From c0e7afde789b0a09b40ef51aeeee3c1435f8cfd2 Mon Sep 17 00:00:00 2001
From: support
Date: Tue, 6 Sep 2022 12:19:58 +0000
Subject: [PATCH] Built motion from commit 990fb85c.|2.6.15
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
package.json | 4 +---
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 +-
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/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/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1204 files changed, 1204 insertions(+), 1206 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 70cb035..b612810 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-08-29T11:56:41.053Z",
+ "time": "2022-09-06T12:11:29.129Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 784284f..a9c8163 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-08-29T11:56:41.053Z",
+ "time": "2022-09-06T12:11:29.129Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/package.json b/package.json
index 3ccea66..6d6dbe7 100644
--- a/package.json
+++ b/package.json
@@ -44,9 +44,7 @@
"prettier:write": "prettier --write './**/*'",
"format-all": "npm run js-beautify && npm run prettier:write",
"test": "mocha server/test --timeout 5000",
- "aux-containers": "docker-compose up -d database cache",
- "db-dump": "docker-compose exec -u root database /xmotion_mysql_bk.sh dump",
- "db-restore": "docker-compose exec -u root database /xmotion_mysql_bk.sh restore"
+ "aux-containers": "docker-compose up -d database cache"
},
"dependencies": {
"@types/express-serve-static-core": "4.17.28",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 4635609..720658a 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 _0xfe43=['sequelize','VIRTUAL','action','STRING','contactManager','integration','jscripty','urlForward','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)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x5d8a4b,_0x273e47){var _0x5f38e=function(_0x51e69e){while(--_0x51e69e){_0x5d8a4b['push'](_0x5d8a4b['shift']());}};_0x5f38e(++_0x273e47);}(_0xfe43,0x120));var _0x3fe4=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0xfe43[_0x46e523];return _0x5da0ee;};'use strict';var Sequelize=require(_0x3fe4('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fe4('0x1')],'get':function(_0x8d4851){return this['getDataValue'](_0x3fe4('0x2'));}},'action':{'type':Sequelize[_0x3fe4('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3fe4('0x4'),_0x3fe4('0x5'),'motionbar',_0x3fe4('0x6'),_0x3fe4('0x7'),'browser',_0x3fe4('0x8'),_0x3fe4('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x3fe4('0xa')},'data1':{'type':Sequelize[_0x3fe4('0x3')](0x1000),'comment':_0x3fe4('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x3fe4('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3fe4('0xd')},'data4':{'type':Sequelize[_0x3fe4('0x3')](0x1000),'comments':_0x3fe4('0xe')},'data5':{'type':Sequelize[_0x3fe4('0x3')](0x1000),'comments':_0x3fe4('0xf')},'data6':{'type':Sequelize[_0x3fe4('0x3')],'comments':_0x3fe4('0x10')},'data7':{'type':Sequelize[_0x3fe4('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xa123=['exports','getDataValue','STRING','contactManager','integration','jscripty','urlForward','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x370a82,_0x1d2de6){var _0x4c4100=function(_0x4c58e1){while(--_0x4c58e1){_0x370a82['push'](_0x370a82['shift']());}};_0x4c4100(++_0x1d2de6);}(_0xa123,0x1c2));var _0x3a12=function(_0x15a05d,_0x5c3a8f){_0x15a05d=_0x15a05d-0x0;var _0x33fe3f=_0xa123[_0x15a05d];return _0x33fe3f;};'use strict';var Sequelize=require('sequelize');module[_0x3a12('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x165f48){return this[_0x3a12('0x1')]('action');}},'action':{'type':Sequelize[_0x3a12('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3a12('0x3'),_0x3a12('0x4'),'motionbar',_0x3a12('0x5'),_0x3a12('0x6'),'browser',_0x3a12('0x7'),_0x3a12('0x8')]],'msg':_0x3a12('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x3a12('0x2')](0x1000),'comment':_0x3a12('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x3a12('0x2')](0x1000),'comments':_0x3a12('0xb')},'data5':{'type':Sequelize[_0x3a12('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x3a12('0x2')],'comments':_0x3a12('0xc')},'data7':{'type':Sequelize[_0x3a12('0xd')],'comments':_0x3a12('0xe')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index b0fe355..e6c0628 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 _0xdab4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','limit','offset','count','Content-Range','json','apply','save','update','then','destroy','stack','name','body','Action','find','params','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4fb167,_0x1b3e51){var _0x2d4b4b=function(_0x3bbe33){while(--_0x3bbe33){_0x4fb167['push'](_0x4fb167['shift']());}};_0x2d4b4b(++_0x1b3e51);}(_0xdab4,0xd4));var _0x4dab=function(_0x511995,_0x5d83a7){_0x511995=_0x511995-0x0;var _0x3f47f3=_0xdab4[_0x511995];return _0x3f47f3;};'use strict';var emlformat=require(_0x4dab('0x0'));var rimraf=require(_0x4dab('0x1'));var zipdir=require(_0x4dab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4dab('0x3'));var moment=require(_0x4dab('0x4'));var BPromise=require(_0x4dab('0x5'));var Mustache=require(_0x4dab('0x6'));var util=require(_0x4dab('0x7'));var path=require(_0x4dab('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4dab('0x9'));var fs=require('fs');var fs_extra=require(_0x4dab('0xa'));var _=require(_0x4dab('0xb'));var squel=require(_0x4dab('0xc'));var crypto=require(_0x4dab('0xd'));var jsforce=require(_0x4dab('0xe'));var deskjs=require(_0x4dab('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4dab('0x10'));var Papa=require(_0x4dab('0x11'));var Redis=require(_0x4dab('0x12'));var authService=require(_0x4dab('0x13'));var qs=require(_0x4dab('0x14'));var as=require(_0x4dab('0x15'));var hardwareService=require(_0x4dab('0x16'));var logger=require(_0x4dab('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4dab('0x18'));var licenseUtil=require(_0x4dab('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37943a,_0x352ddd){_0x352ddd=_0x352ddd||0xcc;return function(_0x520d88){if(_0x520d88){return _0x37943a[_0x4dab('0x1a')](_0x352ddd);}return _0x37943a[_0x4dab('0x1b')](_0x352ddd)[_0x4dab('0x1c')]();};}function respondWithResult(_0x6d90d5,_0x3530f7){_0x3530f7=_0x3530f7||0xc8;return function(_0xa37338){if(_0xa37338){return _0x6d90d5[_0x4dab('0x1b')](_0x3530f7)['json'](_0xa37338);}};}function respondWithFilteredResult(_0x227df9,_0x30fb15){return function(_0x7a5beb){if(_0x7a5beb){var _0x4fa4a2=typeof _0x30fb15['offset']==='undefined'&&typeof _0x30fb15[_0x4dab('0x1d')]==='undefined';var _0x4f1fae=_0x7a5beb['count'];var _0x3322d2=_0x4fa4a2?0x0:_0x30fb15[_0x4dab('0x1e')];var _0x4c760c=_0x4fa4a2?_0x7a5beb[_0x4dab('0x1f')]:_0x30fb15[_0x4dab('0x1e')]+_0x30fb15[_0x4dab('0x1d')];var _0x4cf864;if(_0x4c760c>=_0x4f1fae){_0x4c760c=_0x4f1fae;_0x4cf864=0xc8;}else{_0x4cf864=0xce;}_0x227df9[_0x4dab('0x1b')](_0x4cf864);return _0x227df9['set'](_0x4dab('0x20'),_0x3322d2+'-'+_0x4c760c+'/'+_0x4f1fae)[_0x4dab('0x21')](_0x7a5beb);}return null;};}function patchUpdates(_0x52b885){return function(_0x173cfd){try{jsonpatch[_0x4dab('0x22')](_0x173cfd,_0x52b885,!![]);}catch(_0x1ed8bf){return BPromise['reject'](_0x1ed8bf);}return _0x173cfd[_0x4dab('0x23')]();};}function saveUpdates(_0x27bfce,_0x35c8e9){return function(_0x55f7e8){if(_0x55f7e8){return _0x55f7e8[_0x4dab('0x24')](_0x27bfce)[_0x4dab('0x25')](function(_0x2a8e08){return _0x2a8e08;});}return null;};}function removeEntity(_0x5edc23,_0x23f8be){return function(_0x426202){if(_0x426202){return _0x426202[_0x4dab('0x26')]()[_0x4dab('0x25')](function(){_0x5edc23[_0x4dab('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3911cf,_0x3af25b){return function(_0x58765f){if(!_0x58765f){_0x3911cf[_0x4dab('0x1a')](0x194);}return _0x58765f;};}function handleError(_0x496ae7,_0x31ea7f){_0x31ea7f=_0x31ea7f||0x1f4;return function(_0xb2e5d){logger['error'](_0xb2e5d[_0x4dab('0x27')]);if(_0xb2e5d[_0x4dab('0x28')]){delete _0xb2e5d['name'];}_0x496ae7['status'](_0x31ea7f)['send'](_0xb2e5d);};}exports[_0x4dab('0x24')]=function(_0x5d2f2e,_0x51ca9d){if(_0x5d2f2e[_0x4dab('0x29')]['id']){delete _0x5d2f2e[_0x4dab('0x29')]['id'];}return db[_0x4dab('0x2a')][_0x4dab('0x2b')]({'where':{'id':_0x5d2f2e[_0x4dab('0x2c')]['id']}})['then'](handleEntityNotFound(_0x51ca9d,null))['then'](saveUpdates(_0x5d2f2e[_0x4dab('0x29')],null))['then'](respondWithResult(_0x51ca9d,null))[_0x4dab('0x2d')](handleError(_0x51ca9d,null));};exports[_0x4dab('0x26')]=function(_0x2b5b3a,_0x2d928c){return db['Action'][_0x4dab('0x2b')]({'where':{'id':_0x2b5b3a[_0x4dab('0x2c')]['id']}})[_0x4dab('0x25')](handleEntityNotFound(_0x2d928c,null))[_0x4dab('0x25')](removeEntity(_0x2d928c,null))['catch'](handleError(_0x2d928c,null));};
\ No newline at end of file
+var _0x2398=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','find','params','catch','Action','request-promise','moment','bluebird','mustache','util'];(function(_0x459a2d,_0x48d0db){var _0x44a5ba=function(_0x3864ba){while(--_0x3864ba){_0x459a2d['push'](_0x459a2d['shift']());}};_0x44a5ba(++_0x48d0db);}(_0x2398,0x136));var _0x8239=function(_0xe7f722,_0x3aa747){_0xe7f722=_0xe7f722-0x0;var _0x41b750=_0x2398[_0xe7f722];return _0x41b750;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8239('0x0'));var moment=require(_0x8239('0x1'));var BPromise=require(_0x8239('0x2'));var Mustache=require(_0x8239('0x3'));var util=require(_0x8239('0x4'));var path=require(_0x8239('0x5'));var sox=require(_0x8239('0x6'));var csv=require(_0x8239('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8239('0x8'));var _=require(_0x8239('0x9'));var squel=require(_0x8239('0xa'));var crypto=require(_0x8239('0xb'));var jsforce=require(_0x8239('0xc'));var deskjs=require(_0x8239('0xd'));var toCsv=require(_0x8239('0x7'));var querystring=require(_0x8239('0xe'));var Papa=require('papaparse');var Redis=require(_0x8239('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8239('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8239('0x11'))(_0x8239('0x12'));var utils=require(_0x8239('0x13'));var config=require(_0x8239('0x14'));var licenseUtil=require(_0x8239('0x15'));var db=require(_0x8239('0x16'))['db'];function respondWithStatusCode(_0x2b58bc,_0x2ca0c2){_0x2ca0c2=_0x2ca0c2||0xcc;return function(_0x1958b1){if(_0x1958b1){return _0x2b58bc[_0x8239('0x17')](_0x2ca0c2);}return _0x2b58bc[_0x8239('0x18')](_0x2ca0c2)['end']();};}function respondWithResult(_0x92b464,_0x40237f){_0x40237f=_0x40237f||0xc8;return function(_0x3a4cf9){if(_0x3a4cf9){return _0x92b464[_0x8239('0x18')](_0x40237f)['json'](_0x3a4cf9);}};}function respondWithFilteredResult(_0x2f110b,_0x5cd316){return function(_0x7c5f76){if(_0x7c5f76){var _0x461cde=typeof _0x5cd316['offset']===_0x8239('0x19')&&typeof _0x5cd316[_0x8239('0x1a')]===_0x8239('0x19');var _0x3f7a97=_0x7c5f76[_0x8239('0x1b')];var _0xc75a95=_0x461cde?0x0:_0x5cd316[_0x8239('0x1c')];var _0x22a2a7=_0x461cde?_0x7c5f76[_0x8239('0x1b')]:_0x5cd316['offset']+_0x5cd316['limit'];var _0x34bc88;if(_0x22a2a7>=_0x3f7a97){_0x22a2a7=_0x3f7a97;_0x34bc88=0xc8;}else{_0x34bc88=0xce;}_0x2f110b[_0x8239('0x18')](_0x34bc88);return _0x2f110b[_0x8239('0x1d')](_0x8239('0x1e'),_0xc75a95+'-'+_0x22a2a7+'/'+_0x3f7a97)[_0x8239('0x1f')](_0x7c5f76);}return null;};}function patchUpdates(_0x584e1e){return function(_0x594ceb){try{jsonpatch['apply'](_0x594ceb,_0x584e1e,!![]);}catch(_0x22a5dd){return BPromise[_0x8239('0x20')](_0x22a5dd);}return _0x594ceb[_0x8239('0x21')]();};}function saveUpdates(_0x57ec27,_0x228a17){return function(_0x1b2cbd){if(_0x1b2cbd){return _0x1b2cbd[_0x8239('0x22')](_0x57ec27)[_0x8239('0x23')](function(_0x31ffb6){return _0x31ffb6;});}return null;};}function removeEntity(_0x55288c,_0x4d0ade){return function(_0x5210ff){if(_0x5210ff){return _0x5210ff[_0x8239('0x24')]()['then'](function(){_0x55288c['status'](0xcc)[_0x8239('0x25')]();});}};}function handleEntityNotFound(_0x590628,_0x3c1179){return function(_0x4c2aa7){if(!_0x4c2aa7){_0x590628['sendStatus'](0x194);}return _0x4c2aa7;};}function handleError(_0x6a0f7,_0x1da5f8){_0x1da5f8=_0x1da5f8||0x1f4;return function(_0x4ecaf4){logger[_0x8239('0x26')](_0x4ecaf4['stack']);if(_0x4ecaf4[_0x8239('0x27')]){delete _0x4ecaf4[_0x8239('0x27')];}_0x6a0f7[_0x8239('0x18')](_0x1da5f8)[_0x8239('0x28')](_0x4ecaf4);};}exports[_0x8239('0x22')]=function(_0x3aef8c,_0x2776bb){if(_0x3aef8c['body']['id']){delete _0x3aef8c['body']['id'];}return db['Action'][_0x8239('0x29')]({'where':{'id':_0x3aef8c[_0x8239('0x2a')]['id']}})[_0x8239('0x23')](handleEntityNotFound(_0x2776bb,null))[_0x8239('0x23')](saveUpdates(_0x3aef8c['body'],null))['then'](respondWithResult(_0x2776bb,null))[_0x8239('0x2b')](handleError(_0x2776bb,null));};exports[_0x8239('0x24')]=function(_0x202bce,_0x4d3ab0){return db[_0x8239('0x2c')][_0x8239('0x29')]({'where':{'id':_0x202bce[_0x8239('0x2a')]['id']}})[_0x8239('0x23')](handleEntityNotFound(_0x4d3ab0,null))['then'](removeEntity(_0x4d3ab0,null))['catch'](handleError(_0x4d3ab0,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index d6c2b86..51d4d15 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 _0x826b=['moment','request-promise','path','../../config/environment','Action','../../config/logger','api'];(function(_0x545dbb,_0x3f05ff){var _0x1ec731=function(_0x38d28c){while(--_0x38d28c){_0x545dbb['push'](_0x545dbb['shift']());}};_0x1ec731(++_0x3f05ff);}(_0x826b,0x139));var _0xb826=function(_0x3c3069,_0x56c3bc){_0x3c3069=_0x3c3069-0x0;var _0x3e3b0f=_0x826b[_0x3c3069];return _0x3e3b0f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb826('0x0'))(_0xb826('0x1'));var moment=require(_0xb826('0x2'));var BPromise=require('bluebird');var rp=require(_0xb826('0x3'));var fs=require('fs');var path=require(_0xb826('0x4'));var rimraf=require('rimraf');var config=require(_0xb826('0x5'));var attributes=require('./action.attributes');module['exports']=function(_0x12fdec,_0x1a6d93){return _0x12fdec['define'](_0xb826('0x6'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa862=['request-promise','rimraf','./action.attributes','exports','define','Action','lodash','util','api','moment','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa862,0x95));var _0x2a86=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0xa862[_0x25a42a];return _0x1129b1;};'use strict';var _=require(_0x2a86('0x0'));var util=require(_0x2a86('0x1'));var logger=require('../../config/logger')(_0x2a86('0x2'));var moment=require(_0x2a86('0x3'));var BPromise=require(_0x2a86('0x4'));var rp=require(_0x2a86('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a86('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a86('0x7'));module[_0x2a86('0x8')]=function(_0x3cf4bc,_0x182942){return _0x3cf4bc[_0x2a86('0x9')](_0x2a86('0xa'),attributes,{'tableName':'tools_actions','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 657a157..910822c 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4ea071,_0x29a80a){var _0x18c5a1=function(_0xb0f20f){while(--_0xb0f20f){_0x4ea071['push'](_0x4ea071['shift']());}};_0x18c5a1(++_0x29a80a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5968a5,_0x1b4179){var _0x10dabc=function(_0x54c04a){while(--_0x54c04a){_0x5968a5['push'](_0x5968a5['shift']());}};_0x10dabc(++_0x1b4179);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x5fc3[_0x3aaf0a];return _0x33e6bc;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 64dde49..ca3e950 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 _0xdfc6=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','put','/:id','isAuthenticated'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xdfc6,0x66));var _0x6dfc=function(_0x355911,_0x163b62){_0x355911=_0x355911-0x0;var _0x2d9d0b=_0xdfc6[_0x355911];return _0x2d9d0b;};'use strict';var multer=require(_0x6dfc('0x0'));var util=require(_0x6dfc('0x1'));var path=require(_0x6dfc('0x2'));var timeout=require(_0x6dfc('0x3'));var express=require('express');var router=express[_0x6dfc('0x4')]();var fs_extra=require(_0x6dfc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6dfc('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x6dfc('0x7')](_0x6dfc('0x8'),auth[_0x6dfc('0x9')](),controller[_0x6dfc('0xa')]);router[_0x6dfc('0xb')](_0x6dfc('0x8'),auth[_0x6dfc('0x9')](),controller[_0x6dfc('0xc')]);module[_0x6dfc('0xd')]=router;
\ No newline at end of file
+var _0x1453=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','delete','destroy','exports'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x1453,0xd0));var _0x3145=function(_0x404715,_0x5b4d86){_0x404715=_0x404715-0x0;var _0x198d48=_0x1453[_0x404715];return _0x198d48;};'use strict';var multer=require(_0x3145('0x0'));var util=require('util');var path=require(_0x3145('0x1'));var timeout=require(_0x3145('0x2'));var express=require('express');var router=express[_0x3145('0x3')]();var fs_extra=require(_0x3145('0x4'));var auth=require(_0x3145('0x5'));var interaction=require(_0x3145('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x3145('0x7')](_0x3145('0x8'),auth[_0x3145('0x9')](),controller['update']);router[_0x3145('0xa')](_0x3145('0x8'),auth[_0x3145('0x9')](),controller[_0x3145('0xb')]);module[_0x3145('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 89fc679..912e308 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 _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x7da7[_0x725b8e];return _0x43ac45;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x58a6e8,_0x4f6603){var _0x35ef3e=function(_0x28e9be){while(--_0x28e9be){_0x58a6e8['push'](_0x58a6e8['shift']());}};_0x35ef3e(++_0x4f6603);}(_0x7217,0x19e));var _0x7721=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7217[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index fbd20d5..04c70ce 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 _0xd3d2=['squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','CustomReports','UserProfileResource','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','show','keys','length','find','catch','create','body','get','user','UserProfileSection','userProfileId','error','params','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','select','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','operator','Please\x20insert\x20at\x20least\x20one\x20field','from','table','metric','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','cdr','endDate','startDate','child_process','../../components/export/','savename','COUNT(*)','QueryTypes','SELECT','runReport','Sequelize','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','fs-extra','lodash'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0xd3d2,0x96));var _0x2d3d=function(_0x4e15cb,_0x42698e){_0x4e15cb=_0x4e15cb-0x0;var _0x259e49=_0xd3d2[_0x4e15cb];return _0x259e49;};'use strict';var emlformat=require(_0x2d3d('0x0'));var rimraf=require(_0x2d3d('0x1'));var zipdir=require(_0x2d3d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2d3d('0x3'));var moment=require('moment');var BPromise=require(_0x2d3d('0x4'));var Mustache=require(_0x2d3d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d3d('0x6'));var fs=require('fs');var fs_extra=require(_0x2d3d('0x7'));var _=require(_0x2d3d('0x8'));var squel=require(_0x2d3d('0x9'));var crypto=require('crypto');var jsforce=require(_0x2d3d('0xa'));var deskjs=require(_0x2d3d('0xb'));var toCsv=require(_0x2d3d('0xc'));var querystring=require(_0x2d3d('0xd'));var Papa=require(_0x2d3d('0xe'));var Redis=require(_0x2d3d('0xf'));var authService=require(_0x2d3d('0x10'));var qs=require(_0x2d3d('0x11'));var as=require(_0x2d3d('0x12'));var hardwareService=require(_0x2d3d('0x13'));var logger=require(_0x2d3d('0x14'))(_0x2d3d('0x15'));var utils=require(_0x2d3d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2d3d('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2d3d('0x18'))[_0x2d3d('0x19')];function respondWithStatusCode(_0x2b8bad,_0x20d2ef){_0x20d2ef=_0x20d2ef||0xcc;return function(_0x522543){if(_0x522543){return _0x2b8bad[_0x2d3d('0x1a')](_0x20d2ef);}return _0x2b8bad['status'](_0x20d2ef)[_0x2d3d('0x1b')]();};}function respondWithResult(_0x2ddb4e,_0x58fee8){_0x58fee8=_0x58fee8||0xc8;return function(_0x449f4a){if(_0x449f4a){return _0x2ddb4e[_0x2d3d('0x1c')](_0x58fee8)[_0x2d3d('0x1d')](_0x449f4a);}};}function respondWithFilteredResult(_0x493b50,_0x741af1){return function(_0x34f6aa){if(_0x34f6aa){var _0x3ebfd9=typeof _0x741af1[_0x2d3d('0x1e')]===_0x2d3d('0x1f')&&typeof _0x741af1[_0x2d3d('0x20')]===_0x2d3d('0x1f');var _0x3918b6=_0x34f6aa[_0x2d3d('0x21')];var _0xcfe9f5=_0x3ebfd9?0x0:_0x741af1[_0x2d3d('0x1e')];var _0x1599b8=_0x3ebfd9?_0x34f6aa[_0x2d3d('0x21')]:_0x741af1[_0x2d3d('0x1e')]+_0x741af1['limit'];var _0x18b7ad;if(_0x1599b8>=_0x3918b6){_0x1599b8=_0x3918b6;_0x18b7ad=0xc8;}else{_0x18b7ad=0xce;}_0x493b50[_0x2d3d('0x1c')](_0x18b7ad);return _0x493b50[_0x2d3d('0x22')]('Content-Range',_0xcfe9f5+'-'+_0x1599b8+'/'+_0x3918b6)[_0x2d3d('0x1d')](_0x34f6aa);}return null;};}function patchUpdates(_0x3ea9b1){return function(_0xd9387d){try{jsonpatch['apply'](_0xd9387d,_0x3ea9b1,!![]);}catch(_0x259006){return BPromise[_0x2d3d('0x23')](_0x259006);}return _0xd9387d[_0x2d3d('0x24')]();};}function saveUpdates(_0x221471,_0x595124){return function(_0x485f36){if(_0x485f36){return _0x485f36[_0x2d3d('0x25')](_0x221471)[_0x2d3d('0x26')](function(_0xb4d89){return _0xb4d89;});}return null;};}function removeEntity(_0x554c0b,_0xe1935e){return function(_0x4e5971){if(_0x4e5971){return _0x4e5971[_0x2d3d('0x27')]()[_0x2d3d('0x26')](function(){var _0x52464d=_0x4e5971['get']({'plain':!![]});var _0x422e38=_0x2d3d('0x28');return db[_0x2d3d('0x29')]['destroy']({'where':{'type':_0x422e38,'resourceId':_0x52464d['id']}})['then'](function(){return _0x4e5971;});})[_0x2d3d('0x26')](function(){_0x554c0b[_0x2d3d('0x1c')](0xcc)[_0x2d3d('0x1b')]();});}};}function handleEntityNotFound(_0x58caa6,_0x39c62c){return function(_0x2882ff){if(!_0x2882ff){_0x58caa6[_0x2d3d('0x1a')](0x194);}return _0x2882ff;};}function handleError(_0x5dd73e,_0x3fc196){_0x3fc196=_0x3fc196||0x1f4;return function(_0x39e192){logger['error'](_0x39e192[_0x2d3d('0x2a')]);if(_0x39e192[_0x2d3d('0x2b')]){delete _0x39e192[_0x2d3d('0x2b')];}_0x5dd73e[_0x2d3d('0x1c')](_0x3fc196)[_0x2d3d('0x2c')](_0x39e192);};}exports[_0x2d3d('0x2d')]=function(_0xb1205e,_0x407c6a){var _0x2217e1={},_0x12ab0c={},_0x46f0f7={'count':0x0,'rows':[]};var _0x24405c=_[_0x2d3d('0x2e')](db['AnalyticCustomReport'][_0x2d3d('0x2f')],function(_0x1ed94b){return{'name':_0x1ed94b['fieldName'],'type':_0x1ed94b[_0x2d3d('0x30')]['key']};});_0x12ab0c[_0x2d3d('0x31')]=_['map'](_0x24405c,_0x2d3d('0x2b'));_0x12ab0c[_0x2d3d('0x32')]=_['keys'](_0xb1205e[_0x2d3d('0x32')]);_0x12ab0c[_0x2d3d('0x33')]=_[_0x2d3d('0x34')](_0x12ab0c[_0x2d3d('0x31')],_0x12ab0c[_0x2d3d('0x32')]);_0x2217e1[_0x2d3d('0x35')]=_['intersection'](_0x12ab0c[_0x2d3d('0x31')],qs[_0x2d3d('0x36')](_0xb1205e[_0x2d3d('0x32')][_0x2d3d('0x36')]));_0x2217e1[_0x2d3d('0x35')]=_0x2217e1[_0x2d3d('0x35')]['length']?_0x2217e1[_0x2d3d('0x35')]:_0x12ab0c['model'];if(!_0xb1205e['query'][_0x2d3d('0x37')](_0x2d3d('0x38'))){_0x2217e1['limit']=qs[_0x2d3d('0x20')](_0xb1205e[_0x2d3d('0x32')][_0x2d3d('0x20')]);_0x2217e1[_0x2d3d('0x1e')]=qs[_0x2d3d('0x1e')](_0xb1205e[_0x2d3d('0x32')][_0x2d3d('0x1e')]);}_0x2217e1[_0x2d3d('0x39')]=qs[_0x2d3d('0x3a')](_0xb1205e[_0x2d3d('0x32')][_0x2d3d('0x3a')]);_0x2217e1[_0x2d3d('0x3b')]=qs['filters'](_[_0x2d3d('0x3c')](_0xb1205e[_0x2d3d('0x32')],_0x12ab0c[_0x2d3d('0x33')]),_0x24405c);if(_0xb1205e[_0x2d3d('0x32')][_0x2d3d('0x3d')]){_0x2217e1[_0x2d3d('0x3b')]=_[_0x2d3d('0x3e')](_0x2217e1['where'],{'$or':_['map'](_0x24405c,function(_0x329801){if(_0x329801[_0x2d3d('0x30')]!==_0x2d3d('0x3f')){var _0x429de6={};_0x429de6[_0x329801[_0x2d3d('0x2b')]]={'$like':'%'+_0xb1205e[_0x2d3d('0x32')][_0x2d3d('0x3d')]+'%'};return _0x429de6;}})});}_0x2217e1=_[_0x2d3d('0x3e')]({},_0x2217e1,_0xb1205e[_0x2d3d('0x40')]);var _0x99466e={'where':_0x2217e1[_0x2d3d('0x3b')]};return db[_0x2d3d('0x41')]['count'](_0x99466e)[_0x2d3d('0x26')](function(_0x471b5c){_0x46f0f7[_0x2d3d('0x21')]=_0x471b5c;if(_0xb1205e[_0x2d3d('0x32')][_0x2d3d('0x42')]){_0x2217e1[_0x2d3d('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x2d3d('0x44')](_0x2217e1);})[_0x2d3d('0x26')](function(_0x2b689a){_0x46f0f7['rows']=_0x2b689a;return _0x46f0f7;})['then'](respondWithFilteredResult(_0x407c6a,_0x2217e1))['catch'](handleError(_0x407c6a,null));};exports[_0x2d3d('0x45')]=function(_0x3d9a69,_0x442b25){var _0x266473={'raw':![],'where':{'id':_0x3d9a69['params']['id']}},_0x4ac194={};_0x4ac194[_0x2d3d('0x31')]=_['keys'](db[_0x2d3d('0x41')][_0x2d3d('0x2f')]);_0x4ac194[_0x2d3d('0x32')]=_[_0x2d3d('0x46')](_0x3d9a69[_0x2d3d('0x32')]);_0x4ac194[_0x2d3d('0x33')]=_[_0x2d3d('0x34')](_0x4ac194[_0x2d3d('0x31')],_0x4ac194['query']);_0x266473[_0x2d3d('0x35')]=_[_0x2d3d('0x34')](_0x4ac194[_0x2d3d('0x31')],qs[_0x2d3d('0x36')](_0x3d9a69[_0x2d3d('0x32')]['fields']));_0x266473[_0x2d3d('0x35')]=_0x266473[_0x2d3d('0x35')][_0x2d3d('0x47')]?_0x266473[_0x2d3d('0x35')]:_0x4ac194[_0x2d3d('0x31')];if(_0x3d9a69[_0x2d3d('0x32')][_0x2d3d('0x42')]){_0x266473[_0x2d3d('0x43')]=[{'all':!![]}];}_0x266473=_['merge']({},_0x266473,_0x3d9a69['options']);return db['AnalyticCustomReport'][_0x2d3d('0x48')](_0x266473)[_0x2d3d('0x26')](handleEntityNotFound(_0x442b25,null))[_0x2d3d('0x26')](respondWithResult(_0x442b25,null))[_0x2d3d('0x49')](handleError(_0x442b25,null));};exports[_0x2d3d('0x4a')]=function(_0x180148,_0x4f1395){return db[_0x2d3d('0x41')][_0x2d3d('0x4a')](_0x180148[_0x2d3d('0x4b')],{})['then'](function(_0x3a66eb){var _0x2271f0=_0x180148['user'][_0x2d3d('0x4c')]({'plain':!![]});if(!_0x2271f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2271f0['role']===_0x2d3d('0x4d')){var _0x173227=_0x3a66eb[_0x2d3d('0x4c')]({'plain':!![]});var _0x391fda='Reports';return db[_0x2d3d('0x4e')][_0x2d3d('0x48')]({'where':{'name':_0x391fda,'userProfileId':_0x2271f0[_0x2d3d('0x4f')]},'raw':!![]})[_0x2d3d('0x26')](function(_0x3a2b82){if(_0x3a2b82&&_0x3a2b82['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x173227[_0x2d3d('0x2b')],'resourceId':_0x173227['id'],'type':_0x2d3d('0x28'),'sectionId':_0x3a2b82['id']},{})['then'](function(){return _0x3a66eb;});}else{return _0x3a66eb;}})['catch'](function(_0x4c8c90){logger[_0x2d3d('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c8c90);throw _0x4c8c90;});}return _0x3a66eb;})[_0x2d3d('0x26')](respondWithResult(_0x4f1395,0xc9))[_0x2d3d('0x49')](handleError(_0x4f1395,null));};exports['update']=function(_0x48b150,_0x39bea1){if(_0x48b150[_0x2d3d('0x4b')]['id']){delete _0x48b150['body']['id'];}return db[_0x2d3d('0x41')][_0x2d3d('0x48')]({'where':{'id':_0x48b150['params']['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0x39bea1,null))['then'](saveUpdates(_0x48b150[_0x2d3d('0x4b')],null))[_0x2d3d('0x26')](respondWithResult(_0x39bea1,null))[_0x2d3d('0x49')](handleError(_0x39bea1,null));};exports[_0x2d3d('0x27')]=function(_0x4d9760,_0xa81bfe){return db[_0x2d3d('0x41')][_0x2d3d('0x48')]({'where':{'id':_0x4d9760[_0x2d3d('0x51')]['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0xa81bfe,null))['then'](removeEntity(_0xa81bfe,null))[_0x2d3d('0x49')](handleError(_0xa81bfe,null));};exports[_0x2d3d('0x52')]=function(_0x55ffe4,_0x19a2f9){var _0x3b50de=0xa;var _0x1e1ed6=[_0x2d3d('0x53'),_0x2d3d('0x54'),_0x2d3d('0x55'),_0x2d3d('0x56')];var _0x1c73fe={'SUM':'SUM(%s)','COUNT':_0x2d3d('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2d3d('0x58'),'MIN':_0x2d3d('0x59'),'AVG':_0x2d3d('0x5a'),'GROUP_CONCAT':_0x2d3d('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2d3d('0x5c')};var _0x3da661={'SEC_TO_TIME':_0x2d3d('0x5d'),'DATE':_0x2d3d('0x5e'),'HOUR':_0x2d3d('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x443bad=function(_0x53e970){return!_[_0x2d3d('0x60')]([_0x2d3d('0x61'),'IS\x20NOT\x20NULL',_0x2d3d('0x62'),_0x2d3d('0x63')],_0x53e970);};var _0x34de62=function(_0x4b462e){if(!_0x4b462e||!_0x4b462e['rules'][_0x2d3d('0x47')]){return'';}for(var _0x2d7256='(',_0x19c679=0x0;_0x19c679<_0x4b462e['rules'][_0x2d3d('0x47')];_0x19c679+=0x1){_0x19c679>0x0&&(_0x2d7256+='\x20'+_0x4b462e['operator']+'\x20');_0x2d7256+=_0x4b462e['rules'][_0x19c679]['group']?_0x34de62(_0x4b462e[_0x2d3d('0x64')][_0x19c679][_0x2d3d('0x65')]):_0x4b462e[_0x2d3d('0x64')][_0x19c679][_0x2d3d('0x66')]+'\x20'+_0x4b462e[_0x2d3d('0x64')][_0x19c679][_0x2d3d('0x67')]+(_0x443bad(_0x4b462e[_0x2d3d('0x64')][_0x19c679][_0x2d3d('0x67')])?'\x20'+_0x4b462e[_0x2d3d('0x64')][_0x19c679][_0x2d3d('0x68')]:'');}return _0x2d7256+')';};var _0x592b22={'where':{'id':_0x55ffe4['params']['id']}},_0x4a2319,_0x116c4b,_0x5be8ae,_0x57268d,_0x1b19d6;_0x592b22=_[_0x2d3d('0x3e')]({},_0x592b22,_0x55ffe4[_0x2d3d('0x40')]);return db['AnalyticCustomReport'][_0x2d3d('0x48')](_0x592b22)['then'](function(_0x182a34){if(_0x182a34){_0x4a2319=_0x182a34;return _0x182a34[_0x2d3d('0x69')]();}return null;})[_0x2d3d('0x26')](function(_0x12ed67){if(_0x12ed67){if(!_0x12ed67[_0x2d3d('0x47')]){throw new db['Sequelize'][(_0x2d3d('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x116c4b=_0x12ed67;return db[_0x2d3d('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x2d3d('0x26')](function(_0x4abe76){if(_0x4abe76){_0x5be8ae=_[_0x2d3d('0x6c')](_0x4abe76,'id');var _0x321e7f;var _0x46a175=squel[_0x2d3d('0x6d')]();_0x46a175['from'](_0x4a2319['table']);for(var _0x1620b5=0x0;_0x1620b5<_0x116c4b[_0x2d3d('0x47')];_0x1620b5+=0x1){_0x321e7f=_0x116c4b[_0x1620b5][_0x2d3d('0x6e')]?_0x5be8ae[_0x116c4b[_0x1620b5][_0x2d3d('0x6e')]]['metric']:_0x116c4b[_0x1620b5]['field'];_0x321e7f=_0x116c4b[_0x1620b5][_0x2d3d('0x6f')]?_[_0x2d3d('0x70')](_0x1c73fe[_0x116c4b[_0x1620b5][_0x2d3d('0x6f')]],'%s',_0x321e7f):_0x321e7f;_0x321e7f=_0x116c4b[_0x1620b5][_0x2d3d('0x71')]?_[_0x2d3d('0x70')](_0x3da661[_0x116c4b[_0x1620b5][_0x2d3d('0x71')]],'%s',_0x321e7f):_0x321e7f;if(_0x116c4b[_0x1620b5][_0x2d3d('0x72')]){_0x46a175['group'](_0x321e7f);}_0x116c4b[_0x1620b5][_0x2d3d('0x73')]&&_0x46a175[_0x2d3d('0x39')](_0x321e7f,_0x116c4b[_0x1620b5][_0x2d3d('0x73')]===_0x2d3d('0x74')?![]:!![]);_0x46a175[_0x2d3d('0x66')](_0x321e7f,_0x116c4b[_0x1620b5][_0x2d3d('0x75')]||_0x321e7f);}if(_0x4a2319[_0x2d3d('0x76')]){_0x4a2319[_0x2d3d('0x76')]=JSON[_0x2d3d('0x77')](_0x4a2319[_0x2d3d('0x76')]);for(var _0x1ee869=0x0;_0x1ee869<_0x4a2319['joins']['length'];_0x1ee869+=0x1){if(_0x4a2319['joins'][_0x1ee869][_0x2d3d('0x30')]&&_[_0x2d3d('0x60')](_0x1e1ed6,_0x4a2319['joins'][_0x1ee869]['type'])&&_0x4a2319[_0x2d3d('0x76')][_0x1ee869][_0x2d3d('0x78')]&&_0x4a2319['joins'][_0x1ee869][_0x2d3d('0x79')]&&_0x4a2319[_0x2d3d('0x76')][_0x1ee869][_0x2d3d('0x7a')]){_0x46a175[_0x4a2319[_0x2d3d('0x76')][_0x1ee869]['type']](_0x4a2319[_0x2d3d('0x76')][_0x1ee869][_0x2d3d('0x79')],null,util[_0x2d3d('0x71')](_0x2d3d('0x7b'),_0x4a2319['table'],_0x4a2319[_0x2d3d('0x76')][_0x1ee869][_0x2d3d('0x78')],_0x4a2319[_0x2d3d('0x76')][_0x1ee869][_0x2d3d('0x79')],_0x4a2319[_0x2d3d('0x76')][_0x1ee869][_0x2d3d('0x7a')]));}}}if(_0x4a2319[_0x2d3d('0x7c')]){_0x4a2319[_0x2d3d('0x7c')]=JSON[_0x2d3d('0x77')](_0x4a2319[_0x2d3d('0x7c')]);_0x46a175[_0x2d3d('0x3b')](_0x34de62(_0x4a2319[_0x2d3d('0x7c')][_0x2d3d('0x65')]));}_0x1b19d6=_0x46a175[_0x2d3d('0x7d')]();_0x46a175[_0x2d3d('0x20')](_0x3b50de);_0x46a175[_0x2d3d('0x1e')](0x0);logger[_0x2d3d('0x7e')](_0x2d3d('0x7f'),_0x46a175[_0x2d3d('0x80')]());return dbH[_0x2d3d('0x81')][_0x2d3d('0x32')](_0x46a175['toString'](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x2d3d('0x26')](respondWithResult(_0x19a2f9,null))[_0x2d3d('0x49')](handleError(_0x19a2f9,null));};function runReport(_0x5b1f02,_0x1c13a7,_0x2a460c){var _0x569ea9=_0x1c13a7['name'];var _0x21697e=0xa;var _0x1868e2=[_0x2d3d('0x53'),'left_join',_0x2d3d('0x55'),'cross_join'];var _0x4d365d={'SUM':_0x2d3d('0x82'),'COUNT':_0x2d3d('0x57'),'COUNT DISTINCT':_0x2d3d('0x83'),'MAX':'MAX(%s)','MIN':_0x2d3d('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2d3d('0x5b'),'GROUP_CONCAT ASC':_0x2d3d('0x84'),'GROUP_CONCAT DESC':_0x2d3d('0x5c')};var _0x252fba={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2d3d('0x5e'),'HOUR':_0x2d3d('0x5f'),'ROUND':_0x2d3d('0x85'),'UNIX_TIMESTAMP':_0x2d3d('0x86')};var _0x583e58=function(_0x4be4d4){return!_[_0x2d3d('0x60')]([_0x2d3d('0x61'),_0x2d3d('0x87'),'IS\x20EMPTY',_0x2d3d('0x63')],_0x4be4d4);};var _0x5c2a3d=function(_0x440514){if(!_0x440514||!_0x440514[_0x2d3d('0x64')][_0x2d3d('0x47')]){return'';}for(var _0x3f4ce2='(',_0x53902b=0x0;_0x53902b<_0x440514[_0x2d3d('0x64')]['length'];_0x53902b+=0x1){_0x53902b>0x0&&(_0x3f4ce2+='\x20'+_0x440514[_0x2d3d('0x88')]+'\x20');_0x3f4ce2+=_0x440514[_0x2d3d('0x64')][_0x53902b]['group']?_0x5c2a3d(_0x440514[_0x2d3d('0x64')][_0x53902b][_0x2d3d('0x65')]):_0x440514[_0x2d3d('0x64')][_0x53902b][_0x2d3d('0x66')]+'\x20'+_0x440514['rules'][_0x53902b][_0x2d3d('0x67')]+(_0x583e58(_0x440514[_0x2d3d('0x64')][_0x53902b][_0x2d3d('0x67')])?'\x20'+_0x440514['rules'][_0x53902b]['value']:'');}return _0x3f4ce2+')';};var _0x2a1daf={'where':{'id':_0x5b1f02['id']}},_0x5ec638,_0x3a52f5,_0xc87738,_0x3d3c05,_0x44c89f;_0x2a1daf=_[_0x2d3d('0x3e')]({},_0x2a1daf,_0x2a460c);return db[_0x2d3d('0x41')][_0x2d3d('0x48')](_0x2a1daf)[_0x2d3d('0x26')](function(_0x47cc52){if(_0x47cc52){_0x5ec638=_0x47cc52;return _0x47cc52['getFields']();}return null;})[_0x2d3d('0x26')](function(_0x1cd47f){if(_0x1cd47f){if(!_0x1cd47f[_0x2d3d('0x47')]){throw new db['Sequelize']['ValidationErrorItem'](_0x2d3d('0x89'),0x193);}_0x3a52f5=_0x1cd47f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x302dfa){if(_0x302dfa){_0xc87738=_[_0x2d3d('0x6c')](_0x302dfa,'id');var _0x4fe206;var _0x46ff71=squel[_0x2d3d('0x6d')]();_0x46ff71[_0x2d3d('0x8a')](_0x5ec638[_0x2d3d('0x8b')]);for(var _0x52d008=0x0;_0x52d008<_0x3a52f5['length'];_0x52d008+=0x1){_0x4fe206=_0x3a52f5[_0x52d008][_0x2d3d('0x6e')]?_0xc87738[_0x3a52f5[_0x52d008][_0x2d3d('0x6e')]][_0x2d3d('0x8c')]:_0x3a52f5[_0x52d008][_0x2d3d('0x66')];_0x4fe206=_0x3a52f5[_0x52d008][_0x2d3d('0x6f')]?_['replace'](_0x4d365d[_0x3a52f5[_0x52d008][_0x2d3d('0x6f')]],'%s',_0x4fe206):_0x4fe206;_0x4fe206=_0x3a52f5[_0x52d008][_0x2d3d('0x71')]?_[_0x2d3d('0x70')](_0x252fba[_0x3a52f5[_0x52d008][_0x2d3d('0x71')]],'%s',_0x4fe206):_0x4fe206;if(_0x3a52f5[_0x52d008][_0x2d3d('0x72')]){_0x46ff71['group'](_0x4fe206);}_0x3a52f5[_0x52d008][_0x2d3d('0x73')]&&_0x46ff71[_0x2d3d('0x39')](_0x4fe206,_0x3a52f5[_0x52d008]['orderBy']===_0x2d3d('0x74')?![]:!![]);_0x46ff71[_0x2d3d('0x66')](_0x4fe206,_0x3a52f5[_0x52d008]['alias']||_0x4fe206);}if(_0x5ec638[_0x2d3d('0x76')]){_0x5ec638['joins']=JSON[_0x2d3d('0x77')](_0x5ec638[_0x2d3d('0x76')]);for(var _0x2ff96f=0x0;_0x2ff96f<_0x5ec638[_0x2d3d('0x76')][_0x2d3d('0x47')];_0x2ff96f+=0x1){if(_0x5ec638['joins'][_0x2ff96f][_0x2d3d('0x30')]&&_[_0x2d3d('0x60')](_0x1868e2,_0x5ec638[_0x2d3d('0x76')][_0x2ff96f][_0x2d3d('0x30')])&&_0x5ec638[_0x2d3d('0x76')][_0x2ff96f][_0x2d3d('0x78')]&&_0x5ec638[_0x2d3d('0x76')][_0x2ff96f][_0x2d3d('0x79')]&&_0x5ec638[_0x2d3d('0x76')][_0x2ff96f]['foreignKey']){_0x46ff71[_0x5ec638['joins'][_0x2ff96f]['type']](_0x5ec638[_0x2d3d('0x76')][_0x2ff96f][_0x2d3d('0x79')],null,util[_0x2d3d('0x71')](_0x2d3d('0x7b'),_0x5ec638[_0x2d3d('0x8b')],_0x5ec638['joins'][_0x2ff96f][_0x2d3d('0x78')],_0x5ec638[_0x2d3d('0x76')][_0x2ff96f]['foreignTable'],_0x5ec638['joins'][_0x2ff96f][_0x2d3d('0x7a')]));}}}if(_0x5ec638[_0x2d3d('0x7c')]){_0x5ec638[_0x2d3d('0x7c')]=JSON[_0x2d3d('0x77')](_0x5ec638[_0x2d3d('0x7c')]);_0x46ff71['where'](_0x5c2a3d(_0x5ec638[_0x2d3d('0x7c')][_0x2d3d('0x65')]));}_0x44c89f=_0x46ff71[_0x2d3d('0x7d')]();_0x46ff71['limit'](_0x21697e);_0x46ff71[_0x2d3d('0x1e')](0x0);return;}})['then'](function(){if(_0x1c13a7[_0x2d3d('0x8d')]===_0x2d3d('0x8e')){return null;}var _0x2e0d08=_[_0x2d3d('0x3e')](_0x1c13a7,{'name':_0x1c13a7[_0x2d3d('0x8f')]||_0x1c13a7['name']||_0x5ec638[_0x2d3d('0x2b')],'basename':_0x569ea9,'savename':util[_0x2d3d('0x71')](_0x2d3d('0x90'),_0x1c13a7[_0x2d3d('0x2b')]||_0x5ec638[_0x2d3d('0x2b')],require(_0x2d3d('0x91'))['generate'](0x4),_0x1c13a7[_0x2d3d('0x8d')]||_0x2d3d('0x92')),'reportId':_0x5ec638['id'],'reportType':_0x2d3d('0x93')});return db['AnalyticExtractedReport'][_0x2d3d('0x4a')](_0x2e0d08,{'raw':!![]});})[_0x2d3d('0x26')](function(_0xe966d){if(_0x5ec638['table']===_0x2d3d('0x94')){_0x44c89f[_0x2d3d('0x3b')](_0x5ec638['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1c13a7['startDate'],_0x1c13a7[_0x2d3d('0x95')]);}else{_0x44c89f[_0x2d3d('0x3b')](_0x5ec638[_0x2d3d('0x8b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1c13a7[_0x2d3d('0x96')],_0x1c13a7[_0x2d3d('0x95')]);}if(_0xe966d){logger['info']('Run\x20Query:',_0x44c89f[_0x2d3d('0x80')]());require(_0x2d3d('0x97'))['fork'](path[_0x2d3d('0x53')](__dirname,_0x2d3d('0x98'),_0xe966d['output']),[_0xe966d['id'],_0x44c89f[_0x2d3d('0x80')](),path[_0x2d3d('0x53')](__dirname,'../../files/reports',_0xe966d[_0x2d3d('0x99')]),_0x569ea9]);return _0xe966d;}else{var _0x4bbe8a=squel[_0x2d3d('0x6d')]();_0x4bbe8a[_0x2d3d('0x8a')]('('+_0x44c89f['toString']()+')','countTable');_0x4bbe8a[_0x2d3d('0x66')](_0x2d3d('0x9a'),_0x2d3d('0x21'));_0x44c89f[_0x2d3d('0x20')](_0x1c13a7['limit']||_0x21697e);_0x44c89f[_0x2d3d('0x1e')](_0x1c13a7[_0x2d3d('0x1e')]||0x0);return dbH[_0x2d3d('0x81')][_0x2d3d('0x32')](_0x4bbe8a[_0x2d3d('0x80')](),{'type':dbH['sequelize'][_0x2d3d('0x9b')][_0x2d3d('0x9c')]})['then'](function(_0x41a399){if(!_0x41a399[_0x2d3d('0x47')]){_0x3d3c05=0x0;}else{_0x3d3c05=_0x41a399[0x0]['count']||0x0;}return dbH[_0x2d3d('0x81')][_0x2d3d('0x32')](_0x44c89f[_0x2d3d('0x80')](),{'type':dbH[_0x2d3d('0x81')][_0x2d3d('0x9b')]['SELECT']});})['then'](function(_0x4f7965){return{'rows':_0x4f7965||[],'count':_0x3d3c05};});}});}exports['run']=function(_0x8660f0,_0x2e8078){return runReport(_0x8660f0['params'],_0x8660f0['query'],_0x8660f0[_0x2d3d('0x40')])['then'](respondWithResult(_0x2e8078,null))['catch'](handleError(_0x2e8078,null));};exports[_0x2d3d('0x9d')]=runReport;exports[_0x2d3d('0x32')]=function(_0x5cfeb6,_0x31fd56){var _0x2b1fdc=0xa;var _0x124563=[_0x2d3d('0x53'),'left_join',_0x2d3d('0x55'),_0x2d3d('0x56')];var _0x2a3e4b={'SUM':_0x2d3d('0x82'),'COUNT':_0x2d3d('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2d3d('0x58'),'MIN':'MIN(%s)','AVG':_0x2d3d('0x5a'),'GROUP_CONCAT':_0x2d3d('0x5b'),'GROUP_CONCAT ASC':_0x2d3d('0x84'),'GROUP_CONCAT DESC':_0x2d3d('0x5c')};var _0x2b7e12={'SEC_TO_TIME':_0x2d3d('0x5d'),'DATE':_0x2d3d('0x5e'),'HOUR':_0x2d3d('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4019c1=function(_0x244fc5){return!_['includes']([_0x2d3d('0x61'),_0x2d3d('0x87'),'IS\x20EMPTY',_0x2d3d('0x63')],_0x244fc5);};var _0x599093=function(_0x2d5236){if(!_0x2d5236||!_0x2d5236[_0x2d3d('0x64')]['length']){return'';}for(var _0x556378='(',_0x4b59d0=0x0;_0x4b59d0<_0x2d5236['rules'][_0x2d3d('0x47')];_0x4b59d0+=0x1){_0x4b59d0>0x0&&(_0x556378+='\x20'+_0x2d5236['operator']+'\x20');_0x556378+=_0x2d5236['rules'][_0x4b59d0][_0x2d3d('0x65')]?_0x599093(_0x2d5236['rules'][_0x4b59d0]['group']):_0x2d5236[_0x2d3d('0x64')][_0x4b59d0][_0x2d3d('0x66')]+'\x20'+_0x2d5236[_0x2d3d('0x64')][_0x4b59d0][_0x2d3d('0x67')]+(_0x4019c1(_0x2d5236[_0x2d3d('0x64')][_0x4b59d0][_0x2d3d('0x67')])?'\x20'+_0x2d5236['rules'][_0x4b59d0]['value']:'');}return _0x556378+')';};var _0x4ca924={'where':{'id':_0x5cfeb6[_0x2d3d('0x51')]['id']}},_0x108646,_0x2497f4,_0x16be3f,_0x3d7853,_0x3bab4b;_0x4ca924=_[_0x2d3d('0x3e')]({},_0x4ca924,_0x5cfeb6[_0x2d3d('0x40')]);return db[_0x2d3d('0x41')]['find'](_0x4ca924)[_0x2d3d('0x26')](function(_0x3bb903){if(_0x3bb903){_0x108646=_0x3bb903;return _0x3bb903[_0x2d3d('0x69')]();}return null;})[_0x2d3d('0x26')](function(_0x2bb560){if(_0x2bb560){if(!_0x2bb560[_0x2d3d('0x47')]){throw new db[(_0x2d3d('0x9e'))][(_0x2d3d('0x6a'))](_0x2d3d('0x89'),0x193);}_0x2497f4=_0x2bb560;return db[_0x2d3d('0x6b')][_0x2d3d('0x44')]({'raw':!![]});}return null;})[_0x2d3d('0x26')](function(_0x123d80){if(_0x123d80){_0x16be3f=_[_0x2d3d('0x6c')](_0x123d80,'id');var _0x409073;var _0x5686f0=squel[_0x2d3d('0x6d')]();_0x5686f0['from'](_0x108646['table']);for(var _0x54d064=0x0;_0x54d064<_0x2497f4[_0x2d3d('0x47')];_0x54d064+=0x1){_0x409073=_0x2497f4[_0x54d064]['MetricId']?_0x16be3f[_0x2497f4[_0x54d064][_0x2d3d('0x6e')]][_0x2d3d('0x8c')]:_0x2497f4[_0x54d064][_0x2d3d('0x66')];_0x409073=_0x2497f4[_0x54d064][_0x2d3d('0x6f')]?_['replace'](_0x2a3e4b[_0x2497f4[_0x54d064][_0x2d3d('0x6f')]],'%s',_0x409073):_0x409073;_0x409073=_0x2497f4[_0x54d064][_0x2d3d('0x71')]?_['replace'](_0x2b7e12[_0x2497f4[_0x54d064]['format']],'%s',_0x409073):_0x409073;if(_0x2497f4[_0x54d064]['groupBy']){_0x5686f0[_0x2d3d('0x65')](_0x409073);}_0x2497f4[_0x54d064][_0x2d3d('0x73')]&&_0x5686f0[_0x2d3d('0x39')](_0x409073,_0x2497f4[_0x54d064][_0x2d3d('0x73')]==='DESC'?![]:!![]);_0x5686f0[_0x2d3d('0x66')](_0x409073,_0x2497f4[_0x54d064][_0x2d3d('0x75')]||_0x409073);}if(_0x108646[_0x2d3d('0x76')]){_0x108646['joins']=JSON['parse'](_0x108646[_0x2d3d('0x76')]);for(var _0x20dfb2=0x0;_0x20dfb2<_0x108646[_0x2d3d('0x76')][_0x2d3d('0x47')];_0x20dfb2+=0x1){if(_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x30')]&&_[_0x2d3d('0x60')](_0x124563,_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x30')])&&_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x78')]&&_0x108646['joins'][_0x20dfb2][_0x2d3d('0x79')]&&_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x7a')]){_0x5686f0[_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x30')]](_0x108646['joins'][_0x20dfb2][_0x2d3d('0x79')],null,util[_0x2d3d('0x71')](_0x2d3d('0x7b'),_0x108646[_0x2d3d('0x8b')],_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x78')],_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x79')],_0x108646[_0x2d3d('0x76')][_0x20dfb2][_0x2d3d('0x7a')]));}}}if(_0x108646[_0x2d3d('0x7c')]){_0x108646[_0x2d3d('0x7c')]=JSON[_0x2d3d('0x77')](_0x108646['conditions']);_0x5686f0[_0x2d3d('0x3b')](_0x599093(_0x108646[_0x2d3d('0x7c')][_0x2d3d('0x65')]));}_0x3bab4b=_0x5686f0['clone']();_0x5686f0['limit'](_0x2b1fdc);_0x5686f0['offset'](0x0);logger[_0x2d3d('0x7e')](_0x2d3d('0x7f'),_0x5686f0[_0x2d3d('0x80')]());return dbH[_0x2d3d('0x81')][_0x2d3d('0x32')](_0x5686f0[_0x2d3d('0x80')](),{'type':dbH[_0x2d3d('0x81')][_0x2d3d('0x9b')]['SELECT']});}})[_0x2d3d('0x26')](function(){return{'sql':_0x3bab4b[_0x2d3d('0x80')]()};})[_0x2d3d('0x26')](respondWithResult(_0x31fd56,null))[_0x2d3d('0x49')](handleError(_0x31fd56,null));};
\ No newline at end of file
+var _0x5244=['options','includeAll','include','rows','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','body','params','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','AVG(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../components/export/','savename','countTable','COUNT(*)','run','ROUND(%s)','IS\x20EMPTY','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','send','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x58256e,_0x48f062){var _0xc9e57b=function(_0x32fb7b){while(--_0x32fb7b){_0x58256e['push'](_0x58256e['shift']());}};_0xc9e57b(++_0x48f062);}(_0x5244,0x1a2));var _0x4524=function(_0x2de602,_0x2157a8){_0x2de602=_0x2de602-0x0;var _0x48514a=_0x5244[_0x2de602];return _0x48514a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4524('0x0'));var zipdir=require(_0x4524('0x1'));var jsonpatch=require(_0x4524('0x2'));var rp=require('request-promise');var moment=require(_0x4524('0x3'));var BPromise=require(_0x4524('0x4'));var Mustache=require(_0x4524('0x5'));var util=require(_0x4524('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4524('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4524('0x8'));var _=require(_0x4524('0x9'));var squel=require(_0x4524('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4524('0x7'));var querystring=require(_0x4524('0xb'));var Papa=require(_0x4524('0xc'));var Redis=require(_0x4524('0xd'));var authService=require(_0x4524('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4524('0xf'));var hardwareService=require(_0x4524('0x10'));var logger=require(_0x4524('0x11'))(_0x4524('0x12'));var utils=require(_0x4524('0x13'));var config=require(_0x4524('0x14'));var licenseUtil=require(_0x4524('0x15'));var db=require(_0x4524('0x16'))['db'];var dbH=require('../../mysqldb')[_0x4524('0x17')];function respondWithStatusCode(_0x5220c6,_0x20ed19){_0x20ed19=_0x20ed19||0xcc;return function(_0x15a6dc){if(_0x15a6dc){return _0x5220c6[_0x4524('0x18')](_0x20ed19);}return _0x5220c6[_0x4524('0x19')](_0x20ed19)[_0x4524('0x1a')]();};}function respondWithResult(_0x1d75a7,_0x207c8f){_0x207c8f=_0x207c8f||0xc8;return function(_0x1e0336){if(_0x1e0336){return _0x1d75a7[_0x4524('0x19')](_0x207c8f)[_0x4524('0x1b')](_0x1e0336);}};}function respondWithFilteredResult(_0x327686,_0x26418b){return function(_0x484921){if(_0x484921){var _0x19debe=typeof _0x26418b['offset']===_0x4524('0x1c')&&typeof _0x26418b['limit']===_0x4524('0x1c');var _0xd135dc=_0x484921[_0x4524('0x1d')];var _0x4b7fed=_0x19debe?0x0:_0x26418b['offset'];var _0x748feb=_0x19debe?_0x484921[_0x4524('0x1d')]:_0x26418b[_0x4524('0x1e')]+_0x26418b[_0x4524('0x1f')];var _0xeac76b;if(_0x748feb>=_0xd135dc){_0x748feb=_0xd135dc;_0xeac76b=0xc8;}else{_0xeac76b=0xce;}_0x327686[_0x4524('0x19')](_0xeac76b);return _0x327686['set'](_0x4524('0x20'),_0x4b7fed+'-'+_0x748feb+'/'+_0xd135dc)[_0x4524('0x1b')](_0x484921);}return null;};}function patchUpdates(_0x3450e5){return function(_0xf439e9){try{jsonpatch[_0x4524('0x21')](_0xf439e9,_0x3450e5,!![]);}catch(_0x5bc77d){return BPromise[_0x4524('0x22')](_0x5bc77d);}return _0xf439e9[_0x4524('0x23')]();};}function saveUpdates(_0x3e82b8,_0x2bdcff){return function(_0x1223a2){if(_0x1223a2){return _0x1223a2[_0x4524('0x24')](_0x3e82b8)[_0x4524('0x25')](function(_0x203590){return _0x203590;});}return null;};}function removeEntity(_0x335aac,_0xa75186){return function(_0x54599f){if(_0x54599f){return _0x54599f[_0x4524('0x26')]()['then'](function(){var _0x480571=_0x54599f[_0x4524('0x27')]({'plain':!![]});var _0x524e9b=_0x4524('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x524e9b,'resourceId':_0x480571['id']}})[_0x4524('0x25')](function(){return _0x54599f;});})[_0x4524('0x25')](function(){_0x335aac[_0x4524('0x19')](0xcc)[_0x4524('0x1a')]();});}};}function handleEntityNotFound(_0x2f398f,_0x4429ba){return function(_0x327a0f){if(!_0x327a0f){_0x2f398f[_0x4524('0x18')](0x194);}return _0x327a0f;};}function handleError(_0x288679,_0xb7c194){_0xb7c194=_0xb7c194||0x1f4;return function(_0x395073){logger[_0x4524('0x29')](_0x395073[_0x4524('0x2a')]);if(_0x395073[_0x4524('0x2b')]){delete _0x395073[_0x4524('0x2b')];}_0x288679[_0x4524('0x19')](_0xb7c194)[_0x4524('0x2c')](_0x395073);};}exports['index']=function(_0x57485c,_0x2d77bd){var _0x3fa467={},_0x32439b={},_0x971b4d={'count':0x0,'rows':[]};var _0x463211=_[_0x4524('0x2d')](db[_0x4524('0x2e')]['rawAttributes'],function(_0x4717e3){return{'name':_0x4717e3[_0x4524('0x2f')],'type':_0x4717e3[_0x4524('0x30')][_0x4524('0x31')]};});_0x32439b[_0x4524('0x32')]=_[_0x4524('0x2d')](_0x463211,_0x4524('0x2b'));_0x32439b[_0x4524('0x33')]=_[_0x4524('0x34')](_0x57485c[_0x4524('0x33')]);_0x32439b['filters']=_[_0x4524('0x35')](_0x32439b[_0x4524('0x32')],_0x32439b[_0x4524('0x33')]);_0x3fa467[_0x4524('0x36')]=_['intersection'](_0x32439b[_0x4524('0x32')],qs['fields'](_0x57485c[_0x4524('0x33')][_0x4524('0x37')]));_0x3fa467[_0x4524('0x36')]=_0x3fa467['attributes']['length']?_0x3fa467['attributes']:_0x32439b[_0x4524('0x32')];if(!_0x57485c['query'][_0x4524('0x38')](_0x4524('0x39'))){_0x3fa467[_0x4524('0x1f')]=qs[_0x4524('0x1f')](_0x57485c[_0x4524('0x33')]['limit']);_0x3fa467[_0x4524('0x1e')]=qs['offset'](_0x57485c[_0x4524('0x33')][_0x4524('0x1e')]);}_0x3fa467['order']=qs[_0x4524('0x3a')](_0x57485c[_0x4524('0x33')]['sort']);_0x3fa467[_0x4524('0x3b')]=qs[_0x4524('0x3c')](_[_0x4524('0x3d')](_0x57485c[_0x4524('0x33')],_0x32439b['filters']),_0x463211);if(_0x57485c[_0x4524('0x33')][_0x4524('0x3e')]){_0x3fa467['where']=_[_0x4524('0x3f')](_0x3fa467['where'],{'$or':_['map'](_0x463211,function(_0x29048d){if(_0x29048d[_0x4524('0x30')]!==_0x4524('0x40')){var _0x19ac29={};_0x19ac29[_0x29048d[_0x4524('0x2b')]]={'$like':'%'+_0x57485c['query'][_0x4524('0x3e')]+'%'};return _0x19ac29;}})});}_0x3fa467=_[_0x4524('0x3f')]({},_0x3fa467,_0x57485c[_0x4524('0x41')]);var _0x325da4={'where':_0x3fa467[_0x4524('0x3b')]};return db[_0x4524('0x2e')][_0x4524('0x1d')](_0x325da4)['then'](function(_0x3ca81d){_0x971b4d[_0x4524('0x1d')]=_0x3ca81d;if(_0x57485c[_0x4524('0x33')][_0x4524('0x42')]){_0x3fa467[_0x4524('0x43')]=[{'all':!![]}];}return db[_0x4524('0x2e')]['findAll'](_0x3fa467);})[_0x4524('0x25')](function(_0x210589){_0x971b4d[_0x4524('0x44')]=_0x210589;return _0x971b4d;})['then'](respondWithFilteredResult(_0x2d77bd,_0x3fa467))[_0x4524('0x45')](handleError(_0x2d77bd,null));};exports[_0x4524('0x46')]=function(_0x16de00,_0x47c150){var _0x528594={'raw':![],'where':{'id':_0x16de00['params']['id']}},_0x1b4581={};_0x1b4581['model']=_[_0x4524('0x34')](db[_0x4524('0x2e')]['rawAttributes']);_0x1b4581[_0x4524('0x33')]=_[_0x4524('0x34')](_0x16de00[_0x4524('0x33')]);_0x1b4581[_0x4524('0x3c')]=_[_0x4524('0x35')](_0x1b4581[_0x4524('0x32')],_0x1b4581[_0x4524('0x33')]);_0x528594[_0x4524('0x36')]=_[_0x4524('0x35')](_0x1b4581[_0x4524('0x32')],qs['fields'](_0x16de00[_0x4524('0x33')][_0x4524('0x37')]));_0x528594[_0x4524('0x36')]=_0x528594['attributes'][_0x4524('0x47')]?_0x528594[_0x4524('0x36')]:_0x1b4581[_0x4524('0x32')];if(_0x16de00['query']['includeAll']){_0x528594[_0x4524('0x43')]=[{'all':!![]}];}_0x528594=_[_0x4524('0x3f')]({},_0x528594,_0x16de00['options']);return db[_0x4524('0x2e')][_0x4524('0x48')](_0x528594)[_0x4524('0x25')](handleEntityNotFound(_0x47c150,null))[_0x4524('0x25')](respondWithResult(_0x47c150,null))[_0x4524('0x45')](handleError(_0x47c150,null));};exports[_0x4524('0x49')]=function(_0x85150b,_0x1774fa){return db[_0x4524('0x2e')][_0x4524('0x49')](_0x85150b['body'],{})[_0x4524('0x25')](function(_0x3eb4de){var _0x53e008=_0x85150b[_0x4524('0x4a')][_0x4524('0x27')]({'plain':!![]});if(!_0x53e008)throw new Error(_0x4524('0x4b'));if(_0x53e008[_0x4524('0x4c')]===_0x4524('0x4a')){var _0x389623=_0x3eb4de[_0x4524('0x27')]({'plain':!![]});var _0xe65fc2='Reports';return db['UserProfileSection']['find']({'where':{'name':_0xe65fc2,'userProfileId':_0x53e008['userProfileId']},'raw':!![]})[_0x4524('0x25')](function(_0x4868d5){if(_0x4868d5&&_0x4868d5[_0x4524('0x4d')]===0x0){return db['UserProfileResource'][_0x4524('0x49')]({'name':_0x389623[_0x4524('0x2b')],'resourceId':_0x389623['id'],'type':_0x4524('0x28'),'sectionId':_0x4868d5['id']},{})[_0x4524('0x25')](function(){return _0x3eb4de;});}else{return _0x3eb4de;}})[_0x4524('0x45')](function(_0x3bdc1d){logger[_0x4524('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bdc1d);throw _0x3bdc1d;});}return _0x3eb4de;})[_0x4524('0x25')](respondWithResult(_0x1774fa,0xc9))['catch'](handleError(_0x1774fa,null));};exports[_0x4524('0x24')]=function(_0x32e1ba,_0x4d31c1){if(_0x32e1ba['body']['id']){delete _0x32e1ba[_0x4524('0x4e')]['id'];}return db[_0x4524('0x2e')]['find']({'where':{'id':_0x32e1ba['params']['id']}})['then'](handleEntityNotFound(_0x4d31c1,null))[_0x4524('0x25')](saveUpdates(_0x32e1ba['body'],null))['then'](respondWithResult(_0x4d31c1,null))[_0x4524('0x45')](handleError(_0x4d31c1,null));};exports['destroy']=function(_0x16568a,_0x37caf9){return db[_0x4524('0x2e')][_0x4524('0x48')]({'where':{'id':_0x16568a[_0x4524('0x4f')]['id']}})[_0x4524('0x25')](handleEntityNotFound(_0x37caf9,null))[_0x4524('0x25')](removeEntity(_0x37caf9,null))[_0x4524('0x45')](handleError(_0x37caf9,null));};exports['preview']=function(_0x44a82e,_0xc5349e){var _0x4772c1=0xa;var _0x3f4eb9=[_0x4524('0x50'),_0x4524('0x51'),_0x4524('0x52'),_0x4524('0x53')];var _0x28dd72={'SUM':_0x4524('0x54'),'COUNT':_0x4524('0x55'),'COUNT DISTINCT':_0x4524('0x56'),'MAX':'MAX(%s)','MIN':_0x4524('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4524('0x58'),'GROUP_CONCAT ASC':_0x4524('0x59'),'GROUP_CONCAT DESC':_0x4524('0x5a')};var _0x498894={'SEC_TO_TIME':_0x4524('0x5b'),'DATE':_0x4524('0x5c'),'HOUR':_0x4524('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4524('0x5e')};var _0x3f8cc2=function(_0xb52929){return!_[_0x4524('0x5f')]([_0x4524('0x60'),_0x4524('0x61'),'IS\x20EMPTY',_0x4524('0x62')],_0xb52929);};var _0x4eace9=function(_0x50712d){if(!_0x50712d||!_0x50712d[_0x4524('0x63')][_0x4524('0x47')]){return'';}for(var _0x3e5d75='(',_0x50c3ce=0x0;_0x50c3ce<_0x50712d['rules'][_0x4524('0x47')];_0x50c3ce+=0x1){_0x50c3ce>0x0&&(_0x3e5d75+='\x20'+_0x50712d[_0x4524('0x64')]+'\x20');_0x3e5d75+=_0x50712d['rules'][_0x50c3ce][_0x4524('0x65')]?_0x4eace9(_0x50712d[_0x4524('0x63')][_0x50c3ce][_0x4524('0x65')]):_0x50712d[_0x4524('0x63')][_0x50c3ce][_0x4524('0x66')]+'\x20'+_0x50712d[_0x4524('0x63')][_0x50c3ce][_0x4524('0x67')]+(_0x3f8cc2(_0x50712d[_0x4524('0x63')][_0x50c3ce][_0x4524('0x67')])?'\x20'+_0x50712d[_0x4524('0x63')][_0x50c3ce]['value']:'');}return _0x3e5d75+')';};var _0x40170c={'where':{'id':_0x44a82e[_0x4524('0x4f')]['id']}},_0x5bf843,_0x5030e8,_0x3d86ac,_0x449355,_0x1072e6;_0x40170c=_[_0x4524('0x3f')]({},_0x40170c,_0x44a82e[_0x4524('0x41')]);return db[_0x4524('0x2e')][_0x4524('0x48')](_0x40170c)['then'](function(_0x5050bc){if(_0x5050bc){_0x5bf843=_0x5050bc;return _0x5050bc[_0x4524('0x68')]();}return null;})[_0x4524('0x25')](function(_0x59053d){if(_0x59053d){if(!_0x59053d[_0x4524('0x47')]){throw new db[(_0x4524('0x69'))][(_0x4524('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5030e8=_0x59053d;return db[_0x4524('0x6b')][_0x4524('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x23cb23){if(_0x23cb23){_0x3d86ac=_['keyBy'](_0x23cb23,'id');var _0x341156;var _0x302eba=squel['select']();_0x302eba['from'](_0x5bf843[_0x4524('0x6d')]);for(var _0x2c0638=0x0;_0x2c0638<_0x5030e8[_0x4524('0x47')];_0x2c0638+=0x1){_0x341156=_0x5030e8[_0x2c0638][_0x4524('0x6e')]?_0x3d86ac[_0x5030e8[_0x2c0638][_0x4524('0x6e')]][_0x4524('0x6f')]:_0x5030e8[_0x2c0638]['field'];_0x341156=_0x5030e8[_0x2c0638][_0x4524('0x70')]?_[_0x4524('0x71')](_0x28dd72[_0x5030e8[_0x2c0638][_0x4524('0x70')]],'%s',_0x341156):_0x341156;_0x341156=_0x5030e8[_0x2c0638][_0x4524('0x72')]?_[_0x4524('0x71')](_0x498894[_0x5030e8[_0x2c0638]['format']],'%s',_0x341156):_0x341156;if(_0x5030e8[_0x2c0638][_0x4524('0x73')]){_0x302eba[_0x4524('0x65')](_0x341156);}_0x5030e8[_0x2c0638][_0x4524('0x74')]&&_0x302eba[_0x4524('0x75')](_0x341156,_0x5030e8[_0x2c0638][_0x4524('0x74')]===_0x4524('0x76')?![]:!![]);_0x302eba[_0x4524('0x66')](_0x341156,_0x5030e8[_0x2c0638][_0x4524('0x77')]||_0x341156);}if(_0x5bf843[_0x4524('0x78')]){_0x5bf843[_0x4524('0x78')]=JSON[_0x4524('0x79')](_0x5bf843[_0x4524('0x78')]);for(var _0x5611a8=0x0;_0x5611a8<_0x5bf843[_0x4524('0x78')][_0x4524('0x47')];_0x5611a8+=0x1){if(_0x5bf843['joins'][_0x5611a8][_0x4524('0x30')]&&_['includes'](_0x3f4eb9,_0x5bf843[_0x4524('0x78')][_0x5611a8][_0x4524('0x30')])&&_0x5bf843['joins'][_0x5611a8]['parentKey']&&_0x5bf843['joins'][_0x5611a8][_0x4524('0x7a')]&&_0x5bf843[_0x4524('0x78')][_0x5611a8][_0x4524('0x7b')]){_0x302eba[_0x5bf843['joins'][_0x5611a8][_0x4524('0x30')]](_0x5bf843[_0x4524('0x78')][_0x5611a8][_0x4524('0x7a')],null,util[_0x4524('0x72')](_0x4524('0x7c'),_0x5bf843[_0x4524('0x6d')],_0x5bf843['joins'][_0x5611a8][_0x4524('0x7d')],_0x5bf843[_0x4524('0x78')][_0x5611a8]['foreignTable'],_0x5bf843['joins'][_0x5611a8][_0x4524('0x7b')]));}}}if(_0x5bf843['conditions']){_0x5bf843['conditions']=JSON[_0x4524('0x79')](_0x5bf843[_0x4524('0x7e')]);_0x302eba['where'](_0x4eace9(_0x5bf843[_0x4524('0x7e')]['group']));}_0x1072e6=_0x302eba[_0x4524('0x7f')]();_0x302eba[_0x4524('0x1f')](_0x4772c1);_0x302eba[_0x4524('0x1e')](0x0);logger[_0x4524('0x80')](_0x4524('0x81'),_0x302eba[_0x4524('0x82')]());return dbH[_0x4524('0x83')][_0x4524('0x33')](_0x302eba[_0x4524('0x82')](),{'type':dbH[_0x4524('0x83')][_0x4524('0x84')][_0x4524('0x85')]});}})[_0x4524('0x25')](respondWithResult(_0xc5349e,null))[_0x4524('0x45')](handleError(_0xc5349e,null));};function runReport(_0x46f9d1,_0x1af37e,_0x5300e2){var _0x1e3dc1=_0x1af37e[_0x4524('0x2b')];var _0x2783c0=0xa;var _0x20ebf3=[_0x4524('0x50'),_0x4524('0x51'),_0x4524('0x52'),_0x4524('0x53')];var _0x3591f7={'SUM':_0x4524('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4524('0x56'),'MAX':_0x4524('0x86'),'MIN':_0x4524('0x57'),'AVG':_0x4524('0x87'),'GROUP_CONCAT':_0x4524('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4524('0x5a')};var _0x2defad={'SEC_TO_TIME':_0x4524('0x5b'),'DATE':_0x4524('0x5c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4524('0x5e')};var _0x40516c=function(_0x488fbb){return!_[_0x4524('0x5f')]([_0x4524('0x60'),_0x4524('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x488fbb);};var _0x3c3411=function(_0x41e308){if(!_0x41e308||!_0x41e308[_0x4524('0x63')][_0x4524('0x47')]){return'';}for(var _0x614245='(',_0x18b820=0x0;_0x18b820<_0x41e308[_0x4524('0x63')]['length'];_0x18b820+=0x1){_0x18b820>0x0&&(_0x614245+='\x20'+_0x41e308[_0x4524('0x64')]+'\x20');_0x614245+=_0x41e308[_0x4524('0x63')][_0x18b820][_0x4524('0x65')]?_0x3c3411(_0x41e308[_0x4524('0x63')][_0x18b820]['group']):_0x41e308[_0x4524('0x63')][_0x18b820][_0x4524('0x66')]+'\x20'+_0x41e308[_0x4524('0x63')][_0x18b820]['condition']+(_0x40516c(_0x41e308[_0x4524('0x63')][_0x18b820][_0x4524('0x67')])?'\x20'+_0x41e308[_0x4524('0x63')][_0x18b820][_0x4524('0x88')]:'');}return _0x614245+')';};var _0xa8338a={'where':{'id':_0x46f9d1['id']}},_0x377f50,_0x30bacd,_0x4225a1,_0x291d7a,_0x30f854;_0xa8338a=_['merge']({},_0xa8338a,_0x5300e2);return db[_0x4524('0x2e')][_0x4524('0x48')](_0xa8338a)[_0x4524('0x25')](function(_0x3f9618){if(_0x3f9618){_0x377f50=_0x3f9618;return _0x3f9618[_0x4524('0x68')]();}return null;})['then'](function(_0x3b55bf){if(_0x3b55bf){if(!_0x3b55bf[_0x4524('0x47')]){throw new db[(_0x4524('0x69'))][(_0x4524('0x6a'))](_0x4524('0x89'),0x193);}_0x30bacd=_0x3b55bf;return db[_0x4524('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x21c5f8){if(_0x21c5f8){_0x4225a1=_[_0x4524('0x8a')](_0x21c5f8,'id');var _0x8b324e;var _0xae14fe=squel[_0x4524('0x8b')]();_0xae14fe[_0x4524('0x8c')](_0x377f50[_0x4524('0x6d')]);for(var _0x1e6080=0x0;_0x1e6080<_0x30bacd[_0x4524('0x47')];_0x1e6080+=0x1){_0x8b324e=_0x30bacd[_0x1e6080]['MetricId']?_0x4225a1[_0x30bacd[_0x1e6080][_0x4524('0x6e')]][_0x4524('0x6f')]:_0x30bacd[_0x1e6080][_0x4524('0x66')];_0x8b324e=_0x30bacd[_0x1e6080]['function']?_[_0x4524('0x71')](_0x3591f7[_0x30bacd[_0x1e6080][_0x4524('0x70')]],'%s',_0x8b324e):_0x8b324e;_0x8b324e=_0x30bacd[_0x1e6080][_0x4524('0x72')]?_[_0x4524('0x71')](_0x2defad[_0x30bacd[_0x1e6080][_0x4524('0x72')]],'%s',_0x8b324e):_0x8b324e;if(_0x30bacd[_0x1e6080][_0x4524('0x73')]){_0xae14fe[_0x4524('0x65')](_0x8b324e);}_0x30bacd[_0x1e6080][_0x4524('0x74')]&&_0xae14fe[_0x4524('0x75')](_0x8b324e,_0x30bacd[_0x1e6080][_0x4524('0x74')]==='DESC'?![]:!![]);_0xae14fe[_0x4524('0x66')](_0x8b324e,_0x30bacd[_0x1e6080]['alias']||_0x8b324e);}if(_0x377f50[_0x4524('0x78')]){_0x377f50['joins']=JSON[_0x4524('0x79')](_0x377f50[_0x4524('0x78')]);for(var _0x4c5f3c=0x0;_0x4c5f3c<_0x377f50['joins']['length'];_0x4c5f3c+=0x1){if(_0x377f50[_0x4524('0x78')][_0x4c5f3c][_0x4524('0x30')]&&_[_0x4524('0x5f')](_0x20ebf3,_0x377f50[_0x4524('0x78')][_0x4c5f3c][_0x4524('0x30')])&&_0x377f50['joins'][_0x4c5f3c][_0x4524('0x7d')]&&_0x377f50[_0x4524('0x78')][_0x4c5f3c]['foreignTable']&&_0x377f50[_0x4524('0x78')][_0x4c5f3c][_0x4524('0x7b')]){_0xae14fe[_0x377f50[_0x4524('0x78')][_0x4c5f3c][_0x4524('0x30')]](_0x377f50[_0x4524('0x78')][_0x4c5f3c][_0x4524('0x7a')],null,util[_0x4524('0x72')](_0x4524('0x7c'),_0x377f50['table'],_0x377f50['joins'][_0x4c5f3c][_0x4524('0x7d')],_0x377f50[_0x4524('0x78')][_0x4c5f3c]['foreignTable'],_0x377f50['joins'][_0x4c5f3c][_0x4524('0x7b')]));}}}if(_0x377f50[_0x4524('0x7e')]){_0x377f50[_0x4524('0x7e')]=JSON[_0x4524('0x79')](_0x377f50[_0x4524('0x7e')]);_0xae14fe['where'](_0x3c3411(_0x377f50[_0x4524('0x7e')][_0x4524('0x65')]));}_0x30f854=_0xae14fe[_0x4524('0x7f')]();_0xae14fe[_0x4524('0x1f')](_0x2783c0);_0xae14fe[_0x4524('0x1e')](0x0);return;}})[_0x4524('0x25')](function(){if(_0x1af37e[_0x4524('0x8d')]==='web'){return null;}var _0x3f3501=_[_0x4524('0x3f')](_0x1af37e,{'name':_0x1af37e[_0x4524('0x8e')]||_0x1af37e['name']||_0x377f50['name'],'basename':_0x1e3dc1,'savename':util[_0x4524('0x72')](_0x4524('0x8f'),_0x1af37e[_0x4524('0x2b')]||_0x377f50[_0x4524('0x2b')],require(_0x4524('0x90'))[_0x4524('0x91')](0x4),_0x1af37e['output']||_0x4524('0x92')),'reportId':_0x377f50['id'],'reportType':_0x4524('0x93')});return db[_0x4524('0x94')]['create'](_0x3f3501,{'raw':!![]});})['then'](function(_0x4b9ea8){if(_0x377f50[_0x4524('0x6d')]==='cdr'){_0x30f854[_0x4524('0x3b')](_0x377f50['table']+_0x4524('0x95'),_0x1af37e[_0x4524('0x96')],_0x1af37e[_0x4524('0x97')]);}else{_0x30f854['where'](_0x377f50[_0x4524('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1af37e[_0x4524('0x96')],_0x1af37e[_0x4524('0x97')]);}if(_0x4b9ea8){logger['info'](_0x4524('0x98'),_0x30f854[_0x4524('0x82')]());require('child_process')[_0x4524('0x99')](path[_0x4524('0x50')](__dirname,_0x4524('0x9a'),_0x4b9ea8[_0x4524('0x8d')]),[_0x4b9ea8['id'],_0x30f854[_0x4524('0x82')](),path[_0x4524('0x50')](__dirname,'../../files/reports',_0x4b9ea8[_0x4524('0x9b')]),_0x1e3dc1]);return _0x4b9ea8;}else{var _0x29eb37=squel[_0x4524('0x8b')]();_0x29eb37[_0x4524('0x8c')]('('+_0x30f854[_0x4524('0x82')]()+')',_0x4524('0x9c'));_0x29eb37[_0x4524('0x66')](_0x4524('0x9d'),'count');_0x30f854[_0x4524('0x1f')](_0x1af37e[_0x4524('0x1f')]||_0x2783c0);_0x30f854['offset'](_0x1af37e[_0x4524('0x1e')]||0x0);return dbH[_0x4524('0x83')][_0x4524('0x33')](_0x29eb37[_0x4524('0x82')](),{'type':dbH['sequelize'][_0x4524('0x84')][_0x4524('0x85')]})[_0x4524('0x25')](function(_0x3c6b03){if(!_0x3c6b03[_0x4524('0x47')]){_0x291d7a=0x0;}else{_0x291d7a=_0x3c6b03[0x0][_0x4524('0x1d')]||0x0;}return dbH[_0x4524('0x83')][_0x4524('0x33')](_0x30f854[_0x4524('0x82')](),{'type':dbH[_0x4524('0x83')][_0x4524('0x84')][_0x4524('0x85')]});})['then'](function(_0x5020c2){return{'rows':_0x5020c2||[],'count':_0x291d7a};});}});}exports[_0x4524('0x9e')]=function(_0x147a67,_0x26dd7b){return runReport(_0x147a67[_0x4524('0x4f')],_0x147a67[_0x4524('0x33')],_0x147a67['options'])[_0x4524('0x25')](respondWithResult(_0x26dd7b,null))['catch'](handleError(_0x26dd7b,null));};exports['runReport']=runReport;exports[_0x4524('0x33')]=function(_0x1b7bbd,_0x297eea){var _0x5c86c6=0xa;var _0x187dcb=[_0x4524('0x50'),_0x4524('0x51'),_0x4524('0x52'),'cross_join'];var _0x568371={'SUM':_0x4524('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4524('0x86'),'MIN':_0x4524('0x57'),'AVG':_0x4524('0x87'),'GROUP_CONCAT':_0x4524('0x58'),'GROUP_CONCAT ASC':_0x4524('0x59'),'GROUP_CONCAT DESC':_0x4524('0x5a')};var _0x1ba339={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x4524('0x5d'),'ROUND':_0x4524('0x9f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x40bfe7=function(_0x59fd3a){return!_[_0x4524('0x5f')]([_0x4524('0x60'),_0x4524('0x61'),_0x4524('0xa0'),_0x4524('0x62')],_0x59fd3a);};var _0x1ee2f9=function(_0x32d27c){if(!_0x32d27c||!_0x32d27c['rules'][_0x4524('0x47')]){return'';}for(var _0x10aa28='(',_0x1c159a=0x0;_0x1c159a<_0x32d27c['rules'][_0x4524('0x47')];_0x1c159a+=0x1){_0x1c159a>0x0&&(_0x10aa28+='\x20'+_0x32d27c[_0x4524('0x64')]+'\x20');_0x10aa28+=_0x32d27c['rules'][_0x1c159a]['group']?_0x1ee2f9(_0x32d27c[_0x4524('0x63')][_0x1c159a][_0x4524('0x65')]):_0x32d27c['rules'][_0x1c159a][_0x4524('0x66')]+'\x20'+_0x32d27c['rules'][_0x1c159a][_0x4524('0x67')]+(_0x40bfe7(_0x32d27c['rules'][_0x1c159a]['condition'])?'\x20'+_0x32d27c[_0x4524('0x63')][_0x1c159a]['value']:'');}return _0x10aa28+')';};var _0xf8ba19={'where':{'id':_0x1b7bbd['params']['id']}},_0x202da4,_0x4cf84a,_0x15fc71,_0x153106,_0xdf5684;_0xf8ba19=_[_0x4524('0x3f')]({},_0xf8ba19,_0x1b7bbd[_0x4524('0x41')]);return db[_0x4524('0x2e')]['find'](_0xf8ba19)[_0x4524('0x25')](function(_0x564aa6){if(_0x564aa6){_0x202da4=_0x564aa6;return _0x564aa6[_0x4524('0x68')]();}return null;})[_0x4524('0x25')](function(_0x52cdc8){if(_0x52cdc8){if(!_0x52cdc8[_0x4524('0x47')]){throw new db['Sequelize'][(_0x4524('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cf84a=_0x52cdc8;return db['AnalyticMetric'][_0x4524('0x6c')]({'raw':!![]});}return null;})['then'](function(_0xec54b1){if(_0xec54b1){_0x15fc71=_[_0x4524('0x8a')](_0xec54b1,'id');var _0x4af704;var _0x4d76f2=squel[_0x4524('0x8b')]();_0x4d76f2[_0x4524('0x8c')](_0x202da4[_0x4524('0x6d')]);for(var _0x4f6215=0x0;_0x4f6215<_0x4cf84a[_0x4524('0x47')];_0x4f6215+=0x1){_0x4af704=_0x4cf84a[_0x4f6215][_0x4524('0x6e')]?_0x15fc71[_0x4cf84a[_0x4f6215][_0x4524('0x6e')]][_0x4524('0x6f')]:_0x4cf84a[_0x4f6215]['field'];_0x4af704=_0x4cf84a[_0x4f6215][_0x4524('0x70')]?_['replace'](_0x568371[_0x4cf84a[_0x4f6215][_0x4524('0x70')]],'%s',_0x4af704):_0x4af704;_0x4af704=_0x4cf84a[_0x4f6215]['format']?_[_0x4524('0x71')](_0x1ba339[_0x4cf84a[_0x4f6215]['format']],'%s',_0x4af704):_0x4af704;if(_0x4cf84a[_0x4f6215][_0x4524('0x73')]){_0x4d76f2[_0x4524('0x65')](_0x4af704);}_0x4cf84a[_0x4f6215][_0x4524('0x74')]&&_0x4d76f2['order'](_0x4af704,_0x4cf84a[_0x4f6215][_0x4524('0x74')]===_0x4524('0x76')?![]:!![]);_0x4d76f2[_0x4524('0x66')](_0x4af704,_0x4cf84a[_0x4f6215][_0x4524('0x77')]||_0x4af704);}if(_0x202da4[_0x4524('0x78')]){_0x202da4[_0x4524('0x78')]=JSON['parse'](_0x202da4['joins']);for(var _0x5f38b1=0x0;_0x5f38b1<_0x202da4['joins']['length'];_0x5f38b1+=0x1){if(_0x202da4[_0x4524('0x78')][_0x5f38b1][_0x4524('0x30')]&&_[_0x4524('0x5f')](_0x187dcb,_0x202da4[_0x4524('0x78')][_0x5f38b1][_0x4524('0x30')])&&_0x202da4[_0x4524('0x78')][_0x5f38b1][_0x4524('0x7d')]&&_0x202da4[_0x4524('0x78')][_0x5f38b1]['foreignTable']&&_0x202da4[_0x4524('0x78')][_0x5f38b1][_0x4524('0x7b')]){_0x4d76f2[_0x202da4['joins'][_0x5f38b1][_0x4524('0x30')]](_0x202da4[_0x4524('0x78')][_0x5f38b1][_0x4524('0x7a')],null,util[_0x4524('0x72')](_0x4524('0x7c'),_0x202da4[_0x4524('0x6d')],_0x202da4[_0x4524('0x78')][_0x5f38b1]['parentKey'],_0x202da4[_0x4524('0x78')][_0x5f38b1][_0x4524('0x7a')],_0x202da4['joins'][_0x5f38b1][_0x4524('0x7b')]));}}}if(_0x202da4['conditions']){_0x202da4['conditions']=JSON[_0x4524('0x79')](_0x202da4['conditions']);_0x4d76f2[_0x4524('0x3b')](_0x1ee2f9(_0x202da4['conditions'][_0x4524('0x65')]));}_0xdf5684=_0x4d76f2[_0x4524('0x7f')]();_0x4d76f2[_0x4524('0x1f')](_0x5c86c6);_0x4d76f2[_0x4524('0x1e')](0x0);logger[_0x4524('0x80')]('Limited\x20Query:',_0x4d76f2[_0x4524('0x82')]());return dbH[_0x4524('0x83')][_0x4524('0x33')](_0x4d76f2[_0x4524('0x82')](),{'type':dbH[_0x4524('0x83')][_0x4524('0x84')][_0x4524('0x85')]});}})[_0x4524('0x25')](function(){return{'sql':_0xdf5684[_0x4524('0x82')]()};})[_0x4524('0x25')](respondWithResult(_0x297eea,null))[_0x4524('0x45')](handleError(_0x297eea,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index a53101f..bb807d7 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 _0x09ff=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./analyticCustomReport.attributes'];(function(_0xed4668,_0x469afc){var _0x5e3fad=function(_0x3c59d8){while(--_0x3c59d8){_0xed4668['push'](_0xed4668['shift']());}};_0x5e3fad(++_0x469afc);}(_0x09ff,0x17a));var _0xf09f=function(_0x5389c5,_0xd4953b){_0x5389c5=_0x5389c5-0x0;var _0x31f328=_0x09ff[_0x5389c5];return _0x31f328;};'use strict';var _=require(_0xf09f('0x0'));var util=require(_0xf09f('0x1'));var logger=require(_0xf09f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf09f('0x3'));var rp=require(_0xf09f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf09f('0x5'));var config=require('../../config/environment');var attributes=require(_0xf09f('0x6'));module[_0xf09f('0x7')]=function(_0x112361,_0x1f5f6b){return _0x112361[_0xf09f('0x8')](_0xf09f('0x9'),attributes,{'tableName':_0xf09f('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x762c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','util'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x762c,0x167));var _0xc762=function(_0x50963f,_0x97943a){_0x50963f=_0x50963f-0x0;var _0x5667d5=_0x762c[_0x50963f];return _0x5667d5;};'use strict';var _=require('lodash');var util=require(_0xc762('0x0'));var logger=require('../../config/logger')(_0xc762('0x1'));var moment=require(_0xc762('0x2'));var BPromise=require(_0xc762('0x3'));var rp=require(_0xc762('0x4'));var fs=require('fs');var path=require(_0xc762('0x5'));var rimraf=require(_0xc762('0x6'));var config=require(_0xc762('0x7'));var attributes=require(_0xc762('0x8'));module[_0xc762('0x9')]=function(_0x5ca906,_0xa2c089){return _0x5ca906[_0xc762('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0xc762('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index d48b569..119083b 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 _0x2bfd=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0x2bfd,0x70));var _0xd2bf=function(_0x38f737,_0x54f685){_0x38f737=_0x38f737-0x0;var _0x7afda3=_0x2bfd[_0x38f737];return _0x7afda3;};'use strict';var _=require('lodash');var util=require(_0xd2bf('0x0'));var moment=require(_0xd2bf('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2bf('0x2'));var fs=require('fs');var Redis=require(_0xd2bf('0x3'));var db=require(_0xd2bf('0x4'))['db'];var utils=require(_0xd2bf('0x5'));var logger=require('../../config/logger')(_0xd2bf('0x6'));var config=require(_0xd2bf('0x7'));var jayson=require(_0xd2bf('0x8'));var client=jayson[_0xd2bf('0x9')][_0xd2bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8d10,_0x1e1d7b,_0x573689){return new BPromise(function(_0x15d497,_0x22b02b){return client['request'](_0x2c8d10,_0x573689)[_0xd2bf('0xb')](function(_0x287005){logger['info'](_0xd2bf('0xc'),_0x1e1d7b,_0xd2bf('0xd'));logger[_0xd2bf('0xe')](_0xd2bf('0xf'),_0x1e1d7b,_0xd2bf('0xd'),JSON[_0xd2bf('0x10')](_0x287005));if(_0x287005['error']){if(_0x287005[_0xd2bf('0x11')][_0xd2bf('0x12')]===0x1f4){logger[_0xd2bf('0x11')](_0xd2bf('0xc'),_0x1e1d7b,_0x287005[_0xd2bf('0x11')]['message']);return _0x22b02b(_0x287005['error'][_0xd2bf('0x13')]);}logger[_0xd2bf('0x11')](_0xd2bf('0xc'),_0x1e1d7b,_0x287005[_0xd2bf('0x11')][_0xd2bf('0x13')]);return _0x15d497(_0x287005['error'][_0xd2bf('0x13')]);}else{logger['info'](_0xd2bf('0xc'),_0x1e1d7b,_0xd2bf('0xd'));_0x15d497(_0x287005[_0xd2bf('0x14')][_0xd2bf('0x13')]);}})[_0xd2bf('0x15')](function(_0x2b8231){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1e1d7b,_0x2b8231);_0x22b02b(_0x2b8231);});});}
\ No newline at end of file
+var _0xebe5=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x3105a9,_0x5f36f1){var _0x5d6e3=function(_0x10d873){while(--_0x10d873){_0x3105a9['push'](_0x3105a9['shift']());}};_0x5d6e3(++_0x5f36f1);}(_0xebe5,0x179));var _0x5ebe=function(_0x35836c,_0x17aedb){_0x35836c=_0x35836c-0x0;var _0x5277b3=_0xebe5[_0x35836c];return _0x5277b3;};'use strict';var _=require(_0x5ebe('0x0'));var util=require(_0x5ebe('0x1'));var moment=require(_0x5ebe('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ebe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ebe('0x4'));var logger=require('../../config/logger')(_0x5ebe('0x5'));var config=require(_0x5ebe('0x6'));var jayson=require(_0x5ebe('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a1704,_0x1abb80,_0x31742a){return new BPromise(function(_0x1c649c,_0x23d94b){return client[_0x5ebe('0x8')](_0x4a1704,_0x31742a)[_0x5ebe('0x9')](function(_0x2da3e4){logger[_0x5ebe('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1abb80,_0x5ebe('0xb'));logger['debug'](_0x5ebe('0xc'),_0x1abb80,'request\x20sent',JSON[_0x5ebe('0xd')](_0x2da3e4));if(_0x2da3e4[_0x5ebe('0xe')]){if(_0x2da3e4['error'][_0x5ebe('0xf')]===0x1f4){logger[_0x5ebe('0xe')](_0x5ebe('0x10'),_0x1abb80,_0x2da3e4[_0x5ebe('0xe')][_0x5ebe('0x11')]);return _0x23d94b(_0x2da3e4[_0x5ebe('0xe')]['message']);}logger[_0x5ebe('0xe')](_0x5ebe('0x10'),_0x1abb80,_0x2da3e4[_0x5ebe('0xe')][_0x5ebe('0x11')]);return _0x1c649c(_0x2da3e4[_0x5ebe('0xe')][_0x5ebe('0x11')]);}else{logger[_0x5ebe('0xa')](_0x5ebe('0x10'),_0x1abb80,_0x5ebe('0xb'));_0x1c649c(_0x2da3e4[_0x5ebe('0x12')][_0x5ebe('0x11')]);}})['catch'](function(_0x34d9a6){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1abb80,_0x34d9a6);_0x23d94b(_0x34d9a6);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index be1734f..44b7c14 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 _0x0ffd=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x0ffd,0x123));var _0xd0ff=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x0ffd[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require('multer');var util=require(_0xd0ff('0x0'));var path=require(_0xd0ff('0x1'));var timeout=require(_0xd0ff('0x2'));var express=require('express');var router=express[_0xd0ff('0x3')]();var fs_extra=require(_0xd0ff('0x4'));var auth=require(_0xd0ff('0x5'));var interaction=require(_0xd0ff('0x6'));var config=require('../../config/environment');var controller=require(_0xd0ff('0x7'));router[_0xd0ff('0x8')]('/',auth[_0xd0ff('0x9')](),controller[_0xd0ff('0xa')]);router[_0xd0ff('0x8')](_0xd0ff('0xb'),auth[_0xd0ff('0x9')](),controller[_0xd0ff('0xc')]);router[_0xd0ff('0x8')](_0xd0ff('0xd'),auth[_0xd0ff('0x9')](),controller[_0xd0ff('0xe')]);router[_0xd0ff('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0xd0ff('0xf')]);router[_0xd0ff('0x8')](_0xd0ff('0x10'),auth[_0xd0ff('0x9')](),controller[_0xd0ff('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd0ff('0x12')]);router[_0xd0ff('0x13')](_0xd0ff('0xb'),auth[_0xd0ff('0x9')](),controller['update']);router[_0xd0ff('0x14')](_0xd0ff('0xb'),auth['isAuthenticated'](),controller[_0xd0ff('0x15')]);module[_0xd0ff('0x16')]=router;
\ No newline at end of file
+var _0xb002=['../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','preview','/:id/run','run','/:id/query','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3dd34b,_0x4fd418){var _0x44cd78=function(_0x588742){while(--_0x588742){_0x3dd34b['push'](_0x3dd34b['shift']());}};_0x44cd78(++_0x4fd418);}(_0xb002,0x72));var _0x2b00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb002[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2b00('0x0'));var util=require('util');var path=require(_0x2b00('0x1'));var timeout=require(_0x2b00('0x2'));var express=require(_0x2b00('0x3'));var router=express[_0x2b00('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2b00('0x5'));var config=require(_0x2b00('0x6'));var controller=require(_0x2b00('0x7'));router['get']('/',auth[_0x2b00('0x8')](),controller['index']);router[_0x2b00('0x9')](_0x2b00('0xa'),auth[_0x2b00('0x8')](),controller['show']);router[_0x2b00('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0x2b00('0xb')]);router[_0x2b00('0x9')](_0x2b00('0xc'),auth[_0x2b00('0x8')](),controller[_0x2b00('0xd')]);router[_0x2b00('0x9')](_0x2b00('0xe'),auth[_0x2b00('0x8')](),controller['query']);router['post']('/',auth[_0x2b00('0x8')](),controller[_0x2b00('0xf')]);router['put'](_0x2b00('0xa'),auth[_0x2b00('0x8')](),controller[_0x2b00('0x10')]);router[_0x2b00('0x11')](_0x2b00('0xa'),auth[_0x2b00('0x8')](),controller[_0x2b00('0x12')]);module[_0x2b00('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6eeb6b7..f0cf71d 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 _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x2f0be4,_0x194a40){var _0xefdb9d=function(_0xb2ff86){while(--_0xb2ff86){_0x2f0be4['push'](_0x2f0be4['shift']());}};_0xefdb9d(++_0x194a40);}(_0x814b,0x1a2));var _0xb814=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0x814b[_0x4cd690];return _0x4a74a9;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
+var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x405aeb,_0x5ee732){var _0x50e76a=function(_0x2cded1){while(--_0x2cded1){_0x405aeb['push'](_0x405aeb['shift']());}};_0x50e76a(++_0x5ee732);}(_0x5fab,0x177));var _0xb5fa=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x5fab[_0x2085f3];return _0x384e3c;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 293497d..dfbbf56 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x2782b1,_0x1f93f4){var _0x98e50a=function(_0x1c8d04){while(--_0x1c8d04){_0x2782b1['push'](_0x2782b1['shift']());}};_0x98e50a(++_0x1f93f4);}(_0x4819,0xcd));var _0x9481=function(_0x5dcbf0,_0x101d9d){_0x5dcbf0=_0x5dcbf0-0x0;var _0xcf87aa=_0x4819[_0x5dcbf0];return _0xcf87aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+var _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','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)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0xcd9ec8,_0x27699f){var _0x5aa31b=function(_0x32f922){while(--_0x32f922){_0xcd9ec8['push'](_0xcd9ec8['shift']());}};_0x5aa31b(++_0x27699f);}(_0x7a54,0x106));var _0x47a5=function(_0x25c99c,_0x5146b3){_0x25c99c=_0x25c99c-0x0;var _0x26e4fa=_0x7a54[_0x25c99c];return _0x26e4fa;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 845669f..e207f32 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 _0x960a=['exports','define','analytics_default_reports','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x4911ed,_0x476941){var _0x230288=function(_0xcaa9c0){while(--_0xcaa9c0){_0x4911ed['push'](_0x4911ed['shift']());}};_0x230288(++_0x476941);}(_0x960a,0x147));var _0xa960=function(_0x29a619,_0x7da0d6){_0x29a619=_0x29a619-0x0;var _0x114a54=_0x960a[_0x29a619];return _0x114a54;};'use strict';var _=require('lodash');var util=require(_0xa960('0x0'));var logger=require(_0xa960('0x1'))(_0xa960('0x2'));var moment=require(_0xa960('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa960('0x4'));var config=require(_0xa960('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0xa960('0x6')]=function(_0x16b1e4,_0x58eec8){return _0x16b1e4[_0xa960('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xa960('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec7c=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_default_reports','lodash'];(function(_0x2bdaf6,_0x5a48fe){var _0x33c743=function(_0x26e380){while(--_0x26e380){_0x2bdaf6['push'](_0x2bdaf6['shift']());}};_0x33c743(++_0x5a48fe);}(_0xec7c,0x1c1));var _0xcec7=function(_0x32d225,_0x459300){_0x32d225=_0x32d225-0x0;var _0x22293b=_0xec7c[_0x32d225];return _0x22293b;};'use strict';var _=require(_0xcec7('0x0'));var util=require('util');var logger=require(_0xcec7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcec7('0x2'));var rp=require(_0xcec7('0x3'));var fs=require('fs');var path=require(_0xcec7('0x4'));var rimraf=require(_0xcec7('0x5'));var config=require(_0xcec7('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x2114cc,_0x382308){return _0x2114cc[_0xcec7('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xcec7('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 dd4e02a..3318169 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 _0x4e82=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x58a6de,_0x44b539){var _0x307315=function(_0x337119){while(--_0x337119){_0x58a6de['push'](_0x58a6de['shift']());}};_0x307315(++_0x44b539);}(_0x4e82,0x1b1));var _0x24e8=function(_0x89b396,_0x17b822){_0x89b396=_0x89b396-0x0;var _0x5e4098=_0x4e82[_0x89b396];return _0x5e4098;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x24e8('0x0'));var BPromise=require('bluebird');var rs=require(_0x24e8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24e8('0x2'))['db'];var utils=require(_0x24e8('0x3'));var logger=require(_0x24e8('0x4'))(_0x24e8('0x5'));var config=require(_0x24e8('0x6'));var jayson=require(_0x24e8('0x7'));var client=jayson[_0x24e8('0x8')][_0x24e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9d4bd3,_0x3e8e64,_0x47b5bb){return new BPromise(function(_0x20656c,_0x5741a9){return client[_0x24e8('0xa')](_0x9d4bd3,_0x47b5bb)[_0x24e8('0xb')](function(_0x22e111){logger[_0x24e8('0xc')](_0x24e8('0xd'),_0x3e8e64,'request\x20sent');logger[_0x24e8('0xe')](_0x24e8('0xf'),_0x3e8e64,_0x24e8('0x10'),JSON[_0x24e8('0x11')](_0x22e111));if(_0x22e111['error']){if(_0x22e111['error']['code']===0x1f4){logger[_0x24e8('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e8e64,_0x22e111[_0x24e8('0x12')][_0x24e8('0x13')]);return _0x5741a9(_0x22e111[_0x24e8('0x12')][_0x24e8('0x13')]);}logger[_0x24e8('0x12')](_0x24e8('0xd'),_0x3e8e64,_0x22e111[_0x24e8('0x12')]['message']);return _0x20656c(_0x22e111['error'][_0x24e8('0x13')]);}else{logger[_0x24e8('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e8e64,_0x24e8('0x10'));_0x20656c(_0x22e111[_0x24e8('0x14')][_0x24e8('0x13')]);}})[_0x24e8('0x15')](function(_0x23057e){logger['error'](_0x24e8('0xd'),_0x3e8e64,_0x23057e);_0x5741a9(_0x23057e);});});}
\ No newline at end of file
+var _0xe93f=['debug','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0xe93f,0xb0));var _0xfe93=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe93f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfe93('0x0'));var util=require(_0xfe93('0x1'));var moment=require(_0xfe93('0x2'));var BPromise=require(_0xfe93('0x3'));var rs=require(_0xfe93('0x4'));var fs=require('fs');var Redis=require(_0xfe93('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe93('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfe93('0x7'));var jayson=require(_0xfe93('0x8'));var client=jayson['client'][_0xfe93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bf420,_0x22bf50,_0x19dea2){return new BPromise(function(_0x259174,_0x16b8c9){return client[_0xfe93('0xa')](_0x4bf420,_0x19dea2)[_0xfe93('0xb')](function(_0x14f334){logger[_0xfe93('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x22bf50,_0xfe93('0xd'));logger[_0xfe93('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x22bf50,'request\x20sent',JSON['stringify'](_0x14f334));if(_0x14f334[_0xfe93('0xf')]){if(_0x14f334[_0xfe93('0xf')]['code']===0x1f4){logger[_0xfe93('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x22bf50,_0x14f334[_0xfe93('0xf')][_0xfe93('0x10')]);return _0x16b8c9(_0x14f334[_0xfe93('0xf')][_0xfe93('0x10')]);}logger[_0xfe93('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x22bf50,_0x14f334[_0xfe93('0xf')][_0xfe93('0x10')]);return _0x259174(_0x14f334['error'][_0xfe93('0x10')]);}else{logger[_0xfe93('0xc')](_0xfe93('0x11'),_0x22bf50,'request\x20sent');_0x259174(_0x14f334[_0xfe93('0x12')][_0xfe93('0x10')]);}})['catch'](function(_0x1f4249){logger[_0xfe93('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x22bf50,_0x1f4249);_0x16b8c9(_0x1f4249);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 3123dfe..f28bfd3 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 _0xc94b=['/:id/preview','isAuthenticated','preview','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','show'];(function(_0x468550,_0x4a650e){var _0x3e9700=function(_0x376ef6){while(--_0x376ef6){_0x468550['push'](_0x468550['shift']());}};_0x3e9700(++_0x4a650e);}(_0xc94b,0x17a));var _0xbc94=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xc94b[_0x24259d];return _0x5a701;};'use strict';var multer=require(_0xbc94('0x0'));var util=require(_0xbc94('0x1'));var path=require(_0xbc94('0x2'));var timeout=require(_0xbc94('0x3'));var express=require(_0xbc94('0x4'));var router=express['Router']();var fs_extra=require(_0xbc94('0x5'));var auth=require(_0xbc94('0x6'));var interaction=require(_0xbc94('0x7'));var config=require(_0xbc94('0x8'));var controller=require(_0xbc94('0x9'));router[_0xbc94('0xa')]('/',auth['isAuthenticated'](),controller[_0xbc94('0xb')]);router[_0xbc94('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xbc94('0xc')]);router['get'](_0xbc94('0xd'),auth[_0xbc94('0xe')](),controller[_0xbc94('0xf')]);router['get']('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xbc94('0xa')]('/:id/query',auth[_0xbc94('0xe')](),controller['query']);router[_0xbc94('0x10')]('/',auth[_0xbc94('0xe')](),controller[_0xbc94('0x11')]);router[_0xbc94('0x12')](_0xbc94('0x13'),auth[_0xbc94('0xe')](),controller['update']);router[_0xbc94('0x14')]('/:id',auth[_0xbc94('0xe')](),controller[_0xbc94('0x15')]);module[_0xbc94('0x16')]=router;
\ No newline at end of file
+var _0xe84a=['/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/query','query','post','create','put'];(function(_0x4e6fb2,_0x3cf23e){var _0x2f1636=function(_0x53c7eb){while(--_0x53c7eb){_0x4e6fb2['push'](_0x4e6fb2['shift']());}};_0x2f1636(++_0x3cf23e);}(_0xe84a,0x113));var _0xae84=function(_0x271575,_0x181a21){_0x271575=_0x271575-0x0;var _0x1cd7d2=_0xe84a[_0x271575];return _0x1cd7d2;};'use strict';var multer=require(_0xae84('0x0'));var util=require(_0xae84('0x1'));var path=require(_0xae84('0x2'));var timeout=require(_0xae84('0x3'));var express=require(_0xae84('0x4'));var router=express[_0xae84('0x5')]();var fs_extra=require(_0xae84('0x6'));var auth=require(_0xae84('0x7'));var interaction=require(_0xae84('0x8'));var config=require(_0xae84('0x9'));var controller=require('./analyticDefaultReport.controller');router[_0xae84('0xa')]('/',auth['isAuthenticated'](),controller[_0xae84('0xb')]);router[_0xae84('0xa')]('/:id',auth[_0xae84('0xc')](),controller[_0xae84('0xd')]);router[_0xae84('0xa')]('/:id/preview',auth[_0xae84('0xc')](),controller['preview']);router[_0xae84('0xa')]('/:id/run',auth[_0xae84('0xc')](),controller['run']);router[_0xae84('0xa')](_0xae84('0xe'),auth[_0xae84('0xc')](),controller[_0xae84('0xf')]);router[_0xae84('0x10')]('/',auth[_0xae84('0xc')](),controller[_0xae84('0x11')]);router[_0xae84('0x12')](_0xae84('0x13'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xae84('0x13'),auth[_0xae84('0xc')](),controller[_0xae84('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index a324ab5..2fd36f6 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 _0x0c5e=['ENUM','manual','scheduled','UNSIGNED','moment','exports','STRING','pdf','csv','DATE','Loading'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c5e,0xd5));var _0xe0c5=function(_0x505a7d,_0x25e11f){_0x505a7d=_0x505a7d-0x0;var _0x17d880=_0x0c5e[_0x505a7d];return _0x17d880;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe0c5('0x0'));module[_0xe0c5('0x1')]={'name':{'type':Sequelize[_0xe0c5('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe0c5('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xe0c5('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0xe0c5('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xe0c5('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xe0c5('0x2')],'defaultValue':_0xe0c5('0x6')},'type':{'type':Sequelize[_0xe0c5('0x7')](_0xe0c5('0x8'),_0xe0c5('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xe0c5('0xa')]},'reportType':{'type':Sequelize[_0xe0c5('0x2')]}};
\ No newline at end of file
+var _0x38c9=['UNSIGNED','sequelize','csv','pdf','xlsx','STRING','DATE','ENUM','manual','scheduled'];(function(_0x444625,_0x517882){var _0x1730f2=function(_0x271845){while(--_0x271845){_0x444625['push'](_0x444625['shift']());}};_0x1730f2(++_0x517882);}(_0x38c9,0x10f));var _0x938c=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x38c9[_0x21af3a];return _0x268a49;};'use strict';var Sequelize=require(_0x938c('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x938c('0x1'),_0x938c('0x2'),_0x938c('0x3')),'allowNull':![],'defaultValue':_0x938c('0x1')},'savename':{'type':Sequelize[_0x938c('0x4')],'allowNull':![]},'startDate':{'type':Sequelize[_0x938c('0x5')]},'endDate':{'type':Sequelize[_0x938c('0x5')]},'status':{'type':Sequelize[_0x938c('0x4')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x938c('0x6')](_0x938c('0x7'),_0x938c('0x8')),'allowNull':![],'defaultValue':_0x938c('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x938c('0x9')]},'reportType':{'type':Sequelize[_0x938c('0x4')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index be64039..9ac279f 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 _0x78bc=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','order','where','filter','merge','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x78bc,0x1ef));var _0xc78b=function(_0x19f55e,_0xd4ffc3){_0x19f55e=_0x19f55e-0x0;var _0x44cfee=_0x78bc[_0x19f55e];return _0x44cfee;};'use strict';var emlformat=require(_0xc78b('0x0'));var rimraf=require(_0xc78b('0x1'));var zipdir=require(_0xc78b('0x2'));var jsonpatch=require(_0xc78b('0x3'));var rp=require(_0xc78b('0x4'));var moment=require('moment');var BPromise=require(_0xc78b('0x5'));var Mustache=require(_0xc78b('0x6'));var util=require(_0xc78b('0x7'));var path=require(_0xc78b('0x8'));var sox=require(_0xc78b('0x9'));var csv=require(_0xc78b('0xa'));var ejs=require(_0xc78b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc78b('0xc'));var squel=require(_0xc78b('0xd'));var crypto=require(_0xc78b('0xe'));var jsforce=require(_0xc78b('0xf'));var deskjs=require(_0xc78b('0x10'));var toCsv=require(_0xc78b('0xa'));var querystring=require(_0xc78b('0x11'));var Papa=require(_0xc78b('0x12'));var Redis=require('ioredis');var authService=require(_0xc78b('0x13'));var qs=require(_0xc78b('0x14'));var as=require(_0xc78b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc78b('0x16'))('api');var utils=require(_0xc78b('0x17'));var config=require(_0xc78b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc78b('0x19'))['db'];function respondWithStatusCode(_0x3c2953,_0x54254f){_0x54254f=_0x54254f||0xcc;return function(_0x9e6de0){if(_0x9e6de0){return _0x3c2953[_0xc78b('0x1a')](_0x54254f);}return _0x3c2953[_0xc78b('0x1b')](_0x54254f)[_0xc78b('0x1c')]();};}function respondWithResult(_0x4cde1d,_0x5c9503){_0x5c9503=_0x5c9503||0xc8;return function(_0x41893e){if(_0x41893e){return _0x4cde1d['status'](_0x5c9503)['json'](_0x41893e);}};}function respondWithFilteredResult(_0x1328f3,_0x48ff04){return function(_0x383214){if(_0x383214){var _0x40f7e7=typeof _0x48ff04[_0xc78b('0x1d')]===_0xc78b('0x1e')&&typeof _0x48ff04['limit']===_0xc78b('0x1e');var _0x48228e=_0x383214[_0xc78b('0x1f')];var _0x9ad5fc=_0x40f7e7?0x0:_0x48ff04[_0xc78b('0x1d')];var _0x49fc13=_0x40f7e7?_0x383214['count']:_0x48ff04[_0xc78b('0x1d')]+_0x48ff04[_0xc78b('0x20')];var _0x5e5f77;if(_0x49fc13>=_0x48228e){_0x49fc13=_0x48228e;_0x5e5f77=0xc8;}else{_0x5e5f77=0xce;}_0x1328f3[_0xc78b('0x1b')](_0x5e5f77);return _0x1328f3[_0xc78b('0x21')](_0xc78b('0x22'),_0x9ad5fc+'-'+_0x49fc13+'/'+_0x48228e)[_0xc78b('0x23')](_0x383214);}return null;};}function patchUpdates(_0x53ea6d){return function(_0x59df5f){try{jsonpatch[_0xc78b('0x24')](_0x59df5f,_0x53ea6d,!![]);}catch(_0x522269){return BPromise[_0xc78b('0x25')](_0x522269);}return _0x59df5f[_0xc78b('0x26')]();};}function saveUpdates(_0x44277b,_0x364ee3){return function(_0x160e4f){if(_0x160e4f){return _0x160e4f['update'](_0x44277b)[_0xc78b('0x27')](function(_0x5f1b8f){return _0x5f1b8f;});}return null;};}function removeEntity(_0xf3ab0f,_0x25dad7){return function(_0x199fff){if(_0x199fff){return _0x199fff[_0xc78b('0x28')]()[_0xc78b('0x27')](function(){var _0x2191e4=_0x199fff[_0xc78b('0x29')]({'plain':!![]});var _0x2e039d=_0xc78b('0x2a');return db['UserProfileResource'][_0xc78b('0x28')]({'where':{'type':_0x2e039d,'resourceId':_0x2191e4['id']}})[_0xc78b('0x27')](function(){return _0x199fff;});})[_0xc78b('0x27')](function(){_0xf3ab0f[_0xc78b('0x1b')](0xcc)[_0xc78b('0x1c')]();});}};}function handleEntityNotFound(_0x4756d0,_0xd4c6ff){return function(_0x44f9aa){if(!_0x44f9aa){_0x4756d0[_0xc78b('0x1a')](0x194);}return _0x44f9aa;};}function handleError(_0xa73865,_0x3d283f){_0x3d283f=_0x3d283f||0x1f4;return function(_0x1d93da){logger[_0xc78b('0x2b')](_0x1d93da[_0xc78b('0x2c')]);if(_0x1d93da[_0xc78b('0x2d')]){delete _0x1d93da[_0xc78b('0x2d')];}_0xa73865[_0xc78b('0x1b')](_0x3d283f)[_0xc78b('0x2e')](_0x1d93da);};}exports[_0xc78b('0x2f')]=function(_0x3aee9a,_0x2c07bf){var _0x589990={},_0x25b71f={},_0x3a673e={'count':0x0,'rows':[]};var _0x40d378=_[_0xc78b('0x30')](db['AnalyticExtractedReport'][_0xc78b('0x31')],function(_0x453209){return{'name':_0x453209[_0xc78b('0x32')],'type':_0x453209[_0xc78b('0x33')]['key']};});_0x25b71f[_0xc78b('0x34')]=_[_0xc78b('0x30')](_0x40d378,'name');_0x25b71f[_0xc78b('0x35')]=_[_0xc78b('0x36')](_0x3aee9a['query']);_0x25b71f[_0xc78b('0x37')]=_[_0xc78b('0x38')](_0x25b71f[_0xc78b('0x34')],_0x25b71f[_0xc78b('0x35')]);_0x589990['attributes']=_[_0xc78b('0x38')](_0x25b71f[_0xc78b('0x34')],qs[_0xc78b('0x39')](_0x3aee9a['query'][_0xc78b('0x39')]));_0x589990[_0xc78b('0x3a')]=_0x589990[_0xc78b('0x3a')]['length']?_0x589990[_0xc78b('0x3a')]:_0x25b71f[_0xc78b('0x34')];if(!_0x3aee9a[_0xc78b('0x35')]['hasOwnProperty'](_0xc78b('0x3b'))){_0x589990[_0xc78b('0x20')]=qs[_0xc78b('0x20')](_0x3aee9a['query'][_0xc78b('0x20')]);_0x589990[_0xc78b('0x1d')]=qs['offset'](_0x3aee9a[_0xc78b('0x35')][_0xc78b('0x1d')]);}_0x589990[_0xc78b('0x3c')]=qs['sort'](_0x3aee9a[_0xc78b('0x35')]['sort']);_0x589990[_0xc78b('0x3d')]=qs[_0xc78b('0x37')](_['pick'](_0x3aee9a[_0xc78b('0x35')],_0x25b71f['filters']),_0x40d378);if(_0x3aee9a['query'][_0xc78b('0x3e')]){_0x589990['where']=_[_0xc78b('0x3f')](_0x589990['where'],{'$or':_[_0xc78b('0x30')](_0x40d378,function(_0x1cab17){if(_0x1cab17[_0xc78b('0x33')]!=='VIRTUAL'){var _0x53b82d={};_0x53b82d[_0x1cab17[_0xc78b('0x2d')]]={'$like':'%'+_0x3aee9a[_0xc78b('0x35')][_0xc78b('0x3e')]+'%'};return _0x53b82d;}})});}_0x589990=_[_0xc78b('0x3f')]({},_0x589990,_0x3aee9a[_0xc78b('0x40')]);var _0x350bdd={'where':_0x589990[_0xc78b('0x3d')]};return db[_0xc78b('0x41')][_0xc78b('0x1f')](_0x350bdd)['then'](function(_0x797979){_0x3a673e[_0xc78b('0x1f')]=_0x797979;if(_0x3aee9a[_0xc78b('0x35')][_0xc78b('0x42')]){_0x589990[_0xc78b('0x43')]=[{'all':!![]}];}return db[_0xc78b('0x41')]['findAll'](_0x589990);})[_0xc78b('0x27')](function(_0x47f709){_0x3a673e[_0xc78b('0x44')]=_0x47f709;return _0x3a673e;})[_0xc78b('0x27')](respondWithFilteredResult(_0x2c07bf,_0x589990))[_0xc78b('0x45')](handleError(_0x2c07bf,null));};exports[_0xc78b('0x46')]=function(_0x53aec8,_0x1b145c){var _0x4212b9={'raw':!![],'where':{'id':_0x53aec8[_0xc78b('0x47')]['id']}},_0x17636d={};_0x17636d['model']=_[_0xc78b('0x36')](db[_0xc78b('0x41')][_0xc78b('0x31')]);_0x17636d[_0xc78b('0x35')]=_['keys'](_0x53aec8['query']);_0x17636d[_0xc78b('0x37')]=_[_0xc78b('0x38')](_0x17636d['model'],_0x17636d['query']);_0x4212b9[_0xc78b('0x3a')]=_[_0xc78b('0x38')](_0x17636d[_0xc78b('0x34')],qs[_0xc78b('0x39')](_0x53aec8[_0xc78b('0x35')][_0xc78b('0x39')]));_0x4212b9[_0xc78b('0x3a')]=_0x4212b9[_0xc78b('0x3a')]['length']?_0x4212b9[_0xc78b('0x3a')]:_0x17636d[_0xc78b('0x34')];if(_0x53aec8['query'][_0xc78b('0x42')]){_0x4212b9[_0xc78b('0x43')]=[{'all':!![]}];}_0x4212b9=_[_0xc78b('0x3f')]({},_0x4212b9,_0x53aec8[_0xc78b('0x40')]);return db[_0xc78b('0x41')][_0xc78b('0x48')](_0x4212b9)[_0xc78b('0x27')](handleEntityNotFound(_0x1b145c,null))[_0xc78b('0x27')](respondWithResult(_0x1b145c,null))[_0xc78b('0x45')](handleError(_0x1b145c,null));};exports[_0xc78b('0x49')]=function(_0x25b32c,_0x132a31){return db[_0xc78b('0x41')][_0xc78b('0x49')](_0x25b32c[_0xc78b('0x4a')],{})[_0xc78b('0x27')](function(_0x47dff7){var _0x31b83e=_0x25b32c[_0xc78b('0x4b')][_0xc78b('0x29')]({'plain':!![]});if(!_0x31b83e)throw new Error(_0xc78b('0x4c'));if(_0x31b83e[_0xc78b('0x4d')]===_0xc78b('0x4b')){var _0x27510a=_0x47dff7[_0xc78b('0x29')]({'plain':!![]});var _0x3d1c09='ExtractedReports';return db[_0xc78b('0x4e')][_0xc78b('0x48')]({'where':{'name':_0x3d1c09,'userProfileId':_0x31b83e[_0xc78b('0x4f')]},'raw':!![]})[_0xc78b('0x27')](function(_0x25de67){if(_0x25de67&&_0x25de67[_0xc78b('0x50')]===0x0){return db['UserProfileResource'][_0xc78b('0x49')]({'name':_0x27510a[_0xc78b('0x2d')],'resourceId':_0x27510a['id'],'type':_0x25de67[_0xc78b('0x2d')],'sectionId':_0x25de67['id']},{})['then'](function(){return _0x47dff7;});}else{return _0x47dff7;}})[_0xc78b('0x45')](function(_0x4e197f){logger[_0xc78b('0x2b')](_0xc78b('0x51'),_0x4e197f);throw _0x4e197f;});}return _0x47dff7;})['then'](respondWithResult(_0x132a31,0xc9))['catch'](handleError(_0x132a31,null));};exports[_0xc78b('0x52')]=function(_0x189946,_0x37f930){if(_0x189946['body']['id']){delete _0x189946[_0xc78b('0x4a')]['id'];}return db[_0xc78b('0x41')]['find']({'where':{'id':_0x189946[_0xc78b('0x47')]['id']}})[_0xc78b('0x27')](handleEntityNotFound(_0x37f930,null))[_0xc78b('0x27')](saveUpdates(_0x189946[_0xc78b('0x4a')],null))[_0xc78b('0x27')](respondWithResult(_0x37f930,null))[_0xc78b('0x45')](handleError(_0x37f930,null));};exports['destroy']=function(_0x19a94a,_0x145e64){return db[_0xc78b('0x41')][_0xc78b('0x48')]({'where':{'id':_0x19a94a['params']['id']}})[_0xc78b('0x27')](handleEntityNotFound(_0x145e64,null))[_0xc78b('0x27')](removeEntity(_0x145e64,null))[_0xc78b('0x45')](handleError(_0x145e64,null));};exports[_0xc78b('0x53')]=function(_0xc629a,_0x9f6fd6,_0x2a3a15){return db[_0xc78b('0x41')][_0xc78b('0x48')]({'where':{'id':_0xc629a[_0xc78b('0x47')]['id']},'attributes':[_0xc78b('0x2d'),'basename',_0xc78b('0x54'),_0xc78b('0x55')],'raw':!![]})[_0xc78b('0x27')](handleEntityNotFound(_0x9f6fd6,null))[_0xc78b('0x27')](function(_0x56fab9){if(_0x56fab9){if(!fs[_0xc78b('0x56')](path[_0xc78b('0x57')](config[_0xc78b('0x58')],_0xc78b('0x59'),_0x56fab9['savename']))){throw new db[(_0xc78b('0x5a'))][(_0xc78b('0x5b'))](_0xc78b('0x5c'));}if(_0xc629a['query'][_0xc78b('0x5d')]){return _0x9f6fd6[_0xc78b('0x1a')](0xc8);}return _0x9f6fd6[_0xc78b('0x53')](path['join'](config[_0xc78b('0x58')],_0xc78b('0x59'),_0x56fab9[_0xc78b('0x54')]),util[_0xc78b('0x5e')]('%s.%s',_0x56fab9['basename']||_0x56fab9[_0xc78b('0x2d')],_0x56fab9['output'][_0xc78b('0x5f')]()));}})['catch'](handleError(_0x9f6fd6,null));};
\ No newline at end of file
+var _0xa593=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','AnalyticExtractedReport','rawAttributes','fieldName','key','model','map','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','filter','merge','options','includeAll','findAll','catch','show','keys','fields','include','find','body','user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x48de6b,_0x336431){var _0x501fcc=function(_0x4aa33b){while(--_0x4aa33b){_0x48de6b['push'](_0x48de6b['shift']());}};_0x501fcc(++_0x336431);}(_0xa593,0x175));var _0x3a59=function(_0x4d8f76,_0x2663fb){_0x4d8f76=_0x4d8f76-0x0;var _0x4a2345=_0xa593[_0x4d8f76];return _0x4a2345;};'use strict';var emlformat=require(_0x3a59('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a59('0x1'));var rp=require(_0x3a59('0x2'));var moment=require('moment');var BPromise=require(_0x3a59('0x3'));var Mustache=require(_0x3a59('0x4'));var util=require(_0x3a59('0x5'));var path=require(_0x3a59('0x6'));var sox=require('sox');var csv=require(_0x3a59('0x7'));var ejs=require(_0x3a59('0x8'));var fs=require('fs');var fs_extra=require(_0x3a59('0x9'));var _=require(_0x3a59('0xa'));var squel=require(_0x3a59('0xb'));var crypto=require(_0x3a59('0xc'));var jsforce=require(_0x3a59('0xd'));var deskjs=require(_0x3a59('0xe'));var toCsv=require(_0x3a59('0x7'));var querystring=require(_0x3a59('0xf'));var Papa=require('papaparse');var Redis=require(_0x3a59('0x10'));var authService=require(_0x3a59('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3a59('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a59('0x13'))(_0x3a59('0x14'));var utils=require(_0x3a59('0x15'));var config=require(_0x3a59('0x16'));var licenseUtil=require(_0x3a59('0x17'));var db=require(_0x3a59('0x18'))['db'];function respondWithStatusCode(_0x3f3006,_0x3e4ae7){_0x3e4ae7=_0x3e4ae7||0xcc;return function(_0x58d751){if(_0x58d751){return _0x3f3006[_0x3a59('0x19')](_0x3e4ae7);}return _0x3f3006[_0x3a59('0x1a')](_0x3e4ae7)[_0x3a59('0x1b')]();};}function respondWithResult(_0x514b5f,_0x5b21cf){_0x5b21cf=_0x5b21cf||0xc8;return function(_0x11cd01){if(_0x11cd01){return _0x514b5f[_0x3a59('0x1a')](_0x5b21cf)[_0x3a59('0x1c')](_0x11cd01);}};}function respondWithFilteredResult(_0xe5aadf,_0x301aa7){return function(_0x5205f6){if(_0x5205f6){var _0x23d94d=typeof _0x301aa7[_0x3a59('0x1d')]==='undefined'&&typeof _0x301aa7[_0x3a59('0x1e')]===_0x3a59('0x1f');var _0x5ea7af=_0x5205f6[_0x3a59('0x20')];var _0x1ad69b=_0x23d94d?0x0:_0x301aa7[_0x3a59('0x1d')];var _0x3eee23=_0x23d94d?_0x5205f6['count']:_0x301aa7['offset']+_0x301aa7[_0x3a59('0x1e')];var _0x3c27c6;if(_0x3eee23>=_0x5ea7af){_0x3eee23=_0x5ea7af;_0x3c27c6=0xc8;}else{_0x3c27c6=0xce;}_0xe5aadf[_0x3a59('0x1a')](_0x3c27c6);return _0xe5aadf[_0x3a59('0x21')](_0x3a59('0x22'),_0x1ad69b+'-'+_0x3eee23+'/'+_0x5ea7af)[_0x3a59('0x1c')](_0x5205f6);}return null;};}function patchUpdates(_0x19b7df){return function(_0x54c5fe){try{jsonpatch['apply'](_0x54c5fe,_0x19b7df,!![]);}catch(_0x48de4f){return BPromise[_0x3a59('0x23')](_0x48de4f);}return _0x54c5fe[_0x3a59('0x24')]();};}function saveUpdates(_0x56ded0,_0xd83e47){return function(_0x815e2){if(_0x815e2){return _0x815e2[_0x3a59('0x25')](_0x56ded0)[_0x3a59('0x26')](function(_0x41a1dc){return _0x41a1dc;});}return null;};}function removeEntity(_0x285930,_0x3d3168){return function(_0x5cd755){if(_0x5cd755){return _0x5cd755[_0x3a59('0x27')]()['then'](function(){var _0x4a14b2=_0x5cd755[_0x3a59('0x28')]({'plain':!![]});var _0x4723bb=_0x3a59('0x29');return db[_0x3a59('0x2a')][_0x3a59('0x27')]({'where':{'type':_0x4723bb,'resourceId':_0x4a14b2['id']}})[_0x3a59('0x26')](function(){return _0x5cd755;});})[_0x3a59('0x26')](function(){_0x285930[_0x3a59('0x1a')](0xcc)[_0x3a59('0x1b')]();});}};}function handleEntityNotFound(_0x3733bc,_0x5a8beb){return function(_0x45d584){if(!_0x45d584){_0x3733bc[_0x3a59('0x19')](0x194);}return _0x45d584;};}function handleError(_0x2fa478,_0x5c5132){_0x5c5132=_0x5c5132||0x1f4;return function(_0x3a8716){logger[_0x3a59('0x2b')](_0x3a8716['stack']);if(_0x3a8716[_0x3a59('0x2c')]){delete _0x3a8716[_0x3a59('0x2c')];}_0x2fa478[_0x3a59('0x1a')](_0x5c5132)['send'](_0x3a8716);};}exports['index']=function(_0x313047,_0x14d301){var _0x45af77={},_0x493550={},_0x6a6130={'count':0x0,'rows':[]};var _0x1d61d0=_['map'](db[_0x3a59('0x2d')][_0x3a59('0x2e')],function(_0x118e3d){return{'name':_0x118e3d[_0x3a59('0x2f')],'type':_0x118e3d['type'][_0x3a59('0x30')]};});_0x493550[_0x3a59('0x31')]=_[_0x3a59('0x32')](_0x1d61d0,_0x3a59('0x2c'));_0x493550[_0x3a59('0x33')]=_['keys'](_0x313047[_0x3a59('0x33')]);_0x493550['filters']=_[_0x3a59('0x34')](_0x493550[_0x3a59('0x31')],_0x493550[_0x3a59('0x33')]);_0x45af77[_0x3a59('0x35')]=_[_0x3a59('0x34')](_0x493550['model'],qs['fields'](_0x313047[_0x3a59('0x33')]['fields']));_0x45af77[_0x3a59('0x35')]=_0x45af77[_0x3a59('0x35')][_0x3a59('0x36')]?_0x45af77[_0x3a59('0x35')]:_0x493550[_0x3a59('0x31')];if(!_0x313047[_0x3a59('0x33')][_0x3a59('0x37')](_0x3a59('0x38'))){_0x45af77[_0x3a59('0x1e')]=qs['limit'](_0x313047[_0x3a59('0x33')][_0x3a59('0x1e')]);_0x45af77[_0x3a59('0x1d')]=qs['offset'](_0x313047[_0x3a59('0x33')]['offset']);}_0x45af77[_0x3a59('0x39')]=qs[_0x3a59('0x3a')](_0x313047['query']['sort']);_0x45af77[_0x3a59('0x3b')]=qs[_0x3a59('0x3c')](_[_0x3a59('0x3d')](_0x313047[_0x3a59('0x33')],_0x493550[_0x3a59('0x3c')]),_0x1d61d0);if(_0x313047[_0x3a59('0x33')]['filter']){_0x45af77[_0x3a59('0x3b')]=_['merge'](_0x45af77['where'],{'$or':_[_0x3a59('0x32')](_0x1d61d0,function(_0x4a2bf2){if(_0x4a2bf2[_0x3a59('0x3e')]!=='VIRTUAL'){var _0x412172={};_0x412172[_0x4a2bf2['name']]={'$like':'%'+_0x313047[_0x3a59('0x33')][_0x3a59('0x3f')]+'%'};return _0x412172;}})});}_0x45af77=_[_0x3a59('0x40')]({},_0x45af77,_0x313047[_0x3a59('0x41')]);var _0x164756={'where':_0x45af77[_0x3a59('0x3b')]};return db['AnalyticExtractedReport'][_0x3a59('0x20')](_0x164756)[_0x3a59('0x26')](function(_0x12acf7){_0x6a6130[_0x3a59('0x20')]=_0x12acf7;if(_0x313047[_0x3a59('0x33')][_0x3a59('0x42')]){_0x45af77['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x3a59('0x43')](_0x45af77);})[_0x3a59('0x26')](function(_0x4b9494){_0x6a6130['rows']=_0x4b9494;return _0x6a6130;})[_0x3a59('0x26')](respondWithFilteredResult(_0x14d301,_0x45af77))[_0x3a59('0x44')](handleError(_0x14d301,null));};exports[_0x3a59('0x45')]=function(_0x335243,_0x47a32f){var _0x477beb={'raw':!![],'where':{'id':_0x335243['params']['id']}},_0x135c3b={};_0x135c3b[_0x3a59('0x31')]=_[_0x3a59('0x46')](db['AnalyticExtractedReport']['rawAttributes']);_0x135c3b[_0x3a59('0x33')]=_[_0x3a59('0x46')](_0x335243[_0x3a59('0x33')]);_0x135c3b[_0x3a59('0x3c')]=_[_0x3a59('0x34')](_0x135c3b[_0x3a59('0x31')],_0x135c3b['query']);_0x477beb['attributes']=_[_0x3a59('0x34')](_0x135c3b[_0x3a59('0x31')],qs['fields'](_0x335243[_0x3a59('0x33')][_0x3a59('0x47')]));_0x477beb[_0x3a59('0x35')]=_0x477beb[_0x3a59('0x35')][_0x3a59('0x36')]?_0x477beb[_0x3a59('0x35')]:_0x135c3b[_0x3a59('0x31')];if(_0x335243['query']['includeAll']){_0x477beb[_0x3a59('0x48')]=[{'all':!![]}];}_0x477beb=_['merge']({},_0x477beb,_0x335243['options']);return db[_0x3a59('0x2d')][_0x3a59('0x49')](_0x477beb)[_0x3a59('0x26')](handleEntityNotFound(_0x47a32f,null))[_0x3a59('0x26')](respondWithResult(_0x47a32f,null))[_0x3a59('0x44')](handleError(_0x47a32f,null));};exports['create']=function(_0x51f62f,_0x535006){return db['AnalyticExtractedReport']['create'](_0x51f62f[_0x3a59('0x4a')],{})['then'](function(_0x230706){var _0x1e70ae=_0x51f62f[_0x3a59('0x4b')][_0x3a59('0x28')]({'plain':!![]});if(!_0x1e70ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e70ae[_0x3a59('0x4c')]===_0x3a59('0x4b')){var _0x215471=_0x230706[_0x3a59('0x28')]({'plain':!![]});var _0x443930=_0x3a59('0x29');return db[_0x3a59('0x4d')][_0x3a59('0x49')]({'where':{'name':_0x443930,'userProfileId':_0x1e70ae['userProfileId']},'raw':!![]})['then'](function(_0x2a0385){if(_0x2a0385&&_0x2a0385['autoAssociation']===0x0){return db['UserProfileResource'][_0x3a59('0x4e')]({'name':_0x215471['name'],'resourceId':_0x215471['id'],'type':_0x2a0385[_0x3a59('0x2c')],'sectionId':_0x2a0385['id']},{})[_0x3a59('0x26')](function(){return _0x230706;});}else{return _0x230706;}})[_0x3a59('0x44')](function(_0x5ab818){logger[_0x3a59('0x2b')](_0x3a59('0x4f'),_0x5ab818);throw _0x5ab818;});}return _0x230706;})[_0x3a59('0x26')](respondWithResult(_0x535006,0xc9))[_0x3a59('0x44')](handleError(_0x535006,null));};exports[_0x3a59('0x25')]=function(_0x347417,_0x59a03c){if(_0x347417[_0x3a59('0x4a')]['id']){delete _0x347417['body']['id'];}return db[_0x3a59('0x2d')][_0x3a59('0x49')]({'where':{'id':_0x347417[_0x3a59('0x50')]['id']}})['then'](handleEntityNotFound(_0x59a03c,null))[_0x3a59('0x26')](saveUpdates(_0x347417[_0x3a59('0x4a')],null))[_0x3a59('0x26')](respondWithResult(_0x59a03c,null))['catch'](handleError(_0x59a03c,null));};exports['destroy']=function(_0x1e924a,_0x3df7ee){return db[_0x3a59('0x2d')][_0x3a59('0x49')]({'where':{'id':_0x1e924a[_0x3a59('0x50')]['id']}})[_0x3a59('0x26')](handleEntityNotFound(_0x3df7ee,null))[_0x3a59('0x26')](removeEntity(_0x3df7ee,null))[_0x3a59('0x44')](handleError(_0x3df7ee,null));};exports[_0x3a59('0x51')]=function(_0x4bcb85,_0x2c1185,_0x4b9220){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4bcb85[_0x3a59('0x50')]['id']},'attributes':[_0x3a59('0x2c'),_0x3a59('0x52'),_0x3a59('0x53'),_0x3a59('0x54')],'raw':!![]})[_0x3a59('0x26')](handleEntityNotFound(_0x2c1185,null))[_0x3a59('0x26')](function(_0x491403){if(_0x491403){if(!fs[_0x3a59('0x55')](path[_0x3a59('0x56')](config[_0x3a59('0x57')],_0x3a59('0x58'),_0x491403[_0x3a59('0x53')]))){throw new db[(_0x3a59('0x59'))][(_0x3a59('0x5a'))](_0x3a59('0x5b'));}if(_0x4bcb85['query'][_0x3a59('0x5c')]){return _0x2c1185['sendStatus'](0xc8);}return _0x2c1185[_0x3a59('0x51')](path['join'](config[_0x3a59('0x57')],'server/files/reports',_0x491403[_0x3a59('0x53')]),util['format'](_0x3a59('0x5d'),_0x491403['basename']||_0x491403[_0x3a59('0x2c')],_0x491403[_0x3a59('0x54')][_0x3a59('0x5e')]()));}})['catch'](handleError(_0x2c1185,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 92adae3..1222d71 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 _0x005c=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1bec0d,_0x338db4){var _0x49e3e3=function(_0x372c7a){while(--_0x372c7a){_0x1bec0d['push'](_0x1bec0d['shift']());}};_0x49e3e3(++_0x338db4);}(_0x005c,0xfe));var _0xc005=function(_0x127282,_0x5c6feb){_0x127282=_0x127282-0x0;var _0x1a04fe=_0x005c[_0x127282];return _0x1a04fe;};'use strict';var _=require('lodash');var util=require(_0xc005('0x0'));var logger=require(_0xc005('0x1'))(_0xc005('0x2'));var moment=require('moment');var BPromise=require(_0xc005('0x3'));var rp=require(_0xc005('0x4'));var fs=require('fs');var path=require(_0xc005('0x5'));var rimraf=require(_0xc005('0x6'));var config=require(_0xc005('0x7'));var attributes=require(_0xc005('0x8'));module[_0xc005('0x9')]=function(_0x5519c2,_0x829e88){return _0x5519c2[_0xc005('0xa')](_0xc005('0xb'),attributes,{'tableName':_0xc005('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a15=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird','path'];(function(_0x4eeb93,_0x197bcf){var _0x58a715=function(_0x54491c){while(--_0x54491c){_0x4eeb93['push'](_0x4eeb93['shift']());}};_0x58a715(++_0x197bcf);}(_0x2a15,0x132));var _0x52a1=function(_0x210b5e,_0x13cec9){_0x210b5e=_0x210b5e-0x0;var _0x1bc407=_0x2a15[_0x210b5e];return _0x1bc407;};'use strict';var _=require(_0x52a1('0x0'));var util=require(_0x52a1('0x1'));var logger=require('../../config/logger')(_0x52a1('0x2'));var moment=require(_0x52a1('0x3'));var BPromise=require(_0x52a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52a1('0x5'));var rimraf=require(_0x52a1('0x6'));var config=require(_0x52a1('0x7'));var attributes=require(_0x52a1('0x8'));module[_0x52a1('0x9')]=function(_0x178275,_0x53ca5e){return _0x178275[_0x52a1('0xa')](_0x52a1('0xb'),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 1ef311c..4dbba91 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 _0xe1aa=['request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x2c1aa8,_0x3e0609){var _0x4019f5=function(_0x916eac){while(--_0x916eac){_0x2c1aa8['push'](_0x2c1aa8['shift']());}};_0x4019f5(++_0x3e0609);}(_0xe1aa,0x156));var _0xae1a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe1aa[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xae1a('0x0'));var moment=require(_0xae1a('0x1'));var BPromise=require(_0xae1a('0x2'));var rs=require(_0xae1a('0x3'));var fs=require('fs');var Redis=require(_0xae1a('0x4'));var db=require(_0xae1a('0x5'))['db'];var utils=require(_0xae1a('0x6'));var logger=require(_0xae1a('0x7'))(_0xae1a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae1a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46d3f7,_0x40b3b5,_0x516826){return new BPromise(function(_0x2deb85,_0x2706e0){return client[_0xae1a('0xa')](_0x46d3f7,_0x516826)[_0xae1a('0xb')](function(_0x5d7540){logger[_0xae1a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x40b3b5,_0xae1a('0xd'));logger[_0xae1a('0xe')](_0xae1a('0xf'),_0x40b3b5,'request\x20sent',JSON[_0xae1a('0x10')](_0x5d7540));if(_0x5d7540[_0xae1a('0x11')]){if(_0x5d7540[_0xae1a('0x11')]['code']===0x1f4){logger[_0xae1a('0x11')](_0xae1a('0x12'),_0x40b3b5,_0x5d7540[_0xae1a('0x11')]['message']);return _0x2706e0(_0x5d7540[_0xae1a('0x11')][_0xae1a('0x13')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x40b3b5,_0x5d7540['error'][_0xae1a('0x13')]);return _0x2deb85(_0x5d7540[_0xae1a('0x11')]['message']);}else{logger['info'](_0xae1a('0x12'),_0x40b3b5,_0xae1a('0xd'));_0x2deb85(_0x5d7540[_0xae1a('0x14')][_0xae1a('0x13')]);}})[_0xae1a('0x15')](function(_0x10eaf1){logger[_0xae1a('0x11')](_0xae1a('0x12'),_0x40b3b5,_0x10eaf1);_0x2706e0(_0x10eaf1);});});}
\ No newline at end of file
+var _0xf7e5=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','util'];(function(_0x2aeb2f,_0x2fbc20){var _0x34ada2=function(_0x1905c2){while(--_0x1905c2){_0x2aeb2f['push'](_0x2aeb2f['shift']());}};_0x34ada2(++_0x2fbc20);}(_0xf7e5,0x7d));var _0x5f7e=function(_0x406c91,_0x5efff1){_0x406c91=_0x406c91-0x0;var _0x4ee6fa=_0xf7e5[_0x406c91];return _0x4ee6fa;};'use strict';var _=require('lodash');var util=require(_0x5f7e('0x0'));var moment=require(_0x5f7e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f7e('0x2'));var db=require(_0x5f7e('0x3'))['db'];var utils=require(_0x5f7e('0x4'));var logger=require(_0x5f7e('0x5'))(_0x5f7e('0x6'));var config=require(_0x5f7e('0x7'));var jayson=require(_0x5f7e('0x8'));var client=jayson[_0x5f7e('0x9')][_0x5f7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d2751,_0x509fd5,_0x186646){return new BPromise(function(_0xf2902e,_0x4a1ea2){return client['request'](_0x5d2751,_0x186646)[_0x5f7e('0xb')](function(_0xbabec1){logger[_0x5f7e('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x509fd5,_0x5f7e('0xd'));logger[_0x5f7e('0xe')](_0x5f7e('0xf'),_0x509fd5,_0x5f7e('0xd'),JSON[_0x5f7e('0x10')](_0xbabec1));if(_0xbabec1[_0x5f7e('0x11')]){if(_0xbabec1[_0x5f7e('0x11')]['code']===0x1f4){logger[_0x5f7e('0x11')](_0x5f7e('0x12'),_0x509fd5,_0xbabec1[_0x5f7e('0x11')][_0x5f7e('0x13')]);return _0x4a1ea2(_0xbabec1[_0x5f7e('0x11')]['message']);}logger[_0x5f7e('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x509fd5,_0xbabec1['error']['message']);return _0xf2902e(_0xbabec1[_0x5f7e('0x11')][_0x5f7e('0x13')]);}else{logger[_0x5f7e('0xc')](_0x5f7e('0x12'),_0x509fd5,'request\x20sent');_0xf2902e(_0xbabec1['result'][_0x5f7e('0x13')]);}})[_0x5f7e('0x14')](function(_0x2da1cb){logger[_0x5f7e('0x11')](_0x5f7e('0x12'),_0x509fd5,_0x2da1cb);_0x4a1ea2(_0x2da1cb);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index d4ffdcb..d834924 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 _0x42c4=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','/:id/download','download','post','put','update','delete'];(function(_0x45bbd9,_0x1ff0ee){var _0x4b535e=function(_0x4d3960){while(--_0x4d3960){_0x45bbd9['push'](_0x45bbd9['shift']());}};_0x4b535e(++_0x1ff0ee);}(_0x42c4,0x1ce));var _0x442c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42c4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x442c('0x0'));var util=require(_0x442c('0x1'));var path=require('path');var timeout=require(_0x442c('0x2'));var express=require(_0x442c('0x3'));var router=express[_0x442c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x442c('0x5'));var interaction=require(_0x442c('0x6'));var config=require(_0x442c('0x7'));var controller=require(_0x442c('0x8'));router[_0x442c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x442c('0x9')](_0x442c('0xa'),auth[_0x442c('0xb')](),controller['show']);router[_0x442c('0x9')](_0x442c('0xc'),auth['isAuthenticated'](),controller[_0x442c('0xd')]);router[_0x442c('0xe')]('/',auth[_0x442c('0xb')](),controller['create']);router[_0x442c('0xf')]('/:id',auth[_0x442c('0xb')](),controller[_0x442c('0x10')]);router[_0x442c('0x11')](_0x442c('0xa'),auth[_0x442c('0xb')](),controller[_0x442c('0x12')]);module[_0x442c('0x13')]=router;
\ No newline at end of file
+var _0xc706=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','download','post','create','put','destroy','exports','multer'];(function(_0x34d38c,_0x4f1295){var _0x4be108=function(_0x263e0f){while(--_0x263e0f){_0x34d38c['push'](_0x34d38c['shift']());}};_0x4be108(++_0x4f1295);}(_0xc706,0xe9));var _0x6c70=function(_0x575c17,_0x58cf05){_0x575c17=_0x575c17-0x0;var _0x4be569=_0xc706[_0x575c17];return _0x4be569;};'use strict';var multer=require(_0x6c70('0x0'));var util=require(_0x6c70('0x1'));var path=require(_0x6c70('0x2'));var timeout=require(_0x6c70('0x3'));var express=require('express');var router=express[_0x6c70('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6c70('0x5'));var interaction=require(_0x6c70('0x6'));var config=require('../../config/environment');var controller=require(_0x6c70('0x7'));router[_0x6c70('0x8')]('/',auth[_0x6c70('0x9')](),controller['index']);router[_0x6c70('0x8')](_0x6c70('0xa'),auth[_0x6c70('0x9')](),controller['show']);router['get'](_0x6c70('0xb'),auth[_0x6c70('0x9')](),controller[_0x6c70('0xc')]);router[_0x6c70('0xd')]('/',auth[_0x6c70('0x9')](),controller[_0x6c70('0xe')]);router[_0x6c70('0xf')](_0x6c70('0xa'),auth[_0x6c70('0x9')](),controller['update']);router['delete'](_0x6c70('0xa'),auth['isAuthenticated'](),controller[_0x6c70('0x10')]);module[_0x6c70('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 893a41b..be421cf 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 _0x46a6=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x34d28b,_0x410e14){var _0x2ab511=function(_0x4f3d87){while(--_0x4f3d87){_0x34d28b['push'](_0x34d28b['shift']());}};_0x2ab511(++_0x410e14);}(_0x46a6,0x107));var _0x646a=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x46a6[_0x2af29a];return _0x5ef02f;};'use strict';var Sequelize=require(_0x646a('0x0'));module['exports']={'field':{'type':Sequelize[_0x646a('0x1')]},'alias':{'type':Sequelize[_0x646a('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x646a('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x646a('0x2')]},'custom':{'type':Sequelize[_0x646a('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0a8a=['exports','TEXT','STRING','BOOLEAN'];(function(_0x36ca1f,_0x469b9e){var _0x2df6e1=function(_0x33db68){while(--_0x33db68){_0x36ca1f['push'](_0x36ca1f['shift']());}};_0x2df6e1(++_0x469b9e);}(_0x0a8a,0x1b8));var _0xa0a8=function(_0x568db3,_0x24395d){_0x568db3=_0x568db3-0x0;var _0x58c38b=_0x0a8a[_0x568db3];return _0x58c38b;};'use strict';var Sequelize=require('sequelize');module[_0xa0a8('0x0')]={'field':{'type':Sequelize[_0xa0a8('0x1')]},'alias':{'type':Sequelize[_0xa0a8('0x2')]},'function':{'type':Sequelize[_0xa0a8('0x2')]},'format':{'type':Sequelize[_0xa0a8('0x2')]},'groupBy':{'type':Sequelize[_0xa0a8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa0a8('0x2')]},'custom':{'type':Sequelize[_0xa0a8('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index db0dfc7..44e50b0 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 _0x9681=['../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','apply','reject','update','destroy','error','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','then','rows','catch','show','params','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4e231f,_0x315a9e){var _0x43a501=function(_0x58bdbb){while(--_0x58bdbb){_0x4e231f['push'](_0x4e231f['shift']());}};_0x43a501(++_0x315a9e);}(_0x9681,0xdc));var _0x1968=function(_0x59dbe9,_0x4fa7ff){_0x59dbe9=_0x59dbe9-0x0;var _0x299742=_0x9681[_0x59dbe9];return _0x299742;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1968('0x0'));var zipdir=require(_0x1968('0x1'));var jsonpatch=require(_0x1968('0x2'));var rp=require(_0x1968('0x3'));var moment=require(_0x1968('0x4'));var BPromise=require(_0x1968('0x5'));var Mustache=require(_0x1968('0x6'));var util=require('util');var path=require(_0x1968('0x7'));var sox=require(_0x1968('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1968('0x9'));var squel=require('squel');var crypto=require(_0x1968('0xa'));var jsforce=require(_0x1968('0xb'));var deskjs=require(_0x1968('0xc'));var toCsv=require(_0x1968('0xd'));var querystring=require(_0x1968('0xe'));var Papa=require(_0x1968('0xf'));var Redis=require(_0x1968('0x10'));var authService=require(_0x1968('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1968('0x12'));var hardwareService=require(_0x1968('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1968('0x14'));var config=require(_0x1968('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x307827,_0x1807de){_0x1807de=_0x1807de||0xcc;return function(_0x260a64){if(_0x260a64){return _0x307827[_0x1968('0x16')](_0x1807de);}return _0x307827[_0x1968('0x17')](_0x1807de)[_0x1968('0x18')]();};}function respondWithResult(_0x4d2021,_0x32a567){_0x32a567=_0x32a567||0xc8;return function(_0x2d97b8){if(_0x2d97b8){return _0x4d2021[_0x1968('0x17')](_0x32a567)[_0x1968('0x19')](_0x2d97b8);}};}function respondWithFilteredResult(_0x7348c1,_0x470d77){return function(_0x1b599d){if(_0x1b599d){var _0x246a1b=typeof _0x470d77[_0x1968('0x1a')]==='undefined'&&typeof _0x470d77[_0x1968('0x1b')]==='undefined';var _0x383e31=_0x1b599d[_0x1968('0x1c')];var _0x57b8b3=_0x246a1b?0x0:_0x470d77[_0x1968('0x1a')];var _0xd09671=_0x246a1b?_0x1b599d['count']:_0x470d77['offset']+_0x470d77[_0x1968('0x1b')];var _0xcb20a;if(_0xd09671>=_0x383e31){_0xd09671=_0x383e31;_0xcb20a=0xc8;}else{_0xcb20a=0xce;}_0x7348c1[_0x1968('0x17')](_0xcb20a);return _0x7348c1[_0x1968('0x1d')]('Content-Range',_0x57b8b3+'-'+_0xd09671+'/'+_0x383e31)['json'](_0x1b599d);}return null;};}function patchUpdates(_0x1277a2){return function(_0x13db42){try{jsonpatch[_0x1968('0x1e')](_0x13db42,_0x1277a2,!![]);}catch(_0x5c2549){return BPromise[_0x1968('0x1f')](_0x5c2549);}return _0x13db42['save']();};}function saveUpdates(_0x1f5fa0,_0x55ed53){return function(_0xd4705c){if(_0xd4705c){return _0xd4705c[_0x1968('0x20')](_0x1f5fa0)['then'](function(_0x4ec8ea){return _0x4ec8ea;});}return null;};}function removeEntity(_0x5b1f55,_0x5a85db){return function(_0x4da3db){if(_0x4da3db){return _0x4da3db[_0x1968('0x21')]()['then'](function(){_0x5b1f55[_0x1968('0x17')](0xcc)[_0x1968('0x18')]();});}};}function handleEntityNotFound(_0x51ad81,_0x31f961){return function(_0x18952b){if(!_0x18952b){_0x51ad81[_0x1968('0x16')](0x194);}return _0x18952b;};}function handleError(_0xef86e8,_0xeeb8df){_0xeeb8df=_0xeeb8df||0x1f4;return function(_0x4649e5){logger[_0x1968('0x22')](_0x4649e5['stack']);if(_0x4649e5[_0x1968('0x23')]){delete _0x4649e5[_0x1968('0x23')];}_0xef86e8[_0x1968('0x17')](_0xeeb8df)[_0x1968('0x24')](_0x4649e5);};}exports[_0x1968('0x25')]=function(_0x366afc,_0x2b5b7e){var _0x169fd0={},_0x455bd6={},_0x1b5fdc={'count':0x0,'rows':[]};var _0x4a395e=_['map'](db[_0x1968('0x26')][_0x1968('0x27')],function(_0x5ba8fe){return{'name':_0x5ba8fe[_0x1968('0x28')],'type':_0x5ba8fe['type'][_0x1968('0x29')]};});_0x455bd6[_0x1968('0x2a')]=_[_0x1968('0x2b')](_0x4a395e,_0x1968('0x23'));_0x455bd6[_0x1968('0x2c')]=_[_0x1968('0x2d')](_0x366afc[_0x1968('0x2c')]);_0x455bd6[_0x1968('0x2e')]=_['intersection'](_0x455bd6[_0x1968('0x2a')],_0x455bd6[_0x1968('0x2c')]);_0x169fd0[_0x1968('0x2f')]=_[_0x1968('0x30')](_0x455bd6[_0x1968('0x2a')],qs['fields'](_0x366afc[_0x1968('0x2c')][_0x1968('0x31')]));_0x169fd0[_0x1968('0x2f')]=_0x169fd0[_0x1968('0x2f')][_0x1968('0x32')]?_0x169fd0[_0x1968('0x2f')]:_0x455bd6[_0x1968('0x2a')];if(!_0x366afc['query']['hasOwnProperty'](_0x1968('0x33'))){_0x169fd0[_0x1968('0x1b')]=qs[_0x1968('0x1b')](_0x366afc[_0x1968('0x2c')][_0x1968('0x1b')]);_0x169fd0[_0x1968('0x1a')]=qs[_0x1968('0x1a')](_0x366afc[_0x1968('0x2c')][_0x1968('0x1a')]);}_0x169fd0[_0x1968('0x34')]=qs[_0x1968('0x35')](_0x366afc['query'][_0x1968('0x35')]);_0x169fd0[_0x1968('0x36')]=qs[_0x1968('0x2e')](_['pick'](_0x366afc['query'],_0x455bd6['filters']),_0x4a395e);if(_0x366afc[_0x1968('0x2c')][_0x1968('0x37')]){_0x169fd0[_0x1968('0x36')]=_[_0x1968('0x38')](_0x169fd0[_0x1968('0x36')],{'$or':_[_0x1968('0x2b')](_0x4a395e,function(_0x35e0b2){if(_0x35e0b2[_0x1968('0x39')]!==_0x1968('0x3a')){var _0x5331ac={};_0x5331ac[_0x35e0b2['name']]={'$like':'%'+_0x366afc[_0x1968('0x2c')][_0x1968('0x37')]+'%'};return _0x5331ac;}})});}_0x169fd0=_[_0x1968('0x38')]({},_0x169fd0,_0x366afc['options']);var _0x11cfaf={'where':_0x169fd0[_0x1968('0x36')]};return db[_0x1968('0x26')][_0x1968('0x1c')](_0x11cfaf)['then'](function(_0x83a274){_0x1b5fdc[_0x1968('0x1c')]=_0x83a274;if(_0x366afc[_0x1968('0x2c')][_0x1968('0x3b')]){_0x169fd0[_0x1968('0x3c')]=[{'all':!![]}];}return db[_0x1968('0x26')][_0x1968('0x3d')](_0x169fd0);})[_0x1968('0x3e')](function(_0x3bf010){_0x1b5fdc[_0x1968('0x3f')]=_0x3bf010;return _0x1b5fdc;})['then'](respondWithFilteredResult(_0x2b5b7e,_0x169fd0))[_0x1968('0x40')](handleError(_0x2b5b7e,null));};exports[_0x1968('0x41')]=function(_0x3a1952,_0x487c79){var _0x21f53c={'raw':![],'where':{'id':_0x3a1952[_0x1968('0x42')]['id']}},_0x48003c={};_0x48003c[_0x1968('0x2a')]=_[_0x1968('0x2d')](db[_0x1968('0x26')][_0x1968('0x27')]);_0x48003c['query']=_[_0x1968('0x2d')](_0x3a1952['query']);_0x48003c[_0x1968('0x2e')]=_[_0x1968('0x30')](_0x48003c[_0x1968('0x2a')],_0x48003c[_0x1968('0x2c')]);_0x21f53c[_0x1968('0x2f')]=_[_0x1968('0x30')](_0x48003c[_0x1968('0x2a')],qs['fields'](_0x3a1952[_0x1968('0x2c')]['fields']));_0x21f53c['attributes']=_0x21f53c[_0x1968('0x2f')][_0x1968('0x32')]?_0x21f53c[_0x1968('0x2f')]:_0x48003c[_0x1968('0x2a')];if(_0x3a1952[_0x1968('0x2c')]['includeAll']){_0x21f53c['include']=[{'all':!![]}];}_0x21f53c=_[_0x1968('0x38')]({},_0x21f53c,_0x3a1952[_0x1968('0x43')]);return db[_0x1968('0x26')][_0x1968('0x44')](_0x21f53c)['then'](handleEntityNotFound(_0x487c79,null))['then'](respondWithResult(_0x487c79,null))[_0x1968('0x40')](handleError(_0x487c79,null));};exports[_0x1968('0x45')]=function(_0x35e74c,_0x3dfc1c){return db[_0x1968('0x26')]['create'](_0x35e74c[_0x1968('0x46')],{})['then'](respondWithResult(_0x3dfc1c,0xc9))[_0x1968('0x40')](handleError(_0x3dfc1c,null));};exports[_0x1968('0x47')]=function(_0x27ca98,_0x4d5801){return db[_0x1968('0x26')]['bulkCreate'](_0x27ca98[_0x1968('0x46')],{'raw':![],'individualHooks':!![]})[_0x1968('0x3e')](respondWithResult(_0x4d5801,0xc9))[_0x1968('0x40')](handleError(_0x4d5801,null));};exports['update']=function(_0x1896e4,_0x201264){if(_0x1896e4[_0x1968('0x46')]['id']){delete _0x1896e4['body']['id'];}return db[_0x1968('0x26')][_0x1968('0x44')]({'where':{'id':_0x1896e4[_0x1968('0x42')]['id']}})[_0x1968('0x3e')](handleEntityNotFound(_0x201264,null))[_0x1968('0x3e')](saveUpdates(_0x1896e4[_0x1968('0x46')],null))[_0x1968('0x3e')](respondWithResult(_0x201264,null))['catch'](handleError(_0x201264,null));};exports[_0x1968('0x21')]=function(_0x5c4403,_0x20c428){return db[_0x1968('0x26')][_0x1968('0x44')]({'where':{'id':_0x5c4403[_0x1968('0x42')]['id']}})[_0x1968('0x3e')](handleEntityNotFound(_0x20c428,null))['then'](removeEntity(_0x20c428,null))[_0x1968('0x40')](handleError(_0x20c428,null));};exports[_0x1968('0x48')]=function(_0x5d9079,_0x5a46ce){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x5d9079['query'][_0x1968('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x1968('0x3e')](respondWithResult(_0x5a46ce,0xcc))[_0x1968('0x40')](handleError(_0x5a46ce,null));};exports[_0x1968('0x4a')]=function(_0x8f5fe2,_0x2ab44f,_0x4891aa){return db[_0x1968('0x4b')][_0x1968('0x4c')]({'where':{'id':_0x8f5fe2[_0x1968('0x42')]['id']}})[_0x1968('0x3e')](handleEntityNotFound(_0x2ab44f,null))['then'](function(_0x47bdab){if(_0x47bdab){return db[_0x1968('0x4d')][_0x1968('0x4e')](function(_0x34ac0b){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x8f5fe2[_0x1968('0x42')]['id']},'transaction':_0x34ac0b})[_0x1968('0x3e')](function(_0x449a21){var _0x395d1a=_[_0x1968('0x2b')](_0x8f5fe2[_0x1968('0x46')],function(_0x37892a){delete _0x37892a['id'];_0x37892a[_0x1968('0x4f')]=_0x8f5fe2[_0x1968('0x42')]['id'];return _0x37892a;});return db['AnalyticFieldReport'][_0x1968('0x47')](_0x395d1a,{'transaction':_0x34ac0b});});})['then'](function(){return db[_0x1968('0x26')][_0x1968('0x3d')]({'where':{'CustomReportId':_0x8f5fe2[_0x1968('0x42')]['id']}});});}})[_0x1968('0x3e')](respondWithResult(_0x2ab44f,null))[_0x1968('0x40')](handleError(_0x2ab44f,null));};
\ No newline at end of file
+var _0x2f21=['moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','json','undefined','limit','offset','count','status','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','bulkCreate','bulkDestroy','destroy','ids','AnalyticCustomReport','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x2f21,0xf2));var _0x12f2=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x2f21[_0x487b0c];return _0x1adbdc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12f2('0x0'));var zipdir=require(_0x12f2('0x1'));var jsonpatch=require(_0x12f2('0x2'));var rp=require(_0x12f2('0x3'));var moment=require(_0x12f2('0x4'));var BPromise=require(_0x12f2('0x5'));var Mustache=require('mustache');var util=require(_0x12f2('0x6'));var path=require(_0x12f2('0x7'));var sox=require(_0x12f2('0x8'));var csv=require(_0x12f2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x12f2('0xa'));var _=require(_0x12f2('0xb'));var squel=require(_0x12f2('0xc'));var crypto=require(_0x12f2('0xd'));var jsforce=require(_0x12f2('0xe'));var deskjs=require(_0x12f2('0xf'));var toCsv=require(_0x12f2('0x9'));var querystring=require(_0x12f2('0x10'));var Papa=require(_0x12f2('0x11'));var Redis=require(_0x12f2('0x12'));var authService=require(_0x12f2('0x13'));var qs=require(_0x12f2('0x14'));var as=require(_0x12f2('0x15'));var hardwareService=require(_0x12f2('0x16'));var logger=require('../../config/logger')(_0x12f2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x12f2('0x18'));var db=require(_0x12f2('0x19'))['db'];function respondWithStatusCode(_0x33a358,_0x40695a){_0x40695a=_0x40695a||0xcc;return function(_0x51d2fb){if(_0x51d2fb){return _0x33a358['sendStatus'](_0x40695a);}return _0x33a358['status'](_0x40695a)[_0x12f2('0x1a')]();};}function respondWithResult(_0x1e11cd,_0x8d9942){_0x8d9942=_0x8d9942||0xc8;return function(_0x55d0b8){if(_0x55d0b8){return _0x1e11cd['status'](_0x8d9942)[_0x12f2('0x1b')](_0x55d0b8);}};}function respondWithFilteredResult(_0x161f5b,_0x4834bc){return function(_0x5745f8){if(_0x5745f8){var _0x2dffb5=typeof _0x4834bc['offset']===_0x12f2('0x1c')&&typeof _0x4834bc[_0x12f2('0x1d')]===_0x12f2('0x1c');var _0x492732=_0x5745f8['count'];var _0x5d4e5e=_0x2dffb5?0x0:_0x4834bc[_0x12f2('0x1e')];var _0x36b698=_0x2dffb5?_0x5745f8[_0x12f2('0x1f')]:_0x4834bc[_0x12f2('0x1e')]+_0x4834bc['limit'];var _0x1d0609;if(_0x36b698>=_0x492732){_0x36b698=_0x492732;_0x1d0609=0xc8;}else{_0x1d0609=0xce;}_0x161f5b[_0x12f2('0x20')](_0x1d0609);return _0x161f5b['set']('Content-Range',_0x5d4e5e+'-'+_0x36b698+'/'+_0x492732)[_0x12f2('0x1b')](_0x5745f8);}return null;};}function patchUpdates(_0x42e315){return function(_0x3dc048){try{jsonpatch[_0x12f2('0x21')](_0x3dc048,_0x42e315,!![]);}catch(_0x68672f){return BPromise[_0x12f2('0x22')](_0x68672f);}return _0x3dc048[_0x12f2('0x23')]();};}function saveUpdates(_0x18f2a9,_0x4a6d5d){return function(_0x3a2113){if(_0x3a2113){return _0x3a2113[_0x12f2('0x24')](_0x18f2a9)[_0x12f2('0x25')](function(_0x391f75){return _0x391f75;});}return null;};}function removeEntity(_0x521bff,_0x364def){return function(_0x4adf0c){if(_0x4adf0c){return _0x4adf0c['destroy']()['then'](function(){_0x521bff[_0x12f2('0x20')](0xcc)[_0x12f2('0x1a')]();});}};}function handleEntityNotFound(_0x2a4c61,_0x2223ce){return function(_0x302454){if(!_0x302454){_0x2a4c61[_0x12f2('0x26')](0x194);}return _0x302454;};}function handleError(_0x5a4c8d,_0x1f3cbb){_0x1f3cbb=_0x1f3cbb||0x1f4;return function(_0x53d788){logger[_0x12f2('0x27')](_0x53d788[_0x12f2('0x28')]);if(_0x53d788[_0x12f2('0x29')]){delete _0x53d788[_0x12f2('0x29')];}_0x5a4c8d[_0x12f2('0x20')](_0x1f3cbb)[_0x12f2('0x2a')](_0x53d788);};}exports[_0x12f2('0x2b')]=function(_0x40246e,_0x38b815){var _0x595724={},_0x5c05fb={},_0x5ec16d={'count':0x0,'rows':[]};var _0x53032b=_[_0x12f2('0x2c')](db[_0x12f2('0x2d')][_0x12f2('0x2e')],function(_0x23cdf0){return{'name':_0x23cdf0[_0x12f2('0x2f')],'type':_0x23cdf0[_0x12f2('0x30')][_0x12f2('0x31')]};});_0x5c05fb[_0x12f2('0x32')]=_[_0x12f2('0x2c')](_0x53032b,_0x12f2('0x29'));_0x5c05fb[_0x12f2('0x33')]=_[_0x12f2('0x34')](_0x40246e[_0x12f2('0x33')]);_0x5c05fb[_0x12f2('0x35')]=_[_0x12f2('0x36')](_0x5c05fb[_0x12f2('0x32')],_0x5c05fb[_0x12f2('0x33')]);_0x595724[_0x12f2('0x37')]=_[_0x12f2('0x36')](_0x5c05fb[_0x12f2('0x32')],qs[_0x12f2('0x38')](_0x40246e['query']['fields']));_0x595724[_0x12f2('0x37')]=_0x595724[_0x12f2('0x37')]['length']?_0x595724[_0x12f2('0x37')]:_0x5c05fb['model'];if(!_0x40246e['query'][_0x12f2('0x39')](_0x12f2('0x3a'))){_0x595724[_0x12f2('0x1d')]=qs['limit'](_0x40246e[_0x12f2('0x33')][_0x12f2('0x1d')]);_0x595724[_0x12f2('0x1e')]=qs[_0x12f2('0x1e')](_0x40246e['query'][_0x12f2('0x1e')]);}_0x595724[_0x12f2('0x3b')]=qs[_0x12f2('0x3c')](_0x40246e[_0x12f2('0x33')][_0x12f2('0x3c')]);_0x595724[_0x12f2('0x3d')]=qs[_0x12f2('0x35')](_['pick'](_0x40246e[_0x12f2('0x33')],_0x5c05fb[_0x12f2('0x35')]),_0x53032b);if(_0x40246e[_0x12f2('0x33')]['filter']){_0x595724[_0x12f2('0x3d')]=_[_0x12f2('0x3e')](_0x595724[_0x12f2('0x3d')],{'$or':_[_0x12f2('0x2c')](_0x53032b,function(_0x5dbca1){if(_0x5dbca1[_0x12f2('0x30')]!=='VIRTUAL'){var _0x569eb8={};_0x569eb8[_0x5dbca1[_0x12f2('0x29')]]={'$like':'%'+_0x40246e[_0x12f2('0x33')][_0x12f2('0x3f')]+'%'};return _0x569eb8;}})});}_0x595724=_[_0x12f2('0x3e')]({},_0x595724,_0x40246e[_0x12f2('0x40')]);var _0x5ec01a={'where':_0x595724[_0x12f2('0x3d')]};return db[_0x12f2('0x2d')][_0x12f2('0x1f')](_0x5ec01a)['then'](function(_0x41015b){_0x5ec16d[_0x12f2('0x1f')]=_0x41015b;if(_0x40246e[_0x12f2('0x33')][_0x12f2('0x41')]){_0x595724[_0x12f2('0x42')]=[{'all':!![]}];}return db[_0x12f2('0x2d')][_0x12f2('0x43')](_0x595724);})[_0x12f2('0x25')](function(_0x399fb8){_0x5ec16d['rows']=_0x399fb8;return _0x5ec16d;})[_0x12f2('0x25')](respondWithFilteredResult(_0x38b815,_0x595724))[_0x12f2('0x44')](handleError(_0x38b815,null));};exports[_0x12f2('0x45')]=function(_0x27bb02,_0x3ce16a){var _0x5feab9={'raw':![],'where':{'id':_0x27bb02[_0x12f2('0x46')]['id']}},_0x2c712f={};_0x2c712f[_0x12f2('0x32')]=_[_0x12f2('0x34')](db[_0x12f2('0x2d')][_0x12f2('0x2e')]);_0x2c712f['query']=_[_0x12f2('0x34')](_0x27bb02[_0x12f2('0x33')]);_0x2c712f[_0x12f2('0x35')]=_[_0x12f2('0x36')](_0x2c712f[_0x12f2('0x32')],_0x2c712f[_0x12f2('0x33')]);_0x5feab9[_0x12f2('0x37')]=_[_0x12f2('0x36')](_0x2c712f[_0x12f2('0x32')],qs[_0x12f2('0x38')](_0x27bb02[_0x12f2('0x33')][_0x12f2('0x38')]));_0x5feab9[_0x12f2('0x37')]=_0x5feab9[_0x12f2('0x37')][_0x12f2('0x47')]?_0x5feab9[_0x12f2('0x37')]:_0x2c712f[_0x12f2('0x32')];if(_0x27bb02['query']['includeAll']){_0x5feab9[_0x12f2('0x42')]=[{'all':!![]}];}_0x5feab9=_[_0x12f2('0x3e')]({},_0x5feab9,_0x27bb02[_0x12f2('0x40')]);return db[_0x12f2('0x2d')][_0x12f2('0x48')](_0x5feab9)[_0x12f2('0x25')](handleEntityNotFound(_0x3ce16a,null))['then'](respondWithResult(_0x3ce16a,null))[_0x12f2('0x44')](handleError(_0x3ce16a,null));};exports['create']=function(_0xc9fc66,_0x3b14ff){return db['AnalyticFieldReport'][_0x12f2('0x49')](_0xc9fc66[_0x12f2('0x4a')],{})[_0x12f2('0x25')](respondWithResult(_0x3b14ff,0xc9))[_0x12f2('0x44')](handleError(_0x3b14ff,null));};exports['bulkCreate']=function(_0xef9551,_0x11f681){return db[_0x12f2('0x2d')][_0x12f2('0x4b')](_0xef9551[_0x12f2('0x4a')],{'raw':![],'individualHooks':!![]})[_0x12f2('0x25')](respondWithResult(_0x11f681,0xc9))['catch'](handleError(_0x11f681,null));};exports[_0x12f2('0x24')]=function(_0x562e5b,_0x5f28f7){if(_0x562e5b[_0x12f2('0x4a')]['id']){delete _0x562e5b[_0x12f2('0x4a')]['id'];}return db[_0x12f2('0x2d')][_0x12f2('0x48')]({'where':{'id':_0x562e5b[_0x12f2('0x46')]['id']}})[_0x12f2('0x25')](handleEntityNotFound(_0x5f28f7,null))['then'](saveUpdates(_0x562e5b[_0x12f2('0x4a')],null))[_0x12f2('0x25')](respondWithResult(_0x5f28f7,null))[_0x12f2('0x44')](handleError(_0x5f28f7,null));};exports['destroy']=function(_0x2e5efc,_0x513579){return db[_0x12f2('0x2d')]['find']({'where':{'id':_0x2e5efc['params']['id']}})[_0x12f2('0x25')](handleEntityNotFound(_0x513579,null))[_0x12f2('0x25')](removeEntity(_0x513579,null))[_0x12f2('0x44')](handleError(_0x513579,null));};exports[_0x12f2('0x4c')]=function(_0x5b2560,_0x1fe651){return db[_0x12f2('0x2d')][_0x12f2('0x4d')]({'where':{'id':_0x5b2560['query'][_0x12f2('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x12f2('0x25')](respondWithResult(_0x1fe651,0xcc))[_0x12f2('0x44')](handleError(_0x1fe651,null));};exports['addFields']=function(_0x51ffac,_0x4a4c80,_0x3f7255){return db[_0x12f2('0x4f')]['findOne']({'where':{'id':_0x51ffac['params']['id']}})[_0x12f2('0x25')](handleEntityNotFound(_0x4a4c80,null))[_0x12f2('0x25')](function(_0x4a6045){if(_0x4a6045){return db['sequelize'][_0x12f2('0x50')](function(_0x26e610){return db[_0x12f2('0x2d')][_0x12f2('0x4d')]({'where':{'CustomReportId':_0x51ffac['params']['id']},'transaction':_0x26e610})[_0x12f2('0x25')](function(_0x54f31d){var _0x1baea1=_[_0x12f2('0x2c')](_0x51ffac[_0x12f2('0x4a')],function(_0xaf1c77){delete _0xaf1c77['id'];_0xaf1c77[_0x12f2('0x51')]=_0x51ffac[_0x12f2('0x46')]['id'];return _0xaf1c77;});return db['AnalyticFieldReport'][_0x12f2('0x4b')](_0x1baea1,{'transaction':_0x26e610});});})[_0x12f2('0x25')](function(){return db['AnalyticFieldReport'][_0x12f2('0x43')]({'where':{'CustomReportId':_0x51ffac[_0x12f2('0x46')]['id']}});});}})[_0x12f2('0x25')](respondWithResult(_0x4a4c80,null))[_0x12f2('0x44')](handleError(_0x4a4c80,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index e1d2913..2adbed9 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 _0xef16=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x5bee86,_0x38468d){var _0x116ca1=function(_0x5c951e){while(--_0x5c951e){_0x5bee86['push'](_0x5bee86['shift']());}};_0x116ca1(++_0x38468d);}(_0xef16,0xac));var _0x6ef1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xef16[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x6ef1('0x0'));var util=require('util');var logger=require(_0x6ef1('0x1'))('api');var moment=require(_0x6ef1('0x2'));var BPromise=require(_0x6ef1('0x3'));var rp=require(_0x6ef1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ef1('0x5'));var config=require(_0x6ef1('0x6'));var attributes=require(_0x6ef1('0x7'));module[_0x6ef1('0x8')]=function(_0x1112bc,_0x2aad38){return _0x1112bc[_0x6ef1('0x9')](_0x6ef1('0xa'),attributes,{'tableName':_0x6ef1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x41da=['rimraf','../../config/environment','./analyticFieldReport.attributes','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1e16fe,_0x2ab89d){var _0xb7ac60=function(_0x3704e4){while(--_0x3704e4){_0x1e16fe['push'](_0x1e16fe['shift']());}};_0xb7ac60(++_0x2ab89d);}(_0x41da,0xf5));var _0xa41d=function(_0x4b0a13,_0x9f30e0){_0x4b0a13=_0x4b0a13-0x0;var _0x4d11bf=_0x41da[_0x4b0a13];return _0x4d11bf;};'use strict';var _=require(_0xa41d('0x0'));var util=require(_0xa41d('0x1'));var logger=require(_0xa41d('0x2'))(_0xa41d('0x3'));var moment=require(_0xa41d('0x4'));var BPromise=require(_0xa41d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa41d('0x6'));var rimraf=require(_0xa41d('0x7'));var config=require(_0xa41d('0x8'));var attributes=require(_0xa41d('0x9'));module['exports']=function(_0x3758aa,_0x1b12e8){return _0x3758aa[_0xa41d('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0xa41d('0xb'),'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 3893940..72389b2 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 _0x4715=['jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x4715,0x121));var _0x5471=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x4715[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x5471('0x0'));var util=require(_0x5471('0x1'));var moment=require(_0x5471('0x2'));var BPromise=require(_0x5471('0x3'));var rs=require(_0x5471('0x4'));var fs=require('fs');var Redis=require(_0x5471('0x5'));var db=require(_0x5471('0x6'))['db'];var utils=require(_0x5471('0x7'));var logger=require(_0x5471('0x8'))(_0x5471('0x9'));var config=require(_0x5471('0xa'));var jayson=require(_0x5471('0xb'));var client=jayson[_0x5471('0xc')][_0x5471('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5354f2,_0x305887,_0x34e56d){return new BPromise(function(_0x319460,_0x425759){return client[_0x5471('0xe')](_0x5354f2,_0x34e56d)['then'](function(_0x10bd78){logger['info'](_0x5471('0xf'),_0x305887,_0x5471('0x10'));logger[_0x5471('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x305887,_0x5471('0x10'),JSON[_0x5471('0x12')](_0x10bd78));if(_0x10bd78[_0x5471('0x13')]){if(_0x10bd78[_0x5471('0x13')][_0x5471('0x14')]===0x1f4){logger[_0x5471('0x13')](_0x5471('0xf'),_0x305887,_0x10bd78[_0x5471('0x13')]['message']);return _0x425759(_0x10bd78[_0x5471('0x13')][_0x5471('0x15')]);}logger[_0x5471('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x305887,_0x10bd78[_0x5471('0x13')]['message']);return _0x319460(_0x10bd78['error'][_0x5471('0x15')]);}else{logger[_0x5471('0x16')]('AnalyticFieldReport,\x20%s,\x20%s',_0x305887,'request\x20sent');_0x319460(_0x10bd78[_0x5471('0x17')]['message']);}})[_0x5471('0x18')](function(_0x57de35){logger[_0x5471('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x305887,_0x57de35);_0x425759(_0x57de35);});});}
\ No newline at end of file
+var _0xae93=['rpc','../../config/environment','jayson/promise','client','http','then','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xae93,0x188));var _0x3ae9=function(_0x9a3421,_0x479230){_0x9a3421=_0x9a3421-0x0;var _0x575917=_0xae93[_0x9a3421];return _0x575917;};'use strict';var _=require(_0x3ae9('0x0'));var util=require(_0x3ae9('0x1'));var moment=require(_0x3ae9('0x2'));var BPromise=require(_0x3ae9('0x3'));var rs=require(_0x3ae9('0x4'));var fs=require('fs');var Redis=require(_0x3ae9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3ae9('0x6'))(_0x3ae9('0x7'));var config=require(_0x3ae9('0x8'));var jayson=require(_0x3ae9('0x9'));var client=jayson[_0x3ae9('0xa')][_0x3ae9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13a2da,_0x43c27d,_0x1c1fcc){return new BPromise(function(_0x46b1d3,_0x51ab80){return client['request'](_0x13a2da,_0x1c1fcc)[_0x3ae9('0xc')](function(_0x46af80){logger['info'](_0x3ae9('0xd'),_0x43c27d,'request\x20sent');logger['debug'](_0x3ae9('0xe'),_0x43c27d,_0x3ae9('0xf'),JSON['stringify'](_0x46af80));if(_0x46af80[_0x3ae9('0x10')]){if(_0x46af80[_0x3ae9('0x10')][_0x3ae9('0x11')]===0x1f4){logger[_0x3ae9('0x10')](_0x3ae9('0xd'),_0x43c27d,_0x46af80['error'][_0x3ae9('0x12')]);return _0x51ab80(_0x46af80[_0x3ae9('0x10')][_0x3ae9('0x12')]);}logger[_0x3ae9('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x43c27d,_0x46af80[_0x3ae9('0x10')]['message']);return _0x46b1d3(_0x46af80['error'][_0x3ae9('0x12')]);}else{logger[_0x3ae9('0x13')](_0x3ae9('0xd'),_0x43c27d,'request\x20sent');_0x46b1d3(_0x46af80[_0x3ae9('0x14')][_0x3ae9('0x12')]);}})['catch'](function(_0x2193d9){logger[_0x3ae9('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x43c27d,_0x2193d9);_0x51ab80(_0x2193d9);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 3957849..3557032 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(_0x74c70c,_0x691b18){var _0x53af83=function(_0x49ea2b){while(--_0x49ea2b){_0x74c70c['push'](_0x74c70c['shift']());}};_0x53af83(++_0x691b18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x458188,_0x11abf0){var _0x19d5ce=function(_0x4ec67c){while(--_0x4ec67c){_0x458188['push'](_0x458188['shift']());}};_0x19d5ce(++_0x11abf0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 e72bc4f..a49ffad 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 _0xd10f=['sequelize','exports','STRING','name'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xd10f,0x198));var _0xfd10=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd10f[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xfd10('0x0'));module[_0xfd10('0x1')]={'name':{'type':Sequelize[_0xfd10('0x2')],'allowNull':![],'unique':_0xfd10('0x3')},'table':{'type':Sequelize[_0xfd10('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xfd10('0x2')]}};
\ No newline at end of file
+var _0x9a86=['name','STRING','TEXT','sequelize','exports'];(function(_0x4e24d3,_0x37a5bd){var _0x2c1698=function(_0x2a1e00){while(--_0x2a1e00){_0x4e24d3['push'](_0x4e24d3['shift']());}};_0x2c1698(++_0x37a5bd);}(_0x9a86,0x1ed));var _0x69a8=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x9a86[_0x18b5e8];return _0x25baed;};'use strict';var Sequelize=require(_0x69a8('0x0'));module[_0x69a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x69a8('0x2')},'table':{'type':Sequelize[_0x69a8('0x3')]},'metric':{'type':Sequelize[_0x69a8('0x4')]},'description':{'type':Sequelize[_0x69a8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 9aae6ee..23d273b 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 _0x9957=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
+var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x3bea06,_0x38f09a){var _0x20f6f7=function(_0x37ca19){while(--_0x37ca19){_0x3bea06['push'](_0x3bea06['shift']());}};_0x20f6f7(++_0x38f09a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x24ca[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index da0d0cc..5849ff2 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 _0xb39f=['lodash','util','../../config/logger','api','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric'];(function(_0x29d1b2,_0x26de60){var _0x156681=function(_0x3ed554){while(--_0x3ed554){_0x29d1b2['push'](_0x29d1b2['shift']());}};_0x156681(++_0x26de60);}(_0xb39f,0x1e6));var _0xfb39=function(_0x8aa34,_0x5e6fb2){_0x8aa34=_0x8aa34-0x0;var _0x21cf64=_0xb39f[_0x8aa34];return _0x21cf64;};'use strict';var _=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var logger=require(_0xfb39('0x2'))(_0xfb39('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb39('0x4'));var rimraf=require('rimraf');var config=require(_0xfb39('0x5'));var attributes=require(_0xfb39('0x6'));module['exports']=function(_0x1619f6,_0x455dbe){return _0x1619f6[_0xfb39('0x7')](_0xfb39('0x8'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc73a=['exports','define','AnalyticMetric','analytics_metrics','util','../../config/logger','api','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0xc73a,0x72));var _0xac73=function(_0x415b79,_0x3c813f){_0x415b79=_0x415b79-0x0;var _0x2ef640=_0xc73a[_0x415b79];return _0x2ef640;};'use strict';var _=require('lodash');var util=require(_0xac73('0x0'));var logger=require(_0xac73('0x1'))(_0xac73('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xac73('0x3'));var fs=require('fs');var path=require(_0xac73('0x4'));var rimraf=require(_0xac73('0x5'));var config=require('../../config/environment');var attributes=require(_0xac73('0x6'));module[_0xac73('0x7')]=function(_0x23fa68,_0x57992a){return _0x23fa68[_0xac73('0x8')](_0xac73('0x9'),attributes,{'tableName':_0xac73('0xa'),'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 a6181fd..0f194f7 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 _0x939a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring'];(function(_0x488684,_0xa14634){var _0x3b8d92=function(_0x195202){while(--_0x195202){_0x488684['push'](_0x488684['shift']());}};_0x3b8d92(++_0xa14634);}(_0x939a,0x178));var _0xa939=function(_0x35acee,_0x9e1d14){_0x35acee=_0x35acee-0x0;var _0x55e9ff=_0x939a[_0x35acee];return _0x55e9ff;};'use strict';var _=require('lodash');var util=require(_0xa939('0x0'));var moment=require(_0xa939('0x1'));var BPromise=require(_0xa939('0x2'));var rs=require(_0xa939('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa939('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa939('0x5'))(_0xa939('0x6'));var config=require(_0xa939('0x7'));var jayson=require(_0xa939('0x8'));var client=jayson[_0xa939('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x413c78,_0x265844,_0x3dd51b){return new BPromise(function(_0x741a73,_0x34381b){return client[_0xa939('0xa')](_0x413c78,_0x3dd51b)[_0xa939('0xb')](function(_0x482b2b){logger['info'](_0xa939('0xc'),_0x265844,'request\x20sent');logger['debug'](_0xa939('0xd'),_0x265844,_0xa939('0xe'),JSON[_0xa939('0xf')](_0x482b2b));if(_0x482b2b[_0xa939('0x10')]){if(_0x482b2b['error'][_0xa939('0x11')]===0x1f4){logger[_0xa939('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x265844,_0x482b2b[_0xa939('0x10')][_0xa939('0x12')]);return _0x34381b(_0x482b2b[_0xa939('0x10')][_0xa939('0x12')]);}logger[_0xa939('0x10')](_0xa939('0xc'),_0x265844,_0x482b2b[_0xa939('0x10')]['message']);return _0x741a73(_0x482b2b['error'][_0xa939('0x12')]);}else{logger['info'](_0xa939('0xc'),_0x265844,_0xa939('0xe'));_0x741a73(_0x482b2b[_0xa939('0x13')]['message']);}})['catch'](function(_0x19b504){logger[_0xa939('0x10')](_0xa939('0xc'),_0x265844,_0x19b504);_0x34381b(_0x19b504);});});}
\ No newline at end of file
+var _0xd466=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3afcf1,_0x5e12ec){var _0x193c29=function(_0x1bfc2c){while(--_0x1bfc2c){_0x3afcf1['push'](_0x3afcf1['shift']());}};_0x193c29(++_0x5e12ec);}(_0xd466,0xe7));var _0x6d46=function(_0x2637e5,_0x46b19d){_0x2637e5=_0x2637e5-0x0;var _0xc30f8e=_0xd466[_0x2637e5];return _0xc30f8e;};'use strict';var _=require(_0x6d46('0x0'));var util=require(_0x6d46('0x1'));var moment=require(_0x6d46('0x2'));var BPromise=require(_0x6d46('0x3'));var rs=require(_0x6d46('0x4'));var fs=require('fs');var Redis=require(_0x6d46('0x5'));var db=require(_0x6d46('0x6'))['db'];var utils=require(_0x6d46('0x7'));var logger=require(_0x6d46('0x8'))('rpc');var config=require(_0x6d46('0x9'));var jayson=require(_0x6d46('0xa'));var client=jayson[_0x6d46('0xb')][_0x6d46('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dd3a2,_0x21b78d,_0x25bbe7){return new BPromise(function(_0x4a67cf,_0x6609b8){return client[_0x6d46('0xd')](_0x2dd3a2,_0x25bbe7)[_0x6d46('0xe')](function(_0x4ac3f8){logger[_0x6d46('0xf')](_0x6d46('0x10'),_0x21b78d,_0x6d46('0x11'));logger[_0x6d46('0x12')](_0x6d46('0x13'),_0x21b78d,_0x6d46('0x11'),JSON[_0x6d46('0x14')](_0x4ac3f8));if(_0x4ac3f8[_0x6d46('0x15')]){if(_0x4ac3f8[_0x6d46('0x15')]['code']===0x1f4){logger[_0x6d46('0x15')](_0x6d46('0x10'),_0x21b78d,_0x4ac3f8[_0x6d46('0x15')][_0x6d46('0x16')]);return _0x6609b8(_0x4ac3f8[_0x6d46('0x15')][_0x6d46('0x16')]);}logger[_0x6d46('0x15')]('AnalyticMetric,\x20%s,\x20%s',_0x21b78d,_0x4ac3f8['error'][_0x6d46('0x16')]);return _0x4a67cf(_0x4ac3f8[_0x6d46('0x15')][_0x6d46('0x16')]);}else{logger[_0x6d46('0xf')](_0x6d46('0x10'),_0x21b78d,'request\x20sent');_0x4a67cf(_0x4ac3f8[_0x6d46('0x17')]['message']);}})['catch'](function(_0x865b7e){logger[_0x6d46('0x15')](_0x6d46('0x10'),_0x21b78d,_0x865b7e);_0x6609b8(_0x865b7e);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index c341e14..4b22d2d 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 _0x891b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','show','post','isAuthenticated','create','put','/:id','delete','destroy','exports','path'];(function(_0x54e2b3,_0xc5ce45){var _0x9aa063=function(_0x421770){while(--_0x421770){_0x54e2b3['push'](_0x54e2b3['shift']());}};_0x9aa063(++_0xc5ce45);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb891('0x0'));var timeout=require(_0xb891('0x1'));var express=require('express');var router=express[_0xb891('0x2')]();var fs_extra=require(_0xb891('0x3'));var auth=require(_0xb891('0x4'));var interaction=require(_0xb891('0x5'));var config=require('../../config/environment');var controller=require(_0xb891('0x6'));router[_0xb891('0x7')]('/',auth['isAuthenticated'](),controller[_0xb891('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb891('0x9')]);router[_0xb891('0xa')]('/',auth[_0xb891('0xb')](),controller[_0xb891('0xc')]);router[_0xb891('0xd')](_0xb891('0xe'),auth[_0xb891('0xb')](),controller['update']);router[_0xb891('0xf')](_0xb891('0xe'),auth[_0xb891('0xb')](),controller[_0xb891('0x10')]);module[_0xb891('0x11')]=router;
\ No newline at end of file
+var _0x63b6=['get','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x1c3080,_0x59c2b1){var _0x517c07=function(_0x1e851c){while(--_0x1e851c){_0x1c3080['push'](_0x1c3080['shift']());}};_0x517c07(++_0x59c2b1);}(_0x63b6,0x127));var _0x663b=function(_0x23f7c0,_0x1dab5f){_0x23f7c0=_0x23f7c0-0x0;var _0x2dc413=_0x63b6[_0x23f7c0];return _0x2dc413;};'use strict';var multer=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var path=require(_0x663b('0x2'));var timeout=require('connect-timeout');var express=require(_0x663b('0x3'));var router=express['Router']();var fs_extra=require(_0x663b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var controller=require(_0x663b('0x7'));router['get']('/',auth[_0x663b('0x8')](),controller['index']);router[_0x663b('0x9')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xa')]);router[_0x663b('0xb')]('/',auth[_0x663b('0x8')](),controller[_0x663b('0xc')]);router[_0x663b('0xd')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xe')]);router[_0x663b('0xf')](_0x663b('0x10'),auth[_0x663b('0x8')](),controller[_0x663b('0x11')]);module[_0x663b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 185bcbd..6ad6c5d 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 _0x11b4=['sequelize','exports','TEXT'];(function(_0x350a77,_0x404b6c){var _0x3dc5a6=function(_0x355716){while(--_0x355716){_0x350a77['push'](_0x350a77['shift']());}};_0x3dc5a6(++_0x404b6c);}(_0x11b4,0x168));var _0x411b=function(_0x1f5c0e,_0x3eebf3){_0x1f5c0e=_0x1f5c0e-0x0;var _0x25e992=_0x11b4[_0x1f5c0e];return _0x25e992;};'use strict';var Sequelize=require(_0x411b('0x0'));module[_0x411b('0x1')]={'tree':{'type':Sequelize[_0x411b('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x515d=['exports','TEXT'];(function(_0x4ec56d,_0x1c3f81){var _0x560fdb=function(_0x12fbc8){while(--_0x12fbc8){_0x4ec56d['push'](_0x4ec56d['shift']());}};_0x560fdb(++_0x1c3f81);}(_0x515d,0x104));var _0xd515=function(_0x4ddc5d,_0x33e649){_0x4ddc5d=_0x4ddc5d-0x0;var _0x231056=_0x515d[_0x4ddc5d];return _0x231056;};'use strict';var Sequelize=require('sequelize');module[_0xd515('0x0')]={'tree':{'type':Sequelize[_0xd515('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 774a8ae..4baaac0 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 _0x6d4f=['index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x240773,_0x446008){var _0x2f1a63=function(_0x195844){while(--_0x195844){_0x240773['push'](_0x240773['shift']());}};_0x2f1a63(++_0x446008);}(_0x6d4f,0x105));var _0xf6d4=function(_0x3eef60,_0x9eb279){_0x3eef60=_0x3eef60-0x0;var _0x569efe=_0x6d4f[_0x3eef60];return _0x569efe;};'use strict';var emlformat=require(_0xf6d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6d4('0x1'));var jsonpatch=require(_0xf6d4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6d4('0x3'));var Mustache=require(_0xf6d4('0x4'));var util=require(_0xf6d4('0x5'));var path=require(_0xf6d4('0x6'));var sox=require(_0xf6d4('0x7'));var csv=require(_0xf6d4('0x8'));var ejs=require(_0xf6d4('0x9'));var fs=require('fs');var fs_extra=require(_0xf6d4('0xa'));var _=require(_0xf6d4('0xb'));var squel=require(_0xf6d4('0xc'));var crypto=require(_0xf6d4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6d4('0x8'));var querystring=require(_0xf6d4('0xe'));var Papa=require(_0xf6d4('0xf'));var Redis=require(_0xf6d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf6d4('0x11'));var as=require(_0xf6d4('0x12'));var hardwareService=require(_0xf6d4('0x13'));var logger=require(_0xf6d4('0x14'))(_0xf6d4('0x15'));var utils=require(_0xf6d4('0x16'));var config=require(_0xf6d4('0x17'));var licenseUtil=require(_0xf6d4('0x18'));var db=require(_0xf6d4('0x19'))['db'];function respondWithStatusCode(_0x2d5744,_0x3383e5){_0x3383e5=_0x3383e5||0xcc;return function(_0x108db4){if(_0x108db4){return _0x2d5744['sendStatus'](_0x3383e5);}return _0x2d5744[_0xf6d4('0x1a')](_0x3383e5)[_0xf6d4('0x1b')]();};}function respondWithResult(_0x53855f,_0xa5ec46){_0xa5ec46=_0xa5ec46||0xc8;return function(_0x1c2401){if(_0x1c2401){return _0x53855f[_0xf6d4('0x1a')](_0xa5ec46)['json'](_0x1c2401);}};}function respondWithFilteredResult(_0x31cf0e,_0x23766b){return function(_0x3b3345){if(_0x3b3345){var _0x3c0ffe=typeof _0x23766b[_0xf6d4('0x1c')]===_0xf6d4('0x1d')&&typeof _0x23766b[_0xf6d4('0x1e')]==='undefined';var _0x334056=_0x3b3345[_0xf6d4('0x1f')];var _0x32dcc0=_0x3c0ffe?0x0:_0x23766b[_0xf6d4('0x1c')];var _0x1dc658=_0x3c0ffe?_0x3b3345[_0xf6d4('0x1f')]:_0x23766b[_0xf6d4('0x1c')]+_0x23766b[_0xf6d4('0x1e')];var _0x2da844;if(_0x1dc658>=_0x334056){_0x1dc658=_0x334056;_0x2da844=0xc8;}else{_0x2da844=0xce;}_0x31cf0e['status'](_0x2da844);return _0x31cf0e[_0xf6d4('0x20')]('Content-Range',_0x32dcc0+'-'+_0x1dc658+'/'+_0x334056)['json'](_0x3b3345);}return null;};}function patchUpdates(_0x1502a0){return function(_0x3d030e){try{jsonpatch[_0xf6d4('0x21')](_0x3d030e,_0x1502a0,!![]);}catch(_0x3eb184){return BPromise['reject'](_0x3eb184);}return _0x3d030e[_0xf6d4('0x22')]();};}function saveUpdates(_0x1b69fa,_0x3b6245){return function(_0x1cbd2e){if(_0x1cbd2e){return _0x1cbd2e[_0xf6d4('0x23')](_0x1b69fa)[_0xf6d4('0x24')](function(_0x1d8637){return _0x1d8637;});}return null;};}function removeEntity(_0x38e5ea,_0x45c3df){return function(_0x3d1dd3){if(_0x3d1dd3){return _0x3d1dd3[_0xf6d4('0x25')]()[_0xf6d4('0x24')](function(){_0x38e5ea['status'](0xcc)[_0xf6d4('0x1b')]();});}};}function handleEntityNotFound(_0x1263dd,_0x3eee76){return function(_0x2d6387){if(!_0x2d6387){_0x1263dd[_0xf6d4('0x26')](0x194);}return _0x2d6387;};}function handleError(_0xc46e5c,_0x38f95e){_0x38f95e=_0x38f95e||0x1f4;return function(_0x82daeb){logger[_0xf6d4('0x27')](_0x82daeb[_0xf6d4('0x28')]);if(_0x82daeb[_0xf6d4('0x29')]){delete _0x82daeb[_0xf6d4('0x29')];}_0xc46e5c['status'](_0x38f95e)[_0xf6d4('0x2a')](_0x82daeb);};}exports[_0xf6d4('0x2b')]=function(_0x14dd3f,_0x9af1e8){var _0xb21f3e={},_0xd79a69={},_0x51adcf={'count':0x0,'rows':[]};var _0x40918b=_[_0xf6d4('0x2c')](db[_0xf6d4('0x2d')][_0xf6d4('0x2e')],function(_0x4cba90){return{'name':_0x4cba90[_0xf6d4('0x2f')],'type':_0x4cba90[_0xf6d4('0x30')][_0xf6d4('0x31')]};});_0xd79a69['model']=_[_0xf6d4('0x2c')](_0x40918b,_0xf6d4('0x29'));_0xd79a69['query']=_[_0xf6d4('0x32')](_0x14dd3f['query']);_0xd79a69['filters']=_[_0xf6d4('0x33')](_0xd79a69[_0xf6d4('0x34')],_0xd79a69[_0xf6d4('0x35')]);_0xb21f3e[_0xf6d4('0x36')]=_[_0xf6d4('0x33')](_0xd79a69[_0xf6d4('0x34')],qs['fields'](_0x14dd3f['query'][_0xf6d4('0x37')]));_0xb21f3e[_0xf6d4('0x36')]=_0xb21f3e[_0xf6d4('0x36')][_0xf6d4('0x38')]?_0xb21f3e['attributes']:_0xd79a69[_0xf6d4('0x34')];if(!_0x14dd3f[_0xf6d4('0x35')][_0xf6d4('0x39')]('nolimit')){_0xb21f3e[_0xf6d4('0x1e')]=qs['limit'](_0x14dd3f[_0xf6d4('0x35')][_0xf6d4('0x1e')]);_0xb21f3e[_0xf6d4('0x1c')]=qs['offset'](_0x14dd3f['query'][_0xf6d4('0x1c')]);}_0xb21f3e[_0xf6d4('0x3a')]=qs[_0xf6d4('0x3b')](_0x14dd3f[_0xf6d4('0x35')][_0xf6d4('0x3b')]);_0xb21f3e[_0xf6d4('0x3c')]=qs[_0xf6d4('0x3d')](_[_0xf6d4('0x3e')](_0x14dd3f[_0xf6d4('0x35')],_0xd79a69[_0xf6d4('0x3d')]),_0x40918b);if(_0x14dd3f['query'][_0xf6d4('0x3f')]){_0xb21f3e['where']=_[_0xf6d4('0x40')](_0xb21f3e[_0xf6d4('0x3c')],{'$or':_[_0xf6d4('0x2c')](_0x40918b,function(_0x633252){if(_0x633252['type']!==_0xf6d4('0x41')){var _0x4f1a44={};_0x4f1a44[_0x633252[_0xf6d4('0x29')]]={'$like':'%'+_0x14dd3f[_0xf6d4('0x35')]['filter']+'%'};return _0x4f1a44;}})});}_0xb21f3e=_[_0xf6d4('0x40')]({},_0xb21f3e,_0x14dd3f[_0xf6d4('0x42')]);var _0x502efd={'where':_0xb21f3e[_0xf6d4('0x3c')]};return db[_0xf6d4('0x2d')][_0xf6d4('0x1f')](_0x502efd)[_0xf6d4('0x24')](function(_0xda4e4b){_0x51adcf['count']=_0xda4e4b;if(_0x14dd3f[_0xf6d4('0x35')][_0xf6d4('0x43')]){_0xb21f3e['include']=[{'all':!![]}];}return db[_0xf6d4('0x2d')][_0xf6d4('0x44')](_0xb21f3e);})[_0xf6d4('0x24')](function(_0x4bfc79){_0x51adcf['rows']=_0x4bfc79;return _0x51adcf;})[_0xf6d4('0x24')](respondWithFilteredResult(_0x9af1e8,_0xb21f3e))['catch'](handleError(_0x9af1e8,null));};exports[_0xf6d4('0x45')]=function(_0x42728b,_0x229c45){var _0x121c4b={'raw':!![],'where':{'id':_0x42728b[_0xf6d4('0x46')]['id']}},_0x3a9231={};_0x3a9231[_0xf6d4('0x34')]=_[_0xf6d4('0x32')](db[_0xf6d4('0x2d')][_0xf6d4('0x2e')]);_0x3a9231[_0xf6d4('0x35')]=_[_0xf6d4('0x32')](_0x42728b[_0xf6d4('0x35')]);_0x3a9231['filters']=_[_0xf6d4('0x33')](_0x3a9231[_0xf6d4('0x34')],_0x3a9231[_0xf6d4('0x35')]);_0x121c4b[_0xf6d4('0x36')]=_[_0xf6d4('0x33')](_0x3a9231[_0xf6d4('0x34')],qs[_0xf6d4('0x37')](_0x42728b[_0xf6d4('0x35')][_0xf6d4('0x37')]));_0x121c4b[_0xf6d4('0x36')]=_0x121c4b[_0xf6d4('0x36')][_0xf6d4('0x38')]?_0x121c4b[_0xf6d4('0x36')]:_0x3a9231[_0xf6d4('0x34')];if(_0x42728b[_0xf6d4('0x35')]['includeAll']){_0x121c4b[_0xf6d4('0x47')]=[{'all':!![]}];}_0x121c4b=_['merge']({},_0x121c4b,_0x42728b[_0xf6d4('0x42')]);return db[_0xf6d4('0x2d')][_0xf6d4('0x48')](_0x121c4b)['then'](handleEntityNotFound(_0x229c45,null))[_0xf6d4('0x24')](respondWithResult(_0x229c45,null))[_0xf6d4('0x49')](handleError(_0x229c45,null));};exports['create']=function(_0x3c0b7e,_0x45ea5c){return db[_0xf6d4('0x2d')][_0xf6d4('0x4a')](_0x3c0b7e[_0xf6d4('0x4b')],{})[_0xf6d4('0x24')](respondWithResult(_0x45ea5c,0xc9))[_0xf6d4('0x49')](handleError(_0x45ea5c,null));};exports[_0xf6d4('0x23')]=function(_0x530d0f,_0x45d856){if(_0x530d0f[_0xf6d4('0x4b')]['id']){delete _0x530d0f[_0xf6d4('0x4b')]['id'];}return db[_0xf6d4('0x2d')][_0xf6d4('0x48')]({'where':{'id':_0x530d0f[_0xf6d4('0x46')]['id']}})['then'](handleEntityNotFound(_0x45d856,null))[_0xf6d4('0x24')](saveUpdates(_0x530d0f[_0xf6d4('0x4b')],null))['then'](respondWithResult(_0x45d856,null))[_0xf6d4('0x49')](handleError(_0x45d856,null));};exports[_0xf6d4('0x25')]=function(_0x36f19e,_0x549cc7){return db[_0xf6d4('0x2d')][_0xf6d4('0x48')]({'where':{'id':_0x36f19e['params']['id']}})[_0xf6d4('0x24')](handleEntityNotFound(_0x549cc7,null))[_0xf6d4('0x24')](removeEntity(_0x549cc7,null))[_0xf6d4('0x49')](handleError(_0x549cc7,null));};
\ No newline at end of file
+var _0xe830=['body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','find','create'];(function(_0x45510d,_0x235f12){var _0x263399=function(_0x31c6a4){while(--_0x31c6a4){_0x45510d['push'](_0x45510d['shift']());}};_0x263399(++_0x235f12);}(_0xe830,0xe5));var _0x0e83=function(_0x45533a,_0xf6d29a){_0x45533a=_0x45533a-0x0;var _0x35e675=_0xe830[_0x45533a];return _0x35e675;};'use strict';var emlformat=require(_0x0e83('0x0'));var rimraf=require(_0x0e83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e83('0x2'));var rp=require(_0x0e83('0x3'));var moment=require(_0x0e83('0x4'));var BPromise=require(_0x0e83('0x5'));var Mustache=require(_0x0e83('0x6'));var util=require(_0x0e83('0x7'));var path=require(_0x0e83('0x8'));var sox=require(_0x0e83('0x9'));var csv=require(_0x0e83('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e83('0xb'));var squel=require('squel');var crypto=require(_0x0e83('0xc'));var jsforce=require(_0x0e83('0xd'));var deskjs=require(_0x0e83('0xe'));var toCsv=require(_0x0e83('0xa'));var querystring=require(_0x0e83('0xf'));var Papa=require(_0x0e83('0x10'));var Redis=require(_0x0e83('0x11'));var authService=require(_0x0e83('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0e83('0x13'));var hardwareService=require(_0x0e83('0x14'));var logger=require(_0x0e83('0x15'))(_0x0e83('0x16'));var utils=require(_0x0e83('0x17'));var config=require(_0x0e83('0x18'));var licenseUtil=require(_0x0e83('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6b7e,_0x1d461d){_0x1d461d=_0x1d461d||0xcc;return function(_0x141c45){if(_0x141c45){return _0x4c6b7e['sendStatus'](_0x1d461d);}return _0x4c6b7e[_0x0e83('0x1a')](_0x1d461d)[_0x0e83('0x1b')]();};}function respondWithResult(_0xb25b34,_0x26f5d4){_0x26f5d4=_0x26f5d4||0xc8;return function(_0x2f652f){if(_0x2f652f){return _0xb25b34[_0x0e83('0x1a')](_0x26f5d4)[_0x0e83('0x1c')](_0x2f652f);}};}function respondWithFilteredResult(_0x3fb4e7,_0x20eb82){return function(_0x5d52ea){if(_0x5d52ea){var _0x463a1d=typeof _0x20eb82[_0x0e83('0x1d')]===_0x0e83('0x1e')&&typeof _0x20eb82['limit']===_0x0e83('0x1e');var _0x7032c7=_0x5d52ea[_0x0e83('0x1f')];var _0xa0b29c=_0x463a1d?0x0:_0x20eb82[_0x0e83('0x1d')];var _0x153ddc=_0x463a1d?_0x5d52ea[_0x0e83('0x1f')]:_0x20eb82['offset']+_0x20eb82[_0x0e83('0x20')];var _0x4ac5c2;if(_0x153ddc>=_0x7032c7){_0x153ddc=_0x7032c7;_0x4ac5c2=0xc8;}else{_0x4ac5c2=0xce;}_0x3fb4e7[_0x0e83('0x1a')](_0x4ac5c2);return _0x3fb4e7[_0x0e83('0x21')](_0x0e83('0x22'),_0xa0b29c+'-'+_0x153ddc+'/'+_0x7032c7)['json'](_0x5d52ea);}return null;};}function patchUpdates(_0x4ebc7b){return function(_0x1f8c0b){try{jsonpatch['apply'](_0x1f8c0b,_0x4ebc7b,!![]);}catch(_0x15c10){return BPromise[_0x0e83('0x23')](_0x15c10);}return _0x1f8c0b['save']();};}function saveUpdates(_0x53979d,_0x57ae16){return function(_0x32fd9a){if(_0x32fd9a){return _0x32fd9a[_0x0e83('0x24')](_0x53979d)['then'](function(_0x51bc3c){return _0x51bc3c;});}return null;};}function removeEntity(_0x511e05,_0x261998){return function(_0x3e6fe9){if(_0x3e6fe9){return _0x3e6fe9[_0x0e83('0x25')]()['then'](function(){_0x511e05[_0x0e83('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e3f9,_0x2ac8c3){return function(_0x4d687e){if(!_0x4d687e){_0x52e3f9[_0x0e83('0x26')](0x194);}return _0x4d687e;};}function handleError(_0x3a0d97,_0x509b77){_0x509b77=_0x509b77||0x1f4;return function(_0x33f99b){logger[_0x0e83('0x27')](_0x33f99b[_0x0e83('0x28')]);if(_0x33f99b[_0x0e83('0x29')]){delete _0x33f99b[_0x0e83('0x29')];}_0x3a0d97[_0x0e83('0x1a')](_0x509b77)[_0x0e83('0x2a')](_0x33f99b);};}exports[_0x0e83('0x2b')]=function(_0x105017,_0x129b55){var _0x21f4ea={},_0x432484={},_0x15c8cc={'count':0x0,'rows':[]};var _0x31c6b5=_[_0x0e83('0x2c')](db[_0x0e83('0x2d')][_0x0e83('0x2e')],function(_0x64a2bd){return{'name':_0x64a2bd[_0x0e83('0x2f')],'type':_0x64a2bd[_0x0e83('0x30')][_0x0e83('0x31')]};});_0x432484['model']=_[_0x0e83('0x2c')](_0x31c6b5,_0x0e83('0x29'));_0x432484[_0x0e83('0x32')]=_[_0x0e83('0x33')](_0x105017['query']);_0x432484['filters']=_[_0x0e83('0x34')](_0x432484[_0x0e83('0x35')],_0x432484[_0x0e83('0x32')]);_0x21f4ea['attributes']=_[_0x0e83('0x34')](_0x432484[_0x0e83('0x35')],qs[_0x0e83('0x36')](_0x105017[_0x0e83('0x32')][_0x0e83('0x36')]));_0x21f4ea[_0x0e83('0x37')]=_0x21f4ea[_0x0e83('0x37')][_0x0e83('0x38')]?_0x21f4ea[_0x0e83('0x37')]:_0x432484[_0x0e83('0x35')];if(!_0x105017[_0x0e83('0x32')]['hasOwnProperty']('nolimit')){_0x21f4ea[_0x0e83('0x20')]=qs[_0x0e83('0x20')](_0x105017[_0x0e83('0x32')][_0x0e83('0x20')]);_0x21f4ea[_0x0e83('0x1d')]=qs[_0x0e83('0x1d')](_0x105017[_0x0e83('0x32')]['offset']);}_0x21f4ea[_0x0e83('0x39')]=qs[_0x0e83('0x3a')](_0x105017[_0x0e83('0x32')][_0x0e83('0x3a')]);_0x21f4ea[_0x0e83('0x3b')]=qs['filters'](_[_0x0e83('0x3c')](_0x105017[_0x0e83('0x32')],_0x432484[_0x0e83('0x3d')]),_0x31c6b5);if(_0x105017[_0x0e83('0x32')][_0x0e83('0x3e')]){_0x21f4ea['where']=_[_0x0e83('0x3f')](_0x21f4ea[_0x0e83('0x3b')],{'$or':_[_0x0e83('0x2c')](_0x31c6b5,function(_0x4e4044){if(_0x4e4044[_0x0e83('0x30')]!==_0x0e83('0x40')){var _0x35e7f5={};_0x35e7f5[_0x4e4044[_0x0e83('0x29')]]={'$like':'%'+_0x105017[_0x0e83('0x32')][_0x0e83('0x3e')]+'%'};return _0x35e7f5;}})});}_0x21f4ea=_['merge']({},_0x21f4ea,_0x105017[_0x0e83('0x41')]);var _0x2b2b99={'where':_0x21f4ea[_0x0e83('0x3b')]};return db['AnalyticTreeReport']['count'](_0x2b2b99)[_0x0e83('0x42')](function(_0xfed616){_0x15c8cc[_0x0e83('0x1f')]=_0xfed616;if(_0x105017[_0x0e83('0x32')][_0x0e83('0x43')]){_0x21f4ea[_0x0e83('0x44')]=[{'all':!![]}];}return db[_0x0e83('0x2d')]['findAll'](_0x21f4ea);})[_0x0e83('0x42')](function(_0x38ecd0){_0x15c8cc[_0x0e83('0x45')]=_0x38ecd0;return _0x15c8cc;})[_0x0e83('0x42')](respondWithFilteredResult(_0x129b55,_0x21f4ea))[_0x0e83('0x46')](handleError(_0x129b55,null));};exports[_0x0e83('0x47')]=function(_0x5552e4,_0x4eb48b){var _0x23dd62={'raw':!![],'where':{'id':_0x5552e4[_0x0e83('0x48')]['id']}},_0x422198={};_0x422198[_0x0e83('0x35')]=_[_0x0e83('0x33')](db[_0x0e83('0x2d')][_0x0e83('0x2e')]);_0x422198[_0x0e83('0x32')]=_[_0x0e83('0x33')](_0x5552e4[_0x0e83('0x32')]);_0x422198[_0x0e83('0x3d')]=_[_0x0e83('0x34')](_0x422198[_0x0e83('0x35')],_0x422198[_0x0e83('0x32')]);_0x23dd62[_0x0e83('0x37')]=_['intersection'](_0x422198['model'],qs[_0x0e83('0x36')](_0x5552e4[_0x0e83('0x32')][_0x0e83('0x36')]));_0x23dd62[_0x0e83('0x37')]=_0x23dd62[_0x0e83('0x37')]['length']?_0x23dd62[_0x0e83('0x37')]:_0x422198[_0x0e83('0x35')];if(_0x5552e4[_0x0e83('0x32')][_0x0e83('0x43')]){_0x23dd62[_0x0e83('0x44')]=[{'all':!![]}];}_0x23dd62=_[_0x0e83('0x3f')]({},_0x23dd62,_0x5552e4[_0x0e83('0x41')]);return db[_0x0e83('0x2d')][_0x0e83('0x49')](_0x23dd62)['then'](handleEntityNotFound(_0x4eb48b,null))[_0x0e83('0x42')](respondWithResult(_0x4eb48b,null))[_0x0e83('0x46')](handleError(_0x4eb48b,null));};exports[_0x0e83('0x4a')]=function(_0x5b41b5,_0x3c6fe3){return db[_0x0e83('0x2d')]['create'](_0x5b41b5[_0x0e83('0x4b')],{})[_0x0e83('0x42')](respondWithResult(_0x3c6fe3,0xc9))[_0x0e83('0x46')](handleError(_0x3c6fe3,null));};exports[_0x0e83('0x24')]=function(_0x498feb,_0x28adeb){if(_0x498feb['body']['id']){delete _0x498feb['body']['id'];}return db[_0x0e83('0x2d')][_0x0e83('0x49')]({'where':{'id':_0x498feb[_0x0e83('0x48')]['id']}})[_0x0e83('0x42')](handleEntityNotFound(_0x28adeb,null))[_0x0e83('0x42')](saveUpdates(_0x498feb[_0x0e83('0x4b')],null))[_0x0e83('0x42')](respondWithResult(_0x28adeb,null))[_0x0e83('0x46')](handleError(_0x28adeb,null));};exports[_0x0e83('0x25')]=function(_0x25e25a,_0x17b9e0){return db[_0x0e83('0x2d')][_0x0e83('0x49')]({'where':{'id':_0x25e25a['params']['id']}})['then'](handleEntityNotFound(_0x17b9e0,null))[_0x0e83('0x42')](removeEntity(_0x17b9e0,null))[_0x0e83('0x46')](handleError(_0x17b9e0,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index c6dfec3..db313ff 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 _0xef02=['path','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','util','api','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xef02,0x9f));var _0x2ef0=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0xef02[_0x1a72b8];return _0x39f72d;};'use strict';var _=require('lodash');var util=require(_0x2ef0('0x0'));var logger=require('../../config/logger')(_0x2ef0('0x1'));var moment=require('moment');var BPromise=require(_0x2ef0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ef0('0x3'));var rimraf=require(_0x2ef0('0x4'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x2ef0('0x5')]=function(_0x32a740,_0x30d433){return _0x32a740[_0x2ef0('0x6')](_0x2ef0('0x7'),attributes,{'tableName':_0x2ef0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x71e6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','analytics_report_trees','util','api'];(function(_0xccecef,_0x52e019){var _0xfba4d3=function(_0xb6b9aa){while(--_0xb6b9aa){_0xccecef['push'](_0xccecef['shift']());}};_0xfba4d3(++_0x52e019);}(_0x71e6,0x1ab));var _0x671e=function(_0x39be73,_0x31a022){_0x39be73=_0x39be73-0x0;var _0x14b572=_0x71e6[_0x39be73];return _0x14b572;};'use strict';var _=require('lodash');var util=require(_0x671e('0x0'));var logger=require('../../config/logger')(_0x671e('0x1'));var moment=require(_0x671e('0x2'));var BPromise=require(_0x671e('0x3'));var rp=require(_0x671e('0x4'));var fs=require('fs');var path=require(_0x671e('0x5'));var rimraf=require(_0x671e('0x6'));var config=require(_0x671e('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x671e('0x8')]=function(_0x5ce6aa,_0x5d80ca){return _0x5ce6aa[_0x671e('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x671e('0xa'),'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 de586bb..aa3f137 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x34a47b,_0x109857){var _0x3bd3d7=function(_0x30e79a){while(--_0x30e79a){_0x34a47b['push'](_0x34a47b['shift']());}};_0x3bd3d7(++_0x109857);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b7edf,_0x3cffce){_0x2b7edf=_0x2b7edf-0x0;var _0x59bc17=_0x2ef3[_0x2b7edf];return _0x59bc17;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x450f34,_0x19858b){var _0xa68752=function(_0x4fd64d){while(--_0x4fd64d){_0x450f34['push'](_0x450f34['shift']());}};_0xa68752(++_0x19858b);}(_0xdb28,0x106));var _0x8db2=function(_0x3acb10,_0x37fa4a){_0x3acb10=_0x3acb10-0x0;var _0x3d9d32=_0xdb28[_0x3acb10];return _0x3d9d32;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e793c56..828fd85 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 _0x2f5f=['put','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','post','create'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x2f5f,0x193));var _0xf2f5=function(_0x1ac62d,_0x223a72){_0x1ac62d=_0x1ac62d-0x0;var _0x4bd6b6=_0x2f5f[_0x1ac62d];return _0x4bd6b6;};'use strict';var multer=require(_0xf2f5('0x0'));var util=require(_0xf2f5('0x1'));var path=require(_0xf2f5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2f5('0x3')]();var fs_extra=require(_0xf2f5('0x4'));var auth=require(_0xf2f5('0x5'));var interaction=require(_0xf2f5('0x6'));var config=require(_0xf2f5('0x7'));var controller=require(_0xf2f5('0x8'));router[_0xf2f5('0x9')]('/',auth[_0xf2f5('0xa')](),controller[_0xf2f5('0xb')]);router[_0xf2f5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf2f5('0xc')]);router[_0xf2f5('0xd')]('/',auth['isAuthenticated'](),controller[_0xf2f5('0xe')]);router[_0xf2f5('0xf')](_0xf2f5('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf2f5('0x10'),auth['isAuthenticated'](),controller[_0xf2f5('0x11')]);module[_0xf2f5('0x12')]=router;
\ No newline at end of file
+var _0x8c82=['create','put','/:id','update','delete','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post'];(function(_0x18cc1c,_0x10f42d){var _0x205f02=function(_0x3e3be4){while(--_0x3e3be4){_0x18cc1c['push'](_0x18cc1c['shift']());}};_0x205f02(++_0x10f42d);}(_0x8c82,0x126));var _0x28c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c82[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x28c8('0x0'));var util=require(_0x28c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x28c8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x28c8('0x3'));var interaction=require(_0x28c8('0x4'));var config=require(_0x28c8('0x5'));var controller=require(_0x28c8('0x6'));router[_0x28c8('0x7')]('/',auth['isAuthenticated'](),controller[_0x28c8('0x8')]);router[_0x28c8('0x7')]('/:id',auth[_0x28c8('0x9')](),controller[_0x28c8('0xa')]);router[_0x28c8('0xb')]('/',auth[_0x28c8('0x9')](),controller[_0x28c8('0xc')]);router[_0x28c8('0xd')](_0x28c8('0xe'),auth[_0x28c8('0x9')](),controller[_0x28c8('0xf')]);router[_0x28c8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x28c8('0x11')]);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 6db9962..ae4e812 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 _0xe9e8=['exports','STRING','sequelize'];(function(_0x17403d,_0x37c6f9){var _0x1b130b=function(_0x1992d6){while(--_0x1992d6){_0x17403d['push'](_0x17403d['shift']());}};_0x1b130b(++_0x37c6f9);}(_0xe9e8,0x179));var _0x8e9e=function(_0x562e6c,_0x1d4b7c){_0x562e6c=_0x562e6c-0x0;var _0x17d1ab=_0xe9e8[_0x562e6c];return _0x17d1ab;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'name':{'type':Sequelize[_0x8e9e('0x2')]},'basename':{'type':Sequelize[_0x8e9e('0x2')]},'type':{'type':Sequelize[_0x8e9e('0x2')]}};
\ No newline at end of file
+var _0xd382=['sequelize','exports','STRING'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xd382,0x1b6));var _0x2d38=function(_0x37d7e9,_0x5034be){_0x37d7e9=_0x37d7e9-0x0;var _0x53b51c=_0xd382[_0x37d7e9];return _0x53b51c;};'use strict';var Sequelize=require(_0x2d38('0x0'));module[_0x2d38('0x1')]={'name':{'type':Sequelize[_0x2d38('0x2')]},'basename':{'type':Sequelize[_0x2d38('0x2')]},'type':{'type':Sequelize[_0x2d38('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 00e62fd..9c54aa6 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 _0x7a4f=['count','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','get','omit','createdAt','updatedAt','body','create','originalname','filename','file','mimetype','ChatOfflineMessageId','join','root','offline-chat/','basename','download','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x7a4f,0x141));var _0xf7a4=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x7a4f[_0x547456];return _0xc1fd7b;};'use strict';var emlformat=require(_0xf7a4('0x0'));var rimraf=require(_0xf7a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a4('0x2'));var rp=require(_0xf7a4('0x3'));var moment=require(_0xf7a4('0x4'));var BPromise=require(_0xf7a4('0x5'));var Mustache=require(_0xf7a4('0x6'));var util=require(_0xf7a4('0x7'));var path=require(_0xf7a4('0x8'));var sox=require(_0xf7a4('0x9'));var csv=require(_0xf7a4('0xa'));var ejs=require(_0xf7a4('0xb'));var fs=require('fs');var fs_extra=require(_0xf7a4('0xc'));var _=require('lodash');var squel=require(_0xf7a4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');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('../../config/license/util');var db=require(_0xf7a4('0x17'))['db'];function respondWithStatusCode(_0x30e184,_0x7f1bfe){_0x7f1bfe=_0x7f1bfe||0xcc;return function(_0x1846a2){if(_0x1846a2){return _0x30e184[_0xf7a4('0x18')](_0x7f1bfe);}return _0x30e184[_0xf7a4('0x19')](_0x7f1bfe)[_0xf7a4('0x1a')]();};}function respondWithResult(_0x4e169a,_0x51f9a1){_0x51f9a1=_0x51f9a1||0xc8;return function(_0x54754f){if(_0x54754f){return _0x4e169a[_0xf7a4('0x19')](_0x51f9a1)[_0xf7a4('0x1b')](_0x54754f);}};}function respondWithFilteredResult(_0x47b19e,_0x520ae2){return function(_0x2431fc){if(_0x2431fc){var _0x2775fd=typeof _0x520ae2[_0xf7a4('0x1c')]===_0xf7a4('0x1d')&&typeof _0x520ae2[_0xf7a4('0x1e')]===_0xf7a4('0x1d');var _0x304672=_0x2431fc[_0xf7a4('0x1f')];var _0x1a0b4a=_0x2775fd?0x0:_0x520ae2['offset'];var _0x548a38=_0x2775fd?_0x2431fc[_0xf7a4('0x1f')]:_0x520ae2[_0xf7a4('0x1c')]+_0x520ae2[_0xf7a4('0x1e')];var _0x3b9cd9;if(_0x548a38>=_0x304672){_0x548a38=_0x304672;_0x3b9cd9=0xc8;}else{_0x3b9cd9=0xce;}_0x47b19e[_0xf7a4('0x19')](_0x3b9cd9);return _0x47b19e[_0xf7a4('0x20')](_0xf7a4('0x21'),_0x1a0b4a+'-'+_0x548a38+'/'+_0x304672)[_0xf7a4('0x1b')](_0x2431fc);}return null;};}function patchUpdates(_0x44927c){return function(_0x1c82ea){try{jsonpatch['apply'](_0x1c82ea,_0x44927c,!![]);}catch(_0x1d2a76){return BPromise[_0xf7a4('0x22')](_0x1d2a76);}return _0x1c82ea[_0xf7a4('0x23')]();};}function saveUpdates(_0x2caed5,_0x2dd34c){return function(_0x3e5afe){if(_0x3e5afe){return _0x3e5afe[_0xf7a4('0x24')](_0x2caed5)[_0xf7a4('0x25')](function(_0x872c4){return _0x872c4;});}return null;};}function removeEntity(_0x2e57ef,_0x2173f7){return function(_0x4e7ebd){if(_0x4e7ebd){return _0x4e7ebd[_0xf7a4('0x26')]()[_0xf7a4('0x25')](function(){_0x2e57ef[_0xf7a4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18217e,_0x134bd2){return function(_0x5977f1){if(!_0x5977f1){_0x18217e['sendStatus'](0x194);}return _0x5977f1;};}function handleError(_0x11c81d,_0x20156f){_0x20156f=_0x20156f||0x1f4;return function(_0x455262){logger[_0xf7a4('0x27')](_0x455262['stack']);if(_0x455262['name']){delete _0x455262[_0xf7a4('0x28')];}_0x11c81d[_0xf7a4('0x19')](_0x20156f)['send'](_0x455262);};}exports[_0xf7a4('0x29')]=function(_0x137b1f,_0x5cf28d){var _0x3e23e2={},_0x181cbd={},_0x1505ba={'count':0x0,'rows':[]};var _0xe3a691=_[_0xf7a4('0x2a')](db[_0xf7a4('0x2b')][_0xf7a4('0x2c')],function(_0x3ff3e4){return{'name':_0x3ff3e4[_0xf7a4('0x2d')],'type':_0x3ff3e4[_0xf7a4('0x2e')][_0xf7a4('0x2f')]};});_0x181cbd[_0xf7a4('0x30')]=_[_0xf7a4('0x2a')](_0xe3a691,'name');_0x181cbd[_0xf7a4('0x31')]=_[_0xf7a4('0x32')](_0x137b1f['query']);_0x181cbd[_0xf7a4('0x33')]=_[_0xf7a4('0x34')](_0x181cbd[_0xf7a4('0x30')],_0x181cbd[_0xf7a4('0x31')]);_0x3e23e2[_0xf7a4('0x35')]=_['intersection'](_0x181cbd['model'],qs[_0xf7a4('0x36')](_0x137b1f[_0xf7a4('0x31')][_0xf7a4('0x36')]));_0x3e23e2['attributes']=_0x3e23e2[_0xf7a4('0x35')][_0xf7a4('0x37')]?_0x3e23e2[_0xf7a4('0x35')]:_0x181cbd[_0xf7a4('0x30')];if(!_0x137b1f['query'][_0xf7a4('0x38')](_0xf7a4('0x39'))){_0x3e23e2[_0xf7a4('0x1e')]=qs['limit'](_0x137b1f[_0xf7a4('0x31')][_0xf7a4('0x1e')]);_0x3e23e2[_0xf7a4('0x1c')]=qs[_0xf7a4('0x1c')](_0x137b1f[_0xf7a4('0x31')]['offset']);}_0x3e23e2['order']=qs[_0xf7a4('0x3a')](_0x137b1f[_0xf7a4('0x31')][_0xf7a4('0x3a')]);_0x3e23e2[_0xf7a4('0x3b')]=qs['filters'](_[_0xf7a4('0x3c')](_0x137b1f[_0xf7a4('0x31')],_0x181cbd[_0xf7a4('0x33')]),_0xe3a691);if(_0x137b1f[_0xf7a4('0x31')][_0xf7a4('0x3d')]){_0x3e23e2['where']=_[_0xf7a4('0x3e')](_0x3e23e2[_0xf7a4('0x3b')],{'$or':_[_0xf7a4('0x2a')](_0xe3a691,function(_0x12256c){if(_0x12256c[_0xf7a4('0x2e')]!==_0xf7a4('0x3f')){var _0x290396={};_0x290396[_0x12256c[_0xf7a4('0x28')]]={'$like':'%'+_0x137b1f[_0xf7a4('0x31')][_0xf7a4('0x3d')]+'%'};return _0x290396;}})});}_0x3e23e2=_['merge']({},_0x3e23e2,_0x137b1f[_0xf7a4('0x40')]);var _0x11e612={'where':_0x3e23e2[_0xf7a4('0x3b')]};return db[_0xf7a4('0x2b')][_0xf7a4('0x1f')](_0x11e612)['then'](function(_0x3e857d){_0x1505ba['count']=_0x3e857d;if(_0x137b1f['query'][_0xf7a4('0x41')]){_0x3e23e2[_0xf7a4('0x42')]=[{'all':!![]}];}return db[_0xf7a4('0x2b')]['findAll'](_0x3e23e2);})[_0xf7a4('0x25')](function(_0x3e924f){_0x1505ba[_0xf7a4('0x43')]=_0x3e924f;return _0x1505ba;})['then'](respondWithFilteredResult(_0x5cf28d,_0x3e23e2))[_0xf7a4('0x44')](handleError(_0x5cf28d,null));};exports[_0xf7a4('0x45')]=function(_0x5afcb9,_0x3219e3){var _0x40b85e={'raw':!![],'where':{'id':_0x5afcb9[_0xf7a4('0x46')]['id']}},_0x4f77a2={};_0x4f77a2[_0xf7a4('0x30')]=_[_0xf7a4('0x32')](db['Attachment'][_0xf7a4('0x2c')]);_0x4f77a2['query']=_[_0xf7a4('0x32')](_0x5afcb9[_0xf7a4('0x31')]);_0x4f77a2['filters']=_[_0xf7a4('0x34')](_0x4f77a2[_0xf7a4('0x30')],_0x4f77a2[_0xf7a4('0x31')]);_0x40b85e['attributes']=_[_0xf7a4('0x34')](_0x4f77a2[_0xf7a4('0x30')],qs[_0xf7a4('0x36')](_0x5afcb9[_0xf7a4('0x31')][_0xf7a4('0x36')]));_0x40b85e[_0xf7a4('0x35')]=_0x40b85e[_0xf7a4('0x35')][_0xf7a4('0x37')]?_0x40b85e[_0xf7a4('0x35')]:_0x4f77a2[_0xf7a4('0x30')];if(_0x5afcb9[_0xf7a4('0x31')][_0xf7a4('0x41')]){_0x40b85e[_0xf7a4('0x42')]=[{'all':!![]}];}_0x40b85e=_[_0xf7a4('0x3e')]({},_0x40b85e,_0x5afcb9[_0xf7a4('0x40')]);return db[_0xf7a4('0x2b')][_0xf7a4('0x47')](_0x40b85e)[_0xf7a4('0x25')](handleEntityNotFound(_0x3219e3,null))[_0xf7a4('0x25')](respondWithResult(_0x3219e3,null))[_0xf7a4('0x44')](handleError(_0x3219e3,null));};exports['clone']=function(_0x5c82c0,_0x5eef6e){var _0x3bc935={'where':{'id':_0x5c82c0['params']['id']}},_0x540376={};_0x540376[_0xf7a4('0x30')]=_[_0xf7a4('0x32')](db[_0xf7a4('0x2b')][_0xf7a4('0x2c')]);_0x3bc935['attributes']=_[_0xf7a4('0x34')](_0x540376[_0xf7a4('0x30')],qs[_0xf7a4('0x36')](_0x5c82c0[_0xf7a4('0x31')][_0xf7a4('0x36')]));_0x3bc935[_0xf7a4('0x35')]=_0x3bc935['attributes'][_0xf7a4('0x37')]?_0x3bc935[_0xf7a4('0x35')]:_0x540376[_0xf7a4('0x30')];if(_0x5c82c0[_0xf7a4('0x31')][_0xf7a4('0x41')]){_0x3bc935[_0xf7a4('0x42')]=[{'all':!![]}];}_0x3bc935=_['merge']({},_0x3bc935,_0x5c82c0[_0xf7a4('0x40')]);return db[_0xf7a4('0x2b')][_0xf7a4('0x47')](_0x3bc935)['then'](handleEntityNotFound(_0x5eef6e,null))[_0xf7a4('0x25')](function(_0x2c3af1){if(_0x2c3af1){var _0x1f94a4=_0x2c3af1[_0xf7a4('0x48')]({'plain':!![]});_0x1f94a4=qs[_0xf7a4('0x49')](_0x1f94a4,['id',_0xf7a4('0x4a'),_0xf7a4('0x4b')]);_0x5c82c0[_0xf7a4('0x4c')]=_[_0xf7a4('0x49')](_0x5c82c0[_0xf7a4('0x4c')],['id','createdAt',_0xf7a4('0x4b')]);return db[_0xf7a4('0x2b')]['create'](_[_0xf7a4('0x3e')](_0x1f94a4,_0x5c82c0[_0xf7a4('0x4c')]),{'include':_0x5c82c0[_0xf7a4('0x31')][_0xf7a4('0x41')]?[{'all':!![]}]:undefined});}})[_0xf7a4('0x25')](respondWithResult(_0x5eef6e,0xc9))[_0xf7a4('0x44')](handleError(_0x5eef6e,null));};exports[_0xf7a4('0x24')]=function(_0x4fe8ad,_0x13f27c){if(_0x4fe8ad[_0xf7a4('0x4c')]['id']){delete _0x4fe8ad[_0xf7a4('0x4c')]['id'];}return db[_0xf7a4('0x2b')][_0xf7a4('0x47')]({'where':{'id':_0x4fe8ad[_0xf7a4('0x46')]['id']}})[_0xf7a4('0x25')](handleEntityNotFound(_0x13f27c,null))[_0xf7a4('0x25')](saveUpdates(_0x4fe8ad[_0xf7a4('0x4c')],null))[_0xf7a4('0x25')](respondWithResult(_0x13f27c,null))[_0xf7a4('0x44')](handleError(_0x13f27c,null));};exports[_0xf7a4('0x26')]=function(_0x3e8c8c,_0x5ec727){return db[_0xf7a4('0x2b')][_0xf7a4('0x47')]({'where':{'id':_0x3e8c8c[_0xf7a4('0x46')]['id']}})[_0xf7a4('0x25')](handleEntityNotFound(_0x5ec727,null))[_0xf7a4('0x25')](removeEntity(_0x5ec727,null))[_0xf7a4('0x44')](handleError(_0x5ec727,null));};exports[_0xf7a4('0x4d')]=function(_0x2d7ff8,_0x5d2bac,_0x571f21){_0x2d7ff8[_0xf7a4('0x4c')][_0xf7a4('0x28')]=_0x2d7ff8['file'][_0xf7a4('0x4e')];_0x2d7ff8[_0xf7a4('0x4c')]['basename']=_0x2d7ff8['file'][_0xf7a4('0x4f')];_0x2d7ff8[_0xf7a4('0x4c')][_0xf7a4('0x2e')]=_0x2d7ff8[_0xf7a4('0x50')][_0xf7a4('0x51')];return db[_0xf7a4('0x2b')][_0xf7a4('0x4d')](_0x2d7ff8[_0xf7a4('0x4c')])['then'](respondWithResult(_0x5d2bac,0xc9))[_0xf7a4('0x44')](handleError(_0x5d2bac,null));};exports['download']=function(_0x359612,_0x1626b4,_0x2d8616){return db[_0xf7a4('0x2b')]['findOne']({'where':{'id':_0x359612[_0xf7a4('0x46')]['id']},'raw':!![]})[_0xf7a4('0x25')](handleEntityNotFound(_0x1626b4,null))[_0xf7a4('0x25')](function(_0x53d4a9){if(_0x53d4a9){var _0x43c3c7=_0x53d4a9[_0xf7a4('0x52')]!==null;var _0x2fbf07=path[_0xf7a4('0x53')](config[_0xf7a4('0x54')],'server/files/attachments/');if(_0x43c3c7){_0x2fbf07=path[_0xf7a4('0x53')](_0x2fbf07,_0xf7a4('0x55'));}var _0x1e4967=path['join'](_0x2fbf07,_0x53d4a9[_0xf7a4('0x56')]);return _0x1626b4[_0xf7a4('0x57')](_0x1e4967);}})['catch'](handleError(_0x1626b4,null));};
\ No newline at end of file
+var _0xa92c=['mimetype','download','join','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','set','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','index','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','Attachment','include','findAll','then','catch','show','rawAttributes','keys','find','clone','params','omit','body','createdAt','updatedAt','create','includeAll','file','originalname','basename','filename'];(function(_0x276683,_0x3bc50){var _0x4edd55=function(_0x7082b4){while(--_0x7082b4){_0x276683['push'](_0x276683['shift']());}};_0x4edd55(++_0x3bc50);}(_0xa92c,0x1b2));var _0xca92=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xa92c[_0x2261ce];return _0x524640;};'use strict';var emlformat=require(_0xca92('0x0'));var rimraf=require(_0xca92('0x1'));var zipdir=require(_0xca92('0x2'));var jsonpatch=require(_0xca92('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xca92('0x4'));var Mustache=require(_0xca92('0x5'));var util=require('util');var path=require(_0xca92('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca92('0x7'));var fs=require('fs');var fs_extra=require(_0xca92('0x8'));var _=require(_0xca92('0x9'));var squel=require('squel');var crypto=require(_0xca92('0xa'));var jsforce=require(_0xca92('0xb'));var deskjs=require(_0xca92('0xc'));var toCsv=require(_0xca92('0xd'));var querystring=require(_0xca92('0xe'));var Papa=require(_0xca92('0xf'));var Redis=require(_0xca92('0x10'));var authService=require(_0xca92('0x11'));var qs=require(_0xca92('0x12'));var as=require(_0xca92('0x13'));var hardwareService=require(_0xca92('0x14'));var logger=require(_0xca92('0x15'))(_0xca92('0x16'));var utils=require('../../config/utils');var config=require(_0xca92('0x17'));var licenseUtil=require(_0xca92('0x18'));var db=require(_0xca92('0x19'))['db'];function respondWithStatusCode(_0x346f60,_0x547127){_0x547127=_0x547127||0xcc;return function(_0x873b8c){if(_0x873b8c){return _0x346f60['sendStatus'](_0x547127);}return _0x346f60['status'](_0x547127)['end']();};}function respondWithResult(_0x53b8e4,_0x424e45){_0x424e45=_0x424e45||0xc8;return function(_0x2aa01e){if(_0x2aa01e){return _0x53b8e4[_0xca92('0x1a')](_0x424e45)[_0xca92('0x1b')](_0x2aa01e);}};}function respondWithFilteredResult(_0x41f253,_0x1c3bac){return function(_0xf95084){if(_0xf95084){var _0x1a28f4=typeof _0x1c3bac[_0xca92('0x1c')]==='undefined'&&typeof _0x1c3bac['limit']==='undefined';var _0x100948=_0xf95084[_0xca92('0x1d')];var _0x434525=_0x1a28f4?0x0:_0x1c3bac['offset'];var _0x143c4c=_0x1a28f4?_0xf95084[_0xca92('0x1d')]:_0x1c3bac[_0xca92('0x1c')]+_0x1c3bac['limit'];var _0x103193;if(_0x143c4c>=_0x100948){_0x143c4c=_0x100948;_0x103193=0xc8;}else{_0x103193=0xce;}_0x41f253[_0xca92('0x1a')](_0x103193);return _0x41f253[_0xca92('0x1e')]('Content-Range',_0x434525+'-'+_0x143c4c+'/'+_0x100948)[_0xca92('0x1b')](_0xf95084);}return null;};}function patchUpdates(_0x4ceddc){return function(_0x216eb0){try{jsonpatch[_0xca92('0x1f')](_0x216eb0,_0x4ceddc,!![]);}catch(_0x5437cc){return BPromise[_0xca92('0x20')](_0x5437cc);}return _0x216eb0[_0xca92('0x21')]();};}function saveUpdates(_0x1d96e0,_0xf271f5){return function(_0x1f3380){if(_0x1f3380){return _0x1f3380[_0xca92('0x22')](_0x1d96e0)['then'](function(_0xc7d2e){return _0xc7d2e;});}return null;};}function removeEntity(_0x209046,_0x1e68ff){return function(_0x1bc0b0){if(_0x1bc0b0){return _0x1bc0b0[_0xca92('0x23')]()['then'](function(){_0x209046[_0xca92('0x1a')](0xcc)[_0xca92('0x24')]();});}};}function handleEntityNotFound(_0xf774f6,_0xaf0cc9){return function(_0x50affd){if(!_0x50affd){_0xf774f6[_0xca92('0x25')](0x194);}return _0x50affd;};}function handleError(_0x6eade6,_0x2162ff){_0x2162ff=_0x2162ff||0x1f4;return function(_0xa81e14){logger[_0xca92('0x26')](_0xa81e14[_0xca92('0x27')]);if(_0xa81e14[_0xca92('0x28')]){delete _0xa81e14['name'];}_0x6eade6[_0xca92('0x1a')](_0x2162ff)['send'](_0xa81e14);};}exports[_0xca92('0x29')]=function(_0x468288,_0x496e48){var _0x3877c6={},_0x2cad7a={},_0x1b31c1={'count':0x0,'rows':[]};var _0x12fdb5=_['map'](db['Attachment']['rawAttributes'],function(_0x369f92){return{'name':_0x369f92[_0xca92('0x2a')],'type':_0x369f92[_0xca92('0x2b')]['key']};});_0x2cad7a[_0xca92('0x2c')]=_[_0xca92('0x2d')](_0x12fdb5,_0xca92('0x28'));_0x2cad7a[_0xca92('0x2e')]=_['keys'](_0x468288['query']);_0x2cad7a[_0xca92('0x2f')]=_[_0xca92('0x30')](_0x2cad7a[_0xca92('0x2c')],_0x2cad7a['query']);_0x3877c6['attributes']=_[_0xca92('0x30')](_0x2cad7a[_0xca92('0x2c')],qs[_0xca92('0x31')](_0x468288[_0xca92('0x2e')][_0xca92('0x31')]));_0x3877c6['attributes']=_0x3877c6[_0xca92('0x32')][_0xca92('0x33')]?_0x3877c6[_0xca92('0x32')]:_0x2cad7a[_0xca92('0x2c')];if(!_0x468288[_0xca92('0x2e')]['hasOwnProperty'](_0xca92('0x34'))){_0x3877c6['limit']=qs['limit'](_0x468288[_0xca92('0x2e')][_0xca92('0x35')]);_0x3877c6[_0xca92('0x1c')]=qs[_0xca92('0x1c')](_0x468288[_0xca92('0x2e')][_0xca92('0x1c')]);}_0x3877c6[_0xca92('0x36')]=qs[_0xca92('0x37')](_0x468288[_0xca92('0x2e')][_0xca92('0x37')]);_0x3877c6[_0xca92('0x38')]=qs[_0xca92('0x2f')](_['pick'](_0x468288['query'],_0x2cad7a[_0xca92('0x2f')]),_0x12fdb5);if(_0x468288[_0xca92('0x2e')][_0xca92('0x39')]){_0x3877c6[_0xca92('0x38')]=_[_0xca92('0x3a')](_0x3877c6[_0xca92('0x38')],{'$or':_['map'](_0x12fdb5,function(_0x38f6fd){if(_0x38f6fd[_0xca92('0x2b')]!==_0xca92('0x3b')){var _0x27322b={};_0x27322b[_0x38f6fd[_0xca92('0x28')]]={'$like':'%'+_0x468288['query']['filter']+'%'};return _0x27322b;}})});}_0x3877c6=_['merge']({},_0x3877c6,_0x468288[_0xca92('0x3c')]);var _0x8b0cd4={'where':_0x3877c6['where']};return db[_0xca92('0x3d')]['count'](_0x8b0cd4)['then'](function(_0x1468a0){_0x1b31c1['count']=_0x1468a0;if(_0x468288[_0xca92('0x2e')]['includeAll']){_0x3877c6[_0xca92('0x3e')]=[{'all':!![]}];}return db[_0xca92('0x3d')][_0xca92('0x3f')](_0x3877c6);})['then'](function(_0xe186e7){_0x1b31c1['rows']=_0xe186e7;return _0x1b31c1;})[_0xca92('0x40')](respondWithFilteredResult(_0x496e48,_0x3877c6))[_0xca92('0x41')](handleError(_0x496e48,null));};exports[_0xca92('0x42')]=function(_0x5db5e5,_0x350f20){var _0x197f22={'raw':!![],'where':{'id':_0x5db5e5['params']['id']}},_0x2fc807={};_0x2fc807[_0xca92('0x2c')]=_['keys'](db['Attachment'][_0xca92('0x43')]);_0x2fc807['query']=_[_0xca92('0x44')](_0x5db5e5[_0xca92('0x2e')]);_0x2fc807[_0xca92('0x2f')]=_[_0xca92('0x30')](_0x2fc807[_0xca92('0x2c')],_0x2fc807[_0xca92('0x2e')]);_0x197f22[_0xca92('0x32')]=_[_0xca92('0x30')](_0x2fc807['model'],qs[_0xca92('0x31')](_0x5db5e5[_0xca92('0x2e')][_0xca92('0x31')]));_0x197f22[_0xca92('0x32')]=_0x197f22[_0xca92('0x32')][_0xca92('0x33')]?_0x197f22[_0xca92('0x32')]:_0x2fc807[_0xca92('0x2c')];if(_0x5db5e5[_0xca92('0x2e')]['includeAll']){_0x197f22[_0xca92('0x3e')]=[{'all':!![]}];}_0x197f22=_['merge']({},_0x197f22,_0x5db5e5[_0xca92('0x3c')]);return db[_0xca92('0x3d')][_0xca92('0x45')](_0x197f22)[_0xca92('0x40')](handleEntityNotFound(_0x350f20,null))[_0xca92('0x40')](respondWithResult(_0x350f20,null))[_0xca92('0x41')](handleError(_0x350f20,null));};exports[_0xca92('0x46')]=function(_0x4c20ab,_0x317e1e){var _0x45faf3={'where':{'id':_0x4c20ab[_0xca92('0x47')]['id']}},_0x42852f={};_0x42852f['model']=_['keys'](db[_0xca92('0x3d')]['rawAttributes']);_0x45faf3['attributes']=_[_0xca92('0x30')](_0x42852f['model'],qs[_0xca92('0x31')](_0x4c20ab[_0xca92('0x2e')][_0xca92('0x31')]));_0x45faf3[_0xca92('0x32')]=_0x45faf3[_0xca92('0x32')][_0xca92('0x33')]?_0x45faf3[_0xca92('0x32')]:_0x42852f[_0xca92('0x2c')];if(_0x4c20ab['query']['includeAll']){_0x45faf3[_0xca92('0x3e')]=[{'all':!![]}];}_0x45faf3=_['merge']({},_0x45faf3,_0x4c20ab[_0xca92('0x3c')]);return db[_0xca92('0x3d')][_0xca92('0x45')](_0x45faf3)[_0xca92('0x40')](handleEntityNotFound(_0x317e1e,null))[_0xca92('0x40')](function(_0x2c1cb0){if(_0x2c1cb0){var _0x36ab1b=_0x2c1cb0['get']({'plain':!![]});_0x36ab1b=qs['omit'](_0x36ab1b,['id','createdAt','updatedAt']);_0x4c20ab['body']=_[_0xca92('0x48')](_0x4c20ab[_0xca92('0x49')],['id',_0xca92('0x4a'),_0xca92('0x4b')]);return db['Attachment'][_0xca92('0x4c')](_[_0xca92('0x3a')](_0x36ab1b,_0x4c20ab[_0xca92('0x49')]),{'include':_0x4c20ab['query'][_0xca92('0x4d')]?[{'all':!![]}]:undefined});}})[_0xca92('0x40')](respondWithResult(_0x317e1e,0xc9))[_0xca92('0x41')](handleError(_0x317e1e,null));};exports[_0xca92('0x22')]=function(_0x204866,_0x55cea9){if(_0x204866[_0xca92('0x49')]['id']){delete _0x204866[_0xca92('0x49')]['id'];}return db['Attachment']['find']({'where':{'id':_0x204866['params']['id']}})['then'](handleEntityNotFound(_0x55cea9,null))[_0xca92('0x40')](saveUpdates(_0x204866[_0xca92('0x49')],null))['then'](respondWithResult(_0x55cea9,null))[_0xca92('0x41')](handleError(_0x55cea9,null));};exports['destroy']=function(_0x206dfe,_0x52f846){return db[_0xca92('0x3d')][_0xca92('0x45')]({'where':{'id':_0x206dfe[_0xca92('0x47')]['id']}})[_0xca92('0x40')](handleEntityNotFound(_0x52f846,null))[_0xca92('0x40')](removeEntity(_0x52f846,null))[_0xca92('0x41')](handleError(_0x52f846,null));};exports['create']=function(_0x48dd38,_0x153ba7,_0x52b695){_0x48dd38[_0xca92('0x49')][_0xca92('0x28')]=_0x48dd38[_0xca92('0x4e')][_0xca92('0x4f')];_0x48dd38['body'][_0xca92('0x50')]=_0x48dd38[_0xca92('0x4e')][_0xca92('0x51')];_0x48dd38[_0xca92('0x49')][_0xca92('0x2b')]=_0x48dd38[_0xca92('0x4e')][_0xca92('0x52')];return db[_0xca92('0x3d')][_0xca92('0x4c')](_0x48dd38[_0xca92('0x49')])[_0xca92('0x40')](respondWithResult(_0x153ba7,0xc9))[_0xca92('0x41')](handleError(_0x153ba7,null));};exports[_0xca92('0x53')]=function(_0x482161,_0x2f447d,_0x7da97f){return db['Attachment']['findOne']({'where':{'id':_0x482161['params']['id']},'raw':!![]})[_0xca92('0x40')](handleEntityNotFound(_0x2f447d,null))['then'](function(_0xcf009e){if(_0xcf009e){var _0x4daaee=_0xcf009e['ChatOfflineMessageId']!==null;var _0x351d6f=path[_0xca92('0x54')](config['root'],_0xca92('0x55'));if(_0x4daaee){_0x351d6f=path[_0xca92('0x54')](_0x351d6f,'offline-chat/');}var _0x460016=path[_0xca92('0x54')](_0x351d6f,_0xcf009e[_0xca92('0x50')]);return _0x2f447d[_0xca92('0x53')](_0x460016);}})[_0xca92('0x41')](handleError(_0x2f447d,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index e17fdd8..1080fea 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 _0xbfc1=['define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x517d90,_0x52909b){var _0x52f7a3=function(_0x4ef9c7){while(--_0x4ef9c7){_0x517d90['push'](_0x517d90['shift']());}};_0x52f7a3(++_0x52909b);}(_0xbfc1,0x199));var _0x1bfc=function(_0x4c5dd2,_0x257029){_0x4c5dd2=_0x4c5dd2-0x0;var _0x1710c9=_0xbfc1[_0x4c5dd2];return _0x1710c9;};'use strict';var _=require(_0x1bfc('0x0'));var util=require('util');var logger=require(_0x1bfc('0x1'))(_0x1bfc('0x2'));var moment=require(_0x1bfc('0x3'));var BPromise=require(_0x1bfc('0x4'));var rp=require(_0x1bfc('0x5'));var fs=require('fs');var path=require(_0x1bfc('0x6'));var rimraf=require(_0x1bfc('0x7'));var config=require(_0x1bfc('0x8'));var attributes=require(_0x1bfc('0x9'));module[_0x1bfc('0xa')]=function(_0x1dbb4d,_0x19ac78){return _0x1dbb4d[_0x1bfc('0xb')](_0x1bfc('0xc'),attributes,{'tableName':_0x1bfc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d36=['./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3e9c53,_0x401eb2){var _0x2ffa2f=function(_0xae5b99){while(--_0xae5b99){_0x3e9c53['push'](_0x3e9c53['shift']());}};_0x2ffa2f(++_0x401eb2);}(_0x6d36,0xf7));var _0x66d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6d36[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x66d3('0x0'));var util=require(_0x66d3('0x1'));var logger=require(_0x66d3('0x2'))(_0x66d3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x66d3('0x4'));var fs=require('fs');var path=require(_0x66d3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x66d3('0x6'));module[_0x66d3('0x7')]=function(_0x1736a7,_0x53f7e6){return _0x1736a7[_0x66d3('0x8')](_0x66d3('0x9'),attributes,{'tableName':_0x66d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 2fa0178..8091026 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 _0x3140=['CreateAttachment','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','Attachment','create','options','raw','then'];(function(_0x323879,_0x32a9f6){var _0x5886b4=function(_0x21ae9d){while(--_0x21ae9d){_0x323879['push'](_0x323879['shift']());}};_0x5886b4(++_0x32a9f6);}(_0x3140,0xaf));var _0x0314=function(_0x625492,_0x1cd944){_0x625492=_0x625492-0x0;var _0x296b94=_0x3140[_0x625492];return _0x296b94;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('Attachment,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});}exports['CreateAttachment']=function(_0x575b68){var _0x39db0b=this;return new Promise(function(_0x329679,_0x583d39){return db[_0x0314('0x17')][_0x0314('0x18')](_0x575b68['body'],{'raw':_0x575b68[_0x0314('0x19')]?_0x575b68['options'][_0x0314('0x1a')]===undefined?!![]:![]:!![]})[_0x0314('0x1b')](function(_0x16d273){logger[_0x0314('0xd')](_0x0314('0x1c'),_0x575b68);logger[_0x0314('0xf')]('CreateAttachment',_0x575b68,JSON['stringify'](_0x16d273));_0x329679(_0x16d273);})[_0x0314('0x16')](function(_0xbd3ad0){logger[_0x0314('0x12')](_0x0314('0x1c'),_0xbd3ad0[_0x0314('0x15')],_0x575b68);_0x583d39(_0x39db0b[_0x0314('0x12')](0x1f4,_0xbd3ad0['message']));});});};
\ No newline at end of file
+var _0xdace=['message','info','CreateAttachment','Attachment','create','options','raw','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','Attachment,\x20%s,\x20%s'];(function(_0x156a96,_0xb28bc){var _0x297671=function(_0x302a41){while(--_0x302a41){_0x156a96['push'](_0x156a96['shift']());}};_0x297671(++_0xb28bc);}(_0xdace,0xc5));var _0xedac=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0xdace[_0x7d62cb];return _0x3a6266;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('Attachment,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});}exports[_0xedac('0x15')]=function(_0x4fb540){var _0x4b2563=this;return new Promise(function(_0x2d02d7,_0x2adefa){return db[_0xedac('0x16')][_0xedac('0x17')](_0x4fb540['body'],{'raw':_0x4fb540['options']?_0x4fb540[_0xedac('0x18')][_0xedac('0x19')]===undefined?!![]:![]:!![]})[_0xedac('0xc')](function(_0xcc1605){logger[_0xedac('0x14')](_0xedac('0x15'),_0x4fb540);logger[_0xedac('0xe')](_0xedac('0x15'),_0x4fb540,JSON['stringify'](_0xcc1605));_0x2d02d7(_0xcc1605);})[_0xedac('0x1a')](function(_0x510005){logger[_0xedac('0x10')](_0xedac('0x15'),_0x510005['message'],_0x4fb540);_0x2adefa(_0x4b2563[_0xedac('0x10')](0x1f4,_0x510005[_0xedac('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 8d5ffc6..cf47319 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x2e4e4a,_0x12a58f){var _0x3a28fb=function(_0x4d34f3){while(--_0x4d34f3){_0x2e4e4a['push'](_0x2e4e4a['shift']());}};_0x3a28fb(++_0x12a58f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5af1c8,_0x1b88ee){_0x5af1c8=_0x5af1c8-0x0;var _0x3bca4a=_0x5f2f[_0x5af1c8];return _0x3bca4a;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 5faf51e..a009d7b 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 _0xf628=['activedirectory','baseDN','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','disabled','blockedAt','online','admin','user','agent','then','blockDuration','blocked','minutes','getLicense','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api'];(function(_0x16a80e,_0x52554a){var _0x1db251=function(_0x71b1cb){while(--_0x71b1cb){_0x16a80e['push'](_0x16a80e['shift']());}};_0x1db251(++_0x52554a);}(_0xf628,0xcd));var _0x8f62=function(_0x1ee5ed,_0x49e4e8){_0x1ee5ed=_0x1ee5ed-0x0;var _0x5e2a9b=_0xf628[_0x1ee5ed];return _0x5e2a9b;};'use strict';var passport=require(_0x8f62('0x0'));var LocalStrategy=require(_0x8f62('0x1'))['Strategy'];var moment=require(_0x8f62('0x2'));var ActiveDirectory=require(_0x8f62('0x3'));var BPromise=require(_0x8f62('0x4'));var util=require('util');var db=require(_0x8f62('0x5'))['db'];var authService=require(_0x8f62('0x6'));var utils=require(_0x8f62('0x7'));var config=require('../../config/environment');var logger=require(_0x8f62('0x8'))(_0x8f62('0x9'));function isActiveDirectoryConfigured(_0x4124de){var _0xb9470a=![];if(typeof _0x4124de[_0x8f62('0xa')]!=='undefined'){_0xb9470a=_0x4124de[_0x8f62('0xa')][_0x8f62('0xb')]&&_0x4124de[_0x8f62('0xa')]['url']&&_0x4124de[_0x8f62('0xa')]['domain'];}return _0xb9470a;}function adAuthenticate(_0x45bd96,_0x2e7712,_0x4b165e){return new BPromise(function(_0x2cd469,_0x53afae){try{var _0xf798aa=new ActiveDirectory(_0x45bd96);_0xf798aa['authenticate'](_0x2e7712,_0x4b165e,function(_0x5dc1a2,_0x53c7db){if(_0x5dc1a2){logger[_0x8f62('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x2e7712,util['inspect'](_0x5dc1a2,{'showHidden':![],'depth':null}));_0x53afae(_0x8f62('0xd'));}else if(!_0x53c7db){logger[_0x8f62('0xc')](_0x8f62('0xe'),_0x2e7712);_0x53afae(_0x8f62('0xd'));}else{_0x2cd469(_0x53c7db);}});}catch(_0x1f9b99){_0x53afae(_0x1f9b99);}});}function ActiveDirectoryAuthenticate(_0x232949,_0x3d5510,_0x332488,_0x29f745){var _0x4c9281,_0x9d32c7;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x8f62('0xf'),_0x3d5510);return _0x29f745(null,![],{'message':_0x8f62('0xd')});}return db[_0x8f62('0x10')][_0x8f62('0x11')]({'where':{'id':0x1},'attributes':[_0x8f62('0x12'),'blockDuration'],'raw':!![]})['then'](function(_0x21147b){_0x4c9281=_0x21147b;if(!_0x4c9281['adSsoEnabled']){logger[_0x8f62('0xc')](_0x8f62('0x13'),_0x3d5510);throw new Error(_0x8f62('0xd'));}return _0x232949[_0x8f62('0x11')]({'attributes':['id',_0x8f62('0x14'),_0x8f62('0x15'),'salt','role',_0x8f62('0x16'),'blocked',_0x8f62('0x17'),_0x8f62('0x18')],'where':{'name':_0x3d5510,'role':{'$or':[_0x8f62('0x19'),_0x8f62('0x1a'),_0x8f62('0x1b')]},'adSsoEnabled':!![]}});})[_0x8f62('0x1c')](function(_0x329d73){if(!_0x329d73||_0x329d73&&_0x329d73[_0x8f62('0x14')]!==_0x3d5510){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x9d32c7=_0x329d73;var _0x4a095b=_0x9d32c7[_0x8f62('0x14')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x8f62('0xa')],_0x4a095b,_0x332488);})[_0x8f62('0x1c')](function(_0x359459){if(_0x9d32c7[_0x8f62('0x16')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4c9281[_0x8f62('0x1d')]>0x0){if(_0x9d32c7[_0x8f62('0x1e')]){if(moment(_0x9d32c7[_0x8f62('0x17')])['add'](_0x4c9281['blockDuration'],_0x8f62('0x1f'))>moment()){throw new Error(_0x8f62('0xd'));}return utils['clearBlockUser'](_0x9d32c7,0x0,![],null)[_0x8f62('0x1c')](function(){return utils['getLicense'](_0x9d32c7);})[_0x8f62('0x1c')](function(){return _0x29f745(null,_0x9d32c7);});}else{return utils['getLicense'](_0x9d32c7)[_0x8f62('0x1c')](function(){return _0x29f745(null,_0x9d32c7);});}}else{return utils[_0x8f62('0x20')](_0x9d32c7)[_0x8f62('0x1c')](function(){return _0x29f745(null,_0x9d32c7);});}})['catch'](function(_0x1da6df){return _0x29f745(null,![],_0x1da6df);});}function handleError(_0x11c3b7,_0x3512e7,_0x2620f6){return _0x11c3b7[_0x8f62('0x21')](_0x3512e7||0x1f4)[_0x8f62('0x22')]({'message':_0x2620f6?_0x2620f6[_0x8f62('0x23')]||_0x2620f6:''});}exports['login']=function(_0x4ce034,_0x2cf64f,_0x9dd647){passport['authenticate'](_0x8f62('0x24'),function(_0x3249fb,_0x3f24eb,_0x10337c){var _0x51f3a=_0x3249fb||_0x10337c;if(_0x51f3a){return handleError(_0x2cf64f,0x191,_0x51f3a);}if(!_0x3f24eb){return handleError(_0x2cf64f,0x194,{'message':_0x8f62('0x25')});}else{var _0x415169={'payload':{'id':_0x3f24eb['id'],'role':_0x3f24eb[_0x8f62('0x26')]},'options':{'expiresIn':0x15180}};return authService[_0x8f62('0x27')](_0x415169)[_0x8f62('0x1c')](function(_0x22aa87){_0x2cf64f[_0x8f62('0x28')]({'id':_0x3f24eb['id'],'token':_0x22aa87,'statusCall':'','isAlreadyLogged':_0x3f24eb[_0x8f62('0x18')]});});}})(_0x4ce034,_0x2cf64f,_0x9dd647);};passport[_0x8f62('0x29')]('ad-login',new LocalStrategy({'usernameField':_0x8f62('0x14'),'passwordField':_0x8f62('0x15')},function(_0x3ba00a,_0x497044,_0x22174d){return ActiveDirectoryAuthenticate(db[_0x8f62('0x2a')],_0x3ba00a,_0x497044,_0x22174d);}));
\ No newline at end of file
+var _0x46e3=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','disabled','blockedAt','online','admin','user','blocked','add','minutes','clearBlockUser','getLicense','catch','status','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','name','User','passport','passport-local','moment','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x244086,_0x2d3b2d){var _0x57b8ae=function(_0x5f1409){while(--_0x5f1409){_0x244086['push'](_0x244086['shift']());}};_0x57b8ae(++_0x2d3b2d);}(_0x46e3,0x128));var _0x346e=function(_0x399fa9,_0x50bbd1){_0x399fa9=_0x399fa9-0x0;var _0x1a396e=_0x46e3[_0x399fa9];return _0x1a396e;};'use strict';var passport=require(_0x346e('0x0'));var LocalStrategy=require(_0x346e('0x1'))['Strategy'];var moment=require(_0x346e('0x2'));var ActiveDirectory=require(_0x346e('0x3'));var BPromise=require('bluebird');var util=require(_0x346e('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x346e('0x5'));var utils=require(_0x346e('0x6'));var config=require(_0x346e('0x7'));var logger=require(_0x346e('0x8'))('api');function isActiveDirectoryConfigured(_0x4c1a6c){var _0x4f32a0=![];if(typeof _0x4c1a6c[_0x346e('0x9')]!==_0x346e('0xa')){_0x4f32a0=_0x4c1a6c[_0x346e('0x9')][_0x346e('0xb')]&&_0x4c1a6c[_0x346e('0x9')][_0x346e('0xc')]&&_0x4c1a6c[_0x346e('0x9')][_0x346e('0xd')];}return _0x4f32a0;}function adAuthenticate(_0x3e5ec9,_0x3f5f2f,_0xb1fd3c){return new BPromise(function(_0xdb7380,_0x29f863){try{var _0x347c1c=new ActiveDirectory(_0x3e5ec9);_0x347c1c[_0x346e('0xe')](_0x3f5f2f,_0xb1fd3c,function(_0x56740a,_0x5968c6){if(_0x56740a){logger[_0x346e('0xf')](_0x346e('0x10'),_0x3f5f2f,util[_0x346e('0x11')](_0x56740a,{'showHidden':![],'depth':null}));_0x29f863(_0x346e('0x12'));}else if(!_0x5968c6){logger[_0x346e('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3f5f2f);_0x29f863('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xdb7380(_0x5968c6);}});}catch(_0x3e3336){_0x29f863(_0x3e3336);}});}function ActiveDirectoryAuthenticate(_0x4f1566,_0x57abc6,_0x2cb8ba,_0xac2d44){var _0xf73052,_0x28258f;if(!isActiveDirectoryConfigured(config)){logger[_0x346e('0xf')](_0x346e('0x13'),_0x57abc6);return _0xac2d44(null,![],{'message':_0x346e('0x12')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x346e('0x14'),_0x346e('0x15')],'raw':!![]})[_0x346e('0x16')](function(_0x53cb12){_0xf73052=_0x53cb12;if(!_0xf73052['adSsoEnabled']){logger[_0x346e('0xf')](_0x346e('0x17'),_0x57abc6);throw new Error(_0x346e('0x12'));}return _0x4f1566[_0x346e('0x18')]({'attributes':['id','name',_0x346e('0x19'),_0x346e('0x1a'),'role',_0x346e('0x1b'),'blocked',_0x346e('0x1c'),_0x346e('0x1d')],'where':{'name':_0x57abc6,'role':{'$or':[_0x346e('0x1e'),_0x346e('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x346e('0x16')](function(_0x3c5444){if(!_0x3c5444||_0x3c5444&&_0x3c5444['name']!==_0x57abc6){throw new Error(_0x346e('0x12'));}_0x28258f=_0x3c5444;var _0x3ed3aa=_0x28258f['name']+'@'+config[_0x346e('0x9')][_0x346e('0xd')];return adAuthenticate(config['activedirectory'],_0x3ed3aa,_0x2cb8ba);})[_0x346e('0x16')](function(_0x4483d4){if(_0x28258f[_0x346e('0x1b')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0xf73052[_0x346e('0x15')]>0x0){if(_0x28258f[_0x346e('0x20')]){if(moment(_0x28258f[_0x346e('0x1c')])[_0x346e('0x21')](_0xf73052['blockDuration'],_0x346e('0x22'))>moment()){throw new Error(_0x346e('0x12'));}return utils[_0x346e('0x23')](_0x28258f,0x0,![],null)['then'](function(){return utils[_0x346e('0x24')](_0x28258f);})[_0x346e('0x16')](function(){return _0xac2d44(null,_0x28258f);});}else{return utils[_0x346e('0x24')](_0x28258f)['then'](function(){return _0xac2d44(null,_0x28258f);});}}else{return utils[_0x346e('0x24')](_0x28258f)[_0x346e('0x16')](function(){return _0xac2d44(null,_0x28258f);});}})[_0x346e('0x25')](function(_0x486ae1){return _0xac2d44(null,![],_0x486ae1);});}function handleError(_0x5ee942,_0xcfe8a2,_0x127d0c){return _0x5ee942[_0x346e('0x26')](_0xcfe8a2||0x1f4)['send']({'message':_0x127d0c?_0x127d0c['message']||_0x127d0c:''});}exports[_0x346e('0x27')]=function(_0xa174ca,_0x5edbfe,_0x26adb8){passport[_0x346e('0xe')](_0x346e('0x28'),function(_0x215bf4,_0x575907,_0x3df5eb){var _0x3dfda8=_0x215bf4||_0x3df5eb;if(_0x3dfda8){return handleError(_0x5edbfe,0x191,_0x3dfda8);}if(!_0x575907){return handleError(_0x5edbfe,0x194,{'message':_0x346e('0x29')});}else{var _0x369c96={'payload':{'id':_0x575907['id'],'role':_0x575907['role']},'options':{'expiresIn':0x15180}};return authService[_0x346e('0x2a')](_0x369c96)[_0x346e('0x16')](function(_0x14c1a){_0x5edbfe['json']({'id':_0x575907['id'],'token':_0x14c1a,'statusCall':'','isAlreadyLogged':_0x575907[_0x346e('0x1d')]});});}})(_0xa174ca,_0x5edbfe,_0x26adb8);};passport['use'](_0x346e('0x28'),new LocalStrategy({'usernameField':_0x346e('0x2b'),'passwordField':_0x346e('0x19')},function(_0x34fef5,_0x1325a9,_0x58dbdd){return ActiveDirectoryAuthenticate(db[_0x346e('0x2c')],_0x34fef5,_0x1325a9,_0x58dbdd);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 5c0daed..1fa158d 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 _0x2b01=['./authActiveDirectory.controller','express','Router'];(function(_0x21c9b6,_0x5af50f){var _0x2c9c5c=function(_0x487c95){while(--_0x487c95){_0x21c9b6['push'](_0x21c9b6['shift']());}};_0x2c9c5c(++_0x5af50f);}(_0x2b01,0xe5));var _0x12b0=function(_0x49546a,_0x195a3f){_0x49546a=_0x49546a-0x0;var _0xca8c10=_0x2b01[_0x49546a];return _0xca8c10;};'use strict';var express=require(_0x12b0('0x0'));var router=express[_0x12b0('0x1')]();var controller=require(_0x12b0('0x2'));router['post']('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0x0f39=['exports','express','./authActiveDirectory.controller','post','login'];(function(_0x333a53,_0xe8f712){var _0x3c2bd3=function(_0x106e4f){while(--_0x106e4f){_0x333a53['push'](_0x333a53['shift']());}};_0x3c2bd3(++_0xe8f712);}(_0x0f39,0xdd));var _0x90f3=function(_0x400f47,_0x112481){_0x400f47=_0x400f47-0x0;var _0x3edac7=_0x0f39[_0x400f47];return _0x3edac7;};'use strict';var express=require(_0x90f3('0x0'));var router=express['Router']();var controller=require(_0x90f3('0x1'));router[_0x90f3('0x2')]('/',controller[_0x90f3('0x3')]);module[_0x90f3('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 c769a55..19ad1f5 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(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7a54,0x106));var _0x47a5=function(_0x455fdd,_0x37092b){_0x455fdd=_0x455fdd-0x0;var _0x2c232b=_0x7a54[_0x455fdd];return _0x2c232b;};'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(_0xcc4d00,_0x206c59){var _0x3bec1f=function(_0xf4dd00){while(--_0xf4dd00){_0xcc4d00['push'](_0xcc4d00['shift']());}};_0x3bec1f(++_0x206c59);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 42fc0ca..3289086 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 _0xc2e6=['exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','setTokenCookie'];(function(_0x41a31e,_0x3ef74b){var _0x3fccba=function(_0x1ecda3){while(--_0x1ecda3){_0x41a31e['push'](_0x41a31e['shift']());}};_0x3fccba(++_0x3ef74b);}(_0xc2e6,0xdd));var _0x6c2e=function(_0x4b2ecd,_0x3c9f85){_0x4b2ecd=_0x4b2ecd-0x0;var _0x4fcc19=_0xc2e6[_0x4b2ecd];return _0x4fcc19;};'use strict';var express=require(_0x6c2e('0x0'));var passport=require(_0x6c2e('0x1'));var router=express[_0x6c2e('0x2')]();var controller=require(_0x6c2e('0x3'));var userController=require(_0x6c2e('0x4'));var authService=require(_0x6c2e('0x5'));router['get']('/',controller[_0x6c2e('0x6')]);router[_0x6c2e('0x7')](_0x6c2e('0x8'),controller['callback'],authService['isMiddleware'],userController[_0x6c2e('0x6')],authService[_0x6c2e('0x9')]);module[_0x6c2e('0xa')]=router;
\ No newline at end of file
+var _0x7fc4=['/callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../../components/auth/service','login','get'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x7fc4,0x1cf));var _0x47fc=function(_0xc0e946,_0x5ea564){_0xc0e946=_0xc0e946-0x0;var _0x39efa9=_0x7fc4[_0xc0e946];return _0x39efa9;};'use strict';var express=require('express');var passport=require(_0x47fc('0x0'));var router=express['Router']();var controller=require(_0x47fc('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x47fc('0x2'));router['get']('/',controller[_0x47fc('0x3')]);router[_0x47fc('0x4')](_0x47fc('0x5'),controller['callback'],authService[_0x47fc('0x6')],userController[_0x47fc('0x3')],authService[_0x47fc('0x7')]);module[_0x47fc('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 64ef31e..6fb1c1f 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 _0x05bc=['client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','login','local-login','json','forgot','body','toLowerCase','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','status','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordToken','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x1415fd,_0x598f8f){var _0x363d59=function(_0x5ab12d){while(--_0x5ab12d){_0x1415fd['push'](_0x1415fd['shift']());}};_0x363d59(++_0x598f8f);}(_0x05bc,0x172));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc05b('0x0'));var passport=require(_0xc05b('0x1'));var LocalStrategy=require(_0xc05b('0x2'))[_0xc05b('0x3')];var jayson=require(_0xc05b('0x4'));var _=require(_0xc05b('0x5'));var rs=require(_0xc05b('0x6'));var moment=require('moment');var db=require(_0xc05b('0x7'))['db'];var authService=require(_0xc05b('0x8'));var utils=require(_0xc05b('0x9'));var client=jayson[_0xc05b('0xa')][_0xc05b('0xb')]({'port':0x232b});function localAuthenticate(_0xa28153,_0x343802,_0x22f891,_0x6d40fe){var _0x56a17b,_0x4ddd61;return db[_0xc05b('0xc')][_0xc05b('0xd')]({'where':{'id':0x1},'attributes':[_0xc05b('0xe'),_0xc05b('0xf')],'raw':!![]})[_0xc05b('0x10')](function(_0x15b7ae){_0x56a17b=_0x15b7ae;return _0xa28153['findOne']({'attributes':['id',_0xc05b('0x11'),_0xc05b('0x12'),_0xc05b('0x13'),_0xc05b('0x14'),_0xc05b('0x15'),_0xc05b('0x16'),_0xc05b('0x17'),'loginAttempts'],'where':{'name':_0x343802,'role':{'$or':[_0xc05b('0x18'),_0xc05b('0x19'),_0xc05b('0x1a')]}}});})[_0xc05b('0x10')](function(_0x43b656){if(!_0x43b656||_0x43b656&&_0x43b656[_0xc05b('0x11')]!==_0x343802){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4ddd61=_0x43b656;return _0x4ddd61;}})[_0xc05b('0x10')](function(){_0x4ddd61[_0xc05b('0x1b')](_0x22f891,function(_0x2d6475,_0x5b3aab){var _0x173822=_0x4ddd61['loginAttempts']+0x1;if(_0x2d6475){return _0x6d40fe(_0x2d6475);}else if(!_0x5b3aab){if(_0x4ddd61[_0xc05b('0x15')]){return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}else if(_0x56a17b[_0xc05b('0xe')]>0x0){if(_0x4ddd61[_0xc05b('0x16')]){if(_0x56a17b[_0xc05b('0xf')]>0x0){if(moment(_0x4ddd61['blockedAt'])[_0xc05b('0x1d')](_0x56a17b[_0xc05b('0xf')],_0xc05b('0x1e'))>moment()){return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}else{return utils['clearBlockUser'](_0x4ddd61,_0x173822,![],null)[_0xc05b('0x10')](function(){return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});});}}else{return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}}else{if(_0x173822>=_0x56a17b[_0xc05b('0xe')]){return utils[_0xc05b('0x1f')](_0x4ddd61,0x0,!![],moment())[_0xc05b('0x10')](function(){return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});});}else{return utils[_0xc05b('0x1f')](_0x4ddd61,_0x173822,![],null)[_0xc05b('0x10')](function(){return _0x6d40fe(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}}else{if(_0x4ddd61[_0xc05b('0x15')]){return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}else if(_0x56a17b['allowedLoginAttempts']>0x0){if(_0x4ddd61[_0xc05b('0x16')]){if(_0x56a17b['blockDuration']>0x0){if(moment(_0x4ddd61[_0xc05b('0x17')])[_0xc05b('0x1d')](_0x56a17b[_0xc05b('0xf')],_0xc05b('0x1e'))>moment()){return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}else{return utils[_0xc05b('0x1f')](_0x4ddd61,0x0,![],null)[_0xc05b('0x10')](function(){return utils[_0xc05b('0x20')](_0x4ddd61);})[_0xc05b('0x10')](function(){return _0x6d40fe(null,_0x4ddd61);});}}else{return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}}else{return utils['clearBlockUser'](_0x4ddd61,0x0,![],null)[_0xc05b('0x10')](function(){return utils[_0xc05b('0x20')](_0x4ddd61);})[_0xc05b('0x10')](function(){return _0x6d40fe(null,_0x4ddd61);})[_0xc05b('0x21')](function(_0x4d3577){return _0x6d40fe(null,![],_0x4d3577);});}}else{if(_0x4ddd61[_0xc05b('0x16')]){return _0x6d40fe(null,![],{'message':_0xc05b('0x1c')});}else{return utils[_0xc05b('0x20')](_0x4ddd61)[_0xc05b('0x10')](function(){return _0x6d40fe(null,_0x4ddd61);});}}}});})['catch'](function(_0x4d1823){return _0x6d40fe(null,![],_0x4d1823);});}function sendServiceMail(_0x1d7753){return db['MailAccount'][_0xc05b('0x22')]({'where':{'service':!![]},'attributes':['id',_0xc05b('0x11'),_0xc05b('0x23')],'include':[{'model':db[_0xc05b('0x24')],'as':_0xc05b('0x25'),'include':[{'model':db[_0xc05b('0x26')],'as':_0xc05b('0x26')}]}]})['then'](function(_0x1c0cb5){if(!_0x1c0cb5){throw new Error(_0xc05b('0x27'));}var _0x1e81bc=_0x1c0cb5[_0xc05b('0x28')]();var _0x3c4420={'account':_0x1e81bc,'message':_[_0xc05b('0x29')]({'from':util[_0xc05b('0x2a')](_0xc05b('0x2b'),_0x1c0cb5['name'],_0x1c0cb5['email']||_0x1c0cb5[_0xc05b('0x25')][_0xc05b('0x19')])},_0x1d7753)};return client[_0xc05b('0x2c')](_0xc05b('0x2d'),_0x3c4420);})[_0xc05b('0x10')](function(_0xd23734){if(_0xd23734['error']){throw new Error(util[_0xc05b('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0xd23734[_0xc05b('0x2e')][_0xc05b('0x2f')]||JSON[_0xc05b('0x30')](_0xd23734[_0xc05b('0x2e')])));}return!![];});}function handleError(_0x4bf1ee,_0x1b9d97,_0x253d3a){return _0x4bf1ee['status'](_0x1b9d97||0x1f4)[_0xc05b('0x31')]({'message':_0x253d3a?_0x253d3a[_0xc05b('0x2f')]||_0x253d3a:''});}exports[_0xc05b('0x32')]=function(_0x1f7246,_0x45af46,_0x2d7ccb){passport[_0xc05b('0x1b')](_0xc05b('0x33'),function(_0x2a9268,_0x24691a,_0x2bd800){var _0x88d35c=_0x2a9268||_0x2bd800;if(_0x88d35c){return handleError(_0x45af46,0x191,_0x88d35c);}if(!_0x24691a){return handleError(_0x45af46,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xca30e5={'payload':{'id':_0x24691a['id'],'role':_0x24691a[_0xc05b('0x14')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xca30e5)[_0xc05b('0x10')](function(_0x30a81c){_0x45af46[_0xc05b('0x34')]({'id':_0x24691a['id'],'token':_0x30a81c,'statusCall':'','isAlreadyLogged':_0x24691a['online']});});}})(_0x1f7246,_0x45af46,_0x2d7ccb);};exports[_0xc05b('0x35')]=function(_0x4885b5,_0x41c54e){if(!_0x4885b5['body'][_0xc05b('0x23')]){return handleError(_0x41c54e,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x21f562=rs['generate']();_0x4885b5[_0xc05b('0x36')][_0xc05b('0x23')]=_0x4885b5[_0xc05b('0x36')][_0xc05b('0x23')]['trim']()[_0xc05b('0x37')]();var _0x49b681;return db[_0xc05b('0xc')][_0xc05b('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc05b('0xf')],'raw':!![]})[_0xc05b('0x10')](function(_0x4dc554){_0x49b681=_0x4dc554;return db['User'][_0xc05b('0x22')]({'where':{'email':_0x4885b5[_0xc05b('0x36')][_0xc05b('0x23')]}});})['then'](function(_0x304013){if(!_0x304013){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x304013[_0xc05b('0x15')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x304013[_0xc05b('0x16')]){if(moment(_0x304013[_0xc05b('0x17')])['add'](_0x49b681['blockDuration'],_0xc05b('0x1e'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x304013[_0xc05b('0x16')]=![];_0x304013[_0xc05b('0x17')]=null;}}_0x304013['resetPasswordToken']=_0x21f562;_0x304013[_0xc05b('0x38')]=Date[_0xc05b('0x39')]()+0x36ee80;return _0x304013[_0xc05b('0x3a')]();})[_0xc05b('0x10')](function(){return sendServiceMail({'to':_0x4885b5['body']['email'],'subject':_0xc05b('0x3b'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc05b('0x3c')+_0xc05b('0x3d')+_0x4885b5['headers'][_0xc05b('0x3e')]+_0xc05b('0x3f')+_0x21f562+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc05b('0x10')](function(){_0x41c54e[_0xc05b('0x40')](0xc8)[_0xc05b('0x31')]({'message':_0xc05b('0x41')});})[_0xc05b('0x21')](function(_0x512370){return handleError(_0x41c54e,0x1f4,_0x512370);});};exports[_0xc05b('0x42')]=function(_0x5043b3,_0x1d1f95){return db[_0xc05b('0x43')]['find']({'where':{'resetPasswordToken':_0x5043b3['params'][_0xc05b('0x44')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x31d59c){if(!_0x31d59c){throw new Error(_0xc05b('0x45'));}return db[_0xc05b('0xc')]['findOne']({'attributes':['id',_0xc05b('0x46'),_0xc05b('0x47'),_0xc05b('0x48')]})[_0xc05b('0x10')](function(_0x1ebbbf){if(_0x1ebbbf[_0xc05b('0x46')])authService['validatePasswordPattern'](_0x5043b3['body'][_0xc05b('0x12')]);if(!_0x1ebbbf[_0xc05b('0x47')]||!_0x31d59c[_0xc05b('0x49')])return _0x31d59c;authService['validatePasswordHistory'](_0x5043b3['body'][_0xc05b('0x12')],_0x31d59c[_0xc05b('0x49')],_0x1ebbbf[_0xc05b('0x48')]);return _0x31d59c;})['then'](function(){_0x31d59c[_0xc05b('0x12')]=_0x5043b3['body'][_0xc05b('0x12')];_0x31d59c[_0xc05b('0x4a')]=null;_0x31d59c['resetPasswordExpires']=null;return _0x31d59c[_0xc05b('0x3a')]();});})[_0xc05b('0x10')](function(){_0x1d1f95['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0xc05b('0x21')](function(_0x6f9332){return handleError(_0x1d1f95,0x1f4,_0x6f9332);});};passport[_0xc05b('0x4b')](_0xc05b('0x33'),new LocalStrategy({'usernameField':_0xc05b('0x11'),'passwordField':_0xc05b('0x12')},function(_0x59e033,_0x3cab46,_0x7becaf){return localAuthenticate(db[_0xc05b('0x43')],_0x59e033,_0x3cab46,_0x7becaf);}));
\ No newline at end of file
+var _0x6ebc=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','authenticate','local-login','signToken','json','online','forgot','body','trim','toLowerCase','Setting','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','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','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','findOne','blockDuration','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','Smtp','request','SendMail','error'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6ebc,0x78));var _0xc6eb=function(_0x588901,_0x17249f){_0x588901=_0x588901-0x0;var _0x39c89c=_0x6ebc[_0x588901];return _0x39c89c;};'use strict';var util=require(_0xc6eb('0x0'));var passport=require(_0xc6eb('0x1'));var LocalStrategy=require(_0xc6eb('0x2'))[_0xc6eb('0x3')];var jayson=require('jayson/promise');var _=require(_0xc6eb('0x4'));var rs=require(_0xc6eb('0x5'));var moment=require(_0xc6eb('0x6'));var db=require(_0xc6eb('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc6eb('0x8'));var client=jayson[_0xc6eb('0x9')][_0xc6eb('0xa')]({'port':0x232b});function localAuthenticate(_0x4452b6,_0xe56db1,_0x99e6f3,_0x2c9025){var _0x3de069,_0x18eb36;return db['Setting'][_0xc6eb('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc6eb('0xc')],'raw':!![]})['then'](function(_0x56b9d6){_0x3de069=_0x56b9d6;return _0x4452b6[_0xc6eb('0xb')]({'attributes':['id','name','password','salt','role',_0xc6eb('0xd'),_0xc6eb('0xe'),_0xc6eb('0xf'),_0xc6eb('0x10')],'where':{'name':_0xe56db1,'role':{'$or':[_0xc6eb('0x11'),_0xc6eb('0x12'),_0xc6eb('0x13')]}}});})[_0xc6eb('0x14')](function(_0x4a546a){if(!_0x4a546a||_0x4a546a&&_0x4a546a[_0xc6eb('0x15')]!==_0xe56db1){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x18eb36=_0x4a546a;return _0x18eb36;}})[_0xc6eb('0x14')](function(){_0x18eb36['authenticate'](_0x99e6f3,function(_0x2e13e9,_0x451648){var _0x409824=_0x18eb36[_0xc6eb('0x10')]+0x1;if(_0x2e13e9){return _0x2c9025(_0x2e13e9);}else if(!_0x451648){if(_0x18eb36['disabled']){return _0x2c9025(null,![],{'message':_0xc6eb('0x16')});}else if(_0x3de069[_0xc6eb('0x17')]>0x0){if(_0x18eb36[_0xc6eb('0xe')]){if(_0x3de069[_0xc6eb('0xc')]>0x0){if(moment(_0x18eb36[_0xc6eb('0xf')])[_0xc6eb('0x18')](_0x3de069[_0xc6eb('0xc')],_0xc6eb('0x19'))>moment()){return _0x2c9025(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc6eb('0x1a')](_0x18eb36,_0x409824,![],null)[_0xc6eb('0x14')](function(){return _0x2c9025(null,![],{'message':_0xc6eb('0x16')});});}}else{return _0x2c9025(null,![],{'message':_0xc6eb('0x16')});}}else{if(_0x409824>=_0x3de069[_0xc6eb('0x17')]){return utils['clearBlockUser'](_0x18eb36,0x0,!![],moment())[_0xc6eb('0x14')](function(){return _0x2c9025(null,![],{'message':_0xc6eb('0x16')});});}else{return utils[_0xc6eb('0x1a')](_0x18eb36,_0x409824,![],null)['then'](function(){return _0x2c9025(null,![],{'message':_0xc6eb('0x16')});});}}}else{return _0x2c9025(null,![],{'message':_0xc6eb('0x16')});}}else{if(_0x18eb36['disabled']){return _0x2c9025(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3de069['allowedLoginAttempts']>0x0){if(_0x18eb36[_0xc6eb('0xe')]){if(_0x3de069['blockDuration']>0x0){if(moment(_0x18eb36[_0xc6eb('0xf')])['add'](_0x3de069[_0xc6eb('0xc')],_0xc6eb('0x19'))>moment()){return _0x2c9025(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc6eb('0x1a')](_0x18eb36,0x0,![],null)['then'](function(){return utils['getLicense'](_0x18eb36);})[_0xc6eb('0x14')](function(){return _0x2c9025(null,_0x18eb36);});}}else{return _0x2c9025(null,![],{'message':_0xc6eb('0x16')});}}else{return utils[_0xc6eb('0x1a')](_0x18eb36,0x0,![],null)[_0xc6eb('0x14')](function(){return utils[_0xc6eb('0x1b')](_0x18eb36);})['then'](function(){return _0x2c9025(null,_0x18eb36);})[_0xc6eb('0x1c')](function(_0x4d1709){return _0x2c9025(null,![],_0x4d1709);});}}else{if(_0x18eb36[_0xc6eb('0xe')]){return _0x2c9025(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc6eb('0x1b')](_0x18eb36)[_0xc6eb('0x14')](function(){return _0x2c9025(null,_0x18eb36);});}}}});})[_0xc6eb('0x1c')](function(_0x3f0eee){return _0x2c9025(null,![],_0x3f0eee);});}function sendServiceMail(_0x47376d){return db[_0xc6eb('0x1d')][_0xc6eb('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xc6eb('0x15'),_0xc6eb('0x1f')],'include':[{'model':db[_0xc6eb('0x20')],'as':'Smtp','include':[{'model':db[_0xc6eb('0x21')],'as':_0xc6eb('0x21')}]}]})[_0xc6eb('0x14')](function(_0x48fbd2){if(!_0x48fbd2){throw new Error(_0xc6eb('0x22'));}var _0x299146=_0x48fbd2[_0xc6eb('0x23')]();var _0x38f74c={'account':_0x299146,'message':_[_0xc6eb('0x24')]({'from':util[_0xc6eb('0x25')]('\x22%s\x22\x20<%s>',_0x48fbd2[_0xc6eb('0x15')],_0x48fbd2['email']||_0x48fbd2[_0xc6eb('0x26')][_0xc6eb('0x12')])},_0x47376d)};return client[_0xc6eb('0x27')](_0xc6eb('0x28'),_0x38f74c);})[_0xc6eb('0x14')](function(_0x50730){if(_0x50730[_0xc6eb('0x29')]){throw new Error(util[_0xc6eb('0x25')](_0xc6eb('0x2a'),_0x50730['error'][_0xc6eb('0x2b')]||JSON[_0xc6eb('0x2c')](_0x50730[_0xc6eb('0x29')])));}return!![];});}function handleError(_0x44878f,_0x1662c1,_0x3c64e2){return _0x44878f[_0xc6eb('0x2d')](_0x1662c1||0x1f4)[_0xc6eb('0x2e')]({'message':_0x3c64e2?_0x3c64e2[_0xc6eb('0x2b')]||_0x3c64e2:''});}exports['login']=function(_0x5e14f1,_0x593806,_0x439c43){passport[_0xc6eb('0x2f')](_0xc6eb('0x30'),function(_0x5ab4f7,_0xbf1112,_0x5e3361){var _0x3eb669=_0x5ab4f7||_0x5e3361;if(_0x3eb669){return handleError(_0x593806,0x191,_0x3eb669);}if(!_0xbf1112){return handleError(_0x593806,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x26e70e={'payload':{'id':_0xbf1112['id'],'role':_0xbf1112['role']},'options':{'expiresIn':0x15180}};return authService[_0xc6eb('0x31')](_0x26e70e)['then'](function(_0x34df7c){_0x593806[_0xc6eb('0x32')]({'id':_0xbf1112['id'],'token':_0x34df7c,'statusCall':'','isAlreadyLogged':_0xbf1112[_0xc6eb('0x33')]});});}})(_0x5e14f1,_0x593806,_0x439c43);};exports[_0xc6eb('0x34')]=function(_0x597783,_0x3fdc5f){if(!_0x597783[_0xc6eb('0x35')]['email']){return handleError(_0x3fdc5f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x46c618=rs['generate']();_0x597783[_0xc6eb('0x35')][_0xc6eb('0x1f')]=_0x597783[_0xc6eb('0x35')][_0xc6eb('0x1f')][_0xc6eb('0x36')]()[_0xc6eb('0x37')]();var _0x273c31;return db[_0xc6eb('0x38')][_0xc6eb('0xb')]({'where':{'id':0x1},'attributes':[_0xc6eb('0x17'),'blockDuration'],'raw':!![]})[_0xc6eb('0x14')](function(_0x40d5d9){_0x273c31=_0x40d5d9;return db['User'][_0xc6eb('0x1e')]({'where':{'email':_0x597783[_0xc6eb('0x35')]['email']}});})[_0xc6eb('0x14')](function(_0x2796cd){if(!_0x2796cd){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2796cd['disabled']){throw new Error(_0xc6eb('0x39'));}if(_0x2796cd[_0xc6eb('0xe')]){if(moment(_0x2796cd['blockedAt'])[_0xc6eb('0x18')](_0x273c31[_0xc6eb('0xc')],_0xc6eb('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2796cd['blocked']=![];_0x2796cd['blockedAt']=null;}}_0x2796cd[_0xc6eb('0x3a')]=_0x46c618;_0x2796cd[_0xc6eb('0x3b')]=Date[_0xc6eb('0x3c')]()+0x36ee80;return _0x2796cd[_0xc6eb('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x597783[_0xc6eb('0x35')][_0xc6eb('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xc6eb('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xc6eb('0x3f')+_0x597783[_0xc6eb('0x40')][_0xc6eb('0x41')]+_0xc6eb('0x42')+_0x46c618+'\x0a\x0a'+_0xc6eb('0x43')});})[_0xc6eb('0x14')](function(){_0x3fdc5f[_0xc6eb('0x2d')](0xc8)[_0xc6eb('0x2e')]({'message':_0xc6eb('0x44')});})[_0xc6eb('0x1c')](function(_0x30507b){return handleError(_0x3fdc5f,0x1f4,_0x30507b);});};exports[_0xc6eb('0x45')]=function(_0x100e09,_0x462c6c){return db[_0xc6eb('0x46')][_0xc6eb('0x1e')]({'where':{'resetPasswordToken':_0x100e09[_0xc6eb('0x47')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc6eb('0x3c')]()}}})['then'](function(_0x54a8aa){if(!_0x54a8aa){throw new Error(_0xc6eb('0x48'));}return db['Setting'][_0xc6eb('0xb')]({'attributes':['id',_0xc6eb('0x49'),'enforcePasswordHistory',_0xc6eb('0x4a')]})['then'](function(_0x37abd6){if(_0x37abd6[_0xc6eb('0x49')])authService['validatePasswordPattern'](_0x100e09[_0xc6eb('0x35')][_0xc6eb('0x4b')]);if(!_0x37abd6[_0xc6eb('0x4c')]||!_0x54a8aa[_0xc6eb('0x4d')])return _0x54a8aa;authService[_0xc6eb('0x4e')](_0x100e09[_0xc6eb('0x35')][_0xc6eb('0x4b')],_0x54a8aa[_0xc6eb('0x4d')],_0x37abd6[_0xc6eb('0x4a')]);return _0x54a8aa;})[_0xc6eb('0x14')](function(){_0x54a8aa['password']=_0x100e09[_0xc6eb('0x35')][_0xc6eb('0x4b')];_0x54a8aa[_0xc6eb('0x3a')]=null;_0x54a8aa[_0xc6eb('0x3b')]=null;return _0x54a8aa[_0xc6eb('0x3d')]();});})['then'](function(){_0x462c6c['status'](0xc8)['send']({'message':_0xc6eb('0x4f')});})[_0xc6eb('0x1c')](function(_0x59a723){return handleError(_0x462c6c,0x1f4,_0x59a723);});};passport[_0xc6eb('0x50')](_0xc6eb('0x30'),new LocalStrategy({'usernameField':_0xc6eb('0x15'),'passwordField':'password'},function(_0x166990,_0x381af7,_0x513aad){return localAuthenticate(db[_0xc6eb('0x46')],_0x166990,_0x381af7,_0x513aad);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 1f0b77b..3718735 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 _0x84fc=['exports','express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token'];(function(_0x4a77b8,_0xdd710){var _0x509c8c=function(_0x2bf2a5){while(--_0x2bf2a5){_0x4a77b8['push'](_0x4a77b8['shift']());}};_0x509c8c(++_0xdd710);}(_0x84fc,0x171));var _0xc84f=function(_0x41f2f5,_0x14f33c){_0x41f2f5=_0x41f2f5-0x0;var _0x3d49f1=_0x84fc[_0x41f2f5];return _0x3d49f1;};'use strict';var express=require(_0xc84f('0x0'));var router=express[_0xc84f('0x1')]();var controller=require(_0xc84f('0x2'));router[_0xc84f('0x3')]('/',controller['login']);router['post'](_0xc84f('0x4'),controller[_0xc84f('0x5')]);router[_0xc84f('0x3')](_0xc84f('0x6'),controller['reset']);module[_0xc84f('0x7')]=router;
\ No newline at end of file
+var _0xbddd=['exports','express','Router','./authLocal.controller','post','login','/forgot','/reset/:token'];(function(_0x348310,_0x462221){var _0x5122b6=function(_0xd4b958){while(--_0xd4b958){_0x348310['push'](_0x348310['shift']());}};_0x5122b6(++_0x462221);}(_0xbddd,0x159));var _0xdbdd=function(_0x2f48a6,_0x4d6b5e){_0x2f48a6=_0x2f48a6-0x0;var _0x5788d3=_0xbddd[_0x2f48a6];return _0x5788d3;};'use strict';var express=require(_0xdbdd('0x0'));var router=express[_0xdbdd('0x1')]();var controller=require(_0xdbdd('0x2'));router[_0xdbdd('0x3')]('/',controller[_0xdbdd('0x4')]);router[_0xdbdd('0x3')](_0xdbdd('0x5'),controller['forgot']);router[_0xdbdd('0x3')](_0xdbdd('0x6'),controller['reset']);module[_0xdbdd('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 2cfc69d..4c3e1e2 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 _0xc48c=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x450382,_0x484de1){var _0x3f1f55=function(_0x1db8f6){while(--_0x1db8f6){_0x450382['push'](_0x450382['shift']());}};_0x3f1f55(++_0x484de1);}(_0xc48c,0xfd));var _0xcc48=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xc48c[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0xcc48('0x0'));module[_0xcc48('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xcc48('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xcc48('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcc48('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x517b=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0x565610,_0x1a4085){var _0x89951f=function(_0x4bdf54){while(--_0x4bdf54){_0x565610['push'](_0x565610['shift']());}};_0x89951f(++_0x1a4085);}(_0x517b,0x129));var _0xb517=function(_0xc0ffd5,_0x5d656a){_0xc0ffd5=_0xc0ffd5-0x0;var _0x46fe2c=_0x517b[_0xc0ffd5];return _0x46fe2c;};'use strict';var Sequelize=require(_0xb517('0x0'));module[_0xb517('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xb517('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb517('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index fced00a..f80a4de 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 _0x1b64=['intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','show','includeAll','find','create','body','catch','update','params','destroy','Condition','addConditions','omit','ids','getConditions','rawAttributes','Action','addActions','findOne','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','Automation','type','key','model','map','keys','query','filters'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x1b64,0x7b));var _0x41b6=function(_0x5960c5,_0x33109f){_0x5960c5=_0x5960c5-0x0;var _0x4d3c3b=_0x1b64[_0x5960c5];return _0x4d3c3b;};'use strict';var emlformat=require(_0x41b6('0x0'));var rimraf=require(_0x41b6('0x1'));var zipdir=require(_0x41b6('0x2'));var jsonpatch=require(_0x41b6('0x3'));var rp=require(_0x41b6('0x4'));var moment=require(_0x41b6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x41b6('0x6'));var path=require(_0x41b6('0x7'));var sox=require(_0x41b6('0x8'));var csv=require(_0x41b6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x41b6('0xa'));var _=require(_0x41b6('0xb'));var squel=require(_0x41b6('0xc'));var crypto=require(_0x41b6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x41b6('0x9'));var querystring=require(_0x41b6('0xe'));var Papa=require(_0x41b6('0xf'));var Redis=require('ioredis');var authService=require(_0x41b6('0x10'));var qs=require(_0x41b6('0x11'));var as=require(_0x41b6('0x12'));var hardwareService=require(_0x41b6('0x13'));var logger=require(_0x41b6('0x14'))(_0x41b6('0x15'));var utils=require(_0x41b6('0x16'));var config=require(_0x41b6('0x17'));var licenseUtil=require(_0x41b6('0x18'));var db=require(_0x41b6('0x19'))['db'];function respondWithStatusCode(_0x4acd07,_0x203b5e){_0x203b5e=_0x203b5e||0xcc;return function(_0x214953){if(_0x214953){return _0x4acd07[_0x41b6('0x1a')](_0x203b5e);}return _0x4acd07[_0x41b6('0x1b')](_0x203b5e)[_0x41b6('0x1c')]();};}function respondWithResult(_0x1f858b,_0x347ac8){_0x347ac8=_0x347ac8||0xc8;return function(_0x3ded48){if(_0x3ded48){return _0x1f858b[_0x41b6('0x1b')](_0x347ac8)[_0x41b6('0x1d')](_0x3ded48);}};}function respondWithFilteredResult(_0x4eb2e7,_0x5189ae){return function(_0x258300){if(_0x258300){var _0x48448c=typeof _0x5189ae['offset']===_0x41b6('0x1e')&&typeof _0x5189ae[_0x41b6('0x1f')]==='undefined';var _0x15a6ef=_0x258300[_0x41b6('0x20')];var _0x460e4f=_0x48448c?0x0:_0x5189ae[_0x41b6('0x21')];var _0x437187=_0x48448c?_0x258300['count']:_0x5189ae[_0x41b6('0x21')]+_0x5189ae[_0x41b6('0x1f')];var _0x53c98e;if(_0x437187>=_0x15a6ef){_0x437187=_0x15a6ef;_0x53c98e=0xc8;}else{_0x53c98e=0xce;}_0x4eb2e7[_0x41b6('0x1b')](_0x53c98e);return _0x4eb2e7[_0x41b6('0x22')](_0x41b6('0x23'),_0x460e4f+'-'+_0x437187+'/'+_0x15a6ef)[_0x41b6('0x1d')](_0x258300);}return null;};}function patchUpdates(_0x1aaf9b){return function(_0x4ec03a){try{jsonpatch[_0x41b6('0x24')](_0x4ec03a,_0x1aaf9b,!![]);}catch(_0x4264e9){return BPromise[_0x41b6('0x25')](_0x4264e9);}return _0x4ec03a[_0x41b6('0x26')]();};}function saveUpdates(_0x131cd5,_0x3be7f3){return function(_0x14f1d8){if(_0x14f1d8){return _0x14f1d8['update'](_0x131cd5)[_0x41b6('0x27')](function(_0x17ad1d){return _0x17ad1d;});}return null;};}function removeEntity(_0x22ea6e,_0x569d96){return function(_0x2a838b){if(_0x2a838b){return _0x2a838b['destroy']()[_0x41b6('0x27')](function(){_0x22ea6e[_0x41b6('0x1b')](0xcc)[_0x41b6('0x1c')]();});}};}function handleEntityNotFound(_0x4f7856,_0x132c9a){return function(_0x18e0a1){if(!_0x18e0a1){_0x4f7856[_0x41b6('0x1a')](0x194);}return _0x18e0a1;};}function handleError(_0x528c72,_0x4e3edf){_0x4e3edf=_0x4e3edf||0x1f4;return function(_0x489e2d){logger[_0x41b6('0x28')](_0x489e2d[_0x41b6('0x29')]);if(_0x489e2d[_0x41b6('0x2a')]){delete _0x489e2d[_0x41b6('0x2a')];}_0x528c72[_0x41b6('0x1b')](_0x4e3edf)[_0x41b6('0x2b')](_0x489e2d);};}exports[_0x41b6('0x2c')]=function(_0x1e0e62,_0x43b148){var _0xbb0f41={},_0x1097b3={},_0x42b13e={'count':0x0,'rows':[]};var _0x4be5a7=_['map'](db[_0x41b6('0x2d')]['rawAttributes'],function(_0x34e965){return{'name':_0x34e965['fieldName'],'type':_0x34e965[_0x41b6('0x2e')][_0x41b6('0x2f')]};});_0x1097b3[_0x41b6('0x30')]=_[_0x41b6('0x31')](_0x4be5a7,'name');_0x1097b3['query']=_[_0x41b6('0x32')](_0x1e0e62[_0x41b6('0x33')]);_0x1097b3[_0x41b6('0x34')]=_[_0x41b6('0x35')](_0x1097b3[_0x41b6('0x30')],_0x1097b3[_0x41b6('0x33')]);_0xbb0f41['attributes']=_[_0x41b6('0x35')](_0x1097b3[_0x41b6('0x30')],qs[_0x41b6('0x36')](_0x1e0e62[_0x41b6('0x33')][_0x41b6('0x36')]));_0xbb0f41[_0x41b6('0x37')]=_0xbb0f41[_0x41b6('0x37')][_0x41b6('0x38')]?_0xbb0f41[_0x41b6('0x37')]:_0x1097b3[_0x41b6('0x30')];if(!_0x1e0e62[_0x41b6('0x33')]['hasOwnProperty'](_0x41b6('0x39'))){_0xbb0f41[_0x41b6('0x1f')]=qs['limit'](_0x1e0e62[_0x41b6('0x33')][_0x41b6('0x1f')]);_0xbb0f41[_0x41b6('0x21')]=qs[_0x41b6('0x21')](_0x1e0e62[_0x41b6('0x33')][_0x41b6('0x21')]);}_0xbb0f41[_0x41b6('0x3a')]=qs[_0x41b6('0x3b')](_0x1e0e62['query'][_0x41b6('0x3b')]);_0xbb0f41['where']=qs[_0x41b6('0x34')](_[_0x41b6('0x3c')](_0x1e0e62['query'],_0x1097b3[_0x41b6('0x34')]),_0x4be5a7);if(_0x1e0e62[_0x41b6('0x33')][_0x41b6('0x3d')]){_0xbb0f41[_0x41b6('0x3e')]=_[_0x41b6('0x3f')](_0xbb0f41[_0x41b6('0x3e')],{'$or':_[_0x41b6('0x31')](_0x4be5a7,function(_0x3c50ed){if(_0x3c50ed['type']!=='VIRTUAL'){var _0x238c88={};_0x238c88[_0x3c50ed[_0x41b6('0x2a')]]={'$like':'%'+_0x1e0e62[_0x41b6('0x33')]['filter']+'%'};return _0x238c88;}})});}_0xbb0f41=_['merge']({},_0xbb0f41,_0x1e0e62[_0x41b6('0x40')]);var _0x323638={'where':_0xbb0f41[_0x41b6('0x3e')]};return db[_0x41b6('0x2d')][_0x41b6('0x20')](_0x323638)[_0x41b6('0x27')](function(_0x2b92c6){_0x42b13e[_0x41b6('0x20')]=_0x2b92c6;if(_0x1e0e62[_0x41b6('0x33')]['includeAll']){_0xbb0f41[_0x41b6('0x41')]=[{'all':!![]}];}return db[_0x41b6('0x2d')][_0x41b6('0x42')](_0xbb0f41);})[_0x41b6('0x27')](function(_0x57cd47){_0x42b13e[_0x41b6('0x43')]=_0x57cd47;return _0x42b13e;})[_0x41b6('0x27')](respondWithFilteredResult(_0x43b148,_0xbb0f41))['catch'](handleError(_0x43b148,null));};exports[_0x41b6('0x44')]=function(_0x4abbca,_0x584d61){var _0x3c549d={'raw':![],'where':{'id':_0x4abbca['params']['id']}},_0x3db6d2={};_0x3db6d2[_0x41b6('0x30')]=_[_0x41b6('0x32')](db['Automation']['rawAttributes']);_0x3db6d2[_0x41b6('0x33')]=_[_0x41b6('0x32')](_0x4abbca[_0x41b6('0x33')]);_0x3db6d2[_0x41b6('0x34')]=_[_0x41b6('0x35')](_0x3db6d2[_0x41b6('0x30')],_0x3db6d2[_0x41b6('0x33')]);_0x3c549d['attributes']=_[_0x41b6('0x35')](_0x3db6d2[_0x41b6('0x30')],qs[_0x41b6('0x36')](_0x4abbca[_0x41b6('0x33')][_0x41b6('0x36')]));_0x3c549d[_0x41b6('0x37')]=_0x3c549d[_0x41b6('0x37')]['length']?_0x3c549d[_0x41b6('0x37')]:_0x3db6d2[_0x41b6('0x30')];if(_0x4abbca['query'][_0x41b6('0x45')]){_0x3c549d[_0x41b6('0x41')]=[{'all':!![]}];}_0x3c549d=_[_0x41b6('0x3f')]({},_0x3c549d,_0x4abbca['options']);return db[_0x41b6('0x2d')][_0x41b6('0x46')](_0x3c549d)[_0x41b6('0x27')](handleEntityNotFound(_0x584d61,null))[_0x41b6('0x27')](respondWithResult(_0x584d61,null))['catch'](handleError(_0x584d61,null));};exports[_0x41b6('0x47')]=function(_0x31dfe1,_0x202b40){return db[_0x41b6('0x2d')][_0x41b6('0x47')](_0x31dfe1[_0x41b6('0x48')],{})[_0x41b6('0x27')](respondWithResult(_0x202b40,0xc9))[_0x41b6('0x49')](handleError(_0x202b40,null));};exports[_0x41b6('0x4a')]=function(_0x3047f3,_0x1ec2b7){if(_0x3047f3[_0x41b6('0x48')]['id']){delete _0x3047f3['body']['id'];}return db[_0x41b6('0x2d')]['find']({'where':{'id':_0x3047f3[_0x41b6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ec2b7,null))['then'](saveUpdates(_0x3047f3[_0x41b6('0x48')],null))[_0x41b6('0x27')](respondWithResult(_0x1ec2b7,null))[_0x41b6('0x49')](handleError(_0x1ec2b7,null));};exports[_0x41b6('0x4c')]=function(_0x2c6446,_0x1824d1){return db[_0x41b6('0x2d')][_0x41b6('0x46')]({'where':{'id':_0x2c6446[_0x41b6('0x4b')]['id']}})[_0x41b6('0x27')](handleEntityNotFound(_0x1824d1,null))[_0x41b6('0x27')](removeEntity(_0x1824d1,null))['catch'](handleError(_0x1824d1,null));};exports['addConditions']=function(_0x36f9e5,_0x5cf46a,_0x1abcdc){return db[_0x41b6('0x4d')][_0x41b6('0x46')]({'where':{'id':_0x36f9e5[_0x41b6('0x4b')]['id']}})[_0x41b6('0x27')](handleEntityNotFound(_0x5cf46a,null))[_0x41b6('0x27')](function(_0x4b21ac){if(_0x4b21ac){return _0x4b21ac[_0x41b6('0x4e')](_0x36f9e5[_0x41b6('0x48')]['ids'],_[_0x41b6('0x4f')](_0x36f9e5[_0x41b6('0x48')],[_0x41b6('0x50'),'id'])||{});}})[_0x41b6('0x27')](respondWithResult(_0x5cf46a,null))[_0x41b6('0x49')](handleError(_0x5cf46a,null));};exports[_0x41b6('0x51')]=function(_0x1f4a2c,_0x10a602,_0x5722c0){var _0x4a90a6={};var _0x16670a={};var _0x543305;var _0x41af87;return db[_0x41b6('0x2d')]['findOne']({'where':{'id':_0x1f4a2c['params']['id']}})[_0x41b6('0x27')](handleEntityNotFound(_0x10a602,null))['then'](function(_0x217754){if(_0x217754){_0x543305=_0x217754;_0x16670a[_0x41b6('0x30')]=_['keys'](db[_0x41b6('0x4d')][_0x41b6('0x52')]);_0x16670a[_0x41b6('0x33')]=_[_0x41b6('0x32')](_0x1f4a2c[_0x41b6('0x33')]);_0x16670a['filters']=_['intersection'](_0x16670a['model'],_0x16670a['query']);_0x4a90a6[_0x41b6('0x37')]=_[_0x41b6('0x35')](_0x16670a[_0x41b6('0x30')],qs[_0x41b6('0x36')](_0x1f4a2c['query'][_0x41b6('0x36')]));_0x4a90a6[_0x41b6('0x37')]=_0x4a90a6[_0x41b6('0x37')][_0x41b6('0x38')]?_0x4a90a6[_0x41b6('0x37')]:_0x16670a[_0x41b6('0x30')];_0x4a90a6[_0x41b6('0x3a')]=qs['sort'](_0x1f4a2c['query'][_0x41b6('0x3b')]);_0x4a90a6[_0x41b6('0x3e')]=qs[_0x41b6('0x34')](_['pick'](_0x1f4a2c[_0x41b6('0x33')],_0x16670a[_0x41b6('0x34')]));if(_0x1f4a2c[_0x41b6('0x33')][_0x41b6('0x3d')]){_0x4a90a6[_0x41b6('0x3e')]=_[_0x41b6('0x3f')](_0x4a90a6[_0x41b6('0x3e')],{'$or':_[_0x41b6('0x31')](_0x4a90a6[_0x41b6('0x37')],function(_0x56648f){var _0x3e0675={};_0x3e0675[_0x56648f]={'$like':'%'+_0x1f4a2c[_0x41b6('0x33')][_0x41b6('0x3d')]+'%'};return _0x3e0675;})});}_0x4a90a6=_[_0x41b6('0x3f')]({},_0x4a90a6,_0x1f4a2c['options']);return _0x543305[_0x41b6('0x51')](_0x4a90a6);}})[_0x41b6('0x27')](function(_0x3c0938){if(_0x3c0938){_0x41af87=_0x3c0938[_0x41b6('0x38')];if(!_0x1f4a2c[_0x41b6('0x33')]['hasOwnProperty'](_0x41b6('0x39'))){_0x4a90a6[_0x41b6('0x1f')]=qs[_0x41b6('0x1f')](_0x1f4a2c[_0x41b6('0x33')][_0x41b6('0x1f')]);_0x4a90a6[_0x41b6('0x21')]=qs['offset'](_0x1f4a2c[_0x41b6('0x33')][_0x41b6('0x21')]);}return _0x543305[_0x41b6('0x51')](_0x4a90a6);}})[_0x41b6('0x27')](function(_0x3a4ff1){if(_0x3a4ff1){return _0x3a4ff1?{'count':_0x41af87,'rows':_0x3a4ff1}:null;}})[_0x41b6('0x27')](respondWithResult(_0x10a602,null))['catch'](handleError(_0x10a602,null));};exports['addActions']=function(_0x45f1cc,_0x564216,_0x775678){return db[_0x41b6('0x53')][_0x41b6('0x46')]({'where':{'id':_0x45f1cc[_0x41b6('0x4b')]['id']}})[_0x41b6('0x27')](handleEntityNotFound(_0x564216,null))[_0x41b6('0x27')](function(_0x42bc93){if(_0x42bc93){return _0x42bc93[_0x41b6('0x54')](_0x45f1cc['body']['ids'],_[_0x41b6('0x4f')](_0x45f1cc[_0x41b6('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x564216,null))[_0x41b6('0x49')](handleError(_0x564216,null));};exports['getActions']=function(_0x1d52be,_0x5112c9,_0x17ea13){var _0x3cbb54={};var _0x152e5c={};var _0x4bc1c9;var _0x198952;return db[_0x41b6('0x2d')][_0x41b6('0x55')]({'where':{'id':_0x1d52be['params']['id']}})['then'](handleEntityNotFound(_0x5112c9,null))['then'](function(_0x2a59db){if(_0x2a59db){_0x4bc1c9=_0x2a59db;_0x152e5c[_0x41b6('0x30')]=_[_0x41b6('0x32')](db['Action'][_0x41b6('0x52')]);_0x152e5c['query']=_[_0x41b6('0x32')](_0x1d52be[_0x41b6('0x33')]);_0x152e5c[_0x41b6('0x34')]=_['intersection'](_0x152e5c[_0x41b6('0x30')],_0x152e5c[_0x41b6('0x33')]);_0x3cbb54[_0x41b6('0x37')]=_[_0x41b6('0x35')](_0x152e5c[_0x41b6('0x30')],qs[_0x41b6('0x36')](_0x1d52be['query'][_0x41b6('0x36')]));_0x3cbb54[_0x41b6('0x37')]=_0x3cbb54[_0x41b6('0x37')][_0x41b6('0x38')]?_0x3cbb54[_0x41b6('0x37')]:_0x152e5c[_0x41b6('0x30')];_0x3cbb54['order']=qs[_0x41b6('0x3b')](_0x1d52be[_0x41b6('0x33')]['sort']);_0x3cbb54[_0x41b6('0x3e')]=qs[_0x41b6('0x34')](_['pick'](_0x1d52be[_0x41b6('0x33')],_0x152e5c[_0x41b6('0x34')]));if(_0x1d52be[_0x41b6('0x33')][_0x41b6('0x3d')]){_0x3cbb54[_0x41b6('0x3e')]=_[_0x41b6('0x3f')](_0x3cbb54['where'],{'$or':_[_0x41b6('0x31')](_0x3cbb54['attributes'],function(_0x35eac){var _0x131899={};_0x131899[_0x35eac]={'$like':'%'+_0x1d52be[_0x41b6('0x33')][_0x41b6('0x3d')]+'%'};return _0x131899;})});}_0x3cbb54=_[_0x41b6('0x3f')]({},_0x3cbb54,_0x1d52be[_0x41b6('0x40')]);return _0x4bc1c9[_0x41b6('0x56')](_0x3cbb54);}})['then'](function(_0x8ce15d){if(_0x8ce15d){_0x198952=_0x8ce15d[_0x41b6('0x38')];if(!_0x1d52be[_0x41b6('0x33')][_0x41b6('0x57')](_0x41b6('0x39'))){_0x3cbb54[_0x41b6('0x1f')]=qs[_0x41b6('0x1f')](_0x1d52be[_0x41b6('0x33')][_0x41b6('0x1f')]);_0x3cbb54[_0x41b6('0x21')]=qs[_0x41b6('0x21')](_0x1d52be[_0x41b6('0x33')][_0x41b6('0x21')]);}return _0x4bc1c9[_0x41b6('0x56')](_0x3cbb54);}})[_0x41b6('0x27')](function(_0x152e9c){if(_0x152e9c){return _0x152e9c?{'count':_0x198952,'rows':_0x152e9c}:null;}})[_0x41b6('0x27')](respondWithResult(_0x5112c9,null))[_0x41b6('0x49')](handleError(_0x5112c9,null));};
\ No newline at end of file
+var _0x79fb=['count','set','Content-Range','save','update','destroy','then','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','length','includeAll','find','create','body','params','addConditions','ids','getConditions','findOne','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3be931,_0x3afd25){var _0x3b8a91=function(_0x163c3f){while(--_0x163c3f){_0x3be931['push'](_0x3be931['shift']());}};_0x3b8a91(++_0x3afd25);}(_0x79fb,0xd9));var _0xb79f=function(_0x308056,_0x8d9c69){_0x308056=_0x308056-0x0;var _0xbe9fc6=_0x79fb[_0x308056];return _0xbe9fc6;};'use strict';var emlformat=require(_0xb79f('0x0'));var rimraf=require(_0xb79f('0x1'));var zipdir=require(_0xb79f('0x2'));var jsonpatch=require(_0xb79f('0x3'));var rp=require(_0xb79f('0x4'));var moment=require('moment');var BPromise=require(_0xb79f('0x5'));var Mustache=require(_0xb79f('0x6'));var util=require(_0xb79f('0x7'));var path=require(_0xb79f('0x8'));var sox=require(_0xb79f('0x9'));var csv=require(_0xb79f('0xa'));var ejs=require(_0xb79f('0xb'));var fs=require('fs');var fs_extra=require(_0xb79f('0xc'));var _=require('lodash');var squel=require(_0xb79f('0xd'));var crypto=require(_0xb79f('0xe'));var jsforce=require(_0xb79f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb79f('0xa'));var querystring=require(_0xb79f('0x10'));var Papa=require(_0xb79f('0x11'));var Redis=require('ioredis');var authService=require(_0xb79f('0x12'));var qs=require(_0xb79f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb79f('0x14'));var logger=require(_0xb79f('0x15'))(_0xb79f('0x16'));var utils=require(_0xb79f('0x17'));var config=require(_0xb79f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb79f('0x19'))['db'];function respondWithStatusCode(_0x219a31,_0xdb4ab3){_0xdb4ab3=_0xdb4ab3||0xcc;return function(_0x323787){if(_0x323787){return _0x219a31[_0xb79f('0x1a')](_0xdb4ab3);}return _0x219a31[_0xb79f('0x1b')](_0xdb4ab3)[_0xb79f('0x1c')]();};}function respondWithResult(_0x47d6a4,_0x197d87){_0x197d87=_0x197d87||0xc8;return function(_0x2ac5c8){if(_0x2ac5c8){return _0x47d6a4[_0xb79f('0x1b')](_0x197d87)[_0xb79f('0x1d')](_0x2ac5c8);}};}function respondWithFilteredResult(_0xb53fdd,_0xab22f9){return function(_0xe3bfb3){if(_0xe3bfb3){var _0x495dae=typeof _0xab22f9[_0xb79f('0x1e')]===_0xb79f('0x1f')&&typeof _0xab22f9['limit']===_0xb79f('0x1f');var _0xa52411=_0xe3bfb3['count'];var _0x26cdf8=_0x495dae?0x0:_0xab22f9[_0xb79f('0x1e')];var _0x59226c=_0x495dae?_0xe3bfb3[_0xb79f('0x20')]:_0xab22f9[_0xb79f('0x1e')]+_0xab22f9['limit'];var _0x49374b;if(_0x59226c>=_0xa52411){_0x59226c=_0xa52411;_0x49374b=0xc8;}else{_0x49374b=0xce;}_0xb53fdd['status'](_0x49374b);return _0xb53fdd[_0xb79f('0x21')](_0xb79f('0x22'),_0x26cdf8+'-'+_0x59226c+'/'+_0xa52411)['json'](_0xe3bfb3);}return null;};}function patchUpdates(_0x8621d3){return function(_0x3da063){try{jsonpatch['apply'](_0x3da063,_0x8621d3,!![]);}catch(_0x106bae){return BPromise['reject'](_0x106bae);}return _0x3da063[_0xb79f('0x23')]();};}function saveUpdates(_0x55e97c,_0x246ab6){return function(_0x3d1478){if(_0x3d1478){return _0x3d1478[_0xb79f('0x24')](_0x55e97c)['then'](function(_0x3db1a0){return _0x3db1a0;});}return null;};}function removeEntity(_0x25aa15,_0x2ab119){return function(_0x5eae72){if(_0x5eae72){return _0x5eae72[_0xb79f('0x25')]()[_0xb79f('0x26')](function(){_0x25aa15[_0xb79f('0x1b')](0xcc)[_0xb79f('0x1c')]();});}};}function handleEntityNotFound(_0x470593,_0x293803){return function(_0x5aa319){if(!_0x5aa319){_0x470593[_0xb79f('0x1a')](0x194);}return _0x5aa319;};}function handleError(_0x39d4cc,_0x6bdfe2){_0x6bdfe2=_0x6bdfe2||0x1f4;return function(_0x674f11){logger[_0xb79f('0x27')](_0x674f11[_0xb79f('0x28')]);if(_0x674f11[_0xb79f('0x29')]){delete _0x674f11[_0xb79f('0x29')];}_0x39d4cc['status'](_0x6bdfe2)['send'](_0x674f11);};}exports[_0xb79f('0x2a')]=function(_0x14922d,_0x54bc40){var _0x5badfc={},_0x1d160c={},_0x25b7a1={'count':0x0,'rows':[]};var _0x1c3141=_[_0xb79f('0x2b')](db[_0xb79f('0x2c')][_0xb79f('0x2d')],function(_0x2bb98b){return{'name':_0x2bb98b[_0xb79f('0x2e')],'type':_0x2bb98b[_0xb79f('0x2f')][_0xb79f('0x30')]};});_0x1d160c[_0xb79f('0x31')]=_[_0xb79f('0x2b')](_0x1c3141,_0xb79f('0x29'));_0x1d160c[_0xb79f('0x32')]=_[_0xb79f('0x33')](_0x14922d[_0xb79f('0x32')]);_0x1d160c[_0xb79f('0x34')]=_[_0xb79f('0x35')](_0x1d160c[_0xb79f('0x31')],_0x1d160c[_0xb79f('0x32')]);_0x5badfc[_0xb79f('0x36')]=_[_0xb79f('0x35')](_0x1d160c[_0xb79f('0x31')],qs[_0xb79f('0x37')](_0x14922d['query']['fields']));_0x5badfc[_0xb79f('0x36')]=_0x5badfc[_0xb79f('0x36')]['length']?_0x5badfc[_0xb79f('0x36')]:_0x1d160c[_0xb79f('0x31')];if(!_0x14922d[_0xb79f('0x32')][_0xb79f('0x38')](_0xb79f('0x39'))){_0x5badfc[_0xb79f('0x3a')]=qs['limit'](_0x14922d['query'][_0xb79f('0x3a')]);_0x5badfc[_0xb79f('0x1e')]=qs[_0xb79f('0x1e')](_0x14922d['query'][_0xb79f('0x1e')]);}_0x5badfc[_0xb79f('0x3b')]=qs[_0xb79f('0x3c')](_0x14922d['query']['sort']);_0x5badfc[_0xb79f('0x3d')]=qs['filters'](_[_0xb79f('0x3e')](_0x14922d[_0xb79f('0x32')],_0x1d160c['filters']),_0x1c3141);if(_0x14922d['query'][_0xb79f('0x3f')]){_0x5badfc[_0xb79f('0x3d')]=_[_0xb79f('0x40')](_0x5badfc[_0xb79f('0x3d')],{'$or':_[_0xb79f('0x2b')](_0x1c3141,function(_0x5bdc77){if(_0x5bdc77[_0xb79f('0x2f')]!==_0xb79f('0x41')){var _0x422f80={};_0x422f80[_0x5bdc77[_0xb79f('0x29')]]={'$like':'%'+_0x14922d[_0xb79f('0x32')]['filter']+'%'};return _0x422f80;}})});}_0x5badfc=_['merge']({},_0x5badfc,_0x14922d[_0xb79f('0x42')]);var _0x1407f1={'where':_0x5badfc['where']};return db['Automation'][_0xb79f('0x20')](_0x1407f1)[_0xb79f('0x26')](function(_0x21f57f){_0x25b7a1[_0xb79f('0x20')]=_0x21f57f;if(_0x14922d['query']['includeAll']){_0x5badfc[_0xb79f('0x43')]=[{'all':!![]}];}return db['Automation'][_0xb79f('0x44')](_0x5badfc);})[_0xb79f('0x26')](function(_0x330a41){_0x25b7a1['rows']=_0x330a41;return _0x25b7a1;})[_0xb79f('0x26')](respondWithFilteredResult(_0x54bc40,_0x5badfc))[_0xb79f('0x45')](handleError(_0x54bc40,null));};exports[_0xb79f('0x46')]=function(_0xb6a45c,_0x2aacae){var _0x313b67={'raw':![],'where':{'id':_0xb6a45c['params']['id']}},_0x5859bf={};_0x5859bf['model']=_[_0xb79f('0x33')](db['Automation'][_0xb79f('0x2d')]);_0x5859bf['query']=_[_0xb79f('0x33')](_0xb6a45c[_0xb79f('0x32')]);_0x5859bf[_0xb79f('0x34')]=_[_0xb79f('0x35')](_0x5859bf[_0xb79f('0x31')],_0x5859bf[_0xb79f('0x32')]);_0x313b67[_0xb79f('0x36')]=_[_0xb79f('0x35')](_0x5859bf[_0xb79f('0x31')],qs[_0xb79f('0x37')](_0xb6a45c[_0xb79f('0x32')][_0xb79f('0x37')]));_0x313b67['attributes']=_0x313b67[_0xb79f('0x36')][_0xb79f('0x47')]?_0x313b67[_0xb79f('0x36')]:_0x5859bf[_0xb79f('0x31')];if(_0xb6a45c[_0xb79f('0x32')][_0xb79f('0x48')]){_0x313b67[_0xb79f('0x43')]=[{'all':!![]}];}_0x313b67=_[_0xb79f('0x40')]({},_0x313b67,_0xb6a45c[_0xb79f('0x42')]);return db[_0xb79f('0x2c')][_0xb79f('0x49')](_0x313b67)[_0xb79f('0x26')](handleEntityNotFound(_0x2aacae,null))[_0xb79f('0x26')](respondWithResult(_0x2aacae,null))[_0xb79f('0x45')](handleError(_0x2aacae,null));};exports[_0xb79f('0x4a')]=function(_0x2927f5,_0x24d6f4){return db[_0xb79f('0x2c')][_0xb79f('0x4a')](_0x2927f5[_0xb79f('0x4b')],{})[_0xb79f('0x26')](respondWithResult(_0x24d6f4,0xc9))[_0xb79f('0x45')](handleError(_0x24d6f4,null));};exports['update']=function(_0xf1a588,_0x49218b){if(_0xf1a588['body']['id']){delete _0xf1a588[_0xb79f('0x4b')]['id'];}return db['Automation']['find']({'where':{'id':_0xf1a588[_0xb79f('0x4c')]['id']}})[_0xb79f('0x26')](handleEntityNotFound(_0x49218b,null))[_0xb79f('0x26')](saveUpdates(_0xf1a588[_0xb79f('0x4b')],null))[_0xb79f('0x26')](respondWithResult(_0x49218b,null))[_0xb79f('0x45')](handleError(_0x49218b,null));};exports[_0xb79f('0x25')]=function(_0x970a66,_0x272f9c){return db[_0xb79f('0x2c')][_0xb79f('0x49')]({'where':{'id':_0x970a66[_0xb79f('0x4c')]['id']}})[_0xb79f('0x26')](handleEntityNotFound(_0x272f9c,null))[_0xb79f('0x26')](removeEntity(_0x272f9c,null))[_0xb79f('0x45')](handleError(_0x272f9c,null));};exports[_0xb79f('0x4d')]=function(_0x2e83b8,_0x3cb2b4,_0x228e85){return db['Condition'][_0xb79f('0x49')]({'where':{'id':_0x2e83b8[_0xb79f('0x4c')]['id']}})[_0xb79f('0x26')](handleEntityNotFound(_0x3cb2b4,null))[_0xb79f('0x26')](function(_0x5195c4){if(_0x5195c4){return _0x5195c4['addConditions'](_0x2e83b8[_0xb79f('0x4b')][_0xb79f('0x4e')],_['omit'](_0x2e83b8[_0xb79f('0x4b')],['ids','id'])||{});}})[_0xb79f('0x26')](respondWithResult(_0x3cb2b4,null))[_0xb79f('0x45')](handleError(_0x3cb2b4,null));};exports[_0xb79f('0x4f')]=function(_0x5d1940,_0x1d2e59,_0x5ea90a){var _0x4cca90={};var _0x4d059f={};var _0x582565;var _0x307312;return db['Automation'][_0xb79f('0x50')]({'where':{'id':_0x5d1940[_0xb79f('0x4c')]['id']}})[_0xb79f('0x26')](handleEntityNotFound(_0x1d2e59,null))[_0xb79f('0x26')](function(_0x3a31ab){if(_0x3a31ab){_0x582565=_0x3a31ab;_0x4d059f[_0xb79f('0x31')]=_['keys'](db['Condition'][_0xb79f('0x2d')]);_0x4d059f[_0xb79f('0x32')]=_[_0xb79f('0x33')](_0x5d1940[_0xb79f('0x32')]);_0x4d059f['filters']=_[_0xb79f('0x35')](_0x4d059f[_0xb79f('0x31')],_0x4d059f[_0xb79f('0x32')]);_0x4cca90[_0xb79f('0x36')]=_['intersection'](_0x4d059f[_0xb79f('0x31')],qs['fields'](_0x5d1940[_0xb79f('0x32')]['fields']));_0x4cca90[_0xb79f('0x36')]=_0x4cca90[_0xb79f('0x36')][_0xb79f('0x47')]?_0x4cca90[_0xb79f('0x36')]:_0x4d059f['model'];_0x4cca90['order']=qs['sort'](_0x5d1940[_0xb79f('0x32')]['sort']);_0x4cca90['where']=qs[_0xb79f('0x34')](_[_0xb79f('0x3e')](_0x5d1940['query'],_0x4d059f[_0xb79f('0x34')]));if(_0x5d1940[_0xb79f('0x32')][_0xb79f('0x3f')]){_0x4cca90[_0xb79f('0x3d')]=_['merge'](_0x4cca90[_0xb79f('0x3d')],{'$or':_['map'](_0x4cca90[_0xb79f('0x36')],function(_0x4a8479){var _0x4f9eca={};_0x4f9eca[_0x4a8479]={'$like':'%'+_0x5d1940[_0xb79f('0x32')]['filter']+'%'};return _0x4f9eca;})});}_0x4cca90=_[_0xb79f('0x40')]({},_0x4cca90,_0x5d1940[_0xb79f('0x42')]);return _0x582565[_0xb79f('0x4f')](_0x4cca90);}})['then'](function(_0x1e7ade){if(_0x1e7ade){_0x307312=_0x1e7ade['length'];if(!_0x5d1940[_0xb79f('0x32')][_0xb79f('0x38')]('nolimit')){_0x4cca90[_0xb79f('0x3a')]=qs[_0xb79f('0x3a')](_0x5d1940[_0xb79f('0x32')][_0xb79f('0x3a')]);_0x4cca90['offset']=qs[_0xb79f('0x1e')](_0x5d1940['query'][_0xb79f('0x1e')]);}return _0x582565[_0xb79f('0x4f')](_0x4cca90);}})[_0xb79f('0x26')](function(_0x1e716a){if(_0x1e716a){return _0x1e716a?{'count':_0x307312,'rows':_0x1e716a}:null;}})['then'](respondWithResult(_0x1d2e59,null))[_0xb79f('0x45')](handleError(_0x1d2e59,null));};exports[_0xb79f('0x51')]=function(_0x272f80,_0x5ec7a1,_0x13fe21){return db['Action'][_0xb79f('0x49')]({'where':{'id':_0x272f80['params']['id']}})[_0xb79f('0x26')](handleEntityNotFound(_0x5ec7a1,null))[_0xb79f('0x26')](function(_0x2e14ab){if(_0x2e14ab){return _0x2e14ab['addActions'](_0x272f80[_0xb79f('0x4b')][_0xb79f('0x4e')],_['omit'](_0x272f80[_0xb79f('0x4b')],[_0xb79f('0x4e'),'id'])||{});}})[_0xb79f('0x26')](respondWithResult(_0x5ec7a1,null))['catch'](handleError(_0x5ec7a1,null));};exports[_0xb79f('0x52')]=function(_0x58c21e,_0x4b8a4e,_0x177d31){var _0x2f5f5e={};var _0x250ee6={};var _0x2aa082;var _0x7d6482;return db['Automation'][_0xb79f('0x50')]({'where':{'id':_0x58c21e[_0xb79f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b8a4e,null))[_0xb79f('0x26')](function(_0x464697){if(_0x464697){_0x2aa082=_0x464697;_0x250ee6['model']=_[_0xb79f('0x33')](db['Action'][_0xb79f('0x2d')]);_0x250ee6[_0xb79f('0x32')]=_['keys'](_0x58c21e['query']);_0x250ee6['filters']=_['intersection'](_0x250ee6[_0xb79f('0x31')],_0x250ee6[_0xb79f('0x32')]);_0x2f5f5e[_0xb79f('0x36')]=_[_0xb79f('0x35')](_0x250ee6[_0xb79f('0x31')],qs[_0xb79f('0x37')](_0x58c21e[_0xb79f('0x32')]['fields']));_0x2f5f5e[_0xb79f('0x36')]=_0x2f5f5e[_0xb79f('0x36')][_0xb79f('0x47')]?_0x2f5f5e[_0xb79f('0x36')]:_0x250ee6['model'];_0x2f5f5e[_0xb79f('0x3b')]=qs[_0xb79f('0x3c')](_0x58c21e[_0xb79f('0x32')][_0xb79f('0x3c')]);_0x2f5f5e['where']=qs[_0xb79f('0x34')](_[_0xb79f('0x3e')](_0x58c21e[_0xb79f('0x32')],_0x250ee6['filters']));if(_0x58c21e[_0xb79f('0x32')][_0xb79f('0x3f')]){_0x2f5f5e['where']=_[_0xb79f('0x40')](_0x2f5f5e[_0xb79f('0x3d')],{'$or':_[_0xb79f('0x2b')](_0x2f5f5e['attributes'],function(_0x43cd0b){var _0x5cf60b={};_0x5cf60b[_0x43cd0b]={'$like':'%'+_0x58c21e[_0xb79f('0x32')][_0xb79f('0x3f')]+'%'};return _0x5cf60b;})});}_0x2f5f5e=_[_0xb79f('0x40')]({},_0x2f5f5e,_0x58c21e[_0xb79f('0x42')]);return _0x2aa082[_0xb79f('0x52')](_0x2f5f5e);}})[_0xb79f('0x26')](function(_0xe55d0d){if(_0xe55d0d){_0x7d6482=_0xe55d0d['length'];if(!_0x58c21e[_0xb79f('0x32')]['hasOwnProperty'](_0xb79f('0x39'))){_0x2f5f5e[_0xb79f('0x3a')]=qs[_0xb79f('0x3a')](_0x58c21e['query'][_0xb79f('0x3a')]);_0x2f5f5e[_0xb79f('0x1e')]=qs[_0xb79f('0x1e')](_0x58c21e[_0xb79f('0x32')][_0xb79f('0x1e')]);}return _0x2aa082[_0xb79f('0x52')](_0x2f5f5e);}})['then'](function(_0x50b45b){if(_0x50b45b){return _0x50b45b?{'count':_0x7d6482,'rows':_0x50b45b}:null;}})[_0xb79f('0x26')](respondWithResult(_0x4b8a4e,null))[_0xb79f('0x45')](handleError(_0x4b8a4e,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6a40118..f9a958f 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 _0x73ab=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','Automation','tools_automations','lodash','util'];(function(_0x45a8e5,_0x15cb21){var _0x5c3b72=function(_0x5a9a50){while(--_0x5a9a50){_0x45a8e5['push'](_0x45a8e5['shift']());}};_0x5c3b72(++_0x15cb21);}(_0x73ab,0x1b8));var _0xb73a=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x73ab[_0x176329];return _0x31997c;};'use strict';var _=require(_0xb73a('0x0'));var util=require(_0xb73a('0x1'));var logger=require(_0xb73a('0x2'))(_0xb73a('0x3'));var moment=require(_0xb73a('0x4'));var BPromise=require(_0xb73a('0x5'));var rp=require(_0xb73a('0x6'));var fs=require('fs');var path=require(_0xb73a('0x7'));var rimraf=require(_0xb73a('0x8'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xb73a('0x9')]=function(_0x3bc4aa,_0x5c7b86){return _0x3bc4aa[_0xb73a('0xa')](_0xb73a('0xb'),attributes,{'tableName':_0xb73a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x455e=['tools_automations','../../config/logger','api','request-promise','path','rimraf','./automation.attributes','exports','define','Automation'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x455e,0x169));var _0xe455=function(_0x208d6d,_0x47f7b6){_0x208d6d=_0x208d6d-0x0;var _0x432519=_0x455e[_0x208d6d];return _0x432519;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe455('0x0'))(_0xe455('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe455('0x2'));var fs=require('fs');var path=require(_0xe455('0x3'));var rimraf=require(_0xe455('0x4'));var config=require('../../config/environment');var attributes=require(_0xe455('0x5'));module[_0xe455('0x6')]=function(_0x3f2f08,_0x4ab547){return _0x3f2f08[_0xe455('0x7')](_0xe455('0x8'),attributes,{'tableName':_0xe455('0x9'),'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 4ec3454..dcddc05 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 _0xd945=['debug','request\x20sent','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s'];(function(_0x11dc1a,_0x804361){var _0x5884d3=function(_0x2613c2){while(--_0x2613c2){_0x11dc1a['push'](_0x11dc1a['shift']());}};_0x5884d3(++_0x804361);}(_0xd945,0x84));var _0x5d94=function(_0x587267,_0x3372ee){_0x587267=_0x587267-0x0;var _0x1a4edd=_0xd945[_0x587267];return _0x1a4edd;};'use strict';var _=require(_0x5d94('0x0'));var util=require(_0x5d94('0x1'));var moment=require(_0x5d94('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d94('0x3'));var fs=require('fs');var Redis=require(_0x5d94('0x4'));var db=require(_0x5d94('0x5'))['db'];var utils=require(_0x5d94('0x6'));var logger=require(_0x5d94('0x7'))('rpc');var config=require(_0x5d94('0x8'));var jayson=require(_0x5d94('0x9'));var client=jayson[_0x5d94('0xa')][_0x5d94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3635a6,_0x54af94,_0x430607){return new BPromise(function(_0x34fa30,_0x1117dc){return client['request'](_0x3635a6,_0x430607)[_0x5d94('0xc')](function(_0x3dd79e){logger[_0x5d94('0xd')](_0x5d94('0xe'),_0x54af94,'request\x20sent');logger[_0x5d94('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x54af94,_0x5d94('0x10'),JSON[_0x5d94('0x11')](_0x3dd79e));if(_0x3dd79e[_0x5d94('0x12')]){if(_0x3dd79e[_0x5d94('0x12')][_0x5d94('0x13')]===0x1f4){logger[_0x5d94('0x12')](_0x5d94('0xe'),_0x54af94,_0x3dd79e[_0x5d94('0x12')][_0x5d94('0x14')]);return _0x1117dc(_0x3dd79e[_0x5d94('0x12')]['message']);}logger[_0x5d94('0x12')](_0x5d94('0xe'),_0x54af94,_0x3dd79e['error'][_0x5d94('0x14')]);return _0x34fa30(_0x3dd79e[_0x5d94('0x12')][_0x5d94('0x14')]);}else{logger[_0x5d94('0xd')](_0x5d94('0xe'),_0x54af94,_0x5d94('0x10'));_0x34fa30(_0x3dd79e['result']['message']);}})['catch'](function(_0x38d3c7){logger[_0x5d94('0x12')](_0x5d94('0xe'),_0x54af94,_0x38d3c7);_0x1117dc(_0x38d3c7);});});}
\ No newline at end of file
+var _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','Automation,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3e8082,_0x481707){var _0x58794=function(_0x25fb94){while(--_0x25fb94){_0x3e8082['push'](_0x3e8082['shift']());}};_0x58794(++_0x481707);}(_0x505d,0x93));var _0xd505=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x505d[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 0026ff7..78f1c96 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 _0xb661=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions'];(function(_0x27d12a,_0x490795){var _0x2e6dfc=function(_0xc8e9ab){while(--_0xc8e9ab){_0x27d12a['push'](_0x27d12a['shift']());}};_0x2e6dfc(++_0x490795);}(_0xb661,0x1d0));var _0x1b66=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xb661[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x1b66('0x0'));var util=require(_0x1b66('0x1'));var path=require(_0x1b66('0x2'));var timeout=require(_0x1b66('0x3'));var express=require(_0x1b66('0x4'));var router=express[_0x1b66('0x5')]();var fs_extra=require(_0x1b66('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x1b66('0x7')]('/',auth[_0x1b66('0x8')](),controller['index']);router[_0x1b66('0x7')](_0x1b66('0x9'),auth[_0x1b66('0x8')](),controller[_0x1b66('0xa')]);router[_0x1b66('0x7')](_0x1b66('0xb'),auth[_0x1b66('0x8')](),controller[_0x1b66('0xc')]);router[_0x1b66('0x7')]('/:id/actions',auth[_0x1b66('0x8')](),controller[_0x1b66('0xd')]);router[_0x1b66('0xe')]('/',auth[_0x1b66('0x8')](),controller[_0x1b66('0xf')]);router[_0x1b66('0xe')](_0x1b66('0xb'),auth[_0x1b66('0x8')](),controller[_0x1b66('0x10')]);router[_0x1b66('0xe')](_0x1b66('0x11'),auth[_0x1b66('0x8')](),controller[_0x1b66('0x12')]);router[_0x1b66('0x13')](_0x1b66('0x9'),auth[_0x1b66('0x8')](),controller[_0x1b66('0x14')]);router[_0x1b66('0x15')](_0x1b66('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b66('0x16')]=router;
\ No newline at end of file
+var _0x7bbd=['delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','create','post','put'];(function(_0x4ded50,_0x4a6af3){var _0xa92135=function(_0xe09b41){while(--_0xe09b41){_0x4ded50['push'](_0x4ded50['shift']());}};_0xa92135(++_0x4a6af3);}(_0x7bbd,0x11f));var _0xd7bb=function(_0x550ac7,_0x1b692e){_0x550ac7=_0x550ac7-0x0;var _0x18910b=_0x7bbd[_0x550ac7];return _0x18910b;};'use strict';var multer=require(_0xd7bb('0x0'));var util=require(_0xd7bb('0x1'));var path=require(_0xd7bb('0x2'));var timeout=require(_0xd7bb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd7bb('0x4'));var config=require(_0xd7bb('0x5'));var controller=require('./automation.controller');router[_0xd7bb('0x6')]('/',auth[_0xd7bb('0x7')](),controller[_0xd7bb('0x8')]);router[_0xd7bb('0x6')](_0xd7bb('0x9'),auth[_0xd7bb('0x7')](),controller[_0xd7bb('0xa')]);router[_0xd7bb('0x6')](_0xd7bb('0xb'),auth[_0xd7bb('0x7')](),controller['getConditions']);router[_0xd7bb('0x6')](_0xd7bb('0xc'),auth[_0xd7bb('0x7')](),controller[_0xd7bb('0xd')]);router['post']('/',auth[_0xd7bb('0x7')](),controller[_0xd7bb('0xe')]);router['post']('/:id/conditions',auth[_0xd7bb('0x7')](),controller['addConditions']);router[_0xd7bb('0xf')]('/:id/actions',auth[_0xd7bb('0x7')](),controller['addActions']);router[_0xd7bb('0x10')](_0xd7bb('0x9'),auth[_0xd7bb('0x7')](),controller['update']);router[_0xd7bb('0x11')]('/:id',auth[_0xd7bb('0x7')](),controller[_0xd7bb('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 958de5f..2fdc62f 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 _0x69b6=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x23875f,_0x20a31e){var _0x973243=function(_0x3a48d1){while(--_0x3a48d1){_0x23875f['push'](_0x23875f['shift']());}};_0x973243(++_0x20a31e);}(_0x69b6,0xa3));var _0x669b=function(_0x10ff4c,_0x35c7e2){_0x10ff4c=_0x10ff4c-0x0;var _0x28bac8=_0x69b6[_0x10ff4c];return _0x28bac8;};'use strict';var Sequelize=require(_0x669b('0x0'));module[_0x669b('0x1')]={'name':{'type':Sequelize[_0x669b('0x2')],'unique':_0x669b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x669b('0x4')](_0x669b('0x5')),'allowNull':![],'defaultValue':_0x669b('0x5')},'description':{'type':Sequelize[_0x669b('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x669b('0x6')},'limitCalls':{'type':Sequelize[_0x669b('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x669b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x669b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x669b('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x669b('0x7')](0x3)[_0x669b('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x669b('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x669b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x669b('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x669b('0x7')](0x5)[_0x669b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x669b('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x669b('0x7')](0x3)[_0x669b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x669b('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x669b('0x7')](0x5)[_0x669b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x669b('0x9')],'defaultValue':0x3,'comment':_0x669b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x669b('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x669b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x669b('0x10')},'dialTimezone':{'type':Sequelize[_0x669b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x669b('0x2')],'defaultValue':_0x669b('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x669b('0x4')](_0x669b('0x12'),'never','onlyIfOpen'),'defaultValue':_0x669b('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x669b('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x669b('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x669b('0x7')](0x9)[_0x669b('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x669b('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x669b('0x7')](0x9)[_0x669b('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x669b('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x669b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x669b('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x669b('0x7')](0x9)[_0x669b('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x669b('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x669b('0x7')](0x9)[_0x669b('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x669b('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x669b('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x669b('0x7')](0x5)[_0x669b('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x669b('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x669b('0x7')](0x9)[_0x669b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x669b('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x669b('0x4')]('DESC',_0x669b('0x1b')),'defaultValue':_0x669b('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x669b('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x669b('0x1d')},'dialCutDigit':{'type':Sequelize[_0x669b('0x7')](0x3)[_0x669b('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x669b('0x7')](0x3)[_0x669b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x669b('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x669b('0x7')](0x5)[_0x669b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x669b('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x669b('0x7')](0x3)[_0x669b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x669b('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x669b('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x669b('0x7')](0x3)[_0x669b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x669b('0x7')](0x5)[_0x669b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x669b('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x669b('0x7')](0x3)[_0x669b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x669b('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x669b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x669b('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x669b('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x669b('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x669b('0x7')](0x5)[_0x669b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x669b('0x26')}};
\ No newline at end of file
+var _0x8d87=['exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x2e6369,_0x385ab2){var _0x5b70ee=function(_0x4089dd){while(--_0x4089dd){_0x2e6369['push'](_0x2e6369['shift']());}};_0x5b70ee(++_0x385ab2);}(_0x8d87,0x1ac));var _0x78d8=function(_0x332d5c,_0x4a2336){_0x332d5c=_0x332d5c-0x0;var _0x47448d=_0x8d87[_0x332d5c];return _0x47448d;};'use strict';var Sequelize=require(_0x78d8('0x0'));module[_0x78d8('0x1')]={'name':{'type':Sequelize[_0x78d8('0x2')],'unique':_0x78d8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x78d8('0x4')](_0x78d8('0x5')),'allowNull':![],'defaultValue':_0x78d8('0x5')},'description':{'type':Sequelize[_0x78d8('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x78d8('0x6')},'limitCalls':{'type':Sequelize[_0x78d8('0x7')](0x4)[_0x78d8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x78d8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x78d8('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x78d8('0x7')](0x3)[_0x78d8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x78d8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x78d8('0x7')](0x3)[_0x78d8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x78d8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x78d8('0x7')](0x5)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x78d8('0x7')](0x3)[_0x78d8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x78d8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x78d8('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x78d8('0x7')](0x5)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x78d8('0x7')](0x3)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x78d8('0x10')},'dialTimezone':{'type':Sequelize[_0x78d8('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x78d8('0x2')],'defaultValue':_0x78d8('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x78d8('0x4')](_0x78d8('0x12'),_0x78d8('0x13'),_0x78d8('0x14')),'defaultValue':_0x78d8('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x78d8('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x78d8('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x78d8('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x78d8('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x78d8('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x78d8('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x78d8('0x7')](0x9)[_0x78d8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x78d8('0x7')](0x9)[_0x78d8('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x78d8('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x78d8('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x78d8('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x78d8('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x78d8('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x78d8('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x78d8('0x4')](_0x78d8('0x1d'),_0x78d8('0x1e')),'defaultValue':_0x78d8('0x1d')},'dialPrefix':{'type':Sequelize[_0x78d8('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x78d8('0x7')](0x3)[_0x78d8('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x78d8('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x78d8('0x7')](0x3)[_0x78d8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x78d8('0x7')](0x5)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x78d8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x78d8('0x7')](0x3)[_0x78d8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x78d8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x78d8('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x78d8('0x7')](0x5)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x78d8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x78d8('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x78d8('0x7')](0x5)[_0x78d8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x78d8('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index a5adbf8..39f0e85 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 _0xae53=['fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','Campaign','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','getHoppers','findOne','CmHopper','order','CampaignId','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','ContactId','ListId','select','field','phone','scheduledAt','CmListId','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','rawAttributes'];(function(_0x479746,_0x574758){var _0x36d2aa=function(_0x27e29d){while(--_0x27e29d){_0x479746['push'](_0x479746['shift']());}};_0x36d2aa(++_0x574758);}(_0xae53,0xf7));var _0x3ae5=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xae53[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x3ae5('0x0'));var rimraf=require(_0x3ae5('0x1'));var zipdir=require(_0x3ae5('0x2'));var jsonpatch=require(_0x3ae5('0x3'));var rp=require('request-promise');var moment=require(_0x3ae5('0x4'));var BPromise=require(_0x3ae5('0x5'));var Mustache=require(_0x3ae5('0x6'));var util=require(_0x3ae5('0x7'));var path=require(_0x3ae5('0x8'));var sox=require(_0x3ae5('0x9'));var csv=require('to-csv');var ejs=require(_0x3ae5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ae5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ae5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3ae5('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ae5('0xe'));var authService=require(_0x3ae5('0xf'));var qs=require(_0x3ae5('0x10'));var as=require(_0x3ae5('0x11'));var hardwareService=require(_0x3ae5('0x12'));var logger=require(_0x3ae5('0x13'))('api');var utils=require(_0x3ae5('0x14'));var config=require(_0x3ae5('0x15'));var licenseUtil=require(_0x3ae5('0x16'));var db=require(_0x3ae5('0x17'))['db'];function respondWithStatusCode(_0x304a6c,_0x1236fa){_0x1236fa=_0x1236fa||0xcc;return function(_0x408bd5){if(_0x408bd5){return _0x304a6c[_0x3ae5('0x18')](_0x1236fa);}return _0x304a6c[_0x3ae5('0x19')](_0x1236fa)[_0x3ae5('0x1a')]();};}function respondWithResult(_0x1df2f4,_0x285229){_0x285229=_0x285229||0xc8;return function(_0x1fc10){if(_0x1fc10){return _0x1df2f4['status'](_0x285229)[_0x3ae5('0x1b')](_0x1fc10);}};}function respondWithFilteredResult(_0x38698c,_0x2351f8){return function(_0x12a04e){if(_0x12a04e){var _0x1f664f=typeof _0x2351f8[_0x3ae5('0x1c')]===_0x3ae5('0x1d')&&typeof _0x2351f8[_0x3ae5('0x1e')]===_0x3ae5('0x1d');var _0x1ef4b8=_0x12a04e[_0x3ae5('0x1f')];var _0x5c8e26=_0x1f664f?0x0:_0x2351f8[_0x3ae5('0x1c')];var _0x103de5=_0x1f664f?_0x12a04e[_0x3ae5('0x1f')]:_0x2351f8[_0x3ae5('0x1c')]+_0x2351f8[_0x3ae5('0x1e')];var _0x3afcff;if(_0x103de5>=_0x1ef4b8){_0x103de5=_0x1ef4b8;_0x3afcff=0xc8;}else{_0x3afcff=0xce;}_0x38698c[_0x3ae5('0x19')](_0x3afcff);return _0x38698c[_0x3ae5('0x20')](_0x3ae5('0x21'),_0x5c8e26+'-'+_0x103de5+'/'+_0x1ef4b8)[_0x3ae5('0x1b')](_0x12a04e);}return null;};}function patchUpdates(_0x495b34){return function(_0xa669c6){try{jsonpatch[_0x3ae5('0x22')](_0xa669c6,_0x495b34,!![]);}catch(_0x2eb57a){return BPromise['reject'](_0x2eb57a);}return _0xa669c6[_0x3ae5('0x23')]();};}function saveUpdates(_0x469aec,_0x124677){return function(_0x4ebe28){if(_0x4ebe28){return _0x4ebe28[_0x3ae5('0x24')](_0x469aec)[_0x3ae5('0x25')](function(_0xe8ae78){return _0xe8ae78;});}return null;};}function removeEntity(_0xe0a602,_0x25acba){return function(_0x16eed0){if(_0x16eed0){return _0x16eed0[_0x3ae5('0x26')]()[_0x3ae5('0x25')](function(){var _0x36f8bd=_0x16eed0[_0x3ae5('0x27')]({'plain':!![]});var _0x107dd6=_0x3ae5('0x28');return db[_0x3ae5('0x29')][_0x3ae5('0x26')]({'where':{'type':_0x107dd6,'resourceId':_0x36f8bd['id']}})[_0x3ae5('0x25')](function(){return _0x16eed0;});})[_0x3ae5('0x25')](function(){_0xe0a602['status'](0xcc)[_0x3ae5('0x1a')]();});}};}function handleEntityNotFound(_0x12497f,_0x3d0fbb){return function(_0x4e69da){if(!_0x4e69da){_0x12497f['sendStatus'](0x194);}return _0x4e69da;};}function handleError(_0x397fb3,_0x5159a4){_0x5159a4=_0x5159a4||0x1f4;return function(_0x11076f){logger[_0x3ae5('0x2a')](_0x11076f[_0x3ae5('0x2b')]);if(_0x11076f[_0x3ae5('0x2c')]){delete _0x11076f['name'];}_0x397fb3[_0x3ae5('0x19')](_0x5159a4)[_0x3ae5('0x2d')](_0x11076f);};}exports[_0x3ae5('0x2e')]=function(_0x3ff882,_0x170dde){var _0x51f3d9={},_0x3cd1d8={},_0x330d4e={'count':0x0,'rows':[]};var _0x2a090f=_[_0x3ae5('0x2f')](db['Campaign'][_0x3ae5('0x30')],function(_0x4e6241){return{'name':_0x4e6241[_0x3ae5('0x31')],'type':_0x4e6241[_0x3ae5('0x32')][_0x3ae5('0x33')]};});_0x3cd1d8[_0x3ae5('0x34')]=_[_0x3ae5('0x2f')](_0x2a090f,'name');_0x3cd1d8[_0x3ae5('0x35')]=_['keys'](_0x3ff882[_0x3ae5('0x35')]);_0x3cd1d8[_0x3ae5('0x36')]=_[_0x3ae5('0x37')](_0x3cd1d8[_0x3ae5('0x34')],_0x3cd1d8['query']);_0x51f3d9['attributes']=_[_0x3ae5('0x37')](_0x3cd1d8['model'],qs[_0x3ae5('0x38')](_0x3ff882[_0x3ae5('0x35')][_0x3ae5('0x38')]));_0x51f3d9[_0x3ae5('0x39')]=_0x51f3d9[_0x3ae5('0x39')][_0x3ae5('0x3a')]?_0x51f3d9[_0x3ae5('0x39')]:_0x3cd1d8['model'];if(!_0x3ff882[_0x3ae5('0x35')][_0x3ae5('0x3b')]('nolimit')){_0x51f3d9[_0x3ae5('0x1e')]=qs['limit'](_0x3ff882[_0x3ae5('0x35')][_0x3ae5('0x1e')]);_0x51f3d9[_0x3ae5('0x1c')]=qs[_0x3ae5('0x1c')](_0x3ff882['query'][_0x3ae5('0x1c')]);}_0x51f3d9['order']=qs['sort'](_0x3ff882[_0x3ae5('0x35')][_0x3ae5('0x3c')]);_0x51f3d9[_0x3ae5('0x3d')]=qs[_0x3ae5('0x36')](_[_0x3ae5('0x3e')](_0x3ff882['query'],_0x3cd1d8[_0x3ae5('0x36')]),_0x2a090f);if(_0x3ff882[_0x3ae5('0x35')][_0x3ae5('0x3f')]){_0x51f3d9[_0x3ae5('0x3d')]=_['merge'](_0x51f3d9[_0x3ae5('0x3d')],{'$or':_[_0x3ae5('0x2f')](_0x2a090f,function(_0x57fcc4){if(_0x57fcc4['type']!==_0x3ae5('0x40')){var _0x37d66f={};_0x37d66f[_0x57fcc4['name']]={'$like':'%'+_0x3ff882[_0x3ae5('0x35')][_0x3ae5('0x3f')]+'%'};return _0x37d66f;}})});}_0x51f3d9=_[_0x3ae5('0x41')]({},_0x51f3d9,_0x3ff882[_0x3ae5('0x42')]);var _0x29a186={'where':_0x51f3d9[_0x3ae5('0x3d')]};return db[_0x3ae5('0x43')]['count'](_0x29a186)[_0x3ae5('0x25')](function(_0x127131){_0x330d4e[_0x3ae5('0x1f')]=_0x127131;if(_0x3ff882[_0x3ae5('0x35')]['includeAll']){_0x51f3d9[_0x3ae5('0x44')]=[{'all':!![]}];}return db['Campaign'][_0x3ae5('0x45')](_0x51f3d9);})[_0x3ae5('0x25')](function(_0x3c3730){_0x330d4e[_0x3ae5('0x46')]=_0x3c3730;return _0x330d4e;})[_0x3ae5('0x25')](respondWithFilteredResult(_0x170dde,_0x51f3d9))[_0x3ae5('0x47')](handleError(_0x170dde,null));};exports[_0x3ae5('0x48')]=function(_0xab8bf6,_0x59d54e){var _0x5ba8e4={'raw':![],'where':{'id':_0xab8bf6[_0x3ae5('0x49')]['id']}},_0x2efb27={};_0x2efb27['model']=_[_0x3ae5('0x4a')](db[_0x3ae5('0x43')][_0x3ae5('0x30')]);_0x2efb27[_0x3ae5('0x35')]=_[_0x3ae5('0x4a')](_0xab8bf6[_0x3ae5('0x35')]);_0x2efb27[_0x3ae5('0x36')]=_[_0x3ae5('0x37')](_0x2efb27[_0x3ae5('0x34')],_0x2efb27[_0x3ae5('0x35')]);_0x5ba8e4['attributes']=_[_0x3ae5('0x37')](_0x2efb27['model'],qs[_0x3ae5('0x38')](_0xab8bf6[_0x3ae5('0x35')]['fields']));_0x5ba8e4[_0x3ae5('0x39')]=_0x5ba8e4[_0x3ae5('0x39')][_0x3ae5('0x3a')]?_0x5ba8e4[_0x3ae5('0x39')]:_0x2efb27['model'];if(_0xab8bf6[_0x3ae5('0x35')][_0x3ae5('0x4b')]){_0x5ba8e4['include']=[{'all':!![]}];}_0x5ba8e4=_['merge']({},_0x5ba8e4,_0xab8bf6[_0x3ae5('0x42')]);return db[_0x3ae5('0x43')][_0x3ae5('0x4c')](_0x5ba8e4)['then'](handleEntityNotFound(_0x59d54e,null))[_0x3ae5('0x25')](respondWithResult(_0x59d54e,null))[_0x3ae5('0x47')](handleError(_0x59d54e,null));};exports[_0x3ae5('0x4d')]=function(_0x4b9764,_0x453694){return db['Campaign'][_0x3ae5('0x4d')](_0x4b9764[_0x3ae5('0x4e')],{})[_0x3ae5('0x25')](function(_0x5e505){var _0x4aff4b=_0x4b9764[_0x3ae5('0x4f')][_0x3ae5('0x27')]({'plain':!![]});if(!_0x4aff4b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aff4b['role']==='user'){var _0x5dcf28=_0x5e505[_0x3ae5('0x27')]({'plain':!![]});var _0x5dbd97='IvrCampaigns';return db[_0x3ae5('0x50')][_0x3ae5('0x4c')]({'where':{'name':_0x5dbd97,'userProfileId':_0x4aff4b[_0x3ae5('0x51')]},'raw':!![]})[_0x3ae5('0x25')](function(_0x31e74d){if(_0x31e74d&&_0x31e74d['autoAssociation']===0x0){return db['UserProfileResource'][_0x3ae5('0x4d')]({'name':_0x5dcf28[_0x3ae5('0x2c')],'resourceId':_0x5dcf28['id'],'type':_0x31e74d[_0x3ae5('0x2c')],'sectionId':_0x31e74d['id']},{})[_0x3ae5('0x25')](function(){return _0x5e505;});}else{return _0x5e505;}})['catch'](function(_0x4217bb){logger[_0x3ae5('0x2a')](_0x3ae5('0x52'),_0x4217bb);throw _0x4217bb;});}return _0x5e505;})[_0x3ae5('0x25')](respondWithResult(_0x453694,0xc9))[_0x3ae5('0x47')](handleError(_0x453694,null));};exports['clone']=function(_0x364985,_0x280d44){var _0x46f075={'where':{'id':_0x364985['params']['id']}},_0x5438b6={};_0x5438b6['model']=_['keys'](db['Campaign'][_0x3ae5('0x30')]);_0x46f075[_0x3ae5('0x39')]=_[_0x3ae5('0x37')](_0x5438b6[_0x3ae5('0x34')],qs[_0x3ae5('0x38')](_0x364985[_0x3ae5('0x35')][_0x3ae5('0x38')]));_0x46f075['attributes']=_0x46f075[_0x3ae5('0x39')][_0x3ae5('0x3a')]?_0x46f075[_0x3ae5('0x39')]:_0x5438b6[_0x3ae5('0x34')];if(_0x364985[_0x3ae5('0x35')]['includeAll']){_0x46f075[_0x3ae5('0x44')]=[{'all':!![]}];}_0x46f075=_[_0x3ae5('0x41')]({},_0x46f075,_0x364985['options']);return db['Campaign']['find'](_0x46f075)[_0x3ae5('0x25')](handleEntityNotFound(_0x280d44,null))[_0x3ae5('0x25')](function(_0x3cbbcc){if(_0x3cbbcc){var _0xd75a3=_0x3cbbcc['get']({'plain':!![]});_0xd75a3=qs['omit'](_0xd75a3,['id',_0x3ae5('0x53'),_0x3ae5('0x54')]);_0x364985['body']=_[_0x3ae5('0x55')](_0x364985[_0x3ae5('0x4e')],['id',_0x3ae5('0x53'),_0x3ae5('0x54')]);return db[_0x3ae5('0x43')][_0x3ae5('0x4d')](_[_0x3ae5('0x41')](_0xd75a3,_0x364985['body']),{'include':_0x364985[_0x3ae5('0x35')][_0x3ae5('0x4b')]?[{'all':!![]}]:undefined})[_0x3ae5('0x25')](function(_0x3cfd3a){var _0x4b8676=_0x364985['user'][_0x3ae5('0x27')]({'plain':!![]});if(!_0x4b8676)throw new Error(_0x3ae5('0x56'));if(_0x4b8676[_0x3ae5('0x57')]==='user'){var _0xddc9cc=_0x3cfd3a[_0x3ae5('0x27')]({'plain':!![]});var _0x1cd0a4='IvrCampaigns';return db[_0x3ae5('0x50')][_0x3ae5('0x4c')]({'where':{'name':_0x1cd0a4,'userProfileId':_0x4b8676[_0x3ae5('0x51')]},'raw':!![]})[_0x3ae5('0x25')](function(_0x4c5c01){if(_0x4c5c01&&_0x4c5c01[_0x3ae5('0x58')]===0x0){return db[_0x3ae5('0x29')][_0x3ae5('0x4d')]({'name':_0xddc9cc[_0x3ae5('0x2c')],'resourceId':_0xddc9cc['id'],'type':_0x4c5c01[_0x3ae5('0x2c')],'sectionId':_0x4c5c01['id']},{})[_0x3ae5('0x25')](function(){return _0x3cfd3a;});}else{return _0x3cfd3a;}})['catch'](function(_0x39badd){logger[_0x3ae5('0x2a')](_0x3ae5('0x52'),_0x39badd);throw _0x39badd;});}return _0x3cfd3a;});}})[_0x3ae5('0x25')](respondWithResult(_0x280d44,0xc9))[_0x3ae5('0x47')](handleError(_0x280d44,null));};exports[_0x3ae5('0x24')]=function(_0x5e36fc,_0x4e91cd){if(_0x5e36fc[_0x3ae5('0x4e')]['id']){delete _0x5e36fc[_0x3ae5('0x4e')]['id'];}return db['Campaign']['find']({'where':{'id':_0x5e36fc[_0x3ae5('0x49')]['id']}})[_0x3ae5('0x25')](handleEntityNotFound(_0x4e91cd,null))[_0x3ae5('0x25')](saveUpdates(_0x5e36fc['body'],null))[_0x3ae5('0x25')](respondWithResult(_0x4e91cd,null))[_0x3ae5('0x47')](handleError(_0x4e91cd,null));};exports[_0x3ae5('0x26')]=function(_0x2c29c1,_0x2b41f2){return db[_0x3ae5('0x43')][_0x3ae5('0x4c')]({'where':{'id':_0x2c29c1['params']['id']}})[_0x3ae5('0x25')](handleEntityNotFound(_0x2b41f2,null))[_0x3ae5('0x25')](removeEntity(_0x2b41f2,null))[_0x3ae5('0x47')](handleError(_0x2b41f2,null));};exports[_0x3ae5('0x59')]=function(_0x2bddc2,_0x21d2b0,_0x46e1ce){var _0x305ece={'raw':!![],'where':{}};var _0x427fea={};var _0x5f0d13={'count':0x0,'rows':[]};return db[_0x3ae5('0x43')][_0x3ae5('0x5a')]({'where':{'id':_0x2bddc2[_0x3ae5('0x49')]['id']}})['then'](handleEntityNotFound(_0x21d2b0,null))['then'](function(_0x49110d){if(_0x49110d){_0x427fea['model']=_[_0x3ae5('0x4a')](db[_0x3ae5('0x5b')][_0x3ae5('0x30')]);_0x427fea[_0x3ae5('0x35')]=_[_0x3ae5('0x4a')](_0x2bddc2[_0x3ae5('0x35')]);_0x427fea[_0x3ae5('0x36')]=_[_0x3ae5('0x37')](_0x427fea[_0x3ae5('0x34')],_0x427fea[_0x3ae5('0x35')]);_0x305ece['attributes']=_[_0x3ae5('0x37')](_0x427fea[_0x3ae5('0x34')],qs[_0x3ae5('0x38')](_0x2bddc2[_0x3ae5('0x35')][_0x3ae5('0x38')]));_0x305ece[_0x3ae5('0x39')]=_0x305ece[_0x3ae5('0x39')]['length']?_0x305ece[_0x3ae5('0x39')]:_0x427fea[_0x3ae5('0x34')];if(!_0x2bddc2[_0x3ae5('0x35')][_0x3ae5('0x3b')]('nolimit')){_0x305ece[_0x3ae5('0x1e')]=qs[_0x3ae5('0x1e')](_0x2bddc2[_0x3ae5('0x35')][_0x3ae5('0x1e')]);_0x305ece[_0x3ae5('0x1c')]=qs[_0x3ae5('0x1c')](_0x2bddc2[_0x3ae5('0x35')]['offset']);}_0x305ece[_0x3ae5('0x5c')]=qs[_0x3ae5('0x3c')](_0x2bddc2['query'][_0x3ae5('0x3c')]);_0x305ece['where']=qs[_0x3ae5('0x36')](_[_0x3ae5('0x3e')](_0x2bddc2[_0x3ae5('0x35')],_0x427fea[_0x3ae5('0x36')]));_0x305ece[_0x3ae5('0x3d')][_0x3ae5('0x5d')]=_0x49110d['id'];if(_0x2bddc2[_0x3ae5('0x35')]['filter']){_0x305ece[_0x3ae5('0x3d')]=_[_0x3ae5('0x41')](_0x305ece['where'],{'$or':_[_0x3ae5('0x2f')](_0x305ece[_0x3ae5('0x39')],function(_0x331eca){var _0x3ed9be={};_0x3ed9be[_0x331eca]={'$like':'%'+_0x2bddc2[_0x3ae5('0x35')][_0x3ae5('0x3f')]+'%'};return _0x3ed9be;})});}_0x305ece=_['merge']({},_0x305ece,_0x2bddc2[_0x3ae5('0x42')]);return db[_0x3ae5('0x5b')]['count']({'where':_0x305ece[_0x3ae5('0x3d')]})['then'](function(_0x32ff5b){_0x5f0d13[_0x3ae5('0x1f')]=_0x32ff5b;if(_0x2bddc2['query'][_0x3ae5('0x4b')]){_0x305ece[_0x3ae5('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x3ae5('0x45')](_0x305ece);})['then'](function(_0x368193){_0x5f0d13[_0x3ae5('0x46')]=_0x368193;return _0x5f0d13;});}})[_0x3ae5('0x25')](respondWithFilteredResult(_0x21d2b0,_0x305ece))[_0x3ae5('0x47')](handleError(_0x21d2b0,null));};exports[_0x3ae5('0x5e')]=function(_0x4bdb86,_0x1d9398,_0x4cb9a3){var _0x38e458={'raw':!![],'where':{}};var _0x28f424={};var _0x7587e4={'count':0x0,'rows':[]};return db[_0x3ae5('0x43')]['findOne']({'where':{'id':_0x4bdb86[_0x3ae5('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d9398,null))[_0x3ae5('0x25')](function(_0x1e529a){if(_0x1e529a){_0x28f424['model']=_[_0x3ae5('0x4a')](db[_0x3ae5('0x5f')][_0x3ae5('0x30')]);_0x28f424['query']=_[_0x3ae5('0x4a')](_0x4bdb86['query']);_0x28f424[_0x3ae5('0x36')]=_[_0x3ae5('0x37')](_0x28f424[_0x3ae5('0x34')],_0x28f424[_0x3ae5('0x35')]);_0x38e458['attributes']=_[_0x3ae5('0x37')](_0x28f424[_0x3ae5('0x34')],qs[_0x3ae5('0x38')](_0x4bdb86['query'][_0x3ae5('0x38')]));_0x38e458[_0x3ae5('0x39')]=_0x38e458[_0x3ae5('0x39')][_0x3ae5('0x3a')]?_0x38e458[_0x3ae5('0x39')]:_0x28f424[_0x3ae5('0x34')];if(!_0x4bdb86['query'][_0x3ae5('0x3b')](_0x3ae5('0x60'))){_0x38e458['limit']=qs[_0x3ae5('0x1e')](_0x4bdb86['query'][_0x3ae5('0x1e')]);_0x38e458[_0x3ae5('0x1c')]=qs[_0x3ae5('0x1c')](_0x4bdb86['query'][_0x3ae5('0x1c')]);}_0x38e458[_0x3ae5('0x5c')]=qs[_0x3ae5('0x3c')](_0x4bdb86['query'][_0x3ae5('0x3c')]);_0x38e458[_0x3ae5('0x3d')]=qs[_0x3ae5('0x36')](_[_0x3ae5('0x3e')](_0x4bdb86[_0x3ae5('0x35')],_0x28f424[_0x3ae5('0x36')]));_0x38e458[_0x3ae5('0x3d')][_0x3ae5('0x5d')]=_0x1e529a['id'];if(_0x4bdb86['query'][_0x3ae5('0x3f')]){_0x38e458['where']=_[_0x3ae5('0x41')](_0x38e458[_0x3ae5('0x3d')],{'$or':_[_0x3ae5('0x2f')](_0x38e458[_0x3ae5('0x39')],function(_0x3c1a6c){var _0xe444b={};_0xe444b[_0x3c1a6c]={'$like':'%'+_0x4bdb86[_0x3ae5('0x35')][_0x3ae5('0x3f')]+'%'};return _0xe444b;})});}_0x38e458=_[_0x3ae5('0x41')]({},_0x38e458,_0x4bdb86[_0x3ae5('0x42')]);return db[_0x3ae5('0x5f')][_0x3ae5('0x1f')]({'where':_0x38e458[_0x3ae5('0x3d')]})['then'](function(_0x5d3446){_0x7587e4[_0x3ae5('0x1f')]=_0x5d3446;if(_0x4bdb86[_0x3ae5('0x35')][_0x3ae5('0x4b')]){_0x38e458[_0x3ae5('0x44')]=[{'all':!![]}];}return db[_0x3ae5('0x5f')][_0x3ae5('0x45')](_0x38e458);})['then'](function(_0x14e95f){_0x7587e4[_0x3ae5('0x46')]=_0x14e95f;return _0x7587e4;});}})[_0x3ae5('0x25')](respondWithFilteredResult(_0x1d9398,_0x38e458))[_0x3ae5('0x47')](handleError(_0x1d9398,null));};exports[_0x3ae5('0x61')]=function(_0x31e5e8,_0x921120,_0x3c6933){var _0x1c5bc2={'raw':!![],'where':{}};var _0x5155cf={};var _0x1c8578={'count':0x0,'rows':[]};return db[_0x3ae5('0x43')]['findOne']({'where':{'id':_0x31e5e8[_0x3ae5('0x49')]['id']}})['then'](handleEntityNotFound(_0x921120,null))[_0x3ae5('0x25')](function(_0x5601a7){if(_0x5601a7){_0x5155cf[_0x3ae5('0x34')]=_['keys'](db[_0x3ae5('0x62')][_0x3ae5('0x30')]);_0x5155cf[_0x3ae5('0x35')]=_['keys'](_0x31e5e8['query']);_0x5155cf[_0x3ae5('0x36')]=_[_0x3ae5('0x37')](_0x5155cf[_0x3ae5('0x34')],_0x5155cf[_0x3ae5('0x35')]);_0x1c5bc2[_0x3ae5('0x39')]=_['intersection'](_0x5155cf[_0x3ae5('0x34')],qs[_0x3ae5('0x38')](_0x31e5e8[_0x3ae5('0x35')]['fields']));_0x1c5bc2[_0x3ae5('0x39')]=_0x1c5bc2['attributes'][_0x3ae5('0x3a')]?_0x1c5bc2[_0x3ae5('0x39')]:_0x5155cf['model'];if(!_0x31e5e8['query']['hasOwnProperty'](_0x3ae5('0x60'))){_0x1c5bc2[_0x3ae5('0x1e')]=qs[_0x3ae5('0x1e')](_0x31e5e8[_0x3ae5('0x35')]['limit']);_0x1c5bc2[_0x3ae5('0x1c')]=qs[_0x3ae5('0x1c')](_0x31e5e8[_0x3ae5('0x35')]['offset']);}_0x1c5bc2[_0x3ae5('0x5c')]=qs[_0x3ae5('0x3c')](_0x31e5e8[_0x3ae5('0x35')][_0x3ae5('0x3c')]);_0x1c5bc2[_0x3ae5('0x3d')]=qs[_0x3ae5('0x36')](_[_0x3ae5('0x3e')](_0x31e5e8[_0x3ae5('0x35')],_0x5155cf[_0x3ae5('0x36')]));_0x1c5bc2[_0x3ae5('0x3d')]['CampaignId']=_0x5601a7['id'];if(_0x31e5e8['query'][_0x3ae5('0x3f')]){_0x1c5bc2[_0x3ae5('0x3d')]=_[_0x3ae5('0x41')](_0x1c5bc2[_0x3ae5('0x3d')],{'$or':_['map'](_0x1c5bc2[_0x3ae5('0x39')],function(_0x590dbf){var _0x5f2361={};_0x5f2361[_0x590dbf]={'$like':'%'+_0x31e5e8[_0x3ae5('0x35')][_0x3ae5('0x3f')]+'%'};return _0x5f2361;})});}_0x1c5bc2=_[_0x3ae5('0x41')]({},_0x1c5bc2,_0x31e5e8[_0x3ae5('0x42')]);return db[_0x3ae5('0x62')][_0x3ae5('0x1f')]({'where':_0x1c5bc2[_0x3ae5('0x3d')]})[_0x3ae5('0x25')](function(_0x8277bf){_0x1c8578[_0x3ae5('0x1f')]=_0x8277bf;if(_0x31e5e8[_0x3ae5('0x35')][_0x3ae5('0x4b')]){_0x1c5bc2[_0x3ae5('0x44')]=[{'all':!![]}];}return db[_0x3ae5('0x62')][_0x3ae5('0x45')](_0x1c5bc2);})[_0x3ae5('0x25')](function(_0x46f305){_0x1c8578[_0x3ae5('0x46')]=_0x46f305;return _0x1c8578;});}})[_0x3ae5('0x25')](respondWithFilteredResult(_0x921120,_0x1c5bc2))[_0x3ae5('0x47')](handleError(_0x921120,null));};exports[_0x3ae5('0x63')]=function(_0x303c70,_0x752a42,_0x50b098){var _0x1f61f1={'raw':!![],'where':{}};var _0xf2af63={};var _0x554c5c={'count':0x0,'rows':[]};return db['Campaign'][_0x3ae5('0x5a')]({'where':{'id':_0x303c70['params']['id']}})['then'](handleEntityNotFound(_0x752a42,null))[_0x3ae5('0x25')](function(_0x553064){if(_0x553064){_0xf2af63['model']=_['keys'](db[_0x3ae5('0x64')]['rawAttributes']);_0xf2af63[_0x3ae5('0x35')]=_[_0x3ae5('0x4a')](_0x303c70['query']);_0xf2af63[_0x3ae5('0x36')]=_['intersection'](_0xf2af63[_0x3ae5('0x34')],_0xf2af63[_0x3ae5('0x35')]);_0x1f61f1[_0x3ae5('0x39')]=_['intersection'](_0xf2af63[_0x3ae5('0x34')],qs[_0x3ae5('0x38')](_0x303c70[_0x3ae5('0x35')][_0x3ae5('0x38')]));_0x1f61f1[_0x3ae5('0x39')]=_0x1f61f1[_0x3ae5('0x39')][_0x3ae5('0x3a')]?_0x1f61f1[_0x3ae5('0x39')]:_0xf2af63[_0x3ae5('0x34')];if(!_0x303c70[_0x3ae5('0x35')][_0x3ae5('0x3b')](_0x3ae5('0x60'))){_0x1f61f1[_0x3ae5('0x1e')]=qs[_0x3ae5('0x1e')](_0x303c70[_0x3ae5('0x35')]['limit']);_0x1f61f1[_0x3ae5('0x1c')]=qs[_0x3ae5('0x1c')](_0x303c70[_0x3ae5('0x35')][_0x3ae5('0x1c')]);}_0x1f61f1[_0x3ae5('0x5c')]=qs[_0x3ae5('0x3c')](_0x303c70[_0x3ae5('0x35')]['sort']);_0x1f61f1['where']=qs['filters'](_[_0x3ae5('0x3e')](_0x303c70[_0x3ae5('0x35')],_0xf2af63[_0x3ae5('0x36')]));_0x1f61f1[_0x3ae5('0x3d')][_0x3ae5('0x5d')]=_0x553064['id'];if(_0x303c70[_0x3ae5('0x35')][_0x3ae5('0x3f')]){_0x1f61f1[_0x3ae5('0x3d')]=_[_0x3ae5('0x41')](_0x1f61f1[_0x3ae5('0x3d')],{'$or':_[_0x3ae5('0x2f')](_0x1f61f1[_0x3ae5('0x39')],function(_0x4812b1){var _0x59dc8f={};_0x59dc8f[_0x4812b1]={'$like':'%'+_0x303c70['query'][_0x3ae5('0x3f')]+'%'};return _0x59dc8f;})});}_0x1f61f1=_[_0x3ae5('0x41')]({},_0x1f61f1,_0x303c70[_0x3ae5('0x42')]);return db[_0x3ae5('0x64')][_0x3ae5('0x1f')]({'where':_0x1f61f1[_0x3ae5('0x3d')]})['then'](function(_0x30474b){_0x554c5c['count']=_0x30474b;if(_0x303c70[_0x3ae5('0x35')][_0x3ae5('0x4b')]){_0x1f61f1['include']=[{'all':!![]}];}return db[_0x3ae5('0x64')][_0x3ae5('0x45')](_0x1f61f1);})[_0x3ae5('0x25')](function(_0x5c7a2a){_0x554c5c['rows']=_0x5c7a2a;return _0x554c5c;});}})[_0x3ae5('0x25')](respondWithFilteredResult(_0x752a42,_0x1f61f1))[_0x3ae5('0x47')](handleError(_0x752a42,null));};exports['getLists']=function(_0x20d98e,_0x3b01b7,_0x1cb770){var _0x58edb0={};var _0x3c14a3={};var _0x382b14;var _0x12b4e8;return db['Campaign']['findOne']({'where':{'id':_0x20d98e[_0x3ae5('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b01b7,null))[_0x3ae5('0x25')](function(_0x2acd6e){if(_0x2acd6e){_0x382b14=_0x2acd6e;_0x3c14a3['model']=_[_0x3ae5('0x4a')](db[_0x3ae5('0x65')][_0x3ae5('0x30')]);_0x3c14a3[_0x3ae5('0x35')]=_[_0x3ae5('0x4a')](_0x20d98e[_0x3ae5('0x35')]);_0x3c14a3[_0x3ae5('0x36')]=_[_0x3ae5('0x37')](_0x3c14a3[_0x3ae5('0x34')],_0x3c14a3[_0x3ae5('0x35')]);_0x58edb0['attributes']=_[_0x3ae5('0x37')](_0x3c14a3['model'],qs[_0x3ae5('0x38')](_0x20d98e['query'][_0x3ae5('0x38')]));_0x58edb0[_0x3ae5('0x39')]=_0x58edb0[_0x3ae5('0x39')][_0x3ae5('0x3a')]?_0x58edb0[_0x3ae5('0x39')]:_0x3c14a3[_0x3ae5('0x34')];_0x58edb0['order']=qs['sort'](_0x20d98e[_0x3ae5('0x35')][_0x3ae5('0x3c')]);_0x58edb0[_0x3ae5('0x3d')]=qs[_0x3ae5('0x36')](_[_0x3ae5('0x3e')](_0x20d98e[_0x3ae5('0x35')],_0x3c14a3[_0x3ae5('0x36')]));if(_0x20d98e['query'][_0x3ae5('0x3f')]){_0x58edb0[_0x3ae5('0x3d')]=_['merge'](_0x58edb0['where'],{'$or':_[_0x3ae5('0x2f')](_0x58edb0[_0x3ae5('0x39')],function(_0x186af0){var _0x254c39={};_0x254c39[_0x186af0]={'$like':'%'+_0x20d98e[_0x3ae5('0x35')][_0x3ae5('0x3f')]+'%'};return _0x254c39;})});}_0x58edb0=_[_0x3ae5('0x41')]({},_0x58edb0,_0x20d98e[_0x3ae5('0x42')]);return _0x382b14['getLists'](_0x58edb0);}})[_0x3ae5('0x25')](function(_0x158663){if(_0x158663){_0x12b4e8=_0x158663[_0x3ae5('0x3a')];if(!_0x20d98e['query'][_0x3ae5('0x3b')](_0x3ae5('0x60'))){_0x58edb0['limit']=qs['limit'](_0x20d98e[_0x3ae5('0x35')][_0x3ae5('0x1e')]);_0x58edb0[_0x3ae5('0x1c')]=qs['offset'](_0x20d98e[_0x3ae5('0x35')][_0x3ae5('0x1c')]);}return _0x382b14['getLists'](_0x58edb0);}})[_0x3ae5('0x25')](function(_0xd57790){if(_0xd57790){return _0xd57790?{'count':_0x12b4e8,'rows':_0xd57790}:null;}})[_0x3ae5('0x25')](respondWithResult(_0x3b01b7,null))[_0x3ae5('0x47')](handleError(_0x3b01b7,null));};exports[_0x3ae5('0x66')]=function(_0x2bfb90,_0x495e7b,_0x4f6d62){var _0x523de7,_0x274b06;var _0x308320=[];var _0x3c2e15=moment()[_0x3ae5('0x67')](_0x3ae5('0x68'));return db[_0x3ae5('0x43')][_0x3ae5('0x4c')]({'where':{'id':_0x2bfb90[_0x3ae5('0x49')]['id']}})[_0x3ae5('0x25')](handleEntityNotFound(_0x495e7b,null))[_0x3ae5('0x25')](function(_0x20b106){if(_0x20b106){_0x274b06=_0x20b106;return _0x20b106[_0x3ae5('0x66')](_0x2bfb90['body'][_0x3ae5('0x69')],_['omit'](_0x2bfb90[_0x3ae5('0x4e')],[_0x3ae5('0x69'),'id'])||{});}return null;})[_0x3ae5('0x6a')](function(_0x3e695a){var _0x10b140;var _0x5c0c77;_0x523de7=_0x3e695a||[];var _0x2cda61=[];if(_0x3e695a){for(var _0x361eab=0x0;_0x361eab<_0x3e695a[_0x3ae5('0x3a')];_0x361eab+=0x1){var _0x52d23a=_0x3e695a[_0x361eab][_0x3ae5('0x27')]({'plain':!![]});_0x274b06[_0x3ae5('0x6b')]=_0x2bfb90[_0x3ae5('0x4e')][_0x3ae5('0x6b')]?_0x2bfb90['body'][_0x3ae5('0x6b')]:_0x274b06[_0x3ae5('0x6b')];switch(_0x274b06[_0x3ae5('0x6b')]){case _0x3ae5('0x6c'):_0x10b140=squel[_0x3ae5('0x6d')]()[_0x3ae5('0x6e')]('cm_hopper')[_0x3ae5('0x6f')](['phone','scheduledAt',_0x3ae5('0x70'),_0x3ae5('0x71'),_0x3ae5('0x5d'),_0x3ae5('0x53'),_0x3ae5('0x54')],squel[_0x3ae5('0x72')]()[_0x3ae5('0x73')](_0x3ae5('0x74'),_0x3ae5('0x74'))['field']('NOW()',_0x3ae5('0x75'))[_0x3ae5('0x73')]('id',_0x3ae5('0x70'))['field'](_0x52d23a[_0x3ae5('0x76')][_0x3ae5('0x77')](),'ListId')[_0x3ae5('0x73')](_0x2bfb90[_0x3ae5('0x49')]['id'][_0x3ae5('0x77')](),'CampaignId')[_0x3ae5('0x73')]('\x27'+_0x3c2e15+'\x27',_0x3ae5('0x53'))[_0x3ae5('0x73')]('\x27'+_0x3c2e15+'\x27','updatedAt')[_0x3ae5('0x78')]('cm_contacts')[_0x3ae5('0x3d')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x52d23a[_0x3ae5('0x76')][_0x3ae5('0x77')]())[_0x3ae5('0x3d')](_0x3ae5('0x79'))[_0x3ae5('0x3d')](_0x3ae5('0x7a'),squel[_0x3ae5('0x72')]()[_0x3ae5('0x73')](_0x3ae5('0x7b'))[_0x3ae5('0x78')]('cm_hopper_final')[_0x3ae5('0x3d')]('CampaignId\x20=\x20?',_0x2bfb90[_0x3ae5('0x49')]['id'][_0x3ae5('0x77')]()))[_0x3ae5('0x3d')](_0x3ae5('0x7a'),squel[_0x3ae5('0x72')]()[_0x3ae5('0x73')](_0x3ae5('0x7c'))['from'](_0x3ae5('0x7d'))['where'](_0x3ae5('0x7e'),_0x2bfb90[_0x3ae5('0x49')]['id'][_0x3ae5('0x77')]())))[_0x3ae5('0x77')]();break;case _0x3ae5('0x7f'):_0x10b140=squel[_0x3ae5('0x6d')]()[_0x3ae5('0x6e')]('cm_hopper')[_0x3ae5('0x6f')]([_0x3ae5('0x74'),'scheduledAt','ContactId',_0x3ae5('0x71'),'CampaignId',_0x3ae5('0x53'),_0x3ae5('0x54')],squel[_0x3ae5('0x72')]()[_0x3ae5('0x73')](_0x3ae5('0x74'),_0x3ae5('0x74'))[_0x3ae5('0x73')](_0x3ae5('0x80'),'scheduledAt')[_0x3ae5('0x73')]('id',_0x3ae5('0x70'))['field'](_0x52d23a[_0x3ae5('0x76')][_0x3ae5('0x77')](),'ListId')['field'](_0x2bfb90['params']['id'][_0x3ae5('0x77')](),_0x3ae5('0x5d'))['field']('\x27'+_0x3c2e15+'\x27','createdAt')['field']('\x27'+_0x3c2e15+'\x27','updatedAt')['from'](_0x3ae5('0x81'))['where'](_0x3ae5('0x82'))[_0x3ae5('0x3d')](_0x3ae5('0x83'),_0x52d23a['CmListId'][_0x3ae5('0x77')]())[_0x3ae5('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x3ae5('0x3d')](_0x3ae5('0x7a'),squel[_0x3ae5('0x72')]()[_0x3ae5('0x73')](_0x3ae5('0x7c'))[_0x3ae5('0x78')](_0x3ae5('0x7d'))[_0x3ae5('0x3d')](_0x3ae5('0x7e'),_0x2bfb90[_0x3ae5('0x49')]['id'][_0x3ae5('0x77')]())))[_0x3ae5('0x77')]();break;default:_0x10b140=squel[_0x3ae5('0x6d')]()[_0x3ae5('0x6e')](_0x3ae5('0x7d'))[_0x3ae5('0x6f')]([_0x3ae5('0x74'),'scheduledAt','ContactId',_0x3ae5('0x71'),_0x3ae5('0x5d'),'createdAt',_0x3ae5('0x54')],squel['select']()[_0x3ae5('0x73')]('phone',_0x3ae5('0x74'))['field'](_0x3ae5('0x80'),_0x3ae5('0x75'))[_0x3ae5('0x73')]('id',_0x3ae5('0x70'))[_0x3ae5('0x73')](_0x52d23a[_0x3ae5('0x76')]['toString'](),_0x3ae5('0x71'))[_0x3ae5('0x73')](_0x2bfb90[_0x3ae5('0x49')]['id'][_0x3ae5('0x77')](),'CampaignId')['field']('\x27'+_0x3c2e15+'\x27','createdAt')[_0x3ae5('0x73')]('\x27'+_0x3c2e15+'\x27',_0x3ae5('0x54'))[_0x3ae5('0x78')](_0x3ae5('0x81'))[_0x3ae5('0x3d')]('deletedAt\x20IS\x20NULL')[_0x3ae5('0x3d')]('ListId\x20=\x20?',_0x52d23a[_0x3ae5('0x76')][_0x3ae5('0x77')]())[_0x3ae5('0x3d')](_0x3ae5('0x79')))[_0x3ae5('0x77')]();}_0x5c0c77=squel['insert']()[_0x3ae5('0x6e')](_0x3ae5('0x84'))['fromQuery']([_0x3ae5('0x85'),_0x3ae5('0x75'),_0x3ae5('0x74'),_0x3ae5('0x86'),_0x3ae5('0x53'),'updatedAt'],squel[_0x3ae5('0x72')]()[_0x3ae5('0x73')](_0x3ae5('0x87'),'id')[_0x3ae5('0x73')](_0x3ae5('0x80'),_0x3ae5('0x75'))[_0x3ae5('0x73')]('ci.item','phone')[_0x3ae5('0x73')](_0x3ae5('0x88'),'OrderBy')[_0x3ae5('0x73')]('\x27'+_0x3c2e15+'\x27','createdAt')[_0x3ae5('0x73')]('\x27'+_0x3c2e15+'\x27','updatedAt')[_0x3ae5('0x78')](_0x3ae5('0x89'),'ci')['join']('cm_hopper','h',_0x3ae5('0x8a'))[_0x3ae5('0x3d')](_0x3ae5('0x8b'),_0x52d23a[_0x3ae5('0x76')]['toString']())['where'](_0x3ae5('0x8c'),_0x2bfb90[_0x3ae5('0x49')]['id'][_0x3ae5('0x77')]())[_0x3ae5('0x3d')]('h.createdAt\x20=\x20?',_0x3c2e15))['toString']();_0x2cda61['push'](db[_0x3ae5('0x8d')][_0x3ae5('0x35')](_0x10b140));_0x308320['push'](db[_0x3ae5('0x8d')][_0x3ae5('0x35')](_0x5c0c77));}return BPromise[_0x3ae5('0x8e')](_0x2cda61);}})['then'](function(){return BPromise['all'](_0x308320);})['then'](function(){return _0x523de7;})[_0x3ae5('0x25')](respondWithResult(_0x495e7b,null))['catch'](handleError(_0x495e7b,null));};exports['removeLists']=function(_0x31c0e6,_0x59c887,_0x5484d5){return db[_0x3ae5('0x43')][_0x3ae5('0x4c')]({'where':{'id':_0x31c0e6[_0x3ae5('0x49')]['id']}})[_0x3ae5('0x25')](handleEntityNotFound(_0x59c887,null))[_0x3ae5('0x25')](function(_0xbedaeb){if(_0xbedaeb){return _0xbedaeb[_0x3ae5('0x8f')](_0x31c0e6['query'][_0x3ae5('0x69')]);}})[_0x3ae5('0x25')](function(_0x447a30){if(_0x447a30){return db[_0x3ae5('0x5b')][_0x3ae5('0x26')]({'where':{'ListId':_0x31c0e6[_0x3ae5('0x35')][_0x3ae5('0x69')],'CampaignId':_0x31c0e6['params']['id']}})['then'](function(){return _0x447a30;});}})[_0x3ae5('0x25')](respondWithStatusCode(_0x59c887,null))[_0x3ae5('0x47')](handleError(_0x59c887,null));};exports[_0x3ae5('0x90')]=function(_0x436438,_0x17b7af,_0x43c9b4){var _0xee5584={};var _0x63f301={};var _0x8dd17c;var _0x40af3d;return db[_0x3ae5('0x43')][_0x3ae5('0x5a')]({'where':{'id':_0x436438[_0x3ae5('0x49')]['id']}})[_0x3ae5('0x25')](handleEntityNotFound(_0x17b7af,null))['then'](function(_0x3cd978){if(_0x3cd978){_0x8dd17c=_0x3cd978;_0x63f301[_0x3ae5('0x34')]=_[_0x3ae5('0x4a')](db['CmList'][_0x3ae5('0x30')]);_0x63f301['query']=_[_0x3ae5('0x4a')](_0x436438[_0x3ae5('0x35')]);_0x63f301[_0x3ae5('0x36')]=_[_0x3ae5('0x37')](_0x63f301[_0x3ae5('0x34')],_0x63f301[_0x3ae5('0x35')]);_0xee5584['attributes']=_['intersection'](_0x63f301[_0x3ae5('0x34')],qs['fields'](_0x436438[_0x3ae5('0x35')][_0x3ae5('0x38')]));_0xee5584[_0x3ae5('0x39')]=_0xee5584[_0x3ae5('0x39')]['length']?_0xee5584[_0x3ae5('0x39')]:_0x63f301[_0x3ae5('0x34')];_0xee5584[_0x3ae5('0x5c')]=qs[_0x3ae5('0x3c')](_0x436438['query'][_0x3ae5('0x3c')]);_0xee5584[_0x3ae5('0x3d')]=qs['filters'](_[_0x3ae5('0x3e')](_0x436438[_0x3ae5('0x35')],_0x63f301[_0x3ae5('0x36')]));if(_0x436438[_0x3ae5('0x35')]['filter']){_0xee5584[_0x3ae5('0x3d')]=_[_0x3ae5('0x41')](_0xee5584[_0x3ae5('0x3d')],{'$or':_['map'](_0xee5584[_0x3ae5('0x39')],function(_0x2262e8){var _0x12bb54={};_0x12bb54[_0x2262e8]={'$like':'%'+_0x436438['query'][_0x3ae5('0x3f')]+'%'};return _0x12bb54;})});}_0xee5584=_[_0x3ae5('0x41')]({},_0xee5584,_0x436438[_0x3ae5('0x42')]);return _0x8dd17c[_0x3ae5('0x90')](_0xee5584);}})[_0x3ae5('0x25')](function(_0x99f3a4){if(_0x99f3a4){_0x40af3d=_0x99f3a4[_0x3ae5('0x3a')];if(!_0x436438[_0x3ae5('0x35')][_0x3ae5('0x3b')](_0x3ae5('0x60'))){_0xee5584['limit']=qs[_0x3ae5('0x1e')](_0x436438[_0x3ae5('0x35')][_0x3ae5('0x1e')]);_0xee5584[_0x3ae5('0x1c')]=qs['offset'](_0x436438[_0x3ae5('0x35')][_0x3ae5('0x1c')]);}return _0x8dd17c[_0x3ae5('0x90')](_0xee5584);}})['then'](function(_0x26d6ba){if(_0x26d6ba){return _0x26d6ba?{'count':_0x40af3d,'rows':_0x26d6ba}:null;}})[_0x3ae5('0x25')](respondWithResult(_0x17b7af,null))[_0x3ae5('0x47')](handleError(_0x17b7af,null));};exports[_0x3ae5('0x91')]=function(_0x38be53,_0x30f1fe,_0x498afd){var _0x4ba842,_0x5126cf;var _0x453d24=[];var _0x43658d=moment()['format'](_0x3ae5('0x68'));return db[_0x3ae5('0x43')][_0x3ae5('0x4c')]({'where':{'id':_0x38be53[_0x3ae5('0x49')]['id']}})[_0x3ae5('0x25')](handleEntityNotFound(_0x30f1fe,null))['then'](function(_0x4d8576){if(_0x4d8576){_0x5126cf=_0x4d8576;return _0x4d8576[_0x3ae5('0x91')](_0x38be53[_0x3ae5('0x4e')]['ids'],_[_0x3ae5('0x55')](_0x38be53[_0x3ae5('0x4e')],[_0x3ae5('0x69'),'id'])||{});}return null;})[_0x3ae5('0x6a')](function(_0x3cb779){var _0x214a2f;var _0x35b11e;_0x4ba842=_0x3cb779||[];var _0x4404dd=[];if(_0x3cb779){for(var _0x28ee14=0x0;_0x28ee14<_0x3cb779[_0x3ae5('0x3a')];_0x28ee14+=0x1){var _0x3fcd7f=_0x3cb779[_0x28ee14]['get']({'plain':!![]});_0x214a2f=squel[_0x3ae5('0x6d')]()[_0x3ae5('0x6e')](_0x3ae5('0x92'))[_0x3ae5('0x6f')]([_0x3ae5('0x74'),_0x3ae5('0x70'),_0x3ae5('0x71'),_0x3ae5('0x5d'),'createdAt',_0x3ae5('0x54')],squel['select']()['field']('phone',_0x3ae5('0x74'))[_0x3ae5('0x73')]('id','ContactId')['field'](_0x3fcd7f[_0x3ae5('0x76')][_0x3ae5('0x77')](),_0x3ae5('0x71'))[_0x3ae5('0x73')](_0x38be53[_0x3ae5('0x49')]['id'][_0x3ae5('0x77')](),_0x3ae5('0x5d'))[_0x3ae5('0x73')](_0x3ae5('0x80'),_0x3ae5('0x53'))['field']('NOW()','updatedAt')[_0x3ae5('0x78')](_0x3ae5('0x81'))[_0x3ae5('0x3d')](_0x3ae5('0x82'))[_0x3ae5('0x3d')]('ListId\x20=\x20?',_0x3fcd7f[_0x3ae5('0x76')][_0x3ae5('0x77')]())[_0x3ae5('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x3ae5('0x77')]();_0x4404dd['push'](db[_0x3ae5('0x8d')]['query'](_0x214a2f));}return BPromise['all'](_0x4404dd);}})[_0x3ae5('0x25')](function(){return _0x4ba842;})[_0x3ae5('0x25')](respondWithResult(_0x30f1fe,null))[_0x3ae5('0x47')](handleError(_0x30f1fe,null));};exports[_0x3ae5('0x93')]=function(_0x41e2e2,_0x133d14,_0x1342b3){return db['Campaign']['find']({'where':{'id':_0x41e2e2[_0x3ae5('0x49')]['id']}})[_0x3ae5('0x25')](handleEntityNotFound(_0x133d14,null))[_0x3ae5('0x25')](function(_0x2b3b15){if(_0x2b3b15){return _0x2b3b15['removeBlackLists'](_0x41e2e2['query']['ids']);}})[_0x3ae5('0x25')](function(_0x3d3bdf){if(_0x3d3bdf){return db[_0x3ae5('0x64')][_0x3ae5('0x26')]({'where':{'ListId':_0x41e2e2[_0x3ae5('0x35')][_0x3ae5('0x69')],'CampaignId':_0x41e2e2[_0x3ae5('0x49')]['id']}})[_0x3ae5('0x25')](function(){return _0x3d3bdf;});}})[_0x3ae5('0x25')](respondWithStatusCode(_0x133d14,null))['catch'](handleError(_0x133d14,null));};
\ No newline at end of file
+var _0xc584=['cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','sequelize','push','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','all','removeBlackLists','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','filters','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','getHoppers','findOne','CmHopper','sort','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','pick','CmHopperBlack','getLists','addLists','format','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','field','phone','NOW()','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ListId\x20=\x20?'];(function(_0x4e061e,_0x2c72e9){var _0xda83dc=function(_0x1fc8de){while(--_0x1fc8de){_0x4e061e['push'](_0x4e061e['shift']());}};_0xda83dc(++_0x2c72e9);}(_0xc584,0xa8));var _0x4c58=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0xc584[_0x1e7ead];return _0x3912b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c58('0x0'));var zipdir=require(_0x4c58('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4c58('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4c58('0x3'));var util=require(_0x4c58('0x4'));var path=require(_0x4c58('0x5'));var sox=require('sox');var csv=require(_0x4c58('0x6'));var ejs=require(_0x4c58('0x7'));var fs=require('fs');var fs_extra=require(_0x4c58('0x8'));var _=require(_0x4c58('0x9'));var squel=require(_0x4c58('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4c58('0x6'));var querystring=require(_0x4c58('0xb'));var Papa=require(_0x4c58('0xc'));var Redis=require(_0x4c58('0xd'));var authService=require(_0x4c58('0xe'));var qs=require(_0x4c58('0xf'));var as=require(_0x4c58('0x10'));var hardwareService=require(_0x4c58('0x11'));var logger=require(_0x4c58('0x12'))(_0x4c58('0x13'));var utils=require(_0x4c58('0x14'));var config=require(_0x4c58('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28f052,_0x4c17de){_0x4c17de=_0x4c17de||0xcc;return function(_0x821dba){if(_0x821dba){return _0x28f052[_0x4c58('0x16')](_0x4c17de);}return _0x28f052[_0x4c58('0x17')](_0x4c17de)[_0x4c58('0x18')]();};}function respondWithResult(_0x308372,_0x442bf9){_0x442bf9=_0x442bf9||0xc8;return function(_0x5a9e76){if(_0x5a9e76){return _0x308372[_0x4c58('0x17')](_0x442bf9)['json'](_0x5a9e76);}};}function respondWithFilteredResult(_0x4fa114,_0x5990c3){return function(_0x1831e4){if(_0x1831e4){var _0x14af92=typeof _0x5990c3[_0x4c58('0x19')]===_0x4c58('0x1a')&&typeof _0x5990c3['limit']===_0x4c58('0x1a');var _0x26db37=_0x1831e4[_0x4c58('0x1b')];var _0x1dc590=_0x14af92?0x0:_0x5990c3[_0x4c58('0x19')];var _0x4b72cc=_0x14af92?_0x1831e4[_0x4c58('0x1b')]:_0x5990c3[_0x4c58('0x19')]+_0x5990c3['limit'];var _0x26631e;if(_0x4b72cc>=_0x26db37){_0x4b72cc=_0x26db37;_0x26631e=0xc8;}else{_0x26631e=0xce;}_0x4fa114[_0x4c58('0x17')](_0x26631e);return _0x4fa114[_0x4c58('0x1c')](_0x4c58('0x1d'),_0x1dc590+'-'+_0x4b72cc+'/'+_0x26db37)[_0x4c58('0x1e')](_0x1831e4);}return null;};}function patchUpdates(_0x46876f){return function(_0x5793d2){try{jsonpatch[_0x4c58('0x1f')](_0x5793d2,_0x46876f,!![]);}catch(_0x408e30){return BPromise[_0x4c58('0x20')](_0x408e30);}return _0x5793d2[_0x4c58('0x21')]();};}function saveUpdates(_0xdd2d81,_0x4f189f){return function(_0x101d23){if(_0x101d23){return _0x101d23['update'](_0xdd2d81)[_0x4c58('0x22')](function(_0x368034){return _0x368034;});}return null;};}function removeEntity(_0x53ab2d,_0x3062fb){return function(_0x386c98){if(_0x386c98){return _0x386c98[_0x4c58('0x23')]()['then'](function(){var _0x159bf8=_0x386c98[_0x4c58('0x24')]({'plain':!![]});var _0x3f7de6=_0x4c58('0x25');return db[_0x4c58('0x26')]['destroy']({'where':{'type':_0x3f7de6,'resourceId':_0x159bf8['id']}})[_0x4c58('0x22')](function(){return _0x386c98;});})[_0x4c58('0x22')](function(){_0x53ab2d[_0x4c58('0x17')](0xcc)[_0x4c58('0x18')]();});}};}function handleEntityNotFound(_0x317409,_0x15efd1){return function(_0x38b2de){if(!_0x38b2de){_0x317409[_0x4c58('0x16')](0x194);}return _0x38b2de;};}function handleError(_0x5b5b4e,_0x33a731){_0x33a731=_0x33a731||0x1f4;return function(_0x10b72c){logger[_0x4c58('0x27')](_0x10b72c[_0x4c58('0x28')]);if(_0x10b72c[_0x4c58('0x29')]){delete _0x10b72c[_0x4c58('0x29')];}_0x5b5b4e[_0x4c58('0x17')](_0x33a731)[_0x4c58('0x2a')](_0x10b72c);};}exports[_0x4c58('0x2b')]=function(_0x437975,_0x13cf99){var _0x3c08a7={},_0x3ec02a={},_0x440ee4={'count':0x0,'rows':[]};var _0x1531f1=_[_0x4c58('0x2c')](db[_0x4c58('0x2d')][_0x4c58('0x2e')],function(_0x55fbf8){return{'name':_0x55fbf8['fieldName'],'type':_0x55fbf8['type'][_0x4c58('0x2f')]};});_0x3ec02a['model']=_[_0x4c58('0x2c')](_0x1531f1,'name');_0x3ec02a[_0x4c58('0x30')]=_[_0x4c58('0x31')](_0x437975[_0x4c58('0x30')]);_0x3ec02a['filters']=_[_0x4c58('0x32')](_0x3ec02a[_0x4c58('0x33')],_0x3ec02a[_0x4c58('0x30')]);_0x3c08a7[_0x4c58('0x34')]=_[_0x4c58('0x32')](_0x3ec02a[_0x4c58('0x33')],qs[_0x4c58('0x35')](_0x437975[_0x4c58('0x30')]['fields']));_0x3c08a7['attributes']=_0x3c08a7['attributes'][_0x4c58('0x36')]?_0x3c08a7[_0x4c58('0x34')]:_0x3ec02a[_0x4c58('0x33')];if(!_0x437975['query'][_0x4c58('0x37')](_0x4c58('0x38'))){_0x3c08a7[_0x4c58('0x39')]=qs[_0x4c58('0x39')](_0x437975['query'][_0x4c58('0x39')]);_0x3c08a7[_0x4c58('0x19')]=qs[_0x4c58('0x19')](_0x437975[_0x4c58('0x30')][_0x4c58('0x19')]);}_0x3c08a7[_0x4c58('0x3a')]=qs['sort'](_0x437975[_0x4c58('0x30')]['sort']);_0x3c08a7['where']=qs[_0x4c58('0x3b')](_['pick'](_0x437975[_0x4c58('0x30')],_0x3ec02a[_0x4c58('0x3b')]),_0x1531f1);if(_0x437975[_0x4c58('0x30')][_0x4c58('0x3c')]){_0x3c08a7[_0x4c58('0x3d')]=_['merge'](_0x3c08a7[_0x4c58('0x3d')],{'$or':_[_0x4c58('0x2c')](_0x1531f1,function(_0x511cfd){if(_0x511cfd['type']!==_0x4c58('0x3e')){var _0xb59516={};_0xb59516[_0x511cfd[_0x4c58('0x29')]]={'$like':'%'+_0x437975['query']['filter']+'%'};return _0xb59516;}})});}_0x3c08a7=_['merge']({},_0x3c08a7,_0x437975[_0x4c58('0x3f')]);var _0x5797ae={'where':_0x3c08a7[_0x4c58('0x3d')]};return db['Campaign'][_0x4c58('0x1b')](_0x5797ae)[_0x4c58('0x22')](function(_0x3b74b4){_0x440ee4[_0x4c58('0x1b')]=_0x3b74b4;if(_0x437975[_0x4c58('0x30')][_0x4c58('0x40')]){_0x3c08a7[_0x4c58('0x41')]=[{'all':!![]}];}return db[_0x4c58('0x2d')][_0x4c58('0x42')](_0x3c08a7);})[_0x4c58('0x22')](function(_0x1f8d23){_0x440ee4[_0x4c58('0x43')]=_0x1f8d23;return _0x440ee4;})[_0x4c58('0x22')](respondWithFilteredResult(_0x13cf99,_0x3c08a7))[_0x4c58('0x44')](handleError(_0x13cf99,null));};exports[_0x4c58('0x45')]=function(_0x41c8ab,_0x5c1653){var _0x5d19a0={'raw':![],'where':{'id':_0x41c8ab[_0x4c58('0x46')]['id']}},_0x54ff5d={};_0x54ff5d['model']=_['keys'](db['Campaign'][_0x4c58('0x2e')]);_0x54ff5d[_0x4c58('0x30')]=_[_0x4c58('0x31')](_0x41c8ab[_0x4c58('0x30')]);_0x54ff5d[_0x4c58('0x3b')]=_['intersection'](_0x54ff5d[_0x4c58('0x33')],_0x54ff5d['query']);_0x5d19a0['attributes']=_[_0x4c58('0x32')](_0x54ff5d['model'],qs[_0x4c58('0x35')](_0x41c8ab[_0x4c58('0x30')][_0x4c58('0x35')]));_0x5d19a0['attributes']=_0x5d19a0['attributes']['length']?_0x5d19a0[_0x4c58('0x34')]:_0x54ff5d['model'];if(_0x41c8ab['query'][_0x4c58('0x40')]){_0x5d19a0['include']=[{'all':!![]}];}_0x5d19a0=_[_0x4c58('0x47')]({},_0x5d19a0,_0x41c8ab['options']);return db[_0x4c58('0x2d')]['find'](_0x5d19a0)[_0x4c58('0x22')](handleEntityNotFound(_0x5c1653,null))['then'](respondWithResult(_0x5c1653,null))[_0x4c58('0x44')](handleError(_0x5c1653,null));};exports[_0x4c58('0x48')]=function(_0x47f744,_0x32ad34){return db[_0x4c58('0x2d')]['create'](_0x47f744[_0x4c58('0x49')],{})[_0x4c58('0x22')](function(_0x2ed13b){var _0x465ca3=_0x47f744[_0x4c58('0x4a')][_0x4c58('0x24')]({'plain':!![]});if(!_0x465ca3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x465ca3[_0x4c58('0x4b')]===_0x4c58('0x4a')){var _0x31483f=_0x2ed13b[_0x4c58('0x24')]({'plain':!![]});var _0x374094='IvrCampaigns';return db[_0x4c58('0x4c')][_0x4c58('0x4d')]({'where':{'name':_0x374094,'userProfileId':_0x465ca3[_0x4c58('0x4e')]},'raw':!![]})['then'](function(_0x57c30d){if(_0x57c30d&&_0x57c30d[_0x4c58('0x4f')]===0x0){return db[_0x4c58('0x26')][_0x4c58('0x48')]({'name':_0x31483f['name'],'resourceId':_0x31483f['id'],'type':_0x57c30d[_0x4c58('0x29')],'sectionId':_0x57c30d['id']},{})[_0x4c58('0x22')](function(){return _0x2ed13b;});}else{return _0x2ed13b;}})['catch'](function(_0x5e89f6){logger['error'](_0x4c58('0x50'),_0x5e89f6);throw _0x5e89f6;});}return _0x2ed13b;})[_0x4c58('0x22')](respondWithResult(_0x32ad34,0xc9))[_0x4c58('0x44')](handleError(_0x32ad34,null));};exports[_0x4c58('0x51')]=function(_0x1a8bb4,_0x1fe254){var _0x3db6d6={'where':{'id':_0x1a8bb4['params']['id']}},_0x3c9319={};_0x3c9319[_0x4c58('0x33')]=_[_0x4c58('0x31')](db[_0x4c58('0x2d')][_0x4c58('0x2e')]);_0x3db6d6['attributes']=_['intersection'](_0x3c9319[_0x4c58('0x33')],qs[_0x4c58('0x35')](_0x1a8bb4['query'][_0x4c58('0x35')]));_0x3db6d6[_0x4c58('0x34')]=_0x3db6d6['attributes'][_0x4c58('0x36')]?_0x3db6d6['attributes']:_0x3c9319[_0x4c58('0x33')];if(_0x1a8bb4[_0x4c58('0x30')][_0x4c58('0x40')]){_0x3db6d6[_0x4c58('0x41')]=[{'all':!![]}];}_0x3db6d6=_[_0x4c58('0x47')]({},_0x3db6d6,_0x1a8bb4[_0x4c58('0x3f')]);return db[_0x4c58('0x2d')][_0x4c58('0x4d')](_0x3db6d6)['then'](handleEntityNotFound(_0x1fe254,null))['then'](function(_0x56ac40){if(_0x56ac40){var _0x545568=_0x56ac40[_0x4c58('0x24')]({'plain':!![]});_0x545568=qs[_0x4c58('0x52')](_0x545568,['id','createdAt',_0x4c58('0x53')]);_0x1a8bb4['body']=_[_0x4c58('0x52')](_0x1a8bb4[_0x4c58('0x49')],['id',_0x4c58('0x54'),_0x4c58('0x53')]);return db['Campaign'][_0x4c58('0x48')](_[_0x4c58('0x47')](_0x545568,_0x1a8bb4[_0x4c58('0x49')]),{'include':_0x1a8bb4[_0x4c58('0x30')][_0x4c58('0x40')]?[{'all':!![]}]:undefined})[_0x4c58('0x22')](function(_0x2b1b70){var _0x312bfd=_0x1a8bb4[_0x4c58('0x4a')]['get']({'plain':!![]});if(!_0x312bfd)throw new Error(_0x4c58('0x55'));if(_0x312bfd[_0x4c58('0x4b')]===_0x4c58('0x4a')){var _0x537054=_0x2b1b70[_0x4c58('0x24')]({'plain':!![]});var _0x3bce6e=_0x4c58('0x25');return db[_0x4c58('0x4c')][_0x4c58('0x4d')]({'where':{'name':_0x3bce6e,'userProfileId':_0x312bfd[_0x4c58('0x4e')]},'raw':!![]})[_0x4c58('0x22')](function(_0xe509e2){if(_0xe509e2&&_0xe509e2[_0x4c58('0x4f')]===0x0){return db[_0x4c58('0x26')][_0x4c58('0x48')]({'name':_0x537054[_0x4c58('0x29')],'resourceId':_0x537054['id'],'type':_0xe509e2[_0x4c58('0x29')],'sectionId':_0xe509e2['id']},{})['then'](function(){return _0x2b1b70;});}else{return _0x2b1b70;}})[_0x4c58('0x44')](function(_0x2cd761){logger[_0x4c58('0x27')](_0x4c58('0x50'),_0x2cd761);throw _0x2cd761;});}return _0x2b1b70;});}})[_0x4c58('0x22')](respondWithResult(_0x1fe254,0xc9))[_0x4c58('0x44')](handleError(_0x1fe254,null));};exports[_0x4c58('0x56')]=function(_0x5c8e31,_0xfb4b0f){if(_0x5c8e31[_0x4c58('0x49')]['id']){delete _0x5c8e31[_0x4c58('0x49')]['id'];}return db['Campaign'][_0x4c58('0x4d')]({'where':{'id':_0x5c8e31[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0xfb4b0f,null))[_0x4c58('0x22')](saveUpdates(_0x5c8e31[_0x4c58('0x49')],null))[_0x4c58('0x22')](respondWithResult(_0xfb4b0f,null))['catch'](handleError(_0xfb4b0f,null));};exports['destroy']=function(_0x4aa070,_0x5c3d80){return db[_0x4c58('0x2d')]['find']({'where':{'id':_0x4aa070[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x5c3d80,null))[_0x4c58('0x22')](removeEntity(_0x5c3d80,null))[_0x4c58('0x44')](handleError(_0x5c3d80,null));};exports[_0x4c58('0x57')]=function(_0x20ce29,_0x2cf937,_0x21f92e){var _0x151b3a={'raw':!![],'where':{}};var _0x1ba8ba={};var _0x7fa9eb={'count':0x0,'rows':[]};return db[_0x4c58('0x2d')][_0x4c58('0x58')]({'where':{'id':_0x20ce29[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x2cf937,null))['then'](function(_0x9b38fd){if(_0x9b38fd){_0x1ba8ba[_0x4c58('0x33')]=_[_0x4c58('0x31')](db[_0x4c58('0x59')][_0x4c58('0x2e')]);_0x1ba8ba[_0x4c58('0x30')]=_['keys'](_0x20ce29['query']);_0x1ba8ba[_0x4c58('0x3b')]=_[_0x4c58('0x32')](_0x1ba8ba[_0x4c58('0x33')],_0x1ba8ba[_0x4c58('0x30')]);_0x151b3a['attributes']=_['intersection'](_0x1ba8ba[_0x4c58('0x33')],qs['fields'](_0x20ce29[_0x4c58('0x30')][_0x4c58('0x35')]));_0x151b3a['attributes']=_0x151b3a[_0x4c58('0x34')][_0x4c58('0x36')]?_0x151b3a['attributes']:_0x1ba8ba['model'];if(!_0x20ce29[_0x4c58('0x30')]['hasOwnProperty'](_0x4c58('0x38'))){_0x151b3a['limit']=qs[_0x4c58('0x39')](_0x20ce29['query'][_0x4c58('0x39')]);_0x151b3a[_0x4c58('0x19')]=qs[_0x4c58('0x19')](_0x20ce29[_0x4c58('0x30')][_0x4c58('0x19')]);}_0x151b3a[_0x4c58('0x3a')]=qs[_0x4c58('0x5a')](_0x20ce29[_0x4c58('0x30')][_0x4c58('0x5a')]);_0x151b3a[_0x4c58('0x3d')]=qs['filters'](_['pick'](_0x20ce29[_0x4c58('0x30')],_0x1ba8ba[_0x4c58('0x3b')]));_0x151b3a[_0x4c58('0x3d')][_0x4c58('0x5b')]=_0x9b38fd['id'];if(_0x20ce29['query'][_0x4c58('0x3c')]){_0x151b3a['where']=_[_0x4c58('0x47')](_0x151b3a[_0x4c58('0x3d')],{'$or':_['map'](_0x151b3a[_0x4c58('0x34')],function(_0x1e02aa){var _0x3ce1ed={};_0x3ce1ed[_0x1e02aa]={'$like':'%'+_0x20ce29['query'][_0x4c58('0x3c')]+'%'};return _0x3ce1ed;})});}_0x151b3a=_[_0x4c58('0x47')]({},_0x151b3a,_0x20ce29[_0x4c58('0x3f')]);return db['CmHopper'][_0x4c58('0x1b')]({'where':_0x151b3a[_0x4c58('0x3d')]})[_0x4c58('0x22')](function(_0x121177){_0x7fa9eb[_0x4c58('0x1b')]=_0x121177;if(_0x20ce29[_0x4c58('0x30')][_0x4c58('0x40')]){_0x151b3a[_0x4c58('0x41')]=[{'all':!![]}];}return db[_0x4c58('0x59')]['findAll'](_0x151b3a);})[_0x4c58('0x22')](function(_0x36ed27){_0x7fa9eb[_0x4c58('0x43')]=_0x36ed27;return _0x7fa9eb;});}})[_0x4c58('0x22')](respondWithFilteredResult(_0x2cf937,_0x151b3a))['catch'](handleError(_0x2cf937,null));};exports[_0x4c58('0x5c')]=function(_0x2a56aa,_0x20b43d,_0x88f08e){var _0x2c4f16={'raw':!![],'where':{}};var _0x59ab28={};var _0xf7ea8e={'count':0x0,'rows':[]};return db[_0x4c58('0x2d')]['findOne']({'where':{'id':_0x2a56aa[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x20b43d,null))[_0x4c58('0x22')](function(_0x1fda5d){if(_0x1fda5d){_0x59ab28[_0x4c58('0x33')]=_[_0x4c58('0x31')](db[_0x4c58('0x5d')][_0x4c58('0x2e')]);_0x59ab28[_0x4c58('0x30')]=_[_0x4c58('0x31')](_0x2a56aa[_0x4c58('0x30')]);_0x59ab28[_0x4c58('0x3b')]=_[_0x4c58('0x32')](_0x59ab28[_0x4c58('0x33')],_0x59ab28['query']);_0x2c4f16[_0x4c58('0x34')]=_['intersection'](_0x59ab28[_0x4c58('0x33')],qs['fields'](_0x2a56aa['query'][_0x4c58('0x35')]));_0x2c4f16[_0x4c58('0x34')]=_0x2c4f16[_0x4c58('0x34')]['length']?_0x2c4f16[_0x4c58('0x34')]:_0x59ab28[_0x4c58('0x33')];if(!_0x2a56aa[_0x4c58('0x30')]['hasOwnProperty'](_0x4c58('0x38'))){_0x2c4f16['limit']=qs['limit'](_0x2a56aa['query'][_0x4c58('0x39')]);_0x2c4f16[_0x4c58('0x19')]=qs[_0x4c58('0x19')](_0x2a56aa[_0x4c58('0x30')]['offset']);}_0x2c4f16['order']=qs[_0x4c58('0x5a')](_0x2a56aa[_0x4c58('0x30')][_0x4c58('0x5a')]);_0x2c4f16['where']=qs[_0x4c58('0x3b')](_['pick'](_0x2a56aa['query'],_0x59ab28['filters']));_0x2c4f16[_0x4c58('0x3d')]['CampaignId']=_0x1fda5d['id'];if(_0x2a56aa[_0x4c58('0x30')][_0x4c58('0x3c')]){_0x2c4f16[_0x4c58('0x3d')]=_['merge'](_0x2c4f16[_0x4c58('0x3d')],{'$or':_[_0x4c58('0x2c')](_0x2c4f16[_0x4c58('0x34')],function(_0x3d0101){var _0x207e08={};_0x207e08[_0x3d0101]={'$like':'%'+_0x2a56aa['query'][_0x4c58('0x3c')]+'%'};return _0x207e08;})});}_0x2c4f16=_[_0x4c58('0x47')]({},_0x2c4f16,_0x2a56aa[_0x4c58('0x3f')]);return db[_0x4c58('0x5d')][_0x4c58('0x1b')]({'where':_0x2c4f16['where']})['then'](function(_0x5ce4e9){_0xf7ea8e[_0x4c58('0x1b')]=_0x5ce4e9;if(_0x2a56aa[_0x4c58('0x30')][_0x4c58('0x40')]){_0x2c4f16[_0x4c58('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4c58('0x42')](_0x2c4f16);})[_0x4c58('0x22')](function(_0x582d90){_0xf7ea8e[_0x4c58('0x43')]=_0x582d90;return _0xf7ea8e;});}})['then'](respondWithFilteredResult(_0x20b43d,_0x2c4f16))[_0x4c58('0x44')](handleError(_0x20b43d,null));};exports[_0x4c58('0x5e')]=function(_0x1cfd1a,_0x4c9a4b,_0x310ad7){var _0x3b4662={'raw':!![],'where':{}};var _0x45cf5e={};var _0x242a49={'count':0x0,'rows':[]};return db[_0x4c58('0x2d')][_0x4c58('0x58')]({'where':{'id':_0x1cfd1a[_0x4c58('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c9a4b,null))[_0x4c58('0x22')](function(_0x11b98d){if(_0x11b98d){_0x45cf5e[_0x4c58('0x33')]=_[_0x4c58('0x31')](db[_0x4c58('0x5f')]['rawAttributes']);_0x45cf5e[_0x4c58('0x30')]=_[_0x4c58('0x31')](_0x1cfd1a['query']);_0x45cf5e[_0x4c58('0x3b')]=_[_0x4c58('0x32')](_0x45cf5e[_0x4c58('0x33')],_0x45cf5e['query']);_0x3b4662['attributes']=_[_0x4c58('0x32')](_0x45cf5e['model'],qs[_0x4c58('0x35')](_0x1cfd1a[_0x4c58('0x30')][_0x4c58('0x35')]));_0x3b4662[_0x4c58('0x34')]=_0x3b4662['attributes'][_0x4c58('0x36')]?_0x3b4662['attributes']:_0x45cf5e[_0x4c58('0x33')];if(!_0x1cfd1a['query'][_0x4c58('0x37')](_0x4c58('0x38'))){_0x3b4662['limit']=qs[_0x4c58('0x39')](_0x1cfd1a[_0x4c58('0x30')][_0x4c58('0x39')]);_0x3b4662[_0x4c58('0x19')]=qs[_0x4c58('0x19')](_0x1cfd1a[_0x4c58('0x30')][_0x4c58('0x19')]);}_0x3b4662[_0x4c58('0x3a')]=qs[_0x4c58('0x5a')](_0x1cfd1a[_0x4c58('0x30')][_0x4c58('0x5a')]);_0x3b4662['where']=qs[_0x4c58('0x3b')](_[_0x4c58('0x60')](_0x1cfd1a[_0x4c58('0x30')],_0x45cf5e['filters']));_0x3b4662[_0x4c58('0x3d')][_0x4c58('0x5b')]=_0x11b98d['id'];if(_0x1cfd1a['query'][_0x4c58('0x3c')]){_0x3b4662[_0x4c58('0x3d')]=_[_0x4c58('0x47')](_0x3b4662[_0x4c58('0x3d')],{'$or':_[_0x4c58('0x2c')](_0x3b4662[_0x4c58('0x34')],function(_0xbf4110){var _0x25c25a={};_0x25c25a[_0xbf4110]={'$like':'%'+_0x1cfd1a['query'][_0x4c58('0x3c')]+'%'};return _0x25c25a;})});}_0x3b4662=_[_0x4c58('0x47')]({},_0x3b4662,_0x1cfd1a['options']);return db['CmHopperFinal'][_0x4c58('0x1b')]({'where':_0x3b4662[_0x4c58('0x3d')]})[_0x4c58('0x22')](function(_0x6029d4){_0x242a49[_0x4c58('0x1b')]=_0x6029d4;if(_0x1cfd1a[_0x4c58('0x30')][_0x4c58('0x40')]){_0x3b4662[_0x4c58('0x41')]=[{'all':!![]}];}return db[_0x4c58('0x5f')][_0x4c58('0x42')](_0x3b4662);})['then'](function(_0x447a2b){_0x242a49[_0x4c58('0x43')]=_0x447a2b;return _0x242a49;});}})[_0x4c58('0x22')](respondWithFilteredResult(_0x4c9a4b,_0x3b4662))[_0x4c58('0x44')](handleError(_0x4c9a4b,null));};exports['getHopperBlacks']=function(_0x3acdc1,_0x1ac09b,_0x419cc4){var _0x5dffa1={'raw':!![],'where':{}};var _0x5afdca={};var _0x5a7eac={'count':0x0,'rows':[]};return db['Campaign'][_0x4c58('0x58')]({'where':{'id':_0x3acdc1[_0x4c58('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ac09b,null))['then'](function(_0x37e5cf){if(_0x37e5cf){_0x5afdca['model']=_[_0x4c58('0x31')](db['CmHopperBlack'][_0x4c58('0x2e')]);_0x5afdca[_0x4c58('0x30')]=_['keys'](_0x3acdc1[_0x4c58('0x30')]);_0x5afdca['filters']=_['intersection'](_0x5afdca[_0x4c58('0x33')],_0x5afdca[_0x4c58('0x30')]);_0x5dffa1[_0x4c58('0x34')]=_[_0x4c58('0x32')](_0x5afdca[_0x4c58('0x33')],qs[_0x4c58('0x35')](_0x3acdc1[_0x4c58('0x30')][_0x4c58('0x35')]));_0x5dffa1[_0x4c58('0x34')]=_0x5dffa1[_0x4c58('0x34')]['length']?_0x5dffa1[_0x4c58('0x34')]:_0x5afdca['model'];if(!_0x3acdc1[_0x4c58('0x30')]['hasOwnProperty'](_0x4c58('0x38'))){_0x5dffa1[_0x4c58('0x39')]=qs[_0x4c58('0x39')](_0x3acdc1[_0x4c58('0x30')][_0x4c58('0x39')]);_0x5dffa1[_0x4c58('0x19')]=qs[_0x4c58('0x19')](_0x3acdc1['query'][_0x4c58('0x19')]);}_0x5dffa1[_0x4c58('0x3a')]=qs[_0x4c58('0x5a')](_0x3acdc1[_0x4c58('0x30')]['sort']);_0x5dffa1['where']=qs[_0x4c58('0x3b')](_[_0x4c58('0x60')](_0x3acdc1[_0x4c58('0x30')],_0x5afdca[_0x4c58('0x3b')]));_0x5dffa1['where'][_0x4c58('0x5b')]=_0x37e5cf['id'];if(_0x3acdc1[_0x4c58('0x30')][_0x4c58('0x3c')]){_0x5dffa1[_0x4c58('0x3d')]=_[_0x4c58('0x47')](_0x5dffa1['where'],{'$or':_[_0x4c58('0x2c')](_0x5dffa1['attributes'],function(_0x3f9eb6){var _0x562a39={};_0x562a39[_0x3f9eb6]={'$like':'%'+_0x3acdc1['query'][_0x4c58('0x3c')]+'%'};return _0x562a39;})});}_0x5dffa1=_[_0x4c58('0x47')]({},_0x5dffa1,_0x3acdc1[_0x4c58('0x3f')]);return db['CmHopperBlack'][_0x4c58('0x1b')]({'where':_0x5dffa1[_0x4c58('0x3d')]})[_0x4c58('0x22')](function(_0x2d9003){_0x5a7eac[_0x4c58('0x1b')]=_0x2d9003;if(_0x3acdc1['query'][_0x4c58('0x40')]){_0x5dffa1['include']=[{'all':!![]}];}return db[_0x4c58('0x61')][_0x4c58('0x42')](_0x5dffa1);})[_0x4c58('0x22')](function(_0x113c47){_0x5a7eac[_0x4c58('0x43')]=_0x113c47;return _0x5a7eac;});}})[_0x4c58('0x22')](respondWithFilteredResult(_0x1ac09b,_0x5dffa1))['catch'](handleError(_0x1ac09b,null));};exports[_0x4c58('0x62')]=function(_0x1956aa,_0x3630a7,_0x2a4ec3){var _0x1d8a34={};var _0x1cb289={};var _0x389612;var _0x24679d;return db[_0x4c58('0x2d')][_0x4c58('0x58')]({'where':{'id':_0x1956aa['params']['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x3630a7,null))['then'](function(_0x4a7207){if(_0x4a7207){_0x389612=_0x4a7207;_0x1cb289[_0x4c58('0x33')]=_[_0x4c58('0x31')](db['CmList'][_0x4c58('0x2e')]);_0x1cb289[_0x4c58('0x30')]=_[_0x4c58('0x31')](_0x1956aa['query']);_0x1cb289[_0x4c58('0x3b')]=_[_0x4c58('0x32')](_0x1cb289[_0x4c58('0x33')],_0x1cb289[_0x4c58('0x30')]);_0x1d8a34[_0x4c58('0x34')]=_['intersection'](_0x1cb289['model'],qs[_0x4c58('0x35')](_0x1956aa[_0x4c58('0x30')]['fields']));_0x1d8a34[_0x4c58('0x34')]=_0x1d8a34[_0x4c58('0x34')]['length']?_0x1d8a34['attributes']:_0x1cb289['model'];_0x1d8a34[_0x4c58('0x3a')]=qs[_0x4c58('0x5a')](_0x1956aa['query'][_0x4c58('0x5a')]);_0x1d8a34[_0x4c58('0x3d')]=qs[_0x4c58('0x3b')](_[_0x4c58('0x60')](_0x1956aa[_0x4c58('0x30')],_0x1cb289[_0x4c58('0x3b')]));if(_0x1956aa['query'][_0x4c58('0x3c')]){_0x1d8a34[_0x4c58('0x3d')]=_[_0x4c58('0x47')](_0x1d8a34[_0x4c58('0x3d')],{'$or':_['map'](_0x1d8a34[_0x4c58('0x34')],function(_0x3e0335){var _0x27d6c8={};_0x27d6c8[_0x3e0335]={'$like':'%'+_0x1956aa[_0x4c58('0x30')][_0x4c58('0x3c')]+'%'};return _0x27d6c8;})});}_0x1d8a34=_[_0x4c58('0x47')]({},_0x1d8a34,_0x1956aa[_0x4c58('0x3f')]);return _0x389612[_0x4c58('0x62')](_0x1d8a34);}})['then'](function(_0x6c2f85){if(_0x6c2f85){_0x24679d=_0x6c2f85[_0x4c58('0x36')];if(!_0x1956aa[_0x4c58('0x30')][_0x4c58('0x37')](_0x4c58('0x38'))){_0x1d8a34[_0x4c58('0x39')]=qs[_0x4c58('0x39')](_0x1956aa[_0x4c58('0x30')][_0x4c58('0x39')]);_0x1d8a34[_0x4c58('0x19')]=qs[_0x4c58('0x19')](_0x1956aa[_0x4c58('0x30')][_0x4c58('0x19')]);}return _0x389612[_0x4c58('0x62')](_0x1d8a34);}})[_0x4c58('0x22')](function(_0x1f4ff9){if(_0x1f4ff9){return _0x1f4ff9?{'count':_0x24679d,'rows':_0x1f4ff9}:null;}})[_0x4c58('0x22')](respondWithResult(_0x3630a7,null))['catch'](handleError(_0x3630a7,null));};exports[_0x4c58('0x63')]=function(_0x19f318,_0x45a0f3,_0x352681){var _0x410acd,_0x2bb505;var _0x35edc2=[];var _0x1a5ad2=moment()[_0x4c58('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x4c58('0x2d')][_0x4c58('0x4d')]({'where':{'id':_0x19f318['params']['id']}})['then'](handleEntityNotFound(_0x45a0f3,null))[_0x4c58('0x22')](function(_0x2f2b6a){if(_0x2f2b6a){_0x2bb505=_0x2f2b6a;return _0x2f2b6a[_0x4c58('0x63')](_0x19f318['body'][_0x4c58('0x65')],_[_0x4c58('0x52')](_0x19f318[_0x4c58('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0x23c4a0){var _0x576884;var _0x185288;_0x410acd=_0x23c4a0||[];var _0xf292b6=[];if(_0x23c4a0){for(var _0x461115=0x0;_0x461115<_0x23c4a0['length'];_0x461115+=0x1){var _0x10ae6e=_0x23c4a0[_0x461115][_0x4c58('0x24')]({'plain':!![]});_0x2bb505[_0x4c58('0x66')]=_0x19f318[_0x4c58('0x49')]['dialCheckDuplicateType']?_0x19f318[_0x4c58('0x49')]['dialCheckDuplicateType']:_0x2bb505[_0x4c58('0x66')];switch(_0x2bb505[_0x4c58('0x66')]){case'always':_0x576884=squel[_0x4c58('0x67')]()[_0x4c58('0x68')](_0x4c58('0x69'))[_0x4c58('0x6a')](['phone',_0x4c58('0x6b'),_0x4c58('0x6c'),'ListId',_0x4c58('0x5b'),_0x4c58('0x54'),_0x4c58('0x53')],squel['select']()[_0x4c58('0x6d')](_0x4c58('0x6e'),_0x4c58('0x6e'))[_0x4c58('0x6d')](_0x4c58('0x6f'),'scheduledAt')[_0x4c58('0x6d')]('id','ContactId')['field'](_0x10ae6e[_0x4c58('0x70')][_0x4c58('0x71')](),_0x4c58('0x72'))['field'](_0x19f318[_0x4c58('0x46')]['id'][_0x4c58('0x71')](),_0x4c58('0x5b'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27',_0x4c58('0x54'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27','updatedAt')['from'](_0x4c58('0x73'))[_0x4c58('0x3d')](_0x4c58('0x74'))[_0x4c58('0x3d')]('ListId\x20=\x20?',_0x10ae6e[_0x4c58('0x70')][_0x4c58('0x71')]())[_0x4c58('0x3d')](_0x4c58('0x75'))['where'](_0x4c58('0x76'),squel[_0x4c58('0x77')]()['field'](_0x4c58('0x78'))[_0x4c58('0x79')](_0x4c58('0x7a'))[_0x4c58('0x3d')](_0x4c58('0x7b'),_0x19f318[_0x4c58('0x46')]['id']['toString']()))[_0x4c58('0x3d')](_0x4c58('0x76'),squel['select']()[_0x4c58('0x6d')]('COALESCE(phone,\x27\x27)')[_0x4c58('0x79')](_0x4c58('0x69'))[_0x4c58('0x3d')]('CampaignId\x20=\x20?',_0x19f318[_0x4c58('0x46')]['id'][_0x4c58('0x71')]())))[_0x4c58('0x71')]();break;case'onlyIfOpen':_0x576884=squel[_0x4c58('0x67')]()[_0x4c58('0x68')](_0x4c58('0x69'))[_0x4c58('0x6a')]([_0x4c58('0x6e'),_0x4c58('0x6b'),_0x4c58('0x6c'),_0x4c58('0x72'),_0x4c58('0x5b'),'createdAt','updatedAt'],squel[_0x4c58('0x77')]()['field']('phone',_0x4c58('0x6e'))['field']('NOW()',_0x4c58('0x6b'))[_0x4c58('0x6d')]('id',_0x4c58('0x6c'))['field'](_0x10ae6e[_0x4c58('0x70')][_0x4c58('0x71')](),_0x4c58('0x72'))[_0x4c58('0x6d')](_0x19f318[_0x4c58('0x46')]['id']['toString'](),_0x4c58('0x5b'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27',_0x4c58('0x54'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27',_0x4c58('0x53'))['from'](_0x4c58('0x73'))[_0x4c58('0x3d')](_0x4c58('0x74'))[_0x4c58('0x3d')]('ListId\x20=\x20?',_0x10ae6e[_0x4c58('0x70')][_0x4c58('0x71')]())[_0x4c58('0x3d')](_0x4c58('0x75'))[_0x4c58('0x3d')](_0x4c58('0x76'),squel[_0x4c58('0x77')]()[_0x4c58('0x6d')](_0x4c58('0x7c'))[_0x4c58('0x79')]('cm_hopper')[_0x4c58('0x3d')](_0x4c58('0x7b'),_0x19f318['params']['id'][_0x4c58('0x71')]())))['toString']();break;default:_0x576884=squel[_0x4c58('0x67')]()[_0x4c58('0x68')](_0x4c58('0x69'))[_0x4c58('0x6a')]([_0x4c58('0x6e'),'scheduledAt',_0x4c58('0x6c'),'ListId',_0x4c58('0x5b'),_0x4c58('0x54'),_0x4c58('0x53')],squel[_0x4c58('0x77')]()[_0x4c58('0x6d')](_0x4c58('0x6e'),_0x4c58('0x6e'))['field'](_0x4c58('0x6f'),'scheduledAt')['field']('id','ContactId')[_0x4c58('0x6d')](_0x10ae6e[_0x4c58('0x70')][_0x4c58('0x71')](),_0x4c58('0x72'))[_0x4c58('0x6d')](_0x19f318[_0x4c58('0x46')]['id']['toString'](),_0x4c58('0x5b'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27',_0x4c58('0x54'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27',_0x4c58('0x53'))['from'](_0x4c58('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0x4c58('0x3d')](_0x4c58('0x7d'),_0x10ae6e[_0x4c58('0x70')][_0x4c58('0x71')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x4c58('0x71')]();}_0x185288=squel[_0x4c58('0x67')]()[_0x4c58('0x68')](_0x4c58('0x7e'))['fromQuery'](['cmHopperId',_0x4c58('0x6b'),'phone',_0x4c58('0x7f'),_0x4c58('0x54'),_0x4c58('0x53')],squel[_0x4c58('0x77')]()[_0x4c58('0x6d')](_0x4c58('0x80'),'id')[_0x4c58('0x6d')](_0x4c58('0x6f'),_0x4c58('0x6b'))[_0x4c58('0x6d')](_0x4c58('0x81'),_0x4c58('0x6e'))[_0x4c58('0x6d')](_0x4c58('0x82'),_0x4c58('0x7f'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27',_0x4c58('0x54'))[_0x4c58('0x6d')]('\x27'+_0x1a5ad2+'\x27','updatedAt')[_0x4c58('0x79')](_0x4c58('0x83'),'ci')[_0x4c58('0x84')]('cm_hopper','h',_0x4c58('0x85'))['where'](_0x4c58('0x86'),_0x10ae6e[_0x4c58('0x70')][_0x4c58('0x71')]())[_0x4c58('0x3d')]('h.CampaignId=?',_0x19f318[_0x4c58('0x46')]['id'][_0x4c58('0x71')]())[_0x4c58('0x3d')](_0x4c58('0x87'),_0x1a5ad2))[_0x4c58('0x71')]();_0xf292b6['push'](db[_0x4c58('0x88')]['query'](_0x576884));_0x35edc2[_0x4c58('0x89')](db[_0x4c58('0x88')][_0x4c58('0x30')](_0x185288));}return BPromise['all'](_0xf292b6);}})['then'](function(){return BPromise['all'](_0x35edc2);})[_0x4c58('0x22')](function(){return _0x410acd;})[_0x4c58('0x22')](respondWithResult(_0x45a0f3,null))[_0x4c58('0x44')](handleError(_0x45a0f3,null));};exports[_0x4c58('0x8a')]=function(_0x516919,_0x37b828,_0x4bbf38){return db[_0x4c58('0x2d')][_0x4c58('0x4d')]({'where':{'id':_0x516919[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x37b828,null))[_0x4c58('0x22')](function(_0x9c503){if(_0x9c503){return _0x9c503[_0x4c58('0x8a')](_0x516919['query'][_0x4c58('0x65')]);}})[_0x4c58('0x22')](function(_0x36ace3){if(_0x36ace3){return db[_0x4c58('0x59')][_0x4c58('0x23')]({'where':{'ListId':_0x516919[_0x4c58('0x30')][_0x4c58('0x65')],'CampaignId':_0x516919[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](function(){return _0x36ace3;});}})[_0x4c58('0x22')](respondWithStatusCode(_0x37b828,null))['catch'](handleError(_0x37b828,null));};exports[_0x4c58('0x8b')]=function(_0x26db06,_0x892b6d,_0x519b9d){var _0x195e5a={};var _0x31a34f={};var _0x4aa856;var _0x2c314b;return db['Campaign'][_0x4c58('0x58')]({'where':{'id':_0x26db06[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x892b6d,null))[_0x4c58('0x22')](function(_0x15bf17){if(_0x15bf17){_0x4aa856=_0x15bf17;_0x31a34f[_0x4c58('0x33')]=_[_0x4c58('0x31')](db[_0x4c58('0x8c')][_0x4c58('0x2e')]);_0x31a34f[_0x4c58('0x30')]=_['keys'](_0x26db06[_0x4c58('0x30')]);_0x31a34f[_0x4c58('0x3b')]=_['intersection'](_0x31a34f[_0x4c58('0x33')],_0x31a34f['query']);_0x195e5a[_0x4c58('0x34')]=_[_0x4c58('0x32')](_0x31a34f[_0x4c58('0x33')],qs[_0x4c58('0x35')](_0x26db06[_0x4c58('0x30')][_0x4c58('0x35')]));_0x195e5a[_0x4c58('0x34')]=_0x195e5a['attributes']['length']?_0x195e5a['attributes']:_0x31a34f[_0x4c58('0x33')];_0x195e5a[_0x4c58('0x3a')]=qs[_0x4c58('0x5a')](_0x26db06[_0x4c58('0x30')]['sort']);_0x195e5a[_0x4c58('0x3d')]=qs['filters'](_[_0x4c58('0x60')](_0x26db06[_0x4c58('0x30')],_0x31a34f[_0x4c58('0x3b')]));if(_0x26db06[_0x4c58('0x30')][_0x4c58('0x3c')]){_0x195e5a[_0x4c58('0x3d')]=_[_0x4c58('0x47')](_0x195e5a[_0x4c58('0x3d')],{'$or':_[_0x4c58('0x2c')](_0x195e5a[_0x4c58('0x34')],function(_0x4e444a){var _0x42f667={};_0x42f667[_0x4e444a]={'$like':'%'+_0x26db06[_0x4c58('0x30')][_0x4c58('0x3c')]+'%'};return _0x42f667;})});}_0x195e5a=_[_0x4c58('0x47')]({},_0x195e5a,_0x26db06[_0x4c58('0x3f')]);return _0x4aa856['getBlackLists'](_0x195e5a);}})[_0x4c58('0x22')](function(_0x3f9128){if(_0x3f9128){_0x2c314b=_0x3f9128['length'];if(!_0x26db06[_0x4c58('0x30')][_0x4c58('0x37')](_0x4c58('0x38'))){_0x195e5a[_0x4c58('0x39')]=qs[_0x4c58('0x39')](_0x26db06['query'][_0x4c58('0x39')]);_0x195e5a[_0x4c58('0x19')]=qs[_0x4c58('0x19')](_0x26db06[_0x4c58('0x30')][_0x4c58('0x19')]);}return _0x4aa856[_0x4c58('0x8b')](_0x195e5a);}})[_0x4c58('0x22')](function(_0xce9713){if(_0xce9713){return _0xce9713?{'count':_0x2c314b,'rows':_0xce9713}:null;}})['then'](respondWithResult(_0x892b6d,null))['catch'](handleError(_0x892b6d,null));};exports[_0x4c58('0x8d')]=function(_0x1560a9,_0x38507c,_0x506d7d){var _0x326a4,_0x2e0fd4;var _0x34efd0=[];var _0x57f8cb=moment()[_0x4c58('0x64')](_0x4c58('0x8e'));return db[_0x4c58('0x2d')][_0x4c58('0x4d')]({'where':{'id':_0x1560a9[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x38507c,null))[_0x4c58('0x22')](function(_0x343284){if(_0x343284){_0x2e0fd4=_0x343284;return _0x343284[_0x4c58('0x8d')](_0x1560a9['body'][_0x4c58('0x65')],_['omit'](_0x1560a9[_0x4c58('0x49')],['ids','id'])||{});}return null;})[_0x4c58('0x8f')](function(_0x411be4){var _0x361231;var _0x5e897c;_0x326a4=_0x411be4||[];var _0x3d850a=[];if(_0x411be4){for(var _0x1fb5cf=0x0;_0x1fb5cf<_0x411be4[_0x4c58('0x36')];_0x1fb5cf+=0x1){var _0x53cae5=_0x411be4[_0x1fb5cf]['get']({'plain':!![]});_0x361231=squel[_0x4c58('0x67')]()[_0x4c58('0x68')](_0x4c58('0x90'))['fromQuery']([_0x4c58('0x6e'),_0x4c58('0x6c'),_0x4c58('0x72'),_0x4c58('0x5b'),_0x4c58('0x54'),_0x4c58('0x53')],squel['select']()[_0x4c58('0x6d')]('phone',_0x4c58('0x6e'))[_0x4c58('0x6d')]('id','ContactId')[_0x4c58('0x6d')](_0x53cae5[_0x4c58('0x70')][_0x4c58('0x71')](),'ListId')[_0x4c58('0x6d')](_0x1560a9[_0x4c58('0x46')]['id'][_0x4c58('0x71')](),_0x4c58('0x5b'))[_0x4c58('0x6d')]('NOW()',_0x4c58('0x54'))[_0x4c58('0x6d')]('NOW()',_0x4c58('0x53'))[_0x4c58('0x79')](_0x4c58('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0x4c58('0x3d')]('ListId\x20=\x20?',_0x53cae5['CmListId']['toString']())[_0x4c58('0x3d')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x3d850a[_0x4c58('0x89')](db[_0x4c58('0x88')]['query'](_0x361231));}return BPromise[_0x4c58('0x91')](_0x3d850a);}})[_0x4c58('0x22')](function(){return _0x326a4;})[_0x4c58('0x22')](respondWithResult(_0x38507c,null))[_0x4c58('0x44')](handleError(_0x38507c,null));};exports[_0x4c58('0x92')]=function(_0x1b1d7a,_0x39839d,_0x562bc3){return db[_0x4c58('0x2d')]['find']({'where':{'id':_0x1b1d7a['params']['id']}})[_0x4c58('0x22')](handleEntityNotFound(_0x39839d,null))['then'](function(_0x164579){if(_0x164579){return _0x164579[_0x4c58('0x92')](_0x1b1d7a['query']['ids']);}})['then'](function(_0x253cec){if(_0x253cec){return db[_0x4c58('0x61')][_0x4c58('0x23')]({'where':{'ListId':_0x1b1d7a[_0x4c58('0x30')][_0x4c58('0x65')],'CampaignId':_0x1b1d7a[_0x4c58('0x46')]['id']}})[_0x4c58('0x22')](function(){return _0x253cec;});}})[_0x4c58('0x22')](respondWithStatusCode(_0x39839d,null))[_0x4c58('0x44')](handleError(_0x39839d,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5cb9876..97b03d4 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 87b6c81..dd7d669 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 _0x6c50=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','error','Campaign,\x20%s,\x20%s','message','request\x20sent','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','debug','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x58a614,_0x9f5ab6){var _0x3d4f7f=function(_0x43cdf8){while(--_0x43cdf8){_0x58a614['push'](_0x58a614['shift']());}};_0x3d4f7f(++_0x9f5ab6);}(_0x6c50,0xa4));var _0x06c5=function(_0x14693c,_0x43ff4a){_0x14693c=_0x14693c-0x0;var _0x287fcb=_0x6c50[_0x14693c];return _0x287fcb;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Campaign,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Campaign,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')]({'raw':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1a')]===undefined?!![]:![]:!![],'where':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1b')]||null:null,'attributes':_0x36b9e9['options']?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1c')]||null:null,'limit':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1d')]||null:null,'include':_0x36b9e9[_0x06c5('0x19')]?_0x36b9e9[_0x06c5('0x19')]['include']?_[_0x06c5('0x1e')](_0x36b9e9[_0x06c5('0x19')][_0x06c5('0x1f')],function(_0x20ba9e){return{'model':db[_0x20ba9e[_0x06c5('0x20')]],'as':_0x20ba9e['as'],'attributes':_0x20ba9e[_0x06c5('0x1c')],'include':_0x20ba9e[_0x06c5('0x1f')]?_['map'](_0x20ba9e[_0x06c5('0x1f')],function(_0x5aeb6c){return{'model':db[_0x5aeb6c['model']],'as':_0x5aeb6c['as'],'attributes':_0x5aeb6c['attributes'],'include':_0x5aeb6c['include']?_[_0x06c5('0x1e')](_0x5aeb6c[_0x06c5('0x1f')],function(_0x1067e1){return{'model':db[_0x1067e1[_0x06c5('0x20')]],'as':_0x1067e1['as'],'attributes':_0x1067e1[_0x06c5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x221965){logger[_0x06c5('0xe')](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x21')](_0x06c5('0x16'),_0x36b9e9,JSON['stringify'](_0x221965));_0x18a070(_0x221965);})[_0x06c5('0x15')](function(_0x432de5){logger[_0x06c5('0x10')]('GetCampaign',_0x432de5[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x432de5[_0x06c5('0x12')]));});});};
\ No newline at end of file
+var _0x3140=['include','map','model','then','GetCampaign','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch','Campaign','findAll','options','where','attributes','limit'];(function(_0x91fbca,_0x249f60){var _0x582ad8=function(_0x248c20){while(--_0x248c20){_0x91fbca['push'](_0x91fbca['shift']());}};_0x582ad8(++_0x249f60);}(_0x3140,0xaf));var _0x0314=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0x3140[_0x3861f7];return _0x50879f;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('Campaign,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});}exports['GetCampaign']=function(_0x575b68){var _0x39db0b=this;return new Promise(function(_0x329679,_0x583d39){return db[_0x0314('0x17')][_0x0314('0x18')]({'raw':_0x575b68['options']?_0x575b68[_0x0314('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1a')]||null:null,'attributes':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1b')]||null:null,'limit':_0x575b68['options']?_0x575b68['options'][_0x0314('0x1c')]||null:null,'include':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1d')]?_[_0x0314('0x1e')](_0x575b68[_0x0314('0x19')]['include'],function(_0x3c743e){return{'model':db[_0x3c743e[_0x0314('0x1f')]],'as':_0x3c743e['as'],'attributes':_0x3c743e['attributes'],'include':_0x3c743e[_0x0314('0x1d')]?_[_0x0314('0x1e')](_0x3c743e[_0x0314('0x1d')],function(_0x26c6a4){return{'model':db[_0x26c6a4[_0x0314('0x1f')]],'as':_0x26c6a4['as'],'attributes':_0x26c6a4[_0x0314('0x1b')],'include':_0x26c6a4['include']?_[_0x0314('0x1e')](_0x26c6a4[_0x0314('0x1d')],function(_0x2d636b){return{'model':db[_0x2d636b['model']],'as':_0x2d636b['as'],'attributes':_0x2d636b[_0x0314('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0314('0x20')](function(_0x47c102){logger['info'](_0x0314('0x21'),_0x575b68);logger[_0x0314('0xf')]('GetCampaign',_0x575b68,JSON[_0x0314('0x11')](_0x47c102));_0x329679(_0x47c102);})[_0x0314('0x16')](function(_0x5291c2){logger['error'](_0x0314('0x21'),_0x5291c2[_0x0314('0x15')],_0x575b68);_0x583d39(_0x39db0b['error'](0x1f4,_0x5291c2[_0x0314('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 8c660f0..b097848 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 _0xfb58=['removeLists','/:id/blacklists','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','isAuthenticated','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','create','post','/:id/clone','clone','addLists','addBlackLists','delete','destroy','/:id/lists'];(function(_0x34fa28,_0x3ffb30){var _0x32168d=function(_0x1c3325){while(--_0x1c3325){_0x34fa28['push'](_0x34fa28['shift']());}};_0x32168d(++_0x3ffb30);}(_0xfb58,0x143));var _0x8fb5=function(_0x1ce4e6,_0xc91285){_0x1ce4e6=_0x1ce4e6-0x0;var _0x3cbdaa=_0xfb58[_0x1ce4e6];return _0x3cbdaa;};'use strict';var multer=require(_0x8fb5('0x0'));var util=require(_0x8fb5('0x1'));var path=require(_0x8fb5('0x2'));var timeout=require(_0x8fb5('0x3'));var express=require('express');var router=express[_0x8fb5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8fb5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8fb5('0x6'));var controller=require('./campaign.controller');router[_0x8fb5('0x7')]('/',auth['isAuthenticated'](),controller[_0x8fb5('0x8')]);router['get'](_0x8fb5('0x9'),auth['isAuthenticated'](),controller[_0x8fb5('0xa')]);router[_0x8fb5('0x7')](_0x8fb5('0xb'),auth['isAuthenticated'](),controller[_0x8fb5('0xc')]);router[_0x8fb5('0x7')](_0x8fb5('0xd'),auth[_0x8fb5('0xe')](),controller['getHopperHistories']);router[_0x8fb5('0x7')](_0x8fb5('0xf'),auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x10')]);router[_0x8fb5('0x7')](_0x8fb5('0x11'),auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x12')]);router['get']('/:id/lists',auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x13')]);router['get']('/:id/blacklists',auth[_0x8fb5('0xe')](),controller['getBlackLists']);router['post']('/',auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x14')]);router[_0x8fb5('0x15')](_0x8fb5('0x16'),auth['isAuthenticated'](),controller[_0x8fb5('0x17')]);router[_0x8fb5('0x15')]('/:id/lists',auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x18')]);router['post']('/:id/blacklists',auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x19')]);router['put'](_0x8fb5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8fb5('0x1a')](_0x8fb5('0x9'),auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x1b')]);router[_0x8fb5('0x1a')](_0x8fb5('0x1c'),auth['isAuthenticated'](),controller[_0x8fb5('0x1d')]);router['delete'](_0x8fb5('0x1e'),auth[_0x8fb5('0xe')](),controller[_0x8fb5('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x3786=['put','update','delete','/:id','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists'];(function(_0x13b947,_0x65c4df){var _0x803766=function(_0x5e363f){while(--_0x5e363f){_0x13b947['push'](_0x13b947['shift']());}};_0x803766(++_0x65c4df);}(_0x3786,0x13b));var _0x6378=function(_0x231422,_0x26fcd3){_0x231422=_0x231422-0x0;var _0x520643=_0x3786[_0x231422];return _0x520643;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6378('0x0'));var timeout=require(_0x6378('0x1'));var express=require(_0x6378('0x2'));var router=express[_0x6378('0x3')]();var fs_extra=require(_0x6378('0x4'));var auth=require(_0x6378('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6378('0x6'));var controller=require(_0x6378('0x7'));router['get']('/',auth[_0x6378('0x8')](),controller[_0x6378('0x9')]);router[_0x6378('0xa')]('/:id',auth[_0x6378('0x8')](),controller[_0x6378('0xb')]);router[_0x6378('0xa')](_0x6378('0xc'),auth[_0x6378('0x8')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0x6378('0x8')](),controller['getHopperHistories']);router[_0x6378('0xa')](_0x6378('0xd'),auth[_0x6378('0x8')](),controller[_0x6378('0xe')]);router[_0x6378('0xa')](_0x6378('0xf'),auth[_0x6378('0x8')](),controller['getHopperBlacks']);router[_0x6378('0xa')](_0x6378('0x10'),auth[_0x6378('0x8')](),controller[_0x6378('0x11')]);router['get'](_0x6378('0x12'),auth[_0x6378('0x8')](),controller[_0x6378('0x13')]);router[_0x6378('0x14')]('/',auth[_0x6378('0x8')](),controller[_0x6378('0x15')]);router[_0x6378('0x14')](_0x6378('0x16'),auth['isAuthenticated'](),controller[_0x6378('0x17')]);router[_0x6378('0x14')](_0x6378('0x10'),auth[_0x6378('0x8')](),controller[_0x6378('0x18')]);router[_0x6378('0x14')]('/:id/blacklists',auth[_0x6378('0x8')](),controller[_0x6378('0x19')]);router[_0x6378('0x1a')]('/:id',auth[_0x6378('0x8')](),controller[_0x6378('0x1b')]);router[_0x6378('0x1c')](_0x6378('0x1d'),auth[_0x6378('0x8')](),controller['destroy']);router[_0x6378('0x1c')]('/:id/lists',auth[_0x6378('0x8')](),controller['removeLists']);router[_0x6378('0x1c')](_0x6378('0x12'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x6378('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 3f07e79..d3f1afe 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 _0x5fff=['VIRTUAL','getDataValue','key','sequelize','exports','TEXT','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5fff,0x192));var _0xf5ff=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x5fff[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require(_0xf5ff('0x0'));module[_0xf5ff('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf5ff('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf5ff('0x3')]},'name':{'type':Sequelize[_0xf5ff('0x4')],'get':function(){return this[_0xf5ff('0x5')](_0xf5ff('0x6'));}}};
\ No newline at end of file
+var _0xd5d6=['STRING','VIRTUAL','getDataValue','sequelize'];(function(_0x1a4de0,_0xd775ac){var _0x179477=function(_0x147d13){while(--_0x147d13){_0x1a4de0['push'](_0x1a4de0['shift']());}};_0x179477(++_0xd775ac);}(_0xd5d6,0x77));var _0x6d5d=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xd5d6[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0x6d5d('0x0'));module['exports']={'key':{'type':Sequelize[_0x6d5d('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x6d5d('0x2')],'get':function(){return this[_0x6d5d('0x3')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index c466ce2..5a97670 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 _0xd059=['fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','options','CannedAnswer','include','findAll','catch','params','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x4d1a40,_0x1f8a23){var _0x17b93d=function(_0x169abd){while(--_0x169abd){_0x4d1a40['push'](_0x4d1a40['shift']());}};_0x17b93d(++_0x1f8a23);}(_0xd059,0xad));var _0x9d05=function(_0x45f7ef,_0xd74dc7){_0x45f7ef=_0x45f7ef-0x0;var _0x566b54=_0xd059[_0x45f7ef];return _0x566b54;};'use strict';var emlformat=require(_0x9d05('0x0'));var rimraf=require(_0x9d05('0x1'));var zipdir=require(_0x9d05('0x2'));var jsonpatch=require(_0x9d05('0x3'));var rp=require(_0x9d05('0x4'));var moment=require(_0x9d05('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d05('0x6'));var path=require(_0x9d05('0x7'));var sox=require(_0x9d05('0x8'));var csv=require(_0x9d05('0x9'));var ejs=require(_0x9d05('0xa'));var fs=require('fs');var fs_extra=require(_0x9d05('0xb'));var _=require(_0x9d05('0xc'));var squel=require(_0x9d05('0xd'));var crypto=require(_0x9d05('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9d05('0xf'));var toCsv=require(_0x9d05('0x9'));var querystring=require(_0x9d05('0x10'));var Papa=require(_0x9d05('0x11'));var Redis=require(_0x9d05('0x12'));var authService=require(_0x9d05('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9d05('0x14'));var hardwareService=require(_0x9d05('0x15'));var logger=require(_0x9d05('0x16'))(_0x9d05('0x17'));var utils=require('../../config/utils');var config=require(_0x9d05('0x18'));var licenseUtil=require(_0x9d05('0x19'));var db=require(_0x9d05('0x1a'))['db'];function respondWithStatusCode(_0x2e8ae8,_0x45a13e){_0x45a13e=_0x45a13e||0xcc;return function(_0xab5dd8){if(_0xab5dd8){return _0x2e8ae8[_0x9d05('0x1b')](_0x45a13e);}return _0x2e8ae8['status'](_0x45a13e)[_0x9d05('0x1c')]();};}function respondWithResult(_0x851099,_0x1484a1){_0x1484a1=_0x1484a1||0xc8;return function(_0x23b0b9){if(_0x23b0b9){return _0x851099[_0x9d05('0x1d')](_0x1484a1)[_0x9d05('0x1e')](_0x23b0b9);}};}function respondWithFilteredResult(_0xfbe7b4,_0x1936b1){return function(_0x424028){if(_0x424028){var _0x19c6e7=typeof _0x1936b1[_0x9d05('0x1f')]==='undefined'&&typeof _0x1936b1[_0x9d05('0x20')]===_0x9d05('0x21');var _0x12a1b4=_0x424028[_0x9d05('0x22')];var _0x30576f=_0x19c6e7?0x0:_0x1936b1[_0x9d05('0x1f')];var _0x323982=_0x19c6e7?_0x424028[_0x9d05('0x22')]:_0x1936b1[_0x9d05('0x1f')]+_0x1936b1[_0x9d05('0x20')];var _0xd73c37;if(_0x323982>=_0x12a1b4){_0x323982=_0x12a1b4;_0xd73c37=0xc8;}else{_0xd73c37=0xce;}_0xfbe7b4[_0x9d05('0x1d')](_0xd73c37);return _0xfbe7b4['set']('Content-Range',_0x30576f+'-'+_0x323982+'/'+_0x12a1b4)['json'](_0x424028);}return null;};}function patchUpdates(_0x5ae4a9){return function(_0x2ba4af){try{jsonpatch['apply'](_0x2ba4af,_0x5ae4a9,!![]);}catch(_0x54ab92){return BPromise[_0x9d05('0x23')](_0x54ab92);}return _0x2ba4af[_0x9d05('0x24')]();};}function saveUpdates(_0xd5eec5,_0x3b1ef5){return function(_0x5ef4c8){if(_0x5ef4c8){return _0x5ef4c8[_0x9d05('0x25')](_0xd5eec5)['then'](function(_0x3b6f83){return _0x3b6f83;});}return null;};}function removeEntity(_0x5c4e10,_0x4a180f){return function(_0x2a6bc5){if(_0x2a6bc5){return _0x2a6bc5[_0x9d05('0x26')]()['then'](function(){var _0x3350ca=_0x2a6bc5[_0x9d05('0x27')]({'plain':!![]});var _0x5877e9=_0x9d05('0x28');return db[_0x9d05('0x29')]['destroy']({'where':{'type':_0x5877e9,'resourceId':_0x3350ca['id']}})[_0x9d05('0x2a')](function(){return _0x2a6bc5;});})['then'](function(){_0x5c4e10[_0x9d05('0x1d')](0xcc)[_0x9d05('0x1c')]();});}};}function handleEntityNotFound(_0x1480fb,_0x1f5736){return function(_0x13d116){if(!_0x13d116){_0x1480fb[_0x9d05('0x1b')](0x194);}return _0x13d116;};}function handleError(_0x4a3632,_0x6aebe){_0x6aebe=_0x6aebe||0x1f4;return function(_0x2d7dbd){logger['error'](_0x2d7dbd[_0x9d05('0x2b')]);if(_0x2d7dbd[_0x9d05('0x2c')]){delete _0x2d7dbd['name'];}_0x4a3632[_0x9d05('0x1d')](_0x6aebe)['send'](_0x2d7dbd);};}exports[_0x9d05('0x2d')]=function(_0xbed60b,_0xc19ccd){var _0x5a4871={},_0x57c8e3={},_0x115e9e={'count':0x0,'rows':[]};var _0x216f63=_[_0x9d05('0x2e')](db['CannedAnswer'][_0x9d05('0x2f')],function(_0x1e7180){return{'name':_0x1e7180[_0x9d05('0x30')],'type':_0x1e7180[_0x9d05('0x31')][_0x9d05('0x32')]};});_0x57c8e3[_0x9d05('0x33')]=_['map'](_0x216f63,'name');_0x57c8e3['query']=_[_0x9d05('0x34')](_0xbed60b[_0x9d05('0x35')]);_0x57c8e3['filters']=_['intersection'](_0x57c8e3[_0x9d05('0x33')],_0x57c8e3[_0x9d05('0x35')]);_0x5a4871[_0x9d05('0x36')]=_[_0x9d05('0x37')](_0x57c8e3[_0x9d05('0x33')],qs[_0x9d05('0x38')](_0xbed60b[_0x9d05('0x35')][_0x9d05('0x38')]));_0x5a4871['attributes']=_0x5a4871[_0x9d05('0x36')][_0x9d05('0x39')]?_0x5a4871[_0x9d05('0x36')]:_0x57c8e3[_0x9d05('0x33')];if(!_0xbed60b[_0x9d05('0x35')][_0x9d05('0x3a')](_0x9d05('0x3b'))){_0x5a4871[_0x9d05('0x20')]=qs[_0x9d05('0x20')](_0xbed60b[_0x9d05('0x35')]['limit']);_0x5a4871['offset']=qs[_0x9d05('0x1f')](_0xbed60b['query'][_0x9d05('0x1f')]);}_0x5a4871['order']=qs[_0x9d05('0x3c')](_0xbed60b[_0x9d05('0x35')]['sort']);_0x5a4871['where']=qs['filters'](_[_0x9d05('0x3d')](_0xbed60b[_0x9d05('0x35')],_0x57c8e3[_0x9d05('0x3e')]),_0x216f63);if(_0xbed60b[_0x9d05('0x35')][_0x9d05('0x3f')]){_0x5a4871[_0x9d05('0x40')]=_[_0x9d05('0x41')](_0x5a4871[_0x9d05('0x40')],{'$or':[{'key':{'$like':'%'+_0xbed60b['query'][_0x9d05('0x3f')]+'%'}},{'value':{'$like':'%'+_0xbed60b[_0x9d05('0x35')][_0x9d05('0x3f')]+'%'}}]});}_0x5a4871=_[_0x9d05('0x41')]({},_0x5a4871,_0xbed60b[_0x9d05('0x42')]);var _0x3604ed={'where':_0x5a4871[_0x9d05('0x40')]};return db[_0x9d05('0x43')][_0x9d05('0x22')](_0x3604ed)[_0x9d05('0x2a')](function(_0x453b9c){_0x115e9e[_0x9d05('0x22')]=_0x453b9c;if(_0xbed60b[_0x9d05('0x35')]['includeAll']){_0x5a4871[_0x9d05('0x44')]=[{'all':!![]}];}return db[_0x9d05('0x43')][_0x9d05('0x45')](_0x5a4871);})['then'](function(_0x334b53){_0x115e9e['rows']=_0x334b53;return _0x115e9e;})['then'](respondWithFilteredResult(_0xc19ccd,_0x5a4871))[_0x9d05('0x46')](handleError(_0xc19ccd,null));};exports['show']=function(_0x3d0491,_0x32ad8c){var _0x19c6ca={'raw':!![],'where':{'id':_0x3d0491[_0x9d05('0x47')]['id']}},_0x4c9ee6={};_0x4c9ee6[_0x9d05('0x33')]=_[_0x9d05('0x34')](db[_0x9d05('0x43')][_0x9d05('0x2f')]);_0x4c9ee6[_0x9d05('0x35')]=_[_0x9d05('0x34')](_0x3d0491[_0x9d05('0x35')]);_0x4c9ee6[_0x9d05('0x3e')]=_[_0x9d05('0x37')](_0x4c9ee6[_0x9d05('0x33')],_0x4c9ee6['query']);_0x19c6ca['attributes']=_[_0x9d05('0x37')](_0x4c9ee6['model'],qs[_0x9d05('0x38')](_0x3d0491['query'][_0x9d05('0x38')]));_0x19c6ca['attributes']=_0x19c6ca['attributes'][_0x9d05('0x39')]?_0x19c6ca[_0x9d05('0x36')]:_0x4c9ee6['model'];if(_0x3d0491[_0x9d05('0x35')][_0x9d05('0x48')]){_0x19c6ca[_0x9d05('0x44')]=[{'all':!![]}];}_0x19c6ca=_['merge']({},_0x19c6ca,_0x3d0491[_0x9d05('0x42')]);return db['CannedAnswer'][_0x9d05('0x49')](_0x19c6ca)[_0x9d05('0x2a')](handleEntityNotFound(_0x32ad8c,null))[_0x9d05('0x2a')](respondWithResult(_0x32ad8c,null))[_0x9d05('0x46')](handleError(_0x32ad8c,null));};exports['update']=function(_0x23806b,_0x5d5490){if(_0x23806b[_0x9d05('0x4a')]['id']){delete _0x23806b['body']['id'];}return db[_0x9d05('0x43')][_0x9d05('0x49')]({'where':{'id':_0x23806b[_0x9d05('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d5490,null))[_0x9d05('0x2a')](saveUpdates(_0x23806b[_0x9d05('0x4a')],null))['then'](respondWithResult(_0x5d5490,null))[_0x9d05('0x46')](handleError(_0x5d5490,null));};exports[_0x9d05('0x26')]=function(_0x2cc402,_0x76bc03){return db[_0x9d05('0x43')][_0x9d05('0x49')]({'where':{'id':_0x2cc402[_0x9d05('0x47')]['id']}})[_0x9d05('0x2a')](handleEntityNotFound(_0x76bc03,null))[_0x9d05('0x2a')](removeEntity(_0x76bc03,null))[_0x9d05('0x46')](handleError(_0x76bc03,null));};exports[_0x9d05('0x4b')]=function(_0x26317e,_0x2e20a7){var _0x325311={'key':_0x26317e['body']['key']};if(_0x26317e['body']['MailAccountId']){_0x325311['MailAccountId']=_0x26317e[_0x9d05('0x4a')][_0x9d05('0x4c')];}else if(_0x26317e[_0x9d05('0x4a')][_0x9d05('0x4d')]){_0x325311[_0x9d05('0x4d')]=_0x26317e[_0x9d05('0x4a')][_0x9d05('0x4d')];}else if(_0x26317e['body']['OpenchannelAccountId']){_0x325311['OpenchannelAccountId']=_0x26317e['body'][_0x9d05('0x4e')];}else if(_0x26317e[_0x9d05('0x4a')][_0x9d05('0x4f')]){_0x325311['ChatWebsiteId']=_0x26317e[_0x9d05('0x4a')][_0x9d05('0x4f')];}return db[_0x9d05('0x43')][_0x9d05('0x49')]({'where':_0x325311})[_0x9d05('0x2a')](function(_0x452334){if(_0x452334){throw new db['Sequelize'][(_0x9d05('0x50'))](_0x9d05('0x51'));}return db[_0x9d05('0x43')]['create'](_0x26317e[_0x9d05('0x4a')]);})[_0x9d05('0x2a')](function(_0x2ec2c5){var _0x4a9218=_0x26317e[_0x9d05('0x52')][_0x9d05('0x27')]({'plain':!![]});if(!_0x4a9218)throw new Error(_0x9d05('0x53'));if(_0x4a9218['role']===_0x9d05('0x52')){var _0x14c8d5=_0x2ec2c5['get']({'plain':!![]});return db['UserProfileSection'][_0x9d05('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x4a9218[_0x9d05('0x54')]},'raw':!![]})[_0x9d05('0x2a')](function(_0x54ce59){if(_0x54ce59&&_0x54ce59[_0x9d05('0x55')]===0x0){return db[_0x9d05('0x29')][_0x9d05('0x4b')]({'name':_0x14c8d5[_0x9d05('0x2c')],'resourceId':_0x14c8d5['id'],'type':_0x54ce59[_0x9d05('0x2c')],'sectionId':_0x54ce59['id']},{})[_0x9d05('0x2a')](function(){return _0x2ec2c5;});}else{return _0x2ec2c5;}})[_0x9d05('0x46')](function(_0x1e1001){logger[_0x9d05('0x56')](_0x9d05('0x57'),_0x1e1001);throw _0x1e1001;});}return _0x2ec2c5;})[_0x9d05('0x2a')](respondWithResult(_0x2e20a7,0xc9))[_0x9d05('0x46')](handleError(_0x2e20a7,null));};
\ No newline at end of file
+var _0xe3b6=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','filter','options','CannedAnswer','includeAll','findAll','catch','keys','include','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xe3b6,0x175));var _0x6e3b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe3b6[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x6e3b('0x0'));var rimraf=require(_0x6e3b('0x1'));var zipdir=require(_0x6e3b('0x2'));var jsonpatch=require(_0x6e3b('0x3'));var rp=require(_0x6e3b('0x4'));var moment=require(_0x6e3b('0x5'));var BPromise=require(_0x6e3b('0x6'));var Mustache=require(_0x6e3b('0x7'));var util=require(_0x6e3b('0x8'));var path=require(_0x6e3b('0x9'));var sox=require(_0x6e3b('0xa'));var csv=require('to-csv');var ejs=require(_0x6e3b('0xb'));var fs=require('fs');var fs_extra=require(_0x6e3b('0xc'));var _=require('lodash');var squel=require(_0x6e3b('0xd'));var crypto=require(_0x6e3b('0xe'));var jsforce=require(_0x6e3b('0xf'));var deskjs=require(_0x6e3b('0x10'));var toCsv=require(_0x6e3b('0x11'));var querystring=require(_0x6e3b('0x12'));var Papa=require(_0x6e3b('0x13'));var Redis=require(_0x6e3b('0x14'));var authService=require(_0x6e3b('0x15'));var qs=require(_0x6e3b('0x16'));var as=require(_0x6e3b('0x17'));var hardwareService=require(_0x6e3b('0x18'));var logger=require(_0x6e3b('0x19'))(_0x6e3b('0x1a'));var utils=require(_0x6e3b('0x1b'));var config=require(_0x6e3b('0x1c'));var licenseUtil=require(_0x6e3b('0x1d'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c9882,_0xb464c4){_0xb464c4=_0xb464c4||0xcc;return function(_0x5b2657){if(_0x5b2657){return _0x3c9882['sendStatus'](_0xb464c4);}return _0x3c9882[_0x6e3b('0x1e')](_0xb464c4)[_0x6e3b('0x1f')]();};}function respondWithResult(_0x1884d7,_0x51f07c){_0x51f07c=_0x51f07c||0xc8;return function(_0x48900b){if(_0x48900b){return _0x1884d7[_0x6e3b('0x1e')](_0x51f07c)[_0x6e3b('0x20')](_0x48900b);}};}function respondWithFilteredResult(_0x81d6dc,_0x43063a){return function(_0x1b598f){if(_0x1b598f){var _0x3de81a=typeof _0x43063a[_0x6e3b('0x21')]===_0x6e3b('0x22')&&typeof _0x43063a[_0x6e3b('0x23')]===_0x6e3b('0x22');var _0x1ebd9d=_0x1b598f[_0x6e3b('0x24')];var _0x322fbb=_0x3de81a?0x0:_0x43063a[_0x6e3b('0x21')];var _0x298353=_0x3de81a?_0x1b598f[_0x6e3b('0x24')]:_0x43063a['offset']+_0x43063a[_0x6e3b('0x23')];var _0x2cdd80;if(_0x298353>=_0x1ebd9d){_0x298353=_0x1ebd9d;_0x2cdd80=0xc8;}else{_0x2cdd80=0xce;}_0x81d6dc[_0x6e3b('0x1e')](_0x2cdd80);return _0x81d6dc[_0x6e3b('0x25')](_0x6e3b('0x26'),_0x322fbb+'-'+_0x298353+'/'+_0x1ebd9d)[_0x6e3b('0x20')](_0x1b598f);}return null;};}function patchUpdates(_0x57c033){return function(_0x817739){try{jsonpatch[_0x6e3b('0x27')](_0x817739,_0x57c033,!![]);}catch(_0x45e48d){return BPromise[_0x6e3b('0x28')](_0x45e48d);}return _0x817739[_0x6e3b('0x29')]();};}function saveUpdates(_0x3b4d20,_0x3a9319){return function(_0x43389e){if(_0x43389e){return _0x43389e[_0x6e3b('0x2a')](_0x3b4d20)[_0x6e3b('0x2b')](function(_0x4f4a8c){return _0x4f4a8c;});}return null;};}function removeEntity(_0x15d341,_0x38e5e2){return function(_0x5c1386){if(_0x5c1386){return _0x5c1386[_0x6e3b('0x2c')]()[_0x6e3b('0x2b')](function(){var _0xe8dc86=_0x5c1386[_0x6e3b('0x2d')]({'plain':!![]});var _0x5ec906=_0x6e3b('0x2e');return db['UserProfileResource'][_0x6e3b('0x2c')]({'where':{'type':_0x5ec906,'resourceId':_0xe8dc86['id']}})['then'](function(){return _0x5c1386;});})[_0x6e3b('0x2b')](function(){_0x15d341['status'](0xcc)[_0x6e3b('0x1f')]();});}};}function handleEntityNotFound(_0x3df6a1,_0x27a63d){return function(_0x3ba9f6){if(!_0x3ba9f6){_0x3df6a1[_0x6e3b('0x2f')](0x194);}return _0x3ba9f6;};}function handleError(_0x3d375c,_0x3b790d){_0x3b790d=_0x3b790d||0x1f4;return function(_0x5549b6){logger['error'](_0x5549b6[_0x6e3b('0x30')]);if(_0x5549b6['name']){delete _0x5549b6[_0x6e3b('0x31')];}_0x3d375c['status'](_0x3b790d)[_0x6e3b('0x32')](_0x5549b6);};}exports[_0x6e3b('0x33')]=function(_0x10f630,_0x41868d){var _0x15e907={},_0x5b68a1={},_0x5e78f0={'count':0x0,'rows':[]};var _0x2495a3=_['map'](db['CannedAnswer'][_0x6e3b('0x34')],function(_0x5b82c2){return{'name':_0x5b82c2[_0x6e3b('0x35')],'type':_0x5b82c2['type'][_0x6e3b('0x36')]};});_0x5b68a1[_0x6e3b('0x37')]=_['map'](_0x2495a3,'name');_0x5b68a1[_0x6e3b('0x38')]=_['keys'](_0x10f630[_0x6e3b('0x38')]);_0x5b68a1[_0x6e3b('0x39')]=_[_0x6e3b('0x3a')](_0x5b68a1['model'],_0x5b68a1[_0x6e3b('0x38')]);_0x15e907['attributes']=_[_0x6e3b('0x3a')](_0x5b68a1[_0x6e3b('0x37')],qs['fields'](_0x10f630['query'][_0x6e3b('0x3b')]));_0x15e907['attributes']=_0x15e907[_0x6e3b('0x3c')][_0x6e3b('0x3d')]?_0x15e907[_0x6e3b('0x3c')]:_0x5b68a1[_0x6e3b('0x37')];if(!_0x10f630[_0x6e3b('0x38')]['hasOwnProperty'](_0x6e3b('0x3e'))){_0x15e907['limit']=qs[_0x6e3b('0x23')](_0x10f630[_0x6e3b('0x38')]['limit']);_0x15e907[_0x6e3b('0x21')]=qs['offset'](_0x10f630[_0x6e3b('0x38')][_0x6e3b('0x21')]);}_0x15e907[_0x6e3b('0x3f')]=qs[_0x6e3b('0x40')](_0x10f630['query'][_0x6e3b('0x40')]);_0x15e907['where']=qs[_0x6e3b('0x39')](_[_0x6e3b('0x41')](_0x10f630[_0x6e3b('0x38')],_0x5b68a1[_0x6e3b('0x39')]),_0x2495a3);if(_0x10f630[_0x6e3b('0x38')]['filter']){_0x15e907[_0x6e3b('0x42')]=_[_0x6e3b('0x43')](_0x15e907[_0x6e3b('0x42')],{'$or':[{'key':{'$like':'%'+_0x10f630[_0x6e3b('0x38')][_0x6e3b('0x44')]+'%'}},{'value':{'$like':'%'+_0x10f630['query']['filter']+'%'}}]});}_0x15e907=_[_0x6e3b('0x43')]({},_0x15e907,_0x10f630[_0x6e3b('0x45')]);var _0x4692fb={'where':_0x15e907[_0x6e3b('0x42')]};return db[_0x6e3b('0x46')][_0x6e3b('0x24')](_0x4692fb)[_0x6e3b('0x2b')](function(_0xe60155){_0x5e78f0[_0x6e3b('0x24')]=_0xe60155;if(_0x10f630[_0x6e3b('0x38')][_0x6e3b('0x47')]){_0x15e907['include']=[{'all':!![]}];}return db[_0x6e3b('0x46')][_0x6e3b('0x48')](_0x15e907);})[_0x6e3b('0x2b')](function(_0x430ab5){_0x5e78f0['rows']=_0x430ab5;return _0x5e78f0;})[_0x6e3b('0x2b')](respondWithFilteredResult(_0x41868d,_0x15e907))[_0x6e3b('0x49')](handleError(_0x41868d,null));};exports['show']=function(_0x268b9d,_0xa934e5){var _0x464c17={'raw':!![],'where':{'id':_0x268b9d['params']['id']}},_0x402723={};_0x402723[_0x6e3b('0x37')]=_[_0x6e3b('0x4a')](db[_0x6e3b('0x46')][_0x6e3b('0x34')]);_0x402723[_0x6e3b('0x38')]=_[_0x6e3b('0x4a')](_0x268b9d[_0x6e3b('0x38')]);_0x402723[_0x6e3b('0x39')]=_['intersection'](_0x402723[_0x6e3b('0x37')],_0x402723[_0x6e3b('0x38')]);_0x464c17[_0x6e3b('0x3c')]=_[_0x6e3b('0x3a')](_0x402723[_0x6e3b('0x37')],qs[_0x6e3b('0x3b')](_0x268b9d[_0x6e3b('0x38')][_0x6e3b('0x3b')]));_0x464c17[_0x6e3b('0x3c')]=_0x464c17[_0x6e3b('0x3c')]['length']?_0x464c17[_0x6e3b('0x3c')]:_0x402723['model'];if(_0x268b9d[_0x6e3b('0x38')][_0x6e3b('0x47')]){_0x464c17[_0x6e3b('0x4b')]=[{'all':!![]}];}_0x464c17=_[_0x6e3b('0x43')]({},_0x464c17,_0x268b9d[_0x6e3b('0x45')]);return db['CannedAnswer'][_0x6e3b('0x4c')](_0x464c17)[_0x6e3b('0x2b')](handleEntityNotFound(_0xa934e5,null))[_0x6e3b('0x2b')](respondWithResult(_0xa934e5,null))[_0x6e3b('0x49')](handleError(_0xa934e5,null));};exports[_0x6e3b('0x2a')]=function(_0x247a87,_0xa93483){if(_0x247a87[_0x6e3b('0x4d')]['id']){delete _0x247a87[_0x6e3b('0x4d')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x247a87[_0x6e3b('0x4e')]['id']}})[_0x6e3b('0x2b')](handleEntityNotFound(_0xa93483,null))[_0x6e3b('0x2b')](saveUpdates(_0x247a87[_0x6e3b('0x4d')],null))[_0x6e3b('0x2b')](respondWithResult(_0xa93483,null))[_0x6e3b('0x49')](handleError(_0xa93483,null));};exports[_0x6e3b('0x2c')]=function(_0x20f950,_0x40a51e){return db[_0x6e3b('0x46')][_0x6e3b('0x4c')]({'where':{'id':_0x20f950['params']['id']}})['then'](handleEntityNotFound(_0x40a51e,null))[_0x6e3b('0x2b')](removeEntity(_0x40a51e,null))[_0x6e3b('0x49')](handleError(_0x40a51e,null));};exports[_0x6e3b('0x4f')]=function(_0x355a1a,_0x158953){var _0x11f38f={'key':_0x355a1a['body'][_0x6e3b('0x36')]};if(_0x355a1a[_0x6e3b('0x4d')]['MailAccountId']){_0x11f38f[_0x6e3b('0x50')]=_0x355a1a[_0x6e3b('0x4d')][_0x6e3b('0x50')];}else if(_0x355a1a['body'][_0x6e3b('0x51')]){_0x11f38f[_0x6e3b('0x51')]=_0x355a1a[_0x6e3b('0x4d')][_0x6e3b('0x51')];}else if(_0x355a1a['body'][_0x6e3b('0x52')]){_0x11f38f['OpenchannelAccountId']=_0x355a1a['body'][_0x6e3b('0x52')];}else if(_0x355a1a[_0x6e3b('0x4d')][_0x6e3b('0x53')]){_0x11f38f[_0x6e3b('0x53')]=_0x355a1a['body'][_0x6e3b('0x53')];}return db[_0x6e3b('0x46')][_0x6e3b('0x4c')]({'where':_0x11f38f})['then'](function(_0x5dd18a){if(_0x5dd18a){throw new db[(_0x6e3b('0x54'))][(_0x6e3b('0x55'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x6e3b('0x46')][_0x6e3b('0x4f')](_0x355a1a[_0x6e3b('0x4d')]);})[_0x6e3b('0x2b')](function(_0x574a62){var _0x543e99=_0x355a1a[_0x6e3b('0x56')]['get']({'plain':!![]});if(!_0x543e99)throw new Error(_0x6e3b('0x57'));if(_0x543e99[_0x6e3b('0x58')]===_0x6e3b('0x56')){var _0x48e251=_0x574a62[_0x6e3b('0x2d')]({'plain':!![]});return db[_0x6e3b('0x59')]['find']({'where':{'name':_0x6e3b('0x2e'),'userProfileId':_0x543e99[_0x6e3b('0x5a')]},'raw':!![]})['then'](function(_0x5da73d){if(_0x5da73d&&_0x5da73d[_0x6e3b('0x5b')]===0x0){return db[_0x6e3b('0x5c')]['create']({'name':_0x48e251['name'],'resourceId':_0x48e251['id'],'type':_0x5da73d[_0x6e3b('0x31')],'sectionId':_0x5da73d['id']},{})[_0x6e3b('0x2b')](function(){return _0x574a62;});}else{return _0x574a62;}})['catch'](function(_0x16b804){logger['error'](_0x6e3b('0x5d'),_0x16b804);throw _0x16b804;});}return _0x574a62;})['then'](respondWithResult(_0x158953,0xc9))[_0x6e3b('0x49')](handleError(_0x158953,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 9cfe6f3..2be989a 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 _0xb63b=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes'];(function(_0x513d38,_0x51a893){var _0x17421b=function(_0x3d24ad){while(--_0x3d24ad){_0x513d38['push'](_0x513d38['shift']());}};_0x17421b(++_0x51a893);}(_0xb63b,0x106));var _0xbb63=function(_0x4bfb61,_0x4ffe5f){_0x4bfb61=_0x4bfb61-0x0;var _0x3c2bb0=_0xb63b[_0x4bfb61];return _0x3c2bb0;};'use strict';var _=require(_0xbb63('0x0'));var util=require(_0xbb63('0x1'));var logger=require(_0xbb63('0x2'))(_0xbb63('0x3'));var moment=require(_0xbb63('0x4'));var BPromise=require(_0xbb63('0x5'));var rp=require(_0xbb63('0x6'));var fs=require('fs');var path=require(_0xbb63('0x7'));var rimraf=require(_0xbb63('0x8'));var config=require('../../config/environment');var attributes=require(_0xbb63('0x9'));module[_0xbb63('0xa')]=function(_0x12d54c,_0x49826b){return _0x12d54c[_0xbb63('0xb')](_0xbb63('0xc'),attributes,{'tableName':_0xbb63('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb63('0xe'),'collate':_0xbb63('0xf')});};
\ No newline at end of file
+var _0xad06=['api','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad06,0xa7));var _0x6ad0=function(_0xc9584,_0x2b670b){_0xc9584=_0xc9584-0x0;var _0x2bb31f=_0xad06[_0xc9584];return _0x2bb31f;};'use strict';var _=require(_0x6ad0('0x0'));var util=require(_0x6ad0('0x1'));var logger=require('../../config/logger')(_0x6ad0('0x2'));var moment=require('moment');var BPromise=require(_0x6ad0('0x3'));var rp=require(_0x6ad0('0x4'));var fs=require('fs');var path=require(_0x6ad0('0x5'));var rimraf=require('rimraf');var config=require(_0x6ad0('0x6'));var attributes=require(_0x6ad0('0x7'));module['exports']=function(_0x143e28,_0xc28ac0){return _0x143e28[_0x6ad0('0x8')](_0x6ad0('0x9'),attributes,{'tableName':_0x6ad0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ad0('0xb'),'collate':_0x6ad0('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index e28e39e..2fc5a86 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(_0x9cd6ff,_0x4c28a9){var _0x1a2121=function(_0x57ea65){while(--_0x57ea65){_0x9cd6ff['push'](_0x9cd6ff['shift']());}};_0x1a2121(++_0x4c28a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x2c4d8e,_0x6ba19a){var _0x1b4bef=function(_0x2ad428){while(--_0x2ad428){_0x2c4d8e['push'](_0x2c4d8e['shift']());}};_0x1b4bef(++_0x6ba19a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 16a2344..da7da72 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 _0x204f=['index','get','/:id','isAuthenticated','post','create','put','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x204f,0xda));var _0xf204=function(_0x9dbea0,_0x52290b){_0x9dbea0=_0x9dbea0-0x0;var _0x47c91d=_0x204f[_0x9dbea0];return _0x47c91d;};'use strict';var multer=require(_0xf204('0x0'));var util=require('util');var path=require(_0xf204('0x1'));var timeout=require(_0xf204('0x2'));var express=require(_0xf204('0x3'));var router=express['Router']();var fs_extra=require(_0xf204('0x4'));var auth=require(_0xf204('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf204('0x6'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf204('0x7')]);router[_0xf204('0x8')](_0xf204('0x9'),auth[_0xf204('0xa')](),controller['show']);router[_0xf204('0xb')]('/',auth['isAuthenticated'](),controller[_0xf204('0xc')]);router[_0xf204('0xd')](_0xf204('0x9'),auth[_0xf204('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf204('0xe')]=router;
\ No newline at end of file
+var _0xd469=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x556730,_0x39cbbc){var _0x381001=function(_0x1a2572){while(--_0x1a2572){_0x556730['push'](_0x556730['shift']());}};_0x381001(++_0x39cbbc);}(_0xd469,0xfd));var _0x9d46=function(_0x1ebc40,_0x46811a){_0x1ebc40=_0x1ebc40-0x0;var _0x4565f1=_0xd469[_0x1ebc40];return _0x4565f1;};'use strict';var multer=require(_0x9d46('0x0'));var util=require(_0x9d46('0x1'));var path=require('path');var timeout=require(_0x9d46('0x2'));var express=require(_0x9d46('0x3'));var router=express[_0x9d46('0x4')]();var fs_extra=require(_0x9d46('0x5'));var auth=require(_0x9d46('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9d46('0x7'));var controller=require('./cannedAnswer.controller');router[_0x9d46('0x8')]('/',auth[_0x9d46('0x9')](),controller[_0x9d46('0xa')]);router['get']('/:id',auth[_0x9d46('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9d46('0xb')]);router[_0x9d46('0xc')](_0x9d46('0xd'),auth[_0x9d46('0x9')](),controller['update']);router[_0x9d46('0xe')](_0x9d46('0xd'),auth[_0x9d46('0x9')](),controller[_0x9d46('0xf')]);module[_0x9d46('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index abc7003..3209c15 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 _0x89e8=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x89e8,0x74));var _0x889e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x89e8[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x889e('0x0'));module[_0x889e('0x1')]={'calldate':{'type':Sequelize[_0x889e('0x2')],'allowNull':![],'defaultValue':_0x889e('0x3')},'clid':{'type':Sequelize[_0x889e('0x4')]},'src':{'type':Sequelize[_0x889e('0x4')]},'dst':{'type':Sequelize[_0x889e('0x4')]},'dcontext':{'type':Sequelize[_0x889e('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x889e('0x4')]},'duration':{'type':Sequelize[_0x889e('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x889e('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x889e('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x889e('0x4')]},'uniqueid':{'type':Sequelize[_0x889e('0x4')]},'linkedid':{'type':Sequelize[_0x889e('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x889e('0x4')]},'type':{'type':Sequelize[_0x889e('0x4')]},'tag':{'type':Sequelize[_0x889e('0x4')]}};
\ No newline at end of file
+var _0x87ae=['STRING','INTEGER','DATE'];(function(_0x48bb79,_0x2cbd8a){var _0x50d40c=function(_0x5a6a52){while(--_0x5a6a52){_0x48bb79['push'](_0x48bb79['shift']());}};_0x50d40c(++_0x2cbd8a);}(_0x87ae,0xf5));var _0xe87a=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x87ae[_0x4ce028];return _0x583d0c;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xe87a('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xe87a('0x1')]},'dst':{'type':Sequelize[_0xe87a('0x1')]},'dcontext':{'type':Sequelize[_0xe87a('0x1')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xe87a('0x1')]},'lastapp':{'type':Sequelize[_0xe87a('0x1')]},'lastdata':{'type':Sequelize[_0xe87a('0x1')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe87a('0x1')]},'amaflags':{'type':Sequelize[_0xe87a('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xe87a('0x1')]},'uniqueid':{'type':Sequelize[_0xe87a('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xe87a('0x1')]},'peeraccount':{'type':Sequelize[_0xe87a('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xe87a('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e1bdbf3..da91694 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 _0xe14b=['rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe14b,0x93));var _0xbe14=function(_0x443c60,_0xbbaca4){_0x443c60=_0x443c60-0x0;var _0x1a80ae=_0xe14b[_0x443c60];return _0x1a80ae;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['index']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={},_0x19252f={},_0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x27')](db[_0xbe14('0x28')][_0xbe14('0x29')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x2a')],'type':_0x16a159[_0xbe14('0x2b')][_0xbe14('0x2c')]};});_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x27')](_0x36d4b2,_0xbe14('0x25'));_0x19252f[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x3c3613[_0xbe14('0x2e')]);_0x19252f[_0xbe14('0x30')]=_['intersection'](_0x19252f[_0xbe14('0x2d')],_0x19252f['query']);_0x1c7cc7['attributes']=_[_0xbe14('0x31')](_0x19252f['model'],qs[_0xbe14('0x32')](_0x3c3613[_0xbe14('0x2e')]['fields']));_0x1c7cc7['attributes']=_0x1c7cc7['attributes'][_0xbe14('0x33')]?_0x1c7cc7[_0xbe14('0x34')]:_0x19252f['model'];if(!_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x35')](_0xbe14('0x36'))){_0x1c7cc7[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x3c3613['query']['limit']);_0x1c7cc7[_0xbe14('0x1c')]=qs['offset'](_0x3c3613['query']['offset']);}_0x1c7cc7[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x38')]);_0x1c7cc7[_0xbe14('0x39')]=qs[_0xbe14('0x30')](_[_0xbe14('0x3a')](_0x3c3613[_0xbe14('0x2e')],_0x19252f[_0xbe14('0x30')]),_0x36d4b2);if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]){_0x1c7cc7[_0xbe14('0x39')]=_['merge'](_0x1c7cc7['where'],{'$or':_[_0xbe14('0x27')](_0x36d4b2,function(_0x2951e1){if(_0x2951e1[_0xbe14('0x2b')]!=='VIRTUAL'){var _0x326329={};_0x326329[_0x2951e1[_0xbe14('0x25')]]={'$like':'%'+_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]+'%'};return _0x326329;}})});}_0x1c7cc7=_[_0xbe14('0x3c')]({},_0x1c7cc7,_0x3c3613[_0xbe14('0x3d')]);var _0x19fa30={'where':_0x1c7cc7[_0xbe14('0x39')]};return db[_0xbe14('0x28')]['count'](_0x19fa30)[_0xbe14('0x22')](function(_0x841b71){_0x34d648[_0xbe14('0x1b')]=_0x841b71;if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3e')]){_0x1c7cc7[_0xbe14('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0xbe14('0x40')](_0x1c7cc7);})[_0xbe14('0x22')](function(_0x1220c9){_0x34d648[_0xbe14('0x41')]=_0x1220c9;return _0x34d648;})['then'](respondWithFilteredResult(_0x3b3e84,_0x1c7cc7))['catch'](handleError(_0x3b3e84,null));};exports[_0xbe14('0x42')]=function(_0xe417b,_0x3272ae){var _0x51c859={'raw':!![],'where':{'id':_0xe417b[_0xbe14('0x43')]['id']}},_0x5d5318={};_0x5d5318['model']=_['keys'](db[_0xbe14('0x28')][_0xbe14('0x29')]);_0x5d5318[_0xbe14('0x2e')]=_['keys'](_0xe417b['query']);_0x5d5318['filters']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],_0x5d5318[_0xbe14('0x2e')]);_0x51c859['attributes']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],qs[_0xbe14('0x32')](_0xe417b[_0xbe14('0x2e')]['fields']));_0x51c859['attributes']=_0x51c859[_0xbe14('0x34')][_0xbe14('0x33')]?_0x51c859[_0xbe14('0x34')]:_0x5d5318[_0xbe14('0x2d')];if(_0xe417b[_0xbe14('0x2e')]['includeAll']){_0x51c859['include']=[{'all':!![]}];}_0x51c859=_[_0xbe14('0x3c')]({},_0x51c859,_0xe417b[_0xbe14('0x3d')]);return db[_0xbe14('0x28')][_0xbe14('0x44')](_0x51c859)['then'](handleEntityNotFound(_0x3272ae,null))[_0xbe14('0x22')](respondWithResult(_0x3272ae,null))[_0xbe14('0x45')](handleError(_0x3272ae,null));};exports['create']=function(_0x396e40,_0x2a35e5){return db[_0xbe14('0x28')][_0xbe14('0x46')](_0x396e40['body'],{})['then'](respondWithResult(_0x2a35e5,0xc9))[_0xbe14('0x45')](handleError(_0x2a35e5,null));};exports[_0xbe14('0x21')]=function(_0x4a1a37,_0x5acf90){if(_0x4a1a37[_0xbe14('0x47')]['id']){delete _0x4a1a37[_0xbe14('0x47')]['id'];}return db[_0xbe14('0x28')][_0xbe14('0x44')]({'where':{'id':_0x4a1a37[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x5acf90,null))[_0xbe14('0x22')](saveUpdates(_0x4a1a37['body'],null))[_0xbe14('0x22')](respondWithResult(_0x5acf90,null))[_0xbe14('0x45')](handleError(_0x5acf90,null));};exports[_0xbe14('0x48')]=function(_0x22b1f8,_0x2fc073){return db['Cdr'][_0xbe14('0x44')]({'where':{'id':_0x22b1f8[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x2fc073,null))[_0xbe14('0x22')](removeEntity(_0x2fc073,null))[_0xbe14('0x45')](handleError(_0x2fc073,null));};exports[_0xbe14('0x49')]=function(_0x505829,_0x5aeea9){return db[_0xbe14('0x28')][_0xbe14('0x49')]()[_0xbe14('0x22')](respondWithResult(_0x5aeea9,null))['catch'](handleError(_0x5aeea9,null));};
\ No newline at end of file
+var _0xdd0c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','then','includeAll','findAll','rows','catch','show','length','include','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x239013,_0x4b6af3){var _0x1f80af=function(_0x4b9517){while(--_0x4b9517){_0x239013['push'](_0x239013['shift']());}};_0x1f80af(++_0x4b6af3);}(_0xdd0c,0x165));var _0xcdd0=function(_0x569888,_0x1b93c6){_0x569888=_0x569888-0x0;var _0x1d2e0a=_0xdd0c[_0x569888];return _0x1d2e0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdd0('0x0'));var zipdir=require(_0xcdd0('0x1'));var jsonpatch=require(_0xcdd0('0x2'));var rp=require('request-promise');var moment=require(_0xcdd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdd0('0x4'));var util=require(_0xcdd0('0x5'));var path=require(_0xcdd0('0x6'));var sox=require(_0xcdd0('0x7'));var csv=require(_0xcdd0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd0('0x9'));var _=require(_0xcdd0('0xa'));var squel=require(_0xcdd0('0xb'));var crypto=require(_0xcdd0('0xc'));var jsforce=require(_0xcdd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdd0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd0('0xe'));var authService=require(_0xcdd0('0xf'));var qs=require(_0xcdd0('0x10'));var as=require(_0xcdd0('0x11'));var hardwareService=require(_0xcdd0('0x12'));var logger=require(_0xcdd0('0x13'))(_0xcdd0('0x14'));var utils=require(_0xcdd0('0x15'));var config=require(_0xcdd0('0x16'));var licenseUtil=require(_0xcdd0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1ff6,_0x356501){_0x356501=_0x356501||0xcc;return function(_0x14c775){if(_0x14c775){return _0x4a1ff6['sendStatus'](_0x356501);}return _0x4a1ff6[_0xcdd0('0x18')](_0x356501)[_0xcdd0('0x19')]();};}function respondWithResult(_0x4f4aa4,_0x1fc89a){_0x1fc89a=_0x1fc89a||0xc8;return function(_0x1d5bff){if(_0x1d5bff){return _0x4f4aa4[_0xcdd0('0x18')](_0x1fc89a)[_0xcdd0('0x1a')](_0x1d5bff);}};}function respondWithFilteredResult(_0xc1c3d5,_0x52aef5){return function(_0x5b5c06){if(_0x5b5c06){var _0x189f54=typeof _0x52aef5[_0xcdd0('0x1b')]===_0xcdd0('0x1c')&&typeof _0x52aef5[_0xcdd0('0x1d')]===_0xcdd0('0x1c');var _0x3b07a1=_0x5b5c06[_0xcdd0('0x1e')];var _0x2c199f=_0x189f54?0x0:_0x52aef5[_0xcdd0('0x1b')];var _0x14d55b=_0x189f54?_0x5b5c06['count']:_0x52aef5[_0xcdd0('0x1b')]+_0x52aef5[_0xcdd0('0x1d')];var _0x5060fa;if(_0x14d55b>=_0x3b07a1){_0x14d55b=_0x3b07a1;_0x5060fa=0xc8;}else{_0x5060fa=0xce;}_0xc1c3d5['status'](_0x5060fa);return _0xc1c3d5[_0xcdd0('0x1f')](_0xcdd0('0x20'),_0x2c199f+'-'+_0x14d55b+'/'+_0x3b07a1)['json'](_0x5b5c06);}return null;};}function patchUpdates(_0x12128e){return function(_0x4f7325){try{jsonpatch['apply'](_0x4f7325,_0x12128e,!![]);}catch(_0x4d038f){return BPromise[_0xcdd0('0x21')](_0x4d038f);}return _0x4f7325[_0xcdd0('0x22')]();};}function saveUpdates(_0x4afcfa,_0x2ab7e4){return function(_0x31a3e6){if(_0x31a3e6){return _0x31a3e6[_0xcdd0('0x23')](_0x4afcfa)['then'](function(_0x9d4727){return _0x9d4727;});}return null;};}function removeEntity(_0x7be0ac,_0x509e9c){return function(_0x3c81b1){if(_0x3c81b1){return _0x3c81b1[_0xcdd0('0x24')]()['then'](function(){_0x7be0ac[_0xcdd0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3797c2,_0x64b52){return function(_0x476018){if(!_0x476018){_0x3797c2['sendStatus'](0x194);}return _0x476018;};}function handleError(_0x22fd47,_0x10cba2){_0x10cba2=_0x10cba2||0x1f4;return function(_0x5e5cc){logger[_0xcdd0('0x25')](_0x5e5cc[_0xcdd0('0x26')]);if(_0x5e5cc[_0xcdd0('0x27')]){delete _0x5e5cc[_0xcdd0('0x27')];}_0x22fd47[_0xcdd0('0x18')](_0x10cba2)[_0xcdd0('0x28')](_0x5e5cc);};}exports[_0xcdd0('0x29')]=function(_0x4074e0,_0x49cfe0){var _0x28084c={},_0xd6d64f={},_0x1bbe37={'count':0x0,'rows':[]};var _0x5b8635=_[_0xcdd0('0x2a')](db[_0xcdd0('0x2b')][_0xcdd0('0x2c')],function(_0x477d1a){return{'name':_0x477d1a[_0xcdd0('0x2d')],'type':_0x477d1a['type'][_0xcdd0('0x2e')]};});_0xd6d64f[_0xcdd0('0x2f')]=_[_0xcdd0('0x2a')](_0x5b8635,'name');_0xd6d64f['query']=_[_0xcdd0('0x30')](_0x4074e0[_0xcdd0('0x31')]);_0xd6d64f[_0xcdd0('0x32')]=_['intersection'](_0xd6d64f[_0xcdd0('0x2f')],_0xd6d64f[_0xcdd0('0x31')]);_0x28084c['attributes']=_[_0xcdd0('0x33')](_0xd6d64f[_0xcdd0('0x2f')],qs[_0xcdd0('0x34')](_0x4074e0[_0xcdd0('0x31')]['fields']));_0x28084c[_0xcdd0('0x35')]=_0x28084c[_0xcdd0('0x35')]['length']?_0x28084c[_0xcdd0('0x35')]:_0xd6d64f[_0xcdd0('0x2f')];if(!_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x36')]('nolimit')){_0x28084c[_0xcdd0('0x1d')]=qs[_0xcdd0('0x1d')](_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x1d')]);_0x28084c[_0xcdd0('0x1b')]=qs['offset'](_0x4074e0[_0xcdd0('0x31')]['offset']);}_0x28084c['order']=qs['sort'](_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x37')]);_0x28084c[_0xcdd0('0x38')]=qs[_0xcdd0('0x32')](_[_0xcdd0('0x39')](_0x4074e0[_0xcdd0('0x31')],_0xd6d64f[_0xcdd0('0x32')]),_0x5b8635);if(_0x4074e0['query'][_0xcdd0('0x3a')]){_0x28084c[_0xcdd0('0x38')]=_[_0xcdd0('0x3b')](_0x28084c[_0xcdd0('0x38')],{'$or':_['map'](_0x5b8635,function(_0x4934a5){if(_0x4934a5[_0xcdd0('0x3c')]!==_0xcdd0('0x3d')){var _0x47a5f5={};_0x47a5f5[_0x4934a5[_0xcdd0('0x27')]]={'$like':'%'+_0x4074e0[_0xcdd0('0x31')]['filter']+'%'};return _0x47a5f5;}})});}_0x28084c=_[_0xcdd0('0x3b')]({},_0x28084c,_0x4074e0['options']);var _0x41ce22={'where':_0x28084c['where']};return db[_0xcdd0('0x2b')][_0xcdd0('0x1e')](_0x41ce22)[_0xcdd0('0x3e')](function(_0x271f47){_0x1bbe37['count']=_0x271f47;if(_0x4074e0[_0xcdd0('0x31')][_0xcdd0('0x3f')]){_0x28084c['include']=[{'all':!![]}];}return db[_0xcdd0('0x2b')][_0xcdd0('0x40')](_0x28084c);})[_0xcdd0('0x3e')](function(_0x27ce74){_0x1bbe37[_0xcdd0('0x41')]=_0x27ce74;return _0x1bbe37;})[_0xcdd0('0x3e')](respondWithFilteredResult(_0x49cfe0,_0x28084c))[_0xcdd0('0x42')](handleError(_0x49cfe0,null));};exports[_0xcdd0('0x43')]=function(_0x375e89,_0xce8a50){var _0x5f0c94={'raw':!![],'where':{'id':_0x375e89['params']['id']}},_0x2718b3={};_0x2718b3['model']=_[_0xcdd0('0x30')](db['Cdr'][_0xcdd0('0x2c')]);_0x2718b3[_0xcdd0('0x31')]=_[_0xcdd0('0x30')](_0x375e89[_0xcdd0('0x31')]);_0x2718b3[_0xcdd0('0x32')]=_['intersection'](_0x2718b3[_0xcdd0('0x2f')],_0x2718b3['query']);_0x5f0c94['attributes']=_[_0xcdd0('0x33')](_0x2718b3[_0xcdd0('0x2f')],qs['fields'](_0x375e89['query']['fields']));_0x5f0c94[_0xcdd0('0x35')]=_0x5f0c94[_0xcdd0('0x35')][_0xcdd0('0x44')]?_0x5f0c94['attributes']:_0x2718b3[_0xcdd0('0x2f')];if(_0x375e89[_0xcdd0('0x31')][_0xcdd0('0x3f')]){_0x5f0c94[_0xcdd0('0x45')]=[{'all':!![]}];}_0x5f0c94=_[_0xcdd0('0x3b')]({},_0x5f0c94,_0x375e89['options']);return db[_0xcdd0('0x2b')]['find'](_0x5f0c94)[_0xcdd0('0x3e')](handleEntityNotFound(_0xce8a50,null))[_0xcdd0('0x3e')](respondWithResult(_0xce8a50,null))[_0xcdd0('0x42')](handleError(_0xce8a50,null));};exports[_0xcdd0('0x46')]=function(_0x265cfb,_0x2fc567){return db[_0xcdd0('0x2b')][_0xcdd0('0x46')](_0x265cfb[_0xcdd0('0x47')],{})[_0xcdd0('0x3e')](respondWithResult(_0x2fc567,0xc9))[_0xcdd0('0x42')](handleError(_0x2fc567,null));};exports[_0xcdd0('0x23')]=function(_0x3afae8,_0x6c2cb8){if(_0x3afae8[_0xcdd0('0x47')]['id']){delete _0x3afae8['body']['id'];}return db[_0xcdd0('0x2b')][_0xcdd0('0x48')]({'where':{'id':_0x3afae8[_0xcdd0('0x49')]['id']}})[_0xcdd0('0x3e')](handleEntityNotFound(_0x6c2cb8,null))[_0xcdd0('0x3e')](saveUpdates(_0x3afae8[_0xcdd0('0x47')],null))[_0xcdd0('0x3e')](respondWithResult(_0x6c2cb8,null))[_0xcdd0('0x42')](handleError(_0x6c2cb8,null));};exports[_0xcdd0('0x24')]=function(_0x214cdd,_0x36156c){return db[_0xcdd0('0x2b')][_0xcdd0('0x48')]({'where':{'id':_0x214cdd[_0xcdd0('0x49')]['id']}})['then'](handleEntityNotFound(_0x36156c,null))[_0xcdd0('0x3e')](removeEntity(_0x36156c,null))[_0xcdd0('0x42')](handleError(_0x36156c,null));};exports[_0xcdd0('0x4a')]=function(_0xc7370e,_0x46c578){return db[_0xcdd0('0x2b')][_0xcdd0('0x4a')]()['then'](respondWithResult(_0x46c578,null))[_0xcdd0('0x42')](handleError(_0x46c578,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index a2cc64e..fe61065 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(_0x4192e7,_0x524083){var _0x126235=function(_0x474509){while(--_0x474509){_0x4192e7['push'](_0x4192e7['shift']());}};_0x126235(++_0x524083);}(_0x7a54,0x106));var _0x47a5=function(_0x1371f1,_0x193453){_0x1371f1=_0x1371f1-0x0;var _0x1542fc=_0x7a54[_0x1371f1];return _0x1542fc;};'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(_0x22b7a6,_0x3ce62c){var _0x1b750e=function(_0x576272){while(--_0x576272){_0x22b7a6['push'](_0x22b7a6['shift']());}};_0x1b750e(++_0x3ce62c);}(_0x7a54,0x106));var _0x47a5=function(_0x505e7e,_0x558dd6){_0x505e7e=_0x505e7e-0x0;var _0x15dcb5=_0x7a54[_0x505e7e];return _0x15dcb5;};'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 dd3d93d..3c7db57 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 _0x623d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x225787,_0x13e489){var _0x4ef075=function(_0x476392){while(--_0x476392){_0x225787['push'](_0x225787['shift']());}};_0x4ef075(++_0x13e489);}(_0x623d,0x112));var _0xd623=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x623d[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xd623('0x0'));var util=require(_0xd623('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd623('0x2'));var fs=require('fs');var Redis=require(_0xd623('0x3'));var db=require(_0xd623('0x4'))['db'];var utils=require(_0xd623('0x5'));var logger=require(_0xd623('0x6'))('rpc');var config=require(_0xd623('0x7'));var jayson=require(_0xd623('0x8'));var client=jayson[_0xd623('0x9')][_0xd623('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ac57,_0x54ad7e,_0x29ef98){return new BPromise(function(_0x18e522,_0x251f99){return client[_0xd623('0xb')](_0x23ac57,_0x29ef98)[_0xd623('0xc')](function(_0x2f3618){logger[_0xd623('0xd')]('Cdr,\x20%s,\x20%s',_0x54ad7e,_0xd623('0xe'));logger[_0xd623('0xf')](_0xd623('0x10'),_0x54ad7e,'request\x20sent',JSON[_0xd623('0x11')](_0x2f3618));if(_0x2f3618[_0xd623('0x12')]){if(_0x2f3618[_0xd623('0x12')]['code']===0x1f4){logger['error'](_0xd623('0x13'),_0x54ad7e,_0x2f3618[_0xd623('0x12')]['message']);return _0x251f99(_0x2f3618[_0xd623('0x12')][_0xd623('0x14')]);}logger[_0xd623('0x12')](_0xd623('0x13'),_0x54ad7e,_0x2f3618[_0xd623('0x12')][_0xd623('0x14')]);return _0x18e522(_0x2f3618[_0xd623('0x12')][_0xd623('0x14')]);}else{logger[_0xd623('0xd')]('Cdr,\x20%s,\x20%s',_0x54ad7e,_0xd623('0xe'));_0x18e522(_0x2f3618[_0xd623('0x15')]['message']);}})[_0xd623('0x16')](function(_0x4041bf){logger['error'](_0xd623('0x13'),_0x54ad7e,_0x4041bf);_0x251f99(_0x4041bf);});});}
\ No newline at end of file
+var _0x4b2e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b2e,0x18e));var _0xe4b2=function(_0x2b0aec,_0x86e4ad){_0x2b0aec=_0x2b0aec-0x0;var _0x2aef33=_0x4b2e[_0x2b0aec];return _0x2aef33;};'use strict';var _=require('lodash');var util=require(_0xe4b2('0x0'));var moment=require('moment');var BPromise=require(_0xe4b2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4b2('0x2'));var db=require(_0xe4b2('0x3'))['db'];var utils=require(_0xe4b2('0x4'));var logger=require(_0xe4b2('0x5'))(_0xe4b2('0x6'));var config=require('../../config/environment');var jayson=require(_0xe4b2('0x7'));var client=jayson[_0xe4b2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55a9ea,_0x5a928d,_0x1b4752){return new BPromise(function(_0x2de17f,_0x3dbbf3){return client[_0xe4b2('0x9')](_0x55a9ea,_0x1b4752)[_0xe4b2('0xa')](function(_0x32c69c){logger['info'](_0xe4b2('0xb'),_0x5a928d,_0xe4b2('0xc'));logger[_0xe4b2('0xd')](_0xe4b2('0xe'),_0x5a928d,_0xe4b2('0xc'),JSON['stringify'](_0x32c69c));if(_0x32c69c[_0xe4b2('0xf')]){if(_0x32c69c[_0xe4b2('0xf')][_0xe4b2('0x10')]===0x1f4){logger[_0xe4b2('0xf')]('Cdr,\x20%s,\x20%s',_0x5a928d,_0x32c69c['error']['message']);return _0x3dbbf3(_0x32c69c[_0xe4b2('0xf')][_0xe4b2('0x11')]);}logger[_0xe4b2('0xf')](_0xe4b2('0xb'),_0x5a928d,_0x32c69c[_0xe4b2('0xf')][_0xe4b2('0x11')]);return _0x2de17f(_0x32c69c[_0xe4b2('0xf')][_0xe4b2('0x11')]);}else{logger[_0xe4b2('0x12')](_0xe4b2('0xb'),_0x5a928d,'request\x20sent');_0x2de17f(_0x32c69c['result'][_0xe4b2('0x11')]);}})[_0xe4b2('0x13')](function(_0x29c0f8){logger[_0xe4b2('0xf')](_0xe4b2('0xb'),_0x5a928d,_0x29c0f8);_0x3dbbf3(_0x29c0f8);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index d225d01..1ee97e8 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x3a31ac,_0x5e2c44){var _0x2aa2bc=function(_0x378452){while(--_0x378452){_0x3a31ac['push'](_0x3a31ac['shift']());}};_0x2aa2bc(++_0x5e2c44);}(_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
+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(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index a1f3810..86116fb 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 _0x7144=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x7144,0x1f3));var _0x4714=function(_0x385c09,_0x29501b){_0x385c09=_0x385c09-0x0;var _0x368cd9=_0x7144[_0x385c09];return _0x368cd9;};'use strict';var Sequelize=require('sequelize');module[_0x4714('0x0')]={'priority':{'type':Sequelize[_0x4714('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4714('0x2')],'allowNull':![],'defaultValue':_0x4714('0x3')},'appdata':{'type':Sequelize[_0x4714('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4714('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x3017=['*,*,*,*','INTEGER','STRING','TEXT'];(function(_0x5162ed,_0x386cb7){var _0x4c579b=function(_0x189260){while(--_0x189260){_0x5162ed['push'](_0x5162ed['shift']());}};_0x4c579b(++_0x386cb7);}(_0x3017,0x18d));var _0x7301=function(_0x42d902,_0x2ee119){_0x42d902=_0x42d902-0x0;var _0x39db2a=_0x3017[_0x42d902];return _0x39db2a;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x7301('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x7301('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7301('0x2')]()},'description':{'type':Sequelize[_0x7301('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7301('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index a2b83a0..e9c1cdb 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 _0xcaa3=['Content-Range','apply','update','destroy','then','end','sendStatus','error','stack','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','length','includeAll','include','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count','set'];(function(_0x498f67,_0x3c24c9){var _0x10ec95=function(_0x39899d){while(--_0x39899d){_0x498f67['push'](_0x498f67['shift']());}};_0x10ec95(++_0x3c24c9);}(_0xcaa3,0xcb));var _0x3caa=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xcaa3[_0xe73080];return _0x12cbc4;};'use strict';var emlformat=require(_0x3caa('0x0'));var rimraf=require(_0x3caa('0x1'));var zipdir=require(_0x3caa('0x2'));var jsonpatch=require(_0x3caa('0x3'));var rp=require(_0x3caa('0x4'));var moment=require(_0x3caa('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3caa('0x6'));var path=require(_0x3caa('0x7'));var sox=require(_0x3caa('0x8'));var csv=require(_0x3caa('0x9'));var ejs=require(_0x3caa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3caa('0xb'));var squel=require(_0x3caa('0xc'));var crypto=require(_0x3caa('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3caa('0xe'));var toCsv=require(_0x3caa('0x9'));var querystring=require(_0x3caa('0xf'));var Papa=require(_0x3caa('0x10'));var Redis=require(_0x3caa('0x11'));var authService=require(_0x3caa('0x12'));var qs=require(_0x3caa('0x13'));var as=require(_0x3caa('0x14'));var hardwareService=require(_0x3caa('0x15'));var logger=require(_0x3caa('0x16'))(_0x3caa('0x17'));var utils=require(_0x3caa('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3caa('0x19'))['db'];function respondWithStatusCode(_0xe1df65,_0x47da19){_0x47da19=_0x47da19||0xcc;return function(_0x1ec89c){if(_0x1ec89c){return _0xe1df65['sendStatus'](_0x47da19);}return _0xe1df65[_0x3caa('0x1a')](_0x47da19)['end']();};}function respondWithResult(_0x185593,_0x24791e){_0x24791e=_0x24791e||0xc8;return function(_0x1b18e3){if(_0x1b18e3){return _0x185593['status'](_0x24791e)[_0x3caa('0x1b')](_0x1b18e3);}};}function respondWithFilteredResult(_0x47e528,_0x459bb1){return function(_0x12744c){if(_0x12744c){var _0x563cdd=typeof _0x459bb1[_0x3caa('0x1c')]===_0x3caa('0x1d')&&typeof _0x459bb1[_0x3caa('0x1e')]==='undefined';var _0xbfe273=_0x12744c[_0x3caa('0x1f')];var _0x1ba912=_0x563cdd?0x0:_0x459bb1[_0x3caa('0x1c')];var _0xfcbdad=_0x563cdd?_0x12744c[_0x3caa('0x1f')]:_0x459bb1[_0x3caa('0x1c')]+_0x459bb1['limit'];var _0x4c47be;if(_0xfcbdad>=_0xbfe273){_0xfcbdad=_0xbfe273;_0x4c47be=0xc8;}else{_0x4c47be=0xce;}_0x47e528[_0x3caa('0x1a')](_0x4c47be);return _0x47e528[_0x3caa('0x20')](_0x3caa('0x21'),_0x1ba912+'-'+_0xfcbdad+'/'+_0xbfe273)['json'](_0x12744c);}return null;};}function patchUpdates(_0x34f44f){return function(_0x2dfc98){try{jsonpatch[_0x3caa('0x22')](_0x2dfc98,_0x34f44f,!![]);}catch(_0x105265){return BPromise['reject'](_0x105265);}return _0x2dfc98['save']();};}function saveUpdates(_0x3d7dec,_0x3b04ca){return function(_0x1eff81){if(_0x1eff81){return _0x1eff81[_0x3caa('0x23')](_0x3d7dec)['then'](function(_0x366a6c){return _0x366a6c;});}return null;};}function removeEntity(_0x4bfc8e,_0x556bb8){return function(_0x1b0308){if(_0x1b0308){return _0x1b0308[_0x3caa('0x24')]()[_0x3caa('0x25')](function(){_0x4bfc8e[_0x3caa('0x1a')](0xcc)[_0x3caa('0x26')]();});}};}function handleEntityNotFound(_0x422a92,_0x3c42fb){return function(_0x48c378){if(!_0x48c378){_0x422a92[_0x3caa('0x27')](0x194);}return _0x48c378;};}function handleError(_0x9ecb20,_0x38c00f){_0x38c00f=_0x38c00f||0x1f4;return function(_0x8d7851){logger[_0x3caa('0x28')](_0x8d7851[_0x3caa('0x29')]);if(_0x8d7851['name']){delete _0x8d7851['name'];}_0x9ecb20['status'](_0x38c00f)[_0x3caa('0x2a')](_0x8d7851);};}exports[_0x3caa('0x2b')]=function(_0x5255b7,_0x11f340){var _0x738069={'raw':!![],'where':{'id':_0x5255b7[_0x3caa('0x2c')]['id']}},_0x55050f={};_0x55050f[_0x3caa('0x2d')]=_[_0x3caa('0x2e')](db[_0x3caa('0x2f')][_0x3caa('0x30')]);_0x55050f[_0x3caa('0x31')]=_[_0x3caa('0x2e')](_0x5255b7[_0x3caa('0x31')]);_0x55050f[_0x3caa('0x32')]=_['intersection'](_0x55050f[_0x3caa('0x2d')],_0x55050f['query']);_0x738069[_0x3caa('0x33')]=_['intersection'](_0x55050f['model'],qs['fields'](_0x5255b7[_0x3caa('0x31')][_0x3caa('0x34')]));_0x738069[_0x3caa('0x33')]=_0x738069[_0x3caa('0x33')][_0x3caa('0x35')]?_0x738069['attributes']:_0x55050f['model'];if(_0x5255b7['query'][_0x3caa('0x36')]){_0x738069[_0x3caa('0x37')]=[{'all':!![]}];}_0x738069=_['merge']({},_0x738069,_0x5255b7['options']);return db['ChatApplication']['find'](_0x738069)['then'](handleEntityNotFound(_0x11f340,null))[_0x3caa('0x25')](respondWithResult(_0x11f340,null))[_0x3caa('0x38')](handleError(_0x11f340,null));};exports['update']=function(_0x5a0467,_0x4dc938){if(_0x5a0467['body']['id']){delete _0x5a0467[_0x3caa('0x39')]['id'];}return db[_0x3caa('0x2f')][_0x3caa('0x3a')]({'where':{'id':_0x5a0467['params']['id']}})['then'](handleEntityNotFound(_0x4dc938,null))['then'](saveUpdates(_0x5a0467[_0x3caa('0x39')],null))[_0x3caa('0x25')](respondWithResult(_0x4dc938,null))[_0x3caa('0x38')](handleError(_0x4dc938,null));};exports[_0x3caa('0x24')]=function(_0x364f21,_0x3da966){return db[_0x3caa('0x2f')][_0x3caa('0x3a')]({'where':{'id':_0x364f21[_0x3caa('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3da966,null))[_0x3caa('0x25')](removeEntity(_0x3da966,null))['catch'](handleError(_0x3da966,null));};
\ No newline at end of file
+var _0x76bc=['send','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','name'];(function(_0xdd8feb,_0x48cc45){var _0x87ea75=function(_0x2256f5){while(--_0x2256f5){_0xdd8feb['push'](_0xdd8feb['shift']());}};_0x87ea75(++_0x48cc45);}(_0x76bc,0x17f));var _0xc76b=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x76bc[_0x2b5513];return _0x578fd2;};'use strict';var emlformat=require(_0xc76b('0x0'));var rimraf=require(_0xc76b('0x1'));var zipdir=require(_0xc76b('0x2'));var jsonpatch=require(_0xc76b('0x3'));var rp=require(_0xc76b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc76b('0x5'));var util=require(_0xc76b('0x6'));var path=require(_0xc76b('0x7'));var sox=require(_0xc76b('0x8'));var csv=require(_0xc76b('0x9'));var ejs=require(_0xc76b('0xa'));var fs=require('fs');var fs_extra=require(_0xc76b('0xb'));var _=require(_0xc76b('0xc'));var squel=require(_0xc76b('0xd'));var crypto=require(_0xc76b('0xe'));var jsforce=require(_0xc76b('0xf'));var deskjs=require(_0xc76b('0x10'));var toCsv=require(_0xc76b('0x9'));var querystring=require(_0xc76b('0x11'));var Papa=require(_0xc76b('0x12'));var Redis=require(_0xc76b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc76b('0x14'));var as=require(_0xc76b('0x15'));var hardwareService=require(_0xc76b('0x16'));var logger=require(_0xc76b('0x17'))(_0xc76b('0x18'));var utils=require(_0xc76b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc76b('0x1a'));var db=require(_0xc76b('0x1b'))['db'];function respondWithStatusCode(_0x30835f,_0xc84b2c){_0xc84b2c=_0xc84b2c||0xcc;return function(_0x4474cd){if(_0x4474cd){return _0x30835f[_0xc76b('0x1c')](_0xc84b2c);}return _0x30835f[_0xc76b('0x1d')](_0xc84b2c)['end']();};}function respondWithResult(_0x538ca8,_0x38a0f1){_0x38a0f1=_0x38a0f1||0xc8;return function(_0x25e4a1){if(_0x25e4a1){return _0x538ca8[_0xc76b('0x1d')](_0x38a0f1)[_0xc76b('0x1e')](_0x25e4a1);}};}function respondWithFilteredResult(_0x25752f,_0x5d1130){return function(_0x21d99a){if(_0x21d99a){var _0x2db167=typeof _0x5d1130[_0xc76b('0x1f')]==='undefined'&&typeof _0x5d1130['limit']===_0xc76b('0x20');var _0x2d3e9d=_0x21d99a[_0xc76b('0x21')];var _0x3e716e=_0x2db167?0x0:_0x5d1130[_0xc76b('0x1f')];var _0x55a61d=_0x2db167?_0x21d99a['count']:_0x5d1130['offset']+_0x5d1130[_0xc76b('0x22')];var _0x164d38;if(_0x55a61d>=_0x2d3e9d){_0x55a61d=_0x2d3e9d;_0x164d38=0xc8;}else{_0x164d38=0xce;}_0x25752f[_0xc76b('0x1d')](_0x164d38);return _0x25752f[_0xc76b('0x23')](_0xc76b('0x24'),_0x3e716e+'-'+_0x55a61d+'/'+_0x2d3e9d)[_0xc76b('0x1e')](_0x21d99a);}return null;};}function patchUpdates(_0x336be9){return function(_0x20aed4){try{jsonpatch[_0xc76b('0x25')](_0x20aed4,_0x336be9,!![]);}catch(_0x393b0b){return BPromise['reject'](_0x393b0b);}return _0x20aed4[_0xc76b('0x26')]();};}function saveUpdates(_0x4bf5a9,_0x51fafe){return function(_0x3bbede){if(_0x3bbede){return _0x3bbede[_0xc76b('0x27')](_0x4bf5a9)[_0xc76b('0x28')](function(_0xac9a7f){return _0xac9a7f;});}return null;};}function removeEntity(_0x18332d,_0xa6a862){return function(_0x24ee9a){if(_0x24ee9a){return _0x24ee9a[_0xc76b('0x29')]()['then'](function(){_0x18332d[_0xc76b('0x1d')](0xcc)[_0xc76b('0x2a')]();});}};}function handleEntityNotFound(_0x5f0a7b,_0xf43320){return function(_0x2ac9de){if(!_0x2ac9de){_0x5f0a7b[_0xc76b('0x1c')](0x194);}return _0x2ac9de;};}function handleError(_0x25ea69,_0x369fc1){_0x369fc1=_0x369fc1||0x1f4;return function(_0x451ee1){logger['error'](_0x451ee1['stack']);if(_0x451ee1[_0xc76b('0x2b')]){delete _0x451ee1[_0xc76b('0x2b')];}_0x25ea69[_0xc76b('0x1d')](_0x369fc1)[_0xc76b('0x2c')](_0x451ee1);};}exports['show']=function(_0xd92178,_0x26c19b){var _0x35d1bc={'raw':!![],'where':{'id':_0xd92178[_0xc76b('0x2d')]['id']}},_0x4a0918={};_0x4a0918[_0xc76b('0x2e')]=_[_0xc76b('0x2f')](db[_0xc76b('0x30')]['rawAttributes']);_0x4a0918[_0xc76b('0x31')]=_[_0xc76b('0x2f')](_0xd92178[_0xc76b('0x31')]);_0x4a0918[_0xc76b('0x32')]=_[_0xc76b('0x33')](_0x4a0918['model'],_0x4a0918[_0xc76b('0x31')]);_0x35d1bc['attributes']=_[_0xc76b('0x33')](_0x4a0918[_0xc76b('0x2e')],qs[_0xc76b('0x34')](_0xd92178[_0xc76b('0x31')][_0xc76b('0x34')]));_0x35d1bc[_0xc76b('0x35')]=_0x35d1bc['attributes']['length']?_0x35d1bc[_0xc76b('0x35')]:_0x4a0918[_0xc76b('0x2e')];if(_0xd92178[_0xc76b('0x31')][_0xc76b('0x36')]){_0x35d1bc[_0xc76b('0x37')]=[{'all':!![]}];}_0x35d1bc=_[_0xc76b('0x38')]({},_0x35d1bc,_0xd92178[_0xc76b('0x39')]);return db[_0xc76b('0x30')][_0xc76b('0x3a')](_0x35d1bc)[_0xc76b('0x28')](handleEntityNotFound(_0x26c19b,null))[_0xc76b('0x28')](respondWithResult(_0x26c19b,null))[_0xc76b('0x3b')](handleError(_0x26c19b,null));};exports[_0xc76b('0x27')]=function(_0x21bc23,_0xb3c2c6){if(_0x21bc23['body']['id']){delete _0x21bc23[_0xc76b('0x3c')]['id'];}return db[_0xc76b('0x30')][_0xc76b('0x3a')]({'where':{'id':_0x21bc23[_0xc76b('0x2d')]['id']}})[_0xc76b('0x28')](handleEntityNotFound(_0xb3c2c6,null))[_0xc76b('0x28')](saveUpdates(_0x21bc23[_0xc76b('0x3c')],null))[_0xc76b('0x28')](respondWithResult(_0xb3c2c6,null))[_0xc76b('0x3b')](handleError(_0xb3c2c6,null));};exports[_0xc76b('0x29')]=function(_0x41d26d,_0x3fc3d7){return db[_0xc76b('0x30')][_0xc76b('0x3a')]({'where':{'id':_0x41d26d['params']['id']}})[_0xc76b('0x28')](handleEntityNotFound(_0x3fc3d7,null))['then'](removeEntity(_0x3fc3d7,null))[_0xc76b('0x3b')](handleError(_0x3fc3d7,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index fe4ce32..2636dd8 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 _0xcc3b=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications'];(function(_0x139928,_0x41ed69){var _0x16ef95=function(_0x12e1cf){while(--_0x12e1cf){_0x139928['push'](_0x139928['shift']());}};_0x16ef95(++_0x41ed69);}(_0xcc3b,0x119));var _0xbcc3=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xcc3b[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xbcc3('0x0'));var util=require(_0xbcc3('0x1'));var logger=require(_0xbcc3('0x2'))(_0xbcc3('0x3'));var moment=require(_0xbcc3('0x4'));var BPromise=require(_0xbcc3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcc3('0x6'));var rimraf=require(_0xbcc3('0x7'));var config=require(_0xbcc3('0x8'));var attributes=require(_0xbcc3('0x9'));module[_0xbcc3('0xa')]=function(_0x4e6c92,_0x3a1f9d){return _0x4e6c92[_0xbcc3('0xb')]('ChatApplication',attributes,{'tableName':_0xbcc3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbcc3('0xd')});};
\ No newline at end of file
+var _0x5da8=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatApplication.attributes','define'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x5da8,0x1cb));var _0x85da=function(_0x56a0ec,_0x4bf91b){_0x56a0ec=_0x56a0ec-0x0;var _0x42966f=_0x5da8[_0x56a0ec];return _0x42966f;};'use strict';var _=require(_0x85da('0x0'));var util=require('util');var logger=require(_0x85da('0x1'))(_0x85da('0x2'));var moment=require(_0x85da('0x3'));var BPromise=require(_0x85da('0x4'));var rp=require(_0x85da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85da('0x6'));var attributes=require(_0x85da('0x7'));module['exports']=function(_0x492f7d,_0x21d7a0){return _0x492f7d[_0x85da('0x8')](_0x85da('0x9'),attributes,{'tableName':_0x85da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x85da('0xb'),'collate':_0x85da('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 99d92df..47dee06 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 _0x5905=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5905,0xe3));var _0x5590=function(_0x20e7a7,_0x503cae){_0x20e7a7=_0x20e7a7-0x0;var _0x259372=_0x5905[_0x20e7a7];return _0x259372;};'use strict';var _=require(_0x5590('0x0'));var util=require('util');var moment=require(_0x5590('0x1'));var BPromise=require(_0x5590('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5590('0x3'));var db=require(_0x5590('0x4'))['db'];var utils=require(_0x5590('0x5'));var logger=require(_0x5590('0x6'))(_0x5590('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5590('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1399be,_0x158ed9,_0x52ec4a){return new BPromise(function(_0x517761,_0x24a973){return client[_0x5590('0x9')](_0x1399be,_0x52ec4a)[_0x5590('0xa')](function(_0x4339ff){logger[_0x5590('0xb')](_0x5590('0xc'),_0x158ed9,'request\x20sent');logger[_0x5590('0xd')](_0x5590('0xe'),_0x158ed9,_0x5590('0xf'),JSON[_0x5590('0x10')](_0x4339ff));if(_0x4339ff[_0x5590('0x11')]){if(_0x4339ff[_0x5590('0x11')][_0x5590('0x12')]===0x1f4){logger[_0x5590('0x11')](_0x5590('0xc'),_0x158ed9,_0x4339ff[_0x5590('0x11')][_0x5590('0x13')]);return _0x24a973(_0x4339ff['error']['message']);}logger[_0x5590('0x11')](_0x5590('0xc'),_0x158ed9,_0x4339ff['error'][_0x5590('0x13')]);return _0x517761(_0x4339ff[_0x5590('0x11')][_0x5590('0x13')]);}else{logger[_0x5590('0xb')](_0x5590('0xc'),_0x158ed9,_0x5590('0xf'));_0x517761(_0x4339ff[_0x5590('0x14')][_0x5590('0x13')]);}})['catch'](function(_0xe6cc50){logger[_0x5590('0x11')]('ChatApplication,\x20%s,\x20%s',_0x158ed9,_0xe6cc50);_0x24a973(_0xe6cc50);});});}
\ No newline at end of file
+var _0x274d=['rpc','../../config/environment','jayson/promise','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis','../../config/logger'];(function(_0x2b4d01,_0x4c6044){var _0x4195d7=function(_0x59935){while(--_0x59935){_0x2b4d01['push'](_0x2b4d01['shift']());}};_0x4195d7(++_0x4c6044);}(_0x274d,0x1b4));var _0xd274=function(_0x1b3884,_0x9aab32){_0x1b3884=_0x1b3884-0x0;var _0x5908ca=_0x274d[_0x1b3884];return _0x5908ca;};'use strict';var _=require(_0xd274('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd274('0x1'));var fs=require('fs');var Redis=require(_0xd274('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd274('0x3'))(_0xd274('0x4'));var config=require(_0xd274('0x5'));var jayson=require(_0xd274('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5dd022,_0x22c2c2,_0x2de697){return new BPromise(function(_0x4732e9,_0x222ac9){return client[_0xd274('0x7')](_0x5dd022,_0x2de697)[_0xd274('0x8')](function(_0x58248e){logger['info'](_0xd274('0x9'),_0x22c2c2,'request\x20sent');logger[_0xd274('0xa')](_0xd274('0xb'),_0x22c2c2,_0xd274('0xc'),JSON[_0xd274('0xd')](_0x58248e));if(_0x58248e[_0xd274('0xe')]){if(_0x58248e['error'][_0xd274('0xf')]===0x1f4){logger[_0xd274('0xe')](_0xd274('0x9'),_0x22c2c2,_0x58248e['error'][_0xd274('0x10')]);return _0x222ac9(_0x58248e[_0xd274('0xe')][_0xd274('0x10')]);}logger[_0xd274('0xe')](_0xd274('0x9'),_0x22c2c2,_0x58248e[_0xd274('0xe')]['message']);return _0x4732e9(_0x58248e[_0xd274('0xe')]['message']);}else{logger[_0xd274('0x11')](_0xd274('0x9'),_0x22c2c2,'request\x20sent');_0x4732e9(_0x58248e[_0xd274('0x12')][_0xd274('0x10')]);}})[_0xd274('0x13')](function(_0x913a48){logger[_0xd274('0xe')](_0xd274('0x9'),_0x22c2c2,_0x913a48);_0x222ac9(_0x913a48);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index d4c29fe..51611d8 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 _0x90e4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x477a3f,_0x2e0e85){var _0x375942=function(_0x3645eb){while(--_0x3645eb){_0x477a3f['push'](_0x477a3f['shift']());}};_0x375942(++_0x2e0e85);}(_0x90e4,0xfb));var _0x490e=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x90e4[_0x145b3c];return _0x1b6e36;};'use strict';var multer=require(_0x490e('0x0'));var util=require('util');var path=require(_0x490e('0x1'));var timeout=require(_0x490e('0x2'));var express=require(_0x490e('0x3'));var router=express[_0x490e('0x4')]();var fs_extra=require(_0x490e('0x5'));var auth=require(_0x490e('0x6'));var interaction=require(_0x490e('0x7'));var config=require(_0x490e('0x8'));var controller=require('./chatApplication.controller');router[_0x490e('0x9')](_0x490e('0xa'),auth[_0x490e('0xb')](),controller[_0x490e('0xc')]);router['put'](_0x490e('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x490e('0xd')]('/:id',auth[_0x490e('0xb')](),controller[_0x490e('0xe')]);module[_0x490e('0xf')]=router;
\ No newline at end of file
+var _0x3766=['/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','update','delete'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3766,0x19b));var _0x6376=function(_0x17c283,_0x587fcc){_0x17c283=_0x17c283-0x0;var _0x4e0800=_0x3766[_0x17c283];return _0x4e0800;};'use strict';var multer=require(_0x6376('0x0'));var util=require(_0x6376('0x1'));var path=require('path');var timeout=require(_0x6376('0x2'));var express=require(_0x6376('0x3'));var router=express[_0x6376('0x4')]();var fs_extra=require(_0x6376('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6376('0x6'));var controller=require(_0x6376('0x7'));router[_0x6376('0x8')]('/:id',auth[_0x6376('0x9')](),controller[_0x6376('0xa')]);router[_0x6376('0xb')]('/:id',auth[_0x6376('0x9')](),controller[_0x6376('0xc')]);router[_0x6376('0xd')](_0x6376('0xe'),auth[_0x6376('0x9')](),controller[_0x6376('0xf')]);module[_0x6376('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 41f6549..09bef79 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 _0x325a=['BOOLEAN','sequelize','exports','STRING'];(function(_0x331cca,_0x4aa4d1){var _0x58c870=function(_0x5e1b43){while(--_0x5e1b43){_0x331cca['push'](_0x331cca['shift']());}};_0x58c870(++_0x4aa4d1);}(_0x325a,0x1b5));var _0xa325=function(_0x1880fd,_0x4c752c){_0x1880fd=_0x1880fd-0x0;var _0x5263e0=_0x325a[_0x1880fd];return _0x5263e0;};'use strict';var Sequelize=require(_0xa325('0x0'));module[_0xa325('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa325('0x2')]},'write':{'type':Sequelize[_0xa325('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xed5e=['sequelize','STRING','BOOLEAN'];(function(_0x57e389,_0x4c6889){var _0xdd53a1=function(_0x11bd50){while(--_0x11bd50){_0x57e389['push'](_0x57e389['shift']());}};_0xdd53a1(++_0x4c6889);}(_0xed5e,0xff));var _0xeed5=function(_0x50b919,_0x7cdb7f){_0x50b919=_0x50b919-0x0;var _0x12fec9=_0xed5e[_0x50b919];return _0x12fec9;};'use strict';var Sequelize=require(_0xeed5('0x0'));module['exports']={'name':{'type':Sequelize[_0xeed5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xeed5('0x1')]},'write':{'type':Sequelize[_0xeed5('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index d52ba6e..f0a8692 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 _0x24d6=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x398404,_0x22df2c){var _0x36d1ac=function(_0xcecea0){while(--_0xcecea0){_0x398404['push'](_0x398404['shift']());}};_0x36d1ac(++_0x22df2c);}(_0x24d6,0x1df));var _0x624d=function(_0x21c6b8,_0x16d6f6){_0x21c6b8=_0x21c6b8-0x0;var _0x39d474=_0x24d6[_0x21c6b8];return _0x39d474;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x624d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x624d('0x1'));var rp=require(_0x624d('0x2'));var moment=require(_0x624d('0x3'));var BPromise=require(_0x624d('0x4'));var Mustache=require(_0x624d('0x5'));var util=require(_0x624d('0x6'));var path=require(_0x624d('0x7'));var sox=require(_0x624d('0x8'));var csv=require(_0x624d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x624d('0xa'));var _=require(_0x624d('0xb'));var squel=require(_0x624d('0xc'));var crypto=require(_0x624d('0xd'));var jsforce=require(_0x624d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x624d('0x9'));var querystring=require(_0x624d('0xf'));var Papa=require('papaparse');var Redis=require(_0x624d('0x10'));var authService=require(_0x624d('0x11'));var qs=require(_0x624d('0x12'));var as=require(_0x624d('0x13'));var hardwareService=require(_0x624d('0x14'));var logger=require(_0x624d('0x15'))('api');var utils=require(_0x624d('0x16'));var config=require(_0x624d('0x17'));var licenseUtil=require(_0x624d('0x18'));var db=require(_0x624d('0x19'))['db'];config[_0x624d('0x1a')]=_[_0x624d('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x624d('0x1a')]));require(_0x624d('0x1c'))['register'](socket);function respondWithStatusCode(_0x22b75c,_0x5bcc89){_0x5bcc89=_0x5bcc89||0xcc;return function(_0x5356f3){if(_0x5356f3){return _0x22b75c[_0x624d('0x1d')](_0x5bcc89);}return _0x22b75c[_0x624d('0x1e')](_0x5bcc89)[_0x624d('0x1f')]();};}function respondWithResult(_0x583bb6,_0x45dce2){_0x45dce2=_0x45dce2||0xc8;return function(_0x58cd92){if(_0x58cd92){return _0x583bb6[_0x624d('0x1e')](_0x45dce2)['json'](_0x58cd92);}};}function respondWithFilteredResult(_0x323d58,_0x2f7268){return function(_0x1c0bd6){if(_0x1c0bd6){var _0x3cd2e9=typeof _0x2f7268[_0x624d('0x20')]==='undefined'&&typeof _0x2f7268[_0x624d('0x21')]===_0x624d('0x22');var _0x3cfc40=_0x1c0bd6['count'];var _0x42c65f=_0x3cd2e9?0x0:_0x2f7268[_0x624d('0x20')];var _0x5c101f=_0x3cd2e9?_0x1c0bd6[_0x624d('0x23')]:_0x2f7268[_0x624d('0x20')]+_0x2f7268['limit'];var _0x54d1db;if(_0x5c101f>=_0x3cfc40){_0x5c101f=_0x3cfc40;_0x54d1db=0xc8;}else{_0x54d1db=0xce;}_0x323d58[_0x624d('0x1e')](_0x54d1db);return _0x323d58[_0x624d('0x24')](_0x624d('0x25'),_0x42c65f+'-'+_0x5c101f+'/'+_0x3cfc40)[_0x624d('0x26')](_0x1c0bd6);}return null;};}function patchUpdates(_0x798fcd){return function(_0x14cd6d){try{jsonpatch[_0x624d('0x27')](_0x14cd6d,_0x798fcd,!![]);}catch(_0x229b0d){return BPromise[_0x624d('0x28')](_0x229b0d);}return _0x14cd6d['save']();};}function saveUpdates(_0x264dcf,_0x1ef17b){return function(_0x32e921){if(_0x32e921){return _0x32e921[_0x624d('0x29')](_0x264dcf)[_0x624d('0x2a')](function(_0x2fc749){return _0x2fc749;});}return null;};}function removeEntity(_0x49ccf5,_0x360cba){return function(_0xd63ba1){if(_0xd63ba1){return _0xd63ba1[_0x624d('0x2b')]()[_0x624d('0x2a')](function(){_0x49ccf5[_0x624d('0x1e')](0xcc)[_0x624d('0x1f')]();});}};}function handleEntityNotFound(_0x1501e3,_0x189828){return function(_0xaf0f6d){if(!_0xaf0f6d){_0x1501e3[_0x624d('0x1d')](0x194);}return _0xaf0f6d;};}function handleError(_0xd05a74,_0x4f8ea4){_0x4f8ea4=_0x4f8ea4||0x1f4;return function(_0x52f19a){logger[_0x624d('0x2c')](_0x52f19a[_0x624d('0x2d')]);if(_0x52f19a['name']){delete _0x52f19a[_0x624d('0x2e')];}_0xd05a74[_0x624d('0x1e')](_0x4f8ea4)['send'](_0x52f19a);};}exports[_0x624d('0x2f')]=function(_0x296890,_0x46214f){var _0x235bca={},_0x4d388b={},_0x5b8a94={'count':0x0,'rows':[]};var _0x12f18f=_[_0x624d('0x30')](db[_0x624d('0x31')][_0x624d('0x32')],function(_0x58d9e8){return{'name':_0x58d9e8[_0x624d('0x33')],'type':_0x58d9e8[_0x624d('0x34')]['key']};});_0x4d388b['model']=_[_0x624d('0x30')](_0x12f18f,_0x624d('0x2e'));_0x4d388b[_0x624d('0x35')]=_[_0x624d('0x36')](_0x296890[_0x624d('0x35')]);_0x4d388b[_0x624d('0x37')]=_[_0x624d('0x38')](_0x4d388b[_0x624d('0x39')],_0x4d388b[_0x624d('0x35')]);_0x235bca[_0x624d('0x3a')]=_[_0x624d('0x38')](_0x4d388b[_0x624d('0x39')],qs['fields'](_0x296890[_0x624d('0x35')]['fields']));_0x235bca[_0x624d('0x3a')]=_0x235bca['attributes'][_0x624d('0x3b')]?_0x235bca[_0x624d('0x3a')]:_0x4d388b['model'];if(!_0x296890['query']['hasOwnProperty'](_0x624d('0x3c'))){_0x235bca['limit']=qs[_0x624d('0x21')](_0x296890[_0x624d('0x35')]['limit']);_0x235bca[_0x624d('0x20')]=qs[_0x624d('0x20')](_0x296890[_0x624d('0x35')][_0x624d('0x20')]);}_0x235bca[_0x624d('0x3d')]=qs[_0x624d('0x3e')](_0x296890[_0x624d('0x35')][_0x624d('0x3e')]);_0x235bca[_0x624d('0x3f')]=qs[_0x624d('0x37')](_[_0x624d('0x40')](_0x296890[_0x624d('0x35')],_0x4d388b[_0x624d('0x37')]),_0x12f18f);if(_0x296890[_0x624d('0x35')][_0x624d('0x41')]){_0x235bca['where']=_[_0x624d('0x42')](_0x235bca[_0x624d('0x3f')],{'$or':_[_0x624d('0x30')](_0x12f18f,function(_0x5cd9c5){if(_0x5cd9c5[_0x624d('0x34')]!==_0x624d('0x43')){var _0x21a5e9={};_0x21a5e9[_0x5cd9c5['name']]={'$like':'%'+_0x296890[_0x624d('0x35')][_0x624d('0x41')]+'%'};return _0x21a5e9;}})});}_0x235bca=_[_0x624d('0x42')]({},_0x235bca,_0x296890[_0x624d('0x44')]);var _0xdda0b3={'where':_0x235bca[_0x624d('0x3f')]};return db[_0x624d('0x31')]['count'](_0xdda0b3)[_0x624d('0x2a')](function(_0x4a9466){_0x5b8a94['count']=_0x4a9466;if(_0x296890['query'][_0x624d('0x45')]){_0x235bca[_0x624d('0x46')]=[{'all':!![]}];}return db['ChatGroup'][_0x624d('0x47')](_0x235bca);})[_0x624d('0x2a')](function(_0x2e67ef){_0x5b8a94[_0x624d('0x48')]=_0x2e67ef;return _0x5b8a94;})[_0x624d('0x2a')](respondWithFilteredResult(_0x46214f,_0x235bca))[_0x624d('0x49')](handleError(_0x46214f,null));};exports[_0x624d('0x4a')]=function(_0x457ff5,_0x57fc98){var _0x428bc1={'raw':!![],'where':{'id':_0x457ff5[_0x624d('0x4b')]['id']}},_0x48148f={};_0x48148f['model']=_[_0x624d('0x36')](db[_0x624d('0x31')][_0x624d('0x32')]);_0x48148f[_0x624d('0x35')]=_[_0x624d('0x36')](_0x457ff5[_0x624d('0x35')]);_0x48148f[_0x624d('0x37')]=_[_0x624d('0x38')](_0x48148f[_0x624d('0x39')],_0x48148f[_0x624d('0x35')]);_0x428bc1[_0x624d('0x3a')]=_[_0x624d('0x38')](_0x48148f['model'],qs[_0x624d('0x4c')](_0x457ff5[_0x624d('0x35')]['fields']));_0x428bc1[_0x624d('0x3a')]=_0x428bc1[_0x624d('0x3a')][_0x624d('0x3b')]?_0x428bc1[_0x624d('0x3a')]:_0x48148f['model'];if(_0x457ff5[_0x624d('0x35')][_0x624d('0x45')]){_0x428bc1[_0x624d('0x46')]=[{'all':!![]}];}_0x428bc1=_[_0x624d('0x42')]({},_0x428bc1,_0x457ff5['options']);return db[_0x624d('0x31')][_0x624d('0x4d')](_0x428bc1)[_0x624d('0x2a')](handleEntityNotFound(_0x57fc98,null))[_0x624d('0x2a')](respondWithResult(_0x57fc98,null))['catch'](handleError(_0x57fc98,null));};exports[_0x624d('0x4e')]=function(_0x4863d9,_0x2d87cb){return db[_0x624d('0x31')][_0x624d('0x4e')](_0x4863d9['body'],{})['then'](respondWithResult(_0x2d87cb,0xc9))[_0x624d('0x49')](handleError(_0x2d87cb,null));};exports[_0x624d('0x29')]=function(_0x2a8809,_0x41a6fa){if(_0x2a8809[_0x624d('0x4f')]['id']){delete _0x2a8809['body']['id'];}return db['ChatGroup'][_0x624d('0x4d')]({'where':{'id':_0x2a8809[_0x624d('0x4b')]['id']}})[_0x624d('0x2a')](handleEntityNotFound(_0x41a6fa,null))[_0x624d('0x2a')](saveUpdates(_0x2a8809['body'],null))['then'](respondWithResult(_0x41a6fa,null))[_0x624d('0x49')](handleError(_0x41a6fa,null));};exports['destroy']=function(_0x464c96,_0x337925){return db['ChatGroup'][_0x624d('0x4d')]({'where':{'id':_0x464c96['params']['id']}})[_0x624d('0x2a')](handleEntityNotFound(_0x337925,null))[_0x624d('0x2a')](removeEntity(_0x337925,null))[_0x624d('0x49')](handleError(_0x337925,null));};exports[_0x624d('0x50')]=function(_0x136d11,_0x1501c3){return db[_0x624d('0x31')][_0x624d('0x50')]()[_0x624d('0x2a')](respondWithResult(_0x1501c3,null))[_0x624d('0x49')](handleError(_0x1501c3,null));};exports[_0x624d('0x51')]=function(_0x176bd1,_0x2109a0,_0x33bbe5){return db[_0x624d('0x52')][_0x624d('0x23')]({'where':{'ChatGroupId':_0x176bd1[_0x624d('0x4b')]['id'],'ToId':_0x176bd1['user']['id'],'read':![]}})[_0x624d('0x2a')](function(_0x22cbdb){return{'id':_[_0x624d('0x53')](_0x176bd1[_0x624d('0x4b')]['id']),'count':_0x22cbdb};})[_0x624d('0x2a')](respondWithResult(_0x2109a0,null))[_0x624d('0x49')](handleError(_0x2109a0,null));};exports[_0x624d('0x54')]=function(_0xac409a,_0x2b8eac,_0x577933){return db[_0x624d('0x31')][_0x624d('0x4d')]({'where':{'id':_0xac409a[_0x624d('0x4b')]['id']}})[_0x624d('0x2a')](handleEntityNotFound(_0x2b8eac,null))[_0x624d('0x2a')](function(_0x2ae41d){if(_0x2ae41d){return _0x2ae41d[_0x624d('0x54')](_0xac409a[_0x624d('0x4f')][_0x624d('0x55')],_[_0x624d('0x56')](_0xac409a[_0x624d('0x4f')],[_0x624d('0x55'),'id'])||{});}})[_0x624d('0x2a')](respondWithResult(_0x2b8eac,null))['catch'](handleError(_0x2b8eac,null));};exports[_0x624d('0x57')]=function(_0x3ce6f3,_0x1e29f2,_0xbde25c){var _0xda7a16={};var _0x24555f={};var _0x16cb38;var _0x370a47;return db[_0x624d('0x31')][_0x624d('0x58')]({'where':{'id':_0x3ce6f3[_0x624d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e29f2,null))[_0x624d('0x2a')](function(_0x575be0){if(_0x575be0){_0x16cb38=_0x575be0;_0x24555f[_0x624d('0x39')]=_[_0x624d('0x36')](db[_0x624d('0x59')]['rawAttributes']);_0x24555f['query']=_[_0x624d('0x36')](_0x3ce6f3[_0x624d('0x35')]);_0x24555f[_0x624d('0x37')]=_[_0x624d('0x38')](_0x24555f['model'],_0x24555f[_0x624d('0x35')]);_0xda7a16[_0x624d('0x3a')]=_[_0x624d('0x38')](_0x24555f[_0x624d('0x39')],qs[_0x624d('0x4c')](_0x3ce6f3['query'][_0x624d('0x4c')]));_0xda7a16[_0x624d('0x3a')]=_0xda7a16[_0x624d('0x3a')]['length']?_0xda7a16['attributes']:_0x24555f[_0x624d('0x39')];_0xda7a16[_0x624d('0x3d')]=qs['sort'](_0x3ce6f3[_0x624d('0x35')][_0x624d('0x3e')]);_0xda7a16[_0x624d('0x3f')]=qs[_0x624d('0x37')](_['pick'](_0x3ce6f3['query'],_0x24555f['filters']));if(_0x3ce6f3[_0x624d('0x35')][_0x624d('0x41')]){_0xda7a16[_0x624d('0x3f')]=_[_0x624d('0x42')](_0xda7a16[_0x624d('0x3f')],{'$or':_[_0x624d('0x30')](_0xda7a16['attributes'],function(_0x151eda){var _0x49587a={};_0x49587a[_0x151eda]={'$like':'%'+_0x3ce6f3[_0x624d('0x35')][_0x624d('0x41')]+'%'};return _0x49587a;})});}_0xda7a16=_[_0x624d('0x42')]({},_0xda7a16,_0x3ce6f3[_0x624d('0x44')]);return _0x16cb38[_0x624d('0x57')](_0xda7a16);}})['then'](function(_0x3b4d80){if(_0x3b4d80){_0x370a47=_0x3b4d80[_0x624d('0x3b')];if(!_0x3ce6f3[_0x624d('0x35')][_0x624d('0x5a')](_0x624d('0x3c'))){_0xda7a16[_0x624d('0x21')]=qs[_0x624d('0x21')](_0x3ce6f3[_0x624d('0x35')]['limit']);_0xda7a16[_0x624d('0x20')]=qs[_0x624d('0x20')](_0x3ce6f3[_0x624d('0x35')][_0x624d('0x20')]);}return _0x16cb38[_0x624d('0x57')](_0xda7a16);}})[_0x624d('0x2a')](function(_0x1244a3){if(_0x1244a3){return _0x1244a3?{'count':_0x370a47,'rows':_0x1244a3}:null;}})['then'](respondWithResult(_0x1e29f2,null))['catch'](handleError(_0x1e29f2,null));};exports[_0x624d('0x5b')]=function(_0x5f0f01,_0x36c5b0,_0x583837){return db[_0x624d('0x31')][_0x624d('0x4d')]({'where':{'id':_0x5f0f01[_0x624d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36c5b0,null))[_0x624d('0x2a')](function(_0x15dec0){if(_0x15dec0){return _0x15dec0['removeMembers'](_0x5f0f01[_0x624d('0x35')][_0x624d('0x55')]);}})[_0x624d('0x2a')](respondWithStatusCode(_0x36c5b0,null))[_0x624d('0x49')](handleError(_0x36c5b0,null));};exports['addMessage']=function(_0x12d468,_0x4f053c,_0x1c3c6c){if(_0x12d468['body']['id']){delete _0x12d468[_0x624d('0x4f')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x12d468[_0x624d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f053c,null))['then'](function(_0x5ae771){if(_0x5ae771){_0x12d468[_0x624d('0x4f')][_0x624d('0x5c')]=_0x5ae771['id'];return db[_0x624d('0x52')][_0x624d('0x4e')](_0x12d468['body']);}})[_0x624d('0x2a')](respondWithResult(_0x4f053c,null))[_0x624d('0x49')](handleError(_0x4f053c,null));};exports[_0x624d('0x5d')]=function(_0x3cd2b2,_0x99acab,_0x387d3a){var _0x50d2e6={};var _0x25a439={};var _0x2c160f;var _0x3005e4;return db[_0x624d('0x31')][_0x624d('0x58')]({'where':{'id':_0x3cd2b2['params']['id']}})[_0x624d('0x2a')](handleEntityNotFound(_0x99acab,null))[_0x624d('0x2a')](function(_0x3757b7){if(_0x3757b7){_0x2c160f=_0x3757b7;_0x25a439['model']=_[_0x624d('0x36')](db[_0x624d('0x52')][_0x624d('0x32')]);_0x25a439[_0x624d('0x35')]=_[_0x624d('0x36')](_0x3cd2b2[_0x624d('0x35')]);_0x25a439[_0x624d('0x37')]=_['intersection'](_0x25a439['model'],_0x25a439[_0x624d('0x35')]);_0x50d2e6[_0x624d('0x3a')]=_['intersection'](_0x25a439[_0x624d('0x39')],qs[_0x624d('0x4c')](_0x3cd2b2[_0x624d('0x35')][_0x624d('0x4c')]));_0x50d2e6['attributes']=_0x50d2e6[_0x624d('0x3a')]['length']?_0x50d2e6[_0x624d('0x3a')]:_0x25a439[_0x624d('0x39')];_0x50d2e6[_0x624d('0x3d')]=qs[_0x624d('0x3e')](_0x3cd2b2[_0x624d('0x35')][_0x624d('0x3e')]);_0x50d2e6[_0x624d('0x3f')]=qs[_0x624d('0x37')](_[_0x624d('0x40')](_0x3cd2b2[_0x624d('0x35')],_0x25a439[_0x624d('0x37')]));if(_0x3cd2b2['query'][_0x624d('0x41')]){_0x50d2e6['where']=_[_0x624d('0x42')](_0x50d2e6[_0x624d('0x3f')],{'$or':_[_0x624d('0x30')](_0x50d2e6[_0x624d('0x3a')],function(_0x6ac3e7){var _0x28fa62={};_0x28fa62[_0x6ac3e7]={'$like':'%'+_0x3cd2b2[_0x624d('0x35')]['filter']+'%'};return _0x28fa62;})});}if(_0x3cd2b2[_0x624d('0x35')][_0x624d('0x5e')]){var _0x27453a=_0x3cd2b2['query'][_0x624d('0x5e')][_0x624d('0x5f')](',');var _0x4955da={};_0x4955da[_0x27453a[0x0]]={'$gte':moment(_0x27453a[0x1])[_0x624d('0x60')](_0x624d('0x61'))};_0x50d2e6['where']=_[_0x624d('0x42')](_0x50d2e6[_0x624d('0x3f')],_0x4955da);}_0x50d2e6=_[_0x624d('0x42')]({},_0x50d2e6,_0x3cd2b2[_0x624d('0x44')]);return _0x2c160f[_0x624d('0x5d')](_0x50d2e6);}})[_0x624d('0x2a')](function(_0x145ae0){if(_0x145ae0){_0x3005e4=_0x145ae0[_0x624d('0x3b')];if(!_0x3cd2b2[_0x624d('0x35')]['hasOwnProperty'](_0x624d('0x3c'))){_0x50d2e6[_0x624d('0x21')]=qs[_0x624d('0x21')](_0x3cd2b2['query'][_0x624d('0x21')]);_0x50d2e6[_0x624d('0x20')]=qs[_0x624d('0x20')](_0x3cd2b2[_0x624d('0x35')]['offset']);}return _0x2c160f[_0x624d('0x5d')](_0x50d2e6);}})[_0x624d('0x2a')](function(_0x5447b1){if(_0x5447b1){return _0x5447b1?{'count':_0x3005e4,'rows':_0x5447b1}:null;}})[_0x624d('0x2a')](respondWithResult(_0x99acab,null))['catch'](handleError(_0x99acab,null));};
\ No newline at end of file
+var _0x007e=['ChatGroupId','findOne','$gte','split','format','getMessages','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','error','name','send','index','map','ChatGroup','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','keys','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','order','nolimit','removeMembers','addMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x007e,0x166));var _0xe007=function(_0x5e4487,_0x8b8232){_0x5e4487=_0x5e4487-0x0;var _0x10409b=_0x007e[_0x5e4487];return _0x10409b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe007('0x0'));var zipdir=require(_0xe007('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe007('0x2'));var moment=require(_0xe007('0x3'));var BPromise=require(_0xe007('0x4'));var Mustache=require(_0xe007('0x5'));var util=require('util');var path=require(_0xe007('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe007('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe007('0x8'));var querystring=require(_0xe007('0x9'));var Papa=require(_0xe007('0xa'));var Redis=require(_0xe007('0xb'));var authService=require(_0xe007('0xc'));var qs=require(_0xe007('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe007('0xe'));var logger=require('../../config/logger')(_0xe007('0xf'));var utils=require('../../config/utils');var config=require(_0xe007('0x10'));var licenseUtil=require(_0xe007('0x11'));var db=require(_0xe007('0x12'))['db'];config['redis']=_[_0xe007('0x13')](config[_0xe007('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xe007('0x15'))(new Redis(config[_0xe007('0x14')]));require(_0xe007('0x16'))[_0xe007('0x17')](socket);function respondWithStatusCode(_0x33c40c,_0xfed403){_0xfed403=_0xfed403||0xcc;return function(_0xc74d13){if(_0xc74d13){return _0x33c40c[_0xe007('0x18')](_0xfed403);}return _0x33c40c[_0xe007('0x19')](_0xfed403)[_0xe007('0x1a')]();};}function respondWithResult(_0x48737c,_0x3882e6){_0x3882e6=_0x3882e6||0xc8;return function(_0x4e4425){if(_0x4e4425){return _0x48737c[_0xe007('0x19')](_0x3882e6)[_0xe007('0x1b')](_0x4e4425);}};}function respondWithFilteredResult(_0x44f2ab,_0x534e54){return function(_0x592a8c){if(_0x592a8c){var _0x49c36a=typeof _0x534e54[_0xe007('0x1c')]==='undefined'&&typeof _0x534e54[_0xe007('0x1d')]===_0xe007('0x1e');var _0xd64719=_0x592a8c[_0xe007('0x1f')];var _0x5076cf=_0x49c36a?0x0:_0x534e54[_0xe007('0x1c')];var _0x1f0185=_0x49c36a?_0x592a8c[_0xe007('0x1f')]:_0x534e54[_0xe007('0x1c')]+_0x534e54[_0xe007('0x1d')];var _0x3d4dd;if(_0x1f0185>=_0xd64719){_0x1f0185=_0xd64719;_0x3d4dd=0xc8;}else{_0x3d4dd=0xce;}_0x44f2ab[_0xe007('0x19')](_0x3d4dd);return _0x44f2ab[_0xe007('0x20')]('Content-Range',_0x5076cf+'-'+_0x1f0185+'/'+_0xd64719)[_0xe007('0x1b')](_0x592a8c);}return null;};}function patchUpdates(_0x5e6eee){return function(_0x5f05a0){try{jsonpatch[_0xe007('0x21')](_0x5f05a0,_0x5e6eee,!![]);}catch(_0x5eaf1b){return BPromise['reject'](_0x5eaf1b);}return _0x5f05a0[_0xe007('0x22')]();};}function saveUpdates(_0x52e693,_0x1d352f){return function(_0x1d74a6){if(_0x1d74a6){return _0x1d74a6[_0xe007('0x23')](_0x52e693)[_0xe007('0x24')](function(_0x53d7e3){return _0x53d7e3;});}return null;};}function removeEntity(_0x445123,_0x5c2735){return function(_0xeee007){if(_0xeee007){return _0xeee007['destroy']()[_0xe007('0x24')](function(){_0x445123[_0xe007('0x19')](0xcc)[_0xe007('0x1a')]();});}};}function handleEntityNotFound(_0x5d9884,_0x121024){return function(_0x44b3a9){if(!_0x44b3a9){_0x5d9884[_0xe007('0x18')](0x194);}return _0x44b3a9;};}function handleError(_0x866d1f,_0x14d27a){_0x14d27a=_0x14d27a||0x1f4;return function(_0x33beba){logger[_0xe007('0x25')](_0x33beba['stack']);if(_0x33beba['name']){delete _0x33beba[_0xe007('0x26')];}_0x866d1f['status'](_0x14d27a)[_0xe007('0x27')](_0x33beba);};}exports[_0xe007('0x28')]=function(_0x2e9ec8,_0x3e6de7){var _0x40432c={},_0x503bf9={},_0x52f9d6={'count':0x0,'rows':[]};var _0x55984a=_[_0xe007('0x29')](db[_0xe007('0x2a')]['rawAttributes'],function(_0x3a67ca){return{'name':_0x3a67ca['fieldName'],'type':_0x3a67ca[_0xe007('0x2b')][_0xe007('0x2c')]};});_0x503bf9[_0xe007('0x2d')]=_['map'](_0x55984a,_0xe007('0x26'));_0x503bf9[_0xe007('0x2e')]=_['keys'](_0x2e9ec8[_0xe007('0x2e')]);_0x503bf9[_0xe007('0x2f')]=_[_0xe007('0x30')](_0x503bf9[_0xe007('0x2d')],_0x503bf9[_0xe007('0x2e')]);_0x40432c[_0xe007('0x31')]=_[_0xe007('0x30')](_0x503bf9[_0xe007('0x2d')],qs[_0xe007('0x32')](_0x2e9ec8['query'][_0xe007('0x32')]));_0x40432c[_0xe007('0x31')]=_0x40432c[_0xe007('0x31')][_0xe007('0x33')]?_0x40432c[_0xe007('0x31')]:_0x503bf9[_0xe007('0x2d')];if(!_0x2e9ec8[_0xe007('0x2e')][_0xe007('0x34')]('nolimit')){_0x40432c[_0xe007('0x1d')]=qs[_0xe007('0x1d')](_0x2e9ec8[_0xe007('0x2e')][_0xe007('0x1d')]);_0x40432c[_0xe007('0x1c')]=qs[_0xe007('0x1c')](_0x2e9ec8[_0xe007('0x2e')][_0xe007('0x1c')]);}_0x40432c['order']=qs[_0xe007('0x35')](_0x2e9ec8[_0xe007('0x2e')][_0xe007('0x35')]);_0x40432c['where']=qs['filters'](_[_0xe007('0x36')](_0x2e9ec8[_0xe007('0x2e')],_0x503bf9[_0xe007('0x2f')]),_0x55984a);if(_0x2e9ec8[_0xe007('0x2e')][_0xe007('0x37')]){_0x40432c['where']=_[_0xe007('0x38')](_0x40432c[_0xe007('0x39')],{'$or':_['map'](_0x55984a,function(_0x185c1b){if(_0x185c1b[_0xe007('0x2b')]!==_0xe007('0x3a')){var _0x590b1a={};_0x590b1a[_0x185c1b[_0xe007('0x26')]]={'$like':'%'+_0x2e9ec8[_0xe007('0x2e')][_0xe007('0x37')]+'%'};return _0x590b1a;}})});}_0x40432c=_[_0xe007('0x38')]({},_0x40432c,_0x2e9ec8[_0xe007('0x3b')]);var _0x43ef64={'where':_0x40432c[_0xe007('0x39')]};return db[_0xe007('0x2a')][_0xe007('0x1f')](_0x43ef64)[_0xe007('0x24')](function(_0x57db58){_0x52f9d6[_0xe007('0x1f')]=_0x57db58;if(_0x2e9ec8[_0xe007('0x2e')][_0xe007('0x3c')]){_0x40432c[_0xe007('0x3d')]=[{'all':!![]}];}return db[_0xe007('0x2a')]['findAll'](_0x40432c);})['then'](function(_0x2c4ff2){_0x52f9d6['rows']=_0x2c4ff2;return _0x52f9d6;})['then'](respondWithFilteredResult(_0x3e6de7,_0x40432c))[_0xe007('0x3e')](handleError(_0x3e6de7,null));};exports['show']=function(_0xff7d34,_0x116831){var _0x348d53={'raw':!![],'where':{'id':_0xff7d34[_0xe007('0x3f')]['id']}},_0x804cc6={};_0x804cc6[_0xe007('0x2d')]=_['keys'](db['ChatGroup'][_0xe007('0x40')]);_0x804cc6[_0xe007('0x2e')]=_[_0xe007('0x41')](_0xff7d34[_0xe007('0x2e')]);_0x804cc6['filters']=_['intersection'](_0x804cc6[_0xe007('0x2d')],_0x804cc6['query']);_0x348d53[_0xe007('0x31')]=_[_0xe007('0x30')](_0x804cc6[_0xe007('0x2d')],qs['fields'](_0xff7d34[_0xe007('0x2e')][_0xe007('0x32')]));_0x348d53['attributes']=_0x348d53['attributes'][_0xe007('0x33')]?_0x348d53[_0xe007('0x31')]:_0x804cc6[_0xe007('0x2d')];if(_0xff7d34['query'][_0xe007('0x3c')]){_0x348d53[_0xe007('0x3d')]=[{'all':!![]}];}_0x348d53=_['merge']({},_0x348d53,_0xff7d34[_0xe007('0x3b')]);return db[_0xe007('0x2a')]['find'](_0x348d53)[_0xe007('0x24')](handleEntityNotFound(_0x116831,null))['then'](respondWithResult(_0x116831,null))['catch'](handleError(_0x116831,null));};exports['create']=function(_0x38f2eb,_0x3ef087){return db[_0xe007('0x2a')][_0xe007('0x42')](_0x38f2eb[_0xe007('0x43')],{})['then'](respondWithResult(_0x3ef087,0xc9))[_0xe007('0x3e')](handleError(_0x3ef087,null));};exports[_0xe007('0x23')]=function(_0x496a85,_0x3d2834){if(_0x496a85[_0xe007('0x43')]['id']){delete _0x496a85[_0xe007('0x43')]['id'];}return db[_0xe007('0x2a')][_0xe007('0x44')]({'where':{'id':_0x496a85[_0xe007('0x3f')]['id']}})[_0xe007('0x24')](handleEntityNotFound(_0x3d2834,null))[_0xe007('0x24')](saveUpdates(_0x496a85['body'],null))[_0xe007('0x24')](respondWithResult(_0x3d2834,null))[_0xe007('0x3e')](handleError(_0x3d2834,null));};exports['destroy']=function(_0x124625,_0x63cf9a){return db[_0xe007('0x2a')][_0xe007('0x44')]({'where':{'id':_0x124625['params']['id']}})[_0xe007('0x24')](handleEntityNotFound(_0x63cf9a,null))['then'](removeEntity(_0x63cf9a,null))[_0xe007('0x3e')](handleError(_0x63cf9a,null));};exports['describe']=function(_0x3579d5,_0x319018){return db['ChatGroup'][_0xe007('0x45')]()[_0xe007('0x24')](respondWithResult(_0x319018,null))['catch'](handleError(_0x319018,null));};exports[_0xe007('0x46')]=function(_0x33582e,_0x161bf6,_0x4f6544){return db[_0xe007('0x47')][_0xe007('0x1f')]({'where':{'ChatGroupId':_0x33582e[_0xe007('0x3f')]['id'],'ToId':_0x33582e['user']['id'],'read':![]}})[_0xe007('0x24')](function(_0x40468b){return{'id':_[_0xe007('0x48')](_0x33582e['params']['id']),'count':_0x40468b};})['then'](respondWithResult(_0x161bf6,null))[_0xe007('0x3e')](handleError(_0x161bf6,null));};exports[_0xe007('0x49')]=function(_0x438d98,_0x24d709,_0x199e6d){return db[_0xe007('0x2a')]['find']({'where':{'id':_0x438d98[_0xe007('0x3f')]['id']}})['then'](handleEntityNotFound(_0x24d709,null))[_0xe007('0x24')](function(_0x1daa1a){if(_0x1daa1a){return _0x1daa1a[_0xe007('0x49')](_0x438d98[_0xe007('0x43')][_0xe007('0x4a')],_[_0xe007('0x4b')](_0x438d98['body'],[_0xe007('0x4a'),'id'])||{});}})[_0xe007('0x24')](respondWithResult(_0x24d709,null))[_0xe007('0x3e')](handleError(_0x24d709,null));};exports[_0xe007('0x4c')]=function(_0x2a6ab1,_0x50669b,_0x2121d6){var _0x566bdc={};var _0x2343cd={};var _0xe25215;var _0x19561f;return db['ChatGroup']['findOne']({'where':{'id':_0x2a6ab1[_0xe007('0x3f')]['id']}})['then'](handleEntityNotFound(_0x50669b,null))['then'](function(_0x3c15c9){if(_0x3c15c9){_0xe25215=_0x3c15c9;_0x2343cd[_0xe007('0x2d')]=_[_0xe007('0x41')](db[_0xe007('0x4d')][_0xe007('0x40')]);_0x2343cd['query']=_[_0xe007('0x41')](_0x2a6ab1[_0xe007('0x2e')]);_0x2343cd[_0xe007('0x2f')]=_[_0xe007('0x30')](_0x2343cd['model'],_0x2343cd[_0xe007('0x2e')]);_0x566bdc[_0xe007('0x31')]=_[_0xe007('0x30')](_0x2343cd[_0xe007('0x2d')],qs[_0xe007('0x32')](_0x2a6ab1[_0xe007('0x2e')][_0xe007('0x32')]));_0x566bdc[_0xe007('0x31')]=_0x566bdc[_0xe007('0x31')]['length']?_0x566bdc[_0xe007('0x31')]:_0x2343cd['model'];_0x566bdc[_0xe007('0x4e')]=qs[_0xe007('0x35')](_0x2a6ab1[_0xe007('0x2e')][_0xe007('0x35')]);_0x566bdc[_0xe007('0x39')]=qs[_0xe007('0x2f')](_[_0xe007('0x36')](_0x2a6ab1[_0xe007('0x2e')],_0x2343cd['filters']));if(_0x2a6ab1['query'][_0xe007('0x37')]){_0x566bdc[_0xe007('0x39')]=_[_0xe007('0x38')](_0x566bdc['where'],{'$or':_[_0xe007('0x29')](_0x566bdc[_0xe007('0x31')],function(_0x20f934){var _0x3a60f0={};_0x3a60f0[_0x20f934]={'$like':'%'+_0x2a6ab1[_0xe007('0x2e')][_0xe007('0x37')]+'%'};return _0x3a60f0;})});}_0x566bdc=_[_0xe007('0x38')]({},_0x566bdc,_0x2a6ab1[_0xe007('0x3b')]);return _0xe25215[_0xe007('0x4c')](_0x566bdc);}})[_0xe007('0x24')](function(_0x5d6b48){if(_0x5d6b48){_0x19561f=_0x5d6b48[_0xe007('0x33')];if(!_0x2a6ab1[_0xe007('0x2e')][_0xe007('0x34')](_0xe007('0x4f'))){_0x566bdc[_0xe007('0x1d')]=qs['limit'](_0x2a6ab1[_0xe007('0x2e')][_0xe007('0x1d')]);_0x566bdc[_0xe007('0x1c')]=qs['offset'](_0x2a6ab1['query']['offset']);}return _0xe25215['getMembers'](_0x566bdc);}})['then'](function(_0x114717){if(_0x114717){return _0x114717?{'count':_0x19561f,'rows':_0x114717}:null;}})[_0xe007('0x24')](respondWithResult(_0x50669b,null))['catch'](handleError(_0x50669b,null));};exports['removeMembers']=function(_0x5d1cce,_0x4acc8e,_0x368a85){return db[_0xe007('0x2a')][_0xe007('0x44')]({'where':{'id':_0x5d1cce['params']['id']}})[_0xe007('0x24')](handleEntityNotFound(_0x4acc8e,null))['then'](function(_0x494633){if(_0x494633){return _0x494633[_0xe007('0x50')](_0x5d1cce[_0xe007('0x2e')][_0xe007('0x4a')]);}})[_0xe007('0x24')](respondWithStatusCode(_0x4acc8e,null))[_0xe007('0x3e')](handleError(_0x4acc8e,null));};exports[_0xe007('0x51')]=function(_0x711581,_0x218e9e,_0x24fca6){if(_0x711581['body']['id']){delete _0x711581['body']['id'];}return db[_0xe007('0x2a')][_0xe007('0x44')]({'where':{'id':_0x711581[_0xe007('0x3f')]['id']}})[_0xe007('0x24')](handleEntityNotFound(_0x218e9e,null))[_0xe007('0x24')](function(_0x56bad3){if(_0x56bad3){_0x711581[_0xe007('0x43')][_0xe007('0x52')]=_0x56bad3['id'];return db[_0xe007('0x47')][_0xe007('0x42')](_0x711581['body']);}})[_0xe007('0x24')](respondWithResult(_0x218e9e,null))[_0xe007('0x3e')](handleError(_0x218e9e,null));};exports['getMessages']=function(_0x61caad,_0x49785a,_0x4a0e9c){var _0x309644={};var _0x5c562c={};var _0x3f1cb8;var _0x1977a5;return db[_0xe007('0x2a')][_0xe007('0x53')]({'where':{'id':_0x61caad['params']['id']}})[_0xe007('0x24')](handleEntityNotFound(_0x49785a,null))['then'](function(_0x287b31){if(_0x287b31){_0x3f1cb8=_0x287b31;_0x5c562c['model']=_['keys'](db[_0xe007('0x47')][_0xe007('0x40')]);_0x5c562c[_0xe007('0x2e')]=_[_0xe007('0x41')](_0x61caad[_0xe007('0x2e')]);_0x5c562c[_0xe007('0x2f')]=_[_0xe007('0x30')](_0x5c562c[_0xe007('0x2d')],_0x5c562c[_0xe007('0x2e')]);_0x309644['attributes']=_[_0xe007('0x30')](_0x5c562c['model'],qs['fields'](_0x61caad[_0xe007('0x2e')][_0xe007('0x32')]));_0x309644['attributes']=_0x309644['attributes'][_0xe007('0x33')]?_0x309644['attributes']:_0x5c562c[_0xe007('0x2d')];_0x309644[_0xe007('0x4e')]=qs['sort'](_0x61caad['query'][_0xe007('0x35')]);_0x309644['where']=qs[_0xe007('0x2f')](_[_0xe007('0x36')](_0x61caad[_0xe007('0x2e')],_0x5c562c['filters']));if(_0x61caad[_0xe007('0x2e')]['filter']){_0x309644[_0xe007('0x39')]=_[_0xe007('0x38')](_0x309644[_0xe007('0x39')],{'$or':_['map'](_0x309644[_0xe007('0x31')],function(_0x2f4ccf){var _0x454f08={};_0x454f08[_0x2f4ccf]={'$like':'%'+_0x61caad[_0xe007('0x2e')][_0xe007('0x37')]+'%'};return _0x454f08;})});}if(_0x61caad['query']['$gte']){var _0x473f2c=_0x61caad[_0xe007('0x2e')][_0xe007('0x54')][_0xe007('0x55')](',');var _0x47af52={};_0x47af52[_0x473f2c[0x0]]={'$gte':moment(_0x473f2c[0x1])[_0xe007('0x56')]('YYYY-MM-DD\x20HH:mm:ss')};_0x309644[_0xe007('0x39')]=_[_0xe007('0x38')](_0x309644[_0xe007('0x39')],_0x47af52);}_0x309644=_[_0xe007('0x38')]({},_0x309644,_0x61caad['options']);return _0x3f1cb8[_0xe007('0x57')](_0x309644);}})[_0xe007('0x24')](function(_0x48cad6){if(_0x48cad6){_0x1977a5=_0x48cad6[_0xe007('0x33')];if(!_0x61caad['query']['hasOwnProperty']('nolimit')){_0x309644['limit']=qs[_0xe007('0x1d')](_0x61caad[_0xe007('0x2e')][_0xe007('0x1d')]);_0x309644[_0xe007('0x1c')]=qs[_0xe007('0x1c')](_0x61caad['query']['offset']);}return _0x3f1cb8[_0xe007('0x57')](_0x309644);}})[_0xe007('0x24')](function(_0x12ee1d){if(_0x12ee1d){return _0x12ee1d?{'count':_0x1977a5,'rows':_0x12ee1d}:null;}})[_0xe007('0x24')](respondWithResult(_0x49785a,null))[_0xe007('0x3e')](handleError(_0x49785a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 511b036..b3558e0 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 _0x78d1=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','save','update'];(function(_0x225c0c,_0x5071b1){var _0x7d45e6=function(_0x58871d){while(--_0x58871d){_0x225c0c['push'](_0x225c0c['shift']());}};_0x7d45e6(++_0x5071b1);}(_0x78d1,0x159));var _0x178d=function(_0x5ac3c2,_0x4eeba6){_0x5ac3c2=_0x5ac3c2-0x0;var _0x5ac6ef=_0x78d1[_0x5ac3c2];return _0x5ac6ef;};'use strict';var EventEmitter=require(_0x178d('0x0'));var ChatGroup=require(_0x178d('0x1'))['db'][_0x178d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x178d('0x3'),'afterUpdate':_0x178d('0x4'),'afterDestroy':_0x178d('0x5')};function emitEvent(_0x36446c){return function(_0x3c472e,_0x263b0f,_0x3cdf8b){ChatGroupEvents['emit'](_0x36446c+':'+_0x3c472e['id'],_0x3c472e);ChatGroupEvents[_0x178d('0x6')](_0x36446c,_0x3c472e);_0x3cdf8b(null);};}for(var e in events){if(events[_0x178d('0x7')](e)){var event=events[e];ChatGroup[_0x178d('0x8')](e,emitEvent(event));}}module[_0x178d('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x7c71=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x41f6b7,_0x2defae){var _0x215031=function(_0xdcc8b9){while(--_0xdcc8b9){_0x41f6b7['push'](_0x41f6b7['shift']());}};_0x215031(++_0x2defae);}(_0x7c71,0x177));var _0x17c7=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7c71[_0x40220a];return _0x3903cc;};'use strict';var EventEmitter=require(_0x17c7('0x0'));var ChatGroup=require(_0x17c7('0x1'))['db'][_0x17c7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x17c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x17c7('0x4'),'afterDestroy':_0x17c7('0x5')};function emitEvent(_0x3f9105){return function(_0x5a4923,_0x4fed29,_0xa4e319){ChatGroupEvents[_0x17c7('0x6')](_0x3f9105+':'+_0x5a4923['id'],_0x5a4923);ChatGroupEvents[_0x17c7('0x6')](_0x3f9105,_0x5a4923);_0xa4e319(null);};}for(var e in events){if(events[_0x17c7('0x7')](e)){var event=events[e];ChatGroup[_0x17c7('0x8')](e,emitEvent(event));}}module[_0x17c7('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 165f5f5..99a52c8 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 _0x73a7=['chat_groups','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x73a7,0xaa));var _0x773a=function(_0x3141ca,_0x2a77d7){_0x3141ca=_0x3141ca-0x0;var _0x521898=_0x73a7[_0x3141ca];return _0x521898;};'use strict';var _=require('lodash');var util=require(_0x773a('0x0'));var logger=require('../../config/logger')(_0x773a('0x1'));var moment=require(_0x773a('0x2'));var BPromise=require(_0x773a('0x3'));var rp=require(_0x773a('0x4'));var fs=require('fs');var path=require(_0x773a('0x5'));var rimraf=require(_0x773a('0x6'));var config=require(_0x773a('0x7'));var attributes=require(_0x773a('0x8'));module[_0x773a('0x9')]=function(_0x3490b1,_0x552fe6){return _0x3490b1[_0x773a('0xa')](_0x773a('0xb'),attributes,{'tableName':_0x773a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x046c=['chat_groups','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x36ed67,_0x109b5d){var _0x6efdf7=function(_0x3c9cb6){while(--_0x3c9cb6){_0x36ed67['push'](_0x36ed67['shift']());}};_0x6efdf7(++_0x109b5d);}(_0x046c,0x16c));var _0xc046=function(_0x129726,_0x10fc4a){_0x129726=_0x129726-0x0;var _0x4257bd=_0x046c[_0x129726];return _0x4257bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc046('0x0'))(_0xc046('0x1'));var moment=require(_0xc046('0x2'));var BPromise=require(_0xc046('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc046('0x4'));var rimraf=require(_0xc046('0x5'));var config=require(_0xc046('0x6'));var attributes=require(_0xc046('0x7'));module['exports']=function(_0x37011a,_0x5e0a2a){return _0x37011a[_0xc046('0x8')](_0xc046('0x9'),attributes,{'tableName':_0xc046('0xa'),'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 52cfcb2..175a372 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 _0x35d0=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','request\x20sent'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x35d0,0xf9));var _0x035d=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x35d0[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var moment=require('moment');var BPromise=require(_0x035d('0x2'));var rs=require(_0x035d('0x3'));var fs=require('fs');var Redis=require(_0x035d('0x4'));var db=require(_0x035d('0x5'))['db'];var utils=require(_0x035d('0x6'));var logger=require(_0x035d('0x7'))('rpc');var config=require(_0x035d('0x8'));var jayson=require(_0x035d('0x9'));var client=jayson[_0x035d('0xa')][_0x035d('0xb')]({'port':0x232a});config['redis']=_[_0x035d('0xc')](config[_0x035d('0xd')],{'host':_0x035d('0xe'),'port':0x18eb});var socket=require(_0x035d('0xf'))(new Redis(config[_0x035d('0xd')]));require(_0x035d('0x10'))[_0x035d('0x11')](socket);function respondWithRpcPromise(_0x422ef9,_0x347a28,_0x384462){return new BPromise(function(_0x52a011,_0x82cea4){return client['request'](_0x422ef9,_0x384462)[_0x035d('0x12')](function(_0x5b4ea3){logger[_0x035d('0x13')]('ChatGroup,\x20%s,\x20%s',_0x347a28,_0x035d('0x14'));logger[_0x035d('0x15')](_0x035d('0x16'),_0x347a28,_0x035d('0x14'),JSON[_0x035d('0x17')](_0x5b4ea3));if(_0x5b4ea3['error']){if(_0x5b4ea3['error'][_0x035d('0x18')]===0x1f4){logger[_0x035d('0x19')](_0x035d('0x1a'),_0x347a28,_0x5b4ea3[_0x035d('0x19')][_0x035d('0x1b')]);return _0x82cea4(_0x5b4ea3[_0x035d('0x19')][_0x035d('0x1b')]);}logger['error'](_0x035d('0x1a'),_0x347a28,_0x5b4ea3[_0x035d('0x19')][_0x035d('0x1b')]);return _0x52a011(_0x5b4ea3['error'][_0x035d('0x1b')]);}else{logger['info'](_0x035d('0x1a'),_0x347a28,_0x035d('0x14'));_0x52a011(_0x5b4ea3[_0x035d('0x1c')]['message']);}})[_0x035d('0x1d')](function(_0x2a5f1){logger['error'](_0x035d('0x1a'),_0x347a28,_0x2a5f1);_0x82cea4(_0x2a5f1);});});}
\ No newline at end of file
+var _0x8832=['../../config/environment','jayson/promise','client','redis','localhost','./chatGroup.socket','register','request','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x2d5c0c,_0x2b3c68){var _0x586ea4=function(_0xd580fc){while(--_0xd580fc){_0x2d5c0c['push'](_0x2d5c0c['shift']());}};_0x586ea4(++_0x2b3c68);}(_0x8832,0x1f4));var _0x2883=function(_0x593b90,_0x391cd8){_0x593b90=_0x593b90-0x0;var _0xb3290b=_0x8832[_0x593b90];return _0xb3290b;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2883('0x2'));var fs=require('fs');var Redis=require(_0x2883('0x3'));var db=require(_0x2883('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2883('0x5'))('rpc');var config=require(_0x2883('0x6'));var jayson=require(_0x2883('0x7'));var client=jayson[_0x2883('0x8')]['http']({'port':0x232a});config[_0x2883('0x9')]=_['defaults'](config[_0x2883('0x9')],{'host':_0x2883('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2883('0xb'))[_0x2883('0xc')](socket);function respondWithRpcPromise(_0x467978,_0x10f8c8,_0x21fd17){return new BPromise(function(_0x4a729c,_0x4b803f){return client[_0x2883('0xd')](_0x467978,_0x21fd17)['then'](function(_0x5f3fc1){logger['info'](_0x2883('0xe'),_0x10f8c8,'request\x20sent');logger[_0x2883('0xf')](_0x2883('0x10'),_0x10f8c8,_0x2883('0x11'),JSON[_0x2883('0x12')](_0x5f3fc1));if(_0x5f3fc1[_0x2883('0x13')]){if(_0x5f3fc1[_0x2883('0x13')]['code']===0x1f4){logger['error'](_0x2883('0xe'),_0x10f8c8,_0x5f3fc1[_0x2883('0x13')]['message']);return _0x4b803f(_0x5f3fc1[_0x2883('0x13')][_0x2883('0x14')]);}logger[_0x2883('0x13')](_0x2883('0xe'),_0x10f8c8,_0x5f3fc1[_0x2883('0x13')][_0x2883('0x14')]);return _0x4a729c(_0x5f3fc1[_0x2883('0x13')][_0x2883('0x14')]);}else{logger['info'](_0x2883('0xe'),_0x10f8c8,_0x2883('0x11'));_0x4a729c(_0x5f3fc1[_0x2883('0x15')][_0x2883('0x14')]);}})[_0x2883('0x16')](function(_0x2632eb){logger[_0x2883('0x13')](_0x2883('0xe'),_0x10f8c8,_0x2632eb);_0x4b803f(_0x2632eb);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 47dd422..0e4c699 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 _0x2d78=['emit','removeListener','register','length','./chatGroup.events','save','remove','update'];(function(_0x240cca,_0x392017){var _0x118f2c=function(_0x2a42de){while(--_0x2a42de){_0x240cca['push'](_0x240cca['shift']());}};_0x118f2c(++_0x392017);}(_0x2d78,0xe4));var _0x82d7=function(_0x475aa9,_0x439aab){_0x475aa9=_0x475aa9-0x0;var _0x360bbc=_0x2d78[_0x475aa9];return _0x360bbc;};'use strict';var ChatGroupEvents=require(_0x82d7('0x0'));var events=[_0x82d7('0x1'),_0x82d7('0x2'),_0x82d7('0x3')];function createListener(_0x475b68,_0x13ead3){return function(_0x240f54){_0x13ead3[_0x82d7('0x4')](_0x475b68,_0x240f54);};}function removeListener(_0x217ede,_0x2b0120){return function(){ChatGroupEvents[_0x82d7('0x5')](_0x217ede,_0x2b0120);};}exports[_0x82d7('0x6')]=function(_0x376d76){for(var _0x333f5b=0x0,_0xd735e8=events[_0x82d7('0x7')];_0x333f5b<_0xd735e8;_0x333f5b++){var _0x3a8342=events[_0x333f5b];var _0x184943=createListener('chatGroup:'+_0x3a8342,_0x376d76);ChatGroupEvents['on'](_0x3a8342,_0x184943);}};
\ No newline at end of file
+var _0x27ff=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x1a01b1,_0xcc2032){var _0xbea4b2=function(_0x3768d1){while(--_0x3768d1){_0x1a01b1['push'](_0x1a01b1['shift']());}};_0xbea4b2(++_0xcc2032);}(_0x27ff,0xf5));var _0xf27f=function(_0x23082a,_0x445d35){_0x23082a=_0x23082a-0x0;var _0x4be541=_0x27ff[_0x23082a];return _0x4be541;};'use strict';var ChatGroupEvents=require(_0xf27f('0x0'));var events=[_0xf27f('0x1'),'remove',_0xf27f('0x2')];function createListener(_0xee4c9d,_0x5c0cb9){return function(_0x138a5d){_0x5c0cb9[_0xf27f('0x3')](_0xee4c9d,_0x138a5d);};}function removeListener(_0x422fbb,_0x14cb3c){return function(){ChatGroupEvents[_0xf27f('0x4')](_0x422fbb,_0x14cb3c);};}exports[_0xf27f('0x5')]=function(_0xba170a){for(var _0x38b398=0x0,_0x5de2e1=events[_0xf27f('0x6')];_0x38b398<_0x5de2e1;_0x38b398++){var _0x279a5a=events[_0x38b398];var _0x2959d5=createListener(_0xf27f('0x7')+_0x279a5a,_0xba170a);ChatGroupEvents['on'](_0x279a5a,_0x2959d5);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 8ea44bb..f1b3d45 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 _0x32d9=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','addMessage','put','update','delete','destroy','/:id/members','removeMembers','exports','multer','util','path','connect-timeout','express'];(function(_0x24cf9b,_0x19a454){var _0x48735d=function(_0x11d3b0){while(--_0x11d3b0){_0x24cf9b['push'](_0x24cf9b['shift']());}};_0x48735d(++_0x19a454);}(_0x32d9,0x6f));var _0x932d=function(_0x1729d5,_0x5921c5){_0x1729d5=_0x1729d5-0x0;var _0x6bb300=_0x32d9[_0x1729d5];return _0x6bb300;};'use strict';var multer=require(_0x932d('0x0'));var util=require(_0x932d('0x1'));var path=require(_0x932d('0x2'));var timeout=require(_0x932d('0x3'));var express=require(_0x932d('0x4'));var router=express[_0x932d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x932d('0x6'));var interaction=require(_0x932d('0x7'));var config=require(_0x932d('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x932d('0x9')](_0x932d('0xa'),auth[_0x932d('0xb')](),controller[_0x932d('0xc')]);router[_0x932d('0x9')](_0x932d('0xd'),auth['isAuthenticated'](),controller[_0x932d('0xe')]);router[_0x932d('0x9')](_0x932d('0xf'),auth[_0x932d('0xb')](),controller[_0x932d('0x10')]);router['get']('/:id/members',auth[_0x932d('0xb')](),controller[_0x932d('0x11')]);router[_0x932d('0x9')](_0x932d('0x12'),auth[_0x932d('0xb')](),controller[_0x932d('0x13')]);router[_0x932d('0x14')]('/',auth[_0x932d('0xb')](),controller['create']);router[_0x932d('0x14')]('/:id/members',auth[_0x932d('0xb')](),controller['addMembers']);router['post'](_0x932d('0x12'),auth[_0x932d('0xb')](),controller[_0x932d('0x15')]);router[_0x932d('0x16')](_0x932d('0xd'),auth[_0x932d('0xb')](),controller[_0x932d('0x17')]);router[_0x932d('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x932d('0x19')]);router[_0x932d('0x18')](_0x932d('0x1a'),auth[_0x932d('0xb')](),controller[_0x932d('0x1b')]);module[_0x932d('0x1c')]=router;
\ No newline at end of file
+var _0x42f4=['/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','addMembers','addMessage','put','update','delete','removeMembers','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe'];(function(_0x57acaa,_0x34cf60){var _0x34edad=function(_0x1f046f){while(--_0x1f046f){_0x57acaa['push'](_0x57acaa['shift']());}};_0x34edad(++_0x34cf60);}(_0x42f4,0xd6));var _0x442f=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0x42f4[_0x5ad220];return _0xdec77d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x442f('0x0'));var timeout=require(_0x442f('0x1'));var express=require(_0x442f('0x2'));var router=express['Router']();var fs_extra=require(_0x442f('0x3'));var auth=require(_0x442f('0x4'));var interaction=require(_0x442f('0x5'));var config=require(_0x442f('0x6'));var controller=require(_0x442f('0x7'));router[_0x442f('0x8')]('/',auth[_0x442f('0x9')](),controller['index']);router[_0x442f('0x8')]('/describe',auth[_0x442f('0x9')](),controller[_0x442f('0xa')]);router[_0x442f('0x8')](_0x442f('0xb'),auth[_0x442f('0x9')](),controller[_0x442f('0xc')]);router[_0x442f('0x8')](_0x442f('0xd'),auth[_0x442f('0x9')](),controller[_0x442f('0xe')]);router[_0x442f('0x8')]('/:id/members',auth[_0x442f('0x9')](),controller[_0x442f('0xf')]);router[_0x442f('0x8')](_0x442f('0x10'),auth[_0x442f('0x9')](),controller['getMessages']);router[_0x442f('0x11')]('/',auth[_0x442f('0x9')](),controller['create']);router[_0x442f('0x11')]('/:id/members',auth[_0x442f('0x9')](),controller[_0x442f('0x12')]);router[_0x442f('0x11')](_0x442f('0x10'),auth[_0x442f('0x9')](),controller[_0x442f('0x13')]);router[_0x442f('0x14')]('/:id',auth[_0x442f('0x9')](),controller[_0x442f('0x15')]);router['delete'](_0x442f('0xb'),auth[_0x442f('0x9')](),controller['destroy']);router[_0x442f('0x16')]('/:id/members',auth[_0x442f('0x9')](),controller[_0x442f('0x17')]);module[_0x442f('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 7e2dec3..6d7c5ac 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 _0x4227=['thumb','TEXT','STRING','DATE','long','ENUM','BOOLEAN','sequelize','INTEGER','star'];(function(_0x158d73,_0x57cbb4){var _0x327284=function(_0x10956a){while(--_0x10956a){_0x158d73['push'](_0x158d73['shift']());}};_0x327284(++_0x57cbb4);}(_0x4227,0x89));var _0x7422=function(_0x596d77,_0x408cc9){_0x596d77=_0x596d77-0x0;var _0x5185cf=_0x4227[_0x596d77];return _0x5185cf;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7422('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0x7422('0x2'),_0x7422('0x3')),'defaultValue':_0x7422('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7422('0x4')]},'mailTranscript':{'type':Sequelize[_0x7422('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7422('0x6')]},'disposition':{'type':Sequelize[_0x7422('0x5')]},'secondDisposition':{'type':Sequelize[_0x7422('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7422('0x5')]},'note':{'type':Sequelize[_0x7422('0x5')]},'browserName':{'type':Sequelize[_0x7422('0x5')]},'browserVersion':{'type':Sequelize[_0x7422('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x7422('0x5')]},'deviceModel':{'type':Sequelize[_0x7422('0x5')]},'deviceVendor':{'type':Sequelize[_0x7422('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7422('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7422('0x4')](_0x7422('0x7'))},'read1stAt':{'type':Sequelize[_0x7422('0x6')]},'lastMsgAt':{'type':Sequelize[_0x7422('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x7422('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7422('0x5')]},'customerPort':{'type':Sequelize[_0x7422('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x7422('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa571=['exports','BOOLEAN','INTEGER','star','thumb','TEXT','DATE','STRING','long','ENUM','sequelize'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0xa571,0x107));var _0x1a57=function(_0x34ea07,_0x3c13b0){_0x34ea07=_0x34ea07-0x0;var _0x2af74b=_0xa571[_0x34ea07];return _0x2af74b;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'closed':{'type':Sequelize[_0x1a57('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1a57('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x1a57('0x4'),_0x1a57('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x1a57('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1a57('0x7')]},'disposition':{'type':Sequelize[_0x1a57('0x8')]},'secondDisposition':{'type':Sequelize[_0x1a57('0x8')]},'thirdDisposition':{'type':Sequelize[_0x1a57('0x8')]},'note':{'type':Sequelize[_0x1a57('0x8')]},'browserName':{'type':Sequelize[_0x1a57('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x1a57('0x8')]},'osVersion':{'type':Sequelize[_0x1a57('0x8')]},'deviceModel':{'type':Sequelize[_0x1a57('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x1a57('0x8')]},'referer':{'type':Sequelize[_0x1a57('0x6')]},'customerIp':{'type':Sequelize[_0x1a57('0x8')]},'formData':{'type':Sequelize[_0x1a57('0x6')](_0x1a57('0x9'))},'read1stAt':{'type':Sequelize[_0x1a57('0x7')]},'lastMsgAt':{'type':Sequelize[_0x1a57('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x1a57('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x1a57('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x1a57('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x1a57('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index e46ad2b..cf2f663 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 _0x0ec7=['./chatInteraction.socket','register','http','client','then','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','end','undefined','limit','count','offset','status','Content-Range','update','stack','name','send','body','agent','interaction','account','map','fieldName','key','getOptions','findAll','chat','query','user','show','model','ChatInteraction','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','destroy','createVidaooSession','params','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','fullname','contact','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','AbandonInteraction','abandon','file','basename','filename','type','Attachment','attachmentDownload','json','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','ContactId','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','push','read','mkdirSync','Chat','Owner','N.A.','closedAt','disposition','browserName','referer','customerIp','customerPort','existsSync','createReadStream','value','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x0ec7,0xbb));var _0x70ec=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0ec7[_0x484e36];return _0xafc85d;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x70ec('0x0'));var moment=require(_0x70ec('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x70ec('0x2'));var path=require(_0x70ec('0x3'));var ejs=require(_0x70ec('0x4'));var fs=require('fs');var _=require(_0x70ec('0x5'));var Redis=require(_0x70ec('0x6'));var interaction=require(_0x70ec('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x70ec('0x8'));var config=require(_0x70ec('0x9'));var db=require(_0x70ec('0xa'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x70ec('0xb'),'port':0x18eb});var socket=require(_0x70ec('0xc'))(new Redis(config[_0x70ec('0xd')]));require(_0x70ec('0xe'))[_0x70ec('0xf')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x70ec('0x10')]({'port':0x232b});var client9004=jayson[_0x70ec('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x53594b,_0x2f8f55,_0x27de49,_0x432ae1){return new BPromise(function(_0x2091ff,_0x1809cd){var _0x4ae853=_0x432ae1||client;return _0x4ae853['request'](_0x53594b,_0x27de49)[_0x70ec('0x12')](function(_0x230f4e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x2f8f55,'request\x20sent');logger['debug'](_0x70ec('0x13'),_0x2f8f55,'request\x20sent',JSON['stringify'](_0x230f4e));if(_0x230f4e[_0x70ec('0x14')]){if(_0x230f4e['error'][_0x70ec('0x15')]===0x1f4){logger[_0x70ec('0x14')](_0x70ec('0x16'),_0x2f8f55,_0x230f4e[_0x70ec('0x14')]['message']);return _0x1809cd(_0x230f4e[_0x70ec('0x14')][_0x70ec('0x17')]);}logger[_0x70ec('0x14')](_0x70ec('0x16'),_0x2f8f55,_0x230f4e['error'][_0x70ec('0x17')]);return _0x2091ff(_0x230f4e[_0x70ec('0x14')][_0x70ec('0x17')]);}else{logger['info'](_0x70ec('0x16'),_0x2f8f55,_0x70ec('0x18'));_0x2091ff(_0x230f4e[_0x70ec('0x19')][_0x70ec('0x17')]);}})[_0x70ec('0x1a')](function(_0x1678d6){logger[_0x70ec('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2f8f55,_0x1678d6);_0x1809cd(_0x1678d6);});});}function respondWithStatusCode(_0x94da90,_0x9d5eb){_0x9d5eb=_0x9d5eb||0xcc;return function(_0x18660c){if(_0x18660c){return _0x94da90[_0x70ec('0x1b')](_0x9d5eb);}return _0x94da90['status'](_0x9d5eb)[_0x70ec('0x1c')]();};}function respondWithResult(_0x22adae,_0x58968b){_0x58968b=_0x58968b||0xc8;return function(_0x591b59){if(_0x591b59){return _0x22adae['status'](_0x58968b)['json'](_0x591b59);}};}function respondWithFilteredResult(_0x28c784,_0x175a8f){return function(_0x5c6e66){if(_0x5c6e66){var _0x10872d=typeof _0x175a8f['offset']===_0x70ec('0x1d')&&typeof _0x175a8f[_0x70ec('0x1e')]==='undefined';var _0x35ae79=_0x5c6e66[_0x70ec('0x1f')];var _0x5993ff=_0x10872d?0x0:_0x175a8f[_0x70ec('0x20')];var _0x48a93e=_0x10872d?_0x5c6e66[_0x70ec('0x1f')]:_0x175a8f[_0x70ec('0x20')]+_0x175a8f[_0x70ec('0x1e')];var _0x2f7dd9;if(_0x48a93e>=_0x35ae79){_0x48a93e=_0x35ae79;_0x2f7dd9=0xc8;}else{_0x2f7dd9=0xce;}_0x28c784[_0x70ec('0x21')](_0x2f7dd9);return _0x28c784['set'](_0x70ec('0x22'),_0x5993ff+'-'+_0x48a93e+'/'+_0x35ae79)['json'](_0x5c6e66);}return null;};}function saveUpdates(_0x171682){return function(_0x326605){if(_0x326605){return _0x326605[_0x70ec('0x23')](_0x171682)[_0x70ec('0x12')](function(_0x3ab2c9){return _0x3ab2c9;});}return null;};}function removeEntity(_0x356167){return function(_0x353083){if(_0x353083){return _0x353083['destroy']()['then'](function(){_0x356167[_0x70ec('0x21')](0xcc)[_0x70ec('0x1c')]();});}};}function handleEntityNotFound(_0x414780){return function(_0x55bbf5){if(!_0x55bbf5){_0x414780[_0x70ec('0x1b')](0x194);}return _0x55bbf5;};}function handleError(_0x41d2ec,_0x1d716e){_0x1d716e=_0x1d716e||0x1f4;return function(_0x574abc){logger[_0x70ec('0x14')](_0x574abc[_0x70ec('0x24')]);if(_0x574abc['name']){delete _0x574abc[_0x70ec('0x25')];}_0x41d2ec[_0x70ec('0x21')](_0x1d716e)[_0x70ec('0x26')](_0x574abc);};}function getMustacheRender(_0xc502a3,_0x5d6da2){return Mustache['render'](_0xc502a3,_['merge'](_0x5d6da2[_0x70ec('0x27')],{'contact':_0x5d6da2['contact'],'message':_0x5d6da2[_0x70ec('0x17')],'agent':_0x5d6da2[_0x70ec('0x28')],'interaction':_0x5d6da2[_0x70ec('0x29')],'account':_0x5d6da2[_0x70ec('0x2a')]}))||'';}exports['index']=function(_0x33a61b,_0x5aedd5){var _0x5c00c1={};var _0x1bd42e=_[_0x70ec('0x2b')](db['ChatInteraction']['rawAttributes'],function(_0xac977e){return{'name':_0xac977e[_0x70ec('0x2c')],'type':_0xac977e['type'][_0x70ec('0x2d')]};});_0x5c00c1=qs[_0x70ec('0x2e')](_0x1bd42e,_0x33a61b);return interaction[_0x70ec('0x2f')](_0x70ec('0x30'),_0x33a61b[_0x70ec('0x31')],_0x33a61b[_0x70ec('0x32')],_0x5c00c1,_0x1bd42e)[_0x70ec('0x12')](respondWithFilteredResult(_0x5aedd5,_0x5c00c1))[_0x70ec('0x1a')](handleError(_0x5aedd5,null));};exports[_0x70ec('0x33')]=function(_0x48ce62,_0x5edce7){var _0x30f100={'raw':![],'where':{'id':_0x48ce62['params']['id']}},_0x1d3228={};_0x1d3228[_0x70ec('0x34')]=_['keys'](db[_0x70ec('0x35')]['rawAttributes']);_0x1d3228[_0x70ec('0x31')]=_[_0x70ec('0x36')](_0x48ce62[_0x70ec('0x31')]);_0x1d3228[_0x70ec('0x37')]=_[_0x70ec('0x38')](_0x1d3228[_0x70ec('0x34')],_0x1d3228[_0x70ec('0x31')]);_0x30f100[_0x70ec('0x39')]=_[_0x70ec('0x38')](_0x1d3228[_0x70ec('0x34')],qs[_0x70ec('0x3a')](_0x48ce62[_0x70ec('0x31')]['fields']));_0x30f100['attributes']=_0x30f100['attributes'][_0x70ec('0x3b')]?_0x30f100[_0x70ec('0x39')]:_0x1d3228[_0x70ec('0x34')];if(_0x48ce62[_0x70ec('0x31')][_0x70ec('0x3c')]){_0x30f100[_0x70ec('0x3d')]=[{'all':!![]}];}_0x30f100=_[_0x70ec('0x3e')]({},_0x30f100,_0x48ce62[_0x70ec('0x3f')]);return db[_0x70ec('0x35')][_0x70ec('0x40')](_0x30f100)[_0x70ec('0x12')](handleEntityNotFound(_0x5edce7,null))[_0x70ec('0x12')](respondWithResult(_0x5edce7,null))[_0x70ec('0x1a')](handleError(_0x5edce7,null));};exports[_0x70ec('0x41')]=function(_0x1a2eb4,_0x1fa8d2){return db['ChatInteraction'][_0x70ec('0x41')](_0x1a2eb4['body'],{})[_0x70ec('0x12')](respondWithResult(_0x1fa8d2,0xc9))[_0x70ec('0x1a')](handleError(_0x1fa8d2,null));};exports[_0x70ec('0x23')]=function(_0x5f3117,_0x794e5d){if(_0x5f3117[_0x70ec('0x27')]['id']){delete _0x5f3117[_0x70ec('0x27')]['id'];}return db['ChatInteraction'][_0x70ec('0x40')]({'where':{'id':_0x5f3117['params']['id']}})[_0x70ec('0x12')](handleEntityNotFound(_0x794e5d,null))[_0x70ec('0x12')](saveUpdates(_0x5f3117[_0x70ec('0x27')],null))[_0x70ec('0x12')](respondWithResult(_0x794e5d,null))[_0x70ec('0x1a')](handleError(_0x794e5d,null));};exports[_0x70ec('0x42')]=function(_0x1b2366,_0x6cf7e2){return db['ChatInteraction'][_0x70ec('0x40')]({'where':{'id':_0x1b2366['params']['id']}})[_0x70ec('0x12')](handleEntityNotFound(_0x6cf7e2,null))[_0x70ec('0x12')](removeEntity(_0x6cf7e2,null))[_0x70ec('0x1a')](handleError(_0x6cf7e2,null));};exports['describe']=function(_0x401005,_0x127e41){return db[_0x70ec('0x35')]['describe']()[_0x70ec('0x12')](respondWithResult(_0x127e41,null))['catch'](handleError(_0x127e41,null));};exports[_0x70ec('0x43')]=function(_0x5b2c91,_0x3ac2f8){var _0x47e4cb=_0x5b2c91[_0x70ec('0x44')]['id'];var _0x149306;var _0x10fd21;var _0xe84e92;return db[_0x70ec('0x35')][_0x70ec('0x45')]({'where':{'id':_0x47e4cb}})[_0x70ec('0x12')](function(_0x1c139e){_0x149306=_0x1c139e;return db[_0x70ec('0x46')]['findOne']({'where':{'id':_0x1c139e[_0x70ec('0x47')]},'attributes':['id','vidaooApiKey',_0x70ec('0x48'),_0x70ec('0x49'),_0x70ec('0x4a'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x1de936){if(_0x1de936&&_0x1de936[_0x70ec('0x4b')]&&_0x1de936[_0x70ec('0x48')]){_0x10fd21=_0x1de936;var _0x4f8117={'interaction':{'id':_0x47e4cb},'agent':{'id':_0x5b2c91[_0x70ec('0x32')]['id'],'name':_0x5b2c91[_0x70ec('0x32')][_0x70ec('0x25')],'fullname':_0x5b2c91[_0x70ec('0x32')][_0x70ec('0x4c')],'email':_0x5b2c91[_0x70ec('0x32')]['email']},'contact':_0x5b2c91[_0x70ec('0x27')][_0x70ec('0x4d')],'account':_0x5b2c91[_0x70ec('0x27')][_0x70ec('0x2a')]};var _0x71fe27={'rejectUnauthorized':![],'method':'POST','url':_0x70ec('0x4e'),'headers':{'X-APIKEY':_0x1de936[_0x70ec('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5b2c91[_0x70ec('0x32')][_0x70ec('0x4f')]],'buttons':null,'topic':_0x10fd21[_0x70ec('0x49')],'note':_[_0x70ec('0x50')](_0x10fd21['vidaooNote'])?null:getMustacheRender(_0x10fd21[_0x70ec('0x4a')],_0x4f8117),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x10fd21['vidaooMetadata'])){var _0x477328=getMustacheRender(_0x10fd21[_0x70ec('0x51')],_0x4f8117);var _0x11a4a3=JSON['parse'](_0x477328);_0x71fe27['body'][_0x70ec('0x52')]=_0x11a4a3;}}catch(_0x41fd25){throw new db[(_0x70ec('0x53'))][(_0x70ec('0x54'))](_0x70ec('0x55'));}return rp(_0x71fe27);}else{throw new db[(_0x70ec('0x53'))][(_0x70ec('0x54'))](_0x70ec('0x56'));}})[_0x70ec('0x12')](function(_0x159a40){_0xe84e92=_0x159a40;if(_0xe84e92['id']){var _0x4ae48b={'body':_0xe84e92[_0x70ec('0x57')],'ChatWebsiteId':_0x10fd21['id'],'ChatInteractionId':_0x149306['id'],'direction':_0x70ec('0x58'),'UserId':_0x5b2c91['user']['id']};return db[_0x70ec('0x59')]['create'](_0x4ae48b,{});}else{throw new db['Sequelize']['ValidationError'](_0x70ec('0x5a'));}})[_0x70ec('0x12')](function(){return _0x149306['updateAttributes']({'vidaooSessionId':_0xe84e92['id']});})[_0x70ec('0x12')](respondWithResult(_0x3ac2f8,null))[_0x70ec('0x1a')](handleError(_0x3ac2f8,null));};exports[_0x70ec('0x5b')]=function(_0x4fceed,_0x427c68){if(_0x4fceed[_0x70ec('0x27')]['id']){delete _0x4fceed[_0x70ec('0x27')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x4fceed[_0x70ec('0x44')]['id']},'include':[{'model':db[_0x70ec('0x5c')],'as':_0x70ec('0x5d')}]})['then'](handleEntityNotFound(_0x427c68,null))['then'](saveUpdates(_0x4fceed[_0x70ec('0x27')],null))['then'](respondWithResult(_0x427c68,null))[_0x70ec('0x1a')](handleError(_0x427c68,null));};exports['abandon']=function(_0x18d3f2,_0xd0fbdd){if(_0x18d3f2[_0x70ec('0x27')]['id']){delete _0x18d3f2[_0x70ec('0x27')]['id'];}return db[_0x70ec('0x35')][_0x70ec('0x40')]({'where':{'id':_0x18d3f2[_0x70ec('0x44')]['id']}})[_0x70ec('0x12')](function(_0x17213b){if(!_0x17213b){logger[_0x70ec('0x14')](_0x70ec('0x5e'),'abandon',0x194,_0x70ec('0x5f'));_0xd0fbdd[_0x70ec('0x1b')](0x194);}else{if(_0x17213b[_0x70ec('0x60')]){throw new db[(_0x70ec('0x53'))][(_0x70ec('0x54'))]('Interaction\x20already\x20assigned');}}return _0x17213b;})[_0x70ec('0x12')](function(_0x23d8b4){if(_0x23d8b4){return _0x23d8b4['update']({'closed':_0x18d3f2['body'][_0x70ec('0x61')],'disposition':_0x18d3f2[_0x70ec('0x27')]['disposition']})[_0x70ec('0x12')](function(_0x48c58a){return _0x48c58a;});}})['then'](function(){return respondWithRpcPromise(_0x70ec('0x62'),_0x70ec('0x63'),_0x18d3f2[_0x70ec('0x27')],client9004);})[_0x70ec('0x12')](respondWithResult(_0xd0fbdd,null))[_0x70ec('0x1a')](handleError(_0xd0fbdd,null));};exports['attachmentUpload']=function(_0x4f69ee,_0x44c68e){_0x4f69ee[_0x70ec('0x27')][_0x70ec('0x25')]=_0x4f69ee[_0x70ec('0x64')]['originalname'];_0x4f69ee[_0x70ec('0x27')][_0x70ec('0x65')]=_0x4f69ee[_0x70ec('0x64')][_0x70ec('0x66')];_0x4f69ee[_0x70ec('0x27')][_0x70ec('0x67')]=_0x4f69ee[_0x70ec('0x64')]['mimetype'];return db[_0x70ec('0x68')]['create'](_0x4f69ee['body'])[_0x70ec('0x12')](respondWithResult(_0x44c68e,0xc9))[_0x70ec('0x1a')](handleError(_0x44c68e,null));};exports[_0x70ec('0x69')]=function(_0x27170e,_0x44e862){return db[_0x70ec('0x35')][_0x70ec('0x45')]({'where':{'id':_0x27170e[_0x70ec('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x44e862,null))[_0x70ec('0x12')](function(_0x3beb3f){if(_0x3beb3f){if(_0x3beb3f['closed']){return _0x44e862[_0x70ec('0x21')](0x193)[_0x70ec('0x6a')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x70ec('0x45')]({'where':{'id':_0x27170e[_0x70ec('0x31')][_0x70ec('0x6b')]},'raw':!![]})[_0x70ec('0x12')](handleEntityNotFound(_0x44e862,null));}})[_0x70ec('0x12')](function(_0x32d965){if(_0x32d965){var _0x294bdb=_0x32d965[_0x70ec('0x6c')]!==null;var _0x5cbbea=path['join'](config[_0x70ec('0x6d')],_0x70ec('0x6e'));if(_0x294bdb){_0x5cbbea=path[_0x70ec('0x6f')](_0x5cbbea,_0x70ec('0x70'));}var _0x2dfda4=path[_0x70ec('0x6f')](_0x5cbbea,_0x32d965['basename']);return _0x44e862[_0x70ec('0x71')](_0x2dfda4);}})[_0x70ec('0x1a')](handleError(_0x44e862,null));};exports[_0x70ec('0x72')]=function(_0xcb30f5,_0x1d69ef){var _0x1791e3=null;var _0x288631=null;var _0x6a53d1=null;if(_0xcb30f5[_0x70ec('0x27')]['id']){delete _0xcb30f5[_0x70ec('0x27')]['id'];}if(_0xcb30f5[_0x70ec('0x27')][_0x70ec('0x73')]){_0x6a53d1=path[_0x70ec('0x6f')](config[_0x70ec('0x6d')],_0x70ec('0x74'),util['format'](_0x70ec('0x75'),Date[_0x70ec('0x76')]()));_0xcb30f5[_0x70ec('0x27')][_0x70ec('0x77')]=_0x6a53d1;}return db[_0x70ec('0x35')][_0x70ec('0x40')]({'where':{'id':_0xcb30f5[_0x70ec('0x44')]['id']},'include':[{'model':db[_0x70ec('0x59')],'as':_0x70ec('0x78'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x1d69ef,null))[_0x70ec('0x12')](saveUpdates(_0xcb30f5[_0x70ec('0x27')],null))[_0x70ec('0x12')](function(_0x6e9b0){if(_0x6e9b0){_0x1791e3=_0x6e9b0;return db['ChatWebsite']['find']({'where':{'id':_0x1791e3[_0x70ec('0x47')]}});}})[_0x70ec('0x12')](function(_0x40947e){if(_0x40947e){_0x288631=_0x40947e;return db['CmContact']['find']({'where':{'id':_0x1791e3[_0x70ec('0x79')]}});}})['then'](function(_0xa7c41c){if(_0xa7c41c){if(_0x6a53d1){var _0x315c96=null;for(var _0x3ac016=0x1;_0x3ac016<_0x1791e3[_0x70ec('0x78')]['length'];++_0x3ac016){_0x315c96=_0x1791e3[_0x70ec('0x78')][_0x3ac016];var _0x2610ce=_0x315c96[_0x70ec('0x60')]?util['format'](_0x70ec('0x7a'),_0x288631[_0x70ec('0x7b')],_0x315c96['UserId']):_0x70ec('0x7c');var _0x5cdecc=_0xcb30f5[_0x70ec('0x27')][_0x70ec('0x7d')]||util[_0x70ec('0x7e')](_0x70ec('0x7a'),_0x70ec('0x7f'),_0x315c96['ContactId']);switch(_0x288631[_0x70ec('0x80')]){case _0x70ec('0x81'):_0x2610ce=_0x315c96[_0x70ec('0x60')]?util[_0x70ec('0x7e')](_0x70ec('0x7a'),_0x288631['agentAlias'],_0x315c96[_0x70ec('0x60')]):'System';break;case _0x70ec('0x82'):_0x2610ce=_0x315c96[_0x70ec('0x60')]?_0x315c96[_0x70ec('0x83')]['alias']||_0x315c96['User'][_0x70ec('0x4c')]:_0x70ec('0x7c');break;case _0x70ec('0x84'):_0x2610ce=_0x315c96[_0x70ec('0x60')]?_0x315c96[_0x70ec('0x83')][_0x70ec('0x4c')]:_0x70ec('0x7c');break;default:_0x2610ce=_0x315c96['UserId']?util[_0x70ec('0x7e')](_0x70ec('0x7a'),_0x288631[_0x70ec('0x7b')],_0x315c96['UserId']):_0x70ec('0x7c');}var _0x5d7dbe=util[_0x70ec('0x7e')](_0x70ec('0x85'),moment(_0x315c96[_0x70ec('0x86')])[_0x70ec('0x7e')]('MM/DD/YYYY\x20HH:mm:ss'),_0x315c96[_0x70ec('0x87')]==='in'?_0x5cdecc:_0x2610ce,_0x315c96[_0x70ec('0x27')]);if(!_0x315c96[_0x70ec('0x88')]){fs[_0x70ec('0x89')](_0x6a53d1,_0x5d7dbe);}}return db[_0x70ec('0x8a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x70ec('0x8b')],'as':_0x70ec('0x8c'),'raw':!![],'include':[{'model':db[_0x70ec('0x8d')],'as':_0x70ec('0x8d'),'raw':!![]}]}]});}}})[_0x70ec('0x12')](function(_0xd433c){if(!_0xd433c||!_0xd433c[_0x70ec('0x8c')]||!_0xcb30f5['body'])return _0x1791e3;var _0x214df=_0xd433c['getSmtpOptions']();return respondWithRpcPromise(_0x70ec('0x8e'),_0x70ec('0x8f'),{'account':_0x214df,'message':{'from':util[_0x70ec('0x7e')](_0x70ec('0x90'),_0xd433c[_0x70ec('0x25')],_0xd433c[_0x70ec('0x4f')]||_0xd433c[_0x70ec('0x8c')][_0x70ec('0x32')]),'to':_0xcb30f5['body'][_0x70ec('0x73')],'subject':_0x70ec('0x91'),'text':util['format'](_0x70ec('0x92'),_0xcb30f5[_0x70ec('0x27')][_0x70ec('0x73')]),'attachments':[{'path':_0x6a53d1}]}})[_0x70ec('0x12')](function(){return _0x1791e3;})['catch'](function(_0xf4da8b){logger[_0x70ec('0x14')](_0xf4da8b);});})[_0x70ec('0x12')](respondWithStatusCode(_0x1d69ef,0xc8))[_0x70ec('0x1a')](handleError(_0x1d69ef,null));};exports[_0x70ec('0x93')]=function(_0x25e894,_0x45bcc7){return db[_0x70ec('0x59')][_0x70ec('0x40')]({'where':{'id':_0x25e894['params']['id']}})[_0x70ec('0x12')](handleEntityNotFound(_0x45bcc7,null))[_0x70ec('0x12')](function(_0x426a94){if(_0x426a94){return _0x426a94[_0x70ec('0x93')](_0x25e894['body']['ids'],_[_0x70ec('0x94')](_0x25e894[_0x70ec('0x27')],[_0x70ec('0x95'),'id'])||{});}})[_0x70ec('0x12')](respondWithResult(_0x45bcc7,null))[_0x70ec('0x1a')](handleError(_0x45bcc7,null));};exports[_0x70ec('0x96')]=function(_0x49a8cc,_0x145806){var _0x58077a={'raw':![],'where':{}};var _0x2e58e6={};var _0x2bbcab={'count':0x0,'rows':[]};return db[_0x70ec('0x35')][_0x70ec('0x45')]({'where':{'id':_0x49a8cc[_0x70ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x145806,null))[_0x70ec('0x12')](function(_0x355b20){if(_0x355b20){_0x2e58e6['model']=_['keys'](db[_0x70ec('0x59')][_0x70ec('0x97')]);_0x2e58e6[_0x70ec('0x31')]=_[_0x70ec('0x36')](_0x49a8cc[_0x70ec('0x31')]);_0x2e58e6['filters']=_[_0x70ec('0x38')](_0x2e58e6[_0x70ec('0x34')],_0x2e58e6['query']);_0x58077a['attributes']=_[_0x70ec('0x38')](_0x2e58e6['model'],qs['fields'](_0x49a8cc[_0x70ec('0x31')][_0x70ec('0x3a')]));_0x58077a['attributes']=_0x58077a[_0x70ec('0x39')]['length']?_0x58077a[_0x70ec('0x39')]:_0x2e58e6[_0x70ec('0x34')];if(!_0x49a8cc['query'][_0x70ec('0x98')](_0x70ec('0x99'))){_0x58077a[_0x70ec('0x1e')]=qs[_0x70ec('0x1e')](_0x49a8cc[_0x70ec('0x31')]['limit']);_0x58077a[_0x70ec('0x20')]=qs[_0x70ec('0x20')](_0x49a8cc[_0x70ec('0x31')][_0x70ec('0x20')]);}_0x58077a[_0x70ec('0x9a')]=qs[_0x70ec('0x9b')](_0x49a8cc['query']['sort']);_0x58077a[_0x70ec('0x9c')]=qs[_0x70ec('0x37')](_[_0x70ec('0x9d')](_0x49a8cc[_0x70ec('0x31')],_0x2e58e6[_0x70ec('0x37')]));_0x58077a[_0x70ec('0x9c')][_0x70ec('0x9e')]=_0x355b20['id'];if(_0x49a8cc['query'][_0x70ec('0x9f')]){_0x58077a[_0x70ec('0x9c')]=_[_0x70ec('0x3e')](_0x58077a[_0x70ec('0x9c')],{'$or':_['map'](_0x58077a[_0x70ec('0x39')],function(_0x535ed2){var _0x55e7e8={};_0x55e7e8[_0x535ed2]={'$like':'%'+_0x49a8cc['query']['filter']+'%'};return _0x55e7e8;})});}if(_0x49a8cc['query'][_0x70ec('0xa0')]){var _0x51c65d=_0x49a8cc[_0x70ec('0x31')][_0x70ec('0xa0')][_0x70ec('0xa1')](',');var _0x2f1bdb={};_0x2f1bdb[_0x51c65d[0x0]]={'$gte':moment(_0x51c65d[0x1])[_0x70ec('0x7e')](_0x70ec('0xa2'))};_0x58077a[_0x70ec('0x9c')]=_[_0x70ec('0x3e')](_0x58077a['where'],_0x2f1bdb);}_0x58077a=_['merge']({},_0x58077a,_0x49a8cc[_0x70ec('0x3f')]);return db[_0x70ec('0x59')][_0x70ec('0x1f')]({'where':_0x58077a[_0x70ec('0x9c')]})['then'](function(_0x38901f){_0x2bbcab[_0x70ec('0x1f')]=_0x38901f;if(_0x49a8cc['query'][_0x70ec('0x3c')]){_0x58077a[_0x70ec('0x3d')]=[{'all':!![]}];}return db[_0x70ec('0x59')]['findAll'](_0x58077a);})[_0x70ec('0x12')](function(_0x1c4aab){_0x2bbcab[_0x70ec('0xa3')]=_0x1c4aab;return _0x2bbcab;});}})[_0x70ec('0x12')](respondWithFilteredResult(_0x145806,_0x58077a))[_0x70ec('0x1a')](handleError(_0x145806,null));};exports[_0x70ec('0xa4')]=function(_0x5318e2,_0x271f84){var _0x343695={'where':{}},_0x37c8b7={},_0x4362ac={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x5318e2[_0x70ec('0x44')]['id']}})[_0x70ec('0x12')](handleEntityNotFound(_0x271f84,null))[_0x70ec('0x12')](function(_0x1c98fa){if(_0x1c98fa){_0x37c8b7[_0x70ec('0x34')]=_['keys'](db[_0x70ec('0x59')][_0x70ec('0x97')]);_0x37c8b7[_0x70ec('0x31')]=_[_0x70ec('0x36')](_0x5318e2['query']);_0x37c8b7['filters']=_[_0x70ec('0x38')](_0x37c8b7[_0x70ec('0x34')],_0x37c8b7['query']);_0x343695[_0x70ec('0x39')]=_['intersection'](_0x37c8b7[_0x70ec('0x34')],qs['fields'](_0x5318e2['query'][_0x70ec('0x3a')]));_0x343695[_0x70ec('0x39')]=_0x343695[_0x70ec('0x39')][_0x70ec('0x3b')]?_0x343695[_0x70ec('0x39')]:_0x37c8b7[_0x70ec('0x34')];if(!_0x5318e2[_0x70ec('0x31')][_0x70ec('0x98')](_0x70ec('0x99'))){_0x343695[_0x70ec('0x1e')]=qs[_0x70ec('0x1e')](_0x5318e2['query']['limit']);_0x343695['offset']=qs['offset'](_0x5318e2[_0x70ec('0x31')]['offset']);}_0x343695[_0x70ec('0x9a')]=qs['sort'](_0x5318e2[_0x70ec('0x31')]['sort']);_0x343695[_0x70ec('0x9c')]=qs['filters'](_[_0x70ec('0x9d')](_0x5318e2[_0x70ec('0x31')],_0x37c8b7[_0x70ec('0x37')]));_0x343695['where']['ChatInteractionId']=_0x1c98fa['id'];if(_0x5318e2[_0x70ec('0x31')][_0x70ec('0x9f')]){_0x343695['where']=_['merge'](_0x343695['where'],{'$or':_[_0x70ec('0x2b')](_0x343695[_0x70ec('0x39')],function(_0x536920){var _0x5d37ef={};_0x5d37ef[_0x536920]={'$like':'%'+_0x5318e2[_0x70ec('0x31')][_0x70ec('0x9f')]+'%'};return _0x5d37ef;})});}_0x343695['where']['secret']=![];if(_0x5318e2[_0x70ec('0x31')]['id']){_0x343695[_0x70ec('0x9c')]['id']={'$gt':_0x5318e2['query']['id']};}_0x343695=_[_0x70ec('0x3e')]({},_0x343695,_0x5318e2[_0x70ec('0x3f')]);return db[_0x70ec('0x59')][_0x70ec('0x1f')]({'where':_0x343695['where']})['then'](function(_0x1bcb4b){_0x4362ac[_0x70ec('0x1f')]=_0x1bcb4b;_0x343695['include']=[];if(_0x5318e2['query'][_0x70ec('0xa5')]){_0x343695['include']['push']({'model':db[_0x70ec('0x83')],'as':_0x70ec('0x83'),'attributes':['id',_0x70ec('0x4c'),'alias']});}if(_0x5318e2[_0x70ec('0x31')]['includeAll']){_0x343695[_0x70ec('0x3d')]=[{'all':!![]}];}return db[_0x70ec('0x59')][_0x70ec('0x2f')](_0x343695);})[_0x70ec('0x12')](function(_0x1bdc49){_0x4362ac[_0x70ec('0xa3')]=_0x1bdc49;return _0x4362ac;});}})[_0x70ec('0x12')](respondWithFilteredResult(_0x271f84,_0x343695))[_0x70ec('0x1a')](handleError(_0x271f84,null));};exports[_0x70ec('0xa6')]=function(_0x46aa90,_0x1c78b0){return db['ChatInteraction'][_0x70ec('0x40')]({'where':{'id':_0x46aa90[_0x70ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c78b0,null))[_0x70ec('0x12')](function(_0x47272b){if(_0x47272b){return _0x47272b[_0x70ec('0xa7')](_0x46aa90[_0x70ec('0x27')][_0x70ec('0x95')],_[_0x70ec('0x94')](_0x46aa90[_0x70ec('0x27')],[_0x70ec('0x95'),'id'])||{})[_0x70ec('0xa8')](function(){return db['Tag']['findAll']({'attributes':['id',_0x70ec('0x25'),'color'],'where':{'id':_0x46aa90[_0x70ec('0x27')][_0x70ec('0x95')]}});})[_0x70ec('0x12')](function(_0x143145){socket[_0x70ec('0xa9')](_0x70ec('0xaa'),{'id':Number(_0x46aa90['params']['id']),'tags':_0x143145||[]});return{'id':Number(_0x46aa90['params']['id']),'tags':_0x143145||[]};});}})[_0x70ec('0x12')](respondWithResult(_0x1c78b0,null))['catch'](handleError(_0x1c78b0,null));};exports[_0x70ec('0xab')]=function(_0x3e3d08,_0x27ffe3){return db[_0x70ec('0x35')][_0x70ec('0x40')]({'where':{'id':_0x3e3d08[_0x70ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x27ffe3,null))[_0x70ec('0x12')](function(_0x359997){if(_0x359997){return _0x359997[_0x70ec('0xab')](_0x3e3d08[_0x70ec('0x31')][_0x70ec('0x95')]);}})[_0x70ec('0x12')](respondWithStatusCode(_0x27ffe3,null))[_0x70ec('0x1a')](handleError(_0x27ffe3,null));};exports['download']=function(_0x24c550,_0x4800c6){var _0x193d71=moment()[_0x70ec('0xac')]()[_0x70ec('0xad')]();var _0x132e18=path['join'](config[_0x70ec('0x6d')],_0x70ec('0xae'),_0x70ec('0xaf'),_0x70ec('0xb0'));var _0x49a52f=path['join'](config[_0x70ec('0x6d')],_0x70ec('0xae'),'files','attachments');var _0x422d47=path['join'](_0x132e18,_0x193d71);var _0xd9b9bb=util['format'](_0x70ec('0xb1'),_0x24c550['params']['id'],_0x193d71);var _0x40c991=path[_0x70ec('0x6f')](_0x132e18,_0xd9b9bb);var _0x35ccdb=[];_0x35ccdb['push']({'model':db[_0x70ec('0x83')],'as':'User','attributes':['id',_0x70ec('0x4c')],'raw':!![]});_0x35ccdb['push']({'model':db[_0x70ec('0x5c')],'as':_0x70ec('0x5d'),'attributes':['id',_0x70ec('0xb2'),_0x70ec('0xb3')],'raw':!![]});if(_0x24c550[_0x70ec('0x31')]['attachments']){_0x35ccdb[_0x70ec('0xb4')]({'model':db[_0x70ec('0x68')],'as':_0x70ec('0x68'),'raw':!![]});}var _0xe23e59=[{'model':db[_0x70ec('0x59')],'as':_0x70ec('0x78'),'attributes':['id',_0x70ec('0x27'),_0x70ec('0x86'),'direction',_0x70ec('0x88'),_0x70ec('0xb5')],'include':_0x35ccdb}];_0xe23e59['push']({'model':db[_0x70ec('0x46')],'as':'Account','attributes':['id','name']});_0xe23e59[_0x70ec('0xb4')]({'model':db[_0x70ec('0x83')],'as':'Owner','attributes':['id',_0x70ec('0x4c')]});return db['ChatInteraction'][_0x70ec('0x40')]({'where':{'id':_0x24c550[_0x70ec('0x44')]['id']},'include':_0xe23e59})[_0x70ec('0x12')](handleEntityNotFound(_0x4800c6,null))[_0x70ec('0x12')](function(_0x2028a1){if(_0x2028a1){var _0x5bfb49=_0x2028a1['get']({'plain':!![]});fs[_0x70ec('0xb6')](_0x422d47);var _0x4c2d58={'channel':_0x70ec('0xb7'),'account':_0x5bfb49['Account'][_0x70ec('0x25')],'agent':_0x5bfb49[_0x70ec('0xb8')]?_0x5bfb49[_0x70ec('0xb8')][_0x70ec('0x4c')]:_0x70ec('0xb9'),'createdAt':moment(_0x5bfb49[_0x70ec('0x86')])[_0x70ec('0x7e')](_0x70ec('0xa2'))[_0x70ec('0xad')](),'closedAt':_0x5bfb49[_0x70ec('0x61')]?moment(_0x5bfb49[_0x70ec('0xba')])[_0x70ec('0x7e')](_0x70ec('0xa2'))['toString']():'','disposition':_0x5bfb49[_0x70ec('0xbb')],'chatInfo':{'browser':_0x5bfb49[_0x70ec('0xbc')],'os':_0x5bfb49['osName'],'referer':_0x5bfb49[_0x70ec('0xbd')],'customerIp':_0x5bfb49[_0x70ec('0xbe')],'customerPort':_0x5bfb49['customerPort']?_0x5bfb49[_0x70ec('0xbf')]:_0x70ec('0xb9')},'messages':_(_0x5bfb49[_0x70ec('0x78')])['tail']()['filter']({'secret':![]})[_0x70ec('0x2b')](function(_0x634764){if(_0x634764[_0x70ec('0x68')]){var _0xf1cbd=path[_0x70ec('0x6f')](_0x49a52f,_0x634764[_0x70ec('0x68')][_0x70ec('0x65')]);if(fs[_0x70ec('0xc0')](_0xf1cbd)){fs[_0x70ec('0xc1')](_0xf1cbd)['pipe'](fs['createWriteStream'](path[_0x70ec('0x6f')](_0x422d47,_0x634764[_0x70ec('0x68')][_0x70ec('0x65')])));}}return{'date':moment(_0x634764[_0x70ec('0x86')])[_0x70ec('0x7e')](_0x70ec('0xa2'))[_0x70ec('0xad')](),'sender':_0x634764[_0x70ec('0x87')]===_0x70ec('0x58')?_0x634764[_0x70ec('0x83')]?_0x634764[_0x70ec('0x83')][_0x70ec('0x4c')]:'System':_0x634764[_0x70ec('0x5d')][_0x70ec('0xb2')]+(_0x634764[_0x70ec('0x5d')]['lastName']?'\x20'+_0x634764[_0x70ec('0x5d')][_0x70ec('0xb3')]:''),'body':_0x634764[_0x70ec('0x68')]?_0x634764[_0x70ec('0x68')][_0x70ec('0x65')]:_0x634764[_0x70ec('0x27')],'direction':_0x634764[_0x70ec('0x87')]===_0x70ec('0x58')?'A':'C','secret':_0x634764['secret'],'read':_0x634764[_0x70ec('0xb5')],'attachment':_0x634764[_0x70ec('0x68')]};})[_0x70ec('0xc2')]()};return ejs['renderFile'](path[_0x70ec('0x6f')](config[_0x70ec('0x6d')],_0x70ec('0xae'),_0x70ec('0xc3'),'downloadInteraction.ejs'),{'interaction':_0x4c2d58})[_0x70ec('0x12')](function(_0x15a623){var _0x440078=path[_0x70ec('0x6f')](_0x422d47,_0x70ec('0xc4')+_0x5bfb49['id']+'-'+_0x193d71+_0x70ec('0xc5'));var _0x4630fc={'path':_0x440078,'channel':'Chat','interactionId':_0x5bfb49['id']};return pdf[_0x70ec('0xc6')](_0x15a623,_0x4630fc);})[_0x70ec('0x12')](function(){return new Promise(function(_0x25ffe5,_0x5d02e2){zipdir(_0x422d47,{'saveTo':_0x40c991},function(_0x23fa8f,_0x24ec29){if(_0x23fa8f)return _0x5d02e2(_0x23fa8f);return _0x25ffe5(_0x24ec29);});})[_0x70ec('0x12')](function(){return new BPromise(function(_0xe17f61,_0x48dd14){rimraf(_0x422d47,function(_0x422dc6){if(_0x422dc6)_0x48dd14(_0x422dc6);return _0xe17f61();});});})[_0x70ec('0x12')](function(){return _0x4800c6['download'](_0x40c991,_0xd9b9bb,function(_0x30f874){if(_0x30f874){logger[_0x70ec('0x14')](_0x70ec('0xc7'),_0x30f874);}else{fs[_0x70ec('0xc8')](_0x40c991);}});});});}else{return _0x4800c6[_0x70ec('0x1b')](0xc8);}})[_0x70ec('0x1a')](handleError(_0x4800c6,null));};
\ No newline at end of file
+var _0xcf0e=['Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','UserId','%s%d','System','customer','Visitor','agentIdentifier','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Smtp','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','pick','ChatInteractionId','options','includeAgent','push','alias','addTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','toString','server','files','tmp','lastName','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerPort','tail','createReadStream','pipe','createWriteStream','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','localhost','redis','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','result','ChatInteraction,\x20%s,\x20%s','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','contact','agent','interaction','account','index','map','rawAttributes','fieldName','key','getOptions','findAll','chat','query','user','catch','show','params','ChatInteraction','keys','filters','model','attributes','intersection','fields','length','includeAll','include','find','create','body','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','out','ChatMessage','updateAttributes','customUpdate','CmContact'];(function(_0x58fb9d,_0xc4e55f){var _0x1f2c7f=function(_0x114d88){while(--_0x114d88){_0x58fb9d['push'](_0x58fb9d['shift']());}};_0x1f2c7f(++_0xc4e55f);}(_0xcf0e,0x6d));var _0xecf0=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xcf0e[_0xf51c06];return _0x1d5420;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xecf0('0x0'));var rp=require('request-promise');var moment=require(_0xecf0('0x1'));var BPromise=require(_0xecf0('0x2'));var Mustache=require(_0xecf0('0x3'));var util=require(_0xecf0('0x4'));var path=require(_0xecf0('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xecf0('0x6'));var Redis=require(_0xecf0('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xecf0('0x8'));var pdf=require(_0xecf0('0x9'));var logger=require('../../config/logger')(_0xecf0('0xa'));var config=require(_0xecf0('0xb'));var db=require(_0xecf0('0xc'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xecf0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecf0('0xe')]));require('./chatInteraction.socket')[_0xecf0('0xf')](socket);var jayson=require(_0xecf0('0x10'));var client=jayson[_0xecf0('0x11')][_0xecf0('0x12')]({'port':0x232b});var client9004=jayson[_0xecf0('0x11')][_0xecf0('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x3d3bbd,_0x37cc31,_0x66c47d,_0x295baf){return new BPromise(function(_0x1bd70d,_0x398793){var _0x276a6c=_0x295baf||client;return _0x276a6c[_0xecf0('0x13')](_0x3d3bbd,_0x66c47d)[_0xecf0('0x14')](function(_0x39e325){logger[_0xecf0('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x37cc31,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x37cc31,_0xecf0('0x16'),JSON[_0xecf0('0x17')](_0x39e325));if(_0x39e325[_0xecf0('0x18')]){if(_0x39e325[_0xecf0('0x18')][_0xecf0('0x19')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x37cc31,_0x39e325[_0xecf0('0x18')][_0xecf0('0x1a')]);return _0x398793(_0x39e325[_0xecf0('0x18')]['message']);}logger[_0xecf0('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x37cc31,_0x39e325[_0xecf0('0x18')][_0xecf0('0x1a')]);return _0x1bd70d(_0x39e325[_0xecf0('0x18')]['message']);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x37cc31,_0xecf0('0x16'));_0x1bd70d(_0x39e325[_0xecf0('0x1b')]['message']);}})['catch'](function(_0x2e23a8){logger[_0xecf0('0x18')](_0xecf0('0x1c'),_0x37cc31,_0x2e23a8);_0x398793(_0x2e23a8);});});}function respondWithStatusCode(_0x10087b,_0xdbd195){_0xdbd195=_0xdbd195||0xcc;return function(_0x3d21e2){if(_0x3d21e2){return _0x10087b[_0xecf0('0x1d')](_0xdbd195);}return _0x10087b[_0xecf0('0x1e')](_0xdbd195)[_0xecf0('0x1f')]();};}function respondWithResult(_0x4badc7,_0x354f13){_0x354f13=_0x354f13||0xc8;return function(_0x58e9a1){if(_0x58e9a1){return _0x4badc7[_0xecf0('0x1e')](_0x354f13)[_0xecf0('0x20')](_0x58e9a1);}};}function respondWithFilteredResult(_0x42ecb2,_0x15d57c){return function(_0x580727){if(_0x580727){var _0x388619=typeof _0x15d57c[_0xecf0('0x21')]===_0xecf0('0x22')&&typeof _0x15d57c[_0xecf0('0x23')]===_0xecf0('0x22');var _0x15b966=_0x580727[_0xecf0('0x24')];var _0x4aef05=_0x388619?0x0:_0x15d57c[_0xecf0('0x21')];var _0x1fa553=_0x388619?_0x580727[_0xecf0('0x24')]:_0x15d57c[_0xecf0('0x21')]+_0x15d57c['limit'];var _0x448c30;if(_0x1fa553>=_0x15b966){_0x1fa553=_0x15b966;_0x448c30=0xc8;}else{_0x448c30=0xce;}_0x42ecb2[_0xecf0('0x1e')](_0x448c30);return _0x42ecb2[_0xecf0('0x25')](_0xecf0('0x26'),_0x4aef05+'-'+_0x1fa553+'/'+_0x15b966)[_0xecf0('0x20')](_0x580727);}return null;};}function saveUpdates(_0x3b31ee){return function(_0x515512){if(_0x515512){return _0x515512[_0xecf0('0x27')](_0x3b31ee)[_0xecf0('0x14')](function(_0xd3f5b6){return _0xd3f5b6;});}return null;};}function removeEntity(_0x3b643d){return function(_0x124ac4){if(_0x124ac4){return _0x124ac4[_0xecf0('0x28')]()[_0xecf0('0x14')](function(){_0x3b643d['status'](0xcc)[_0xecf0('0x1f')]();});}};}function handleEntityNotFound(_0x53586c){return function(_0x3181d6){if(!_0x3181d6){_0x53586c[_0xecf0('0x1d')](0x194);}return _0x3181d6;};}function handleError(_0x900106,_0x458788){_0x458788=_0x458788||0x1f4;return function(_0x5cdb9b){logger[_0xecf0('0x18')](_0x5cdb9b[_0xecf0('0x29')]);if(_0x5cdb9b[_0xecf0('0x2a')]){delete _0x5cdb9b[_0xecf0('0x2a')];}_0x900106[_0xecf0('0x1e')](_0x458788)['send'](_0x5cdb9b);};}function getMustacheRender(_0x1c4301,_0x5aebed){return Mustache[_0xecf0('0x2b')](_0x1c4301,_[_0xecf0('0x2c')](_0x5aebed['body'],{'contact':_0x5aebed[_0xecf0('0x2d')],'message':_0x5aebed['message'],'agent':_0x5aebed[_0xecf0('0x2e')],'interaction':_0x5aebed[_0xecf0('0x2f')],'account':_0x5aebed[_0xecf0('0x30')]}))||'';}exports[_0xecf0('0x31')]=function(_0xdc91ad,_0x4f4cdb){var _0x475413={};var _0x8a50d2=_[_0xecf0('0x32')](db['ChatInteraction'][_0xecf0('0x33')],function(_0x534048){return{'name':_0x534048[_0xecf0('0x34')],'type':_0x534048['type'][_0xecf0('0x35')]};});_0x475413=qs[_0xecf0('0x36')](_0x8a50d2,_0xdc91ad);return interaction[_0xecf0('0x37')](_0xecf0('0x38'),_0xdc91ad[_0xecf0('0x39')],_0xdc91ad[_0xecf0('0x3a')],_0x475413,_0x8a50d2)['then'](respondWithFilteredResult(_0x4f4cdb,_0x475413))[_0xecf0('0x3b')](handleError(_0x4f4cdb,null));};exports[_0xecf0('0x3c')]=function(_0x4f3e5f,_0x5e15c9){var _0x2652b3={'raw':![],'where':{'id':_0x4f3e5f[_0xecf0('0x3d')]['id']}},_0x252eec={};_0x252eec['model']=_['keys'](db[_0xecf0('0x3e')][_0xecf0('0x33')]);_0x252eec['query']=_[_0xecf0('0x3f')](_0x4f3e5f[_0xecf0('0x39')]);_0x252eec[_0xecf0('0x40')]=_['intersection'](_0x252eec[_0xecf0('0x41')],_0x252eec[_0xecf0('0x39')]);_0x2652b3[_0xecf0('0x42')]=_[_0xecf0('0x43')](_0x252eec[_0xecf0('0x41')],qs['fields'](_0x4f3e5f[_0xecf0('0x39')][_0xecf0('0x44')]));_0x2652b3['attributes']=_0x2652b3[_0xecf0('0x42')][_0xecf0('0x45')]?_0x2652b3['attributes']:_0x252eec['model'];if(_0x4f3e5f[_0xecf0('0x39')][_0xecf0('0x46')]){_0x2652b3[_0xecf0('0x47')]=[{'all':!![]}];}_0x2652b3=_['merge']({},_0x2652b3,_0x4f3e5f['options']);return db[_0xecf0('0x3e')][_0xecf0('0x48')](_0x2652b3)[_0xecf0('0x14')](handleEntityNotFound(_0x5e15c9,null))[_0xecf0('0x14')](respondWithResult(_0x5e15c9,null))[_0xecf0('0x3b')](handleError(_0x5e15c9,null));};exports[_0xecf0('0x49')]=function(_0x1b5bd8,_0x2eee3f){return db[_0xecf0('0x3e')][_0xecf0('0x49')](_0x1b5bd8[_0xecf0('0x4a')],{})[_0xecf0('0x14')](respondWithResult(_0x2eee3f,0xc9))[_0xecf0('0x3b')](handleError(_0x2eee3f,null));};exports['update']=function(_0x49aedf,_0xa518f3){if(_0x49aedf[_0xecf0('0x4a')]['id']){delete _0x49aedf[_0xecf0('0x4a')]['id'];}return db[_0xecf0('0x3e')][_0xecf0('0x48')]({'where':{'id':_0x49aedf[_0xecf0('0x3d')]['id']}})[_0xecf0('0x14')](handleEntityNotFound(_0xa518f3,null))[_0xecf0('0x14')](saveUpdates(_0x49aedf[_0xecf0('0x4a')],null))[_0xecf0('0x14')](respondWithResult(_0xa518f3,null))[_0xecf0('0x3b')](handleError(_0xa518f3,null));};exports[_0xecf0('0x28')]=function(_0x1f661b,_0x53b978){return db[_0xecf0('0x3e')][_0xecf0('0x48')]({'where':{'id':_0x1f661b[_0xecf0('0x3d')]['id']}})[_0xecf0('0x14')](handleEntityNotFound(_0x53b978,null))[_0xecf0('0x14')](removeEntity(_0x53b978,null))[_0xecf0('0x3b')](handleError(_0x53b978,null));};exports[_0xecf0('0x4b')]=function(_0x20346a,_0x338241){return db['ChatInteraction']['describe']()[_0xecf0('0x14')](respondWithResult(_0x338241,null))['catch'](handleError(_0x338241,null));};exports['createVidaooSession']=function(_0x2e098a,_0x3116e6){var _0xd614c4=_0x2e098a[_0xecf0('0x3d')]['id'];var _0x5d4f3d;var _0x354607;var _0x327399;return db[_0xecf0('0x3e')][_0xecf0('0x4c')]({'where':{'id':_0xd614c4}})[_0xecf0('0x14')](function(_0x5a1663){_0x5d4f3d=_0x5a1663;return db[_0xecf0('0x4d')][_0xecf0('0x4c')]({'where':{'id':_0x5a1663[_0xecf0('0x4e')]},'attributes':['id',_0xecf0('0x4f'),_0xecf0('0x50'),_0xecf0('0x51'),_0xecf0('0x52'),_0xecf0('0x53')],'raw':!![]});})[_0xecf0('0x14')](function(_0x502db8){if(_0x502db8&&_0x502db8['vidaooApiKey']&&_0x502db8['vidaooEscalation']){_0x354607=_0x502db8;var _0x5ceb34={'interaction':{'id':_0xd614c4},'agent':{'id':_0x2e098a[_0xecf0('0x3a')]['id'],'name':_0x2e098a['user']['name'],'fullname':_0x2e098a[_0xecf0('0x3a')][_0xecf0('0x54')],'email':_0x2e098a['user'][_0xecf0('0x55')]},'contact':_0x2e098a[_0xecf0('0x4a')][_0xecf0('0x2d')],'account':_0x2e098a[_0xecf0('0x4a')][_0xecf0('0x30')]};var _0xe817e0={'rejectUnauthorized':![],'method':_0xecf0('0x56'),'url':_0xecf0('0x57'),'headers':{'X-APIKEY':_0x502db8[_0xecf0('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2e098a[_0xecf0('0x3a')][_0xecf0('0x55')]],'buttons':null,'topic':_0x354607[_0xecf0('0x51')],'note':_[_0xecf0('0x58')](_0x354607[_0xecf0('0x52')])?null:getMustacheRender(_0x354607[_0xecf0('0x52')],_0x5ceb34),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x354607[_0xecf0('0x53')])){var _0x375377=getMustacheRender(_0x354607[_0xecf0('0x53')],_0x5ceb34);var _0x463a4c=JSON[_0xecf0('0x59')](_0x375377);_0xe817e0[_0xecf0('0x4a')][_0xecf0('0x5a')]=_0x463a4c;}}catch(_0x3cb581){throw new db[(_0xecf0('0x5b'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xe817e0);}else{throw new db[(_0xecf0('0x5b'))][(_0xecf0('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xecf0('0x14')](function(_0x423bd5){_0x327399=_0x423bd5;if(_0x327399['id']){var _0x216bea={'body':_0x327399['join_url'],'ChatWebsiteId':_0x354607['id'],'ChatInteractionId':_0x5d4f3d['id'],'direction':_0xecf0('0x5d'),'UserId':_0x2e098a['user']['id']};return db[_0xecf0('0x5e')][_0xecf0('0x49')](_0x216bea,{});}else{throw new db[(_0xecf0('0x5b'))][(_0xecf0('0x5c'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xecf0('0x14')](function(){return _0x5d4f3d[_0xecf0('0x5f')]({'vidaooSessionId':_0x327399['id']});})[_0xecf0('0x14')](respondWithResult(_0x3116e6,null))[_0xecf0('0x3b')](handleError(_0x3116e6,null));};exports[_0xecf0('0x60')]=function(_0x3d1e2a,_0x1cdb3e){if(_0x3d1e2a[_0xecf0('0x4a')]['id']){delete _0x3d1e2a['body']['id'];}return db[_0xecf0('0x3e')][_0xecf0('0x48')]({'where':{'id':_0x3d1e2a[_0xecf0('0x3d')]['id']},'include':[{'model':db[_0xecf0('0x61')],'as':_0xecf0('0x62')}]})[_0xecf0('0x14')](handleEntityNotFound(_0x1cdb3e,null))[_0xecf0('0x14')](saveUpdates(_0x3d1e2a[_0xecf0('0x4a')],null))[_0xecf0('0x14')](respondWithResult(_0x1cdb3e,null))[_0xecf0('0x3b')](handleError(_0x1cdb3e,null));};exports[_0xecf0('0x63')]=function(_0x15a937,_0x22ca53){if(_0x15a937[_0xecf0('0x4a')]['id']){delete _0x15a937[_0xecf0('0x4a')]['id'];}return db['ChatInteraction'][_0xecf0('0x48')]({'where':{'id':_0x15a937[_0xecf0('0x3d')]['id']}})['then'](function(_0x2364d0){if(!_0x2364d0){logger[_0xecf0('0x18')](_0xecf0('0x64'),_0xecf0('0x63'),0x194,_0xecf0('0x65'));_0x22ca53['sendStatus'](0x194);}else{if(_0x2364d0['UserId']){throw new db[(_0xecf0('0x5b'))]['ValidationError'](_0xecf0('0x66'));}}return _0x2364d0;})[_0xecf0('0x14')](function(_0x4c3986){if(_0x4c3986){return _0x4c3986[_0xecf0('0x27')]({'closed':_0x15a937['body']['closed'],'disposition':_0x15a937[_0xecf0('0x4a')][_0xecf0('0x67')]})[_0xecf0('0x14')](function(_0x133bc3){return _0x133bc3;});}})[_0xecf0('0x14')](function(){return respondWithRpcPromise(_0xecf0('0x68'),_0xecf0('0x63'),_0x15a937[_0xecf0('0x4a')],client9004);})['then'](respondWithResult(_0x22ca53,null))[_0xecf0('0x3b')](handleError(_0x22ca53,null));};exports['attachmentUpload']=function(_0x1aef55,_0x37b0c2){_0x1aef55[_0xecf0('0x4a')]['name']=_0x1aef55[_0xecf0('0x69')]['originalname'];_0x1aef55['body'][_0xecf0('0x6a')]=_0x1aef55[_0xecf0('0x69')][_0xecf0('0x6b')];_0x1aef55[_0xecf0('0x4a')]['type']=_0x1aef55[_0xecf0('0x69')][_0xecf0('0x6c')];return db[_0xecf0('0x6d')][_0xecf0('0x49')](_0x1aef55['body'])[_0xecf0('0x14')](respondWithResult(_0x37b0c2,0xc9))['catch'](handleError(_0x37b0c2,null));};exports[_0xecf0('0x6e')]=function(_0x280b11,_0x2f3f3f){return db[_0xecf0('0x3e')][_0xecf0('0x4c')]({'where':{'id':_0x280b11[_0xecf0('0x3d')]['id']},'raw':!![]})[_0xecf0('0x14')](handleEntityNotFound(_0x2f3f3f,null))[_0xecf0('0x14')](function(_0x30c3a0){if(_0x30c3a0){if(_0x30c3a0[_0xecf0('0x6f')]){return _0x2f3f3f[_0xecf0('0x1e')](0x193)[_0xecf0('0x20')]({'status':0x193,'message':_0xecf0('0x70')});}return db[_0xecf0('0x6d')][_0xecf0('0x4c')]({'where':{'id':_0x280b11[_0xecf0('0x39')][_0xecf0('0x71')]},'raw':!![]})[_0xecf0('0x14')](handleEntityNotFound(_0x2f3f3f,null));}})[_0xecf0('0x14')](function(_0x42aeb5){if(_0x42aeb5){var _0x44b854=_0x42aeb5['ChatOfflineMessageId']!==null;var _0x281fe3=path[_0xecf0('0x72')](config[_0xecf0('0x73')],_0xecf0('0x74'));if(_0x44b854){_0x281fe3=path['join'](_0x281fe3,_0xecf0('0x75'));}var _0x226254=path[_0xecf0('0x72')](_0x281fe3,_0x42aeb5[_0xecf0('0x6a')]);return _0x2f3f3f[_0xecf0('0x76')](_0x226254);}})['catch'](handleError(_0x2f3f3f,null));};exports[_0xecf0('0x77')]=function(_0x49ea93,_0x42d4db){var _0xbe9546=null;var _0x861c37=null;var _0x3163d8=null;if(_0x49ea93['body']['id']){delete _0x49ea93['body']['id'];}if(_0x49ea93['body'][_0xecf0('0x78')]){_0x3163d8=path[_0xecf0('0x72')](config[_0xecf0('0x73')],_0xecf0('0x79'),util[_0xecf0('0x7a')](_0xecf0('0x7b'),Date[_0xecf0('0x7c')]()));_0x49ea93[_0xecf0('0x4a')][_0xecf0('0x7d')]=_0x3163d8;}return db['ChatInteraction'][_0xecf0('0x48')]({'where':{'id':_0x49ea93['params']['id']},'include':[{'model':db[_0xecf0('0x5e')],'as':_0xecf0('0x7e'),'include':[{'model':db[_0xecf0('0x7f')],'as':_0xecf0('0x7f')}]}]})['then'](handleEntityNotFound(_0x42d4db,null))[_0xecf0('0x14')](saveUpdates(_0x49ea93[_0xecf0('0x4a')],null))['then'](function(_0x5357db){if(_0x5357db){_0xbe9546=_0x5357db;return db[_0xecf0('0x4d')][_0xecf0('0x48')]({'where':{'id':_0xbe9546[_0xecf0('0x4e')]}});}})['then'](function(_0x7220c9){if(_0x7220c9){_0x861c37=_0x7220c9;return db[_0xecf0('0x61')]['find']({'where':{'id':_0xbe9546[_0xecf0('0x80')]}});}})[_0xecf0('0x14')](function(_0x1ef488){if(_0x1ef488){if(_0x3163d8){var _0x4d377b=null;for(var _0xc92c99=0x1;_0xc92c99<_0xbe9546['Messages']['length'];++_0xc92c99){_0x4d377b=_0xbe9546[_0xecf0('0x7e')][_0xc92c99];var _0x23ab22=_0x4d377b[_0xecf0('0x81')]?util[_0xecf0('0x7a')](_0xecf0('0x82'),_0x861c37['agentAlias'],_0x4d377b[_0xecf0('0x81')]):_0xecf0('0x83');var _0x29d335=_0x49ea93[_0xecf0('0x4a')][_0xecf0('0x84')]||util[_0xecf0('0x7a')](_0xecf0('0x82'),_0xecf0('0x85'),_0x4d377b[_0xecf0('0x80')]);switch(_0x861c37[_0xecf0('0x86')]){case'website_alias':_0x23ab22=_0x4d377b[_0xecf0('0x81')]?util[_0xecf0('0x7a')](_0xecf0('0x82'),_0x861c37[_0xecf0('0x87')],_0x4d377b[_0xecf0('0x81')]):_0xecf0('0x83');break;case _0xecf0('0x88'):_0x23ab22=_0x4d377b[_0xecf0('0x81')]?_0x4d377b[_0xecf0('0x7f')]['alias']||_0x4d377b[_0xecf0('0x7f')][_0xecf0('0x54')]:_0xecf0('0x83');break;case _0xecf0('0x89'):_0x23ab22=_0x4d377b['UserId']?_0x4d377b[_0xecf0('0x7f')][_0xecf0('0x54')]:_0xecf0('0x83');break;default:_0x23ab22=_0x4d377b[_0xecf0('0x81')]?util[_0xecf0('0x7a')](_0xecf0('0x82'),_0x861c37[_0xecf0('0x87')],_0x4d377b['UserId']):_0xecf0('0x83');}var _0x7d6301=util['format'](_0xecf0('0x8a'),moment(_0x4d377b[_0xecf0('0x8b')])['format'](_0xecf0('0x8c')),_0x4d377b[_0xecf0('0x8d')]==='in'?_0x29d335:_0x23ab22,_0x4d377b[_0xecf0('0x4a')]);if(!_0x4d377b[_0xecf0('0x8e')]){fs[_0xecf0('0x8f')](_0x3163d8,_0x7d6301);}}return db[_0xecf0('0x90')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xecf0('0x91')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xecf0('0x92'),'raw':!![]}]}]});}}})[_0xecf0('0x14')](function(_0x150f9e){if(!_0x150f9e||!_0x150f9e['Smtp']||!_0x49ea93[_0xecf0('0x4a')])return _0xbe9546;var _0x21f900=_0x150f9e[_0xecf0('0x93')]();return respondWithRpcPromise(_0xecf0('0x94'),'sendMail',{'account':_0x21f900,'message':{'from':util[_0xecf0('0x7a')](_0xecf0('0x95'),_0x150f9e[_0xecf0('0x2a')],_0x150f9e[_0xecf0('0x55')]||_0x150f9e[_0xecf0('0x96')][_0xecf0('0x3a')]),'to':_0x49ea93[_0xecf0('0x4a')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xecf0('0x7a')](_0xecf0('0x97'),_0x49ea93[_0xecf0('0x4a')][_0xecf0('0x78')]),'attachments':[{'path':_0x3163d8}]}})['then'](function(){return _0xbe9546;})[_0xecf0('0x3b')](function(_0x260bb4){logger[_0xecf0('0x18')](_0x260bb4);});})[_0xecf0('0x14')](respondWithStatusCode(_0x42d4db,0xc8))['catch'](handleError(_0x42d4db,null));};exports['addMessage']=function(_0x4a5a1b,_0x37a361){return db[_0xecf0('0x5e')][_0xecf0('0x48')]({'where':{'id':_0x4a5a1b[_0xecf0('0x3d')]['id']}})[_0xecf0('0x14')](handleEntityNotFound(_0x37a361,null))[_0xecf0('0x14')](function(_0x4aa412){if(_0x4aa412){return _0x4aa412['addMessage'](_0x4a5a1b['body'][_0xecf0('0x98')],_[_0xecf0('0x99')](_0x4a5a1b[_0xecf0('0x4a')],[_0xecf0('0x98'),'id'])||{});}})[_0xecf0('0x14')](respondWithResult(_0x37a361,null))[_0xecf0('0x3b')](handleError(_0x37a361,null));};exports[_0xecf0('0x9a')]=function(_0x442f41,_0x4e3538){var _0x756e4e={'raw':![],'where':{}};var _0x55f842={};var _0x169a0b={'count':0x0,'rows':[]};return db[_0xecf0('0x3e')][_0xecf0('0x4c')]({'where':{'id':_0x442f41[_0xecf0('0x3d')]['id']}})[_0xecf0('0x14')](handleEntityNotFound(_0x4e3538,null))['then'](function(_0x44bd0d){if(_0x44bd0d){_0x55f842['model']=_[_0xecf0('0x3f')](db[_0xecf0('0x5e')][_0xecf0('0x33')]);_0x55f842[_0xecf0('0x39')]=_[_0xecf0('0x3f')](_0x442f41[_0xecf0('0x39')]);_0x55f842['filters']=_[_0xecf0('0x43')](_0x55f842[_0xecf0('0x41')],_0x55f842['query']);_0x756e4e[_0xecf0('0x42')]=_[_0xecf0('0x43')](_0x55f842[_0xecf0('0x41')],qs[_0xecf0('0x44')](_0x442f41[_0xecf0('0x39')][_0xecf0('0x44')]));_0x756e4e[_0xecf0('0x42')]=_0x756e4e[_0xecf0('0x42')][_0xecf0('0x45')]?_0x756e4e[_0xecf0('0x42')]:_0x55f842[_0xecf0('0x41')];if(!_0x442f41[_0xecf0('0x39')][_0xecf0('0x9b')](_0xecf0('0x9c'))){_0x756e4e[_0xecf0('0x23')]=qs[_0xecf0('0x23')](_0x442f41['query'][_0xecf0('0x23')]);_0x756e4e[_0xecf0('0x21')]=qs[_0xecf0('0x21')](_0x442f41[_0xecf0('0x39')][_0xecf0('0x21')]);}_0x756e4e[_0xecf0('0x9d')]=qs['sort'](_0x442f41[_0xecf0('0x39')][_0xecf0('0x9e')]);_0x756e4e[_0xecf0('0x9f')]=qs['filters'](_['pick'](_0x442f41[_0xecf0('0x39')],_0x55f842[_0xecf0('0x40')]));_0x756e4e[_0xecf0('0x9f')]['ChatInteractionId']=_0x44bd0d['id'];if(_0x442f41[_0xecf0('0x39')]['filter']){_0x756e4e[_0xecf0('0x9f')]=_[_0xecf0('0x2c')](_0x756e4e[_0xecf0('0x9f')],{'$or':_[_0xecf0('0x32')](_0x756e4e[_0xecf0('0x42')],function(_0x24b03a){var _0x3ecf64={};_0x3ecf64[_0x24b03a]={'$like':'%'+_0x442f41[_0xecf0('0x39')][_0xecf0('0xa0')]+'%'};return _0x3ecf64;})});}if(_0x442f41[_0xecf0('0x39')]['$gte']){var _0x519b53=_0x442f41[_0xecf0('0x39')][_0xecf0('0xa1')]['split'](',');var _0x2ff2da={};_0x2ff2da[_0x519b53[0x0]]={'$gte':moment(_0x519b53[0x1])[_0xecf0('0x7a')](_0xecf0('0xa2'))};_0x756e4e[_0xecf0('0x9f')]=_[_0xecf0('0x2c')](_0x756e4e[_0xecf0('0x9f')],_0x2ff2da);}_0x756e4e=_[_0xecf0('0x2c')]({},_0x756e4e,_0x442f41['options']);return db[_0xecf0('0x5e')][_0xecf0('0x24')]({'where':_0x756e4e[_0xecf0('0x9f')]})[_0xecf0('0x14')](function(_0x29c225){_0x169a0b[_0xecf0('0x24')]=_0x29c225;if(_0x442f41[_0xecf0('0x39')][_0xecf0('0x46')]){_0x756e4e['include']=[{'all':!![]}];}return db[_0xecf0('0x5e')]['findAll'](_0x756e4e);})['then'](function(_0x3d4802){_0x169a0b[_0xecf0('0xa3')]=_0x3d4802;return _0x169a0b;});}})['then'](respondWithFilteredResult(_0x4e3538,_0x756e4e))[_0xecf0('0x3b')](handleError(_0x4e3538,null));};exports['getMyMessages']=function(_0x1aa6d1,_0x49b767){var _0x5b9122={'where':{}},_0x3a4ffb={},_0x4acb4a={'count':0x0,'rows':[]};return db[_0xecf0('0x3e')][_0xecf0('0x4c')]({'where':{'id':_0x1aa6d1[_0xecf0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x49b767,null))[_0xecf0('0x14')](function(_0x26645){if(_0x26645){_0x3a4ffb['model']=_['keys'](db[_0xecf0('0x5e')][_0xecf0('0x33')]);_0x3a4ffb[_0xecf0('0x39')]=_[_0xecf0('0x3f')](_0x1aa6d1[_0xecf0('0x39')]);_0x3a4ffb['filters']=_['intersection'](_0x3a4ffb[_0xecf0('0x41')],_0x3a4ffb[_0xecf0('0x39')]);_0x5b9122[_0xecf0('0x42')]=_[_0xecf0('0x43')](_0x3a4ffb[_0xecf0('0x41')],qs[_0xecf0('0x44')](_0x1aa6d1[_0xecf0('0x39')]['fields']));_0x5b9122['attributes']=_0x5b9122[_0xecf0('0x42')][_0xecf0('0x45')]?_0x5b9122[_0xecf0('0x42')]:_0x3a4ffb[_0xecf0('0x41')];if(!_0x1aa6d1[_0xecf0('0x39')][_0xecf0('0x9b')]('nolimit')){_0x5b9122[_0xecf0('0x23')]=qs[_0xecf0('0x23')](_0x1aa6d1[_0xecf0('0x39')][_0xecf0('0x23')]);_0x5b9122['offset']=qs[_0xecf0('0x21')](_0x1aa6d1[_0xecf0('0x39')][_0xecf0('0x21')]);}_0x5b9122[_0xecf0('0x9d')]=qs[_0xecf0('0x9e')](_0x1aa6d1[_0xecf0('0x39')][_0xecf0('0x9e')]);_0x5b9122[_0xecf0('0x9f')]=qs[_0xecf0('0x40')](_[_0xecf0('0xa4')](_0x1aa6d1[_0xecf0('0x39')],_0x3a4ffb[_0xecf0('0x40')]));_0x5b9122[_0xecf0('0x9f')][_0xecf0('0xa5')]=_0x26645['id'];if(_0x1aa6d1['query'][_0xecf0('0xa0')]){_0x5b9122[_0xecf0('0x9f')]=_['merge'](_0x5b9122[_0xecf0('0x9f')],{'$or':_[_0xecf0('0x32')](_0x5b9122[_0xecf0('0x42')],function(_0x2ce08f){var _0x22ab73={};_0x22ab73[_0x2ce08f]={'$like':'%'+_0x1aa6d1[_0xecf0('0x39')][_0xecf0('0xa0')]+'%'};return _0x22ab73;})});}_0x5b9122[_0xecf0('0x9f')][_0xecf0('0x8e')]=![];if(_0x1aa6d1[_0xecf0('0x39')]['id']){_0x5b9122[_0xecf0('0x9f')]['id']={'$gt':_0x1aa6d1[_0xecf0('0x39')]['id']};}_0x5b9122=_[_0xecf0('0x2c')]({},_0x5b9122,_0x1aa6d1[_0xecf0('0xa6')]);return db[_0xecf0('0x5e')]['count']({'where':_0x5b9122[_0xecf0('0x9f')]})[_0xecf0('0x14')](function(_0x19f779){_0x4acb4a[_0xecf0('0x24')]=_0x19f779;_0x5b9122['include']=[];if(_0x1aa6d1['query'][_0xecf0('0xa7')]){_0x5b9122[_0xecf0('0x47')][_0xecf0('0xa8')]({'model':db[_0xecf0('0x7f')],'as':'User','attributes':['id',_0xecf0('0x54'),_0xecf0('0xa9')]});}if(_0x1aa6d1[_0xecf0('0x39')][_0xecf0('0x46')]){_0x5b9122[_0xecf0('0x47')]=[{'all':!![]}];}return db[_0xecf0('0x5e')][_0xecf0('0x37')](_0x5b9122);})[_0xecf0('0x14')](function(_0xd1ef98){_0x4acb4a[_0xecf0('0xa3')]=_0xd1ef98;return _0x4acb4a;});}})['then'](respondWithFilteredResult(_0x49b767,_0x5b9122))[_0xecf0('0x3b')](handleError(_0x49b767,null));};exports[_0xecf0('0xaa')]=function(_0x49530d,_0x3a7710){return db['ChatInteraction'][_0xecf0('0x48')]({'where':{'id':_0x49530d[_0xecf0('0x3d')]['id']}})[_0xecf0('0x14')](handleEntityNotFound(_0x3a7710,null))['then'](function(_0x408996){if(_0x408996){return _0x408996['setTags'](_0x49530d['body'][_0xecf0('0x98')],_['omit'](_0x49530d[_0xecf0('0x4a')],['ids','id'])||{})[_0xecf0('0xab')](function(){return db[_0xecf0('0xac')][_0xecf0('0x37')]({'attributes':['id',_0xecf0('0x2a'),_0xecf0('0xad')],'where':{'id':_0x49530d[_0xecf0('0x4a')][_0xecf0('0x98')]}});})[_0xecf0('0x14')](function(_0x556379){socket[_0xecf0('0xae')](_0xecf0('0xaf'),{'id':Number(_0x49530d[_0xecf0('0x3d')]['id']),'tags':_0x556379||[]});return{'id':Number(_0x49530d[_0xecf0('0x3d')]['id']),'tags':_0x556379||[]};});}})['then'](respondWithResult(_0x3a7710,null))[_0xecf0('0x3b')](handleError(_0x3a7710,null));};exports[_0xecf0('0xb0')]=function(_0x444574,_0x1775ad){return db[_0xecf0('0x3e')]['find']({'where':{'id':_0x444574[_0xecf0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1775ad,null))['then'](function(_0x2c90ef){if(_0x2c90ef){return _0x2c90ef[_0xecf0('0xb0')](_0x444574[_0xecf0('0x39')][_0xecf0('0x98')]);}})['then'](respondWithStatusCode(_0x1775ad,null))[_0xecf0('0x3b')](handleError(_0x1775ad,null));};exports[_0xecf0('0x76')]=function(_0x2e75a0,_0x39e8a4){var _0x4cb263=moment()['unix']()[_0xecf0('0xb1')]();var _0x39abc2=path[_0xecf0('0x72')](config[_0xecf0('0x73')],_0xecf0('0xb2'),_0xecf0('0xb3'),_0xecf0('0xb4'));var _0xca76a1=path[_0xecf0('0x72')](config['root'],'server',_0xecf0('0xb3'),'attachments');var _0x453f72=path[_0xecf0('0x72')](_0x39abc2,_0x4cb263);var _0x3a7f13=util['format']('transcript-%d-%s.zip',_0x2e75a0[_0xecf0('0x3d')]['id'],_0x4cb263);var _0x4fe85f=path['join'](_0x39abc2,_0x3a7f13);var _0x32db42=[];_0x32db42['push']({'model':db[_0xecf0('0x7f')],'as':_0xecf0('0x7f'),'attributes':['id',_0xecf0('0x54')],'raw':!![]});_0x32db42['push']({'model':db[_0xecf0('0x61')],'as':_0xecf0('0x62'),'attributes':['id','firstName',_0xecf0('0xb5')],'raw':!![]});if(_0x2e75a0[_0xecf0('0x39')]['attachments']){_0x32db42[_0xecf0('0xa8')]({'model':db[_0xecf0('0x6d')],'as':_0xecf0('0x6d'),'raw':!![]});}var _0x3d795c=[{'model':db['ChatMessage'],'as':_0xecf0('0x7e'),'attributes':['id',_0xecf0('0x4a'),_0xecf0('0x8b'),'direction',_0xecf0('0x8e'),_0xecf0('0xb6')],'include':_0x32db42}];_0x3d795c['push']({'model':db['ChatWebsite'],'as':_0xecf0('0xb7'),'attributes':['id',_0xecf0('0x2a')]});_0x3d795c[_0xecf0('0xa8')]({'model':db['User'],'as':_0xecf0('0xb8'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xecf0('0x48')]({'where':{'id':_0x2e75a0[_0xecf0('0x3d')]['id']},'include':_0x3d795c})['then'](handleEntityNotFound(_0x39e8a4,null))[_0xecf0('0x14')](function(_0x11e3b0){if(_0x11e3b0){var _0x24a61c=_0x11e3b0['get']({'plain':!![]});fs[_0xecf0('0xb9')](_0x453f72);var _0xfb34c8={'channel':_0xecf0('0xba'),'account':_0x24a61c[_0xecf0('0xb7')]['name'],'agent':_0x24a61c[_0xecf0('0xb8')]?_0x24a61c[_0xecf0('0xb8')][_0xecf0('0x54')]:_0xecf0('0xbb'),'createdAt':moment(_0x24a61c[_0xecf0('0x8b')])[_0xecf0('0x7a')](_0xecf0('0xa2'))[_0xecf0('0xb1')](),'closedAt':_0x24a61c['closed']?moment(_0x24a61c[_0xecf0('0xbc')])['format'](_0xecf0('0xa2'))[_0xecf0('0xb1')]():'','disposition':_0x24a61c[_0xecf0('0x67')],'chatInfo':{'browser':_0x24a61c[_0xecf0('0xbd')],'os':_0x24a61c[_0xecf0('0xbe')],'referer':_0x24a61c[_0xecf0('0xbf')],'customerIp':_0x24a61c['customerIp'],'customerPort':_0x24a61c[_0xecf0('0xc0')]?_0x24a61c['customerPort']:_0xecf0('0xbb')},'messages':_(_0x24a61c[_0xecf0('0x7e')])[_0xecf0('0xc1')]()[_0xecf0('0xa0')]({'secret':![]})[_0xecf0('0x32')](function(_0xb24602){if(_0xb24602['Attachment']){var _0x31f6fb=path[_0xecf0('0x72')](_0xca76a1,_0xb24602[_0xecf0('0x6d')]['basename']);if(fs['existsSync'](_0x31f6fb)){fs[_0xecf0('0xc2')](_0x31f6fb)[_0xecf0('0xc3')](fs[_0xecf0('0xc4')](path[_0xecf0('0x72')](_0x453f72,_0xb24602['Attachment'][_0xecf0('0x6a')])));}}return{'date':moment(_0xb24602[_0xecf0('0x8b')])[_0xecf0('0x7a')](_0xecf0('0xa2'))[_0xecf0('0xb1')](),'sender':_0xb24602[_0xecf0('0x8d')]===_0xecf0('0x5d')?_0xb24602[_0xecf0('0x7f')]?_0xb24602[_0xecf0('0x7f')][_0xecf0('0x54')]:_0xecf0('0x83'):_0xb24602['Contact'][_0xecf0('0xc5')]+(_0xb24602[_0xecf0('0x62')][_0xecf0('0xb5')]?'\x20'+_0xb24602['Contact']['lastName']:''),'body':_0xb24602[_0xecf0('0x6d')]?_0xb24602[_0xecf0('0x6d')][_0xecf0('0x6a')]:_0xb24602[_0xecf0('0x4a')],'direction':_0xb24602[_0xecf0('0x8d')]===_0xecf0('0x5d')?'A':'C','secret':_0xb24602[_0xecf0('0x8e')],'read':_0xb24602[_0xecf0('0xb6')],'attachment':_0xb24602[_0xecf0('0x6d')]};})[_0xecf0('0xc6')]()};return ejs[_0xecf0('0xc7')](path[_0xecf0('0x72')](config[_0xecf0('0x73')],_0xecf0('0xb2'),_0xecf0('0xc8'),_0xecf0('0xc9')),{'interaction':_0xfb34c8})[_0xecf0('0x14')](function(_0x5edffe){var _0x6d1a50=path[_0xecf0('0x72')](_0x453f72,_0xecf0('0xca')+_0x24a61c['id']+'-'+_0x4cb263+_0xecf0('0xcb'));var _0x3007f9={'path':_0x6d1a50,'channel':'Chat','interactionId':_0x24a61c['id']};return pdf[_0xecf0('0xcc')](_0x5edffe,_0x3007f9);})[_0xecf0('0x14')](function(){return new Promise(function(_0x1033ce,_0x43fda2){zipdir(_0x453f72,{'saveTo':_0x4fe85f},function(_0x4ab3d8,_0x49eb9c){if(_0x4ab3d8)return _0x43fda2(_0x4ab3d8);return _0x1033ce(_0x49eb9c);});})[_0xecf0('0x14')](function(){return new BPromise(function(_0x1484c4,_0x350581){rimraf(_0x453f72,function(_0x4707ad){if(_0x4707ad)_0x350581(_0x4707ad);return _0x1484c4();});});})[_0xecf0('0x14')](function(){return _0x39e8a4['download'](_0x4fe85f,_0x3a7f13,function(_0x14e6da){if(_0x14e6da){logger[_0xecf0('0x18')](_0xecf0('0xcd'),_0x14e6da);}else{fs[_0xecf0('0xce')](_0x4fe85f);}});});});}else{return _0x39e8a4[_0xecf0('0x1d')](0xc8);}})[_0xecf0('0x3b')](handleError(_0x39e8a4,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 83ed538..f37ba97 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 _0x14f8=['exports','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x296ee6,_0x2c9872){var _0x38d838=function(_0x2bbb79){while(--_0x2bbb79){_0x296ee6['push'](_0x296ee6['shift']());}};_0x38d838(++_0x2c9872);}(_0x14f8,0xe2));var _0x814f=function(_0x5683d4,_0x4abc6f){_0x5683d4=_0x5683d4-0x0;var _0x48a100=_0x14f8[_0x5683d4];return _0x48a100;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x814f('0x0')];var ChatMessage=require('../../mysqldb')['db'][_0x814f('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x814f('0x2')](0x0);var events={'afterCreate':_0x814f('0x3'),'afterUpdate':'update','afterDestroy':_0x814f('0x4')};function emitEvent(_0x547d1f){return function(_0x29a256,_0x26c3e1,_0x4b261c){_0x29a256[_0x814f('0x5')]({'attributes':['id'],'raw':!![]})[_0x814f('0x6')](function(_0x173158){_0x29a256['setDataValue'](_0x814f('0x7'),_0x173158['map'](function(_0x4f6a43){return{'id':_0x4f6a43['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x29a256['id'],'direction':'in','read':![]},'raw':!![]});})[_0x814f('0x6')](function(_0x7e20c8){_0x29a256['setDataValue'](_0x814f('0x8'),_0x7e20c8[_0x814f('0x9')]);ChatInteractionEvents[_0x814f('0xa')](_0x547d1f+':'+_0x29a256['id'],_0x29a256);ChatInteractionEvents['emit'](_0x547d1f,_0x29a256);_0x4b261c(null);})[_0x814f('0xb')](_0x4b261c(null));};}for(var e in events){if(events[_0x814f('0xc')](e)){var event=events[e];ChatInteraction[_0x814f('0xd')](e,emitEvent(event));}}module[_0x814f('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xea71=['events','../../mysqldb','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x2a8020,_0x30b23d){var _0x239636=function(_0x29aa39){while(--_0x29aa39){_0x2a8020['push'](_0x2a8020['shift']());}};_0x239636(++_0x30b23d);}(_0xea71,0x143));var _0x1ea7=function(_0x2d060e,_0xbfe514){_0x2d060e=_0x2d060e-0x0;var _0x36a103=_0xea71[_0x2d060e];return _0x36a103;};'use strict';var EventEmitter=require(_0x1ea7('0x0'));var ChatInteraction=require(_0x1ea7('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x1ea7('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1ea7('0x2')](0x0);var events={'afterCreate':_0x1ea7('0x3'),'afterUpdate':_0x1ea7('0x4'),'afterDestroy':_0x1ea7('0x5')};function emitEvent(_0x43ba7f){return function(_0xbcd225,_0x179c11,_0x1862ba){_0xbcd225['getUsers']({'attributes':['id'],'raw':!![]})[_0x1ea7('0x6')](function(_0x312a7b){_0xbcd225[_0x1ea7('0x7')]('Users',_0x312a7b[_0x1ea7('0x8')](function(_0x5a486e){return{'id':_0x5a486e['id']};}));return ChatMessage[_0x1ea7('0x9')]({'where':{'ChatInteractionId':_0xbcd225['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x521c38){_0xbcd225[_0x1ea7('0x7')](_0x1ea7('0xa'),_0x521c38[_0x1ea7('0xb')]);ChatInteractionEvents[_0x1ea7('0xc')](_0x43ba7f+':'+_0xbcd225['id'],_0xbcd225);ChatInteractionEvents['emit'](_0x43ba7f,_0xbcd225);_0x1862ba(null);})[_0x1ea7('0xd')](_0x1862ba(null));};}for(var e in events){if(events[_0x1ea7('0xe')](e)){var event=events[e];ChatInteraction[_0x1ea7('0xf')](e,emitEvent(event));}}module[_0x1ea7('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 19e832a..78f4185 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 _0xcd9e=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x1acf65,_0x597636){var _0xeb7dd7=function(_0x30261c){while(--_0x30261c){_0x1acf65['push'](_0x1acf65['shift']());}};_0xeb7dd7(++_0x597636);}(_0xcd9e,0x14b));var _0xecd9=function(_0x10eef6,_0x3601ff){_0x10eef6=_0x10eef6-0x0;var _0x3483dd=_0xcd9e[_0x10eef6];return _0x3483dd;};'use strict';var _=require(_0xecd9('0x0'));var util=require(_0xecd9('0x1'));var logger=require(_0xecd9('0x2'))(_0xecd9('0x3'));var moment=require('moment');var BPromise=require(_0xecd9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecd9('0x5'));var rimraf=require(_0xecd9('0x6'));var config=require(_0xecd9('0x7'));var attributes=require(_0xecd9('0x8'));module[_0xecd9('0x9')]=function(_0xa99aa8,_0x1088fa){return _0xa99aa8[_0xecd9('0xa')](_0xecd9('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48da20,_0x3db9a1,_0x3534bf){if(_0x48da20['changed']('closed')){_0x48da20['closedAt']=moment()[_0xecd9('0xc')](_0xecd9('0xd'));}_0x3534bf(null,_0x48da20);}},'charset':_0xecd9('0xe'),'collate':_0xecd9('0xf')});};
\ No newline at end of file
+var _0xcc49=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x2d9c11,_0x2a4c8a){var _0x3b3e89=function(_0x415955){while(--_0x415955){_0x2d9c11['push'](_0x2d9c11['shift']());}};_0x3b3e89(++_0x2a4c8a);}(_0xcc49,0x1c8));var _0x9cc4=function(_0x336c8b,_0x56b55b){_0x336c8b=_0x336c8b-0x0;var _0x4dd2f6=_0xcc49[_0x336c8b];return _0x4dd2f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9cc4('0x0'))(_0x9cc4('0x1'));var moment=require(_0x9cc4('0x2'));var BPromise=require('bluebird');var rp=require(_0x9cc4('0x3'));var fs=require('fs');var path=require(_0x9cc4('0x4'));var rimraf=require(_0x9cc4('0x5'));var config=require(_0x9cc4('0x6'));var attributes=require(_0x9cc4('0x7'));module[_0x9cc4('0x8')]=function(_0x54c3e8,_0x4e5446){return _0x54c3e8['define'](_0x9cc4('0x9'),attributes,{'tableName':_0x9cc4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4205c4,_0xe41488,_0x595ac1){if(_0x4205c4[_0x9cc4('0xb')](_0x9cc4('0xc'))){_0x4205c4[_0x9cc4('0xd')]=moment()[_0x9cc4('0xe')](_0x9cc4('0xf'));}_0x595ac1(null,_0x4205c4);}},'charset':'utf8mb4','collate':_0x9cc4('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 07a6edb..995aee8 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 _0xc184=['redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatInteraction','update','body','options','raw','where','limit','UpdateChatInteraction','stringify','then','ids','omit','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc184,0x18f));var _0x4c18=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xc184[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x4c18('0x0'));var util=require('util');var moment=require(_0x4c18('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c18('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c18('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c18('0x4'))('rpc');var config=require(_0x4c18('0x5'));var jayson=require(_0x4c18('0x6'));var client=jayson[_0x4c18('0x7')]['http']({'port':0x232a});config[_0x4c18('0x8')]=_['defaults'](config[_0x4c18('0x8')],{'host':_0x4c18('0x9'),'port':0x18eb});var socket=require(_0x4c18('0xa'))(new Redis(config['redis']));require(_0x4c18('0xb'))[_0x4c18('0xc')](socket);function respondWithRpcPromise(_0x9c3442,_0x11cf84,_0x26692f){return new BPromise(function(_0x3de4ad,_0x92e507){return client[_0x4c18('0xd')](_0x9c3442,_0x26692f)['then'](function(_0x50f1c8){logger[_0x4c18('0xe')](_0x4c18('0xf'),_0x11cf84,_0x4c18('0x10'));logger[_0x4c18('0x11')](_0x4c18('0x12'),_0x11cf84,_0x4c18('0x10'),JSON['stringify'](_0x50f1c8));if(_0x50f1c8[_0x4c18('0x13')]){if(_0x50f1c8['error'][_0x4c18('0x14')]===0x1f4){logger['error'](_0x4c18('0xf'),_0x11cf84,_0x50f1c8[_0x4c18('0x13')][_0x4c18('0x15')]);return _0x92e507(_0x50f1c8[_0x4c18('0x13')][_0x4c18('0x15')]);}logger[_0x4c18('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x11cf84,_0x50f1c8[_0x4c18('0x13')][_0x4c18('0x15')]);return _0x3de4ad(_0x50f1c8['error']['message']);}else{logger[_0x4c18('0xe')](_0x4c18('0xf'),_0x11cf84,_0x4c18('0x10'));_0x3de4ad(_0x50f1c8[_0x4c18('0x16')]['message']);}})[_0x4c18('0x17')](function(_0x2944b4){logger['error'](_0x4c18('0xf'),_0x11cf84,_0x2944b4);_0x92e507(_0x2944b4);});});}exports['UpdateChatInteraction']=function(_0x80172d){var _0x3cf66b=this;return new Promise(function(_0x139381,_0x26851b){return db[_0x4c18('0x18')][_0x4c18('0x19')](_0x80172d[_0x4c18('0x1a')],{'raw':_0x80172d[_0x4c18('0x1b')]?_0x80172d['options'][_0x4c18('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x80172d['options']?_0x80172d[_0x4c18('0x1b')][_0x4c18('0x1d')]||null:null,'attributes':_0x80172d[_0x4c18('0x1b')]?_0x80172d[_0x4c18('0x1b')]['attributes']||null:null,'limit':_0x80172d[_0x4c18('0x1b')]?_0x80172d[_0x4c18('0x1b')][_0x4c18('0x1e')]||null:null})['then'](function(_0x3512ef){logger['info']('UpdateChatInteraction',_0x80172d);logger[_0x4c18('0x11')](_0x4c18('0x1f'),_0x80172d,JSON[_0x4c18('0x20')](_0x3512ef));_0x139381(_0x3512ef);})[_0x4c18('0x17')](function(_0x21855e){logger[_0x4c18('0x13')]('UpdateChatInteraction',_0x21855e[_0x4c18('0x15')],_0x80172d);_0x26851b(_0x3cf66b[_0x4c18('0x13')](0x1f4,_0x21855e[_0x4c18('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x17f882){return new Promise(function(_0x135664,_0x2560fd){return db['ChatInteraction']['find']({'where':_0x17f882['options']?_0x17f882[_0x4c18('0x1b')][_0x4c18('0x1d')]||null:null})[_0x4c18('0x21')](function(_0x4c83b){if(_0x4c83b){return _0x4c83b['addTags'](_0x17f882[_0x4c18('0x1a')][_0x4c18('0x22')],_[_0x4c18('0x23')](_0x17f882[_0x4c18('0x1a')],[_0x4c18('0x22'),'id'])||{});}})['spread'](function(_0x255e8b){logger[_0x4c18('0xe')](_0x4c18('0x24'),_0x17f882);logger['debug']('AddTags',_0x17f882,JSON[_0x4c18('0x20')](_0x255e8b));_0x135664(_0x255e8b);})['catch'](function(_0x50a268){logger['error']('AddTags',_0x50a268[_0x4c18('0x15')],_0x17f882);_0x2560fd(_this[_0x4c18('0x13')](0x1f4,_0x50a268['message']));});});};
\ No newline at end of file
+var _0xd7f1=['message','result','UpdateChatInteraction','options','raw','where','attributes','limit','info','debug','catch','AddTagsToChatInteraction','addTags','body','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7f1,0xcf));var _0x1d7f=function(_0x1e1858,_0x2bc0ec){_0x1e1858=_0x1e1858-0x0;var _0x4d8d7a=_0xd7f1[_0x1e1858];return _0x4d8d7a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d7f('0x0'));var BPromise=require(_0x1d7f('0x1'));var rs=require(_0x1d7f('0x2'));var fs=require('fs');var Redis=require(_0x1d7f('0x3'));var db=require(_0x1d7f('0x4'))['db'];var utils=require(_0x1d7f('0x5'));var logger=require(_0x1d7f('0x6'))(_0x1d7f('0x7'));var config=require(_0x1d7f('0x8'));var jayson=require(_0x1d7f('0x9'));var client=jayson[_0x1d7f('0xa')]['http']({'port':0x232a});config[_0x1d7f('0xb')]=_['defaults'](config['redis'],{'host':_0x1d7f('0xc'),'port':0x18eb});var socket=require(_0x1d7f('0xd'))(new Redis(config[_0x1d7f('0xb')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x42167e,_0xae04ad,_0x30b968){return new BPromise(function(_0x16dcf0,_0x500446){return client[_0x1d7f('0xe')](_0x42167e,_0x30b968)[_0x1d7f('0xf')](function(_0x342dc2){logger['info'](_0x1d7f('0x10'),_0xae04ad,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xae04ad,_0x1d7f('0x11'),JSON[_0x1d7f('0x12')](_0x342dc2));if(_0x342dc2[_0x1d7f('0x13')]){if(_0x342dc2[_0x1d7f('0x13')][_0x1d7f('0x14')]===0x1f4){logger[_0x1d7f('0x13')](_0x1d7f('0x10'),_0xae04ad,_0x342dc2['error']['message']);return _0x500446(_0x342dc2[_0x1d7f('0x13')]['message']);}logger['error'](_0x1d7f('0x10'),_0xae04ad,_0x342dc2['error'][_0x1d7f('0x15')]);return _0x16dcf0(_0x342dc2[_0x1d7f('0x13')][_0x1d7f('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0xae04ad,_0x1d7f('0x11'));_0x16dcf0(_0x342dc2[_0x1d7f('0x16')]['message']);}})['catch'](function(_0x35f1de){logger[_0x1d7f('0x13')](_0x1d7f('0x10'),_0xae04ad,_0x35f1de);_0x500446(_0x35f1de);});});}exports[_0x1d7f('0x17')]=function(_0x3770d6){var _0x3bd63a=this;return new Promise(function(_0x37e65b,_0xf5e0d8){return db['ChatInteraction']['update'](_0x3770d6['body'],{'raw':_0x3770d6[_0x1d7f('0x18')]?_0x3770d6[_0x1d7f('0x18')][_0x1d7f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3770d6[_0x1d7f('0x18')]?_0x3770d6['options'][_0x1d7f('0x1a')]||null:null,'attributes':_0x3770d6['options']?_0x3770d6['options'][_0x1d7f('0x1b')]||null:null,'limit':_0x3770d6['options']?_0x3770d6[_0x1d7f('0x18')][_0x1d7f('0x1c')]||null:null})[_0x1d7f('0xf')](function(_0x54ea9e){logger[_0x1d7f('0x1d')](_0x1d7f('0x17'),_0x3770d6);logger[_0x1d7f('0x1e')](_0x1d7f('0x17'),_0x3770d6,JSON[_0x1d7f('0x12')](_0x54ea9e));_0x37e65b(_0x54ea9e);})[_0x1d7f('0x1f')](function(_0x3a0037){logger['error'](_0x1d7f('0x17'),_0x3a0037[_0x1d7f('0x15')],_0x3770d6);_0xf5e0d8(_0x3bd63a[_0x1d7f('0x13')](0x1f4,_0x3a0037[_0x1d7f('0x15')]));});});};exports[_0x1d7f('0x20')]=function(_0x242ef6){return new Promise(function(_0x43115b,_0x42f4ab){return db['ChatInteraction']['find']({'where':_0x242ef6[_0x1d7f('0x18')]?_0x242ef6[_0x1d7f('0x18')][_0x1d7f('0x1a')]||null:null})[_0x1d7f('0xf')](function(_0x3ddbc3){if(_0x3ddbc3){return _0x3ddbc3[_0x1d7f('0x21')](_0x242ef6[_0x1d7f('0x22')][_0x1d7f('0x23')],_[_0x1d7f('0x24')](_0x242ef6['body'],['ids','id'])||{});}})['spread'](function(_0x1f8628){logger['info'](_0x1d7f('0x25'),_0x242ef6);logger['debug'](_0x1d7f('0x25'),_0x242ef6,JSON[_0x1d7f('0x12')](_0x1f8628));_0x43115b(_0x1f8628);})[_0x1d7f('0x1f')](function(_0x247c46){logger[_0x1d7f('0x13')]('AddTags',_0x247c46['message'],_0x242ef6);_0x42f4ab(_this[_0x1d7f('0x13')](0x1f4,_0x247c46[_0x1d7f('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0c3ce97..4be9081 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 _0x5947=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0xbb79d2,_0x7df561){var _0x3a72eb=function(_0x2511b1){while(--_0x2511b1){_0xbb79d2['push'](_0xbb79d2['shift']());}};_0x3a72eb(++_0x7df561);}(_0x5947,0x16e));var _0x7594=function(_0x43cb67,_0x5aaaa9){_0x43cb67=_0x43cb67-0x0;var _0x2d35a4=_0x5947[_0x43cb67];return _0x2d35a4;};'use strict';var ChatInteractionEvents=require(_0x7594('0x0'));var events=[_0x7594('0x1'),_0x7594('0x2'),_0x7594('0x3')];function createListener(_0xd87c08,_0x22bf9b){return function(_0x2bed84){_0x22bf9b[_0x7594('0x4')](_0xd87c08,_0x2bed84);};}function removeListener(_0x3355ff,_0x1a0c75){return function(){ChatInteractionEvents[_0x7594('0x5')](_0x3355ff,_0x1a0c75);};}exports[_0x7594('0x6')]=function(_0x1fac2e){for(var _0x378695=0x0,_0x5c4b53=events[_0x7594('0x7')];_0x378695<_0x5c4b53;_0x378695++){var _0x58d17b=events[_0x378695];var _0x52b2a3=createListener(_0x7594('0x8')+_0x58d17b,_0x1fac2e);ChatInteractionEvents['on'](_0x58d17b,_0x52b2a3);}};
\ No newline at end of file
+var _0x0a7f=['chatInteraction:','remove','update','emit','removeListener','register'];(function(_0x5c1a4c,_0x3778b2){var _0x5c66b7=function(_0x9756e6){while(--_0x9756e6){_0x5c1a4c['push'](_0x5c1a4c['shift']());}};_0x5c66b7(++_0x3778b2);}(_0x0a7f,0xdf));var _0xf0a7=function(_0x2c63ac,_0x1df97a){_0x2c63ac=_0x2c63ac-0x0;var _0xdf3040=_0x0a7f[_0x2c63ac];return _0xdf3040;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xf0a7('0x0'),_0xf0a7('0x1')];function createListener(_0x4fffb2,_0x100fdd){return function(_0x4cda0c){_0x100fdd[_0xf0a7('0x2')](_0x4fffb2,_0x4cda0c);};}function removeListener(_0xf15212,_0xeaac94){return function(){ChatInteractionEvents[_0xf0a7('0x3')](_0xf15212,_0xeaac94);};}exports[_0xf0a7('0x4')]=function(_0x42e27a){for(var _0x305ea6=0x0,_0x19ffa7=events['length'];_0x305ea6<_0x19ffa7;_0x305ea6++){var _0x22dc7c=events[_0x305ea6];var _0x20e7fa=createListener(_0xf0a7('0x5')+_0x22dc7c,_0x42e27a);ChatInteractionEvents['on'](_0x22dc7c,_0x20e7fa);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3677c6e..160bc25 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 _0xf2a8=['addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x13cde0,_0xb9753e){var _0x514733=function(_0x348279){while(--_0x348279){_0x13cde0['push'](_0x13cde0['shift']());}};_0x514733(++_0xb9753e);}(_0xf2a8,0x79));var _0x8f2a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf2a8[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x8f2a('0x0'));var util=require(_0x8f2a('0x1'));var path=require(_0x8f2a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8f2a('0x3')]();var fs_extra=require(_0x8f2a('0x4'));var auth=require(_0x8f2a('0x5'));var interaction=require(_0x8f2a('0x6'));var config=require(_0x8f2a('0x7'));var controller=require(_0x8f2a('0x8'));router[_0x8f2a('0x9')]('/',auth[_0x8f2a('0xa')](),controller[_0x8f2a('0xb')]);router['get'](_0x8f2a('0xc'),auth[_0x8f2a('0xa')](),controller[_0x8f2a('0xd')]);router[_0x8f2a('0x9')](_0x8f2a('0xe'),auth[_0x8f2a('0xf')](),controller[_0x8f2a('0x10')]);router[_0x8f2a('0x9')](_0x8f2a('0x11'),auth[_0x8f2a('0xf')](),controller[_0x8f2a('0x12')]);router[_0x8f2a('0x9')](_0x8f2a('0x13'),auth[_0x8f2a('0xa')](),controller[_0x8f2a('0x14')]);router[_0x8f2a('0x9')](_0x8f2a('0x15'),auth[_0x8f2a('0xf')](),controller[_0x8f2a('0x16')]);router['get']('/:id/download',auth[_0x8f2a('0xa')](),controller[_0x8f2a('0x17')]);router[_0x8f2a('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8f2a('0x18')](_0x8f2a('0x19'),auth[_0x8f2a('0xa')](),controller[_0x8f2a('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x197f9b,_0x21277c,_0x4aabff){_0x4aabff(null,path[_0x8f2a('0x1b')](config[_0x8f2a('0x1c')],_0x8f2a('0x1d')));},'filename':function(_0x3558f8,_0x19180d,_0x26b829){_0x26b829(null,util[_0x8f2a('0x1e')](_0x8f2a('0x1f'),Date[_0x8f2a('0x20')](),_0x19180d[_0x8f2a('0x21')][_0x8f2a('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8f2a('0x18')](_0x8f2a('0x23'),upload[_0x8f2a('0x24')]('file'),controller['attachmentUpload']);router[_0x8f2a('0x18')](_0x8f2a('0x13'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x8f2a('0x18')](_0x8f2a('0x25'),auth[_0x8f2a('0xa')](),interaction[_0x8f2a('0x26')](_0x8f2a('0x27'),_0x8f2a('0x28')),controller[_0x8f2a('0x29')]);router[_0x8f2a('0x2a')](_0x8f2a('0xe'),auth[_0x8f2a('0xa')](),interaction[_0x8f2a('0x26')](_0x8f2a('0x27'),_0x8f2a('0x2b')),controller[_0x8f2a('0x2c')]);router[_0x8f2a('0x2a')](_0x8f2a('0x2d'),controller[_0x8f2a('0x2e')]);router[_0x8f2a('0x2a')]('/:id/abandon',auth[_0x8f2a('0xf')](),controller['abandon']);router[_0x8f2a('0x2a')](_0x8f2a('0x2f'),controller[_0x8f2a('0x30')]);router['delete'](_0x8f2a('0xe'),auth[_0x8f2a('0xa')](),interaction[_0x8f2a('0x26')]('chat',_0x8f2a('0x31')),controller[_0x8f2a('0x32')]);router[_0x8f2a('0x33')](_0x8f2a('0x25'),auth[_0x8f2a('0xa')](),controller[_0x8f2a('0x34')]);module[_0x8f2a('0x35')]=router;
\ No newline at end of file
+var _0x998f=['../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','attachmentUpload','/:id/tags','tracked','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chat','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x998f,0x136));var _0xf998=function(_0x45de99,_0x2b5ffd){_0x45de99=_0x45de99-0x0;var _0x2c846d=_0x998f[_0x45de99];return _0x2c846d;};'use strict';var multer=require(_0xf998('0x0'));var util=require(_0xf998('0x1'));var path=require(_0xf998('0x2'));var timeout=require(_0xf998('0x3'));var express=require(_0xf998('0x4'));var router=express[_0xf998('0x5')]();var fs_extra=require(_0xf998('0x6'));var auth=require(_0xf998('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf998('0x8'));var controller=require(_0xf998('0x9'));router['get']('/',auth[_0xf998('0xa')](),controller[_0xf998('0xb')]);router[_0xf998('0xc')](_0xf998('0xd'),auth['isAuthenticated'](),controller[_0xf998('0xe')]);router[_0xf998('0xc')](_0xf998('0xf'),auth[_0xf998('0x10')](),controller[_0xf998('0x11')]);router[_0xf998('0xc')]('/:id/attachment_download',auth[_0xf998('0x10')](),controller[_0xf998('0x12')]);router[_0xf998('0xc')](_0xf998('0x13'),auth[_0xf998('0xa')](),controller[_0xf998('0x14')]);router['get'](_0xf998('0x15'),auth[_0xf998('0x10')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0xf998('0xa')](),controller[_0xf998('0x16')]);router['post']('/',auth[_0xf998('0xa')](),controller[_0xf998('0x17')]);router[_0xf998('0x18')](_0xf998('0x19'),auth[_0xf998('0xa')](),controller[_0xf998('0x1a')]);var upload=multer({'storage':multer[_0xf998('0x1b')]({'destination':function(_0x34d18a,_0x3f2bc2,_0x1e7343){_0x1e7343(null,path[_0xf998('0x1c')](config[_0xf998('0x1d')],_0xf998('0x1e')));},'filename':function(_0x42733f,_0x177e25,_0xad57ac){_0xad57ac(null,util['format'](_0xf998('0x1f'),Date[_0xf998('0x20')](),_0x177e25[_0xf998('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf998('0x18')](_0xf998('0x22'),upload[_0xf998('0x23')]('file'),controller[_0xf998('0x24')]);router[_0xf998('0x18')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0xf998('0x25'),auth[_0xf998('0xa')](),interaction[_0xf998('0x26')]('chat',_0xf998('0x27')),controller[_0xf998('0x28')]);router[_0xf998('0x29')](_0xf998('0xf'),auth[_0xf998('0xa')](),interaction[_0xf998('0x26')]('chat','chatinteraction:update'),controller['update']);router['put'](_0xf998('0x2a'),controller[_0xf998('0x2b')]);router[_0xf998('0x29')](_0xf998('0x2c'),auth[_0xf998('0x10')](),controller[_0xf998('0x2d')]);router['put'](_0xf998('0x2e'),controller[_0xf998('0x2f')]);router[_0xf998('0x30')]('/:id',auth[_0xf998('0xa')](),interaction[_0xf998('0x26')](_0xf998('0x31'),_0xf998('0x32')),controller[_0xf998('0x33')]);router[_0xf998('0x30')](_0xf998('0x25'),auth[_0xf998('0xa')](),controller[_0xf998('0x34')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index c058dc7..0f3a2fc 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 _0x810a=['medium','BOOLEAN','sequelize'];(function(_0x83531b,_0x5daca6){var _0x3696f2=function(_0x368b38){while(--_0x368b38){_0x83531b['push'](_0x83531b['shift']());}};_0x3696f2(++_0x5daca6);}(_0x810a,0x134));var _0xa810=function(_0x25b954,_0x523fe5){_0x25b954=_0x25b954-0x0;var _0x85f71d=_0x810a[_0x25b954];return _0x85f71d;};'use strict';var Sequelize=require(_0xa810('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa810('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa810('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xdd7f=['sequelize','medium','BOOLEAN'];(function(_0x1ef0dd,_0x4435ea){var _0x18710c=function(_0x419133){while(--_0x419133){_0x1ef0dd['push'](_0x1ef0dd['shift']());}};_0x18710c(++_0x4435ea);}(_0xdd7f,0x1d7));var _0xfdd7=function(_0x3d125d,_0xc2ce6a){_0x3d125d=_0x3d125d-0x0;var _0x3c7a20=_0xdd7f[_0x3d125d];return _0x3c7a20;};'use strict';var Sequelize=require(_0xfdd7('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xfdd7('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xfdd7('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 73ff6a2..7afde40 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 _0xf2c4=['util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','sort','where','filters','pick','filter','merge','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x4794b7,_0x4207b2){var _0x4552a9=function(_0x1e8123){while(--_0x1e8123){_0x4794b7['push'](_0x4794b7['shift']());}};_0x4552a9(++_0x4207b2);}(_0xf2c4,0x141));var _0x4f2c=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf2c4[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x4f2c('0x0'));var rimraf=require(_0x4f2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f2c('0x2'));var rp=require(_0x4f2c('0x3'));var moment=require('moment');var BPromise=require(_0x4f2c('0x4'));var Mustache=require(_0x4f2c('0x5'));var util=require(_0x4f2c('0x6'));var path=require('path');var sox=require(_0x4f2c('0x7'));var csv=require(_0x4f2c('0x8'));var ejs=require(_0x4f2c('0x9'));var fs=require('fs');var fs_extra=require(_0x4f2c('0xa'));var _=require('lodash');var squel=require(_0x4f2c('0xb'));var crypto=require(_0x4f2c('0xc'));var jsforce=require(_0x4f2c('0xd'));var deskjs=require(_0x4f2c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4f2c('0xf'));var Papa=require(_0x4f2c('0x10'));var Redis=require(_0x4f2c('0x11'));var authService=require(_0x4f2c('0x12'));var qs=require(_0x4f2c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f2c('0x14'))(_0x4f2c('0x15'));var utils=require(_0x4f2c('0x16'));var config=require(_0x4f2c('0x17'));var licenseUtil=require(_0x4f2c('0x18'));var db=require(_0x4f2c('0x19'))['db'];config[_0x4f2c('0x1a')]=_[_0x4f2c('0x1b')](config[_0x4f2c('0x1a')],{'host':_0x4f2c('0x1c'),'port':0x18eb});var socket=require(_0x4f2c('0x1d'))(new Redis(config[_0x4f2c('0x1a')]));require(_0x4f2c('0x1e'))['register'](socket);function respondWithStatusCode(_0x381474,_0x131ac7){_0x131ac7=_0x131ac7||0xcc;return function(_0x1c8f5a){if(_0x1c8f5a){return _0x381474['sendStatus'](_0x131ac7);}return _0x381474[_0x4f2c('0x1f')](_0x131ac7)[_0x4f2c('0x20')]();};}function respondWithResult(_0x23be75,_0xe3856c){_0xe3856c=_0xe3856c||0xc8;return function(_0x1d2b05){if(_0x1d2b05){return _0x23be75[_0x4f2c('0x1f')](_0xe3856c)[_0x4f2c('0x21')](_0x1d2b05);}};}function respondWithFilteredResult(_0x362c82,_0x426dd2){return function(_0x5e2aa8){if(_0x5e2aa8){var _0x1b07d9=typeof _0x426dd2[_0x4f2c('0x22')]===_0x4f2c('0x23')&&typeof _0x426dd2[_0x4f2c('0x24')]===_0x4f2c('0x23');var _0x2eb9ae=_0x5e2aa8['count'];var _0x3fe378=_0x1b07d9?0x0:_0x426dd2[_0x4f2c('0x22')];var _0xb85d05=_0x1b07d9?_0x5e2aa8[_0x4f2c('0x25')]:_0x426dd2['offset']+_0x426dd2[_0x4f2c('0x24')];var _0x2803f8;if(_0xb85d05>=_0x2eb9ae){_0xb85d05=_0x2eb9ae;_0x2803f8=0xc8;}else{_0x2803f8=0xce;}_0x362c82[_0x4f2c('0x1f')](_0x2803f8);return _0x362c82[_0x4f2c('0x26')](_0x4f2c('0x27'),_0x3fe378+'-'+_0xb85d05+'/'+_0x2eb9ae)[_0x4f2c('0x21')](_0x5e2aa8);}return null;};}function patchUpdates(_0x545369){return function(_0x448656){try{jsonpatch[_0x4f2c('0x28')](_0x448656,_0x545369,!![]);}catch(_0x44cfab){return BPromise[_0x4f2c('0x29')](_0x44cfab);}return _0x448656['save']();};}function saveUpdates(_0x4f2584,_0x50c04b){return function(_0x5e79ad){if(_0x5e79ad){return _0x5e79ad[_0x4f2c('0x2a')](_0x4f2584)[_0x4f2c('0x2b')](function(_0xb9fc0f){return _0xb9fc0f;});}return null;};}function removeEntity(_0x3e9133,_0x50b495){return function(_0x19c45e){if(_0x19c45e){return _0x19c45e[_0x4f2c('0x2c')]()['then'](function(){_0x3e9133[_0x4f2c('0x1f')](0xcc)[_0x4f2c('0x20')]();});}};}function handleEntityNotFound(_0x4b52a3,_0x47f28a){return function(_0xb1e52d){if(!_0xb1e52d){_0x4b52a3[_0x4f2c('0x2d')](0x194);}return _0xb1e52d;};}function handleError(_0x262e59,_0x373c9d){_0x373c9d=_0x373c9d||0x1f4;return function(_0x14f4b9){logger[_0x4f2c('0x2e')](_0x14f4b9['stack']);if(_0x14f4b9[_0x4f2c('0x2f')]){delete _0x14f4b9['name'];}_0x262e59[_0x4f2c('0x1f')](_0x373c9d)[_0x4f2c('0x30')](_0x14f4b9);};}exports[_0x4f2c('0x31')]=function(_0x55e575,_0x214af8){var _0x3ad857={},_0x2e8b13={},_0x4c80e7={'count':0x0,'rows':[]};var _0xab25b0=_[_0x4f2c('0x32')](db[_0x4f2c('0x33')][_0x4f2c('0x34')],function(_0x16bec9){return{'name':_0x16bec9[_0x4f2c('0x35')],'type':_0x16bec9[_0x4f2c('0x36')][_0x4f2c('0x37')]};});_0x2e8b13[_0x4f2c('0x38')]=_[_0x4f2c('0x32')](_0xab25b0,_0x4f2c('0x2f'));_0x2e8b13[_0x4f2c('0x39')]=_[_0x4f2c('0x3a')](_0x55e575[_0x4f2c('0x39')]);_0x2e8b13['filters']=_[_0x4f2c('0x3b')](_0x2e8b13[_0x4f2c('0x38')],_0x2e8b13[_0x4f2c('0x39')]);_0x3ad857[_0x4f2c('0x3c')]=_[_0x4f2c('0x3b')](_0x2e8b13[_0x4f2c('0x38')],qs[_0x4f2c('0x3d')](_0x55e575[_0x4f2c('0x39')][_0x4f2c('0x3d')]));_0x3ad857[_0x4f2c('0x3c')]=_0x3ad857[_0x4f2c('0x3c')]['length']?_0x3ad857[_0x4f2c('0x3c')]:_0x2e8b13[_0x4f2c('0x38')];if(!_0x55e575[_0x4f2c('0x39')]['hasOwnProperty']('nolimit')){_0x3ad857[_0x4f2c('0x24')]=qs[_0x4f2c('0x24')](_0x55e575[_0x4f2c('0x39')][_0x4f2c('0x24')]);_0x3ad857[_0x4f2c('0x22')]=qs[_0x4f2c('0x22')](_0x55e575[_0x4f2c('0x39')][_0x4f2c('0x22')]);}_0x3ad857['order']=qs[_0x4f2c('0x3e')](_0x55e575[_0x4f2c('0x39')][_0x4f2c('0x3e')]);_0x3ad857[_0x4f2c('0x3f')]=qs[_0x4f2c('0x40')](_[_0x4f2c('0x41')](_0x55e575[_0x4f2c('0x39')],_0x2e8b13[_0x4f2c('0x40')]),_0xab25b0);if(_0x55e575[_0x4f2c('0x39')][_0x4f2c('0x42')]){_0x3ad857[_0x4f2c('0x3f')]=_[_0x4f2c('0x43')](_0x3ad857[_0x4f2c('0x3f')],{'$or':_[_0x4f2c('0x32')](_0xab25b0,function(_0x5801a8){if(_0x5801a8['type']!=='VIRTUAL'){var _0x314cf7={};_0x314cf7[_0x5801a8[_0x4f2c('0x2f')]]={'$like':'%'+_0x55e575[_0x4f2c('0x39')][_0x4f2c('0x42')]+'%'};return _0x314cf7;}})});}_0x3ad857=_[_0x4f2c('0x43')]({},_0x3ad857,_0x55e575['options']);var _0x151ebc={'where':_0x3ad857[_0x4f2c('0x3f')]};return db['ChatInternalMessage']['count'](_0x151ebc)[_0x4f2c('0x2b')](function(_0x2a1c76){_0x4c80e7[_0x4f2c('0x25')]=_0x2a1c76;if(_0x55e575[_0x4f2c('0x39')][_0x4f2c('0x44')]){_0x3ad857[_0x4f2c('0x45')]=[{'all':!![]}];}return db[_0x4f2c('0x33')][_0x4f2c('0x46')](_0x3ad857);})['then'](function(_0x50d883){_0x4c80e7['rows']=_0x50d883;return _0x4c80e7;})[_0x4f2c('0x2b')](respondWithFilteredResult(_0x214af8,_0x3ad857))[_0x4f2c('0x47')](handleError(_0x214af8,null));};exports[_0x4f2c('0x48')]=function(_0x5252b5,_0x2c8dd2){var _0x2b5948={'raw':!![],'where':{'id':_0x5252b5[_0x4f2c('0x49')]['id']}},_0x1aa53c={};_0x1aa53c[_0x4f2c('0x38')]=_[_0x4f2c('0x3a')](db[_0x4f2c('0x33')]['rawAttributes']);_0x1aa53c[_0x4f2c('0x39')]=_[_0x4f2c('0x3a')](_0x5252b5['query']);_0x1aa53c[_0x4f2c('0x40')]=_[_0x4f2c('0x3b')](_0x1aa53c[_0x4f2c('0x38')],_0x1aa53c[_0x4f2c('0x39')]);_0x2b5948[_0x4f2c('0x3c')]=_['intersection'](_0x1aa53c[_0x4f2c('0x38')],qs[_0x4f2c('0x3d')](_0x5252b5[_0x4f2c('0x39')][_0x4f2c('0x3d')]));_0x2b5948['attributes']=_0x2b5948[_0x4f2c('0x3c')][_0x4f2c('0x4a')]?_0x2b5948['attributes']:_0x1aa53c['model'];if(_0x5252b5[_0x4f2c('0x39')][_0x4f2c('0x44')]){_0x2b5948[_0x4f2c('0x45')]=[{'all':!![]}];}_0x2b5948=_[_0x4f2c('0x43')]({},_0x2b5948,_0x5252b5['options']);return db[_0x4f2c('0x33')][_0x4f2c('0x4b')](_0x2b5948)[_0x4f2c('0x2b')](handleEntityNotFound(_0x2c8dd2,null))[_0x4f2c('0x2b')](respondWithResult(_0x2c8dd2,null))['catch'](handleError(_0x2c8dd2,null));};exports[_0x4f2c('0x4c')]=function(_0x488367,_0x3ce5a1){return db['ChatInternalMessage'][_0x4f2c('0x4c')](_0x488367['body'],{})['then'](respondWithResult(_0x3ce5a1,0xc9))[_0x4f2c('0x47')](handleError(_0x3ce5a1,null));};exports[_0x4f2c('0x2a')]=function(_0x5e6ebf,_0x54c049){if(_0x5e6ebf[_0x4f2c('0x4d')]['id']){delete _0x5e6ebf['body']['id'];}return db[_0x4f2c('0x33')][_0x4f2c('0x4b')]({'where':{'id':_0x5e6ebf[_0x4f2c('0x49')]['id']}})['then'](handleEntityNotFound(_0x54c049,null))[_0x4f2c('0x2b')](saveUpdates(_0x5e6ebf[_0x4f2c('0x4d')],null))['then'](respondWithResult(_0x54c049,null))[_0x4f2c('0x47')](handleError(_0x54c049,null));};exports['destroy']=function(_0x1aa3bb,_0x51fcd4){return db[_0x4f2c('0x33')][_0x4f2c('0x4b')]({'where':{'id':_0x1aa3bb['params']['id']}})['then'](handleEntityNotFound(_0x51fcd4,null))[_0x4f2c('0x2b')](removeEntity(_0x51fcd4,null))['catch'](handleError(_0x51fcd4,null));};exports[_0x4f2c('0x4e')]=function(_0x210c44,_0x31c69d){return db['ChatInternalMessage'][_0x4f2c('0x4e')]()[_0x4f2c('0x2b')](respondWithResult(_0x31c69d,null))['catch'](handleError(_0x31c69d,null));};function wrapUser(_0x15d3e6){return function(_0x3c7724){var _0x166a24=_0x15d3e6[_0x4f2c('0x4f')]({'plain':!![]});_0x166a24['messages']=[];if(_0x3c7724){_0x166a24[_0x4f2c('0x50')]=_0x3c7724[_0x4f2c('0x51')];_0x166a24['lastMessage']=_0x3c7724;}else{_0x166a24[_0x4f2c('0x50')]=moment(0x0)[_0x4f2c('0x52')](_0x4f2c('0x53'));_0x166a24['lastMessage']={};}return _0x166a24;};}exports[_0x4f2c('0x54')]=function(_0x20eb1a,_0x181a05,_0x4cac25){var _0x510fcd=[];return db[_0x4f2c('0x55')][_0x4f2c('0x46')]({'where':{'role':[_0x4f2c('0x56'),_0x4f2c('0x57'),_0x4f2c('0x58')]},'attributes':['id',_0x4f2c('0x59'),_0x4f2c('0x2f'),_0x4f2c('0x5a'),_0x4f2c('0x5b'),_0x4f2c('0x5c'),'online',_0x4f2c('0x5d'),_0x4f2c('0x5e'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x4f2c('0x5f'),'attributes':['id',_0x4f2c('0x2f'),_0x4f2c('0x36')],'through':{'attributes':[]}}]})['then'](function(_0x29e849){if(_0x29e849){var _0x1193ac=_0x20eb1a[_0x4f2c('0x58')][_0x4f2c('0x4f')]({'plain':!![]});if(!_0x1193ac)throw new Error(_0x4f2c('0x60'));if(_0x1193ac[_0x4f2c('0x5a')]===_0x4f2c('0x58')){return db[_0x4f2c('0x61')][_0x4f2c('0x4b')]({'where':{'name':_0x4f2c('0x62'),'userProfileId':_0x1193ac['userProfileId']},'raw':!![]})[_0x4f2c('0x2b')](function(_0x13507f){if(_0x13507f){if(_0x13507f[_0x4f2c('0x63')]===0x0){return db[_0x4f2c('0x64')][_0x4f2c('0x46')]({'where':{'sectionId':_0x13507f['id']},'raw':!![]})[_0x4f2c('0x2b')](function(_0x1a0d3d){var _0x24fe2d=[];if(_[_0x4f2c('0x65')](_0x1a0d3d)){_0x24fe2d=_[_0x4f2c('0x42')](_0x29e849,function(_0x39229b){if(_0x39229b[_0x4f2c('0x5a')]!==_0x4f2c('0x56')){return _0x39229b;}});return _0x24fe2d;}else{for(var _0x165963=0x0;_0x165963<_0x29e849[_0x4f2c('0x4a')];_0x165963++){var _0x4d2037=_0x29e849[_0x165963];if(_0x4d2037[_0x4f2c('0x5a')]==='agent'){var _0x22a579=_[_0x4f2c('0x4b')](_0x1a0d3d,function(_0x30f6bb){return _0x30f6bb[_0x4f2c('0x66')]===_0x4d2037['id'];});if(_0x22a579)_0x24fe2d['push'](_0x4d2037);}else{_0x24fe2d[_0x4f2c('0x67')](_0x4d2037);}}return _0x24fe2d;}});}else{return _0x29e849;}}else{var _0x326691=_[_0x4f2c('0x42')](_0x29e849,function(_0x568ced){if(_0x568ced[_0x4f2c('0x5a')]!==_0x4f2c('0x56')){return _0x568ced;}});return _0x326691;}});}else{return _0x29e849;}}})[_0x4f2c('0x2b')](function(_0x5ee3f7){var _0x40d65d=[];if(_0x5ee3f7){_0x510fcd=_0x5ee3f7;for(var _0xb7c815=0x0;_0xb7c815<_0x5ee3f7['length'];_0xb7c815+=0x1){_0x510fcd[_0xb7c815][_0x4f2c('0x68')]=[];_0x40d65d[_0x4f2c('0x67')](db[_0x4f2c('0x33')][_0x4f2c('0x4b')]({'where':{'FromId':[_0x20eb1a[_0x4f2c('0x58')]['id'],_0x5ee3f7[_0xb7c815]['id']],'ToId':[_0x20eb1a[_0x4f2c('0x58')]['id'],_0x5ee3f7[_0xb7c815]['id']],'ChatGroupId':null},'attributes':['id',_0x4f2c('0x51'),_0x4f2c('0x69'),_0x4f2c('0x6a'),_0x4f2c('0x6b'),_0x4f2c('0x4d')],'order':qs[_0x4f2c('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5ee3f7[_0xb7c815])));}return BPromise[_0x4f2c('0x6c')](_0x40d65d);}return[];})['then'](function(_0x4e2b16){return{'rows':_0x4e2b16,'count':_0x4e2b16[_0x4f2c('0x4a')]};})[_0x4f2c('0x2b')](respondWithResult(_0x181a05,null))['catch'](handleError(_0x181a05,null));};
\ No newline at end of file
+var _0x4daa=['showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','send','map','ChatInternalMessage','key','model','query','filters','intersection','attributes','length','nolimit','sort','where','filter','merge','type','includeAll','include','findAll','catch','show','params','keys','fields','find','create','body','update','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','userpic','internal','online'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x4daa,0x1b6));var _0xa4da=function(_0x295e7f,_0x1a4d59){_0x295e7f=_0x295e7f-0x0;var _0xdb8b56=_0x4daa[_0x295e7f];return _0xdb8b56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4da('0x0'));var zipdir=require(_0xa4da('0x1'));var jsonpatch=require(_0xa4da('0x2'));var rp=require(_0xa4da('0x3'));var moment=require(_0xa4da('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa4da('0x5'));var path=require(_0xa4da('0x6'));var sox=require(_0xa4da('0x7'));var csv=require(_0xa4da('0x8'));var ejs=require(_0xa4da('0x9'));var fs=require('fs');var fs_extra=require(_0xa4da('0xa'));var _=require(_0xa4da('0xb'));var squel=require(_0xa4da('0xc'));var crypto=require('crypto');var jsforce=require(_0xa4da('0xd'));var deskjs=require(_0xa4da('0xe'));var toCsv=require(_0xa4da('0x8'));var querystring=require(_0xa4da('0xf'));var Papa=require(_0xa4da('0x10'));var Redis=require(_0xa4da('0x11'));var authService=require(_0xa4da('0x12'));var qs=require(_0xa4da('0x13'));var as=require(_0xa4da('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4da('0x15'))(_0xa4da('0x16'));var utils=require(_0xa4da('0x17'));var config=require(_0xa4da('0x18'));var licenseUtil=require(_0xa4da('0x19'));var db=require(_0xa4da('0x1a'))['db'];config['redis']=_[_0xa4da('0x1b')](config[_0xa4da('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xa4da('0x1d'))(new Redis(config[_0xa4da('0x1c')]));require(_0xa4da('0x1e'))[_0xa4da('0x1f')](socket);function respondWithStatusCode(_0x21ccd1,_0x3929dd){_0x3929dd=_0x3929dd||0xcc;return function(_0x4094a0){if(_0x4094a0){return _0x21ccd1['sendStatus'](_0x3929dd);}return _0x21ccd1[_0xa4da('0x20')](_0x3929dd)['end']();};}function respondWithResult(_0x212c6c,_0x14c8b9){_0x14c8b9=_0x14c8b9||0xc8;return function(_0x44ffeb){if(_0x44ffeb){return _0x212c6c[_0xa4da('0x20')](_0x14c8b9)[_0xa4da('0x21')](_0x44ffeb);}};}function respondWithFilteredResult(_0x4541d8,_0x24f322){return function(_0x5c9d8f){if(_0x5c9d8f){var _0x19ef99=typeof _0x24f322['offset']===_0xa4da('0x22')&&typeof _0x24f322['limit']===_0xa4da('0x22');var _0x230543=_0x5c9d8f[_0xa4da('0x23')];var _0x5f3e5b=_0x19ef99?0x0:_0x24f322[_0xa4da('0x24')];var _0x5be1f5=_0x19ef99?_0x5c9d8f[_0xa4da('0x23')]:_0x24f322[_0xa4da('0x24')]+_0x24f322[_0xa4da('0x25')];var _0x29b83c;if(_0x5be1f5>=_0x230543){_0x5be1f5=_0x230543;_0x29b83c=0xc8;}else{_0x29b83c=0xce;}_0x4541d8[_0xa4da('0x20')](_0x29b83c);return _0x4541d8['set'](_0xa4da('0x26'),_0x5f3e5b+'-'+_0x5be1f5+'/'+_0x230543)[_0xa4da('0x21')](_0x5c9d8f);}return null;};}function patchUpdates(_0x583616){return function(_0x34a6ea){try{jsonpatch[_0xa4da('0x27')](_0x34a6ea,_0x583616,!![]);}catch(_0x3a544d){return BPromise[_0xa4da('0x28')](_0x3a544d);}return _0x34a6ea[_0xa4da('0x29')]();};}function saveUpdates(_0x48bfd2,_0x297af2){return function(_0x2a46c1){if(_0x2a46c1){return _0x2a46c1['update'](_0x48bfd2)['then'](function(_0x1d9757){return _0x1d9757;});}return null;};}function removeEntity(_0x378069,_0x442b1f){return function(_0x5133ad){if(_0x5133ad){return _0x5133ad[_0xa4da('0x2a')]()[_0xa4da('0x2b')](function(){_0x378069['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x103083,_0x52ab8b){return function(_0x28e4bd){if(!_0x28e4bd){_0x103083[_0xa4da('0x2c')](0x194);}return _0x28e4bd;};}function handleError(_0x4f095f,_0x2636fd){_0x2636fd=_0x2636fd||0x1f4;return function(_0x2477cb){logger[_0xa4da('0x2d')](_0x2477cb['stack']);if(_0x2477cb['name']){delete _0x2477cb[_0xa4da('0x2e')];}_0x4f095f[_0xa4da('0x20')](_0x2636fd)[_0xa4da('0x2f')](_0x2477cb);};}exports['index']=function(_0x3e60de,_0x558024){var _0x2cb1a2={},_0x15c1c6={},_0x191c84={'count':0x0,'rows':[]};var _0x2f2153=_[_0xa4da('0x30')](db[_0xa4da('0x31')]['rawAttributes'],function(_0x3daf65){return{'name':_0x3daf65['fieldName'],'type':_0x3daf65['type'][_0xa4da('0x32')]};});_0x15c1c6[_0xa4da('0x33')]=_[_0xa4da('0x30')](_0x2f2153,'name');_0x15c1c6[_0xa4da('0x34')]=_['keys'](_0x3e60de[_0xa4da('0x34')]);_0x15c1c6[_0xa4da('0x35')]=_[_0xa4da('0x36')](_0x15c1c6[_0xa4da('0x33')],_0x15c1c6[_0xa4da('0x34')]);_0x2cb1a2[_0xa4da('0x37')]=_['intersection'](_0x15c1c6['model'],qs['fields'](_0x3e60de['query']['fields']));_0x2cb1a2[_0xa4da('0x37')]=_0x2cb1a2[_0xa4da('0x37')][_0xa4da('0x38')]?_0x2cb1a2[_0xa4da('0x37')]:_0x15c1c6[_0xa4da('0x33')];if(!_0x3e60de[_0xa4da('0x34')]['hasOwnProperty'](_0xa4da('0x39'))){_0x2cb1a2[_0xa4da('0x25')]=qs[_0xa4da('0x25')](_0x3e60de[_0xa4da('0x34')]['limit']);_0x2cb1a2[_0xa4da('0x24')]=qs[_0xa4da('0x24')](_0x3e60de[_0xa4da('0x34')][_0xa4da('0x24')]);}_0x2cb1a2['order']=qs[_0xa4da('0x3a')](_0x3e60de[_0xa4da('0x34')][_0xa4da('0x3a')]);_0x2cb1a2[_0xa4da('0x3b')]=qs['filters'](_['pick'](_0x3e60de[_0xa4da('0x34')],_0x15c1c6[_0xa4da('0x35')]),_0x2f2153);if(_0x3e60de[_0xa4da('0x34')][_0xa4da('0x3c')]){_0x2cb1a2['where']=_[_0xa4da('0x3d')](_0x2cb1a2[_0xa4da('0x3b')],{'$or':_[_0xa4da('0x30')](_0x2f2153,function(_0x27a614){if(_0x27a614[_0xa4da('0x3e')]!=='VIRTUAL'){var _0xadc6f0={};_0xadc6f0[_0x27a614[_0xa4da('0x2e')]]={'$like':'%'+_0x3e60de[_0xa4da('0x34')]['filter']+'%'};return _0xadc6f0;}})});}_0x2cb1a2=_[_0xa4da('0x3d')]({},_0x2cb1a2,_0x3e60de['options']);var _0x306f05={'where':_0x2cb1a2[_0xa4da('0x3b')]};return db[_0xa4da('0x31')][_0xa4da('0x23')](_0x306f05)[_0xa4da('0x2b')](function(_0x24f8ca){_0x191c84[_0xa4da('0x23')]=_0x24f8ca;if(_0x3e60de[_0xa4da('0x34')][_0xa4da('0x3f')]){_0x2cb1a2[_0xa4da('0x40')]=[{'all':!![]}];}return db[_0xa4da('0x31')][_0xa4da('0x41')](_0x2cb1a2);})[_0xa4da('0x2b')](function(_0x3a8cc2){_0x191c84['rows']=_0x3a8cc2;return _0x191c84;})['then'](respondWithFilteredResult(_0x558024,_0x2cb1a2))[_0xa4da('0x42')](handleError(_0x558024,null));};exports[_0xa4da('0x43')]=function(_0xc2a3f8,_0xeb8a76){var _0x2f6655={'raw':!![],'where':{'id':_0xc2a3f8[_0xa4da('0x44')]['id']}},_0x22309d={};_0x22309d['model']=_[_0xa4da('0x45')](db[_0xa4da('0x31')]['rawAttributes']);_0x22309d[_0xa4da('0x34')]=_[_0xa4da('0x45')](_0xc2a3f8[_0xa4da('0x34')]);_0x22309d['filters']=_[_0xa4da('0x36')](_0x22309d['model'],_0x22309d[_0xa4da('0x34')]);_0x2f6655[_0xa4da('0x37')]=_[_0xa4da('0x36')](_0x22309d[_0xa4da('0x33')],qs[_0xa4da('0x46')](_0xc2a3f8[_0xa4da('0x34')]['fields']));_0x2f6655['attributes']=_0x2f6655[_0xa4da('0x37')]['length']?_0x2f6655[_0xa4da('0x37')]:_0x22309d[_0xa4da('0x33')];if(_0xc2a3f8[_0xa4da('0x34')][_0xa4da('0x3f')]){_0x2f6655[_0xa4da('0x40')]=[{'all':!![]}];}_0x2f6655=_[_0xa4da('0x3d')]({},_0x2f6655,_0xc2a3f8['options']);return db[_0xa4da('0x31')][_0xa4da('0x47')](_0x2f6655)[_0xa4da('0x2b')](handleEntityNotFound(_0xeb8a76,null))[_0xa4da('0x2b')](respondWithResult(_0xeb8a76,null))[_0xa4da('0x42')](handleError(_0xeb8a76,null));};exports[_0xa4da('0x48')]=function(_0x1d3004,_0x2c0948){return db[_0xa4da('0x31')][_0xa4da('0x48')](_0x1d3004[_0xa4da('0x49')],{})[_0xa4da('0x2b')](respondWithResult(_0x2c0948,0xc9))[_0xa4da('0x42')](handleError(_0x2c0948,null));};exports[_0xa4da('0x4a')]=function(_0x53abdf,_0x442ff2){if(_0x53abdf[_0xa4da('0x49')]['id']){delete _0x53abdf[_0xa4da('0x49')]['id'];}return db[_0xa4da('0x31')][_0xa4da('0x47')]({'where':{'id':_0x53abdf[_0xa4da('0x44')]['id']}})[_0xa4da('0x2b')](handleEntityNotFound(_0x442ff2,null))[_0xa4da('0x2b')](saveUpdates(_0x53abdf[_0xa4da('0x49')],null))[_0xa4da('0x2b')](respondWithResult(_0x442ff2,null))[_0xa4da('0x42')](handleError(_0x442ff2,null));};exports[_0xa4da('0x2a')]=function(_0x57f808,_0x40872b){return db[_0xa4da('0x31')][_0xa4da('0x47')]({'where':{'id':_0x57f808[_0xa4da('0x44')]['id']}})[_0xa4da('0x2b')](handleEntityNotFound(_0x40872b,null))[_0xa4da('0x2b')](removeEntity(_0x40872b,null))[_0xa4da('0x42')](handleError(_0x40872b,null));};exports[_0xa4da('0x4b')]=function(_0x205b3a,_0x5d9d35){return db[_0xa4da('0x31')][_0xa4da('0x4b')]()[_0xa4da('0x2b')](respondWithResult(_0x5d9d35,null))['catch'](handleError(_0x5d9d35,null));};function wrapUser(_0x1a3fb1){return function(_0x34a118){var _0x31468c=_0x1a3fb1[_0xa4da('0x4c')]({'plain':!![]});_0x31468c[_0xa4da('0x4d')]=[];if(_0x34a118){_0x31468c[_0xa4da('0x4e')]=_0x34a118[_0xa4da('0x4f')];_0x31468c['lastMessage']=_0x34a118;}else{_0x31468c[_0xa4da('0x4e')]=moment(0x0)[_0xa4da('0x50')](_0xa4da('0x51'));_0x31468c[_0xa4da('0x52')]={};}return _0x31468c;};}exports[_0xa4da('0x53')]=function(_0x544a3d,_0x184899,_0x2257d0){var _0x4ea71b=[];return db['User'][_0xa4da('0x41')]({'where':{'role':[_0xa4da('0x54'),_0xa4da('0x55'),_0xa4da('0x56')]},'attributes':['id',_0xa4da('0x57'),'name',_0xa4da('0x58'),_0xa4da('0x59'),_0xa4da('0x5a'),_0xa4da('0x5b'),'lastLoginAt','allowmessenger',_0xa4da('0x5c')],'order':qs['sort']('-online'),'include':[{'model':db[_0xa4da('0x5d')],'as':_0xa4da('0x5e'),'attributes':['id',_0xa4da('0x2e'),'type'],'through':{'attributes':[]}}]})[_0xa4da('0x2b')](function(_0x269be1){if(_0x269be1){var _0x46fdfc=_0x544a3d[_0xa4da('0x56')][_0xa4da('0x4c')]({'plain':!![]});if(!_0x46fdfc)throw new Error(_0xa4da('0x5f'));if(_0x46fdfc[_0xa4da('0x58')]===_0xa4da('0x56')){return db['UserProfileSection']['find']({'where':{'name':_0xa4da('0x60'),'userProfileId':_0x46fdfc['userProfileId']},'raw':!![]})[_0xa4da('0x2b')](function(_0x2286e2){if(_0x2286e2){if(_0x2286e2[_0xa4da('0x61')]===0x0){return db[_0xa4da('0x62')][_0xa4da('0x41')]({'where':{'sectionId':_0x2286e2['id']},'raw':!![]})[_0xa4da('0x2b')](function(_0x355988){var _0x359bc9=[];if(_[_0xa4da('0x63')](_0x355988)){_0x359bc9=_[_0xa4da('0x3c')](_0x269be1,function(_0x45e849){if(_0x45e849[_0xa4da('0x58')]!==_0xa4da('0x54')){return _0x45e849;}});return _0x359bc9;}else{for(var _0x4c9bda=0x0;_0x4c9bda<_0x269be1[_0xa4da('0x38')];_0x4c9bda++){var _0x44d413=_0x269be1[_0x4c9bda];if(_0x44d413[_0xa4da('0x58')]===_0xa4da('0x54')){var _0x11fe02=_[_0xa4da('0x47')](_0x355988,function(_0x42bf8d){return _0x42bf8d[_0xa4da('0x64')]===_0x44d413['id'];});if(_0x11fe02)_0x359bc9[_0xa4da('0x65')](_0x44d413);}else{_0x359bc9['push'](_0x44d413);}}return _0x359bc9;}});}else{return _0x269be1;}}else{var _0x438207=_['filter'](_0x269be1,function(_0x48d086){if(_0x48d086['role']!==_0xa4da('0x54')){return _0x48d086;}});return _0x438207;}});}else{return _0x269be1;}}})[_0xa4da('0x2b')](function(_0x109c81){var _0x5e1f41=[];if(_0x109c81){_0x4ea71b=_0x109c81;for(var _0x22df10=0x0;_0x22df10<_0x109c81['length'];_0x22df10+=0x1){_0x4ea71b[_0x22df10]['messages']=[];_0x5e1f41[_0xa4da('0x65')](db[_0xa4da('0x31')]['find']({'where':{'FromId':[_0x544a3d[_0xa4da('0x56')]['id'],_0x109c81[_0x22df10]['id']],'ToId':[_0x544a3d[_0xa4da('0x56')]['id'],_0x109c81[_0x22df10]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa4da('0x66'),_0xa4da('0x67'),_0xa4da('0x68'),_0xa4da('0x49')],'order':qs['sort'](_0xa4da('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x109c81[_0x22df10])));}return BPromise['all'](_0x5e1f41);}return[];})['then'](function(_0x1add3e){return{'rows':_0x1add3e,'count':_0x1add3e[_0xa4da('0x38')]};})['then'](respondWithResult(_0x184899,null))[_0xa4da('0x42')](handleError(_0x184899,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 26a5af8..471bff6 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 _0x5e6c=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','save','emit'];(function(_0x29b97,_0x34f5ee){var _0x474630=function(_0x4d8751){while(--_0x4d8751){_0x29b97['push'](_0x29b97['shift']());}};_0x474630(++_0x34f5ee);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x2316c0,_0x43333c){_0x2316c0=_0x2316c0-0x0;var _0x103441=_0x5e6c[_0x2316c0];return _0x103441;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc5e6('0x0'))['db'][_0xc5e6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc5e6('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5bb81d){return function(_0x3c392e,_0x107078,_0x59f827){ChatInternalMessageEvents[_0xc5e6('0x3')](_0x5bb81d+':'+_0x3c392e['id'],_0x3c392e);ChatInternalMessageEvents['emit'](_0x5bb81d,_0x3c392e);_0x59f827(null);};}for(var e in events){if(events[_0xc5e6('0x4')](e)){var event=events[e];ChatInternalMessage[_0xc5e6('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe5f0=['exports','events','../../mysqldb','ChatInternalMessage','save','update','emit','hasOwnProperty'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xe5f0,0x69));var _0x0e5f=function(_0x1ecc8a,_0x2753e7){_0x1ecc8a=_0x1ecc8a-0x0;var _0x5bb893=_0xe5f0[_0x1ecc8a];return _0x5bb893;};'use strict';var EventEmitter=require(_0x0e5f('0x0'));var ChatInternalMessage=require(_0x0e5f('0x1'))['db'][_0x0e5f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0e5f('0x3'),'afterUpdate':_0x0e5f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x141176){return function(_0x41a4e8,_0x3ab87b,_0xbf2587){ChatInternalMessageEvents[_0x0e5f('0x5')](_0x141176+':'+_0x41a4e8['id'],_0x41a4e8);ChatInternalMessageEvents[_0x0e5f('0x5')](_0x141176,_0x41a4e8);_0xbf2587(null);};}for(var e in events){if(events[_0x0e5f('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x0e5f('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 fed5044..c790b15 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 _0x017d=['moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x017d,0x1ca));var _0xd017=function(_0x5940a7,_0x4e5abb){_0x5940a7=_0x5940a7-0x0;var _0x354543=_0x017d[_0x5940a7];return _0x354543;};'use strict';var _=require(_0xd017('0x0'));var util=require(_0xd017('0x1'));var logger=require(_0xd017('0x2'))(_0xd017('0x3'));var moment=require(_0xd017('0x4'));var BPromise=require(_0xd017('0x5'));var rp=require(_0xd017('0x6'));var fs=require('fs');var path=require(_0xd017('0x7'));var rimraf=require('rimraf');var config=require(_0xd017('0x8'));var attributes=require(_0xd017('0x9'));module[_0xd017('0xa')]=function(_0x4a8026,_0x200ed2){return _0x4a8026['define']('ChatInternalMessage',attributes,{'tableName':_0xd017('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd017('0xc'),'collate':_0xd017('0xd')});};
\ No newline at end of file
+var _0x58d3=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','./chatInternalMessage.attributes','exports'];(function(_0x56e3f2,_0x4c3db1){var _0x1a0106=function(_0x1e3960){while(--_0x1e3960){_0x56e3f2['push'](_0x56e3f2['shift']());}};_0x1a0106(++_0x4c3db1);}(_0x58d3,0x92));var _0x358d=function(_0x1fa4ae,_0xb27861){_0x1fa4ae=_0x1fa4ae-0x0;var _0x40e58a=_0x58d3[_0x1fa4ae];return _0x40e58a;};'use strict';var _=require(_0x358d('0x0'));var util=require(_0x358d('0x1'));var logger=require('../../config/logger')(_0x358d('0x2'));var moment=require(_0x358d('0x3'));var BPromise=require(_0x358d('0x4'));var rp=require(_0x358d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x358d('0x6'));module[_0x358d('0x7')]=function(_0x5aaa6b,_0x17bf79){return _0x5aaa6b['define']('ChatInternalMessage',attributes,{'tableName':_0x358d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x358d('0x9'),'collate':_0x358d('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index fddc9b2..b4ea088 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 _0x6340=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x584af4,_0x15e71f){var _0x24dc52=function(_0xe0078e){while(--_0xe0078e){_0x584af4['push'](_0x584af4['shift']());}};_0x24dc52(++_0x15e71f);}(_0x6340,0x71));var _0x0634=function(_0x8d2172,_0x30fbbc){_0x8d2172=_0x8d2172-0x0;var _0x528f62=_0x6340[_0x8d2172];return _0x528f62;};'use strict';var _=require(_0x0634('0x0'));var util=require(_0x0634('0x1'));var moment=require(_0x0634('0x2'));var BPromise=require(_0x0634('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0634('0x4'));var db=require(_0x0634('0x5'))['db'];var utils=require(_0x0634('0x6'));var logger=require(_0x0634('0x7'))('rpc');var config=require(_0x0634('0x8'));var jayson=require(_0x0634('0x9'));var client=jayson[_0x0634('0xa')][_0x0634('0xb')]({'port':0x232a});config[_0x0634('0xc')]=_[_0x0634('0xd')](config[_0x0634('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0634('0xe'))(new Redis(config['redis']));require(_0x0634('0xf'))[_0x0634('0x10')](socket);function respondWithRpcPromise(_0x463c51,_0x2c82d0,_0x3db0d2){return new BPromise(function(_0x2f6c47,_0x550ee7){return client[_0x0634('0x11')](_0x463c51,_0x3db0d2)[_0x0634('0x12')](function(_0x3175f1){logger[_0x0634('0x13')](_0x0634('0x14'),_0x2c82d0,_0x0634('0x15'));logger['debug'](_0x0634('0x16'),_0x2c82d0,'request\x20sent',JSON[_0x0634('0x17')](_0x3175f1));if(_0x3175f1[_0x0634('0x18')]){if(_0x3175f1[_0x0634('0x18')]['code']===0x1f4){logger[_0x0634('0x18')](_0x0634('0x14'),_0x2c82d0,_0x3175f1[_0x0634('0x18')][_0x0634('0x19')]);return _0x550ee7(_0x3175f1[_0x0634('0x18')]['message']);}logger[_0x0634('0x18')](_0x0634('0x14'),_0x2c82d0,_0x3175f1[_0x0634('0x18')][_0x0634('0x19')]);return _0x2f6c47(_0x3175f1[_0x0634('0x18')][_0x0634('0x19')]);}else{logger[_0x0634('0x13')](_0x0634('0x14'),_0x2c82d0,_0x0634('0x15'));_0x2f6c47(_0x3175f1[_0x0634('0x1a')][_0x0634('0x19')]);}})[_0x0634('0x1b')](function(_0x20e245){logger[_0x0634('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x2c82d0,_0x20e245);_0x550ee7(_0x20e245);});});}
\ No newline at end of file
+var _0xc30d=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x397984,_0x5cbddf){var _0x54daaa=function(_0x44fd81){while(--_0x44fd81){_0x397984['push'](_0x397984['shift']());}};_0x54daaa(++_0x5cbddf);}(_0xc30d,0x6e));var _0xdc30=function(_0x2ecd91,_0x1f21e8){_0x2ecd91=_0x2ecd91-0x0;var _0x3bf737=_0xc30d[_0x2ecd91];return _0x3bf737;};'use strict';var _=require(_0xdc30('0x0'));var util=require('util');var moment=require(_0xdc30('0x1'));var BPromise=require(_0xdc30('0x2'));var rs=require(_0xdc30('0x3'));var fs=require('fs');var Redis=require(_0xdc30('0x4'));var db=require(_0xdc30('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc30('0x6'))('rpc');var config=require(_0xdc30('0x7'));var jayson=require(_0xdc30('0x8'));var client=jayson[_0xdc30('0x9')][_0xdc30('0xa')]({'port':0x232a});config[_0xdc30('0xb')]=_[_0xdc30('0xc')](config['redis'],{'host':_0xdc30('0xd'),'port':0x18eb});var socket=require(_0xdc30('0xe'))(new Redis(config[_0xdc30('0xb')]));require(_0xdc30('0xf'))[_0xdc30('0x10')](socket);function respondWithRpcPromise(_0x65f596,_0x38b6fc,_0x165fb2){return new BPromise(function(_0x2c4fe1,_0x593143){return client['request'](_0x65f596,_0x165fb2)['then'](function(_0x110f58){logger[_0xdc30('0x11')](_0xdc30('0x12'),_0x38b6fc,_0xdc30('0x13'));logger[_0xdc30('0x14')](_0xdc30('0x15'),_0x38b6fc,_0xdc30('0x13'),JSON['stringify'](_0x110f58));if(_0x110f58[_0xdc30('0x16')]){if(_0x110f58[_0xdc30('0x16')][_0xdc30('0x17')]===0x1f4){logger[_0xdc30('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x38b6fc,_0x110f58[_0xdc30('0x16')][_0xdc30('0x18')]);return _0x593143(_0x110f58[_0xdc30('0x16')]['message']);}logger[_0xdc30('0x16')](_0xdc30('0x12'),_0x38b6fc,_0x110f58[_0xdc30('0x16')][_0xdc30('0x18')]);return _0x2c4fe1(_0x110f58[_0xdc30('0x16')][_0xdc30('0x18')]);}else{logger[_0xdc30('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x38b6fc,_0xdc30('0x13'));_0x2c4fe1(_0x110f58[_0xdc30('0x19')]['message']);}})['catch'](function(_0x3d984e){logger[_0xdc30('0x16')](_0xdc30('0x12'),_0x38b6fc,_0x3d984e);_0x593143(_0x3d984e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 06060aa..e4185b0 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 _0x2306=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x589cdf,_0x53f463){var _0x5f0774=function(_0x530589){while(--_0x530589){_0x589cdf['push'](_0x589cdf['shift']());}};_0x5f0774(++_0x53f463);}(_0x2306,0x1f1));var _0x6230=function(_0x3d0f99,_0x52c4bf){_0x3d0f99=_0x3d0f99-0x0;var _0x274bd2=_0x2306[_0x3d0f99];return _0x274bd2;};'use strict';var ChatInternalMessageEvents=require(_0x6230('0x0'));var events=[_0x6230('0x1'),_0x6230('0x2'),_0x6230('0x3')];function createListener(_0x4750e7,_0x54aca6){return function(_0x2b61eb){_0x54aca6[_0x6230('0x4')](_0x4750e7,_0x2b61eb);};}function removeListener(_0x16d1a9,_0x30d3ec){return function(){ChatInternalMessageEvents[_0x6230('0x5')](_0x16d1a9,_0x30d3ec);};}exports['register']=function(_0x4a5164){for(var _0x55e65e=0x0,_0x2b5e2d=events[_0x6230('0x6')];_0x55e65e<_0x2b5e2d;_0x55e65e++){var _0x61bde6=events[_0x55e65e];var _0x2fd06b=createListener(_0x6230('0x7')+_0x61bde6,_0x4a5164);ChatInternalMessageEvents['on'](_0x61bde6,_0x2fd06b);}};
\ No newline at end of file
+var _0x8b61=['remove','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x8b61,0xed));var _0x18b6=function(_0x5f4ef9,_0x2a82c1){_0x5f4ef9=_0x5f4ef9-0x0;var _0x4728cc=_0x8b61[_0x5f4ef9];return _0x4728cc;};'use strict';var ChatInternalMessageEvents=require(_0x18b6('0x0'));var events=['save',_0x18b6('0x1'),'update'];function createListener(_0x36e0cb,_0x51fd91){return function(_0x2997cc){_0x51fd91[_0x18b6('0x2')](_0x36e0cb,_0x2997cc);};}function removeListener(_0x46e210,_0x58a971){return function(){ChatInternalMessageEvents[_0x18b6('0x3')](_0x46e210,_0x58a971);};}exports[_0x18b6('0x4')]=function(_0x26112b){for(var _0x13a20=0x0,_0x18588b=events[_0x18b6('0x5')];_0x13a20<_0x18588b;_0x13a20++){var _0x135abb=events[_0x13a20];var _0x241be7=createListener(_0x18b6('0x6')+_0x135abb,_0x26112b);ChatInternalMessageEvents['on'](_0x135abb,_0x241be7);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4db4028..9d5d685 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 _0xcc3c=['index','isAuthenticated','describe','/users','getUsers','show','put','/:id','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x1ad53c,_0x13ebf8){var _0x33afe4=function(_0x2fa995){while(--_0x2fa995){_0x1ad53c['push'](_0x1ad53c['shift']());}};_0x33afe4(++_0x13ebf8);}(_0xcc3c,0xd2));var _0xccc3=function(_0x4fefdd,_0x2453f0){_0x4fefdd=_0x4fefdd-0x0;var _0x6df87=_0xcc3c[_0x4fefdd];return _0x6df87;};'use strict';var multer=require(_0xccc3('0x0'));var util=require('util');var path=require(_0xccc3('0x1'));var timeout=require('connect-timeout');var express=require(_0xccc3('0x2'));var router=express[_0xccc3('0x3')]();var fs_extra=require(_0xccc3('0x4'));var auth=require(_0xccc3('0x5'));var interaction=require(_0xccc3('0x6'));var config=require(_0xccc3('0x7'));var controller=require(_0xccc3('0x8'));router[_0xccc3('0x9')]('/',auth['isAuthenticated'](),controller[_0xccc3('0xa')]);router['get']('/describe',auth[_0xccc3('0xb')](),controller[_0xccc3('0xc')]);router[_0xccc3('0x9')](_0xccc3('0xd'),auth[_0xccc3('0xb')](),controller[_0xccc3('0xe')]);router[_0xccc3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xccc3('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xccc3('0x10')](_0xccc3('0x11'),controller[_0xccc3('0x12')]);router[_0xccc3('0x13')](_0xccc3('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf4ab=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','describe','/users','getUsers','isAuthenticated','post','put','/:id'];(function(_0x102adc,_0xe36885){var _0x4198cd=function(_0x4f7021){while(--_0x4f7021){_0x102adc['push'](_0x102adc['shift']());}};_0x4198cd(++_0xe36885);}(_0xf4ab,0x1b7));var _0xbf4a=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xf4ab[_0x245afe];return _0x4eefde;};'use strict';var multer=require(_0xbf4a('0x0'));var util=require(_0xbf4a('0x1'));var path=require(_0xbf4a('0x2'));var timeout=require(_0xbf4a('0x3'));var express=require(_0xbf4a('0x4'));var router=express[_0xbf4a('0x5')]();var fs_extra=require(_0xbf4a('0x6'));var auth=require(_0xbf4a('0x7'));var interaction=require(_0xbf4a('0x8'));var config=require(_0xbf4a('0x9'));var controller=require(_0xbf4a('0xa'));router[_0xbf4a('0xb')]('/',auth['isAuthenticated'](),controller[_0xbf4a('0xc')]);router[_0xbf4a('0xb')](_0xbf4a('0xd'),auth['isAuthenticated'](),controller[_0xbf4a('0xe')]);router[_0xbf4a('0xb')](_0xbf4a('0xf'),auth['isAuthenticated'](),controller[_0xbf4a('0x10')]);router[_0xbf4a('0xb')]('/:id',auth[_0xbf4a('0x11')](),controller['show']);router[_0xbf4a('0x12')]('/',auth[_0xbf4a('0x11')](),controller['create']);router[_0xbf4a('0x13')]('/:id',controller['update']);router['delete'](_0xbf4a('0x14'),auth[_0xbf4a('0x11')](),controller[_0xbf4a('0x15')]);module[_0xbf4a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 74954d4..13a4b93 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 _0x1707=['BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x1707,0x1df));var _0x7170=function(_0x10e422,_0x520f27){_0x10e422=_0x10e422-0x0;var _0x2ece15=_0x1707[_0x10e422];return _0x2ece15;};'use strict';var Sequelize=require(_0x7170('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7170('0x2')),'defaultValue':_0x7170('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7170('0x3')]},'providerName':{'type':Sequelize[_0x7170('0x4')]},'providerResponse':{'type':Sequelize[_0x7170('0x5')]}};
\ No newline at end of file
+var _0x585e=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5cf272,_0x5ef6b4){var _0x479246=function(_0x1fb87c){while(--_0x1fb87c){_0x5cf272['push'](_0x5cf272['shift']());}};_0x479246(++_0x5ef6b4);}(_0x585e,0x1c2));var _0xe585=function(_0x1b4c7b,_0x141bbf){_0x1b4c7b=_0x1b4c7b-0x0;var _0x45f19b=_0x585e[_0x1b4c7b];return _0x45f19b;};'use strict';var Sequelize=require(_0xe585('0x0'));module[_0xe585('0x1')]={'body':{'type':Sequelize[_0xe585('0x2')](_0xe585('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe585('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe585('0x5')),'defaultValue':_0xe585('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xe585('0x6')]},'providerResponse':{'type':Sequelize[_0xe585('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 644cd88..0ba0c0d 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 _0x3d34=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','rows','show','params','merge','find','create','body','chat-interactions','accept','chat','UserId','user','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','internal','SIP/%s','rejectmessage','parse','formData','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x14a02d,_0x240b37){var _0x5abc59=function(_0x2b0b35){while(--_0x2b0b35){_0x14a02d['push'](_0x14a02d['shift']());}};_0x5abc59(++_0x240b37);}(_0x3d34,0xfd));var _0x43d3=function(_0x35b07d,_0x3d0ae7){_0x35b07d=_0x35b07d-0x0;var _0x2868bc=_0x3d34[_0x35b07d];return _0x2868bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x43d3('0x0'));var zipdir=require(_0x43d3('0x1'));var jsonpatch=require(_0x43d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43d3('0x3'));var Mustache=require(_0x43d3('0x4'));var util=require(_0x43d3('0x5'));var path=require(_0x43d3('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43d3('0x7'));var _=require(_0x43d3('0x8'));var squel=require(_0x43d3('0x9'));var crypto=require(_0x43d3('0xa'));var jsforce=require(_0x43d3('0xb'));var deskjs=require(_0x43d3('0xc'));var toCsv=require(_0x43d3('0xd'));var querystring=require('querystring');var Papa=require(_0x43d3('0xe'));var Redis=require(_0x43d3('0xf'));var authService=require(_0x43d3('0x10'));var qs=require(_0x43d3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43d3('0x12'));var logger=require(_0x43d3('0x13'))('api');var utils=require(_0x43d3('0x14'));var config=require(_0x43d3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d3('0x16'))['db'];config[_0x43d3('0x17')]=_[_0x43d3('0x18')](config[_0x43d3('0x17')],{'host':_0x43d3('0x19'),'port':0x18eb});var socket=require(_0x43d3('0x1a'))(new Redis(config[_0x43d3('0x17')]));require('./chatMessage.socket')[_0x43d3('0x1b')](socket);var jayson=require(_0x43d3('0x1c'));var client=jayson[_0x43d3('0x1d')][_0x43d3('0x1e')]({'port':0x232c});var client9002=jayson[_0x43d3('0x1d')][_0x43d3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x98fc3f,_0x516509,_0x4200a8,_0x50054d){return new BPromise(function(_0x2ebd63,_0x416b7f){var _0x5d3d6a=_0x50054d||client;return _0x5d3d6a[_0x43d3('0x1f')](_0x98fc3f,_0x4200a8)['then'](function(_0xb1ff47){logger[_0x43d3('0x20')]('ChatMessage,\x20%s,\x20%s',_0x516509,_0x43d3('0x21'));logger[_0x43d3('0x22')](_0x43d3('0x23'),_0x516509,_0x43d3('0x21'),JSON[_0x43d3('0x24')](_0xb1ff47));if(_0xb1ff47['error']){if(_0xb1ff47[_0x43d3('0x25')][_0x43d3('0x26')]===0x1f4){logger[_0x43d3('0x25')](_0x43d3('0x27'),_0x516509,_0xb1ff47['error'][_0x43d3('0x28')]);return _0x416b7f(_0xb1ff47[_0x43d3('0x25')]['message']);}logger[_0x43d3('0x25')](_0x43d3('0x27'),_0x516509,_0xb1ff47['error'][_0x43d3('0x28')]);return _0x2ebd63(_0xb1ff47[_0x43d3('0x25')][_0x43d3('0x28')]);}else{logger['info'](_0x43d3('0x27'),_0x516509,'request\x20sent');_0x2ebd63(_0xb1ff47[_0x43d3('0x29')]['message']);}})[_0x43d3('0x2a')](function(_0x574474){logger['error'](_0x43d3('0x27'),_0x516509,_0x574474);_0x416b7f(_0x574474);});});}function respondWithStatusCode(_0x995037,_0x488e9a){_0x488e9a=_0x488e9a||0xcc;return function(_0x2aaeb3){if(_0x2aaeb3){return _0x995037[_0x43d3('0x2b')](_0x488e9a);}return _0x995037[_0x43d3('0x2c')](_0x488e9a)[_0x43d3('0x2d')]();};}function respondWithResult(_0x5c31a6,_0x4dc8f3){_0x4dc8f3=_0x4dc8f3||0xc8;return function(_0x34d1d0){if(_0x34d1d0){return _0x5c31a6[_0x43d3('0x2c')](_0x4dc8f3)[_0x43d3('0x2e')](_0x34d1d0);}};}function respondWithFilteredResult(_0x4beb93,_0x568983){return function(_0x4b43ae){if(_0x4b43ae){var _0x358c4c=typeof _0x568983[_0x43d3('0x2f')]===_0x43d3('0x30')&&typeof _0x568983['limit']==='undefined';var _0x27a522=_0x4b43ae[_0x43d3('0x31')];var _0x31b8ca=_0x358c4c?0x0:_0x568983[_0x43d3('0x2f')];var _0x3c27fb=_0x358c4c?_0x4b43ae[_0x43d3('0x31')]:_0x568983[_0x43d3('0x2f')]+_0x568983[_0x43d3('0x32')];var _0x5e326b;if(_0x3c27fb>=_0x27a522){_0x3c27fb=_0x27a522;_0x5e326b=0xc8;}else{_0x5e326b=0xce;}_0x4beb93[_0x43d3('0x2c')](_0x5e326b);return _0x4beb93[_0x43d3('0x33')]('Content-Range',_0x31b8ca+'-'+_0x3c27fb+'/'+_0x27a522)[_0x43d3('0x2e')](_0x4b43ae);}return null;};}function patchUpdates(_0x18ac72){return function(_0x2a013d){try{jsonpatch['apply'](_0x2a013d,_0x18ac72,!![]);}catch(_0x5cc9dc){return BPromise[_0x43d3('0x34')](_0x5cc9dc);}return _0x2a013d[_0x43d3('0x35')]();};}function saveUpdates(_0x372fda,_0x599b63){return function(_0x36c1a3){if(_0x36c1a3){return _0x36c1a3['update'](_0x372fda)[_0x43d3('0x36')](function(_0x514f42){return _0x514f42;});}return null;};}function removeEntity(_0x23ef23,_0x35cff2){return function(_0x511bc3){if(_0x511bc3){return _0x511bc3[_0x43d3('0x37')]()[_0x43d3('0x36')](function(){_0x23ef23[_0x43d3('0x2c')](0xcc)[_0x43d3('0x2d')]();});}};}function handleEntityNotFound(_0x2d2cad,_0x212904){return function(_0x416cc5){if(!_0x416cc5){_0x2d2cad[_0x43d3('0x2b')](0x194);}return _0x416cc5;};}function handleError(_0x2ac5c3,_0x9a454e){_0x9a454e=_0x9a454e||0x1f4;return function(_0x23d59a){logger['error'](_0x23d59a[_0x43d3('0x38')]);if(_0x23d59a[_0x43d3('0x39')]){delete _0x23d59a[_0x43d3('0x39')];}_0x2ac5c3[_0x43d3('0x2c')](_0x9a454e)[_0x43d3('0x3a')](_0x23d59a);};}exports['index']=function(_0x497897,_0xcf473f){var _0x13aee1={},_0x125419={},_0x2a3139={'count':0x0,'rows':[]};var _0x21a546=_[_0x43d3('0x3b')](db[_0x43d3('0x3c')][_0x43d3('0x3d')],function(_0xf8d069){return{'name':_0xf8d069[_0x43d3('0x3e')],'type':_0xf8d069[_0x43d3('0x3f')][_0x43d3('0x40')]};});_0x125419['model']=_[_0x43d3('0x3b')](_0x21a546,_0x43d3('0x39'));_0x125419[_0x43d3('0x41')]=_[_0x43d3('0x42')](_0x497897[_0x43d3('0x41')]);_0x125419['filters']=_[_0x43d3('0x43')](_0x125419['model'],_0x125419['query']);_0x13aee1[_0x43d3('0x44')]=_[_0x43d3('0x43')](_0x125419[_0x43d3('0x45')],qs[_0x43d3('0x46')](_0x497897[_0x43d3('0x41')][_0x43d3('0x46')]));_0x13aee1[_0x43d3('0x44')]=_0x13aee1['attributes'][_0x43d3('0x47')]?_0x13aee1[_0x43d3('0x44')]:_0x125419[_0x43d3('0x45')];if(!_0x497897[_0x43d3('0x41')][_0x43d3('0x48')](_0x43d3('0x49'))){_0x13aee1[_0x43d3('0x32')]=qs[_0x43d3('0x32')](_0x497897[_0x43d3('0x41')][_0x43d3('0x32')]);_0x13aee1[_0x43d3('0x2f')]=qs[_0x43d3('0x2f')](_0x497897[_0x43d3('0x41')][_0x43d3('0x2f')]);}_0x13aee1[_0x43d3('0x4a')]=qs['sort'](_0x497897['query'][_0x43d3('0x4b')]);_0x13aee1[_0x43d3('0x4c')]=qs[_0x43d3('0x4d')](_['pick'](_0x497897[_0x43d3('0x41')],_0x125419[_0x43d3('0x4d')]),_0x21a546);if(_0x497897['query'][_0x43d3('0x4e')]){_0x13aee1[_0x43d3('0x4c')]=_['merge'](_0x13aee1[_0x43d3('0x4c')],{'$or':_[_0x43d3('0x3b')](_0x21a546,function(_0x508813){if(_0x508813[_0x43d3('0x3f')]!==_0x43d3('0x4f')){var _0x48a984={};_0x48a984[_0x508813['name']]={'$like':'%'+_0x497897[_0x43d3('0x41')]['filter']+'%'};return _0x48a984;}})});}_0x13aee1=_['merge']({},_0x13aee1,_0x497897[_0x43d3('0x50')]);var _0x3438c2={'where':_0x13aee1[_0x43d3('0x4c')]};return db['ChatMessage'][_0x43d3('0x31')](_0x3438c2)['then'](function(_0x4302e3){_0x2a3139[_0x43d3('0x31')]=_0x4302e3;if(_0x497897[_0x43d3('0x41')][_0x43d3('0x51')]){_0x13aee1[_0x43d3('0x52')]=[{'all':!![]}];}return db[_0x43d3('0x3c')]['findAll'](_0x13aee1);})[_0x43d3('0x36')](function(_0x3efb03){_0x2a3139[_0x43d3('0x53')]=_0x3efb03;return _0x2a3139;})['then'](respondWithFilteredResult(_0xcf473f,_0x13aee1))['catch'](handleError(_0xcf473f,null));};exports[_0x43d3('0x54')]=function(_0xd139db,_0x13d49f){var _0xb1222a={'raw':!![],'where':{'id':_0xd139db[_0x43d3('0x55')]['id']}},_0x196f36={};_0x196f36[_0x43d3('0x45')]=_['keys'](db['ChatMessage'][_0x43d3('0x3d')]);_0x196f36[_0x43d3('0x41')]=_[_0x43d3('0x42')](_0xd139db[_0x43d3('0x41')]);_0x196f36[_0x43d3('0x4d')]=_[_0x43d3('0x43')](_0x196f36['model'],_0x196f36['query']);_0xb1222a[_0x43d3('0x44')]=_[_0x43d3('0x43')](_0x196f36['model'],qs[_0x43d3('0x46')](_0xd139db[_0x43d3('0x41')][_0x43d3('0x46')]));_0xb1222a[_0x43d3('0x44')]=_0xb1222a['attributes'][_0x43d3('0x47')]?_0xb1222a[_0x43d3('0x44')]:_0x196f36[_0x43d3('0x45')];if(_0xd139db[_0x43d3('0x41')][_0x43d3('0x51')]){_0xb1222a[_0x43d3('0x52')]=[{'all':!![]}];}_0xb1222a=_[_0x43d3('0x56')]({},_0xb1222a,_0xd139db[_0x43d3('0x50')]);return db[_0x43d3('0x3c')][_0x43d3('0x57')](_0xb1222a)[_0x43d3('0x36')](handleEntityNotFound(_0x13d49f,null))['then'](respondWithResult(_0x13d49f,null))['catch'](handleError(_0x13d49f,null));};exports[_0x43d3('0x58')]=function(_0x6742d9,_0x537be5){return db[_0x43d3('0x3c')][_0x43d3('0x58')](_0x6742d9[_0x43d3('0x59')],{})['then'](respondWithResult(_0x537be5,0xc9))[_0x43d3('0x2a')](handleError(_0x537be5,null));};exports['update']=function(_0x39b37e,_0x224b8b){if(_0x39b37e[_0x43d3('0x59')]['id']){delete _0x39b37e[_0x43d3('0x59')]['id'];}return db[_0x43d3('0x3c')][_0x43d3('0x57')]({'where':{'id':_0x39b37e[_0x43d3('0x55')]['id']}})[_0x43d3('0x36')](handleEntityNotFound(_0x224b8b,null))[_0x43d3('0x36')](saveUpdates(_0x39b37e[_0x43d3('0x59')],null))[_0x43d3('0x36')](respondWithResult(_0x224b8b,null))[_0x43d3('0x2a')](handleError(_0x224b8b,null));};exports[_0x43d3('0x37')]=function(_0x365504,_0x1d75e9){return db[_0x43d3('0x3c')]['find']({'where':{'id':_0x365504[_0x43d3('0x55')]['id']}})[_0x43d3('0x36')](handleEntityNotFound(_0x1d75e9,null))[_0x43d3('0x36')](removeEntity(_0x1d75e9,null))['catch'](handleError(_0x1d75e9,null));};exports['describe']=function(_0x2afa00,_0x468895){return db['ChatMessage']['describe']()[_0x43d3('0x36')](respondWithResult(_0x468895,null))[_0x43d3('0x2a')](handleError(_0x468895,null));};var interaction_log=require('../../config/logger')(_0x43d3('0x5a'));exports[_0x43d3('0x5b')]=function(_0x12c7d0,_0x5c37a7,_0x1cc588){var _0x32dced={'agent':{},'channel':_0x43d3('0x5c')};if(_0x12c7d0[_0x43d3('0x59')]['id']){delete _0x12c7d0[_0x43d3('0x59')]['id'];}_0x12c7d0['body']['read']=!![];_0x12c7d0['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x12c7d0[_0x43d3('0x59')]['UserId']=_0x12c7d0[_0x43d3('0x59')][_0x43d3('0x5d')]||_0x12c7d0[_0x43d3('0x5e')]['id'];_0x32dced[_0x43d3('0x5f')]['id']=_0x12c7d0[_0x43d3('0x59')][_0x43d3('0x5d')];return db['ChatMessage']['find']({'where':{'id':_0x12c7d0['params']['id'],'UserId':null}})[_0x43d3('0x36')](handleEntityNotFound(_0x5c37a7,null))[_0x43d3('0x36')](saveUpdates(_0x12c7d0[_0x43d3('0x59')],null))[_0x43d3('0x36')](function(_0x41e020){if(_0x41e020){_0x32dced[_0x43d3('0x28')]=_0x41e020[_0x43d3('0x60')]({'plain':!![]});return db[_0x43d3('0x61')]['find']({'where':{'id':_0x41e020[_0x43d3('0x62')]}});}return null;})[_0x43d3('0x36')](handleEntityNotFound(_0x5c37a7,null))['then'](function(_0xcdcf20){if(_0xcdcf20){return _0xcdcf20[_0x43d3('0x63')]({'UserId':_0x12c7d0[_0x43d3('0x59')][_0x43d3('0x5d')],'read1stAt':_[_0x43d3('0x64')](_0xcdcf20[_0x43d3('0x65')])?moment()[_0x43d3('0x66')](_0x43d3('0x67')):undefined});}return null;})[_0x43d3('0x36')](function(_0x29c980){if(_0x29c980){_0x32dced[_0x43d3('0x68')]=_0x29c980[_0x43d3('0x60')]({'plain':!![]});interaction_log['info'](_0x43d3('0x69'),_0x12c7d0['user']['id'],_0x12c7d0[_0x43d3('0x5e')][_0x43d3('0x39')],_0x12c7d0[_0x43d3('0x5e')][_0x43d3('0x6a')],_0x32dced['interaction']['id'],_0x12c7d0[_0x43d3('0x59')]?JSON[_0x43d3('0x24')](_0x12c7d0[_0x43d3('0x59')]):_0x43d3('0x6b'));return respondWithRpcPromise(_0x43d3('0x6c'),_0x43d3('0x6d'),_0x32dced);}return null;})[_0x43d3('0x36')](function(_0x6d7628){var _0x57620a=_0x43d3('0x6e')+_0x6d7628['message']['ContactId'];return db[_0x43d3('0x6f')][_0x43d3('0x41')](_0x57620a,{'type':db[_0x43d3('0x70')][_0x43d3('0x71')][_0x43d3('0x72')],'raw':!![]})[_0x43d3('0x36')](function(_0x18f034){return _0x18f034;});})['then'](function(_0x148f5c){if(_0x148f5c){_0x32dced[_0x43d3('0x28')][_0x43d3('0x73')]=_0x148f5c[0x0];if(!_0x12c7d0[_0x43d3('0x59')][_0x43d3('0x5d')])return;return db[_0x43d3('0x74')]['find']({'where':{'id':_0x12c7d0[_0x43d3('0x59')]['UserId'],'role':_0x43d3('0x5f')},'attributes':['id',_0x43d3('0x39'),_0x43d3('0x75'),_0x43d3('0x76'),'internal'],'raw':!![]});}return null;})[_0x43d3('0x36')](function(_0x289a02){if(!_0x289a02)return null;_0x32dced[_0x43d3('0x28')][_0x43d3('0x5f')]=_0x289a02;return _0x32dced;})[_0x43d3('0x36')](function(_0x35bd74){if(_0x35bd74){if(_0x12c7d0[_0x43d3('0x59')][_0x43d3('0x77')]){_0x32dced['message'][_0x43d3('0x78')]=util['format']('SIP/%s',_0x12c7d0[_0x43d3('0x5e')]['name']);_0x32dced[_0x43d3('0x28')][_0x43d3('0x79')]=_0x32dced[_0x43d3('0x79')];_0x32dced[_0x43d3('0x28')][_0x43d3('0x7a')]=_0x32dced[_0x43d3('0x79')];_0x32dced['message'][_0x43d3('0x7b')]=_0x43d3('0x5b');return respondWithRpcPromise(_0x43d3('0x7c'),'EventManager',{'event':_0x43d3('0x7d'),'message':_[_0x43d3('0x56')](_0x32dced[_0x43d3('0x28')],JSON['parse'](_0x32dced[_0x43d3('0x68')]['formData']))},client9002)[_0x43d3('0x36')](function(){return _0x32dced;});}return _0x32dced;}return null;})['then'](respondWithResult(_0x5c37a7,null))[_0x43d3('0x2a')](handleError(_0x5c37a7,null));};var interaction_log=require(_0x43d3('0x13'))(_0x43d3('0x5a'));exports['reject']=function(_0xf1cb96,_0x229ab4,_0x499efe){var _0x2e7c46={'agent':{},'channel':_0x43d3('0x5c')};if(_0xf1cb96[_0x43d3('0x59')]['id']){delete _0xf1cb96[_0x43d3('0x59')]['id'];}_0xf1cb96[_0x43d3('0x59')][_0x43d3('0x5d')]=_0xf1cb96['body']['UserId']||_0xf1cb96[_0x43d3('0x5e')]['id'];_0x2e7c46[_0x43d3('0x5f')]['id']=_0xf1cb96['body'][_0x43d3('0x5d')];return db[_0x43d3('0x3c')][_0x43d3('0x57')]({'where':{'id':_0xf1cb96['params']['id'],'UserId':null}})[_0x43d3('0x36')](handleEntityNotFound(_0x229ab4,null))[_0x43d3('0x36')](function(_0x413bb9){if(_0x413bb9){_0x2e7c46['message']=_0x413bb9[_0x43d3('0x60')]({'plain':!![]});return db[_0x43d3('0x61')][_0x43d3('0x57')]({'where':{'id':_0x413bb9[_0x43d3('0x62')]}});}return null;})[_0x43d3('0x36')](handleEntityNotFound(_0x229ab4,null))[_0x43d3('0x36')](function(_0x2fab87){if(_0x2fab87){_0x2e7c46[_0x43d3('0x68')]=_0x2fab87[_0x43d3('0x60')]({'plain':!![]});interaction_log[_0x43d3('0x20')](_0x43d3('0x7e'),_0xf1cb96[_0x43d3('0x5e')]['id'],_0xf1cb96[_0x43d3('0x5e')][_0x43d3('0x39')],_0xf1cb96[_0x43d3('0x5e')][_0x43d3('0x6a')],_0x2e7c46[_0x43d3('0x68')]['id'],_0xf1cb96[_0x43d3('0x59')]?JSON['stringify'](_0xf1cb96['body']):_0x43d3('0x6b'));return respondWithRpcPromise('RejectMessage',_0x43d3('0x7f'),_0x2e7c46);}return null;})['then'](function(_0x282306){var _0x4cb6ef=_0x43d3('0x6e')+_0x282306[_0x43d3('0x28')][_0x43d3('0x80')];return db['sequelize'][_0x43d3('0x41')](_0x4cb6ef,{'type':db['Sequelize'][_0x43d3('0x71')][_0x43d3('0x72')],'raw':!![]})[_0x43d3('0x36')](function(_0x155e33){return _0x155e33;});})[_0x43d3('0x36')](function(_0x4efe8a){if(_0x4efe8a){_0x2e7c46['message'][_0x43d3('0x73')]=_0x4efe8a[0x0];if(!_0xf1cb96['body'][_0x43d3('0x5d')])return;return db[_0x43d3('0x74')][_0x43d3('0x57')]({'where':{'id':_0xf1cb96[_0x43d3('0x59')]['UserId'],'role':_0x43d3('0x5f')},'attributes':['id',_0x43d3('0x39'),_0x43d3('0x75'),'email',_0x43d3('0x81')],'raw':!![]});}return null;})['then'](function(_0x5ef658){if(!_0x5ef658)return null;_0x2e7c46[_0x43d3('0x28')][_0x43d3('0x5f')]=_0x5ef658;return _0x2e7c46;})[_0x43d3('0x36')](function(_0x239561){if(_0x239561){_0x239561[_0x43d3('0x28')][_0x43d3('0x78')]=util['format'](_0x43d3('0x82'),_0xf1cb96['user']['name']);_0x239561[_0x43d3('0x28')][_0x43d3('0x79')]=_0x2e7c46[_0x43d3('0x79')];_0x239561[_0x43d3('0x28')]['motionChannel']=_0x2e7c46['channel'];_0x239561[_0x43d3('0x28')][_0x43d3('0x7b')]='reject';respondWithRpcPromise(_0x43d3('0x7c'),_0x43d3('0x7c'),{'event':_0x43d3('0x83'),'message':_[_0x43d3('0x56')](_0x2e7c46['message'],JSON[_0x43d3('0x84')](_0x2e7c46[_0x43d3('0x68')][_0x43d3('0x85')]))},client9002);return _0x2e7c46;}return null;})['then'](respondWithResult(_0x229ab4,null))['catch'](handleError(_0x229ab4,null));};
\ No newline at end of file
+var _0xd0c4=['status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','show','include','find','body','params','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','parse','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','SIP/%s','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus'];(function(_0x255d9f,_0x558dbf){var _0x435eb4=function(_0x3ca94d){while(--_0x3ca94d){_0x255d9f['push'](_0x255d9f['shift']());}};_0x435eb4(++_0x558dbf);}(_0xd0c4,0xd9));var _0x4d0c=function(_0x149bc3,_0x4b09d8){_0x149bc3=_0x149bc3-0x0;var _0x5d33eb=_0xd0c4[_0x149bc3];return _0x5d33eb;};'use strict';var emlformat=require(_0x4d0c('0x0'));var rimraf=require(_0x4d0c('0x1'));var zipdir=require(_0x4d0c('0x2'));var jsonpatch=require(_0x4d0c('0x3'));var rp=require(_0x4d0c('0x4'));var moment=require(_0x4d0c('0x5'));var BPromise=require(_0x4d0c('0x6'));var Mustache=require('mustache');var util=require(_0x4d0c('0x7'));var path=require(_0x4d0c('0x8'));var sox=require(_0x4d0c('0x9'));var csv=require(_0x4d0c('0xa'));var ejs=require(_0x4d0c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d0c('0xc'));var crypto=require(_0x4d0c('0xd'));var jsforce=require(_0x4d0c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d0c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4d0c('0xf'));var as=require(_0x4d0c('0x10'));var hardwareService=require(_0x4d0c('0x11'));var logger=require(_0x4d0c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x4d0c('0x13'));var licenseUtil=require(_0x4d0c('0x14'));var db=require(_0x4d0c('0x15'))['db'];config[_0x4d0c('0x16')]=_[_0x4d0c('0x17')](config[_0x4d0c('0x16')],{'host':_0x4d0c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4d0c('0x19'))[_0x4d0c('0x1a')](socket);var jayson=require(_0x4d0c('0x1b'));var client=jayson[_0x4d0c('0x1c')][_0x4d0c('0x1d')]({'port':0x232c});var client9002=jayson[_0x4d0c('0x1c')][_0x4d0c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x368d82,_0x2c656c,_0x9c952,_0x4b8eb3){return new BPromise(function(_0x1a3506,_0x27df0b){var _0x3faf01=_0x4b8eb3||client;return _0x3faf01[_0x4d0c('0x1e')](_0x368d82,_0x9c952)[_0x4d0c('0x1f')](function(_0x5aba47){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2c656c,_0x4d0c('0x20'));logger[_0x4d0c('0x21')](_0x4d0c('0x22'),_0x2c656c,_0x4d0c('0x20'),JSON[_0x4d0c('0x23')](_0x5aba47));if(_0x5aba47[_0x4d0c('0x24')]){if(_0x5aba47['error']['code']===0x1f4){logger[_0x4d0c('0x24')](_0x4d0c('0x25'),_0x2c656c,_0x5aba47[_0x4d0c('0x24')][_0x4d0c('0x26')]);return _0x27df0b(_0x5aba47['error'][_0x4d0c('0x26')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x2c656c,_0x5aba47['error'][_0x4d0c('0x26')]);return _0x1a3506(_0x5aba47[_0x4d0c('0x24')][_0x4d0c('0x26')]);}else{logger[_0x4d0c('0x27')](_0x4d0c('0x25'),_0x2c656c,_0x4d0c('0x20'));_0x1a3506(_0x5aba47[_0x4d0c('0x28')][_0x4d0c('0x26')]);}})[_0x4d0c('0x29')](function(_0x1f7f35){logger['error'](_0x4d0c('0x25'),_0x2c656c,_0x1f7f35);_0x27df0b(_0x1f7f35);});});}function respondWithStatusCode(_0x1e76c9,_0x478d66){_0x478d66=_0x478d66||0xcc;return function(_0x38f86b){if(_0x38f86b){return _0x1e76c9[_0x4d0c('0x2a')](_0x478d66);}return _0x1e76c9[_0x4d0c('0x2b')](_0x478d66)[_0x4d0c('0x2c')]();};}function respondWithResult(_0x35b1ea,_0x7407f2){_0x7407f2=_0x7407f2||0xc8;return function(_0x53dd14){if(_0x53dd14){return _0x35b1ea[_0x4d0c('0x2b')](_0x7407f2)[_0x4d0c('0x2d')](_0x53dd14);}};}function respondWithFilteredResult(_0x43e0fa,_0x324186){return function(_0x13288c){if(_0x13288c){var _0xe660c=typeof _0x324186['offset']===_0x4d0c('0x2e')&&typeof _0x324186[_0x4d0c('0x2f')]==='undefined';var _0x468128=_0x13288c[_0x4d0c('0x30')];var _0x33fb28=_0xe660c?0x0:_0x324186[_0x4d0c('0x31')];var _0x2a9cd2=_0xe660c?_0x13288c[_0x4d0c('0x30')]:_0x324186[_0x4d0c('0x31')]+_0x324186['limit'];var _0x4c6619;if(_0x2a9cd2>=_0x468128){_0x2a9cd2=_0x468128;_0x4c6619=0xc8;}else{_0x4c6619=0xce;}_0x43e0fa[_0x4d0c('0x2b')](_0x4c6619);return _0x43e0fa[_0x4d0c('0x32')]('Content-Range',_0x33fb28+'-'+_0x2a9cd2+'/'+_0x468128)[_0x4d0c('0x2d')](_0x13288c);}return null;};}function patchUpdates(_0x57b569){return function(_0xaae1e6){try{jsonpatch['apply'](_0xaae1e6,_0x57b569,!![]);}catch(_0x57a8b4){return BPromise[_0x4d0c('0x33')](_0x57a8b4);}return _0xaae1e6[_0x4d0c('0x34')]();};}function saveUpdates(_0x4f6e01,_0x20f68f){return function(_0x575ea2){if(_0x575ea2){return _0x575ea2[_0x4d0c('0x35')](_0x4f6e01)['then'](function(_0x170f19){return _0x170f19;});}return null;};}function removeEntity(_0x56a080,_0x4f1515){return function(_0x3d5f29){if(_0x3d5f29){return _0x3d5f29[_0x4d0c('0x36')]()['then'](function(){_0x56a080[_0x4d0c('0x2b')](0xcc)[_0x4d0c('0x2c')]();});}};}function handleEntityNotFound(_0x14e423,_0x1cf725){return function(_0x33653e){if(!_0x33653e){_0x14e423[_0x4d0c('0x2a')](0x194);}return _0x33653e;};}function handleError(_0x37894d,_0x2d7253){_0x2d7253=_0x2d7253||0x1f4;return function(_0x4e75d8){logger[_0x4d0c('0x24')](_0x4e75d8[_0x4d0c('0x37')]);if(_0x4e75d8[_0x4d0c('0x38')]){delete _0x4e75d8['name'];}_0x37894d[_0x4d0c('0x2b')](_0x2d7253)[_0x4d0c('0x39')](_0x4e75d8);};}exports['index']=function(_0x453393,_0x592ce1){var _0x54508f={},_0x981e52={},_0x38572d={'count':0x0,'rows':[]};var _0x32c712=_[_0x4d0c('0x3a')](db[_0x4d0c('0x3b')][_0x4d0c('0x3c')],function(_0x4ad18f){return{'name':_0x4ad18f[_0x4d0c('0x3d')],'type':_0x4ad18f[_0x4d0c('0x3e')][_0x4d0c('0x3f')]};});_0x981e52['model']=_[_0x4d0c('0x3a')](_0x32c712,_0x4d0c('0x38'));_0x981e52[_0x4d0c('0x40')]=_[_0x4d0c('0x41')](_0x453393[_0x4d0c('0x40')]);_0x981e52['filters']=_[_0x4d0c('0x42')](_0x981e52[_0x4d0c('0x43')],_0x981e52['query']);_0x54508f['attributes']=_[_0x4d0c('0x42')](_0x981e52[_0x4d0c('0x43')],qs[_0x4d0c('0x44')](_0x453393[_0x4d0c('0x40')]['fields']));_0x54508f['attributes']=_0x54508f[_0x4d0c('0x45')][_0x4d0c('0x46')]?_0x54508f['attributes']:_0x981e52[_0x4d0c('0x43')];if(!_0x453393[_0x4d0c('0x40')]['hasOwnProperty'](_0x4d0c('0x47'))){_0x54508f[_0x4d0c('0x2f')]=qs[_0x4d0c('0x2f')](_0x453393['query'][_0x4d0c('0x2f')]);_0x54508f[_0x4d0c('0x31')]=qs[_0x4d0c('0x31')](_0x453393['query'][_0x4d0c('0x31')]);}_0x54508f[_0x4d0c('0x48')]=qs[_0x4d0c('0x49')](_0x453393['query'][_0x4d0c('0x49')]);_0x54508f[_0x4d0c('0x4a')]=qs['filters'](_['pick'](_0x453393[_0x4d0c('0x40')],_0x981e52[_0x4d0c('0x4b')]),_0x32c712);if(_0x453393['query'][_0x4d0c('0x4c')]){_0x54508f['where']=_['merge'](_0x54508f[_0x4d0c('0x4a')],{'$or':_[_0x4d0c('0x3a')](_0x32c712,function(_0x55ae7f){if(_0x55ae7f[_0x4d0c('0x3e')]!=='VIRTUAL'){var _0x4dce59={};_0x4dce59[_0x55ae7f[_0x4d0c('0x38')]]={'$like':'%'+_0x453393[_0x4d0c('0x40')][_0x4d0c('0x4c')]+'%'};return _0x4dce59;}})});}_0x54508f=_[_0x4d0c('0x4d')]({},_0x54508f,_0x453393[_0x4d0c('0x4e')]);var _0x5c6d68={'where':_0x54508f['where']};return db[_0x4d0c('0x3b')][_0x4d0c('0x30')](_0x5c6d68)[_0x4d0c('0x1f')](function(_0x5e2810){_0x38572d[_0x4d0c('0x30')]=_0x5e2810;if(_0x453393[_0x4d0c('0x40')][_0x4d0c('0x4f')]){_0x54508f['include']=[{'all':!![]}];}return db[_0x4d0c('0x3b')][_0x4d0c('0x50')](_0x54508f);})[_0x4d0c('0x1f')](function(_0x98c438){_0x38572d[_0x4d0c('0x51')]=_0x98c438;return _0x38572d;})['then'](respondWithFilteredResult(_0x592ce1,_0x54508f))[_0x4d0c('0x29')](handleError(_0x592ce1,null));};exports[_0x4d0c('0x52')]=function(_0x3d4dd6,_0x27fe22){var _0x3728c1={'raw':!![],'where':{'id':_0x3d4dd6['params']['id']}},_0x33e455={};_0x33e455[_0x4d0c('0x43')]=_[_0x4d0c('0x41')](db[_0x4d0c('0x3b')][_0x4d0c('0x3c')]);_0x33e455[_0x4d0c('0x40')]=_[_0x4d0c('0x41')](_0x3d4dd6['query']);_0x33e455[_0x4d0c('0x4b')]=_[_0x4d0c('0x42')](_0x33e455[_0x4d0c('0x43')],_0x33e455[_0x4d0c('0x40')]);_0x3728c1[_0x4d0c('0x45')]=_[_0x4d0c('0x42')](_0x33e455[_0x4d0c('0x43')],qs[_0x4d0c('0x44')](_0x3d4dd6[_0x4d0c('0x40')][_0x4d0c('0x44')]));_0x3728c1[_0x4d0c('0x45')]=_0x3728c1[_0x4d0c('0x45')][_0x4d0c('0x46')]?_0x3728c1['attributes']:_0x33e455[_0x4d0c('0x43')];if(_0x3d4dd6[_0x4d0c('0x40')][_0x4d0c('0x4f')]){_0x3728c1[_0x4d0c('0x53')]=[{'all':!![]}];}_0x3728c1=_[_0x4d0c('0x4d')]({},_0x3728c1,_0x3d4dd6['options']);return db['ChatMessage'][_0x4d0c('0x54')](_0x3728c1)[_0x4d0c('0x1f')](handleEntityNotFound(_0x27fe22,null))['then'](respondWithResult(_0x27fe22,null))[_0x4d0c('0x29')](handleError(_0x27fe22,null));};exports['create']=function(_0x466c09,_0x2794bc){return db[_0x4d0c('0x3b')]['create'](_0x466c09[_0x4d0c('0x55')],{})[_0x4d0c('0x1f')](respondWithResult(_0x2794bc,0xc9))[_0x4d0c('0x29')](handleError(_0x2794bc,null));};exports[_0x4d0c('0x35')]=function(_0x4885e3,_0xce0ac8){if(_0x4885e3['body']['id']){delete _0x4885e3['body']['id'];}return db['ChatMessage'][_0x4d0c('0x54')]({'where':{'id':_0x4885e3[_0x4d0c('0x56')]['id']}})[_0x4d0c('0x1f')](handleEntityNotFound(_0xce0ac8,null))[_0x4d0c('0x1f')](saveUpdates(_0x4885e3['body'],null))[_0x4d0c('0x1f')](respondWithResult(_0xce0ac8,null))[_0x4d0c('0x29')](handleError(_0xce0ac8,null));};exports[_0x4d0c('0x36')]=function(_0x5aace7,_0x416dad){return db[_0x4d0c('0x3b')][_0x4d0c('0x54')]({'where':{'id':_0x5aace7[_0x4d0c('0x56')]['id']}})[_0x4d0c('0x1f')](handleEntityNotFound(_0x416dad,null))[_0x4d0c('0x1f')](removeEntity(_0x416dad,null))[_0x4d0c('0x29')](handleError(_0x416dad,null));};exports[_0x4d0c('0x57')]=function(_0x1f9d17,_0x1f71da){return db['ChatMessage'][_0x4d0c('0x57')]()[_0x4d0c('0x1f')](respondWithResult(_0x1f71da,null))[_0x4d0c('0x29')](handleError(_0x1f71da,null));};var interaction_log=require(_0x4d0c('0x12'))(_0x4d0c('0x58'));exports[_0x4d0c('0x59')]=function(_0x329394,_0x11b88b,_0x3b67ab){var _0x304364={'agent':{},'channel':_0x4d0c('0x5a')};if(_0x329394[_0x4d0c('0x55')]['id']){delete _0x329394[_0x4d0c('0x55')]['id'];}_0x329394[_0x4d0c('0x55')][_0x4d0c('0x5b')]=!![];_0x329394[_0x4d0c('0x55')][_0x4d0c('0x5c')]=moment()[_0x4d0c('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x329394[_0x4d0c('0x55')][_0x4d0c('0x5e')]=_0x329394[_0x4d0c('0x55')][_0x4d0c('0x5e')]||_0x329394[_0x4d0c('0x5f')]['id'];_0x304364[_0x4d0c('0x60')]['id']=_0x329394[_0x4d0c('0x55')]['UserId'];return db[_0x4d0c('0x3b')][_0x4d0c('0x54')]({'where':{'id':_0x329394[_0x4d0c('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x11b88b,null))[_0x4d0c('0x1f')](saveUpdates(_0x329394[_0x4d0c('0x55')],null))[_0x4d0c('0x1f')](function(_0x3257a4){if(_0x3257a4){_0x304364[_0x4d0c('0x26')]=_0x3257a4['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x3257a4[_0x4d0c('0x61')]}});}return null;})[_0x4d0c('0x1f')](handleEntityNotFound(_0x11b88b,null))[_0x4d0c('0x1f')](function(_0x46d958){if(_0x46d958){return _0x46d958[_0x4d0c('0x35')]({'UserId':_0x329394[_0x4d0c('0x55')][_0x4d0c('0x5e')],'read1stAt':_['isNil'](_0x46d958['read1stAt'])?moment()[_0x4d0c('0x5d')](_0x4d0c('0x62')):undefined});}return null;})['then'](function(_0x494312){if(_0x494312){_0x304364['interaction']=_0x494312[_0x4d0c('0x63')]({'plain':!![]});interaction_log[_0x4d0c('0x27')](_0x4d0c('0x64'),_0x329394[_0x4d0c('0x5f')]['id'],_0x329394[_0x4d0c('0x5f')][_0x4d0c('0x38')],_0x329394[_0x4d0c('0x5f')][_0x4d0c('0x65')],_0x304364[_0x4d0c('0x66')]['id'],_0x329394[_0x4d0c('0x55')]?JSON[_0x4d0c('0x23')](_0x329394[_0x4d0c('0x55')]):_0x4d0c('0x67'));return respondWithRpcPromise(_0x4d0c('0x68'),_0x4d0c('0x69'),_0x304364);}return null;})[_0x4d0c('0x1f')](function(_0x422972){var _0x578764=_0x4d0c('0x6a')+_0x422972['message'][_0x4d0c('0x6b')];return db[_0x4d0c('0x6c')][_0x4d0c('0x40')](_0x578764,{'type':db['Sequelize'][_0x4d0c('0x6d')][_0x4d0c('0x6e')],'raw':!![]})['then'](function(_0x587dfb){return _0x587dfb;});})[_0x4d0c('0x1f')](function(_0x5d919d){if(_0x5d919d){_0x304364[_0x4d0c('0x26')][_0x4d0c('0x6f')]=_0x5d919d[0x0];if(!_0x329394[_0x4d0c('0x55')][_0x4d0c('0x5e')])return;return db[_0x4d0c('0x70')]['find']({'where':{'id':_0x329394[_0x4d0c('0x55')][_0x4d0c('0x5e')],'role':_0x4d0c('0x60')},'attributes':['id','name',_0x4d0c('0x71'),_0x4d0c('0x72'),_0x4d0c('0x73')],'raw':!![]});}return null;})[_0x4d0c('0x1f')](function(_0x434e3e){if(!_0x434e3e)return null;_0x304364[_0x4d0c('0x26')]['agent']=_0x434e3e;return _0x304364;})[_0x4d0c('0x1f')](function(_0x3dd49b){if(_0x3dd49b){if(_0x329394[_0x4d0c('0x55')][_0x4d0c('0x74')]){_0x304364[_0x4d0c('0x26')][_0x4d0c('0x75')]=util[_0x4d0c('0x5d')]('SIP/%s',_0x329394[_0x4d0c('0x5f')][_0x4d0c('0x38')]);_0x304364[_0x4d0c('0x26')][_0x4d0c('0x76')]=_0x304364[_0x4d0c('0x76')];_0x304364[_0x4d0c('0x26')][_0x4d0c('0x77')]=_0x304364[_0x4d0c('0x76')];_0x304364[_0x4d0c('0x26')]['event']=_0x4d0c('0x59');return respondWithRpcPromise(_0x4d0c('0x78'),_0x4d0c('0x78'),{'event':_0x4d0c('0x79'),'message':_[_0x4d0c('0x4d')](_0x304364[_0x4d0c('0x26')],JSON[_0x4d0c('0x7a')](_0x304364[_0x4d0c('0x66')]['formData']))},client9002)[_0x4d0c('0x1f')](function(){return _0x304364;});}return _0x304364;}return null;})[_0x4d0c('0x1f')](respondWithResult(_0x11b88b,null))[_0x4d0c('0x29')](handleError(_0x11b88b,null));};var interaction_log=require(_0x4d0c('0x12'))(_0x4d0c('0x58'));exports[_0x4d0c('0x33')]=function(_0x51f73d,_0x17b29a,_0x3f53b2){var _0x2521d4={'agent':{},'channel':_0x4d0c('0x5a')};if(_0x51f73d['body']['id']){delete _0x51f73d[_0x4d0c('0x55')]['id'];}_0x51f73d[_0x4d0c('0x55')][_0x4d0c('0x5e')]=_0x51f73d[_0x4d0c('0x55')][_0x4d0c('0x5e')]||_0x51f73d['user']['id'];_0x2521d4[_0x4d0c('0x60')]['id']=_0x51f73d['body'][_0x4d0c('0x5e')];return db[_0x4d0c('0x3b')][_0x4d0c('0x54')]({'where':{'id':_0x51f73d[_0x4d0c('0x56')]['id'],'UserId':null}})[_0x4d0c('0x1f')](handleEntityNotFound(_0x17b29a,null))['then'](function(_0x3a0539){if(_0x3a0539){_0x2521d4[_0x4d0c('0x26')]=_0x3a0539[_0x4d0c('0x63')]({'plain':!![]});return db[_0x4d0c('0x7b')]['find']({'where':{'id':_0x3a0539['ChatInteractionId']}});}return null;})[_0x4d0c('0x1f')](handleEntityNotFound(_0x17b29a,null))['then'](function(_0x7d29db){if(_0x7d29db){_0x2521d4[_0x4d0c('0x66')]=_0x7d29db[_0x4d0c('0x63')]({'plain':!![]});interaction_log['info'](_0x4d0c('0x7c'),_0x51f73d[_0x4d0c('0x5f')]['id'],_0x51f73d[_0x4d0c('0x5f')][_0x4d0c('0x38')],_0x51f73d['user'][_0x4d0c('0x65')],_0x2521d4[_0x4d0c('0x66')]['id'],_0x51f73d['body']?JSON[_0x4d0c('0x23')](_0x51f73d[_0x4d0c('0x55')]):_0x4d0c('0x67'));return respondWithRpcPromise(_0x4d0c('0x7d'),'rejectMessage',_0x2521d4);}return null;})['then'](function(_0x27c468){var _0x207f45='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x27c468[_0x4d0c('0x26')][_0x4d0c('0x6b')];return db[_0x4d0c('0x6c')][_0x4d0c('0x40')](_0x207f45,{'type':db[_0x4d0c('0x7e')][_0x4d0c('0x6d')][_0x4d0c('0x6e')],'raw':!![]})['then'](function(_0x17360c){return _0x17360c;});})[_0x4d0c('0x1f')](function(_0xe60750){if(_0xe60750){_0x2521d4[_0x4d0c('0x26')][_0x4d0c('0x6f')]=_0xe60750[0x0];if(!_0x51f73d['body'][_0x4d0c('0x5e')])return;return db[_0x4d0c('0x70')][_0x4d0c('0x54')]({'where':{'id':_0x51f73d[_0x4d0c('0x55')][_0x4d0c('0x5e')],'role':'agent'},'attributes':['id',_0x4d0c('0x38'),'fullname',_0x4d0c('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x235260){if(!_0x235260)return null;_0x2521d4[_0x4d0c('0x26')][_0x4d0c('0x60')]=_0x235260;return _0x2521d4;})[_0x4d0c('0x1f')](function(_0x508d96){if(_0x508d96){_0x508d96[_0x4d0c('0x26')]['interface']=util[_0x4d0c('0x5d')](_0x4d0c('0x7f'),_0x51f73d[_0x4d0c('0x5f')][_0x4d0c('0x38')]);_0x508d96[_0x4d0c('0x26')]['channel']=_0x2521d4[_0x4d0c('0x76')];_0x508d96['message']['motionChannel']=_0x2521d4['channel'];_0x508d96[_0x4d0c('0x26')][_0x4d0c('0x80')]=_0x4d0c('0x33');respondWithRpcPromise(_0x4d0c('0x78'),_0x4d0c('0x78'),{'event':_0x4d0c('0x81'),'message':_[_0x4d0c('0x4d')](_0x2521d4['message'],JSON[_0x4d0c('0x7a')](_0x2521d4[_0x4d0c('0x66')]['formData']))},client9002);return _0x2521d4;}return null;})[_0x4d0c('0x1f')](respondWithResult(_0x17b29a,null))[_0x4d0c('0x29')](handleError(_0x17b29a,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 8150a59..0523f06 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 _0xfcec=['emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x301494,_0x1934ad){var _0x2ff6c4=function(_0x3ccf95){while(--_0x3ccf95){_0x301494['push'](_0x301494['shift']());}};_0x2ff6c4(++_0x1934ad);}(_0xfcec,0x108));var _0xcfce=function(_0x4a3e45,_0x1e8ef3){_0x4a3e45=_0x4a3e45-0x0;var _0x48db76=_0xfcec[_0x4a3e45];return _0x48db76;};'use strict';var EventEmitter=require(_0xcfce('0x0'));var ChatMessage=require(_0xcfce('0x1'))['db'][_0xcfce('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xcfce('0x3')](0x0);var events={'afterCreate':_0xcfce('0x4'),'afterUpdate':_0xcfce('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a97a7){return function(_0x111628,_0x249219,_0x40f7b1){ChatMessageEvents[_0xcfce('0x6')](_0x2a97a7+':'+_0x111628['id'],_0x111628);ChatMessageEvents[_0xcfce('0x6')](_0x2a97a7,_0x111628);_0x40f7b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xcfce('0x7')](e,emitEvent(event));}}module[_0xcfce('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xc501=['save','remove','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc501,0x64));var _0x1c50=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0xc501[_0x2c5255];return _0x30d0ea;};'use strict';var EventEmitter=require(_0x1c50('0x0'));var ChatMessage=require(_0x1c50('0x1'))['db'][_0x1c50('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1c50('0x3')](0x0);var events={'afterCreate':_0x1c50('0x4'),'afterUpdate':'update','afterDestroy':_0x1c50('0x5')};function emitEvent(_0x27af38){return function(_0x3d1a13,_0x48791f,_0x271ec2){ChatMessageEvents['emit'](_0x27af38+':'+_0x3d1a13['id'],_0x3d1a13);ChatMessageEvents['emit'](_0x27af38,_0x3d1a13);_0x271ec2(null);};}for(var e in events){if(events[_0x1c50('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x1c50('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index b5a8be7..c11ac62 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 _0x76cb=['findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x581baa,_0x1a6cf8){var _0x4f9d02=function(_0x30498e){while(--_0x30498e){_0x581baa['push'](_0x581baa['shift']());}};_0x4f9d02(++_0x1a6cf8);}(_0x76cb,0x129));var _0xb76c=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0x76cb[_0x15a634];return _0xf4f7a0;};'use strict';var _=require(_0xb76c('0x0'));var util=require(_0xb76c('0x1'));var logger=require(_0xb76c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb76c('0x3'));var fs=require('fs');var path=require(_0xb76c('0x4'));var rimraf=require(_0xb76c('0x5'));var config=require('../../config/environment');var attributes=require(_0xb76c('0x6'));module[_0xb76c('0x7')]=function(_0x485111,_0x3d39e5){return _0x485111[_0xb76c('0x8')](_0xb76c('0x9'),attributes,{'tableName':_0xb76c('0xa'),'paranoid':![],'indexes':[{'name':_0xb76c('0xb'),'fields':[_0xb76c('0xc')],'type':_0xb76c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d1ac3,_0x5c07b4,_0x198554){var _0x741581=_0x485111[_0xb76c('0xe')];var _0x3fce99=_0x3d1ac3[_0xb76c('0xf')]({'plain':!![]});if(_0x3fce99[_0xb76c('0x10')]['toLowerCase']()==='in'||_0x3fce99[_0xb76c('0x10')][_0xb76c('0x11')]()===_0xb76c('0x12')&&!_0x3fce99[_0xb76c('0x13')]&&!_[_0xb76c('0x14')](_0x3fce99[_0xb76c('0x15')])){_0x741581['ChatInteraction'][_0xb76c('0x16')]({'where':{'id':_0x3fce99[_0xb76c('0x17')]}})[_0xb76c('0x18')](function(_0x3862a8){if(_0x3862a8){_0x3862a8['update']({'lastMsgAt':_0x3fce99[_0xb76c('0x19')],'lastMsgDirection':_0x3fce99[_0xb76c('0x10')][_0xb76c('0x11')]()});}})[_0xb76c('0x1a')](function(_0x186859){console[_0xb76c('0x1b')](_0x186859);});}_0x198554();}},'charset':'utf8mb4','collate':_0xb76c('0x1c')});};
\ No newline at end of file
+var _0x1d9d=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x333a60,_0x201ccf){var _0x21e8c2=function(_0x2fbac3){while(--_0x2fbac3){_0x333a60['push'](_0x333a60['shift']());}};_0x21e8c2(++_0x201ccf);}(_0x1d9d,0x6d));var _0xd1d9=function(_0x3fd38f,_0x5c31e2){_0x3fd38f=_0x3fd38f-0x0;var _0x15afd0=_0x1d9d[_0x3fd38f];return _0x15afd0;};'use strict';var _=require(_0xd1d9('0x0'));var util=require(_0xd1d9('0x1'));var logger=require(_0xd1d9('0x2'))('api');var moment=require(_0xd1d9('0x3'));var BPromise=require(_0xd1d9('0x4'));var rp=require(_0xd1d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d9('0x6'));var config=require(_0xd1d9('0x7'));var attributes=require(_0xd1d9('0x8'));module[_0xd1d9('0x9')]=function(_0x5cc987,_0x286cd0){return _0x5cc987[_0xd1d9('0xa')](_0xd1d9('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xd1d9('0xc'),'fields':[_0xd1d9('0xd')],'type':_0xd1d9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e1b9e,_0x536d32,_0x105a4f){var _0x5132ef=_0x5cc987['models'];var _0x39f3c7=_0x1e1b9e[_0xd1d9('0xf')]({'plain':!![]});if(_0x39f3c7[_0xd1d9('0x10')]['toLowerCase']()==='in'||_0x39f3c7[_0xd1d9('0x10')][_0xd1d9('0x11')]()===_0xd1d9('0x12')&&!_0x39f3c7['secret']&&!_['isNil'](_0x39f3c7['UserId'])){_0x5132ef[_0xd1d9('0x13')][_0xd1d9('0x14')]({'where':{'id':_0x39f3c7[_0xd1d9('0x15')]}})[_0xd1d9('0x16')](function(_0x45c88c){if(_0x45c88c){_0x45c88c['update']({'lastMsgAt':_0x39f3c7[_0xd1d9('0x17')],'lastMsgDirection':_0x39f3c7['direction'][_0xd1d9('0x11')]()});}})[_0xd1d9('0x18')](function(_0x42df45){console[_0xd1d9('0x19')](_0x42df45);});}_0x105a4f();}},'charset':_0xd1d9('0x1a'),'collate':_0xd1d9('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index cd6c66f..e27c4cf 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 _0xe155=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','ChatMessage','create','options','raw','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0xe155,0xcf));var _0x5e15=function(_0x34e5cf,_0x3bf4b9){_0x34e5cf=_0x34e5cf-0x0;var _0x3cc62e=_0xe155[_0x34e5cf];return _0x3cc62e;};'use strict';var _=require(_0x5e15('0x0'));var util=require(_0x5e15('0x1'));var moment=require(_0x5e15('0x2'));var BPromise=require(_0x5e15('0x3'));var rs=require(_0x5e15('0x4'));var fs=require('fs');var Redis=require(_0x5e15('0x5'));var db=require(_0x5e15('0x6'))['db'];var utils=require(_0x5e15('0x7'));var logger=require(_0x5e15('0x8'))(_0x5e15('0x9'));var config=require(_0x5e15('0xa'));var jayson=require(_0x5e15('0xb'));var client=jayson[_0x5e15('0xc')][_0x5e15('0xd')]({'port':0x232a});config[_0x5e15('0xe')]=_[_0x5e15('0xf')](config[_0x5e15('0xe')],{'host':_0x5e15('0x10'),'port':0x18eb});var socket=require(_0x5e15('0x11'))(new Redis(config[_0x5e15('0xe')]));require('./chatMessage.socket')[_0x5e15('0x12')](socket);function respondWithRpcPromise(_0x301517,_0x3a8909,_0x99b4f6){return new BPromise(function(_0x412d49,_0x242048){return client[_0x5e15('0x13')](_0x301517,_0x99b4f6)[_0x5e15('0x14')](function(_0x9dde34){logger[_0x5e15('0x15')](_0x5e15('0x16'),_0x3a8909,'request\x20sent');logger[_0x5e15('0x17')](_0x5e15('0x18'),_0x3a8909,'request\x20sent',JSON[_0x5e15('0x19')](_0x9dde34));if(_0x9dde34[_0x5e15('0x1a')]){if(_0x9dde34['error']['code']===0x1f4){logger[_0x5e15('0x1a')](_0x5e15('0x16'),_0x3a8909,_0x9dde34[_0x5e15('0x1a')][_0x5e15('0x1b')]);return _0x242048(_0x9dde34[_0x5e15('0x1a')]['message']);}logger[_0x5e15('0x1a')](_0x5e15('0x16'),_0x3a8909,_0x9dde34[_0x5e15('0x1a')]['message']);return _0x412d49(_0x9dde34[_0x5e15('0x1a')][_0x5e15('0x1b')]);}else{logger[_0x5e15('0x15')](_0x5e15('0x16'),_0x3a8909,_0x5e15('0x1c'));_0x412d49(_0x9dde34[_0x5e15('0x1d')][_0x5e15('0x1b')]);}})[_0x5e15('0x1e')](function(_0x260c56){logger[_0x5e15('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x3a8909,_0x260c56);_0x242048(_0x260c56);});});}exports['CreateChatMessage']=function(_0x17c4cc){var _0xda7c63=this;return new Promise(function(_0x2d9723,_0x224f84){return db[_0x5e15('0x1f')][_0x5e15('0x20')](_0x17c4cc['body'],{'raw':_0x17c4cc[_0x5e15('0x21')]?_0x17c4cc['options'][_0x5e15('0x22')]===undefined?!![]:![]:!![]})[_0x5e15('0x14')](function(_0xf17a2c){logger[_0x5e15('0x15')]('CreateChatMessage',_0x17c4cc);logger[_0x5e15('0x17')](_0x5e15('0x23'),_0x17c4cc,JSON[_0x5e15('0x19')](_0xf17a2c));_0x2d9723(_0xf17a2c);})['catch'](function(_0x163060){logger[_0x5e15('0x1a')](_0x5e15('0x23'),_0x163060[_0x5e15('0x1b')],_0x17c4cc);_0x224f84(_0xda7c63['error'](0x1f4,_0x163060[_0x5e15('0x1b')]));});});};
\ No newline at end of file
+var _0x5439=['moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash'];(function(_0x403580,_0x353dd3){var _0x18f0cf=function(_0x3f5ee4){while(--_0x3f5ee4){_0x403580['push'](_0x403580['shift']());}};_0x18f0cf(++_0x353dd3);}(_0x5439,0x1ef));var _0x9543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5439[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9543('0x0'));var util=require('util');var moment=require(_0x9543('0x1'));var BPromise=require(_0x9543('0x2'));var rs=require(_0x9543('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9543('0x4'));var logger=require(_0x9543('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9543('0x6'));var client=jayson[_0x9543('0x7')][_0x9543('0x8')]({'port':0x232a});config[_0x9543('0x9')]=_[_0x9543('0xa')](config[_0x9543('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9543('0xb'))(new Redis(config[_0x9543('0x9')]));require(_0x9543('0xc'))['register'](socket);function respondWithRpcPromise(_0x2d62a1,_0x3ea8e6,_0x8c8b9f){return new BPromise(function(_0x496dec,_0x3cc885){return client[_0x9543('0xd')](_0x2d62a1,_0x8c8b9f)[_0x9543('0xe')](function(_0xfe3681){logger['info'](_0x9543('0xf'),_0x3ea8e6,_0x9543('0x10'));logger[_0x9543('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3ea8e6,_0x9543('0x10'),JSON[_0x9543('0x12')](_0xfe3681));if(_0xfe3681[_0x9543('0x13')]){if(_0xfe3681['error'][_0x9543('0x14')]===0x1f4){logger[_0x9543('0x13')](_0x9543('0xf'),_0x3ea8e6,_0xfe3681['error'][_0x9543('0x15')]);return _0x3cc885(_0xfe3681['error'][_0x9543('0x15')]);}logger[_0x9543('0x13')](_0x9543('0xf'),_0x3ea8e6,_0xfe3681[_0x9543('0x13')][_0x9543('0x15')]);return _0x496dec(_0xfe3681['error'][_0x9543('0x15')]);}else{logger[_0x9543('0x16')](_0x9543('0xf'),_0x3ea8e6,'request\x20sent');_0x496dec(_0xfe3681[_0x9543('0x17')][_0x9543('0x15')]);}})[_0x9543('0x18')](function(_0x2beae4){logger[_0x9543('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3ea8e6,_0x2beae4);_0x3cc885(_0x2beae4);});});}exports['CreateChatMessage']=function(_0x5d5df8){var _0x345ed9=this;return new Promise(function(_0x49a6c0,_0x589b41){return db[_0x9543('0x19')][_0x9543('0x1a')](_0x5d5df8[_0x9543('0x1b')],{'raw':_0x5d5df8['options']?_0x5d5df8[_0x9543('0x1c')][_0x9543('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x32a25c){logger[_0x9543('0x16')]('CreateChatMessage',_0x5d5df8);logger['debug']('CreateChatMessage',_0x5d5df8,JSON['stringify'](_0x32a25c));_0x49a6c0(_0x32a25c);})[_0x9543('0x18')](function(_0x3e8a47){logger[_0x9543('0x13')](_0x9543('0x1e'),_0x3e8a47[_0x9543('0x15')],_0x5d5df8);_0x589b41(_0x345ed9[_0x9543('0x13')](0x1f4,_0x3e8a47[_0x9543('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ed55483..db4886d 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 _0x7118=['length','chatMessage:','remove','update','emit','removeListener','register'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0x7118,0x159));var _0x8711=function(_0x16ad5e,_0x224def){_0x16ad5e=_0x16ad5e-0x0;var _0x314c70=_0x7118[_0x16ad5e];return _0x314c70;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x8711('0x0'),_0x8711('0x1')];function createListener(_0x5c64d4,_0x1758c5){return function(_0x3ea36f){_0x1758c5[_0x8711('0x2')](_0x5c64d4,_0x3ea36f);};}function removeListener(_0x259c36,_0x12496b){return function(){ChatMessageEvents[_0x8711('0x3')](_0x259c36,_0x12496b);};}exports[_0x8711('0x4')]=function(_0x54885e){for(var _0x385033=0x0,_0x2244c2=events[_0x8711('0x5')];_0x385033<_0x2244c2;_0x385033++){var _0x3d82f2=events[_0x385033];var _0x189349=createListener(_0x8711('0x6')+_0x3d82f2,_0x54885e);ChatMessageEvents['on'](_0x3d82f2,_0x189349);}};
\ No newline at end of file
+var _0xee14=['length','chatMessage:','remove','update','emit','removeListener'];(function(_0x132b71,_0x25f23e){var _0x224664=function(_0x1f9e23){while(--_0x1f9e23){_0x132b71['push'](_0x132b71['shift']());}};_0x224664(++_0x25f23e);}(_0xee14,0x13a));var _0x4ee1=function(_0x1e3c5e,_0x5252b1){_0x1e3c5e=_0x1e3c5e-0x0;var _0x4d9e35=_0xee14[_0x1e3c5e];return _0x4d9e35;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x4ee1('0x0'),_0x4ee1('0x1')];function createListener(_0x34e49d,_0x1fa407){return function(_0x18e3c4){_0x1fa407[_0x4ee1('0x2')](_0x34e49d,_0x18e3c4);};}function removeListener(_0x34a0ae,_0x1e5fb6){return function(){ChatMessageEvents[_0x4ee1('0x3')](_0x34a0ae,_0x1e5fb6);};}exports['register']=function(_0xba6d36){for(var _0x573700=0x0,_0x327c18=events[_0x4ee1('0x4')];_0x573700<_0x327c18;_0x573700++){var _0x187656=events[_0x573700];var _0x293d5f=createListener(_0x4ee1('0x5')+_0x187656,_0xba6d36);ChatMessageEvents['on'](_0x187656,_0x293d5f);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 7a2a8db..50c3e00 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 _0x00b1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path'];(function(_0x3cd451,_0x26e81a){var _0x571ce6=function(_0x27af9e){while(--_0x27af9e){_0x3cd451['push'](_0x3cd451['shift']());}};_0x571ce6(++_0x26e81a);}(_0x00b1,0x1d9));var _0x100b=function(_0x200585,_0x2878c8){_0x200585=_0x200585-0x0;var _0x44a661=_0x00b1[_0x200585];return _0x44a661;};'use strict';var multer=require(_0x100b('0x0'));var util=require('util');var path=require(_0x100b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x100b('0x2')]();var fs_extra=require(_0x100b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x100b('0x4'));var config=require(_0x100b('0x5'));var controller=require(_0x100b('0x6'));router[_0x100b('0x7')]('/',auth[_0x100b('0x8')](),controller[_0x100b('0x9')]);router[_0x100b('0x7')](_0x100b('0xa'),auth['isAuthenticated'](),controller[_0x100b('0xb')]);router['get'](_0x100b('0xc'),auth[_0x100b('0x8')](),controller[_0x100b('0xd')]);router[_0x100b('0xe')]('/',auth[_0x100b('0x8')](),interaction[_0x100b('0xf')](_0x100b('0x10'),_0x100b('0x11')),controller['create']);router['put']('/:id',controller['update']);router[_0x100b('0x12')](_0x100b('0x13'),auth[_0x100b('0x8')](),controller[_0x100b('0x14')]);router[_0x100b('0x12')](_0x100b('0x15'),auth[_0x100b('0x8')](),controller[_0x100b('0x16')]);router[_0x100b('0x17')](_0x100b('0xc'),auth[_0x100b('0x8')](),controller[_0x100b('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x10f9=['isAuthenticated','describe','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get'];(function(_0x240167,_0x38a99c){var _0x292a01=function(_0x19710b){while(--_0x19710b){_0x240167['push'](_0x240167['shift']());}};_0x292a01(++_0x38a99c);}(_0x10f9,0x148));var _0x910f=function(_0x4adbdb,_0x3ff3c7){_0x4adbdb=_0x4adbdb-0x0;var _0x59966b=_0x10f9[_0x4adbdb];return _0x59966b;};'use strict';var multer=require(_0x910f('0x0'));var util=require('util');var path=require(_0x910f('0x1'));var timeout=require(_0x910f('0x2'));var express=require(_0x910f('0x3'));var router=express[_0x910f('0x4')]();var fs_extra=require(_0x910f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x910f('0x6'));var config=require(_0x910f('0x7'));var controller=require(_0x910f('0x8'));router[_0x910f('0x9')]('/',auth[_0x910f('0xa')](),controller['index']);router[_0x910f('0x9')]('/describe',auth[_0x910f('0xa')](),controller[_0x910f('0xb')]);router['get'](_0x910f('0xc'),auth[_0x910f('0xa')](),controller[_0x910f('0xd')]);router[_0x910f('0xe')]('/',auth[_0x910f('0xa')](),interaction[_0x910f('0xf')]('chat',_0x910f('0x10')),controller[_0x910f('0x11')]);router[_0x910f('0x12')]('/:id',controller[_0x910f('0x13')]);router[_0x910f('0x12')](_0x910f('0x14'),auth[_0x910f('0xa')](),controller['accept']);router['put'](_0x910f('0x15'),auth['isAuthenticated'](),controller[_0x910f('0x16')]);router[_0x910f('0x17')](_0x910f('0xc'),auth[_0x910f('0xa')](),controller[_0x910f('0x18')]);module[_0x910f('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 34d57d1..cb4c6d2 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 _0x757a=['exports','TEXT'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x757a,0xde));var _0xa757=function(_0xfd37d6,_0x4e844a){_0xfd37d6=_0xfd37d6-0x0;var _0xab9f9=_0x757a[_0xfd37d6];return _0xab9f9;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x757a=['exports','TEXT'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x757a,0xde));var _0xa757=function(_0x31df51,_0x2d54b4){_0x31df51=_0x31df51-0x0;var _0x1d3e0e=_0x757a[_0x31df51];return _0x1d3e0e;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index c353e49..571faac 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5824e0,_0x394157){var _0x7a610d=function(_0x509af7){while(--_0x509af7){_0x5824e0['push'](_0x5824e0['shift']());}};_0x7a610d(++_0x394157);}(_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
+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(_0x2cca5d,_0x117d96){var _0x507c48=function(_0x255c38){while(--_0x255c38){_0x2cca5d['push'](_0x2cca5d['shift']());}};_0x507c48(++_0x117d96);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 c3180e2..5553fbe 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 _0xc8e0=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x57402d,_0x3ebd30){var _0x224071=function(_0x5c8d23){while(--_0x5c8d23){_0x57402d['push'](_0x57402d['shift']());}};_0x224071(++_0x3ebd30);}(_0xc8e0,0xb7));var _0x0c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e0[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0c8e('0x0'));var ChatOfflineMessage=require(_0x0c8e('0x1'))['db'][_0x0c8e('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x0c8e('0x3')](0x0);var events={'afterCreate':_0x0c8e('0x4'),'afterUpdate':_0x0c8e('0x5'),'afterDestroy':_0x0c8e('0x6')};function emitEvent(_0x1334ab){return function(_0x19af18,_0x13dfb9,_0x5668c0){ChatOfflineMessageEvents[_0x0c8e('0x7')](_0x1334ab+':'+_0x19af18['id'],_0x19af18);ChatOfflineMessageEvents[_0x0c8e('0x7')](_0x1334ab,_0x19af18);_0x5668c0(null);};}for(var e in events){if(events[_0x0c8e('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x0c8e('0x9')](e,emitEvent(event));}}module[_0x0c8e('0xa')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x33de=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x3f5155,_0x13cc8f){var _0x5a8d5a=function(_0x3a47d1){while(--_0x3a47d1){_0x3f5155['push'](_0x3f5155['shift']());}};_0x5a8d5a(++_0x13cc8f);}(_0x33de,0x14b));var _0xe33d=function(_0x59820d,_0xc8e6ba){_0x59820d=_0x59820d-0x0;var _0x3c72b1=_0x33de[_0x59820d];return _0x3c72b1;};'use strict';var EventEmitter=require(_0xe33d('0x0'));var ChatOfflineMessage=require(_0xe33d('0x1'))['db'][_0xe33d('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe33d('0x3')](0x0);var events={'afterCreate':_0xe33d('0x4'),'afterUpdate':_0xe33d('0x5'),'afterDestroy':_0xe33d('0x6')};function emitEvent(_0x3bd5ec){return function(_0x84395f,_0x451e5a,_0xb4d96){ChatOfflineMessageEvents['emit'](_0x3bd5ec+':'+_0x84395f['id'],_0x84395f);ChatOfflineMessageEvents[_0xe33d('0x7')](_0x3bd5ec,_0x84395f);_0xb4d96(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xe33d('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index bacc681..615f64b 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 _0xb32f=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb32f,0x17a));var _0xfb32=function(_0x1a1e42,_0x45b0d9){_0x1a1e42=_0x1a1e42-0x0;var _0x409105=_0xb32f[_0x1a1e42];return _0x409105;};'use strict';var attributes=require(_0xfb32('0x0'));module[_0xfb32('0x1')]=function(_0x159b5a){return _0x159b5a[_0xfb32('0x2')](_0xfb32('0x3'),attributes,{'tableName':_0xfb32('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfb32('0x5'),'collate':_0xfb32('0x6')});};
\ No newline at end of file
+var _0x5c70=['ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes','exports','define'];(function(_0x3439bc,_0xc03879){var _0x484801=function(_0x39d69f){while(--_0x39d69f){_0x3439bc['push'](_0x3439bc['shift']());}};_0x484801(++_0xc03879);}(_0x5c70,0x11f));var _0x05c7=function(_0x3ac76f,_0x46494c){_0x3ac76f=_0x3ac76f-0x0;var _0x178ae0=_0x5c70[_0x3ac76f];return _0x178ae0;};'use strict';var attributes=require(_0x05c7('0x0'));module[_0x05c7('0x1')]=function(_0x463380){return _0x463380[_0x05c7('0x2')](_0x05c7('0x3'),attributes,{'tableName':_0x05c7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 38eb0da..7f014c1 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 _0xde8a=['info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1f4c1f,_0x19ff7f){var _0x56ef12=function(_0x36b24a){while(--_0x36b24a){_0x1f4c1f['push'](_0x1f4c1f['shift']());}};_0x56ef12(++_0x19ff7f);}(_0xde8a,0x107));var _0xade8=function(_0x13e784,_0x175ae9){_0x13e784=_0x13e784-0x0;var _0x1ecb5a=_0xde8a[_0x13e784];return _0x1ecb5a;};'use strict';var _=require('lodash');var util=require(_0xade8('0x0'));var moment=require(_0xade8('0x1'));var BPromise=require(_0xade8('0x2'));var rs=require(_0xade8('0x3'));var fs=require('fs');var Redis=require(_0xade8('0x4'));var db=require(_0xade8('0x5'))['db'];var utils=require(_0xade8('0x6'));var logger=require('../../config/logger')(_0xade8('0x7'));var config=require(_0xade8('0x8'));var jayson=require(_0xade8('0x9'));var client=jayson[_0xade8('0xa')][_0xade8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8657e8,_0x187293,_0x4a0425){return new BPromise(function(_0x2e3e61,_0x12db41){return client['request'](_0x8657e8,_0x4a0425)[_0xade8('0xc')](function(_0x284427){logger[_0xade8('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x187293,'request\x20sent');logger[_0xade8('0xe')](_0xade8('0xf'),_0x187293,_0xade8('0x10'),JSON[_0xade8('0x11')](_0x284427));if(_0x284427[_0xade8('0x12')]){if(_0x284427[_0xade8('0x12')][_0xade8('0x13')]===0x1f4){logger[_0xade8('0x12')](_0xade8('0x14'),_0x187293,_0x284427[_0xade8('0x12')][_0xade8('0x15')]);return _0x12db41(_0x284427[_0xade8('0x12')][_0xade8('0x15')]);}logger[_0xade8('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x187293,_0x284427[_0xade8('0x12')]['message']);return _0x2e3e61(_0x284427[_0xade8('0x12')]['message']);}else{logger[_0xade8('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x187293,'request\x20sent');_0x2e3e61(_0x284427[_0xade8('0x16')][_0xade8('0x15')]);}})['catch'](function(_0x4aea85){logger[_0xade8('0x12')](_0xade8('0x14'),_0x187293,_0x4aea85);_0x12db41(_0x4aea85);});});}
\ No newline at end of file
+var _0x6408=['jayson/promise','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1b6f54,_0x17109a){var _0x5ae1c9=function(_0x384a94){while(--_0x384a94){_0x1b6f54['push'](_0x1b6f54['shift']());}};_0x5ae1c9(++_0x17109a);}(_0x6408,0x194));var _0x8640=function(_0x46608c,_0x4bb7a2){_0x46608c=_0x46608c-0x0;var _0x168a0c=_0x6408[_0x46608c];return _0x168a0c;};'use strict';var _=require(_0x8640('0x0'));var util=require(_0x8640('0x1'));var moment=require(_0x8640('0x2'));var BPromise=require(_0x8640('0x3'));var rs=require(_0x8640('0x4'));var fs=require('fs');var Redis=require(_0x8640('0x5'));var db=require(_0x8640('0x6'))['db'];var utils=require(_0x8640('0x7'));var logger=require(_0x8640('0x8'))(_0x8640('0x9'));var config=require('../../config/environment');var jayson=require(_0x8640('0xa'));var client=jayson[_0x8640('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9083,_0x44d634,_0x52c497){return new BPromise(function(_0x40b941,_0x5113d8){return client['request'](_0x1b9083,_0x52c497)[_0x8640('0xc')](function(_0x590034){logger[_0x8640('0xd')](_0x8640('0xe'),_0x44d634,'request\x20sent');logger[_0x8640('0xf')](_0x8640('0x10'),_0x44d634,_0x8640('0x11'),JSON[_0x8640('0x12')](_0x590034));if(_0x590034[_0x8640('0x13')]){if(_0x590034[_0x8640('0x13')]['code']===0x1f4){logger['error'](_0x8640('0xe'),_0x44d634,_0x590034[_0x8640('0x13')][_0x8640('0x14')]);return _0x5113d8(_0x590034[_0x8640('0x13')]['message']);}logger[_0x8640('0x13')](_0x8640('0xe'),_0x44d634,_0x590034[_0x8640('0x13')][_0x8640('0x14')]);return _0x40b941(_0x590034[_0x8640('0x13')][_0x8640('0x14')]);}else{logger['info'](_0x8640('0xe'),_0x44d634,_0x8640('0x11'));_0x40b941(_0x590034[_0x8640('0x15')][_0x8640('0x14')]);}})[_0x8640('0x16')](function(_0x15ac1b){logger['error'](_0x8640('0xe'),_0x44d634,_0x15ac1b);_0x5113d8(_0x15ac1b);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 3372ba0..3ddb88c 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 _0x57c3=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','delete','destroy','util','express'];(function(_0x2b9885,_0x2ab1ab){var _0x136a82=function(_0x28b328){while(--_0x28b328){_0x2b9885['push'](_0x2b9885['shift']());}};_0x136a82(++_0x2ab1ab);}(_0x57c3,0xb2));var _0x357c=function(_0x15f344,_0xcfdee8){_0x15f344=_0x15f344-0x0;var _0x2de358=_0x57c3[_0x15f344];return _0x2de358;};'use strict';var multer=require('multer');var util=require(_0x357c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x357c('0x1'));var router=express[_0x357c('0x2')]();var fs_extra=require(_0x357c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x357c('0x4'));var config=require(_0x357c('0x5'));var controller=require(_0x357c('0x6'));router[_0x357c('0x7')]('/',auth[_0x357c('0x8')](),controller[_0x357c('0x9')]);router[_0x357c('0x7')](_0x357c('0xa'),auth[_0x357c('0x8')](),controller[_0x357c('0xb')]);router[_0x357c('0x7')]('/:id',auth[_0x357c('0x8')](),controller['show']);router['post']('/',auth[_0x357c('0x8')](),controller[_0x357c('0xc')]);router[_0x357c('0xd')](_0x357c('0xe'),auth['isAuthenticated'](),controller[_0x357c('0xf')]);router[_0x357c('0x10')]('/:id',auth[_0x357c('0x8')](),controller[_0x357c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x656b=['fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','create','update','destroy','multer','connect-timeout','Router'];(function(_0x1aa883,_0x50f53b){var _0x5e9fb5=function(_0x5558f1){while(--_0x5558f1){_0x1aa883['push'](_0x1aa883['shift']());}};_0x5e9fb5(++_0x50f53b);}(_0x656b,0x1dd));var _0xb656=function(_0x14e1da,_0x2d21d2){_0x14e1da=_0x14e1da-0x0;var _0x411d1d=_0x656b[_0x14e1da];return _0x411d1d;};'use strict';var multer=require(_0xb656('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb656('0x1'));var express=require('express');var router=express[_0xb656('0x2')]();var fs_extra=require(_0xb656('0x3'));var auth=require(_0xb656('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb656('0x5'));var controller=require(_0xb656('0x6'));router[_0xb656('0x7')]('/',auth[_0xb656('0x8')](),controller['index']);router['get'](_0xb656('0x9'),auth[_0xb656('0x8')](),controller[_0xb656('0xa')]);router[_0xb656('0x7')](_0xb656('0xb'),auth[_0xb656('0x8')](),controller['show']);router['post']('/',auth[_0xb656('0x8')](),controller[_0xb656('0xc')]);router['put'](_0xb656('0xb'),auth['isAuthenticated'](),controller[_0xb656('0xd')]);router['delete'](_0xb656('0xb'),auth[_0xb656('0x8')](),controller[_0xb656('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 15f539a..ab674bf 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 _0x7c45=['ENUM','timeout','mouseOver','sequelize','exports','STRING'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x7c45,0x7b));var _0x57c4=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x7c45[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x57c4('0x0'));module[_0x57c4('0x1')]={'name':{'type':Sequelize[_0x57c4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x57c4('0x3')]('mouseOver',_0x57c4('0x4')),'defaultValue':_0x57c4('0x5')},'selector':{'type':Sequelize[_0x57c4('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa7a6=['STRING','timeout','mouseOver','INTEGER','exports'];(function(_0x246464,_0x1f0b14){var _0x26eb18=function(_0x7721b3){while(--_0x7721b3){_0x246464['push'](_0x246464['shift']());}};_0x26eb18(++_0x1f0b14);}(_0xa7a6,0x19e));var _0x6a7a=function(_0x28e196,_0x55ea66){_0x28e196=_0x28e196-0x0;var _0xebe98e=_0xa7a6[_0x28e196];return _0xebe98e;};'use strict';var Sequelize=require('sequelize');module[_0x6a7a('0x0')]={'name':{'type':Sequelize[_0x6a7a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x6a7a('0x2')),'defaultValue':_0x6a7a('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6a7a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 8d966e1..3496fb2 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 _0x4b84=['name','show','params','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0xd351b8,_0x410fa3){var _0x3f8a1c=function(_0x55c53e){while(--_0x55c53e){_0xd351b8['push'](_0xd351b8['shift']());}};_0x3f8a1c(++_0x410fa3);}(_0x4b84,0x1cc));var _0x44b8=function(_0xb68772,_0x5253ac){_0xb68772=_0xb68772-0x0;var _0x4189bb=_0x4b84[_0xb68772];return _0x4189bb;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x22')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x23')]){delete _0x41d673[_0x44b8('0x23')];}_0x474f01[_0x44b8('0x14')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x24')]=function(_0x242342,_0x53d9c7){var _0x2e0174={'raw':!![],'where':{'id':_0x242342[_0x44b8('0x25')]['id']}},_0x4a182d={};_0x4a182d['model']=_['keys'](db['ChatProactiveAction'][_0x44b8('0x26')]);_0x4a182d[_0x44b8('0x27')]=_[_0x44b8('0x28')](_0x242342[_0x44b8('0x27')]);_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x2a')](_0x4a182d[_0x44b8('0x2b')],_0x4a182d[_0x44b8('0x27')]);_0x2e0174[_0x44b8('0x2c')]=_[_0x44b8('0x2a')](_0x4a182d[_0x44b8('0x2b')],qs[_0x44b8('0x2d')](_0x242342[_0x44b8('0x27')]['fields']));_0x2e0174[_0x44b8('0x2c')]=_0x2e0174['attributes'][_0x44b8('0x2e')]?_0x2e0174[_0x44b8('0x2c')]:_0x4a182d[_0x44b8('0x2b')];if(_0x242342[_0x44b8('0x27')][_0x44b8('0x2f')]){_0x2e0174['include']=[{'all':!![]}];}_0x2e0174=_[_0x44b8('0x30')]({},_0x2e0174,_0x242342[_0x44b8('0x31')]);return db[_0x44b8('0x32')][_0x44b8('0x33')](_0x2e0174)[_0x44b8('0x20')](handleEntityNotFound(_0x53d9c7,null))['then'](respondWithResult(_0x53d9c7,null))[_0x44b8('0x34')](handleError(_0x53d9c7,null));};exports[_0x44b8('0x35')]=function(_0x1a30fc,_0x3e93af){return db[_0x44b8('0x32')][_0x44b8('0x35')](_0x1a30fc[_0x44b8('0x36')],{})[_0x44b8('0x20')](respondWithResult(_0x3e93af,0xc9))[_0x44b8('0x34')](handleError(_0x3e93af,null));};exports[_0x44b8('0x1f')]=function(_0x13994c,_0xce304d){if(_0x13994c[_0x44b8('0x36')]['id']){delete _0x13994c[_0x44b8('0x36')]['id'];}return db[_0x44b8('0x32')][_0x44b8('0x33')]({'where':{'id':_0x13994c[_0x44b8('0x25')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0xce304d,null))[_0x44b8('0x20')](saveUpdates(_0x13994c[_0x44b8('0x36')],null))[_0x44b8('0x20')](respondWithResult(_0xce304d,null))[_0x44b8('0x34')](handleError(_0xce304d,null));};exports['destroy']=function(_0x1e2420,_0xd61f14){return db['ChatProactiveAction'][_0x44b8('0x33')]({'where':{'id':_0x1e2420[_0x44b8('0x25')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0xd61f14,null))[_0x44b8('0x20')](removeEntity(_0xd61f14,null))['catch'](handleError(_0xd61f14,null));};
\ No newline at end of file
+var _0x1134=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv'];(function(_0x5edcd8,_0xd8a6ca){var _0x2263cc=function(_0x17df45){while(--_0x17df45){_0x5edcd8['push'](_0x5edcd8['shift']());}};_0x2263cc(++_0xd8a6ca);}(_0x1134,0x19c));var _0x4113=function(_0x364cdd,_0x15c213){_0x364cdd=_0x364cdd-0x0;var _0x6fb254=_0x1134[_0x364cdd];return _0x6fb254;};'use strict';var emlformat=require(_0x4113('0x0'));var rimraf=require(_0x4113('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4113('0x2'));var rp=require(_0x4113('0x3'));var moment=require('moment');var BPromise=require(_0x4113('0x4'));var Mustache=require(_0x4113('0x5'));var util=require('util');var path=require(_0x4113('0x6'));var sox=require('sox');var csv=require(_0x4113('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4113('0x8'));var _=require('lodash');var squel=require(_0x4113('0x9'));var crypto=require(_0x4113('0xa'));var jsforce=require(_0x4113('0xb'));var deskjs=require(_0x4113('0xc'));var toCsv=require(_0x4113('0x7'));var querystring=require(_0x4113('0xd'));var Papa=require(_0x4113('0xe'));var Redis=require(_0x4113('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4113('0x10'));var as=require(_0x4113('0x11'));var hardwareService=require(_0x4113('0x12'));var logger=require(_0x4113('0x13'))(_0x4113('0x14'));var utils=require(_0x4113('0x15'));var config=require(_0x4113('0x16'));var licenseUtil=require(_0x4113('0x17'));var db=require(_0x4113('0x18'))['db'];function respondWithStatusCode(_0x457d3f,_0x53720f){_0x53720f=_0x53720f||0xcc;return function(_0x48b14c){if(_0x48b14c){return _0x457d3f['sendStatus'](_0x53720f);}return _0x457d3f[_0x4113('0x19')](_0x53720f)[_0x4113('0x1a')]();};}function respondWithResult(_0x4ba7ce,_0x567e69){_0x567e69=_0x567e69||0xc8;return function(_0x40f01e){if(_0x40f01e){return _0x4ba7ce['status'](_0x567e69)[_0x4113('0x1b')](_0x40f01e);}};}function respondWithFilteredResult(_0x5ab2a7,_0x59f69b){return function(_0xcdfdd){if(_0xcdfdd){var _0xe88992=typeof _0x59f69b[_0x4113('0x1c')]===_0x4113('0x1d')&&typeof _0x59f69b[_0x4113('0x1e')]===_0x4113('0x1d');var _0x405849=_0xcdfdd[_0x4113('0x1f')];var _0x1051d4=_0xe88992?0x0:_0x59f69b[_0x4113('0x1c')];var _0x59b821=_0xe88992?_0xcdfdd[_0x4113('0x1f')]:_0x59f69b[_0x4113('0x1c')]+_0x59f69b[_0x4113('0x1e')];var _0x1d40ba;if(_0x59b821>=_0x405849){_0x59b821=_0x405849;_0x1d40ba=0xc8;}else{_0x1d40ba=0xce;}_0x5ab2a7[_0x4113('0x19')](_0x1d40ba);return _0x5ab2a7[_0x4113('0x20')](_0x4113('0x21'),_0x1051d4+'-'+_0x59b821+'/'+_0x405849)[_0x4113('0x1b')](_0xcdfdd);}return null;};}function patchUpdates(_0x37bf1e){return function(_0x57540a){try{jsonpatch[_0x4113('0x22')](_0x57540a,_0x37bf1e,!![]);}catch(_0x2776a6){return BPromise['reject'](_0x2776a6);}return _0x57540a['save']();};}function saveUpdates(_0x11deb0,_0x49c72f){return function(_0x149d1a){if(_0x149d1a){return _0x149d1a[_0x4113('0x23')](_0x11deb0)[_0x4113('0x24')](function(_0x5a85be){return _0x5a85be;});}return null;};}function removeEntity(_0x12f1fe,_0x16b16c){return function(_0x349b33){if(_0x349b33){return _0x349b33[_0x4113('0x25')]()[_0x4113('0x24')](function(){_0x12f1fe[_0x4113('0x19')](0xcc)[_0x4113('0x1a')]();});}};}function handleEntityNotFound(_0x1c498a,_0x122102){return function(_0xc73743){if(!_0xc73743){_0x1c498a[_0x4113('0x26')](0x194);}return _0xc73743;};}function handleError(_0x2a014b,_0x56c343){_0x56c343=_0x56c343||0x1f4;return function(_0x44b317){logger[_0x4113('0x27')](_0x44b317['stack']);if(_0x44b317[_0x4113('0x28')]){delete _0x44b317[_0x4113('0x28')];}_0x2a014b[_0x4113('0x19')](_0x56c343)[_0x4113('0x29')](_0x44b317);};}exports[_0x4113('0x2a')]=function(_0x180fed,_0x234543){var _0x134a04={'raw':!![],'where':{'id':_0x180fed[_0x4113('0x2b')]['id']}},_0x3f063f={};_0x3f063f[_0x4113('0x2c')]=_[_0x4113('0x2d')](db[_0x4113('0x2e')][_0x4113('0x2f')]);_0x3f063f['query']=_[_0x4113('0x2d')](_0x180fed[_0x4113('0x30')]);_0x3f063f['filters']=_[_0x4113('0x31')](_0x3f063f[_0x4113('0x2c')],_0x3f063f[_0x4113('0x30')]);_0x134a04[_0x4113('0x32')]=_['intersection'](_0x3f063f[_0x4113('0x2c')],qs[_0x4113('0x33')](_0x180fed[_0x4113('0x30')][_0x4113('0x33')]));_0x134a04[_0x4113('0x32')]=_0x134a04[_0x4113('0x32')][_0x4113('0x34')]?_0x134a04[_0x4113('0x32')]:_0x3f063f[_0x4113('0x2c')];if(_0x180fed['query'][_0x4113('0x35')]){_0x134a04['include']=[{'all':!![]}];}_0x134a04=_[_0x4113('0x36')]({},_0x134a04,_0x180fed[_0x4113('0x37')]);return db[_0x4113('0x2e')][_0x4113('0x38')](_0x134a04)[_0x4113('0x24')](handleEntityNotFound(_0x234543,null))[_0x4113('0x24')](respondWithResult(_0x234543,null))['catch'](handleError(_0x234543,null));};exports[_0x4113('0x39')]=function(_0x56ad93,_0x397fcd){return db[_0x4113('0x2e')][_0x4113('0x39')](_0x56ad93['body'],{})[_0x4113('0x24')](respondWithResult(_0x397fcd,0xc9))['catch'](handleError(_0x397fcd,null));};exports[_0x4113('0x23')]=function(_0x580434,_0x13d161){if(_0x580434[_0x4113('0x3a')]['id']){delete _0x580434['body']['id'];}return db['ChatProactiveAction'][_0x4113('0x38')]({'where':{'id':_0x580434[_0x4113('0x2b')]['id']}})[_0x4113('0x24')](handleEntityNotFound(_0x13d161,null))['then'](saveUpdates(_0x580434['body'],null))[_0x4113('0x24')](respondWithResult(_0x13d161,null))[_0x4113('0x3b')](handleError(_0x13d161,null));};exports[_0x4113('0x25')]=function(_0xed3af2,_0xa50de0){return db['ChatProactiveAction'][_0x4113('0x38')]({'where':{'id':_0xed3af2[_0x4113('0x2b')]['id']}})[_0x4113('0x24')](handleEntityNotFound(_0xa50de0,null))['then'](removeEntity(_0xa50de0,null))[_0x4113('0x3b')](handleError(_0xa50de0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index cfe1721..799846e 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 _0xd75b=['chat_proactive_actions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x53411f,_0x23a4fc){var _0x9a1691=function(_0x5a3d76){while(--_0x5a3d76){_0x53411f['push'](_0x53411f['shift']());}};_0x9a1691(++_0x23a4fc);}(_0xd75b,0x139));var _0xbd75=function(_0x4faabc,_0x349a1e){_0x4faabc=_0x4faabc-0x0;var _0x42fc45=_0xd75b[_0x4faabc];return _0x42fc45;};'use strict';var _=require(_0xbd75('0x0'));var util=require(_0xbd75('0x1'));var logger=require('../../config/logger')(_0xbd75('0x2'));var moment=require(_0xbd75('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd75('0x4'));var fs=require('fs');var path=require(_0xbd75('0x5'));var rimraf=require(_0xbd75('0x6'));var config=require(_0xbd75('0x7'));var attributes=require(_0xbd75('0x8'));module[_0xbd75('0x9')]=function(_0x298f13,_0x4b5493){return _0x298f13[_0xbd75('0xa')](_0xbd75('0xb'),attributes,{'tableName':_0xbd75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d5a=['bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment'];(function(_0x10cc9f,_0x5d40a5){var _0x392aaa=function(_0x2f0e7b){while(--_0x2f0e7b){_0x10cc9f['push'](_0x10cc9f['shift']());}};_0x392aaa(++_0x5d40a5);}(_0x8d5a,0x67));var _0xa8d5=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8d5a[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xa8d5('0x0'));var util=require(_0xa8d5('0x1'));var logger=require(_0xa8d5('0x2'))(_0xa8d5('0x3'));var moment=require(_0xa8d5('0x4'));var BPromise=require(_0xa8d5('0x5'));var rp=require(_0xa8d5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8d5('0x7'));var config=require(_0xa8d5('0x8'));var attributes=require(_0xa8d5('0x9'));module[_0xa8d5('0xa')]=function(_0x1ffe07,_0x45bb52){return _0x1ffe07['define'](_0xa8d5('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 67df291..060f43c 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 _0xfbba=['lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x110bf2,_0x1cac5d){var _0x39cb78=function(_0x1e0241){while(--_0x1e0241){_0x110bf2['push'](_0x110bf2['shift']());}};_0x39cb78(++_0x1cac5d);}(_0xfbba,0xcf));var _0xafbb=function(_0x44edd8,_0x1adc9e){_0x44edd8=_0x44edd8-0x0;var _0x542bb6=_0xfbba[_0x44edd8];return _0x542bb6;};'use strict';var _=require(_0xafbb('0x0'));var util=require('util');var moment=require(_0xafbb('0x1'));var BPromise=require(_0xafbb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafbb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xafbb('0x4'));var logger=require(_0xafbb('0x5'))(_0xafbb('0x6'));var config=require(_0xafbb('0x7'));var jayson=require(_0xafbb('0x8'));var client=jayson[_0xafbb('0x9')][_0xafbb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x555f96,_0x260a3a,_0x27638c){return new BPromise(function(_0x2b29e2,_0x5a0cea){return client[_0xafbb('0xb')](_0x555f96,_0x27638c)[_0xafbb('0xc')](function(_0x37d764){logger[_0xafbb('0xd')](_0xafbb('0xe'),_0x260a3a,_0xafbb('0xf'));logger[_0xafbb('0x10')](_0xafbb('0x11'),_0x260a3a,_0xafbb('0xf'),JSON[_0xafbb('0x12')](_0x37d764));if(_0x37d764[_0xafbb('0x13')]){if(_0x37d764[_0xafbb('0x13')][_0xafbb('0x14')]===0x1f4){logger[_0xafbb('0x13')](_0xafbb('0xe'),_0x260a3a,_0x37d764[_0xafbb('0x13')][_0xafbb('0x15')]);return _0x5a0cea(_0x37d764[_0xafbb('0x13')][_0xafbb('0x15')]);}logger[_0xafbb('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x260a3a,_0x37d764[_0xafbb('0x13')][_0xafbb('0x15')]);return _0x2b29e2(_0x37d764[_0xafbb('0x13')][_0xafbb('0x15')]);}else{logger['info'](_0xafbb('0xe'),_0x260a3a,_0xafbb('0xf'));_0x2b29e2(_0x37d764['result'][_0xafbb('0x15')]);}})[_0xafbb('0x16')](function(_0x2b9600){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x260a3a,_0x2b9600);_0x5a0cea(_0x2b9600);});});}
\ No newline at end of file
+var _0xc7f3=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xc7f3,0x1c1));var _0x3c7f=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0xc7f3[_0x22205c];return _0x3f5efe;};'use strict';var _=require(_0x3c7f('0x0'));var util=require(_0x3c7f('0x1'));var moment=require(_0x3c7f('0x2'));var BPromise=require(_0x3c7f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c7f('0x4'))['db'];var utils=require(_0x3c7f('0x5'));var logger=require(_0x3c7f('0x6'))(_0x3c7f('0x7'));var config=require(_0x3c7f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3c7f('0x9')][_0x3c7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa8a8e5,_0xd237fc,_0x46cffb){return new BPromise(function(_0x3fdd3f,_0x11dd9f){return client['request'](_0xa8a8e5,_0x46cffb)[_0x3c7f('0xb')](function(_0x3c7e0c){logger['info'](_0x3c7f('0xc'),_0xd237fc,_0x3c7f('0xd'));logger[_0x3c7f('0xe')](_0x3c7f('0xf'),_0xd237fc,_0x3c7f('0xd'),JSON[_0x3c7f('0x10')](_0x3c7e0c));if(_0x3c7e0c[_0x3c7f('0x11')]){if(_0x3c7e0c[_0x3c7f('0x11')][_0x3c7f('0x12')]===0x1f4){logger[_0x3c7f('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0xd237fc,_0x3c7e0c[_0x3c7f('0x11')]['message']);return _0x11dd9f(_0x3c7e0c[_0x3c7f('0x11')][_0x3c7f('0x13')]);}logger[_0x3c7f('0x11')](_0x3c7f('0xc'),_0xd237fc,_0x3c7e0c[_0x3c7f('0x11')][_0x3c7f('0x13')]);return _0x3fdd3f(_0x3c7e0c[_0x3c7f('0x11')][_0x3c7f('0x13')]);}else{logger[_0x3c7f('0x14')](_0x3c7f('0xc'),_0xd237fc,_0x3c7f('0xd'));_0x3fdd3f(_0x3c7e0c[_0x3c7f('0x15')]['message']);}})[_0x3c7f('0x16')](function(_0x84265){logger[_0x3c7f('0x11')](_0x3c7f('0xc'),_0xd237fc,_0x84265);_0x11dd9f(_0x84265);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index b3d8d2e..03adb85 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 _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(_0x307835,_0x34473c){var _0x7a5ee=function(_0x5d1723){while(--_0x5d1723){_0x307835['push'](_0x307835['shift']());}};_0x7a5ee(++_0x34473c);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x484a60,_0x63e920){_0x484a60=_0x484a60-0x0;var _0x18217b=_0x3f8a[_0x484a60];return _0x18217b;};'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
+var _0x7217=['Router','fs-extra','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x43023c,_0x53062e){var _0x8c0d9a=function(_0x144ead){while(--_0x144ead){_0x43023c['push'](_0x43023c['shift']());}};_0x8c0d9a(++_0x53062e);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')](_0x7721('0x9'),auth[_0x7721('0xa')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')]('/',auth[_0x7721('0xa')](),controller[_0x7721('0xd')]);router[_0x7721('0xe')](_0x7721('0x9'),auth[_0x7721('0xa')](),controller[_0x7721('0xf')]);router[_0x7721('0x10')](_0x7721('0x9'),auth['isAuthenticated'](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 284755b..ece26e2 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 _0x96db=['ENUM','rrmemory','beepall','exports','STRING','INTEGER'];(function(_0xf8c068,_0x233159){var _0x4d6940=function(_0x4c590f){while(--_0x4c590f){_0xf8c068['push'](_0xf8c068['shift']());}};_0x4d6940(++_0x233159);}(_0x96db,0x18f));var _0xb96d=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x96db[_0xda464c];return _0x19e222;};'use strict';var Sequelize=require('sequelize');module[_0xb96d('0x0')]={'name':{'type':Sequelize[_0xb96d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb96d('0x1')]},'timeout':{'type':Sequelize[_0xb96d('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb96d('0x3')](_0xb96d('0x4'),_0xb96d('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x5c97=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x47cb0f,_0x5c7147){var _0x4dd971=function(_0x2fd41c){while(--_0x2fd41c){_0x47cb0f['push'](_0x47cb0f['shift']());}};_0x4dd971(++_0x5c7147);}(_0x5c97,0x1b3));var _0x75c9=function(_0x49c341,_0x5b9570){_0x49c341=_0x49c341-0x0;var _0x1c106d=_0x5c97[_0x49c341];return _0x1c106d;};'use strict';var Sequelize=require(_0x75c9('0x0'));module[_0x75c9('0x1')]={'name':{'type':Sequelize[_0x75c9('0x2')],'unique':_0x75c9('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x75c9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x75c9('0x5')](_0x75c9('0x6'),'beepall',_0x75c9('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index a9ee568..e1fd78e 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 _0x6cdd=['result','catch','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','name','index','ChatQueue','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','map','findAndCountAll','agent','chatPause','createdAt','rows','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserChatQueue','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3d70aa,_0x3bea48){var _0x169953=function(_0x375b01){while(--_0x375b01){_0x3d70aa['push'](_0x3d70aa['shift']());}};_0x169953(++_0x3bea48);}(_0x6cdd,0x70));var _0xd6cd=function(_0x1d8364,_0x57478a){_0x1d8364=_0x1d8364-0x0;var _0x17f34d=_0x6cdd[_0x1d8364];return _0x17f34d;};'use strict';var emlformat=require(_0xd6cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6cd('0x1'));var jsonpatch=require(_0xd6cd('0x2'));var rp=require('request-promise');var moment=require(_0xd6cd('0x3'));var BPromise=require(_0xd6cd('0x4'));var Mustache=require(_0xd6cd('0x5'));var util=require(_0xd6cd('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd6cd('0x7'));var ejs=require(_0xd6cd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6cd('0x9'));var squel=require(_0xd6cd('0xa'));var crypto=require('crypto');var jsforce=require(_0xd6cd('0xb'));var deskjs=require(_0xd6cd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd6cd('0xd'));var Papa=require(_0xd6cd('0xe'));var Redis=require(_0xd6cd('0xf'));var authService=require(_0xd6cd('0x10'));var qs=require(_0xd6cd('0x11'));var as=require(_0xd6cd('0x12'));var hardwareService=require(_0xd6cd('0x13'));var logger=require(_0xd6cd('0x14'))(_0xd6cd('0x15'));var utils=require(_0xd6cd('0x16'));var config=require(_0xd6cd('0x17'));var licenseUtil=require(_0xd6cd('0x18'));var db=require('../../mysqldb')['db'];config[_0xd6cd('0x19')]=_[_0xd6cd('0x1a')](config['redis'],{'host':_0xd6cd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6cd('0x19')]));require('./chatQueue.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd6cd('0x1c')][_0xd6cd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3a07b1,_0x52493f,_0x3a37c5,_0x6115bc){return new BPromise(function(_0x325e42,_0x3a2303){var _0x18fc01=_0x6115bc||client;return _0x18fc01[_0xd6cd('0x1e')](_0x3a07b1,_0x3a37c5)[_0xd6cd('0x1f')](function(_0x443a03){logger[_0xd6cd('0x20')](_0xd6cd('0x21'),_0x52493f,_0xd6cd('0x22'));logger['debug'](_0xd6cd('0x23'),_0x52493f,_0xd6cd('0x22'),JSON[_0xd6cd('0x24')](_0x443a03));if(_0x443a03[_0xd6cd('0x25')]){if(_0x443a03[_0xd6cd('0x25')][_0xd6cd('0x26')]===0x1f4){logger[_0xd6cd('0x25')]('ChatQueue,\x20%s,\x20%s',_0x52493f,_0x443a03[_0xd6cd('0x25')][_0xd6cd('0x27')]);return _0x3a2303(_0x443a03[_0xd6cd('0x25')]['message']);}logger['error'](_0xd6cd('0x21'),_0x52493f,_0x443a03[_0xd6cd('0x25')]['message']);return _0x325e42(_0x443a03[_0xd6cd('0x25')][_0xd6cd('0x27')]);}else{logger[_0xd6cd('0x20')](_0xd6cd('0x21'),_0x52493f,_0xd6cd('0x22'));_0x325e42(_0x443a03[_0xd6cd('0x28')][_0xd6cd('0x27')]);}})[_0xd6cd('0x29')](function(_0x519a78){logger['error'](_0xd6cd('0x21'),_0x52493f,_0x519a78);_0x3a2303(_0x519a78);});});}function respondWithStatusCode(_0x4c74c4,_0x14ad61){_0x14ad61=_0x14ad61||0xcc;return function(_0xd10b09){if(_0xd10b09){return _0x4c74c4[_0xd6cd('0x2a')](_0x14ad61);}return _0x4c74c4[_0xd6cd('0x2b')](_0x14ad61)['end']();};}function respondWithResult(_0x14138d,_0x143f18){_0x143f18=_0x143f18||0xc8;return function(_0xf2cc3c){if(_0xf2cc3c){return _0x14138d[_0xd6cd('0x2b')](_0x143f18)[_0xd6cd('0x2c')](_0xf2cc3c);}};}function respondWithFilteredResult(_0x290b44,_0x39a158){return function(_0x5b0590){if(_0x5b0590){var _0x2e0f0e=typeof _0x39a158['offset']==='undefined'&&typeof _0x39a158[_0xd6cd('0x2d')]==='undefined';var _0x290d7e=_0x5b0590[_0xd6cd('0x2e')];var _0x19c7b7=_0x2e0f0e?0x0:_0x39a158[_0xd6cd('0x2f')];var _0x122fba=_0x2e0f0e?_0x5b0590[_0xd6cd('0x2e')]:_0x39a158[_0xd6cd('0x2f')]+_0x39a158[_0xd6cd('0x2d')];var _0x377a99;if(_0x122fba>=_0x290d7e){_0x122fba=_0x290d7e;_0x377a99=0xc8;}else{_0x377a99=0xce;}_0x290b44[_0xd6cd('0x2b')](_0x377a99);return _0x290b44[_0xd6cd('0x30')](_0xd6cd('0x31'),_0x19c7b7+'-'+_0x122fba+'/'+_0x290d7e)[_0xd6cd('0x2c')](_0x5b0590);}return null;};}function patchUpdates(_0x5ebefb){return function(_0x1e59e2){try{jsonpatch[_0xd6cd('0x32')](_0x1e59e2,_0x5ebefb,!![]);}catch(_0x28ca1c){return BPromise[_0xd6cd('0x33')](_0x28ca1c);}return _0x1e59e2[_0xd6cd('0x34')]();};}function saveUpdates(_0x155850,_0x2a4a07){return function(_0x3e6614){if(_0x3e6614){return _0x3e6614[_0xd6cd('0x35')](_0x155850)[_0xd6cd('0x1f')](function(_0x189b55){return _0x189b55;});}return null;};}function removeEntity(_0x5bf695,_0x1d4f99){return function(_0x1e70a4){if(_0x1e70a4){return _0x1e70a4[_0xd6cd('0x36')]()[_0xd6cd('0x1f')](function(){var _0x30f884=_0x1e70a4[_0xd6cd('0x37')]({'plain':!![]});var _0x3f982a=_0xd6cd('0x38');return db[_0xd6cd('0x39')][_0xd6cd('0x36')]({'where':{'type':_0x3f982a,'resourceId':_0x30f884['id']}})['then'](function(){return _0x1e70a4;});})['then'](function(){_0x5bf695['status'](0xcc)[_0xd6cd('0x3a')]();});}};}function handleEntityNotFound(_0x43f89f,_0x58ac7b){return function(_0x15b0e3){if(!_0x15b0e3){_0x43f89f[_0xd6cd('0x2a')](0x194);}return _0x15b0e3;};}function handleError(_0x2ba09c,_0x58531){_0x58531=_0x58531||0x1f4;return function(_0x40bc3f){logger['error'](_0x40bc3f['stack']);if(_0x40bc3f[_0xd6cd('0x3b')]){delete _0x40bc3f[_0xd6cd('0x3b')];}_0x2ba09c['status'](_0x58531)['send'](_0x40bc3f);};}exports[_0xd6cd('0x3c')]=function(_0x14c087,_0x1b2d65){var _0xc3bce4={},_0xdb3653={},_0x3f0ddc={'count':0x0,'rows':[]};var _0x1f8cc1=_['map'](db[_0xd6cd('0x3d')][_0xd6cd('0x3e')],function(_0x2179ba){return{'name':_0x2179ba['fieldName'],'type':_0x2179ba[_0xd6cd('0x3f')][_0xd6cd('0x40')]};});_0xdb3653[_0xd6cd('0x41')]=_['map'](_0x1f8cc1,_0xd6cd('0x3b'));_0xdb3653[_0xd6cd('0x42')]=_[_0xd6cd('0x43')](_0x14c087[_0xd6cd('0x42')]);_0xdb3653['filters']=_[_0xd6cd('0x44')](_0xdb3653['model'],_0xdb3653[_0xd6cd('0x42')]);_0xc3bce4[_0xd6cd('0x45')]=_[_0xd6cd('0x44')](_0xdb3653['model'],qs['fields'](_0x14c087['query'][_0xd6cd('0x46')]));_0xc3bce4[_0xd6cd('0x45')]=_0xc3bce4[_0xd6cd('0x45')][_0xd6cd('0x47')]?_0xc3bce4[_0xd6cd('0x45')]:_0xdb3653[_0xd6cd('0x41')];if(!_0x14c087['query'][_0xd6cd('0x48')](_0xd6cd('0x49'))){_0xc3bce4[_0xd6cd('0x2d')]=qs[_0xd6cd('0x2d')](_0x14c087[_0xd6cd('0x42')][_0xd6cd('0x2d')]);_0xc3bce4[_0xd6cd('0x2f')]=qs[_0xd6cd('0x2f')](_0x14c087[_0xd6cd('0x42')][_0xd6cd('0x2f')]);}_0xc3bce4[_0xd6cd('0x4a')]=qs[_0xd6cd('0x4b')](_0x14c087[_0xd6cd('0x42')][_0xd6cd('0x4b')]);_0xc3bce4['where']=qs[_0xd6cd('0x4c')](_[_0xd6cd('0x4d')](_0x14c087[_0xd6cd('0x42')],_0xdb3653['filters']),_0x1f8cc1);if(_0x14c087[_0xd6cd('0x42')][_0xd6cd('0x4e')]){_0xc3bce4[_0xd6cd('0x4f')]=_[_0xd6cd('0x50')](_0xc3bce4['where'],{'$or':_['map'](_0x1f8cc1,function(_0x42b647){if(_0x42b647['type']!==_0xd6cd('0x51')){var _0x431d5d={};_0x431d5d[_0x42b647[_0xd6cd('0x3b')]]={'$like':'%'+_0x14c087[_0xd6cd('0x42')]['filter']+'%'};return _0x431d5d;}})});}_0xc3bce4=_[_0xd6cd('0x50')]({},_0xc3bce4,_0x14c087[_0xd6cd('0x52')]);var _0x5e3420={'where':_0xc3bce4['where']};return db[_0xd6cd('0x3d')][_0xd6cd('0x2e')](_0x5e3420)[_0xd6cd('0x1f')](function(_0x473935){_0x3f0ddc[_0xd6cd('0x2e')]=_0x473935;if(_0x14c087[_0xd6cd('0x42')][_0xd6cd('0x53')]){_0xc3bce4[_0xd6cd('0x54')]=[{'all':!![]}];}return db[_0xd6cd('0x3d')][_0xd6cd('0x55')](_0xc3bce4);})[_0xd6cd('0x1f')](function(_0x13b879){_0x3f0ddc['rows']=_0x13b879;return _0x3f0ddc;})[_0xd6cd('0x1f')](respondWithFilteredResult(_0x1b2d65,_0xc3bce4))[_0xd6cd('0x29')](handleError(_0x1b2d65,null));};exports[_0xd6cd('0x56')]=function(_0x57d296,_0x5de8ea){var _0x3c506b={'raw':!![],'where':{'id':_0x57d296['params']['id']}},_0x549d3f={};_0x549d3f[_0xd6cd('0x41')]=_[_0xd6cd('0x43')](db[_0xd6cd('0x3d')][_0xd6cd('0x3e')]);_0x549d3f['query']=_[_0xd6cd('0x43')](_0x57d296['query']);_0x549d3f['filters']=_[_0xd6cd('0x44')](_0x549d3f[_0xd6cd('0x41')],_0x549d3f[_0xd6cd('0x42')]);_0x3c506b[_0xd6cd('0x45')]=_[_0xd6cd('0x44')](_0x549d3f[_0xd6cd('0x41')],qs[_0xd6cd('0x46')](_0x57d296[_0xd6cd('0x42')]['fields']));_0x3c506b[_0xd6cd('0x45')]=_0x3c506b['attributes'][_0xd6cd('0x47')]?_0x3c506b['attributes']:_0x549d3f['model'];if(_0x57d296[_0xd6cd('0x42')][_0xd6cd('0x53')]){_0x3c506b[_0xd6cd('0x54')]=[{'all':!![]}];}_0x3c506b=_[_0xd6cd('0x50')]({},_0x3c506b,_0x57d296['options']);return db['ChatQueue'][_0xd6cd('0x57')](_0x3c506b)[_0xd6cd('0x1f')](handleEntityNotFound(_0x5de8ea,null))[_0xd6cd('0x1f')](respondWithResult(_0x5de8ea,null))[_0xd6cd('0x29')](handleError(_0x5de8ea,null));};exports[_0xd6cd('0x58')]=function(_0x430515,_0x3cad35){return db[_0xd6cd('0x3d')][_0xd6cd('0x58')](_0x430515[_0xd6cd('0x59')],{})[_0xd6cd('0x1f')](function(_0x24d512){var _0x1e5e96=_0x430515['user'][_0xd6cd('0x37')]({'plain':!![]});if(!_0x1e5e96)throw new Error(_0xd6cd('0x5a'));if(_0x1e5e96[_0xd6cd('0x5b')]===_0xd6cd('0x5c')){var _0x2e96a0=_0x24d512[_0xd6cd('0x37')]({'plain':!![]});var _0x592346='ChatQueues';return db[_0xd6cd('0x5d')][_0xd6cd('0x57')]({'where':{'name':_0x592346,'userProfileId':_0x1e5e96['userProfileId']},'raw':!![]})['then'](function(_0x23f08b){if(_0x23f08b&&_0x23f08b['autoAssociation']===0x0){return db[_0xd6cd('0x39')][_0xd6cd('0x58')]({'name':_0x2e96a0['name'],'resourceId':_0x2e96a0['id'],'type':_0x23f08b[_0xd6cd('0x3b')],'sectionId':_0x23f08b['id']},{})[_0xd6cd('0x1f')](function(){return _0x24d512;});}else{return _0x24d512;}})[_0xd6cd('0x29')](function(_0x5b791d){logger['error'](_0xd6cd('0x5e'),_0x5b791d);throw _0x5b791d;});}return _0x24d512;})[_0xd6cd('0x1f')](respondWithResult(_0x3cad35,0xc9))[_0xd6cd('0x29')](handleError(_0x3cad35,null));};exports['update']=function(_0x32dba6,_0x3bf277){if(_0x32dba6[_0xd6cd('0x59')]['id']){delete _0x32dba6[_0xd6cd('0x59')]['id'];}return db[_0xd6cd('0x3d')]['find']({'where':{'id':_0x32dba6['params']['id']}})[_0xd6cd('0x1f')](handleEntityNotFound(_0x3bf277,null))[_0xd6cd('0x1f')](saveUpdates(_0x32dba6[_0xd6cd('0x59')],null))['then'](respondWithResult(_0x3bf277,null))[_0xd6cd('0x29')](handleError(_0x3bf277,null));};exports['destroy']=function(_0x2fb258,_0x3c5271){return db['ChatQueue'][_0xd6cd('0x57')]({'where':{'id':_0x2fb258[_0xd6cd('0x5f')]['id']}})[_0xd6cd('0x1f')](handleEntityNotFound(_0x3c5271,null))[_0xd6cd('0x1f')](removeEntity(_0x3c5271,null))[_0xd6cd('0x29')](handleError(_0x3c5271,null));};exports[_0xd6cd('0x60')]=function(_0x3f5db3,_0x102265){return db[_0xd6cd('0x3d')][_0xd6cd('0x60')]()[_0xd6cd('0x1f')](respondWithResult(_0x102265,null))['catch'](handleError(_0x102265,null));};exports[_0xd6cd('0x61')]=function(_0x36f648,_0x580fb2,_0x3a0cc6){var _0x4e0b63={'raw':!![],'where':{}},_0x5436d9={},_0x241da3;return db['ChatQueue'][_0xd6cd('0x62')]({'where':{'id':_0x36f648[_0xd6cd('0x5f')]['id']}})['then'](handleEntityNotFound(_0x580fb2,null))[_0xd6cd('0x1f')](function(_0x59dfb4){if(_0x59dfb4){_0x241da3=_0x59dfb4[_0xd6cd('0x37')]({'plain':!![]});_0x5436d9[_0xd6cd('0x41')]=_['keys'](db['UserChatQueue'][_0xd6cd('0x3e')]);_0x5436d9[_0xd6cd('0x42')]=_[_0xd6cd('0x43')](_0x36f648[_0xd6cd('0x42')]);_0x5436d9[_0xd6cd('0x4c')]=_[_0xd6cd('0x44')](_0x5436d9['model'],_0x5436d9[_0xd6cd('0x42')]);_0x4e0b63['attributes']=_['intersection'](_0x5436d9[_0xd6cd('0x41')],qs['fields'](_0x36f648[_0xd6cd('0x42')][_0xd6cd('0x46')]));_0x4e0b63[_0xd6cd('0x45')]=_0x4e0b63[_0xd6cd('0x45')][_0xd6cd('0x47')]?_0x4e0b63[_0xd6cd('0x45')]:_0x5436d9[_0xd6cd('0x41')];if(!_0x36f648[_0xd6cd('0x42')][_0xd6cd('0x48')](_0xd6cd('0x49'))){_0x4e0b63[_0xd6cd('0x2d')]=qs[_0xd6cd('0x2d')](_0x36f648[_0xd6cd('0x42')][_0xd6cd('0x2d')]);_0x4e0b63[_0xd6cd('0x2f')]=qs[_0xd6cd('0x2f')](_0x36f648[_0xd6cd('0x42')][_0xd6cd('0x2f')]);}_0x4e0b63[_0xd6cd('0x4a')]=qs['sort'](_0x36f648[_0xd6cd('0x42')]['sort']);_0x4e0b63['where']=qs['filters'](_[_0xd6cd('0x4d')](_0x36f648['query'],_0x5436d9[_0xd6cd('0x4c')]));_0x4e0b63[_0xd6cd('0x4f')]['ChatQueueId']=_0x59dfb4['id'];if(_0x36f648[_0xd6cd('0x42')]['filter']){_0x4e0b63[_0xd6cd('0x4f')]=_[_0xd6cd('0x50')](_0x4e0b63['where'],{'$or':_[_0xd6cd('0x63')](_0x4e0b63['attributes'],function(_0x37d52c){var _0x32063a={};_0x32063a[_0x37d52c]={'$like':'%'+_0x36f648[_0xd6cd('0x42')][_0xd6cd('0x4e')]+'%'};return _0x32063a;})});}_0x4e0b63=_[_0xd6cd('0x50')]({},_0x4e0b63,_0x36f648[_0xd6cd('0x52')]);return db['UserChatQueue'][_0xd6cd('0x55')](_0x4e0b63);}})['then'](function(_0x491a1c){if(_0x491a1c){return db['User'][_0xd6cd('0x64')]({'where':{'id':_[_0xd6cd('0x63')](_0x491a1c,'UserId'),'role':_0xd6cd('0x65')},'attributes':['id','name',_0xd6cd('0x66'),'updatedAt',_0xd6cd('0x67')]});}})[_0xd6cd('0x1f')](function(_0x302088){if(_0x302088){return{'count':_0x302088[_0xd6cd('0x2e')],'rows':_[_0xd6cd('0x63')](_0x302088[_0xd6cd('0x68')],function(_0x5b3e40){return{'membername':_0x5b3e40[_0xd6cd('0x3b')],'UserId':_0x5b3e40['id'],'queue_name':_0x241da3[_0xd6cd('0x3b')],'ChatQueueId':_0x241da3['id'],'interface':util[_0xd6cd('0x69')](_0xd6cd('0x6a'),_0xd6cd('0x6b'),_0x5b3e40[_0xd6cd('0x3b')]),'penalty':0x0,'paused':_0x5b3e40[_0xd6cd('0x66')],'createdAt':_0x5b3e40[_0xd6cd('0x67')],'updatedAt':_0x5b3e40[_0xd6cd('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd6cd('0x1f')](respondWithFilteredResult(_0x580fb2,_0x4e0b63))[_0xd6cd('0x29')](handleError(_0x580fb2,null));};exports['getTeams']=function(_0xfef063,_0x51d989,_0x2a8f3a){var _0x7d1cb5={};var _0x152a13={};var _0x29fa4c;var _0x2f494f;return db[_0xd6cd('0x3d')][_0xd6cd('0x62')]({'where':{'id':_0xfef063[_0xd6cd('0x5f')]['id']}})[_0xd6cd('0x1f')](handleEntityNotFound(_0x51d989,null))[_0xd6cd('0x1f')](function(_0x1c8d42){if(_0x1c8d42){_0x29fa4c=_0x1c8d42;_0x152a13[_0xd6cd('0x41')]=_[_0xd6cd('0x43')](db[_0xd6cd('0x6d')][_0xd6cd('0x3e')]);_0x152a13[_0xd6cd('0x42')]=_[_0xd6cd('0x43')](_0xfef063[_0xd6cd('0x42')]);_0x152a13[_0xd6cd('0x4c')]=_[_0xd6cd('0x44')](_0x152a13[_0xd6cd('0x41')],_0x152a13[_0xd6cd('0x42')]);_0x7d1cb5[_0xd6cd('0x45')]=_[_0xd6cd('0x44')](_0x152a13[_0xd6cd('0x41')],qs['fields'](_0xfef063[_0xd6cd('0x42')][_0xd6cd('0x46')]));_0x7d1cb5['attributes']=_0x7d1cb5[_0xd6cd('0x45')][_0xd6cd('0x47')]?_0x7d1cb5[_0xd6cd('0x45')]:_0x152a13[_0xd6cd('0x41')];_0x7d1cb5[_0xd6cd('0x4a')]=qs[_0xd6cd('0x4b')](_0xfef063['query']['sort']);_0x7d1cb5[_0xd6cd('0x4f')]=qs[_0xd6cd('0x4c')](_[_0xd6cd('0x4d')](_0xfef063['query'],_0x152a13[_0xd6cd('0x4c')]));if(_0xfef063[_0xd6cd('0x42')][_0xd6cd('0x4e')]){_0x7d1cb5[_0xd6cd('0x4f')]=_['merge'](_0x7d1cb5[_0xd6cd('0x4f')],{'$or':_['map'](_0x7d1cb5[_0xd6cd('0x45')],function(_0x126a22){var _0x7c5250={};_0x7c5250[_0x126a22]={'$like':'%'+_0xfef063[_0xd6cd('0x42')]['filter']+'%'};return _0x7c5250;})});}_0x7d1cb5=_['merge']({},_0x7d1cb5,_0xfef063['options']);return _0x29fa4c[_0xd6cd('0x6e')](_0x7d1cb5);}})[_0xd6cd('0x1f')](function(_0x1af133){if(_0x1af133){_0x2f494f=_0x1af133[_0xd6cd('0x47')];if(!_0xfef063[_0xd6cd('0x42')][_0xd6cd('0x48')](_0xd6cd('0x49'))){_0x7d1cb5[_0xd6cd('0x2d')]=qs[_0xd6cd('0x2d')](_0xfef063[_0xd6cd('0x42')][_0xd6cd('0x2d')]);_0x7d1cb5[_0xd6cd('0x2f')]=qs[_0xd6cd('0x2f')](_0xfef063['query'][_0xd6cd('0x2f')]);}return _0x29fa4c[_0xd6cd('0x6e')](_0x7d1cb5);}})[_0xd6cd('0x1f')](function(_0x1f89b8){if(_0x1f89b8){return _0x1f89b8?{'count':_0x2f494f,'rows':_0x1f89b8}:null;}})[_0xd6cd('0x1f')](respondWithResult(_0x51d989,null))['catch'](handleError(_0x51d989,null));};exports[_0xd6cd('0x6f')]=function(_0x1a4d0f,_0x29dde2,_0x4acd26){var _0x4bac71=_0x1a4d0f[_0xd6cd('0x59')][_0xd6cd('0x70')];return db['Team'][_0xd6cd('0x55')]({'where':{'id':_0x4bac71},'attributes':['id'],'include':[{'model':db[_0xd6cd('0x71')],'as':_0xd6cd('0x72'),'attributes':['id','name',_0xd6cd('0x73'),_0xd6cd('0x74'),_0xd6cd('0x75')],'raw':!![]}]})[_0xd6cd('0x1f')](function(_0x5006dc){if(_0x5006dc){var _0xda04d3=_[_0xd6cd('0x76')](_0x5006dc,function(_0x56c65c){var _0x111ba9=_0x56c65c[_0xd6cd('0x37')]({'plain':!![]});return _0x111ba9[_0xd6cd('0x72')];});return db['ChatQueue'][_0xd6cd('0x57')]({'where':{'id':_0x1a4d0f[_0xd6cd('0x5f')]['id']}})[_0xd6cd('0x1f')](function(_0x59750e){return db[_0xd6cd('0x77')][_0xd6cd('0x78')](function(_0x1bee44){return _0x59750e[_0xd6cd('0x6f')](_0x4bac71,{'transaction':_0x1bee44})['then'](function(){return BPromise[_0xd6cd('0x79')](_0xda04d3,function(_0x6b8072){return db[_0xd6cd('0x7a')]['findOrCreate']({'where':{'UserId':_0x6b8072['id'],'ChatQueueId':_0x1a4d0f[_0xd6cd('0x5f')]['id']},'transaction':_0x1bee44});});})[_0xd6cd('0x1f')](function(){_0xda04d3['forEach'](function(_0x5e852b){socket[_0xd6cd('0x7b')]('userChatQueue:save',{'UserId':_0x5e852b['id'],'ChatQueueId':_0x59750e['id']});});});});});}})[_0xd6cd('0x1f')](respondWithStatusCode(_0x29dde2,null))['catch'](handleError(_0x29dde2,null));};exports[_0xd6cd('0x7c')]=function(_0x2fda8f,_0x265ded,_0x5262e1){return db[_0xd6cd('0x6d')]['findAll']({'where':{'id':_0x2fda8f[_0xd6cd('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd6cd('0x71')],'as':_0xd6cd('0x72'),'attributes':['id'],'raw':!![]}]})[_0xd6cd('0x1f')](handleEntityNotFound(_0x265ded,null))[_0xd6cd('0x1f')](function(_0x4d7c52){var _0x1cefcd=_['map'](_0x4d7c52,'id');var _0x2f8239=[];var _0x1a971f=[];var _0x3804b8=squel[_0xd6cd('0x7d')]();_0x3804b8[_0xd6cd('0x7e')](_0xd6cd('0x7f'))[_0xd6cd('0x80')](_0xd6cd('0x81'),'tq')[_0xd6cd('0x82')]('user_has_teams','ut',_0xd6cd('0x83'))[_0xd6cd('0x4f')](_0xd6cd('0x84'),_0x2fda8f[_0xd6cd('0x5f')]['id']);for(var _0x310a6d=0x0;_0x310a6d<_0x4d7c52['length'];_0x310a6d+=0x1){let _0x465189=_0x4d7c52[_0x310a6d];for(var _0x27b9dc=0x0;_0x27b9dc<_0x465189[_0xd6cd('0x72')][_0xd6cd('0x47')];_0x27b9dc+=0x1){let _0x27beae=_0x465189['Agents'][_0x27b9dc];var _0x1047cd=_0x3804b8[_0xd6cd('0x85')]();_0x1047cd[_0xd6cd('0x4f')](_0xd6cd('0x86'),_0x27beae['id']);_0x1a971f[_0xd6cd('0x87')](db['sequelize'][_0xd6cd('0x42')](_0x1047cd[_0xd6cd('0x88')](),{'type':db['sequelize'][_0xd6cd('0x89')][_0xd6cd('0x8a')]})[_0xd6cd('0x1f')](function(_0x4e7a37){if(_0x4e7a37[_0xd6cd('0x47')]===0x1){return _0x27beae['id'];}else{var _0x2c1022=_[_0xd6cd('0x8b')](_['map'](_0x4e7a37,_0xd6cd('0x8c')),function(_0x13afb9){return _[_0xd6cd('0x8d')](_0x1cefcd,_0x13afb9);});if(_0x2c1022){return _0x27beae['id'];}}}));}}return BPromise[_0xd6cd('0x8e')](_0x1a971f)[_0xd6cd('0x1f')](function(_0x1b1fe4){_0x2f8239=_(_0x2f8239)['union'](_0x1b1fe4)[_0xd6cd('0x8f')]()[_0xd6cd('0x90')]();return db[_0xd6cd('0x3d')][_0xd6cd('0x57')]({'where':{'id':_0x2fda8f[_0xd6cd('0x5f')]['id']}})[_0xd6cd('0x1f')](function(_0x5055d5){return db[_0xd6cd('0x77')][_0xd6cd('0x78')](function(_0x1faaf6){return _0x5055d5['removeTeams'](_0x2fda8f[_0xd6cd('0x42')]['ids'],{'transaction':_0x1faaf6})[_0xd6cd('0x1f')](function(){if(!_['isEmpty'](_0x2f8239)){return _0x5055d5[_0xd6cd('0x91')](_0x2f8239,{'transaction':_0x1faaf6});}})[_0xd6cd('0x1f')](function(){_0x2f8239[_0xd6cd('0x92')](function(_0x5ba67c){socket['emit'](_0xd6cd('0x93'),{'UserId':_0x5ba67c,'ChatQueueId':_0x5055d5['id']});});});});});});})[_0xd6cd('0x1f')](respondWithStatusCode(_0x265ded,null))[_0xd6cd('0x29')](handleError(_0x265ded,null));};exports[_0xd6cd('0x94')]=function(_0x220211,_0xbd0767,_0x50d3e0){return db[_0xd6cd('0x3d')][_0xd6cd('0x57')]({'where':{'id':_0x220211[_0xd6cd('0x5f')]['id']}})['then'](handleEntityNotFound(_0xbd0767,null))['then'](function(_0x23a5c9){if(_0x23a5c9){return _0x23a5c9[_0xd6cd('0x94')](_0x220211['body'][_0xd6cd('0x70')],_[_0xd6cd('0x95')](_0x220211[_0xd6cd('0x59')],[_0xd6cd('0x70'),'id'])||{})['spread'](function(_0x470d7e){for(var _0x58adad=0x0;_0x58adad<_0x220211[_0xd6cd('0x59')][_0xd6cd('0x70')][_0xd6cd('0x47')];_0x58adad+=0x1){socket[_0xd6cd('0x7b')]('userChatQueue:save',{'UserId':Number(_0x220211[_0xd6cd('0x59')]['ids'][_0x58adad]),'ChatQueueId':Number(_0x220211[_0xd6cd('0x5f')]['id'])});}return _0x470d7e;});}})[_0xd6cd('0x1f')](respondWithResult(_0xbd0767,null))[_0xd6cd('0x29')](handleError(_0xbd0767,null));};exports['removeAgents']=function(_0x3a5604,_0x38a217,_0x152ae0){return db['ChatQueue'][_0xd6cd('0x57')]({'where':{'id':_0x3a5604[_0xd6cd('0x5f')]['id']}})[_0xd6cd('0x1f')](handleEntityNotFound(_0x38a217,null))[_0xd6cd('0x1f')](function(_0x3d2381){if(_0x3d2381){return _0x3d2381[_0xd6cd('0x91')](_0x3a5604[_0xd6cd('0x42')]['ids'])[_0xd6cd('0x1f')](function(){if(_[_0xd6cd('0x96')](_0x3a5604[_0xd6cd('0x42')][_0xd6cd('0x70')])){for(var _0x31d63e=0x0;_0x31d63e<_0x3a5604[_0xd6cd('0x42')][_0xd6cd('0x70')][_0xd6cd('0x47')];_0x31d63e+=0x1){socket[_0xd6cd('0x7b')](_0xd6cd('0x93'),{'UserId':Number(_0x3a5604[_0xd6cd('0x42')][_0xd6cd('0x70')][_0x31d63e]),'ChatQueueId':Number(_0x3a5604[_0xd6cd('0x5f')]['id'])});}}else{socket['emit'](_0xd6cd('0x93'),{'UserId':Number(_0x3a5604['query']['ids']),'ChatQueueId':Number(_0x3a5604['params']['id'])});}});}})[_0xd6cd('0x1f')](respondWithStatusCode(_0x38a217,null))[_0xd6cd('0x29')](handleError(_0x38a217,null));};exports['getAgents']=function(_0xf92a66,_0x46ce19,_0x249473){var _0x383ea2={};var _0x174b6c={};var _0x5ed84d;var _0x76e717;return db['ChatQueue']['findOne']({'where':{'id':_0xf92a66['params']['id']}})[_0xd6cd('0x1f')](handleEntityNotFound(_0x46ce19,null))[_0xd6cd('0x1f')](function(_0x5a551f){if(_0x5a551f){_0x5ed84d=_0x5a551f;_0x174b6c[_0xd6cd('0x41')]=_['keys'](db[_0xd6cd('0x71')][_0xd6cd('0x3e')]);_0x174b6c[_0xd6cd('0x42')]=_[_0xd6cd('0x43')](_0xf92a66['query']);_0x174b6c[_0xd6cd('0x4c')]=_[_0xd6cd('0x44')](_0x174b6c[_0xd6cd('0x41')],_0x174b6c[_0xd6cd('0x42')]);_0x383ea2[_0xd6cd('0x45')]=_[_0xd6cd('0x44')](_0x174b6c[_0xd6cd('0x41')],qs[_0xd6cd('0x46')](_0xf92a66[_0xd6cd('0x42')][_0xd6cd('0x46')]));_0x383ea2[_0xd6cd('0x45')]=_0x383ea2[_0xd6cd('0x45')][_0xd6cd('0x47')]?_0x383ea2[_0xd6cd('0x45')]:_0x174b6c[_0xd6cd('0x41')];_0x383ea2['order']=qs[_0xd6cd('0x4b')](_0xf92a66['query']['sort']);_0x383ea2[_0xd6cd('0x4f')]=qs['filters'](_['pick'](_0xf92a66['query'],_0x174b6c[_0xd6cd('0x4c')]));if(_0xf92a66[_0xd6cd('0x42')][_0xd6cd('0x4e')]){_0x383ea2[_0xd6cd('0x4f')]=_[_0xd6cd('0x50')](_0x383ea2[_0xd6cd('0x4f')],{'$or':_['map'](_0x383ea2[_0xd6cd('0x45')],function(_0x3900b2){var _0x24e8cf={};_0x24e8cf[_0x3900b2]={'$like':'%'+_0xf92a66[_0xd6cd('0x42')][_0xd6cd('0x4e')]+'%'};return _0x24e8cf;})});}_0x383ea2=_['merge']({},_0x383ea2,_0xf92a66['options']);return _0x5ed84d[_0xd6cd('0x97')](_0x383ea2);}})[_0xd6cd('0x1f')](function(_0x2a43db){if(_0x2a43db){_0x76e717=_0x2a43db['length'];if(!_0xf92a66[_0xd6cd('0x42')][_0xd6cd('0x48')]('nolimit')){_0x383ea2[_0xd6cd('0x2d')]=qs['limit'](_0xf92a66['query'][_0xd6cd('0x2d')]);_0x383ea2[_0xd6cd('0x2f')]=qs[_0xd6cd('0x2f')](_0xf92a66['query'][_0xd6cd('0x2f')]);}return _0x5ed84d['getAgents'](_0x383ea2);}})['then'](function(_0x19ac6c){if(_0x19ac6c){return _0x19ac6c?{'count':_0x76e717,'rows':_0x19ac6c}:null;}})['then'](respondWithResult(_0x46ce19,null))[_0xd6cd('0x29')](handleError(_0x46ce19,null));};
\ No newline at end of file
+var _0xb0ad=['localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','findAll','rows','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','params','describe','getMembers','findOne','UserChatQueue','findAndCountAll','agent','chatPause','updatedAt','format','%s/%s','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','push','sequelize','every','TeamId','all','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','order','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0x1ff192,_0x350338){var _0x11f5ad=function(_0x492244){while(--_0x492244){_0x1ff192['push'](_0x1ff192['shift']());}};_0x11f5ad(++_0x350338);}(_0xb0ad,0x113));var _0xdb0a=function(_0x46fc52,_0x1dcbe4){_0x46fc52=_0x46fc52-0x0;var _0x3a4be0=_0xb0ad[_0x46fc52];return _0x3a4be0;};'use strict';var emlformat=require(_0xdb0a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb0a('0x1'));var jsonpatch=require(_0xdb0a('0x2'));var rp=require(_0xdb0a('0x3'));var moment=require('moment');var BPromise=require(_0xdb0a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdb0a('0x5'));var sox=require(_0xdb0a('0x6'));var csv=require(_0xdb0a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb0a('0x8'));var squel=require(_0xdb0a('0x9'));var crypto=require(_0xdb0a('0xa'));var jsforce=require(_0xdb0a('0xb'));var deskjs=require(_0xdb0a('0xc'));var toCsv=require(_0xdb0a('0x7'));var querystring=require(_0xdb0a('0xd'));var Papa=require(_0xdb0a('0xe'));var Redis=require(_0xdb0a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdb0a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb0a('0x11'))(_0xdb0a('0x12'));var utils=require(_0xdb0a('0x13'));var config=require(_0xdb0a('0x14'));var licenseUtil=require(_0xdb0a('0x15'));var db=require(_0xdb0a('0x16'))['db'];config['redis']=_[_0xdb0a('0x17')](config[_0xdb0a('0x18')],{'host':_0xdb0a('0x19'),'port':0x18eb});var socket=require(_0xdb0a('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xdb0a('0x1b')](socket);var jayson=require(_0xdb0a('0x1c'));var client=jayson[_0xdb0a('0x1d')][_0xdb0a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xd6f476,_0x3a12c3,_0x5711c7,_0x43415d){return new BPromise(function(_0x45223d,_0x595fc0){var _0x401fc2=_0x43415d||client;return _0x401fc2['request'](_0xd6f476,_0x5711c7)[_0xdb0a('0x1f')](function(_0xdd4568){logger[_0xdb0a('0x20')](_0xdb0a('0x21'),_0x3a12c3,_0xdb0a('0x22'));logger[_0xdb0a('0x23')](_0xdb0a('0x24'),_0x3a12c3,_0xdb0a('0x22'),JSON[_0xdb0a('0x25')](_0xdd4568));if(_0xdd4568[_0xdb0a('0x26')]){if(_0xdd4568[_0xdb0a('0x26')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3a12c3,_0xdd4568[_0xdb0a('0x26')][_0xdb0a('0x27')]);return _0x595fc0(_0xdd4568[_0xdb0a('0x26')][_0xdb0a('0x27')]);}logger[_0xdb0a('0x26')](_0xdb0a('0x21'),_0x3a12c3,_0xdd4568[_0xdb0a('0x26')][_0xdb0a('0x27')]);return _0x45223d(_0xdd4568[_0xdb0a('0x26')]['message']);}else{logger[_0xdb0a('0x20')]('ChatQueue,\x20%s,\x20%s',_0x3a12c3,_0xdb0a('0x22'));_0x45223d(_0xdd4568[_0xdb0a('0x28')][_0xdb0a('0x27')]);}})[_0xdb0a('0x29')](function(_0x406246){logger[_0xdb0a('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3a12c3,_0x406246);_0x595fc0(_0x406246);});});}function respondWithStatusCode(_0x5ab7a6,_0x1153a2){_0x1153a2=_0x1153a2||0xcc;return function(_0xf1a2c8){if(_0xf1a2c8){return _0x5ab7a6[_0xdb0a('0x2a')](_0x1153a2);}return _0x5ab7a6[_0xdb0a('0x2b')](_0x1153a2)['end']();};}function respondWithResult(_0x3f5b2d,_0x448d59){_0x448d59=_0x448d59||0xc8;return function(_0x3bce13){if(_0x3bce13){return _0x3f5b2d[_0xdb0a('0x2b')](_0x448d59)[_0xdb0a('0x2c')](_0x3bce13);}};}function respondWithFilteredResult(_0xb98459,_0x26a327){return function(_0x26fce9){if(_0x26fce9){var _0x3b586c=typeof _0x26a327[_0xdb0a('0x2d')]===_0xdb0a('0x2e')&&typeof _0x26a327[_0xdb0a('0x2f')]===_0xdb0a('0x2e');var _0x1052a2=_0x26fce9[_0xdb0a('0x30')];var _0x3e49d4=_0x3b586c?0x0:_0x26a327['offset'];var _0x532870=_0x3b586c?_0x26fce9['count']:_0x26a327[_0xdb0a('0x2d')]+_0x26a327[_0xdb0a('0x2f')];var _0x244fdf;if(_0x532870>=_0x1052a2){_0x532870=_0x1052a2;_0x244fdf=0xc8;}else{_0x244fdf=0xce;}_0xb98459['status'](_0x244fdf);return _0xb98459[_0xdb0a('0x31')](_0xdb0a('0x32'),_0x3e49d4+'-'+_0x532870+'/'+_0x1052a2)['json'](_0x26fce9);}return null;};}function patchUpdates(_0x5e8b13){return function(_0x306254){try{jsonpatch[_0xdb0a('0x33')](_0x306254,_0x5e8b13,!![]);}catch(_0x47ad0c){return BPromise[_0xdb0a('0x34')](_0x47ad0c);}return _0x306254[_0xdb0a('0x35')]();};}function saveUpdates(_0xf0d148,_0x2e4709){return function(_0x4bbb79){if(_0x4bbb79){return _0x4bbb79['update'](_0xf0d148)[_0xdb0a('0x1f')](function(_0xe487b2){return _0xe487b2;});}return null;};}function removeEntity(_0x95e6bd,_0x45b95e){return function(_0x54bd93){if(_0x54bd93){return _0x54bd93[_0xdb0a('0x36')]()[_0xdb0a('0x1f')](function(){var _0x3dae8c=_0x54bd93[_0xdb0a('0x37')]({'plain':!![]});var _0x34f520=_0xdb0a('0x38');return db[_0xdb0a('0x39')][_0xdb0a('0x36')]({'where':{'type':_0x34f520,'resourceId':_0x3dae8c['id']}})[_0xdb0a('0x1f')](function(){return _0x54bd93;});})['then'](function(){_0x95e6bd[_0xdb0a('0x2b')](0xcc)[_0xdb0a('0x3a')]();});}};}function handleEntityNotFound(_0x49d4ae,_0x34c5de){return function(_0x3cd66c){if(!_0x3cd66c){_0x49d4ae[_0xdb0a('0x2a')](0x194);}return _0x3cd66c;};}function handleError(_0x11dde0,_0xb24ac){_0xb24ac=_0xb24ac||0x1f4;return function(_0x50652d){logger[_0xdb0a('0x26')](_0x50652d[_0xdb0a('0x3b')]);if(_0x50652d[_0xdb0a('0x3c')]){delete _0x50652d[_0xdb0a('0x3c')];}_0x11dde0[_0xdb0a('0x2b')](_0xb24ac)[_0xdb0a('0x3d')](_0x50652d);};}exports[_0xdb0a('0x3e')]=function(_0x3df1ac,_0x3b8149){var _0x175004={},_0x41fea4={},_0xa281d4={'count':0x0,'rows':[]};var _0x1e8f0d=_[_0xdb0a('0x3f')](db[_0xdb0a('0x40')][_0xdb0a('0x41')],function(_0x2eb56f){return{'name':_0x2eb56f[_0xdb0a('0x42')],'type':_0x2eb56f[_0xdb0a('0x43')][_0xdb0a('0x44')]};});_0x41fea4[_0xdb0a('0x45')]=_[_0xdb0a('0x3f')](_0x1e8f0d,'name');_0x41fea4[_0xdb0a('0x46')]=_[_0xdb0a('0x47')](_0x3df1ac[_0xdb0a('0x46')]);_0x41fea4['filters']=_[_0xdb0a('0x48')](_0x41fea4[_0xdb0a('0x45')],_0x41fea4['query']);_0x175004[_0xdb0a('0x49')]=_[_0xdb0a('0x48')](_0x41fea4[_0xdb0a('0x45')],qs[_0xdb0a('0x4a')](_0x3df1ac[_0xdb0a('0x46')][_0xdb0a('0x4a')]));_0x175004['attributes']=_0x175004[_0xdb0a('0x49')][_0xdb0a('0x4b')]?_0x175004[_0xdb0a('0x49')]:_0x41fea4[_0xdb0a('0x45')];if(!_0x3df1ac[_0xdb0a('0x46')][_0xdb0a('0x4c')](_0xdb0a('0x4d'))){_0x175004[_0xdb0a('0x2f')]=qs['limit'](_0x3df1ac['query']['limit']);_0x175004[_0xdb0a('0x2d')]=qs[_0xdb0a('0x2d')](_0x3df1ac['query'][_0xdb0a('0x2d')]);}_0x175004['order']=qs[_0xdb0a('0x4e')](_0x3df1ac[_0xdb0a('0x46')][_0xdb0a('0x4e')]);_0x175004[_0xdb0a('0x4f')]=qs[_0xdb0a('0x50')](_[_0xdb0a('0x51')](_0x3df1ac[_0xdb0a('0x46')],_0x41fea4[_0xdb0a('0x50')]),_0x1e8f0d);if(_0x3df1ac[_0xdb0a('0x46')][_0xdb0a('0x52')]){_0x175004[_0xdb0a('0x4f')]=_[_0xdb0a('0x53')](_0x175004[_0xdb0a('0x4f')],{'$or':_['map'](_0x1e8f0d,function(_0x4de2b9){if(_0x4de2b9[_0xdb0a('0x43')]!=='VIRTUAL'){var _0x3837a4={};_0x3837a4[_0x4de2b9[_0xdb0a('0x3c')]]={'$like':'%'+_0x3df1ac[_0xdb0a('0x46')][_0xdb0a('0x52')]+'%'};return _0x3837a4;}})});}_0x175004=_[_0xdb0a('0x53')]({},_0x175004,_0x3df1ac['options']);var _0x2bb342={'where':_0x175004[_0xdb0a('0x4f')]};return db['ChatQueue'][_0xdb0a('0x30')](_0x2bb342)['then'](function(_0xf226b1){_0xa281d4[_0xdb0a('0x30')]=_0xf226b1;if(_0x3df1ac[_0xdb0a('0x46')]['includeAll']){_0x175004['include']=[{'all':!![]}];}return db['ChatQueue'][_0xdb0a('0x54')](_0x175004);})['then'](function(_0x141383){_0xa281d4[_0xdb0a('0x55')]=_0x141383;return _0xa281d4;})[_0xdb0a('0x1f')](respondWithFilteredResult(_0x3b8149,_0x175004))[_0xdb0a('0x29')](handleError(_0x3b8149,null));};exports['show']=function(_0x12bb6d,_0x4dd154){var _0x3d0e33={'raw':!![],'where':{'id':_0x12bb6d['params']['id']}},_0x115e60={};_0x115e60[_0xdb0a('0x45')]=_[_0xdb0a('0x47')](db[_0xdb0a('0x40')][_0xdb0a('0x41')]);_0x115e60[_0xdb0a('0x46')]=_[_0xdb0a('0x47')](_0x12bb6d[_0xdb0a('0x46')]);_0x115e60['filters']=_['intersection'](_0x115e60['model'],_0x115e60[_0xdb0a('0x46')]);_0x3d0e33[_0xdb0a('0x49')]=_[_0xdb0a('0x48')](_0x115e60[_0xdb0a('0x45')],qs[_0xdb0a('0x4a')](_0x12bb6d[_0xdb0a('0x46')][_0xdb0a('0x4a')]));_0x3d0e33[_0xdb0a('0x49')]=_0x3d0e33[_0xdb0a('0x49')][_0xdb0a('0x4b')]?_0x3d0e33[_0xdb0a('0x49')]:_0x115e60['model'];if(_0x12bb6d['query'][_0xdb0a('0x56')]){_0x3d0e33[_0xdb0a('0x57')]=[{'all':!![]}];}_0x3d0e33=_[_0xdb0a('0x53')]({},_0x3d0e33,_0x12bb6d[_0xdb0a('0x58')]);return db['ChatQueue'][_0xdb0a('0x59')](_0x3d0e33)[_0xdb0a('0x1f')](handleEntityNotFound(_0x4dd154,null))[_0xdb0a('0x1f')](respondWithResult(_0x4dd154,null))[_0xdb0a('0x29')](handleError(_0x4dd154,null));};exports[_0xdb0a('0x5a')]=function(_0x1df126,_0x40b4b7){return db[_0xdb0a('0x40')][_0xdb0a('0x5a')](_0x1df126['body'],{})[_0xdb0a('0x1f')](function(_0x14f41b){var _0x1b3e83=_0x1df126[_0xdb0a('0x5b')][_0xdb0a('0x37')]({'plain':!![]});if(!_0x1b3e83)throw new Error(_0xdb0a('0x5c'));if(_0x1b3e83[_0xdb0a('0x5d')]===_0xdb0a('0x5b')){var _0x271416=_0x14f41b[_0xdb0a('0x37')]({'plain':!![]});var _0x56556a=_0xdb0a('0x38');return db[_0xdb0a('0x5e')][_0xdb0a('0x59')]({'where':{'name':_0x56556a,'userProfileId':_0x1b3e83[_0xdb0a('0x5f')]},'raw':!![]})['then'](function(_0x2561aa){if(_0x2561aa&&_0x2561aa[_0xdb0a('0x60')]===0x0){return db[_0xdb0a('0x39')][_0xdb0a('0x5a')]({'name':_0x271416[_0xdb0a('0x3c')],'resourceId':_0x271416['id'],'type':_0x2561aa['name'],'sectionId':_0x2561aa['id']},{})['then'](function(){return _0x14f41b;});}else{return _0x14f41b;}})[_0xdb0a('0x29')](function(_0x1401ed){logger[_0xdb0a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1401ed);throw _0x1401ed;});}return _0x14f41b;})[_0xdb0a('0x1f')](respondWithResult(_0x40b4b7,0xc9))[_0xdb0a('0x29')](handleError(_0x40b4b7,null));};exports[_0xdb0a('0x61')]=function(_0x57d26f,_0x1345a2){if(_0x57d26f[_0xdb0a('0x62')]['id']){delete _0x57d26f[_0xdb0a('0x62')]['id'];}return db['ChatQueue'][_0xdb0a('0x59')]({'where':{'id':_0x57d26f[_0xdb0a('0x63')]['id']}})[_0xdb0a('0x1f')](handleEntityNotFound(_0x1345a2,null))[_0xdb0a('0x1f')](saveUpdates(_0x57d26f[_0xdb0a('0x62')],null))['then'](respondWithResult(_0x1345a2,null))[_0xdb0a('0x29')](handleError(_0x1345a2,null));};exports[_0xdb0a('0x36')]=function(_0x239f57,_0x139826){return db[_0xdb0a('0x40')][_0xdb0a('0x59')]({'where':{'id':_0x239f57[_0xdb0a('0x63')]['id']}})[_0xdb0a('0x1f')](handleEntityNotFound(_0x139826,null))[_0xdb0a('0x1f')](removeEntity(_0x139826,null))[_0xdb0a('0x29')](handleError(_0x139826,null));};exports[_0xdb0a('0x64')]=function(_0xd58b2e,_0x591f6a){return db['ChatQueue'][_0xdb0a('0x64')]()['then'](respondWithResult(_0x591f6a,null))[_0xdb0a('0x29')](handleError(_0x591f6a,null));};exports[_0xdb0a('0x65')]=function(_0xcca25,_0x491098,_0x3a7514){var _0x58c006={'raw':!![],'where':{}},_0x41281c={},_0x219934;return db[_0xdb0a('0x40')][_0xdb0a('0x66')]({'where':{'id':_0xcca25[_0xdb0a('0x63')]['id']}})[_0xdb0a('0x1f')](handleEntityNotFound(_0x491098,null))[_0xdb0a('0x1f')](function(_0x3dbc21){if(_0x3dbc21){_0x219934=_0x3dbc21[_0xdb0a('0x37')]({'plain':!![]});_0x41281c[_0xdb0a('0x45')]=_['keys'](db['UserChatQueue'][_0xdb0a('0x41')]);_0x41281c['query']=_[_0xdb0a('0x47')](_0xcca25[_0xdb0a('0x46')]);_0x41281c['filters']=_['intersection'](_0x41281c[_0xdb0a('0x45')],_0x41281c[_0xdb0a('0x46')]);_0x58c006[_0xdb0a('0x49')]=_[_0xdb0a('0x48')](_0x41281c[_0xdb0a('0x45')],qs['fields'](_0xcca25[_0xdb0a('0x46')]['fields']));_0x58c006[_0xdb0a('0x49')]=_0x58c006[_0xdb0a('0x49')][_0xdb0a('0x4b')]?_0x58c006[_0xdb0a('0x49')]:_0x41281c[_0xdb0a('0x45')];if(!_0xcca25[_0xdb0a('0x46')]['hasOwnProperty'](_0xdb0a('0x4d'))){_0x58c006[_0xdb0a('0x2f')]=qs['limit'](_0xcca25[_0xdb0a('0x46')][_0xdb0a('0x2f')]);_0x58c006[_0xdb0a('0x2d')]=qs['offset'](_0xcca25[_0xdb0a('0x46')]['offset']);}_0x58c006['order']=qs[_0xdb0a('0x4e')](_0xcca25['query'][_0xdb0a('0x4e')]);_0x58c006['where']=qs[_0xdb0a('0x50')](_[_0xdb0a('0x51')](_0xcca25[_0xdb0a('0x46')],_0x41281c['filters']));_0x58c006[_0xdb0a('0x4f')]['ChatQueueId']=_0x3dbc21['id'];if(_0xcca25[_0xdb0a('0x46')][_0xdb0a('0x52')]){_0x58c006[_0xdb0a('0x4f')]=_[_0xdb0a('0x53')](_0x58c006[_0xdb0a('0x4f')],{'$or':_[_0xdb0a('0x3f')](_0x58c006[_0xdb0a('0x49')],function(_0x15f5ab){var _0x44ad38={};_0x44ad38[_0x15f5ab]={'$like':'%'+_0xcca25['query'][_0xdb0a('0x52')]+'%'};return _0x44ad38;})});}_0x58c006=_['merge']({},_0x58c006,_0xcca25[_0xdb0a('0x58')]);return db[_0xdb0a('0x67')][_0xdb0a('0x54')](_0x58c006);}})[_0xdb0a('0x1f')](function(_0x2d64a6){if(_0x2d64a6){return db['User'][_0xdb0a('0x68')]({'where':{'id':_[_0xdb0a('0x3f')](_0x2d64a6,'UserId'),'role':_0xdb0a('0x69')},'attributes':['id',_0xdb0a('0x3c'),_0xdb0a('0x6a'),_0xdb0a('0x6b'),'createdAt']});}})['then'](function(_0x62e4c0){if(_0x62e4c0){return{'count':_0x62e4c0['count'],'rows':_[_0xdb0a('0x3f')](_0x62e4c0['rows'],function(_0x4e16bd){return{'membername':_0x4e16bd[_0xdb0a('0x3c')],'UserId':_0x4e16bd['id'],'queue_name':_0x219934['name'],'ChatQueueId':_0x219934['id'],'interface':util[_0xdb0a('0x6c')](_0xdb0a('0x6d'),'SIP',_0x4e16bd[_0xdb0a('0x3c')]),'penalty':0x0,'paused':_0x4e16bd['chatPause'],'createdAt':_0x4e16bd['createdAt'],'updatedAt':_0x4e16bd[_0xdb0a('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x491098,_0x58c006))['catch'](handleError(_0x491098,null));};exports[_0xdb0a('0x6e')]=function(_0x1d849d,_0x2de924,_0x4c0ae8){var _0x45e7bc={};var _0x28db73={};var _0xff1820;var _0x14df8e;return db[_0xdb0a('0x40')][_0xdb0a('0x66')]({'where':{'id':_0x1d849d[_0xdb0a('0x63')]['id']}})[_0xdb0a('0x1f')](handleEntityNotFound(_0x2de924,null))[_0xdb0a('0x1f')](function(_0x3d1ebe){if(_0x3d1ebe){_0xff1820=_0x3d1ebe;_0x28db73[_0xdb0a('0x45')]=_['keys'](db['Team']['rawAttributes']);_0x28db73[_0xdb0a('0x46')]=_[_0xdb0a('0x47')](_0x1d849d[_0xdb0a('0x46')]);_0x28db73[_0xdb0a('0x50')]=_[_0xdb0a('0x48')](_0x28db73[_0xdb0a('0x45')],_0x28db73[_0xdb0a('0x46')]);_0x45e7bc['attributes']=_[_0xdb0a('0x48')](_0x28db73['model'],qs['fields'](_0x1d849d[_0xdb0a('0x46')][_0xdb0a('0x4a')]));_0x45e7bc[_0xdb0a('0x49')]=_0x45e7bc[_0xdb0a('0x49')][_0xdb0a('0x4b')]?_0x45e7bc[_0xdb0a('0x49')]:_0x28db73[_0xdb0a('0x45')];_0x45e7bc['order']=qs[_0xdb0a('0x4e')](_0x1d849d['query'][_0xdb0a('0x4e')]);_0x45e7bc['where']=qs['filters'](_['pick'](_0x1d849d['query'],_0x28db73['filters']));if(_0x1d849d[_0xdb0a('0x46')]['filter']){_0x45e7bc[_0xdb0a('0x4f')]=_['merge'](_0x45e7bc[_0xdb0a('0x4f')],{'$or':_[_0xdb0a('0x3f')](_0x45e7bc[_0xdb0a('0x49')],function(_0x581d6d){var _0x14f2ed={};_0x14f2ed[_0x581d6d]={'$like':'%'+_0x1d849d[_0xdb0a('0x46')][_0xdb0a('0x52')]+'%'};return _0x14f2ed;})});}_0x45e7bc=_['merge']({},_0x45e7bc,_0x1d849d['options']);return _0xff1820[_0xdb0a('0x6e')](_0x45e7bc);}})[_0xdb0a('0x1f')](function(_0xaf4a0f){if(_0xaf4a0f){_0x14df8e=_0xaf4a0f[_0xdb0a('0x4b')];if(!_0x1d849d[_0xdb0a('0x46')][_0xdb0a('0x4c')](_0xdb0a('0x4d'))){_0x45e7bc[_0xdb0a('0x2f')]=qs[_0xdb0a('0x2f')](_0x1d849d[_0xdb0a('0x46')][_0xdb0a('0x2f')]);_0x45e7bc[_0xdb0a('0x2d')]=qs[_0xdb0a('0x2d')](_0x1d849d['query'][_0xdb0a('0x2d')]);}return _0xff1820[_0xdb0a('0x6e')](_0x45e7bc);}})[_0xdb0a('0x1f')](function(_0x20c058){if(_0x20c058){return _0x20c058?{'count':_0x14df8e,'rows':_0x20c058}:null;}})[_0xdb0a('0x1f')](respondWithResult(_0x2de924,null))['catch'](handleError(_0x2de924,null));};exports[_0xdb0a('0x6f')]=function(_0x203754,_0x394cb7,_0x5b1a09){var _0x4af425=_0x203754[_0xdb0a('0x62')][_0xdb0a('0x70')];return db[_0xdb0a('0x71')][_0xdb0a('0x54')]({'where':{'id':_0x4af425},'attributes':['id'],'include':[{'model':db[_0xdb0a('0x72')],'as':_0xdb0a('0x73'),'attributes':['id',_0xdb0a('0x3c'),_0xdb0a('0x74'),_0xdb0a('0x75'),'interface'],'raw':!![]}]})[_0xdb0a('0x1f')](function(_0x1565a2){if(_0x1565a2){var _0x292667=_[_0xdb0a('0x76')](_0x1565a2,function(_0xc826d4){var _0x51a7c3=_0xc826d4[_0xdb0a('0x37')]({'plain':!![]});return _0x51a7c3['Agents'];});return db[_0xdb0a('0x40')][_0xdb0a('0x59')]({'where':{'id':_0x203754[_0xdb0a('0x63')]['id']}})['then'](function(_0x174f75){return db['sequelize'][_0xdb0a('0x77')](function(_0x14836b){return _0x174f75[_0xdb0a('0x6f')](_0x4af425,{'transaction':_0x14836b})['then'](function(){return BPromise[_0xdb0a('0x78')](_0x292667,function(_0x346bf5){return db[_0xdb0a('0x67')][_0xdb0a('0x79')]({'where':{'UserId':_0x346bf5['id'],'ChatQueueId':_0x203754['params']['id']},'transaction':_0x14836b});});})[_0xdb0a('0x1f')](function(){_0x292667[_0xdb0a('0x7a')](function(_0x22e82b){socket[_0xdb0a('0x7b')](_0xdb0a('0x7c'),{'UserId':_0x22e82b['id'],'ChatQueueId':_0x174f75['id']});});});});});}})[_0xdb0a('0x1f')](respondWithStatusCode(_0x394cb7,null))[_0xdb0a('0x29')](handleError(_0x394cb7,null));};exports[_0xdb0a('0x7d')]=function(_0x58ca99,_0x538344,_0x178989){return db['Team'][_0xdb0a('0x54')]({'where':{'id':_0x58ca99['query'][_0xdb0a('0x70')]},'attributes':['id'],'include':[{'model':db[_0xdb0a('0x72')],'as':_0xdb0a('0x73'),'attributes':['id'],'raw':!![]}]})[_0xdb0a('0x1f')](handleEntityNotFound(_0x538344,null))['then'](function(_0x16329f){var _0x287bbb=_[_0xdb0a('0x3f')](_0x16329f,'id');var _0x4f366c=[];var _0x33bf24=[];var _0x2304c2=squel[_0xdb0a('0x7e')]();_0x2304c2[_0xdb0a('0x7f')](_0xdb0a('0x80'))[_0xdb0a('0x81')](_0xdb0a('0x82'),'tq')['join'](_0xdb0a('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdb0a('0x4f')](_0xdb0a('0x84'),_0x58ca99['params']['id']);for(var _0x19605a=0x0;_0x19605a<_0x16329f[_0xdb0a('0x4b')];_0x19605a+=0x1){let _0x4f2ba4=_0x16329f[_0x19605a];for(var _0x544e1c=0x0;_0x544e1c<_0x4f2ba4['Agents'][_0xdb0a('0x4b')];_0x544e1c+=0x1){let _0x1cf9f8=_0x4f2ba4[_0xdb0a('0x73')][_0x544e1c];var _0x46a5b2=_0x2304c2[_0xdb0a('0x85')]();_0x46a5b2[_0xdb0a('0x4f')]('ut.UserId\x20=\x20?',_0x1cf9f8['id']);_0x33bf24[_0xdb0a('0x86')](db[_0xdb0a('0x87')][_0xdb0a('0x46')](_0x46a5b2['toString'](),{'type':db[_0xdb0a('0x87')]['QueryTypes']['SELECT']})[_0xdb0a('0x1f')](function(_0x659206){if(_0x659206[_0xdb0a('0x4b')]===0x1){return _0x1cf9f8['id'];}else{var _0x4eac3f=_[_0xdb0a('0x88')](_[_0xdb0a('0x3f')](_0x659206,_0xdb0a('0x89')),function(_0x2e3d43){return _['includes'](_0x287bbb,_0x2e3d43);});if(_0x4eac3f){return _0x1cf9f8['id'];}}}));}}return BPromise[_0xdb0a('0x8a')](_0x33bf24)['then'](function(_0x443255){_0x4f366c=_(_0x4f366c)['union'](_0x443255)[_0xdb0a('0x8b')]()[_0xdb0a('0x8c')]();return db[_0xdb0a('0x40')]['find']({'where':{'id':_0x58ca99[_0xdb0a('0x63')]['id']}})[_0xdb0a('0x1f')](function(_0x40d715){return db['sequelize']['transaction'](function(_0x5b3e23){return _0x40d715[_0xdb0a('0x7d')](_0x58ca99[_0xdb0a('0x46')][_0xdb0a('0x70')],{'transaction':_0x5b3e23})[_0xdb0a('0x1f')](function(){if(!_[_0xdb0a('0x8d')](_0x4f366c)){return _0x40d715['removeAgents'](_0x4f366c,{'transaction':_0x5b3e23});}})[_0xdb0a('0x1f')](function(){_0x4f366c[_0xdb0a('0x7a')](function(_0x8c7b2a){socket[_0xdb0a('0x7b')](_0xdb0a('0x8e'),{'UserId':_0x8c7b2a,'ChatQueueId':_0x40d715['id']});});});});});});})['then'](respondWithStatusCode(_0x538344,null))[_0xdb0a('0x29')](handleError(_0x538344,null));};exports['addAgents']=function(_0xc1fc21,_0x7074ba,_0x542648){return db[_0xdb0a('0x40')]['find']({'where':{'id':_0xc1fc21['params']['id']}})[_0xdb0a('0x1f')](handleEntityNotFound(_0x7074ba,null))[_0xdb0a('0x1f')](function(_0x40a0bd){if(_0x40a0bd){return _0x40a0bd[_0xdb0a('0x8f')](_0xc1fc21[_0xdb0a('0x62')]['ids'],_[_0xdb0a('0x90')](_0xc1fc21[_0xdb0a('0x62')],[_0xdb0a('0x70'),'id'])||{})[_0xdb0a('0x91')](function(_0x176328){for(var _0x5078c8=0x0;_0x5078c8<_0xc1fc21[_0xdb0a('0x62')]['ids'][_0xdb0a('0x4b')];_0x5078c8+=0x1){socket[_0xdb0a('0x7b')]('userChatQueue:save',{'UserId':Number(_0xc1fc21[_0xdb0a('0x62')][_0xdb0a('0x70')][_0x5078c8]),'ChatQueueId':Number(_0xc1fc21[_0xdb0a('0x63')]['id'])});}return _0x176328;});}})[_0xdb0a('0x1f')](respondWithResult(_0x7074ba,null))['catch'](handleError(_0x7074ba,null));};exports[_0xdb0a('0x92')]=function(_0x57f7d3,_0x3425f4,_0x2c0971){return db['ChatQueue'][_0xdb0a('0x59')]({'where':{'id':_0x57f7d3['params']['id']}})[_0xdb0a('0x1f')](handleEntityNotFound(_0x3425f4,null))[_0xdb0a('0x1f')](function(_0x3e8ba0){if(_0x3e8ba0){return _0x3e8ba0[_0xdb0a('0x92')](_0x57f7d3[_0xdb0a('0x46')][_0xdb0a('0x70')])[_0xdb0a('0x1f')](function(){if(_[_0xdb0a('0x93')](_0x57f7d3[_0xdb0a('0x46')][_0xdb0a('0x70')])){for(var _0x3f1288=0x0;_0x3f1288<_0x57f7d3[_0xdb0a('0x46')]['ids'][_0xdb0a('0x4b')];_0x3f1288+=0x1){socket[_0xdb0a('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x57f7d3['query'][_0xdb0a('0x70')][_0x3f1288]),'ChatQueueId':Number(_0x57f7d3['params']['id'])});}}else{socket[_0xdb0a('0x7b')](_0xdb0a('0x8e'),{'UserId':Number(_0x57f7d3['query'][_0xdb0a('0x70')]),'ChatQueueId':Number(_0x57f7d3['params']['id'])});}});}})[_0xdb0a('0x1f')](respondWithStatusCode(_0x3425f4,null))['catch'](handleError(_0x3425f4,null));};exports[_0xdb0a('0x94')]=function(_0x2a9468,_0x208b57,_0x43acc1){var _0x15df04={};var _0x1712d7={};var _0x1b9894;var _0x1fc661;return db['ChatQueue'][_0xdb0a('0x66')]({'where':{'id':_0x2a9468[_0xdb0a('0x63')]['id']}})[_0xdb0a('0x1f')](handleEntityNotFound(_0x208b57,null))['then'](function(_0x178fa4){if(_0x178fa4){_0x1b9894=_0x178fa4;_0x1712d7[_0xdb0a('0x45')]=_[_0xdb0a('0x47')](db[_0xdb0a('0x72')][_0xdb0a('0x41')]);_0x1712d7[_0xdb0a('0x46')]=_[_0xdb0a('0x47')](_0x2a9468[_0xdb0a('0x46')]);_0x1712d7[_0xdb0a('0x50')]=_[_0xdb0a('0x48')](_0x1712d7['model'],_0x1712d7[_0xdb0a('0x46')]);_0x15df04['attributes']=_[_0xdb0a('0x48')](_0x1712d7[_0xdb0a('0x45')],qs[_0xdb0a('0x4a')](_0x2a9468[_0xdb0a('0x46')][_0xdb0a('0x4a')]));_0x15df04[_0xdb0a('0x49')]=_0x15df04[_0xdb0a('0x49')]['length']?_0x15df04[_0xdb0a('0x49')]:_0x1712d7[_0xdb0a('0x45')];_0x15df04[_0xdb0a('0x95')]=qs[_0xdb0a('0x4e')](_0x2a9468[_0xdb0a('0x46')][_0xdb0a('0x4e')]);_0x15df04[_0xdb0a('0x4f')]=qs['filters'](_[_0xdb0a('0x51')](_0x2a9468[_0xdb0a('0x46')],_0x1712d7[_0xdb0a('0x50')]));if(_0x2a9468[_0xdb0a('0x46')][_0xdb0a('0x52')]){_0x15df04[_0xdb0a('0x4f')]=_[_0xdb0a('0x53')](_0x15df04['where'],{'$or':_['map'](_0x15df04[_0xdb0a('0x49')],function(_0x16fe7e){var _0x5694d8={};_0x5694d8[_0x16fe7e]={'$like':'%'+_0x2a9468[_0xdb0a('0x46')][_0xdb0a('0x52')]+'%'};return _0x5694d8;})});}_0x15df04=_[_0xdb0a('0x53')]({},_0x15df04,_0x2a9468[_0xdb0a('0x58')]);return _0x1b9894['getAgents'](_0x15df04);}})['then'](function(_0x4a8428){if(_0x4a8428){_0x1fc661=_0x4a8428[_0xdb0a('0x4b')];if(!_0x2a9468[_0xdb0a('0x46')][_0xdb0a('0x4c')]('nolimit')){_0x15df04['limit']=qs['limit'](_0x2a9468['query']['limit']);_0x15df04[_0xdb0a('0x2d')]=qs[_0xdb0a('0x2d')](_0x2a9468[_0xdb0a('0x46')]['offset']);}return _0x1b9894[_0xdb0a('0x94')](_0x15df04);}})[_0xdb0a('0x1f')](function(_0x538be1){if(_0x538be1){return _0x538be1?{'count':_0x1fc661,'rows':_0x538be1}:null;}})[_0xdb0a('0x1f')](respondWithResult(_0x208b57,null))['catch'](handleError(_0x208b57,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index a7381d2..55fa0df 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 _0x7e16=['ChatQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4ca571,_0xd1d6b6){var _0xaa55a5=function(_0x3a71f4){while(--_0x3a71f4){_0x4ca571['push'](_0x4ca571['shift']());}};_0xaa55a5(++_0xd1d6b6);}(_0x7e16,0x16f));var _0x67e1=function(_0x5547d4,_0x3a847c){_0x5547d4=_0x5547d4-0x0;var _0x2ed9ce=_0x7e16[_0x5547d4];return _0x2ed9ce;};'use strict';var EventEmitter=require(_0x67e1('0x0'));var ChatQueue=require(_0x67e1('0x1'))['db'][_0x67e1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x67e1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x67e1('0x4')};function emitEvent(_0x53bbdf){return function(_0x268f07,_0x25d798,_0x563303){ChatQueueEvents[_0x67e1('0x5')](_0x53bbdf+':'+_0x268f07['id'],_0x268f07);ChatQueueEvents[_0x67e1('0x5')](_0x53bbdf,_0x268f07);_0x563303(null);};}for(var e in events){if(events[_0x67e1('0x6')](e)){var event=events[e];ChatQueue[_0x67e1('0x7')](e,emitEvent(event));}}module[_0x67e1('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x3e9e=['events','ChatQueue','hasOwnProperty','hook','exports'];(function(_0x3b59d5,_0x1e23f2){var _0x30cc91=function(_0x54815d){while(--_0x54815d){_0x3b59d5['push'](_0x3b59d5['shift']());}};_0x30cc91(++_0x1e23f2);}(_0x3e9e,0x91));var _0xe3e9=function(_0xe10194,_0x7ff838){_0xe10194=_0xe10194-0x0;var _0x2369cf=_0x3e9e[_0xe10194];return _0x2369cf;};'use strict';var EventEmitter=require(_0xe3e9('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe3e9('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x229cee){return function(_0x1846d6,_0x334206,_0x455c8f){ChatQueueEvents['emit'](_0x229cee+':'+_0x1846d6['id'],_0x1846d6);ChatQueueEvents['emit'](_0x229cee,_0x1846d6);_0x455c8f(null);};}for(var e in events){if(events[_0xe3e9('0x2')](e)){var event=events[e];ChatQueue[_0xe3e9('0x3')](e,emitEvent(event));}}module[_0xe3e9('0x4')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index b081457..57830a0 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 _0xe35a=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','util','../../config/logger','api'];(function(_0x5c8f85,_0x7957cc){var _0x319d90=function(_0x173e1f){while(--_0x173e1f){_0x5c8f85['push'](_0x5c8f85['shift']());}};_0x319d90(++_0x7957cc);}(_0xe35a,0x147));var _0xae35=function(_0xce8299,_0x55ec18){_0xce8299=_0xce8299-0x0;var _0xa39773=_0xe35a[_0xce8299];return _0xa39773;};'use strict';var _=require('lodash');var util=require(_0xae35('0x0'));var logger=require(_0xae35('0x1'))(_0xae35('0x2'));var moment=require('moment');var BPromise=require(_0xae35('0x3'));var rp=require(_0xae35('0x4'));var fs=require('fs');var path=require(_0xae35('0x5'));var rimraf=require(_0xae35('0x6'));var config=require(_0xae35('0x7'));var attributes=require(_0xae35('0x8'));module['exports']=function(_0x5a21bb,_0x59a07d){return _0x5a21bb[_0xae35('0x9')](_0xae35('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7287=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4a247e,_0x2099a7){var _0x30a6ca=function(_0x7397cc){while(--_0x7397cc){_0x4a247e['push'](_0x4a247e['shift']());}};_0x30a6ca(++_0x2099a7);}(_0x7287,0x96));var _0x7728=function(_0xebfd56,_0x5967f1){_0xebfd56=_0xebfd56-0x0;var _0x4cb58e=_0x7287[_0xebfd56];return _0x4cb58e;};'use strict';var _=require(_0x7728('0x0'));var util=require(_0x7728('0x1'));var logger=require(_0x7728('0x2'))(_0x7728('0x3'));var moment=require('moment');var BPromise=require(_0x7728('0x4'));var rp=require(_0x7728('0x5'));var fs=require('fs');var path=require(_0x7728('0x6'));var rimraf=require(_0x7728('0x7'));var config=require(_0x7728('0x8'));var attributes=require(_0x7728('0x9'));module[_0x7728('0xa')]=function(_0x5f1233,_0x29e53b){return _0x5f1233[_0x7728('0xb')](_0x7728('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index b56aa22..b768b0e 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 _0x6c00=['register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','options','raw','where','attributes','include','map','model','info','ShowChatQueue','ChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatQueue.socket'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x6c00,0x1a9));var _0x06c0=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x6c00[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x06c0('0x0'));var util=require(_0x06c0('0x1'));var moment=require(_0x06c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x06c0('0x3'));var fs=require('fs');var Redis=require(_0x06c0('0x4'));var db=require(_0x06c0('0x5'))['db'];var utils=require(_0x06c0('0x6'));var logger=require('../../config/logger')(_0x06c0('0x7'));var config=require(_0x06c0('0x8'));var jayson=require(_0x06c0('0x9'));var client=jayson[_0x06c0('0xa')][_0x06c0('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x06c0('0xc')],{'host':_0x06c0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x06c0('0xc')]));require(_0x06c0('0xe'))[_0x06c0('0xf')](socket);function respondWithRpcPromise(_0x617889,_0x2a6e7b,_0x140b20){return new BPromise(function(_0x27d317,_0x139770){return client[_0x06c0('0x10')](_0x617889,_0x140b20)[_0x06c0('0x11')](function(_0x2409fd){logger['info']('ChatQueue,\x20%s,\x20%s',_0x2a6e7b,_0x06c0('0x12'));logger[_0x06c0('0x13')](_0x06c0('0x14'),_0x2a6e7b,_0x06c0('0x12'),JSON[_0x06c0('0x15')](_0x2409fd));if(_0x2409fd['error']){if(_0x2409fd['error'][_0x06c0('0x16')]===0x1f4){logger[_0x06c0('0x17')](_0x06c0('0x18'),_0x2a6e7b,_0x2409fd[_0x06c0('0x17')][_0x06c0('0x19')]);return _0x139770(_0x2409fd[_0x06c0('0x17')][_0x06c0('0x19')]);}logger['error'](_0x06c0('0x18'),_0x2a6e7b,_0x2409fd[_0x06c0('0x17')][_0x06c0('0x19')]);return _0x27d317(_0x2409fd[_0x06c0('0x17')][_0x06c0('0x19')]);}else{logger['info'](_0x06c0('0x18'),_0x2a6e7b,'request\x20sent');_0x27d317(_0x2409fd[_0x06c0('0x1a')][_0x06c0('0x19')]);}})[_0x06c0('0x1b')](function(_0x47484e){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2a6e7b,_0x47484e);_0x139770(_0x47484e);});});}exports[_0x06c0('0x1c')]=function(_0x55c25e){var _0x1b897b=this;return new Promise(function(_0x1e3623,_0x30bf8c){return db['ChatQueue']['findAll']({'raw':_0x55c25e[_0x06c0('0x1d')]?_0x55c25e['options'][_0x06c0('0x1e')]===undefined?!![]:![]:!![],'where':_0x55c25e[_0x06c0('0x1d')]?_0x55c25e[_0x06c0('0x1d')][_0x06c0('0x1f')]||null:null,'attributes':_0x55c25e[_0x06c0('0x1d')]?_0x55c25e['options'][_0x06c0('0x20')]||null:null,'limit':_0x55c25e[_0x06c0('0x1d')]?_0x55c25e['options']['limit']||null:null,'include':_0x55c25e[_0x06c0('0x1d')]?_0x55c25e[_0x06c0('0x1d')][_0x06c0('0x21')]?_[_0x06c0('0x22')](_0x55c25e['options']['include'],function(_0x13f63e){return{'model':db[_0x13f63e[_0x06c0('0x23')]],'as':_0x13f63e['as'],'attributes':_0x13f63e[_0x06c0('0x20')],'include':_0x13f63e[_0x06c0('0x21')]?_[_0x06c0('0x22')](_0x13f63e[_0x06c0('0x21')],function(_0x42e370){return{'model':db[_0x42e370[_0x06c0('0x23')]],'as':_0x42e370['as'],'attributes':_0x42e370['attributes'],'include':_0x42e370[_0x06c0('0x21')]?_[_0x06c0('0x22')](_0x42e370[_0x06c0('0x21')],function(_0x46115a){return{'model':db[_0x46115a[_0x06c0('0x23')]],'as':_0x46115a['as'],'attributes':_0x46115a[_0x06c0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x426792){logger[_0x06c0('0x24')](_0x06c0('0x1c'),_0x55c25e);logger[_0x06c0('0x13')]('GetChatQueue',_0x55c25e,JSON[_0x06c0('0x15')](_0x426792));_0x1e3623(_0x426792);})[_0x06c0('0x1b')](function(_0x4c5ed7){logger[_0x06c0('0x17')]('GetChatQueue',_0x4c5ed7[_0x06c0('0x19')],_0x55c25e);_0x30bf8c(_0x1b897b[_0x06c0('0x17')](0x1f4,_0x4c5ed7[_0x06c0('0x19')]));});});};exports[_0x06c0('0x25')]=function(_0x4bc6dc){var _0x5627e1=this;return new Promise(function(_0x522e78,_0x2da993){return db[_0x06c0('0x26')][_0x06c0('0x27')]({'raw':_0x4bc6dc[_0x06c0('0x1d')]?_0x4bc6dc['options'][_0x06c0('0x1e')]===undefined?!![]:![]:!![],'where':_0x4bc6dc[_0x06c0('0x1d')]?_0x4bc6dc['options'][_0x06c0('0x1f')]||null:null,'attributes':_0x4bc6dc[_0x06c0('0x1d')]?_0x4bc6dc[_0x06c0('0x1d')][_0x06c0('0x20')]||null:null,'include':_0x4bc6dc[_0x06c0('0x1d')]?_0x4bc6dc[_0x06c0('0x1d')][_0x06c0('0x21')]?_[_0x06c0('0x22')](_0x4bc6dc[_0x06c0('0x1d')]['include'],function(_0x7b9528){return{'model':db[_0x7b9528['model']],'as':_0x7b9528['as'],'attributes':_0x7b9528[_0x06c0('0x20')],'include':_0x7b9528['include']?_[_0x06c0('0x22')](_0x7b9528[_0x06c0('0x21')],function(_0x47e55e){return{'model':db[_0x47e55e['model']],'as':_0x47e55e['as'],'attributes':_0x47e55e['attributes'],'include':_0x47e55e[_0x06c0('0x21')]?_[_0x06c0('0x22')](_0x47e55e[_0x06c0('0x21')],function(_0xc18b0e){return{'model':db[_0xc18b0e['model']],'as':_0xc18b0e['as'],'attributes':_0xc18b0e[_0x06c0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x06c0('0x11')](function(_0x1aa553){logger['info'](_0x06c0('0x25'),_0x4bc6dc);logger['debug'](_0x06c0('0x25'),_0x4bc6dc,JSON[_0x06c0('0x15')](_0x1aa553));_0x522e78(_0x1aa553);})['catch'](function(_0x4e14fc){logger['error'](_0x06c0('0x25'),_0x4e14fc[_0x06c0('0x19')],_0x4bc6dc);_0x2da993(_0x5627e1[_0x06c0('0x17')](0x1f4,_0x4e14fc['message']));});});};
\ No newline at end of file
+var _0xd027=['limit','include','map','model','ShowChatQueue','find','stringify','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes'];(function(_0x3adb53,_0x344e17){var _0x36be40=function(_0x2dc6f5){while(--_0x2dc6f5){_0x3adb53['push'](_0x3adb53['shift']());}};_0x36be40(++_0x344e17);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7d02('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d02('0x1'));var fs=require('fs');var Redis=require(_0x7d02('0x2'));var db=require(_0x7d02('0x3'))['db'];var utils=require(_0x7d02('0x4'));var logger=require(_0x7d02('0x5'))(_0x7d02('0x6'));var config=require(_0x7d02('0x7'));var jayson=require(_0x7d02('0x8'));var client=jayson['client'][_0x7d02('0x9')]({'port':0x232a});config[_0x7d02('0xa')]=_[_0x7d02('0xb')](config[_0x7d02('0xa')],{'host':_0x7d02('0xc'),'port':0x18eb});var socket=require(_0x7d02('0xd'))(new Redis(config[_0x7d02('0xa')]));require(_0x7d02('0xe'))[_0x7d02('0xf')](socket);function respondWithRpcPromise(_0x37217c,_0x21abe5,_0x3bfc73){return new BPromise(function(_0x259517,_0x55b35a){return client[_0x7d02('0x10')](_0x37217c,_0x3bfc73)[_0x7d02('0x11')](function(_0x5eefcd){logger[_0x7d02('0x12')](_0x7d02('0x13'),_0x21abe5,_0x7d02('0x14'));logger[_0x7d02('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x21abe5,_0x7d02('0x14'),JSON['stringify'](_0x5eefcd));if(_0x5eefcd[_0x7d02('0x16')]){if(_0x5eefcd[_0x7d02('0x16')]['code']===0x1f4){logger[_0x7d02('0x16')](_0x7d02('0x13'),_0x21abe5,_0x5eefcd['error'][_0x7d02('0x17')]);return _0x55b35a(_0x5eefcd[_0x7d02('0x16')][_0x7d02('0x17')]);}logger['error'](_0x7d02('0x13'),_0x21abe5,_0x5eefcd[_0x7d02('0x16')][_0x7d02('0x17')]);return _0x259517(_0x5eefcd[_0x7d02('0x16')][_0x7d02('0x17')]);}else{logger[_0x7d02('0x12')](_0x7d02('0x13'),_0x21abe5,_0x7d02('0x14'));_0x259517(_0x5eefcd[_0x7d02('0x18')][_0x7d02('0x17')]);}})[_0x7d02('0x19')](function(_0x1168c0){logger[_0x7d02('0x16')](_0x7d02('0x13'),_0x21abe5,_0x1168c0);_0x55b35a(_0x1168c0);});});}exports[_0x7d02('0x1a')]=function(_0x82a804){var _0x579565=this;return new Promise(function(_0x41c538,_0x152291){return db[_0x7d02('0x1b')][_0x7d02('0x1c')]({'raw':_0x82a804[_0x7d02('0x1d')]?_0x82a804[_0x7d02('0x1d')][_0x7d02('0x1e')]===undefined?!![]:![]:!![],'where':_0x82a804['options']?_0x82a804[_0x7d02('0x1d')][_0x7d02('0x1f')]||null:null,'attributes':_0x82a804[_0x7d02('0x1d')]?_0x82a804[_0x7d02('0x1d')][_0x7d02('0x20')]||null:null,'limit':_0x82a804[_0x7d02('0x1d')]?_0x82a804[_0x7d02('0x1d')][_0x7d02('0x21')]||null:null,'include':_0x82a804[_0x7d02('0x1d')]?_0x82a804[_0x7d02('0x1d')][_0x7d02('0x22')]?_['map'](_0x82a804[_0x7d02('0x1d')][_0x7d02('0x22')],function(_0xe81f55){return{'model':db[_0xe81f55['model']],'as':_0xe81f55['as'],'attributes':_0xe81f55['attributes'],'include':_0xe81f55[_0x7d02('0x22')]?_[_0x7d02('0x23')](_0xe81f55[_0x7d02('0x22')],function(_0x478506){return{'model':db[_0x478506[_0x7d02('0x24')]],'as':_0x478506['as'],'attributes':_0x478506[_0x7d02('0x20')],'include':_0x478506[_0x7d02('0x22')]?_[_0x7d02('0x23')](_0x478506['include'],function(_0x5b94c8){return{'model':db[_0x5b94c8['model']],'as':_0x5b94c8['as'],'attributes':_0x5b94c8[_0x7d02('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7d02('0x11')](function(_0x2d6132){logger[_0x7d02('0x12')]('GetChatQueue',_0x82a804);logger[_0x7d02('0x15')]('GetChatQueue',_0x82a804,JSON['stringify'](_0x2d6132));_0x41c538(_0x2d6132);})[_0x7d02('0x19')](function(_0x7a05c6){logger[_0x7d02('0x16')](_0x7d02('0x1a'),_0x7a05c6['message'],_0x82a804);_0x152291(_0x579565[_0x7d02('0x16')](0x1f4,_0x7a05c6[_0x7d02('0x17')]));});});};exports[_0x7d02('0x25')]=function(_0x4bac3e){var _0x868f7e=this;return new Promise(function(_0x3aaa05,_0x22cf7e){return db[_0x7d02('0x1b')][_0x7d02('0x26')]({'raw':_0x4bac3e[_0x7d02('0x1d')]?_0x4bac3e[_0x7d02('0x1d')][_0x7d02('0x1e')]===undefined?!![]:![]:!![],'where':_0x4bac3e[_0x7d02('0x1d')]?_0x4bac3e[_0x7d02('0x1d')][_0x7d02('0x1f')]||null:null,'attributes':_0x4bac3e[_0x7d02('0x1d')]?_0x4bac3e['options'][_0x7d02('0x20')]||null:null,'include':_0x4bac3e[_0x7d02('0x1d')]?_0x4bac3e[_0x7d02('0x1d')][_0x7d02('0x22')]?_['map'](_0x4bac3e['options'][_0x7d02('0x22')],function(_0x4dfe91){return{'model':db[_0x4dfe91['model']],'as':_0x4dfe91['as'],'attributes':_0x4dfe91[_0x7d02('0x20')],'include':_0x4dfe91['include']?_['map'](_0x4dfe91[_0x7d02('0x22')],function(_0x4841cc){return{'model':db[_0x4841cc[_0x7d02('0x24')]],'as':_0x4841cc['as'],'attributes':_0x4841cc['attributes'],'include':_0x4841cc[_0x7d02('0x22')]?_['map'](_0x4841cc[_0x7d02('0x22')],function(_0x1b1037){return{'model':db[_0x1b1037[_0x7d02('0x24')]],'as':_0x1b1037['as'],'attributes':_0x1b1037['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x388842){logger[_0x7d02('0x12')](_0x7d02('0x25'),_0x4bac3e);logger[_0x7d02('0x15')](_0x7d02('0x25'),_0x4bac3e,JSON[_0x7d02('0x27')](_0x388842));_0x3aaa05(_0x388842);})[_0x7d02('0x19')](function(_0x46c843){logger[_0x7d02('0x16')](_0x7d02('0x25'),_0x46c843[_0x7d02('0x17')],_0x4bac3e);_0x22cf7e(_0x868f7e['error'](0x1f4,_0x46c843['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 74e660b..d36cac8 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 _0xf021=['update','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x3b601a,_0x1fcc08){var _0x3b4d2b=function(_0x5e5d8b){while(--_0x5e5d8b){_0x3b601a['push'](_0x3b601a['shift']());}};_0x3b4d2b(++_0x1fcc08);}(_0xf021,0x18f));var _0x1f02=function(_0xc0bf56,_0x476134){_0xc0bf56=_0xc0bf56-0x0;var _0x43ff64=_0xf021[_0xc0bf56];return _0x43ff64;};'use strict';var ChatQueueEvents=require(_0x1f02('0x0'));var events=[_0x1f02('0x1'),_0x1f02('0x2'),_0x1f02('0x3')];function createListener(_0x30184d,_0x53cc42){return function(_0x1027d2){_0x53cc42['emit'](_0x30184d,_0x1027d2);};}function removeListener(_0x2e8594,_0x3164f0){return function(){ChatQueueEvents['removeListener'](_0x2e8594,_0x3164f0);};}exports['register']=function(_0x84a8f0){for(var _0x56b275=0x0,_0x383d0b=events[_0x1f02('0x4')];_0x56b275<_0x383d0b;_0x56b275++){var _0x2a6c50=events[_0x56b275];var _0x4193d2=createListener(_0x1f02('0x5')+_0x2a6c50,_0x84a8f0);ChatQueueEvents['on'](_0x2a6c50,_0x4193d2);}};
\ No newline at end of file
+var _0x425d=['./chatQueue.events','remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x425d,0x1e0));var _0xd425=function(_0x1e1818,_0x5bb131){_0x1e1818=_0x1e1818-0x0;var _0x5c7561=_0x425d[_0x1e1818];return _0x5c7561;};'use strict';var ChatQueueEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){ChatQueueEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);ChatQueueEvents['on'](_0x50b061,_0xb6ba8e);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 3044429..672e856 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x394060,_0x53eba3){var _0xedd258=function(_0xc447a6){while(--_0xc447a6){_0x394060['push'](_0x394060['shift']());}};_0xedd258(++_0x53eba3);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x23f615,_0xc4a2e8){var _0x3e7474=function(_0xe3ede1){while(--_0xe3ede1){_0x23f615['push'](_0x23f615['shift']());}};_0x3e7474(++_0xc4a2e8);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index c6b40c6..785260c 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 _0x7741=['DATE','moment','sequelize','exports','STRING'];(function(_0x2c4f3f,_0x266947){var _0x3d0234=function(_0x31495c){while(--_0x31495c){_0x2c4f3f['push'](_0x2c4f3f['shift']());}};_0x3d0234(++_0x266947);}(_0x7741,0x1af));var _0x1774=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x7741[_0x49ca18];return _0x145d54;};'use strict';var moment=require(_0x1774('0x0'));var Sequelize=require(_0x1774('0x1'));module[_0x1774('0x2')]={'uniqueid':{'type':Sequelize[_0x1774('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1774('0x3')]},'joinAt':{'type':Sequelize[_0x1774('0x4')]},'leaveAt':{'type':Sequelize[_0x1774('0x4')]},'acceptAt':{'type':Sequelize[_0x1774('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe3ab=['exports','STRING','DATE','moment'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xe3ab,0x8b));var _0xbe3a=function(_0x2c52cd,_0x17bf79){_0x2c52cd=_0x2c52cd-0x0;var _0x432dd5=_0xe3ab[_0x2c52cd];return _0x432dd5;};'use strict';var moment=require(_0xbe3a('0x0'));var Sequelize=require('sequelize');module[_0xbe3a('0x1')]={'uniqueid':{'type':Sequelize[_0xbe3a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbe3a('0x2')]},'joinAt':{'type':Sequelize[_0xbe3a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbe3a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbe3a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 6ab8384..a69fdd7 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 _0x4cfd=['destroy','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','sendStatus','stack','send','map','ChatQueueReport','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','show','rawAttributes','find','catch','create','body'];(function(_0x26dab8,_0x3be499){var _0xda463e=function(_0x2f2f4b){while(--_0x2f2f4b){_0x26dab8['push'](_0x26dab8['shift']());}};_0xda463e(++_0x3be499);}(_0x4cfd,0x170));var _0xd4cf=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x4cfd[_0x3c2b2e];return _0x27a338;};'use strict';var emlformat=require(_0xd4cf('0x0'));var rimraf=require(_0xd4cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cf('0x2'));var rp=require(_0xd4cf('0x3'));var moment=require(_0xd4cf('0x4'));var BPromise=require(_0xd4cf('0x5'));var Mustache=require(_0xd4cf('0x6'));var util=require(_0xd4cf('0x7'));var path=require('path');var sox=require(_0xd4cf('0x8'));var csv=require(_0xd4cf('0x9'));var ejs=require(_0xd4cf('0xa'));var fs=require('fs');var fs_extra=require(_0xd4cf('0xb'));var _=require(_0xd4cf('0xc'));var squel=require(_0xd4cf('0xd'));var crypto=require('crypto');var jsforce=require(_0xd4cf('0xe'));var deskjs=require(_0xd4cf('0xf'));var toCsv=require(_0xd4cf('0x9'));var querystring=require(_0xd4cf('0x10'));var Papa=require(_0xd4cf('0x11'));var Redis=require(_0xd4cf('0x12'));var authService=require(_0xd4cf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd4cf('0x14'));var hardwareService=require(_0xd4cf('0x15'));var logger=require(_0xd4cf('0x16'))(_0xd4cf('0x17'));var utils=require(_0xd4cf('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd4cf('0x19'))['db'];function respondWithStatusCode(_0x294c99,_0x544065){_0x544065=_0x544065||0xcc;return function(_0x3ff2db){if(_0x3ff2db){return _0x294c99['sendStatus'](_0x544065);}return _0x294c99[_0xd4cf('0x1a')](_0x544065)['end']();};}function respondWithResult(_0x330630,_0xa597cd){_0xa597cd=_0xa597cd||0xc8;return function(_0x51c61e){if(_0x51c61e){return _0x330630[_0xd4cf('0x1a')](_0xa597cd)[_0xd4cf('0x1b')](_0x51c61e);}};}function respondWithFilteredResult(_0x2f8607,_0x13c0a1){return function(_0x44abd7){if(_0x44abd7){var _0x2ff69e=typeof _0x13c0a1['offset']===_0xd4cf('0x1c')&&typeof _0x13c0a1[_0xd4cf('0x1d')]===_0xd4cf('0x1c');var _0x11b06a=_0x44abd7[_0xd4cf('0x1e')];var _0x3e749d=_0x2ff69e?0x0:_0x13c0a1[_0xd4cf('0x1f')];var _0x1df3e0=_0x2ff69e?_0x44abd7[_0xd4cf('0x1e')]:_0x13c0a1[_0xd4cf('0x1f')]+_0x13c0a1[_0xd4cf('0x1d')];var _0x540e2b;if(_0x1df3e0>=_0x11b06a){_0x1df3e0=_0x11b06a;_0x540e2b=0xc8;}else{_0x540e2b=0xce;}_0x2f8607[_0xd4cf('0x1a')](_0x540e2b);return _0x2f8607[_0xd4cf('0x20')](_0xd4cf('0x21'),_0x3e749d+'-'+_0x1df3e0+'/'+_0x11b06a)[_0xd4cf('0x1b')](_0x44abd7);}return null;};}function patchUpdates(_0x1caa70){return function(_0x2bef15){try{jsonpatch[_0xd4cf('0x22')](_0x2bef15,_0x1caa70,!![]);}catch(_0x5338dc){return BPromise[_0xd4cf('0x23')](_0x5338dc);}return _0x2bef15['save']();};}function saveUpdates(_0x4ec111,_0x10f6a7){return function(_0x3dbe6d){if(_0x3dbe6d){return _0x3dbe6d[_0xd4cf('0x24')](_0x4ec111)[_0xd4cf('0x25')](function(_0x2fe806){return _0x2fe806;});}return null;};}function removeEntity(_0x40c251,_0x54aaab){return function(_0x14c159){if(_0x14c159){return _0x14c159['destroy']()[_0xd4cf('0x25')](function(){_0x40c251[_0xd4cf('0x1a')](0xcc)[_0xd4cf('0x26')]();});}};}function handleEntityNotFound(_0x4c1896,_0x5266aa){return function(_0x52c21b){if(!_0x52c21b){_0x4c1896[_0xd4cf('0x27')](0x194);}return _0x52c21b;};}function handleError(_0x413317,_0x4fd6ea){_0x4fd6ea=_0x4fd6ea||0x1f4;return function(_0x59c215){logger['error'](_0x59c215[_0xd4cf('0x28')]);if(_0x59c215['name']){delete _0x59c215['name'];}_0x413317['status'](_0x4fd6ea)[_0xd4cf('0x29')](_0x59c215);};}exports['index']=function(_0xd08f38,_0xa9ae56){var _0x2459f4={},_0x3b507f={},_0x45943d={'count':0x0,'rows':[]};var _0x2183c1=_[_0xd4cf('0x2a')](db[_0xd4cf('0x2b')]['rawAttributes'],function(_0x1c6ae5){return{'name':_0x1c6ae5[_0xd4cf('0x2c')],'type':_0x1c6ae5[_0xd4cf('0x2d')]['key']};});_0x3b507f['model']=_[_0xd4cf('0x2a')](_0x2183c1,_0xd4cf('0x2e'));_0x3b507f[_0xd4cf('0x2f')]=_[_0xd4cf('0x30')](_0xd08f38[_0xd4cf('0x2f')]);_0x3b507f[_0xd4cf('0x31')]=_[_0xd4cf('0x32')](_0x3b507f[_0xd4cf('0x33')],_0x3b507f['query']);_0x2459f4[_0xd4cf('0x34')]=_[_0xd4cf('0x32')](_0x3b507f[_0xd4cf('0x33')],qs[_0xd4cf('0x35')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x35')]));_0x2459f4[_0xd4cf('0x34')]=_0x2459f4[_0xd4cf('0x34')][_0xd4cf('0x36')]?_0x2459f4[_0xd4cf('0x34')]:_0x3b507f[_0xd4cf('0x33')];if(!_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x37')]('nolimit')){_0x2459f4['limit']=qs[_0xd4cf('0x1d')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x1d')]);_0x2459f4[_0xd4cf('0x1f')]=qs[_0xd4cf('0x1f')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x1f')]);}_0x2459f4[_0xd4cf('0x38')]=qs['sort'](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x39')]);_0x2459f4[_0xd4cf('0x3a')]=qs['filters'](_['pick'](_0xd08f38[_0xd4cf('0x2f')],_0x3b507f[_0xd4cf('0x31')]),_0x2183c1);if(_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x3b')]){_0x2459f4['where']=_[_0xd4cf('0x3c')](_0x2459f4[_0xd4cf('0x3a')],{'$or':_[_0xd4cf('0x2a')](_0x2183c1,function(_0x222669){if(_0x222669['type']!=='VIRTUAL'){var _0x4aeaa8={};_0x4aeaa8[_0x222669[_0xd4cf('0x2e')]]={'$like':'%'+_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x3b')]+'%'};return _0x4aeaa8;}})});}_0x2459f4=_[_0xd4cf('0x3c')]({},_0x2459f4,_0xd08f38[_0xd4cf('0x3d')]);var _0x17a8ee={'where':_0x2459f4[_0xd4cf('0x3a')]};return db[_0xd4cf('0x2b')]['count'](_0x17a8ee)['then'](function(_0x52fa6b){_0x45943d[_0xd4cf('0x1e')]=_0x52fa6b;if(_0xd08f38['query'][_0xd4cf('0x3e')]){_0x2459f4[_0xd4cf('0x3f')]=[{'all':!![]}];}return db[_0xd4cf('0x2b')]['findAll'](_0x2459f4);})[_0xd4cf('0x25')](function(_0x1ee4e2){_0x45943d['rows']=_0x1ee4e2;return _0x45943d;})[_0xd4cf('0x25')](respondWithFilteredResult(_0xa9ae56,_0x2459f4))['catch'](handleError(_0xa9ae56,null));};exports[_0xd4cf('0x40')]=function(_0x4b6da5,_0x4541db){var _0x476b2d={'raw':!![],'where':{'id':_0x4b6da5['params']['id']}},_0x4b874e={};_0x4b874e['model']=_[_0xd4cf('0x30')](db[_0xd4cf('0x2b')][_0xd4cf('0x41')]);_0x4b874e[_0xd4cf('0x2f')]=_[_0xd4cf('0x30')](_0x4b6da5[_0xd4cf('0x2f')]);_0x4b874e['filters']=_[_0xd4cf('0x32')](_0x4b874e[_0xd4cf('0x33')],_0x4b874e[_0xd4cf('0x2f')]);_0x476b2d[_0xd4cf('0x34')]=_['intersection'](_0x4b874e[_0xd4cf('0x33')],qs['fields'](_0x4b6da5[_0xd4cf('0x2f')][_0xd4cf('0x35')]));_0x476b2d['attributes']=_0x476b2d['attributes'][_0xd4cf('0x36')]?_0x476b2d[_0xd4cf('0x34')]:_0x4b874e['model'];if(_0x4b6da5[_0xd4cf('0x2f')][_0xd4cf('0x3e')]){_0x476b2d[_0xd4cf('0x3f')]=[{'all':!![]}];}_0x476b2d=_[_0xd4cf('0x3c')]({},_0x476b2d,_0x4b6da5[_0xd4cf('0x3d')]);return db['ChatQueueReport'][_0xd4cf('0x42')](_0x476b2d)[_0xd4cf('0x25')](handleEntityNotFound(_0x4541db,null))[_0xd4cf('0x25')](respondWithResult(_0x4541db,null))[_0xd4cf('0x43')](handleError(_0x4541db,null));};exports[_0xd4cf('0x44')]=function(_0x1a547a,_0x55504f){return db[_0xd4cf('0x2b')][_0xd4cf('0x44')](_0x1a547a[_0xd4cf('0x45')],{})[_0xd4cf('0x25')](respondWithResult(_0x55504f,0xc9))[_0xd4cf('0x43')](handleError(_0x55504f,null));};exports[_0xd4cf('0x24')]=function(_0x14af9f,_0x532c7b){if(_0x14af9f[_0xd4cf('0x45')]['id']){delete _0x14af9f[_0xd4cf('0x45')]['id'];}return db[_0xd4cf('0x2b')][_0xd4cf('0x42')]({'where':{'id':_0x14af9f['params']['id']}})[_0xd4cf('0x25')](handleEntityNotFound(_0x532c7b,null))[_0xd4cf('0x25')](saveUpdates(_0x14af9f[_0xd4cf('0x45')],null))[_0xd4cf('0x25')](respondWithResult(_0x532c7b,null))[_0xd4cf('0x43')](handleError(_0x532c7b,null));};exports[_0xd4cf('0x46')]=function(_0xe69dbf,_0x4fd5e0){return db['ChatQueueReport']['find']({'where':{'id':_0xe69dbf[_0xd4cf('0x47')]['id']}})[_0xd4cf('0x25')](handleEntityNotFound(_0x4fd5e0,null))[_0xd4cf('0x25')](removeEntity(_0x4fd5e0,null))[_0xd4cf('0x43')](handleError(_0x4fd5e0,null));};exports[_0xd4cf('0x48')]=function(_0x4934a0,_0x54bb75){return db[_0xd4cf('0x2b')]['describe']()[_0xd4cf('0x25')](respondWithResult(_0x54bb75,null))[_0xd4cf('0x43')](handleError(_0x54bb75,null));};
\ No newline at end of file
+var _0x9120=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9120,0x1b3));var _0x0912=function(_0x5ef8d8,_0x3d70a2){_0x5ef8d8=_0x5ef8d8-0x0;var _0x21cd90=_0x9120[_0x5ef8d8];return _0x21cd90;};'use strict';var emlformat=require(_0x0912('0x0'));var rimraf=require(_0x0912('0x1'));var zipdir=require(_0x0912('0x2'));var jsonpatch=require(_0x0912('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0912('0x4'));var Mustache=require(_0x0912('0x5'));var util=require(_0x0912('0x6'));var path=require(_0x0912('0x7'));var sox=require(_0x0912('0x8'));var csv=require(_0x0912('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0912('0xa'));var _=require(_0x0912('0xb'));var squel=require(_0x0912('0xc'));var crypto=require('crypto');var jsforce=require(_0x0912('0xd'));var deskjs=require(_0x0912('0xe'));var toCsv=require(_0x0912('0x9'));var querystring=require(_0x0912('0xf'));var Papa=require(_0x0912('0x10'));var Redis=require('ioredis');var authService=require(_0x0912('0x11'));var qs=require(_0x0912('0x12'));var as=require(_0x0912('0x13'));var hardwareService=require(_0x0912('0x14'));var logger=require('../../config/logger')(_0x0912('0x15'));var utils=require('../../config/utils');var config=require(_0x0912('0x16'));var licenseUtil=require(_0x0912('0x17'));var db=require(_0x0912('0x18'))['db'];function respondWithStatusCode(_0xc7af62,_0x22752b){_0x22752b=_0x22752b||0xcc;return function(_0x10faac){if(_0x10faac){return _0xc7af62[_0x0912('0x19')](_0x22752b);}return _0xc7af62[_0x0912('0x1a')](_0x22752b)[_0x0912('0x1b')]();};}function respondWithResult(_0x102468,_0x17f22d){_0x17f22d=_0x17f22d||0xc8;return function(_0x350d6b){if(_0x350d6b){return _0x102468[_0x0912('0x1a')](_0x17f22d)[_0x0912('0x1c')](_0x350d6b);}};}function respondWithFilteredResult(_0x247612,_0x5eb1c9){return function(_0x4d00fd){if(_0x4d00fd){var _0x1ed3e8=typeof _0x5eb1c9['offset']===_0x0912('0x1d')&&typeof _0x5eb1c9['limit']===_0x0912('0x1d');var _0x49b581=_0x4d00fd[_0x0912('0x1e')];var _0x5eace1=_0x1ed3e8?0x0:_0x5eb1c9[_0x0912('0x1f')];var _0x5357db=_0x1ed3e8?_0x4d00fd[_0x0912('0x1e')]:_0x5eb1c9['offset']+_0x5eb1c9['limit'];var _0x3377af;if(_0x5357db>=_0x49b581){_0x5357db=_0x49b581;_0x3377af=0xc8;}else{_0x3377af=0xce;}_0x247612['status'](_0x3377af);return _0x247612[_0x0912('0x20')](_0x0912('0x21'),_0x5eace1+'-'+_0x5357db+'/'+_0x49b581)['json'](_0x4d00fd);}return null;};}function patchUpdates(_0x106008){return function(_0xb1af32){try{jsonpatch[_0x0912('0x22')](_0xb1af32,_0x106008,!![]);}catch(_0x5927d2){return BPromise['reject'](_0x5927d2);}return _0xb1af32[_0x0912('0x23')]();};}function saveUpdates(_0x626428,_0x1f04a1){return function(_0x30b7cc){if(_0x30b7cc){return _0x30b7cc[_0x0912('0x24')](_0x626428)[_0x0912('0x25')](function(_0x6c4902){return _0x6c4902;});}return null;};}function removeEntity(_0x2a3e70,_0xca7f8b){return function(_0x572d12){if(_0x572d12){return _0x572d12[_0x0912('0x26')]()[_0x0912('0x25')](function(){_0x2a3e70[_0x0912('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a938e,_0x21d65b){return function(_0x53d673){if(!_0x53d673){_0x4a938e['sendStatus'](0x194);}return _0x53d673;};}function handleError(_0x39462e,_0x39e96b){_0x39e96b=_0x39e96b||0x1f4;return function(_0x4d45d2){logger[_0x0912('0x27')](_0x4d45d2[_0x0912('0x28')]);if(_0x4d45d2[_0x0912('0x29')]){delete _0x4d45d2[_0x0912('0x29')];}_0x39462e[_0x0912('0x1a')](_0x39e96b)['send'](_0x4d45d2);};}exports[_0x0912('0x2a')]=function(_0x1d6c87,_0x4ac024){var _0x2b1653={},_0x3428a9={},_0x2ce714={'count':0x0,'rows':[]};var _0x5b3956=_[_0x0912('0x2b')](db[_0x0912('0x2c')][_0x0912('0x2d')],function(_0x176529){return{'name':_0x176529['fieldName'],'type':_0x176529[_0x0912('0x2e')][_0x0912('0x2f')]};});_0x3428a9[_0x0912('0x30')]=_[_0x0912('0x2b')](_0x5b3956,_0x0912('0x29'));_0x3428a9[_0x0912('0x31')]=_['keys'](_0x1d6c87['query']);_0x3428a9[_0x0912('0x32')]=_[_0x0912('0x33')](_0x3428a9['model'],_0x3428a9['query']);_0x2b1653[_0x0912('0x34')]=_[_0x0912('0x33')](_0x3428a9[_0x0912('0x30')],qs[_0x0912('0x35')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x35')]));_0x2b1653[_0x0912('0x34')]=_0x2b1653[_0x0912('0x34')]['length']?_0x2b1653['attributes']:_0x3428a9[_0x0912('0x30')];if(!_0x1d6c87[_0x0912('0x31')]['hasOwnProperty'](_0x0912('0x36'))){_0x2b1653[_0x0912('0x37')]=qs[_0x0912('0x37')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x37')]);_0x2b1653[_0x0912('0x1f')]=qs[_0x0912('0x1f')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x1f')]);}_0x2b1653['order']=qs[_0x0912('0x38')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x38')]);_0x2b1653[_0x0912('0x39')]=qs[_0x0912('0x32')](_[_0x0912('0x3a')](_0x1d6c87[_0x0912('0x31')],_0x3428a9['filters']),_0x5b3956);if(_0x1d6c87[_0x0912('0x31')]['filter']){_0x2b1653['where']=_['merge'](_0x2b1653[_0x0912('0x39')],{'$or':_[_0x0912('0x2b')](_0x5b3956,function(_0x5db5f9){if(_0x5db5f9[_0x0912('0x2e')]!==_0x0912('0x3b')){var _0xfdf81c={};_0xfdf81c[_0x5db5f9['name']]={'$like':'%'+_0x1d6c87[_0x0912('0x31')][_0x0912('0x3c')]+'%'};return _0xfdf81c;}})});}_0x2b1653=_['merge']({},_0x2b1653,_0x1d6c87[_0x0912('0x3d')]);var _0x40de57={'where':_0x2b1653[_0x0912('0x39')]};return db[_0x0912('0x2c')][_0x0912('0x1e')](_0x40de57)[_0x0912('0x25')](function(_0x4eb359){_0x2ce714[_0x0912('0x1e')]=_0x4eb359;if(_0x1d6c87[_0x0912('0x31')][_0x0912('0x3e')]){_0x2b1653[_0x0912('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0912('0x40')](_0x2b1653);})[_0x0912('0x25')](function(_0x10040b){_0x2ce714['rows']=_0x10040b;return _0x2ce714;})[_0x0912('0x25')](respondWithFilteredResult(_0x4ac024,_0x2b1653))[_0x0912('0x41')](handleError(_0x4ac024,null));};exports[_0x0912('0x42')]=function(_0x19839e,_0x1c5158){var _0x320f98={'raw':!![],'where':{'id':_0x19839e[_0x0912('0x43')]['id']}},_0x15e23b={};_0x15e23b['model']=_[_0x0912('0x44')](db['ChatQueueReport'][_0x0912('0x2d')]);_0x15e23b[_0x0912('0x31')]=_[_0x0912('0x44')](_0x19839e[_0x0912('0x31')]);_0x15e23b[_0x0912('0x32')]=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],_0x15e23b[_0x0912('0x31')]);_0x320f98['attributes']=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],qs[_0x0912('0x35')](_0x19839e['query'][_0x0912('0x35')]));_0x320f98[_0x0912('0x34')]=_0x320f98[_0x0912('0x34')][_0x0912('0x45')]?_0x320f98[_0x0912('0x34')]:_0x15e23b[_0x0912('0x30')];if(_0x19839e[_0x0912('0x31')][_0x0912('0x3e')]){_0x320f98[_0x0912('0x3f')]=[{'all':!![]}];}_0x320f98=_[_0x0912('0x46')]({},_0x320f98,_0x19839e[_0x0912('0x3d')]);return db[_0x0912('0x2c')][_0x0912('0x47')](_0x320f98)[_0x0912('0x25')](handleEntityNotFound(_0x1c5158,null))[_0x0912('0x25')](respondWithResult(_0x1c5158,null))[_0x0912('0x41')](handleError(_0x1c5158,null));};exports[_0x0912('0x48')]=function(_0x255ee5,_0x3b0548){return db[_0x0912('0x2c')][_0x0912('0x48')](_0x255ee5[_0x0912('0x49')],{})[_0x0912('0x25')](respondWithResult(_0x3b0548,0xc9))['catch'](handleError(_0x3b0548,null));};exports[_0x0912('0x24')]=function(_0x3b94cc,_0x591c83){if(_0x3b94cc[_0x0912('0x49')]['id']){delete _0x3b94cc[_0x0912('0x49')]['id'];}return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x3b94cc[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x591c83,null))['then'](saveUpdates(_0x3b94cc[_0x0912('0x49')],null))[_0x0912('0x25')](respondWithResult(_0x591c83,null))[_0x0912('0x41')](handleError(_0x591c83,null));};exports['destroy']=function(_0x11364e,_0x3ce4bf){return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x11364e[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x3ce4bf,null))[_0x0912('0x25')](removeEntity(_0x3ce4bf,null))[_0x0912('0x41')](handleError(_0x3ce4bf,null));};exports['describe']=function(_0x91bb1a,_0x360313){return db[_0x0912('0x2c')][_0x0912('0x4a')]()[_0x0912('0x25')](respondWithResult(_0x360313,null))['catch'](handleError(_0x360313,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index d2ed5c9..ee18a5b 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0xcb91[_0x36d25e];return _0x4b95b8;};'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
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xf51299,_0x388983){var _0x2db212=function(_0x285929){while(--_0x285929){_0xf51299['push'](_0xf51299['shift']());}};_0x2db212(++_0x388983);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c542a21..d76bb67 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 _0xbd99=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','info','catch','UpdateChatQueueReport','limit','lodash'];(function(_0x1e8ded,_0x2c2bcc){var _0xe418ec=function(_0x502880){while(--_0x502880){_0x1e8ded['push'](_0x1e8ded['shift']());}};_0xe418ec(++_0x2c2bcc);}(_0xbd99,0x1df));var _0x9bd9=function(_0x254d9c,_0x29723f){_0x254d9c=_0x254d9c-0x0;var _0x3dc0e9=_0xbd99[_0x254d9c];return _0x3dc0e9;};'use strict';var _=require(_0x9bd9('0x0'));var util=require(_0x9bd9('0x1'));var moment=require('moment');var BPromise=require(_0x9bd9('0x2'));var rs=require(_0x9bd9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bd9('0x4'))['db'];var utils=require(_0x9bd9('0x5'));var logger=require(_0x9bd9('0x6'))(_0x9bd9('0x7'));var config=require(_0x9bd9('0x8'));var jayson=require(_0x9bd9('0x9'));var client=jayson[_0x9bd9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b41ea,_0x241303,_0x28b83f){return new BPromise(function(_0x7ddd62,_0x441225){return client[_0x9bd9('0xb')](_0x3b41ea,_0x28b83f)['then'](function(_0x865dc1){logger['info'](_0x9bd9('0xc'),_0x241303,_0x9bd9('0xd'));logger[_0x9bd9('0xe')](_0x9bd9('0xf'),_0x241303,_0x9bd9('0xd'),JSON[_0x9bd9('0x10')](_0x865dc1));if(_0x865dc1[_0x9bd9('0x11')]){if(_0x865dc1['error'][_0x9bd9('0x12')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x241303,_0x865dc1[_0x9bd9('0x11')]['message']);return _0x441225(_0x865dc1[_0x9bd9('0x11')][_0x9bd9('0x13')]);}logger[_0x9bd9('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x241303,_0x865dc1[_0x9bd9('0x11')]['message']);return _0x7ddd62(_0x865dc1[_0x9bd9('0x11')][_0x9bd9('0x13')]);}else{logger['info'](_0x9bd9('0xc'),_0x241303,_0x9bd9('0xd'));_0x7ddd62(_0x865dc1[_0x9bd9('0x14')][_0x9bd9('0x13')]);}})['catch'](function(_0x57ffcb){logger[_0x9bd9('0x11')](_0x9bd9('0xc'),_0x241303,_0x57ffcb);_0x441225(_0x57ffcb);});});}exports[_0x9bd9('0x15')]=function(_0x46a4bf){var _0x3cba37=this;return new Promise(function(_0x3e52ae,_0x4bb159){return db[_0x9bd9('0x16')][_0x9bd9('0x17')](_0x46a4bf[_0x9bd9('0x18')],{'raw':_0x46a4bf['options']?_0x46a4bf[_0x9bd9('0x19')][_0x9bd9('0x1a')]===undefined?!![]:![]:!![]})[_0x9bd9('0x1b')](function(_0x1820e3){logger[_0x9bd9('0x1c')](_0x9bd9('0x15'),_0x46a4bf);logger['debug']('CreateChatQueueReport',_0x46a4bf,JSON['stringify'](_0x1820e3));_0x3e52ae(_0x1820e3);})[_0x9bd9('0x1d')](function(_0x1fd658){logger[_0x9bd9('0x11')](_0x9bd9('0x15'),_0x1fd658[_0x9bd9('0x13')],_0x46a4bf);_0x4bb159(_0x3cba37[_0x9bd9('0x11')](0x1f4,_0x1fd658['message']));});});};exports[_0x9bd9('0x1e')]=function(_0x4b6bec){var _0x17f3ff=this;return new Promise(function(_0x511d05,_0x2a06e9){return db[_0x9bd9('0x16')]['update'](_0x4b6bec[_0x9bd9('0x18')],{'raw':_0x4b6bec[_0x9bd9('0x19')]?_0x4b6bec[_0x9bd9('0x19')][_0x9bd9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6bec[_0x9bd9('0x19')]?_0x4b6bec[_0x9bd9('0x19')]['where']||null:null,'attributes':_0x4b6bec[_0x9bd9('0x19')]?_0x4b6bec[_0x9bd9('0x19')]['attributes']||null:null,'limit':_0x4b6bec[_0x9bd9('0x19')]?_0x4b6bec[_0x9bd9('0x19')][_0x9bd9('0x1f')]||null:null})['then'](function(_0x4fdcc6){logger['info'](_0x9bd9('0x1e'),_0x4b6bec);logger[_0x9bd9('0xe')](_0x9bd9('0x1e'),_0x4b6bec,JSON[_0x9bd9('0x10')](_0x4fdcc6));_0x511d05(_0x4fdcc6);})[_0x9bd9('0x1d')](function(_0x29a10c){logger['error'](_0x9bd9('0x1e'),_0x29a10c[_0x9bd9('0x13')],_0x4b6bec);_0x2a06e9(_0x17f3ff[_0x9bd9('0x11')](0x1f4,_0x29a10c[_0x9bd9('0x13')]));});});};
\ No newline at end of file
+var _0xc0dc=['request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x285f9b,_0xfcae6c){var _0x32dd58=function(_0x392920){while(--_0x392920){_0x285f9b['push'](_0x285f9b['shift']());}};_0x32dd58(++_0xfcae6c);}(_0xc0dc,0xf6));var _0xcc0d=function(_0x4e291b,_0x1f1dcc){_0x4e291b=_0x4e291b-0x0;var _0x2d0bd3=_0xc0dc[_0x4e291b];return _0x2d0bd3;};'use strict';var _=require(_0xcc0d('0x0'));var util=require(_0xcc0d('0x1'));var moment=require(_0xcc0d('0x2'));var BPromise=require(_0xcc0d('0x3'));var rs=require(_0xcc0d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc0d('0x6'))(_0xcc0d('0x7'));var config=require(_0xcc0d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcc0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x387e4f,_0x43de3e,_0x4f387e){return new BPromise(function(_0x49fda8,_0xb83ca3){return client[_0xcc0d('0xa')](_0x387e4f,_0x4f387e)[_0xcc0d('0xb')](function(_0x6e4dca){logger[_0xcc0d('0xc')](_0xcc0d('0xd'),_0x43de3e,'request\x20sent');logger[_0xcc0d('0xe')](_0xcc0d('0xf'),_0x43de3e,_0xcc0d('0x10'),JSON[_0xcc0d('0x11')](_0x6e4dca));if(_0x6e4dca['error']){if(_0x6e4dca['error']['code']===0x1f4){logger['error'](_0xcc0d('0xd'),_0x43de3e,_0x6e4dca[_0xcc0d('0x12')][_0xcc0d('0x13')]);return _0xb83ca3(_0x6e4dca[_0xcc0d('0x12')][_0xcc0d('0x13')]);}logger[_0xcc0d('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x43de3e,_0x6e4dca[_0xcc0d('0x12')][_0xcc0d('0x13')]);return _0x49fda8(_0x6e4dca[_0xcc0d('0x12')][_0xcc0d('0x13')]);}else{logger[_0xcc0d('0xc')](_0xcc0d('0xd'),_0x43de3e,'request\x20sent');_0x49fda8(_0x6e4dca[_0xcc0d('0x14')]['message']);}})['catch'](function(_0x4d7182){logger['error'](_0xcc0d('0xd'),_0x43de3e,_0x4d7182);_0xb83ca3(_0x4d7182);});});}exports[_0xcc0d('0x15')]=function(_0x57d7f1){var _0x4c2b0e=this;return new Promise(function(_0x23f28d,_0x22745e){return db[_0xcc0d('0x16')][_0xcc0d('0x17')](_0x57d7f1[_0xcc0d('0x18')],{'raw':_0x57d7f1['options']?_0x57d7f1[_0xcc0d('0x19')][_0xcc0d('0x1a')]===undefined?!![]:![]:!![]})[_0xcc0d('0xb')](function(_0x40dbbc){logger['info'](_0xcc0d('0x15'),_0x57d7f1);logger[_0xcc0d('0xe')](_0xcc0d('0x15'),_0x57d7f1,JSON[_0xcc0d('0x11')](_0x40dbbc));_0x23f28d(_0x40dbbc);})['catch'](function(_0x59285d){logger[_0xcc0d('0x12')](_0xcc0d('0x15'),_0x59285d['message'],_0x57d7f1);_0x22745e(_0x4c2b0e['error'](0x1f4,_0x59285d[_0xcc0d('0x13')]));});});};exports[_0xcc0d('0x1b')]=function(_0x8fd67c){var _0xca46ee=this;return new Promise(function(_0x306c05,_0x5487f7){return db[_0xcc0d('0x16')]['update'](_0x8fd67c[_0xcc0d('0x18')],{'raw':_0x8fd67c['options']?_0x8fd67c[_0xcc0d('0x19')][_0xcc0d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8fd67c[_0xcc0d('0x19')]?_0x8fd67c[_0xcc0d('0x19')][_0xcc0d('0x1c')]||null:null,'attributes':_0x8fd67c[_0xcc0d('0x19')]?_0x8fd67c[_0xcc0d('0x19')][_0xcc0d('0x1d')]||null:null,'limit':_0x8fd67c[_0xcc0d('0x19')]?_0x8fd67c[_0xcc0d('0x19')][_0xcc0d('0x1e')]||null:null})[_0xcc0d('0xb')](function(_0x226f57){logger[_0xcc0d('0xc')]('UpdateChatQueueReport',_0x8fd67c);logger['debug'](_0xcc0d('0x1b'),_0x8fd67c,JSON[_0xcc0d('0x11')](_0x226f57));_0x306c05(_0x226f57);})[_0xcc0d('0x1f')](function(_0x448941){logger[_0xcc0d('0x12')]('UpdateChatQueueReport',_0x448941['message'],_0x8fd67c);_0x5487f7(_0xca46ee[_0xcc0d('0x12')](0x1f4,_0x448941[_0xcc0d('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 758bd15..8e15c2d 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 _0x5517=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','post','create','/:id','update','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c5b92,_0x4bef5c){var _0x137efd=function(_0x19637a){while(--_0x19637a){_0x4c5b92['push'](_0x4c5b92['shift']());}};_0x137efd(++_0x4bef5c);}(_0x5517,0x151));var _0x7551=function(_0x5cc14b,_0x17f0d0){_0x5cc14b=_0x5cc14b-0x0;var _0x1064de=_0x5517[_0x5cc14b];return _0x1064de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7551('0x0'));var timeout=require(_0x7551('0x1'));var express=require(_0x7551('0x2'));var router=express[_0x7551('0x3')]();var fs_extra=require(_0x7551('0x4'));var auth=require(_0x7551('0x5'));var interaction=require(_0x7551('0x6'));var config=require(_0x7551('0x7'));var controller=require(_0x7551('0x8'));router[_0x7551('0x9')]('/',auth[_0x7551('0xa')](),controller[_0x7551('0xb')]);router['get']('/describe',auth[_0x7551('0xa')](),controller[_0x7551('0xc')]);router[_0x7551('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7551('0xd')]('/',auth[_0x7551('0xa')](),controller[_0x7551('0xe')]);router['put'](_0x7551('0xf'),auth[_0x7551('0xa')](),controller[_0x7551('0x10')]);router['delete']('/:id',auth[_0x7551('0xa')](),controller[_0x7551('0x11')]);module[_0x7551('0x12')]=router;
\ No newline at end of file
+var _0xe554=['/:id','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','get','show','post','create','put'];(function(_0x197043,_0x3ebf47){var _0x233e33=function(_0x17bd0f){while(--_0x17bd0f){_0x197043['push'](_0x197043['shift']());}};_0x233e33(++_0x3ebf47);}(_0xe554,0x112));var _0x4e55=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe554[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x4e55('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4e55('0x1'));var express=require(_0x4e55('0x2'));var router=express[_0x4e55('0x3')]();var fs_extra=require(_0x4e55('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4e55('0x5'));var config=require(_0x4e55('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x4e55('0x7')](),controller['index']);router['get'](_0x4e55('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x4e55('0x9')]('/:id',auth[_0x4e55('0x7')](),controller[_0x4e55('0xa')]);router[_0x4e55('0xb')]('/',auth[_0x4e55('0x7')](),controller[_0x4e55('0xc')]);router[_0x4e55('0xd')](_0x4e55('0xe'),auth['isAuthenticated'](),controller[_0x4e55('0xf')]);router[_0x4e55('0x10')](_0x4e55('0xe'),auth[_0x4e55('0x7')](),controller['destroy']);module[_0x4e55('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 c103d25..071274a 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3928a0,_0x491c35){var _0x54839f=function(_0x379754){while(--_0x379754){_0x3928a0['push'](_0x3928a0['shift']());}};_0x54839f(++_0x491c35);}(_0x70e0,0x17b));var _0x070e=function(_0x4e3851,_0x51ae8d){_0x4e3851=_0x4e3851-0x0;var _0x22a59c=_0x70e0[_0x4e3851];return _0x22a59c;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5a19fc,_0x58f9f4){var _0x34b413=function(_0x344feb){while(--_0x344feb){_0x5a19fc['push'](_0x5a19fc['shift']());}};_0x34b413(++_0x58f9f4);}(_0xb43b,0x1b2));var _0xbb43=function(_0x437344,_0x482d45){_0x437344=_0x437344-0x0;var _0x450a49=_0xb43b[_0x437344];return _0x450a49;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index d2b9fe9..2e6b013 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 _0xe8f3=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','type','key','map','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','params','intersection','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x26caac,_0x5469d6){var _0x5bd934=function(_0x39ad2){while(--_0x39ad2){_0x26caac['push'](_0x26caac['shift']());}};_0x5bd934(++_0x5469d6);}(_0xe8f3,0x1bc));var _0x3e8f=function(_0x2f5d29,_0x5b9a42){_0x2f5d29=_0x2f5d29-0x0;var _0x5a633e=_0xe8f3[_0x2f5d29];return _0x5a633e;};'use strict';var emlformat=require(_0x3e8f('0x0'));var rimraf=require(_0x3e8f('0x1'));var zipdir=require(_0x3e8f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e8f('0x3'));var moment=require(_0x3e8f('0x4'));var BPromise=require(_0x3e8f('0x5'));var Mustache=require(_0x3e8f('0x6'));var util=require(_0x3e8f('0x7'));var path=require(_0x3e8f('0x8'));var sox=require('sox');var csv=require(_0x3e8f('0x9'));var ejs=require(_0x3e8f('0xa'));var fs=require('fs');var fs_extra=require(_0x3e8f('0xb'));var _=require(_0x3e8f('0xc'));var squel=require(_0x3e8f('0xd'));var crypto=require(_0x3e8f('0xe'));var jsforce=require(_0x3e8f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3e8f('0x9'));var querystring=require(_0x3e8f('0x10'));var Papa=require(_0x3e8f('0x11'));var Redis=require(_0x3e8f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e8f('0x13'));var logger=require(_0x3e8f('0x14'))(_0x3e8f('0x15'));var utils=require(_0x3e8f('0x16'));var config=require(_0x3e8f('0x17'));var licenseUtil=require(_0x3e8f('0x18'));var db=require(_0x3e8f('0x19'))['db'];function respondWithStatusCode(_0x269897,_0x120bf1){_0x120bf1=_0x120bf1||0xcc;return function(_0x50d53e){if(_0x50d53e){return _0x269897[_0x3e8f('0x1a')](_0x120bf1);}return _0x269897[_0x3e8f('0x1b')](_0x120bf1)[_0x3e8f('0x1c')]();};}function respondWithResult(_0x727074,_0x3839bb){_0x3839bb=_0x3839bb||0xc8;return function(_0x2fd73e){if(_0x2fd73e){return _0x727074[_0x3e8f('0x1b')](_0x3839bb)[_0x3e8f('0x1d')](_0x2fd73e);}};}function respondWithFilteredResult(_0x5b854d,_0x149e18){return function(_0x377e3a){if(_0x377e3a){var _0x3407c3=typeof _0x149e18[_0x3e8f('0x1e')]===_0x3e8f('0x1f')&&typeof _0x149e18[_0x3e8f('0x20')]===_0x3e8f('0x1f');var _0x2e838f=_0x377e3a[_0x3e8f('0x21')];var _0x5099a1=_0x3407c3?0x0:_0x149e18[_0x3e8f('0x1e')];var _0x3dc2a1=_0x3407c3?_0x377e3a[_0x3e8f('0x21')]:_0x149e18[_0x3e8f('0x1e')]+_0x149e18[_0x3e8f('0x20')];var _0x599201;if(_0x3dc2a1>=_0x2e838f){_0x3dc2a1=_0x2e838f;_0x599201=0xc8;}else{_0x599201=0xce;}_0x5b854d['status'](_0x599201);return _0x5b854d[_0x3e8f('0x22')](_0x3e8f('0x23'),_0x5099a1+'-'+_0x3dc2a1+'/'+_0x2e838f)[_0x3e8f('0x1d')](_0x377e3a);}return null;};}function patchUpdates(_0x4dc3b0){return function(_0x3aed5f){try{jsonpatch[_0x3e8f('0x24')](_0x3aed5f,_0x4dc3b0,!![]);}catch(_0x3b8111){return BPromise[_0x3e8f('0x25')](_0x3b8111);}return _0x3aed5f[_0x3e8f('0x26')]();};}function saveUpdates(_0x47f2cf,_0x5d9333){return function(_0x57ecad){if(_0x57ecad){return _0x57ecad[_0x3e8f('0x27')](_0x47f2cf)['then'](function(_0x39da9a){return _0x39da9a;});}return null;};}function removeEntity(_0x43d304,_0x1db034){return function(_0x12a062){if(_0x12a062){return _0x12a062[_0x3e8f('0x28')]()['then'](function(){_0x43d304[_0x3e8f('0x1b')](0xcc)[_0x3e8f('0x1c')]();});}};}function handleEntityNotFound(_0x1f34fe,_0x384c7d){return function(_0x6c69aa){if(!_0x6c69aa){_0x1f34fe['sendStatus'](0x194);}return _0x6c69aa;};}function handleError(_0x3f68fb,_0x537d7c){_0x537d7c=_0x537d7c||0x1f4;return function(_0x546d3d){logger[_0x3e8f('0x29')](_0x546d3d[_0x3e8f('0x2a')]);if(_0x546d3d[_0x3e8f('0x2b')]){delete _0x546d3d[_0x3e8f('0x2b')];}_0x3f68fb[_0x3e8f('0x1b')](_0x537d7c)[_0x3e8f('0x2c')](_0x546d3d);};}exports[_0x3e8f('0x2d')]=function(_0x277c94,_0x7c6957){var _0x5c1d8c={},_0x131678={},_0x4ae593={'count':0x0,'rows':[]};var _0x399dd8=_['map'](db[_0x3e8f('0x2e')][_0x3e8f('0x2f')],function(_0x54ac81){return{'name':_0x54ac81['fieldName'],'type':_0x54ac81[_0x3e8f('0x30')][_0x3e8f('0x31')]};});_0x131678['model']=_[_0x3e8f('0x32')](_0x399dd8,'name');_0x131678[_0x3e8f('0x33')]=_[_0x3e8f('0x34')](_0x277c94[_0x3e8f('0x33')]);_0x131678[_0x3e8f('0x35')]=_['intersection'](_0x131678[_0x3e8f('0x36')],_0x131678[_0x3e8f('0x33')]);_0x5c1d8c['attributes']=_['intersection'](_0x131678[_0x3e8f('0x36')],qs[_0x3e8f('0x37')](_0x277c94[_0x3e8f('0x33')][_0x3e8f('0x37')]));_0x5c1d8c['attributes']=_0x5c1d8c[_0x3e8f('0x38')][_0x3e8f('0x39')]?_0x5c1d8c[_0x3e8f('0x38')]:_0x131678[_0x3e8f('0x36')];if(!_0x277c94[_0x3e8f('0x33')][_0x3e8f('0x3a')](_0x3e8f('0x3b'))){_0x5c1d8c['limit']=qs[_0x3e8f('0x20')](_0x277c94[_0x3e8f('0x33')][_0x3e8f('0x20')]);_0x5c1d8c[_0x3e8f('0x1e')]=qs['offset'](_0x277c94['query']['offset']);}_0x5c1d8c['order']=qs[_0x3e8f('0x3c')](_0x277c94[_0x3e8f('0x33')][_0x3e8f('0x3c')]);_0x5c1d8c['where']=qs[_0x3e8f('0x35')](_['pick'](_0x277c94[_0x3e8f('0x33')],_0x131678[_0x3e8f('0x35')]),_0x399dd8);if(_0x277c94[_0x3e8f('0x33')][_0x3e8f('0x3d')]){_0x5c1d8c[_0x3e8f('0x3e')]=_['merge'](_0x5c1d8c[_0x3e8f('0x3e')],{'$or':_[_0x3e8f('0x32')](_0x399dd8,function(_0x25ce41){if(_0x25ce41['type']!==_0x3e8f('0x3f')){var _0x49558f={};_0x49558f[_0x25ce41[_0x3e8f('0x2b')]]={'$like':'%'+_0x277c94[_0x3e8f('0x33')]['filter']+'%'};return _0x49558f;}})});}_0x5c1d8c=_[_0x3e8f('0x40')]({},_0x5c1d8c,_0x277c94['options']);var _0x1cc9c9={'where':_0x5c1d8c[_0x3e8f('0x3e')]};return db['ChatTransferReport'][_0x3e8f('0x21')](_0x1cc9c9)[_0x3e8f('0x41')](function(_0x5bca73){_0x4ae593['count']=_0x5bca73;if(_0x277c94['query'][_0x3e8f('0x42')]){_0x5c1d8c[_0x3e8f('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x3e8f('0x44')](_0x5c1d8c);})[_0x3e8f('0x41')](function(_0x43852c){_0x4ae593[_0x3e8f('0x45')]=_0x43852c;return _0x4ae593;})[_0x3e8f('0x41')](respondWithFilteredResult(_0x7c6957,_0x5c1d8c))[_0x3e8f('0x46')](handleError(_0x7c6957,null));};exports['show']=function(_0x592e2e,_0x579970){var _0x271f49={'raw':!![],'where':{'id':_0x592e2e[_0x3e8f('0x47')]['id']}},_0x407792={};_0x407792[_0x3e8f('0x36')]=_['keys'](db[_0x3e8f('0x2e')]['rawAttributes']);_0x407792[_0x3e8f('0x33')]=_[_0x3e8f('0x34')](_0x592e2e['query']);_0x407792[_0x3e8f('0x35')]=_[_0x3e8f('0x48')](_0x407792[_0x3e8f('0x36')],_0x407792[_0x3e8f('0x33')]);_0x271f49['attributes']=_[_0x3e8f('0x48')](_0x407792[_0x3e8f('0x36')],qs[_0x3e8f('0x37')](_0x592e2e[_0x3e8f('0x33')][_0x3e8f('0x37')]));_0x271f49[_0x3e8f('0x38')]=_0x271f49['attributes'][_0x3e8f('0x39')]?_0x271f49['attributes']:_0x407792[_0x3e8f('0x36')];if(_0x592e2e[_0x3e8f('0x33')][_0x3e8f('0x42')]){_0x271f49['include']=[{'all':!![]}];}_0x271f49=_[_0x3e8f('0x40')]({},_0x271f49,_0x592e2e[_0x3e8f('0x49')]);return db['ChatTransferReport'][_0x3e8f('0x4a')](_0x271f49)[_0x3e8f('0x41')](handleEntityNotFound(_0x579970,null))[_0x3e8f('0x41')](respondWithResult(_0x579970,null))[_0x3e8f('0x46')](handleError(_0x579970,null));};exports['create']=function(_0x405d55,_0x496b8d){return db[_0x3e8f('0x2e')][_0x3e8f('0x4b')](_0x405d55[_0x3e8f('0x4c')],{})[_0x3e8f('0x41')](respondWithResult(_0x496b8d,0xc9))[_0x3e8f('0x46')](handleError(_0x496b8d,null));};exports['update']=function(_0x48711d,_0x46b860){if(_0x48711d['body']['id']){delete _0x48711d[_0x3e8f('0x4c')]['id'];}return db['ChatTransferReport'][_0x3e8f('0x4a')]({'where':{'id':_0x48711d['params']['id']}})[_0x3e8f('0x41')](handleEntityNotFound(_0x46b860,null))[_0x3e8f('0x41')](saveUpdates(_0x48711d[_0x3e8f('0x4c')],null))[_0x3e8f('0x41')](respondWithResult(_0x46b860,null))['catch'](handleError(_0x46b860,null));};exports['destroy']=function(_0x22b9c5,_0x5324d2){return db[_0x3e8f('0x2e')][_0x3e8f('0x4a')]({'where':{'id':_0x22b9c5[_0x3e8f('0x47')]['id']}})[_0x3e8f('0x41')](handleEntityNotFound(_0x5324d2,null))[_0x3e8f('0x41')](removeEntity(_0x5324d2,null))[_0x3e8f('0x46')](handleError(_0x5324d2,null));};exports['describe']=function(_0x407d62,_0x5a673f){return db['ChatTransferReport'][_0x3e8f('0x4d')]()[_0x3e8f('0x41')](respondWithResult(_0x5a673f,null))[_0x3e8f('0x46')](handleError(_0x5a673f,null));};
\ No newline at end of file
+var _0xfacc=['fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatTransferReport','includeAll','include','rows','catch','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model'];(function(_0x49710a,_0x56a5f1){var _0x686417=function(_0x5d51ef){while(--_0x5d51ef){_0x49710a['push'](_0x49710a['shift']());}};_0x686417(++_0x56a5f1);}(_0xfacc,0xfc));var _0xcfac=function(_0x540311,_0x53ca8b){_0x540311=_0x540311-0x0;var _0x56beef=_0xfacc[_0x540311];return _0x56beef;};'use strict';var emlformat=require(_0xcfac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfac('0x1'));var jsonpatch=require(_0xcfac('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfac('0x3'));var Mustache=require('mustache');var util=require(_0xcfac('0x4'));var path=require(_0xcfac('0x5'));var sox=require(_0xcfac('0x6'));var csv=require(_0xcfac('0x7'));var ejs=require(_0xcfac('0x8'));var fs=require('fs');var fs_extra=require(_0xcfac('0x9'));var _=require(_0xcfac('0xa'));var squel=require(_0xcfac('0xb'));var crypto=require(_0xcfac('0xc'));var jsforce=require(_0xcfac('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcfac('0xe'));var Papa=require(_0xcfac('0xf'));var Redis=require(_0xcfac('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcfac('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcfac('0x12'));var logger=require(_0xcfac('0x13'))(_0xcfac('0x14'));var utils=require(_0xcfac('0x15'));var config=require(_0xcfac('0x16'));var licenseUtil=require(_0xcfac('0x17'));var db=require(_0xcfac('0x18'))['db'];function respondWithStatusCode(_0x4dd907,_0x21681a){_0x21681a=_0x21681a||0xcc;return function(_0x12e854){if(_0x12e854){return _0x4dd907['sendStatus'](_0x21681a);}return _0x4dd907[_0xcfac('0x19')](_0x21681a)[_0xcfac('0x1a')]();};}function respondWithResult(_0xffea01,_0x57069c){_0x57069c=_0x57069c||0xc8;return function(_0x297623){if(_0x297623){return _0xffea01[_0xcfac('0x19')](_0x57069c)[_0xcfac('0x1b')](_0x297623);}};}function respondWithFilteredResult(_0x117df8,_0x562e3c){return function(_0x356bfd){if(_0x356bfd){var _0xc2fcc4=typeof _0x562e3c[_0xcfac('0x1c')]===_0xcfac('0x1d')&&typeof _0x562e3c['limit']===_0xcfac('0x1d');var _0x3baaad=_0x356bfd[_0xcfac('0x1e')];var _0x286063=_0xc2fcc4?0x0:_0x562e3c[_0xcfac('0x1c')];var _0x36e510=_0xc2fcc4?_0x356bfd[_0xcfac('0x1e')]:_0x562e3c[_0xcfac('0x1c')]+_0x562e3c['limit'];var _0x458b54;if(_0x36e510>=_0x3baaad){_0x36e510=_0x3baaad;_0x458b54=0xc8;}else{_0x458b54=0xce;}_0x117df8['status'](_0x458b54);return _0x117df8[_0xcfac('0x1f')](_0xcfac('0x20'),_0x286063+'-'+_0x36e510+'/'+_0x3baaad)['json'](_0x356bfd);}return null;};}function patchUpdates(_0x42678c){return function(_0x2f18fd){try{jsonpatch[_0xcfac('0x21')](_0x2f18fd,_0x42678c,!![]);}catch(_0x397c07){return BPromise['reject'](_0x397c07);}return _0x2f18fd[_0xcfac('0x22')]();};}function saveUpdates(_0x1e8ae7,_0xab1813){return function(_0x4cabe8){if(_0x4cabe8){return _0x4cabe8[_0xcfac('0x23')](_0x1e8ae7)['then'](function(_0x47ed6f){return _0x47ed6f;});}return null;};}function removeEntity(_0x19b518,_0x1937de){return function(_0x2d8b50){if(_0x2d8b50){return _0x2d8b50[_0xcfac('0x24')]()[_0xcfac('0x25')](function(){_0x19b518[_0xcfac('0x19')](0xcc)[_0xcfac('0x1a')]();});}};}function handleEntityNotFound(_0x4a6f0a,_0x2a6a17){return function(_0x2dfd9f){if(!_0x2dfd9f){_0x4a6f0a[_0xcfac('0x26')](0x194);}return _0x2dfd9f;};}function handleError(_0x2909eb,_0x5f0964){_0x5f0964=_0x5f0964||0x1f4;return function(_0xabc551){logger[_0xcfac('0x27')](_0xabc551[_0xcfac('0x28')]);if(_0xabc551[_0xcfac('0x29')]){delete _0xabc551[_0xcfac('0x29')];}_0x2909eb[_0xcfac('0x19')](_0x5f0964)[_0xcfac('0x2a')](_0xabc551);};}exports[_0xcfac('0x2b')]=function(_0x4e78d2,_0x5a3b9c){var _0x3528e5={},_0x45e91a={},_0x4ee3e7={'count':0x0,'rows':[]};var _0x465912=_[_0xcfac('0x2c')](db['ChatTransferReport'][_0xcfac('0x2d')],function(_0x4ca36f){return{'name':_0x4ca36f[_0xcfac('0x2e')],'type':_0x4ca36f['type']['key']};});_0x45e91a['model']=_[_0xcfac('0x2c')](_0x465912,_0xcfac('0x29'));_0x45e91a[_0xcfac('0x2f')]=_[_0xcfac('0x30')](_0x4e78d2[_0xcfac('0x2f')]);_0x45e91a[_0xcfac('0x31')]=_[_0xcfac('0x32')](_0x45e91a[_0xcfac('0x33')],_0x45e91a[_0xcfac('0x2f')]);_0x3528e5['attributes']=_[_0xcfac('0x32')](_0x45e91a['model'],qs[_0xcfac('0x34')](_0x4e78d2[_0xcfac('0x2f')]['fields']));_0x3528e5['attributes']=_0x3528e5['attributes']['length']?_0x3528e5[_0xcfac('0x35')]:_0x45e91a[_0xcfac('0x33')];if(!_0x4e78d2[_0xcfac('0x2f')][_0xcfac('0x36')](_0xcfac('0x37'))){_0x3528e5[_0xcfac('0x38')]=qs['limit'](_0x4e78d2[_0xcfac('0x2f')][_0xcfac('0x38')]);_0x3528e5[_0xcfac('0x1c')]=qs['offset'](_0x4e78d2['query']['offset']);}_0x3528e5[_0xcfac('0x39')]=qs[_0xcfac('0x3a')](_0x4e78d2[_0xcfac('0x2f')]['sort']);_0x3528e5['where']=qs[_0xcfac('0x31')](_[_0xcfac('0x3b')](_0x4e78d2[_0xcfac('0x2f')],_0x45e91a[_0xcfac('0x31')]),_0x465912);if(_0x4e78d2[_0xcfac('0x2f')][_0xcfac('0x3c')]){_0x3528e5[_0xcfac('0x3d')]=_[_0xcfac('0x3e')](_0x3528e5['where'],{'$or':_['map'](_0x465912,function(_0x40a87c){if(_0x40a87c[_0xcfac('0x3f')]!==_0xcfac('0x40')){var _0x58f23f={};_0x58f23f[_0x40a87c[_0xcfac('0x29')]]={'$like':'%'+_0x4e78d2['query'][_0xcfac('0x3c')]+'%'};return _0x58f23f;}})});}_0x3528e5=_[_0xcfac('0x3e')]({},_0x3528e5,_0x4e78d2[_0xcfac('0x41')]);var _0x173537={'where':_0x3528e5[_0xcfac('0x3d')]};return db[_0xcfac('0x42')][_0xcfac('0x1e')](_0x173537)['then'](function(_0x204cc4){_0x4ee3e7[_0xcfac('0x1e')]=_0x204cc4;if(_0x4e78d2['query'][_0xcfac('0x43')]){_0x3528e5[_0xcfac('0x44')]=[{'all':!![]}];}return db[_0xcfac('0x42')]['findAll'](_0x3528e5);})[_0xcfac('0x25')](function(_0x1b71e1){_0x4ee3e7[_0xcfac('0x45')]=_0x1b71e1;return _0x4ee3e7;})['then'](respondWithFilteredResult(_0x5a3b9c,_0x3528e5))[_0xcfac('0x46')](handleError(_0x5a3b9c,null));};exports['show']=function(_0x194571,_0x5ebedf){var _0x1db5d8={'raw':!![],'where':{'id':_0x194571[_0xcfac('0x47')]['id']}},_0x1d5f5f={};_0x1d5f5f['model']=_['keys'](db[_0xcfac('0x42')][_0xcfac('0x2d')]);_0x1d5f5f['query']=_[_0xcfac('0x30')](_0x194571[_0xcfac('0x2f')]);_0x1d5f5f['filters']=_['intersection'](_0x1d5f5f['model'],_0x1d5f5f['query']);_0x1db5d8[_0xcfac('0x35')]=_[_0xcfac('0x32')](_0x1d5f5f[_0xcfac('0x33')],qs['fields'](_0x194571[_0xcfac('0x2f')][_0xcfac('0x34')]));_0x1db5d8['attributes']=_0x1db5d8[_0xcfac('0x35')]['length']?_0x1db5d8[_0xcfac('0x35')]:_0x1d5f5f[_0xcfac('0x33')];if(_0x194571[_0xcfac('0x2f')][_0xcfac('0x43')]){_0x1db5d8[_0xcfac('0x44')]=[{'all':!![]}];}_0x1db5d8=_['merge']({},_0x1db5d8,_0x194571[_0xcfac('0x41')]);return db[_0xcfac('0x42')]['find'](_0x1db5d8)[_0xcfac('0x25')](handleEntityNotFound(_0x5ebedf,null))[_0xcfac('0x25')](respondWithResult(_0x5ebedf,null))[_0xcfac('0x46')](handleError(_0x5ebedf,null));};exports['create']=function(_0x2abc29,_0x316629){return db[_0xcfac('0x42')][_0xcfac('0x48')](_0x2abc29[_0xcfac('0x49')],{})[_0xcfac('0x25')](respondWithResult(_0x316629,0xc9))[_0xcfac('0x46')](handleError(_0x316629,null));};exports[_0xcfac('0x23')]=function(_0x2f3539,_0x3de1a4){if(_0x2f3539[_0xcfac('0x49')]['id']){delete _0x2f3539[_0xcfac('0x49')]['id'];}return db[_0xcfac('0x42')][_0xcfac('0x4a')]({'where':{'id':_0x2f3539[_0xcfac('0x47')]['id']}})[_0xcfac('0x25')](handleEntityNotFound(_0x3de1a4,null))[_0xcfac('0x25')](saveUpdates(_0x2f3539['body'],null))['then'](respondWithResult(_0x3de1a4,null))[_0xcfac('0x46')](handleError(_0x3de1a4,null));};exports[_0xcfac('0x24')]=function(_0x18b3d4,_0x9c935c){return db[_0xcfac('0x42')][_0xcfac('0x4a')]({'where':{'id':_0x18b3d4[_0xcfac('0x47')]['id']}})[_0xcfac('0x25')](handleEntityNotFound(_0x9c935c,null))[_0xcfac('0x25')](removeEntity(_0x9c935c,null))[_0xcfac('0x46')](handleError(_0x9c935c,null));};exports[_0xcfac('0x4b')]=function(_0x4c9734,_0x3124c3){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x3124c3,null))[_0xcfac('0x46')](handleError(_0x3124c3,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index ff40873..4ee58c0 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 _0x418c=['request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4c391e,_0x58e86b){var _0x44143a=function(_0x2c5e3f){while(--_0x2c5e3f){_0x4c391e['push'](_0x4c391e['shift']());}};_0x44143a(++_0x58e86b);}(_0x418c,0x192));var _0xc418=function(_0x50c6d8,_0x166278){_0x50c6d8=_0x50c6d8-0x0;var _0x416c3a=_0x418c[_0x50c6d8];return _0x416c3a;};'use strict';var _=require(_0xc418('0x0'));var util=require(_0xc418('0x1'));var logger=require(_0xc418('0x2'))('api');var moment=require(_0xc418('0x3'));var BPromise=require(_0xc418('0x4'));var rp=require(_0xc418('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc418('0x6'));var attributes=require(_0xc418('0x7'));module[_0xc418('0x8')]=function(_0x4ee8ee,_0x2f3ee1){return _0x4ee8ee[_0xc418('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc418('0xa'),'fields':[_0xc418('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x14fb=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','uniqueid','util','moment','bluebird'];(function(_0x5f2cd,_0x2640ce){var _0x356ba8=function(_0x2a5ee1){while(--_0x2a5ee1){_0x5f2cd['push'](_0x5f2cd['shift']());}};_0x356ba8(++_0x2640ce);}(_0x14fb,0xbb));var _0xb14f=function(_0x45f24d,_0x1055a2){_0x45f24d=_0x45f24d-0x0;var _0x374cd6=_0x14fb[_0x45f24d];return _0x374cd6;};'use strict';var _=require('lodash');var util=require(_0xb14f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb14f('0x1'));var BPromise=require(_0xb14f('0x2'));var rp=require(_0xb14f('0x3'));var fs=require('fs');var path=require(_0xb14f('0x4'));var rimraf=require(_0xb14f('0x5'));var config=require(_0xb14f('0x6'));var attributes=require(_0xb14f('0x7'));module[_0xb14f('0x8')]=function(_0x332fe6,_0x43345b){return _0x332fe6['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xb14f('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 80d67d0..9a2e027 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 _0x67fd=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x67fd,0x94));var _0xd67f=function(_0x162338,_0x509994){_0x162338=_0x162338-0x0;var _0x296cc0=_0x67fd[_0x162338];return _0x296cc0;};'use strict';var _=require(_0xd67f('0x0'));var util=require(_0xd67f('0x1'));var moment=require(_0xd67f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd67f('0x3'));var fs=require('fs');var Redis=require(_0xd67f('0x4'));var db=require(_0xd67f('0x5'))['db'];var utils=require(_0xd67f('0x6'));var logger=require(_0xd67f('0x7'))(_0xd67f('0x8'));var config=require(_0xd67f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd67f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58171c,_0x4cb619,_0x39915b){return new BPromise(function(_0x42acbe,_0x1fe56a){return client[_0xd67f('0xb')](_0x58171c,_0x39915b)[_0xd67f('0xc')](function(_0x2c46fd){logger[_0xd67f('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x4cb619,_0xd67f('0xe'));logger['debug'](_0xd67f('0xf'),_0x4cb619,_0xd67f('0xe'),JSON[_0xd67f('0x10')](_0x2c46fd));if(_0x2c46fd[_0xd67f('0x11')]){if(_0x2c46fd[_0xd67f('0x11')][_0xd67f('0x12')]===0x1f4){logger['error'](_0xd67f('0x13'),_0x4cb619,_0x2c46fd[_0xd67f('0x11')][_0xd67f('0x14')]);return _0x1fe56a(_0x2c46fd['error']['message']);}logger[_0xd67f('0x11')](_0xd67f('0x13'),_0x4cb619,_0x2c46fd['error']['message']);return _0x42acbe(_0x2c46fd[_0xd67f('0x11')][_0xd67f('0x14')]);}else{logger[_0xd67f('0xd')](_0xd67f('0x13'),_0x4cb619,_0xd67f('0xe'));_0x42acbe(_0x2c46fd[_0xd67f('0x15')][_0xd67f('0x14')]);}})['catch'](function(_0x323dc0){logger[_0xd67f('0x11')](_0xd67f('0x13'),_0x4cb619,_0x323dc0);_0x1fe56a(_0x323dc0);});});}
\ No newline at end of file
+var _0x7b04=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x43a8b9,_0x4ff1e0){var _0x39894b=function(_0x48b507){while(--_0x48b507){_0x43a8b9['push'](_0x43a8b9['shift']());}};_0x39894b(++_0x4ff1e0);}(_0x7b04,0x157));var _0x47b0=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x7b04[_0x1203f];return _0x365f0a;};'use strict';var _=require('lodash');var util=require(_0x47b0('0x0'));var moment=require(_0x47b0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47b0('0x2'));var db=require(_0x47b0('0x3'))['db'];var utils=require(_0x47b0('0x4'));var logger=require(_0x47b0('0x5'))(_0x47b0('0x6'));var config=require(_0x47b0('0x7'));var jayson=require(_0x47b0('0x8'));var client=jayson[_0x47b0('0x9')][_0x47b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x366e67,_0x3227cf,_0x35e8c7){return new BPromise(function(_0x4fc356,_0x4fa919){return client[_0x47b0('0xb')](_0x366e67,_0x35e8c7)[_0x47b0('0xc')](function(_0x74ac52){logger['info'](_0x47b0('0xd'),_0x3227cf,_0x47b0('0xe'));logger[_0x47b0('0xf')](_0x47b0('0x10'),_0x3227cf,_0x47b0('0xe'),JSON[_0x47b0('0x11')](_0x74ac52));if(_0x74ac52['error']){if(_0x74ac52[_0x47b0('0x12')]['code']===0x1f4){logger['error'](_0x47b0('0xd'),_0x3227cf,_0x74ac52[_0x47b0('0x12')][_0x47b0('0x13')]);return _0x4fa919(_0x74ac52[_0x47b0('0x12')][_0x47b0('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3227cf,_0x74ac52[_0x47b0('0x12')][_0x47b0('0x13')]);return _0x4fc356(_0x74ac52[_0x47b0('0x12')][_0x47b0('0x13')]);}else{logger['info'](_0x47b0('0xd'),_0x3227cf,'request\x20sent');_0x4fc356(_0x74ac52['result'][_0x47b0('0x13')]);}})[_0x47b0('0x14')](function(_0x1f09e9){logger[_0x47b0('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x3227cf,_0x1f09e9);_0x4fa919(_0x1f09e9);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9d6fb1d..1fd236b 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 _0xe1fd=['create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','show','post'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xe1fd,0x7e));var _0xde1f=function(_0x3fe41d,_0xe45d60){_0x3fe41d=_0x3fe41d-0x0;var _0x40c928=_0xe1fd[_0x3fe41d];return _0x40c928;};'use strict';var multer=require(_0xde1f('0x0'));var util=require(_0xde1f('0x1'));var path=require('path');var timeout=require(_0xde1f('0x2'));var express=require(_0xde1f('0x3'));var router=express['Router']();var fs_extra=require(_0xde1f('0x4'));var auth=require(_0xde1f('0x5'));var interaction=require(_0xde1f('0x6'));var config=require(_0xde1f('0x7'));var controller=require(_0xde1f('0x8'));router[_0xde1f('0x9')]('/',auth[_0xde1f('0xa')](),controller[_0xde1f('0xb')]);router['get']('/describe',auth[_0xde1f('0xa')](),controller['describe']);router[_0xde1f('0x9')]('/:id',auth[_0xde1f('0xa')](),controller[_0xde1f('0xc')]);router[_0xde1f('0xd')]('/',auth[_0xde1f('0xa')](),controller[_0xde1f('0xe')]);router['put'](_0xde1f('0xf'),auth[_0xde1f('0xa')](),controller[_0xde1f('0x10')]);router[_0xde1f('0x11')](_0xde1f('0xf'),auth[_0xde1f('0xa')](),controller[_0xde1f('0x12')]);module[_0xde1f('0x13')]=router;
\ No newline at end of file
+var _0x016c=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x4ca426,_0x265a46){var _0x23edec=function(_0xe03a6a){while(--_0xe03a6a){_0x4ca426['push'](_0x4ca426['shift']());}};_0x23edec(++_0x265a46);}(_0x016c,0x1c3));var _0xc016=function(_0x6d948e,_0x240e7c){_0x6d948e=_0x6d948e-0x0;var _0x1affc4=_0x016c[_0x6d948e];return _0x1affc4;};'use strict';var multer=require(_0xc016('0x0'));var util=require(_0xc016('0x1'));var path=require(_0xc016('0x2'));var timeout=require('connect-timeout');var express=require(_0xc016('0x3'));var router=express['Router']();var fs_extra=require(_0xc016('0x4'));var auth=require(_0xc016('0x5'));var interaction=require(_0xc016('0x6'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xc016('0x7')]('/',auth[_0xc016('0x8')](),controller[_0xc016('0x9')]);router[_0xc016('0x7')](_0xc016('0xa'),auth['isAuthenticated'](),controller[_0xc016('0xb')]);router[_0xc016('0x7')](_0xc016('0xc'),auth['isAuthenticated'](),controller[_0xc016('0xd')]);router[_0xc016('0xe')]('/',auth[_0xc016('0x8')](),controller[_0xc016('0xf')]);router['put'](_0xc016('0xc'),auth[_0xc016('0x8')](),controller[_0xc016('0x10')]);router['delete']('/:id',auth[_0xc016('0x8')](),controller['destroy']);module[_0xc016('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index a84b4ec..76b26b3 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 _0xb58b=['alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','TEXT','Form\x20properly\x20submitted','Type\x20a\x20message','Skip','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT'];(function(_0x35c01e,_0x16c60f){var _0xd0cb89=function(_0x30d08e){while(--_0x30d08e){_0x35c01e['push'](_0x35c01e['shift']());}};_0xd0cb89(++_0x16c60f);}(_0xb58b,0x1f1));var _0xbb58=function(_0x849132,_0x104c4e){_0x849132=_0x849132-0x0;var _0x597dd6=_0xb58b[_0x849132];return _0x597dd6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbb58('0x0'));module[_0xbb58('0x1')]={'name':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb58('0x3')},'description':{'type':Sequelize[_0xbb58('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'key':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbb58('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbb58('0x8')]('rounded',_0xbb58('0x9')),'defaultValue':_0xbb58('0xa')},'header_online':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0xc')},'offline_chat_button':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xd')},'download_transcript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbb58('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x11')},'closingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x12')},'conditionAgreement':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xbb58('0x8')](_0xbb58('0x13'),_0xbb58('0x14')),'defaultValue':_0xbb58('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'variable':null,'config':{'placeholder':_0xbb58('0x17'),'type':'text','required':!![]},'props':{'title':_0xbb58('0x17'),'helpText':''}},{'type':'input','props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x19'))?JSON[_0xbb58('0x1a')](this[_0xbb58('0x18')](_0xbb58('0x19'))):{};},'set':function(_0x4e0303){return this[_0xbb58('0x1b')](_0xbb58('0x19'),JSON[_0xbb58('0x15')](_0x4e0303));}},'offlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null},{'type':_0xbb58('0x1c'),'config':{'placeholder':_0xbb58('0x1d')},'props':{'title':_0xbb58('0x1d'),'helpText':_0xbb58('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x1f'))?JSON['parse'](this[_0xbb58('0x18')](_0xbb58('0x1f'))):{};},'set':function(_0x12b3eb){return this[_0xbb58('0x1b')](_0xbb58('0x1f'),JSON[_0xbb58('0x15')](_0x12b3eb));}},'token':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return rs[_0xbb58('0x20')]();}},'autoclose':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbb58('0x2')]},'forwardOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbb58('0x2')]},'waitingTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x21')},'waitingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x23')},'offlineMessageBody':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x25')},'enableCustomerAttachment':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbb58('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbb58('0x26');}},'notificationSound':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x29')},'messagesAlignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x2a')},'defaultTitle':{'type':Sequelize[_0xbb58('0x2')]},'customerAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb58('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xbb58('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb58('0x7')],'comment':_0xbb58('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xc29171){if(!_0xc29171)this[_0xbb58('0x1b')](_0xbb58('0x2d'),null);this[_0xbb58('0x1b')](_0xbb58('0x2e'),_0xc29171);}},'vidaooEscalation':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x2f')},'vidaooNote':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return _0xbb58('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xa75b=['ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','TEXT','stringify','input','text','name','onlineForm','parse','getDataValue','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xa75b,0x170));var _0xba75=function(_0x2bbde9,_0x3a3e09){_0x2bbde9=_0x2bbde9-0x0;var _0x19418e=_0xa75b[_0x2bbde9];return _0x19418e;};'use strict';var Sequelize=require(_0xba75('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'unique':_0xba75('0x2')},'description':{'type':Sequelize[_0xba75('0x1')]},'mapKey':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x3')},'mapKeyOffline':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x3')},'key':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x4')},'customerAlias':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba75('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xba75('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xba75('0x1')]},'animation':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xba75('0x8')](_0xba75('0x9'),_0xba75('0xa')),'defaultValue':_0xba75('0x9')},'header_online':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xb')},'start_chat_button':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xc')},'offline_chat_button':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xba75('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x11')},'placeholderMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x12')},'closingMessageButton':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x13')},'skipMessageButton':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x15')},'ratingType':{'type':Sequelize[_0xba75('0x8')]('star','thumb'),'defaultValue':_0xba75('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xba75('0x17')],'defaultValue':function(){return JSON[_0xba75('0x18')]({'items':[{'type':_0xba75('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xba75('0x1a'),'required':!![]},'props':{'title':_0xba75('0x1b'),'helpText':''}},{'type':_0xba75('0x19'),'props':{'title':_0xba75('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xba75('0x3'),'type':_0xba75('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xba75('0x1c'))?JSON[_0xba75('0x1d')](this[_0xba75('0x1e')](_0xba75('0x1c'))):{};},'set':function(_0x1caa6){return this[_0xba75('0x1f')](_0xba75('0x1c'),JSON[_0xba75('0x18')](_0x1caa6));}},'offlineForm':{'type':Sequelize[_0xba75('0x17')],'defaultValue':function(){return JSON[_0xba75('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xba75('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xba75('0x20')},'props':{'title':'Comments','helpText':_0xba75('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xba75('0x1e')](_0xba75('0x22'))?JSON['parse'](this[_0xba75('0x1e')](_0xba75('0x22'))):{};},'set':function(_0x8a2e4d){return this[_0xba75('0x1f')]('offlineForm',JSON['stringify'](_0x8a2e4d));}},'token':{'type':Sequelize[_0xba75('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xba75('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xba75('0x1')]},'waitingTitle':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xba75('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x26')},'skipUnmanaged':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xba75('0x17')]},'showAgentAvatar':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xba75('0x1')]},'notificationTemplate':{'type':Sequelize[_0xba75('0x17')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xba75('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xba75('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x27')},'messagesAlignment':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x28')},'defaultTitle':{'type':Sequelize[_0xba75('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xba75('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':_0xba75('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xba75('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xba75('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xba75('0x2a')},'systemAvatar':{'type':Sequelize[_0xba75('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xba75('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![],'comment':_0xba75('0x2c'),'set':function(_0x45d8cd){if(!_0x45d8cd)this[_0xba75('0x1f')](_0xba75('0x2d'),null);this[_0xba75('0x1f')]('mandatoryDisposition',_0x45d8cd);}},'vidaooEscalation':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xba75('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xba75('0x1')],'defaultValue':function(){return _0xba75('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0xba75('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xba75('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xba75('0x17')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 6ff0284..99572ca 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 _0x273b=['referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','lastName','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','inspect','No\x20timezone','Interval','getProactiveActions','increment','chatLicenseExceeded','Intervals','address','origin','remote','x-real-ip','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','findAll','rows','show','params','ChatWebsite','rawAttributes','fields','include','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','ids','addAnswer','CannedAnswer','getAnswers','nolimit','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/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','applications','list','orderBy','account','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port'];(function(_0x5f0cb0,_0x242b92){var _0x1ec431=function(_0x2d56e1){while(--_0x2d56e1){_0x5f0cb0['push'](_0x5f0cb0['shift']());}};_0x1ec431(++_0x242b92);}(_0x273b,0x1b6));var _0xb273=function(_0x16bb34,_0x2b658d){_0x16bb34=_0x16bb34-0x0;var _0x47b4f8=_0x273b[_0x16bb34];return _0x47b4f8;};'use strict';var BPromise=require(_0xb273('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb273('0x1'));var _=require(_0xb273('0x2'));var querystring=require(_0xb273('0x3'));var Redis=require(_0xb273('0x4'));var qs=require(_0xb273('0x5'));var logger=require(_0xb273('0x6'))(_0xb273('0x7'));var config=require('../../config/environment');var url=require(_0xb273('0x8'));var db=require(_0xb273('0x9'))['db'];config[_0xb273('0xa')]=_[_0xb273('0xb')](config['redis'],{'host':_0xb273('0xc'),'port':0x18eb});var socket=require(_0xb273('0xd'))(new Redis(config[_0xb273('0xa')]));require(_0xb273('0xe'))['register'](socket);var htmlToText=require(_0xb273('0xf'));var jayson=require(_0xb273('0x10'));var client=jayson[_0xb273('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xb273('0x11')][_0xb273('0x12')]({'port':0x232a});var client9003=jayson[_0xb273('0x11')][_0xb273('0x12')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x26271c,_0x4148f5,_0x52fc69,_0x49cb59){return new BPromise(function(_0x51fcb4,_0x1e084d){var _0x303011=_0x49cb59||client;return _0x303011['request'](_0x26271c,_0x52fc69)[_0xb273('0x13')](function(_0x433170){logger[_0xb273('0x14')](_0xb273('0x15'),_0x4148f5,_0xb273('0x16'));logger['debug'](_0xb273('0x17'),_0x4148f5,_0xb273('0x16'),JSON['stringify'](_0x433170));if(_0x433170[_0xb273('0x18')]){if(_0x433170[_0xb273('0x18')][_0xb273('0x19')]===0x1f4){logger[_0xb273('0x18')](_0xb273('0x15'),_0x4148f5,_0x433170[_0xb273('0x18')][_0xb273('0x1a')]);return _0x1e084d(_0x433170[_0xb273('0x18')][_0xb273('0x1a')]);}logger[_0xb273('0x18')](_0xb273('0x15'),_0x4148f5,_0x433170[_0xb273('0x18')][_0xb273('0x1a')]);return _0x51fcb4(_0x433170['error'][_0xb273('0x1a')]);}else{logger[_0xb273('0x14')](_0xb273('0x15'),_0x4148f5,'request\x20sent');_0x51fcb4(_0x433170[_0xb273('0x1b')][_0xb273('0x1a')]);}})['catch'](function(_0x2ad192){logger[_0xb273('0x18')](_0xb273('0x15'),_0x4148f5,_0x2ad192);_0x1e084d(_0x2ad192);});});}function respondWithStatusCode(_0x4e9b46,_0x536143){_0x536143=_0x536143||0xcc;return function(_0x58a9be){if(_0x58a9be){return _0x4e9b46[_0xb273('0x1c')](_0x536143);}return _0x4e9b46[_0xb273('0x1d')](_0x536143)['end']();};}function respondWithResult(_0x517278,_0x43a96d){_0x43a96d=_0x43a96d||0xc8;return function(_0x3708a9){if(_0x3708a9){return _0x517278[_0xb273('0x1d')](_0x43a96d)[_0xb273('0x1e')](_0x3708a9);}};}function respondWithFilteredResult(_0x1c335b,_0xb05bfd){return function(_0x1e630a){if(_0x1e630a){var _0x4672f0=typeof _0xb05bfd[_0xb273('0x1f')]===_0xb273('0x20')&&typeof _0xb05bfd[_0xb273('0x21')]===_0xb273('0x20');var _0x142f77=_0x1e630a[_0xb273('0x22')];var _0x27aec5=_0x4672f0?0x0:_0xb05bfd[_0xb273('0x1f')];var _0x5bf595=_0x4672f0?_0x1e630a['count']:_0xb05bfd[_0xb273('0x1f')]+_0xb05bfd[_0xb273('0x21')];var _0x46ec22;if(_0x5bf595>=_0x142f77){_0x5bf595=_0x142f77;_0x46ec22=0xc8;}else{_0x46ec22=0xce;}_0x1c335b['status'](_0x46ec22);return _0x1c335b[_0xb273('0x23')](_0xb273('0x24'),_0x27aec5+'-'+_0x5bf595+'/'+_0x142f77)[_0xb273('0x1e')](_0x1e630a);}return null;};}function saveUpdates(_0x43d968){return function(_0x41ea1d){if(_0x41ea1d){return _0x41ea1d[_0xb273('0x25')](_0x43d968)[_0xb273('0x13')](function(_0x43d724){return _0x43d724;});}return null;};}function removeEntity(_0x1db350){return function(_0x3e7bf8){if(_0x3e7bf8){return _0x3e7bf8[_0xb273('0x26')]()[_0xb273('0x13')](function(){var _0x453566=_0x3e7bf8[_0xb273('0x27')]({'plain':!![]});var _0x6dc1a1=_0xb273('0x28');return db[_0xb273('0x29')][_0xb273('0x26')]({'where':{'type':_0x6dc1a1,'resourceId':_0x453566['id']}})[_0xb273('0x13')](function(){return _0x3e7bf8;});})['then'](function(){_0x1db350[_0xb273('0x1d')](0xcc)[_0xb273('0x2a')]();});}};}function handleEntityNotFound(_0x16a586){return function(_0x4e7f29){if(!_0x4e7f29){_0x16a586[_0xb273('0x1c')](0x194);}return _0x4e7f29;};}function handleError(_0x18102e,_0x30cf1d){_0x30cf1d=_0x30cf1d||0x1f4;return function(_0x55330c){logger[_0xb273('0x18')](_0x55330c[_0xb273('0x2b')]);if(_0x55330c[_0xb273('0x2c')]){delete _0x55330c[_0xb273('0x2c')];}_0x18102e[_0xb273('0x1d')](_0x30cf1d)['send'](_0x55330c);};}exports[_0xb273('0x2d')]=function(_0x368308,_0x3ebbd6){var _0x31c4f6={'include':[{'model':db[_0xb273('0x2e')],'as':_0xb273('0x2f')}]},_0xcf9d25={},_0x107213={'count':0x0,'rows':[]};var _0x2bfe2e=_[_0xb273('0x30')](db['ChatWebsite']['rawAttributes'],function(_0xfefac0){return{'name':_0xfefac0['fieldName'],'type':_0xfefac0['type'][_0xb273('0x31')]};});_0xcf9d25[_0xb273('0x32')]=_[_0xb273('0x30')](_0x2bfe2e,'name');_0xcf9d25['query']=_[_0xb273('0x33')](_0x368308[_0xb273('0x34')]);_0xcf9d25[_0xb273('0x35')]=_[_0xb273('0x36')](_0xcf9d25['model'],_0xcf9d25[_0xb273('0x34')]);_0x31c4f6[_0xb273('0x37')]=_[_0xb273('0x36')](_0xcf9d25[_0xb273('0x32')],qs['fields'](_0x368308[_0xb273('0x34')]['fields']));_0x31c4f6[_0xb273('0x37')]=_0x31c4f6[_0xb273('0x37')][_0xb273('0x38')]?_0x31c4f6['attributes']:_0xcf9d25[_0xb273('0x32')];if(!_0x368308[_0xb273('0x34')][_0xb273('0x39')]('nolimit')){_0x31c4f6[_0xb273('0x21')]=qs[_0xb273('0x21')](_0x368308['query']['limit']);_0x31c4f6[_0xb273('0x1f')]=qs['offset'](_0x368308['query'][_0xb273('0x1f')]);}_0x31c4f6[_0xb273('0x3a')]=qs[_0xb273('0x3b')](_0x368308[_0xb273('0x34')][_0xb273('0x3b')]);_0x31c4f6[_0xb273('0x3c')]=qs[_0xb273('0x35')](_[_0xb273('0x3d')](_0x368308[_0xb273('0x34')],_0xcf9d25['filters']),_0x2bfe2e);if(_0x368308[_0xb273('0x34')]['filter']){_0x31c4f6[_0xb273('0x3c')]=_['merge'](_0x31c4f6[_0xb273('0x3c')],{'$or':_[_0xb273('0x30')](_0x2bfe2e,function(_0x55d623){if(_0x55d623[_0xb273('0x3e')]!==_0xb273('0x3f')){var _0x28a815={};_0x28a815[_0x55d623[_0xb273('0x2c')]]={'$like':'%'+_0x368308['query'][_0xb273('0x40')]+'%'};return _0x28a815;}})});}_0x31c4f6=_[_0xb273('0x41')]({},_0x31c4f6,_0x368308['options']);var _0x391311={'where':_0x31c4f6[_0xb273('0x3c')]};return db['ChatWebsite'][_0xb273('0x22')](_0x391311)[_0xb273('0x13')](function(_0xa2cf7b){_0x107213[_0xb273('0x22')]=_0xa2cf7b;if(_0x368308[_0xb273('0x34')][_0xb273('0x42')]){_0x31c4f6['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xb273('0x43')](_0x31c4f6);})[_0xb273('0x13')](function(_0x4b4c94){_0x107213[_0xb273('0x44')]=_0x4b4c94;return _0x107213;})[_0xb273('0x13')](respondWithFilteredResult(_0x3ebbd6,_0x31c4f6))['catch'](handleError(_0x3ebbd6,null));};exports[_0xb273('0x45')]=function(_0x58dff9,_0x13dd84){var _0x169aad={'raw':![],'where':{'id':_0x58dff9[_0xb273('0x46')]['id']},'include':[{'model':db[_0xb273('0x2e')],'as':_0xb273('0x2f')}]},_0x4e9c32={};_0x4e9c32[_0xb273('0x32')]=_[_0xb273('0x33')](db[_0xb273('0x47')][_0xb273('0x48')]);_0x4e9c32[_0xb273('0x34')]=_[_0xb273('0x33')](_0x58dff9['query']);_0x4e9c32[_0xb273('0x35')]=_[_0xb273('0x36')](_0x4e9c32['model'],_0x4e9c32[_0xb273('0x34')]);_0x169aad[_0xb273('0x37')]=_['intersection'](_0x4e9c32[_0xb273('0x32')],qs[_0xb273('0x49')](_0x58dff9['query'][_0xb273('0x49')]));_0x169aad[_0xb273('0x37')]=_0x169aad[_0xb273('0x37')][_0xb273('0x38')]?_0x169aad[_0xb273('0x37')]:_0x4e9c32[_0xb273('0x32')];if(_0x58dff9[_0xb273('0x34')][_0xb273('0x42')]){_0x169aad[_0xb273('0x4a')]=[{'all':!![]}];}_0x169aad=_[_0xb273('0x41')]({},_0x169aad,_0x58dff9[_0xb273('0x4b')]);return db[_0xb273('0x47')]['find'](_0x169aad)[_0xb273('0x13')](handleEntityNotFound(_0x13dd84,null))['then'](respondWithResult(_0x13dd84,null))[_0xb273('0x4c')](handleError(_0x13dd84,null));};exports[_0xb273('0x4d')]=function(_0x5814c0,_0x348bd6){return db[_0xb273('0x47')][_0xb273('0x4d')](_0x5814c0[_0xb273('0x4e')],{})[_0xb273('0x13')](function(_0x3b7004){var _0x5448e8=_0x5814c0['user'][_0xb273('0x27')]({'plain':!![]});if(!_0x5448e8)throw new Error(_0xb273('0x4f'));if(_0x5448e8[_0xb273('0x50')]===_0xb273('0x51')){var _0x102698=_0x3b7004['get']({'plain':!![]});var _0x58251a='ChatWebsites';return db[_0xb273('0x52')][_0xb273('0x53')]({'where':{'name':_0x58251a,'userProfileId':_0x5448e8[_0xb273('0x54')]},'raw':!![]})[_0xb273('0x13')](function(_0x590fea){if(_0x590fea&&_0x590fea['autoAssociation']===0x0){return db['UserProfileResource'][_0xb273('0x4d')]({'name':_0x102698['name'],'resourceId':_0x102698['id'],'type':_0x590fea[_0xb273('0x2c')],'sectionId':_0x590fea['id']},{})[_0xb273('0x13')](function(){return _0x3b7004;});}else{return _0x3b7004;}})[_0xb273('0x4c')](function(_0x4424d4){logger[_0xb273('0x18')](_0xb273('0x55'),_0x4424d4);throw _0x4424d4;});}return _0x3b7004;})[_0xb273('0x13')](respondWithResult(_0x348bd6,0xc9))['catch'](handleError(_0x348bd6,null));};exports[_0xb273('0x25')]=function(_0x3813d5,_0x1f405f){if(_0x3813d5['body']['id']){delete _0x3813d5['body']['id'];}return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x3813d5[_0xb273('0x46')]['id']},'include':[{'model':db[_0xb273('0x2e')],'as':_0xb273('0x2f')}]})[_0xb273('0x13')](handleEntityNotFound(_0x1f405f,null))[_0xb273('0x13')](saveUpdates(_0x3813d5['body'],null))[_0xb273('0x13')](respondWithResult(_0x1f405f,null))[_0xb273('0x4c')](handleError(_0x1f405f,null));};exports['destroy']=function(_0x5fc982,_0x26ac88){return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x5fc982[_0xb273('0x46')]['id']}})['then'](handleEntityNotFound(_0x26ac88,null))[_0xb273('0x13')](removeEntity(_0x26ac88,null))[_0xb273('0x4c')](handleError(_0x26ac88,null));};exports[_0xb273('0x56')]=function(_0x453c1f,_0x4a6be1){return db[_0xb273('0x47')][_0xb273('0x56')]()['then'](respondWithResult(_0x4a6be1,null))[_0xb273('0x4c')](handleError(_0x4a6be1,null));};exports['addDisposition']=function(_0xf7ca82,_0x3be665){if(_0xf7ca82[_0xb273('0x4e')]['id']){delete _0xf7ca82[_0xb273('0x4e')]['id'];}return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0xf7ca82[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x3be665,null))[_0xb273('0x13')](function(_0x41f77e){if(_0x41f77e){_0xf7ca82[_0xb273('0x4e')][_0xb273('0x57')]=_0x41f77e['id'];return db[_0xb273('0x58')][_0xb273('0x4d')](_0xf7ca82[_0xb273('0x4e')]);}})[_0xb273('0x13')](respondWithResult(_0x3be665,null))[_0xb273('0x4c')](handleError(_0x3be665,null));};exports[_0xb273('0x59')]=function(_0x3c7bbb,_0x5c9ad1){var _0x1e3410={'raw':![],'where':{}};var _0x763c84={};var _0x3bc231={'count':0x0,'rows':[]};return db[_0xb273('0x47')][_0xb273('0x5a')]({'where':{'id':_0x3c7bbb[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x5c9ad1,null))[_0xb273('0x13')](function(_0x326ddd){if(_0x326ddd){_0x763c84[_0xb273('0x32')]=_['keys'](db[_0xb273('0x58')][_0xb273('0x48')]);_0x763c84['query']=_[_0xb273('0x33')](_0x3c7bbb[_0xb273('0x34')]);_0x763c84['filters']=_['intersection'](_0x763c84[_0xb273('0x32')],_0x763c84[_0xb273('0x34')]);_0x1e3410[_0xb273('0x37')]=_['intersection'](_0x763c84[_0xb273('0x32')],qs[_0xb273('0x49')](_0x3c7bbb[_0xb273('0x34')][_0xb273('0x49')]));_0x1e3410[_0xb273('0x37')]=_0x1e3410[_0xb273('0x37')]['length']?_0x1e3410[_0xb273('0x37')]:_0x763c84[_0xb273('0x32')];if(!_0x3c7bbb[_0xb273('0x34')]['hasOwnProperty']('nolimit')){_0x1e3410[_0xb273('0x21')]=qs[_0xb273('0x21')](_0x3c7bbb[_0xb273('0x34')][_0xb273('0x21')]);_0x1e3410[_0xb273('0x1f')]=qs[_0xb273('0x1f')](_0x3c7bbb[_0xb273('0x34')][_0xb273('0x1f')]);}_0x1e3410['order']=qs['sort'](_0x3c7bbb[_0xb273('0x34')][_0xb273('0x3b')]);_0x1e3410[_0xb273('0x3c')]=qs[_0xb273('0x35')](_['pick'](_0x3c7bbb[_0xb273('0x34')],_0x763c84[_0xb273('0x35')]));_0x1e3410[_0xb273('0x3c')]['ChatWebsiteId']=_0x326ddd['id'];if(_0x3c7bbb['query'][_0xb273('0x40')]){_0x1e3410['where']=_[_0xb273('0x41')](_0x1e3410[_0xb273('0x3c')],{'$or':_[_0xb273('0x30')](_0x1e3410[_0xb273('0x37')],function(_0xecfaaf){var _0x53776b={};_0x53776b[_0xecfaaf]={'$like':'%'+_0x3c7bbb[_0xb273('0x34')][_0xb273('0x40')]+'%'};return _0x53776b;})});}_0x1e3410=_[_0xb273('0x41')]({},_0x1e3410,_0x3c7bbb[_0xb273('0x4b')]);return db[_0xb273('0x58')][_0xb273('0x22')]({'where':_0x1e3410[_0xb273('0x3c')]})[_0xb273('0x13')](function(_0x536e34){_0x3bc231[_0xb273('0x22')]=_0x536e34;if(_0x3c7bbb['query'][_0xb273('0x42')]){_0x1e3410[_0xb273('0x4a')]=[{'all':!![]}];}return db[_0xb273('0x58')][_0xb273('0x43')](_0x1e3410);})[_0xb273('0x13')](function(_0x340da3){_0x3bc231[_0xb273('0x44')]=_0x340da3;return _0x3bc231;});}})[_0xb273('0x13')](respondWithFilteredResult(_0x5c9ad1,_0x1e3410))['catch'](handleError(_0x5c9ad1,null));};exports['removeDispositions']=function(_0x4a13c7,_0x5e727c){return db[_0xb273('0x47')]['find']({'where':{'id':_0x4a13c7[_0xb273('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e727c,null))['then'](function(_0x2486d6){if(_0x2486d6){return _0x2486d6['removeDispositions'](_0x4a13c7[_0xb273('0x34')][_0xb273('0x5b')]);}})[_0xb273('0x13')](respondWithStatusCode(_0x5e727c,null))[_0xb273('0x4c')](handleError(_0x5e727c,null));};exports[_0xb273('0x5c')]=function(_0x2c0985,_0x3f594a){if(_0x2c0985['body']['id']){delete _0x2c0985[_0xb273('0x4e')]['id'];}return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x2c0985['params']['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x3f594a,null))[_0xb273('0x13')](function(_0x594510){if(_0x594510){_0x2c0985[_0xb273('0x4e')][_0xb273('0x57')]=_0x594510['id'];return db[_0xb273('0x5d')][_0xb273('0x4d')](_0x2c0985[_0xb273('0x4e')]);}})['then'](respondWithResult(_0x3f594a,null))[_0xb273('0x4c')](handleError(_0x3f594a,null));};exports[_0xb273('0x5e')]=function(_0x39bcc9,_0x50a6bb){var _0xbe68b7={'raw':![],'where':{}};var _0x147996={};var _0x217741={'count':0x0,'rows':[]};return db[_0xb273('0x47')][_0xb273('0x5a')]({'where':{'id':_0x39bcc9[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x50a6bb,null))[_0xb273('0x13')](function(_0x4812ae){if(_0x4812ae){_0x147996[_0xb273('0x32')]=_[_0xb273('0x33')](db[_0xb273('0x5d')]['rawAttributes']);_0x147996['query']=_[_0xb273('0x33')](_0x39bcc9[_0xb273('0x34')]);_0x147996[_0xb273('0x35')]=_['intersection'](_0x147996[_0xb273('0x32')],_0x147996[_0xb273('0x34')]);_0xbe68b7[_0xb273('0x37')]=_[_0xb273('0x36')](_0x147996['model'],qs[_0xb273('0x49')](_0x39bcc9[_0xb273('0x34')][_0xb273('0x49')]));_0xbe68b7[_0xb273('0x37')]=_0xbe68b7[_0xb273('0x37')][_0xb273('0x38')]?_0xbe68b7['attributes']:_0x147996[_0xb273('0x32')];if(!_0x39bcc9[_0xb273('0x34')][_0xb273('0x39')](_0xb273('0x5f'))){_0xbe68b7[_0xb273('0x21')]=qs[_0xb273('0x21')](_0x39bcc9['query'][_0xb273('0x21')]);_0xbe68b7[_0xb273('0x1f')]=qs['offset'](_0x39bcc9['query'][_0xb273('0x1f')]);}_0xbe68b7['order']=qs[_0xb273('0x3b')](_0x39bcc9[_0xb273('0x34')][_0xb273('0x3b')]);_0xbe68b7[_0xb273('0x3c')]=qs[_0xb273('0x35')](_[_0xb273('0x3d')](_0x39bcc9['query'],_0x147996['filters']));_0xbe68b7[_0xb273('0x3c')]['ChatWebsiteId']=_0x4812ae['id'];if(_0x39bcc9[_0xb273('0x34')][_0xb273('0x40')]){_0xbe68b7['where']=_[_0xb273('0x41')](_0xbe68b7[_0xb273('0x3c')],{'$or':_[_0xb273('0x30')](_0xbe68b7[_0xb273('0x37')],function(_0x8f7c79){var _0x2148f7={};_0x2148f7[_0x8f7c79]={'$like':'%'+_0x39bcc9['query'][_0xb273('0x40')]+'%'};return _0x2148f7;})});}_0xbe68b7=_[_0xb273('0x41')]({},_0xbe68b7,_0x39bcc9[_0xb273('0x4b')]);return db[_0xb273('0x5d')]['count']({'where':_0xbe68b7[_0xb273('0x3c')]})[_0xb273('0x13')](function(_0x12c928){_0x217741[_0xb273('0x22')]=_0x12c928;if(_0x39bcc9[_0xb273('0x34')]['includeAll']){_0xbe68b7[_0xb273('0x4a')]=[{'all':!![]}];}return db[_0xb273('0x5d')][_0xb273('0x43')](_0xbe68b7);})[_0xb273('0x13')](function(_0x151f61){_0x217741['rows']=_0x151f61;return _0x217741;});}})[_0xb273('0x13')](respondWithFilteredResult(_0x50a6bb,_0xbe68b7))[_0xb273('0x4c')](handleError(_0x50a6bb,null));};exports[_0xb273('0x60')]=function(_0x1b756a,_0x88320a){return db[_0xb273('0x47')]['find']({'where':{'id':_0x1b756a['params']['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x88320a,null))['then'](function(_0x5a3ea7){if(_0x5a3ea7){return _0x5a3ea7['removeAnswers'](_0x1b756a[_0xb273('0x34')][_0xb273('0x5b')]);}})[_0xb273('0x13')](respondWithStatusCode(_0x88320a,null))[_0xb273('0x4c')](handleError(_0x88320a,null));};exports[_0xb273('0x61')]=function(_0x96ba3d,_0x4906e3){_0x96ba3d[_0xb273('0x4e')][_0xb273('0x62')]=_0x96ba3d[_0xb273('0x63')][_0xb273('0x64')];return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x96ba3d[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x4906e3,null))[_0xb273('0x13')](saveUpdates(_0x96ba3d[_0xb273('0x4e')],null))[_0xb273('0x13')](respondWithResult(_0x4906e3,null))[_0xb273('0x4c')](handleError(_0x4906e3,null));};exports[_0xb273('0x65')]=function(_0x32d2d0,_0x597dd1){_0x32d2d0[_0xb273('0x4e')][_0xb273('0x66')]=_0x32d2d0['file'][_0xb273('0x64')];return db[_0xb273('0x47')]['find']({'where':{'id':_0x32d2d0[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x597dd1,null))['then'](saveUpdates(_0x32d2d0[_0xb273('0x4e')],null))[_0xb273('0x13')](respondWithResult(_0x597dd1,null))[_0xb273('0x4c')](handleError(_0x597dd1,null));};exports[_0xb273('0x67')]=function(_0x389624,_0x5321f6){_0x389624[_0xb273('0x4e')][_0xb273('0x68')]=_0x389624[_0xb273('0x63')][_0xb273('0x64')];return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x389624[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x5321f6,null))[_0xb273('0x13')](saveUpdates(_0x389624[_0xb273('0x4e')],null))[_0xb273('0x13')](respondWithResult(_0x5321f6,null))[_0xb273('0x4c')](handleError(_0x5321f6,null));};exports[_0xb273('0x69')]=function(_0x4dbf2c,_0x5c5f14){_0x4dbf2c['body'][_0xb273('0x6a')]=_0x4dbf2c['file']['filename'];return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x4dbf2c['params']['id']}})['then'](handleEntityNotFound(_0x5c5f14,null))[_0xb273('0x13')](saveUpdates(_0x4dbf2c[_0xb273('0x4e')],null))['then'](respondWithResult(_0x5c5f14,null))[_0xb273('0x4c')](handleError(_0x5c5f14,null));};exports[_0xb273('0x6b')]=function(_0x4b923e,_0x1de2f7){var _0x229ed1=path[_0xb273('0x6c')](config[_0xb273('0x6d')],_0xb273('0x6e'));var _0x3e82a0={'where':{'id':_0x4b923e[_0xb273('0x46')]['id']},'attributes':['id',_0xb273('0x62')],'raw':!![]};var _0x19cf30=![];return require(_0xb273('0x6f'))[_0xb273('0x70')]()[_0xb273('0x13')](function(_0x26d99d){if(_0x26d99d){_0x19cf30=_0x26d99d[_0xb273('0x71')];}})[_0xb273('0x13')](function(){return db[_0xb273('0x47')]['find'](_0x3e82a0);})['then'](handleEntityNotFound(_0x1de2f7,null))[_0xb273('0x13')](function(_0x127922){if(_0x127922){if(!_[_0xb273('0x72')](_0x127922[_0xb273('0x62')])){if(fs[_0xb273('0x73')](path[_0xb273('0x6c')](config[_0xb273('0x6d')],_0xb273('0x74'),_0x127922['sitepic']))&&_0x19cf30){_0x229ed1=path[_0xb273('0x6c')](config[_0xb273('0x6d')],'server/files/images/logos/',_0x127922['sitepic']);}}return _0x1de2f7[_0xb273('0x75')](_0x229ed1);}})[_0xb273('0x4c')](handleError(_0x1de2f7,null));};exports[_0xb273('0x76')]=function(_0x541e15,_0x8ff450){var _0x4ef3bf=path['join'](config[_0xb273('0x6d')],_0xb273('0x77'));var _0x20ae5e={'where':{'id':_0x541e15[_0xb273('0x46')]['id']},'attributes':['id',_0xb273('0x66')],'raw':!![]};return db[_0xb273('0x47')][_0xb273('0x53')](_0x20ae5e)[_0xb273('0x13')](handleEntityNotFound(_0x8ff450,null))['then'](function(_0xfd6131){if(_0xfd6131){if(!_[_0xb273('0x72')](_0xfd6131['agentAvatar'])){if(fs[_0xb273('0x73')](path[_0xb273('0x6c')](config[_0xb273('0x6d')],'server/files/images/avatars/',_0xfd6131[_0xb273('0x66')]))){_0x4ef3bf=path[_0xb273('0x6c')](config[_0xb273('0x6d')],_0xb273('0x78'),_0xfd6131[_0xb273('0x66')]);}}return _0x8ff450[_0xb273('0x75')](_0x4ef3bf);}})[_0xb273('0x4c')](handleError(_0x8ff450,null));};exports[_0xb273('0x79')]=function(_0x51161f,_0x399387){var _0x24a043=path[_0xb273('0x6c')](config[_0xb273('0x6d')],_0xb273('0x7a'));var _0x565b3e={'where':{'id':_0x51161f['params']['id']},'attributes':['id',_0xb273('0x68'),_0xb273('0x7b')],'raw':!![]};return db[_0xb273('0x47')][_0xb273('0x53')](_0x565b3e)[_0xb273('0x13')](handleEntityNotFound(_0x399387,null))[_0xb273('0x13')](function(_0x5f5d29){if(_0x5f5d29){if(!_[_0xb273('0x72')](_0x5f5d29[_0xb273('0x68')])){if(fs[_0xb273('0x73')](path['join'](config[_0xb273('0x6d')],_0xb273('0x78'),_0x5f5d29[_0xb273('0x68')]))&&_0x5f5d29['showCustomerAvatar']){_0x24a043=path['join'](config['root'],_0xb273('0x78'),_0x5f5d29[_0xb273('0x68')]);}}return _0x399387[_0xb273('0x75')](_0x24a043);}})[_0xb273('0x4c')](handleError(_0x399387,null));};exports[_0xb273('0x7c')]=function(_0x20037f,_0x28a5d7){var _0x133253=path[_0xb273('0x6c')](config['root'],_0xb273('0x7d'));var _0x26f139={'where':{'id':_0x20037f[_0xb273('0x46')]['id']},'attributes':['id',_0xb273('0x6a')],'raw':!![]};return db[_0xb273('0x47')]['find'](_0x26f139)[_0xb273('0x13')](handleEntityNotFound(_0x28a5d7,null))[_0xb273('0x13')](function(_0x38843e){if(_0x38843e){if(!_[_0xb273('0x72')](_0x38843e[_0xb273('0x6a')])){if(fs[_0xb273('0x73')](path[_0xb273('0x6c')](config[_0xb273('0x6d')],'server/files/images/avatars/',_0x38843e[_0xb273('0x6a')]))){_0x133253=path['join'](config['root'],_0xb273('0x78'),_0x38843e[_0xb273('0x6a')]);}}return _0x28a5d7['download'](_0x133253);}})['catch'](handleError(_0x28a5d7,null));};exports[_0xb273('0x7e')]=function(_0x59b212,_0x2e367c){var _0x406114=require(_0xb273('0x7f'));var _0x3e9baf=new _0x406114();var _0xa8c58a=_0x3e9baf['setUA'](_0x59b212[_0xb273('0x80')][_0xb273('0x81')])[_0xb273('0x82')]();var _0x34dae7={'body':_0x59b212[_0xb273('0x4e')],'channel':_0xb273('0x83')};var _0x2df63b=[];var _0x4dbe7f=[];var _0x302d17={};var _0x4e36ad=![];return db[_0xb273('0x84')][_0xb273('0x56')]()[_0xb273('0x13')](function(_0x3e2519){if(!_0x3e2519){throw new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0x87'));}_0x2df63b=_[_0xb273('0x88')](_[_0xb273('0x33')](_0x3e2519),['createdAt','updatedAt']);_0x4dbe7f=_[_0xb273('0x88')](_[_0xb273('0x33')](_0x3e2519),[_0xb273('0x89'),_0xb273('0x8a'),'CompanyId',_0xb273('0x8b')]);if(_0x59b212['body']['id']){delete _0x59b212[_0xb273('0x4e')]['id'];}if(_[_0xb273('0x72')](_0x59b212[_0xb273('0x4e')][_0xb273('0x8c')])){throw new db['Sequelize'][(_0xb273('0x86'))](_0xb273('0x8d'));}if(_[_0xb273('0x72')](_0x59b212[_0xb273('0x4e')][_0xb273('0x4e')])||_0x59b212[_0xb273('0x4e')][_0xb273('0x4e')]===''){throw new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0x8e'));}if(_[_0xb273('0x72')](_0x59b212[_0xb273('0x4e')][_0xb273('0x8f')])){throw new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0x90')+_0x4dbe7f);}if(!_[_0xb273('0x91')](_0x4dbe7f,_0x59b212[_0xb273('0x4e')][_0xb273('0x8f')])){throw new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0x92')+_0x4dbe7f);}_0x302d17[_0x59b212[_0xb273('0x4e')][_0xb273('0x8f')]]=_0x59b212[_0xb273('0x4e')][_0xb273('0x8c')];})['then'](function(){return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x59b212[_0xb273('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0xb273('0x93'),'include':[{'model':db[_0xb273('0x84')],'as':_0xb273('0x94'),'where':_0x302d17,'limit':0x1,'order':[[_0xb273('0x8a'),_0xb273('0x95')]]}]},{'model':db['ChatApplication'],'as':_0xb273('0x96')}]});})[_0xb273('0x13')](handleEntityNotFound(_0x2e367c,null))[_0xb273('0x13')](function(_0x21b439){if(_0x21b439&&_0x21b439['List']){_0x34dae7['account']=_0x21b439;_0x34dae7[_0xb273('0x97')]=_0x21b439[_0xb273('0x96')];_0x34dae7[_0xb273('0x98')]=_0x21b439[_0xb273('0x93')];_0x34dae7[_0xb273('0x97')]=_[_0xb273('0x99')](_0x34dae7[_0xb273('0x97')],['priority'],['asc']);if(_0x34dae7[_0xb273('0x9a')][_0xb273('0x96')]){delete _0x34dae7[_0xb273('0x9a')][_0xb273('0x96')];}if(_0x34dae7[_0xb273('0x9a')]['List']&&_0x34dae7[_0xb273('0x9a')][_0xb273('0x93')][_0xb273('0x94')][_0xb273('0x38')]){return _0x34dae7[_0xb273('0x9a')]['List'][_0xb273('0x94')][0x0];}var _0x68bf9e=_[_0xb273('0xb')](_0x59b212['body'],{'firstName':_0x59b212['body'][_0xb273('0x8c')],'ListId':_0x21b439[_0xb273('0x8b')]});_0x68bf9e[_0x59b212[_0xb273('0x4e')][_0xb273('0x8f')]]=_0x59b212['body'][_0xb273('0x8c')];return db['CmContact']['create'](_0x68bf9e,{'fields':_0x2df63b,'raw':!![]});}})[_0xb273('0x13')](handleEntityNotFound(_0x2e367c,null))[_0xb273('0x13')](function(_0x2cb13e){_0x34dae7['contact']=_0x2cb13e;var _0x41db79=_0x59b212[_0xb273('0x4e')][_0xb273('0x9b')];if(_0x59b212[_0xb273('0x80')][_0xb273('0x9c')]){_0x41db79=_0x59b212[_0xb273('0x80')][_0xb273('0x9c')];}else if(_0x59b212[_0xb273('0x80')][_0xb273('0x9d')]){_0x41db79=_[_0xb273('0x9e')](_0x59b212[_0xb273('0x80')][_0xb273('0x9d')][_0xb273('0x9f')](','));}if(_0x2cb13e){var _0x47f6be={'ContactId':_0x2cb13e['id'],'ChatWebsiteId':_0x59b212[_0xb273('0x46')]['id'],'from':(_0x2cb13e[_0xb273('0xa0')]||'')+'\x20'+(_0x2cb13e['lastName']||''),'customerIp':_0x41db79,'customerPort':_0x59b212[_0xb273('0x80')][_0xb273('0xa1')]?_0x59b212[_0xb273('0x80')][_0xb273('0xa1')]:null,'referer':_0x59b212[_0xb273('0x4e')][_0xb273('0xa2')],'browserName':_0xa8c58a[_0xb273('0xa3')][_0xb273('0x2c')]&&_0xa8c58a['browser'][_0xb273('0xa4')]?util[_0xb273('0xa5')](_0xb273('0xa6'),_0xa8c58a['browser'][_0xb273('0x2c')],_0xa8c58a[_0xb273('0xa3')][_0xb273('0xa4')]):_0xb273('0xa7'),'browserVersion':_0xa8c58a[_0xb273('0xa3')][_0xb273('0xa4')]||_0xb273('0xa7'),'osName':util[_0xb273('0xa5')](_0xb273('0xa6'),_0xa8c58a['os']['name'],_0xa8c58a['os']['version']),'osVersion':_0xa8c58a['os'][_0xb273('0xa4')],'deviceModel':_0xa8c58a['device'][_0xb273('0x32')]&&_0xa8c58a[_0xb273('0xa8')][_0xb273('0xa9')]?util[_0xb273('0xa5')](_0xb273('0xaa'),_0xa8c58a[_0xb273('0xa8')]['model'],_0xa8c58a[_0xb273('0xa8')][_0xb273('0xa9')],_0xa8c58a['device'][_0xb273('0x3e')]):null,'deviceVendor':_0xa8c58a['device']['vendor'],'deviceType':_0xa8c58a['device'][_0xb273('0x3e')],'formData':JSON[_0xb273('0xab')](_0x59b212[_0xb273('0x4e')])};var _0x5bfac7={'ChatWebsiteId':_0x59b212['params']['id'],'closed':![]};if(_0x59b212[_0xb273('0x4e')][_0xb273('0xac')]){_0x5bfac7[_0xb273('0xac')]=_0x59b212[_0xb273('0x4e')][_0xb273('0xac')];return db[_0xb273('0xad')]['find']({'where':_0x5bfac7})['then'](function(_0x12252e){if(_0x12252e){return[_0x12252e,![]];}_0x47f6be['threadId']=_0x59b212[_0xb273('0x4e')]['threadId'];_0x47f6be['externalUrl']=_0x59b212['body'][_0xb273('0xae')];return db[_0xb273('0xad')][_0xb273('0x4d')](_0x47f6be)['then'](function(_0x352fae){return[_0x352fae,!![]];});});}_0x5bfac7[_0xb273('0xaf')]=_0x2cb13e['id'];if(_0x59b212[_0xb273('0x4e')]['interaction']&&_0x59b212[_0xb273('0x4e')][_0xb273('0xb0')]['id']){_0x5bfac7['id']=_0x59b212['body']['interaction']['id'];return db[_0xb273('0xad')][_0xb273('0x53')]({'where':_0x5bfac7})[_0xb273('0x13')](function(_0x7a363e){if(_0x7a363e){return[_0x7a363e,![]];}return db['ChatInteraction'][_0xb273('0x4d')](_0x47f6be)[_0xb273('0x13')](function(_0xb34f4){return[_0xb34f4,!![]];});});}return db[_0xb273('0xad')]['create'](_0x47f6be)['then'](function(_0x2f586b){return[_0x2f586b,!![]];});}})[_0xb273('0xb1')](function(_0x5cbdc3,_0x342a58){if(_0x5cbdc3){_0x4e36ad=_0x342a58;if(!_0x342a58){var _0x130238={'from':(_0x34dae7[_0xb273('0xb2')][_0xb273('0xa0')]||'')+'\x20'+(_0x34dae7[_0xb273('0xb2')][_0xb273('0xb3')]||'')};if(_0x59b212[_0xb273('0x4e')][_0xb273('0xac')]&&_0x59b212[_0xb273('0x4e')][_0xb273('0xb4')]&&_0x59b212[_0xb273('0x4e')][_0xb273('0xac')]!=_0x59b212[_0xb273('0x4e')][_0xb273('0xb4')]){_0x130238['threadId']=_0x59b212['body'][_0xb273('0xb4')];}return _0x5cbdc3['update'](_0x130238);}else{return _0x5cbdc3;}}})['then'](function(_0x4af8d2){_0x34dae7[_0xb273('0xb0')]=_0x4af8d2[_0xb273('0x27')]({'plain':!![]});_0x34dae7[_0xb273('0xb0')]['created']=_0x4e36ad;if(_0x34dae7['interaction'][_0xb273('0xb5')]){if(_0x34dae7['account'][_0xb273('0xb6')]){_0x34dae7[_0xb273('0x97')][_0xb273('0xb7')]({'id':0x0,'priority':_0x34dae7[_0xb273('0x97')]['length']+0x1,'app':_0xb273('0xb8'),'appdata':'unmanaged','interval':_0xb273('0xb9')});}}return db[_0xb273('0xba')]['create']({'body':_0x59b212[_0xb273('0x4e')][_0xb273('0x4e')],'ChatWebsiteId':_0x59b212['params']['id'],'ChatInteractionId':_0x4af8d2['id'],'direction':'in','ContactId':_0x34dae7[_0xb273('0xb2')]['id'],'AttachmentId':_0x59b212[_0xb273('0x4e')]['AttachmentId']});})[_0xb273('0x13')](function(_0x596eea){_0x34dae7['message']=_0x596eea;if(_0x34dae7[_0xb273('0xb0')]['UserId']){return db['User'][_0xb273('0x53')]({'attributes':['id',_0xb273('0x2c')],'where':{'id':_0x34dae7[_0xb273('0xb0')][_0xb273('0xbb')]}})[_0xb273('0x13')](function(_0x5175cb){if(_0x5175cb){_0x34dae7[_0xb273('0x97')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb273('0xbc'),'appdata':_0x5175cb[_0xb273('0x2c')]+','+(_0x34dae7[_0xb273('0x9a')][_0xb273('0xbd')]||0xa),'interval':_0xb273('0xb9')});_0x34dae7[_0xb273('0xbe')]=!![];}return respondWithRpcPromise(_0xb273('0xbf'),_0xb273('0xc0'),_0x34dae7);});}return respondWithRpcPromise(_0xb273('0xbf'),_0xb273('0xc0'),_0x34dae7);})[_0xb273('0x13')](function(_0x4c693f){respondWithRpcPromise(_0xb273('0xc1'),_0xb273('0xc1'),{'event':_0xb273('0x7e'),'message':_0x4c693f},client9002);return _0x4c693f;})[_0xb273('0x13')](respondWithResult(_0x2e367c,null))['catch'](handleError(_0x2e367c,null));};exports[_0xb273('0xc2')]=function(_0x3be6fa,_0x47fc98){var _0x247e89,_0x6e2894,_0x18e169;var _0x1781ec=[];var _0x464eb9={};var _0x4a82f5=_0x3be6fa[_0xb273('0xc3')]||[];var _0x539d19=[];var _0x2b096f;return db[_0xb273('0x84')][_0xb273('0x56')]()['then'](function(_0x1ced3b){if(!_0x1ced3b){throw new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0x87'));}_0x1781ec=_[_0xb273('0x88')](_[_0xb273('0x33')](_0x1ced3b),[_0xb273('0x89'),_0xb273('0x8a'),'CompanyId',_0xb273('0x8b')]);if(_0x3be6fa[_0xb273('0x4e')]['id']){delete _0x3be6fa[_0xb273('0x4e')]['id'];}if(_['isNil'](_0x3be6fa[_0xb273('0x4e')][_0xb273('0x8c')])){throw _0x47fc98[_0xb273('0x1d')](0x1f4)[_0xb273('0xc4')](new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0x8d')));}if(_['isNil'](_0x3be6fa[_0xb273('0x4e')][_0xb273('0x4e')])||_0x3be6fa['body'][_0xb273('0x4e')]===''){throw _0x47fc98[_0xb273('0x1d')](0x1f4)['send'](new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0x8e')));}if(_[_0xb273('0x72')](_0x3be6fa[_0xb273('0x4e')]['mapKeyOffline'])){throw _0x47fc98[_0xb273('0x1d')](0x1f4)[_0xb273('0xc4')](new db[(_0xb273('0x85'))][(_0xb273('0x86'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1781ec));}if(!_[_0xb273('0x91')](_0x1781ec,_0x3be6fa[_0xb273('0x4e')]['mapKeyOffline'])){throw _0x47fc98[_0xb273('0x1d')](0x1f4)[_0xb273('0xc4')](new db[(_0xb273('0x85'))][(_0xb273('0x86'))](_0xb273('0xc5')+_0x1781ec));}_0x464eb9[_0x3be6fa[_0xb273('0x4e')][_0xb273('0xc6')]]=_0x3be6fa['body'][_0xb273('0x8c')];})['then'](function(){return db['ChatWebsite'][_0xb273('0x53')]({'where':{'id':_0x3be6fa[_0xb273('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0xb273('0x93')},{'model':db[_0xb273('0xc7')],'as':'MailAccount'}]});})[_0xb273('0x13')](handleEntityNotFound(_0x47fc98,null))[_0xb273('0x13')](function(_0x2fc619){if(_0x2fc619&&_0x2fc619['List']){_0x6e2894=_0x2fc619;var _0x105fcd=_[_0xb273('0xb')](_0x3be6fa['body'],{'firstName':_0x3be6fa[_0xb273('0x4e')][_0xb273('0x8c')],'phone':_0x3be6fa[_0xb273('0x4e')][_0xb273('0x8c')],'ListId':_0x2fc619[_0xb273('0x8b')]});_0x105fcd[_0x3be6fa[_0xb273('0x4e')][_0xb273('0xc6')]]=_0x3be6fa[_0xb273('0x4e')]['from'];return db[_0xb273('0x84')][_0xb273('0xc8')]({'where':_0x464eb9,'defaults':_0x105fcd});}})[_0xb273('0xb1')](function(_0x15ad83){if(_0x15ad83){_0x18e169=_0x15ad83;var _0x5f8ea0=fs[_0xb273('0xc9')](path[_0xb273('0x6c')](config[_0xb273('0x6d')],_0xb273('0xca')),_0xb273('0xcb'));var _0x1ab479=ejs[_0xb273('0xcc')](_0x5f8ea0,{'body':_[_0xb273('0xcd')](_0x3be6fa[_0xb273('0x4e')]['body']),'bodyTitle':_0x6e2894[_0xb273('0xce')]});return db[_0xb273('0xcf')][_0xb273('0x4d')]({'body':_0x1ab479,'plainBody':htmlToText[_0xb273('0xd0')](_0x1ab479),'ContactId':_0x15ad83['id'],'ChatWebsiteId':_0x6e2894['id']});}})[_0xb273('0x13')](function(_0x101faa){_0x2b096f=_0x101faa;if(_0x4a82f5[_0xb273('0x38')]){var _0x5750ab=_0x4a82f5[_0xb273('0x30')](function(_0x593296){return{'name':_0x593296[_0xb273('0xd1')],'basename':_0x593296[_0xb273('0x64')],'type':_0x593296[_0xb273('0xd2')],'ChatOfflineMessageId':_0x101faa['id']};});_0x539d19=_0x5750ab['map'](_0x24f039=>{var _0x4dcc98={'filename':_0x24f039['name'],'path':path[_0xb273('0x6c')](config['root'],_0xb273('0xd3'),_0xb273('0xc3'),_0xb273('0xd4'),_0xb273('0xd5'),_0x24f039[_0xb273('0xd6')])};return _0x4dcc98;});if(!_0x6e2894[_0xb273('0xd7')]){return db['sequelize']['transaction'](function(_0x5d46d2){return db[_0xb273('0xd8')][_0xb273('0xd9')](_0x5750ab,{'transaction':_0x5d46d2});});}}})['then'](function(){if(_0x2b096f){_0x247e89=_0x2b096f;return db[_0xb273('0xc7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xb273('0xda')],'as':_0xb273('0xdb'),'raw':!![],'include':[{'model':db[_0xb273('0xdc')],'as':_0xb273('0xdc'),'raw':!![]}]}]});}})[_0xb273('0x13')](function(_0x466db6){if(_0x466db6&&_0x466db6[_0xb273('0xdb')]&&_0x6e2894[_0xb273('0xdd')]&&_0x6e2894[_0xb273('0xde')]){var _0x374823=_0x466db6['getSmtpOptions']();return respondWithRpcPromise(_0xb273('0xdf'),_0xb273('0xe0'),{'account':_0x374823,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x466db6[_0xb273('0x2c')],_0x466db6[_0xb273('0xe1')]||_0x466db6[_0xb273('0xdb')][_0xb273('0x51')]),'to':_0x6e2894['forwardOfflineAddress'],'subject':_0x6e2894[_0xb273('0xe2')],'html':_0x247e89[_0xb273('0x4e')],'attachments':_0x539d19}},client9003)[_0xb273('0x13')](function(){return _0x247e89;})[_0xb273('0x4c')](function(_0x3e6304){logger[_0xb273('0x18')](_0x3e6304);});}})[_0xb273('0x13')](function(){if(_0x6e2894&&_0x6e2894[_0xb273('0xd7')]&&_0x6e2894[_0xb273('0xe3')]){var _0x1dce68=[];if(_0x4a82f5[_0xb273('0x38')]){_0x1dce68=_0x4a82f5[_0xb273('0x30')](function(_0x34f282){return{'name':_0x34f282['originalname'],'basename':_0x34f282[_0xb273('0x64')],'type':_0x34f282[_0xb273('0xd2')],'ChatOfflineMessageId':_0x2b096f['id']};});}var _0x3d89e7;if(!_['isNil'](_0x6e2894[_0xb273('0xe4')])){var _0x2876fc=_[_0xb273('0x30')](_0x3be6fa[_0xb273('0x4e')],function(_0x3384e7){return _0x3384e7;});var _0x1ca9fa=_[_0xb273('0xe5')](_0x2876fc)[0x0];var _0x367dad=_[_0xb273('0xe6')](_0x1ca9fa,function(_0x505a1f){return _0x505a1f;});_0x3d89e7=_0x367dad[0x1][_0x6e2894[_0xb273('0xe4')]];}var _0x55b139={'from':_0x18e169[_0xb273('0xe1')],'firstName':_0x18e169['firstName'],'lastName':_0x18e169[_0xb273('0xb3')],'mapKey':_0xb273('0xe1'),'message':{'from':_0x18e169[_0xb273('0xe1')],'to':_0x6e2894[_0xb273('0xc7')]['email'],'cc':'','subject':_[_0xb273('0x72')](_0x3d89e7)?_0x6e2894[_0xb273('0xe2')]:_0x3d89e7,'messageId':'','sentAt':new Date(),'attach':_0x1dce68['length'],'attachments':_0x1dce68,'originChannel':'Chat','ChatWebsiteId':_0x6e2894['id'],'ChatOfflineMessageId':_0x247e89['id'],'originTo':_0x6e2894[_0xb273('0xc7')][_0xb273('0xe1')]},'body':_0x247e89[_0xb273('0x4e')]};var _0x5ce23e={'account':{'id':_0x6e2894[_0xb273('0xe3')]},'body':_0x55b139,'log':_0xb273('0xe7')};return respondWithRpcPromise('NotifyMailAccount',_0xb273('0xe8'),_0x5ce23e,client9001)[_0xb273('0x13')](function(){return _0x247e89;})[_0xb273('0x4c')](function(_0x406ffe){logger[_0xb273('0x18')](_0x406ffe);});}return;})[_0xb273('0x13')](function(){if(_0x247e89){return _0x247e89;}})[_0xb273('0x13')](respondWithResult(_0x47fc98,null))['catch'](function(_0x25921c){logger['error'](_0xb273('0x4c'),_0x25921c);for(var _0x3f176d of _0x4a82f5){var _0x33fa19=path['join'](config[_0xb273('0x6d')],_0xb273('0xd3'),_0xb273('0xc3'),_0xb273('0xd4'),_0xb273('0xd5'),_0x3f176d[_0xb273('0x64')]);fs_extra['remove'](_0x33fa19)[_0xb273('0x4c')](function(_0xe5ca1e){logger[_0xb273('0x18')](_0xb273('0xe9'),_0x33fa19,_0xe5ca1e);});}});};exports[_0xb273('0xea')]=function(_0x4f4b7c,_0x309058){return db[_0xb273('0xad')][_0xb273('0x53')]({'where':{'id':_0x4f4b7c[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x309058,null))[_0xb273('0x13')](function(_0x2ff4e){if(_0x2ff4e){return _0x2ff4e[_0xb273('0xea')](_0x4f4b7c[_0xb273('0x4e')][_0xb273('0x5b')],_[_0xb273('0xeb')](_0x4f4b7c[_0xb273('0x4e')],[_0xb273('0x5b'),'id'])||{});}})[_0xb273('0x13')](respondWithResult(_0x309058,null))[_0xb273('0x4c')](handleError(_0x309058,null));};exports[_0xb273('0xec')]=function(_0x41d168,_0x56d9bf){var _0x464796={'raw':![],'where':{}};var _0x51e44b={};var _0x19c542={'count':0x0,'rows':[]};return db[_0xb273('0x47')][_0xb273('0x5a')]({'where':{'id':_0x41d168['params']['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x56d9bf,null))['then'](function(_0x619b6a){if(_0x619b6a){_0x51e44b['model']=_['keys'](db[_0xb273('0xad')][_0xb273('0x48')]);_0x51e44b[_0xb273('0x34')]=_['keys'](_0x41d168[_0xb273('0x34')]);_0x51e44b[_0xb273('0x35')]=_['intersection'](_0x51e44b[_0xb273('0x32')],_0x51e44b[_0xb273('0x34')]);_0x464796[_0xb273('0x37')]=_[_0xb273('0x36')](_0x51e44b[_0xb273('0x32')],qs['fields'](_0x41d168['query'][_0xb273('0x49')]));_0x464796['attributes']=_0x464796[_0xb273('0x37')][_0xb273('0x38')]?_0x464796[_0xb273('0x37')]:_0x51e44b[_0xb273('0x32')];if(!_0x41d168[_0xb273('0x34')][_0xb273('0x39')](_0xb273('0x5f'))){_0x464796[_0xb273('0x21')]=qs['limit'](_0x41d168[_0xb273('0x34')][_0xb273('0x21')]);_0x464796['offset']=qs[_0xb273('0x1f')](_0x41d168[_0xb273('0x34')][_0xb273('0x1f')]);}_0x464796[_0xb273('0x3a')]=qs['sort'](_0x41d168[_0xb273('0x34')][_0xb273('0x3b')]);_0x464796[_0xb273('0x3c')]=qs[_0xb273('0x35')](_[_0xb273('0x3d')](_0x41d168['query'],_0x51e44b['filters']));_0x464796[_0xb273('0x3c')][_0xb273('0x57')]=_0x619b6a['id'];if(_0x41d168[_0xb273('0x34')]['filter']){_0x464796['where']=_[_0xb273('0x41')](_0x464796[_0xb273('0x3c')],{'$or':_[_0xb273('0x30')](_0x464796[_0xb273('0x37')],function(_0x2f701e){var _0x17e888={};_0x17e888[_0x2f701e]={'$like':'%'+_0x41d168['query'][_0xb273('0x40')]+'%'};return _0x17e888;})});}_0x464796=_[_0xb273('0x41')]({},_0x464796,_0x41d168[_0xb273('0x4b')]);return db[_0xb273('0xad')]['count']({'where':_0x464796[_0xb273('0x3c')]})[_0xb273('0x13')](function(_0x4d49e1){_0x19c542['count']=_0x4d49e1;if(_0x41d168[_0xb273('0x34')][_0xb273('0x42')]){_0x464796['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xb273('0xed')],'as':'Owner','attributes':[_0xb273('0x2c'),_0xb273('0xee'),_0xb273('0xef')],'required':![]},{'model':db['Tag'],'as':_0xb273('0xf0'),'attributes':['id',_0xb273('0x2c'),'color'],'where':_0x41d168[_0xb273('0x34')][_0xb273('0xf1')]?{'id':_0x41d168[_0xb273('0x34')][_0xb273('0xf1')]}:undefined,'required':_0x41d168['query'][_0xb273('0xf1')]?!![]:![]}];}return db[_0xb273('0xad')]['findAll'](_0x464796);})[_0xb273('0x13')](function(_0x2b93c2){_0x19c542['rows']=_0x2b93c2;return _0x19c542;});}})[_0xb273('0x13')](respondWithFilteredResult(_0x56d9bf,_0x464796))[_0xb273('0x4c')](handleError(_0x56d9bf,null));};function iftimePromise(_0x9c28c3,_0x536675){return respondWithRpcPromise(_0xb273('0xf2'),_0xb273('0xf3'),{'command':_0x536675[_0xb273('0xf4')]?util[_0xb273('0xa5')](_0xb273('0xf5'),_0x9c28c3['interval'],_0x536675[_0xb273('0xf4')]):util[_0xb273('0xa5')](_0xb273('0xf6'),_0x9c28c3[_0xb273('0xf7')])},client9002)['then'](function(_0x37f253){var _0x88c4=_0x37f253&&_0x37f253[_0xb273('0xf8')](_0xb273('0xf9'))>=0x0?!![]:![];logger[_0xb273('0x14')](_0xb273('0xfa'),_0x536675['id'],_0x9c28c3['id'],_0x9c28c3[_0xb273('0xf7')],_0x88c4?_0xb273('0xfb'):'OFFLINE',_0x536675[_0xb273('0xf4')]?_0x536675[_0xb273('0xf4')]:'No\x20timezone');return _0x88c4;})['catch'](function(_0xe8d206){logger[_0xb273('0x18')](_0xb273('0xfa'),_0x536675['id'],_0x9c28c3['id'],_0x9c28c3[_0xb273('0xf7')],util[_0xb273('0xfc')](_0xe8d206,{'showHidden':![],'depth':null}),_0x536675[_0xb273('0xf4')]?_0x536675[_0xb273('0xf4')]:_0xb273('0xfd'));return![];});}exports[_0xb273('0xf3')]=function(_0x71de17,_0x2e4777){var _0x30074e=0x0;var _0x4186da=0x0;var _0x181e67=![];var _0x57f5e7;var _0x47cd63;return db['ChatWebsite']['find']({'where':{'id':_0x71de17[_0xb273('0x46')]['id']},'include':[{'model':db[_0xb273('0xfe')],'as':'Interval','include':[{'model':db[_0xb273('0xfe')],'as':'Intervals','attributes':['id',_0xb273('0xf7')],'raw':!![]}]}]})[_0xb273('0x13')](handleEntityNotFound(_0x2e4777,null))[_0xb273('0x13')](function(_0x20d997){if(_0x20d997){_0x57f5e7=_0x20d997;return _0x20d997[_0xb273('0xff')]({'raw':!![]});}})['then'](function(_0x4b733a){if(_0x57f5e7){if(_0x4b733a){_0x47cd63=_0x4b733a;}}return require(_0xb273('0x6f'))['getLicense']();})[_0xb273('0x13')](function(_0x3184da){if(_0x3184da){_0x4186da=_0x3184da['virtual'];_0x181e67=_0x3184da['custom'];}})[_0xb273('0x13')](function(){return db[_0xb273('0xad')][_0xb273('0x22')]({'where':{'closed':![]}});})['then'](function(_0x446c6d){_0x30074e=_0x446c6d;if(_0x4186da&&_0x446c6d>_0x4186da){return db['License'][_0xb273('0x5a')]({'where':{'id':0x1}})[_0xb273('0x13')](function(_0x22eae5){if(_0x22eae5){_0x22eae5[_0xb273('0x100')](_0xb273('0x101'));}});}})[_0xb273('0x13')](function(){if(_0x57f5e7[_0xb273('0xfe')]&&_0x57f5e7[_0xb273('0xfe')][_0xb273('0x102')]){var _0x3fd55b=[];for(var _0xddd862=0x0;_0xddd862<_0x57f5e7[_0xb273('0xfe')][_0xb273('0x102')][_0xb273('0x38')];_0xddd862++){var _0x5c948b=_0x57f5e7[_0xb273('0xfe')][_0xb273('0x102')][_0xddd862]['get']({'plain':!![]});_0x3fd55b[_0xb273('0xb7')](iftimePromise(_0x5c948b,_0x57f5e7));}return BPromise['all'](_0x3fd55b)[_0xb273('0x13')](function(_0x2902b6){return _['some'](_0x2902b6);});}else{return!![];}})[_0xb273('0x13')](function(_0x3ec1d9){var _0x56d048=fs[_0xb273('0xc9')](path[_0xb273('0x6c')](config[_0xb273('0x6d')],'server/files/chat/iframe.ejs'),_0xb273('0xcb'));var _0x5ee5c8=new url['URL'](_0x57f5e7[_0xb273('0x103')])[_0xb273('0x104')];var _0x268fd1='3.1.0';var _0x445637=![];var _0x1edbf6={'chatVersion':_0x268fd1,'chatWebsiteAddressOrigin':_0x5ee5c8,'remote':_0x57f5e7[_0xb273('0x105')],'query':querystring[_0xb273('0xab')](_[_0xb273('0x41')](_0x57f5e7[_0xb273('0x27')]({'plain':!![]}),{'customerIp':_0x71de17[_0xb273('0x80')][_0xb273('0x9d')]||_0x71de17[_0xb273('0x80')][_0xb273('0x106')]||_0x71de17['connection']['remoteAddress']||_0x71de17['ip'],'referer':_0x71de17[_0xb273('0x80')]['referer'],'openedInteractions':_0x30074e,'maxInteractions':_0x4186da,'virtual':_0x181e67['virtual'],'online':_0x3ec1d9,'custom':_0x181e67}))[_0xb273('0x107')](/'/g,'\x5c\x27')};_0x2e4777[_0xb273('0xc4')](ejs[_0xb273('0xcc')](Mustache[_0xb273('0xcc')](_0x56d048,_0x1edbf6),{'proactiveActions':_0x47cd63,'alignment':_0x57f5e7[_0xb273('0x108')],'verticalAlignment':_0x57f5e7[_0xb273('0x109')],'div_color':_0x57f5e7['color'],'labelText':_0x57f5e7[_0xb273('0x10a')],'text_color':_0x57f5e7[_0xb273('0x10b')],'text_button_color':_0x57f5e7['textButtonColor'],'button_color':_0x57f5e7[_0xb273('0x10c')],'background_color':_0x57f5e7[_0xb273('0x10d')],'hideWhenOffline':_0x57f5e7[_0xb273('0x10e')],'intervalId':_0x57f5e7[_0xb273('0x10f')],'isDevelopment':_0x445637,'chatVersion':_0x268fd1}));})[_0xb273('0x4c')](handleError(_0x2e4777,null));};exports['addApplications']=function(_0xc1f8c0,_0x1a22ba){var _0x4e7e0a=_0xc1f8c0[_0xb273('0x46')]['id'];var _0x20dd37=_0xc1f8c0[_0xb273('0x4e')];var _0x51cc83=0xc8;var _0x2709f0=null;return db[_0xb273('0x110')][_0xb273('0x111')]({'isolationLevel':db['sequelize'][_0xb273('0x112')][_0xb273('0x113')][_0xb273('0x114')]},function(_0xae67eb){return db[_0xb273('0x47')][_0xb273('0x5a')]({'where':{'id':_0x4e7e0a},'transaction':_0xae67eb})['then'](function(_0x324665){if(_0x324665){return db[_0xb273('0x115')][_0xb273('0x26')]({'where':{'ChatWebsiteId':_0x4e7e0a},'transaction':_0xae67eb})[_0xb273('0x13')](function(){var _0x55f6a5=_[_0xb273('0x30')](_0x20dd37,function(_0x20809d){_0x20809d[_0xb273('0x57')]=_0x4e7e0a;return _0x20809d;});return db[_0xb273('0x115')][_0xb273('0xd9')](_0x55f6a5,{'transaction':_0xae67eb});});}else{_0x51cc83=0x194;_0x2709f0=[];}});})[_0xb273('0x13')](function(){if(_0x51cc83!==0x194){return db[_0xb273('0x115')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4e7e0a},'order':_0xb273('0x116')})[_0xb273('0x13')](function(_0x491c5c){_0x2709f0=_0x491c5c;});}})['catch'](function(_0xaf1656){_0x51cc83=0x1f4;logger[_0xb273('0x18')](_0xaf1656[_0xb273('0x2b')]);if(_0xaf1656['name']){delete _0xaf1656['name'];}_0x2709f0=_0xaf1656;})[_0xb273('0x117')](function(){if(_0x2709f0===null){_0x1a22ba['sendStatus'](_0x51cc83);}else{if(_0x51cc83===0x1f4){_0x1a22ba[_0xb273('0x1d')](_0x51cc83)[_0xb273('0xc4')](_0x2709f0);}else{_0x1a22ba[_0xb273('0x1d')](_0x51cc83)['json'](_0x2709f0);}}});};exports[_0xb273('0x118')]=function(_0x5cbacf,_0x4859be){var _0x25099c={};var _0x8d43d={};var _0x34b285;var _0x1f6c16;return db[_0xb273('0x47')][_0xb273('0x5a')]({'where':{'id':_0x5cbacf[_0xb273('0x46')]['id']}})['then'](handleEntityNotFound(_0x4859be,null))[_0xb273('0x13')](function(_0x5ca2d5){if(_0x5ca2d5){_0x34b285=_0x5ca2d5;_0x8d43d[_0xb273('0x32')]=_[_0xb273('0x33')](db['ChatApplication'][_0xb273('0x48')]);_0x8d43d[_0xb273('0x34')]=_['keys'](_0x5cbacf[_0xb273('0x34')]);_0x8d43d['filters']=_['intersection'](_0x8d43d[_0xb273('0x32')],_0x8d43d[_0xb273('0x34')]);_0x25099c[_0xb273('0x37')]=_[_0xb273('0x36')](_0x8d43d[_0xb273('0x32')],qs['fields'](_0x5cbacf[_0xb273('0x34')][_0xb273('0x49')]));_0x25099c[_0xb273('0x37')]=_0x25099c['attributes'][_0xb273('0x38')]?_0x25099c['attributes']:_0x8d43d[_0xb273('0x32')];_0x25099c[_0xb273('0x3a')]=qs['sort'](_0x5cbacf['query'][_0xb273('0x3b')]);_0x25099c['where']=qs[_0xb273('0x35')](_[_0xb273('0x3d')](_0x5cbacf[_0xb273('0x34')],_0x8d43d[_0xb273('0x35')]));if(_0x5cbacf[_0xb273('0x34')][_0xb273('0x40')]){_0x25099c['where']=_[_0xb273('0x41')](_0x25099c['where'],{'$or':_[_0xb273('0x30')](_0x25099c[_0xb273('0x37')],function(_0x5ded6c){var _0x47b23e={};_0x47b23e[_0x5ded6c]={'$like':'%'+_0x5cbacf[_0xb273('0x34')][_0xb273('0x40')]+'%'};return _0x47b23e;})});}_0x25099c=_[_0xb273('0x41')]({},_0x25099c,_0x5cbacf[_0xb273('0x4b')]);return _0x34b285[_0xb273('0x118')](_0x25099c);}})[_0xb273('0x13')](function(_0x280ca7){if(_0x280ca7){_0x1f6c16=_0x280ca7['length'];if(!_0x5cbacf[_0xb273('0x34')]['hasOwnProperty']('nolimit')){_0x25099c[_0xb273('0x21')]=qs[_0xb273('0x21')](_0x5cbacf['query']['limit']);_0x25099c[_0xb273('0x1f')]=qs[_0xb273('0x1f')](_0x5cbacf[_0xb273('0x34')][_0xb273('0x1f')]);}return _0x34b285[_0xb273('0x118')](_0x25099c);}})[_0xb273('0x13')](function(_0x5e09e9){if(_0x5e09e9){return _0x5e09e9?{'count':_0x1f6c16,'rows':_0x5e09e9}:null;}})[_0xb273('0x13')](respondWithResult(_0x4859be,null))[_0xb273('0x4c')](handleError(_0x4859be,null));};exports[_0xb273('0x119')]=function(_0x4dec0d,_0x186000){return db[_0xb273('0x11a')][_0xb273('0x53')]({'where':{'id':_0x4dec0d[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x186000,null))[_0xb273('0x13')](function(_0x5ed5a6){if(_0x5ed5a6){return _0x5ed5a6[_0xb273('0x119')](_0x4dec0d[_0xb273('0x4e')][_0xb273('0x5b')],_[_0xb273('0xeb')](_0x4dec0d[_0xb273('0x4e')],['ids','id'])||{});}})[_0xb273('0x13')](respondWithResult(_0x186000,null))['catch'](handleError(_0x186000,null));};exports['getProactiveActions']=function(_0x45dae6,_0x1ec15a){var _0x1bd68d={};var _0xae22c4={};var _0x1f78ea;var _0x28076b;return db[_0xb273('0x47')][_0xb273('0x5a')]({'where':{'id':_0x45dae6['params']['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x1ec15a,null))[_0xb273('0x13')](function(_0x14a7bd){if(_0x14a7bd){_0x1f78ea=_0x14a7bd;_0xae22c4[_0xb273('0x32')]=_[_0xb273('0x33')](db[_0xb273('0x11b')][_0xb273('0x48')]);_0xae22c4[_0xb273('0x34')]=_['keys'](_0x45dae6[_0xb273('0x34')]);_0xae22c4[_0xb273('0x35')]=_[_0xb273('0x36')](_0xae22c4[_0xb273('0x32')],_0xae22c4[_0xb273('0x34')]);_0x1bd68d['attributes']=_['intersection'](_0xae22c4[_0xb273('0x32')],qs[_0xb273('0x49')](_0x45dae6[_0xb273('0x34')]['fields']));_0x1bd68d[_0xb273('0x37')]=_0x1bd68d[_0xb273('0x37')]['length']?_0x1bd68d[_0xb273('0x37')]:_0xae22c4[_0xb273('0x32')];_0x1bd68d[_0xb273('0x3a')]=qs['sort'](_0x45dae6['query'][_0xb273('0x3b')]);_0x1bd68d[_0xb273('0x3c')]=qs['filters'](_[_0xb273('0x3d')](_0x45dae6[_0xb273('0x34')],_0xae22c4[_0xb273('0x35')]));if(_0x45dae6[_0xb273('0x34')]['filter']){_0x1bd68d[_0xb273('0x3c')]=_[_0xb273('0x41')](_0x1bd68d['where'],{'$or':_[_0xb273('0x30')](_0x1bd68d[_0xb273('0x37')],function(_0x5123e8){var _0xb63365={};_0xb63365[_0x5123e8]={'$like':'%'+_0x45dae6[_0xb273('0x34')][_0xb273('0x40')]+'%'};return _0xb63365;})});}_0x1bd68d=_['merge']({},_0x1bd68d,_0x45dae6['options']);return _0x1f78ea[_0xb273('0xff')](_0x1bd68d);}})[_0xb273('0x13')](function(_0x367d1f){if(_0x367d1f){_0x28076b=_0x367d1f['length'];if(!_0x45dae6['query'][_0xb273('0x39')](_0xb273('0x5f'))){_0x1bd68d[_0xb273('0x21')]=qs['limit'](_0x45dae6[_0xb273('0x34')]['limit']);_0x1bd68d['offset']=qs[_0xb273('0x1f')](_0x45dae6['query']['offset']);}return _0x1f78ea['getProactiveActions'](_0x1bd68d);}})[_0xb273('0x13')](function(_0x5e6063){if(_0x5e6063){return _0x5e6063?{'count':_0x28076b,'rows':_0x5e6063}:null;}})['then'](respondWithResult(_0x1ec15a,null))['catch'](handleError(_0x1ec15a,null));};exports[_0xb273('0x11c')]=function(_0x41cfde,_0x57d8af){var _0x1d0cf9=_0x41cfde[_0xb273('0x34')][_0xb273('0x11d')]===_0xb273('0x11e')?_0xb273('0x11f'):_0xb273('0x120');return db['ChatWebsite'][_0xb273('0x53')]({'attributes':['id',_0x1d0cf9],'where':{'id':_0x41cfde[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x57d8af,null))[_0xb273('0x13')](function(_0x4caf42){if(_0x4caf42){var _0x1f3e3a=_0x4caf42[_0x1d0cf9];var _0xbc9d72=_0x1f3e3a&&_0x1f3e3a[_0xb273('0x121')]?_0x1f3e3a[_0xb273('0x121')]:[];_0x57d8af[_0xb273('0xc4')]({'fromKey':_['isNil'](_0x1f3e3a[_0xb273('0x122')])?undefined:_0x1f3e3a['fromKey'],'count':_0xbc9d72['length'],'rows':_0xbc9d72});}})[_0xb273('0x4c')](handleError(_0x57d8af,null));};exports[_0xb273('0x123')]=function(_0x4a554a,_0x1fe77c){var _0x4ee8c0={'raw':![],'where':{}};var _0x3ee91f={};var _0x5f02cf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb273('0x5a')]({'where':{'id':_0x4a554a[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x1fe77c,null))[_0xb273('0x13')](function(_0x462647){if(_0x462647){_0x3ee91f[_0xb273('0x32')]=_[_0xb273('0x33')](db[_0xb273('0xcf')][_0xb273('0x48')]);_0x3ee91f[_0xb273('0x34')]=_[_0xb273('0x33')](_0x4a554a['query']);_0x3ee91f[_0xb273('0x35')]=_[_0xb273('0x36')](_0x3ee91f[_0xb273('0x32')],_0x3ee91f[_0xb273('0x34')]);_0x4ee8c0['attributes']=_[_0xb273('0x36')](_0x3ee91f[_0xb273('0x32')],qs['fields'](_0x4a554a[_0xb273('0x34')]['fields']));_0x4ee8c0[_0xb273('0x37')]=_0x4ee8c0[_0xb273('0x37')][_0xb273('0x38')]?_0x4ee8c0['attributes']:_0x3ee91f[_0xb273('0x32')];if(!_0x4a554a[_0xb273('0x34')][_0xb273('0x39')](_0xb273('0x5f'))){_0x4ee8c0[_0xb273('0x21')]=qs[_0xb273('0x21')](_0x4a554a[_0xb273('0x34')][_0xb273('0x21')]);_0x4ee8c0[_0xb273('0x1f')]=qs[_0xb273('0x1f')](_0x4a554a[_0xb273('0x34')]['offset']);}_0x4ee8c0['order']=qs['sort'](_0x4a554a[_0xb273('0x34')][_0xb273('0x3b')]);_0x4ee8c0[_0xb273('0x3c')]=qs['filters'](_[_0xb273('0x3d')](_0x4a554a[_0xb273('0x34')],_0x3ee91f[_0xb273('0x35')]));_0x4ee8c0[_0xb273('0x3c')][_0xb273('0x57')]=_0x462647['id'];if(_0x4a554a[_0xb273('0x34')][_0xb273('0x40')]){_0x4ee8c0[_0xb273('0x3c')]=_[_0xb273('0x41')](_0x4ee8c0[_0xb273('0x3c')],{'$or':_['map'](_0x4ee8c0[_0xb273('0x37')],function(_0x40448c){var _0x315c6a={};_0x315c6a[_0x40448c]={'$like':'%'+_0x4a554a[_0xb273('0x34')][_0xb273('0x40')]+'%'};return _0x315c6a;})});}_0x4ee8c0=_['merge']({},_0x4ee8c0,_0x4a554a[_0xb273('0x4b')]);return db[_0xb273('0xcf')]['count']({'where':_0x4ee8c0[_0xb273('0x3c')]})[_0xb273('0x13')](function(_0x36cf67){_0x5f02cf[_0xb273('0x22')]=_0x36cf67;if(_0x4a554a[_0xb273('0x34')][_0xb273('0x42')]){_0x4ee8c0['include']=[{'all':!![]}];}else{_0x4ee8c0[_0xb273('0x4a')]=[{'model':db['CmContact'],'as':_0xb273('0x124'),'required':![]},{'model':db[_0xb273('0xd8')],'as':'Attachments','required':![]}];}return db[_0xb273('0xcf')][_0xb273('0x43')](_0x4ee8c0);})[_0xb273('0x13')](function(_0x51d974){_0x5f02cf[_0xb273('0x44')]=_0x51d974;return _0x5f02cf;});}})[_0xb273('0x13')](respondWithFilteredResult(_0x1fe77c,_0x4ee8c0))[_0xb273('0x4c')](handleError(_0x1fe77c,null));};exports[_0xb273('0x125')]=function(_0x255baa,_0x5402c2){return db[_0xb273('0x47')][_0xb273('0x53')]({'where':{'id':_0x255baa[_0xb273('0x46')]['id']}})['then'](handleEntityNotFound(_0x5402c2,null))[_0xb273('0x13')](function(_0x5251f2){if(_0x5251f2){return _0x5251f2[_0xb273('0x125')](_0x255baa[_0xb273('0x4e')]['ids'],_[_0xb273('0xeb')](_0x255baa[_0xb273('0x4e')],[_0xb273('0x5b'),'id'])||{})['spread'](function(_0x5f342a){for(var _0x1496f2=0x0;_0x1496f2<_0x255baa['body'][_0xb273('0x5b')][_0xb273('0x38')];_0x1496f2+=0x1){socket[_0xb273('0x126')](_0xb273('0x127'),{'UserId':Number(_0x255baa['body'][_0xb273('0x5b')][_0x1496f2]),'ChatWebsiteId':Number(_0x255baa[_0xb273('0x46')]['id'])});}return _0x5f342a;});}})[_0xb273('0x13')](respondWithResult(_0x5402c2,null))['catch'](handleError(_0x5402c2,null));};exports[_0xb273('0x128')]=function(_0x49624e,_0x1ea122){return db['ChatWebsite']['find']({'where':{'id':_0x49624e[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x1ea122,null))[_0xb273('0x13')](function(_0x18708d){if(_0x18708d){return _0x18708d[_0xb273('0x128')](_0x49624e[_0xb273('0x34')][_0xb273('0x5b')])[_0xb273('0x13')](function(){if(_[_0xb273('0x129')](_0x49624e[_0xb273('0x34')][_0xb273('0x5b')])){for(var _0x1cbac5=0x0;_0x1cbac5<_0x49624e[_0xb273('0x34')][_0xb273('0x5b')][_0xb273('0x38')];_0x1cbac5+=0x1){socket[_0xb273('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x49624e[_0xb273('0x34')][_0xb273('0x5b')][_0x1cbac5]),'ChatWebsiteId':Number(_0x49624e[_0xb273('0x46')]['id'])});}}else{socket[_0xb273('0x126')](_0xb273('0x12a'),{'UserId':Number(_0x49624e[_0xb273('0x34')]['ids']),'ChatWebsiteId':Number(_0x49624e['params']['id'])});}});}})[_0xb273('0x13')](respondWithStatusCode(_0x1ea122,null))[_0xb273('0x4c')](handleError(_0x1ea122,null));};exports[_0xb273('0x12b')]=function(_0x567cc0,_0x1334bf){var _0x2ddb8c={};var _0x2d3d7c={};var _0x5f0ec8;var _0x3e0513;return db[_0xb273('0x47')][_0xb273('0x5a')]({'where':{'id':_0x567cc0[_0xb273('0x46')]['id']}})[_0xb273('0x13')](handleEntityNotFound(_0x1334bf,null))[_0xb273('0x13')](function(_0xbacbc6){if(_0xbacbc6){_0x5f0ec8=_0xbacbc6;_0x2d3d7c[_0xb273('0x32')]=_[_0xb273('0x33')](db[_0xb273('0xed')]['rawAttributes']);_0x2d3d7c[_0xb273('0x34')]=_[_0xb273('0x33')](_0x567cc0[_0xb273('0x34')]);_0x2d3d7c[_0xb273('0x35')]=_[_0xb273('0x36')](_0x2d3d7c['model'],_0x2d3d7c['query']);_0x2ddb8c[_0xb273('0x37')]=_['intersection'](_0x2d3d7c['model'],qs[_0xb273('0x49')](_0x567cc0[_0xb273('0x34')][_0xb273('0x49')]));_0x2ddb8c[_0xb273('0x37')]=_0x2ddb8c['attributes'][_0xb273('0x38')]?_0x2ddb8c[_0xb273('0x37')]:_0x2d3d7c['model'];_0x2ddb8c[_0xb273('0x3a')]=qs['sort'](_0x567cc0[_0xb273('0x34')]['sort']);_0x2ddb8c[_0xb273('0x3c')]=qs['filters'](_['pick'](_0x567cc0[_0xb273('0x34')],_0x2d3d7c[_0xb273('0x35')]));if(_0x567cc0[_0xb273('0x34')]['filter']){_0x2ddb8c[_0xb273('0x3c')]=_[_0xb273('0x41')](_0x2ddb8c['where'],{'$or':_[_0xb273('0x30')](_0x2ddb8c['attributes'],function(_0x1582e0){var _0x1d6520={};_0x1d6520[_0x1582e0]={'$like':'%'+_0x567cc0[_0xb273('0x34')][_0xb273('0x40')]+'%'};return _0x1d6520;})});}_0x2ddb8c=_[_0xb273('0x41')]({},_0x2ddb8c,_0x567cc0[_0xb273('0x4b')]);return _0x5f0ec8[_0xb273('0x12b')](_0x2ddb8c);}})['then'](function(_0x2c4eb6){if(_0x2c4eb6){_0x3e0513=_0x2c4eb6[_0xb273('0x38')];if(!_0x567cc0['query'][_0xb273('0x39')](_0xb273('0x5f'))){_0x2ddb8c[_0xb273('0x21')]=qs['limit'](_0x567cc0[_0xb273('0x34')][_0xb273('0x21')]);_0x2ddb8c[_0xb273('0x1f')]=qs['offset'](_0x567cc0[_0xb273('0x34')][_0xb273('0x1f')]);}return _0x5f0ec8[_0xb273('0x12b')](_0x2ddb8c);}})[_0xb273('0x13')](function(_0x1d5814){if(_0x1d5814){return _0x1d5814?{'count':_0x3e0513,'rows':_0x1d5814}:null;}})['then'](respondWithResult(_0x1334bf,null))[_0xb273('0x4c')](handleError(_0x1334bf,null));};
\ No newline at end of file
+var _0x426e=['Attachment','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','mimetype','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','URL','3.1.0','remote','connection','remoteAddress','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','destroy','bulkCreate','stack','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','offlineForm','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','ChatWebsites','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','rows','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','Disposition','findOne','options','findAll','removeDispositions','addAnswer','CannedAnswer','hasOwnProperty','include','removeAnswers','ids','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','account','list','applications','priority','Applications','defaults','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','autoclose','unmanaged','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','files','attachments','offline-chat','basename','sequelize','transaction'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0x426e,0x182));var _0xe426=function(_0x404303,_0xcf6dee){_0x404303=_0x404303-0x0;var _0x2bb9e5=_0x426e[_0x404303];return _0x2bb9e5;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xe426('0x0'));var util=require('util');var path=require(_0xe426('0x1'));var ejs=require(_0xe426('0x2'));var fs=require('fs');var fs_extra=require(_0xe426('0x3'));var _=require(_0xe426('0x4'));var querystring=require(_0xe426('0x5'));var Redis=require(_0xe426('0x6'));var qs=require(_0xe426('0x7'));var logger=require(_0xe426('0x8'))(_0xe426('0x9'));var config=require(_0xe426('0xa'));var url=require(_0xe426('0xb'));var db=require(_0xe426('0xc'))['db'];config[_0xe426('0xd')]=_['defaults'](config[_0xe426('0xd')],{'host':_0xe426('0xe'),'port':0x18eb});var socket=require(_0xe426('0xf'))(new Redis(config[_0xe426('0xd')]));require(_0xe426('0x10'))[_0xe426('0x11')](socket);var htmlToText=require(_0xe426('0x12'));var jayson=require(_0xe426('0x13'));var client=jayson[_0xe426('0x14')][_0xe426('0x15')]({'port':0x232c});var client9002=jayson[_0xe426('0x14')][_0xe426('0x15')]({'port':0x232a});var client9003=jayson[_0xe426('0x14')][_0xe426('0x15')]({'port':0x232b});var client9001=jayson[_0xe426('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x5b29a4,_0x13d983,_0x43a4d8,_0x411ea1){return new BPromise(function(_0x4ec2cb,_0x1f23a1){var _0x7a3333=_0x411ea1||client;return _0x7a3333[_0xe426('0x16')](_0x5b29a4,_0x43a4d8)[_0xe426('0x17')](function(_0x1b0567){logger['info'](_0xe426('0x18'),_0x13d983,'request\x20sent');logger[_0xe426('0x19')](_0xe426('0x1a'),_0x13d983,_0xe426('0x1b'),JSON['stringify'](_0x1b0567));if(_0x1b0567[_0xe426('0x1c')]){if(_0x1b0567['error']['code']===0x1f4){logger[_0xe426('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x13d983,_0x1b0567[_0xe426('0x1c')][_0xe426('0x1d')]);return _0x1f23a1(_0x1b0567[_0xe426('0x1c')]['message']);}logger[_0xe426('0x1c')](_0xe426('0x18'),_0x13d983,_0x1b0567['error'][_0xe426('0x1d')]);return _0x4ec2cb(_0x1b0567['error']['message']);}else{logger[_0xe426('0x1e')](_0xe426('0x18'),_0x13d983,'request\x20sent');_0x4ec2cb(_0x1b0567[_0xe426('0x1f')][_0xe426('0x1d')]);}})[_0xe426('0x20')](function(_0x36f2c4){logger[_0xe426('0x1c')](_0xe426('0x18'),_0x13d983,_0x36f2c4);_0x1f23a1(_0x36f2c4);});});}function respondWithStatusCode(_0x37baa0,_0x577504){_0x577504=_0x577504||0xcc;return function(_0xbea2c8){if(_0xbea2c8){return _0x37baa0[_0xe426('0x21')](_0x577504);}return _0x37baa0[_0xe426('0x22')](_0x577504)[_0xe426('0x23')]();};}function respondWithResult(_0x62954e,_0x2e381f){_0x2e381f=_0x2e381f||0xc8;return function(_0x42d06c){if(_0x42d06c){return _0x62954e[_0xe426('0x22')](_0x2e381f)[_0xe426('0x24')](_0x42d06c);}};}function respondWithFilteredResult(_0x20a9cc,_0x1e64a7){return function(_0x101d8c){if(_0x101d8c){var _0x53c4f3=typeof _0x1e64a7[_0xe426('0x25')]===_0xe426('0x26')&&typeof _0x1e64a7['limit']===_0xe426('0x26');var _0xfbbbf3=_0x101d8c[_0xe426('0x27')];var _0x554411=_0x53c4f3?0x0:_0x1e64a7[_0xe426('0x25')];var _0x5ad5ba=_0x53c4f3?_0x101d8c[_0xe426('0x27')]:_0x1e64a7[_0xe426('0x25')]+_0x1e64a7['limit'];var _0xbf028e;if(_0x5ad5ba>=_0xfbbbf3){_0x5ad5ba=_0xfbbbf3;_0xbf028e=0xc8;}else{_0xbf028e=0xce;}_0x20a9cc[_0xe426('0x22')](_0xbf028e);return _0x20a9cc['set'](_0xe426('0x28'),_0x554411+'-'+_0x5ad5ba+'/'+_0xfbbbf3)[_0xe426('0x24')](_0x101d8c);}return null;};}function saveUpdates(_0x1cb9be){return function(_0x5e6cd0){if(_0x5e6cd0){return _0x5e6cd0['update'](_0x1cb9be)[_0xe426('0x17')](function(_0xfcbb07){return _0xfcbb07;});}return null;};}function removeEntity(_0x396bd4){return function(_0x55edb2){if(_0x55edb2){return _0x55edb2['destroy']()['then'](function(){var _0x1c03e5=_0x55edb2['get']({'plain':!![]});var _0x478703=_0xe426('0x29');return db[_0xe426('0x2a')]['destroy']({'where':{'type':_0x478703,'resourceId':_0x1c03e5['id']}})[_0xe426('0x17')](function(){return _0x55edb2;});})[_0xe426('0x17')](function(){_0x396bd4[_0xe426('0x22')](0xcc)[_0xe426('0x23')]();});}};}function handleEntityNotFound(_0x2e504b){return function(_0x21a4cb){if(!_0x21a4cb){_0x2e504b[_0xe426('0x21')](0x194);}return _0x21a4cb;};}function handleError(_0x5106c5,_0xa2cdc1){_0xa2cdc1=_0xa2cdc1||0x1f4;return function(_0x1c177b){logger['error'](_0x1c177b['stack']);if(_0x1c177b[_0xe426('0x2b')]){delete _0x1c177b[_0xe426('0x2b')];}_0x5106c5['status'](_0xa2cdc1)[_0xe426('0x2c')](_0x1c177b);};}exports['index']=function(_0x2d13e5,_0x36a224){var _0x365f72={'include':[{'model':db[_0xe426('0x2d')],'as':_0xe426('0x2e')}]},_0x3cdc10={},_0x5e58ff={'count':0x0,'rows':[]};var _0xa91b0b=_[_0xe426('0x2f')](db[_0xe426('0x30')][_0xe426('0x31')],function(_0x4a261a){return{'name':_0x4a261a['fieldName'],'type':_0x4a261a[_0xe426('0x32')][_0xe426('0x33')]};});_0x3cdc10[_0xe426('0x34')]=_['map'](_0xa91b0b,_0xe426('0x2b'));_0x3cdc10[_0xe426('0x35')]=_[_0xe426('0x36')](_0x2d13e5[_0xe426('0x35')]);_0x3cdc10[_0xe426('0x37')]=_[_0xe426('0x38')](_0x3cdc10[_0xe426('0x34')],_0x3cdc10[_0xe426('0x35')]);_0x365f72[_0xe426('0x39')]=_[_0xe426('0x38')](_0x3cdc10[_0xe426('0x34')],qs[_0xe426('0x3a')](_0x2d13e5[_0xe426('0x35')][_0xe426('0x3a')]));_0x365f72[_0xe426('0x39')]=_0x365f72[_0xe426('0x39')]['length']?_0x365f72[_0xe426('0x39')]:_0x3cdc10[_0xe426('0x34')];if(!_0x2d13e5[_0xe426('0x35')]['hasOwnProperty'](_0xe426('0x3b'))){_0x365f72['limit']=qs[_0xe426('0x3c')](_0x2d13e5[_0xe426('0x35')][_0xe426('0x3c')]);_0x365f72[_0xe426('0x25')]=qs['offset'](_0x2d13e5[_0xe426('0x35')][_0xe426('0x25')]);}_0x365f72[_0xe426('0x3d')]=qs[_0xe426('0x3e')](_0x2d13e5['query'][_0xe426('0x3e')]);_0x365f72['where']=qs[_0xe426('0x37')](_[_0xe426('0x3f')](_0x2d13e5['query'],_0x3cdc10[_0xe426('0x37')]),_0xa91b0b);if(_0x2d13e5[_0xe426('0x35')]['filter']){_0x365f72[_0xe426('0x40')]=_[_0xe426('0x41')](_0x365f72[_0xe426('0x40')],{'$or':_['map'](_0xa91b0b,function(_0x345b8e){if(_0x345b8e[_0xe426('0x32')]!==_0xe426('0x42')){var _0x55936f={};_0x55936f[_0x345b8e[_0xe426('0x2b')]]={'$like':'%'+_0x2d13e5[_0xe426('0x35')][_0xe426('0x43')]+'%'};return _0x55936f;}})});}_0x365f72=_['merge']({},_0x365f72,_0x2d13e5['options']);var _0x5dbaae={'where':_0x365f72[_0xe426('0x40')]};return db[_0xe426('0x30')][_0xe426('0x27')](_0x5dbaae)[_0xe426('0x17')](function(_0x2d4e4c){_0x5e58ff['count']=_0x2d4e4c;if(_0x2d13e5[_0xe426('0x35')][_0xe426('0x44')]){_0x365f72['include']=[{'all':!![]}];}return db[_0xe426('0x30')]['findAll'](_0x365f72);})[_0xe426('0x17')](function(_0x5ad755){_0x5e58ff[_0xe426('0x45')]=_0x5ad755;return _0x5e58ff;})[_0xe426('0x17')](respondWithFilteredResult(_0x36a224,_0x365f72))['catch'](handleError(_0x36a224,null));};exports[_0xe426('0x46')]=function(_0x310500,_0x5d7545){var _0x522872={'raw':![],'where':{'id':_0x310500[_0xe426('0x47')]['id']},'include':[{'model':db[_0xe426('0x2d')],'as':_0xe426('0x2e')}]},_0x53b71a={};_0x53b71a[_0xe426('0x34')]=_[_0xe426('0x36')](db[_0xe426('0x30')][_0xe426('0x31')]);_0x53b71a[_0xe426('0x35')]=_[_0xe426('0x36')](_0x310500[_0xe426('0x35')]);_0x53b71a['filters']=_[_0xe426('0x38')](_0x53b71a[_0xe426('0x34')],_0x53b71a['query']);_0x522872[_0xe426('0x39')]=_[_0xe426('0x38')](_0x53b71a[_0xe426('0x34')],qs[_0xe426('0x3a')](_0x310500['query']['fields']));_0x522872[_0xe426('0x39')]=_0x522872[_0xe426('0x39')][_0xe426('0x48')]?_0x522872[_0xe426('0x39')]:_0x53b71a['model'];if(_0x310500[_0xe426('0x35')][_0xe426('0x44')]){_0x522872['include']=[{'all':!![]}];}_0x522872=_[_0xe426('0x41')]({},_0x522872,_0x310500['options']);return db[_0xe426('0x30')][_0xe426('0x49')](_0x522872)[_0xe426('0x17')](handleEntityNotFound(_0x5d7545,null))['then'](respondWithResult(_0x5d7545,null))['catch'](handleError(_0x5d7545,null));};exports[_0xe426('0x4a')]=function(_0x4ff4a2,_0x528c0d){return db['ChatWebsite']['create'](_0x4ff4a2[_0xe426('0x4b')],{})[_0xe426('0x17')](function(_0x3fccc5){var _0x2aeac2=_0x4ff4a2['user'][_0xe426('0x4c')]({'plain':!![]});if(!_0x2aeac2)throw new Error(_0xe426('0x4d'));if(_0x2aeac2[_0xe426('0x4e')]===_0xe426('0x4f')){var _0x3bf7bb=_0x3fccc5[_0xe426('0x4c')]({'plain':!![]});var _0x110372=_0xe426('0x29');return db[_0xe426('0x50')][_0xe426('0x49')]({'where':{'name':_0x110372,'userProfileId':_0x2aeac2['userProfileId']},'raw':!![]})[_0xe426('0x17')](function(_0x1eea18){if(_0x1eea18&&_0x1eea18[_0xe426('0x51')]===0x0){return db[_0xe426('0x2a')]['create']({'name':_0x3bf7bb[_0xe426('0x2b')],'resourceId':_0x3bf7bb['id'],'type':_0x1eea18[_0xe426('0x2b')],'sectionId':_0x1eea18['id']},{})[_0xe426('0x17')](function(){return _0x3fccc5;});}else{return _0x3fccc5;}})[_0xe426('0x20')](function(_0x3ef90c){logger[_0xe426('0x1c')](_0xe426('0x52'),_0x3ef90c);throw _0x3ef90c;});}return _0x3fccc5;})['then'](respondWithResult(_0x528c0d,0xc9))[_0xe426('0x20')](handleError(_0x528c0d,null));};exports[_0xe426('0x53')]=function(_0x9f5082,_0x2d0205){if(_0x9f5082['body']['id']){delete _0x9f5082[_0xe426('0x4b')]['id'];}return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x9f5082[_0xe426('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xe426('0x2e')}]})['then'](handleEntityNotFound(_0x2d0205,null))[_0xe426('0x17')](saveUpdates(_0x9f5082['body'],null))[_0xe426('0x17')](respondWithResult(_0x2d0205,null))['catch'](handleError(_0x2d0205,null));};exports['destroy']=function(_0x3c6681,_0x55ddbe){return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x3c6681[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x55ddbe,null))[_0xe426('0x17')](removeEntity(_0x55ddbe,null))[_0xe426('0x20')](handleError(_0x55ddbe,null));};exports[_0xe426('0x54')]=function(_0x4450af,_0x317787){return db[_0xe426('0x30')][_0xe426('0x54')]()['then'](respondWithResult(_0x317787,null))['catch'](handleError(_0x317787,null));};exports['addDisposition']=function(_0x12b481,_0x307ff3){if(_0x12b481['body']['id']){delete _0x12b481[_0xe426('0x4b')]['id'];}return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x12b481[_0xe426('0x47')]['id']}})['then'](handleEntityNotFound(_0x307ff3,null))[_0xe426('0x17')](function(_0x59b68f){if(_0x59b68f){_0x12b481['body'][_0xe426('0x55')]=_0x59b68f['id'];return db[_0xe426('0x56')][_0xe426('0x4a')](_0x12b481[_0xe426('0x4b')]);}})[_0xe426('0x17')](respondWithResult(_0x307ff3,null))[_0xe426('0x20')](handleError(_0x307ff3,null));};exports['getDispositions']=function(_0x472031,_0x2fd67a){var _0x5d28a5={'raw':![],'where':{}};var _0x508fe2={};var _0x29d091={'count':0x0,'rows':[]};return db[_0xe426('0x30')][_0xe426('0x57')]({'where':{'id':_0x472031[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x2fd67a,null))[_0xe426('0x17')](function(_0x152125){if(_0x152125){_0x508fe2[_0xe426('0x34')]=_['keys'](db['Disposition']['rawAttributes']);_0x508fe2[_0xe426('0x35')]=_[_0xe426('0x36')](_0x472031[_0xe426('0x35')]);_0x508fe2[_0xe426('0x37')]=_[_0xe426('0x38')](_0x508fe2[_0xe426('0x34')],_0x508fe2[_0xe426('0x35')]);_0x5d28a5[_0xe426('0x39')]=_[_0xe426('0x38')](_0x508fe2[_0xe426('0x34')],qs[_0xe426('0x3a')](_0x472031[_0xe426('0x35')][_0xe426('0x3a')]));_0x5d28a5['attributes']=_0x5d28a5[_0xe426('0x39')][_0xe426('0x48')]?_0x5d28a5[_0xe426('0x39')]:_0x508fe2[_0xe426('0x34')];if(!_0x472031[_0xe426('0x35')]['hasOwnProperty']('nolimit')){_0x5d28a5[_0xe426('0x3c')]=qs[_0xe426('0x3c')](_0x472031[_0xe426('0x35')]['limit']);_0x5d28a5[_0xe426('0x25')]=qs[_0xe426('0x25')](_0x472031['query'][_0xe426('0x25')]);}_0x5d28a5[_0xe426('0x3d')]=qs[_0xe426('0x3e')](_0x472031[_0xe426('0x35')][_0xe426('0x3e')]);_0x5d28a5[_0xe426('0x40')]=qs['filters'](_[_0xe426('0x3f')](_0x472031[_0xe426('0x35')],_0x508fe2[_0xe426('0x37')]));_0x5d28a5[_0xe426('0x40')][_0xe426('0x55')]=_0x152125['id'];if(_0x472031[_0xe426('0x35')][_0xe426('0x43')]){_0x5d28a5['where']=_['merge'](_0x5d28a5[_0xe426('0x40')],{'$or':_[_0xe426('0x2f')](_0x5d28a5['attributes'],function(_0x59d120){var _0x2384e5={};_0x2384e5[_0x59d120]={'$like':'%'+_0x472031[_0xe426('0x35')][_0xe426('0x43')]+'%'};return _0x2384e5;})});}_0x5d28a5=_[_0xe426('0x41')]({},_0x5d28a5,_0x472031[_0xe426('0x58')]);return db[_0xe426('0x56')][_0xe426('0x27')]({'where':_0x5d28a5[_0xe426('0x40')]})[_0xe426('0x17')](function(_0x136e54){_0x29d091[_0xe426('0x27')]=_0x136e54;if(_0x472031['query']['includeAll']){_0x5d28a5['include']=[{'all':!![]}];}return db[_0xe426('0x56')][_0xe426('0x59')](_0x5d28a5);})['then'](function(_0x16ba01){_0x29d091['rows']=_0x16ba01;return _0x29d091;});}})[_0xe426('0x17')](respondWithFilteredResult(_0x2fd67a,_0x5d28a5))[_0xe426('0x20')](handleError(_0x2fd67a,null));};exports[_0xe426('0x5a')]=function(_0x30d198,_0x918582){return db['ChatWebsite'][_0xe426('0x49')]({'where':{'id':_0x30d198[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x918582,null))[_0xe426('0x17')](function(_0x129898){if(_0x129898){return _0x129898['removeDispositions'](_0x30d198['query']['ids']);}})['then'](respondWithStatusCode(_0x918582,null))[_0xe426('0x20')](handleError(_0x918582,null));};exports[_0xe426('0x5b')]=function(_0x34f09a,_0x2830c2){if(_0x34f09a['body']['id']){delete _0x34f09a[_0xe426('0x4b')]['id'];}return db[_0xe426('0x30')]['find']({'where':{'id':_0x34f09a[_0xe426('0x47')]['id']}})['then'](handleEntityNotFound(_0x2830c2,null))[_0xe426('0x17')](function(_0x1ad8b5){if(_0x1ad8b5){_0x34f09a[_0xe426('0x4b')][_0xe426('0x55')]=_0x1ad8b5['id'];return db[_0xe426('0x5c')][_0xe426('0x4a')](_0x34f09a[_0xe426('0x4b')]);}})[_0xe426('0x17')](respondWithResult(_0x2830c2,null))[_0xe426('0x20')](handleError(_0x2830c2,null));};exports['getAnswers']=function(_0x4992df,_0x184ea6){var _0x3d4ef7={'raw':![],'where':{}};var _0x51f3b1={};var _0x250f78={'count':0x0,'rows':[]};return db[_0xe426('0x30')]['findOne']({'where':{'id':_0x4992df[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x184ea6,null))['then'](function(_0x9eaac2){if(_0x9eaac2){_0x51f3b1[_0xe426('0x34')]=_[_0xe426('0x36')](db[_0xe426('0x5c')][_0xe426('0x31')]);_0x51f3b1[_0xe426('0x35')]=_['keys'](_0x4992df[_0xe426('0x35')]);_0x51f3b1[_0xe426('0x37')]=_[_0xe426('0x38')](_0x51f3b1[_0xe426('0x34')],_0x51f3b1[_0xe426('0x35')]);_0x3d4ef7[_0xe426('0x39')]=_[_0xe426('0x38')](_0x51f3b1[_0xe426('0x34')],qs[_0xe426('0x3a')](_0x4992df[_0xe426('0x35')][_0xe426('0x3a')]));_0x3d4ef7[_0xe426('0x39')]=_0x3d4ef7['attributes'][_0xe426('0x48')]?_0x3d4ef7[_0xe426('0x39')]:_0x51f3b1[_0xe426('0x34')];if(!_0x4992df[_0xe426('0x35')][_0xe426('0x5d')](_0xe426('0x3b'))){_0x3d4ef7[_0xe426('0x3c')]=qs['limit'](_0x4992df['query'][_0xe426('0x3c')]);_0x3d4ef7[_0xe426('0x25')]=qs[_0xe426('0x25')](_0x4992df['query'][_0xe426('0x25')]);}_0x3d4ef7[_0xe426('0x3d')]=qs['sort'](_0x4992df['query'][_0xe426('0x3e')]);_0x3d4ef7['where']=qs[_0xe426('0x37')](_[_0xe426('0x3f')](_0x4992df['query'],_0x51f3b1[_0xe426('0x37')]));_0x3d4ef7['where'][_0xe426('0x55')]=_0x9eaac2['id'];if(_0x4992df[_0xe426('0x35')][_0xe426('0x43')]){_0x3d4ef7[_0xe426('0x40')]=_[_0xe426('0x41')](_0x3d4ef7[_0xe426('0x40')],{'$or':_[_0xe426('0x2f')](_0x3d4ef7['attributes'],function(_0x2309bd){var _0x467759={};_0x467759[_0x2309bd]={'$like':'%'+_0x4992df['query'][_0xe426('0x43')]+'%'};return _0x467759;})});}_0x3d4ef7=_[_0xe426('0x41')]({},_0x3d4ef7,_0x4992df['options']);return db['CannedAnswer'][_0xe426('0x27')]({'where':_0x3d4ef7[_0xe426('0x40')]})['then'](function(_0x2c2651){_0x250f78[_0xe426('0x27')]=_0x2c2651;if(_0x4992df['query'][_0xe426('0x44')]){_0x3d4ef7[_0xe426('0x5e')]=[{'all':!![]}];}return db[_0xe426('0x5c')][_0xe426('0x59')](_0x3d4ef7);})[_0xe426('0x17')](function(_0xb35ff3){_0x250f78[_0xe426('0x45')]=_0xb35ff3;return _0x250f78;});}})['then'](respondWithFilteredResult(_0x184ea6,_0x3d4ef7))[_0xe426('0x20')](handleError(_0x184ea6,null));};exports[_0xe426('0x5f')]=function(_0x215aa4,_0x2d5c89){return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x215aa4['params']['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x2d5c89,null))[_0xe426('0x17')](function(_0x4726d5){if(_0x4726d5){return _0x4726d5[_0xe426('0x5f')](_0x215aa4['query'][_0xe426('0x60')]);}})['then'](respondWithStatusCode(_0x2d5c89,null))[_0xe426('0x20')](handleError(_0x2d5c89,null));};exports['addLogo']=function(_0x357641,_0x2380b8){_0x357641[_0xe426('0x4b')][_0xe426('0x61')]=_0x357641[_0xe426('0x62')][_0xe426('0x63')];return db['ChatWebsite']['find']({'where':{'id':_0x357641[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x2380b8,null))['then'](saveUpdates(_0x357641[_0xe426('0x4b')],null))['then'](respondWithResult(_0x2380b8,null))[_0xe426('0x20')](handleError(_0x2380b8,null));};exports['addAvatar']=function(_0xb3de01,_0x1275da){_0xb3de01[_0xe426('0x4b')][_0xe426('0x64')]=_0xb3de01['file']['filename'];return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0xb3de01[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x1275da,null))[_0xe426('0x17')](saveUpdates(_0xb3de01[_0xe426('0x4b')],null))[_0xe426('0x17')](respondWithResult(_0x1275da,null))[_0xe426('0x20')](handleError(_0x1275da,null));};exports[_0xe426('0x65')]=function(_0x135566,_0x3a89ba){_0x135566[_0xe426('0x4b')][_0xe426('0x66')]=_0x135566[_0xe426('0x62')]['filename'];return db['ChatWebsite'][_0xe426('0x49')]({'where':{'id':_0x135566[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x3a89ba,null))[_0xe426('0x17')](saveUpdates(_0x135566['body'],null))['then'](respondWithResult(_0x3a89ba,null))[_0xe426('0x20')](handleError(_0x3a89ba,null));};exports[_0xe426('0x67')]=function(_0x5d1af1,_0x2a1232){_0x5d1af1[_0xe426('0x4b')][_0xe426('0x68')]=_0x5d1af1[_0xe426('0x62')][_0xe426('0x63')];return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x5d1af1[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x2a1232,null))[_0xe426('0x17')](saveUpdates(_0x5d1af1['body'],null))['then'](respondWithResult(_0x2a1232,null))[_0xe426('0x20')](handleError(_0x2a1232,null));};exports[_0xe426('0x69')]=function(_0x26fc94,_0x4a926a){var _0xe87470=path[_0xe426('0x6a')](config[_0xe426('0x6b')],_0xe426('0x6c'));var _0x128c1e={'where':{'id':_0x26fc94[_0xe426('0x47')]['id']},'attributes':['id',_0xe426('0x61')],'raw':!![]};var _0x316cfa=![];return require('../../config/license/util')[_0xe426('0x6d')]()[_0xe426('0x17')](function(_0x369a0a){if(_0x369a0a){_0x316cfa=_0x369a0a[_0xe426('0x6e')];}})[_0xe426('0x17')](function(){return db['ChatWebsite'][_0xe426('0x49')](_0x128c1e);})[_0xe426('0x17')](handleEntityNotFound(_0x4a926a,null))[_0xe426('0x17')](function(_0x5aa974){if(_0x5aa974){if(!_[_0xe426('0x6f')](_0x5aa974[_0xe426('0x61')])){if(fs[_0xe426('0x70')](path[_0xe426('0x6a')](config['root'],_0xe426('0x71'),_0x5aa974[_0xe426('0x61')]))&&_0x316cfa){_0xe87470=path[_0xe426('0x6a')](config[_0xe426('0x6b')],_0xe426('0x71'),_0x5aa974[_0xe426('0x61')]);}}return _0x4a926a[_0xe426('0x72')](_0xe87470);}})[_0xe426('0x20')](handleError(_0x4a926a,null));};exports['getAvatar']=function(_0x3a2792,_0x1c96f7){var _0x18a3de=path['join'](config[_0xe426('0x6b')],_0xe426('0x73'));var _0x476fba={'where':{'id':_0x3a2792[_0xe426('0x47')]['id']},'attributes':['id',_0xe426('0x64')],'raw':!![]};return db[_0xe426('0x30')][_0xe426('0x49')](_0x476fba)[_0xe426('0x17')](handleEntityNotFound(_0x1c96f7,null))[_0xe426('0x17')](function(_0x42ccd4){if(_0x42ccd4){if(!_['isNil'](_0x42ccd4[_0xe426('0x64')])){if(fs['existsSync'](path[_0xe426('0x6a')](config['root'],_0xe426('0x74'),_0x42ccd4[_0xe426('0x64')]))){_0x18a3de=path[_0xe426('0x6a')](config[_0xe426('0x6b')],_0xe426('0x74'),_0x42ccd4['agentAvatar']);}}return _0x1c96f7[_0xe426('0x72')](_0x18a3de);}})['catch'](handleError(_0x1c96f7,null));};exports[_0xe426('0x75')]=function(_0x2b56da,_0x401297){var _0x26c954=path['join'](config['root'],_0xe426('0x76'));var _0x584dac={'where':{'id':_0x2b56da[_0xe426('0x47')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xe426('0x30')][_0xe426('0x49')](_0x584dac)['then'](handleEntityNotFound(_0x401297,null))[_0xe426('0x17')](function(_0x5d1756){if(_0x5d1756){if(!_[_0xe426('0x6f')](_0x5d1756[_0xe426('0x66')])){if(fs[_0xe426('0x70')](path[_0xe426('0x6a')](config['root'],'server/files/images/avatars/',_0x5d1756['customerAvatar']))&&_0x5d1756['showCustomerAvatar']){_0x26c954=path[_0xe426('0x6a')](config[_0xe426('0x6b')],_0xe426('0x74'),_0x5d1756[_0xe426('0x66')]);}}return _0x401297['download'](_0x26c954);}})[_0xe426('0x20')](handleError(_0x401297,null));};exports['getSystemAvatar']=function(_0x55afad,_0x27ed74){var _0x3b8560=path['join'](config[_0xe426('0x6b')],_0xe426('0x77'));var _0x239eca={'where':{'id':_0x55afad[_0xe426('0x47')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xe426('0x49')](_0x239eca)[_0xe426('0x17')](handleEntityNotFound(_0x27ed74,null))['then'](function(_0x421f7c){if(_0x421f7c){if(!_[_0xe426('0x6f')](_0x421f7c[_0xe426('0x68')])){if(fs[_0xe426('0x70')](path['join'](config[_0xe426('0x6b')],_0xe426('0x74'),_0x421f7c['systemAvatar']))){_0x3b8560=path['join'](config['root'],'server/files/images/avatars/',_0x421f7c[_0xe426('0x68')]);}}return _0x27ed74[_0xe426('0x72')](_0x3b8560);}})['catch'](handleError(_0x27ed74,null));};exports[_0xe426('0x78')]=function(_0x922e28,_0x30d0c7){var _0x324bc9=require('user-agent-parser');var _0x4ea2fd=new _0x324bc9();var _0x181e45=_0x4ea2fd['setUA'](_0x922e28[_0xe426('0x79')][_0xe426('0x7a')])[_0xe426('0x7b')]();var _0x751919={'body':_0x922e28['body'],'channel':_0xe426('0x7c')};var _0x25b1a5=[];var _0x3e64da=[];var _0x5de36a={};var _0x5618ec=![];return db[_0xe426('0x7d')][_0xe426('0x54')]()['then'](function(_0x2798a2){if(!_0x2798a2){throw new db[(_0xe426('0x7e'))][(_0xe426('0x7f'))](_0xe426('0x80'));}_0x25b1a5=_[_0xe426('0x81')](_[_0xe426('0x36')](_0x2798a2),[_0xe426('0x82'),'updatedAt']);_0x3e64da=_[_0xe426('0x81')](_[_0xe426('0x36')](_0x2798a2),[_0xe426('0x82'),_0xe426('0x83'),_0xe426('0x84'),_0xe426('0x85')]);if(_0x922e28[_0xe426('0x4b')]['id']){delete _0x922e28[_0xe426('0x4b')]['id'];}if(_[_0xe426('0x6f')](_0x922e28['body'][_0xe426('0x86')])){throw new db[(_0xe426('0x7e'))]['ValidationError'](_0xe426('0x87'));}if(_[_0xe426('0x6f')](_0x922e28[_0xe426('0x4b')][_0xe426('0x4b')])||_0x922e28[_0xe426('0x4b')][_0xe426('0x4b')]===''){throw new db[(_0xe426('0x7e'))][(_0xe426('0x7f'))](_0xe426('0x88'));}if(_[_0xe426('0x6f')](_0x922e28[_0xe426('0x4b')][_0xe426('0x89')])){throw new db[(_0xe426('0x7e'))]['ValidationError'](_0xe426('0x8a')+_0x3e64da);}if(!_[_0xe426('0x8b')](_0x3e64da,_0x922e28[_0xe426('0x4b')][_0xe426('0x89')])){throw new db[(_0xe426('0x7e'))][(_0xe426('0x7f'))](_0xe426('0x8c')+_0x3e64da);}_0x5de36a[_0x922e28[_0xe426('0x4b')][_0xe426('0x89')]]=_0x922e28[_0xe426('0x4b')]['from'];})[_0xe426('0x17')](function(){return db['ChatWebsite'][_0xe426('0x49')]({'where':{'id':_0x922e28[_0xe426('0x47')]['id']},'include':[{'model':db[_0xe426('0x8d')],'as':_0xe426('0x8e'),'include':[{'model':db[_0xe426('0x7d')],'as':_0xe426('0x8f'),'where':_0x5de36a,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xe426('0x90')],'as':'Applications'}]});})[_0xe426('0x17')](handleEntityNotFound(_0x30d0c7,null))['then'](function(_0x32eaae){if(_0x32eaae&&_0x32eaae['List']){_0x751919[_0xe426('0x91')]=_0x32eaae;_0x751919['applications']=_0x32eaae['Applications'];_0x751919[_0xe426('0x92')]=_0x32eaae[_0xe426('0x8e')];_0x751919[_0xe426('0x93')]=_['orderBy'](_0x751919[_0xe426('0x93')],[_0xe426('0x94')],['asc']);if(_0x751919[_0xe426('0x91')]['Applications']){delete _0x751919[_0xe426('0x91')][_0xe426('0x95')];}if(_0x751919[_0xe426('0x91')][_0xe426('0x8e')]&&_0x751919[_0xe426('0x91')][_0xe426('0x8e')]['Contacts']['length']){return _0x751919[_0xe426('0x91')][_0xe426('0x8e')][_0xe426('0x8f')][0x0];}var _0x43cfad=_[_0xe426('0x96')](_0x922e28[_0xe426('0x4b')],{'firstName':_0x922e28[_0xe426('0x4b')][_0xe426('0x86')],'ListId':_0x32eaae[_0xe426('0x85')]});_0x43cfad[_0x922e28[_0xe426('0x4b')]['mapKey']]=_0x922e28[_0xe426('0x4b')][_0xe426('0x86')];return db['CmContact'][_0xe426('0x4a')](_0x43cfad,{'fields':_0x25b1a5,'raw':!![]});}})['then'](handleEntityNotFound(_0x30d0c7,null))[_0xe426('0x17')](function(_0x59e2b3){_0x751919['contact']=_0x59e2b3;var _0x4047f9=_0x922e28[_0xe426('0x4b')][_0xe426('0x97')];if(_0x922e28[_0xe426('0x79')][_0xe426('0x98')]){_0x4047f9=_0x922e28[_0xe426('0x79')][_0xe426('0x98')];}else if(_0x922e28['headers'][_0xe426('0x99')]){_0x4047f9=_[_0xe426('0x9a')](_0x922e28[_0xe426('0x79')][_0xe426('0x99')][_0xe426('0x9b')](','));}if(_0x59e2b3){var _0x1688df={'ContactId':_0x59e2b3['id'],'ChatWebsiteId':_0x922e28[_0xe426('0x47')]['id'],'from':(_0x59e2b3[_0xe426('0x9c')]||'')+'\x20'+(_0x59e2b3[_0xe426('0x9d')]||''),'customerIp':_0x4047f9,'customerPort':_0x922e28[_0xe426('0x79')][_0xe426('0x9e')]?_0x922e28['headers']['x-real-port']:null,'referer':_0x922e28[_0xe426('0x4b')][_0xe426('0x9f')],'browserName':_0x181e45[_0xe426('0xa0')][_0xe426('0x2b')]&&_0x181e45['browser'][_0xe426('0xa1')]?util['format'](_0xe426('0xa2'),_0x181e45[_0xe426('0xa0')][_0xe426('0x2b')],_0x181e45[_0xe426('0xa0')][_0xe426('0xa1')]):_0xe426('0xa3'),'browserVersion':_0x181e45[_0xe426('0xa0')][_0xe426('0xa1')]||_0xe426('0xa3'),'osName':util[_0xe426('0xa4')](_0xe426('0xa2'),_0x181e45['os'][_0xe426('0x2b')],_0x181e45['os'][_0xe426('0xa1')]),'osVersion':_0x181e45['os'][_0xe426('0xa1')],'deviceModel':_0x181e45[_0xe426('0xa5')][_0xe426('0x34')]&&_0x181e45[_0xe426('0xa5')][_0xe426('0xa6')]?util[_0xe426('0xa4')](_0xe426('0xa7'),_0x181e45[_0xe426('0xa5')][_0xe426('0x34')],_0x181e45[_0xe426('0xa5')][_0xe426('0xa6')],_0x181e45['device'][_0xe426('0x32')]):null,'deviceVendor':_0x181e45[_0xe426('0xa5')][_0xe426('0xa6')],'deviceType':_0x181e45[_0xe426('0xa5')]['type'],'formData':JSON[_0xe426('0xa8')](_0x922e28[_0xe426('0x4b')])};var _0x5669e1={'ChatWebsiteId':_0x922e28[_0xe426('0x47')]['id'],'closed':![]};if(_0x922e28['body'][_0xe426('0xa9')]){_0x5669e1[_0xe426('0xa9')]=_0x922e28['body']['threadId'];return db[_0xe426('0xaa')][_0xe426('0x49')]({'where':_0x5669e1})[_0xe426('0x17')](function(_0x3856d4){if(_0x3856d4){return[_0x3856d4,![]];}_0x1688df[_0xe426('0xa9')]=_0x922e28[_0xe426('0x4b')][_0xe426('0xa9')];_0x1688df[_0xe426('0xab')]=_0x922e28[_0xe426('0x4b')][_0xe426('0xab')];return db[_0xe426('0xaa')][_0xe426('0x4a')](_0x1688df)[_0xe426('0x17')](function(_0x370235){return[_0x370235,!![]];});});}_0x5669e1['ContactId']=_0x59e2b3['id'];if(_0x922e28[_0xe426('0x4b')]['interaction']&&_0x922e28[_0xe426('0x4b')][_0xe426('0xac')]['id']){_0x5669e1['id']=_0x922e28[_0xe426('0x4b')][_0xe426('0xac')]['id'];return db[_0xe426('0xaa')][_0xe426('0x49')]({'where':_0x5669e1})[_0xe426('0x17')](function(_0x44668d){if(_0x44668d){return[_0x44668d,![]];}return db[_0xe426('0xaa')][_0xe426('0x4a')](_0x1688df)[_0xe426('0x17')](function(_0x3bfa0){return[_0x3bfa0,!![]];});});}return db[_0xe426('0xaa')][_0xe426('0x4a')](_0x1688df)['then'](function(_0x4f3011){return[_0x4f3011,!![]];});}})[_0xe426('0xad')](function(_0x1b8726,_0x2f2192){if(_0x1b8726){_0x5618ec=_0x2f2192;if(!_0x2f2192){var _0xf8d0cd={'from':(_0x751919[_0xe426('0xae')][_0xe426('0x9c')]||'')+'\x20'+(_0x751919['contact']['lastName']||'')};if(_0x922e28['body'][_0xe426('0xa9')]&&_0x922e28[_0xe426('0x4b')][_0xe426('0xaf')]&&_0x922e28['body'][_0xe426('0xa9')]!=_0x922e28['body'][_0xe426('0xaf')]){_0xf8d0cd[_0xe426('0xa9')]=_0x922e28[_0xe426('0x4b')]['messageId'];}return _0x1b8726['update'](_0xf8d0cd);}else{return _0x1b8726;}}})[_0xe426('0x17')](function(_0x2d7ac6){_0x751919['interaction']=_0x2d7ac6[_0xe426('0x4c')]({'plain':!![]});_0x751919[_0xe426('0xac')][_0xe426('0xb0')]=_0x5618ec;if(_0x751919[_0xe426('0xac')][_0xe426('0xb0')]){if(_0x751919[_0xe426('0x91')][_0xe426('0xb1')]){_0x751919[_0xe426('0x93')]['push']({'id':0x0,'priority':_0x751919['applications'][_0xe426('0x48')]+0x1,'app':'close','appdata':_0xe426('0xb2'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x922e28[_0xe426('0x4b')][_0xe426('0x4b')],'ChatWebsiteId':_0x922e28[_0xe426('0x47')]['id'],'ChatInteractionId':_0x2d7ac6['id'],'direction':'in','ContactId':_0x751919['contact']['id'],'AttachmentId':_0x922e28[_0xe426('0x4b')][_0xe426('0xb3')]});})[_0xe426('0x17')](function(_0x4ebe54){_0x751919['message']=_0x4ebe54;if(_0x751919[_0xe426('0xac')][_0xe426('0xb4')]){return db[_0xe426('0xb5')][_0xe426('0x49')]({'attributes':['id',_0xe426('0x2b')],'where':{'id':_0x751919['interaction'][_0xe426('0xb4')]}})[_0xe426('0x17')](function(_0x4d0cc4){if(_0x4d0cc4){_0x751919[_0xe426('0x93')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe426('0xb6'),'appdata':_0x4d0cc4[_0xe426('0x2b')]+','+(_0x751919[_0xe426('0x91')][_0xe426('0xb7')]||0xa),'interval':'*,*,*,*'});_0x751919[_0xe426('0xb8')]=!![];}return respondWithRpcPromise(_0xe426('0xb9'),_0xe426('0xba'),_0x751919);});}return respondWithRpcPromise('Start',_0xe426('0xba'),_0x751919);})[_0xe426('0x17')](function(_0x232c32){respondWithRpcPromise('EventManager',_0xe426('0xbb'),{'event':_0xe426('0x78'),'message':_0x232c32},client9002);return _0x232c32;})[_0xe426('0x17')](respondWithResult(_0x30d0c7,null))[_0xe426('0x20')](handleError(_0x30d0c7,null));};exports[_0xe426('0xbc')]=function(_0x48af6c,_0x2bb0c1){var _0x1f769e,_0xc28a0c,_0x24cf7f;var _0x2d00a6=[];var _0x7e1f28={};var _0xc8340=_0x48af6c['files']||[];var _0x43b14a=[];var _0x3602df;return db[_0xe426('0x7d')][_0xe426('0x54')]()['then'](function(_0x1a9c3d){if(!_0x1a9c3d){throw new db['Sequelize'][(_0xe426('0x7f'))](_0xe426('0x80'));}_0x2d00a6=_[_0xe426('0x81')](_[_0xe426('0x36')](_0x1a9c3d),[_0xe426('0x82'),_0xe426('0x83'),_0xe426('0x84'),_0xe426('0x85')]);if(_0x48af6c[_0xe426('0x4b')]['id']){delete _0x48af6c['body']['id'];}if(_[_0xe426('0x6f')](_0x48af6c['body']['from'])){throw _0x2bb0c1['status'](0x1f4)[_0xe426('0x2c')](new db[(_0xe426('0x7e'))][(_0xe426('0x7f'))](_0xe426('0x87')));}if(_['isNil'](_0x48af6c['body'][_0xe426('0x4b')])||_0x48af6c[_0xe426('0x4b')][_0xe426('0x4b')]===''){throw _0x2bb0c1[_0xe426('0x22')](0x1f4)[_0xe426('0x2c')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xe426('0x6f')](_0x48af6c[_0xe426('0x4b')][_0xe426('0xbd')])){throw _0x2bb0c1[_0xe426('0x22')](0x1f4)[_0xe426('0x2c')](new db['Sequelize']['ValidationError'](_0xe426('0xbe')+_0x2d00a6));}if(!_[_0xe426('0x8b')](_0x2d00a6,_0x48af6c[_0xe426('0x4b')]['mapKeyOffline'])){throw _0x2bb0c1['status'](0x1f4)['send'](new db[(_0xe426('0x7e'))][(_0xe426('0x7f'))](_0xe426('0xbf')+_0x2d00a6));}_0x7e1f28[_0x48af6c[_0xe426('0x4b')][_0xe426('0xbd')]]=_0x48af6c[_0xe426('0x4b')][_0xe426('0x86')];})[_0xe426('0x17')](function(){return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x48af6c[_0xe426('0x47')]['id']},'include':[{'model':db[_0xe426('0x8d')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xe426('0x17')](handleEntityNotFound(_0x2bb0c1,null))[_0xe426('0x17')](function(_0x17864b){if(_0x17864b&&_0x17864b[_0xe426('0x8e')]){_0xc28a0c=_0x17864b;var _0x1fe58a=_['defaults'](_0x48af6c[_0xe426('0x4b')],{'firstName':_0x48af6c['body'][_0xe426('0x86')],'phone':_0x48af6c[_0xe426('0x4b')]['from'],'ListId':_0x17864b[_0xe426('0x85')]});_0x1fe58a[_0x48af6c[_0xe426('0x4b')][_0xe426('0xbd')]]=_0x48af6c[_0xe426('0x4b')][_0xe426('0x86')];return db[_0xe426('0x7d')][_0xe426('0xc0')]({'where':_0x7e1f28,'defaults':_0x1fe58a});}})[_0xe426('0xad')](function(_0x2664fb){if(_0x2664fb){_0x24cf7f=_0x2664fb;var _0x413672=fs[_0xe426('0xc1')](path[_0xe426('0x6a')](config['root'],_0xe426('0xc2')),'utf8');var _0x44216d=ejs[_0xe426('0xc3')](_0x413672,{'body':_[_0xe426('0xc4')](_0x48af6c[_0xe426('0x4b')][_0xe426('0x4b')]),'bodyTitle':_0xc28a0c[_0xe426('0xc5')]});return db[_0xe426('0xc6')][_0xe426('0x4a')]({'body':_0x44216d,'plainBody':htmlToText[_0xe426('0xc7')](_0x44216d),'ContactId':_0x2664fb['id'],'ChatWebsiteId':_0xc28a0c['id']});}})[_0xe426('0x17')](function(_0x229824){_0x3602df=_0x229824;if(_0xc8340[_0xe426('0x48')]){var _0x2db419=_0xc8340[_0xe426('0x2f')](function(_0x1baac3){return{'name':_0x1baac3['originalname'],'basename':_0x1baac3[_0xe426('0x63')],'type':_0x1baac3['mimetype'],'ChatOfflineMessageId':_0x229824['id']};});_0x43b14a=_0x2db419[_0xe426('0x2f')](_0x2dbcb2=>{var _0x4b6ed6={'filename':_0x2dbcb2[_0xe426('0x2b')],'path':path[_0xe426('0x6a')](config[_0xe426('0x6b')],'server',_0xe426('0xc8'),_0xe426('0xc9'),_0xe426('0xca'),_0x2dbcb2[_0xe426('0xcb')])};return _0x4b6ed6;});if(!_0xc28a0c['openNewInteraction']){return db[_0xe426('0xcc')][_0xe426('0xcd')](function(_0xb8484a){return db[_0xe426('0xce')]['bulkCreate'](_0x2db419,{'transaction':_0xb8484a});});}}})[_0xe426('0x17')](function(){if(_0x3602df){_0x1f769e=_0x3602df;return db[_0xe426('0xcf')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe426('0xd0')],'as':_0xe426('0xd1'),'raw':!![],'include':[{'model':db[_0xe426('0xd2')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xe426('0x17')](function(_0x3e35f9){if(_0x3e35f9&&_0x3e35f9[_0xe426('0xd1')]&&_0xc28a0c[_0xe426('0xd3')]&&_0xc28a0c[_0xe426('0xd4')]){var _0x2de72a=_0x3e35f9[_0xe426('0xd5')]();return respondWithRpcPromise('SendMail',_0xe426('0xd6'),{'account':_0x2de72a,'message':{'from':util[_0xe426('0xa4')](_0xe426('0xd7'),_0x3e35f9['name'],_0x3e35f9[_0xe426('0xd8')]||_0x3e35f9[_0xe426('0xd1')][_0xe426('0x4f')]),'to':_0xc28a0c[_0xe426('0xd4')],'subject':_0xc28a0c['offlineMessageSubject'],'html':_0x1f769e[_0xe426('0x4b')],'attachments':_0x43b14a}},client9003)[_0xe426('0x17')](function(){return _0x1f769e;})[_0xe426('0x20')](function(_0x2dda46){logger[_0xe426('0x1c')](_0x2dda46);});}})[_0xe426('0x17')](function(){if(_0xc28a0c&&_0xc28a0c[_0xe426('0xd9')]&&_0xc28a0c['MailAccountId']){var _0xeddf87=[];if(_0xc8340['length']){_0xeddf87=_0xc8340[_0xe426('0x2f')](function(_0x2ca6b1){return{'name':_0x2ca6b1['originalname'],'basename':_0x2ca6b1[_0xe426('0x63')],'type':_0x2ca6b1[_0xe426('0xda')],'ChatOfflineMessageId':_0x3602df['id']};});}var _0x290f15;if(!_[_0xe426('0x6f')](_0xc28a0c['subjectOffline'])){var _0x36c49e=_['map'](_0x48af6c[_0xe426('0x4b')],function(_0x2b268d){return _0x2b268d;});var _0x1f3d74=_['toPairsIn'](_0x36c49e)[0x0];var _0x1a245e=_[_0xe426('0xdb')](_0x1f3d74,function(_0x27a73f){return _0x27a73f;});_0x290f15=_0x1a245e[0x1][_0xc28a0c[_0xe426('0xdc')]];}var _0x4256ef={'from':_0x24cf7f[_0xe426('0xd8')],'firstName':_0x24cf7f[_0xe426('0x9c')],'lastName':_0x24cf7f[_0xe426('0x9d')],'mapKey':'email','message':{'from':_0x24cf7f[_0xe426('0xd8')],'to':_0xc28a0c[_0xe426('0xcf')][_0xe426('0xd8')],'cc':'','subject':_['isNil'](_0x290f15)?_0xc28a0c['offlineMessageSubject']:_0x290f15,'messageId':'','sentAt':new Date(),'attach':_0xeddf87[_0xe426('0x48')],'attachments':_0xeddf87,'originChannel':_0xe426('0xdd'),'ChatWebsiteId':_0xc28a0c['id'],'ChatOfflineMessageId':_0x1f769e['id'],'originTo':_0xc28a0c['MailAccount']['email']},'body':_0x1f769e[_0xe426('0x4b')]};var _0x373bd0={'account':{'id':_0xc28a0c['MailAccountId']},'body':_0x4256ef,'log':_0xe426('0xde')};return respondWithRpcPromise('NotifyMailAccount',_0xe426('0xdf'),_0x373bd0,client9001)[_0xe426('0x17')](function(){return _0x1f769e;})[_0xe426('0x20')](function(_0x582450){logger[_0xe426('0x1c')](_0x582450);});}return;})['then'](function(){if(_0x1f769e){return _0x1f769e;}})[_0xe426('0x17')](respondWithResult(_0x2bb0c1,null))[_0xe426('0x20')](function(_0xe9c092){logger[_0xe426('0x1c')](_0xe426('0x20'),_0xe9c092);for(var _0x5edb84 of _0xc8340){var _0x36d29c=path[_0xe426('0x6a')](config['root'],_0xe426('0xe0'),_0xe426('0xc8'),_0xe426('0xc9'),_0xe426('0xca'),_0x5edb84[_0xe426('0x63')]);fs_extra[_0xe426('0xe1')](_0x36d29c)['catch'](function(_0x2c02e0){logger[_0xe426('0x1c')](_0xe426('0xe2'),_0x36d29c,_0x2c02e0);});}});};exports['addInteraction']=function(_0x3d9931,_0x1479e2){return db[_0xe426('0xaa')]['find']({'where':{'id':_0x3d9931[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x1479e2,null))['then'](function(_0x47c191){if(_0x47c191){return _0x47c191[_0xe426('0xe3')](_0x3d9931[_0xe426('0x4b')]['ids'],_['omit'](_0x3d9931[_0xe426('0x4b')],[_0xe426('0x60'),'id'])||{});}})[_0xe426('0x17')](respondWithResult(_0x1479e2,null))[_0xe426('0x20')](handleError(_0x1479e2,null));};exports[_0xe426('0xe4')]=function(_0x4e204a,_0x140867){var _0x1ee551={'raw':![],'where':{}};var _0x3e3118={};var _0x11a219={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xe426('0x57')]({'where':{'id':_0x4e204a[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x140867,null))[_0xe426('0x17')](function(_0x30bce2){if(_0x30bce2){_0x3e3118['model']=_[_0xe426('0x36')](db[_0xe426('0xaa')]['rawAttributes']);_0x3e3118[_0xe426('0x35')]=_[_0xe426('0x36')](_0x4e204a[_0xe426('0x35')]);_0x3e3118['filters']=_['intersection'](_0x3e3118[_0xe426('0x34')],_0x3e3118['query']);_0x1ee551[_0xe426('0x39')]=_['intersection'](_0x3e3118[_0xe426('0x34')],qs[_0xe426('0x3a')](_0x4e204a[_0xe426('0x35')][_0xe426('0x3a')]));_0x1ee551[_0xe426('0x39')]=_0x1ee551[_0xe426('0x39')]['length']?_0x1ee551[_0xe426('0x39')]:_0x3e3118[_0xe426('0x34')];if(!_0x4e204a[_0xe426('0x35')]['hasOwnProperty'](_0xe426('0x3b'))){_0x1ee551['limit']=qs[_0xe426('0x3c')](_0x4e204a[_0xe426('0x35')][_0xe426('0x3c')]);_0x1ee551['offset']=qs[_0xe426('0x25')](_0x4e204a[_0xe426('0x35')]['offset']);}_0x1ee551[_0xe426('0x3d')]=qs[_0xe426('0x3e')](_0x4e204a[_0xe426('0x35')][_0xe426('0x3e')]);_0x1ee551[_0xe426('0x40')]=qs[_0xe426('0x37')](_['pick'](_0x4e204a['query'],_0x3e3118[_0xe426('0x37')]));_0x1ee551[_0xe426('0x40')][_0xe426('0x55')]=_0x30bce2['id'];if(_0x4e204a[_0xe426('0x35')][_0xe426('0x43')]){_0x1ee551['where']=_[_0xe426('0x41')](_0x1ee551[_0xe426('0x40')],{'$or':_['map'](_0x1ee551[_0xe426('0x39')],function(_0x197e70){var _0xb04408={};_0xb04408[_0x197e70]={'$like':'%'+_0x4e204a[_0xe426('0x35')][_0xe426('0x43')]+'%'};return _0xb04408;})});}_0x1ee551=_[_0xe426('0x41')]({},_0x1ee551,_0x4e204a[_0xe426('0x58')]);return db[_0xe426('0xaa')]['count']({'where':_0x1ee551[_0xe426('0x40')]})['then'](function(_0x1e9202){_0x11a219['count']=_0x1e9202;if(_0x4e204a[_0xe426('0x35')][_0xe426('0x44')]){_0x1ee551['include']=[{'model':db[_0xe426('0x7d')],'as':_0xe426('0xe5'),'required':![]},{'model':db['User'],'as':_0xe426('0xe6'),'attributes':[_0xe426('0x2b'),_0xe426('0xe7'),_0xe426('0xe8')],'required':![]},{'model':db[_0xe426('0xe9')],'as':_0xe426('0xea'),'attributes':['id',_0xe426('0x2b'),_0xe426('0xeb')],'where':_0x4e204a[_0xe426('0x35')][_0xe426('0xec')]?{'id':_0x4e204a[_0xe426('0x35')]['tag']}:undefined,'required':_0x4e204a[_0xe426('0x35')][_0xe426('0xec')]?!![]:![]}];}return db[_0xe426('0xaa')]['findAll'](_0x1ee551);})['then'](function(_0x26fa7d){_0x11a219[_0xe426('0x45')]=_0x26fa7d;return _0x11a219;});}})[_0xe426('0x17')](respondWithFilteredResult(_0x140867,_0x1ee551))['catch'](handleError(_0x140867,null));};function iftimePromise(_0xe55103,_0x5639b9){return respondWithRpcPromise(_0xe426('0xed'),'getSnippet',{'command':_0x5639b9[_0xe426('0xee')]?util['format'](_0xe426('0xef'),_0xe55103[_0xe426('0xf0')],_0x5639b9['timezone']):util[_0xe426('0xa4')](_0xe426('0xf1'),_0xe55103[_0xe426('0xf0')])},client9002)[_0xe426('0x17')](function(_0x5f0496){var _0x53be1d=_0x5f0496&&_0x5f0496[_0xe426('0xf2')](_0xe426('0xf3'))>=0x0?!![]:![];logger[_0xe426('0x1e')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5639b9['id'],_0xe55103['id'],_0xe55103[_0xe426('0xf0')],_0x53be1d?_0xe426('0xf4'):_0xe426('0xf5'),_0x5639b9[_0xe426('0xee')]?_0x5639b9[_0xe426('0xee')]:_0xe426('0xf6'));return _0x53be1d;})[_0xe426('0x20')](function(_0x5378ab){logger[_0xe426('0x1c')](_0xe426('0xf7'),_0x5639b9['id'],_0xe55103['id'],_0xe55103['interval'],util[_0xe426('0xf8')](_0x5378ab,{'showHidden':![],'depth':null}),_0x5639b9[_0xe426('0xee')]?_0x5639b9['timezone']:_0xe426('0xf6'));return![];});}exports['getSnippet']=function(_0x1cd7fa,_0xb91145){var _0x26a003=0x0;var _0x4a2f59=0x0;var _0x342ac4=![];var _0x17ac63;var _0x5b6cff;return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x1cd7fa['params']['id']},'include':[{'model':db[_0xe426('0xf9')],'as':_0xe426('0xf9'),'include':[{'model':db[_0xe426('0xf9')],'as':_0xe426('0xfa'),'attributes':['id',_0xe426('0xf0')],'raw':!![]}]}]})[_0xe426('0x17')](handleEntityNotFound(_0xb91145,null))[_0xe426('0x17')](function(_0x4f4dcd){if(_0x4f4dcd){_0x17ac63=_0x4f4dcd;return _0x4f4dcd[_0xe426('0xfb')]({'raw':!![]});}})[_0xe426('0x17')](function(_0x4a7a88){if(_0x17ac63){if(_0x4a7a88){_0x5b6cff=_0x4a7a88;}}return require('../../config/license/util')[_0xe426('0x6d')]();})['then'](function(_0x7b96d0){if(_0x7b96d0){_0x4a2f59=_0x7b96d0[_0xe426('0xfc')];_0x342ac4=_0x7b96d0['custom'];}})['then'](function(){return db[_0xe426('0xaa')][_0xe426('0x27')]({'where':{'closed':![]}});})[_0xe426('0x17')](function(_0x44f0c1){_0x26a003=_0x44f0c1;if(_0x4a2f59&&_0x44f0c1>_0x4a2f59){return db[_0xe426('0xfd')][_0xe426('0x57')]({'where':{'id':0x1}})['then'](function(_0x3a9eec){if(_0x3a9eec){_0x3a9eec[_0xe426('0xfe')](_0xe426('0xff'));}});}})[_0xe426('0x17')](function(){if(_0x17ac63[_0xe426('0xf9')]&&_0x17ac63[_0xe426('0xf9')]['Intervals']){var _0x3cfaf4=[];for(var _0x37f73f=0x0;_0x37f73f<_0x17ac63[_0xe426('0xf9')][_0xe426('0xfa')]['length'];_0x37f73f++){var _0x1d8649=_0x17ac63['Interval'][_0xe426('0xfa')][_0x37f73f]['get']({'plain':!![]});_0x3cfaf4['push'](iftimePromise(_0x1d8649,_0x17ac63));}return BPromise[_0xe426('0x100')](_0x3cfaf4)['then'](function(_0x2228cf){return _[_0xe426('0x101')](_0x2228cf);});}else{return!![];}})[_0xe426('0x17')](function(_0x4c029d){var _0x192f79=fs[_0xe426('0xc1')](path[_0xe426('0x6a')](config[_0xe426('0x6b')],_0xe426('0x102')),_0xe426('0x103'));var _0x26a96a=new url[(_0xe426('0x104'))](_0x17ac63['address'])['origin'];var _0xe7579e=_0xe426('0x105');var _0x4840f7=![];var _0x2a02f4={'chatVersion':_0xe7579e,'chatWebsiteAddressOrigin':_0x26a96a,'remote':_0x17ac63[_0xe426('0x106')],'query':querystring['stringify'](_['merge'](_0x17ac63[_0xe426('0x4c')]({'plain':!![]}),{'customerIp':_0x1cd7fa[_0xe426('0x79')][_0xe426('0x99')]||_0x1cd7fa['headers']['x-real-ip']||_0x1cd7fa[_0xe426('0x107')][_0xe426('0x108')]||_0x1cd7fa['ip'],'referer':_0x1cd7fa[_0xe426('0x79')]['referer'],'openedInteractions':_0x26a003,'maxInteractions':_0x4a2f59,'virtual':_0x342ac4[_0xe426('0xfc')],'online':_0x4c029d,'custom':_0x342ac4}))['replace'](/'/g,'\x5c\x27')};_0xb91145[_0xe426('0x2c')](ejs[_0xe426('0xc3')](Mustache['render'](_0x192f79,_0x2a02f4),{'proactiveActions':_0x5b6cff,'alignment':_0x17ac63[_0xe426('0x109')],'verticalAlignment':_0x17ac63[_0xe426('0x10a')],'div_color':_0x17ac63['color'],'labelText':_0x17ac63[_0xe426('0x10b')],'text_color':_0x17ac63['textColor'],'text_button_color':_0x17ac63[_0xe426('0x10c')],'button_color':_0x17ac63['color_button'],'background_color':_0x17ac63[_0xe426('0x10d')],'hideWhenOffline':_0x17ac63[_0xe426('0x10e')],'intervalId':_0x17ac63[_0xe426('0x10f')],'isDevelopment':_0x4840f7,'chatVersion':_0xe7579e}));})['catch'](handleError(_0xb91145,null));};exports[_0xe426('0x110')]=function(_0x5368d5,_0x38f847){var _0x29b950=_0x5368d5[_0xe426('0x47')]['id'];var _0x482b1e=_0x5368d5[_0xe426('0x4b')];var _0x3d8fa9=0xc8;var _0x2846b2=null;return db['sequelize'][_0xe426('0xcd')]({'isolationLevel':db[_0xe426('0xcc')][_0xe426('0x111')][_0xe426('0x112')]['READ_COMMITTED']},function(_0x47a7fe){return db[_0xe426('0x30')][_0xe426('0x57')]({'where':{'id':_0x29b950},'transaction':_0x47a7fe})[_0xe426('0x17')](function(_0x97c875){if(_0x97c875){return db['ChatApplication'][_0xe426('0x113')]({'where':{'ChatWebsiteId':_0x29b950},'transaction':_0x47a7fe})['then'](function(){var _0x1b7e30=_[_0xe426('0x2f')](_0x482b1e,function(_0x587f6e){_0x587f6e[_0xe426('0x55')]=_0x29b950;return _0x587f6e;});return db[_0xe426('0x90')][_0xe426('0x114')](_0x1b7e30,{'transaction':_0x47a7fe});});}else{_0x3d8fa9=0x194;_0x2846b2=[];}});})[_0xe426('0x17')](function(){if(_0x3d8fa9!==0x194){return db[_0xe426('0x90')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x29b950},'order':_0xe426('0x94')})[_0xe426('0x17')](function(_0x2e9bc8){_0x2846b2=_0x2e9bc8;});}})[_0xe426('0x20')](function(_0x452bf2){_0x3d8fa9=0x1f4;logger[_0xe426('0x1c')](_0x452bf2[_0xe426('0x115')]);if(_0x452bf2['name']){delete _0x452bf2[_0xe426('0x2b')];}_0x2846b2=_0x452bf2;})[_0xe426('0x116')](function(){if(_0x2846b2===null){_0x38f847['sendStatus'](_0x3d8fa9);}else{if(_0x3d8fa9===0x1f4){_0x38f847[_0xe426('0x22')](_0x3d8fa9)[_0xe426('0x2c')](_0x2846b2);}else{_0x38f847[_0xe426('0x22')](_0x3d8fa9)['json'](_0x2846b2);}}});};exports[_0xe426('0x117')]=function(_0x2f0c58,_0x16d1af){var _0x3da150={};var _0x4b73da={};var _0x2be093;var _0x1ea724;return db['ChatWebsite'][_0xe426('0x57')]({'where':{'id':_0x2f0c58['params']['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x16d1af,null))[_0xe426('0x17')](function(_0x26bc6b){if(_0x26bc6b){_0x2be093=_0x26bc6b;_0x4b73da['model']=_[_0xe426('0x36')](db['ChatApplication'][_0xe426('0x31')]);_0x4b73da['query']=_[_0xe426('0x36')](_0x2f0c58[_0xe426('0x35')]);_0x4b73da[_0xe426('0x37')]=_['intersection'](_0x4b73da[_0xe426('0x34')],_0x4b73da[_0xe426('0x35')]);_0x3da150[_0xe426('0x39')]=_[_0xe426('0x38')](_0x4b73da[_0xe426('0x34')],qs[_0xe426('0x3a')](_0x2f0c58['query'][_0xe426('0x3a')]));_0x3da150['attributes']=_0x3da150['attributes']['length']?_0x3da150[_0xe426('0x39')]:_0x4b73da['model'];_0x3da150[_0xe426('0x3d')]=qs[_0xe426('0x3e')](_0x2f0c58[_0xe426('0x35')]['sort']);_0x3da150[_0xe426('0x40')]=qs[_0xe426('0x37')](_[_0xe426('0x3f')](_0x2f0c58['query'],_0x4b73da['filters']));if(_0x2f0c58[_0xe426('0x35')]['filter']){_0x3da150[_0xe426('0x40')]=_[_0xe426('0x41')](_0x3da150[_0xe426('0x40')],{'$or':_[_0xe426('0x2f')](_0x3da150[_0xe426('0x39')],function(_0x1ce007){var _0x288e1c={};_0x288e1c[_0x1ce007]={'$like':'%'+_0x2f0c58['query'][_0xe426('0x43')]+'%'};return _0x288e1c;})});}_0x3da150=_[_0xe426('0x41')]({},_0x3da150,_0x2f0c58[_0xe426('0x58')]);return _0x2be093[_0xe426('0x117')](_0x3da150);}})[_0xe426('0x17')](function(_0x49a551){if(_0x49a551){_0x1ea724=_0x49a551[_0xe426('0x48')];if(!_0x2f0c58[_0xe426('0x35')][_0xe426('0x5d')](_0xe426('0x3b'))){_0x3da150[_0xe426('0x3c')]=qs[_0xe426('0x3c')](_0x2f0c58[_0xe426('0x35')]['limit']);_0x3da150[_0xe426('0x25')]=qs[_0xe426('0x25')](_0x2f0c58[_0xe426('0x35')][_0xe426('0x25')]);}return _0x2be093['getApplications'](_0x3da150);}})[_0xe426('0x17')](function(_0x533325){if(_0x533325){return _0x533325?{'count':_0x1ea724,'rows':_0x533325}:null;}})[_0xe426('0x17')](respondWithResult(_0x16d1af,null))[_0xe426('0x20')](handleError(_0x16d1af,null));};exports[_0xe426('0x118')]=function(_0x47a0e0,_0x1c43c7){return db[_0xe426('0x119')][_0xe426('0x49')]({'where':{'id':_0x47a0e0[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x1c43c7,null))[_0xe426('0x17')](function(_0x4aa808){if(_0x4aa808){return _0x4aa808[_0xe426('0x118')](_0x47a0e0[_0xe426('0x4b')][_0xe426('0x60')],_[_0xe426('0x11a')](_0x47a0e0[_0xe426('0x4b')],[_0xe426('0x60'),'id'])||{});}})[_0xe426('0x17')](respondWithResult(_0x1c43c7,null))[_0xe426('0x20')](handleError(_0x1c43c7,null));};exports[_0xe426('0xfb')]=function(_0x21da57,_0xb80bc7){var _0x224914={};var _0x129b7a={};var _0x3fd503;var _0x54dc09;return db[_0xe426('0x30')]['findOne']({'where':{'id':_0x21da57[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0xb80bc7,null))[_0xe426('0x17')](function(_0x597e56){if(_0x597e56){_0x3fd503=_0x597e56;_0x129b7a['model']=_[_0xe426('0x36')](db[_0xe426('0x11b')][_0xe426('0x31')]);_0x129b7a['query']=_['keys'](_0x21da57[_0xe426('0x35')]);_0x129b7a['filters']=_[_0xe426('0x38')](_0x129b7a[_0xe426('0x34')],_0x129b7a[_0xe426('0x35')]);_0x224914[_0xe426('0x39')]=_['intersection'](_0x129b7a['model'],qs['fields'](_0x21da57['query'][_0xe426('0x3a')]));_0x224914[_0xe426('0x39')]=_0x224914[_0xe426('0x39')][_0xe426('0x48')]?_0x224914[_0xe426('0x39')]:_0x129b7a[_0xe426('0x34')];_0x224914[_0xe426('0x3d')]=qs['sort'](_0x21da57['query'][_0xe426('0x3e')]);_0x224914[_0xe426('0x40')]=qs['filters'](_[_0xe426('0x3f')](_0x21da57[_0xe426('0x35')],_0x129b7a['filters']));if(_0x21da57[_0xe426('0x35')][_0xe426('0x43')]){_0x224914[_0xe426('0x40')]=_[_0xe426('0x41')](_0x224914[_0xe426('0x40')],{'$or':_[_0xe426('0x2f')](_0x224914[_0xe426('0x39')],function(_0x519656){var _0x2de78f={};_0x2de78f[_0x519656]={'$like':'%'+_0x21da57[_0xe426('0x35')][_0xe426('0x43')]+'%'};return _0x2de78f;})});}_0x224914=_[_0xe426('0x41')]({},_0x224914,_0x21da57[_0xe426('0x58')]);return _0x3fd503[_0xe426('0xfb')](_0x224914);}})[_0xe426('0x17')](function(_0x50cdcd){if(_0x50cdcd){_0x54dc09=_0x50cdcd[_0xe426('0x48')];if(!_0x21da57[_0xe426('0x35')]['hasOwnProperty'](_0xe426('0x3b'))){_0x224914[_0xe426('0x3c')]=qs[_0xe426('0x3c')](_0x21da57['query'][_0xe426('0x3c')]);_0x224914[_0xe426('0x25')]=qs['offset'](_0x21da57[_0xe426('0x35')][_0xe426('0x25')]);}return _0x3fd503['getProactiveActions'](_0x224914);}})[_0xe426('0x17')](function(_0x4d86b5){if(_0x4d86b5){return _0x4d86b5?{'count':_0x54dc09,'rows':_0x4d86b5}:null;}})[_0xe426('0x17')](respondWithResult(_0xb80bc7,null))[_0xe426('0x20')](handleError(_0xb80bc7,null));};exports[_0xe426('0x11c')]=function(_0x1fd656,_0x1910a2){var _0x3894c4=_0x1fd656[_0xe426('0x35')]['online']===_0xe426('0x11d')?_0xe426('0x11e'):'onlineForm';return db[_0xe426('0x30')][_0xe426('0x49')]({'attributes':['id',_0x3894c4],'where':{'id':_0x1fd656['params']['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x1910a2,null))[_0xe426('0x17')](function(_0x429f63){if(_0x429f63){var _0x23527f=_0x429f63[_0x3894c4];var _0x1b7b7c=_0x23527f&&_0x23527f['items']?_0x23527f['items']:[];_0x1910a2[_0xe426('0x2c')]({'fromKey':_[_0xe426('0x6f')](_0x23527f[_0xe426('0x11f')])?undefined:_0x23527f[_0xe426('0x11f')],'count':_0x1b7b7c[_0xe426('0x48')],'rows':_0x1b7b7c});}})[_0xe426('0x20')](handleError(_0x1910a2,null));};exports[_0xe426('0x120')]=function(_0x35ccb3,_0x5dbce1){var _0x403c83={'raw':![],'where':{}};var _0x310da6={};var _0x34f7d1={'count':0x0,'rows':[]};return db[_0xe426('0x30')][_0xe426('0x57')]({'where':{'id':_0x35ccb3[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x5dbce1,null))['then'](function(_0x18f545){if(_0x18f545){_0x310da6[_0xe426('0x34')]=_[_0xe426('0x36')](db['ChatOfflineMessage'][_0xe426('0x31')]);_0x310da6[_0xe426('0x35')]=_[_0xe426('0x36')](_0x35ccb3[_0xe426('0x35')]);_0x310da6[_0xe426('0x37')]=_[_0xe426('0x38')](_0x310da6[_0xe426('0x34')],_0x310da6['query']);_0x403c83[_0xe426('0x39')]=_['intersection'](_0x310da6[_0xe426('0x34')],qs[_0xe426('0x3a')](_0x35ccb3[_0xe426('0x35')][_0xe426('0x3a')]));_0x403c83[_0xe426('0x39')]=_0x403c83['attributes'][_0xe426('0x48')]?_0x403c83[_0xe426('0x39')]:_0x310da6[_0xe426('0x34')];if(!_0x35ccb3[_0xe426('0x35')][_0xe426('0x5d')]('nolimit')){_0x403c83[_0xe426('0x3c')]=qs[_0xe426('0x3c')](_0x35ccb3[_0xe426('0x35')][_0xe426('0x3c')]);_0x403c83['offset']=qs[_0xe426('0x25')](_0x35ccb3[_0xe426('0x35')][_0xe426('0x25')]);}_0x403c83[_0xe426('0x3d')]=qs['sort'](_0x35ccb3['query'][_0xe426('0x3e')]);_0x403c83['where']=qs['filters'](_[_0xe426('0x3f')](_0x35ccb3[_0xe426('0x35')],_0x310da6['filters']));_0x403c83[_0xe426('0x40')]['ChatWebsiteId']=_0x18f545['id'];if(_0x35ccb3[_0xe426('0x35')]['filter']){_0x403c83[_0xe426('0x40')]=_[_0xe426('0x41')](_0x403c83[_0xe426('0x40')],{'$or':_[_0xe426('0x2f')](_0x403c83[_0xe426('0x39')],function(_0x1e4f64){var _0x2494b6={};_0x2494b6[_0x1e4f64]={'$like':'%'+_0x35ccb3[_0xe426('0x35')][_0xe426('0x43')]+'%'};return _0x2494b6;})});}_0x403c83=_[_0xe426('0x41')]({},_0x403c83,_0x35ccb3[_0xe426('0x58')]);return db[_0xe426('0xc6')][_0xe426('0x27')]({'where':_0x403c83[_0xe426('0x40')]})[_0xe426('0x17')](function(_0x21e200){_0x34f7d1[_0xe426('0x27')]=_0x21e200;if(_0x35ccb3['query']['includeAll']){_0x403c83['include']=[{'all':!![]}];}else{_0x403c83[_0xe426('0x5e')]=[{'model':db[_0xe426('0x7d')],'as':_0xe426('0xe5'),'required':![]},{'model':db[_0xe426('0xce')],'as':'Attachments','required':![]}];}return db[_0xe426('0xc6')][_0xe426('0x59')](_0x403c83);})[_0xe426('0x17')](function(_0x7f3b72){_0x34f7d1[_0xe426('0x45')]=_0x7f3b72;return _0x34f7d1;});}})[_0xe426('0x17')](respondWithFilteredResult(_0x5dbce1,_0x403c83))['catch'](handleError(_0x5dbce1,null));};exports[_0xe426('0x121')]=function(_0x48a91d,_0x5ccaff){return db[_0xe426('0x30')][_0xe426('0x49')]({'where':{'id':_0x48a91d[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x5ccaff,null))['then'](function(_0x9634e3){if(_0x9634e3){return _0x9634e3[_0xe426('0x121')](_0x48a91d[_0xe426('0x4b')][_0xe426('0x60')],_[_0xe426('0x11a')](_0x48a91d['body'],[_0xe426('0x60'),'id'])||{})[_0xe426('0xad')](function(_0x1463e0){for(var _0x3d0418=0x0;_0x3d0418<_0x48a91d[_0xe426('0x4b')][_0xe426('0x60')]['length'];_0x3d0418+=0x1){socket[_0xe426('0x122')](_0xe426('0x123'),{'UserId':Number(_0x48a91d[_0xe426('0x4b')][_0xe426('0x60')][_0x3d0418]),'ChatWebsiteId':Number(_0x48a91d['params']['id'])});}return _0x1463e0;});}})['then'](respondWithResult(_0x5ccaff,null))[_0xe426('0x20')](handleError(_0x5ccaff,null));};exports[_0xe426('0x124')]=function(_0x9b3b0,_0x2dde1e){return db[_0xe426('0x30')]['find']({'where':{'id':_0x9b3b0[_0xe426('0x47')]['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x2dde1e,null))['then'](function(_0x230053){if(_0x230053){return _0x230053[_0xe426('0x124')](_0x9b3b0['query'][_0xe426('0x60')])[_0xe426('0x17')](function(){if(_[_0xe426('0x125')](_0x9b3b0[_0xe426('0x35')][_0xe426('0x60')])){for(var _0x346944=0x0;_0x346944<_0x9b3b0['query'][_0xe426('0x60')][_0xe426('0x48')];_0x346944+=0x1){socket[_0xe426('0x122')](_0xe426('0x126'),{'UserId':Number(_0x9b3b0[_0xe426('0x35')][_0xe426('0x60')][_0x346944]),'ChatWebsiteId':Number(_0x9b3b0['params']['id'])});}}else{socket['emit'](_0xe426('0x126'),{'UserId':Number(_0x9b3b0[_0xe426('0x35')][_0xe426('0x60')]),'ChatWebsiteId':Number(_0x9b3b0[_0xe426('0x47')]['id'])});}});}})[_0xe426('0x17')](respondWithStatusCode(_0x2dde1e,null))[_0xe426('0x20')](handleError(_0x2dde1e,null));};exports[_0xe426('0x127')]=function(_0x1c13d8,_0x3045db){var _0x27cb61={};var _0x1550d0={};var _0x4a968a;var _0x4e06e2;return db[_0xe426('0x30')][_0xe426('0x57')]({'where':{'id':_0x1c13d8['params']['id']}})[_0xe426('0x17')](handleEntityNotFound(_0x3045db,null))['then'](function(_0x251ba6){if(_0x251ba6){_0x4a968a=_0x251ba6;_0x1550d0[_0xe426('0x34')]=_[_0xe426('0x36')](db['User'][_0xe426('0x31')]);_0x1550d0[_0xe426('0x35')]=_[_0xe426('0x36')](_0x1c13d8[_0xe426('0x35')]);_0x1550d0[_0xe426('0x37')]=_[_0xe426('0x38')](_0x1550d0[_0xe426('0x34')],_0x1550d0[_0xe426('0x35')]);_0x27cb61['attributes']=_[_0xe426('0x38')](_0x1550d0[_0xe426('0x34')],qs['fields'](_0x1c13d8[_0xe426('0x35')][_0xe426('0x3a')]));_0x27cb61['attributes']=_0x27cb61[_0xe426('0x39')][_0xe426('0x48')]?_0x27cb61['attributes']:_0x1550d0[_0xe426('0x34')];_0x27cb61[_0xe426('0x3d')]=qs['sort'](_0x1c13d8[_0xe426('0x35')][_0xe426('0x3e')]);_0x27cb61[_0xe426('0x40')]=qs['filters'](_[_0xe426('0x3f')](_0x1c13d8[_0xe426('0x35')],_0x1550d0[_0xe426('0x37')]));if(_0x1c13d8[_0xe426('0x35')][_0xe426('0x43')]){_0x27cb61['where']=_[_0xe426('0x41')](_0x27cb61['where'],{'$or':_[_0xe426('0x2f')](_0x27cb61[_0xe426('0x39')],function(_0x1f7968){var _0x1202e6={};_0x1202e6[_0x1f7968]={'$like':'%'+_0x1c13d8[_0xe426('0x35')]['filter']+'%'};return _0x1202e6;})});}_0x27cb61=_[_0xe426('0x41')]({},_0x27cb61,_0x1c13d8[_0xe426('0x58')]);return _0x4a968a['getAgents'](_0x27cb61);}})['then'](function(_0x928504){if(_0x928504){_0x4e06e2=_0x928504['length'];if(!_0x1c13d8[_0xe426('0x35')]['hasOwnProperty'](_0xe426('0x3b'))){_0x27cb61[_0xe426('0x3c')]=qs[_0xe426('0x3c')](_0x1c13d8[_0xe426('0x35')][_0xe426('0x3c')]);_0x27cb61[_0xe426('0x25')]=qs[_0xe426('0x25')](_0x1c13d8[_0xe426('0x35')][_0xe426('0x25')]);}return _0x4a968a['getAgents'](_0x27cb61);}})[_0xe426('0x17')](function(_0x2c7361){if(_0x2c7361){return _0x2c7361?{'count':_0x4e06e2,'rows':_0x2c7361}:null;}})[_0xe426('0x17')](respondWithResult(_0x3045db,null))[_0xe426('0x20')](handleError(_0x3045db,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 11bce62..c3201ea 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x14634f,_0x5c3b5b){var _0x452ced=function(_0x35c771){while(--_0x35c771){_0x14634f['push'](_0x14634f['shift']());}};_0x452ced(++_0x5c3b5b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x7995('0x0'));var ChatWebsite=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){ChatWebsiteEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);ChatWebsiteEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];ChatWebsite[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xe599=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x29bc23,_0x470822){var _0x8116bf=function(_0x40df49){while(--_0x40df49){_0x29bc23['push'](_0x29bc23['shift']());}};_0x8116bf(++_0x470822);}(_0xe599,0x1e5));var _0x9e59=function(_0x4ca3d6,_0x48e3ae){_0x4ca3d6=_0x4ca3d6-0x0;var _0x117506=_0xe599[_0x4ca3d6];return _0x117506;};'use strict';var EventEmitter=require(_0x9e59('0x0'));var ChatWebsite=require(_0x9e59('0x1'))['db'][_0x9e59('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9e59('0x3')](0x0);var events={'afterCreate':_0x9e59('0x4'),'afterUpdate':_0x9e59('0x5'),'afterDestroy':_0x9e59('0x6')};function emitEvent(_0x296a98){return function(_0x3b40cc,_0x568c08,_0x156af6){ChatWebsiteEvents[_0x9e59('0x7')](_0x296a98+':'+_0x3b40cc['id'],_0x3b40cc);ChatWebsiteEvents['emit'](_0x296a98,_0x3b40cc);_0x156af6(null);};}for(var e in events){if(events[_0x9e59('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9e59('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index a5ab330..1a78889 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 _0x5d58=['define','ChatWebsite','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x56193b,_0x49a9c3){var _0x4624e8=function(_0xf05f89){while(--_0xf05f89){_0x56193b['push'](_0x56193b['shift']());}};_0x4624e8(++_0x49a9c3);}(_0x5d58,0x1ee));var _0x85d5=function(_0x46f5b6,_0x5064b4){_0x46f5b6=_0x46f5b6-0x0;var _0x54169b=_0x5d58[_0x46f5b6];return _0x54169b;};'use strict';var _=require(_0x85d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x85d5('0x1'));var moment=require(_0x85d5('0x2'));var BPromise=require(_0x85d5('0x3'));var rp=require(_0x85d5('0x4'));var fs=require('fs');var path=require(_0x85d5('0x5'));var rimraf=require(_0x85d5('0x6'));var config=require(_0x85d5('0x7'));var attributes=require(_0x85d5('0x8'));module[_0x85d5('0x9')]=function(_0x351e61,_0x3c9208){return _0x351e61[_0x85d5('0xa')](_0x85d5('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fe0=['ChatWebsite','chat_websites','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x553870,_0x247a0d){var _0x406fa4=function(_0x3ee467){while(--_0x3ee467){_0x553870['push'](_0x553870['shift']());}};_0x406fa4(++_0x247a0d);}(_0x9fe0,0x7b));var _0x09fe=function(_0x45ce62,_0x1b1631){_0x45ce62=_0x45ce62-0x0;var _0x2d5b0e=_0x9fe0[_0x45ce62];return _0x2d5b0e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x09fe('0x0'))(_0x09fe('0x1'));var moment=require(_0x09fe('0x2'));var BPromise=require(_0x09fe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x09fe('0x4'));var config=require(_0x09fe('0x5'));var attributes=require(_0x09fe('0x6'));module[_0x09fe('0x7')]=function(_0x5e2622,_0x202979){return _0x5e2622[_0x09fe('0x8')](_0x09fe('0x9'),attributes,{'tableName':_0x09fe('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 951383b..4f4dbbd 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 _0xb87f=['client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb87f,0x9b));var _0xfb87=function(_0x32751d,_0x4612d8){_0x32751d=_0x32751d-0x0;var _0x99f81f=_0xb87f[_0x32751d];return _0x99f81f;};'use strict';var _=require('lodash');var util=require(_0xfb87('0x0'));var moment=require(_0xfb87('0x1'));var BPromise=require('bluebird');var rs=require(_0xfb87('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb87('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb87('0x4'))(_0xfb87('0x5'));var config=require('../../config/environment');var jayson=require(_0xfb87('0x6'));var client=jayson[_0xfb87('0x7')][_0xfb87('0x8')]({'port':0x232a});config[_0xfb87('0x9')]=_[_0xfb87('0xa')](config[_0xfb87('0x9')],{'host':_0xfb87('0xb'),'port':0x18eb});var socket=require(_0xfb87('0xc'))(new Redis(config[_0xfb87('0x9')]));require(_0xfb87('0xd'))['register'](socket);function respondWithRpcPromise(_0x41e2d7,_0x13b611,_0x3cb6cb){return new BPromise(function(_0xd14f06,_0xe19f5a){return client[_0xfb87('0xe')](_0x41e2d7,_0x3cb6cb)[_0xfb87('0xf')](function(_0x3c9057){logger[_0xfb87('0x10')](_0xfb87('0x11'),_0x13b611,_0xfb87('0x12'));logger[_0xfb87('0x13')](_0xfb87('0x14'),_0x13b611,_0xfb87('0x12'),JSON[_0xfb87('0x15')](_0x3c9057));if(_0x3c9057[_0xfb87('0x16')]){if(_0x3c9057[_0xfb87('0x16')][_0xfb87('0x17')]===0x1f4){logger[_0xfb87('0x16')](_0xfb87('0x11'),_0x13b611,_0x3c9057[_0xfb87('0x16')][_0xfb87('0x18')]);return _0xe19f5a(_0x3c9057[_0xfb87('0x16')]['message']);}logger['error'](_0xfb87('0x11'),_0x13b611,_0x3c9057[_0xfb87('0x16')][_0xfb87('0x18')]);return _0xd14f06(_0x3c9057[_0xfb87('0x16')][_0xfb87('0x18')]);}else{logger[_0xfb87('0x10')](_0xfb87('0x11'),_0x13b611,_0xfb87('0x12'));_0xd14f06(_0x3c9057[_0xfb87('0x19')]['message']);}})[_0xfb87('0x1a')](function(_0x19a8b5){logger[_0xfb87('0x16')](_0xfb87('0x11'),_0x13b611,_0x19a8b5);_0xe19f5a(_0x19a8b5);});});}
\ No newline at end of file
+var _0x0df5=['rpc','jayson/promise','client','http','redis','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x48935f,_0x534032){var _0xc8e4c6=function(_0x5737b7){while(--_0x5737b7){_0x48935f['push'](_0x48935f['shift']());}};_0xc8e4c6(++_0x534032);}(_0x0df5,0xaf));var _0x50df=function(_0x1f8f0a,_0x52a210){_0x1f8f0a=_0x1f8f0a-0x0;var _0x5b32e4=_0x0df5[_0x1f8f0a];return _0x5b32e4;};'use strict';var _=require('lodash');var util=require(_0x50df('0x0'));var moment=require(_0x50df('0x1'));var BPromise=require(_0x50df('0x2'));var rs=require(_0x50df('0x3'));var fs=require('fs');var Redis=require(_0x50df('0x4'));var db=require(_0x50df('0x5'))['db'];var utils=require(_0x50df('0x6'));var logger=require('../../config/logger')(_0x50df('0x7'));var config=require('../../config/environment');var jayson=require(_0x50df('0x8'));var client=jayson[_0x50df('0x9')][_0x50df('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x50df('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x50df('0xc'))(new Redis(config[_0x50df('0xb')]));require(_0x50df('0xd'))[_0x50df('0xe')](socket);function respondWithRpcPromise(_0x4955df,_0x2a1e87,_0x33903d){return new BPromise(function(_0xf11104,_0x458f7c){return client[_0x50df('0xf')](_0x4955df,_0x33903d)[_0x50df('0x10')](function(_0x4e3f9a){logger[_0x50df('0x11')](_0x50df('0x12'),_0x2a1e87,'request\x20sent');logger[_0x50df('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2a1e87,'request\x20sent',JSON[_0x50df('0x14')](_0x4e3f9a));if(_0x4e3f9a[_0x50df('0x15')]){if(_0x4e3f9a[_0x50df('0x15')]['code']===0x1f4){logger[_0x50df('0x15')](_0x50df('0x12'),_0x2a1e87,_0x4e3f9a[_0x50df('0x15')][_0x50df('0x16')]);return _0x458f7c(_0x4e3f9a[_0x50df('0x15')][_0x50df('0x16')]);}logger[_0x50df('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x2a1e87,_0x4e3f9a[_0x50df('0x15')][_0x50df('0x16')]);return _0xf11104(_0x4e3f9a[_0x50df('0x15')]['message']);}else{logger['info'](_0x50df('0x12'),_0x2a1e87,_0x50df('0x17'));_0xf11104(_0x4e3f9a[_0x50df('0x18')][_0x50df('0x16')]);}})[_0x50df('0x19')](function(_0x1f0f71){logger[_0x50df('0x15')](_0x50df('0x12'),_0x2a1e87,_0x1f0f71);_0x458f7c(_0x1f0f71);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 58ccad9..cacb637 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 _0xe873=['remove','update','emit','removeListener','./chatWebsite.events','save'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0xe873,0xca));var _0x3e87=function(_0x44d63b,_0x32cfbb){_0x44d63b=_0x44d63b-0x0;var _0x9d72d5=_0xe873[_0x44d63b];return _0x9d72d5;};'use strict';var ChatWebsiteEvents=require(_0x3e87('0x0'));var events=[_0x3e87('0x1'),_0x3e87('0x2'),_0x3e87('0x3')];function createListener(_0x226eb8,_0x2a9c46){return function(_0x315c7){_0x2a9c46[_0x3e87('0x4')](_0x226eb8,_0x315c7);};}function removeListener(_0x341d1c,_0x203d87){return function(){ChatWebsiteEvents[_0x3e87('0x5')](_0x341d1c,_0x203d87);};}exports['register']=function(_0x21b0a6){for(var _0x19fafb=0x0,_0xb4e16f=events['length'];_0x19fafb<_0xb4e16f;_0x19fafb++){var _0x278ba1=events[_0x19fafb];var _0x44fb44=createListener('chatWebsite:'+_0x278ba1,_0x21b0a6);ChatWebsiteEvents['on'](_0x278ba1,_0x44fb44);}};
\ No newline at end of file
+var _0x5633=['chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register','length'];(function(_0x69555a,_0x5f0c36){var _0x5c9b69=function(_0xa4f5ff){while(--_0xa4f5ff){_0x69555a['push'](_0x69555a['shift']());}};_0x5c9b69(++_0x5f0c36);}(_0x5633,0x121));var _0x3563=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5633[_0x36eaaa];return _0x461349;};'use strict';var ChatWebsiteEvents=require(_0x3563('0x0'));var events=[_0x3563('0x1'),'remove',_0x3563('0x2')];function createListener(_0x4df85,_0x346bd0){return function(_0x4e229b){_0x346bd0[_0x3563('0x3')](_0x4df85,_0x4e229b);};}function removeListener(_0x237de0,_0x36f937){return function(){ChatWebsiteEvents[_0x3563('0x4')](_0x237de0,_0x36f937);};}exports[_0x3563('0x5')]=function(_0x2a6f2d){for(var _0x3c81c7=0x0,_0x4eb8e6=events[_0x3563('0x6')];_0x3c81c7<_0x4eb8e6;_0x3c81c7++){var _0xfb3507=events[_0x3c81c7];var _0x109dad=createListener(_0x3563('0x7')+_0xfb3507,_0x2a6f2d);ChatWebsiteEvents['on'](_0xfb3507,_0x109dad);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 42d1423..be54f05 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 _0x5cb2=['destroy','removeDispositions','exports','multer','util','path','express','Router','fs-extra','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','ensureDir','replace','extname','/:id/offline','addApplications','addProactiveActions','addAgents','update','delete'];(function(_0x311293,_0xbde3b9){var _0x1cdd56=function(_0x759066){while(--_0x759066){_0x311293['push'](_0x311293['shift']());}};_0x1cdd56(++_0xbde3b9);}(_0x5cb2,0x195));var _0x25cb=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x5cb2[_0x117f4c];return _0x2b24e9;};'use strict';var multer=require(_0x25cb('0x0'));var util=require(_0x25cb('0x1'));var path=require(_0x25cb('0x2'));var timeout=require('connect-timeout');var express=require(_0x25cb('0x3'));var router=express[_0x25cb('0x4')]();var fs_extra=require(_0x25cb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25cb('0x6'));router[_0x25cb('0x7')]('/',auth[_0x25cb('0x8')](),controller[_0x25cb('0x9')]);router[_0x25cb('0x7')](_0x25cb('0xa'),auth[_0x25cb('0x8')](),controller[_0x25cb('0xb')]);router['get'](_0x25cb('0xc'),auth[_0x25cb('0x8')](),controller['show']);router[_0x25cb('0x7')](_0x25cb('0xd'),auth[_0x25cb('0x8')](),controller[_0x25cb('0xe')]);router[_0x25cb('0x7')](_0x25cb('0xf'),auth['isAuthenticated'](),controller[_0x25cb('0x10')]);router['get'](_0x25cb('0x11'),controller[_0x25cb('0x12')]);router[_0x25cb('0x7')](_0x25cb('0x13'),controller[_0x25cb('0x14')]);router[_0x25cb('0x7')](_0x25cb('0x15'),controller[_0x25cb('0x16')]);router[_0x25cb('0x7')](_0x25cb('0x17'),controller[_0x25cb('0x18')]);router['get'](_0x25cb('0x19'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x25cb('0x7')](_0x25cb('0x1a'),controller[_0x25cb('0x1b')]);router[_0x25cb('0x7')](_0x25cb('0x1c'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x25cb('0x1d'),auth[_0x25cb('0x8')](),controller['getProactiveActions']);router[_0x25cb('0x7')](_0x25cb('0x1e'),controller[_0x25cb('0x1f')]);router['get'](_0x25cb('0x20'),auth[_0x25cb('0x8')](),controller['getOfflineMessages']);router[_0x25cb('0x7')](_0x25cb('0x21'),auth[_0x25cb('0x8')](),controller[_0x25cb('0x22')]);router[_0x25cb('0x23')]('/',auth[_0x25cb('0x8')](),controller[_0x25cb('0x24')]);router[_0x25cb('0x23')](_0x25cb('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x25cb('0x23')](_0x25cb('0xf'),auth[_0x25cb('0x8')](),controller[_0x25cb('0x25')]);var upload=multer({'storage':multer[_0x25cb('0x26')]({'destination':function(_0x1c90ed,_0x1d097a,_0x39c5cb){_0x39c5cb(null,path[_0x25cb('0x27')](config[_0x25cb('0x28')],'server/files/images/logos/'));},'filename':function(_0x2447e4,_0x371f99,_0x59ee00){_0x59ee00(null,util[_0x25cb('0x29')](_0x25cb('0x2a'),Date[_0x25cb('0x2b')](),_0x371f99[_0x25cb('0x2c')]));}})});router[_0x25cb('0x23')]('/:id/logo',upload[_0x25cb('0x2d')](_0x25cb('0x2e')),controller[_0x25cb('0x2f')]);var upload=multer({'storage':multer[_0x25cb('0x26')]({'destination':function(_0x3e0780,_0x396f7c,_0x3f16b0){_0x3f16b0(null,path[_0x25cb('0x27')](config[_0x25cb('0x28')],_0x25cb('0x30')));},'filename':function(_0x2a4cc7,_0x16a993,_0x455dfe){_0x455dfe(null,util[_0x25cb('0x29')]('%s-%s',Date[_0x25cb('0x2b')](),_0x16a993['originalname']));}})});router[_0x25cb('0x23')](_0x25cb('0x13'),upload[_0x25cb('0x2d')]('file'),controller[_0x25cb('0x31')]);var upload=multer({'storage':multer[_0x25cb('0x26')]({'destination':function(_0x1e6960,_0x368062,_0x2a0548){_0x2a0548(null,path[_0x25cb('0x27')](config[_0x25cb('0x28')],_0x25cb('0x30')));},'filename':function(_0xff5791,_0x40c103,_0x43b538){_0x43b538(null,util[_0x25cb('0x29')]('%s-%s',Date[_0x25cb('0x2b')](),_0x40c103['originalname']));}})});router['post'](_0x25cb('0x15'),upload['single'](_0x25cb('0x2e')),controller[_0x25cb('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x283eca,_0x4a531c,_0x23b98f){_0x23b98f(null,path[_0x25cb('0x27')](config['root'],_0x25cb('0x30')));},'filename':function(_0x36c153,_0x47a94e,_0x19c3f6){_0x19c3f6(null,util[_0x25cb('0x29')](_0x25cb('0x2a'),Date[_0x25cb('0x2b')](),_0x47a94e[_0x25cb('0x2c')]));}})});router[_0x25cb('0x23')](_0x25cb('0x17'),upload[_0x25cb('0x2d')](_0x25cb('0x2e')),controller[_0x25cb('0x33')]);router[_0x25cb('0x23')](_0x25cb('0x34'),controller[_0x25cb('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x25cb('0x26')]({'destination':function(_0x491127,_0x317ce9,_0x1e4abe){const _0x353686=path[_0x25cb('0x27')](config[_0x25cb('0x28')],_0x25cb('0x36'),'attachments','offline-chat');fs_extra[_0x25cb('0x37')](_0x353686,function(){_0x1e4abe(null,_0x353686);});},'filename':function(_0x49211c,_0x1b305d,_0x28514c){const _0x5d970c=_0x1b305d['originalname'][_0x25cb('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x577839=path[_0x25cb('0x39')](_0x5d970c);const _0x2f0694=Date[_0x25cb('0x2b')]()+'-'+_0x5d970c[_0x25cb('0x38')](_0x577839,'')+_0x577839;_0x28514c(null,_0x2f0694);}})});router[_0x25cb('0x23')](_0x25cb('0x3a'),offlineUploadMulter['any'](),controller['offline']);router[_0x25cb('0x23')](_0x25cb('0x19'),auth[_0x25cb('0x8')](),controller['addInteraction']);router['post'](_0x25cb('0x1c'),auth[_0x25cb('0x8')](),controller[_0x25cb('0x3b')]);router[_0x25cb('0x23')](_0x25cb('0x1d'),auth['isAuthenticated'](),controller[_0x25cb('0x3c')]);router[_0x25cb('0x23')](_0x25cb('0x21'),auth[_0x25cb('0x8')](),controller[_0x25cb('0x3d')]);router['put'](_0x25cb('0xc'),auth[_0x25cb('0x8')](),controller[_0x25cb('0x3e')]);router[_0x25cb('0x3f')](_0x25cb('0xc'),auth[_0x25cb('0x8')](),controller[_0x25cb('0x40')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x25cb('0x41')]);router['delete'](_0x25cb('0xf'),auth[_0x25cb('0x8')](),controller['removeAnswers']);router['delete'](_0x25cb('0x21'),auth[_0x25cb('0x8')](),controller['removeAgents']);module[_0x25cb('0x42')]=router;
\ No newline at end of file
+var _0xa4ef=['replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','file','addLogo','root','server/files/images/avatars/','now','single','addAvatar','originalname','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','offline-chat','ensureDir'];(function(_0x3cb4c7,_0xf4a50e){var _0x3c6060=function(_0xbea008){while(--_0xbea008){_0x3cb4c7['push'](_0x3cb4c7['shift']());}};_0x3c6060(++_0xf4a50e);}(_0xa4ef,0xee));var _0xfa4e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa4ef[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xfa4e('0x0'));var util=require(_0xfa4e('0x1'));var path=require(_0xfa4e('0x2'));var timeout=require(_0xfa4e('0x3'));var express=require(_0xfa4e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfa4e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa4e('0x6'));var controller=require(_0xfa4e('0x7'));router[_0xfa4e('0x8')]('/',auth[_0xfa4e('0x9')](),controller[_0xfa4e('0xa')]);router[_0xfa4e('0x8')](_0xfa4e('0xb'),auth[_0xfa4e('0x9')](),controller['describe']);router['get']('/:id',auth[_0xfa4e('0x9')](),controller[_0xfa4e('0xc')]);router[_0xfa4e('0x8')](_0xfa4e('0xd'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0xe')]);router[_0xfa4e('0x8')](_0xfa4e('0xf'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x10')]);router[_0xfa4e('0x8')](_0xfa4e('0x11'),controller[_0xfa4e('0x12')]);router[_0xfa4e('0x8')](_0xfa4e('0x13'),controller[_0xfa4e('0x14')]);router[_0xfa4e('0x8')]('/:id/customer_avatar',controller[_0xfa4e('0x15')]);router[_0xfa4e('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xfa4e('0x8')]('/:id/interactions',auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x16')]);router[_0xfa4e('0x8')](_0xfa4e('0x17'),controller[_0xfa4e('0x18')]);router['get']('/:id/applications',auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x19')]);router[_0xfa4e('0x8')](_0xfa4e('0x1a'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x1b')]);router[_0xfa4e('0x8')]('/:id/fields',controller[_0xfa4e('0x1c')]);router[_0xfa4e('0x8')](_0xfa4e('0x1d'),auth[_0xfa4e('0x9')](),controller['getOfflineMessages']);router[_0xfa4e('0x8')](_0xfa4e('0x1e'),auth[_0xfa4e('0x9')](),controller['getAgents']);router[_0xfa4e('0x1f')]('/',auth[_0xfa4e('0x9')](),controller['create']);router[_0xfa4e('0x1f')](_0xfa4e('0xd'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x20')]);router[_0xfa4e('0x1f')](_0xfa4e('0xf'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x21')]);var upload=multer({'storage':multer[_0xfa4e('0x22')]({'destination':function(_0x15d93d,_0x3d5837,_0x474078){_0x474078(null,path[_0xfa4e('0x23')](config['root'],_0xfa4e('0x24')));},'filename':function(_0x394678,_0x37a27f,_0xeef2c){_0xeef2c(null,util[_0xfa4e('0x25')](_0xfa4e('0x26'),Date['now'](),_0x37a27f['originalname']));}})});router[_0xfa4e('0x1f')](_0xfa4e('0x11'),upload['single'](_0xfa4e('0x27')),controller[_0xfa4e('0x28')]);var upload=multer({'storage':multer[_0xfa4e('0x22')]({'destination':function(_0xeeec03,_0x4bfdb0,_0x1e6b84){_0x1e6b84(null,path[_0xfa4e('0x23')](config[_0xfa4e('0x29')],_0xfa4e('0x2a')));},'filename':function(_0xa141a3,_0xea5d4f,_0x5cd3f8){_0x5cd3f8(null,util[_0xfa4e('0x25')]('%s-%s',Date[_0xfa4e('0x2b')](),_0xea5d4f['originalname']));}})});router[_0xfa4e('0x1f')](_0xfa4e('0x13'),upload[_0xfa4e('0x2c')](_0xfa4e('0x27')),controller[_0xfa4e('0x2d')]);var upload=multer({'storage':multer[_0xfa4e('0x22')]({'destination':function(_0x56c8f1,_0x39144d,_0x58d70b){_0x58d70b(null,path[_0xfa4e('0x23')](config[_0xfa4e('0x29')],_0xfa4e('0x2a')));},'filename':function(_0x2bb059,_0xcdb8a6,_0x252f06){_0x252f06(null,util[_0xfa4e('0x25')](_0xfa4e('0x26'),Date[_0xfa4e('0x2b')](),_0xcdb8a6[_0xfa4e('0x2e')]));}})});router[_0xfa4e('0x1f')](_0xfa4e('0x2f'),upload[_0xfa4e('0x2c')](_0xfa4e('0x27')),controller[_0xfa4e('0x30')]);var upload=multer({'storage':multer[_0xfa4e('0x22')]({'destination':function(_0x3df91a,_0x84b6c5,_0x44ea68){_0x44ea68(null,path[_0xfa4e('0x23')](config['root'],_0xfa4e('0x2a')));},'filename':function(_0x1f42ba,_0x4341fd,_0x309996){_0x309996(null,util['format'](_0xfa4e('0x26'),Date['now'](),_0x4341fd['originalname']));}})});router[_0xfa4e('0x1f')](_0xfa4e('0x31'),upload[_0xfa4e('0x2c')](_0xfa4e('0x27')),controller[_0xfa4e('0x32')]);router['post'](_0xfa4e('0x33'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x33906f,_0x3f2131,_0x3aaaaf){const _0x31888d=path[_0xfa4e('0x23')](config['root'],'server/files','attachments',_0xfa4e('0x34'));fs_extra[_0xfa4e('0x35')](_0x31888d,function(){_0x3aaaaf(null,_0x31888d);});},'filename':function(_0x2b0fdc,_0x4c0aad,_0x5f2035){const _0x4ae65e=_0x4c0aad['originalname'][_0xfa4e('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1f9113=path[_0xfa4e('0x37')](_0x4ae65e);const _0x7dfc64=Date['now']()+'-'+_0x4ae65e[_0xfa4e('0x36')](_0x1f9113,'')+_0x1f9113;_0x5f2035(null,_0x7dfc64);}})});router[_0xfa4e('0x1f')](_0xfa4e('0x38'),offlineUploadMulter[_0xfa4e('0x39')](),controller[_0xfa4e('0x3a')]);router[_0xfa4e('0x1f')](_0xfa4e('0x3b'),auth['isAuthenticated'](),controller[_0xfa4e('0x3c')]);router[_0xfa4e('0x1f')](_0xfa4e('0x3d'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x3e')]);router[_0xfa4e('0x1f')](_0xfa4e('0x1a'),auth['isAuthenticated'](),controller[_0xfa4e('0x3f')]);router['post'](_0xfa4e('0x1e'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x40')]);router[_0xfa4e('0x41')]('/:id',auth['isAuthenticated'](),controller[_0xfa4e('0x42')]);router[_0xfa4e('0x43')]('/:id',auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x44')]);router[_0xfa4e('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xfa4e('0x45')]);router['delete'](_0xfa4e('0xf'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x46')]);router['delete'](_0xfa4e('0x1e'),auth[_0xfa4e('0x9')](),controller[_0xfa4e('0x47')]);module[_0xfa4e('0x48')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 0c77f93..79a07a1 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 _0xebcc=['use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x542e59,_0x3a9b0f){var _0x6106e5=function(_0x3fdf41){while(--_0x3fdf41){_0x542e59['push'](_0x542e59['shift']());}};_0x6106e5(++_0x3a9b0f);}(_0xebcc,0xf3));var _0xcebc=function(_0x30ff7c,_0x4d51b5){_0x30ff7c=_0x30ff7c-0x0;var _0x5583c2=_0xebcc[_0x30ff7c];return _0x5583c2;};var beaverLogger=require(_0xcebc('0x0'));var express=require(_0xcebc('0x1'));var auth=require('../components/auth/service');var config=require(_0xcebc('0x2'));var router=express['Router']();var isProduction=config['env']===_0xcebc('0x3')||![];function clientSideLogs(_0x58f2f5,_0x305e7f,_0x2824d5){var _0x3c43c7=_0x58f2f5[_0xcebc('0x4')][_0xcebc('0x5')](_0xcebc('0x6'));if(!_0x3c43c7){throw new Error(_0xcebc('0x7'));}return beaverLogger[_0xcebc('0x8')]({'uri':'/client-logs','logger':_0x3c43c7,'enableCors':!isProduction})(_0x58f2f5,_0x305e7f,_0x2824d5);}router[_0xcebc('0x9')](auth[_0xcebc('0xa')](),clientSideLogs);module[_0xcebc('0xb')]=router;
\ No newline at end of file
+var _0x7920=['Client-Side\x20logger\x20not\x20found!','/client-logs','exports','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7920,0x19a));var _0x0792=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x7920[_0x1a36a5];return _0x746243;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x0792('0x0'));var config=require(_0x0792('0x1'));var router=express[_0x0792('0x2')]();var isProduction=config[_0x0792('0x3')]===_0x0792('0x4')||![];function clientSideLogs(_0xa82dc5,_0xe45935,_0x5d3a12){var _0x4d61f3=_0xa82dc5[_0x0792('0x5')][_0x0792('0x6')](_0x0792('0x7'));if(!_0x4d61f3){throw new Error(_0x0792('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x0792('0x9'),'logger':_0x4d61f3,'enableCors':!isProduction})(_0xa82dc5,_0xe45935,_0x5d3a12);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x0792('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 c43f106..71ac0d6 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 _0xddb8=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','AmazonAWS','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x34d2a0,_0x6cde4f){var _0x505c5b=function(_0x2130a3){while(--_0x2130a3){_0x34d2a0['push'](_0x34d2a0['shift']());}};_0x505c5b(++_0x6cde4f);}(_0xddb8,0x147));var _0x8ddb=function(_0x1bb553,_0x10c76a){_0x1bb553=_0x1bb553-0x0;var _0x207f64=_0xddb8[_0x1bb553];return _0x207f64;};'use strict';var Sequelize=require(_0x8ddb('0x0'));module['exports']={'name':{'type':Sequelize[_0x8ddb('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8ddb('0x2')](_0x8ddb('0x3'),_0x8ddb('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x8ddb('0x5'))},'data1':{'type':Sequelize[_0x8ddb('0x1')],'comment':_0x8ddb('0x6')},'data2':{'type':Sequelize[_0x8ddb('0x1')],'comment':_0x8ddb('0x7')},'data3':{'type':Sequelize[_0x8ddb('0x1')],'comment':_0x8ddb('0x8')},'data4':{'type':Sequelize[_0x8ddb('0x1')],'comment':_0x8ddb('0x9')},'data5':{'type':Sequelize[_0x8ddb('0xa')],'comment':_0x8ddb('0xb')},'data6':{'type':Sequelize[_0x8ddb('0xa')],'comment':_0x8ddb('0xc')},'data7':{'type':Sequelize[_0x8ddb('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x5502=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x1dbaf1,_0x16ae3b){var _0x3bcc08=function(_0x4ec701){while(--_0x4ec701){_0x1dbaf1['push'](_0x1dbaf1['shift']());}};_0x3bcc08(++_0x16ae3b);}(_0x5502,0x7b));var _0x2550=function(_0xb6cc07,_0x3ef661){_0xb6cc07=_0xb6cc07-0x0;var _0x5c8c21=_0x5502[_0xb6cc07];return _0x5c8c21;};'use strict';var Sequelize=require(_0x2550('0x0'));module[_0x2550('0x1')]={'name':{'type':Sequelize[_0x2550('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2550('0x3')](_0x2550('0x4'),_0x2550('0x5'),_0x2550('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2550('0x3')](_0x2550('0x7'),_0x2550('0x8'))},'data1':{'type':Sequelize[_0x2550('0x2')],'comment':_0x2550('0x9')},'data2':{'type':Sequelize[_0x2550('0x2')],'comment':_0x2550('0xa')},'data3':{'type':Sequelize[_0x2550('0x2')],'comment':_0x2550('0xb')},'data4':{'type':Sequelize[_0x2550('0x2')],'comment':_0x2550('0xc')},'data5':{'type':Sequelize[_0x2550('0xd')],'comment':_0x2550('0xe')},'data6':{'type':Sequelize[_0x2550('0xd')],'comment':_0x2550('0xf')},'data7':{'type':Sequelize['TEXT'],'comment':_0x2550('0x10')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b21be38..0c3a465 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 _0xb330=['offset','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','padEnd','slice','map','CloudProvider','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','includeAll','include','find','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','from','state','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','sendStatus','status','end'];(function(_0xaffc69,_0x4272a7){var _0x1bc6dd=function(_0x2ed754){while(--_0x2ed754){_0xaffc69['push'](_0xaffc69['shift']());}};_0x1bc6dd(++_0x4272a7);}(_0xb330,0xb1));var _0x0b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb330[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0b33('0x0'));var Redis=require(_0x0b33('0x1'));var qs=require(_0x0b33('0x2'));var encryptor=require(_0x0b33('0x3'));var config=require(_0x0b33('0x4'));var logger=require(_0x0b33('0x5'))('api');var db=require(_0x0b33('0x6'))['db'];var oauth=require(_0x0b33('0x7'));config[_0x0b33('0x8')]=_[_0x0b33('0x9')](config[_0x0b33('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x0b33('0x8')]);function respondWithStatusCode(_0x44335a,_0x244e80){_0x244e80=_0x244e80||0xcc;return function(_0xcfa4f9){if(_0xcfa4f9){return _0x44335a[_0x0b33('0xa')](_0x244e80);}return _0x44335a[_0x0b33('0xb')](_0x244e80)[_0x0b33('0xc')]();};}function respondWithResult(_0x220461,_0xacb5cd){_0xacb5cd=_0xacb5cd||0xc8;return function(_0x1a6d57){if(_0x1a6d57){return _0x220461['status'](_0xacb5cd)['json'](_0x1a6d57);}};}function respondWithFilteredResult(_0x158301,_0x4516ee){return function(_0x220bea){if(_0x220bea){var _0x4a0958=typeof _0x4516ee[_0x0b33('0xd')]===_0x0b33('0xe')&&typeof _0x4516ee['limit']==='undefined';var _0x576096=_0x220bea[_0x0b33('0xf')];var _0x315d5f=_0x4a0958?0x0:_0x4516ee[_0x0b33('0xd')];var _0x315b56=_0x4a0958?_0x220bea[_0x0b33('0xf')]:_0x4516ee[_0x0b33('0xd')]+_0x4516ee[_0x0b33('0x10')];var _0x4f3042;if(_0x315b56>=_0x576096){_0x315b56=_0x576096;_0x4f3042=0xc8;}else{_0x4f3042=0xce;}_0x158301[_0x0b33('0xb')](_0x4f3042);return _0x158301['set'](_0x0b33('0x11'),_0x315d5f+'-'+_0x315b56+'/'+_0x576096)['json'](_0x220bea);}return null;};}function saveUpdates(_0x103ff7){return function(_0x58adcd){if(_0x58adcd){return _0x58adcd[_0x0b33('0x12')](_0x103ff7)[_0x0b33('0x13')](function(_0x34d7fd){return _0x34d7fd;});}return null;};}function removeEntity(_0x32ce1a){return function(_0x4033dc){if(_0x4033dc){return _0x4033dc[_0x0b33('0x14')]()[_0x0b33('0x13')](function(){_0x32ce1a['status'](0xcc)[_0x0b33('0xc')]();});}};}function handleEntityNotFound(_0x5c0b1c){return function(_0x43d55e){if(!_0x43d55e){_0x5c0b1c[_0x0b33('0xa')](0x194);}return _0x43d55e;};}function handleError(_0x4b4d00,_0x296d4d){_0x296d4d=_0x296d4d||0x1f4;return function(_0x4ab676){logger[_0x0b33('0x15')](_0x4ab676[_0x0b33('0x16')]);if(_0x4ab676[_0x0b33('0x17')]){delete _0x4ab676[_0x0b33('0x17')];}_0x4b4d00[_0x0b33('0xb')](_0x296d4d)['send'](_0x4ab676);};}function maskClientSecret(_0x5412d7){return _[_0x0b33('0x18')](_0x5412d7[_0x0b33('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x5e6920,_0x3a3317){var _0x257e4f={},_0x2c164b={},_0x4a8e8a={'count':0x0,'rows':[]};var _0x425ed0=_[_0x0b33('0x1a')](db[_0x0b33('0x1b')]['rawAttributes'],function(_0x590fb0){return{'name':_0x590fb0[_0x0b33('0x1c')],'type':_0x590fb0[_0x0b33('0x1d')]['key']};});_0x2c164b[_0x0b33('0x1e')]=_[_0x0b33('0x1a')](_0x425ed0,'name');_0x2c164b[_0x0b33('0x1f')]=_[_0x0b33('0x20')](_0x5e6920[_0x0b33('0x1f')]);_0x2c164b[_0x0b33('0x21')]=_[_0x0b33('0x22')](_0x2c164b[_0x0b33('0x1e')],_0x2c164b[_0x0b33('0x1f')]);_0x257e4f[_0x0b33('0x23')]=_['intersection'](_0x2c164b[_0x0b33('0x1e')],qs[_0x0b33('0x24')](_0x5e6920[_0x0b33('0x1f')][_0x0b33('0x24')]));_0x257e4f['attributes']=_0x257e4f[_0x0b33('0x23')][_0x0b33('0x25')]?_0x257e4f[_0x0b33('0x23')]:_0x2c164b['model'];if(!_0x5e6920[_0x0b33('0x1f')][_0x0b33('0x26')](_0x0b33('0x27'))){_0x257e4f['limit']=qs['limit'](_0x5e6920['query'][_0x0b33('0x10')]);_0x257e4f[_0x0b33('0xd')]=qs[_0x0b33('0xd')](_0x5e6920['query'][_0x0b33('0xd')]);}_0x257e4f[_0x0b33('0x28')]=qs[_0x0b33('0x29')](_0x5e6920[_0x0b33('0x1f')]['sort']);_0x257e4f[_0x0b33('0x2a')]=qs[_0x0b33('0x21')](_[_0x0b33('0x2b')](_0x5e6920[_0x0b33('0x1f')],_0x2c164b['filters']),_0x425ed0);if(_0x5e6920[_0x0b33('0x1f')][_0x0b33('0x2c')]){_0x257e4f[_0x0b33('0x2a')]=_['merge'](_0x257e4f[_0x0b33('0x2a')],{'$or':_[_0x0b33('0x1a')](_0x425ed0,function(_0x3b60fe){if(_0x3b60fe['type']!=='VIRTUAL'){var _0x419bb1={};_0x419bb1[_0x3b60fe[_0x0b33('0x17')]]={'$like':'%'+_0x5e6920[_0x0b33('0x1f')]['filter']+'%'};return _0x419bb1;}})});}_0x257e4f=_[_0x0b33('0x2d')]({},_0x257e4f,_0x5e6920[_0x0b33('0x2e')]);var _0x31fbfa={'where':_0x257e4f[_0x0b33('0x2a')]};return db['CloudProvider'][_0x0b33('0xf')](_0x31fbfa)[_0x0b33('0x13')](function(_0x2b5e2f){_0x4a8e8a['count']=_0x2b5e2f;if(_0x5e6920[_0x0b33('0x1f')]['includeAll']){_0x257e4f['include']=[{'all':!![]}];}return db[_0x0b33('0x1b')][_0x0b33('0x2f')](_0x257e4f);})[_0x0b33('0x13')](function(_0x26c705){_0x4a8e8a[_0x0b33('0x30')]=_[_0x0b33('0x1a')](_0x26c705,function(_0x3b9c39){if(_0x3b9c39[_0x0b33('0x31')]===_0x0b33('0x32')){var _0x17aedc=encryptor[_0x0b33('0x33')](_0x3b9c39[_0x0b33('0x34')]);_0x3b9c39['data3']=maskClientSecret(_0x17aedc);}return _0x3b9c39;});return _0x4a8e8a;})[_0x0b33('0x13')](respondWithFilteredResult(_0x3a3317,_0x257e4f))[_0x0b33('0x35')](handleError(_0x3a3317,null));};exports[_0x0b33('0x36')]=function(_0x4b2036,_0x506e9e){var _0x1e296d={'raw':!![],'where':{'id':_0x4b2036[_0x0b33('0x37')]['id']}},_0x25d02c={};_0x25d02c['model']=_[_0x0b33('0x20')](db[_0x0b33('0x1b')][_0x0b33('0x38')]);_0x25d02c[_0x0b33('0x1f')]=_[_0x0b33('0x20')](_0x4b2036[_0x0b33('0x1f')]);_0x25d02c[_0x0b33('0x21')]=_[_0x0b33('0x22')](_0x25d02c[_0x0b33('0x1e')],_0x25d02c[_0x0b33('0x1f')]);_0x1e296d[_0x0b33('0x23')]=_[_0x0b33('0x22')](_0x25d02c[_0x0b33('0x1e')],qs[_0x0b33('0x24')](_0x4b2036['query'][_0x0b33('0x24')]));_0x1e296d[_0x0b33('0x23')]=_0x1e296d[_0x0b33('0x23')]['length']?_0x1e296d[_0x0b33('0x23')]:_0x25d02c[_0x0b33('0x1e')];if(_0x4b2036[_0x0b33('0x1f')][_0x0b33('0x39')]){_0x1e296d[_0x0b33('0x3a')]=[{'all':!![]}];}_0x1e296d=_[_0x0b33('0x2d')]({},_0x1e296d,_0x4b2036[_0x0b33('0x2e')]);return db[_0x0b33('0x1b')][_0x0b33('0x3b')](_0x1e296d)[_0x0b33('0x13')](handleEntityNotFound(_0x506e9e,null))[_0x0b33('0x13')](function(_0x58dd55){if(_0x58dd55[_0x0b33('0x31')]===_0x0b33('0x32')){var _0x1b96b0=encryptor[_0x0b33('0x33')](_0x58dd55['data3']);_0x58dd55[_0x0b33('0x34')]=maskClientSecret(_0x1b96b0);}return _0x58dd55;})['then'](respondWithResult(_0x506e9e,null))[_0x0b33('0x35')](handleError(_0x506e9e,null));};exports[_0x0b33('0x3c')]=function(_0x242861,_0x405c01){if(!_0x242861['body'][_0x0b33('0x17')])throw new Error(_0x0b33('0x3d'));if(!_0x242861[_0x0b33('0x3e')][_0x0b33('0x31')])throw new Error(_0x0b33('0x3f'));var _0x1b6a79=db[_0x0b33('0x1b')][_0x0b33('0x38')][_0x0b33('0x31')][_0x0b33('0x40')];if(!_0x1b6a79['includes'](_0x242861[_0x0b33('0x3e')][_0x0b33('0x31')]))throw new Error(_0x0b33('0x41')+_0x1b6a79['join'](',\x20'));if(_0x242861[_0x0b33('0x3e')][_0x0b33('0x31')]===_0x0b33('0x32')&&_0x242861[_0x0b33('0x3e')]['data3']){_0x242861[_0x0b33('0x3e')]['data3']=encryptor['encryptString'](_0x242861[_0x0b33('0x3e')]['data3']);}return db['CloudProvider'][_0x0b33('0x3c')](_0x242861['body'],{})[_0x0b33('0x13')](respondWithResult(_0x405c01,0xc9))[_0x0b33('0x35')](handleError(_0x405c01,null));};exports[_0x0b33('0x12')]=function(_0xd8373e,_0x19c0ab){if(_0xd8373e[_0x0b33('0x3e')]['id']){delete _0xd8373e['body']['id'];}return db[_0x0b33('0x1b')][_0x0b33('0x3b')]({'where':{'id':_0xd8373e[_0x0b33('0x37')]['id']}})[_0x0b33('0x13')](handleEntityNotFound(_0x19c0ab,null))[_0x0b33('0x13')](function(_0x3f64c2){if(_0x3f64c2[_0x0b33('0x31')]===_0x0b33('0x32')&&_0xd8373e['body']['data3']){_0xd8373e['body']['data3']=encryptor[_0x0b33('0x42')](_0xd8373e[_0x0b33('0x3e')][_0x0b33('0x34')]);}return _0x3f64c2;})[_0x0b33('0x13')](saveUpdates(_0xd8373e[_0x0b33('0x3e')],null))[_0x0b33('0x13')](respondWithResult(_0x19c0ab,null))[_0x0b33('0x35')](handleError(_0x19c0ab,null));};exports['destroy']=function(_0x397eaa,_0xab2071){return db['CloudProvider']['find']({'where':{'id':_0x397eaa[_0x0b33('0x37')]['id']}})[_0x0b33('0x13')](handleEntityNotFound(_0xab2071,null))['then'](removeEntity(_0xab2071,null))[_0x0b33('0x35')](handleError(_0xab2071,null));};exports[_0x0b33('0x43')]=function(_0x55b01e,_0x10647c){return db[_0x0b33('0x1b')][_0x0b33('0x44')]({'where':{'id':_0x55b01e[_0x0b33('0x37')]['id']},'raw':!![]})[_0x0b33('0x13')](function(_0x3bd97e){if(!_0x3bd97e)return _0x10647c[_0x0b33('0xa')](0x194);return{'url':oauth[_0x0b33('0x45')](_0x3bd97e,_0x55b01e['user']['id'])};})['then'](respondWithResult(_0x10647c,null))[_0x0b33('0x35')](handleError(_0x10647c,null));};exports[_0x0b33('0x46')]=function(_0x4e9dac,_0x14327d){var _0x405e4f=_0x4e9dac['body'];var _0x39950c;var _0x414339;if(_0x405e4f['error'])throw _0x405e4f;redis['get'](_0x405e4f['state'])[_0x0b33('0x13')](function(_0x4183a2){if(!_0x4183a2)throw new Error(_0x0b33('0x47'));_0x39950c=JSON['parse'](_0x4183a2);var _0x16b51c=Buffer[_0x0b33('0x48')](_0x405e4f[_0x0b33('0x49')],'base64')[_0x0b33('0x4a')](_0x0b33('0x4b'));_0x414339=JSON[_0x0b33('0x4c')](_0x16b51c);if(!oauth[_0x0b33('0x4d')](_0x405e4f[_0x0b33('0x4e')],_0x39950c[_0x0b33('0x4f')]))throw new Error(_0x0b33('0x50'));redis[_0x0b33('0x51')](_0x405e4f[_0x0b33('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x405e4f[_0x0b33('0x52')],_0x39950c);})[_0x0b33('0x13')](function(_0xb1f5d9){_0x39950c[_0x0b33('0x53')]=_0xb1f5d9[_0x0b33('0x54')];_0x39950c[_0x0b33('0x55')]=_0xb1f5d9['refresh_token'];return db[_0x0b33('0x1b')]['update']({'data5':_0x39950c[_0x0b33('0x53')],'data6':_0x39950c['data6']},{'where':{'id':_0x39950c['id']}});})['then'](function(){oauth[_0x0b33('0x56')](_0x39950c);socket[_0x0b33('0x57')](_0x0b33('0x58'),{'id':_0x414339['id']});return;})[_0x0b33('0x13')](respondWithStatusCode(_0x14327d,null))[_0x0b33('0x35')](function(_0x1a647a){if(_0x414339){socket[_0x0b33('0x57')](_0x0b33('0x59'),{'id':_0x414339['id']});}if(!_0x39950c){logger['error'](_0x0b33('0x5a'),_0x1a647a);return _0x14327d[_0x0b33('0xb')](0x1f4)[_0x0b33('0x5b')](_0x1a647a[_0x0b33('0x5c')]);}logger[_0x0b33('0x15')](_0x0b33('0x5d'),_0x39950c['id'],JSON[_0x0b33('0x5e')](_0x1a647a));});};
\ No newline at end of file
+var _0x81ad=['join','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','Invalid\x20state\x20parameter','parse','from','state','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/encryptor','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'];(function(_0x4b368a,_0x5e4556){var _0x1e16fb=function(_0x4ab059){while(--_0x4ab059){_0x4b368a['push'](_0x4b368a['shift']());}};_0x1e16fb(++_0x5e4556);}(_0x81ad,0xdf));var _0xd81a=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x81ad[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0xd81a('0x0'));var Redis=require(_0xd81a('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xd81a('0x2'));var config=require('../../config/environment');var logger=require(_0xd81a('0x3'))('api');var db=require(_0xd81a('0x4'))['db'];var oauth=require(_0xd81a('0x5'));config[_0xd81a('0x6')]=_[_0xd81a('0x7')](config[_0xd81a('0x6')],{'host':_0xd81a('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4a7a4f,_0x1feb24){_0x1feb24=_0x1feb24||0xcc;return function(_0x10b1b6){if(_0x10b1b6){return _0x4a7a4f[_0xd81a('0x9')](_0x1feb24);}return _0x4a7a4f[_0xd81a('0xa')](_0x1feb24)[_0xd81a('0xb')]();};}function respondWithResult(_0x33ec2c,_0x4f6655){_0x4f6655=_0x4f6655||0xc8;return function(_0xd3b543){if(_0xd3b543){return _0x33ec2c[_0xd81a('0xa')](_0x4f6655)[_0xd81a('0xc')](_0xd3b543);}};}function respondWithFilteredResult(_0x19de1a,_0x1e0124){return function(_0x1ddcb4){if(_0x1ddcb4){var _0x79614b=typeof _0x1e0124[_0xd81a('0xd')]===_0xd81a('0xe')&&typeof _0x1e0124[_0xd81a('0xf')]===_0xd81a('0xe');var _0x2f4ae8=_0x1ddcb4[_0xd81a('0x10')];var _0x5f2fba=_0x79614b?0x0:_0x1e0124[_0xd81a('0xd')];var _0xaa87fb=_0x79614b?_0x1ddcb4['count']:_0x1e0124[_0xd81a('0xd')]+_0x1e0124[_0xd81a('0xf')];var _0x4262a3;if(_0xaa87fb>=_0x2f4ae8){_0xaa87fb=_0x2f4ae8;_0x4262a3=0xc8;}else{_0x4262a3=0xce;}_0x19de1a['status'](_0x4262a3);return _0x19de1a[_0xd81a('0x11')](_0xd81a('0x12'),_0x5f2fba+'-'+_0xaa87fb+'/'+_0x2f4ae8)[_0xd81a('0xc')](_0x1ddcb4);}return null;};}function saveUpdates(_0x508b78){return function(_0x335345){if(_0x335345){return _0x335345[_0xd81a('0x13')](_0x508b78)[_0xd81a('0x14')](function(_0x14dfe4){return _0x14dfe4;});}return null;};}function removeEntity(_0x2faa06){return function(_0x5d48e4){if(_0x5d48e4){return _0x5d48e4[_0xd81a('0x15')]()[_0xd81a('0x14')](function(){_0x2faa06[_0xd81a('0xa')](0xcc)[_0xd81a('0xb')]();});}};}function handleEntityNotFound(_0x3a5e1c){return function(_0x45f993){if(!_0x45f993){_0x3a5e1c[_0xd81a('0x9')](0x194);}return _0x45f993;};}function handleError(_0x1e5188,_0x4afcac){_0x4afcac=_0x4afcac||0x1f4;return function(_0x172247){logger[_0xd81a('0x16')](_0x172247[_0xd81a('0x17')]);if(_0x172247[_0xd81a('0x18')]){delete _0x172247[_0xd81a('0x18')];}_0x1e5188['status'](_0x4afcac)['send'](_0x172247);};}function maskClientSecret(_0x4d429f){return _[_0xd81a('0x19')](_0x4d429f[_0xd81a('0x1a')](0x0,0x3),0x14,'*');}exports[_0xd81a('0x1b')]=function(_0x336a42,_0x340eac){var _0x4ab3cb={},_0x14bcbb={},_0x24ba29={'count':0x0,'rows':[]};var _0x99697d=_[_0xd81a('0x1c')](db[_0xd81a('0x1d')][_0xd81a('0x1e')],function(_0x3bca33){return{'name':_0x3bca33[_0xd81a('0x1f')],'type':_0x3bca33['type'][_0xd81a('0x20')]};});_0x14bcbb['model']=_[_0xd81a('0x1c')](_0x99697d,_0xd81a('0x18'));_0x14bcbb[_0xd81a('0x21')]=_[_0xd81a('0x22')](_0x336a42['query']);_0x14bcbb[_0xd81a('0x23')]=_[_0xd81a('0x24')](_0x14bcbb[_0xd81a('0x25')],_0x14bcbb[_0xd81a('0x21')]);_0x4ab3cb[_0xd81a('0x26')]=_[_0xd81a('0x24')](_0x14bcbb[_0xd81a('0x25')],qs[_0xd81a('0x27')](_0x336a42[_0xd81a('0x21')][_0xd81a('0x27')]));_0x4ab3cb[_0xd81a('0x26')]=_0x4ab3cb[_0xd81a('0x26')][_0xd81a('0x28')]?_0x4ab3cb[_0xd81a('0x26')]:_0x14bcbb[_0xd81a('0x25')];if(!_0x336a42['query'][_0xd81a('0x29')](_0xd81a('0x2a'))){_0x4ab3cb[_0xd81a('0xf')]=qs[_0xd81a('0xf')](_0x336a42['query'][_0xd81a('0xf')]);_0x4ab3cb[_0xd81a('0xd')]=qs[_0xd81a('0xd')](_0x336a42[_0xd81a('0x21')]['offset']);}_0x4ab3cb['order']=qs[_0xd81a('0x2b')](_0x336a42[_0xd81a('0x21')][_0xd81a('0x2b')]);_0x4ab3cb[_0xd81a('0x2c')]=qs['filters'](_[_0xd81a('0x2d')](_0x336a42[_0xd81a('0x21')],_0x14bcbb[_0xd81a('0x23')]),_0x99697d);if(_0x336a42[_0xd81a('0x21')][_0xd81a('0x2e')]){_0x4ab3cb[_0xd81a('0x2c')]=_['merge'](_0x4ab3cb['where'],{'$or':_['map'](_0x99697d,function(_0x2ebd87){if(_0x2ebd87[_0xd81a('0x2f')]!==_0xd81a('0x30')){var _0x52f763={};_0x52f763[_0x2ebd87[_0xd81a('0x18')]]={'$like':'%'+_0x336a42[_0xd81a('0x21')]['filter']+'%'};return _0x52f763;}})});}_0x4ab3cb=_[_0xd81a('0x31')]({},_0x4ab3cb,_0x336a42['options']);var _0xeb1e61={'where':_0x4ab3cb[_0xd81a('0x2c')]};return db[_0xd81a('0x1d')][_0xd81a('0x10')](_0xeb1e61)['then'](function(_0x45a46b){_0x24ba29[_0xd81a('0x10')]=_0x45a46b;if(_0x336a42[_0xd81a('0x21')][_0xd81a('0x32')]){_0x4ab3cb[_0xd81a('0x33')]=[{'all':!![]}];}return db[_0xd81a('0x1d')][_0xd81a('0x34')](_0x4ab3cb);})[_0xd81a('0x14')](function(_0x562ae4){_0x24ba29[_0xd81a('0x35')]=_[_0xd81a('0x1c')](_0x562ae4,function(_0x1838bc){if(_0x1838bc[_0xd81a('0x36')]===_0xd81a('0x37')){var _0x497134=encryptor['decryptString'](_0x1838bc[_0xd81a('0x38')]);_0x1838bc[_0xd81a('0x38')]=maskClientSecret(_0x497134);}return _0x1838bc;});return _0x24ba29;})[_0xd81a('0x14')](respondWithFilteredResult(_0x340eac,_0x4ab3cb))[_0xd81a('0x39')](handleError(_0x340eac,null));};exports[_0xd81a('0x3a')]=function(_0x28cb14,_0x8f5f56){var _0x51c27c={'raw':!![],'where':{'id':_0x28cb14[_0xd81a('0x3b')]['id']}},_0x1abced={};_0x1abced[_0xd81a('0x25')]=_[_0xd81a('0x22')](db['CloudProvider'][_0xd81a('0x1e')]);_0x1abced[_0xd81a('0x21')]=_[_0xd81a('0x22')](_0x28cb14[_0xd81a('0x21')]);_0x1abced[_0xd81a('0x23')]=_[_0xd81a('0x24')](_0x1abced['model'],_0x1abced[_0xd81a('0x21')]);_0x51c27c[_0xd81a('0x26')]=_[_0xd81a('0x24')](_0x1abced[_0xd81a('0x25')],qs['fields'](_0x28cb14[_0xd81a('0x21')][_0xd81a('0x27')]));_0x51c27c['attributes']=_0x51c27c['attributes']['length']?_0x51c27c[_0xd81a('0x26')]:_0x1abced['model'];if(_0x28cb14[_0xd81a('0x21')][_0xd81a('0x32')]){_0x51c27c['include']=[{'all':!![]}];}_0x51c27c=_['merge']({},_0x51c27c,_0x28cb14['options']);return db[_0xd81a('0x1d')][_0xd81a('0x3c')](_0x51c27c)['then'](handleEntityNotFound(_0x8f5f56,null))[_0xd81a('0x14')](function(_0x453f5a){if(_0x453f5a[_0xd81a('0x36')]==='MicrosoftAzure'){var _0x3c72e1=encryptor[_0xd81a('0x3d')](_0x453f5a[_0xd81a('0x38')]);_0x453f5a[_0xd81a('0x38')]=maskClientSecret(_0x3c72e1);}return _0x453f5a;})[_0xd81a('0x14')](respondWithResult(_0x8f5f56,null))['catch'](handleError(_0x8f5f56,null));};exports['create']=function(_0x462e4d,_0x4fbd6c){if(!_0x462e4d[_0xd81a('0x3e')][_0xd81a('0x18')])throw new Error(_0xd81a('0x3f'));if(!_0x462e4d[_0xd81a('0x3e')][_0xd81a('0x36')])throw new Error(_0xd81a('0x40'));var _0x8e7353=db[_0xd81a('0x1d')][_0xd81a('0x1e')][_0xd81a('0x36')][_0xd81a('0x41')];if(!_0x8e7353[_0xd81a('0x42')](_0x462e4d[_0xd81a('0x3e')][_0xd81a('0x36')]))throw new Error(_0xd81a('0x43')+_0x8e7353[_0xd81a('0x44')](',\x20'));if(_0x462e4d[_0xd81a('0x3e')]['service']===_0xd81a('0x37')&&_0x462e4d[_0xd81a('0x3e')][_0xd81a('0x38')]){_0x462e4d[_0xd81a('0x3e')][_0xd81a('0x38')]=encryptor[_0xd81a('0x45')](_0x462e4d['body']['data3']);}return db[_0xd81a('0x1d')][_0xd81a('0x46')](_0x462e4d['body'],{})[_0xd81a('0x14')](respondWithResult(_0x4fbd6c,0xc9))[_0xd81a('0x39')](handleError(_0x4fbd6c,null));};exports[_0xd81a('0x13')]=function(_0x302a54,_0x3fadba){if(_0x302a54[_0xd81a('0x3e')]['id']){delete _0x302a54[_0xd81a('0x3e')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x302a54[_0xd81a('0x3b')]['id']}})[_0xd81a('0x14')](handleEntityNotFound(_0x3fadba,null))[_0xd81a('0x14')](function(_0x18b7a0){if(_0x18b7a0['service']===_0xd81a('0x37')&&_0x302a54[_0xd81a('0x3e')][_0xd81a('0x38')]){_0x302a54['body'][_0xd81a('0x38')]=encryptor[_0xd81a('0x45')](_0x302a54[_0xd81a('0x3e')][_0xd81a('0x38')]);}return _0x18b7a0;})[_0xd81a('0x14')](saveUpdates(_0x302a54[_0xd81a('0x3e')],null))['then'](respondWithResult(_0x3fadba,null))[_0xd81a('0x39')](handleError(_0x3fadba,null));};exports[_0xd81a('0x15')]=function(_0x2175b5,_0x363ab6){return db[_0xd81a('0x1d')][_0xd81a('0x3c')]({'where':{'id':_0x2175b5['params']['id']}})[_0xd81a('0x14')](handleEntityNotFound(_0x363ab6,null))['then'](removeEntity(_0x363ab6,null))[_0xd81a('0x39')](handleError(_0x363ab6,null));};exports[_0xd81a('0x47')]=function(_0x381c5d,_0x48dbb8){return db[_0xd81a('0x1d')][_0xd81a('0x48')]({'where':{'id':_0x381c5d[_0xd81a('0x3b')]['id']},'raw':!![]})['then'](function(_0x46210a){if(!_0x46210a)return _0x48dbb8['sendStatus'](0x194);return{'url':oauth[_0xd81a('0x49')](_0x46210a,_0x381c5d[_0xd81a('0x4a')]['id'])};})['then'](respondWithResult(_0x48dbb8,null))[_0xd81a('0x39')](handleError(_0x48dbb8,null));};exports['oauth2MicrosoftCallback']=function(_0x479365,_0x1e33f4){var _0x959526=_0x479365[_0xd81a('0x3e')];var _0x370bde;var _0x4b54b4;if(_0x959526['error'])throw _0x959526;redis['get'](_0x959526['state'])[_0xd81a('0x14')](function(_0x503f59){if(!_0x503f59)throw new Error(_0xd81a('0x4b'));_0x370bde=JSON[_0xd81a('0x4c')](_0x503f59);var _0x9edb31=Buffer[_0xd81a('0x4d')](_0x959526[_0xd81a('0x4e')],'base64')[_0xd81a('0x4f')](_0xd81a('0x50'));_0x4b54b4=JSON[_0xd81a('0x4c')](_0x9edb31);if(!oauth['isValidIdToken'](_0x959526[_0xd81a('0x51')],_0x370bde[_0xd81a('0x52')]))throw new Error(_0xd81a('0x53'));redis[_0xd81a('0x54')](_0x959526[_0xd81a('0x4e')]);return oauth[_0xd81a('0x55')](_0x959526[_0xd81a('0x56')],_0x370bde);})[_0xd81a('0x14')](function(_0xc25183){_0x370bde[_0xd81a('0x57')]=_0xc25183[_0xd81a('0x58')];_0x370bde[_0xd81a('0x59')]=_0xc25183[_0xd81a('0x5a')];return db[_0xd81a('0x1d')][_0xd81a('0x13')]({'data5':_0x370bde[_0xd81a('0x57')],'data6':_0x370bde['data6']},{'where':{'id':_0x370bde['id']}});})['then'](function(){oauth[_0xd81a('0x5b')](_0x370bde);socket[_0xd81a('0x5c')](_0xd81a('0x5d'),{'id':_0x4b54b4['id']});return;})['then'](respondWithStatusCode(_0x1e33f4,null))[_0xd81a('0x39')](function(_0x20bfd4){if(_0x4b54b4){socket[_0xd81a('0x5c')](_0xd81a('0x5e'),{'id':_0x4b54b4['id']});}if(!_0x370bde){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x20bfd4);return _0x1e33f4[_0xd81a('0xa')](0x1f4)[_0xd81a('0x5f')](_0x20bfd4['message']);}logger['error'](_0xd81a('0x60'),_0x370bde['id'],JSON['stringify'](_0x20bfd4));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 4eb03e9..2ff0847 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 _0x29a8=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x29a8,0x158));var _0x829a=function(_0x102d1c,_0x36f1e4){_0x102d1c=_0x102d1c-0x0;var _0x5b9be5=_0x29a8[_0x102d1c];return _0x5b9be5;};'use strict';var _=require(_0x829a('0x0'));var util=require(_0x829a('0x1'));var logger=require(_0x829a('0x2'))(_0x829a('0x3'));var moment=require(_0x829a('0x4'));var BPromise=require(_0x829a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x829a('0x6'));var rimraf=require(_0x829a('0x7'));var config=require(_0x829a('0x8'));var attributes=require(_0x829a('0x9'));module[_0x829a('0xa')]=function(_0x424a75,_0x42bf2b){return _0x424a75[_0x829a('0xb')](_0x829a('0xc'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe52c=['path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','../../config/logger','api','moment','bluebird'];(function(_0x19b2d2,_0x2485b2){var _0x183e8e=function(_0x47b88b){while(--_0x47b88b){_0x19b2d2['push'](_0x19b2d2['shift']());}};_0x183e8e(++_0x2485b2);}(_0xe52c,0x196));var _0xce52=function(_0x3c36aa,_0x52a733){_0x3c36aa=_0x3c36aa-0x0;var _0x210dfb=_0xe52c[_0x3c36aa];return _0x210dfb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xce52('0x0'))(_0xce52('0x1'));var moment=require(_0xce52('0x2'));var BPromise=require(_0xce52('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce52('0x4'));var rimraf=require(_0xce52('0x5'));var config=require('../../config/environment');var attributes=require(_0xce52('0x6'));module[_0xce52('0x7')]=function(_0xf4bd3,_0xd1fe8f){return _0xf4bd3[_0xce52('0x8')](_0xce52('0x9'),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 6b48393..d5a19a5 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 _0x74d8=['https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','Outlook365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','join','redirect_uri','response_mode','form_post','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','POST','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x74d8,0x1e6));var _0x874d=function(_0x355b43,_0x1ea26e){_0x355b43=_0x355b43-0x0;var _0x122791=_0x74d8[_0x355b43];return _0x122791;};'use strict';var _=require('lodash');var crypto=require(_0x874d('0x0'));var jwt=require('jsonwebtoken');var moment=require(_0x874d('0x1'));var Redis=require(_0x874d('0x2'));var rp=require(_0x874d('0x3'));var util=require(_0x874d('0x4'));var encryptor=require(_0x874d('0x5'));var config=require(_0x874d('0x6'));var logger=require('../../config/logger')(_0x874d('0x7'));var schedule=require(_0x874d('0x8'));var db=require(_0x874d('0x9'))['db'];config[_0x874d('0xa')]=_[_0x874d('0xb')](config[_0x874d('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x874d('0xa')]);var MICROSOFT_AUTH_URL=_0x874d('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x874d('0xd'),_0x874d('0xe'),_0x874d('0xf'),_0x874d('0x10'),_0x874d('0x11'),_0x874d('0x12'),_0x874d('0x13')],'Dynamics365':[_0x874d('0xd'),_0x874d('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x874d('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xa820ae){var _0x53fb65=_[_0x874d('0x15')](AZURE_AUTH_SCOPES[_0xa820ae[_0x874d('0x16')]]);if(_0xa820ae[_0x874d('0x16')]===_0x874d('0x17'))_0x53fb65[_0x874d('0x18')](_0xa820ae[_0x874d('0x19')]+'/.default');return _0x53fb65['join']('\x20');}function getAccessTokenScope(_0x4c837f){if(_0x4c837f[_0x874d('0x16')]===_0x874d('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x4c837f[_0x874d('0x16')]===_0x874d('0x17'))return _0x4c837f[_0x874d('0x19')]+_0x874d('0x1b');}function generateMicrosoftAuthorizationUrl(_0xbfb63a,_0x440f51){var _0xafdbf3=MICROSOFT_AUTH_URL[_0x874d('0x1c')](_0x874d('0x1d'),_0xbfb63a[_0x874d('0x1e')]);var _0x472b46=[_0x874d('0x1f'),_0x874d('0x20')];var _0x2a4a9e=Buffer[_0x874d('0x21')](JSON[_0x874d('0x22')]({'id':_0x440f51}))[_0x874d('0x23')](_0x874d('0x24'));var _0x55d5fa=crypto[_0x874d('0x25')](0x10)[_0x874d('0x23')](_0x874d('0x26'));var _0x20fb59=getAuthorizationScopes(_0xbfb63a);var _0x3800e4=[{'key':_0x874d('0x27'),'value':_0xbfb63a[_0x874d('0x28')]},{'key':_0x874d('0x29'),'value':encodeURIComponent(_0x472b46[_0x874d('0x2a')]('\x20'))},{'key':_0x874d('0x2b'),'value':_0xbfb63a['data4']},{'key':_0x874d('0x2c'),'value':_0x874d('0x2d')},{'key':_0x874d('0x2e'),'value':encodeURIComponent(_0x20fb59)},{'key':_0x874d('0x2f'),'value':_0x2a4a9e},{'key':_0x874d('0x30'),'value':_0x55d5fa},{'key':'prompt','value':_0x874d('0x31')}];var _0x4759ed=_0xafdbf3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x874d('0x15')](_0x3800e4,function(_0x5e7091){return _0x5e7091[_0x874d('0x32')]+'='+_0x5e7091[_0x874d('0x33')];})[_0x874d('0x2a')]('&');_0xbfb63a[_0x874d('0x34')]={'issuer':_0xafdbf3['replace'](_0x874d('0x35'),''),'audience':_0xbfb63a[_0x874d('0x28')],'state':_0x2a4a9e,'nonce':_0x55d5fa};redis[_0x874d('0x36')](_0x2a4a9e,JSON[_0x874d('0x22')](_0xbfb63a));return _0x4759ed;}function isValidIdToken(_0x2a615c,_0x4c3cf7){try{var _0x554582=jwt['decode'](_0x2a615c,{'complete':!![]});var _0x37b876=_0x554582[_0x874d('0x37')];if(_0x37b876[_0x874d('0x38')]!==_0x4c3cf7[_0x874d('0x39')])return![];if(_0x37b876['aud']!==_0x4c3cf7['audience'])return![];if(_0x37b876[_0x874d('0x30')]!==_0x4c3cf7[_0x874d('0x30')])return![];if(moment()[_0x874d('0x3a')](moment[_0x874d('0x3b')](_0x37b876[_0x874d('0x3c')])))return![];return!![];}catch(_0x4bd205){throw _0x4bd205;}}function refreshOauth2MicrosoftAccessToken(_0xb10920){return Promise[_0x874d('0x3d')]()[_0x874d('0x3e')](function(){if(_0xb10920[_0x874d('0x3f')])return _0xb10920;return db[_0x874d('0x40')][_0x874d('0x41')]({'where':{'id':_0xb10920['id']},'raw':!![]});})[_0x874d('0x3e')](function(_0x33428e){var _0x1e765f={'grant_type':_0x874d('0x42'),'refresh_token':_0x33428e[_0x874d('0x43')],'scope':getAccessTokenScope(_0x33428e),'redirect_uri':_0x33428e[_0x874d('0x44')],'client_id':_0x33428e[_0x874d('0x28')],'client_secret':encryptor[_0x874d('0x45')](_0x33428e['data3'])};var _0x598371={'method':_0x874d('0x46'),'uri':MICROSOFT_AUTH_URL['replace'](_0x874d('0x1d'),_0x33428e[_0x874d('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1e765f,'json':!![]};return rp(_0x598371);})[_0x874d('0x3e')](function(_0x2cd9d2){_0xb10920[_0x874d('0x47')]=_0x2cd9d2[_0x874d('0x48')];_0xb10920['data6']=_0x2cd9d2['refresh_token'];return db[_0x874d('0x40')]['update']({'data5':_0xb10920[_0x874d('0x47')],'data6':_0xb10920[_0x874d('0x43')]},{'where':{'id':_0xb10920['id']}});})[_0x874d('0x3e')](function(){return _0xb10920;})[_0x874d('0x49')](function(_0x54c5fa){logger[_0x874d('0x4a')](_0x874d('0x4b'),_0xb10920['id'],_0x54c5fa);});}function getOauth2MicrosoftAccessToken(_0x1842ce,_0x36bf18){var _0x2301f3={'grant_type':_0x874d('0x4c'),'code':_0x1842ce,'scope':getAccessTokenScope(_0x36bf18),'redirect_uri':_0x36bf18[_0x874d('0x44')],'client_id':_0x36bf18[_0x874d('0x28')],'client_secret':encryptor[_0x874d('0x45')](_0x36bf18['data3'])};var _0x166de7={'method':_0x874d('0x46'),'uri':MICROSOFT_AUTH_URL[_0x874d('0x1c')](_0x874d('0x1d'),_0x36bf18[_0x874d('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2301f3,'json':!![]};return rp(_0x166de7);}function startRefreshInterval(_0x5ed234){var _0x26de0e=schedule[_0x874d('0x4d')];if(_0x26de0e[_0x5ed234['id']])clearInterval(_0x26de0e[_0x5ed234['id']]);_0x26de0e[_0x5ed234['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5ed234['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x874d('0x4d')]=_0x26de0e;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x874d('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x874d('0x3e')](function(_0x434684){var _0x1b0a61=_0x434684[_0x874d('0x15')](function(_0x1a2ea4){return refreshOauth2MicrosoftAccessToken(_0x1a2ea4)['then'](function(_0x475806){startRefreshInterval(_0x475806);});});return Promise[_0x874d('0x4f')](_0x1b0a61);})['catch'](function(_0x1f2cfd){var _0x2db8bf=_0x1f2cfd?util[_0x874d('0x50')](_0x1f2cfd,{'showHidden':![],'depth':null}):'';logger[_0x874d('0x4a')](_0x874d('0x51'),_0x2db8bf);});}module[_0x874d('0x52')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x492a=['catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','findAll','all','exports','lodash','crypto','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','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','/authorize','/token','map','Dynamics365','push','data7','/.default','join','type','Outlook365','replace','{TENANT_ID}','id_token','from','stringify','base64','randomBytes','toString','hex','response_type','redirect_uri','response_mode','form_post','scope','state','login','key','oauth2Claims','oauth2/','data1','set','decode','payload','iss','audience','nonce','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','data4','POST','data5','update'];(function(_0x34ced0,_0x21907f){var _0x3db58d=function(_0x51fb31){while(--_0x51fb31){_0x34ced0['push'](_0x34ced0['shift']());}};_0x3db58d(++_0x21907f);}(_0x492a,0x1cb));var _0xa492=function(_0x9ef902,_0x25ed15){_0x9ef902=_0x9ef902-0x0;var _0x126e46=_0x492a[_0x9ef902];return _0x126e46;};'use strict';var _=require(_0xa492('0x0'));var crypto=require(_0xa492('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0xa492('0x2'));var rp=require(_0xa492('0x3'));var util=require('util');var encryptor=require(_0xa492('0x4'));var config=require(_0xa492('0x5'));var logger=require(_0xa492('0x6'))(_0xa492('0x7'));var schedule=require(_0xa492('0x8'));var db=require(_0xa492('0x9'))['db'];config[_0xa492('0xa')]=_[_0xa492('0xb')](config[_0xa492('0xa')],{'host':_0xa492('0xc'),'port':0x18eb});var redis=new Redis(config[_0xa492('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xa492('0xd'),'profile',_0xa492('0xe'),'offline_access',_0xa492('0xf'),_0xa492('0x10'),_0xa492('0x11')],'Dynamics365':[_0xa492('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xa492('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xa492('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x220cea){var _0xe165c=_[_0xa492('0x14')](AZURE_AUTH_SCOPES[_0x220cea['type']]);if(_0x220cea['type']===_0xa492('0x15'))_0xe165c[_0xa492('0x16')](_0x220cea[_0xa492('0x17')]+_0xa492('0x18'));return _0xe165c[_0xa492('0x19')]('\x20');}function getAccessTokenScope(_0x18e52e){if(_0x18e52e[_0xa492('0x1a')]===_0xa492('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x18e52e['type']===_0xa492('0x15'))return _0x18e52e[_0xa492('0x17')]+_0xa492('0x18');}function generateMicrosoftAuthorizationUrl(_0x59a70a,_0x23eda0){var _0x93fa60=MICROSOFT_AUTH_URL[_0xa492('0x1c')](_0xa492('0x1d'),_0x59a70a['data2']);var _0x1422c9=['code',_0xa492('0x1e')];var _0x4c663a=Buffer[_0xa492('0x1f')](JSON[_0xa492('0x20')]({'id':_0x23eda0}))['toString'](_0xa492('0x21'));var _0x339984=crypto[_0xa492('0x22')](0x10)[_0xa492('0x23')](_0xa492('0x24'));var _0x1caf9d=getAuthorizationScopes(_0x59a70a);var _0x460734=[{'key':'client_id','value':_0x59a70a['data1']},{'key':_0xa492('0x25'),'value':encodeURIComponent(_0x1422c9[_0xa492('0x19')]('\x20'))},{'key':_0xa492('0x26'),'value':_0x59a70a['data4']},{'key':_0xa492('0x27'),'value':_0xa492('0x28')},{'key':_0xa492('0x29'),'value':encodeURIComponent(_0x1caf9d)},{'key':_0xa492('0x2a'),'value':_0x4c663a},{'key':'nonce','value':_0x339984},{'key':'prompt','value':_0xa492('0x2b')}];var _0x5d66f0=_0x93fa60+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa492('0x14')](_0x460734,function(_0x44aa2d){return _0x44aa2d[_0xa492('0x2c')]+'='+_0x44aa2d['value'];})[_0xa492('0x19')]('&');_0x59a70a[_0xa492('0x2d')]={'issuer':_0x93fa60[_0xa492('0x1c')](_0xa492('0x2e'),''),'audience':_0x59a70a[_0xa492('0x2f')],'state':_0x4c663a,'nonce':_0x339984};redis[_0xa492('0x30')](_0x4c663a,JSON[_0xa492('0x20')](_0x59a70a));return _0x5d66f0;}function isValidIdToken(_0x4fa3a3,_0x1d89ef){try{var _0x52f9a7=jwt[_0xa492('0x31')](_0x4fa3a3,{'complete':!![]});var _0x17a1ec=_0x52f9a7[_0xa492('0x32')];if(_0x17a1ec[_0xa492('0x33')]!==_0x1d89ef['issuer'])return![];if(_0x17a1ec['aud']!==_0x1d89ef[_0xa492('0x34')])return![];if(_0x17a1ec[_0xa492('0x35')]!==_0x1d89ef[_0xa492('0x35')])return![];if(moment()['isAfter'](moment[_0xa492('0x36')](_0x17a1ec['exp'])))return![];return!![];}catch(_0x5938da){throw _0x5938da;}}function refreshOauth2MicrosoftAccessToken(_0x2759eb){return Promise[_0xa492('0x37')]()[_0xa492('0x38')](function(){if(_0x2759eb[_0xa492('0x39')])return _0x2759eb;return db[_0xa492('0x3a')][_0xa492('0x3b')]({'where':{'id':_0x2759eb['id']},'raw':!![]});})[_0xa492('0x38')](function(_0x1cdd56){var _0x4b12d7={'grant_type':_0xa492('0x3c'),'refresh_token':_0x1cdd56[_0xa492('0x3d')],'scope':getAccessTokenScope(_0x1cdd56),'redirect_uri':_0x1cdd56[_0xa492('0x3e')],'client_id':_0x1cdd56[_0xa492('0x2f')],'client_secret':encryptor['decryptString'](_0x1cdd56[_0xa492('0x39')])};var _0x14dbf2={'method':_0xa492('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa492('0x1d'),_0x1cdd56['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b12d7,'json':!![]};return rp(_0x14dbf2);})[_0xa492('0x38')](function(_0x40ac73){_0x2759eb[_0xa492('0x40')]=_0x40ac73['access_token'];_0x2759eb[_0xa492('0x3d')]=_0x40ac73[_0xa492('0x3c')];return db[_0xa492('0x3a')][_0xa492('0x41')]({'data5':_0x2759eb[_0xa492('0x40')],'data6':_0x2759eb[_0xa492('0x3d')]},{'where':{'id':_0x2759eb['id']}});})['then'](function(){return _0x2759eb;})[_0xa492('0x42')](function(_0xefea69){logger[_0xa492('0x43')](_0xa492('0x44'),_0x2759eb['id'],_0xefea69);});}function getOauth2MicrosoftAccessToken(_0x575c6b,_0x1585bb){var _0x46b7bc={'grant_type':_0xa492('0x45'),'code':_0x575c6b,'scope':getAccessTokenScope(_0x1585bb),'redirect_uri':_0x1585bb['data4'],'client_id':_0x1585bb[_0xa492('0x2f')],'client_secret':encryptor[_0xa492('0x46')](_0x1585bb[_0xa492('0x39')])};var _0x20a0a5={'method':_0xa492('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xa492('0x1c')]('{TENANT_ID}',_0x1585bb['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x46b7bc,'json':!![]};return rp(_0x20a0a5);}function startRefreshInterval(_0x3c4411){var _0x5ca6d6=schedule['intervals'];if(_0x5ca6d6[_0x3c4411['id']])clearInterval(_0x5ca6d6[_0x3c4411['id']]);_0x5ca6d6[_0x3c4411['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3c4411['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa492('0x47')]=_0x5ca6d6;}function startAllRefreshIntervals(){return db[_0xa492('0x3a')][_0xa492('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa492('0x38')](function(_0x4a9c60){var _0x56919c=_0x4a9c60[_0xa492('0x14')](function(_0xef644a){return refreshOauth2MicrosoftAccessToken(_0xef644a)[_0xa492('0x38')](function(_0x35f4a7){startRefreshInterval(_0x35f4a7);});});return Promise[_0xa492('0x49')](_0x56919c);})['catch'](function(_0x487bad){var _0x3ea61f=_0x487bad?util['inspect'](_0x487bad,{'showHidden':![],'depth':null}):'';logger[_0xa492('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x3ea61f);});}module[_0xa492('0x4a')]={'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 98ca94a..130884a 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 _0xb2af=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb2af,0xd2));var _0xfb2a=function(_0x49742b,_0x21e377){_0x49742b=_0x49742b-0x0;var _0x488468=_0xb2af[_0x49742b];return _0x488468;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});}
\ No newline at end of file
+var _0x8325=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','randomstring'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8325,0x1f1));var _0x5832=function(_0x37a73b,_0x569e74){_0x37a73b=_0x37a73b-0x0;var _0x39cee2=_0x8325[_0x37a73b];return _0x39cee2;};'use strict';var _=require(_0x5832('0x0'));var util=require('util');var moment=require(_0x5832('0x1'));var BPromise=require('bluebird');var rs=require(_0x5832('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5832('0x3'))['db'];var utils=require(_0x5832('0x4'));var logger=require(_0x5832('0x5'))(_0x5832('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5832('0x7')][_0x5832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8b3b30,_0xe80d1d,_0xb4e9b9){return new BPromise(function(_0x333780,_0x495531){return client[_0x5832('0x9')](_0x8b3b30,_0xb4e9b9)[_0x5832('0xa')](function(_0x10192d){logger[_0x5832('0xb')](_0x5832('0xc'),_0xe80d1d,_0x5832('0xd'));logger[_0x5832('0xe')](_0x5832('0xf'),_0xe80d1d,_0x5832('0xd'),JSON['stringify'](_0x10192d));if(_0x10192d['error']){if(_0x10192d[_0x5832('0x10')][_0x5832('0x11')]===0x1f4){logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x10192d['error']['message']);return _0x495531(_0x10192d[_0x5832('0x10')][_0x5832('0x12')]);}logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x10192d['error'][_0x5832('0x12')]);return _0x333780(_0x10192d[_0x5832('0x10')][_0x5832('0x12')]);}else{logger[_0x5832('0xb')]('CloudProvider,\x20%s,\x20%s',_0xe80d1d,_0x5832('0xd'));_0x333780(_0x10192d[_0x5832('0x13')][_0x5832('0x12')]);}})['catch'](function(_0x32d360){logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x32d360);_0x495531(_0x32d360);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index d338894..fea1fe4 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x328d50,_0x4da1a9){var _0x19f171=function(_0x4ea53b){while(--_0x4ea53b){_0x328d50['push'](_0x328d50['shift']());}};_0x19f171(++_0x4da1a9);}(_0xadb5,0xad));var _0x5adb=function(_0x5bb743,_0x40462f){_0x5bb743=_0x5bb743-0x0;var _0x565df5=_0xadb5[_0x5bb743];return _0x565df5;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c3f08,_0x380f2b){_0x2c3f08=_0x2c3f08-0x0;var _0x4ea2ab=_0x5f2f[_0x2c3f08];return _0x4ea2ab;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9e0e207..d88ce70 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 _0xe2bb=['STRING','name','sequelize'];(function(_0x46fbee,_0x4bbebd){var _0x1528a1=function(_0x5bbaf1){while(--_0x5bbaf1){_0x46fbee['push'](_0x46fbee['shift']());}};_0x1528a1(++_0x4bbebd);}(_0xe2bb,0x13d));var _0xbe2b=function(_0x6c00b2,_0x2769d4){_0x6c00b2=_0x6c00b2-0x0;var _0x255585=_0xe2bb[_0x6c00b2];return _0x255585;};'use strict';var Sequelize=require(_0xbe2b('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe2b('0x1')],'unique':_0xbe2b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbe2b('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xbe2b('0x1')]},'phone':{'type':Sequelize[_0xbe2b('0x1')]},'fax':{'type':Sequelize[_0xbe2b('0x1')]},'type':{'type':Sequelize[_0xbe2b('0x1')]},'street':{'type':Sequelize[_0xbe2b('0x1')]},'postalCode':{'type':Sequelize[_0xbe2b('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbe2b('0x1')]},'email':{'type':Sequelize[_0xbe2b('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbe2b('0x1')]},'sStreet':{'type':Sequelize[_0xbe2b('0x1')]},'sPostalCode':{'type':Sequelize[_0xbe2b('0x1')]},'sCity':{'type':Sequelize[_0xbe2b('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbe2b('0x1')]}};
\ No newline at end of file
+var _0x1d6f=['STRING','sequelize'];(function(_0x340165,_0x27fd27){var _0x346e2a=function(_0x4b3839){while(--_0x4b3839){_0x340165['push'](_0x340165['shift']());}};_0x346e2a(++_0x27fd27);}(_0x1d6f,0x171));var _0xf1d6=function(_0x141323,_0x4c0370){_0x141323=_0x141323-0x0;var _0x1cb78f=_0x1d6f[_0x141323];return _0x1cb78f;};'use strict';var Sequelize=require(_0xf1d6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf1d6('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xf1d6('0x1')]},'phone':{'type':Sequelize[_0xf1d6('0x1')]},'fax':{'type':Sequelize[_0xf1d6('0x1')]},'type':{'type':Sequelize[_0xf1d6('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf1d6('0x1')]},'city':{'type':Sequelize[_0xf1d6('0x1')]},'country':{'type':Sequelize[_0xf1d6('0x1')]},'email':{'type':Sequelize[_0xf1d6('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xf1d6('0x1')]},'sPostalCode':{'type':Sequelize[_0xf1d6('0x1')]},'sCity':{'type':Sequelize[_0xf1d6('0x1')]},'sCountry':{'type':Sequelize[_0xf1d6('0x1')]},'description':{'type':Sequelize[_0xf1d6('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index c727dcd..d7c1abe 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 _0xcc23=['name','send','CmCompany','describe','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','order','sort','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0xcc23,0x178));var _0x3cc2=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xcc23[_0x50e40b];return _0x2608b7;};'use strict';var emlformat=require(_0x3cc2('0x0'));var rimraf=require(_0x3cc2('0x1'));var zipdir=require(_0x3cc2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3cc2('0x3'));var moment=require(_0x3cc2('0x4'));var BPromise=require(_0x3cc2('0x5'));var Mustache=require(_0x3cc2('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3cc2('0x7'));var csv=require(_0x3cc2('0x8'));var ejs=require(_0x3cc2('0x9'));var fs=require('fs');var fs_extra=require(_0x3cc2('0xa'));var _=require('lodash');var squel=require(_0x3cc2('0xb'));var crypto=require('crypto');var jsforce=require(_0x3cc2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3cc2('0x8'));var querystring=require(_0x3cc2('0xd'));var Papa=require('papaparse');var Redis=require(_0x3cc2('0xe'));var authService=require(_0x3cc2('0xf'));var qs=require(_0x3cc2('0x10'));var as=require(_0x3cc2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cc2('0x12'))(_0x3cc2('0x13'));var utils=require('../../config/utils');var config=require(_0x3cc2('0x14'));var licenseUtil=require(_0x3cc2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a6c8,_0x44372b){_0x44372b=_0x44372b||0xcc;return function(_0x3894b8){if(_0x3894b8){return _0x32a6c8['sendStatus'](_0x44372b);}return _0x32a6c8[_0x3cc2('0x16')](_0x44372b)[_0x3cc2('0x17')]();};}function respondWithResult(_0x2c1be0,_0x4df307){_0x4df307=_0x4df307||0xc8;return function(_0x30884c){if(_0x30884c){return _0x2c1be0['status'](_0x4df307)[_0x3cc2('0x18')](_0x30884c);}};}function respondWithFilteredResult(_0x43b343,_0x518b4e){return function(_0x4eceb7){if(_0x4eceb7){var _0x250e3b=typeof _0x518b4e[_0x3cc2('0x19')]===_0x3cc2('0x1a')&&typeof _0x518b4e[_0x3cc2('0x1b')]===_0x3cc2('0x1a');var _0x2b2a9f=_0x4eceb7[_0x3cc2('0x1c')];var _0x5042ad=_0x250e3b?0x0:_0x518b4e[_0x3cc2('0x19')];var _0x206cd7=_0x250e3b?_0x4eceb7[_0x3cc2('0x1c')]:_0x518b4e[_0x3cc2('0x19')]+_0x518b4e['limit'];var _0x2b409a;if(_0x206cd7>=_0x2b2a9f){_0x206cd7=_0x2b2a9f;_0x2b409a=0xc8;}else{_0x2b409a=0xce;}_0x43b343[_0x3cc2('0x16')](_0x2b409a);return _0x43b343[_0x3cc2('0x1d')](_0x3cc2('0x1e'),_0x5042ad+'-'+_0x206cd7+'/'+_0x2b2a9f)[_0x3cc2('0x18')](_0x4eceb7);}return null;};}function patchUpdates(_0x4ffe3a){return function(_0x27e294){try{jsonpatch[_0x3cc2('0x1f')](_0x27e294,_0x4ffe3a,!![]);}catch(_0x2039e1){return BPromise['reject'](_0x2039e1);}return _0x27e294['save']();};}function saveUpdates(_0x18adea,_0x41b9e0){return function(_0xfcdc76){if(_0xfcdc76){return _0xfcdc76[_0x3cc2('0x20')](_0x18adea)[_0x3cc2('0x21')](function(_0x321ee5){return _0x321ee5;});}return null;};}function removeEntity(_0x3eaac7,_0x3df037){return function(_0x3a7927){if(_0x3a7927){return _0x3a7927[_0x3cc2('0x22')]()[_0x3cc2('0x21')](function(){var _0x57089e=_0x3a7927[_0x3cc2('0x23')]({'plain':!![]});var _0x41b7df='Companies';return db[_0x3cc2('0x24')][_0x3cc2('0x22')]({'where':{'type':_0x41b7df,'resourceId':_0x57089e['id']}})[_0x3cc2('0x21')](function(){return _0x3a7927;});})['then'](function(){_0x3eaac7[_0x3cc2('0x16')](0xcc)[_0x3cc2('0x17')]();});}};}function handleEntityNotFound(_0x2ae3ee,_0x52a319){return function(_0x3f1fcf){if(!_0x3f1fcf){_0x2ae3ee['sendStatus'](0x194);}return _0x3f1fcf;};}function handleError(_0x4c75b8,_0x52dedc){_0x52dedc=_0x52dedc||0x1f4;return function(_0x31bb79){logger[_0x3cc2('0x25')](_0x31bb79[_0x3cc2('0x26')]);if(_0x31bb79[_0x3cc2('0x27')]){delete _0x31bb79[_0x3cc2('0x27')];}_0x4c75b8['status'](_0x52dedc)[_0x3cc2('0x28')](_0x31bb79);};}exports['index']=function(_0x1896aa,_0x147438){var _0x2c4727={},_0x1af842={},_0x26f1a3={'count':0x0,'rows':[]};return db[_0x3cc2('0x29')][_0x3cc2('0x2a')]()[_0x3cc2('0x21')](function(_0x46e35f){_0x1af842[_0x3cc2('0x2b')]=_['keys'](_0x46e35f);_0x1af842[_0x3cc2('0x2c')]=_['keys'](_0x1896aa['query']);_0x1af842['filters']=_[_0x3cc2('0x2d')](_0x1af842[_0x3cc2('0x2b')],_0x1af842[_0x3cc2('0x2c')]);_0x2c4727['attributes']=_[_0x3cc2('0x2d')](_0x1af842[_0x3cc2('0x2b')],qs[_0x3cc2('0x2e')](_0x1896aa[_0x3cc2('0x2c')][_0x3cc2('0x2e')]));_0x2c4727[_0x3cc2('0x2f')]=_0x2c4727[_0x3cc2('0x2f')][_0x3cc2('0x30')]?_0x2c4727[_0x3cc2('0x2f')]:_0x1af842[_0x3cc2('0x2b')];if(!_0x1896aa[_0x3cc2('0x2c')][_0x3cc2('0x31')](_0x3cc2('0x32'))){_0x2c4727[_0x3cc2('0x1b')]=qs[_0x3cc2('0x1b')](_0x1896aa['query']['limit']);_0x2c4727[_0x3cc2('0x19')]=qs[_0x3cc2('0x19')](_0x1896aa[_0x3cc2('0x2c')][_0x3cc2('0x19')]);}_0x2c4727['order']=qs['sort'](_0x1896aa[_0x3cc2('0x2c')]['sort']);_0x2c4727[_0x3cc2('0x33')]=qs[_0x3cc2('0x34')](_[_0x3cc2('0x35')](_0x1896aa[_0x3cc2('0x2c')],_0x1af842['filters']),_0x46e35f);if(_0x1896aa[_0x3cc2('0x2c')][_0x3cc2('0x36')]){_0x2c4727['where']=_['merge'](_0x2c4727[_0x3cc2('0x33')],{'$or':_[_0x3cc2('0x37')](_0x2c4727[_0x3cc2('0x2f')],function(_0x2d0615){var _0xeb3cbe={};_0xeb3cbe[_0x2d0615]={'$like':'%'+_0x1896aa[_0x3cc2('0x2c')][_0x3cc2('0x36')]+'%'};return _0xeb3cbe;})});}_0x2c4727=_[_0x3cc2('0x38')]({},_0x2c4727,_0x1896aa[_0x3cc2('0x39')]);var _0x2eff7b={'where':_0x2c4727[_0x3cc2('0x33')]};return db['CmCompany'][_0x3cc2('0x1c')](_0x2eff7b)['then'](function(_0x821f16){_0x26f1a3[_0x3cc2('0x1c')]=_0x821f16;if(_0x1896aa['query'][_0x3cc2('0x3a')]){_0x2c4727[_0x3cc2('0x3b')]=[{'all':!![]}];}return db[_0x3cc2('0x29')][_0x3cc2('0x3c')](_0x2c4727);})[_0x3cc2('0x21')](function(_0x5ec466){_0x26f1a3[_0x3cc2('0x3d')]=_0x5ec466;return _0x26f1a3;})[_0x3cc2('0x21')](respondWithFilteredResult(_0x147438,_0x2c4727))['catch'](handleError(_0x147438,null));})[_0x3cc2('0x3e')](handleError(_0x147438,null));};exports['show']=function(_0x48d92c,_0x3ef2cf){var _0x4eed08={'raw':![],'where':{'id':_0x48d92c[_0x3cc2('0x3f')]['id']}},_0x30696f={};_0x30696f[_0x3cc2('0x2b')]=_[_0x3cc2('0x40')](db[_0x3cc2('0x29')][_0x3cc2('0x41')]);_0x30696f[_0x3cc2('0x2c')]=_['keys'](_0x48d92c['query']);_0x30696f[_0x3cc2('0x34')]=_[_0x3cc2('0x2d')](_0x30696f[_0x3cc2('0x2b')],_0x30696f[_0x3cc2('0x2c')]);_0x4eed08['attributes']=_[_0x3cc2('0x2d')](_0x30696f['model'],qs[_0x3cc2('0x2e')](_0x48d92c[_0x3cc2('0x2c')]['fields']));_0x4eed08[_0x3cc2('0x2f')]=_0x4eed08[_0x3cc2('0x2f')][_0x3cc2('0x30')]?_0x4eed08['attributes']:_0x30696f[_0x3cc2('0x2b')];if(_0x48d92c[_0x3cc2('0x2c')]['includeAll']){_0x4eed08[_0x3cc2('0x3b')]=[{'all':!![]}];}_0x4eed08=_[_0x3cc2('0x38')]({},_0x4eed08,_0x48d92c['options']);return db[_0x3cc2('0x29')][_0x3cc2('0x42')](_0x4eed08)[_0x3cc2('0x21')](handleEntityNotFound(_0x3ef2cf,null))[_0x3cc2('0x21')](respondWithResult(_0x3ef2cf,null))[_0x3cc2('0x3e')](handleError(_0x3ef2cf,null));};exports[_0x3cc2('0x43')]=function(_0x487f44,_0x4541d5){return db[_0x3cc2('0x29')][_0x3cc2('0x43')](_0x487f44[_0x3cc2('0x44')],{})[_0x3cc2('0x21')](function(_0x726aaa){var _0x21ed2c=_0x487f44[_0x3cc2('0x45')][_0x3cc2('0x23')]({'plain':!![]});if(!_0x21ed2c)throw new Error(_0x3cc2('0x46'));if(_0x21ed2c[_0x3cc2('0x47')]===_0x3cc2('0x45')){var _0x39b014=_0x726aaa['get']({'plain':!![]});var _0x77a136='Companies';return db[_0x3cc2('0x48')][_0x3cc2('0x42')]({'where':{'name':_0x77a136,'userProfileId':_0x21ed2c['userProfileId']},'raw':!![]})[_0x3cc2('0x21')](function(_0x1f75b1){if(_0x1f75b1&&_0x1f75b1[_0x3cc2('0x49')]===0x0){return db[_0x3cc2('0x24')][_0x3cc2('0x43')]({'name':_0x39b014['name'],'resourceId':_0x39b014['id'],'type':_0x1f75b1['name'],'sectionId':_0x1f75b1['id']},{})[_0x3cc2('0x21')](function(){return _0x726aaa;});}else{return _0x726aaa;}})[_0x3cc2('0x3e')](function(_0x41039f){logger[_0x3cc2('0x25')](_0x3cc2('0x4a'),_0x41039f);throw _0x41039f;});}return _0x726aaa;})['then'](respondWithResult(_0x4541d5,0xc9))[_0x3cc2('0x3e')](handleError(_0x4541d5,null));};exports[_0x3cc2('0x20')]=function(_0x4beb9f,_0x45bb9a){if(_0x4beb9f['body']['id']){delete _0x4beb9f['body']['id'];}return db['CmCompany'][_0x3cc2('0x42')]({'where':{'id':_0x4beb9f[_0x3cc2('0x3f')]['id']}})[_0x3cc2('0x21')](handleEntityNotFound(_0x45bb9a,null))['then'](saveUpdates(_0x4beb9f[_0x3cc2('0x44')],null))[_0x3cc2('0x21')](respondWithResult(_0x45bb9a,null))[_0x3cc2('0x3e')](handleError(_0x45bb9a,null));};exports[_0x3cc2('0x22')]=function(_0x46543c,_0x2c8f2f){return db[_0x3cc2('0x29')]['find']({'where':{'id':_0x46543c[_0x3cc2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2c8f2f,null))[_0x3cc2('0x21')](removeEntity(_0x2c8f2f,null))[_0x3cc2('0x3e')](handleError(_0x2c8f2f,null));};exports[_0x3cc2('0x2a')]=function(_0x5ba68b,_0x13f15f){return db['CmCompany'][_0x3cc2('0x2a')]()[_0x3cc2('0x21')](respondWithResult(_0x13f15f,null))[_0x3cc2('0x3e')](handleError(_0x13f15f,null));};exports[_0x3cc2('0x4b')]=function(_0x289ca2,_0x4377be,_0x3fd53){return db[_0x3cc2('0x4c')][_0x3cc2('0x42')]({'where':{'id':_0x289ca2[_0x3cc2('0x3f')]['id']}})[_0x3cc2('0x21')](handleEntityNotFound(_0x4377be,null))['then'](function(_0x2ce09e){if(_0x2ce09e){return _0x2ce09e[_0x3cc2('0x4b')](_0x289ca2[_0x3cc2('0x44')][_0x3cc2('0x4d')],_[_0x3cc2('0x4e')](_0x289ca2[_0x3cc2('0x44')],[_0x3cc2('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x4377be,null))[_0x3cc2('0x3e')](handleError(_0x4377be,null));};exports[_0x3cc2('0x4f')]=function(_0x480c3c,_0x41ed0e,_0x543436){var _0x3271a3={};var _0x3bf0a6={};var _0x24eef3;var _0x1a8c64;return db[_0x3cc2('0x29')][_0x3cc2('0x50')]({'where':{'id':_0x480c3c[_0x3cc2('0x3f')]['id']}})[_0x3cc2('0x21')](handleEntityNotFound(_0x41ed0e,null))[_0x3cc2('0x21')](function(_0x1d9d7c){if(_0x1d9d7c){_0x24eef3=_0x1d9d7c;_0x3bf0a6[_0x3cc2('0x2b')]=_['keys'](db['CmContact'][_0x3cc2('0x41')]);_0x3bf0a6[_0x3cc2('0x2c')]=_[_0x3cc2('0x40')](_0x480c3c[_0x3cc2('0x2c')]);_0x3bf0a6[_0x3cc2('0x34')]=_[_0x3cc2('0x2d')](_0x3bf0a6[_0x3cc2('0x2b')],_0x3bf0a6[_0x3cc2('0x2c')]);_0x3271a3[_0x3cc2('0x2f')]=_[_0x3cc2('0x2d')](_0x3bf0a6[_0x3cc2('0x2b')],qs[_0x3cc2('0x2e')](_0x480c3c[_0x3cc2('0x2c')]['fields']));_0x3271a3[_0x3cc2('0x2f')]=_0x3271a3[_0x3cc2('0x2f')]['length']?_0x3271a3[_0x3cc2('0x2f')]:_0x3bf0a6['model'];_0x3271a3[_0x3cc2('0x51')]=qs[_0x3cc2('0x52')](_0x480c3c['query'][_0x3cc2('0x52')]);_0x3271a3['where']=qs[_0x3cc2('0x34')](_[_0x3cc2('0x35')](_0x480c3c[_0x3cc2('0x2c')],_0x3bf0a6[_0x3cc2('0x34')]));if(_0x480c3c['query']['filter']){_0x3271a3[_0x3cc2('0x33')]=_['merge'](_0x3271a3[_0x3cc2('0x33')],{'$or':_[_0x3cc2('0x37')](_0x3271a3[_0x3cc2('0x2f')],function(_0x21181c){var _0x3bca6a={};_0x3bca6a[_0x21181c]={'$like':'%'+_0x480c3c['query'][_0x3cc2('0x36')]+'%'};return _0x3bca6a;})});}_0x3271a3=_[_0x3cc2('0x38')]({},_0x3271a3,_0x480c3c[_0x3cc2('0x39')]);return _0x24eef3[_0x3cc2('0x4f')](_0x3271a3);}})['then'](function(_0x2d861d){if(_0x2d861d){_0x1a8c64=_0x2d861d[_0x3cc2('0x30')];if(!_0x480c3c[_0x3cc2('0x2c')][_0x3cc2('0x31')](_0x3cc2('0x32'))){_0x3271a3[_0x3cc2('0x1b')]=qs[_0x3cc2('0x1b')](_0x480c3c[_0x3cc2('0x2c')][_0x3cc2('0x1b')]);_0x3271a3[_0x3cc2('0x19')]=qs[_0x3cc2('0x19')](_0x480c3c[_0x3cc2('0x2c')]['offset']);}return _0x24eef3['getContacts'](_0x3271a3);}})[_0x3cc2('0x21')](function(_0x47ef67){if(_0x47ef67){return _0x47ef67?{'count':_0x1a8c64,'rows':_0x47ef67}:null;}})[_0x3cc2('0x21')](respondWithResult(_0x41ed0e,null))['catch'](handleError(_0x41ed0e,null));};
\ No newline at end of file
+var _0xbeb0=['merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x224721,_0x45b988){var _0x145358=function(_0x42305e){while(--_0x42305e){_0x224721['push'](_0x224721['shift']());}};_0x145358(++_0x45b988);}(_0xbeb0,0x69));var _0x0beb=function(_0x5a5b49,_0x2a11fb){_0x5a5b49=_0x5a5b49-0x0;var _0x42e871=_0xbeb0[_0x5a5b49];return _0x42e871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0beb('0x0'));var jsonpatch=require(_0x0beb('0x1'));var rp=require(_0x0beb('0x2'));var moment=require(_0x0beb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0beb('0x4'));var util=require(_0x0beb('0x5'));var path=require(_0x0beb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0beb('0x7'));var _=require(_0x0beb('0x8'));var squel=require(_0x0beb('0x9'));var crypto=require('crypto');var jsforce=require(_0x0beb('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0beb('0xb'));var Papa=require(_0x0beb('0xc'));var Redis=require(_0x0beb('0xd'));var authService=require(_0x0beb('0xe'));var qs=require(_0x0beb('0xf'));var as=require(_0x0beb('0x10'));var hardwareService=require(_0x0beb('0x11'));var logger=require('../../config/logger')(_0x0beb('0x12'));var utils=require(_0x0beb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0beb('0x14'));var db=require(_0x0beb('0x15'))['db'];function respondWithStatusCode(_0x480eb3,_0x5dc202){_0x5dc202=_0x5dc202||0xcc;return function(_0x459f86){if(_0x459f86){return _0x480eb3[_0x0beb('0x16')](_0x5dc202);}return _0x480eb3[_0x0beb('0x17')](_0x5dc202)[_0x0beb('0x18')]();};}function respondWithResult(_0x47129e,_0x39f5ad){_0x39f5ad=_0x39f5ad||0xc8;return function(_0x2e7d6e){if(_0x2e7d6e){return _0x47129e[_0x0beb('0x17')](_0x39f5ad)['json'](_0x2e7d6e);}};}function respondWithFilteredResult(_0x3311c3,_0x54a760){return function(_0x527c78){if(_0x527c78){var _0x4419da=typeof _0x54a760[_0x0beb('0x19')]===_0x0beb('0x1a')&&typeof _0x54a760[_0x0beb('0x1b')]==='undefined';var _0x28a30f=_0x527c78[_0x0beb('0x1c')];var _0x549a96=_0x4419da?0x0:_0x54a760[_0x0beb('0x19')];var _0x4fd805=_0x4419da?_0x527c78['count']:_0x54a760[_0x0beb('0x19')]+_0x54a760[_0x0beb('0x1b')];var _0x145884;if(_0x4fd805>=_0x28a30f){_0x4fd805=_0x28a30f;_0x145884=0xc8;}else{_0x145884=0xce;}_0x3311c3[_0x0beb('0x17')](_0x145884);return _0x3311c3['set'](_0x0beb('0x1d'),_0x549a96+'-'+_0x4fd805+'/'+_0x28a30f)[_0x0beb('0x1e')](_0x527c78);}return null;};}function patchUpdates(_0x446a62){return function(_0x5a5931){try{jsonpatch[_0x0beb('0x1f')](_0x5a5931,_0x446a62,!![]);}catch(_0x469365){return BPromise['reject'](_0x469365);}return _0x5a5931[_0x0beb('0x20')]();};}function saveUpdates(_0x34eb24,_0x8b150b){return function(_0x3c285d){if(_0x3c285d){return _0x3c285d[_0x0beb('0x21')](_0x34eb24)[_0x0beb('0x22')](function(_0x35f63e){return _0x35f63e;});}return null;};}function removeEntity(_0x5ca394,_0x5c49ba){return function(_0xde42af){if(_0xde42af){return _0xde42af[_0x0beb('0x23')]()[_0x0beb('0x22')](function(){var _0x347023=_0xde42af[_0x0beb('0x24')]({'plain':!![]});var _0x83dbb2=_0x0beb('0x25');return db[_0x0beb('0x26')][_0x0beb('0x23')]({'where':{'type':_0x83dbb2,'resourceId':_0x347023['id']}})['then'](function(){return _0xde42af;});})[_0x0beb('0x22')](function(){_0x5ca394['status'](0xcc)[_0x0beb('0x18')]();});}};}function handleEntityNotFound(_0x274cdd,_0x480d10){return function(_0x2a3f75){if(!_0x2a3f75){_0x274cdd[_0x0beb('0x16')](0x194);}return _0x2a3f75;};}function handleError(_0x5d5765,_0x55f287){_0x55f287=_0x55f287||0x1f4;return function(_0x1370e8){logger[_0x0beb('0x27')](_0x1370e8[_0x0beb('0x28')]);if(_0x1370e8[_0x0beb('0x29')]){delete _0x1370e8[_0x0beb('0x29')];}_0x5d5765[_0x0beb('0x17')](_0x55f287)[_0x0beb('0x2a')](_0x1370e8);};}exports[_0x0beb('0x2b')]=function(_0x5f1dd6,_0x527152){var _0x5b8b2a={},_0x43ae7e={},_0x9043b3={'count':0x0,'rows':[]};return db[_0x0beb('0x2c')][_0x0beb('0x2d')]()[_0x0beb('0x22')](function(_0x26ed6e){_0x43ae7e[_0x0beb('0x2e')]=_[_0x0beb('0x2f')](_0x26ed6e);_0x43ae7e[_0x0beb('0x30')]=_[_0x0beb('0x2f')](_0x5f1dd6['query']);_0x43ae7e[_0x0beb('0x31')]=_[_0x0beb('0x32')](_0x43ae7e[_0x0beb('0x2e')],_0x43ae7e[_0x0beb('0x30')]);_0x5b8b2a[_0x0beb('0x33')]=_[_0x0beb('0x32')](_0x43ae7e['model'],qs[_0x0beb('0x34')](_0x5f1dd6[_0x0beb('0x30')][_0x0beb('0x34')]));_0x5b8b2a[_0x0beb('0x33')]=_0x5b8b2a[_0x0beb('0x33')][_0x0beb('0x35')]?_0x5b8b2a[_0x0beb('0x33')]:_0x43ae7e[_0x0beb('0x2e')];if(!_0x5f1dd6['query'][_0x0beb('0x36')](_0x0beb('0x37'))){_0x5b8b2a[_0x0beb('0x1b')]=qs[_0x0beb('0x1b')](_0x5f1dd6[_0x0beb('0x30')]['limit']);_0x5b8b2a[_0x0beb('0x19')]=qs['offset'](_0x5f1dd6[_0x0beb('0x30')]['offset']);}_0x5b8b2a[_0x0beb('0x38')]=qs[_0x0beb('0x39')](_0x5f1dd6[_0x0beb('0x30')]['sort']);_0x5b8b2a[_0x0beb('0x3a')]=qs[_0x0beb('0x31')](_[_0x0beb('0x3b')](_0x5f1dd6['query'],_0x43ae7e[_0x0beb('0x31')]),_0x26ed6e);if(_0x5f1dd6[_0x0beb('0x30')][_0x0beb('0x3c')]){_0x5b8b2a[_0x0beb('0x3a')]=_[_0x0beb('0x3d')](_0x5b8b2a[_0x0beb('0x3a')],{'$or':_[_0x0beb('0x3e')](_0x5b8b2a['attributes'],function(_0x363064){var _0x4d451d={};_0x4d451d[_0x363064]={'$like':'%'+_0x5f1dd6[_0x0beb('0x30')][_0x0beb('0x3c')]+'%'};return _0x4d451d;})});}_0x5b8b2a=_[_0x0beb('0x3d')]({},_0x5b8b2a,_0x5f1dd6[_0x0beb('0x3f')]);var _0x1f06e9={'where':_0x5b8b2a[_0x0beb('0x3a')]};return db['CmCompany'][_0x0beb('0x1c')](_0x1f06e9)['then'](function(_0x13cb13){_0x9043b3[_0x0beb('0x1c')]=_0x13cb13;if(_0x5f1dd6[_0x0beb('0x30')][_0x0beb('0x40')]){_0x5b8b2a[_0x0beb('0x41')]=[{'all':!![]}];}return db[_0x0beb('0x2c')]['findAll'](_0x5b8b2a);})[_0x0beb('0x22')](function(_0x2ba7d5){_0x9043b3[_0x0beb('0x42')]=_0x2ba7d5;return _0x9043b3;})[_0x0beb('0x22')](respondWithFilteredResult(_0x527152,_0x5b8b2a))[_0x0beb('0x43')](handleError(_0x527152,null));})['catch'](handleError(_0x527152,null));};exports[_0x0beb('0x44')]=function(_0x599393,_0x440790){var _0x578de0={'raw':![],'where':{'id':_0x599393[_0x0beb('0x45')]['id']}},_0x19c6c0={};_0x19c6c0[_0x0beb('0x2e')]=_[_0x0beb('0x2f')](db[_0x0beb('0x2c')][_0x0beb('0x46')]);_0x19c6c0[_0x0beb('0x30')]=_[_0x0beb('0x2f')](_0x599393['query']);_0x19c6c0['filters']=_[_0x0beb('0x32')](_0x19c6c0['model'],_0x19c6c0['query']);_0x578de0[_0x0beb('0x33')]=_[_0x0beb('0x32')](_0x19c6c0[_0x0beb('0x2e')],qs[_0x0beb('0x34')](_0x599393[_0x0beb('0x30')][_0x0beb('0x34')]));_0x578de0['attributes']=_0x578de0[_0x0beb('0x33')]['length']?_0x578de0['attributes']:_0x19c6c0[_0x0beb('0x2e')];if(_0x599393['query'][_0x0beb('0x40')]){_0x578de0[_0x0beb('0x41')]=[{'all':!![]}];}_0x578de0=_['merge']({},_0x578de0,_0x599393[_0x0beb('0x3f')]);return db['CmCompany'][_0x0beb('0x47')](_0x578de0)[_0x0beb('0x22')](handleEntityNotFound(_0x440790,null))[_0x0beb('0x22')](respondWithResult(_0x440790,null))[_0x0beb('0x43')](handleError(_0x440790,null));};exports[_0x0beb('0x48')]=function(_0x49e17c,_0x2d88dd){return db[_0x0beb('0x2c')]['create'](_0x49e17c[_0x0beb('0x49')],{})[_0x0beb('0x22')](function(_0xc35b29){var _0x311abf=_0x49e17c[_0x0beb('0x4a')][_0x0beb('0x24')]({'plain':!![]});if(!_0x311abf)throw new Error(_0x0beb('0x4b'));if(_0x311abf['role']===_0x0beb('0x4a')){var _0x5232ef=_0xc35b29[_0x0beb('0x24')]({'plain':!![]});var _0x285d23='Companies';return db[_0x0beb('0x4c')][_0x0beb('0x47')]({'where':{'name':_0x285d23,'userProfileId':_0x311abf[_0x0beb('0x4d')]},'raw':!![]})[_0x0beb('0x22')](function(_0x1cd63c){if(_0x1cd63c&&_0x1cd63c[_0x0beb('0x4e')]===0x0){return db[_0x0beb('0x26')][_0x0beb('0x48')]({'name':_0x5232ef['name'],'resourceId':_0x5232ef['id'],'type':_0x1cd63c[_0x0beb('0x29')],'sectionId':_0x1cd63c['id']},{})['then'](function(){return _0xc35b29;});}else{return _0xc35b29;}})[_0x0beb('0x43')](function(_0x256d92){logger[_0x0beb('0x27')](_0x0beb('0x4f'),_0x256d92);throw _0x256d92;});}return _0xc35b29;})[_0x0beb('0x22')](respondWithResult(_0x2d88dd,0xc9))[_0x0beb('0x43')](handleError(_0x2d88dd,null));};exports[_0x0beb('0x21')]=function(_0x19042e,_0x44f75d){if(_0x19042e[_0x0beb('0x49')]['id']){delete _0x19042e['body']['id'];}return db[_0x0beb('0x2c')][_0x0beb('0x47')]({'where':{'id':_0x19042e['params']['id']}})[_0x0beb('0x22')](handleEntityNotFound(_0x44f75d,null))[_0x0beb('0x22')](saveUpdates(_0x19042e[_0x0beb('0x49')],null))['then'](respondWithResult(_0x44f75d,null))[_0x0beb('0x43')](handleError(_0x44f75d,null));};exports['destroy']=function(_0x346f0b,_0x11a64b){return db[_0x0beb('0x2c')]['find']({'where':{'id':_0x346f0b[_0x0beb('0x45')]['id']}})[_0x0beb('0x22')](handleEntityNotFound(_0x11a64b,null))[_0x0beb('0x22')](removeEntity(_0x11a64b,null))[_0x0beb('0x43')](handleError(_0x11a64b,null));};exports[_0x0beb('0x2d')]=function(_0x5c81f3,_0x3f7b04){return db['CmCompany'][_0x0beb('0x2d')]()[_0x0beb('0x22')](respondWithResult(_0x3f7b04,null))[_0x0beb('0x43')](handleError(_0x3f7b04,null));};exports[_0x0beb('0x50')]=function(_0x48c2a1,_0x337045,_0x4b4a20){return db[_0x0beb('0x51')][_0x0beb('0x47')]({'where':{'id':_0x48c2a1[_0x0beb('0x45')]['id']}})['then'](handleEntityNotFound(_0x337045,null))['then'](function(_0x483ac5){if(_0x483ac5){return _0x483ac5[_0x0beb('0x50')](_0x48c2a1['body'][_0x0beb('0x52')],_['omit'](_0x48c2a1[_0x0beb('0x49')],[_0x0beb('0x52'),'id'])||{});}})[_0x0beb('0x22')](respondWithResult(_0x337045,null))[_0x0beb('0x43')](handleError(_0x337045,null));};exports['getContacts']=function(_0x17bae4,_0x5190fd,_0x2ab3d7){var _0x464b31={};var _0x1facc2={};var _0x1a04d1;var _0xef30d1;return db[_0x0beb('0x2c')]['findOne']({'where':{'id':_0x17bae4['params']['id']}})[_0x0beb('0x22')](handleEntityNotFound(_0x5190fd,null))[_0x0beb('0x22')](function(_0x4f5b3a){if(_0x4f5b3a){_0x1a04d1=_0x4f5b3a;_0x1facc2[_0x0beb('0x2e')]=_[_0x0beb('0x2f')](db[_0x0beb('0x51')][_0x0beb('0x46')]);_0x1facc2[_0x0beb('0x30')]=_[_0x0beb('0x2f')](_0x17bae4[_0x0beb('0x30')]);_0x1facc2['filters']=_[_0x0beb('0x32')](_0x1facc2['model'],_0x1facc2['query']);_0x464b31[_0x0beb('0x33')]=_[_0x0beb('0x32')](_0x1facc2[_0x0beb('0x2e')],qs[_0x0beb('0x34')](_0x17bae4['query'][_0x0beb('0x34')]));_0x464b31['attributes']=_0x464b31['attributes'][_0x0beb('0x35')]?_0x464b31[_0x0beb('0x33')]:_0x1facc2[_0x0beb('0x2e')];_0x464b31[_0x0beb('0x38')]=qs['sort'](_0x17bae4[_0x0beb('0x30')][_0x0beb('0x39')]);_0x464b31[_0x0beb('0x3a')]=qs[_0x0beb('0x31')](_[_0x0beb('0x3b')](_0x17bae4['query'],_0x1facc2[_0x0beb('0x31')]));if(_0x17bae4[_0x0beb('0x30')]['filter']){_0x464b31['where']=_[_0x0beb('0x3d')](_0x464b31['where'],{'$or':_['map'](_0x464b31[_0x0beb('0x33')],function(_0x587d7e){var _0x39b8b1={};_0x39b8b1[_0x587d7e]={'$like':'%'+_0x17bae4['query'][_0x0beb('0x3c')]+'%'};return _0x39b8b1;})});}_0x464b31=_[_0x0beb('0x3d')]({},_0x464b31,_0x17bae4[_0x0beb('0x3f')]);return _0x1a04d1['getContacts'](_0x464b31);}})[_0x0beb('0x22')](function(_0x507ad6){if(_0x507ad6){_0xef30d1=_0x507ad6[_0x0beb('0x35')];if(!_0x17bae4[_0x0beb('0x30')][_0x0beb('0x36')](_0x0beb('0x37'))){_0x464b31['limit']=qs[_0x0beb('0x1b')](_0x17bae4[_0x0beb('0x30')][_0x0beb('0x1b')]);_0x464b31[_0x0beb('0x19')]=qs['offset'](_0x17bae4[_0x0beb('0x30')]['offset']);}return _0x1a04d1['getContacts'](_0x464b31);}})['then'](function(_0x16ad9c){if(_0x16ad9c){return _0x16ad9c?{'count':_0xef30d1,'rows':_0x16ad9c}:null;}})['then'](respondWithResult(_0x5190fd,null))[_0x0beb('0x43')](handleError(_0x5190fd,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 394c899..54e1eeb 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 _0xc284=['../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x2e600a,_0x415a78){var _0x330169=function(_0xc069d1){while(--_0xc069d1){_0x2e600a['push'](_0x2e600a['shift']());}};_0x330169(++_0x415a78);}(_0xc284,0x1b5));var _0x4c28=function(_0x272188,_0x56363a){_0x272188=_0x272188-0x0;var _0x2ca472=_0xc284[_0x272188];return _0x2ca472;};'use strict';var _=require(_0x4c28('0x0'));var util=require(_0x4c28('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4c28('0x2'));var BPromise=require(_0x4c28('0x3'));var rp=require(_0x4c28('0x4'));var fs=require('fs');var path=require(_0x4c28('0x5'));var rimraf=require(_0x4c28('0x6'));var config=require(_0x4c28('0x7'));var attributes=require('./cmCompany.attributes');module[_0x4c28('0x8')]=function(_0x4b5b80,_0x454b2f){return _0x4b5b80[_0x4c28('0x9')](_0x4c28('0xa'),attributes,{'tableName':_0x4c28('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2767=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','CmCompany','cm_companies'];(function(_0x20e07a,_0x53d32e){var _0xacd186=function(_0x387593){while(--_0x387593){_0x20e07a['push'](_0x20e07a['shift']());}};_0xacd186(++_0x53d32e);}(_0x2767,0x8f));var _0x7276=function(_0x42dd13,_0x408c01){_0x42dd13=_0x42dd13-0x0;var _0x18cfdd=_0x2767[_0x42dd13];return _0x18cfdd;};'use strict';var _=require(_0x7276('0x0'));var util=require(_0x7276('0x1'));var logger=require(_0x7276('0x2'))(_0x7276('0x3'));var moment=require(_0x7276('0x4'));var BPromise=require(_0x7276('0x5'));var rp=require(_0x7276('0x6'));var fs=require('fs');var path=require(_0x7276('0x7'));var rimraf=require(_0x7276('0x8'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x7276('0x9')]=function(_0x6d8f27,_0x42cfed){return _0x6d8f27[_0x7276('0xa')](_0x7276('0xb'),attributes,{'tableName':_0x7276('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 5dd628b..3cdb30c 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 _0x9471=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x9471,0x1d3));var _0x1947=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9471[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1947('0x0'));var util=require(_0x1947('0x1'));var moment=require(_0x1947('0x2'));var BPromise=require(_0x1947('0x3'));var rs=require(_0x1947('0x4'));var fs=require('fs');var Redis=require(_0x1947('0x5'));var db=require(_0x1947('0x6'))['db'];var utils=require(_0x1947('0x7'));var logger=require(_0x1947('0x8'))(_0x1947('0x9'));var config=require('../../config/environment');var jayson=require(_0x1947('0xa'));var client=jayson[_0x1947('0xb')][_0x1947('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c7a62,_0x46d9ff,_0x2cfba6){return new BPromise(function(_0x5804d2,_0x5f19dd){return client[_0x1947('0xd')](_0x4c7a62,_0x2cfba6)[_0x1947('0xe')](function(_0x4f86d8){logger[_0x1947('0xf')](_0x1947('0x10'),_0x46d9ff,_0x1947('0x11'));logger[_0x1947('0x12')](_0x1947('0x13'),_0x46d9ff,_0x1947('0x11'),JSON[_0x1947('0x14')](_0x4f86d8));if(_0x4f86d8[_0x1947('0x15')]){if(_0x4f86d8[_0x1947('0x15')][_0x1947('0x16')]===0x1f4){logger['error'](_0x1947('0x10'),_0x46d9ff,_0x4f86d8[_0x1947('0x15')]['message']);return _0x5f19dd(_0x4f86d8[_0x1947('0x15')]['message']);}logger[_0x1947('0x15')]('CmCompany,\x20%s,\x20%s',_0x46d9ff,_0x4f86d8[_0x1947('0x15')]['message']);return _0x5804d2(_0x4f86d8[_0x1947('0x15')][_0x1947('0x17')]);}else{logger[_0x1947('0xf')](_0x1947('0x10'),_0x46d9ff,_0x1947('0x11'));_0x5804d2(_0x4f86d8['result'][_0x1947('0x17')]);}})[_0x1947('0x18')](function(_0x4628f1){logger['error'](_0x1947('0x10'),_0x46d9ff,_0x4628f1);_0x5f19dd(_0x4628f1);});});}
\ No newline at end of file
+var _0x0f40=['jayson/promise','client','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xdcbbb,_0x39b964){var _0x19bb4e=function(_0x4952b7){while(--_0x4952b7){_0xdcbbb['push'](_0xdcbbb['shift']());}};_0x19bb4e(++_0x39b964);}(_0x0f40,0xc9));var _0x00f4=function(_0x59522a,_0x14d1e5){_0x59522a=_0x59522a-0x0;var _0x30f09d=_0x0f40[_0x59522a];return _0x30f09d;};'use strict';var _=require(_0x00f4('0x0'));var util=require(_0x00f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x00f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x00f4('0x3'))['db'];var utils=require(_0x00f4('0x4'));var logger=require(_0x00f4('0x5'))(_0x00f4('0x6'));var config=require(_0x00f4('0x7'));var jayson=require(_0x00f4('0x8'));var client=jayson[_0x00f4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed2f9,_0xd66c18,_0x36001c){return new BPromise(function(_0x10fb70,_0x13b260){return client['request'](_0x2ed2f9,_0x36001c)['then'](function(_0x3aa3bb){logger['info'](_0x00f4('0xa'),_0xd66c18,_0x00f4('0xb'));logger[_0x00f4('0xc')](_0x00f4('0xd'),_0xd66c18,_0x00f4('0xb'),JSON['stringify'](_0x3aa3bb));if(_0x3aa3bb[_0x00f4('0xe')]){if(_0x3aa3bb[_0x00f4('0xe')][_0x00f4('0xf')]===0x1f4){logger['error'](_0x00f4('0xa'),_0xd66c18,_0x3aa3bb[_0x00f4('0xe')][_0x00f4('0x10')]);return _0x13b260(_0x3aa3bb['error']['message']);}logger[_0x00f4('0xe')](_0x00f4('0xa'),_0xd66c18,_0x3aa3bb[_0x00f4('0xe')][_0x00f4('0x10')]);return _0x10fb70(_0x3aa3bb[_0x00f4('0xe')][_0x00f4('0x10')]);}else{logger['info'](_0x00f4('0xa'),_0xd66c18,_0x00f4('0xb'));_0x10fb70(_0x3aa3bb[_0x00f4('0x11')][_0x00f4('0x10')]);}})[_0x00f4('0x12')](function(_0x5a8da2){logger[_0x00f4('0xe')](_0x00f4('0xa'),_0xd66c18,_0x5a8da2);_0x13b260(_0x5a8da2);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index cee3a0b..0e1c7ba 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 _0xae3f=['/:id/contacts','addContacts','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create'];(function(_0x5f4a67,_0x4cb2e7){var _0x57faa3=function(_0x465b96){while(--_0x465b96){_0x5f4a67['push'](_0x5f4a67['shift']());}};_0x57faa3(++_0x4cb2e7);}(_0xae3f,0x115));var _0xfae3=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xae3f[_0x1589dd];return _0x1bddd1;};'use strict';var multer=require('multer');var util=require(_0xfae3('0x0'));var path=require('path');var timeout=require(_0xfae3('0x1'));var express=require(_0xfae3('0x2'));var router=express['Router']();var fs_extra=require(_0xfae3('0x3'));var auth=require(_0xfae3('0x4'));var interaction=require(_0xfae3('0x5'));var config=require(_0xfae3('0x6'));var controller=require('./cmCompany.controller');router[_0xfae3('0x7')]('/',auth[_0xfae3('0x8')](),controller[_0xfae3('0x9')]);router['get'](_0xfae3('0xa'),auth[_0xfae3('0x8')](),controller[_0xfae3('0xb')]);router[_0xfae3('0x7')](_0xfae3('0xc'),auth[_0xfae3('0x8')](),controller[_0xfae3('0xd')]);router[_0xfae3('0x7')]('/:id/contacts',auth[_0xfae3('0x8')](),controller[_0xfae3('0xe')]);router[_0xfae3('0xf')]('/',auth[_0xfae3('0x8')](),controller[_0xfae3('0x10')]);router[_0xfae3('0xf')](_0xfae3('0x11'),auth[_0xfae3('0x8')](),controller[_0xfae3('0x12')]);router['put']('/:id',auth[_0xfae3('0x8')](),controller['update']);router['delete'](_0xfae3('0xc'),auth[_0xfae3('0x8')](),controller[_0xfae3('0x13')]);module[_0xfae3('0x14')]=router;
\ No newline at end of file
+var _0x66a3=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts'];(function(_0x1e032e,_0xcaea0a){var _0x3dc166=function(_0x2710fb){while(--_0x2710fb){_0x1e032e['push'](_0x1e032e['shift']());}};_0x3dc166(++_0xcaea0a);}(_0x66a3,0x1c5));var _0x366a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x366a('0x0'));var util=require(_0x366a('0x1'));var path=require(_0x366a('0x2'));var timeout=require(_0x366a('0x3'));var express=require(_0x366a('0x4'));var router=express[_0x366a('0x5')]();var fs_extra=require(_0x366a('0x6'));var auth=require(_0x366a('0x7'));var interaction=require(_0x366a('0x8'));var config=require(_0x366a('0x9'));var controller=require(_0x366a('0xa'));router[_0x366a('0xb')]('/',auth[_0x366a('0xc')](),controller[_0x366a('0xd')]);router['get'](_0x366a('0xe'),auth[_0x366a('0xc')](),controller['describe']);router['get'](_0x366a('0xf'),auth[_0x366a('0xc')](),controller[_0x366a('0x10')]);router[_0x366a('0xb')](_0x366a('0x11'),auth[_0x366a('0xc')](),controller[_0x366a('0x12')]);router['post']('/',auth[_0x366a('0xc')](),controller[_0x366a('0x13')]);router[_0x366a('0x14')]('/:id/contacts',auth[_0x366a('0xc')](),controller[_0x366a('0x15')]);router[_0x366a('0x16')](_0x366a('0xf'),auth[_0x366a('0xc')](),controller[_0x366a('0x17')]);router[_0x366a('0x18')]('/:id',auth[_0x366a('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 799f27f..0efef7f 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 _0x2342=['exports','STRING','INTEGER','UNSIGNED','DATE','lodash'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2342,0x1d9));var _0x2234=function(_0x5843e3,_0x34319e){_0x5843e3=_0x5843e3-0x0;var _0x4e935b=_0x2342[_0x5843e3];return _0x4e935b;};'use strict';var _=require(_0x2234('0x0'));var Sequelize=require('sequelize');module[_0x2234('0x1')]={'firstName':{'type':Sequelize[_0x2234('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x2234('0x2')]},'street':{'type':Sequelize[_0x2234('0x2')]},'postalCode':{'type':Sequelize[_0x2234('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2234('0x2')]},'dateOfBirth':{'type':Sequelize[_0x2234('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x2234('0x2')]},'fax':{'type':Sequelize[_0x2234('0x2')]},'email':{'type':Sequelize[_0x2234('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x2234('0x2')]},'fb_data':{'type':Sequelize[_0x2234('0x2')]},'twitter':{'type':Sequelize[_0x2234('0x2')]},'skype':{'type':Sequelize[_0x2234('0x2')]},'teams':{'type':Sequelize[_0x2234('0x2')]},'viber':{'type':Sequelize[_0x2234('0x2')]},'line':{'type':Sequelize[_0x2234('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x2234('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x2234('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2234('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2234('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x2234('0x3')]}};
\ No newline at end of file
+var _0xf5f3=['NOW','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xf5f3,0xb9));var _0x3f5f=function(_0x563828,_0xa51f73){_0x563828=_0x563828-0x0;var _0x3508d2=_0xf5f3[_0x563828];return _0x3508d2;};'use strict';var _=require('lodash');var Sequelize=require(_0x3f5f('0x0'));module[_0x3f5f('0x1')]={'firstName':{'type':Sequelize[_0x3f5f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3f5f('0x2')]},'street':{'type':Sequelize[_0x3f5f('0x2')]},'postalCode':{'type':Sequelize[_0x3f5f('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3f5f('0x2')]},'dateOfBirth':{'type':Sequelize[_0x3f5f('0x2')]},'description':{'type':Sequelize[_0x3f5f('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3f5f('0x2')]},'email':{'type':Sequelize[_0x3f5f('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3f5f('0x2')]},'twitter':{'type':Sequelize[_0x3f5f('0x2')]},'skype':{'type':Sequelize[_0x3f5f('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x3f5f('0x2')]},'line':{'type':Sequelize[_0x3f5f('0x2')]},'wechat':{'type':Sequelize[_0x3f5f('0x2')]},'telegram':{'type':Sequelize[_0x3f5f('0x2')]},'UserId':{'type':Sequelize[_0x3f5f('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3f5f('0x4')](0x2)[_0x3f5f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3f5f('0x6')],'defaultValue':Sequelize[_0x3f5f('0x7')]},'dialTimezone':{'type':Sequelize[_0x3f5f('0x2')]},'utcOffset':{'type':Sequelize[_0x3f5f('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index df0d888..ea42a4c 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','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!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','moment'];(function(_0x267be3,_0x18ef5f){var _0x57fe29=function(_0x5bb754){while(--_0x5bb754){_0x267be3['push'](_0x267be3['shift']());}};_0x57fe29(++_0x18ef5f);}(_0x21bb,0x12e));var _0xb21b=function(_0x2c1171,_0x3572d2){_0x2c1171=_0x2c1171-0x0;var _0x13f475=_0x21bb[_0x2c1171];return _0x13f475;};'use strict';var _=require(_0xb21b('0x0'));var moment=require(_0xb21b('0x1'));var random=require(_0xb21b('0x2'));var fs=require('fs');var path=require(_0xb21b('0x3'));var util=require(_0xb21b('0x4'));var tnef=require(_0xb21b('0x5'));var logger=require(_0xb21b('0x6'))('email');var config=require(_0xb21b('0x7'));function getAddress(_0x215fc4){var _0x5e9ef9=_[_0xb21b('0x8')](_0x215fc4['value']);return _0x5e9ef9&&_0x5e9ef9['address']?_0x5e9ef9[_0xb21b('0x9')]:_0xb21b('0xa')+random[_0xb21b('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x4c6265){var _0x127f82=_['head'](_0x4c6265['value']);if(_0x127f82&&_0x127f82[_0xb21b('0xc')]){if(_0x127f82['name']==_0x127f82[_0xb21b('0x9')]){return _0x127f82[_0xb21b('0xc')]['substring'](0x0,_0x127f82['name'][_0xb21b('0xd')]('@'));}var _0x43491c=_0x127f82[_0xb21b('0xc')][_0xb21b('0xe')](/\s+/);return _0x43491c[_0xb21b('0xf')]>0x1?_0x43491c['slice'](0x0,-0x1)[_0xb21b('0x10')]('\x20'):_0x127f82['name'];}return _0xb21b('0x11');}function getLastName(_0x374395){var _0x1ad41b=_[_0xb21b('0x8')](_0x374395[_0xb21b('0x12')]);if(_0x1ad41b&&_0x1ad41b[_0xb21b('0xc')]){var _0x1aec9c=_0x1ad41b[_0xb21b('0xc')][_0xb21b('0xe')](/\s+/);return _0x1aec9c['length']>0x1?_0x1aec9c[_0xb21b('0x13')]():'';}return'';}function getMails(_0x48c418,_0x57d52a){var _0x5ab638='';for(var _0x4a3556=0x0;_0x4a3556<_0x57d52a['value'][_0xb21b('0xf')];_0x4a3556+=0x1){if(_0x57d52a[_0xb21b('0x12')][_0x4a3556][_0xb21b('0x9')]!==_0x48c418){if(!_[_0xb21b('0x14')](_0x5ab638)){_0x5ab638+=',';}_0x5ab638+=_0x57d52a[_0xb21b('0x12')][_0x4a3556][_0xb21b('0xc')]||_0x57d52a['value'][_0x4a3556][_0xb21b('0x9')]||'';_0x5ab638+='\x20<';_0x5ab638+=_0x57d52a[_0xb21b('0x12')][_0x4a3556]['address']?_0x57d52a['value'][_0x4a3556]['address']:_0xb21b('0xa')+random[_0xb21b('0xb')](0x6)+'@xcally.com';_0x5ab638+='>';}}return _0x5ab638;}function parseEmail(_0x299bdf,_0x2c8d5e,_0x2e7463){if(_0x2c8d5e[_0xb21b('0x15')]){var _0x7e0f13=/