From 16150c52ac3db5d0f09443a16ae5bb51ff2e5fb9 Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Wed, 9 Feb 2022 09:00:58 +0100
Subject: [PATCH] Built motion from commit b9adbb98.|2.6.1
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
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/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/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/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/additionalPhone.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/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/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1187 files changed, 1187 insertions(+), 1187 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 84d3856..6909d6e 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-02-08T14:59:52.266Z",
+ "time": "2022-02-09T07:52:27.516Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9a4ed1d..3b630fb 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-02-08T14:59:52.266Z",
+ "time": "2022-02-09T07:52:27.516Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 0b6c574..b085bf9 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 _0x9fa8=['contactManager','integration','motionbar','jscripty','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','contactManager[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[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x9fa8,0x12b));var _0x89fa=function(_0x4ef354,_0x23e5a0){_0x4ef354=_0x4ef354-0x0;var _0x24a46e=_0x9fa8[_0x4ef354];return _0x24a46e;};'use strict';var Sequelize=require(_0x89fa('0x0'));module[_0x89fa('0x1')]={'name':{'type':Sequelize[_0x89fa('0x2')],'get':function(_0x147ebd){return this[_0x89fa('0x3')](_0x89fa('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x89fa('0x5'),_0x89fa('0x6'),_0x89fa('0x7'),_0x89fa('0x8'),_0x89fa('0x9'),_0x89fa('0xa'),'bot','script']],'msg':_0x89fa('0xb')}},'comment':_0x89fa('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x89fa('0xc')},'data2':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comment':_0x89fa('0xe')},'data3':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comment':_0x89fa('0xf')},'data4':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comments':_0x89fa('0x10')},'data5':{'type':Sequelize[_0x89fa('0xd')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x89fa('0xd')],'comments':_0x89fa('0x11')},'data7':{'type':Sequelize[_0x89fa('0x12')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x45f7=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]'];(function(_0x4fdd3f,_0x2d3d16){var _0x3e2348=function(_0x37f10a){while(--_0x37f10a){_0x4fdd3f['push'](_0x4fdd3f['shift']());}};_0x3e2348(++_0x2d3d16);}(_0x45f7,0x148));var _0x745f=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x45f7[_0x454e6d];return _0x4bc294;};'use strict';var Sequelize=require('sequelize');module[_0x745f('0x0')]={'name':{'type':Sequelize[_0x745f('0x1')],'get':function(_0x43b766){return this[_0x745f('0x2')](_0x745f('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0x745f('0x4'),_0x745f('0x5'),'urlForward',_0x745f('0x6'),'bot',_0x745f('0x7')]],'msg':_0x745f('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x745f('0x9')](0x1000),'comment':_0x745f('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x745f('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x745f('0xc')},'data4':{'type':Sequelize[_0x745f('0x9')](0x1000),'comments':_0x745f('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x745f('0xe')},'data6':{'type':Sequelize[_0x745f('0x9')],'comments':_0x745f('0xf')},'data7':{'type':Sequelize[_0x745f('0x10')],'comments':_0x745f('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 8b29f2c..6ce76e4 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 _0x7555=['reject','save','update','then','stack','name','body','find','params','catch','Action','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit'];(function(_0xef42a3,_0x50805d){var _0x42d1d3=function(_0x198383){while(--_0x198383){_0xef42a3['push'](_0xef42a3['shift']());}};_0x42d1d3(++_0x50805d);}(_0x7555,0x65));var _0x5755=function(_0x302ff9,_0x1a8faf){_0x302ff9=_0x302ff9-0x0;var _0x39cbf0=_0x7555[_0x302ff9];return _0x39cbf0;};'use strict';var emlformat=require(_0x5755('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5755('0x1'));var jsonpatch=require(_0x5755('0x2'));var rp=require(_0x5755('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5755('0x4'));var util=require(_0x5755('0x5'));var path=require(_0x5755('0x6'));var sox=require(_0x5755('0x7'));var csv=require(_0x5755('0x8'));var ejs=require(_0x5755('0x9'));var fs=require('fs');var fs_extra=require(_0x5755('0xa'));var _=require(_0x5755('0xb'));var squel=require(_0x5755('0xc'));var crypto=require(_0x5755('0xd'));var jsforce=require(_0x5755('0xe'));var deskjs=require(_0x5755('0xf'));var toCsv=require(_0x5755('0x8'));var querystring=require('querystring');var Papa=require(_0x5755('0x10'));var Redis=require(_0x5755('0x11'));var authService=require(_0x5755('0x12'));var qs=require(_0x5755('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5755('0x14'));var logger=require(_0x5755('0x15'))('api');var utils=require(_0x5755('0x16'));var config=require(_0x5755('0x17'));var licenseUtil=require(_0x5755('0x18'));var db=require(_0x5755('0x19'))['db'];function respondWithStatusCode(_0x578d7d,_0x5b73df){_0x5b73df=_0x5b73df||0xcc;return function(_0xd15a0a){if(_0xd15a0a){return _0x578d7d[_0x5755('0x1a')](_0x5b73df);}return _0x578d7d[_0x5755('0x1b')](_0x5b73df)[_0x5755('0x1c')]();};}function respondWithResult(_0x56b05c,_0x324c82){_0x324c82=_0x324c82||0xc8;return function(_0x12edeb){if(_0x12edeb){return _0x56b05c[_0x5755('0x1b')](_0x324c82)[_0x5755('0x1d')](_0x12edeb);}};}function respondWithFilteredResult(_0x13b95d,_0x6a5b65){return function(_0x412902){if(_0x412902){var _0x1c4403=typeof _0x6a5b65['offset']===_0x5755('0x1e')&&typeof _0x6a5b65['limit']===_0x5755('0x1e');var _0x97f22=_0x412902[_0x5755('0x1f')];var _0x489b25=_0x1c4403?0x0:_0x6a5b65[_0x5755('0x20')];var _0x36365f=_0x1c4403?_0x412902[_0x5755('0x1f')]:_0x6a5b65[_0x5755('0x20')]+_0x6a5b65[_0x5755('0x21')];var _0x2c92b4;if(_0x36365f>=_0x97f22){_0x36365f=_0x97f22;_0x2c92b4=0xc8;}else{_0x2c92b4=0xce;}_0x13b95d[_0x5755('0x1b')](_0x2c92b4);return _0x13b95d['set']('Content-Range',_0x489b25+'-'+_0x36365f+'/'+_0x97f22)[_0x5755('0x1d')](_0x412902);}return null;};}function patchUpdates(_0x2f73c3){return function(_0x1887fd){try{jsonpatch['apply'](_0x1887fd,_0x2f73c3,!![]);}catch(_0x3d9cfa){return BPromise[_0x5755('0x22')](_0x3d9cfa);}return _0x1887fd[_0x5755('0x23')]();};}function saveUpdates(_0x11dc58,_0x4565e7){return function(_0x57fc72){if(_0x57fc72){return _0x57fc72[_0x5755('0x24')](_0x11dc58)['then'](function(_0x52152c){return _0x52152c;});}return null;};}function removeEntity(_0x437624,_0x5748fa){return function(_0x25f19b){if(_0x25f19b){return _0x25f19b['destroy']()[_0x5755('0x25')](function(){_0x437624[_0x5755('0x1b')](0xcc)[_0x5755('0x1c')]();});}};}function handleEntityNotFound(_0x3f0a33,_0x1258bc){return function(_0x566391){if(!_0x566391){_0x3f0a33['sendStatus'](0x194);}return _0x566391;};}function handleError(_0x426043,_0x5a8e48){_0x5a8e48=_0x5a8e48||0x1f4;return function(_0xbf9144){logger['error'](_0xbf9144[_0x5755('0x26')]);if(_0xbf9144[_0x5755('0x27')]){delete _0xbf9144[_0x5755('0x27')];}_0x426043['status'](_0x5a8e48)['send'](_0xbf9144);};}exports[_0x5755('0x24')]=function(_0x29a82f,_0x3d09bb){if(_0x29a82f[_0x5755('0x28')]['id']){delete _0x29a82f['body']['id'];}return db['Action'][_0x5755('0x29')]({'where':{'id':_0x29a82f[_0x5755('0x2a')]['id']}})[_0x5755('0x25')](handleEntityNotFound(_0x3d09bb,null))[_0x5755('0x25')](saveUpdates(_0x29a82f['body'],null))['then'](respondWithResult(_0x3d09bb,null))[_0x5755('0x2b')](handleError(_0x3d09bb,null));};exports['destroy']=function(_0x466913,_0x2e65b4){return db[_0x5755('0x2c')]['find']({'where':{'id':_0x466913[_0x5755('0x2a')]['id']}})[_0x5755('0x25')](handleEntityNotFound(_0x2e65b4,null))[_0x5755('0x25')](removeEntity(_0x2e65b4,null))[_0x5755('0x2b')](handleError(_0x2e65b4,null));};
\ No newline at end of file
+var _0x5518=['find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','Action'];(function(_0x144863,_0x4e6697){var _0x557a96=function(_0x1d4244){while(--_0x1d4244){_0x144863['push'](_0x144863['shift']());}};_0x557a96(++_0x4e6697);}(_0x5518,0x1b3));var _0x8551=function(_0x10c6ef,_0x5534fe){_0x10c6ef=_0x10c6ef-0x0;var _0x160322=_0x5518[_0x10c6ef];return _0x160322;};'use strict';var emlformat=require(_0x8551('0x0'));var rimraf=require(_0x8551('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8551('0x2'));var rp=require(_0x8551('0x3'));var moment=require(_0x8551('0x4'));var BPromise=require(_0x8551('0x5'));var Mustache=require(_0x8551('0x6'));var util=require(_0x8551('0x7'));var path=require(_0x8551('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8551('0x9'));var fs=require('fs');var fs_extra=require(_0x8551('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8551('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8551('0xc'));var querystring=require(_0x8551('0xd'));var Papa=require(_0x8551('0xe'));var Redis=require(_0x8551('0xf'));var authService=require(_0x8551('0x10'));var qs=require(_0x8551('0x11'));var as=require(_0x8551('0x12'));var hardwareService=require(_0x8551('0x13'));var logger=require(_0x8551('0x14'))('api');var utils=require(_0x8551('0x15'));var config=require(_0x8551('0x16'));var licenseUtil=require(_0x8551('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aa976,_0x53974f){_0x53974f=_0x53974f||0xcc;return function(_0x314d9d){if(_0x314d9d){return _0x1aa976['sendStatus'](_0x53974f);}return _0x1aa976[_0x8551('0x18')](_0x53974f)[_0x8551('0x19')]();};}function respondWithResult(_0x5a739e,_0x17c5a3){_0x17c5a3=_0x17c5a3||0xc8;return function(_0x5babc8){if(_0x5babc8){return _0x5a739e[_0x8551('0x18')](_0x17c5a3)[_0x8551('0x1a')](_0x5babc8);}};}function respondWithFilteredResult(_0x33921d,_0x2ab5e6){return function(_0x28ecba){if(_0x28ecba){var _0x1c5083=typeof _0x2ab5e6['offset']===_0x8551('0x1b')&&typeof _0x2ab5e6[_0x8551('0x1c')]===_0x8551('0x1b');var _0x4fc2aa=_0x28ecba[_0x8551('0x1d')];var _0x39f5bb=_0x1c5083?0x0:_0x2ab5e6['offset'];var _0x11b7c0=_0x1c5083?_0x28ecba[_0x8551('0x1d')]:_0x2ab5e6['offset']+_0x2ab5e6[_0x8551('0x1c')];var _0x16e9dc;if(_0x11b7c0>=_0x4fc2aa){_0x11b7c0=_0x4fc2aa;_0x16e9dc=0xc8;}else{_0x16e9dc=0xce;}_0x33921d['status'](_0x16e9dc);return _0x33921d[_0x8551('0x1e')](_0x8551('0x1f'),_0x39f5bb+'-'+_0x11b7c0+'/'+_0x4fc2aa)[_0x8551('0x1a')](_0x28ecba);}return null;};}function patchUpdates(_0x2df243){return function(_0x5515a3){try{jsonpatch[_0x8551('0x20')](_0x5515a3,_0x2df243,!![]);}catch(_0x54e803){return BPromise[_0x8551('0x21')](_0x54e803);}return _0x5515a3[_0x8551('0x22')]();};}function saveUpdates(_0x4350dc,_0x5cd9b7){return function(_0x3e358b){if(_0x3e358b){return _0x3e358b[_0x8551('0x23')](_0x4350dc)[_0x8551('0x24')](function(_0x26ecda){return _0x26ecda;});}return null;};}function removeEntity(_0x266bbd,_0x58cbb7){return function(_0x8fefd4){if(_0x8fefd4){return _0x8fefd4[_0x8551('0x25')]()[_0x8551('0x24')](function(){_0x266bbd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e5a94,_0x46112e){return function(_0x3e6e03){if(!_0x3e6e03){_0x4e5a94[_0x8551('0x26')](0x194);}return _0x3e6e03;};}function handleError(_0x518dd6,_0x43ec1c){_0x43ec1c=_0x43ec1c||0x1f4;return function(_0x2047c1){logger[_0x8551('0x27')](_0x2047c1[_0x8551('0x28')]);if(_0x2047c1[_0x8551('0x29')]){delete _0x2047c1[_0x8551('0x29')];}_0x518dd6[_0x8551('0x18')](_0x43ec1c)[_0x8551('0x2a')](_0x2047c1);};}exports[_0x8551('0x23')]=function(_0x1fe741,_0x563634){if(_0x1fe741[_0x8551('0x2b')]['id']){delete _0x1fe741[_0x8551('0x2b')]['id'];}return db[_0x8551('0x2c')][_0x8551('0x2d')]({'where':{'id':_0x1fe741[_0x8551('0x2e')]['id']}})['then'](handleEntityNotFound(_0x563634,null))[_0x8551('0x24')](saveUpdates(_0x1fe741[_0x8551('0x2b')],null))[_0x8551('0x24')](respondWithResult(_0x563634,null))[_0x8551('0x2f')](handleError(_0x563634,null));};exports[_0x8551('0x25')]=function(_0x54a88f,_0x29b7e6){return db[_0x8551('0x2c')][_0x8551('0x2d')]({'where':{'id':_0x54a88f[_0x8551('0x2e')]['id']}})[_0x8551('0x24')](handleEntityNotFound(_0x29b7e6,null))[_0x8551('0x24')](removeEntity(_0x29b7e6,null))[_0x8551('0x2f')](handleError(_0x29b7e6,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 93e8e36..55ae4dc 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 _0x5a4d=['bluebird','request-promise','path','rimraf','./action.attributes','Action','tools_actions','lodash','../../config/logger','moment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5a4d,0x18d));var _0xd5a4=function(_0x1985a6,_0xf5988a){_0x1985a6=_0x1985a6-0x0;var _0x130395=_0x5a4d[_0x1985a6];return _0x130395;};'use strict';var _=require(_0xd5a4('0x0'));var util=require('util');var logger=require(_0xd5a4('0x1'))('api');var moment=require(_0xd5a4('0x2'));var BPromise=require(_0xd5a4('0x3'));var rp=require(_0xd5a4('0x4'));var fs=require('fs');var path=require(_0xd5a4('0x5'));var rimraf=require(_0xd5a4('0x6'));var config=require('../../config/environment');var attributes=require(_0xd5a4('0x7'));module['exports']=function(_0x431b4b,_0x4d5ff9){return _0x431b4b['define'](_0xd5a4('0x8'),attributes,{'tableName':_0xd5a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1ef=['Action','tools_actions','lodash','../../config/logger','api','bluebird','path','rimraf','./action.attributes'];(function(_0xa25b20,_0x2c8254){var _0x387ba4=function(_0xddf94d){while(--_0xddf94d){_0xa25b20['push'](_0xa25b20['shift']());}};_0x387ba4(++_0x2c8254);}(_0xb1ef,0x146));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfb1e('0x0'));var util=require('util');var logger=require(_0xfb1e('0x1'))(_0xfb1e('0x2'));var moment=require('moment');var BPromise=require(_0xfb1e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb1e('0x4'));var rimraf=require(_0xfb1e('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb1e('0x6'));module['exports']=function(_0x33b9ca,_0x4a44e2){return _0x33b9ca['define'](_0xfb1e('0x7'),attributes,{'tableName':_0xfb1e('0x8'),'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 7aa9d8a..9de24c1 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2332ac,_0x318329){var _0x1ed7a7=function(_0x44f10a){while(--_0x44f10a){_0x2332ac['push'](_0x2332ac['shift']());}};_0x1ed7a7(++_0x318329);}(_0x5fc3,0xa8));var _0x35fc=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0x5fc3[_0x41bdd4];return _0x5c03a6;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x290d20,_0x3d2b74){var _0x4b5056=function(_0x5e91bb){while(--_0x5e91bb){_0x290d20['push'](_0x290d20['shift']());}};_0x4b5056(++_0x3d2b74);}(_0x1261,0x144));var _0x1126=function(_0x2c3458,_0x1f7efd){_0x2c3458=_0x2c3458-0x0;var _0x3f7e02=_0x1261[_0x2c3458];return _0x3f7e02;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 4cf3930..a322f7d 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 _0x3edf=['exports','multer','path','express','fs-extra','../../config/environment','put','delete','isAuthenticated'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x3edf,0x1e7));var _0xf3ed=function(_0x1654ab,_0x41a7fb){_0x1654ab=_0x1654ab-0x0;var _0x113be2=_0x3edf[_0x1654ab];return _0x113be2;};'use strict';var multer=require(_0xf3ed('0x0'));var util=require('util');var path=require(_0xf3ed('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3ed('0x2'));var router=express['Router']();var fs_extra=require(_0xf3ed('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf3ed('0x4'));var controller=require('./action.controller');router[_0xf3ed('0x5')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf3ed('0x6')]('/:id',auth[_0xf3ed('0x7')](),controller['destroy']);module[_0xf3ed('0x8')]=router;
\ No newline at end of file
+var _0x3a74=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update'];(function(_0x1c7152,_0x3a94f1){var _0x17747a=function(_0x2e9f87){while(--_0x2e9f87){_0x1c7152['push'](_0x1c7152['shift']());}};_0x17747a(++_0x3a94f1);}(_0x3a74,0x93));var _0x43a7=function(_0x1e7be1,_0x161891){_0x1e7be1=_0x1e7be1-0x0;var _0x5c9c54=_0x3a74[_0x1e7be1];return _0x5c9c54;};'use strict';var multer=require(_0x43a7('0x0'));var util=require(_0x43a7('0x1'));var path=require(_0x43a7('0x2'));var timeout=require(_0x43a7('0x3'));var express=require(_0x43a7('0x4'));var router=express['Router']();var fs_extra=require(_0x43a7('0x5'));var auth=require(_0x43a7('0x6'));var interaction=require(_0x43a7('0x7'));var config=require(_0x43a7('0x8'));var controller=require(_0x43a7('0x9'));router['put'](_0x43a7('0xa'),auth[_0x43a7('0xb')](),controller[_0x43a7('0xc')]);router[_0x43a7('0xd')](_0x43a7('0xa'),auth['isAuthenticated'](),controller[_0x43a7('0xe')]);module[_0x43a7('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d1c1ded..0b81e3d 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 _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x253c60,_0x2b47ef){var _0x4b7ca1=function(_0x37d0da){while(--_0x37d0da){_0x253c60['push'](_0x253c60['shift']());}};_0x4b7ca1(++_0x2b47ef);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3012f5,_0x3ed0bf){_0x3012f5=_0x3012f5-0x0;var _0x5395db=_0x9c5a[_0x3012f5];return _0x5395db;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x292c18,_0x5ac463){var _0x5b1235=function(_0x37dce3){while(--_0x37dce3){_0x292c18['push'](_0x292c18['shift']());}};_0x5b1235(++_0x5ac463);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'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 ee1a523..ddd4849 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 _0xe77e=['right_join','value','Sequelize','ValidationErrorItem','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','destroy','then','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','AnalyticCustomReport','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','clone','debug','toString','sequelize','QueryTypes'];(function(_0x2c3def,_0x34b7c2){var _0x55b215=function(_0x3904f3){while(--_0x3904f3){_0x2c3def['push'](_0x2c3def['shift']());}};_0x55b215(++_0x34b7c2);}(_0xe77e,0xc4));var _0xee77=function(_0x4d9428,_0x1a7508){_0x4d9428=_0x4d9428-0x0;var _0x1d49f3=_0xe77e[_0x4d9428];return _0x1d49f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee77('0x0'));var zipdir=require(_0xee77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee77('0x2'));var moment=require(_0xee77('0x3'));var BPromise=require(_0xee77('0x4'));var Mustache=require(_0xee77('0x5'));var util=require(_0xee77('0x6'));var path=require(_0xee77('0x7'));var sox=require(_0xee77('0x8'));var csv=require(_0xee77('0x9'));var ejs=require(_0xee77('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xee77('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xee77('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee77('0xd'));var Redis=require(_0xee77('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xee77('0xf'));var as=require(_0xee77('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee77('0x11'))(_0xee77('0x12'));var utils=require(_0xee77('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xee77('0x14'));var db=require(_0xee77('0x15'))['db'];var dbH=require('../../mysqldb')[_0xee77('0x16')];function respondWithStatusCode(_0x3bf2b9,_0x35f147){_0x35f147=_0x35f147||0xcc;return function(_0x2f7beb){if(_0x2f7beb){return _0x3bf2b9['sendStatus'](_0x35f147);}return _0x3bf2b9[_0xee77('0x17')](_0x35f147)[_0xee77('0x18')]();};}function respondWithResult(_0x2373b2,_0x3e1412){_0x3e1412=_0x3e1412||0xc8;return function(_0x35fc40){if(_0x35fc40){return _0x2373b2[_0xee77('0x17')](_0x3e1412)['json'](_0x35fc40);}};}function respondWithFilteredResult(_0x117e06,_0x384c00){return function(_0x28d55a){if(_0x28d55a){var _0x455dca=typeof _0x384c00[_0xee77('0x19')]==='undefined'&&typeof _0x384c00[_0xee77('0x1a')]===_0xee77('0x1b');var _0x39bbd2=_0x28d55a[_0xee77('0x1c')];var _0x10f837=_0x455dca?0x0:_0x384c00['offset'];var _0xda448b=_0x455dca?_0x28d55a[_0xee77('0x1c')]:_0x384c00[_0xee77('0x19')]+_0x384c00['limit'];var _0x1513e8;if(_0xda448b>=_0x39bbd2){_0xda448b=_0x39bbd2;_0x1513e8=0xc8;}else{_0x1513e8=0xce;}_0x117e06[_0xee77('0x17')](_0x1513e8);return _0x117e06[_0xee77('0x1d')](_0xee77('0x1e'),_0x10f837+'-'+_0xda448b+'/'+_0x39bbd2)[_0xee77('0x1f')](_0x28d55a);}return null;};}function patchUpdates(_0x26c880){return function(_0x1ab640){try{jsonpatch[_0xee77('0x20')](_0x1ab640,_0x26c880,!![]);}catch(_0x1ce343){return BPromise['reject'](_0x1ce343);}return _0x1ab640[_0xee77('0x21')]();};}function saveUpdates(_0xc0ea04,_0x3c2f23){return function(_0x31bd8b){if(_0x31bd8b){return _0x31bd8b['update'](_0xc0ea04)['then'](function(_0xa40dad){return _0xa40dad;});}return null;};}function removeEntity(_0x1ba5f0,_0x15e9c1){return function(_0x290052){if(_0x290052){return _0x290052[_0xee77('0x22')]()[_0xee77('0x23')](function(){var _0x39248b=_0x290052['get']({'plain':!![]});var _0x4bf852=_0xee77('0x24');return db[_0xee77('0x25')][_0xee77('0x22')]({'where':{'type':_0x4bf852,'resourceId':_0x39248b['id']}})[_0xee77('0x23')](function(){return _0x290052;});})[_0xee77('0x23')](function(){_0x1ba5f0['status'](0xcc)[_0xee77('0x18')]();});}};}function handleEntityNotFound(_0x219fa7,_0x25d942){return function(_0x49bd05){if(!_0x49bd05){_0x219fa7[_0xee77('0x26')](0x194);}return _0x49bd05;};}function handleError(_0x1a8256,_0x737f40){_0x737f40=_0x737f40||0x1f4;return function(_0x2ec5d3){logger[_0xee77('0x27')](_0x2ec5d3[_0xee77('0x28')]);if(_0x2ec5d3[_0xee77('0x29')]){delete _0x2ec5d3['name'];}_0x1a8256['status'](_0x737f40)[_0xee77('0x2a')](_0x2ec5d3);};}exports[_0xee77('0x2b')]=function(_0x35fee7,_0x1dff09){var _0x63c197={},_0x3f3834={},_0x239895={'count':0x0,'rows':[]};var _0x2b4499=_['map'](db[_0xee77('0x2c')]['rawAttributes'],function(_0x1bf213){return{'name':_0x1bf213['fieldName'],'type':_0x1bf213[_0xee77('0x2d')][_0xee77('0x2e')]};});_0x3f3834[_0xee77('0x2f')]=_[_0xee77('0x30')](_0x2b4499,_0xee77('0x29'));_0x3f3834[_0xee77('0x31')]=_[_0xee77('0x32')](_0x35fee7['query']);_0x3f3834['filters']=_['intersection'](_0x3f3834[_0xee77('0x2f')],_0x3f3834[_0xee77('0x31')]);_0x63c197[_0xee77('0x33')]=_['intersection'](_0x3f3834[_0xee77('0x2f')],qs[_0xee77('0x34')](_0x35fee7[_0xee77('0x31')][_0xee77('0x34')]));_0x63c197[_0xee77('0x33')]=_0x63c197['attributes'][_0xee77('0x35')]?_0x63c197[_0xee77('0x33')]:_0x3f3834[_0xee77('0x2f')];if(!_0x35fee7[_0xee77('0x31')][_0xee77('0x36')](_0xee77('0x37'))){_0x63c197[_0xee77('0x1a')]=qs[_0xee77('0x1a')](_0x35fee7[_0xee77('0x31')][_0xee77('0x1a')]);_0x63c197[_0xee77('0x19')]=qs['offset'](_0x35fee7['query'][_0xee77('0x19')]);}_0x63c197[_0xee77('0x38')]=qs[_0xee77('0x39')](_0x35fee7[_0xee77('0x31')][_0xee77('0x39')]);_0x63c197[_0xee77('0x3a')]=qs[_0xee77('0x3b')](_['pick'](_0x35fee7[_0xee77('0x31')],_0x3f3834['filters']),_0x2b4499);if(_0x35fee7[_0xee77('0x31')]['filter']){_0x63c197[_0xee77('0x3a')]=_[_0xee77('0x3c')](_0x63c197['where'],{'$or':_['map'](_0x2b4499,function(_0x31a2e0){if(_0x31a2e0[_0xee77('0x2d')]!==_0xee77('0x3d')){var _0x49118d={};_0x49118d[_0x31a2e0['name']]={'$like':'%'+_0x35fee7[_0xee77('0x31')][_0xee77('0x3e')]+'%'};return _0x49118d;}})});}_0x63c197=_[_0xee77('0x3c')]({},_0x63c197,_0x35fee7[_0xee77('0x3f')]);var _0x3e21a7={'where':_0x63c197[_0xee77('0x3a')]};return db[_0xee77('0x2c')][_0xee77('0x1c')](_0x3e21a7)[_0xee77('0x23')](function(_0x2373e7){_0x239895[_0xee77('0x1c')]=_0x2373e7;if(_0x35fee7['query'][_0xee77('0x40')]){_0x63c197['include']=[{'all':!![]}];}return db[_0xee77('0x2c')][_0xee77('0x41')](_0x63c197);})[_0xee77('0x23')](function(_0x10f6cb){_0x239895[_0xee77('0x42')]=_0x10f6cb;return _0x239895;})['then'](respondWithFilteredResult(_0x1dff09,_0x63c197))[_0xee77('0x43')](handleError(_0x1dff09,null));};exports[_0xee77('0x44')]=function(_0x5d494e,_0x2ab15b){var _0x1f7c83={'raw':![],'where':{'id':_0x5d494e[_0xee77('0x45')]['id']}},_0x35fe82={};_0x35fe82[_0xee77('0x2f')]=_[_0xee77('0x32')](db[_0xee77('0x2c')][_0xee77('0x46')]);_0x35fe82['query']=_[_0xee77('0x32')](_0x5d494e[_0xee77('0x31')]);_0x35fe82[_0xee77('0x3b')]=_[_0xee77('0x47')](_0x35fe82[_0xee77('0x2f')],_0x35fe82[_0xee77('0x31')]);_0x1f7c83[_0xee77('0x33')]=_[_0xee77('0x47')](_0x35fe82['model'],qs[_0xee77('0x34')](_0x5d494e[_0xee77('0x31')][_0xee77('0x34')]));_0x1f7c83[_0xee77('0x33')]=_0x1f7c83[_0xee77('0x33')][_0xee77('0x35')]?_0x1f7c83[_0xee77('0x33')]:_0x35fe82[_0xee77('0x2f')];if(_0x5d494e[_0xee77('0x31')][_0xee77('0x40')]){_0x1f7c83[_0xee77('0x48')]=[{'all':!![]}];}_0x1f7c83=_[_0xee77('0x3c')]({},_0x1f7c83,_0x5d494e[_0xee77('0x3f')]);return db[_0xee77('0x2c')][_0xee77('0x49')](_0x1f7c83)[_0xee77('0x23')](handleEntityNotFound(_0x2ab15b,null))[_0xee77('0x23')](respondWithResult(_0x2ab15b,null))['catch'](handleError(_0x2ab15b,null));};exports[_0xee77('0x4a')]=function(_0x3b912c,_0x3b3a48){return db[_0xee77('0x2c')][_0xee77('0x4a')](_0x3b912c[_0xee77('0x4b')],{})['then'](function(_0x2f3587){var _0x2bf4ef=_0x3b912c[_0xee77('0x4c')][_0xee77('0x4d')]({'plain':!![]});if(!_0x2bf4ef)throw new Error(_0xee77('0x4e'));if(_0x2bf4ef[_0xee77('0x4f')]==='user'){var _0x590daf=_0x2f3587['get']({'plain':!![]});var _0x4ef38e=_0xee77('0x50');return db[_0xee77('0x51')][_0xee77('0x49')]({'where':{'name':_0x4ef38e,'userProfileId':_0x2bf4ef[_0xee77('0x52')]},'raw':!![]})['then'](function(_0x528050){if(_0x528050&&_0x528050[_0xee77('0x53')]===0x0){return db[_0xee77('0x25')]['create']({'name':_0x590daf[_0xee77('0x29')],'resourceId':_0x590daf['id'],'type':'CustomReports','sectionId':_0x528050['id']},{})[_0xee77('0x23')](function(){return _0x2f3587;});}else{return _0x2f3587;}})[_0xee77('0x43')](function(_0x36b779){logger[_0xee77('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36b779);throw _0x36b779;});}return _0x2f3587;})[_0xee77('0x23')](respondWithResult(_0x3b3a48,0xc9))[_0xee77('0x43')](handleError(_0x3b3a48,null));};exports[_0xee77('0x54')]=function(_0x13b024,_0x422818){if(_0x13b024[_0xee77('0x4b')]['id']){delete _0x13b024[_0xee77('0x4b')]['id'];}return db[_0xee77('0x2c')][_0xee77('0x49')]({'where':{'id':_0x13b024['params']['id']}})[_0xee77('0x23')](handleEntityNotFound(_0x422818,null))[_0xee77('0x23')](saveUpdates(_0x13b024['body'],null))[_0xee77('0x23')](respondWithResult(_0x422818,null))[_0xee77('0x43')](handleError(_0x422818,null));};exports[_0xee77('0x22')]=function(_0x1ac75d,_0x50ab26){return db[_0xee77('0x2c')][_0xee77('0x49')]({'where':{'id':_0x1ac75d[_0xee77('0x45')]['id']}})[_0xee77('0x23')](handleEntityNotFound(_0x50ab26,null))[_0xee77('0x23')](removeEntity(_0x50ab26,null))[_0xee77('0x43')](handleError(_0x50ab26,null));};exports[_0xee77('0x55')]=function(_0x4de8ed,_0x3479ad){var _0x5a50c7=0xa;var _0x282c46=[_0xee77('0x56'),_0xee77('0x57'),'right_join',_0xee77('0x58')];var _0x28a549={'SUM':_0xee77('0x59'),'COUNT':_0xee77('0x5a'),'COUNT DISTINCT':_0xee77('0x5b'),'MAX':_0xee77('0x5c'),'MIN':_0xee77('0x5d'),'AVG':_0xee77('0x5e'),'GROUP_CONCAT':_0xee77('0x5f'),'GROUP_CONCAT ASC':_0xee77('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e0118={'SEC_TO_TIME':_0xee77('0x61'),'DATE':_0xee77('0x62'),'HOUR':_0xee77('0x63'),'ROUND':_0xee77('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4cae28=function(_0xf19782){return!_[_0xee77('0x65')]([_0xee77('0x66'),_0xee77('0x67'),_0xee77('0x68'),_0xee77('0x69')],_0xf19782);};var _0x5b5aea=function(_0x57c525){if(!_0x57c525||!_0x57c525['rules'][_0xee77('0x35')]){return'';}for(var _0x986d21='(',_0x3361c9=0x0;_0x3361c9<_0x57c525[_0xee77('0x6a')][_0xee77('0x35')];_0x3361c9+=0x1){_0x3361c9>0x0&&(_0x986d21+='\x20'+_0x57c525[_0xee77('0x6b')]+'\x20');_0x986d21+=_0x57c525[_0xee77('0x6a')][_0x3361c9][_0xee77('0x6c')]?_0x5b5aea(_0x57c525['rules'][_0x3361c9]['group']):_0x57c525[_0xee77('0x6a')][_0x3361c9][_0xee77('0x6d')]+'\x20'+_0x57c525['rules'][_0x3361c9][_0xee77('0x6e')]+(_0x4cae28(_0x57c525[_0xee77('0x6a')][_0x3361c9]['condition'])?'\x20'+_0x57c525[_0xee77('0x6a')][_0x3361c9]['value']:'');}return _0x986d21+')';};var _0x522e5a={'where':{'id':_0x4de8ed['params']['id']}},_0x22716b,_0x5b88cf,_0x3d7cf5,_0xbe8cc4,_0x5eb255;_0x522e5a=_[_0xee77('0x3c')]({},_0x522e5a,_0x4de8ed[_0xee77('0x3f')]);return db['AnalyticCustomReport']['find'](_0x522e5a)[_0xee77('0x23')](function(_0x141356){if(_0x141356){_0x22716b=_0x141356;return _0x141356[_0xee77('0x6f')]();}return null;})[_0xee77('0x23')](function(_0x58157d){if(_0x58157d){if(!_0x58157d[_0xee77('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xee77('0x70'),0x193);}_0x5b88cf=_0x58157d;return db[_0xee77('0x71')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x53913c){if(_0x53913c){_0x3d7cf5=_[_0xee77('0x72')](_0x53913c,'id');var _0x1a42e9;var _0x2e9038=squel[_0xee77('0x73')]();_0x2e9038[_0xee77('0x74')](_0x22716b[_0xee77('0x75')]);for(var _0x382b85=0x0;_0x382b85<_0x5b88cf[_0xee77('0x35')];_0x382b85+=0x1){_0x1a42e9=_0x5b88cf[_0x382b85][_0xee77('0x76')]?_0x3d7cf5[_0x5b88cf[_0x382b85]['MetricId']][_0xee77('0x77')]:_0x5b88cf[_0x382b85]['field'];_0x1a42e9=_0x5b88cf[_0x382b85][_0xee77('0x78')]?_['replace'](_0x28a549[_0x5b88cf[_0x382b85][_0xee77('0x78')]],'%s',_0x1a42e9):_0x1a42e9;_0x1a42e9=_0x5b88cf[_0x382b85][_0xee77('0x79')]?_[_0xee77('0x7a')](_0x2e0118[_0x5b88cf[_0x382b85][_0xee77('0x79')]],'%s',_0x1a42e9):_0x1a42e9;if(_0x5b88cf[_0x382b85][_0xee77('0x7b')]){_0x2e9038[_0xee77('0x6c')](_0x1a42e9);}_0x5b88cf[_0x382b85]['orderBy']&&_0x2e9038[_0xee77('0x38')](_0x1a42e9,_0x5b88cf[_0x382b85][_0xee77('0x7c')]===_0xee77('0x7d')?![]:!![]);_0x2e9038['field'](_0x1a42e9,_0x5b88cf[_0x382b85][_0xee77('0x7e')]||_0x1a42e9);}if(_0x22716b[_0xee77('0x7f')]){_0x22716b[_0xee77('0x7f')]=JSON[_0xee77('0x80')](_0x22716b['joins']);for(var _0xb576f9=0x0;_0xb576f9<_0x22716b[_0xee77('0x7f')]['length'];_0xb576f9+=0x1){if(_0x22716b['joins'][_0xb576f9][_0xee77('0x2d')]&&_[_0xee77('0x65')](_0x282c46,_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x2d')])&&_0x22716b['joins'][_0xb576f9][_0xee77('0x81')]&&_0x22716b['joins'][_0xb576f9]['foreignTable']&&_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x82')]){_0x2e9038[_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x2d')]](_0x22716b[_0xee77('0x7f')][_0xb576f9][_0xee77('0x83')],null,util[_0xee77('0x79')]('%s.%s\x20=\x20%s.%s',_0x22716b['table'],_0x22716b[_0xee77('0x7f')][_0xb576f9]['parentKey'],_0x22716b['joins'][_0xb576f9][_0xee77('0x83')],_0x22716b['joins'][_0xb576f9]['foreignKey']));}}}if(_0x22716b[_0xee77('0x84')]){_0x22716b['conditions']=JSON[_0xee77('0x80')](_0x22716b['conditions']);_0x2e9038[_0xee77('0x3a')](_0x5b5aea(_0x22716b[_0xee77('0x84')][_0xee77('0x6c')]));}_0x5eb255=_0x2e9038[_0xee77('0x85')]();_0x2e9038[_0xee77('0x1a')](_0x5a50c7);_0x2e9038[_0xee77('0x19')](0x0);logger[_0xee77('0x86')]('Limited\x20Query:',_0x2e9038[_0xee77('0x87')]());return dbH[_0xee77('0x88')][_0xee77('0x31')](_0x2e9038[_0xee77('0x87')](),{'type':dbH[_0xee77('0x88')][_0xee77('0x89')]['SELECT']});}})['then'](respondWithResult(_0x3479ad,null))[_0xee77('0x43')](handleError(_0x3479ad,null));};function runReport(_0x5dfcf1,_0x3d987d,_0x2d4453){var _0x330392=_0x3d987d[_0xee77('0x29')];var _0x35621d=0xa;var _0x4557cb=[_0xee77('0x56'),'left_join',_0xee77('0x8a'),_0xee77('0x58')];var _0x255297={'SUM':_0xee77('0x59'),'COUNT':_0xee77('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee77('0x5c'),'MIN':_0xee77('0x5d'),'AVG':_0xee77('0x5e'),'GROUP_CONCAT':_0xee77('0x5f'),'GROUP_CONCAT ASC':_0xee77('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25c3c6={'SEC_TO_TIME':_0xee77('0x61'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x33f407=function(_0x3f293a){return!_['includes']([_0xee77('0x66'),'IS\x20NOT\x20NULL',_0xee77('0x68'),'IS\x20NOT\x20EMPTY'],_0x3f293a);};var _0x2d86db=function(_0x1c978c){if(!_0x1c978c||!_0x1c978c['rules'][_0xee77('0x35')]){return'';}for(var _0x161391='(',_0x4cc36b=0x0;_0x4cc36b<_0x1c978c[_0xee77('0x6a')][_0xee77('0x35')];_0x4cc36b+=0x1){_0x4cc36b>0x0&&(_0x161391+='\x20'+_0x1c978c['operator']+'\x20');_0x161391+=_0x1c978c[_0xee77('0x6a')][_0x4cc36b][_0xee77('0x6c')]?_0x2d86db(_0x1c978c[_0xee77('0x6a')][_0x4cc36b][_0xee77('0x6c')]):_0x1c978c['rules'][_0x4cc36b]['field']+'\x20'+_0x1c978c['rules'][_0x4cc36b]['condition']+(_0x33f407(_0x1c978c[_0xee77('0x6a')][_0x4cc36b][_0xee77('0x6e')])?'\x20'+_0x1c978c['rules'][_0x4cc36b][_0xee77('0x8b')]:'');}return _0x161391+')';};var _0x581f8d={'where':{'id':_0x5dfcf1['id']}},_0x5997a8,_0x50322e,_0x26ba12,_0x415ca7,_0xc5f1d7;_0x581f8d=_[_0xee77('0x3c')]({},_0x581f8d,_0x2d4453);return db[_0xee77('0x2c')][_0xee77('0x49')](_0x581f8d)['then'](function(_0x57c89d){if(_0x57c89d){_0x5997a8=_0x57c89d;return _0x57c89d[_0xee77('0x6f')]();}return null;})['then'](function(_0x25a658){if(_0x25a658){if(!_0x25a658['length']){throw new db[(_0xee77('0x8c'))][(_0xee77('0x8d'))](_0xee77('0x70'),0x193);}_0x50322e=_0x25a658;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xee77('0x23')](function(_0x56ce6c){if(_0x56ce6c){_0x26ba12=_[_0xee77('0x72')](_0x56ce6c,'id');var _0x33948a;var _0xdb8692=squel[_0xee77('0x73')]();_0xdb8692['from'](_0x5997a8[_0xee77('0x75')]);for(var _0x27d7b2=0x0;_0x27d7b2<_0x50322e[_0xee77('0x35')];_0x27d7b2+=0x1){_0x33948a=_0x50322e[_0x27d7b2]['MetricId']?_0x26ba12[_0x50322e[_0x27d7b2][_0xee77('0x76')]][_0xee77('0x77')]:_0x50322e[_0x27d7b2][_0xee77('0x6d')];_0x33948a=_0x50322e[_0x27d7b2]['function']?_[_0xee77('0x7a')](_0x255297[_0x50322e[_0x27d7b2][_0xee77('0x78')]],'%s',_0x33948a):_0x33948a;_0x33948a=_0x50322e[_0x27d7b2][_0xee77('0x79')]?_[_0xee77('0x7a')](_0x25c3c6[_0x50322e[_0x27d7b2][_0xee77('0x79')]],'%s',_0x33948a):_0x33948a;if(_0x50322e[_0x27d7b2][_0xee77('0x7b')]){_0xdb8692[_0xee77('0x6c')](_0x33948a);}_0x50322e[_0x27d7b2][_0xee77('0x7c')]&&_0xdb8692[_0xee77('0x38')](_0x33948a,_0x50322e[_0x27d7b2]['orderBy']===_0xee77('0x7d')?![]:!![]);_0xdb8692['field'](_0x33948a,_0x50322e[_0x27d7b2][_0xee77('0x7e')]||_0x33948a);}if(_0x5997a8[_0xee77('0x7f')]){_0x5997a8[_0xee77('0x7f')]=JSON[_0xee77('0x80')](_0x5997a8[_0xee77('0x7f')]);for(var _0x3ccbb3=0x0;_0x3ccbb3<_0x5997a8[_0xee77('0x7f')]['length'];_0x3ccbb3+=0x1){if(_0x5997a8[_0xee77('0x7f')][_0x3ccbb3]['type']&&_[_0xee77('0x65')](_0x4557cb,_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x2d')])&&_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x81')]&&_0x5997a8['joins'][_0x3ccbb3][_0xee77('0x83')]&&_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x82')]){_0xdb8692[_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x2d')]](_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x83')],null,util[_0xee77('0x79')](_0xee77('0x8e'),_0x5997a8[_0xee77('0x75')],_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x81')],_0x5997a8['joins'][_0x3ccbb3][_0xee77('0x83')],_0x5997a8[_0xee77('0x7f')][_0x3ccbb3][_0xee77('0x82')]));}}}if(_0x5997a8['conditions']){_0x5997a8['conditions']=JSON[_0xee77('0x80')](_0x5997a8[_0xee77('0x84')]);_0xdb8692[_0xee77('0x3a')](_0x2d86db(_0x5997a8[_0xee77('0x84')][_0xee77('0x6c')]));}_0xc5f1d7=_0xdb8692[_0xee77('0x85')]();_0xdb8692[_0xee77('0x1a')](_0x35621d);_0xdb8692[_0xee77('0x19')](0x0);return;}})[_0xee77('0x23')](function(){if(_0x3d987d[_0xee77('0x8f')]===_0xee77('0x90')){return null;}var _0x2345cd=_[_0xee77('0x3c')](_0x3d987d,{'name':_0x3d987d[_0xee77('0x91')]||_0x3d987d[_0xee77('0x29')]||_0x5997a8['name'],'basename':_0x330392,'savename':util[_0xee77('0x79')](_0xee77('0x92'),_0x3d987d[_0xee77('0x29')]||_0x5997a8[_0xee77('0x29')],require('randomstring')['generate'](0x4),_0x3d987d[_0xee77('0x8f')]||_0xee77('0x93')),'reportId':_0x5997a8['id'],'reportType':_0xee77('0x94')});return db[_0xee77('0x95')][_0xee77('0x4a')](_0x2345cd,{'raw':!![]});})['then'](function(_0x4b62ed){if(_0x5997a8[_0xee77('0x75')]===_0xee77('0x96')){_0xc5f1d7['where'](_0x5997a8[_0xee77('0x75')]+_0xee77('0x97'),_0x3d987d[_0xee77('0x98')],_0x3d987d[_0xee77('0x99')]);}else{_0xc5f1d7['where'](_0x5997a8[_0xee77('0x75')]+_0xee77('0x9a'),_0x3d987d['startDate'],_0x3d987d[_0xee77('0x99')]);}if(_0x4b62ed){logger[_0xee77('0x9b')](_0xee77('0x9c'),_0xc5f1d7[_0xee77('0x87')]());require('child_process')[_0xee77('0x9d')](path['join'](__dirname,_0xee77('0x9e'),_0x4b62ed[_0xee77('0x8f')]),[_0x4b62ed['id'],_0xc5f1d7['toString'](),path[_0xee77('0x56')](__dirname,_0xee77('0x9f'),_0x4b62ed[_0xee77('0xa0')]),_0x330392]);return _0x4b62ed;}else{var _0x469916=squel[_0xee77('0x73')]();_0x469916['from']('('+_0xc5f1d7[_0xee77('0x87')]()+')',_0xee77('0xa1'));_0x469916[_0xee77('0x6d')](_0xee77('0xa2'),_0xee77('0x1c'));_0xc5f1d7['limit'](_0x3d987d['limit']||_0x35621d);_0xc5f1d7[_0xee77('0x19')](_0x3d987d['offset']||0x0);return dbH[_0xee77('0x88')][_0xee77('0x31')](_0x469916[_0xee77('0x87')](),{'type':dbH['sequelize'][_0xee77('0x89')][_0xee77('0xa3')]})[_0xee77('0x23')](function(_0x701c80){if(!_0x701c80[_0xee77('0x35')]){_0x415ca7=0x0;}else{_0x415ca7=_0x701c80[0x0][_0xee77('0x1c')]||0x0;}return dbH[_0xee77('0x88')]['query'](_0xc5f1d7[_0xee77('0x87')](),{'type':dbH['sequelize'][_0xee77('0x89')][_0xee77('0xa3')]});})[_0xee77('0x23')](function(_0x389cce){return{'rows':_0x389cce||[],'count':_0x415ca7};});}});}exports[_0xee77('0xa4')]=function(_0x3f3319,_0x456347){return runReport(_0x3f3319[_0xee77('0x45')],_0x3f3319[_0xee77('0x31')],_0x3f3319['options'])[_0xee77('0x23')](respondWithResult(_0x456347,null))[_0xee77('0x43')](handleError(_0x456347,null));};exports['runReport']=runReport;exports[_0xee77('0x31')]=function(_0x2ff181,_0xbc9112){var _0x3f6994=0xa;var _0x191e22=[_0xee77('0x56'),_0xee77('0x57'),_0xee77('0x8a'),'cross_join'];var _0x41c018={'SUM':_0xee77('0x59'),'COUNT':_0xee77('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xee77('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xee77('0x60'),'GROUP_CONCAT DESC':_0xee77('0xa5')};var _0xb553eb={'SEC_TO_TIME':_0xee77('0x61'),'DATE':_0xee77('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee77('0xa6')};var _0x4d29b7=function(_0x589995){return!_['includes']([_0xee77('0x66'),_0xee77('0x67'),_0xee77('0x68'),'IS\x20NOT\x20EMPTY'],_0x589995);};var _0x50e338=function(_0x402a5c){if(!_0x402a5c||!_0x402a5c[_0xee77('0x6a')][_0xee77('0x35')]){return'';}for(var _0x518a42='(',_0x35e2ba=0x0;_0x35e2ba<_0x402a5c['rules'][_0xee77('0x35')];_0x35e2ba+=0x1){_0x35e2ba>0x0&&(_0x518a42+='\x20'+_0x402a5c['operator']+'\x20');_0x518a42+=_0x402a5c['rules'][_0x35e2ba][_0xee77('0x6c')]?_0x50e338(_0x402a5c[_0xee77('0x6a')][_0x35e2ba][_0xee77('0x6c')]):_0x402a5c[_0xee77('0x6a')][_0x35e2ba]['field']+'\x20'+_0x402a5c[_0xee77('0x6a')][_0x35e2ba]['condition']+(_0x4d29b7(_0x402a5c[_0xee77('0x6a')][_0x35e2ba][_0xee77('0x6e')])?'\x20'+_0x402a5c[_0xee77('0x6a')][_0x35e2ba][_0xee77('0x8b')]:'');}return _0x518a42+')';};var _0xfeebdc={'where':{'id':_0x2ff181[_0xee77('0x45')]['id']}},_0xfc5c44,_0x5d43ec,_0xa5456f,_0x158975,_0x5484fb;_0xfeebdc=_[_0xee77('0x3c')]({},_0xfeebdc,_0x2ff181[_0xee77('0x3f')]);return db['AnalyticCustomReport'][_0xee77('0x49')](_0xfeebdc)[_0xee77('0x23')](function(_0x3a76c8){if(_0x3a76c8){_0xfc5c44=_0x3a76c8;return _0x3a76c8['getFields']();}return null;})['then'](function(_0x230c5c){if(_0x230c5c){if(!_0x230c5c[_0xee77('0x35')]){throw new db[(_0xee77('0x8c'))][(_0xee77('0x8d'))](_0xee77('0x70'),0x193);}_0x5d43ec=_0x230c5c;return db[_0xee77('0x71')]['findAll']({'raw':!![]});}return null;})[_0xee77('0x23')](function(_0x47d051){if(_0x47d051){_0xa5456f=_[_0xee77('0x72')](_0x47d051,'id');var _0x4bec93;var _0x2c7b06=squel[_0xee77('0x73')]();_0x2c7b06[_0xee77('0x74')](_0xfc5c44[_0xee77('0x75')]);for(var _0xf4006=0x0;_0xf4006<_0x5d43ec[_0xee77('0x35')];_0xf4006+=0x1){_0x4bec93=_0x5d43ec[_0xf4006][_0xee77('0x76')]?_0xa5456f[_0x5d43ec[_0xf4006][_0xee77('0x76')]][_0xee77('0x77')]:_0x5d43ec[_0xf4006][_0xee77('0x6d')];_0x4bec93=_0x5d43ec[_0xf4006][_0xee77('0x78')]?_['replace'](_0x41c018[_0x5d43ec[_0xf4006][_0xee77('0x78')]],'%s',_0x4bec93):_0x4bec93;_0x4bec93=_0x5d43ec[_0xf4006][_0xee77('0x79')]?_['replace'](_0xb553eb[_0x5d43ec[_0xf4006][_0xee77('0x79')]],'%s',_0x4bec93):_0x4bec93;if(_0x5d43ec[_0xf4006][_0xee77('0x7b')]){_0x2c7b06[_0xee77('0x6c')](_0x4bec93);}_0x5d43ec[_0xf4006][_0xee77('0x7c')]&&_0x2c7b06[_0xee77('0x38')](_0x4bec93,_0x5d43ec[_0xf4006][_0xee77('0x7c')]==='DESC'?![]:!![]);_0x2c7b06['field'](_0x4bec93,_0x5d43ec[_0xf4006][_0xee77('0x7e')]||_0x4bec93);}if(_0xfc5c44['joins']){_0xfc5c44[_0xee77('0x7f')]=JSON[_0xee77('0x80')](_0xfc5c44[_0xee77('0x7f')]);for(var _0x2b8c84=0x0;_0x2b8c84<_0xfc5c44['joins'][_0xee77('0x35')];_0x2b8c84+=0x1){if(_0xfc5c44[_0xee77('0x7f')][_0x2b8c84]['type']&&_[_0xee77('0x65')](_0x191e22,_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x2d')])&&_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x81')]&&_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x83')]&&_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x82')]){_0x2c7b06[_0xfc5c44['joins'][_0x2b8c84][_0xee77('0x2d')]](_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x83')],null,util[_0xee77('0x79')](_0xee77('0x8e'),_0xfc5c44[_0xee77('0x75')],_0xfc5c44['joins'][_0x2b8c84]['parentKey'],_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x83')],_0xfc5c44[_0xee77('0x7f')][_0x2b8c84][_0xee77('0x82')]));}}}if(_0xfc5c44[_0xee77('0x84')]){_0xfc5c44[_0xee77('0x84')]=JSON[_0xee77('0x80')](_0xfc5c44[_0xee77('0x84')]);_0x2c7b06[_0xee77('0x3a')](_0x50e338(_0xfc5c44[_0xee77('0x84')]['group']));}_0x5484fb=_0x2c7b06[_0xee77('0x85')]();_0x2c7b06[_0xee77('0x1a')](_0x3f6994);_0x2c7b06[_0xee77('0x19')](0x0);logger['debug']('Limited\x20Query:',_0x2c7b06['toString']());return dbH[_0xee77('0x88')][_0xee77('0x31')](_0x2c7b06['toString'](),{'type':dbH['sequelize'][_0xee77('0x89')][_0xee77('0xa3')]});}})[_0xee77('0x23')](function(){return{'sql':_0x5484fb['toString']()};})[_0xee77('0x23')](respondWithResult(_0xbc9112,null))[_0xee77('0x43')](handleError(_0xbc9112,null));};
\ No newline at end of file
+var _0x8091=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','catch','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','MetricId','metric','function','replace','format','orderBy','DESC','joins','parentKey','foreignKey','foreignTable','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','IS\x20EMPTY','ValidationErrorItem','from','table','groupBy','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','HOUR(%s)','operator','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x4ba248,_0xb5f0cd){var _0x7fea04=function(_0x586ea4){while(--_0x586ea4){_0x4ba248['push'](_0x4ba248['shift']());}};_0x7fea04(++_0xb5f0cd);}(_0x8091,0x124));var _0x1809=function(_0x55f4df,_0xd5b609){_0x55f4df=_0x55f4df-0x0;var _0x5db630=_0x8091[_0x55f4df];return _0x5db630;};'use strict';var emlformat=require(_0x1809('0x0'));var rimraf=require(_0x1809('0x1'));var zipdir=require(_0x1809('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1809('0x3'));var BPromise=require(_0x1809('0x4'));var Mustache=require(_0x1809('0x5'));var util=require(_0x1809('0x6'));var path=require(_0x1809('0x7'));var sox=require(_0x1809('0x8'));var csv=require('to-csv');var ejs=require(_0x1809('0x9'));var fs=require('fs');var fs_extra=require(_0x1809('0xa'));var _=require(_0x1809('0xb'));var squel=require(_0x1809('0xc'));var crypto=require(_0x1809('0xd'));var jsforce=require(_0x1809('0xe'));var deskjs=require(_0x1809('0xf'));var toCsv=require(_0x1809('0x10'));var querystring=require('querystring');var Papa=require(_0x1809('0x11'));var Redis=require(_0x1809('0x12'));var authService=require(_0x1809('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1809('0x14'));var hardwareService=require(_0x1809('0x15'));var logger=require(_0x1809('0x16'))(_0x1809('0x17'));var utils=require(_0x1809('0x18'));var config=require(_0x1809('0x19'));var licenseUtil=require(_0x1809('0x1a'));var db=require(_0x1809('0x1b'))['db'];var dbH=require(_0x1809('0x1b'))['dbH'];function respondWithStatusCode(_0x142b90,_0x140e09){_0x140e09=_0x140e09||0xcc;return function(_0x1d85bf){if(_0x1d85bf){return _0x142b90['sendStatus'](_0x140e09);}return _0x142b90['status'](_0x140e09)['end']();};}function respondWithResult(_0x2d67ac,_0x4fb600){_0x4fb600=_0x4fb600||0xc8;return function(_0x2275c8){if(_0x2275c8){return _0x2d67ac['status'](_0x4fb600)['json'](_0x2275c8);}};}function respondWithFilteredResult(_0x13df4a,_0x19aae6){return function(_0x2cd365){if(_0x2cd365){var _0x2a2b2d=typeof _0x19aae6[_0x1809('0x1c')]===_0x1809('0x1d')&&typeof _0x19aae6['limit']==='undefined';var _0x8a8a41=_0x2cd365['count'];var _0x5ceef8=_0x2a2b2d?0x0:_0x19aae6[_0x1809('0x1c')];var _0x3fcd4a=_0x2a2b2d?_0x2cd365[_0x1809('0x1e')]:_0x19aae6[_0x1809('0x1c')]+_0x19aae6['limit'];var _0x47f3c1;if(_0x3fcd4a>=_0x8a8a41){_0x3fcd4a=_0x8a8a41;_0x47f3c1=0xc8;}else{_0x47f3c1=0xce;}_0x13df4a[_0x1809('0x1f')](_0x47f3c1);return _0x13df4a[_0x1809('0x20')](_0x1809('0x21'),_0x5ceef8+'-'+_0x3fcd4a+'/'+_0x8a8a41)['json'](_0x2cd365);}return null;};}function patchUpdates(_0x4b82c3){return function(_0x32dfb9){try{jsonpatch[_0x1809('0x22')](_0x32dfb9,_0x4b82c3,!![]);}catch(_0x25f5e2){return BPromise[_0x1809('0x23')](_0x25f5e2);}return _0x32dfb9[_0x1809('0x24')]();};}function saveUpdates(_0x317abb,_0x464934){return function(_0x5eee4b){if(_0x5eee4b){return _0x5eee4b[_0x1809('0x25')](_0x317abb)[_0x1809('0x26')](function(_0xde93c3){return _0xde93c3;});}return null;};}function removeEntity(_0x47c032,_0x2b2107){return function(_0xff7dfe){if(_0xff7dfe){return _0xff7dfe[_0x1809('0x27')]()[_0x1809('0x26')](function(){var _0x81b24d=_0xff7dfe[_0x1809('0x28')]({'plain':!![]});var _0x6c44fb=_0x1809('0x29');return db[_0x1809('0x2a')]['destroy']({'where':{'type':_0x6c44fb,'resourceId':_0x81b24d['id']}})['then'](function(){return _0xff7dfe;});})[_0x1809('0x26')](function(){_0x47c032['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb725a,_0x377a0c){return function(_0x31e0a1){if(!_0x31e0a1){_0xb725a[_0x1809('0x2b')](0x194);}return _0x31e0a1;};}function handleError(_0x599f7c,_0x5a609e){_0x5a609e=_0x5a609e||0x1f4;return function(_0x38b86c){logger[_0x1809('0x2c')](_0x38b86c['stack']);if(_0x38b86c['name']){delete _0x38b86c[_0x1809('0x2d')];}_0x599f7c[_0x1809('0x1f')](_0x5a609e)['send'](_0x38b86c);};}exports['index']=function(_0x21ddab,_0x3b62e4){var _0x51e4a6={},_0x146bc5={},_0x505d34={'count':0x0,'rows':[]};var _0x2bbe46=_[_0x1809('0x2e')](db[_0x1809('0x2f')][_0x1809('0x30')],function(_0x1667bb){return{'name':_0x1667bb[_0x1809('0x31')],'type':_0x1667bb[_0x1809('0x32')][_0x1809('0x33')]};});_0x146bc5[_0x1809('0x34')]=_[_0x1809('0x2e')](_0x2bbe46,_0x1809('0x2d'));_0x146bc5[_0x1809('0x35')]=_[_0x1809('0x36')](_0x21ddab[_0x1809('0x35')]);_0x146bc5['filters']=_[_0x1809('0x37')](_0x146bc5[_0x1809('0x34')],_0x146bc5[_0x1809('0x35')]);_0x51e4a6[_0x1809('0x38')]=_['intersection'](_0x146bc5['model'],qs[_0x1809('0x39')](_0x21ddab['query'][_0x1809('0x39')]));_0x51e4a6['attributes']=_0x51e4a6[_0x1809('0x38')][_0x1809('0x3a')]?_0x51e4a6[_0x1809('0x38')]:_0x146bc5[_0x1809('0x34')];if(!_0x21ddab['query'][_0x1809('0x3b')](_0x1809('0x3c'))){_0x51e4a6[_0x1809('0x3d')]=qs[_0x1809('0x3d')](_0x21ddab[_0x1809('0x35')]['limit']);_0x51e4a6['offset']=qs['offset'](_0x21ddab['query'][_0x1809('0x1c')]);}_0x51e4a6[_0x1809('0x3e')]=qs[_0x1809('0x3f')](_0x21ddab[_0x1809('0x35')][_0x1809('0x3f')]);_0x51e4a6['where']=qs[_0x1809('0x40')](_[_0x1809('0x41')](_0x21ddab['query'],_0x146bc5[_0x1809('0x40')]),_0x2bbe46);if(_0x21ddab[_0x1809('0x35')][_0x1809('0x42')]){_0x51e4a6['where']=_['merge'](_0x51e4a6[_0x1809('0x43')],{'$or':_[_0x1809('0x2e')](_0x2bbe46,function(_0x5576bc){if(_0x5576bc[_0x1809('0x32')]!==_0x1809('0x44')){var _0xb6e262={};_0xb6e262[_0x5576bc[_0x1809('0x2d')]]={'$like':'%'+_0x21ddab[_0x1809('0x35')][_0x1809('0x42')]+'%'};return _0xb6e262;}})});}_0x51e4a6=_[_0x1809('0x45')]({},_0x51e4a6,_0x21ddab[_0x1809('0x46')]);var _0x2434d7={'where':_0x51e4a6[_0x1809('0x43')]};return db[_0x1809('0x2f')][_0x1809('0x1e')](_0x2434d7)['then'](function(_0x3b0aa8){_0x505d34['count']=_0x3b0aa8;if(_0x21ddab[_0x1809('0x35')][_0x1809('0x47')]){_0x51e4a6['include']=[{'all':!![]}];}return db[_0x1809('0x2f')]['findAll'](_0x51e4a6);})['then'](function(_0x1921fc){_0x505d34[_0x1809('0x48')]=_0x1921fc;return _0x505d34;})['then'](respondWithFilteredResult(_0x3b62e4,_0x51e4a6))['catch'](handleError(_0x3b62e4,null));};exports[_0x1809('0x49')]=function(_0x4f23a,_0x28ff37){var _0x60fcab={'raw':![],'where':{'id':_0x4f23a[_0x1809('0x4a')]['id']}},_0x3b6bbd={};_0x3b6bbd[_0x1809('0x34')]=_[_0x1809('0x36')](db['AnalyticCustomReport']['rawAttributes']);_0x3b6bbd[_0x1809('0x35')]=_[_0x1809('0x36')](_0x4f23a[_0x1809('0x35')]);_0x3b6bbd['filters']=_[_0x1809('0x37')](_0x3b6bbd[_0x1809('0x34')],_0x3b6bbd['query']);_0x60fcab[_0x1809('0x38')]=_[_0x1809('0x37')](_0x3b6bbd[_0x1809('0x34')],qs[_0x1809('0x39')](_0x4f23a[_0x1809('0x35')][_0x1809('0x39')]));_0x60fcab[_0x1809('0x38')]=_0x60fcab['attributes'][_0x1809('0x3a')]?_0x60fcab[_0x1809('0x38')]:_0x3b6bbd[_0x1809('0x34')];if(_0x4f23a[_0x1809('0x35')]['includeAll']){_0x60fcab[_0x1809('0x4b')]=[{'all':!![]}];}_0x60fcab=_[_0x1809('0x45')]({},_0x60fcab,_0x4f23a[_0x1809('0x46')]);return db[_0x1809('0x2f')][_0x1809('0x4c')](_0x60fcab)[_0x1809('0x26')](handleEntityNotFound(_0x28ff37,null))[_0x1809('0x26')](respondWithResult(_0x28ff37,null))['catch'](handleError(_0x28ff37,null));};exports[_0x1809('0x4d')]=function(_0x5ca3ee,_0x4c06cc){return db[_0x1809('0x2f')][_0x1809('0x4d')](_0x5ca3ee[_0x1809('0x4e')],{})['then'](function(_0x5e5852){var _0x346239=_0x5ca3ee[_0x1809('0x4f')][_0x1809('0x28')]({'plain':!![]});if(!_0x346239)throw new Error(_0x1809('0x50'));if(_0x346239[_0x1809('0x51')]===_0x1809('0x4f')){var _0x4bb3b7=_0x5e5852[_0x1809('0x28')]({'plain':!![]});var _0x266a04=_0x1809('0x52');return db[_0x1809('0x53')][_0x1809('0x4c')]({'where':{'name':_0x266a04,'userProfileId':_0x346239[_0x1809('0x54')]},'raw':!![]})['then'](function(_0x159572){if(_0x159572&&_0x159572[_0x1809('0x55')]===0x0){return db[_0x1809('0x2a')][_0x1809('0x4d')]({'name':_0x4bb3b7[_0x1809('0x2d')],'resourceId':_0x4bb3b7['id'],'type':'CustomReports','sectionId':_0x159572['id']},{})['then'](function(){return _0x5e5852;});}else{return _0x5e5852;}})['catch'](function(_0x103628){logger[_0x1809('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x103628);throw _0x103628;});}return _0x5e5852;})[_0x1809('0x26')](respondWithResult(_0x4c06cc,0xc9))['catch'](handleError(_0x4c06cc,null));};exports[_0x1809('0x25')]=function(_0xb54a71,_0x4b3300){if(_0xb54a71[_0x1809('0x4e')]['id']){delete _0xb54a71[_0x1809('0x4e')]['id'];}return db['AnalyticCustomReport'][_0x1809('0x4c')]({'where':{'id':_0xb54a71[_0x1809('0x4a')]['id']}})[_0x1809('0x26')](handleEntityNotFound(_0x4b3300,null))[_0x1809('0x26')](saveUpdates(_0xb54a71[_0x1809('0x4e')],null))[_0x1809('0x26')](respondWithResult(_0x4b3300,null))[_0x1809('0x56')](handleError(_0x4b3300,null));};exports['destroy']=function(_0x2b9266,_0x2f680b){return db['AnalyticCustomReport'][_0x1809('0x4c')]({'where':{'id':_0x2b9266[_0x1809('0x4a')]['id']}})[_0x1809('0x26')](handleEntityNotFound(_0x2f680b,null))[_0x1809('0x26')](removeEntity(_0x2f680b,null))[_0x1809('0x56')](handleError(_0x2f680b,null));};exports[_0x1809('0x57')]=function(_0x28d3cc,_0x190add){var _0x59ef4f=0xa;var _0x4899a9=[_0x1809('0x58'),_0x1809('0x59'),'right_join',_0x1809('0x5a')];var _0x3b6d86={'SUM':_0x1809('0x5b'),'COUNT':_0x1809('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1809('0x5d'),'MIN':'MIN(%s)','AVG':_0x1809('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1809('0x5f'),'GROUP_CONCAT DESC':_0x1809('0x60')};var _0x37a40a={'SEC_TO_TIME':_0x1809('0x61'),'DATE':_0x1809('0x62'),'HOUR':'HOUR(%s)','ROUND':_0x1809('0x63'),'UNIX_TIMESTAMP':_0x1809('0x64')};var _0x552453=function(_0xd0ff0a){return!_[_0x1809('0x65')]([_0x1809('0x66'),_0x1809('0x67'),'IS\x20EMPTY',_0x1809('0x68')],_0xd0ff0a);};var _0x3596fb=function(_0x4449f2){if(!_0x4449f2||!_0x4449f2[_0x1809('0x69')][_0x1809('0x3a')]){return'';}for(var _0x13b27c='(',_0x533a41=0x0;_0x533a41<_0x4449f2[_0x1809('0x69')][_0x1809('0x3a')];_0x533a41+=0x1){_0x533a41>0x0&&(_0x13b27c+='\x20'+_0x4449f2['operator']+'\x20');_0x13b27c+=_0x4449f2[_0x1809('0x69')][_0x533a41][_0x1809('0x6a')]?_0x3596fb(_0x4449f2[_0x1809('0x69')][_0x533a41]['group']):_0x4449f2[_0x1809('0x69')][_0x533a41][_0x1809('0x6b')]+'\x20'+_0x4449f2[_0x1809('0x69')][_0x533a41][_0x1809('0x6c')]+(_0x552453(_0x4449f2[_0x1809('0x69')][_0x533a41]['condition'])?'\x20'+_0x4449f2['rules'][_0x533a41][_0x1809('0x6d')]:'');}return _0x13b27c+')';};var _0x115e26={'where':{'id':_0x28d3cc[_0x1809('0x4a')]['id']}},_0x1d0b5e,_0x14ef6b,_0x203980,_0x1803bd,_0x1ba1a3;_0x115e26=_[_0x1809('0x45')]({},_0x115e26,_0x28d3cc[_0x1809('0x46')]);return db[_0x1809('0x2f')][_0x1809('0x4c')](_0x115e26)[_0x1809('0x26')](function(_0x2ca37a){if(_0x2ca37a){_0x1d0b5e=_0x2ca37a;return _0x2ca37a[_0x1809('0x6e')]();}return null;})[_0x1809('0x26')](function(_0x26bb99){if(_0x26bb99){if(!_0x26bb99[_0x1809('0x3a')]){throw new db[(_0x1809('0x6f'))]['ValidationErrorItem'](_0x1809('0x70'),0x193);}_0x14ef6b=_0x26bb99;return db[_0x1809('0x71')][_0x1809('0x72')]({'raw':!![]});}return null;})['then'](function(_0x3084ec){if(_0x3084ec){_0x203980=_[_0x1809('0x73')](_0x3084ec,'id');var _0x220daf;var _0x2f7c74=squel[_0x1809('0x74')]();_0x2f7c74['from'](_0x1d0b5e['table']);for(var _0x3ec3a1=0x0;_0x3ec3a1<_0x14ef6b[_0x1809('0x3a')];_0x3ec3a1+=0x1){_0x220daf=_0x14ef6b[_0x3ec3a1][_0x1809('0x75')]?_0x203980[_0x14ef6b[_0x3ec3a1][_0x1809('0x75')]][_0x1809('0x76')]:_0x14ef6b[_0x3ec3a1][_0x1809('0x6b')];_0x220daf=_0x14ef6b[_0x3ec3a1][_0x1809('0x77')]?_['replace'](_0x3b6d86[_0x14ef6b[_0x3ec3a1][_0x1809('0x77')]],'%s',_0x220daf):_0x220daf;_0x220daf=_0x14ef6b[_0x3ec3a1]['format']?_[_0x1809('0x78')](_0x37a40a[_0x14ef6b[_0x3ec3a1][_0x1809('0x79')]],'%s',_0x220daf):_0x220daf;if(_0x14ef6b[_0x3ec3a1]['groupBy']){_0x2f7c74['group'](_0x220daf);}_0x14ef6b[_0x3ec3a1][_0x1809('0x7a')]&&_0x2f7c74[_0x1809('0x3e')](_0x220daf,_0x14ef6b[_0x3ec3a1][_0x1809('0x7a')]===_0x1809('0x7b')?![]:!![]);_0x2f7c74['field'](_0x220daf,_0x14ef6b[_0x3ec3a1]['alias']||_0x220daf);}if(_0x1d0b5e[_0x1809('0x7c')]){_0x1d0b5e[_0x1809('0x7c')]=JSON['parse'](_0x1d0b5e['joins']);for(var _0x2b3841=0x0;_0x2b3841<_0x1d0b5e[_0x1809('0x7c')][_0x1809('0x3a')];_0x2b3841+=0x1){if(_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x32')]&&_[_0x1809('0x65')](_0x4899a9,_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x32')])&&_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7d')]&&_0x1d0b5e[_0x1809('0x7c')][_0x2b3841]['foreignTable']&&_0x1d0b5e['joins'][_0x2b3841][_0x1809('0x7e')]){_0x2f7c74[_0x1d0b5e[_0x1809('0x7c')][_0x2b3841]['type']](_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7f')],null,util[_0x1809('0x79')]('%s.%s\x20=\x20%s.%s',_0x1d0b5e['table'],_0x1d0b5e[_0x1809('0x7c')][_0x2b3841]['parentKey'],_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7f')],_0x1d0b5e[_0x1809('0x7c')][_0x2b3841][_0x1809('0x7e')]));}}}if(_0x1d0b5e[_0x1809('0x80')]){_0x1d0b5e[_0x1809('0x80')]=JSON[_0x1809('0x81')](_0x1d0b5e[_0x1809('0x80')]);_0x2f7c74[_0x1809('0x43')](_0x3596fb(_0x1d0b5e[_0x1809('0x80')][_0x1809('0x6a')]));}_0x1ba1a3=_0x2f7c74[_0x1809('0x82')]();_0x2f7c74[_0x1809('0x3d')](_0x59ef4f);_0x2f7c74[_0x1809('0x1c')](0x0);logger[_0x1809('0x83')](_0x1809('0x84'),_0x2f7c74[_0x1809('0x85')]());return dbH['sequelize'][_0x1809('0x35')](_0x2f7c74[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]});}})[_0x1809('0x26')](respondWithResult(_0x190add,null))['catch'](handleError(_0x190add,null));};function runReport(_0xaa2303,_0x294faa,_0x5b0d8e){var _0x104533=_0x294faa[_0x1809('0x2d')];var _0x3ad747=0xa;var _0x3acd45=[_0x1809('0x58'),'left_join',_0x1809('0x89'),'cross_join'];var _0x1e1492={'SUM':_0x1809('0x5b'),'COUNT':_0x1809('0x5c'),'COUNT DISTINCT':_0x1809('0x8a'),'MAX':'MAX(%s)','MIN':_0x1809('0x8b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1809('0x8c'),'GROUP_CONCAT ASC':_0x1809('0x5f'),'GROUP_CONCAT DESC':_0x1809('0x60')};var _0xce3d6e={'SEC_TO_TIME':_0x1809('0x61'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1809('0x64')};var _0x1e10a0=function(_0x1ae4e4){return!_[_0x1809('0x65')]([_0x1809('0x66'),_0x1809('0x67'),_0x1809('0x8d'),_0x1809('0x68')],_0x1ae4e4);};var _0x13b303=function(_0x12da14){if(!_0x12da14||!_0x12da14[_0x1809('0x69')][_0x1809('0x3a')]){return'';}for(var _0xabedca='(',_0x33c48d=0x0;_0x33c48d<_0x12da14[_0x1809('0x69')][_0x1809('0x3a')];_0x33c48d+=0x1){_0x33c48d>0x0&&(_0xabedca+='\x20'+_0x12da14['operator']+'\x20');_0xabedca+=_0x12da14[_0x1809('0x69')][_0x33c48d]['group']?_0x13b303(_0x12da14[_0x1809('0x69')][_0x33c48d][_0x1809('0x6a')]):_0x12da14[_0x1809('0x69')][_0x33c48d]['field']+'\x20'+_0x12da14['rules'][_0x33c48d][_0x1809('0x6c')]+(_0x1e10a0(_0x12da14['rules'][_0x33c48d][_0x1809('0x6c')])?'\x20'+_0x12da14[_0x1809('0x69')][_0x33c48d]['value']:'');}return _0xabedca+')';};var _0x5b08ec={'where':{'id':_0xaa2303['id']}},_0xed4258,_0x57d45d,_0x3b557f,_0x19b162,_0x350384;_0x5b08ec=_['merge']({},_0x5b08ec,_0x5b0d8e);return db['AnalyticCustomReport']['find'](_0x5b08ec)[_0x1809('0x26')](function(_0x3e1d62){if(_0x3e1d62){_0xed4258=_0x3e1d62;return _0x3e1d62[_0x1809('0x6e')]();}return null;})[_0x1809('0x26')](function(_0x5490c5){if(_0x5490c5){if(!_0x5490c5[_0x1809('0x3a')]){throw new db[(_0x1809('0x6f'))][(_0x1809('0x8e'))](_0x1809('0x70'),0x193);}_0x57d45d=_0x5490c5;return db[_0x1809('0x71')][_0x1809('0x72')]({'raw':!![]});}return null;})[_0x1809('0x26')](function(_0x4ca94f){if(_0x4ca94f){_0x3b557f=_[_0x1809('0x73')](_0x4ca94f,'id');var _0x6ec642;var _0x26fe09=squel[_0x1809('0x74')]();_0x26fe09[_0x1809('0x8f')](_0xed4258[_0x1809('0x90')]);for(var _0x49c6d2=0x0;_0x49c6d2<_0x57d45d[_0x1809('0x3a')];_0x49c6d2+=0x1){_0x6ec642=_0x57d45d[_0x49c6d2]['MetricId']?_0x3b557f[_0x57d45d[_0x49c6d2]['MetricId']][_0x1809('0x76')]:_0x57d45d[_0x49c6d2][_0x1809('0x6b')];_0x6ec642=_0x57d45d[_0x49c6d2][_0x1809('0x77')]?_[_0x1809('0x78')](_0x1e1492[_0x57d45d[_0x49c6d2][_0x1809('0x77')]],'%s',_0x6ec642):_0x6ec642;_0x6ec642=_0x57d45d[_0x49c6d2][_0x1809('0x79')]?_[_0x1809('0x78')](_0xce3d6e[_0x57d45d[_0x49c6d2][_0x1809('0x79')]],'%s',_0x6ec642):_0x6ec642;if(_0x57d45d[_0x49c6d2][_0x1809('0x91')]){_0x26fe09[_0x1809('0x6a')](_0x6ec642);}_0x57d45d[_0x49c6d2][_0x1809('0x7a')]&&_0x26fe09[_0x1809('0x3e')](_0x6ec642,_0x57d45d[_0x49c6d2][_0x1809('0x7a')]===_0x1809('0x7b')?![]:!![]);_0x26fe09['field'](_0x6ec642,_0x57d45d[_0x49c6d2][_0x1809('0x92')]||_0x6ec642);}if(_0xed4258['joins']){_0xed4258[_0x1809('0x7c')]=JSON[_0x1809('0x81')](_0xed4258[_0x1809('0x7c')]);for(var _0x503b98=0x0;_0x503b98<_0xed4258[_0x1809('0x7c')][_0x1809('0x3a')];_0x503b98+=0x1){if(_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x32')]&&_[_0x1809('0x65')](_0x3acd45,_0xed4258['joins'][_0x503b98][_0x1809('0x32')])&&_0xed4258['joins'][_0x503b98][_0x1809('0x7d')]&&_0xed4258[_0x1809('0x7c')][_0x503b98]['foreignTable']&&_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x7e')]){_0x26fe09[_0xed4258['joins'][_0x503b98]['type']](_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x7f')],null,util[_0x1809('0x79')](_0x1809('0x93'),_0xed4258[_0x1809('0x90')],_0xed4258[_0x1809('0x7c')][_0x503b98][_0x1809('0x7d')],_0xed4258['joins'][_0x503b98]['foreignTable'],_0xed4258['joins'][_0x503b98][_0x1809('0x7e')]));}}}if(_0xed4258[_0x1809('0x80')]){_0xed4258[_0x1809('0x80')]=JSON['parse'](_0xed4258[_0x1809('0x80')]);_0x26fe09[_0x1809('0x43')](_0x13b303(_0xed4258[_0x1809('0x80')][_0x1809('0x6a')]));}_0x350384=_0x26fe09[_0x1809('0x82')]();_0x26fe09['limit'](_0x3ad747);_0x26fe09[_0x1809('0x1c')](0x0);return;}})[_0x1809('0x26')](function(){if(_0x294faa[_0x1809('0x94')]===_0x1809('0x95')){return null;}var _0x57a73a=_[_0x1809('0x45')](_0x294faa,{'name':_0x294faa[_0x1809('0x96')]||_0x294faa[_0x1809('0x2d')]||_0xed4258[_0x1809('0x2d')],'basename':_0x104533,'savename':util[_0x1809('0x79')](_0x1809('0x97'),_0x294faa[_0x1809('0x2d')]||_0xed4258[_0x1809('0x2d')],require(_0x1809('0x98'))[_0x1809('0x99')](0x4),_0x294faa[_0x1809('0x94')]||'csv'),'reportId':_0xed4258['id'],'reportType':_0x1809('0x9a')});return db[_0x1809('0x9b')]['create'](_0x57a73a,{'raw':!![]});})[_0x1809('0x26')](function(_0x126d2c){if(_0xed4258[_0x1809('0x90')]===_0x1809('0x9c')){_0x350384[_0x1809('0x43')](_0xed4258['table']+_0x1809('0x9d'),_0x294faa[_0x1809('0x9e')],_0x294faa[_0x1809('0x9f')]);}else{_0x350384[_0x1809('0x43')](_0xed4258[_0x1809('0x90')]+_0x1809('0xa0'),_0x294faa[_0x1809('0x9e')],_0x294faa[_0x1809('0x9f')]);}if(_0x126d2c){logger[_0x1809('0xa1')](_0x1809('0xa2'),_0x350384[_0x1809('0x85')]());require(_0x1809('0xa3'))[_0x1809('0xa4')](path[_0x1809('0x58')](__dirname,_0x1809('0xa5'),_0x126d2c['output']),[_0x126d2c['id'],_0x350384['toString'](),path['join'](__dirname,_0x1809('0xa6'),_0x126d2c[_0x1809('0xa7')]),_0x104533]);return _0x126d2c;}else{var _0x3974d9=squel[_0x1809('0x74')]();_0x3974d9[_0x1809('0x8f')]('('+_0x350384['toString']()+')',_0x1809('0xa8'));_0x3974d9[_0x1809('0x6b')](_0x1809('0xa9'),_0x1809('0x1e'));_0x350384[_0x1809('0x3d')](_0x294faa[_0x1809('0x3d')]||_0x3ad747);_0x350384[_0x1809('0x1c')](_0x294faa[_0x1809('0x1c')]||0x0);return dbH[_0x1809('0x86')]['query'](_0x3974d9[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]})[_0x1809('0x26')](function(_0x3b44f1){if(!_0x3b44f1[_0x1809('0x3a')]){_0x19b162=0x0;}else{_0x19b162=_0x3b44f1[0x0][_0x1809('0x1e')]||0x0;}return dbH[_0x1809('0x86')][_0x1809('0x35')](_0x350384[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]});})['then'](function(_0x5c22e7){return{'rows':_0x5c22e7||[],'count':_0x19b162};});}});}exports['run']=function(_0x38ea21,_0x5c0078){return runReport(_0x38ea21[_0x1809('0x4a')],_0x38ea21['query'],_0x38ea21[_0x1809('0x46')])[_0x1809('0x26')](respondWithResult(_0x5c0078,null))[_0x1809('0x56')](handleError(_0x5c0078,null));};exports[_0x1809('0xaa')]=runReport;exports[_0x1809('0x35')]=function(_0x365c42,_0x48932e){var _0x48122c=0xa;var _0x534688=[_0x1809('0x58'),'left_join','right_join',_0x1809('0x5a')];var _0x1261ca={'SUM':'SUM(%s)','COUNT':_0x1809('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x1809('0x8b'),'AVG':_0x1809('0x5e'),'GROUP_CONCAT':_0x1809('0x8c'),'GROUP_CONCAT ASC':_0x1809('0x5f'),'GROUP_CONCAT DESC':_0x1809('0x60')};var _0x2480e5={'SEC_TO_TIME':_0x1809('0x61'),'DATE':_0x1809('0x62'),'HOUR':_0x1809('0xab'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1809('0x64')};var _0x5b09bd=function(_0x275a85){return!_[_0x1809('0x65')](['IS\x20NULL',_0x1809('0x67'),_0x1809('0x8d'),'IS\x20NOT\x20EMPTY'],_0x275a85);};var _0x4f8877=function(_0x5976da){if(!_0x5976da||!_0x5976da['rules'][_0x1809('0x3a')]){return'';}for(var _0x3e1c35='(',_0x59de3e=0x0;_0x59de3e<_0x5976da['rules'][_0x1809('0x3a')];_0x59de3e+=0x1){_0x59de3e>0x0&&(_0x3e1c35+='\x20'+_0x5976da[_0x1809('0xac')]+'\x20');_0x3e1c35+=_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6a')]?_0x4f8877(_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6a')]):_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6b')]+'\x20'+_0x5976da[_0x1809('0x69')][_0x59de3e][_0x1809('0x6c')]+(_0x5b09bd(_0x5976da[_0x1809('0x69')][_0x59de3e]['condition'])?'\x20'+_0x5976da[_0x1809('0x69')][_0x59de3e]['value']:'');}return _0x3e1c35+')';};var _0x3ce05c={'where':{'id':_0x365c42[_0x1809('0x4a')]['id']}},_0x321452,_0xd78ab3,_0xd51404,_0x2f12e4,_0x282b78;_0x3ce05c=_[_0x1809('0x45')]({},_0x3ce05c,_0x365c42[_0x1809('0x46')]);return db[_0x1809('0x2f')][_0x1809('0x4c')](_0x3ce05c)[_0x1809('0x26')](function(_0x26bf35){if(_0x26bf35){_0x321452=_0x26bf35;return _0x26bf35[_0x1809('0x6e')]();}return null;})[_0x1809('0x26')](function(_0x11f48b){if(_0x11f48b){if(!_0x11f48b[_0x1809('0x3a')]){throw new db[(_0x1809('0x6f'))]['ValidationErrorItem'](_0x1809('0x70'),0x193);}_0xd78ab3=_0x11f48b;return db['AnalyticMetric'][_0x1809('0x72')]({'raw':!![]});}return null;})[_0x1809('0x26')](function(_0x188150){if(_0x188150){_0xd51404=_[_0x1809('0x73')](_0x188150,'id');var _0x5d08e4;var _0x49a532=squel[_0x1809('0x74')]();_0x49a532[_0x1809('0x8f')](_0x321452[_0x1809('0x90')]);for(var _0x2a92d6=0x0;_0x2a92d6<_0xd78ab3[_0x1809('0x3a')];_0x2a92d6+=0x1){_0x5d08e4=_0xd78ab3[_0x2a92d6][_0x1809('0x75')]?_0xd51404[_0xd78ab3[_0x2a92d6][_0x1809('0x75')]][_0x1809('0x76')]:_0xd78ab3[_0x2a92d6][_0x1809('0x6b')];_0x5d08e4=_0xd78ab3[_0x2a92d6]['function']?_['replace'](_0x1261ca[_0xd78ab3[_0x2a92d6]['function']],'%s',_0x5d08e4):_0x5d08e4;_0x5d08e4=_0xd78ab3[_0x2a92d6]['format']?_[_0x1809('0x78')](_0x2480e5[_0xd78ab3[_0x2a92d6][_0x1809('0x79')]],'%s',_0x5d08e4):_0x5d08e4;if(_0xd78ab3[_0x2a92d6][_0x1809('0x91')]){_0x49a532['group'](_0x5d08e4);}_0xd78ab3[_0x2a92d6]['orderBy']&&_0x49a532[_0x1809('0x3e')](_0x5d08e4,_0xd78ab3[_0x2a92d6][_0x1809('0x7a')]==='DESC'?![]:!![]);_0x49a532[_0x1809('0x6b')](_0x5d08e4,_0xd78ab3[_0x2a92d6][_0x1809('0x92')]||_0x5d08e4);}if(_0x321452[_0x1809('0x7c')]){_0x321452[_0x1809('0x7c')]=JSON[_0x1809('0x81')](_0x321452[_0x1809('0x7c')]);for(var _0x403f18=0x0;_0x403f18<_0x321452[_0x1809('0x7c')]['length'];_0x403f18+=0x1){if(_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x32')]&&_[_0x1809('0x65')](_0x534688,_0x321452[_0x1809('0x7c')][_0x403f18]['type'])&&_0x321452[_0x1809('0x7c')][_0x403f18]['parentKey']&&_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x7f')]&&_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x7e')]){_0x49a532[_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x32')]](_0x321452['joins'][_0x403f18][_0x1809('0x7f')],null,util[_0x1809('0x79')](_0x1809('0x93'),_0x321452[_0x1809('0x90')],_0x321452['joins'][_0x403f18][_0x1809('0x7d')],_0x321452['joins'][_0x403f18][_0x1809('0x7f')],_0x321452[_0x1809('0x7c')][_0x403f18][_0x1809('0x7e')]));}}}if(_0x321452[_0x1809('0x80')]){_0x321452[_0x1809('0x80')]=JSON[_0x1809('0x81')](_0x321452['conditions']);_0x49a532[_0x1809('0x43')](_0x4f8877(_0x321452[_0x1809('0x80')][_0x1809('0x6a')]));}_0x282b78=_0x49a532[_0x1809('0x82')]();_0x49a532[_0x1809('0x3d')](_0x48122c);_0x49a532[_0x1809('0x1c')](0x0);logger[_0x1809('0x83')]('Limited\x20Query:',_0x49a532[_0x1809('0x85')]());return dbH['sequelize'][_0x1809('0x35')](_0x49a532[_0x1809('0x85')](),{'type':dbH[_0x1809('0x86')][_0x1809('0x87')][_0x1809('0x88')]});}})['then'](function(){return{'sql':_0x282b78[_0x1809('0x85')]()};})[_0x1809('0x26')](respondWithResult(_0x48932e,null))[_0x1809('0x56')](handleError(_0x48932e,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 2e56b29..feea3e7 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 _0x27fc=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird'];(function(_0x145d1e,_0x263e6b){var _0x4a5495=function(_0x2eb189){while(--_0x2eb189){_0x145d1e['push'](_0x145d1e['shift']());}};_0x4a5495(++_0x263e6b);}(_0x27fc,0xd8));var _0xc27f=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x27fc[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0xc27f('0x0'));var util=require(_0xc27f('0x1'));var logger=require(_0xc27f('0x2'))('api');var moment=require(_0xc27f('0x3'));var BPromise=require(_0xc27f('0x4'));var rp=require(_0xc27f('0x5'));var fs=require('fs');var path=require(_0xc27f('0x6'));var rimraf=require('rimraf');var config=require(_0xc27f('0x7'));var attributes=require(_0xc27f('0x8'));module[_0xc27f('0x9')]=function(_0x38e911,_0xefeb68){return _0x38e911[_0xc27f('0xa')](_0xc27f('0xb'),attributes,{'tableName':_0xc27f('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x125d=['./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2474cd,_0x56c1cc){var _0x9f6b3e=function(_0x459ee6){while(--_0x459ee6){_0x2474cd['push'](_0x2474cd['shift']());}};_0x9f6b3e(++_0x56c1cc);}(_0x125d,0x66));var _0xd125=function(_0x12078d,_0x25fa78){_0x12078d=_0x12078d-0x0;var _0x167e27=_0x125d[_0x12078d];return _0x167e27;};'use strict';var _=require(_0xd125('0x0'));var util=require(_0xd125('0x1'));var logger=require('../../config/logger')(_0xd125('0x2'));var moment=require(_0xd125('0x3'));var BPromise=require(_0xd125('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd125('0x5'));var rimraf=require(_0xd125('0x6'));var config=require(_0xd125('0x7'));var attributes=require(_0xd125('0x8'));module['exports']=function(_0x10e17a,_0x24a0f7){return _0x10e17a[_0xd125('0x9')](_0xd125('0xa'),attributes,{'tableName':'analytics_custom_reports','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 3cd07da..58aff2d 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 _0x7f9c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash'];(function(_0x311f54,_0x5a83f3){var _0x26fe9e=function(_0x1dd811){while(--_0x1dd811){_0x311f54['push'](_0x311f54['shift']());}};_0x26fe9e(++_0x5a83f3);}(_0x7f9c,0x117));var _0xc7f9=function(_0x2a2d43,_0x165f8b){_0x2a2d43=_0x2a2d43-0x0;var _0xec3c59=_0x7f9c[_0x2a2d43];return _0xec3c59;};'use strict';var _=require(_0xc7f9('0x0'));var util=require(_0xc7f9('0x1'));var moment=require('moment');var BPromise=require(_0xc7f9('0x2'));var rs=require(_0xc7f9('0x3'));var fs=require('fs');var Redis=require(_0xc7f9('0x4'));var db=require(_0xc7f9('0x5'))['db'];var utils=require(_0xc7f9('0x6'));var logger=require('../../config/logger')(_0xc7f9('0x7'));var config=require('../../config/environment');var jayson=require(_0xc7f9('0x8'));var client=jayson[_0xc7f9('0x9')][_0xc7f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6b75,_0x60d7b,_0x1226e9){return new BPromise(function(_0xd571b,_0x3f3e73){return client['request'](_0x4f6b75,_0x1226e9)[_0xc7f9('0xb')](function(_0x13ec90){logger['info'](_0xc7f9('0xc'),_0x60d7b,_0xc7f9('0xd'));logger[_0xc7f9('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x60d7b,_0xc7f9('0xd'),JSON[_0xc7f9('0xf')](_0x13ec90));if(_0x13ec90['error']){if(_0x13ec90[_0xc7f9('0x10')]['code']===0x1f4){logger[_0xc7f9('0x10')](_0xc7f9('0xc'),_0x60d7b,_0x13ec90[_0xc7f9('0x10')][_0xc7f9('0x11')]);return _0x3f3e73(_0x13ec90[_0xc7f9('0x10')][_0xc7f9('0x11')]);}logger[_0xc7f9('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x60d7b,_0x13ec90['error'][_0xc7f9('0x11')]);return _0xd571b(_0x13ec90[_0xc7f9('0x10')][_0xc7f9('0x11')]);}else{logger[_0xc7f9('0x12')](_0xc7f9('0xc'),_0x60d7b,_0xc7f9('0xd'));_0xd571b(_0x13ec90[_0xc7f9('0x13')][_0xc7f9('0x11')]);}})['catch'](function(_0x1027b3){logger[_0xc7f9('0x10')](_0xc7f9('0xc'),_0x60d7b,_0x1027b3);_0x3f3e73(_0x1027b3);});});}
\ No newline at end of file
+var _0x712d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment'];(function(_0x412377,_0x3446b8){var _0x5b833a=function(_0x4e0ea4){while(--_0x4e0ea4){_0x412377['push'](_0x412377['shift']());}};_0x5b833a(++_0x3446b8);}(_0x712d,0x1e2));var _0xd712=function(_0x4bc62e,_0x2ed0a4){_0x4bc62e=_0x4bc62e-0x0;var _0xd9adfe=_0x712d[_0x4bc62e];return _0xd9adfe;};'use strict';var _=require(_0xd712('0x0'));var util=require('util');var moment=require(_0xd712('0x1'));var BPromise=require(_0xd712('0x2'));var rs=require(_0xd712('0x3'));var fs=require('fs');var Redis=require(_0xd712('0x4'));var db=require(_0xd712('0x5'))['db'];var utils=require(_0xd712('0x6'));var logger=require(_0xd712('0x7'))('rpc');var config=require(_0xd712('0x8'));var jayson=require(_0xd712('0x9'));var client=jayson[_0xd712('0xa')][_0xd712('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11cb31,_0x504912,_0x2d3ec3){return new BPromise(function(_0x5cedc0,_0x175cf6){return client['request'](_0x11cb31,_0x2d3ec3)[_0xd712('0xc')](function(_0x4d2188){logger[_0xd712('0xd')](_0xd712('0xe'),_0x504912,'request\x20sent');logger[_0xd712('0xf')](_0xd712('0x10'),_0x504912,_0xd712('0x11'),JSON[_0xd712('0x12')](_0x4d2188));if(_0x4d2188[_0xd712('0x13')]){if(_0x4d2188[_0xd712('0x13')]['code']===0x1f4){logger[_0xd712('0x13')](_0xd712('0xe'),_0x504912,_0x4d2188['error'][_0xd712('0x14')]);return _0x175cf6(_0x4d2188[_0xd712('0x13')]['message']);}logger[_0xd712('0x13')](_0xd712('0xe'),_0x504912,_0x4d2188[_0xd712('0x13')][_0xd712('0x14')]);return _0x5cedc0(_0x4d2188[_0xd712('0x13')][_0xd712('0x14')]);}else{logger[_0xd712('0xd')](_0xd712('0xe'),_0x504912,_0xd712('0x11'));_0x5cedc0(_0x4d2188['result'][_0xd712('0x14')]);}})[_0xd712('0x15')](function(_0x1ef8b6){logger[_0xd712('0x13')](_0xd712('0xe'),_0x504912,_0x1ef8b6);_0x175cf6(_0x1ef8b6);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 595cbc5..ab8c3a0 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 _0xc85c=['preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2f1ce0,_0x1920a2){var _0x41800a=function(_0x53f826){while(--_0x53f826){_0x2f1ce0['push'](_0x2f1ce0['shift']());}};_0x41800a(++_0x1920a2);}(_0xc85c,0xf6));var _0xcc85=function(_0x470615,_0x1c7aaa){_0x470615=_0x470615-0x0;var _0x189c81=_0xc85c[_0x470615];return _0x189c81;};'use strict';var multer=require(_0xcc85('0x0'));var util=require('util');var path=require(_0xcc85('0x1'));var timeout=require(_0xcc85('0x2'));var express=require(_0xcc85('0x3'));var router=express[_0xcc85('0x4')]();var fs_extra=require(_0xcc85('0x5'));var auth=require(_0xcc85('0x6'));var interaction=require(_0xcc85('0x7'));var config=require('../../config/environment');var controller=require(_0xcc85('0x8'));router[_0xcc85('0x9')]('/',auth[_0xcc85('0xa')](),controller[_0xcc85('0xb')]);router[_0xcc85('0x9')](_0xcc85('0xc'),auth[_0xcc85('0xa')](),controller[_0xcc85('0xd')]);router[_0xcc85('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xcc85('0xe')]);router[_0xcc85('0x9')](_0xcc85('0xf'),auth[_0xcc85('0xa')](),controller[_0xcc85('0x10')]);router[_0xcc85('0x9')](_0xcc85('0x11'),auth[_0xcc85('0xa')](),controller[_0xcc85('0x12')]);router[_0xcc85('0x13')]('/',auth[_0xcc85('0xa')](),controller[_0xcc85('0x14')]);router[_0xcc85('0x15')](_0xcc85('0xc'),auth['isAuthenticated'](),controller[_0xcc85('0x16')]);router[_0xcc85('0x17')](_0xcc85('0xc'),auth[_0xcc85('0xa')](),controller[_0xcc85('0x18')]);module[_0xcc85('0x19')]=router;
\ No newline at end of file
+var _0x56ca=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','create','put','delete'];(function(_0x294ebc,_0x355914){var _0x1db19b=function(_0x173eab){while(--_0x173eab){_0x294ebc['push'](_0x294ebc['shift']());}};_0x1db19b(++_0x355914);}(_0x56ca,0x1b9));var _0xa56c=function(_0x2b6b6e,_0x47f2b1){_0x2b6b6e=_0x2b6b6e-0x0;var _0x2bfceb=_0x56ca[_0x2b6b6e];return _0x2bfceb;};'use strict';var multer=require('multer');var util=require(_0xa56c('0x0'));var path=require('path');var timeout=require(_0xa56c('0x1'));var express=require(_0xa56c('0x2'));var router=express['Router']();var fs_extra=require(_0xa56c('0x3'));var auth=require(_0xa56c('0x4'));var interaction=require(_0xa56c('0x5'));var config=require(_0xa56c('0x6'));var controller=require(_0xa56c('0x7'));router[_0xa56c('0x8')]('/',auth[_0xa56c('0x9')](),controller[_0xa56c('0xa')]);router['get'](_0xa56c('0xb'),auth[_0xa56c('0x9')](),controller[_0xa56c('0xc')]);router[_0xa56c('0x8')](_0xa56c('0xd'),auth['isAuthenticated'](),controller[_0xa56c('0xe')]);router['get'](_0xa56c('0xf'),auth[_0xa56c('0x9')](),controller['run']);router[_0xa56c('0x8')](_0xa56c('0x10'),auth[_0xa56c('0x9')](),controller[_0xa56c('0x11')]);router['post']('/',auth[_0xa56c('0x9')](),controller[_0xa56c('0x12')]);router[_0xa56c('0x13')](_0xa56c('0xb'),auth[_0xa56c('0x9')](),controller['update']);router[_0xa56c('0x14')]('/:id',auth[_0xa56c('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 31d667e..0482aab 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 _0x7fbe=['STRING','TEXT'];(function(_0x435aba,_0x1910b4){var _0x19c266=function(_0x2098aa){while(--_0x2098aa){_0x435aba['push'](_0x435aba['shift']());}};_0x19c266(++_0x1910b4);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x48a80d,_0x1b2aaf){_0x48a80d=_0x48a80d-0x0;var _0x267bcb=_0x7fbe[_0x48a80d];return _0x267bcb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0xa406af,_0xe9d7f1){var _0x22f04f=function(_0x3296d5){while(--_0x3296d5){_0xa406af['push'](_0xa406af['shift']());}};_0x22f04f(++_0xe9d7f1);}(_0xeda8,0x104));var _0x8eda=function(_0x561dea,_0x47c419){_0x561dea=_0x561dea-0x0;var _0x2e629e=_0xeda8[_0x561dea];return _0x2e629e;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index a449670..d0ffdf8 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 _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0x30df37,_0x48ad64){_0x30df37=_0x30df37-0x0;var _0x41ab55=_0x687b[_0x30df37];return _0x41ab55;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));};
\ No newline at end of file
+var _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0xb14376,_0x5b0bf2){_0xb14376=_0xb14376-0x0;var _0x232f52=_0x687b[_0xb14376];return _0x232f52;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 542f635..04f3937 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 _0x584a=['AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x1d2103,_0x439533){var _0x4785a8=function(_0x5279ad){while(--_0x5279ad){_0x1d2103['push'](_0x1d2103['shift']());}};_0x4785a8(++_0x439533);}(_0x584a,0x183));var _0xa584=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0x584a[_0x3213b7];return _0xb960bf;};'use strict';var _=require(_0xa584('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa584('0x1'));var moment=require(_0xa584('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa584('0x3'));var rimraf=require(_0xa584('0x4'));var config=require(_0xa584('0x5'));var attributes=require(_0xa584('0x6'));module[_0xa584('0x7')]=function(_0x22e731,_0xf72819){return _0x22e731[_0xa584('0x8')](_0xa584('0x9'),attributes,{'tableName':_0xa584('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ddb=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9ddb,0x1d8));var _0xb9dd=function(_0x14278a,_0x485860){_0x14278a=_0x14278a-0x0;var _0x24835d=_0x9ddb[_0x14278a];return _0x24835d;};'use strict';var _=require('lodash');var util=require(_0xb9dd('0x0'));var logger=require(_0xb9dd('0x1'))(_0xb9dd('0x2'));var moment=require(_0xb9dd('0x3'));var BPromise=require(_0xb9dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb9dd('0x5'));var config=require(_0xb9dd('0x6'));var attributes=require(_0xb9dd('0x7'));module[_0xb9dd('0x8')]=function(_0x904f5c,_0x44b7){return _0x904f5c[_0xb9dd('0x9')](_0xb9dd('0xa'),attributes,{'tableName':_0xb9dd('0xb'),'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 33ee911..f02b808 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 _0x10b0=['client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x10b0,0x1e5));var _0x010b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x10b0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x010b('0x0'));var util=require(_0x010b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x010b('0x2'));var fs=require('fs');var Redis=require(_0x010b('0x3'));var db=require(_0x010b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x010b('0x5'))(_0x010b('0x6'));var config=require(_0x010b('0x7'));var jayson=require(_0x010b('0x8'));var client=jayson[_0x010b('0x9')][_0x010b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f30ae,_0x358c42,_0x22a8e9){return new BPromise(function(_0x549725,_0x446e74){return client[_0x010b('0xb')](_0x3f30ae,_0x22a8e9)['then'](function(_0x56a04f){logger[_0x010b('0xc')](_0x010b('0xd'),_0x358c42,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x358c42,_0x010b('0xe'),JSON['stringify'](_0x56a04f));if(_0x56a04f[_0x010b('0xf')]){if(_0x56a04f[_0x010b('0xf')][_0x010b('0x10')]===0x1f4){logger['error'](_0x010b('0xd'),_0x358c42,_0x56a04f['error'][_0x010b('0x11')]);return _0x446e74(_0x56a04f[_0x010b('0xf')][_0x010b('0x11')]);}logger['error'](_0x010b('0xd'),_0x358c42,_0x56a04f[_0x010b('0xf')][_0x010b('0x11')]);return _0x549725(_0x56a04f[_0x010b('0xf')][_0x010b('0x11')]);}else{logger[_0x010b('0xc')](_0x010b('0xd'),_0x358c42,_0x010b('0xe'));_0x549725(_0x56a04f['result'][_0x010b('0x11')]);}})[_0x010b('0x12')](function(_0x2dd9aa){logger[_0x010b('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x358c42,_0x2dd9aa);_0x446e74(_0x2dd9aa);});});}
\ No newline at end of file
+var _0x5036=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment'];(function(_0x11c4ff,_0x567b13){var _0x52e721=function(_0x2fd190){while(--_0x2fd190){_0x11c4ff['push'](_0x11c4ff['shift']());}};_0x52e721(++_0x567b13);}(_0x5036,0x91));var _0x6503=function(_0x34271c,_0x28a8b){_0x34271c=_0x34271c-0x0;var _0x83585f=_0x5036[_0x34271c];return _0x83585f;};'use strict';var _=require('lodash');var util=require(_0x6503('0x0'));var moment=require(_0x6503('0x1'));var BPromise=require(_0x6503('0x2'));var rs=require(_0x6503('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6503('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6503('0x5'))(_0x6503('0x6'));var config=require(_0x6503('0x7'));var jayson=require(_0x6503('0x8'));var client=jayson[_0x6503('0x9')][_0x6503('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3332cf,_0x51bab9,_0x2e9f1a){return new BPromise(function(_0x1018eb,_0x3db1b4){return client[_0x6503('0xb')](_0x3332cf,_0x2e9f1a)[_0x6503('0xc')](function(_0x59c835){logger['info'](_0x6503('0xd'),_0x51bab9,_0x6503('0xe'));logger['debug'](_0x6503('0xf'),_0x51bab9,'request\x20sent',JSON['stringify'](_0x59c835));if(_0x59c835[_0x6503('0x10')]){if(_0x59c835[_0x6503('0x10')][_0x6503('0x11')]===0x1f4){logger['error'](_0x6503('0xd'),_0x51bab9,_0x59c835[_0x6503('0x10')]['message']);return _0x3db1b4(_0x59c835[_0x6503('0x10')][_0x6503('0x12')]);}logger[_0x6503('0x10')](_0x6503('0xd'),_0x51bab9,_0x59c835[_0x6503('0x10')][_0x6503('0x12')]);return _0x1018eb(_0x59c835[_0x6503('0x10')][_0x6503('0x12')]);}else{logger['info'](_0x6503('0xd'),_0x51bab9,_0x6503('0xe'));_0x1018eb(_0x59c835[_0x6503('0x13')][_0x6503('0x12')]);}})[_0x6503('0x14')](function(_0x2a92a){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x51bab9,_0x2a92a);_0x3db1b4(_0x2a92a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index fe6c7d8..593db79 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 _0x5823=['util','path','connect-timeout','express','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/run','run','query','post','create','put','update','multer'];(function(_0x17d363,_0x180411){var _0x3ea444=function(_0x19fb7a){while(--_0x19fb7a){_0x17d363['push'](_0x17d363['shift']());}};_0x3ea444(++_0x180411);}(_0x5823,0x18e));var _0x3582=function(_0x61ef6c,_0x2c4d43){_0x61ef6c=_0x61ef6c-0x0;var _0x48f75c=_0x5823[_0x61ef6c];return _0x48f75c;};'use strict';var multer=require(_0x3582('0x0'));var util=require(_0x3582('0x1'));var path=require(_0x3582('0x2'));var timeout=require(_0x3582('0x3'));var express=require(_0x3582('0x4'));var router=express['Router']();var fs_extra=require(_0x3582('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3582('0x6'));var controller=require(_0x3582('0x7'));router[_0x3582('0x8')]('/',auth['isAuthenticated'](),controller[_0x3582('0x9')]);router['get'](_0x3582('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3582('0x8')]('/:id/preview',auth[_0x3582('0xb')](),controller['preview']);router[_0x3582('0x8')](_0x3582('0xc'),auth[_0x3582('0xb')](),controller[_0x3582('0xd')]);router['get']('/:id/query',auth[_0x3582('0xb')](),controller[_0x3582('0xe')]);router[_0x3582('0xf')]('/',auth[_0x3582('0xb')](),controller[_0x3582('0x10')]);router[_0x3582('0x11')](_0x3582('0xa'),auth[_0x3582('0xb')](),controller[_0x3582('0x12')]);router['delete'](_0x3582('0xa'),auth[_0x3582('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8c4e=['../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2a0504,_0x5b5bbc){var _0x492f99=function(_0x1cc057){while(--_0x1cc057){_0x2a0504['push'](_0x2a0504['shift']());}};_0x492f99(++_0x5b5bbc);}(_0x8c4e,0x117));var _0xe8c4=function(_0x5726a6,_0x48f53a){_0x5726a6=_0x5726a6-0x0;var _0x437d89=_0x8c4e[_0x5726a6];return _0x437d89;};'use strict';var multer=require(_0xe8c4('0x0'));var util=require(_0xe8c4('0x1'));var path=require('path');var timeout=require(_0xe8c4('0x2'));var express=require(_0xe8c4('0x3'));var router=express[_0xe8c4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe8c4('0x5'));var interaction=require(_0xe8c4('0x6'));var config=require(_0xe8c4('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xe8c4('0x8')]('/',auth[_0xe8c4('0x9')](),controller[_0xe8c4('0xa')]);router[_0xe8c4('0x8')](_0xe8c4('0xb'),auth[_0xe8c4('0x9')](),controller['show']);router[_0xe8c4('0x8')](_0xe8c4('0xc'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0xd')]);router[_0xe8c4('0x8')](_0xe8c4('0xe'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0xf')]);router[_0xe8c4('0x8')](_0xe8c4('0x10'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x11')]);router['post']('/',auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x12')]);router[_0xe8c4('0x13')](_0xe8c4('0xb'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x14')]);router['delete'](_0xe8c4('0xb'),auth[_0xe8c4('0x9')](),controller[_0xe8c4('0x15')]);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 3f87b3c..44668a8 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 _0x9aaf=['scheduled','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9aaf,0x152));var _0xf9aa=function(_0x4bcfa6,_0x1c7e43){_0x4bcfa6=_0x4bcfa6-0x0;var _0x1c0165=_0x9aaf[_0x4bcfa6];return _0x1c0165;};'use strict';var Sequelize=require(_0xf9aa('0x0'));var moment=require('moment');module[_0xf9aa('0x1')]={'name':{'type':Sequelize[_0xf9aa('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xf9aa('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xf9aa('0x3')](_0xf9aa('0x4'),_0xf9aa('0x5'),_0xf9aa('0x6')),'allowNull':![],'defaultValue':_0xf9aa('0x4')},'savename':{'type':Sequelize[_0xf9aa('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf9aa('0x7')]},'endDate':{'type':Sequelize[_0xf9aa('0x7')]},'status':{'type':Sequelize[_0xf9aa('0x2')],'defaultValue':_0xf9aa('0x8')},'type':{'type':Sequelize['ENUM'](_0xf9aa('0x9'),_0xf9aa('0xa')),'allowNull':![],'defaultValue':_0xf9aa('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xf9aa('0xb')]},'reportType':{'type':Sequelize[_0xf9aa('0x2')]}};
\ No newline at end of file
+var _0xf924=['Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','STRING','csv','pdf','xlsx','DATE'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf924,0x1cd));var _0x4f92=function(_0x29e327,_0x2b6ea9){_0x29e327=_0x29e327-0x0;var _0x3dac9e=_0xf924[_0x29e327];return _0x3dac9e;};'use strict';var Sequelize=require(_0x4f92('0x0'));var moment=require(_0x4f92('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4f92('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4f92('0x3'),_0x4f92('0x4'),_0x4f92('0x5')),'allowNull':![],'defaultValue':_0x4f92('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x4f92('0x6')]},'endDate':{'type':Sequelize[_0x4f92('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x4f92('0x7')},'type':{'type':Sequelize[_0x4f92('0x8')](_0x4f92('0x9'),_0x4f92('0xa')),'allowNull':![],'defaultValue':_0x4f92('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x4f92('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index c0490f4..6af251d 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 _0x1c10=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','join','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','sendStatus','stack','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes'];(function(_0x4a3af6,_0x13193c){var _0x191578=function(_0x3ad4eb){while(--_0x3ad4eb){_0x4a3af6['push'](_0x4a3af6['shift']());}};_0x191578(++_0x13193c);}(_0x1c10,0x8a));var _0x01c1=function(_0x1a03b7,_0x11b26c){_0x1a03b7=_0x1a03b7-0x0;var _0x234f13=_0x1c10[_0x1a03b7];return _0x234f13;};'use strict';var emlformat=require(_0x01c1('0x0'));var rimraf=require(_0x01c1('0x1'));var zipdir=require(_0x01c1('0x2'));var jsonpatch=require(_0x01c1('0x3'));var rp=require(_0x01c1('0x4'));var moment=require(_0x01c1('0x5'));var BPromise=require(_0x01c1('0x6'));var Mustache=require('mustache');var util=require(_0x01c1('0x7'));var path=require('path');var sox=require(_0x01c1('0x8'));var csv=require(_0x01c1('0x9'));var ejs=require(_0x01c1('0xa'));var fs=require('fs');var fs_extra=require(_0x01c1('0xb'));var _=require('lodash');var squel=require(_0x01c1('0xc'));var crypto=require(_0x01c1('0xd'));var jsforce=require(_0x01c1('0xe'));var deskjs=require(_0x01c1('0xf'));var toCsv=require(_0x01c1('0x9'));var querystring=require(_0x01c1('0x10'));var Papa=require(_0x01c1('0x11'));var Redis=require(_0x01c1('0x12'));var authService=require(_0x01c1('0x13'));var qs=require(_0x01c1('0x14'));var as=require(_0x01c1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01c1('0x16'))(_0x01c1('0x17'));var utils=require(_0x01c1('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01c1('0x19'))['db'];function respondWithStatusCode(_0x331778,_0x58584d){_0x58584d=_0x58584d||0xcc;return function(_0x506b2c){if(_0x506b2c){return _0x331778['sendStatus'](_0x58584d);}return _0x331778[_0x01c1('0x1a')](_0x58584d)[_0x01c1('0x1b')]();};}function respondWithResult(_0x537ec5,_0x35368a){_0x35368a=_0x35368a||0xc8;return function(_0x586d83){if(_0x586d83){return _0x537ec5[_0x01c1('0x1a')](_0x35368a)[_0x01c1('0x1c')](_0x586d83);}};}function respondWithFilteredResult(_0x23927b,_0x633df7){return function(_0x54c5cb){if(_0x54c5cb){var _0x1bef64=typeof _0x633df7[_0x01c1('0x1d')]===_0x01c1('0x1e')&&typeof _0x633df7['limit']===_0x01c1('0x1e');var _0x28ea76=_0x54c5cb[_0x01c1('0x1f')];var _0x4a86b=_0x1bef64?0x0:_0x633df7[_0x01c1('0x1d')];var _0x223ca1=_0x1bef64?_0x54c5cb['count']:_0x633df7[_0x01c1('0x1d')]+_0x633df7[_0x01c1('0x20')];var _0x275fad;if(_0x223ca1>=_0x28ea76){_0x223ca1=_0x28ea76;_0x275fad=0xc8;}else{_0x275fad=0xce;}_0x23927b[_0x01c1('0x1a')](_0x275fad);return _0x23927b[_0x01c1('0x21')](_0x01c1('0x22'),_0x4a86b+'-'+_0x223ca1+'/'+_0x28ea76)[_0x01c1('0x1c')](_0x54c5cb);}return null;};}function patchUpdates(_0xaeed02){return function(_0x535db3){try{jsonpatch[_0x01c1('0x23')](_0x535db3,_0xaeed02,!![]);}catch(_0x21b084){return BPromise[_0x01c1('0x24')](_0x21b084);}return _0x535db3[_0x01c1('0x25')]();};}function saveUpdates(_0x26d5d7,_0x5843c9){return function(_0x16d561){if(_0x16d561){return _0x16d561[_0x01c1('0x26')](_0x26d5d7)[_0x01c1('0x27')](function(_0xb50482){return _0xb50482;});}return null;};}function removeEntity(_0x580484,_0x1e8893){return function(_0x429091){if(_0x429091){return _0x429091[_0x01c1('0x28')]()[_0x01c1('0x27')](function(){var _0x155588=_0x429091[_0x01c1('0x29')]({'plain':!![]});var _0x3b64d2=_0x01c1('0x2a');return db['UserProfileResource'][_0x01c1('0x28')]({'where':{'type':_0x3b64d2,'resourceId':_0x155588['id']}})[_0x01c1('0x27')](function(){return _0x429091;});})['then'](function(){_0x580484[_0x01c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x554d0e,_0x2b0473){return function(_0xda56ae){if(!_0xda56ae){_0x554d0e[_0x01c1('0x2b')](0x194);}return _0xda56ae;};}function handleError(_0x76b4a,_0x4f7d89){_0x4f7d89=_0x4f7d89||0x1f4;return function(_0x1ffe65){logger['error'](_0x1ffe65[_0x01c1('0x2c')]);if(_0x1ffe65['name']){delete _0x1ffe65['name'];}_0x76b4a[_0x01c1('0x1a')](_0x4f7d89)[_0x01c1('0x2d')](_0x1ffe65);};}exports[_0x01c1('0x2e')]=function(_0x22f9d8,_0x16cd8a){var _0x102ff1={},_0x116fbd={},_0x259635={'count':0x0,'rows':[]};var _0x1f02ba=_[_0x01c1('0x2f')](db[_0x01c1('0x30')][_0x01c1('0x31')],function(_0x37592e){return{'name':_0x37592e[_0x01c1('0x32')],'type':_0x37592e[_0x01c1('0x33')][_0x01c1('0x34')]};});_0x116fbd[_0x01c1('0x35')]=_[_0x01c1('0x2f')](_0x1f02ba,_0x01c1('0x36'));_0x116fbd[_0x01c1('0x37')]=_[_0x01c1('0x38')](_0x22f9d8[_0x01c1('0x37')]);_0x116fbd[_0x01c1('0x39')]=_[_0x01c1('0x3a')](_0x116fbd['model'],_0x116fbd[_0x01c1('0x37')]);_0x102ff1[_0x01c1('0x3b')]=_[_0x01c1('0x3a')](_0x116fbd[_0x01c1('0x35')],qs[_0x01c1('0x3c')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x3c')]));_0x102ff1[_0x01c1('0x3b')]=_0x102ff1[_0x01c1('0x3b')][_0x01c1('0x3d')]?_0x102ff1[_0x01c1('0x3b')]:_0x116fbd[_0x01c1('0x35')];if(!_0x22f9d8['query'][_0x01c1('0x3e')](_0x01c1('0x3f'))){_0x102ff1[_0x01c1('0x20')]=qs[_0x01c1('0x20')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x20')]);_0x102ff1['offset']=qs[_0x01c1('0x1d')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x1d')]);}_0x102ff1[_0x01c1('0x40')]=qs[_0x01c1('0x41')](_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x41')]);_0x102ff1[_0x01c1('0x42')]=qs[_0x01c1('0x39')](_[_0x01c1('0x43')](_0x22f9d8[_0x01c1('0x37')],_0x116fbd[_0x01c1('0x39')]),_0x1f02ba);if(_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x44')]){_0x102ff1['where']=_[_0x01c1('0x45')](_0x102ff1[_0x01c1('0x42')],{'$or':_[_0x01c1('0x2f')](_0x1f02ba,function(_0x558fa2){if(_0x558fa2['type']!=='VIRTUAL'){var _0x3d6d94={};_0x3d6d94[_0x558fa2[_0x01c1('0x36')]]={'$like':'%'+_0x22f9d8[_0x01c1('0x37')][_0x01c1('0x44')]+'%'};return _0x3d6d94;}})});}_0x102ff1=_[_0x01c1('0x45')]({},_0x102ff1,_0x22f9d8[_0x01c1('0x46')]);var _0x2d23f1={'where':_0x102ff1[_0x01c1('0x42')]};return db[_0x01c1('0x30')][_0x01c1('0x1f')](_0x2d23f1)[_0x01c1('0x27')](function(_0x39e08c){_0x259635[_0x01c1('0x1f')]=_0x39e08c;if(_0x22f9d8['query']['includeAll']){_0x102ff1[_0x01c1('0x47')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x01c1('0x48')](_0x102ff1);})[_0x01c1('0x27')](function(_0x1f97f0){_0x259635['rows']=_0x1f97f0;return _0x259635;})[_0x01c1('0x27')](respondWithFilteredResult(_0x16cd8a,_0x102ff1))[_0x01c1('0x49')](handleError(_0x16cd8a,null));};exports[_0x01c1('0x4a')]=function(_0x8aa46,_0xc64cdb){var _0x3be818={'raw':!![],'where':{'id':_0x8aa46[_0x01c1('0x4b')]['id']}},_0x3275ab={};_0x3275ab['model']=_[_0x01c1('0x38')](db[_0x01c1('0x30')][_0x01c1('0x31')]);_0x3275ab[_0x01c1('0x37')]=_[_0x01c1('0x38')](_0x8aa46[_0x01c1('0x37')]);_0x3275ab[_0x01c1('0x39')]=_[_0x01c1('0x3a')](_0x3275ab[_0x01c1('0x35')],_0x3275ab[_0x01c1('0x37')]);_0x3be818[_0x01c1('0x3b')]=_[_0x01c1('0x3a')](_0x3275ab[_0x01c1('0x35')],qs['fields'](_0x8aa46['query'][_0x01c1('0x3c')]));_0x3be818[_0x01c1('0x3b')]=_0x3be818[_0x01c1('0x3b')][_0x01c1('0x3d')]?_0x3be818[_0x01c1('0x3b')]:_0x3275ab[_0x01c1('0x35')];if(_0x8aa46[_0x01c1('0x37')][_0x01c1('0x4c')]){_0x3be818[_0x01c1('0x47')]=[{'all':!![]}];}_0x3be818=_[_0x01c1('0x45')]({},_0x3be818,_0x8aa46[_0x01c1('0x46')]);return db['AnalyticExtractedReport'][_0x01c1('0x4d')](_0x3be818)[_0x01c1('0x27')](handleEntityNotFound(_0xc64cdb,null))['then'](respondWithResult(_0xc64cdb,null))[_0x01c1('0x49')](handleError(_0xc64cdb,null));};exports[_0x01c1('0x4e')]=function(_0x5c067d,_0x4d23fe){return db[_0x01c1('0x30')][_0x01c1('0x4e')](_0x5c067d[_0x01c1('0x4f')],{})[_0x01c1('0x27')](function(_0x51cef1){var _0x2a8c4a=_0x5c067d[_0x01c1('0x50')][_0x01c1('0x29')]({'plain':!![]});if(!_0x2a8c4a)throw new Error(_0x01c1('0x51'));if(_0x2a8c4a['role']==='user'){var _0x1da8c3=_0x51cef1[_0x01c1('0x29')]({'plain':!![]});var _0x288975=_0x01c1('0x2a');return db[_0x01c1('0x52')]['find']({'where':{'name':_0x288975,'userProfileId':_0x2a8c4a[_0x01c1('0x53')]},'raw':!![]})[_0x01c1('0x27')](function(_0x3a81bd){if(_0x3a81bd&&_0x3a81bd[_0x01c1('0x54')]===0x0){return db[_0x01c1('0x55')][_0x01c1('0x4e')]({'name':_0x1da8c3[_0x01c1('0x36')],'resourceId':_0x1da8c3['id'],'type':_0x3a81bd['name'],'sectionId':_0x3a81bd['id']},{})['then'](function(){return _0x51cef1;});}else{return _0x51cef1;}})[_0x01c1('0x49')](function(_0x404047){logger[_0x01c1('0x56')](_0x01c1('0x57'),_0x404047);throw _0x404047;});}return _0x51cef1;})[_0x01c1('0x27')](respondWithResult(_0x4d23fe,0xc9))[_0x01c1('0x49')](handleError(_0x4d23fe,null));};exports[_0x01c1('0x26')]=function(_0x598843,_0x36fedc){if(_0x598843[_0x01c1('0x4f')]['id']){delete _0x598843['body']['id'];}return db[_0x01c1('0x30')][_0x01c1('0x4d')]({'where':{'id':_0x598843['params']['id']}})[_0x01c1('0x27')](handleEntityNotFound(_0x36fedc,null))[_0x01c1('0x27')](saveUpdates(_0x598843[_0x01c1('0x4f')],null))[_0x01c1('0x27')](respondWithResult(_0x36fedc,null))[_0x01c1('0x49')](handleError(_0x36fedc,null));};exports[_0x01c1('0x28')]=function(_0xb7e9db,_0x25f01e){return db[_0x01c1('0x30')]['find']({'where':{'id':_0xb7e9db[_0x01c1('0x4b')]['id']}})[_0x01c1('0x27')](handleEntityNotFound(_0x25f01e,null))[_0x01c1('0x27')](removeEntity(_0x25f01e,null))[_0x01c1('0x49')](handleError(_0x25f01e,null));};exports[_0x01c1('0x58')]=function(_0x3521f5,_0x1be031,_0x50098b){return db[_0x01c1('0x30')]['find']({'where':{'id':_0x3521f5[_0x01c1('0x4b')]['id']},'attributes':[_0x01c1('0x36'),_0x01c1('0x59'),_0x01c1('0x5a'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1be031,null))[_0x01c1('0x27')](function(_0x4b97ff){if(_0x4b97ff){if(!fs['existsSync'](path['join'](config[_0x01c1('0x5b')],'server/files/reports',_0x4b97ff[_0x01c1('0x5a')]))){throw new db[(_0x01c1('0x5c'))]['ValidationError'](_0x01c1('0x5d'));}if(_0x3521f5['query'][_0x01c1('0x5e')]){return _0x1be031[_0x01c1('0x2b')](0xc8);}return _0x1be031[_0x01c1('0x58')](path[_0x01c1('0x5f')](config['root'],'server/files/reports',_0x4b97ff[_0x01c1('0x5a')]),util['format'](_0x01c1('0x60'),_0x4b97ff[_0x01c1('0x59')]||_0x4b97ff['name'],_0x4b97ff[_0x01c1('0x61')][_0x01c1('0x62')]()));}})[_0x01c1('0x49')](handleError(_0x1be031,null));};
\ No newline at end of file
+var _0x9fc0=['role','ExtractedReports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','AnalyticExtractedReport','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xde455,_0x1f7ed9){var _0x4822d5=function(_0x363598){while(--_0x363598){_0xde455['push'](_0xde455['shift']());}};_0x4822d5(++_0x1f7ed9);}(_0x9fc0,0x138));var _0x09fc=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0x9fc0[_0xa4928c];return _0x27cc29;};'use strict';var emlformat=require(_0x09fc('0x0'));var rimraf=require(_0x09fc('0x1'));var zipdir=require(_0x09fc('0x2'));var jsonpatch=require(_0x09fc('0x3'));var rp=require(_0x09fc('0x4'));var moment=require(_0x09fc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x09fc('0x6'));var util=require('util');var path=require(_0x09fc('0x7'));var sox=require(_0x09fc('0x8'));var csv=require(_0x09fc('0x9'));var ejs=require(_0x09fc('0xa'));var fs=require('fs');var fs_extra=require(_0x09fc('0xb'));var _=require('lodash');var squel=require(_0x09fc('0xc'));var crypto=require(_0x09fc('0xd'));var jsforce=require(_0x09fc('0xe'));var deskjs=require(_0x09fc('0xf'));var toCsv=require(_0x09fc('0x9'));var querystring=require('querystring');var Papa=require(_0x09fc('0x10'));var Redis=require(_0x09fc('0x11'));var authService=require(_0x09fc('0x12'));var qs=require(_0x09fc('0x13'));var as=require(_0x09fc('0x14'));var hardwareService=require(_0x09fc('0x15'));var logger=require(_0x09fc('0x16'))(_0x09fc('0x17'));var utils=require(_0x09fc('0x18'));var config=require(_0x09fc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x09fc('0x1a'))['db'];function respondWithStatusCode(_0x3f786c,_0x3c8011){_0x3c8011=_0x3c8011||0xcc;return function(_0xcae202){if(_0xcae202){return _0x3f786c[_0x09fc('0x1b')](_0x3c8011);}return _0x3f786c['status'](_0x3c8011)[_0x09fc('0x1c')]();};}function respondWithResult(_0x27bec0,_0x152e6c){_0x152e6c=_0x152e6c||0xc8;return function(_0x29d989){if(_0x29d989){return _0x27bec0[_0x09fc('0x1d')](_0x152e6c)[_0x09fc('0x1e')](_0x29d989);}};}function respondWithFilteredResult(_0xfaeb3a,_0x2f5dc7){return function(_0x255eba){if(_0x255eba){var _0xa18d29=typeof _0x2f5dc7[_0x09fc('0x1f')]==='undefined'&&typeof _0x2f5dc7[_0x09fc('0x20')]===_0x09fc('0x21');var _0x2e1bb0=_0x255eba['count'];var _0x4aec9c=_0xa18d29?0x0:_0x2f5dc7[_0x09fc('0x1f')];var _0x19a19f=_0xa18d29?_0x255eba[_0x09fc('0x22')]:_0x2f5dc7['offset']+_0x2f5dc7[_0x09fc('0x20')];var _0x50688f;if(_0x19a19f>=_0x2e1bb0){_0x19a19f=_0x2e1bb0;_0x50688f=0xc8;}else{_0x50688f=0xce;}_0xfaeb3a['status'](_0x50688f);return _0xfaeb3a[_0x09fc('0x23')](_0x09fc('0x24'),_0x4aec9c+'-'+_0x19a19f+'/'+_0x2e1bb0)[_0x09fc('0x1e')](_0x255eba);}return null;};}function patchUpdates(_0x34b454){return function(_0x55b176){try{jsonpatch[_0x09fc('0x25')](_0x55b176,_0x34b454,!![]);}catch(_0x2aac69){return BPromise[_0x09fc('0x26')](_0x2aac69);}return _0x55b176[_0x09fc('0x27')]();};}function saveUpdates(_0x11f5bd,_0x583df8){return function(_0x1fcc87){if(_0x1fcc87){return _0x1fcc87[_0x09fc('0x28')](_0x11f5bd)[_0x09fc('0x29')](function(_0xd59f29){return _0xd59f29;});}return null;};}function removeEntity(_0x52ed92,_0x2a7822){return function(_0x6549a4){if(_0x6549a4){return _0x6549a4[_0x09fc('0x2a')]()[_0x09fc('0x29')](function(){var _0x315871=_0x6549a4[_0x09fc('0x2b')]({'plain':!![]});var _0x4a0442='ExtractedReports';return db[_0x09fc('0x2c')]['destroy']({'where':{'type':_0x4a0442,'resourceId':_0x315871['id']}})[_0x09fc('0x29')](function(){return _0x6549a4;});})[_0x09fc('0x29')](function(){_0x52ed92[_0x09fc('0x1d')](0xcc)[_0x09fc('0x1c')]();});}};}function handleEntityNotFound(_0x6ff714,_0x414846){return function(_0xac2e28){if(!_0xac2e28){_0x6ff714[_0x09fc('0x1b')](0x194);}return _0xac2e28;};}function handleError(_0xf4b598,_0x3ca042){_0x3ca042=_0x3ca042||0x1f4;return function(_0x3b4d42){logger['error'](_0x3b4d42[_0x09fc('0x2d')]);if(_0x3b4d42['name']){delete _0x3b4d42[_0x09fc('0x2e')];}_0xf4b598[_0x09fc('0x1d')](_0x3ca042)['send'](_0x3b4d42);};}exports[_0x09fc('0x2f')]=function(_0x2c592d,_0x415051){var _0x45e316={},_0x25a388={},_0x203bba={'count':0x0,'rows':[]};var _0x216990=_[_0x09fc('0x30')](db['AnalyticExtractedReport'][_0x09fc('0x31')],function(_0x45543d){return{'name':_0x45543d[_0x09fc('0x32')],'type':_0x45543d[_0x09fc('0x33')][_0x09fc('0x34')]};});_0x25a388[_0x09fc('0x35')]=_['map'](_0x216990,_0x09fc('0x2e'));_0x25a388[_0x09fc('0x36')]=_[_0x09fc('0x37')](_0x2c592d[_0x09fc('0x36')]);_0x25a388[_0x09fc('0x38')]=_[_0x09fc('0x39')](_0x25a388[_0x09fc('0x35')],_0x25a388['query']);_0x45e316[_0x09fc('0x3a')]=_[_0x09fc('0x39')](_0x25a388['model'],qs[_0x09fc('0x3b')](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x3b')]));_0x45e316[_0x09fc('0x3a')]=_0x45e316['attributes'][_0x09fc('0x3c')]?_0x45e316[_0x09fc('0x3a')]:_0x25a388[_0x09fc('0x35')];if(!_0x2c592d[_0x09fc('0x36')]['hasOwnProperty']('nolimit')){_0x45e316[_0x09fc('0x20')]=qs[_0x09fc('0x20')](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x20')]);_0x45e316[_0x09fc('0x1f')]=qs[_0x09fc('0x1f')](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x1f')]);}_0x45e316[_0x09fc('0x3d')]=qs['sort'](_0x2c592d[_0x09fc('0x36')][_0x09fc('0x3e')]);_0x45e316[_0x09fc('0x3f')]=qs[_0x09fc('0x38')](_[_0x09fc('0x40')](_0x2c592d['query'],_0x25a388['filters']),_0x216990);if(_0x2c592d[_0x09fc('0x36')][_0x09fc('0x41')]){_0x45e316[_0x09fc('0x3f')]=_[_0x09fc('0x42')](_0x45e316[_0x09fc('0x3f')],{'$or':_[_0x09fc('0x30')](_0x216990,function(_0x155f67){if(_0x155f67[_0x09fc('0x33')]!=='VIRTUAL'){var _0x5e3ea5={};_0x5e3ea5[_0x155f67[_0x09fc('0x2e')]]={'$like':'%'+_0x2c592d['query'][_0x09fc('0x41')]+'%'};return _0x5e3ea5;}})});}_0x45e316=_[_0x09fc('0x42')]({},_0x45e316,_0x2c592d[_0x09fc('0x43')]);var _0x39219f={'where':_0x45e316[_0x09fc('0x3f')]};return db[_0x09fc('0x44')]['count'](_0x39219f)[_0x09fc('0x29')](function(_0x4b8512){_0x203bba[_0x09fc('0x22')]=_0x4b8512;if(_0x2c592d[_0x09fc('0x36')][_0x09fc('0x45')]){_0x45e316[_0x09fc('0x46')]=[{'all':!![]}];}return db[_0x09fc('0x44')][_0x09fc('0x47')](_0x45e316);})[_0x09fc('0x29')](function(_0x3a76c4){_0x203bba[_0x09fc('0x48')]=_0x3a76c4;return _0x203bba;})['then'](respondWithFilteredResult(_0x415051,_0x45e316))['catch'](handleError(_0x415051,null));};exports[_0x09fc('0x49')]=function(_0x103240,_0x3b2dba){var _0x50712c={'raw':!![],'where':{'id':_0x103240[_0x09fc('0x4a')]['id']}},_0x32cd3e={};_0x32cd3e[_0x09fc('0x35')]=_[_0x09fc('0x37')](db['AnalyticExtractedReport'][_0x09fc('0x31')]);_0x32cd3e[_0x09fc('0x36')]=_['keys'](_0x103240[_0x09fc('0x36')]);_0x32cd3e[_0x09fc('0x38')]=_[_0x09fc('0x39')](_0x32cd3e['model'],_0x32cd3e[_0x09fc('0x36')]);_0x50712c[_0x09fc('0x3a')]=_['intersection'](_0x32cd3e[_0x09fc('0x35')],qs[_0x09fc('0x3b')](_0x103240[_0x09fc('0x36')][_0x09fc('0x3b')]));_0x50712c[_0x09fc('0x3a')]=_0x50712c['attributes'][_0x09fc('0x3c')]?_0x50712c[_0x09fc('0x3a')]:_0x32cd3e['model'];if(_0x103240[_0x09fc('0x36')]['includeAll']){_0x50712c[_0x09fc('0x46')]=[{'all':!![]}];}_0x50712c=_[_0x09fc('0x42')]({},_0x50712c,_0x103240['options']);return db[_0x09fc('0x44')]['find'](_0x50712c)['then'](handleEntityNotFound(_0x3b2dba,null))['then'](respondWithResult(_0x3b2dba,null))[_0x09fc('0x4b')](handleError(_0x3b2dba,null));};exports['create']=function(_0xba7035,_0x54d547){return db[_0x09fc('0x44')][_0x09fc('0x4c')](_0xba7035[_0x09fc('0x4d')],{})[_0x09fc('0x29')](function(_0x1ab60c){var _0x211465=_0xba7035[_0x09fc('0x4e')][_0x09fc('0x2b')]({'plain':!![]});if(!_0x211465)throw new Error(_0x09fc('0x4f'));if(_0x211465[_0x09fc('0x50')]===_0x09fc('0x4e')){var _0x291ef0=_0x1ab60c[_0x09fc('0x2b')]({'plain':!![]});var _0x40f767=_0x09fc('0x51');return db[_0x09fc('0x52')][_0x09fc('0x53')]({'where':{'name':_0x40f767,'userProfileId':_0x211465[_0x09fc('0x54')]},'raw':!![]})[_0x09fc('0x29')](function(_0x4c84a6){if(_0x4c84a6&&_0x4c84a6['autoAssociation']===0x0){return db[_0x09fc('0x2c')][_0x09fc('0x4c')]({'name':_0x291ef0[_0x09fc('0x2e')],'resourceId':_0x291ef0['id'],'type':_0x4c84a6[_0x09fc('0x2e')],'sectionId':_0x4c84a6['id']},{})[_0x09fc('0x29')](function(){return _0x1ab60c;});}else{return _0x1ab60c;}})['catch'](function(_0x320fe1){logger['error'](_0x09fc('0x55'),_0x320fe1);throw _0x320fe1;});}return _0x1ab60c;})[_0x09fc('0x29')](respondWithResult(_0x54d547,0xc9))[_0x09fc('0x4b')](handleError(_0x54d547,null));};exports[_0x09fc('0x28')]=function(_0x5d81f2,_0x2e1732){if(_0x5d81f2[_0x09fc('0x4d')]['id']){delete _0x5d81f2[_0x09fc('0x4d')]['id'];}return db[_0x09fc('0x44')][_0x09fc('0x53')]({'where':{'id':_0x5d81f2['params']['id']}})[_0x09fc('0x29')](handleEntityNotFound(_0x2e1732,null))[_0x09fc('0x29')](saveUpdates(_0x5d81f2[_0x09fc('0x4d')],null))[_0x09fc('0x29')](respondWithResult(_0x2e1732,null))[_0x09fc('0x4b')](handleError(_0x2e1732,null));};exports['destroy']=function(_0x3e59a1,_0x45e6e2){return db[_0x09fc('0x44')][_0x09fc('0x53')]({'where':{'id':_0x3e59a1[_0x09fc('0x4a')]['id']}})[_0x09fc('0x29')](handleEntityNotFound(_0x45e6e2,null))[_0x09fc('0x29')](removeEntity(_0x45e6e2,null))[_0x09fc('0x4b')](handleError(_0x45e6e2,null));};exports[_0x09fc('0x56')]=function(_0x3b16bb,_0x2261fa,_0x4ac7be){return db[_0x09fc('0x44')][_0x09fc('0x53')]({'where':{'id':_0x3b16bb[_0x09fc('0x4a')]['id']},'attributes':[_0x09fc('0x2e'),_0x09fc('0x57'),_0x09fc('0x58'),_0x09fc('0x59')],'raw':!![]})[_0x09fc('0x29')](handleEntityNotFound(_0x2261fa,null))['then'](function(_0x1c0e00){if(_0x1c0e00){if(!fs[_0x09fc('0x5a')](path[_0x09fc('0x5b')](config[_0x09fc('0x5c')],_0x09fc('0x5d'),_0x1c0e00[_0x09fc('0x58')]))){throw new db[(_0x09fc('0x5e'))][(_0x09fc('0x5f'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3b16bb[_0x09fc('0x36')][_0x09fc('0x60')]){return _0x2261fa['sendStatus'](0xc8);}return _0x2261fa[_0x09fc('0x56')](path[_0x09fc('0x5b')](config[_0x09fc('0x5c')],'server/files/reports',_0x1c0e00[_0x09fc('0x58')]),util[_0x09fc('0x61')]('%s.%s',_0x1c0e00[_0x09fc('0x57')]||_0x1c0e00[_0x09fc('0x2e')],_0x1c0e00[_0x09fc('0x59')]['toLowerCase']()));}})[_0x09fc('0x4b')](handleError(_0x2261fa,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 7d9e1b3..6d67606 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 _0x3d09=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticExtractedReport','../../config/logger'];(function(_0x3a0390,_0x1ef29b){var _0x2e8eb0=function(_0x2793ef){while(--_0x2793ef){_0x3a0390['push'](_0x3a0390['shift']());}};_0x2e8eb0(++_0x1ef29b);}(_0x3d09,0x1e9));var _0x93d0=function(_0x5ce019,_0x382d56){_0x5ce019=_0x5ce019-0x0;var _0x3babd2=_0x3d09[_0x5ce019];return _0x3babd2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x93d0('0x0'))(_0x93d0('0x1'));var moment=require(_0x93d0('0x2'));var BPromise=require(_0x93d0('0x3'));var rp=require(_0x93d0('0x4'));var fs=require('fs');var path=require(_0x93d0('0x5'));var rimraf=require(_0x93d0('0x6'));var config=require(_0x93d0('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x93d0('0x8')]=function(_0x3c972e,_0x7bc9f5){return _0x3c972e['define'](_0x93d0('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd621=['request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird'];(function(_0x29c505,_0x5a2da4){var _0xee9319=function(_0x38d92a){while(--_0x38d92a){_0x29c505['push'](_0x29c505['shift']());}};_0xee9319(++_0x5a2da4);}(_0xd621,0x1db));var _0x1d62=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0xd621[_0x97db75];return _0x259a53;};'use strict';var _=require('lodash');var util=require(_0x1d62('0x0'));var logger=require(_0x1d62('0x1'))(_0x1d62('0x2'));var moment=require(_0x1d62('0x3'));var BPromise=require(_0x1d62('0x4'));var rp=require(_0x1d62('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d62('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d62('0x7'));module[_0x1d62('0x8')]=function(_0xb10afd,_0x253bce){return _0xb10afd[_0x1d62('0x9')](_0x1d62('0xa'),attributes,{'tableName':_0x1d62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 1b795d5..0e8bb89 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 _0xff0c=['request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0xff0c,0x142));var _0xcff0=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0xff0c[_0x4a4922];return _0x55a8c6;};'use strict';var _=require(_0xcff0('0x0'));var util=require('util');var moment=require(_0xcff0('0x1'));var BPromise=require('bluebird');var rs=require(_0xcff0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcff0('0x3'))['db'];var utils=require(_0xcff0('0x4'));var logger=require(_0xcff0('0x5'))(_0xcff0('0x6'));var config=require(_0xcff0('0x7'));var jayson=require(_0xcff0('0x8'));var client=jayson[_0xcff0('0x9')][_0xcff0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x398cec,_0x44ae5c,_0x188f8f){return new BPromise(function(_0x1582a4,_0x4fac87){return client[_0xcff0('0xb')](_0x398cec,_0x188f8f)['then'](function(_0x1eadb6){logger[_0xcff0('0xc')](_0xcff0('0xd'),_0x44ae5c,_0xcff0('0xe'));logger['debug'](_0xcff0('0xf'),_0x44ae5c,'request\x20sent',JSON[_0xcff0('0x10')](_0x1eadb6));if(_0x1eadb6[_0xcff0('0x11')]){if(_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x12')]===0x1f4){logger[_0xcff0('0x11')](_0xcff0('0xd'),_0x44ae5c,_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x13')]);return _0x4fac87(_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x13')]);}logger[_0xcff0('0x11')](_0xcff0('0xd'),_0x44ae5c,_0x1eadb6['error'][_0xcff0('0x13')]);return _0x1582a4(_0x1eadb6[_0xcff0('0x11')][_0xcff0('0x13')]);}else{logger[_0xcff0('0xc')](_0xcff0('0xd'),_0x44ae5c,_0xcff0('0xe'));_0x1582a4(_0x1eadb6[_0xcff0('0x14')][_0xcff0('0x13')]);}})['catch'](function(_0x1ab301){logger['error'](_0xcff0('0xd'),_0x44ae5c,_0x1ab301);_0x4fac87(_0x1ab301);});});}
\ No newline at end of file
+var _0xac02=['request\x20sent','stringify','error','code','message','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0xe0cd41,_0x24fb9b){var _0x1ac3c3=function(_0x29713d){while(--_0x29713d){_0xe0cd41['push'](_0xe0cd41['shift']());}};_0x1ac3c3(++_0x24fb9b);}(_0xac02,0xc3));var _0x2ac0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xac02[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x2ac0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ac0('0x1'));var db=require(_0x2ac0('0x2'))['db'];var utils=require(_0x2ac0('0x3'));var logger=require(_0x2ac0('0x4'))(_0x2ac0('0x5'));var config=require(_0x2ac0('0x6'));var jayson=require(_0x2ac0('0x7'));var client=jayson[_0x2ac0('0x8')][_0x2ac0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ceb94,_0x3d4e33,_0x399cb8){return new BPromise(function(_0x5c7bc3,_0x4e9741){return client[_0x2ac0('0xa')](_0x5ceb94,_0x399cb8)[_0x2ac0('0xb')](function(_0x17fe32){logger[_0x2ac0('0xc')](_0x2ac0('0xd'),_0x3d4e33,'request\x20sent');logger['debug'](_0x2ac0('0xe'),_0x3d4e33,_0x2ac0('0xf'),JSON[_0x2ac0('0x10')](_0x17fe32));if(_0x17fe32[_0x2ac0('0x11')]){if(_0x17fe32['error'][_0x2ac0('0x12')]===0x1f4){logger[_0x2ac0('0x11')](_0x2ac0('0xd'),_0x3d4e33,_0x17fe32['error']['message']);return _0x4e9741(_0x17fe32['error'][_0x2ac0('0x13')]);}logger['error'](_0x2ac0('0xd'),_0x3d4e33,_0x17fe32[_0x2ac0('0x11')]['message']);return _0x5c7bc3(_0x17fe32['error'][_0x2ac0('0x13')]);}else{logger[_0x2ac0('0xc')](_0x2ac0('0xd'),_0x3d4e33,_0x2ac0('0xf'));_0x5c7bc3(_0x17fe32['result'][_0x2ac0('0x13')]);}})[_0x2ac0('0x14')](function(_0x5f32a9){logger[_0x2ac0('0x11')](_0x2ac0('0xd'),_0x3d4e33,_0x5f32a9);_0x4e9741(_0x5f32a9);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 69ceffb..35552ac 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 _0x14cf=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1a365c,_0x4adc59){var _0x30c5ec=function(_0x261c8d){while(--_0x261c8d){_0x1a365c['push'](_0x1a365c['shift']());}};_0x30c5ec(++_0x4adc59);}(_0x14cf,0x19e));var _0xf14c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x14cf[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xf14c('0x0'));var util=require(_0xf14c('0x1'));var path=require(_0xf14c('0x2'));var timeout=require(_0xf14c('0x3'));var express=require(_0xf14c('0x4'));var router=express[_0xf14c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf14c('0x6'));var interaction=require(_0xf14c('0x7'));var config=require(_0xf14c('0x8'));var controller=require(_0xf14c('0x9'));router[_0xf14c('0xa')]('/',auth[_0xf14c('0xb')](),controller[_0xf14c('0xc')]);router[_0xf14c('0xa')](_0xf14c('0xd'),auth[_0xf14c('0xb')](),controller[_0xf14c('0xe')]);router[_0xf14c('0xa')](_0xf14c('0xf'),auth[_0xf14c('0xb')](),controller[_0xf14c('0x10')]);router[_0xf14c('0x11')]('/',auth['isAuthenticated'](),controller[_0xf14c('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf14c('0x13')]);router[_0xf14c('0x14')]('/:id',auth[_0xf14c('0xb')](),controller['destroy']);module[_0xf14c('0x15')]=router;
\ No newline at end of file
+var _0x89ef=['../../config/environment','isAuthenticated','get','/:id','show','/:id/download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xd5cad8,_0x7ed253){var _0x546feb=function(_0x476e52){while(--_0x476e52){_0xd5cad8['push'](_0xd5cad8['shift']());}};_0x546feb(++_0x7ed253);}(_0x89ef,0x188));var _0xf89e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x89ef[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xf89e('0x0'));var util=require(_0xf89e('0x1'));var path=require(_0xf89e('0x2'));var timeout=require(_0xf89e('0x3'));var express=require(_0xf89e('0x4'));var router=express[_0xf89e('0x5')]();var fs_extra=require(_0xf89e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf89e('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xf89e('0x8')](),controller['index']);router[_0xf89e('0x9')](_0xf89e('0xa'),auth['isAuthenticated'](),controller[_0xf89e('0xb')]);router[_0xf89e('0x9')](_0xf89e('0xc'),auth[_0xf89e('0x8')](),controller['download']);router[_0xf89e('0xd')]('/',auth[_0xf89e('0x8')](),controller[_0xf89e('0xe')]);router['put'](_0xf89e('0xa'),auth[_0xf89e('0x8')](),controller[_0xf89e('0xf')]);router[_0xf89e('0x10')](_0xf89e('0xa'),auth[_0xf89e('0x8')](),controller[_0xf89e('0x11')]);module[_0xf89e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index f6106a2..8dfe2e7 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 _0x8d5d=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0xa4b8e1,_0x49d30b){var _0x507e42=function(_0xca2abc){while(--_0xca2abc){_0xa4b8e1['push'](_0xa4b8e1['shift']());}};_0x507e42(++_0x49d30b);}(_0x8d5d,0xdf));var _0xd8d5=function(_0x18d08b,_0x59e33d){_0x18d08b=_0x18d08b-0x0;var _0x29e500=_0x8d5d[_0x18d08b];return _0x29e500;};'use strict';var Sequelize=require(_0xd8d5('0x0'));module[_0xd8d5('0x1')]={'field':{'type':Sequelize[_0xd8d5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xd8d5('0x3')]},'format':{'type':Sequelize[_0xd8d5('0x3')]},'groupBy':{'type':Sequelize[_0xd8d5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd8d5('0x3')]},'custom':{'type':Sequelize[_0xd8d5('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe365=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1301a7,_0x3d0baa){var _0x1b5f19=function(_0x20d3cc){while(--_0x20d3cc){_0x1301a7['push'](_0x1301a7['shift']());}};_0x1b5f19(++_0x3d0baa);}(_0xe365,0xdc));var _0x5e36=function(_0x3fb391,_0x539bd5){_0x3fb391=_0x3fb391-0x0;var _0x3dd627=_0xe365[_0x3fb391];return _0x3dd627;};'use strict';var Sequelize=require(_0x5e36('0x0'));module[_0x5e36('0x1')]={'field':{'type':Sequelize[_0x5e36('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x5e36('0x3')]},'format':{'type':Sequelize[_0x5e36('0x3')]},'groupBy':{'type':Sequelize[_0x5e36('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5e36('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index df094c0..7df5d25 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 _0x13ce=['order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','keys','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','AnalyticFieldReport','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x13ce,0x6b));var _0xe13c=function(_0x16a3f9,_0x251ad4){_0x16a3f9=_0x16a3f9-0x0;var _0x231886=_0x13ce[_0x16a3f9];return _0x231886;};'use strict';var emlformat=require(_0xe13c('0x0'));var rimraf=require(_0xe13c('0x1'));var zipdir=require(_0xe13c('0x2'));var jsonpatch=require(_0xe13c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe13c('0x4'));var Mustache=require('mustache');var util=require(_0xe13c('0x5'));var path=require(_0xe13c('0x6'));var sox=require(_0xe13c('0x7'));var csv=require('to-csv');var ejs=require(_0xe13c('0x8'));var fs=require('fs');var fs_extra=require(_0xe13c('0x9'));var _=require('lodash');var squel=require(_0xe13c('0xa'));var crypto=require(_0xe13c('0xb'));var jsforce=require(_0xe13c('0xc'));var deskjs=require(_0xe13c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe13c('0xe'));var Papa=require(_0xe13c('0xf'));var Redis=require('ioredis');var authService=require(_0xe13c('0x10'));var qs=require(_0xe13c('0x11'));var as=require(_0xe13c('0x12'));var hardwareService=require(_0xe13c('0x13'));var logger=require(_0xe13c('0x14'))(_0xe13c('0x15'));var utils=require(_0xe13c('0x16'));var config=require(_0xe13c('0x17'));var licenseUtil=require(_0xe13c('0x18'));var db=require(_0xe13c('0x19'))['db'];function respondWithStatusCode(_0x21e7e1,_0x78325){_0x78325=_0x78325||0xcc;return function(_0x53c8c1){if(_0x53c8c1){return _0x21e7e1[_0xe13c('0x1a')](_0x78325);}return _0x21e7e1['status'](_0x78325)[_0xe13c('0x1b')]();};}function respondWithResult(_0x30309d,_0x13bb07){_0x13bb07=_0x13bb07||0xc8;return function(_0x742a12){if(_0x742a12){return _0x30309d[_0xe13c('0x1c')](_0x13bb07)[_0xe13c('0x1d')](_0x742a12);}};}function respondWithFilteredResult(_0x41e454,_0x594649){return function(_0x31cfaa){if(_0x31cfaa){var _0x5e0c00=typeof _0x594649[_0xe13c('0x1e')]===_0xe13c('0x1f')&&typeof _0x594649[_0xe13c('0x20')]===_0xe13c('0x1f');var _0x54ab9a=_0x31cfaa[_0xe13c('0x21')];var _0x243f5f=_0x5e0c00?0x0:_0x594649[_0xe13c('0x1e')];var _0x4d3105=_0x5e0c00?_0x31cfaa[_0xe13c('0x21')]:_0x594649[_0xe13c('0x1e')]+_0x594649['limit'];var _0x5f05a5;if(_0x4d3105>=_0x54ab9a){_0x4d3105=_0x54ab9a;_0x5f05a5=0xc8;}else{_0x5f05a5=0xce;}_0x41e454[_0xe13c('0x1c')](_0x5f05a5);return _0x41e454[_0xe13c('0x22')](_0xe13c('0x23'),_0x243f5f+'-'+_0x4d3105+'/'+_0x54ab9a)[_0xe13c('0x1d')](_0x31cfaa);}return null;};}function patchUpdates(_0x15b94c){return function(_0x590775){try{jsonpatch[_0xe13c('0x24')](_0x590775,_0x15b94c,!![]);}catch(_0xd66b66){return BPromise[_0xe13c('0x25')](_0xd66b66);}return _0x590775[_0xe13c('0x26')]();};}function saveUpdates(_0x29eff5,_0x942f6c){return function(_0x28a2f0){if(_0x28a2f0){return _0x28a2f0[_0xe13c('0x27')](_0x29eff5)[_0xe13c('0x28')](function(_0x528b35){return _0x528b35;});}return null;};}function removeEntity(_0x4c9bbf,_0x195c16){return function(_0x145c5){if(_0x145c5){return _0x145c5[_0xe13c('0x29')]()['then'](function(){_0x4c9bbf['status'](0xcc)[_0xe13c('0x1b')]();});}};}function handleEntityNotFound(_0x4de4c4,_0x1e6673){return function(_0x4180){if(!_0x4180){_0x4de4c4[_0xe13c('0x1a')](0x194);}return _0x4180;};}function handleError(_0x5dba7f,_0x2b4a55){_0x2b4a55=_0x2b4a55||0x1f4;return function(_0x5d3b77){logger['error'](_0x5d3b77['stack']);if(_0x5d3b77['name']){delete _0x5d3b77[_0xe13c('0x2a')];}_0x5dba7f[_0xe13c('0x1c')](_0x2b4a55)[_0xe13c('0x2b')](_0x5d3b77);};}exports[_0xe13c('0x2c')]=function(_0x36bb10,_0x3ec82f){var _0x3be6ca={},_0x3f1065={},_0x26ff54={'count':0x0,'rows':[]};var _0x1f94cd=_[_0xe13c('0x2d')](db[_0xe13c('0x2e')]['rawAttributes'],function(_0x7c5bf0){return{'name':_0x7c5bf0[_0xe13c('0x2f')],'type':_0x7c5bf0[_0xe13c('0x30')]['key']};});_0x3f1065[_0xe13c('0x31')]=_['map'](_0x1f94cd,_0xe13c('0x2a'));_0x3f1065[_0xe13c('0x32')]=_['keys'](_0x36bb10[_0xe13c('0x32')]);_0x3f1065[_0xe13c('0x33')]=_[_0xe13c('0x34')](_0x3f1065[_0xe13c('0x31')],_0x3f1065[_0xe13c('0x32')]);_0x3be6ca['attributes']=_['intersection'](_0x3f1065[_0xe13c('0x31')],qs['fields'](_0x36bb10['query'][_0xe13c('0x35')]));_0x3be6ca[_0xe13c('0x36')]=_0x3be6ca[_0xe13c('0x36')][_0xe13c('0x37')]?_0x3be6ca[_0xe13c('0x36')]:_0x3f1065['model'];if(!_0x36bb10[_0xe13c('0x32')]['hasOwnProperty'](_0xe13c('0x38'))){_0x3be6ca[_0xe13c('0x20')]=qs['limit'](_0x36bb10['query'][_0xe13c('0x20')]);_0x3be6ca[_0xe13c('0x1e')]=qs['offset'](_0x36bb10['query'][_0xe13c('0x1e')]);}_0x3be6ca[_0xe13c('0x39')]=qs[_0xe13c('0x3a')](_0x36bb10['query'][_0xe13c('0x3a')]);_0x3be6ca['where']=qs[_0xe13c('0x33')](_[_0xe13c('0x3b')](_0x36bb10['query'],_0x3f1065['filters']),_0x1f94cd);if(_0x36bb10[_0xe13c('0x32')]['filter']){_0x3be6ca[_0xe13c('0x3c')]=_[_0xe13c('0x3d')](_0x3be6ca[_0xe13c('0x3c')],{'$or':_['map'](_0x1f94cd,function(_0x5d7663){if(_0x5d7663[_0xe13c('0x30')]!==_0xe13c('0x3e')){var _0x43aef1={};_0x43aef1[_0x5d7663[_0xe13c('0x2a')]]={'$like':'%'+_0x36bb10['query'][_0xe13c('0x3f')]+'%'};return _0x43aef1;}})});}_0x3be6ca=_[_0xe13c('0x3d')]({},_0x3be6ca,_0x36bb10[_0xe13c('0x40')]);var _0x1827fb={'where':_0x3be6ca[_0xe13c('0x3c')]};return db['AnalyticFieldReport'][_0xe13c('0x21')](_0x1827fb)[_0xe13c('0x28')](function(_0x3beada){_0x26ff54[_0xe13c('0x21')]=_0x3beada;if(_0x36bb10[_0xe13c('0x32')][_0xe13c('0x41')]){_0x3be6ca[_0xe13c('0x42')]=[{'all':!![]}];}return db[_0xe13c('0x2e')]['findAll'](_0x3be6ca);})[_0xe13c('0x28')](function(_0x56e52e){_0x26ff54[_0xe13c('0x43')]=_0x56e52e;return _0x26ff54;})[_0xe13c('0x28')](respondWithFilteredResult(_0x3ec82f,_0x3be6ca))[_0xe13c('0x44')](handleError(_0x3ec82f,null));};exports['show']=function(_0x29ba52,_0x1f9209){var _0x152c8a={'raw':![],'where':{'id':_0x29ba52[_0xe13c('0x45')]['id']}},_0x40bc63={};_0x40bc63[_0xe13c('0x31')]=_[_0xe13c('0x46')](db['AnalyticFieldReport']['rawAttributes']);_0x40bc63[_0xe13c('0x32')]=_['keys'](_0x29ba52[_0xe13c('0x32')]);_0x40bc63['filters']=_['intersection'](_0x40bc63[_0xe13c('0x31')],_0x40bc63[_0xe13c('0x32')]);_0x152c8a[_0xe13c('0x36')]=_[_0xe13c('0x34')](_0x40bc63[_0xe13c('0x31')],qs['fields'](_0x29ba52[_0xe13c('0x32')][_0xe13c('0x35')]));_0x152c8a[_0xe13c('0x36')]=_0x152c8a[_0xe13c('0x36')][_0xe13c('0x37')]?_0x152c8a['attributes']:_0x40bc63[_0xe13c('0x31')];if(_0x29ba52[_0xe13c('0x32')][_0xe13c('0x41')]){_0x152c8a[_0xe13c('0x42')]=[{'all':!![]}];}_0x152c8a=_[_0xe13c('0x3d')]({},_0x152c8a,_0x29ba52[_0xe13c('0x40')]);return db[_0xe13c('0x2e')][_0xe13c('0x47')](_0x152c8a)[_0xe13c('0x28')](handleEntityNotFound(_0x1f9209,null))[_0xe13c('0x28')](respondWithResult(_0x1f9209,null))['catch'](handleError(_0x1f9209,null));};exports['create']=function(_0x16cd6e,_0x3866d0){return db[_0xe13c('0x2e')][_0xe13c('0x48')](_0x16cd6e[_0xe13c('0x49')],{})['then'](respondWithResult(_0x3866d0,0xc9))[_0xe13c('0x44')](handleError(_0x3866d0,null));};exports[_0xe13c('0x4a')]=function(_0x8785fe,_0x3b6f1b){return db['AnalyticFieldReport'][_0xe13c('0x4a')](_0x8785fe[_0xe13c('0x49')],{'raw':![],'individualHooks':!![]})[_0xe13c('0x28')](respondWithResult(_0x3b6f1b,0xc9))[_0xe13c('0x44')](handleError(_0x3b6f1b,null));};exports[_0xe13c('0x27')]=function(_0x374e2c,_0x447604){if(_0x374e2c['body']['id']){delete _0x374e2c[_0xe13c('0x49')]['id'];}return db[_0xe13c('0x2e')][_0xe13c('0x47')]({'where':{'id':_0x374e2c[_0xe13c('0x45')]['id']}})[_0xe13c('0x28')](handleEntityNotFound(_0x447604,null))[_0xe13c('0x28')](saveUpdates(_0x374e2c[_0xe13c('0x49')],null))[_0xe13c('0x28')](respondWithResult(_0x447604,null))['catch'](handleError(_0x447604,null));};exports[_0xe13c('0x29')]=function(_0x2c4333,_0xcfe4be){return db['AnalyticFieldReport'][_0xe13c('0x47')]({'where':{'id':_0x2c4333[_0xe13c('0x45')]['id']}})[_0xe13c('0x28')](handleEntityNotFound(_0xcfe4be,null))[_0xe13c('0x28')](removeEntity(_0xcfe4be,null))[_0xe13c('0x44')](handleError(_0xcfe4be,null));};exports[_0xe13c('0x4b')]=function(_0x217412,_0x3b3a5b){return db[_0xe13c('0x2e')][_0xe13c('0x29')]({'where':{'id':_0x217412['query'][_0xe13c('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xe13c('0x28')](respondWithResult(_0x3b3a5b,0xcc))['catch'](handleError(_0x3b3a5b,null));};exports[_0xe13c('0x4d')]=function(_0x12cde3,_0x5c3c28,_0x4a63ea){return db[_0xe13c('0x4e')]['findOne']({'where':{'id':_0x12cde3['params']['id']}})[_0xe13c('0x28')](handleEntityNotFound(_0x5c3c28,null))[_0xe13c('0x28')](function(_0x24c776){if(_0x24c776){return db[_0xe13c('0x4f')]['transaction'](function(_0x1f186a){return db['AnalyticFieldReport'][_0xe13c('0x29')]({'where':{'CustomReportId':_0x12cde3['params']['id']},'transaction':_0x1f186a})[_0xe13c('0x28')](function(_0x1dca77){var _0x1f6190=_[_0xe13c('0x2d')](_0x12cde3['body'],function(_0x1295eb){delete _0x1295eb['id'];_0x1295eb[_0xe13c('0x50')]=_0x12cde3[_0xe13c('0x45')]['id'];return _0x1295eb;});return db[_0xe13c('0x2e')]['bulkCreate'](_0x1f6190,{'transaction':_0x1f186a});});})['then'](function(){return db[_0xe13c('0x2e')][_0xe13c('0x51')]({'where':{'CustomReportId':_0x12cde3[_0xe13c('0x45')]['id']}});});}})[_0xe13c('0x28')](respondWithResult(_0x5c3c28,null))[_0xe13c('0x44')](handleError(_0x5c3c28,null));};
\ No newline at end of file
+var _0x3901=['addFields','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','catch','include','options','find','create','body','bulkCreate','params','destroy','bulkDestroy','ids'];(function(_0x4bea2a,_0x1638c5){var _0x152ad2=function(_0x25c627){while(--_0x25c627){_0x4bea2a['push'](_0x4bea2a['shift']());}};_0x152ad2(++_0x1638c5);}(_0x3901,0x181));var _0x1390=function(_0xf7fe97,_0x432968){_0xf7fe97=_0xf7fe97-0x0;var _0x55b1a5=_0x3901[_0xf7fe97];return _0x55b1a5;};'use strict';var emlformat=require(_0x1390('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1390('0x1'));var jsonpatch=require(_0x1390('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1390('0x3'));var Mustache=require(_0x1390('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1390('0x5'));var csv=require(_0x1390('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1390('0x7'));var squel=require(_0x1390('0x8'));var crypto=require(_0x1390('0x9'));var jsforce=require(_0x1390('0xa'));var deskjs=require(_0x1390('0xb'));var toCsv=require(_0x1390('0x6'));var querystring=require(_0x1390('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1390('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1390('0xe'));var hardwareService=require(_0x1390('0xf'));var logger=require('../../config/logger')(_0x1390('0x10'));var utils=require(_0x1390('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1390('0x12'));var db=require(_0x1390('0x13'))['db'];function respondWithStatusCode(_0x1fcc1c,_0x35d00d){_0x35d00d=_0x35d00d||0xcc;return function(_0x2dde8a){if(_0x2dde8a){return _0x1fcc1c['sendStatus'](_0x35d00d);}return _0x1fcc1c[_0x1390('0x14')](_0x35d00d)[_0x1390('0x15')]();};}function respondWithResult(_0x566512,_0x186f57){_0x186f57=_0x186f57||0xc8;return function(_0x1748e3){if(_0x1748e3){return _0x566512[_0x1390('0x14')](_0x186f57)[_0x1390('0x16')](_0x1748e3);}};}function respondWithFilteredResult(_0x219553,_0x194c6d){return function(_0x2543ad){if(_0x2543ad){var _0xe6df2b=typeof _0x194c6d[_0x1390('0x17')]===_0x1390('0x18')&&typeof _0x194c6d[_0x1390('0x19')]===_0x1390('0x18');var _0x252a62=_0x2543ad['count'];var _0x19612e=_0xe6df2b?0x0:_0x194c6d[_0x1390('0x17')];var _0x361b19=_0xe6df2b?_0x2543ad[_0x1390('0x1a')]:_0x194c6d[_0x1390('0x17')]+_0x194c6d['limit'];var _0x4b0078;if(_0x361b19>=_0x252a62){_0x361b19=_0x252a62;_0x4b0078=0xc8;}else{_0x4b0078=0xce;}_0x219553[_0x1390('0x14')](_0x4b0078);return _0x219553['set'](_0x1390('0x1b'),_0x19612e+'-'+_0x361b19+'/'+_0x252a62)[_0x1390('0x16')](_0x2543ad);}return null;};}function patchUpdates(_0x491834){return function(_0x34f5e3){try{jsonpatch[_0x1390('0x1c')](_0x34f5e3,_0x491834,!![]);}catch(_0x5d6b41){return BPromise['reject'](_0x5d6b41);}return _0x34f5e3[_0x1390('0x1d')]();};}function saveUpdates(_0x1b3605,_0x392fb1){return function(_0x2c48cd){if(_0x2c48cd){return _0x2c48cd[_0x1390('0x1e')](_0x1b3605)[_0x1390('0x1f')](function(_0x5f4e4d){return _0x5f4e4d;});}return null;};}function removeEntity(_0x44f8c8,_0x52d794){return function(_0xe647fb){if(_0xe647fb){return _0xe647fb['destroy']()['then'](function(){_0x44f8c8['status'](0xcc)[_0x1390('0x15')]();});}};}function handleEntityNotFound(_0x1d9cff,_0x4e1498){return function(_0x1d26ae){if(!_0x1d26ae){_0x1d9cff['sendStatus'](0x194);}return _0x1d26ae;};}function handleError(_0x3b78cd,_0x7b1146){_0x7b1146=_0x7b1146||0x1f4;return function(_0x1d1a92){logger['error'](_0x1d1a92[_0x1390('0x20')]);if(_0x1d1a92['name']){delete _0x1d1a92[_0x1390('0x21')];}_0x3b78cd[_0x1390('0x14')](_0x7b1146)['send'](_0x1d1a92);};}exports[_0x1390('0x22')]=function(_0x54bc45,_0x488272){var _0x318a39={},_0x4c87de={},_0x1a2701={'count':0x0,'rows':[]};var _0x2b70d2=_['map'](db[_0x1390('0x23')][_0x1390('0x24')],function(_0x512be0){return{'name':_0x512be0[_0x1390('0x25')],'type':_0x512be0['type'][_0x1390('0x26')]};});_0x4c87de['model']=_[_0x1390('0x27')](_0x2b70d2,_0x1390('0x21'));_0x4c87de['query']=_[_0x1390('0x28')](_0x54bc45[_0x1390('0x29')]);_0x4c87de[_0x1390('0x2a')]=_[_0x1390('0x2b')](_0x4c87de[_0x1390('0x2c')],_0x4c87de[_0x1390('0x29')]);_0x318a39[_0x1390('0x2d')]=_[_0x1390('0x2b')](_0x4c87de[_0x1390('0x2c')],qs[_0x1390('0x2e')](_0x54bc45[_0x1390('0x29')][_0x1390('0x2e')]));_0x318a39[_0x1390('0x2d')]=_0x318a39[_0x1390('0x2d')][_0x1390('0x2f')]?_0x318a39[_0x1390('0x2d')]:_0x4c87de[_0x1390('0x2c')];if(!_0x54bc45['query'][_0x1390('0x30')](_0x1390('0x31'))){_0x318a39[_0x1390('0x19')]=qs['limit'](_0x54bc45['query'][_0x1390('0x19')]);_0x318a39[_0x1390('0x17')]=qs['offset'](_0x54bc45[_0x1390('0x29')][_0x1390('0x17')]);}_0x318a39[_0x1390('0x32')]=qs[_0x1390('0x33')](_0x54bc45[_0x1390('0x29')][_0x1390('0x33')]);_0x318a39[_0x1390('0x34')]=qs['filters'](_[_0x1390('0x35')](_0x54bc45[_0x1390('0x29')],_0x4c87de[_0x1390('0x2a')]),_0x2b70d2);if(_0x54bc45['query'][_0x1390('0x36')]){_0x318a39[_0x1390('0x34')]=_[_0x1390('0x37')](_0x318a39[_0x1390('0x34')],{'$or':_[_0x1390('0x27')](_0x2b70d2,function(_0x381681){if(_0x381681[_0x1390('0x38')]!==_0x1390('0x39')){var _0x23f501={};_0x23f501[_0x381681[_0x1390('0x21')]]={'$like':'%'+_0x54bc45[_0x1390('0x29')]['filter']+'%'};return _0x23f501;}})});}_0x318a39=_[_0x1390('0x37')]({},_0x318a39,_0x54bc45['options']);var _0x1e4dfe={'where':_0x318a39[_0x1390('0x34')]};return db[_0x1390('0x23')]['count'](_0x1e4dfe)[_0x1390('0x1f')](function(_0x233bca){_0x1a2701['count']=_0x233bca;if(_0x54bc45[_0x1390('0x29')][_0x1390('0x3a')]){_0x318a39['include']=[{'all':!![]}];}return db[_0x1390('0x23')][_0x1390('0x3b')](_0x318a39);})['then'](function(_0x1d6cba){_0x1a2701['rows']=_0x1d6cba;return _0x1a2701;})['then'](respondWithFilteredResult(_0x488272,_0x318a39))[_0x1390('0x3c')](handleError(_0x488272,null));};exports['show']=function(_0x228a24,_0x471d6d){var _0x76b548={'raw':![],'where':{'id':_0x228a24['params']['id']}},_0xbb0e65={};_0xbb0e65[_0x1390('0x2c')]=_[_0x1390('0x28')](db[_0x1390('0x23')][_0x1390('0x24')]);_0xbb0e65[_0x1390('0x29')]=_[_0x1390('0x28')](_0x228a24[_0x1390('0x29')]);_0xbb0e65[_0x1390('0x2a')]=_[_0x1390('0x2b')](_0xbb0e65[_0x1390('0x2c')],_0xbb0e65[_0x1390('0x29')]);_0x76b548['attributes']=_[_0x1390('0x2b')](_0xbb0e65[_0x1390('0x2c')],qs[_0x1390('0x2e')](_0x228a24[_0x1390('0x29')][_0x1390('0x2e')]));_0x76b548[_0x1390('0x2d')]=_0x76b548[_0x1390('0x2d')][_0x1390('0x2f')]?_0x76b548[_0x1390('0x2d')]:_0xbb0e65[_0x1390('0x2c')];if(_0x228a24[_0x1390('0x29')][_0x1390('0x3a')]){_0x76b548[_0x1390('0x3d')]=[{'all':!![]}];}_0x76b548=_[_0x1390('0x37')]({},_0x76b548,_0x228a24[_0x1390('0x3e')]);return db[_0x1390('0x23')][_0x1390('0x3f')](_0x76b548)['then'](handleEntityNotFound(_0x471d6d,null))[_0x1390('0x1f')](respondWithResult(_0x471d6d,null))[_0x1390('0x3c')](handleError(_0x471d6d,null));};exports[_0x1390('0x40')]=function(_0x38512e,_0x3b3621){return db[_0x1390('0x23')][_0x1390('0x40')](_0x38512e[_0x1390('0x41')],{})[_0x1390('0x1f')](respondWithResult(_0x3b3621,0xc9))[_0x1390('0x3c')](handleError(_0x3b3621,null));};exports['bulkCreate']=function(_0x99b21d,_0x56906f){return db[_0x1390('0x23')][_0x1390('0x42')](_0x99b21d[_0x1390('0x41')],{'raw':![],'individualHooks':!![]})[_0x1390('0x1f')](respondWithResult(_0x56906f,0xc9))[_0x1390('0x3c')](handleError(_0x56906f,null));};exports[_0x1390('0x1e')]=function(_0x1d350a,_0x58f6e8){if(_0x1d350a[_0x1390('0x41')]['id']){delete _0x1d350a['body']['id'];}return db['AnalyticFieldReport'][_0x1390('0x3f')]({'where':{'id':_0x1d350a[_0x1390('0x43')]['id']}})['then'](handleEntityNotFound(_0x58f6e8,null))[_0x1390('0x1f')](saveUpdates(_0x1d350a[_0x1390('0x41')],null))[_0x1390('0x1f')](respondWithResult(_0x58f6e8,null))['catch'](handleError(_0x58f6e8,null));};exports[_0x1390('0x44')]=function(_0x24181c,_0x3ee11b){return db[_0x1390('0x23')]['find']({'where':{'id':_0x24181c[_0x1390('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ee11b,null))['then'](removeEntity(_0x3ee11b,null))['catch'](handleError(_0x3ee11b,null));};exports[_0x1390('0x45')]=function(_0x4ff322,_0x18e707){return db[_0x1390('0x23')][_0x1390('0x44')]({'where':{'id':_0x4ff322[_0x1390('0x29')][_0x1390('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x1390('0x1f')](respondWithResult(_0x18e707,0xcc))['catch'](handleError(_0x18e707,null));};exports[_0x1390('0x47')]=function(_0x257d8e,_0x19c985,_0xe512e4){return db['AnalyticCustomReport'][_0x1390('0x48')]({'where':{'id':_0x257d8e['params']['id']}})[_0x1390('0x1f')](handleEntityNotFound(_0x19c985,null))[_0x1390('0x1f')](function(_0x290b95){if(_0x290b95){return db[_0x1390('0x49')][_0x1390('0x4a')](function(_0x389b2b){return db[_0x1390('0x23')][_0x1390('0x44')]({'where':{'CustomReportId':_0x257d8e[_0x1390('0x43')]['id']},'transaction':_0x389b2b})[_0x1390('0x1f')](function(_0xf9973f){var _0x3ff7a7=_['map'](_0x257d8e[_0x1390('0x41')],function(_0x5cb307){delete _0x5cb307['id'];_0x5cb307[_0x1390('0x4b')]=_0x257d8e[_0x1390('0x43')]['id'];return _0x5cb307;});return db['AnalyticFieldReport'][_0x1390('0x42')](_0x3ff7a7,{'transaction':_0x389b2b});});})[_0x1390('0x1f')](function(){return db['AnalyticFieldReport'][_0x1390('0x3b')]({'where':{'CustomReportId':_0x257d8e['params']['id']}});});}})[_0x1390('0x1f')](respondWithResult(_0x19c985,null))[_0x1390('0x3c')](handleError(_0x19c985,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 0cb5726..2fef210 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 _0x5cd9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0xb68b92,_0x17e742){var _0x2f9b23=function(_0x15c5ab){while(--_0x15c5ab){_0xb68b92['push'](_0xb68b92['shift']());}};_0x2f9b23(++_0x17e742);}(_0x5cd9,0x1d1));var _0x95cd=function(_0x45fabc,_0x2f0df7){_0x45fabc=_0x45fabc-0x0;var _0x3012ac=_0x5cd9[_0x45fabc];return _0x3012ac;};'use strict';var _=require(_0x95cd('0x0'));var util=require(_0x95cd('0x1'));var logger=require(_0x95cd('0x2'))(_0x95cd('0x3'));var moment=require(_0x95cd('0x4'));var BPromise=require(_0x95cd('0x5'));var rp=require(_0x95cd('0x6'));var fs=require('fs');var path=require(_0x95cd('0x7'));var rimraf=require(_0x95cd('0x8'));var config=require(_0x95cd('0x9'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x4f151a,_0x3d3558){return _0x4f151a[_0x95cd('0xa')](_0x95cd('0xb'),attributes,{'tableName':_0x95cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd164=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x3f320c,_0x541b60){var _0x1a49fb=function(_0x471c43){while(--_0x471c43){_0x3f320c['push'](_0x3f320c['shift']());}};_0x1a49fb(++_0x541b60);}(_0xd164,0x198));var _0x4d16=function(_0xbf2500,_0x51c9d6){_0xbf2500=_0xbf2500-0x0;var _0x128f48=_0xd164[_0xbf2500];return _0x128f48;};'use strict';var _=require(_0x4d16('0x0'));var util=require(_0x4d16('0x1'));var logger=require(_0x4d16('0x2'))(_0x4d16('0x3'));var moment=require(_0x4d16('0x4'));var BPromise=require(_0x4d16('0x5'));var rp=require(_0x4d16('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d16('0x7'));var config=require(_0x4d16('0x8'));var attributes=require(_0x4d16('0x9'));module[_0x4d16('0xa')]=function(_0x2fe4fe,_0x4ab6a7){return _0x2fe4fe[_0x4d16('0xb')](_0x4d16('0xc'),attributes,{'tableName':_0x4d16('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 7d0befe..142c3e9 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 _0xf9a2=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xf9a2,0xb6));var _0x2f9a=function(_0x540a76,_0x1a337b){_0x540a76=_0x540a76-0x0;var _0x5b9c4f=_0xf9a2[_0x540a76];return _0x5b9c4f;};'use strict';var _=require('lodash');var util=require(_0x2f9a('0x0'));var moment=require('moment');var BPromise=require(_0x2f9a('0x1'));var rs=require(_0x2f9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f9a('0x3'))['db'];var utils=require(_0x2f9a('0x4'));var logger=require(_0x2f9a('0x5'))(_0x2f9a('0x6'));var config=require(_0x2f9a('0x7'));var jayson=require(_0x2f9a('0x8'));var client=jayson[_0x2f9a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ff7c,_0x3061d9,_0x23fbb0){return new BPromise(function(_0x503f54,_0x21e2a7){return client[_0x2f9a('0xa')](_0x49ff7c,_0x23fbb0)[_0x2f9a('0xb')](function(_0x45e852){logger[_0x2f9a('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3061d9,_0x2f9a('0xd'));logger[_0x2f9a('0xe')](_0x2f9a('0xf'),_0x3061d9,_0x2f9a('0xd'),JSON[_0x2f9a('0x10')](_0x45e852));if(_0x45e852[_0x2f9a('0x11')]){if(_0x45e852[_0x2f9a('0x11')][_0x2f9a('0x12')]===0x1f4){logger[_0x2f9a('0x11')](_0x2f9a('0x13'),_0x3061d9,_0x45e852[_0x2f9a('0x11')][_0x2f9a('0x14')]);return _0x21e2a7(_0x45e852['error'][_0x2f9a('0x14')]);}logger[_0x2f9a('0x11')](_0x2f9a('0x13'),_0x3061d9,_0x45e852['error'][_0x2f9a('0x14')]);return _0x503f54(_0x45e852['error'][_0x2f9a('0x14')]);}else{logger[_0x2f9a('0xc')](_0x2f9a('0x13'),_0x3061d9,'request\x20sent');_0x503f54(_0x45e852[_0x2f9a('0x15')][_0x2f9a('0x14')]);}})[_0x2f9a('0x16')](function(_0x35eff9){logger[_0x2f9a('0x11')](_0x2f9a('0x13'),_0x3061d9,_0x35eff9);_0x21e2a7(_0x35eff9);});});}
\ No newline at end of file
+var _0x344f=['request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','client','http'];(function(_0x56a0bb,_0x55fd27){var _0x349f94=function(_0x597edf){while(--_0x597edf){_0x56a0bb['push'](_0x56a0bb['shift']());}};_0x349f94(++_0x55fd27);}(_0x344f,0x14d));var _0xf344=function(_0x552d37,_0x21b0c4){_0x552d37=_0x552d37-0x0;var _0x3a765c=_0x344f[_0x552d37];return _0x3a765c;};'use strict';var _=require(_0xf344('0x0'));var util=require(_0xf344('0x1'));var moment=require(_0xf344('0x2'));var BPromise=require('bluebird');var rs=require(_0xf344('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf344('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf344('0x5'));var config=require('../../config/environment');var jayson=require(_0xf344('0x6'));var client=jayson[_0xf344('0x7')][_0xf344('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x90d3d9,_0x948307,_0x3e6552){return new BPromise(function(_0x4bd9de,_0x30a56f){return client[_0xf344('0x9')](_0x90d3d9,_0x3e6552)['then'](function(_0x139b43){logger['info'](_0xf344('0xa'),_0x948307,_0xf344('0xb'));logger[_0xf344('0xc')](_0xf344('0xd'),_0x948307,'request\x20sent',JSON[_0xf344('0xe')](_0x139b43));if(_0x139b43[_0xf344('0xf')]){if(_0x139b43['error']['code']===0x1f4){logger[_0xf344('0xf')](_0xf344('0xa'),_0x948307,_0x139b43[_0xf344('0xf')]['message']);return _0x30a56f(_0x139b43[_0xf344('0xf')][_0xf344('0x10')]);}logger[_0xf344('0xf')](_0xf344('0xa'),_0x948307,_0x139b43['error']['message']);return _0x4bd9de(_0x139b43[_0xf344('0xf')]['message']);}else{logger['info'](_0xf344('0xa'),_0x948307,'request\x20sent');_0x4bd9de(_0x139b43[_0xf344('0x11')]['message']);}})['catch'](function(_0x240009){logger[_0xf344('0xf')](_0xf344('0xa'),_0x948307,_0x240009);_0x30a56f(_0x240009);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 7b0316a..4635329 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(_0x112cc0,_0x56b670){var _0x47696f=function(_0x3e25a4){while(--_0x3e25a4){_0x112cc0['push'](_0x112cc0['shift']());}};_0x47696f(++_0x56b670);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x5320c1,_0x1f41bd){var _0x451574=function(_0x4cf080){while(--_0x4cf080){_0x5320c1['push'](_0x5320c1['shift']());}};_0x451574(++_0x1f41bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 b191d64..11ec9fd 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 _0x21a3=['name','TEXT','sequelize','STRING'];(function(_0x47bb5a,_0x3121b0){var _0x3e0b51=function(_0x1ee25b){while(--_0x1ee25b){_0x47bb5a['push'](_0x47bb5a['shift']());}};_0x3e0b51(++_0x3121b0);}(_0x21a3,0x66));var _0x321a=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0x21a3[_0x574ce3];return _0x3447a0;};'use strict';var Sequelize=require(_0x321a('0x0'));module['exports']={'name':{'type':Sequelize[_0x321a('0x1')],'allowNull':![],'unique':_0x321a('0x2')},'table':{'type':Sequelize[_0x321a('0x1')]},'metric':{'type':Sequelize[_0x321a('0x3')]},'description':{'type':Sequelize[_0x321a('0x1')]}};
\ No newline at end of file
+var _0x49e9=['TEXT','sequelize','exports','name','STRING'];(function(_0x58b6c7,_0x3bf35e){var _0x5f50d0=function(_0x532e10){while(--_0x532e10){_0x58b6c7['push'](_0x58b6c7['shift']());}};_0x5f50d0(++_0x3bf35e);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x949e('0x0'));module[_0x949e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x949e('0x2')},'table':{'type':Sequelize[_0x949e('0x3')]},'metric':{'type':Sequelize[_0x949e('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ae26a68..abedff2 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 _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x323c59,_0x2fa7f5){var _0x4b2831=function(_0x11c3b3){while(--_0x11c3b3){_0x323c59['push'](_0x323c59['shift']());}};_0x4b2831(++_0x2fa7f5);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x133611,_0x11a138){_0x133611=_0x133611-0x0;var _0x5b2514=_0x9c5a[_0x133611];return _0x5b2514;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x5ecd2a,_0x81f935){var _0x5c2850=function(_0x15dfed){while(--_0x15dfed){_0x5ecd2a['push'](_0x5ecd2a['shift']());}};_0x5c2850(++_0x81f935);}(_0x00bb,0x1d8));var _0xb00b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x00bb[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index f2707ee..8f474f5 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 _0xc03e=['rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','api','bluebird','path'];(function(_0x5a5e42,_0x2208b5){var _0x4eac7e=function(_0x3be2ed){while(--_0x3be2ed){_0x5a5e42['push'](_0x5a5e42['shift']());}};_0x4eac7e(++_0x2208b5);}(_0xc03e,0x15a));var _0xec03=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0xc03e[_0x4287b6];return _0x5a4f7e;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xec03('0x1'));var moment=require('moment');var BPromise=require(_0xec03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec03('0x3'));var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1ce78a,_0x31db21){return _0x1ce78a[_0xec03('0x8')](_0xec03('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc838=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4e7544,_0x17891b){var _0x1c20ee=function(_0x2c068b){while(--_0x2c068b){_0x4e7544['push'](_0x4e7544['shift']());}};_0x1c20ee(++_0x17891b);}(_0xc838,0xbd));var _0x8c83=function(_0x2ec1fa,_0x56dbd4){_0x2ec1fa=_0x2ec1fa-0x0;var _0x2bf179=_0xc838[_0x2ec1fa];return _0x2bf179;};'use strict';var _=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var logger=require(_0x8c83('0x2'))(_0x8c83('0x3'));var moment=require(_0x8c83('0x4'));var BPromise=require(_0x8c83('0x5'));var rp=require(_0x8c83('0x6'));var fs=require('fs');var path=require(_0x8c83('0x7'));var rimraf=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var attributes=require(_0x8c83('0xa'));module[_0x8c83('0xb')]=function(_0x115e50,_0x3aab2a){return _0x115e50[_0x8c83('0xc')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 05233bc..e656dd6 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 _0xcea3=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x2d222a,_0x17de56){var _0x57a81c=function(_0x22c34e){while(--_0x22c34e){_0x2d222a['push'](_0x2d222a['shift']());}};_0x57a81c(++_0x17de56);}(_0xcea3,0x98));var _0x3cea=function(_0x2bdb0e,_0x58b18c){_0x2bdb0e=_0x2bdb0e-0x0;var _0x39e9c3=_0xcea3[_0x2bdb0e];return _0x39e9c3;};'use strict';var _=require(_0x3cea('0x0'));var util=require(_0x3cea('0x1'));var moment=require(_0x3cea('0x2'));var BPromise=require(_0x3cea('0x3'));var rs=require(_0x3cea('0x4'));var fs=require('fs');var Redis=require(_0x3cea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cea('0x6'));var logger=require(_0x3cea('0x7'))(_0x3cea('0x8'));var config=require(_0x3cea('0x9'));var jayson=require(_0x3cea('0xa'));var client=jayson[_0x3cea('0xb')][_0x3cea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42cf52,_0x18531b,_0x117997){return new BPromise(function(_0x21d17a,_0x3d603d){return client['request'](_0x42cf52,_0x117997)['then'](function(_0x559c79){logger[_0x3cea('0xd')](_0x3cea('0xe'),_0x18531b,_0x3cea('0xf'));logger['debug'](_0x3cea('0x10'),_0x18531b,'request\x20sent',JSON[_0x3cea('0x11')](_0x559c79));if(_0x559c79['error']){if(_0x559c79[_0x3cea('0x12')][_0x3cea('0x13')]===0x1f4){logger[_0x3cea('0x12')](_0x3cea('0xe'),_0x18531b,_0x559c79[_0x3cea('0x12')][_0x3cea('0x14')]);return _0x3d603d(_0x559c79['error'][_0x3cea('0x14')]);}logger[_0x3cea('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x18531b,_0x559c79[_0x3cea('0x12')]['message']);return _0x21d17a(_0x559c79[_0x3cea('0x12')]['message']);}else{logger[_0x3cea('0xd')](_0x3cea('0xe'),_0x18531b,_0x3cea('0xf'));_0x21d17a(_0x559c79[_0x3cea('0x15')][_0x3cea('0x14')]);}})['catch'](function(_0xa09263){logger[_0x3cea('0x12')](_0x3cea('0xe'),_0x18531b,_0xa09263);_0x3d603d(_0xa09263);});});}
\ No newline at end of file
+var _0x6cbf=['result','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x12dbfa,_0x39f5c9){var _0x48983a=function(_0x1dcb6c){while(--_0x1dcb6c){_0x12dbfa['push'](_0x12dbfa['shift']());}};_0x48983a(++_0x39f5c9);}(_0x6cbf,0x122));var _0xf6cb=function(_0x1d8f94,_0x57edc0){_0x1d8f94=_0x1d8f94-0x0;var _0x31989c=_0x6cbf[_0x1d8f94];return _0x31989c;};'use strict';var _=require(_0xf6cb('0x0'));var util=require('util');var moment=require(_0xf6cb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6cb('0x2'));var db=require(_0xf6cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6cb('0x4'))(_0xf6cb('0x5'));var config=require(_0xf6cb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf6cb('0x7')][_0xf6cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc5bde1,_0x5ab9e2,_0x39ba5e){return new BPromise(function(_0x27cc2d,_0xb73a29){return client['request'](_0xc5bde1,_0x39ba5e)['then'](function(_0x4ab999){logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,_0xf6cb('0xb'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x5ab9e2,_0xf6cb('0xb'),JSON[_0xf6cb('0xc')](_0x4ab999));if(_0x4ab999[_0xf6cb('0xd')]){if(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xe')]===0x1f4){logger['error'](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0xb73a29(_0x4ab999[_0xf6cb('0xd')]['message']);}logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0x27cc2d(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);}else{logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,'request\x20sent');_0x27cc2d(_0x4ab999[_0xf6cb('0x10')]['message']);}})[_0xf6cb('0x11')](function(_0x1f3978){logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x1f3978);_0xb73a29(_0x1f3978);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b49dcec..f3a4baf 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 _0xd634=['/:id','update','util','path','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xd634,0xf4));var _0x4d63=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xd634[_0x2f87cd];return _0x5d7eda;};'use strict';var multer=require('multer');var util=require(_0x4d63('0x0'));var path=require(_0x4d63('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d63('0x2')]();var fs_extra=require(_0x4d63('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d63('0x4'));var controller=require(_0x4d63('0x5'));router[_0x4d63('0x6')]('/',auth[_0x4d63('0x7')](),controller[_0x4d63('0x8')]);router[_0x4d63('0x6')](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller[_0x4d63('0xa')]);router['delete'](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8efc=['put','destroy','exports','path','express','fs-extra','../../components/auth/service','./analyticMetric.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0x8d0eab,_0x43accb){var _0x3d343b=function(_0x33e8aa){while(--_0x33e8aa){_0x8d0eab['push'](_0x8d0eab['shift']());}};_0x3d343b(++_0x43accb);}(_0x8efc,0x8f));var _0xc8ef=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x8efc[_0xa3fadc];return _0x23ecb8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc8ef('0x0'));var timeout=require('connect-timeout');var express=require(_0xc8ef('0x1'));var router=express['Router']();var fs_extra=require(_0xc8ef('0x2'));var auth=require(_0xc8ef('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc8ef('0x4'));router['get']('/',auth[_0xc8ef('0x5')](),controller[_0xc8ef('0x6')]);router[_0xc8ef('0x7')](_0xc8ef('0x8'),auth[_0xc8ef('0x5')](),controller['show']);router[_0xc8ef('0x9')]('/',auth['isAuthenticated'](),controller[_0xc8ef('0xa')]);router[_0xc8ef('0xb')](_0xc8ef('0x8'),auth[_0xc8ef('0x5')](),controller['update']);router['delete']('/:id',auth[_0xc8ef('0x5')](),controller[_0xc8ef('0xc')]);module[_0xc8ef('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 146b614..ae670be 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 _0x92f3=['exports','TEXT','sequelize'];(function(_0x4017b4,_0x2cd5b8){var _0x34d43a=function(_0x5527a2){while(--_0x5527a2){_0x4017b4['push'](_0x4017b4['shift']());}};_0x34d43a(++_0x2cd5b8);}(_0x92f3,0xef));var _0x392f=function(_0x2a30da,_0x270871){_0x2a30da=_0x2a30da-0x0;var _0x49e870=_0x92f3[_0x2a30da];return _0x49e870;};'use strict';var Sequelize=require(_0x392f('0x0'));module[_0x392f('0x1')]={'tree':{'type':Sequelize[_0x392f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xcf50=['sequelize','TEXT'];(function(_0x255d05,_0x259f3e){var _0x487a4a=function(_0x4db5ef){while(--_0x4db5ef){_0x255d05['push'](_0x255d05['shift']());}};_0x487a4a(++_0x259f3e);}(_0xcf50,0xfc));var _0x0cf5=function(_0x5ad490,_0xd62e67){_0x5ad490=_0x5ad490-0x0;var _0x171bfb=_0xcf50[_0x5ad490];return _0x171bfb;};'use strict';var Sequelize=require(_0x0cf5('0x0'));module['exports']={'tree':{'type':Sequelize[_0x0cf5('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 34626a7..4c4fbbd 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 _0x1db3=['rawAttributes','type','key','model','query','intersection','fields','attributes','hasOwnProperty','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','AnalyticTreeReport','catch','params','keys','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','save','update','then','sendStatus','error','stack','name','send','index','map'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1db3,0x12b));var _0x31db=function(_0x3f763d,_0x13c788){_0x3f763d=_0x3f763d-0x0;var _0x48e041=_0x1db3[_0x3f763d];return _0x48e041;};'use strict';var emlformat=require(_0x31db('0x0'));var rimraf=require(_0x31db('0x1'));var zipdir=require(_0x31db('0x2'));var jsonpatch=require(_0x31db('0x3'));var rp=require('request-promise');var moment=require(_0x31db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x31db('0x5'));var util=require(_0x31db('0x6'));var path=require('path');var sox=require(_0x31db('0x7'));var csv=require(_0x31db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31db('0x9'));var _=require(_0x31db('0xa'));var squel=require('squel');var crypto=require(_0x31db('0xb'));var jsforce=require(_0x31db('0xc'));var deskjs=require(_0x31db('0xd'));var toCsv=require(_0x31db('0x8'));var querystring=require(_0x31db('0xe'));var Papa=require(_0x31db('0xf'));var Redis=require(_0x31db('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x31db('0x11'));var as=require(_0x31db('0x12'));var hardwareService=require(_0x31db('0x13'));var logger=require('../../config/logger')(_0x31db('0x14'));var utils=require('../../config/utils');var config=require(_0x31db('0x15'));var licenseUtil=require(_0x31db('0x16'));var db=require(_0x31db('0x17'))['db'];function respondWithStatusCode(_0x57f398,_0x11e54a){_0x11e54a=_0x11e54a||0xcc;return function(_0x54d13c){if(_0x54d13c){return _0x57f398['sendStatus'](_0x11e54a);}return _0x57f398[_0x31db('0x18')](_0x11e54a)['end']();};}function respondWithResult(_0x5cbf46,_0x39832f){_0x39832f=_0x39832f||0xc8;return function(_0x5f2ad8){if(_0x5f2ad8){return _0x5cbf46[_0x31db('0x18')](_0x39832f)[_0x31db('0x19')](_0x5f2ad8);}};}function respondWithFilteredResult(_0x27de6a,_0x19ab62){return function(_0x32e973){if(_0x32e973){var _0x2b6739=typeof _0x19ab62['offset']===_0x31db('0x1a')&&typeof _0x19ab62[_0x31db('0x1b')]===_0x31db('0x1a');var _0x3461c0=_0x32e973['count'];var _0x54fdd5=_0x2b6739?0x0:_0x19ab62[_0x31db('0x1c')];var _0x44272f=_0x2b6739?_0x32e973[_0x31db('0x1d')]:_0x19ab62['offset']+_0x19ab62[_0x31db('0x1b')];var _0x32ddac;if(_0x44272f>=_0x3461c0){_0x44272f=_0x3461c0;_0x32ddac=0xc8;}else{_0x32ddac=0xce;}_0x27de6a[_0x31db('0x18')](_0x32ddac);return _0x27de6a[_0x31db('0x1e')]('Content-Range',_0x54fdd5+'-'+_0x44272f+'/'+_0x3461c0)[_0x31db('0x19')](_0x32e973);}return null;};}function patchUpdates(_0x4fd950){return function(_0x55ead7){try{jsonpatch['apply'](_0x55ead7,_0x4fd950,!![]);}catch(_0x1818d6){return BPromise['reject'](_0x1818d6);}return _0x55ead7[_0x31db('0x1f')]();};}function saveUpdates(_0x2bcaa0,_0x2f5ce7){return function(_0xd1113d){if(_0xd1113d){return _0xd1113d[_0x31db('0x20')](_0x2bcaa0)[_0x31db('0x21')](function(_0x290a91){return _0x290a91;});}return null;};}function removeEntity(_0x4d23f,_0x2d8989){return function(_0x18374c){if(_0x18374c){return _0x18374c['destroy']()[_0x31db('0x21')](function(){_0x4d23f[_0x31db('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478d57,_0x2c9eec){return function(_0x174e97){if(!_0x174e97){_0x478d57[_0x31db('0x22')](0x194);}return _0x174e97;};}function handleError(_0x463b47,_0xdcd97){_0xdcd97=_0xdcd97||0x1f4;return function(_0x2ab9d1){logger[_0x31db('0x23')](_0x2ab9d1[_0x31db('0x24')]);if(_0x2ab9d1[_0x31db('0x25')]){delete _0x2ab9d1[_0x31db('0x25')];}_0x463b47['status'](_0xdcd97)[_0x31db('0x26')](_0x2ab9d1);};}exports[_0x31db('0x27')]=function(_0x4ccfd5,_0x24bcc1){var _0x533394={},_0x5ed72a={},_0x195593={'count':0x0,'rows':[]};var _0x49c7f3=_[_0x31db('0x28')](db['AnalyticTreeReport'][_0x31db('0x29')],function(_0x3eef98){return{'name':_0x3eef98['fieldName'],'type':_0x3eef98[_0x31db('0x2a')][_0x31db('0x2b')]};});_0x5ed72a[_0x31db('0x2c')]=_[_0x31db('0x28')](_0x49c7f3,_0x31db('0x25'));_0x5ed72a[_0x31db('0x2d')]=_['keys'](_0x4ccfd5[_0x31db('0x2d')]);_0x5ed72a['filters']=_[_0x31db('0x2e')](_0x5ed72a[_0x31db('0x2c')],_0x5ed72a[_0x31db('0x2d')]);_0x533394['attributes']=_['intersection'](_0x5ed72a[_0x31db('0x2c')],qs[_0x31db('0x2f')](_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x2f')]));_0x533394[_0x31db('0x30')]=_0x533394['attributes']['length']?_0x533394[_0x31db('0x30')]:_0x5ed72a[_0x31db('0x2c')];if(!_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x31')]('nolimit')){_0x533394['limit']=qs[_0x31db('0x1b')](_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x1b')]);_0x533394['offset']=qs[_0x31db('0x1c')](_0x4ccfd5['query'][_0x31db('0x1c')]);}_0x533394['order']=qs[_0x31db('0x32')](_0x4ccfd5['query'][_0x31db('0x32')]);_0x533394[_0x31db('0x33')]=qs[_0x31db('0x34')](_['pick'](_0x4ccfd5['query'],_0x5ed72a[_0x31db('0x34')]),_0x49c7f3);if(_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x35')]){_0x533394[_0x31db('0x33')]=_['merge'](_0x533394[_0x31db('0x33')],{'$or':_[_0x31db('0x28')](_0x49c7f3,function(_0x31f2e0){if(_0x31f2e0[_0x31db('0x2a')]!==_0x31db('0x36')){var _0x3a6a6b={};_0x3a6a6b[_0x31f2e0['name']]={'$like':'%'+_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x35')]+'%'};return _0x3a6a6b;}})});}_0x533394=_[_0x31db('0x37')]({},_0x533394,_0x4ccfd5[_0x31db('0x38')]);var _0x4a064e={'where':_0x533394[_0x31db('0x33')]};return db['AnalyticTreeReport'][_0x31db('0x1d')](_0x4a064e)['then'](function(_0x17b8fc){_0x195593[_0x31db('0x1d')]=_0x17b8fc;if(_0x4ccfd5[_0x31db('0x2d')][_0x31db('0x39')]){_0x533394['include']=[{'all':!![]}];}return db[_0x31db('0x3a')]['findAll'](_0x533394);})[_0x31db('0x21')](function(_0x3c74c6){_0x195593['rows']=_0x3c74c6;return _0x195593;})[_0x31db('0x21')](respondWithFilteredResult(_0x24bcc1,_0x533394))[_0x31db('0x3b')](handleError(_0x24bcc1,null));};exports['show']=function(_0x2d7769,_0x32fabf){var _0x29305f={'raw':!![],'where':{'id':_0x2d7769[_0x31db('0x3c')]['id']}},_0x734e09={};_0x734e09['model']=_[_0x31db('0x3d')](db[_0x31db('0x3a')]['rawAttributes']);_0x734e09[_0x31db('0x2d')]=_[_0x31db('0x3d')](_0x2d7769['query']);_0x734e09[_0x31db('0x34')]=_[_0x31db('0x2e')](_0x734e09['model'],_0x734e09[_0x31db('0x2d')]);_0x29305f[_0x31db('0x30')]=_[_0x31db('0x2e')](_0x734e09['model'],qs[_0x31db('0x2f')](_0x2d7769['query'][_0x31db('0x2f')]));_0x29305f[_0x31db('0x30')]=_0x29305f[_0x31db('0x30')][_0x31db('0x3e')]?_0x29305f[_0x31db('0x30')]:_0x734e09[_0x31db('0x2c')];if(_0x2d7769[_0x31db('0x2d')][_0x31db('0x39')]){_0x29305f[_0x31db('0x3f')]=[{'all':!![]}];}_0x29305f=_[_0x31db('0x37')]({},_0x29305f,_0x2d7769['options']);return db[_0x31db('0x3a')][_0x31db('0x40')](_0x29305f)[_0x31db('0x21')](handleEntityNotFound(_0x32fabf,null))[_0x31db('0x21')](respondWithResult(_0x32fabf,null))[_0x31db('0x3b')](handleError(_0x32fabf,null));};exports[_0x31db('0x41')]=function(_0x123117,_0x11d737){return db[_0x31db('0x3a')][_0x31db('0x41')](_0x123117['body'],{})[_0x31db('0x21')](respondWithResult(_0x11d737,0xc9))['catch'](handleError(_0x11d737,null));};exports[_0x31db('0x20')]=function(_0x26e3b7,_0x5a8e88){if(_0x26e3b7[_0x31db('0x42')]['id']){delete _0x26e3b7['body']['id'];}return db[_0x31db('0x3a')][_0x31db('0x40')]({'where':{'id':_0x26e3b7['params']['id']}})['then'](handleEntityNotFound(_0x5a8e88,null))[_0x31db('0x21')](saveUpdates(_0x26e3b7[_0x31db('0x42')],null))['then'](respondWithResult(_0x5a8e88,null))[_0x31db('0x3b')](handleError(_0x5a8e88,null));};exports[_0x31db('0x43')]=function(_0x45bace,_0x563daa){return db[_0x31db('0x3a')][_0x31db('0x40')]({'where':{'id':_0x45bace[_0x31db('0x3c')]['id']}})[_0x31db('0x21')](handleEntityNotFound(_0x563daa,null))[_0x31db('0x21')](removeEntity(_0x563daa,null))[_0x31db('0x3b')](handleError(_0x563daa,null));};
\ No newline at end of file
+var _0x337c=['options','includeAll','include','findAll','rows','catch','params','keys','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','type','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL'];(function(_0x12ff82,_0x4e767a){var _0x49bd51=function(_0x250d99){while(--_0x250d99){_0x12ff82['push'](_0x12ff82['shift']());}};_0x49bd51(++_0x4e767a);}(_0x337c,0x134));var _0xc337=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x337c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc337('0x0'));var rimraf=require(_0xc337('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc337('0x2'));var rp=require(_0xc337('0x3'));var moment=require(_0xc337('0x4'));var BPromise=require(_0xc337('0x5'));var Mustache=require(_0xc337('0x6'));var util=require(_0xc337('0x7'));var path=require(_0xc337('0x8'));var sox=require(_0xc337('0x9'));var csv=require(_0xc337('0xa'));var ejs=require(_0xc337('0xb'));var fs=require('fs');var fs_extra=require(_0xc337('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc337('0xd'));var jsforce=require(_0xc337('0xe'));var deskjs=require(_0xc337('0xf'));var toCsv=require(_0xc337('0xa'));var querystring=require(_0xc337('0x10'));var Papa=require(_0xc337('0x11'));var Redis=require(_0xc337('0x12'));var authService=require(_0xc337('0x13'));var qs=require(_0xc337('0x14'));var as=require(_0xc337('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc337('0x16'))('api');var utils=require(_0xc337('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc337('0x18'))['db'];function respondWithStatusCode(_0x5526f8,_0x39407c){_0x39407c=_0x39407c||0xcc;return function(_0x48a293){if(_0x48a293){return _0x5526f8[_0xc337('0x19')](_0x39407c);}return _0x5526f8['status'](_0x39407c)[_0xc337('0x1a')]();};}function respondWithResult(_0x9f2050,_0x1ee1cd){_0x1ee1cd=_0x1ee1cd||0xc8;return function(_0x4a80fd){if(_0x4a80fd){return _0x9f2050[_0xc337('0x1b')](_0x1ee1cd)[_0xc337('0x1c')](_0x4a80fd);}};}function respondWithFilteredResult(_0x4d4869,_0x579a0c){return function(_0x538e39){if(_0x538e39){var _0x8b41a1=typeof _0x579a0c['offset']===_0xc337('0x1d')&&typeof _0x579a0c[_0xc337('0x1e')]==='undefined';var _0x4ebd6f=_0x538e39[_0xc337('0x1f')];var _0x23437b=_0x8b41a1?0x0:_0x579a0c[_0xc337('0x20')];var _0x39b797=_0x8b41a1?_0x538e39[_0xc337('0x1f')]:_0x579a0c[_0xc337('0x20')]+_0x579a0c['limit'];var _0xbdfd48;if(_0x39b797>=_0x4ebd6f){_0x39b797=_0x4ebd6f;_0xbdfd48=0xc8;}else{_0xbdfd48=0xce;}_0x4d4869[_0xc337('0x1b')](_0xbdfd48);return _0x4d4869[_0xc337('0x21')](_0xc337('0x22'),_0x23437b+'-'+_0x39b797+'/'+_0x4ebd6f)['json'](_0x538e39);}return null;};}function patchUpdates(_0x40074f){return function(_0x46b157){try{jsonpatch[_0xc337('0x23')](_0x46b157,_0x40074f,!![]);}catch(_0x54b144){return BPromise[_0xc337('0x24')](_0x54b144);}return _0x46b157[_0xc337('0x25')]();};}function saveUpdates(_0x29cc5c,_0x5b1dba){return function(_0x2fdfbf){if(_0x2fdfbf){return _0x2fdfbf['update'](_0x29cc5c)[_0xc337('0x26')](function(_0x10b4af){return _0x10b4af;});}return null;};}function removeEntity(_0x7617cd,_0x4da37d){return function(_0x1c7a87){if(_0x1c7a87){return _0x1c7a87[_0xc337('0x27')]()[_0xc337('0x26')](function(){_0x7617cd[_0xc337('0x1b')](0xcc)[_0xc337('0x1a')]();});}};}function handleEntityNotFound(_0x452d7f,_0xb2de92){return function(_0x4c5e21){if(!_0x4c5e21){_0x452d7f[_0xc337('0x19')](0x194);}return _0x4c5e21;};}function handleError(_0x14c1e3,_0x1e9bfe){_0x1e9bfe=_0x1e9bfe||0x1f4;return function(_0x28976c){logger[_0xc337('0x28')](_0x28976c[_0xc337('0x29')]);if(_0x28976c[_0xc337('0x2a')]){delete _0x28976c[_0xc337('0x2a')];}_0x14c1e3[_0xc337('0x1b')](_0x1e9bfe)[_0xc337('0x2b')](_0x28976c);};}exports[_0xc337('0x2c')]=function(_0x2116e9,_0x2a0542){var _0x58efae={},_0x68fcf2={},_0x386eca={'count':0x0,'rows':[]};var _0xc84f7a=_['map'](db[_0xc337('0x2d')]['rawAttributes'],function(_0x306128){return{'name':_0x306128['fieldName'],'type':_0x306128[_0xc337('0x2e')]['key']};});_0x68fcf2['model']=_[_0xc337('0x2f')](_0xc84f7a,'name');_0x68fcf2[_0xc337('0x30')]=_['keys'](_0x2116e9[_0xc337('0x30')]);_0x68fcf2['filters']=_[_0xc337('0x31')](_0x68fcf2[_0xc337('0x32')],_0x68fcf2['query']);_0x58efae['attributes']=_['intersection'](_0x68fcf2[_0xc337('0x32')],qs[_0xc337('0x33')](_0x2116e9[_0xc337('0x30')][_0xc337('0x33')]));_0x58efae[_0xc337('0x34')]=_0x58efae[_0xc337('0x34')][_0xc337('0x35')]?_0x58efae[_0xc337('0x34')]:_0x68fcf2[_0xc337('0x32')];if(!_0x2116e9['query'][_0xc337('0x36')](_0xc337('0x37'))){_0x58efae[_0xc337('0x1e')]=qs[_0xc337('0x1e')](_0x2116e9[_0xc337('0x30')]['limit']);_0x58efae[_0xc337('0x20')]=qs[_0xc337('0x20')](_0x2116e9[_0xc337('0x30')][_0xc337('0x20')]);}_0x58efae['order']=qs['sort'](_0x2116e9[_0xc337('0x30')][_0xc337('0x38')]);_0x58efae[_0xc337('0x39')]=qs[_0xc337('0x3a')](_['pick'](_0x2116e9[_0xc337('0x30')],_0x68fcf2[_0xc337('0x3a')]),_0xc84f7a);if(_0x2116e9[_0xc337('0x30')][_0xc337('0x3b')]){_0x58efae[_0xc337('0x39')]=_[_0xc337('0x3c')](_0x58efae[_0xc337('0x39')],{'$or':_[_0xc337('0x2f')](_0xc84f7a,function(_0x536843){if(_0x536843[_0xc337('0x2e')]!==_0xc337('0x3d')){var _0xf22e3a={};_0xf22e3a[_0x536843[_0xc337('0x2a')]]={'$like':'%'+_0x2116e9[_0xc337('0x30')][_0xc337('0x3b')]+'%'};return _0xf22e3a;}})});}_0x58efae=_[_0xc337('0x3c')]({},_0x58efae,_0x2116e9[_0xc337('0x3e')]);var _0x1ed38b={'where':_0x58efae[_0xc337('0x39')]};return db[_0xc337('0x2d')]['count'](_0x1ed38b)[_0xc337('0x26')](function(_0xd18cea){_0x386eca['count']=_0xd18cea;if(_0x2116e9['query'][_0xc337('0x3f')]){_0x58efae[_0xc337('0x40')]=[{'all':!![]}];}return db[_0xc337('0x2d')][_0xc337('0x41')](_0x58efae);})[_0xc337('0x26')](function(_0x5e7dac){_0x386eca[_0xc337('0x42')]=_0x5e7dac;return _0x386eca;})['then'](respondWithFilteredResult(_0x2a0542,_0x58efae))[_0xc337('0x43')](handleError(_0x2a0542,null));};exports['show']=function(_0x547fa0,_0x1528e4){var _0x4af1b1={'raw':!![],'where':{'id':_0x547fa0[_0xc337('0x44')]['id']}},_0x17c8a1={};_0x17c8a1['model']=_[_0xc337('0x45')](db[_0xc337('0x2d')]['rawAttributes']);_0x17c8a1[_0xc337('0x30')]=_['keys'](_0x547fa0[_0xc337('0x30')]);_0x17c8a1['filters']=_[_0xc337('0x31')](_0x17c8a1[_0xc337('0x32')],_0x17c8a1[_0xc337('0x30')]);_0x4af1b1[_0xc337('0x34')]=_[_0xc337('0x31')](_0x17c8a1[_0xc337('0x32')],qs[_0xc337('0x33')](_0x547fa0['query'][_0xc337('0x33')]));_0x4af1b1['attributes']=_0x4af1b1[_0xc337('0x34')]['length']?_0x4af1b1[_0xc337('0x34')]:_0x17c8a1['model'];if(_0x547fa0[_0xc337('0x30')]['includeAll']){_0x4af1b1[_0xc337('0x40')]=[{'all':!![]}];}_0x4af1b1=_[_0xc337('0x3c')]({},_0x4af1b1,_0x547fa0[_0xc337('0x3e')]);return db[_0xc337('0x2d')]['find'](_0x4af1b1)['then'](handleEntityNotFound(_0x1528e4,null))[_0xc337('0x26')](respondWithResult(_0x1528e4,null))[_0xc337('0x43')](handleError(_0x1528e4,null));};exports[_0xc337('0x46')]=function(_0x389ed0,_0x4f1cec){return db[_0xc337('0x2d')][_0xc337('0x46')](_0x389ed0[_0xc337('0x47')],{})[_0xc337('0x26')](respondWithResult(_0x4f1cec,0xc9))['catch'](handleError(_0x4f1cec,null));};exports[_0xc337('0x48')]=function(_0x4d97b7,_0x5720d1){if(_0x4d97b7[_0xc337('0x47')]['id']){delete _0x4d97b7[_0xc337('0x47')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x4d97b7[_0xc337('0x44')]['id']}})['then'](handleEntityNotFound(_0x5720d1,null))['then'](saveUpdates(_0x4d97b7[_0xc337('0x47')],null))[_0xc337('0x26')](respondWithResult(_0x5720d1,null))['catch'](handleError(_0x5720d1,null));};exports[_0xc337('0x27')]=function(_0x4b073e,_0x17e50d){return db[_0xc337('0x2d')][_0xc337('0x49')]({'where':{'id':_0x4b073e['params']['id']}})[_0xc337('0x26')](handleEntityNotFound(_0x17e50d,null))[_0xc337('0x26')](removeEntity(_0x17e50d,null))[_0xc337('0x43')](handleError(_0x17e50d,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 76a704d..00b7c63 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 _0x2719=['analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x210c86,_0x3b6d61){var _0x2d7e0d=function(_0x3f2991){while(--_0x3f2991){_0x210c86['push'](_0x210c86['shift']());}};_0x2d7e0d(++_0x3b6d61);}(_0x2719,0x90));var _0x9271=function(_0x59d546,_0x107f05){_0x59d546=_0x59d546-0x0;var _0x41fbdb=_0x2719[_0x59d546];return _0x41fbdb;};'use strict';var _=require(_0x9271('0x0'));var util=require('util');var logger=require(_0x9271('0x1'))(_0x9271('0x2'));var moment=require(_0x9271('0x3'));var BPromise=require(_0x9271('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9271('0x5'));var rimraf=require(_0x9271('0x6'));var config=require(_0x9271('0x7'));var attributes=require(_0x9271('0x8'));module[_0x9271('0x9')]=function(_0x1f7322,_0x34fd09){return _0x1f7322[_0x9271('0xa')](_0x9271('0xb'),attributes,{'tableName':_0x9271('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d96=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x3d96,0x1a2));var _0x63d9=function(_0x233be7,_0x3a2f6b){_0x233be7=_0x233be7-0x0;var _0x2cb1f7=_0x3d96[_0x233be7];return _0x2cb1f7;};'use strict';var _=require(_0x63d9('0x0'));var util=require(_0x63d9('0x1'));var logger=require(_0x63d9('0x2'))(_0x63d9('0x3'));var moment=require(_0x63d9('0x4'));var BPromise=require('bluebird');var rp=require(_0x63d9('0x5'));var fs=require('fs');var path=require(_0x63d9('0x6'));var rimraf=require(_0x63d9('0x7'));var config=require(_0x63d9('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x63d9('0x9')]=function(_0x27a7fc,_0x2e8f38){return _0x27a7fc[_0x63d9('0xa')](_0x63d9('0xb'),attributes,{'tableName':_0x63d9('0xc'),'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 347ffd5..5dbec55 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2b9419,_0x355da6){var _0x2e1e6e=function(_0x297ad5){while(--_0x297ad5){_0x2b9419['push'](_0x2b9419['shift']());}};_0x2e1e6e(++_0x355da6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x2cabae,_0x1b6883){_0x2cabae=_0x2cabae-0x0;var _0x4cf348=_0x7a54[_0x2cabae];return _0x4cf348;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d97e6a1..3121d56 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 _0x8acb=['put','/:id','delete','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','show','post','isAuthenticated'];(function(_0x1b8738,_0x5ed5c9){var _0x4c4556=function(_0x445018){while(--_0x445018){_0x1b8738['push'](_0x1b8738['shift']());}};_0x4c4556(++_0x5ed5c9);}(_0x8acb,0x1cf));var _0xb8ac=function(_0x2a18aa,_0x2be68d){_0x2a18aa=_0x2a18aa-0x0;var _0x43bdd3=_0x8acb[_0x2a18aa];return _0x43bdd3;};'use strict';var multer=require(_0xb8ac('0x0'));var util=require(_0xb8ac('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb8ac('0x2'));var router=express['Router']();var fs_extra=require(_0xb8ac('0x3'));var auth=require(_0xb8ac('0x4'));var interaction=require(_0xb8ac('0x5'));var config=require(_0xb8ac('0x6'));var controller=require(_0xb8ac('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb8ac('0x8')]);router[_0xb8ac('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb8ac('0xa')]);router[_0xb8ac('0xb')]('/',auth[_0xb8ac('0xc')](),controller['create']);router[_0xb8ac('0xd')](_0xb8ac('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xb8ac('0xf')](_0xb8ac('0xe'),auth[_0xb8ac('0xc')](),controller['destroy']);module[_0xb8ac('0x10')]=router;
\ No newline at end of file
+var _0x5cf5=['index','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x3a61cf,_0x120f14){var _0x12d6ca=function(_0x32fff6){while(--_0x32fff6){_0x3a61cf['push'](_0x3a61cf['shift']());}};_0x12d6ca(++_0x120f14);}(_0x5cf5,0x1cb));var _0x55cf=function(_0x521e41,_0x34e57f){_0x521e41=_0x521e41-0x0;var _0x25b247=_0x5cf5[_0x521e41];return _0x25b247;};'use strict';var multer=require(_0x55cf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x55cf('0x1'));var express=require(_0x55cf('0x2'));var router=express[_0x55cf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x55cf('0x4'));var interaction=require(_0x55cf('0x5'));var config=require('../../config/environment');var controller=require(_0x55cf('0x6'));router[_0x55cf('0x7')]('/',auth[_0x55cf('0x8')](),controller[_0x55cf('0x9')]);router[_0x55cf('0x7')](_0x55cf('0xa'),auth[_0x55cf('0x8')](),controller[_0x55cf('0xb')]);router[_0x55cf('0xc')]('/',auth[_0x55cf('0x8')](),controller['create']);router[_0x55cf('0xd')](_0x55cf('0xa'),auth['isAuthenticated'](),controller[_0x55cf('0xe')]);router[_0x55cf('0xf')](_0x55cf('0xa'),auth['isAuthenticated'](),controller[_0x55cf('0x10')]);module[_0x55cf('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 85204a9..de9b118 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 _0x83f1=['STRING','sequelize','exports'];(function(_0x1f3786,_0x311f9b){var _0x4e595c=function(_0xd32535){while(--_0xd32535){_0x1f3786['push'](_0x1f3786['shift']());}};_0x4e595c(++_0x311f9b);}(_0x83f1,0x1cc));var _0x183f=function(_0x3ca8ec,_0x409ea0){_0x3ca8ec=_0x3ca8ec-0x0;var _0x3fd1a9=_0x83f1[_0x3ca8ec];return _0x3fd1a9;};'use strict';var Sequelize=require(_0x183f('0x0'));module[_0x183f('0x1')]={'name':{'type':Sequelize[_0x183f('0x2')]},'basename':{'type':Sequelize[_0x183f('0x2')]},'type':{'type':Sequelize[_0x183f('0x2')]}};
\ No newline at end of file
+var _0xa98d=['STRING','sequelize'];(function(_0x16d367,_0xc8b7cc){var _0x5e4319=function(_0x23ae99){while(--_0x23ae99){_0x16d367['push'](_0x16d367['shift']());}};_0x5e4319(++_0xc8b7cc);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xda98('0x0'));module['exports']={'name':{'type':Sequelize[_0xda98('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xda98('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b972f0b..e900df4 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 _0x8ad7=['then','destroy','sendStatus','error','stack','name','index','Attachment','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','include','catch','show','rawAttributes','keys','clone','params','includeAll','find','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x3437a4,_0x4e577f){var _0x3dbdd0=function(_0x25f088){while(--_0x25f088){_0x3437a4['push'](_0x3437a4['shift']());}};_0x3dbdd0(++_0x4e577f);}(_0x8ad7,0xe4));var _0x78ad=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x8ad7[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0x78ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78ad('0x1'));var jsonpatch=require(_0x78ad('0x2'));var rp=require(_0x78ad('0x3'));var moment=require(_0x78ad('0x4'));var BPromise=require(_0x78ad('0x5'));var Mustache=require(_0x78ad('0x6'));var util=require(_0x78ad('0x7'));var path=require(_0x78ad('0x8'));var sox=require('sox');var csv=require(_0x78ad('0x9'));var ejs=require(_0x78ad('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78ad('0xb'));var crypto=require(_0x78ad('0xc'));var jsforce=require(_0x78ad('0xd'));var deskjs=require(_0x78ad('0xe'));var toCsv=require(_0x78ad('0x9'));var querystring=require(_0x78ad('0xf'));var Papa=require('papaparse');var Redis=require(_0x78ad('0x10'));var authService=require(_0x78ad('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ad('0x12'));var logger=require(_0x78ad('0x13'))('api');var utils=require(_0x78ad('0x14'));var config=require(_0x78ad('0x15'));var licenseUtil=require(_0x78ad('0x16'));var db=require(_0x78ad('0x17'))['db'];function respondWithStatusCode(_0x30ff69,_0x4deb08){_0x4deb08=_0x4deb08||0xcc;return function(_0x41a8a9){if(_0x41a8a9){return _0x30ff69['sendStatus'](_0x4deb08);}return _0x30ff69[_0x78ad('0x18')](_0x4deb08)[_0x78ad('0x19')]();};}function respondWithResult(_0x4dda6c,_0x52fd25){_0x52fd25=_0x52fd25||0xc8;return function(_0x5d944e){if(_0x5d944e){return _0x4dda6c[_0x78ad('0x18')](_0x52fd25)[_0x78ad('0x1a')](_0x5d944e);}};}function respondWithFilteredResult(_0x4bbaca,_0xe32b5a){return function(_0x1ac6f2){if(_0x1ac6f2){var _0x389c76=typeof _0xe32b5a[_0x78ad('0x1b')]===_0x78ad('0x1c')&&typeof _0xe32b5a[_0x78ad('0x1d')]===_0x78ad('0x1c');var _0x26056e=_0x1ac6f2[_0x78ad('0x1e')];var _0x165310=_0x389c76?0x0:_0xe32b5a[_0x78ad('0x1b')];var _0x46d739=_0x389c76?_0x1ac6f2[_0x78ad('0x1e')]:_0xe32b5a[_0x78ad('0x1b')]+_0xe32b5a[_0x78ad('0x1d')];var _0x3242f3;if(_0x46d739>=_0x26056e){_0x46d739=_0x26056e;_0x3242f3=0xc8;}else{_0x3242f3=0xce;}_0x4bbaca[_0x78ad('0x18')](_0x3242f3);return _0x4bbaca[_0x78ad('0x1f')](_0x78ad('0x20'),_0x165310+'-'+_0x46d739+'/'+_0x26056e)['json'](_0x1ac6f2);}return null;};}function patchUpdates(_0x4e649b){return function(_0x2aa42a){try{jsonpatch['apply'](_0x2aa42a,_0x4e649b,!![]);}catch(_0x2ff702){return BPromise[_0x78ad('0x21')](_0x2ff702);}return _0x2aa42a[_0x78ad('0x22')]();};}function saveUpdates(_0xf43c22,_0xa599f7){return function(_0x18cdc4){if(_0x18cdc4){return _0x18cdc4[_0x78ad('0x23')](_0xf43c22)[_0x78ad('0x24')](function(_0x2bba73){return _0x2bba73;});}return null;};}function removeEntity(_0x4a08fb,_0x407673){return function(_0x27b371){if(_0x27b371){return _0x27b371[_0x78ad('0x25')]()['then'](function(){_0x4a08fb[_0x78ad('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3244cc,_0x17097e){return function(_0x25c3c0){if(!_0x25c3c0){_0x3244cc[_0x78ad('0x26')](0x194);}return _0x25c3c0;};}function handleError(_0x57eaed,_0x28ce56){_0x28ce56=_0x28ce56||0x1f4;return function(_0x1c6808){logger[_0x78ad('0x27')](_0x1c6808[_0x78ad('0x28')]);if(_0x1c6808[_0x78ad('0x29')]){delete _0x1c6808[_0x78ad('0x29')];}_0x57eaed['status'](_0x28ce56)['send'](_0x1c6808);};}exports[_0x78ad('0x2a')]=function(_0x230d0f,_0x4e76e3){var _0x1c4925={},_0x59cdcd={},_0x2f65e3={'count':0x0,'rows':[]};var _0x5980cd=_['map'](db[_0x78ad('0x2b')]['rawAttributes'],function(_0x5b23aa){return{'name':_0x5b23aa[_0x78ad('0x2c')],'type':_0x5b23aa[_0x78ad('0x2d')][_0x78ad('0x2e')]};});_0x59cdcd[_0x78ad('0x2f')]=_['map'](_0x5980cd,_0x78ad('0x29'));_0x59cdcd[_0x78ad('0x30')]=_['keys'](_0x230d0f[_0x78ad('0x30')]);_0x59cdcd[_0x78ad('0x31')]=_['intersection'](_0x59cdcd[_0x78ad('0x2f')],_0x59cdcd[_0x78ad('0x30')]);_0x1c4925[_0x78ad('0x32')]=_[_0x78ad('0x33')](_0x59cdcd['model'],qs['fields'](_0x230d0f[_0x78ad('0x30')][_0x78ad('0x34')]));_0x1c4925['attributes']=_0x1c4925[_0x78ad('0x32')][_0x78ad('0x35')]?_0x1c4925['attributes']:_0x59cdcd[_0x78ad('0x2f')];if(!_0x230d0f[_0x78ad('0x30')][_0x78ad('0x36')](_0x78ad('0x37'))){_0x1c4925[_0x78ad('0x1d')]=qs['limit'](_0x230d0f[_0x78ad('0x30')]['limit']);_0x1c4925[_0x78ad('0x1b')]=qs['offset'](_0x230d0f[_0x78ad('0x30')][_0x78ad('0x1b')]);}_0x1c4925[_0x78ad('0x38')]=qs[_0x78ad('0x39')](_0x230d0f[_0x78ad('0x30')][_0x78ad('0x39')]);_0x1c4925['where']=qs[_0x78ad('0x31')](_[_0x78ad('0x3a')](_0x230d0f[_0x78ad('0x30')],_0x59cdcd['filters']),_0x5980cd);if(_0x230d0f['query'][_0x78ad('0x3b')]){_0x1c4925['where']=_[_0x78ad('0x3c')](_0x1c4925[_0x78ad('0x3d')],{'$or':_['map'](_0x5980cd,function(_0x28cd42){if(_0x28cd42[_0x78ad('0x2d')]!=='VIRTUAL'){var _0x15078d={};_0x15078d[_0x28cd42['name']]={'$like':'%'+_0x230d0f[_0x78ad('0x30')][_0x78ad('0x3b')]+'%'};return _0x15078d;}})});}_0x1c4925=_[_0x78ad('0x3c')]({},_0x1c4925,_0x230d0f[_0x78ad('0x3e')]);var _0x5c5c1f={'where':_0x1c4925['where']};return db['Attachment'][_0x78ad('0x1e')](_0x5c5c1f)['then'](function(_0x556cce){_0x2f65e3[_0x78ad('0x1e')]=_0x556cce;if(_0x230d0f[_0x78ad('0x30')]['includeAll']){_0x1c4925[_0x78ad('0x3f')]=[{'all':!![]}];}return db[_0x78ad('0x2b')]['findAll'](_0x1c4925);})['then'](function(_0x3ca359){_0x2f65e3['rows']=_0x3ca359;return _0x2f65e3;})['then'](respondWithFilteredResult(_0x4e76e3,_0x1c4925))[_0x78ad('0x40')](handleError(_0x4e76e3,null));};exports[_0x78ad('0x41')]=function(_0x201984,_0x55991a){var _0x41bf07={'raw':!![],'where':{'id':_0x201984['params']['id']}},_0x1b1c9e={};_0x1b1c9e[_0x78ad('0x2f')]=_['keys'](db[_0x78ad('0x2b')][_0x78ad('0x42')]);_0x1b1c9e['query']=_[_0x78ad('0x43')](_0x201984[_0x78ad('0x30')]);_0x1b1c9e['filters']=_[_0x78ad('0x33')](_0x1b1c9e['model'],_0x1b1c9e[_0x78ad('0x30')]);_0x41bf07[_0x78ad('0x32')]=_[_0x78ad('0x33')](_0x1b1c9e['model'],qs[_0x78ad('0x34')](_0x201984[_0x78ad('0x30')][_0x78ad('0x34')]));_0x41bf07[_0x78ad('0x32')]=_0x41bf07[_0x78ad('0x32')][_0x78ad('0x35')]?_0x41bf07[_0x78ad('0x32')]:_0x1b1c9e[_0x78ad('0x2f')];if(_0x201984['query']['includeAll']){_0x41bf07[_0x78ad('0x3f')]=[{'all':!![]}];}_0x41bf07=_[_0x78ad('0x3c')]({},_0x41bf07,_0x201984['options']);return db[_0x78ad('0x2b')]['find'](_0x41bf07)[_0x78ad('0x24')](handleEntityNotFound(_0x55991a,null))['then'](respondWithResult(_0x55991a,null))['catch'](handleError(_0x55991a,null));};exports[_0x78ad('0x44')]=function(_0x4cfe7d,_0x57a935){var _0x52aa41={'where':{'id':_0x4cfe7d[_0x78ad('0x45')]['id']}},_0x4f808b={};_0x4f808b[_0x78ad('0x2f')]=_['keys'](db[_0x78ad('0x2b')]['rawAttributes']);_0x52aa41[_0x78ad('0x32')]=_[_0x78ad('0x33')](_0x4f808b[_0x78ad('0x2f')],qs['fields'](_0x4cfe7d[_0x78ad('0x30')][_0x78ad('0x34')]));_0x52aa41['attributes']=_0x52aa41[_0x78ad('0x32')][_0x78ad('0x35')]?_0x52aa41['attributes']:_0x4f808b[_0x78ad('0x2f')];if(_0x4cfe7d[_0x78ad('0x30')][_0x78ad('0x46')]){_0x52aa41[_0x78ad('0x3f')]=[{'all':!![]}];}_0x52aa41=_[_0x78ad('0x3c')]({},_0x52aa41,_0x4cfe7d['options']);return db[_0x78ad('0x2b')][_0x78ad('0x47')](_0x52aa41)[_0x78ad('0x24')](handleEntityNotFound(_0x57a935,null))[_0x78ad('0x24')](function(_0x4eec4a){if(_0x4eec4a){var _0x148c93=_0x4eec4a[_0x78ad('0x48')]({'plain':!![]});_0x148c93=qs['omit'](_0x148c93,['id',_0x78ad('0x49'),_0x78ad('0x4a')]);_0x4cfe7d[_0x78ad('0x4b')]=_[_0x78ad('0x4c')](_0x4cfe7d[_0x78ad('0x4b')],['id',_0x78ad('0x49'),_0x78ad('0x4a')]);return db[_0x78ad('0x2b')][_0x78ad('0x4d')](_[_0x78ad('0x3c')](_0x148c93,_0x4cfe7d[_0x78ad('0x4b')]),{'include':_0x4cfe7d[_0x78ad('0x30')][_0x78ad('0x46')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x57a935,0xc9))[_0x78ad('0x40')](handleError(_0x57a935,null));};exports['update']=function(_0xd8287a,_0x5e2703){if(_0xd8287a[_0x78ad('0x4b')]['id']){delete _0xd8287a[_0x78ad('0x4b')]['id'];}return db['Attachment']['find']({'where':{'id':_0xd8287a[_0x78ad('0x45')]['id']}})[_0x78ad('0x24')](handleEntityNotFound(_0x5e2703,null))[_0x78ad('0x24')](saveUpdates(_0xd8287a[_0x78ad('0x4b')],null))[_0x78ad('0x24')](respondWithResult(_0x5e2703,null))[_0x78ad('0x40')](handleError(_0x5e2703,null));};exports[_0x78ad('0x25')]=function(_0x111072,_0x1f9f7b){return db[_0x78ad('0x2b')][_0x78ad('0x47')]({'where':{'id':_0x111072[_0x78ad('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f9f7b,null))[_0x78ad('0x24')](removeEntity(_0x1f9f7b,null))['catch'](handleError(_0x1f9f7b,null));};exports['create']=function(_0x452e38,_0x1f212b,_0x22e66e){_0x452e38[_0x78ad('0x4b')]['name']=_0x452e38[_0x78ad('0x4e')][_0x78ad('0x4f')];_0x452e38[_0x78ad('0x4b')][_0x78ad('0x50')]=_0x452e38['file']['filename'];_0x452e38[_0x78ad('0x4b')][_0x78ad('0x2d')]=_0x452e38[_0x78ad('0x4e')][_0x78ad('0x51')];return db['Attachment'][_0x78ad('0x4d')](_0x452e38['body'])['then'](respondWithResult(_0x1f212b,0xc9))[_0x78ad('0x40')](handleError(_0x1f212b,null));};exports[_0x78ad('0x52')]=function(_0x3496f2,_0x25f0c3,_0x2fb2dc){return db[_0x78ad('0x2b')][_0x78ad('0x53')]({'where':{'id':_0x3496f2[_0x78ad('0x45')]['id']},'raw':!![]})[_0x78ad('0x24')](handleEntityNotFound(_0x25f0c3,null))[_0x78ad('0x24')](function(_0x570279){if(_0x570279){var _0x554cf8=_0x570279[_0x78ad('0x54')]!==null;var _0x49921=path[_0x78ad('0x55')](config[_0x78ad('0x56')],_0x78ad('0x57'));if(_0x554cf8){_0x49921=path['join'](_0x49921,'offline-chat/');}var _0x3e51a4=path[_0x78ad('0x55')](_0x49921,_0x570279['basename']);return _0x25f0c3[_0x78ad('0x52')](_0x3e51a4);}})['catch'](handleError(_0x25f0c3,null));};
\ No newline at end of file
+var _0x21da=['order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','params','find','clone','createdAt','updatedAt','body','omit','destroy','create','file','originalname','basename','download','findOne','join','server/files/attachments/','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1d236b,_0x1ab689){var _0x4b48c7=function(_0x325b6f){while(--_0x325b6f){_0x1d236b['push'](_0x1d236b['shift']());}};_0x4b48c7(++_0x1ab689);}(_0x21da,0x126));var _0xa21d=function(_0xc03ff6,_0x3461d9){_0xc03ff6=_0xc03ff6-0x0;var _0x977a61=_0x21da[_0xc03ff6];return _0x977a61;};'use strict';var emlformat=require(_0xa21d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa21d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa21d('0x2'));var Mustache=require(_0xa21d('0x3'));var util=require(_0xa21d('0x4'));var path=require(_0xa21d('0x5'));var sox=require(_0xa21d('0x6'));var csv=require(_0xa21d('0x7'));var ejs=require(_0xa21d('0x8'));var fs=require('fs');var fs_extra=require(_0xa21d('0x9'));var _=require('lodash');var squel=require(_0xa21d('0xa'));var crypto=require('crypto');var jsforce=require(_0xa21d('0xb'));var deskjs=require(_0xa21d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa21d('0xd'));var Papa=require(_0xa21d('0xe'));var Redis=require(_0xa21d('0xf'));var authService=require(_0xa21d('0x10'));var qs=require(_0xa21d('0x11'));var as=require(_0xa21d('0x12'));var hardwareService=require(_0xa21d('0x13'));var logger=require(_0xa21d('0x14'))(_0xa21d('0x15'));var utils=require(_0xa21d('0x16'));var config=require(_0xa21d('0x17'));var licenseUtil=require(_0xa21d('0x18'));var db=require(_0xa21d('0x19'))['db'];function respondWithStatusCode(_0x58b319,_0x3df72b){_0x3df72b=_0x3df72b||0xcc;return function(_0x232360){if(_0x232360){return _0x58b319[_0xa21d('0x1a')](_0x3df72b);}return _0x58b319['status'](_0x3df72b)[_0xa21d('0x1b')]();};}function respondWithResult(_0x15d301,_0x1bcd57){_0x1bcd57=_0x1bcd57||0xc8;return function(_0x4b6688){if(_0x4b6688){return _0x15d301['status'](_0x1bcd57)[_0xa21d('0x1c')](_0x4b6688);}};}function respondWithFilteredResult(_0x4c5e44,_0x902c29){return function(_0xa7be47){if(_0xa7be47){var _0x49eeac=typeof _0x902c29[_0xa21d('0x1d')]===_0xa21d('0x1e')&&typeof _0x902c29['limit']===_0xa21d('0x1e');var _0x250f3=_0xa7be47['count'];var _0x5525ad=_0x49eeac?0x0:_0x902c29['offset'];var _0x5963f9=_0x49eeac?_0xa7be47[_0xa21d('0x1f')]:_0x902c29['offset']+_0x902c29[_0xa21d('0x20')];var _0x616491;if(_0x5963f9>=_0x250f3){_0x5963f9=_0x250f3;_0x616491=0xc8;}else{_0x616491=0xce;}_0x4c5e44[_0xa21d('0x21')](_0x616491);return _0x4c5e44[_0xa21d('0x22')](_0xa21d('0x23'),_0x5525ad+'-'+_0x5963f9+'/'+_0x250f3)[_0xa21d('0x1c')](_0xa7be47);}return null;};}function patchUpdates(_0x24f741){return function(_0x21c1b2){try{jsonpatch[_0xa21d('0x24')](_0x21c1b2,_0x24f741,!![]);}catch(_0x44a2c2){return BPromise['reject'](_0x44a2c2);}return _0x21c1b2['save']();};}function saveUpdates(_0x2da71d,_0x318ba9){return function(_0x1cfcb7){if(_0x1cfcb7){return _0x1cfcb7[_0xa21d('0x25')](_0x2da71d)[_0xa21d('0x26')](function(_0x3176a1){return _0x3176a1;});}return null;};}function removeEntity(_0x4b4a53,_0x279eae){return function(_0x392f25){if(_0x392f25){return _0x392f25['destroy']()[_0xa21d('0x26')](function(){_0x4b4a53[_0xa21d('0x21')](0xcc)[_0xa21d('0x1b')]();});}};}function handleEntityNotFound(_0x1c6ee6,_0xa7ddc9){return function(_0x30a02c){if(!_0x30a02c){_0x1c6ee6['sendStatus'](0x194);}return _0x30a02c;};}function handleError(_0x5048d3,_0x46f3d4){_0x46f3d4=_0x46f3d4||0x1f4;return function(_0x516044){logger[_0xa21d('0x27')](_0x516044[_0xa21d('0x28')]);if(_0x516044[_0xa21d('0x29')]){delete _0x516044[_0xa21d('0x29')];}_0x5048d3[_0xa21d('0x21')](_0x46f3d4)[_0xa21d('0x2a')](_0x516044);};}exports['index']=function(_0xa2b7d1,_0x18eb1d){var _0x50a69a={},_0x99a8e={},_0x175677={'count':0x0,'rows':[]};var _0x423dab=_['map'](db['Attachment'][_0xa21d('0x2b')],function(_0x5460a8){return{'name':_0x5460a8[_0xa21d('0x2c')],'type':_0x5460a8[_0xa21d('0x2d')][_0xa21d('0x2e')]};});_0x99a8e[_0xa21d('0x2f')]=_[_0xa21d('0x30')](_0x423dab,_0xa21d('0x29'));_0x99a8e[_0xa21d('0x31')]=_[_0xa21d('0x32')](_0xa2b7d1[_0xa21d('0x31')]);_0x99a8e[_0xa21d('0x33')]=_[_0xa21d('0x34')](_0x99a8e[_0xa21d('0x2f')],_0x99a8e[_0xa21d('0x31')]);_0x50a69a[_0xa21d('0x35')]=_[_0xa21d('0x34')](_0x99a8e[_0xa21d('0x2f')],qs[_0xa21d('0x36')](_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x36')]));_0x50a69a[_0xa21d('0x35')]=_0x50a69a[_0xa21d('0x35')][_0xa21d('0x37')]?_0x50a69a['attributes']:_0x99a8e[_0xa21d('0x2f')];if(!_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x38')](_0xa21d('0x39'))){_0x50a69a[_0xa21d('0x20')]=qs[_0xa21d('0x20')](_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x20')]);_0x50a69a[_0xa21d('0x1d')]=qs[_0xa21d('0x1d')](_0xa2b7d1[_0xa21d('0x31')]['offset']);}_0x50a69a[_0xa21d('0x3a')]=qs[_0xa21d('0x3b')](_0xa2b7d1['query']['sort']);_0x50a69a[_0xa21d('0x3c')]=qs['filters'](_[_0xa21d('0x3d')](_0xa2b7d1[_0xa21d('0x31')],_0x99a8e[_0xa21d('0x33')]),_0x423dab);if(_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x3e')]){_0x50a69a[_0xa21d('0x3c')]=_[_0xa21d('0x3f')](_0x50a69a[_0xa21d('0x3c')],{'$or':_[_0xa21d('0x30')](_0x423dab,function(_0x1945a7){if(_0x1945a7[_0xa21d('0x2d')]!==_0xa21d('0x40')){var _0x2f7a77={};_0x2f7a77[_0x1945a7[_0xa21d('0x29')]]={'$like':'%'+_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x3e')]+'%'};return _0x2f7a77;}})});}_0x50a69a=_[_0xa21d('0x3f')]({},_0x50a69a,_0xa2b7d1[_0xa21d('0x41')]);var _0x331c88={'where':_0x50a69a[_0xa21d('0x3c')]};return db[_0xa21d('0x42')][_0xa21d('0x1f')](_0x331c88)['then'](function(_0x57aa92){_0x175677[_0xa21d('0x1f')]=_0x57aa92;if(_0xa2b7d1[_0xa21d('0x31')][_0xa21d('0x43')]){_0x50a69a[_0xa21d('0x44')]=[{'all':!![]}];}return db[_0xa21d('0x42')][_0xa21d('0x45')](_0x50a69a);})[_0xa21d('0x26')](function(_0x10152b){_0x175677[_0xa21d('0x46')]=_0x10152b;return _0x175677;})[_0xa21d('0x26')](respondWithFilteredResult(_0x18eb1d,_0x50a69a))[_0xa21d('0x47')](handleError(_0x18eb1d,null));};exports['show']=function(_0x508ca9,_0x31bb3f){var _0x4138c3={'raw':!![],'where':{'id':_0x508ca9[_0xa21d('0x48')]['id']}},_0x482fa1={};_0x482fa1['model']=_[_0xa21d('0x32')](db[_0xa21d('0x42')][_0xa21d('0x2b')]);_0x482fa1[_0xa21d('0x31')]=_['keys'](_0x508ca9[_0xa21d('0x31')]);_0x482fa1[_0xa21d('0x33')]=_[_0xa21d('0x34')](_0x482fa1[_0xa21d('0x2f')],_0x482fa1[_0xa21d('0x31')]);_0x4138c3['attributes']=_['intersection'](_0x482fa1[_0xa21d('0x2f')],qs['fields'](_0x508ca9[_0xa21d('0x31')][_0xa21d('0x36')]));_0x4138c3[_0xa21d('0x35')]=_0x4138c3[_0xa21d('0x35')]['length']?_0x4138c3[_0xa21d('0x35')]:_0x482fa1['model'];if(_0x508ca9[_0xa21d('0x31')][_0xa21d('0x43')]){_0x4138c3[_0xa21d('0x44')]=[{'all':!![]}];}_0x4138c3=_['merge']({},_0x4138c3,_0x508ca9[_0xa21d('0x41')]);return db[_0xa21d('0x42')][_0xa21d('0x49')](_0x4138c3)[_0xa21d('0x26')](handleEntityNotFound(_0x31bb3f,null))[_0xa21d('0x26')](respondWithResult(_0x31bb3f,null))[_0xa21d('0x47')](handleError(_0x31bb3f,null));};exports[_0xa21d('0x4a')]=function(_0xd5f0d3,_0x16d66f){var _0x13c00c={'where':{'id':_0xd5f0d3[_0xa21d('0x48')]['id']}},_0x3b901e={};_0x3b901e[_0xa21d('0x2f')]=_[_0xa21d('0x32')](db[_0xa21d('0x42')][_0xa21d('0x2b')]);_0x13c00c[_0xa21d('0x35')]=_['intersection'](_0x3b901e[_0xa21d('0x2f')],qs[_0xa21d('0x36')](_0xd5f0d3[_0xa21d('0x31')]['fields']));_0x13c00c['attributes']=_0x13c00c[_0xa21d('0x35')]['length']?_0x13c00c[_0xa21d('0x35')]:_0x3b901e[_0xa21d('0x2f')];if(_0xd5f0d3['query'][_0xa21d('0x43')]){_0x13c00c[_0xa21d('0x44')]=[{'all':!![]}];}_0x13c00c=_[_0xa21d('0x3f')]({},_0x13c00c,_0xd5f0d3[_0xa21d('0x41')]);return db[_0xa21d('0x42')]['find'](_0x13c00c)['then'](handleEntityNotFound(_0x16d66f,null))[_0xa21d('0x26')](function(_0x481b53){if(_0x481b53){var _0x1da99a=_0x481b53['get']({'plain':!![]});_0x1da99a=qs['omit'](_0x1da99a,['id',_0xa21d('0x4b'),_0xa21d('0x4c')]);_0xd5f0d3[_0xa21d('0x4d')]=_[_0xa21d('0x4e')](_0xd5f0d3[_0xa21d('0x4d')],['id',_0xa21d('0x4b'),_0xa21d('0x4c')]);return db[_0xa21d('0x42')]['create'](_['merge'](_0x1da99a,_0xd5f0d3['body']),{'include':_0xd5f0d3['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x16d66f,0xc9))[_0xa21d('0x47')](handleError(_0x16d66f,null));};exports[_0xa21d('0x25')]=function(_0x18a898,_0x51ae4b){if(_0x18a898[_0xa21d('0x4d')]['id']){delete _0x18a898[_0xa21d('0x4d')]['id'];}return db[_0xa21d('0x42')]['find']({'where':{'id':_0x18a898[_0xa21d('0x48')]['id']}})['then'](handleEntityNotFound(_0x51ae4b,null))[_0xa21d('0x26')](saveUpdates(_0x18a898[_0xa21d('0x4d')],null))['then'](respondWithResult(_0x51ae4b,null))['catch'](handleError(_0x51ae4b,null));};exports[_0xa21d('0x4f')]=function(_0x1753e8,_0x1f5318){return db[_0xa21d('0x42')][_0xa21d('0x49')]({'where':{'id':_0x1753e8[_0xa21d('0x48')]['id']}})[_0xa21d('0x26')](handleEntityNotFound(_0x1f5318,null))[_0xa21d('0x26')](removeEntity(_0x1f5318,null))[_0xa21d('0x47')](handleError(_0x1f5318,null));};exports[_0xa21d('0x50')]=function(_0xb5a5c5,_0x441fce,_0x4190af){_0xb5a5c5['body']['name']=_0xb5a5c5[_0xa21d('0x51')][_0xa21d('0x52')];_0xb5a5c5[_0xa21d('0x4d')][_0xa21d('0x53')]=_0xb5a5c5['file']['filename'];_0xb5a5c5['body'][_0xa21d('0x2d')]=_0xb5a5c5[_0xa21d('0x51')]['mimetype'];return db[_0xa21d('0x42')][_0xa21d('0x50')](_0xb5a5c5[_0xa21d('0x4d')])['then'](respondWithResult(_0x441fce,0xc9))['catch'](handleError(_0x441fce,null));};exports[_0xa21d('0x54')]=function(_0x12148e,_0x378f36,_0x4abdf9){return db['Attachment'][_0xa21d('0x55')]({'where':{'id':_0x12148e[_0xa21d('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x378f36,null))['then'](function(_0x217f86){if(_0x217f86){var _0x506021=_0x217f86['ChatOfflineMessageId']!==null;var _0x5d2612=path[_0xa21d('0x56')](config['root'],_0xa21d('0x57'));if(_0x506021){_0x5d2612=path['join'](_0x5d2612,'offline-chat/');}var _0x16f652=path[_0xa21d('0x56')](_0x5d2612,_0x217f86[_0xa21d('0x53')]);return _0x378f36[_0xa21d('0x54')](_0x16f652);}})[_0xa21d('0x47')](handleError(_0x378f36,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index e52eed7..dc661ac 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 _0x1068=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4754df,_0x505290){var _0x2d61c0=function(_0x1b280f){while(--_0x1b280f){_0x4754df['push'](_0x4754df['shift']());}};_0x2d61c0(++_0x505290);}(_0x1068,0x14c));var _0x8106=function(_0x41b397,_0x53a516){_0x41b397=_0x41b397-0x0;var _0x2f7be6=_0x1068[_0x41b397];return _0x2f7be6;};'use strict';var _=require(_0x8106('0x0'));var util=require(_0x8106('0x1'));var logger=require(_0x8106('0x2'))(_0x8106('0x3'));var moment=require('moment');var BPromise=require(_0x8106('0x4'));var rp=require(_0x8106('0x5'));var fs=require('fs');var path=require(_0x8106('0x6'));var rimraf=require('rimraf');var config=require(_0x8106('0x7'));var attributes=require(_0x8106('0x8'));module[_0x8106('0x9')]=function(_0x1fdb72,_0x21399f){return _0x1fdb72[_0x8106('0xa')](_0x8106('0xb'),attributes,{'tableName':_0x8106('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0349=['path','../../config/environment','define','Attachment','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x37fa0e,_0x542ac5){var _0x21eb37=function(_0x54fe7f){while(--_0x54fe7f){_0x37fa0e['push'](_0x37fa0e['shift']());}};_0x21eb37(++_0x542ac5);}(_0x0349,0x1c7));var _0x9034=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x0349[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x9034('0x0'));var util=require(_0x9034('0x1'));var logger=require(_0x9034('0x2'))(_0x9034('0x3'));var moment=require(_0x9034('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9034('0x5'));var rimraf=require('rimraf');var config=require(_0x9034('0x6'));var attributes=require('./attachment.attributes');module['exports']=function(_0x5ed773,_0x38596c){return _0x5ed773[_0x9034('0x7')](_0x9034('0x8'),attributes,{'tableName':_0x9034('0x9'),'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 bc0f925..ca3e07e 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 _0xe3ee=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','body','options','raw','CreateAttachment','debug','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','then','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x2b5ef6,_0x47f0f1){var _0x3419aa=function(_0x228e96){while(--_0x228e96){_0x2b5ef6['push'](_0x2b5ef6['shift']());}};_0x3419aa(++_0x47f0f1);}(_0xe3ee,0x116));var _0xee3e=function(_0x5f281f,_0x856880){_0x5f281f=_0x5f281f-0x0;var _0xc2f03f=_0xe3ee[_0x5f281f];return _0xc2f03f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee3e('0x0'));var BPromise=require(_0xee3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee3e('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee3e('0x3'));var config=require('../../config/environment');var jayson=require(_0xee3e('0x4'));var client=jayson[_0xee3e('0x5')][_0xee3e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xd893ca,_0x42d135,_0x39a770){return new BPromise(function(_0x43ab67,_0x17fba1){return client['request'](_0xd893ca,_0x39a770)[_0xee3e('0x7')](function(_0x2f6153){logger['info'](_0xee3e('0x8'),_0x42d135,_0xee3e('0x9'));logger['debug'](_0xee3e('0xa'),_0x42d135,_0xee3e('0x9'),JSON[_0xee3e('0xb')](_0x2f6153));if(_0x2f6153[_0xee3e('0xc')]){if(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xd')]===0x1f4){logger[_0xee3e('0xc')](_0xee3e('0x8'),_0x42d135,_0x2f6153['error']['message']);return _0x17fba1(_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);}logger['error'](_0xee3e('0x8'),_0x42d135,_0x2f6153[_0xee3e('0xc')][_0xee3e('0xe')]);return _0x43ab67(_0x2f6153['error'][_0xee3e('0xe')]);}else{logger[_0xee3e('0xf')]('Attachment,\x20%s,\x20%s',_0x42d135,'request\x20sent');_0x43ab67(_0x2f6153[_0xee3e('0x10')][_0xee3e('0xe')]);}})[_0xee3e('0x11')](function(_0x512609){logger['error']('Attachment,\x20%s,\x20%s',_0x42d135,_0x512609);_0x17fba1(_0x512609);});});}exports['CreateAttachment']=function(_0x2589c0){var _0x23cd1f=this;return new Promise(function(_0x372605,_0x253530){return db[_0xee3e('0x12')]['create'](_0x2589c0[_0xee3e('0x13')],{'raw':_0x2589c0[_0xee3e('0x14')]?_0x2589c0[_0xee3e('0x14')][_0xee3e('0x15')]===undefined?!![]:![]:!![]})[_0xee3e('0x7')](function(_0x3b6d40){logger['info'](_0xee3e('0x16'),_0x2589c0);logger[_0xee3e('0x17')](_0xee3e('0x16'),_0x2589c0,JSON[_0xee3e('0xb')](_0x3b6d40));_0x372605(_0x3b6d40);})[_0xee3e('0x11')](function(_0xfbf279){logger[_0xee3e('0xc')](_0xee3e('0x16'),_0xfbf279[_0xee3e('0xe')],_0x2589c0);_0x253530(_0x23cd1f[_0xee3e('0xc')](0x1f4,_0xfbf279['message']));});});};
\ No newline at end of file
+var _0x78f0=['client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','body','options','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x248be5,_0x499d9c){var _0x4be9aa=function(_0x467c2f){while(--_0x467c2f){_0x248be5['push'](_0x248be5['shift']());}};_0x4be9aa(++_0x499d9c);}(_0x78f0,0x15d));var _0x078f=function(_0x210cae,_0x3607a0){_0x210cae=_0x210cae-0x0;var _0xe9f760=_0x78f0[_0x210cae];return _0xe9f760;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var moment=require(_0x078f('0x2'));var BPromise=require(_0x078f('0x3'));var rs=require(_0x078f('0x4'));var fs=require('fs');var Redis=require(_0x078f('0x5'));var db=require(_0x078f('0x6'))['db'];var utils=require(_0x078f('0x7'));var logger=require('../../config/logger')(_0x078f('0x8'));var config=require(_0x078f('0x9'));var jayson=require(_0x078f('0xa'));var client=jayson[_0x078f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x728cfe,_0x205510,_0x4a7db3){return new BPromise(function(_0x2ef013,_0x1901e3){return client[_0x078f('0xc')](_0x728cfe,_0x4a7db3)[_0x078f('0xd')](function(_0x7e87f){logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));logger['debug'](_0x078f('0x11'),_0x205510,_0x078f('0x10'),JSON['stringify'](_0x7e87f));if(_0x7e87f[_0x078f('0x12')]){if(_0x7e87f[_0x078f('0x12')][_0x078f('0x13')]===0x1f4){logger[_0x078f('0x12')]('Attachment,\x20%s,\x20%s',_0x205510,_0x7e87f['error'][_0x078f('0x14')]);return _0x1901e3(_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);}logger[_0x078f('0x12')]('Attachment,\x20%s,\x20%s',_0x205510,_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);return _0x2ef013(_0x7e87f['error'][_0x078f('0x14')]);}else{logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));_0x2ef013(_0x7e87f[_0x078f('0x15')][_0x078f('0x14')]);}})['catch'](function(_0x56bad2){logger[_0x078f('0x12')](_0x078f('0xf'),_0x205510,_0x56bad2);_0x1901e3(_0x56bad2);});});}exports[_0x078f('0x16')]=function(_0x19a182){var _0x201560=this;return new Promise(function(_0x25bb2d,_0xb8af8c){return db[_0x078f('0x17')][_0x078f('0x18')](_0x19a182[_0x078f('0x19')],{'raw':_0x19a182[_0x078f('0x1a')]?_0x19a182[_0x078f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x078f('0xd')](function(_0x52c74f){logger['info'](_0x078f('0x16'),_0x19a182);logger[_0x078f('0x1b')](_0x078f('0x16'),_0x19a182,JSON[_0x078f('0x1c')](_0x52c74f));_0x25bb2d(_0x52c74f);})[_0x078f('0x1d')](function(_0x2c6db4){logger[_0x078f('0x12')](_0x078f('0x16'),_0x2c6db4[_0x078f('0x14')],_0x19a182);_0xb8af8c(_0x201560['error'](0x1f4,_0x2c6db4[_0x078f('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index cb1e5b0..e1b02cb 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x34e250,_0x513da5){var _0x229bfa=function(_0x389967){while(--_0x389967){_0x34e250['push'](_0x34e250['shift']());}};_0x229bfa(++_0x513da5);}(_0x2032,0xd9));var _0x2203=function(_0x11771b,_0x54dc0d){_0x11771b=_0x11771b-0x0;var _0x20c501=_0x2032[_0x11771b];return _0x20c501;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0x0b0e[_0x230e39];return _0xa804e;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index ed5b7ec..10b3983 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 _0x4b20=['../../components/auth/service','../../config/environment','../../config/logger','api','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.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','then','name','role','disabled','blocked','blockedAt','agent','add','blockDuration','minutes','clearBlockUser','getLicense','catch','status','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','password','User','passport','passport-local','moment','activedirectory2','util','../../mysqldb'];(function(_0x51b3c6,_0x13bc82){var _0x5cbb1b=function(_0x25caa2){while(--_0x25caa2){_0x51b3c6['push'](_0x51b3c6['shift']());}};_0x5cbb1b(++_0x13bc82);}(_0x4b20,0x1c6));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x04b2('0x0'));var LocalStrategy=require(_0x04b2('0x1'))['Strategy'];var moment=require(_0x04b2('0x2'));var ActiveDirectory=require(_0x04b2('0x3'));var BPromise=require('bluebird');var util=require(_0x04b2('0x4'));var db=require(_0x04b2('0x5'))['db'];var authService=require(_0x04b2('0x6'));var utils=require('../../config/utils');var config=require(_0x04b2('0x7'));var logger=require(_0x04b2('0x8'))(_0x04b2('0x9'));function isActiveDirectoryConfigured(_0x3b4bbd){var _0x55352b=![];if(typeof _0x3b4bbd[_0x04b2('0xa')]!==_0x04b2('0xb')){_0x55352b=_0x3b4bbd[_0x04b2('0xa')][_0x04b2('0xc')]&&_0x3b4bbd[_0x04b2('0xa')][_0x04b2('0xd')]&&_0x3b4bbd[_0x04b2('0xa')][_0x04b2('0xe')];}return _0x55352b;}function adAuthenticate(_0x4962ca,_0x12e143,_0x43fac3){return new BPromise(function(_0x26e66f,_0x48e684){try{var _0x8f85bf=new ActiveDirectory(_0x4962ca);_0x8f85bf[_0x04b2('0xf')](_0x12e143,_0x43fac3,function(_0x4a8d79,_0x2c7595){if(_0x4a8d79){logger[_0x04b2('0x10')](_0x04b2('0x11'),_0x12e143,util[_0x04b2('0x12')](_0x4a8d79,{'showHidden':![],'depth':null}));_0x48e684(_0x04b2('0x13'));}else if(!_0x2c7595){logger[_0x04b2('0x10')](_0x04b2('0x14'),_0x12e143);_0x48e684(_0x04b2('0x13'));}else{_0x26e66f(_0x2c7595);}});}catch(_0x2bc915){_0x48e684(_0x2bc915);}});}function ActiveDirectoryAuthenticate(_0x4d7d73,_0x7e67e7,_0x4feadf,_0x1c5861){var _0x507b5d,_0x245d0b;if(!isActiveDirectoryConfigured(config)){logger[_0x04b2('0x10')](_0x04b2('0x15'),_0x7e67e7);return _0x1c5861(null,![],{'message':_0x04b2('0x13')});}return db[_0x04b2('0x16')][_0x04b2('0x17')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0x04b2('0x18')](function(_0xf9eebb){_0x507b5d=_0xf9eebb;if(!_0x507b5d['adSsoEnabled']){logger[_0x04b2('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x7e67e7);throw new Error(_0x04b2('0x13'));}return _0x4d7d73[_0x04b2('0x17')]({'logging':!![],'attributes':['id',_0x04b2('0x19'),'password','salt',_0x04b2('0x1a'),_0x04b2('0x1b'),_0x04b2('0x1c'),_0x04b2('0x1d'),'online'],'where':{'name':_0x7e67e7,'role':{'$or':['admin','user',_0x04b2('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x2f3256){if(!_0x2f3256||_0x2f3256&&_0x2f3256[_0x04b2('0x19')]!==_0x7e67e7){throw new Error(_0x04b2('0x13'));}_0x245d0b=_0x2f3256;var _0x1ca519=_0x245d0b[_0x04b2('0x19')]+'@'+config[_0x04b2('0xa')][_0x04b2('0xe')];return adAuthenticate(config[_0x04b2('0xa')],_0x1ca519,_0x4feadf);})[_0x04b2('0x18')](function(_0x2716ad){if(_0x245d0b['disabled']){throw new Error(_0x04b2('0x13'));}if(_0x507b5d['blockDuration']>0x0){if(_0x245d0b[_0x04b2('0x1c')]){if(moment(_0x245d0b[_0x04b2('0x1d')])[_0x04b2('0x1f')](_0x507b5d[_0x04b2('0x20')],_0x04b2('0x21'))>moment()){throw new Error(_0x04b2('0x13'));}return utils[_0x04b2('0x22')](_0x245d0b,0x0,![],null)[_0x04b2('0x18')](function(){return utils['getLicense'](_0x245d0b);})[_0x04b2('0x18')](function(){return _0x1c5861(null,_0x245d0b);});}else{return utils['getLicense'](_0x245d0b)[_0x04b2('0x18')](function(){return _0x1c5861(null,_0x245d0b);});}}else{return utils[_0x04b2('0x23')](_0x245d0b)[_0x04b2('0x18')](function(){return _0x1c5861(null,_0x245d0b);});}})[_0x04b2('0x24')](function(_0xb1b792){return _0x1c5861(null,![],_0xb1b792);});}function handleError(_0x3e0710,_0x7af90a,_0x436c63){return _0x3e0710[_0x04b2('0x25')](_0x7af90a||0x1f4)['send']({'message':_0x436c63?_0x436c63[_0x04b2('0x26')]||_0x436c63:''});}exports['login']=function(_0x129d24,_0x71fa5a,_0x52718b){passport[_0x04b2('0xf')](_0x04b2('0x27'),function(_0x57b80a,_0x32289e,_0x3c01e5){var _0x1f9fe6=_0x57b80a||_0x3c01e5;if(_0x1f9fe6){return handleError(_0x71fa5a,0x191,_0x1f9fe6);}if(!_0x32289e){return handleError(_0x71fa5a,0x194,{'message':_0x04b2('0x28')});}else{var _0x5e416e={'payload':{'id':_0x32289e['id'],'role':_0x32289e[_0x04b2('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x04b2('0x29')](_0x5e416e)['then'](function(_0x838303){_0x71fa5a[_0x04b2('0x2a')]({'id':_0x32289e['id'],'token':_0x838303,'statusCall':'','isAlreadyLogged':_0x32289e['online']});});}})(_0x129d24,_0x71fa5a,_0x52718b);};passport[_0x04b2('0x2b')](_0x04b2('0x27'),new LocalStrategy({'usernameField':'name','passwordField':_0x04b2('0x2c')},function(_0x1682bd,_0x4949fa,_0x5b7105){return ActiveDirectoryAuthenticate(db[_0x04b2('0x2d')],_0x1682bd,_0x4949fa,_0x5b7105);}));
\ No newline at end of file
+var _0xda8f=['online','admin','user','agent','disabled','add','minutes','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','User','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt'];(function(_0x57e6f5,_0x2e371f){var _0x59f71c=function(_0x5dde08){while(--_0x5dde08){_0x57e6f5['push'](_0x57e6f5['shift']());}};_0x59f71c(++_0x2e371f);}(_0xda8f,0xcc));var _0xfda8=function(_0x381db0,_0x5c1d55){_0x381db0=_0x381db0-0x0;var _0x59a3ef=_0xda8f[_0x381db0];return _0x59a3ef;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xfda8('0x0'));var ActiveDirectory=require(_0xfda8('0x1'));var BPromise=require(_0xfda8('0x2'));var util=require(_0xfda8('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0xfda8('0x4'));var utils=require(_0xfda8('0x5'));var config=require(_0xfda8('0x6'));var logger=require(_0xfda8('0x7'))(_0xfda8('0x8'));function isActiveDirectoryConfigured(_0x226bb1){var _0x10e0f7=![];if(typeof _0x226bb1[_0xfda8('0x9')]!==_0xfda8('0xa')){_0x10e0f7=_0x226bb1[_0xfda8('0x9')][_0xfda8('0xb')]&&_0x226bb1['activedirectory'][_0xfda8('0xc')]&&_0x226bb1[_0xfda8('0x9')][_0xfda8('0xd')];}return _0x10e0f7;}function adAuthenticate(_0x16e651,_0x206258,_0x470109){return new BPromise(function(_0x185999,_0x51fa1c){try{var _0x405ef3=new ActiveDirectory(_0x16e651);_0x405ef3[_0xfda8('0xe')](_0x206258,_0x470109,function(_0x3992a6,_0x1ed5d1){if(_0x3992a6){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x206258,util[_0xfda8('0xf')](_0x3992a6,{'showHidden':![],'depth':null}));_0x51fa1c(_0xfda8('0x10'));}else if(!_0x1ed5d1){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x206258);_0x51fa1c(_0xfda8('0x10'));}else{_0x185999(_0x1ed5d1);}});}catch(_0x50fe08){_0x51fa1c(_0x50fe08);}});}function ActiveDirectoryAuthenticate(_0x2024a7,_0x6546cd,_0x55502b,_0x51ea64){var _0x2f0ff4,_0x32e963;if(!isActiveDirectoryConfigured(config)){logger[_0xfda8('0x11')](_0xfda8('0x12'),_0x6546cd);return _0x51ea64(null,![],{'message':_0xfda8('0x10')});}return db[_0xfda8('0x13')][_0xfda8('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xfda8('0x15')],'raw':!![]})[_0xfda8('0x16')](function(_0x4da15c){_0x2f0ff4=_0x4da15c;if(!_0x2f0ff4[_0xfda8('0x17')]){logger[_0xfda8('0x11')](_0xfda8('0x18'),_0x6546cd);throw new Error(_0xfda8('0x10'));}return _0x2024a7[_0xfda8('0x14')]({'logging':!![],'attributes':['id',_0xfda8('0x19'),_0xfda8('0x1a'),_0xfda8('0x1b'),_0xfda8('0x1c'),'disabled',_0xfda8('0x1d'),_0xfda8('0x1e'),_0xfda8('0x1f')],'where':{'name':_0x6546cd,'role':{'$or':[_0xfda8('0x20'),_0xfda8('0x21'),_0xfda8('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x5c3ac4){if(!_0x5c3ac4||_0x5c3ac4&&_0x5c3ac4[_0xfda8('0x19')]!==_0x6546cd){throw new Error(_0xfda8('0x10'));}_0x32e963=_0x5c3ac4;var _0x40fd00=_0x32e963['name']+'@'+config['activedirectory'][_0xfda8('0xd')];return adAuthenticate(config['activedirectory'],_0x40fd00,_0x55502b);})['then'](function(_0x434ab1){if(_0x32e963[_0xfda8('0x23')]){throw new Error(_0xfda8('0x10'));}if(_0x2f0ff4['blockDuration']>0x0){if(_0x32e963['blocked']){if(moment(_0x32e963[_0xfda8('0x1e')])[_0xfda8('0x24')](_0x2f0ff4[_0xfda8('0x15')],_0xfda8('0x25'))>moment()){throw new Error(_0xfda8('0x10'));}return utils[_0xfda8('0x26')](_0x32e963,0x0,![],null)['then'](function(){return utils[_0xfda8('0x27')](_0x32e963);})[_0xfda8('0x16')](function(){return _0x51ea64(null,_0x32e963);});}else{return utils[_0xfda8('0x27')](_0x32e963)['then'](function(){return _0x51ea64(null,_0x32e963);});}}else{return utils[_0xfda8('0x27')](_0x32e963)[_0xfda8('0x16')](function(){return _0x51ea64(null,_0x32e963);});}})[_0xfda8('0x28')](function(_0x4d2a96){return _0x51ea64(null,![],_0x4d2a96);});}function handleError(_0x3171dc,_0x490929,_0x3d44d0){return _0x3171dc[_0xfda8('0x29')](_0x490929||0x1f4)[_0xfda8('0x2a')]({'message':_0x3d44d0?_0x3d44d0['message']||_0x3d44d0:''});}exports['login']=function(_0x24063a,_0x1ee5e5,_0x4ef602){passport[_0xfda8('0xe')](_0xfda8('0x2b'),function(_0xab467f,_0x62c269,_0x2a9c5f){var _0x5a9212=_0xab467f||_0x2a9c5f;if(_0x5a9212){return handleError(_0x1ee5e5,0x191,_0x5a9212);}if(!_0x62c269){return handleError(_0x1ee5e5,0x194,{'message':_0xfda8('0x2c')});}else{var _0x50724e={'payload':{'id':_0x62c269['id'],'role':_0x62c269[_0xfda8('0x1c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x50724e)['then'](function(_0xce4216){_0x1ee5e5[_0xfda8('0x2d')]({'id':_0x62c269['id'],'token':_0xce4216,'statusCall':'','isAlreadyLogged':_0x62c269[_0xfda8('0x1f')]});});}})(_0x24063a,_0x1ee5e5,_0x4ef602);};passport['use'](_0xfda8('0x2b'),new LocalStrategy({'usernameField':_0xfda8('0x19'),'passwordField':_0xfda8('0x1a')},function(_0x2adbe3,_0x4a36cf,_0x5b83d5){return ActiveDirectoryAuthenticate(db[_0xfda8('0x2e')],_0x2adbe3,_0x4a36cf,_0x5b83d5);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index f0d3ccc..140bf8f 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 _0xda46=['login','exports','Router','./authActiveDirectory.controller','post'];(function(_0xd73d53,_0x598443){var _0x560148=function(_0x3c8918){while(--_0x3c8918){_0xd73d53['push'](_0xd73d53['shift']());}};_0x560148(++_0x598443);}(_0xda46,0x7f));var _0x6da4=function(_0x5555ad,_0x70e0a8){_0x5555ad=_0x5555ad-0x0;var _0x8628d4=_0xda46[_0x5555ad];return _0x8628d4;};'use strict';var express=require('express');var router=express[_0x6da4('0x0')]();var controller=require(_0x6da4('0x1'));router[_0x6da4('0x2')]('/',controller[_0x6da4('0x3')]);module[_0x6da4('0x4')]=router;
\ No newline at end of file
+var _0xa55f=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa55f,0x16e));var _0xfa55=function(_0x548a22,_0x266250){_0x548a22=_0x548a22-0x0;var _0x4644b0=_0xa55f[_0x548a22];return _0x4644b0;};'use strict';var express=require('express');var router=express[_0xfa55('0x0')]();var controller=require(_0xfa55('0x1'));router[_0xfa55('0x2')]('/',controller[_0xfa55('0x3')]);module[_0xfa55('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 bd5e97d..a854d0e 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(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x7a54,0x106));var _0x47a5=function(_0xcd9c13,_0x5cb1bc){_0xcd9c13=_0xcd9c13-0x0;var _0x5b9bf3=_0x7a54[_0xcd9c13];return _0x5b9bf3;};'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 _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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7a54,0x106));var _0x47a5=function(_0x3416b2,_0x1e29d8){_0x3416b2=_0x3416b2-0x0;var _0x10c02d=_0x7a54[_0x3416b2];return _0x10c02d;};'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
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index e7592dc..1d1a039 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 _0x970a=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x25b6f4,_0x282647){var _0x9bda9c=function(_0x595721){while(--_0x595721){_0x25b6f4['push'](_0x25b6f4['shift']());}};_0x9bda9c(++_0x282647);}(_0x970a,0xee));var _0xa970=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x970a[_0x59ee6f];return _0x4c0979;};'use strict';var express=require(_0xa970('0x0'));var passport=require(_0xa970('0x1'));var router=express[_0xa970('0x2')]();var controller=require(_0xa970('0x3'));var userController=require(_0xa970('0x4'));var authService=require(_0xa970('0x5'));router[_0xa970('0x6')]('/',controller[_0xa970('0x7')]);router[_0xa970('0x6')](_0xa970('0x8'),controller[_0xa970('0x9')],authService[_0xa970('0xa')],userController[_0xa970('0x7')],authService[_0xa970('0xb')]);module[_0xa970('0xc')]=router;
\ No newline at end of file
+var _0xf760=['../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x304d7e,_0x5cafcc){var _0x54e806=function(_0x1c6beb){while(--_0x1c6beb){_0x304d7e['push'](_0x304d7e['shift']());}};_0x54e806(++_0x5cafcc);}(_0xf760,0x1ab));var _0x0f76=function(_0x241c6a,_0x2531e4){_0x241c6a=_0x241c6a-0x0;var _0x13b613=_0xf760[_0x241c6a];return _0x13b613;};'use strict';var express=require('express');var passport=require(_0x0f76('0x0'));var router=express[_0x0f76('0x1')]();var controller=require(_0x0f76('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x0f76('0x3'));router[_0x0f76('0x4')]('/',controller[_0x0f76('0x5')]);router['get'](_0x0f76('0x6'),controller['callback'],authService[_0x0f76('0x7')],userController[_0x0f76('0x5')],authService[_0x0f76('0x8')]);module[_0x0f76('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index fd1bac0..54881e0 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 _0xa584=['getSmtpOptions','merge','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x20f605,_0x10e384){var _0x328e57=function(_0x490438){while(--_0x490438){_0x20f605['push'](_0x20f605['shift']());}};_0x328e57(++_0x10e384);}(_0xa584,0x17c));var _0x4a58=function(_0x47215c,_0x87a489){_0x47215c=_0x47215c-0x0;var _0x2d0f7c=_0xa584[_0x47215c];return _0x2d0f7c;};'use strict';var util=require(_0x4a58('0x0'));var passport=require(_0x4a58('0x1'));var LocalStrategy=require(_0x4a58('0x2'))['Strategy'];var jayson=require(_0x4a58('0x3'));var _=require(_0x4a58('0x4'));var rs=require(_0x4a58('0x5'));var moment=require('moment');var db=require(_0x4a58('0x6'))['db'];var authService=require(_0x4a58('0x7'));var utils=require('../../config/utils');var client=jayson[_0x4a58('0x8')][_0x4a58('0x9')]({'port':0x232b});function localAuthenticate(_0x456caf,_0x1515b3,_0x5c0520,_0x363759){var _0x2a0689,_0x31b387;return db[_0x4a58('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x4a58('0xb'),_0x4a58('0xc')],'raw':!![]})[_0x4a58('0xd')](function(_0x5b6ea8){_0x2a0689=_0x5b6ea8;return _0x456caf[_0x4a58('0xe')]({'attributes':['id','name',_0x4a58('0xf'),_0x4a58('0x10'),_0x4a58('0x11'),_0x4a58('0x12'),'blocked',_0x4a58('0x13'),'loginAttempts'],'where':{'name':_0x1515b3,'role':{'$or':[_0x4a58('0x14'),_0x4a58('0x15'),_0x4a58('0x16')]}}});})[_0x4a58('0xd')](function(_0x2ea28d){if(!_0x2ea28d||_0x2ea28d&&_0x2ea28d[_0x4a58('0x17')]!==_0x1515b3){throw new Error(_0x4a58('0x18'));}else{_0x31b387=_0x2ea28d;return _0x31b387;}})['then'](function(){_0x31b387[_0x4a58('0x19')](_0x5c0520,function(_0x448170,_0x1550a8){var _0x21414b=_0x31b387[_0x4a58('0x1a')]+0x1;if(_0x448170){return _0x363759(_0x448170);}else if(!_0x1550a8){if(_0x31b387['disabled']){return _0x363759(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2a0689[_0x4a58('0xb')]>0x0){if(_0x31b387[_0x4a58('0x1b')]){if(_0x2a0689['blockDuration']>0x0){if(moment(_0x31b387[_0x4a58('0x13')])[_0x4a58('0x1c')](_0x2a0689[_0x4a58('0xc')],_0x4a58('0x1d'))>moment()){return _0x363759(null,![],{'message':_0x4a58('0x18')});}else{return utils[_0x4a58('0x1e')](_0x31b387,_0x21414b,![],null)[_0x4a58('0xd')](function(){return _0x363759(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x363759(null,![],{'message':_0x4a58('0x18')});}}else{if(_0x21414b>=_0x2a0689[_0x4a58('0xb')]){return utils['clearBlockUser'](_0x31b387,0x0,!![],moment())[_0x4a58('0xd')](function(){return _0x363759(null,![],{'message':_0x4a58('0x18')});});}else{return utils[_0x4a58('0x1e')](_0x31b387,_0x21414b,![],null)['then'](function(){return _0x363759(null,![],{'message':_0x4a58('0x18')});});}}}else{return _0x363759(null,![],{'message':_0x4a58('0x18')});}}else{if(_0x31b387[_0x4a58('0x12')]){return _0x363759(null,![],{'message':_0x4a58('0x18')});}else if(_0x2a0689[_0x4a58('0xb')]>0x0){if(_0x31b387['blocked']){if(_0x2a0689[_0x4a58('0xc')]>0x0){if(moment(_0x31b387[_0x4a58('0x13')])[_0x4a58('0x1c')](_0x2a0689[_0x4a58('0xc')],_0x4a58('0x1d'))>moment()){return _0x363759(null,![],{'message':_0x4a58('0x18')});}else{return utils['clearBlockUser'](_0x31b387,0x0,![],null)[_0x4a58('0xd')](function(){return utils[_0x4a58('0x1f')](_0x31b387);})[_0x4a58('0xd')](function(){return _0x363759(null,_0x31b387);});}}else{return _0x363759(null,![],{'message':_0x4a58('0x18')});}}else{return utils[_0x4a58('0x1e')](_0x31b387,0x0,![],null)[_0x4a58('0xd')](function(){return utils[_0x4a58('0x1f')](_0x31b387);})[_0x4a58('0xd')](function(){return _0x363759(null,_0x31b387);})[_0x4a58('0x20')](function(_0x32473c){return _0x363759(null,![],_0x32473c);});}}else{if(_0x31b387[_0x4a58('0x1b')]){return _0x363759(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4a58('0x1f')](_0x31b387)[_0x4a58('0xd')](function(){return _0x363759(null,_0x31b387);});}}}});})[_0x4a58('0x20')](function(_0x1d9411){return _0x363759(null,![],_0x1d9411);});}function sendServiceMail(_0x5ae182){return db[_0x4a58('0x21')][_0x4a58('0x22')]({'where':{'service':!![]},'attributes':['id','name',_0x4a58('0x23')],'include':[{'model':db[_0x4a58('0x24')],'as':_0x4a58('0x25'),'include':[{'model':db[_0x4a58('0x26')],'as':'CloudProvider'}]}]})[_0x4a58('0xd')](function(_0x550b04){if(!_0x550b04){throw new Error(_0x4a58('0x27'));}var _0x9b59fa=_0x550b04[_0x4a58('0x28')]();var _0x3962db={'account':_0x9b59fa,'message':_[_0x4a58('0x29')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x550b04[_0x4a58('0x17')],_0x550b04[_0x4a58('0x23')]||_0x550b04[_0x4a58('0x25')][_0x4a58('0x15')])},_0x5ae182)};return client['request']('SendMail',_0x3962db);})[_0x4a58('0xd')](function(_0x10c09d){if(_0x10c09d[_0x4a58('0x2a')]){throw new Error(util[_0x4a58('0x2b')](_0x4a58('0x2c'),_0x10c09d['error'][_0x4a58('0x2d')]||JSON[_0x4a58('0x2e')](_0x10c09d[_0x4a58('0x2a')])));}return!![];});}function handleError(_0x2fba9f,_0x1ff9c9,_0x2a6e84){return _0x2fba9f[_0x4a58('0x2f')](_0x1ff9c9||0x1f4)[_0x4a58('0x30')]({'message':_0x2a6e84?_0x2a6e84[_0x4a58('0x2d')]||_0x2a6e84:''});}exports['login']=function(_0x1bfc14,_0x2fa861,_0x1e9733){passport[_0x4a58('0x19')]('local-login',function(_0x22813a,_0x71b182,_0xa2c094){var _0x37ebf6=_0x22813a||_0xa2c094;if(_0x37ebf6){return handleError(_0x2fa861,0x191,_0x37ebf6);}if(!_0x71b182){return handleError(_0x2fa861,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x22e528={'payload':{'id':_0x71b182['id'],'role':_0x71b182[_0x4a58('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x22e528)[_0x4a58('0xd')](function(_0x55a4b4){_0x2fa861[_0x4a58('0x31')]({'id':_0x71b182['id'],'token':_0x55a4b4,'statusCall':'','isAlreadyLogged':_0x71b182[_0x4a58('0x32')]});});}})(_0x1bfc14,_0x2fa861,_0x1e9733);};exports[_0x4a58('0x33')]=function(_0x3cf8fd,_0x46812e){if(!_0x3cf8fd[_0x4a58('0x34')]['email']){return handleError(_0x46812e,0x1f4,{'message':_0x4a58('0x35')});}var _0x14fb7e=rs['generate']();_0x3cf8fd[_0x4a58('0x34')]['email']=_0x3cf8fd[_0x4a58('0x34')][_0x4a58('0x23')][_0x4a58('0x36')]()[_0x4a58('0x37')]();var _0x5841e1;return db[_0x4a58('0xa')][_0x4a58('0xe')]({'where':{'id':0x1},'attributes':[_0x4a58('0xb'),_0x4a58('0xc')],'raw':!![]})[_0x4a58('0xd')](function(_0x558c19){_0x5841e1=_0x558c19;return db[_0x4a58('0x38')][_0x4a58('0x22')]({'where':{'email':_0x3cf8fd['body']['email']}});})[_0x4a58('0xd')](function(_0xec260f){if(!_0xec260f){throw new Error(_0x4a58('0x39'));}if(_0xec260f['disabled']){throw new Error(_0x4a58('0x3a'));}if(_0xec260f[_0x4a58('0x1b')]){if(moment(_0xec260f[_0x4a58('0x13')])[_0x4a58('0x1c')](_0x5841e1[_0x4a58('0xc')],_0x4a58('0x1d'))>moment()){throw new Error(_0x4a58('0x3b'));}else{_0xec260f[_0x4a58('0x1b')]=![];_0xec260f['blockedAt']=null;}}_0xec260f['resetPasswordToken']=_0x14fb7e;_0xec260f[_0x4a58('0x3c')]=Date[_0x4a58('0x3d')]()+0x36ee80;return _0xec260f['save']();})[_0x4a58('0xd')](function(){return sendServiceMail({'to':_0x3cf8fd[_0x4a58('0x34')][_0x4a58('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x4a58('0x3e')+_0x4a58('0x3f')+_0x4a58('0x40')+_0x3cf8fd[_0x4a58('0x41')][_0x4a58('0x42')]+_0x4a58('0x43')+_0x14fb7e+'\x0a\x0a'+_0x4a58('0x44')});})[_0x4a58('0xd')](function(){_0x46812e[_0x4a58('0x2f')](0xc8)[_0x4a58('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x4a58('0x20')](function(_0x1a57e9){return handleError(_0x46812e,0x1f4,_0x1a57e9);});};exports[_0x4a58('0x45')]=function(_0x1d81f1,_0x52404c){return db[_0x4a58('0x38')]['find']({'where':{'resetPasswordToken':_0x1d81f1[_0x4a58('0x46')][_0x4a58('0x47')],'resetPasswordExpires':{'$gt':Date[_0x4a58('0x3d')]()}}})[_0x4a58('0xd')](function(_0x1af49e){if(!_0x1af49e){throw new Error(_0x4a58('0x48'));}return db[_0x4a58('0xa')][_0x4a58('0xe')]({'attributes':['id',_0x4a58('0x49'),_0x4a58('0x4a'),_0x4a58('0x4b')]})['then'](function(_0x3ea89a){if(_0x3ea89a[_0x4a58('0x49')])authService[_0x4a58('0x4c')](_0x1d81f1['body'][_0x4a58('0xf')]);if(!_0x3ea89a[_0x4a58('0x4a')]||!_0x1af49e[_0x4a58('0x4d')])return _0x1af49e;authService[_0x4a58('0x4e')](_0x1d81f1['body'][_0x4a58('0xf')],_0x1af49e['previousPasswords'],_0x3ea89a[_0x4a58('0x4b')]);return _0x1af49e;})[_0x4a58('0xd')](function(){_0x1af49e['password']=_0x1d81f1[_0x4a58('0x34')]['password'];_0x1af49e[_0x4a58('0x4f')]=null;_0x1af49e['resetPasswordExpires']=null;return _0x1af49e[_0x4a58('0x50')]();});})[_0x4a58('0xd')](function(){_0x52404c['status'](0xc8)['send']({'message':_0x4a58('0x51')});})[_0x4a58('0x20')](function(_0xe9b0f7){return handleError(_0x52404c,0x1f4,_0xe9b0f7);});};passport[_0x4a58('0x52')](_0x4a58('0x53'),new LocalStrategy({'usernameField':_0x4a58('0x17'),'passwordField':_0x4a58('0xf')},function(_0x5c18ad,_0x31df25,_0x48eb47){return localAuthenticate(db[_0x4a58('0x38')],_0x5c18ad,_0x31df25,_0x48eb47);}));
\ No newline at end of file
+var _0x07c8=['find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','add','blockDuration','minutes','clearBlockUser','getLicense','catch'];(function(_0xf11a42,_0x210fdc){var _0x25f6d2=function(_0x243357){while(--_0x243357){_0xf11a42['push'](_0xf11a42['shift']());}};_0x25f6d2(++_0x210fdc);}(_0x07c8,0x7d));var _0x807c=function(_0x3a5269,_0x10e45a){_0x3a5269=_0x3a5269-0x0;var _0x446ed7=_0x07c8[_0x3a5269];return _0x446ed7;};'use strict';var util=require(_0x807c('0x0'));var passport=require(_0x807c('0x1'));var LocalStrategy=require('passport-local')[_0x807c('0x2')];var jayson=require(_0x807c('0x3'));var _=require(_0x807c('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x807c('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x807c('0x6'));var client=jayson[_0x807c('0x7')][_0x807c('0x8')]({'port':0x232b});function localAuthenticate(_0x5c84d1,_0x111980,_0x557381,_0x2a1ca3){var _0x158794,_0x7f3d05;return db[_0x807c('0x9')][_0x807c('0xa')]({'where':{'id':0x1},'attributes':[_0x807c('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x20b279){_0x158794=_0x20b279;return _0x5c84d1['findOne']({'attributes':['id','name','password',_0x807c('0xc'),'role',_0x807c('0xd'),_0x807c('0xe'),_0x807c('0xf'),_0x807c('0x10')],'where':{'name':_0x111980,'role':{'$or':[_0x807c('0x11'),_0x807c('0x12'),_0x807c('0x13')]}}});})['then'](function(_0x527311){if(!_0x527311||_0x527311&&_0x527311[_0x807c('0x14')]!==_0x111980){throw new Error(_0x807c('0x15'));}else{_0x7f3d05=_0x527311;return _0x7f3d05;}})[_0x807c('0x16')](function(){_0x7f3d05['authenticate'](_0x557381,function(_0x161799,_0x857022){var _0x5642dc=_0x7f3d05[_0x807c('0x10')]+0x1;if(_0x161799){return _0x2a1ca3(_0x161799);}else if(!_0x857022){if(_0x7f3d05['disabled']){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x158794[_0x807c('0xb')]>0x0){if(_0x7f3d05[_0x807c('0xe')]){if(_0x158794['blockDuration']>0x0){if(moment(_0x7f3d05[_0x807c('0xf')])[_0x807c('0x17')](_0x158794[_0x807c('0x18')],_0x807c('0x19'))>moment()){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}else{return utils[_0x807c('0x1a')](_0x7f3d05,_0x5642dc,![],null)[_0x807c('0x16')](function(){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});});}}else{return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}}else{if(_0x5642dc>=_0x158794['allowedLoginAttempts']){return utils[_0x807c('0x1a')](_0x7f3d05,0x0,!![],moment())['then'](function(){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});});}else{return utils[_0x807c('0x1a')](_0x7f3d05,_0x5642dc,![],null)['then'](function(){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}}else{if(_0x7f3d05[_0x807c('0xd')]){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x158794['allowedLoginAttempts']>0x0){if(_0x7f3d05[_0x807c('0xe')]){if(_0x158794[_0x807c('0x18')]>0x0){if(moment(_0x7f3d05['blockedAt'])['add'](_0x158794['blockDuration'],_0x807c('0x19'))>moment()){return _0x2a1ca3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x7f3d05,0x0,![],null)[_0x807c('0x16')](function(){return utils[_0x807c('0x1b')](_0x7f3d05);})['then'](function(){return _0x2a1ca3(null,_0x7f3d05);});}}else{return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}}else{return utils['clearBlockUser'](_0x7f3d05,0x0,![],null)[_0x807c('0x16')](function(){return utils[_0x807c('0x1b')](_0x7f3d05);})[_0x807c('0x16')](function(){return _0x2a1ca3(null,_0x7f3d05);})[_0x807c('0x1c')](function(_0x49dcf1){return _0x2a1ca3(null,![],_0x49dcf1);});}}else{if(_0x7f3d05[_0x807c('0xe')]){return _0x2a1ca3(null,![],{'message':_0x807c('0x15')});}else{return utils['getLicense'](_0x7f3d05)[_0x807c('0x16')](function(){return _0x2a1ca3(null,_0x7f3d05);});}}}});})[_0x807c('0x1c')](function(_0x2417e5){return _0x2a1ca3(null,![],_0x2417e5);});}function sendServiceMail(_0x9151c7){return db['MailAccount'][_0x807c('0x1d')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x807c('0x1e')],'as':_0x807c('0x1f'),'include':[{'model':db[_0x807c('0x20')],'as':_0x807c('0x20')}]}]})[_0x807c('0x16')](function(_0x1ed059){if(!_0x1ed059){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x376b6f=_0x1ed059[_0x807c('0x21')]();var _0x278c0c={'account':_0x376b6f,'message':_[_0x807c('0x22')]({'from':util['format'](_0x807c('0x23'),_0x1ed059['name'],_0x1ed059[_0x807c('0x24')]||_0x1ed059[_0x807c('0x1f')]['user'])},_0x9151c7)};return client[_0x807c('0x25')]('SendMail',_0x278c0c);})[_0x807c('0x16')](function(_0x19c05c){if(_0x19c05c[_0x807c('0x26')]){throw new Error(util['format'](_0x807c('0x27'),_0x19c05c[_0x807c('0x26')][_0x807c('0x28')]||JSON[_0x807c('0x29')](_0x19c05c[_0x807c('0x26')])));}return!![];});}function handleError(_0xa20f56,_0x2d651a,_0x20672a){return _0xa20f56[_0x807c('0x2a')](_0x2d651a||0x1f4)[_0x807c('0x2b')]({'message':_0x20672a?_0x20672a[_0x807c('0x28')]||_0x20672a:''});}exports[_0x807c('0x2c')]=function(_0x15efdd,_0x1662db,_0xc561e6){passport[_0x807c('0x2d')](_0x807c('0x2e'),function(_0x1af642,_0x1413ed,_0x20862f){var _0x56c6a6=_0x1af642||_0x20862f;if(_0x56c6a6){return handleError(_0x1662db,0x191,_0x56c6a6);}if(!_0x1413ed){return handleError(_0x1662db,0x194,{'message':_0x807c('0x2f')});}else{var _0x225781={'payload':{'id':_0x1413ed['id'],'role':_0x1413ed['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x225781)[_0x807c('0x16')](function(_0x10f7b8){_0x1662db[_0x807c('0x30')]({'id':_0x1413ed['id'],'token':_0x10f7b8,'statusCall':'','isAlreadyLogged':_0x1413ed['online']});});}})(_0x15efdd,_0x1662db,_0xc561e6);};exports['forgot']=function(_0x1e1256,_0x11a473){if(!_0x1e1256[_0x807c('0x31')][_0x807c('0x24')]){return handleError(_0x11a473,0x1f4,{'message':_0x807c('0x32')});}var _0x10bf0a=rs[_0x807c('0x33')]();_0x1e1256['body'][_0x807c('0x24')]=_0x1e1256[_0x807c('0x31')][_0x807c('0x24')][_0x807c('0x34')]()['toLowerCase']();var _0x4e2295;return db[_0x807c('0x9')][_0x807c('0xa')]({'where':{'id':0x1},'attributes':[_0x807c('0xb'),_0x807c('0x18')],'raw':!![]})[_0x807c('0x16')](function(_0x42b1a8){_0x4e2295=_0x42b1a8;return db[_0x807c('0x35')][_0x807c('0x1d')]({'where':{'email':_0x1e1256[_0x807c('0x31')][_0x807c('0x24')]}});})['then'](function(_0x1b0347){if(!_0x1b0347){throw new Error(_0x807c('0x36'));}if(_0x1b0347['disabled']){throw new Error(_0x807c('0x37'));}if(_0x1b0347[_0x807c('0xe')]){if(moment(_0x1b0347[_0x807c('0xf')])[_0x807c('0x17')](_0x4e2295[_0x807c('0x18')],'minutes')>moment()){throw new Error(_0x807c('0x38'));}else{_0x1b0347[_0x807c('0xe')]=![];_0x1b0347['blockedAt']=null;}}_0x1b0347['resetPasswordToken']=_0x10bf0a;_0x1b0347[_0x807c('0x39')]=Date[_0x807c('0x3a')]()+0x36ee80;return _0x1b0347[_0x807c('0x3b')]();})[_0x807c('0x16')](function(){return sendServiceMail({'to':_0x1e1256[_0x807c('0x31')][_0x807c('0x24')],'subject':_0x807c('0x3c'),'text':_0x807c('0x3d')+_0x807c('0x3e')+_0x807c('0x3f')+_0x1e1256['headers'][_0x807c('0x40')]+_0x807c('0x41')+_0x10bf0a+'\x0a\x0a'+_0x807c('0x42')});})[_0x807c('0x16')](function(){_0x11a473['status'](0xc8)[_0x807c('0x2b')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x2a2ff0){return handleError(_0x11a473,0x1f4,_0x2a2ff0);});};exports['reset']=function(_0x2f5b44,_0x4687f5){return db[_0x807c('0x35')][_0x807c('0x1d')]({'where':{'resetPasswordToken':_0x2f5b44[_0x807c('0x43')][_0x807c('0x44')],'resetPasswordExpires':{'$gt':Date[_0x807c('0x3a')]()}}})[_0x807c('0x16')](function(_0x2c0647){if(!_0x2c0647){throw new Error(_0x807c('0x45'));}return db[_0x807c('0x9')][_0x807c('0xa')]({'attributes':['id',_0x807c('0x46'),_0x807c('0x47'),_0x807c('0x48')]})[_0x807c('0x16')](function(_0x52512a){if(_0x52512a[_0x807c('0x46')])authService['validatePasswordPattern'](_0x2f5b44[_0x807c('0x31')][_0x807c('0x49')]);if(!_0x52512a[_0x807c('0x47')]||!_0x2c0647[_0x807c('0x4a')])return _0x2c0647;authService['validatePasswordHistory'](_0x2f5b44[_0x807c('0x31')][_0x807c('0x49')],_0x2c0647['previousPasswords'],_0x52512a[_0x807c('0x48')]);return _0x2c0647;})['then'](function(){_0x2c0647['password']=_0x2f5b44['body']['password'];_0x2c0647['resetPasswordToken']=null;_0x2c0647[_0x807c('0x39')]=null;return _0x2c0647[_0x807c('0x3b')]();});})[_0x807c('0x16')](function(){_0x4687f5[_0x807c('0x2a')](0xc8)[_0x807c('0x2b')]({'message':_0x807c('0x4b')});})[_0x807c('0x1c')](function(_0x30a006){return handleError(_0x4687f5,0x1f4,_0x30a006);});};passport[_0x807c('0x4c')]('local-login',new LocalStrategy({'usernameField':_0x807c('0x14'),'passwordField':_0x807c('0x49')},function(_0x47fc04,_0x22ab3c,_0x57e8fd){return localAuthenticate(db[_0x807c('0x35')],_0x47fc04,_0x22ab3c,_0x57e8fd);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index e5153a5..126530e 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 _0x26c4=['reset','exports','express','Router','./authLocal.controller','post','login','/reset/:token'];(function(_0x3547c7,_0x123133){var _0x30d6da=function(_0x36b7f4){while(--_0x36b7f4){_0x3547c7['push'](_0x3547c7['shift']());}};_0x30d6da(++_0x123133);}(_0x26c4,0x11a));var _0x426c=function(_0x43b6a5,_0x1e03fd){_0x43b6a5=_0x43b6a5-0x0;var _0x1a29b9=_0x26c4[_0x43b6a5];return _0x1a29b9;};'use strict';var express=require(_0x426c('0x0'));var router=express[_0x426c('0x1')]();var controller=require(_0x426c('0x2'));router[_0x426c('0x3')]('/',controller[_0x426c('0x4')]);router['post']('/forgot',controller['forgot']);router['post'](_0x426c('0x5'),controller[_0x426c('0x6')]);module[_0x426c('0x7')]=router;
\ No newline at end of file
+var _0x8b82=['/forgot','forgot','/reset/:token','reset','express','./authLocal.controller','post','login'];(function(_0x17f59f,_0x4b9eae){var _0x546846=function(_0x33eee4){while(--_0x33eee4){_0x17f59f['push'](_0x17f59f['shift']());}};_0x546846(++_0x4b9eae);}(_0x8b82,0x154));var _0x28b8=function(_0x2a4511,_0x8eed99){_0x2a4511=_0x2a4511-0x0;var _0x40704b=_0x8b82[_0x2a4511];return _0x40704b;};'use strict';var express=require(_0x28b8('0x0'));var router=express['Router']();var controller=require(_0x28b8('0x1'));router[_0x28b8('0x2')]('/',controller[_0x28b8('0x3')]);router[_0x28b8('0x2')](_0x28b8('0x4'),controller[_0x28b8('0x5')]);router[_0x28b8('0x2')](_0x28b8('0x6'),controller[_0x28b8('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index a8a01f7..a9c5a55 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 _0x33c8=['BOOLEAN','exports','STRING'];(function(_0xbe2540,_0x59cf19){var _0x2e0015=function(_0x114890){while(--_0x114890){_0xbe2540['push'](_0xbe2540['shift']());}};_0x2e0015(++_0x59cf19);}(_0x33c8,0x1db));var _0x833c=function(_0x1fdb7a,_0x59c591){_0x1fdb7a=_0x1fdb7a-0x0;var _0x20d14c=_0x33c8[_0x1fdb7a];return _0x20d14c;};'use strict';var Sequelize=require('sequelize');module[_0x833c('0x0')]={'name':{'type':Sequelize[_0x833c('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x833c('0x1')]},'description':{'type':Sequelize[_0x833c('0x1')]},'status':{'type':Sequelize[_0x833c('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x177e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1239c9,_0x31a03b){var _0x5544ac=function(_0x536e01){while(--_0x536e01){_0x1239c9['push'](_0x1239c9['shift']());}};_0x5544ac(++_0x31a03b);}(_0x177e,0x11a));var _0xe177=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x177e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe177('0x0'));module[_0xe177('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xe177('0x2')]},'description':{'type':Sequelize[_0xe177('0x2')]},'status':{'type':Sequelize[_0xe177('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 311dfec..6c59fa6 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 _0xa46a=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','findAll','catch','show','find','create','body','params','destroy','addConditions','Condition','omit','ids','getConditions','findOne','order','merge','options','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','end','error','stack','name','index','map','Automation','rawAttributes','fieldName','type'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa46a,0x11b));var _0xaa46=function(_0x552c27,_0x478dc2){_0x552c27=_0x552c27-0x0;var _0x2a0922=_0xa46a[_0x552c27];return _0x2a0922;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa46('0x0'));var zipdir=require(_0xaa46('0x1'));var jsonpatch=require(_0xaa46('0x2'));var rp=require(_0xaa46('0x3'));var moment=require(_0xaa46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa46('0x5'));var util=require(_0xaa46('0x6'));var path=require(_0xaa46('0x7'));var sox=require('sox');var csv=require(_0xaa46('0x8'));var ejs=require(_0xaa46('0x9'));var fs=require('fs');var fs_extra=require(_0xaa46('0xa'));var _=require(_0xaa46('0xb'));var squel=require('squel');var crypto=require(_0xaa46('0xc'));var jsforce=require(_0xaa46('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa46('0xe'));var Redis=require(_0xaa46('0xf'));var authService=require(_0xaa46('0x10'));var qs=require(_0xaa46('0x11'));var as=require(_0xaa46('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa46('0x13'))('api');var utils=require(_0xaa46('0x14'));var config=require(_0xaa46('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa46('0x16'))['db'];function respondWithStatusCode(_0x4c66d8,_0x23c9fe){_0x23c9fe=_0x23c9fe||0xcc;return function(_0x5a1f75){if(_0x5a1f75){return _0x4c66d8[_0xaa46('0x17')](_0x23c9fe);}return _0x4c66d8[_0xaa46('0x18')](_0x23c9fe)['end']();};}function respondWithResult(_0x8a57c2,_0x25baa2){_0x25baa2=_0x25baa2||0xc8;return function(_0x577a91){if(_0x577a91){return _0x8a57c2[_0xaa46('0x18')](_0x25baa2)[_0xaa46('0x19')](_0x577a91);}};}function respondWithFilteredResult(_0x147086,_0x2ed9c9){return function(_0x358834){if(_0x358834){var _0x580f37=typeof _0x2ed9c9[_0xaa46('0x1a')]==='undefined'&&typeof _0x2ed9c9[_0xaa46('0x1b')]===_0xaa46('0x1c');var _0x4eb956=_0x358834[_0xaa46('0x1d')];var _0x4e556a=_0x580f37?0x0:_0x2ed9c9[_0xaa46('0x1a')];var _0x23c840=_0x580f37?_0x358834['count']:_0x2ed9c9['offset']+_0x2ed9c9['limit'];var _0x50c97c;if(_0x23c840>=_0x4eb956){_0x23c840=_0x4eb956;_0x50c97c=0xc8;}else{_0x50c97c=0xce;}_0x147086['status'](_0x50c97c);return _0x147086[_0xaa46('0x1e')]('Content-Range',_0x4e556a+'-'+_0x23c840+'/'+_0x4eb956)['json'](_0x358834);}return null;};}function patchUpdates(_0x431b27){return function(_0x3f5471){try{jsonpatch['apply'](_0x3f5471,_0x431b27,!![]);}catch(_0x4e4237){return BPromise[_0xaa46('0x1f')](_0x4e4237);}return _0x3f5471[_0xaa46('0x20')]();};}function saveUpdates(_0xdd5bac,_0x55fa84){return function(_0x5548c1){if(_0x5548c1){return _0x5548c1[_0xaa46('0x21')](_0xdd5bac)[_0xaa46('0x22')](function(_0x458c09){return _0x458c09;});}return null;};}function removeEntity(_0x54c7c6,_0x1c8efd){return function(_0x4e2929){if(_0x4e2929){return _0x4e2929['destroy']()[_0xaa46('0x22')](function(){_0x54c7c6['status'](0xcc)[_0xaa46('0x23')]();});}};}function handleEntityNotFound(_0x5338f1,_0x95a44d){return function(_0x29ee03){if(!_0x29ee03){_0x5338f1[_0xaa46('0x17')](0x194);}return _0x29ee03;};}function handleError(_0x52f7a1,_0x19ddcf){_0x19ddcf=_0x19ddcf||0x1f4;return function(_0x53e4e4){logger[_0xaa46('0x24')](_0x53e4e4[_0xaa46('0x25')]);if(_0x53e4e4[_0xaa46('0x26')]){delete _0x53e4e4[_0xaa46('0x26')];}_0x52f7a1[_0xaa46('0x18')](_0x19ddcf)['send'](_0x53e4e4);};}exports[_0xaa46('0x27')]=function(_0x3e519b,_0x417568){var _0x39a86b={},_0x1c7664={},_0x2417ff={'count':0x0,'rows':[]};var _0x359094=_[_0xaa46('0x28')](db[_0xaa46('0x29')][_0xaa46('0x2a')],function(_0x1f01a4){return{'name':_0x1f01a4[_0xaa46('0x2b')],'type':_0x1f01a4[_0xaa46('0x2c')]['key']};});_0x1c7664[_0xaa46('0x2d')]=_[_0xaa46('0x28')](_0x359094,_0xaa46('0x26'));_0x1c7664[_0xaa46('0x2e')]=_[_0xaa46('0x2f')](_0x3e519b[_0xaa46('0x2e')]);_0x1c7664['filters']=_[_0xaa46('0x30')](_0x1c7664[_0xaa46('0x2d')],_0x1c7664[_0xaa46('0x2e')]);_0x39a86b[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x1c7664['model'],qs[_0xaa46('0x32')](_0x3e519b['query'][_0xaa46('0x32')]));_0x39a86b[_0xaa46('0x31')]=_0x39a86b[_0xaa46('0x31')][_0xaa46('0x33')]?_0x39a86b['attributes']:_0x1c7664[_0xaa46('0x2d')];if(!_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x34')](_0xaa46('0x35'))){_0x39a86b[_0xaa46('0x1b')]=qs['limit'](_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x1b')]);_0x39a86b[_0xaa46('0x1a')]=qs[_0xaa46('0x1a')](_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x1a')]);}_0x39a86b['order']=qs['sort'](_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x36')]);_0x39a86b['where']=qs[_0xaa46('0x37')](_[_0xaa46('0x38')](_0x3e519b['query'],_0x1c7664[_0xaa46('0x37')]),_0x359094);if(_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x39')]){_0x39a86b['where']=_['merge'](_0x39a86b[_0xaa46('0x3a')],{'$or':_[_0xaa46('0x28')](_0x359094,function(_0x1a264d){if(_0x1a264d[_0xaa46('0x2c')]!==_0xaa46('0x3b')){var _0xb8eece={};_0xb8eece[_0x1a264d['name']]={'$like':'%'+_0x3e519b['query'][_0xaa46('0x39')]+'%'};return _0xb8eece;}})});}_0x39a86b=_['merge']({},_0x39a86b,_0x3e519b['options']);var _0xc74b11={'where':_0x39a86b['where']};return db['Automation']['count'](_0xc74b11)['then'](function(_0x58191f){_0x2417ff['count']=_0x58191f;if(_0x3e519b[_0xaa46('0x2e')][_0xaa46('0x3c')]){_0x39a86b[_0xaa46('0x3d')]=[{'all':!![]}];}return db[_0xaa46('0x29')][_0xaa46('0x3e')](_0x39a86b);})[_0xaa46('0x22')](function(_0x3b6d62){_0x2417ff['rows']=_0x3b6d62;return _0x2417ff;})[_0xaa46('0x22')](respondWithFilteredResult(_0x417568,_0x39a86b))[_0xaa46('0x3f')](handleError(_0x417568,null));};exports[_0xaa46('0x40')]=function(_0x178fc7,_0x35b22e){var _0x5ad603={'raw':![],'where':{'id':_0x178fc7['params']['id']}},_0x53ea65={};_0x53ea65[_0xaa46('0x2d')]=_[_0xaa46('0x2f')](db['Automation'][_0xaa46('0x2a')]);_0x53ea65[_0xaa46('0x2e')]=_['keys'](_0x178fc7[_0xaa46('0x2e')]);_0x53ea65[_0xaa46('0x37')]=_['intersection'](_0x53ea65[_0xaa46('0x2d')],_0x53ea65['query']);_0x5ad603[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x53ea65[_0xaa46('0x2d')],qs[_0xaa46('0x32')](_0x178fc7['query'][_0xaa46('0x32')]));_0x5ad603['attributes']=_0x5ad603[_0xaa46('0x31')]['length']?_0x5ad603[_0xaa46('0x31')]:_0x53ea65[_0xaa46('0x2d')];if(_0x178fc7[_0xaa46('0x2e')]['includeAll']){_0x5ad603[_0xaa46('0x3d')]=[{'all':!![]}];}_0x5ad603=_['merge']({},_0x5ad603,_0x178fc7['options']);return db[_0xaa46('0x29')][_0xaa46('0x41')](_0x5ad603)[_0xaa46('0x22')](handleEntityNotFound(_0x35b22e,null))[_0xaa46('0x22')](respondWithResult(_0x35b22e,null))[_0xaa46('0x3f')](handleError(_0x35b22e,null));};exports[_0xaa46('0x42')]=function(_0x308b0c,_0x42b134){return db[_0xaa46('0x29')][_0xaa46('0x42')](_0x308b0c[_0xaa46('0x43')],{})['then'](respondWithResult(_0x42b134,0xc9))['catch'](handleError(_0x42b134,null));};exports[_0xaa46('0x21')]=function(_0x4bc34d,_0xa39b9c){if(_0x4bc34d['body']['id']){delete _0x4bc34d['body']['id'];}return db[_0xaa46('0x29')]['find']({'where':{'id':_0x4bc34d[_0xaa46('0x44')]['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0xa39b9c,null))[_0xaa46('0x22')](saveUpdates(_0x4bc34d[_0xaa46('0x43')],null))['then'](respondWithResult(_0xa39b9c,null))[_0xaa46('0x3f')](handleError(_0xa39b9c,null));};exports[_0xaa46('0x45')]=function(_0x4431a2,_0x40f30f){return db[_0xaa46('0x29')]['find']({'where':{'id':_0x4431a2[_0xaa46('0x44')]['id']}})['then'](handleEntityNotFound(_0x40f30f,null))[_0xaa46('0x22')](removeEntity(_0x40f30f,null))[_0xaa46('0x3f')](handleError(_0x40f30f,null));};exports[_0xaa46('0x46')]=function(_0x519743,_0x5c5df2,_0x50dd54){return db[_0xaa46('0x47')][_0xaa46('0x41')]({'where':{'id':_0x519743[_0xaa46('0x44')]['id']}})['then'](handleEntityNotFound(_0x5c5df2,null))[_0xaa46('0x22')](function(_0x22b752){if(_0x22b752){return _0x22b752[_0xaa46('0x46')](_0x519743[_0xaa46('0x43')]['ids'],_[_0xaa46('0x48')](_0x519743['body'],[_0xaa46('0x49'),'id'])||{});}})['then'](respondWithResult(_0x5c5df2,null))[_0xaa46('0x3f')](handleError(_0x5c5df2,null));};exports[_0xaa46('0x4a')]=function(_0x38845c,_0x12a33e,_0x69d355){var _0xca2bcf={};var _0x55e184={};var _0x3c5d67;var _0x3a83c2;return db[_0xaa46('0x29')][_0xaa46('0x4b')]({'where':{'id':_0x38845c['params']['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0x12a33e,null))['then'](function(_0x11ee21){if(_0x11ee21){_0x3c5d67=_0x11ee21;_0x55e184[_0xaa46('0x2d')]=_[_0xaa46('0x2f')](db[_0xaa46('0x47')][_0xaa46('0x2a')]);_0x55e184[_0xaa46('0x2e')]=_[_0xaa46('0x2f')](_0x38845c[_0xaa46('0x2e')]);_0x55e184[_0xaa46('0x37')]=_['intersection'](_0x55e184['model'],_0x55e184[_0xaa46('0x2e')]);_0xca2bcf[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x55e184[_0xaa46('0x2d')],qs['fields'](_0x38845c[_0xaa46('0x2e')][_0xaa46('0x32')]));_0xca2bcf[_0xaa46('0x31')]=_0xca2bcf['attributes'][_0xaa46('0x33')]?_0xca2bcf[_0xaa46('0x31')]:_0x55e184[_0xaa46('0x2d')];_0xca2bcf[_0xaa46('0x4c')]=qs[_0xaa46('0x36')](_0x38845c[_0xaa46('0x2e')]['sort']);_0xca2bcf[_0xaa46('0x3a')]=qs['filters'](_[_0xaa46('0x38')](_0x38845c[_0xaa46('0x2e')],_0x55e184[_0xaa46('0x37')]));if(_0x38845c['query'][_0xaa46('0x39')]){_0xca2bcf[_0xaa46('0x3a')]=_[_0xaa46('0x4d')](_0xca2bcf[_0xaa46('0x3a')],{'$or':_[_0xaa46('0x28')](_0xca2bcf[_0xaa46('0x31')],function(_0x2aa9b6){var _0x2598a8={};_0x2598a8[_0x2aa9b6]={'$like':'%'+_0x38845c[_0xaa46('0x2e')][_0xaa46('0x39')]+'%'};return _0x2598a8;})});}_0xca2bcf=_['merge']({},_0xca2bcf,_0x38845c[_0xaa46('0x4e')]);return _0x3c5d67[_0xaa46('0x4a')](_0xca2bcf);}})[_0xaa46('0x22')](function(_0x4e7018){if(_0x4e7018){_0x3a83c2=_0x4e7018[_0xaa46('0x33')];if(!_0x38845c['query']['hasOwnProperty'](_0xaa46('0x35'))){_0xca2bcf[_0xaa46('0x1b')]=qs[_0xaa46('0x1b')](_0x38845c[_0xaa46('0x2e')][_0xaa46('0x1b')]);_0xca2bcf['offset']=qs[_0xaa46('0x1a')](_0x38845c['query'][_0xaa46('0x1a')]);}return _0x3c5d67[_0xaa46('0x4a')](_0xca2bcf);}})['then'](function(_0x1d72ec){if(_0x1d72ec){return _0x1d72ec?{'count':_0x3a83c2,'rows':_0x1d72ec}:null;}})[_0xaa46('0x22')](respondWithResult(_0x12a33e,null))['catch'](handleError(_0x12a33e,null));};exports[_0xaa46('0x4f')]=function(_0x3d68e3,_0x1a6a22,_0x47d991){return db[_0xaa46('0x50')][_0xaa46('0x41')]({'where':{'id':_0x3d68e3[_0xaa46('0x44')]['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0x1a6a22,null))[_0xaa46('0x22')](function(_0x14d38e){if(_0x14d38e){return _0x14d38e[_0xaa46('0x4f')](_0x3d68e3[_0xaa46('0x43')][_0xaa46('0x49')],_[_0xaa46('0x48')](_0x3d68e3['body'],[_0xaa46('0x49'),'id'])||{});}})['then'](respondWithResult(_0x1a6a22,null))[_0xaa46('0x3f')](handleError(_0x1a6a22,null));};exports[_0xaa46('0x51')]=function(_0x36644b,_0x89a16b,_0x1e6b88){var _0x4bc331={};var _0x495c01={};var _0x264c95;var _0x1f3c71;return db[_0xaa46('0x29')]['findOne']({'where':{'id':_0x36644b[_0xaa46('0x44')]['id']}})[_0xaa46('0x22')](handleEntityNotFound(_0x89a16b,null))['then'](function(_0x4f7a52){if(_0x4f7a52){_0x264c95=_0x4f7a52;_0x495c01['model']=_[_0xaa46('0x2f')](db[_0xaa46('0x50')][_0xaa46('0x2a')]);_0x495c01[_0xaa46('0x2e')]=_[_0xaa46('0x2f')](_0x36644b[_0xaa46('0x2e')]);_0x495c01[_0xaa46('0x37')]=_[_0xaa46('0x30')](_0x495c01[_0xaa46('0x2d')],_0x495c01[_0xaa46('0x2e')]);_0x4bc331[_0xaa46('0x31')]=_[_0xaa46('0x30')](_0x495c01['model'],qs['fields'](_0x36644b[_0xaa46('0x2e')][_0xaa46('0x32')]));_0x4bc331[_0xaa46('0x31')]=_0x4bc331['attributes'][_0xaa46('0x33')]?_0x4bc331['attributes']:_0x495c01[_0xaa46('0x2d')];_0x4bc331[_0xaa46('0x4c')]=qs[_0xaa46('0x36')](_0x36644b[_0xaa46('0x2e')][_0xaa46('0x36')]);_0x4bc331[_0xaa46('0x3a')]=qs[_0xaa46('0x37')](_[_0xaa46('0x38')](_0x36644b[_0xaa46('0x2e')],_0x495c01['filters']));if(_0x36644b[_0xaa46('0x2e')]['filter']){_0x4bc331['where']=_['merge'](_0x4bc331[_0xaa46('0x3a')],{'$or':_[_0xaa46('0x28')](_0x4bc331[_0xaa46('0x31')],function(_0xba4730){var _0x190ef3={};_0x190ef3[_0xba4730]={'$like':'%'+_0x36644b[_0xaa46('0x2e')]['filter']+'%'};return _0x190ef3;})});}_0x4bc331=_[_0xaa46('0x4d')]({},_0x4bc331,_0x36644b[_0xaa46('0x4e')]);return _0x264c95['getActions'](_0x4bc331);}})[_0xaa46('0x22')](function(_0x296ddc){if(_0x296ddc){_0x1f3c71=_0x296ddc[_0xaa46('0x33')];if(!_0x36644b[_0xaa46('0x2e')][_0xaa46('0x34')]('nolimit')){_0x4bc331[_0xaa46('0x1b')]=qs[_0xaa46('0x1b')](_0x36644b['query'][_0xaa46('0x1b')]);_0x4bc331[_0xaa46('0x1a')]=qs['offset'](_0x36644b[_0xaa46('0x2e')][_0xaa46('0x1a')]);}return _0x264c95[_0xaa46('0x51')](_0x4bc331);}})[_0xaa46('0x22')](function(_0x19e51f){if(_0x19e51f){return _0x19e51f?{'count':_0x1f3c71,'rows':_0x19e51f}:null;}})[_0xaa46('0x22')](respondWithResult(_0x89a16b,null))['catch'](handleError(_0x89a16b,null));};
\ No newline at end of file
+var _0xb229=['name','send','index','Automation','rawAttributes','fieldName','type','model','map','keys','query','attributes','intersection','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','addConditions','ids','getConditions','Condition','order','addActions','Action','omit','getActions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack'];(function(_0x17cb74,_0x53baa1){var _0x2a2c1e=function(_0x499418){while(--_0x499418){_0x17cb74['push'](_0x17cb74['shift']());}};_0x2a2c1e(++_0x53baa1);}(_0xb229,0x123));var _0x9b22=function(_0x4a13af,_0x5db35d){_0x4a13af=_0x4a13af-0x0;var _0xf3b735=_0xb229[_0x4a13af];return _0xf3b735;};'use strict';var emlformat=require(_0x9b22('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b22('0x1'));var jsonpatch=require(_0x9b22('0x2'));var rp=require(_0x9b22('0x3'));var moment=require('moment');var BPromise=require(_0x9b22('0x4'));var Mustache=require(_0x9b22('0x5'));var util=require(_0x9b22('0x6'));var path=require('path');var sox=require(_0x9b22('0x7'));var csv=require(_0x9b22('0x8'));var ejs=require(_0x9b22('0x9'));var fs=require('fs');var fs_extra=require(_0x9b22('0xa'));var _=require(_0x9b22('0xb'));var squel=require(_0x9b22('0xc'));var crypto=require(_0x9b22('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9b22('0xe'));var toCsv=require(_0x9b22('0x8'));var querystring=require('querystring');var Papa=require(_0x9b22('0xf'));var Redis=require(_0x9b22('0x10'));var authService=require(_0x9b22('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b22('0x12'));var hardwareService=require(_0x9b22('0x13'));var logger=require(_0x9b22('0x14'))(_0x9b22('0x15'));var utils=require(_0x9b22('0x16'));var config=require(_0x9b22('0x17'));var licenseUtil=require(_0x9b22('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310d9d,_0xe5bec7){_0xe5bec7=_0xe5bec7||0xcc;return function(_0x14288e){if(_0x14288e){return _0x310d9d[_0x9b22('0x19')](_0xe5bec7);}return _0x310d9d[_0x9b22('0x1a')](_0xe5bec7)[_0x9b22('0x1b')]();};}function respondWithResult(_0x2c6b35,_0x33a0bf){_0x33a0bf=_0x33a0bf||0xc8;return function(_0x562c89){if(_0x562c89){return _0x2c6b35['status'](_0x33a0bf)[_0x9b22('0x1c')](_0x562c89);}};}function respondWithFilteredResult(_0x4e16e5,_0x1f3232){return function(_0x314023){if(_0x314023){var _0x118023=typeof _0x1f3232[_0x9b22('0x1d')]===_0x9b22('0x1e')&&typeof _0x1f3232[_0x9b22('0x1f')]==='undefined';var _0x58cae6=_0x314023[_0x9b22('0x20')];var _0x12df29=_0x118023?0x0:_0x1f3232[_0x9b22('0x1d')];var _0x52b69b=_0x118023?_0x314023['count']:_0x1f3232[_0x9b22('0x1d')]+_0x1f3232['limit'];var _0x22f5e5;if(_0x52b69b>=_0x58cae6){_0x52b69b=_0x58cae6;_0x22f5e5=0xc8;}else{_0x22f5e5=0xce;}_0x4e16e5[_0x9b22('0x1a')](_0x22f5e5);return _0x4e16e5[_0x9b22('0x21')](_0x9b22('0x22'),_0x12df29+'-'+_0x52b69b+'/'+_0x58cae6)[_0x9b22('0x1c')](_0x314023);}return null;};}function patchUpdates(_0x320600){return function(_0x56156e){try{jsonpatch['apply'](_0x56156e,_0x320600,!![]);}catch(_0x44b35f){return BPromise[_0x9b22('0x23')](_0x44b35f);}return _0x56156e['save']();};}function saveUpdates(_0x5c0acd,_0x46912d){return function(_0xae44a){if(_0xae44a){return _0xae44a[_0x9b22('0x24')](_0x5c0acd)[_0x9b22('0x25')](function(_0x40b22d){return _0x40b22d;});}return null;};}function removeEntity(_0x5720b8,_0x5c648b){return function(_0x433220){if(_0x433220){return _0x433220[_0x9b22('0x26')]()['then'](function(){_0x5720b8['status'](0xcc)[_0x9b22('0x1b')]();});}};}function handleEntityNotFound(_0x4b1a07,_0x1d24d6){return function(_0x532bed){if(!_0x532bed){_0x4b1a07[_0x9b22('0x19')](0x194);}return _0x532bed;};}function handleError(_0xf10a72,_0xc10d16){_0xc10d16=_0xc10d16||0x1f4;return function(_0x448c84){logger[_0x9b22('0x27')](_0x448c84[_0x9b22('0x28')]);if(_0x448c84[_0x9b22('0x29')]){delete _0x448c84[_0x9b22('0x29')];}_0xf10a72[_0x9b22('0x1a')](_0xc10d16)[_0x9b22('0x2a')](_0x448c84);};}exports[_0x9b22('0x2b')]=function(_0x2eba42,_0x28063){var _0x19217d={},_0x2c955d={},_0x11bc7c={'count':0x0,'rows':[]};var _0x3336d0=_['map'](db[_0x9b22('0x2c')][_0x9b22('0x2d')],function(_0x3261c1){return{'name':_0x3261c1[_0x9b22('0x2e')],'type':_0x3261c1[_0x9b22('0x2f')]['key']};});_0x2c955d[_0x9b22('0x30')]=_[_0x9b22('0x31')](_0x3336d0,_0x9b22('0x29'));_0x2c955d['query']=_[_0x9b22('0x32')](_0x2eba42[_0x9b22('0x33')]);_0x2c955d['filters']=_['intersection'](_0x2c955d['model'],_0x2c955d[_0x9b22('0x33')]);_0x19217d[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x2c955d[_0x9b22('0x30')],qs['fields'](_0x2eba42['query']['fields']));_0x19217d['attributes']=_0x19217d[_0x9b22('0x34')][_0x9b22('0x36')]?_0x19217d['attributes']:_0x2c955d[_0x9b22('0x30')];if(!_0x2eba42[_0x9b22('0x33')]['hasOwnProperty'](_0x9b22('0x37'))){_0x19217d[_0x9b22('0x1f')]=qs[_0x9b22('0x1f')](_0x2eba42[_0x9b22('0x33')][_0x9b22('0x1f')]);_0x19217d[_0x9b22('0x1d')]=qs[_0x9b22('0x1d')](_0x2eba42['query'][_0x9b22('0x1d')]);}_0x19217d['order']=qs['sort'](_0x2eba42[_0x9b22('0x33')][_0x9b22('0x38')]);_0x19217d[_0x9b22('0x39')]=qs[_0x9b22('0x3a')](_[_0x9b22('0x3b')](_0x2eba42['query'],_0x2c955d['filters']),_0x3336d0);if(_0x2eba42[_0x9b22('0x33')][_0x9b22('0x3c')]){_0x19217d[_0x9b22('0x39')]=_[_0x9b22('0x3d')](_0x19217d[_0x9b22('0x39')],{'$or':_['map'](_0x3336d0,function(_0x45ac59){if(_0x45ac59[_0x9b22('0x2f')]!=='VIRTUAL'){var _0x2e6f2b={};_0x2e6f2b[_0x45ac59['name']]={'$like':'%'+_0x2eba42[_0x9b22('0x33')]['filter']+'%'};return _0x2e6f2b;}})});}_0x19217d=_[_0x9b22('0x3d')]({},_0x19217d,_0x2eba42[_0x9b22('0x3e')]);var _0x1feb95={'where':_0x19217d[_0x9b22('0x39')]};return db[_0x9b22('0x2c')]['count'](_0x1feb95)['then'](function(_0x94247){_0x11bc7c[_0x9b22('0x20')]=_0x94247;if(_0x2eba42[_0x9b22('0x33')][_0x9b22('0x3f')]){_0x19217d[_0x9b22('0x40')]=[{'all':!![]}];}return db[_0x9b22('0x2c')][_0x9b22('0x41')](_0x19217d);})[_0x9b22('0x25')](function(_0x42e507){_0x11bc7c[_0x9b22('0x42')]=_0x42e507;return _0x11bc7c;})[_0x9b22('0x25')](respondWithFilteredResult(_0x28063,_0x19217d))[_0x9b22('0x43')](handleError(_0x28063,null));};exports['show']=function(_0x242a6e,_0x3f4c1e){var _0x499dd6={'raw':![],'where':{'id':_0x242a6e[_0x9b22('0x44')]['id']}},_0x15724e={};_0x15724e[_0x9b22('0x30')]=_[_0x9b22('0x32')](db[_0x9b22('0x2c')][_0x9b22('0x2d')]);_0x15724e[_0x9b22('0x33')]=_['keys'](_0x242a6e[_0x9b22('0x33')]);_0x15724e['filters']=_['intersection'](_0x15724e[_0x9b22('0x30')],_0x15724e[_0x9b22('0x33')]);_0x499dd6[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x15724e['model'],qs[_0x9b22('0x45')](_0x242a6e[_0x9b22('0x33')][_0x9b22('0x45')]));_0x499dd6[_0x9b22('0x34')]=_0x499dd6[_0x9b22('0x34')]['length']?_0x499dd6['attributes']:_0x15724e['model'];if(_0x242a6e[_0x9b22('0x33')][_0x9b22('0x3f')]){_0x499dd6['include']=[{'all':!![]}];}_0x499dd6=_[_0x9b22('0x3d')]({},_0x499dd6,_0x242a6e[_0x9b22('0x3e')]);return db[_0x9b22('0x2c')][_0x9b22('0x46')](_0x499dd6)[_0x9b22('0x25')](handleEntityNotFound(_0x3f4c1e,null))[_0x9b22('0x25')](respondWithResult(_0x3f4c1e,null))['catch'](handleError(_0x3f4c1e,null));};exports[_0x9b22('0x47')]=function(_0x2e3711,_0x381c37){return db[_0x9b22('0x2c')][_0x9b22('0x47')](_0x2e3711[_0x9b22('0x48')],{})[_0x9b22('0x25')](respondWithResult(_0x381c37,0xc9))[_0x9b22('0x43')](handleError(_0x381c37,null));};exports['update']=function(_0x28b8d9,_0x17305f){if(_0x28b8d9[_0x9b22('0x48')]['id']){delete _0x28b8d9['body']['id'];}return db[_0x9b22('0x2c')][_0x9b22('0x46')]({'where':{'id':_0x28b8d9['params']['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x17305f,null))[_0x9b22('0x25')](saveUpdates(_0x28b8d9[_0x9b22('0x48')],null))[_0x9b22('0x25')](respondWithResult(_0x17305f,null))['catch'](handleError(_0x17305f,null));};exports[_0x9b22('0x26')]=function(_0x2222e3,_0x1454a5){return db[_0x9b22('0x2c')]['find']({'where':{'id':_0x2222e3['params']['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x1454a5,null))[_0x9b22('0x25')](removeEntity(_0x1454a5,null))[_0x9b22('0x43')](handleError(_0x1454a5,null));};exports[_0x9b22('0x49')]=function(_0xbbd6d0,_0x2237bb,_0x305db3){return db['Condition'][_0x9b22('0x46')]({'where':{'id':_0xbbd6d0['params']['id']}})['then'](handleEntityNotFound(_0x2237bb,null))[_0x9b22('0x25')](function(_0x380594){if(_0x380594){return _0x380594['addConditions'](_0xbbd6d0[_0x9b22('0x48')][_0x9b22('0x4a')],_['omit'](_0xbbd6d0[_0x9b22('0x48')],[_0x9b22('0x4a'),'id'])||{});}})[_0x9b22('0x25')](respondWithResult(_0x2237bb,null))[_0x9b22('0x43')](handleError(_0x2237bb,null));};exports[_0x9b22('0x4b')]=function(_0x21556a,_0x4e024a,_0x1ad937){var _0x52acc1={};var _0x2791ca={};var _0x339583;var _0x28d619;return db[_0x9b22('0x2c')]['findOne']({'where':{'id':_0x21556a[_0x9b22('0x44')]['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x4e024a,null))[_0x9b22('0x25')](function(_0x59e2fc){if(_0x59e2fc){_0x339583=_0x59e2fc;_0x2791ca[_0x9b22('0x30')]=_[_0x9b22('0x32')](db[_0x9b22('0x4c')]['rawAttributes']);_0x2791ca[_0x9b22('0x33')]=_[_0x9b22('0x32')](_0x21556a[_0x9b22('0x33')]);_0x2791ca[_0x9b22('0x3a')]=_[_0x9b22('0x35')](_0x2791ca[_0x9b22('0x30')],_0x2791ca[_0x9b22('0x33')]);_0x52acc1[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x2791ca[_0x9b22('0x30')],qs[_0x9b22('0x45')](_0x21556a[_0x9b22('0x33')]['fields']));_0x52acc1[_0x9b22('0x34')]=_0x52acc1[_0x9b22('0x34')][_0x9b22('0x36')]?_0x52acc1[_0x9b22('0x34')]:_0x2791ca[_0x9b22('0x30')];_0x52acc1[_0x9b22('0x4d')]=qs[_0x9b22('0x38')](_0x21556a['query'][_0x9b22('0x38')]);_0x52acc1[_0x9b22('0x39')]=qs['filters'](_[_0x9b22('0x3b')](_0x21556a[_0x9b22('0x33')],_0x2791ca[_0x9b22('0x3a')]));if(_0x21556a[_0x9b22('0x33')][_0x9b22('0x3c')]){_0x52acc1[_0x9b22('0x39')]=_[_0x9b22('0x3d')](_0x52acc1[_0x9b22('0x39')],{'$or':_[_0x9b22('0x31')](_0x52acc1[_0x9b22('0x34')],function(_0x6e48e3){var _0x10e234={};_0x10e234[_0x6e48e3]={'$like':'%'+_0x21556a[_0x9b22('0x33')]['filter']+'%'};return _0x10e234;})});}_0x52acc1=_['merge']({},_0x52acc1,_0x21556a['options']);return _0x339583[_0x9b22('0x4b')](_0x52acc1);}})[_0x9b22('0x25')](function(_0x43cd19){if(_0x43cd19){_0x28d619=_0x43cd19[_0x9b22('0x36')];if(!_0x21556a[_0x9b22('0x33')]['hasOwnProperty'](_0x9b22('0x37'))){_0x52acc1[_0x9b22('0x1f')]=qs[_0x9b22('0x1f')](_0x21556a[_0x9b22('0x33')][_0x9b22('0x1f')]);_0x52acc1['offset']=qs[_0x9b22('0x1d')](_0x21556a[_0x9b22('0x33')][_0x9b22('0x1d')]);}return _0x339583['getConditions'](_0x52acc1);}})[_0x9b22('0x25')](function(_0x222027){if(_0x222027){return _0x222027?{'count':_0x28d619,'rows':_0x222027}:null;}})[_0x9b22('0x25')](respondWithResult(_0x4e024a,null))[_0x9b22('0x43')](handleError(_0x4e024a,null));};exports[_0x9b22('0x4e')]=function(_0x164b2b,_0x52014c,_0x590b2c){return db[_0x9b22('0x4f')][_0x9b22('0x46')]({'where':{'id':_0x164b2b[_0x9b22('0x44')]['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x52014c,null))[_0x9b22('0x25')](function(_0x50ea40){if(_0x50ea40){return _0x50ea40[_0x9b22('0x4e')](_0x164b2b[_0x9b22('0x48')][_0x9b22('0x4a')],_[_0x9b22('0x50')](_0x164b2b[_0x9b22('0x48')],[_0x9b22('0x4a'),'id'])||{});}})[_0x9b22('0x25')](respondWithResult(_0x52014c,null))[_0x9b22('0x43')](handleError(_0x52014c,null));};exports[_0x9b22('0x51')]=function(_0x99e79d,_0x4cca0e,_0x43f8ff){var _0x2a6626={};var _0x389bd1={};var _0xb9f9a4;var _0x5f5c08;return db[_0x9b22('0x2c')][_0x9b22('0x52')]({'where':{'id':_0x99e79d[_0x9b22('0x44')]['id']}})[_0x9b22('0x25')](handleEntityNotFound(_0x4cca0e,null))[_0x9b22('0x25')](function(_0x58c160){if(_0x58c160){_0xb9f9a4=_0x58c160;_0x389bd1[_0x9b22('0x30')]=_[_0x9b22('0x32')](db[_0x9b22('0x4f')][_0x9b22('0x2d')]);_0x389bd1['query']=_[_0x9b22('0x32')](_0x99e79d[_0x9b22('0x33')]);_0x389bd1[_0x9b22('0x3a')]=_['intersection'](_0x389bd1[_0x9b22('0x30')],_0x389bd1[_0x9b22('0x33')]);_0x2a6626[_0x9b22('0x34')]=_[_0x9b22('0x35')](_0x389bd1[_0x9b22('0x30')],qs[_0x9b22('0x45')](_0x99e79d[_0x9b22('0x33')]['fields']));_0x2a6626[_0x9b22('0x34')]=_0x2a6626[_0x9b22('0x34')]['length']?_0x2a6626[_0x9b22('0x34')]:_0x389bd1[_0x9b22('0x30')];_0x2a6626[_0x9b22('0x4d')]=qs[_0x9b22('0x38')](_0x99e79d[_0x9b22('0x33')][_0x9b22('0x38')]);_0x2a6626['where']=qs[_0x9b22('0x3a')](_[_0x9b22('0x3b')](_0x99e79d[_0x9b22('0x33')],_0x389bd1[_0x9b22('0x3a')]));if(_0x99e79d[_0x9b22('0x33')][_0x9b22('0x3c')]){_0x2a6626[_0x9b22('0x39')]=_[_0x9b22('0x3d')](_0x2a6626[_0x9b22('0x39')],{'$or':_[_0x9b22('0x31')](_0x2a6626['attributes'],function(_0x3eb166){var _0x3642df={};_0x3642df[_0x3eb166]={'$like':'%'+_0x99e79d[_0x9b22('0x33')][_0x9b22('0x3c')]+'%'};return _0x3642df;})});}_0x2a6626=_[_0x9b22('0x3d')]({},_0x2a6626,_0x99e79d['options']);return _0xb9f9a4[_0x9b22('0x51')](_0x2a6626);}})[_0x9b22('0x25')](function(_0x53624f){if(_0x53624f){_0x5f5c08=_0x53624f['length'];if(!_0x99e79d[_0x9b22('0x33')]['hasOwnProperty']('nolimit')){_0x2a6626['limit']=qs[_0x9b22('0x1f')](_0x99e79d['query'][_0x9b22('0x1f')]);_0x2a6626['offset']=qs[_0x9b22('0x1d')](_0x99e79d[_0x9b22('0x33')]['offset']);}return _0xb9f9a4[_0x9b22('0x51')](_0x2a6626);}})[_0x9b22('0x25')](function(_0x2f7d39){if(_0x2f7d39){return _0x2f7d39?{'count':_0x5f5c08,'rows':_0x2f7d39}:null;}})[_0x9b22('0x25')](respondWithResult(_0x4cca0e,null))[_0x9b22('0x43')](handleError(_0x4cca0e,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index f0aa5b9..8d6743c 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 _0x26df=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x34d892,_0x3d97c6){var _0x443bc6=function(_0x2cb0ff){while(--_0x2cb0ff){_0x34d892['push'](_0x34d892['shift']());}};_0x443bc6(++_0x3d97c6);}(_0x26df,0x1a3));var _0xf26d=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x26df[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xf26d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf26d('0x1'));var moment=require(_0xf26d('0x2'));var BPromise=require(_0xf26d('0x3'));var rp=require(_0xf26d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf26d('0x5'));var config=require(_0xf26d('0x6'));var attributes=require(_0xf26d('0x7'));module[_0xf26d('0x8')]=function(_0x6a2f23,_0xdeff30){return _0x6a2f23[_0xf26d('0x9')](_0xf26d('0xa'),attributes,{'tableName':_0xf26d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6479=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','util','../../config/logger','moment','bluebird'];(function(_0x16a4e2,_0x416fbc){var _0x4de8e1=function(_0x378820){while(--_0x378820){_0x16a4e2['push'](_0x16a4e2['shift']());}};_0x4de8e1(++_0x416fbc);}(_0x6479,0x1dc));var _0x9647=function(_0x3a9d77,_0xdc466){_0x3a9d77=_0x3a9d77-0x0;var _0x130f80=_0x6479[_0x3a9d77];return _0x130f80;};'use strict';var _=require('lodash');var util=require(_0x9647('0x0'));var logger=require(_0x9647('0x1'))('api');var moment=require(_0x9647('0x2'));var BPromise=require(_0x9647('0x3'));var rp=require(_0x9647('0x4'));var fs=require('fs');var path=require(_0x9647('0x5'));var rimraf=require(_0x9647('0x6'));var config=require(_0x9647('0x7'));var attributes=require(_0x9647('0x8'));module[_0x9647('0x9')]=function(_0x3ed50b,_0x3d53b3){return _0x3ed50b[_0x9647('0xa')](_0x9647('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 5336ac0..4c664bf 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 _0x5fdc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring'];(function(_0x46e439,_0x47edec){var _0x3a8e2a=function(_0x17d9fc){while(--_0x17d9fc){_0x46e439['push'](_0x46e439['shift']());}};_0x3a8e2a(++_0x47edec);}(_0x5fdc,0x127));var _0xc5fd=function(_0x46dee4,_0x1d26f3){_0x46dee4=_0x46dee4-0x0;var _0x577d82=_0x5fdc[_0x46dee4];return _0x577d82;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('Automation,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}
\ No newline at end of file
+var _0xb9e7=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0xb9e7[_0x3c6ae2];return _0x4edda;};'use strict';var _=require('lodash');var util=require(_0x7b9e('0x0'));var moment=require(_0x7b9e('0x1'));var BPromise=require(_0x7b9e('0x2'));var rs=require(_0x7b9e('0x3'));var fs=require('fs');var Redis=require(_0x7b9e('0x4'));var db=require(_0x7b9e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b9e('0x6'))(_0x7b9e('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b9e('0x8'));var client=jayson['client'][_0x7b9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ea3,_0x14e025,_0x9b53ea){return new BPromise(function(_0x30d1d8,_0x5c358c){return client[_0x7b9e('0xa')](_0x3e7ea3,_0x9b53ea)[_0x7b9e('0xb')](function(_0xb35b20){logger['info'](_0x7b9e('0xc'),_0x14e025,'request\x20sent');logger[_0x7b9e('0xd')](_0x7b9e('0xe'),_0x14e025,'request\x20sent',JSON['stringify'](_0xb35b20));if(_0xb35b20[_0x7b9e('0xf')]){if(_0xb35b20['error'][_0x7b9e('0x10')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x14e025,_0xb35b20['error'][_0x7b9e('0x11')]);return _0x5c358c(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}logger[_0x7b9e('0xf')]('Automation,\x20%s,\x20%s',_0x14e025,_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);return _0x30d1d8(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}else{logger[_0x7b9e('0x12')](_0x7b9e('0xc'),_0x14e025,_0x7b9e('0x13'));_0x30d1d8(_0xb35b20[_0x7b9e('0x14')][_0x7b9e('0x11')]);}})[_0x7b9e('0x15')](function(_0x49e88c){logger[_0x7b9e('0xf')]('Automation,\x20%s,\x20%s',_0x14e025,_0x49e88c);_0x5c358c(_0x49e88c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 8cf6247..4005377 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 _0x15ab=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','index','/:id','isAuthenticated','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete'];(function(_0x180c49,_0x403808){var _0x406f6d=function(_0x4b7cbc){while(--_0x4b7cbc){_0x180c49['push'](_0x180c49['shift']());}};_0x406f6d(++_0x403808);}(_0x15ab,0xda));var _0xb15a=function(_0x559fa3,_0x22fabc){_0x559fa3=_0x559fa3-0x0;var _0x571dbb=_0x15ab[_0x559fa3];return _0x571dbb;};'use strict';var multer=require(_0xb15a('0x0'));var util=require(_0xb15a('0x1'));var path=require(_0xb15a('0x2'));var timeout=require(_0xb15a('0x3'));var express=require(_0xb15a('0x4'));var router=express[_0xb15a('0x5')]();var fs_extra=require(_0xb15a('0x6'));var auth=require(_0xb15a('0x7'));var interaction=require(_0xb15a('0x8'));var config=require('../../config/environment');var controller=require(_0xb15a('0x9'));router[_0xb15a('0xa')]('/',auth['isAuthenticated'](),controller[_0xb15a('0xb')]);router['get'](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller['show']);router[_0xb15a('0xa')](_0xb15a('0xe'),auth[_0xb15a('0xd')](),controller[_0xb15a('0xf')]);router[_0xb15a('0xa')](_0xb15a('0x10'),auth[_0xb15a('0xd')](),controller['getActions']);router[_0xb15a('0x11')]('/',auth[_0xb15a('0xd')](),controller[_0xb15a('0x12')]);router[_0xb15a('0x11')](_0xb15a('0xe'),auth[_0xb15a('0xd')](),controller['addConditions']);router['post']('/:id/actions',auth[_0xb15a('0xd')](),controller[_0xb15a('0x13')]);router[_0xb15a('0x14')](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller['update']);router[_0xb15a('0x15')](_0xb15a('0xc'),auth[_0xb15a('0xd')](),controller[_0xb15a('0x16')]);module[_0xb15a('0x17')]=router;
\ No newline at end of file
+var _0x9ef8=['put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/conditions','/:id/actions','post','create','addConditions'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x9ef8,0x17f));var _0x89ef=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9ef8[_0x22b68a];return _0x1ac67a;};'use strict';var multer=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var path=require('path');var timeout=require(_0x89ef('0x2'));var express=require(_0x89ef('0x3'));var router=express[_0x89ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89ef('0x5'));var interaction=require(_0x89ef('0x6'));var config=require('../../config/environment');var controller=require('./automation.controller');router['get']('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0x8')]);router[_0x89ef('0x9')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0xb')]);router[_0x89ef('0x9')](_0x89ef('0xc'),auth[_0x89ef('0x7')](),controller['getConditions']);router[_0x89ef('0x9')](_0x89ef('0xd'),auth[_0x89ef('0x7')](),controller['getActions']);router[_0x89ef('0xe')]('/',auth[_0x89ef('0x7')](),controller[_0x89ef('0xf')]);router[_0x89ef('0xe')](_0x89ef('0xc'),auth['isAuthenticated'](),controller[_0x89ef('0x10')]);router['post'](_0x89ef('0xd'),auth[_0x89ef('0x7')](),controller['addActions']);router[_0x89ef('0x11')](_0x89ef('0xa'),auth[_0x89ef('0x7')](),controller[_0x89ef('0x12')]);router[_0x89ef('0x13')]('/:id',auth[_0x89ef('0x7')](),controller['destroy']);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 f6b46a2..0ebbe8f 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 _0xe502=['never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x3550ae,_0x13c5ce){var _0x441355=function(_0x3450a0){while(--_0x3450a0){_0x3550ae['push'](_0x3550ae['shift']());}};_0x441355(++_0x13c5ce);}(_0xe502,0x17c));var _0x2e50=function(_0x408aa8,_0x54b16e){_0x408aa8=_0x408aa8-0x0;var _0x8d1da7=_0xe502[_0x408aa8];return _0x8d1da7;};'use strict';var Sequelize=require('sequelize');module[_0x2e50('0x0')]={'name':{'type':Sequelize[_0x2e50('0x1')],'unique':_0x2e50('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2e50('0x3')](_0x2e50('0x4')),'allowNull':![],'defaultValue':_0x2e50('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x2e50('0x5')],'defaultValue':0x0,'comment':_0x2e50('0x6')},'limitCalls':{'type':Sequelize[_0x2e50('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x2e50('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2e50('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2e50('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2e50('0x1')],'defaultValue':_0x2e50('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x2e50('0x3')]('always',_0x2e50('0x10'),_0x2e50('0x11')),'defaultValue':_0x2e50('0x12')},'dialAMDActive':{'type':Sequelize[_0x2e50('0x5')],'defaultValue':0x0,'comment':_0x2e50('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2e50('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2e50('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2e50('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2e50('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x2e50('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2e50('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2e50('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2e50('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2e50('0x7')](0x9)[_0x2e50('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2e50('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2e50('0x3')](_0x2e50('0x1b'),_0x2e50('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x2e50('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2e50('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2e50('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)[_0x2e50('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2e50('0x7')](0x3)[_0x2e50('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2e50('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2e50('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x4ce1=['name','ivr','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING'];(function(_0x4c5934,_0x364a26){var _0x2b3204=function(_0x176b51){while(--_0x176b51){_0x4c5934['push'](_0x4c5934['shift']());}};_0x2b3204(++_0x364a26);}(_0x4ce1,0xca));var _0x14ce=function(_0x1ab735,_0x1dd5a8){_0x1ab735=_0x1ab735-0x0;var _0xec8fe8=_0x4ce1[_0x1ab735];return _0xec8fe8;};'use strict';var Sequelize=require(_0x14ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x14ce('0x1')],'unique':_0x14ce('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x14ce('0x3')),'allowNull':![],'defaultValue':_0x14ce('0x3')},'description':{'type':Sequelize[_0x14ce('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x14ce('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x14ce('0x5')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x14ce('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'comment':_0x14ce('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x14ce('0xc')},'dialTimezone':{'type':Sequelize[_0x14ce('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x14ce('0xd')](_0x14ce('0xe'),_0x14ce('0xf'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x14ce('0x10')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x14ce('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x14ce('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x14ce('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x14ce('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x14ce('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x14ce('0x6')](0x9)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x14ce('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x14ce('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14ce('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x14ce('0x17'),_0x14ce('0x18')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x14ce('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14ce('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x14ce('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14ce('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14ce('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x14ce('0x6')](0x3)[_0x14ce('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14ce('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x14ce('0x6')](0x5)[_0x14ce('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5effc26..d9a0b5f 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 _0x9703=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','update','destroy','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','CmHopperBlack','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','set','Content-Range','json','reject','save','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','Campaign','findAll','rows','catch','params','rawAttributes','fields','options'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9703,0xdb));var _0x3970=function(_0x546278,_0x9c3521){_0x546278=_0x546278-0x0;var _0x3f0647=_0x9703[_0x546278];return _0x3f0647;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3970('0x0'));var jsonpatch=require(_0x3970('0x1'));var rp=require(_0x3970('0x2'));var moment=require('moment');var BPromise=require(_0x3970('0x3'));var Mustache=require('mustache');var util=require(_0x3970('0x4'));var path=require('path');var sox=require(_0x3970('0x5'));var csv=require(_0x3970('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3970('0x7'));var squel=require(_0x3970('0x8'));var crypto=require(_0x3970('0x9'));var jsforce=require(_0x3970('0xa'));var deskjs=require(_0x3970('0xb'));var toCsv=require(_0x3970('0x6'));var querystring=require(_0x3970('0xc'));var Papa=require(_0x3970('0xd'));var Redis=require('ioredis');var authService=require(_0x3970('0xe'));var qs=require(_0x3970('0xf'));var as=require(_0x3970('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3970('0x11'))(_0x3970('0x12'));var utils=require('../../config/utils');var config=require(_0x3970('0x13'));var licenseUtil=require(_0x3970('0x14'));var db=require(_0x3970('0x15'))['db'];function respondWithStatusCode(_0x261275,_0x5920fb){_0x5920fb=_0x5920fb||0xcc;return function(_0x116af8){if(_0x116af8){return _0x261275[_0x3970('0x16')](_0x5920fb);}return _0x261275[_0x3970('0x17')](_0x5920fb)[_0x3970('0x18')]();};}function respondWithResult(_0x1cd5d9,_0x1089c0){_0x1089c0=_0x1089c0||0xc8;return function(_0x1dc283){if(_0x1dc283){return _0x1cd5d9[_0x3970('0x17')](_0x1089c0)['json'](_0x1dc283);}};}function respondWithFilteredResult(_0x1a617c,_0x176652){return function(_0x4de4ee){if(_0x4de4ee){var _0x21f297=typeof _0x176652[_0x3970('0x19')]==='undefined'&&typeof _0x176652['limit']==='undefined';var _0x3743c4=_0x4de4ee[_0x3970('0x1a')];var _0x5747a2=_0x21f297?0x0:_0x176652['offset'];var _0x21bd6b=_0x21f297?_0x4de4ee[_0x3970('0x1a')]:_0x176652[_0x3970('0x19')]+_0x176652['limit'];var _0x4bef3d;if(_0x21bd6b>=_0x3743c4){_0x21bd6b=_0x3743c4;_0x4bef3d=0xc8;}else{_0x4bef3d=0xce;}_0x1a617c[_0x3970('0x17')](_0x4bef3d);return _0x1a617c[_0x3970('0x1b')](_0x3970('0x1c'),_0x5747a2+'-'+_0x21bd6b+'/'+_0x3743c4)[_0x3970('0x1d')](_0x4de4ee);}return null;};}function patchUpdates(_0x3c865){return function(_0x14b28b){try{jsonpatch['apply'](_0x14b28b,_0x3c865,!![]);}catch(_0x475742){return BPromise[_0x3970('0x1e')](_0x475742);}return _0x14b28b[_0x3970('0x1f')]();};}function saveUpdates(_0x112fd0,_0x2058c5){return function(_0x308370){if(_0x308370){return _0x308370['update'](_0x112fd0)[_0x3970('0x20')](function(_0x48f9a5){return _0x48f9a5;});}return null;};}function removeEntity(_0x20f35b,_0x5f3d74){return function(_0xf010ac){if(_0xf010ac){return _0xf010ac['destroy']()[_0x3970('0x20')](function(){var _0x19f504=_0xf010ac[_0x3970('0x21')]({'plain':!![]});var _0x3889a7=_0x3970('0x22');return db[_0x3970('0x23')]['destroy']({'where':{'type':_0x3889a7,'resourceId':_0x19f504['id']}})[_0x3970('0x20')](function(){return _0xf010ac;});})[_0x3970('0x20')](function(){_0x20f35b[_0x3970('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37479f,_0x26cd59){return function(_0x5c34ef){if(!_0x5c34ef){_0x37479f[_0x3970('0x16')](0x194);}return _0x5c34ef;};}function handleError(_0x4e7ac6,_0x486ab9){_0x486ab9=_0x486ab9||0x1f4;return function(_0x544f15){logger[_0x3970('0x24')](_0x544f15[_0x3970('0x25')]);if(_0x544f15[_0x3970('0x26')]){delete _0x544f15[_0x3970('0x26')];}_0x4e7ac6[_0x3970('0x17')](_0x486ab9)[_0x3970('0x27')](_0x544f15);};}exports['index']=function(_0x4ec998,_0x1f0f0c){var _0x1a36da={},_0x4e2874={},_0x206cf1={'count':0x0,'rows':[]};var _0x15556e=_[_0x3970('0x28')](db['Campaign']['rawAttributes'],function(_0x5b8664){return{'name':_0x5b8664[_0x3970('0x29')],'type':_0x5b8664[_0x3970('0x2a')][_0x3970('0x2b')]};});_0x4e2874['model']=_[_0x3970('0x28')](_0x15556e,_0x3970('0x26'));_0x4e2874[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x4ec998[_0x3970('0x2c')]);_0x4e2874[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x4e2874[_0x3970('0x30')],_0x4e2874[_0x3970('0x2c')]);_0x1a36da['attributes']=_[_0x3970('0x2f')](_0x4e2874[_0x3970('0x30')],qs['fields'](_0x4ec998[_0x3970('0x2c')]['fields']));_0x1a36da[_0x3970('0x31')]=_0x1a36da[_0x3970('0x31')][_0x3970('0x32')]?_0x1a36da[_0x3970('0x31')]:_0x4e2874[_0x3970('0x30')];if(!_0x4ec998['query'][_0x3970('0x33')](_0x3970('0x34'))){_0x1a36da['limit']=qs[_0x3970('0x35')](_0x4ec998[_0x3970('0x2c')][_0x3970('0x35')]);_0x1a36da[_0x3970('0x19')]=qs['offset'](_0x4ec998[_0x3970('0x2c')][_0x3970('0x19')]);}_0x1a36da[_0x3970('0x36')]=qs[_0x3970('0x37')](_0x4ec998[_0x3970('0x2c')]['sort']);_0x1a36da['where']=qs[_0x3970('0x2e')](_[_0x3970('0x38')](_0x4ec998[_0x3970('0x2c')],_0x4e2874[_0x3970('0x2e')]),_0x15556e);if(_0x4ec998['query'][_0x3970('0x39')]){_0x1a36da[_0x3970('0x3a')]=_[_0x3970('0x3b')](_0x1a36da[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x15556e,function(_0xd6d13d){if(_0xd6d13d[_0x3970('0x2a')]!==_0x3970('0x3c')){var _0x5f09f2={};_0x5f09f2[_0xd6d13d['name']]={'$like':'%'+_0x4ec998[_0x3970('0x2c')][_0x3970('0x39')]+'%'};return _0x5f09f2;}})});}_0x1a36da=_['merge']({},_0x1a36da,_0x4ec998['options']);var _0x478369={'where':_0x1a36da[_0x3970('0x3a')]};return db['Campaign'][_0x3970('0x1a')](_0x478369)['then'](function(_0x496963){_0x206cf1[_0x3970('0x1a')]=_0x496963;if(_0x4ec998[_0x3970('0x2c')][_0x3970('0x3d')]){_0x1a36da[_0x3970('0x3e')]=[{'all':!![]}];}return db[_0x3970('0x3f')][_0x3970('0x40')](_0x1a36da);})[_0x3970('0x20')](function(_0x448538){_0x206cf1[_0x3970('0x41')]=_0x448538;return _0x206cf1;})[_0x3970('0x20')](respondWithFilteredResult(_0x1f0f0c,_0x1a36da))[_0x3970('0x42')](handleError(_0x1f0f0c,null));};exports['show']=function(_0x4dfbe1,_0x309e75){var _0x1623a2={'raw':![],'where':{'id':_0x4dfbe1[_0x3970('0x43')]['id']}},_0x851b79={};_0x851b79['model']=_[_0x3970('0x2d')](db['Campaign'][_0x3970('0x44')]);_0x851b79[_0x3970('0x2c')]=_['keys'](_0x4dfbe1['query']);_0x851b79['filters']=_['intersection'](_0x851b79[_0x3970('0x30')],_0x851b79[_0x3970('0x2c')]);_0x1623a2['attributes']=_[_0x3970('0x2f')](_0x851b79[_0x3970('0x30')],qs['fields'](_0x4dfbe1[_0x3970('0x2c')][_0x3970('0x45')]));_0x1623a2['attributes']=_0x1623a2[_0x3970('0x31')][_0x3970('0x32')]?_0x1623a2['attributes']:_0x851b79[_0x3970('0x30')];if(_0x4dfbe1['query'][_0x3970('0x3d')]){_0x1623a2[_0x3970('0x3e')]=[{'all':!![]}];}_0x1623a2=_[_0x3970('0x3b')]({},_0x1623a2,_0x4dfbe1[_0x3970('0x46')]);return db[_0x3970('0x3f')]['find'](_0x1623a2)['then'](handleEntityNotFound(_0x309e75,null))['then'](respondWithResult(_0x309e75,null))[_0x3970('0x42')](handleError(_0x309e75,null));};exports[_0x3970('0x47')]=function(_0x18bd6e,_0x238c4f){return db[_0x3970('0x3f')][_0x3970('0x47')](_0x18bd6e[_0x3970('0x48')],{})[_0x3970('0x20')](function(_0x2ee650){var _0x56152d=_0x18bd6e[_0x3970('0x49')][_0x3970('0x21')]({'plain':!![]});if(!_0x56152d)throw new Error(_0x3970('0x4a'));if(_0x56152d[_0x3970('0x4b')]===_0x3970('0x49')){var _0x27ecb7=_0x2ee650['get']({'plain':!![]});var _0x5686a4=_0x3970('0x22');return db[_0x3970('0x4c')][_0x3970('0x4d')]({'where':{'name':_0x5686a4,'userProfileId':_0x56152d[_0x3970('0x4e')]},'raw':!![]})[_0x3970('0x20')](function(_0x303250){if(_0x303250&&_0x303250[_0x3970('0x4f')]===0x0){return db[_0x3970('0x23')][_0x3970('0x47')]({'name':_0x27ecb7['name'],'resourceId':_0x27ecb7['id'],'type':_0x303250['name'],'sectionId':_0x303250['id']},{})[_0x3970('0x20')](function(){return _0x2ee650;});}else{return _0x2ee650;}})[_0x3970('0x42')](function(_0x1630ec){logger[_0x3970('0x24')](_0x3970('0x50'),_0x1630ec);throw _0x1630ec;});}return _0x2ee650;})[_0x3970('0x20')](respondWithResult(_0x238c4f,0xc9))[_0x3970('0x42')](handleError(_0x238c4f,null));};exports[_0x3970('0x51')]=function(_0x5758ff,_0x59678d){var _0x4f788b={'where':{'id':_0x5758ff[_0x3970('0x43')]['id']}},_0x190bd0={};_0x190bd0['model']=_[_0x3970('0x2d')](db['Campaign']['rawAttributes']);_0x4f788b[_0x3970('0x31')]=_[_0x3970('0x2f')](_0x190bd0[_0x3970('0x30')],qs[_0x3970('0x45')](_0x5758ff[_0x3970('0x2c')][_0x3970('0x45')]));_0x4f788b[_0x3970('0x31')]=_0x4f788b[_0x3970('0x31')]['length']?_0x4f788b['attributes']:_0x190bd0[_0x3970('0x30')];if(_0x5758ff[_0x3970('0x2c')][_0x3970('0x3d')]){_0x4f788b[_0x3970('0x3e')]=[{'all':!![]}];}_0x4f788b=_[_0x3970('0x3b')]({},_0x4f788b,_0x5758ff['options']);return db[_0x3970('0x3f')][_0x3970('0x4d')](_0x4f788b)['then'](handleEntityNotFound(_0x59678d,null))[_0x3970('0x20')](function(_0x247cc3){if(_0x247cc3){var _0x47f28b=_0x247cc3['get']({'plain':!![]});_0x47f28b=qs[_0x3970('0x52')](_0x47f28b,['id',_0x3970('0x53'),_0x3970('0x54')]);_0x5758ff[_0x3970('0x48')]=_[_0x3970('0x52')](_0x5758ff[_0x3970('0x48')],['id',_0x3970('0x53'),_0x3970('0x54')]);return db['Campaign'][_0x3970('0x47')](_[_0x3970('0x3b')](_0x47f28b,_0x5758ff[_0x3970('0x48')]),{'include':_0x5758ff['query'][_0x3970('0x3d')]?[{'all':!![]}]:undefined})[_0x3970('0x20')](function(_0x5402dc){var _0x3773a6=_0x5758ff['user'][_0x3970('0x21')]({'plain':!![]});if(!_0x3773a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3773a6[_0x3970('0x4b')]===_0x3970('0x49')){var _0x68ac1=_0x5402dc[_0x3970('0x21')]({'plain':!![]});var _0x5c54aa=_0x3970('0x22');return db[_0x3970('0x4c')][_0x3970('0x4d')]({'where':{'name':_0x5c54aa,'userProfileId':_0x3773a6[_0x3970('0x4e')]},'raw':!![]})[_0x3970('0x20')](function(_0x249764){if(_0x249764&&_0x249764[_0x3970('0x4f')]===0x0){return db[_0x3970('0x23')][_0x3970('0x47')]({'name':_0x68ac1[_0x3970('0x26')],'resourceId':_0x68ac1['id'],'type':_0x249764[_0x3970('0x26')],'sectionId':_0x249764['id']},{})[_0x3970('0x20')](function(){return _0x5402dc;});}else{return _0x5402dc;}})[_0x3970('0x42')](function(_0x2f1372){logger[_0x3970('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f1372);throw _0x2f1372;});}return _0x5402dc;});}})[_0x3970('0x20')](respondWithResult(_0x59678d,0xc9))['catch'](handleError(_0x59678d,null));};exports[_0x3970('0x55')]=function(_0x535f69,_0x1f33ea){if(_0x535f69['body']['id']){delete _0x535f69[_0x3970('0x48')]['id'];}return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x535f69[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x1f33ea,null))[_0x3970('0x20')](saveUpdates(_0x535f69[_0x3970('0x48')],null))[_0x3970('0x20')](respondWithResult(_0x1f33ea,null))[_0x3970('0x42')](handleError(_0x1f33ea,null));};exports[_0x3970('0x56')]=function(_0x19913a,_0xe6e639){return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x19913a[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0xe6e639,null))[_0x3970('0x20')](removeEntity(_0xe6e639,null))[_0x3970('0x42')](handleError(_0xe6e639,null));};exports['getHoppers']=function(_0x93ad95,_0x85819b,_0x2155f9){var _0x549e19={'raw':!![],'where':{}};var _0xbe56d9={};var _0x2031cd={'count':0x0,'rows':[]};return db['Campaign'][_0x3970('0x57')]({'where':{'id':_0x93ad95[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x85819b,null))[_0x3970('0x20')](function(_0x124dfd){if(_0x124dfd){_0xbe56d9[_0x3970('0x30')]=_[_0x3970('0x2d')](db[_0x3970('0x58')][_0x3970('0x44')]);_0xbe56d9[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x93ad95[_0x3970('0x2c')]);_0xbe56d9[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0xbe56d9[_0x3970('0x30')],_0xbe56d9[_0x3970('0x2c')]);_0x549e19['attributes']=_[_0x3970('0x2f')](_0xbe56d9['model'],qs['fields'](_0x93ad95[_0x3970('0x2c')][_0x3970('0x45')]));_0x549e19[_0x3970('0x31')]=_0x549e19['attributes'][_0x3970('0x32')]?_0x549e19[_0x3970('0x31')]:_0xbe56d9[_0x3970('0x30')];if(!_0x93ad95[_0x3970('0x2c')][_0x3970('0x33')]('nolimit')){_0x549e19[_0x3970('0x35')]=qs['limit'](_0x93ad95['query'][_0x3970('0x35')]);_0x549e19[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x93ad95[_0x3970('0x2c')][_0x3970('0x19')]);}_0x549e19[_0x3970('0x36')]=qs['sort'](_0x93ad95[_0x3970('0x2c')][_0x3970('0x37')]);_0x549e19[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_[_0x3970('0x38')](_0x93ad95[_0x3970('0x2c')],_0xbe56d9['filters']));_0x549e19['where'][_0x3970('0x59')]=_0x124dfd['id'];if(_0x93ad95[_0x3970('0x2c')][_0x3970('0x39')]){_0x549e19[_0x3970('0x3a')]=_[_0x3970('0x3b')](_0x549e19[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x549e19['attributes'],function(_0xc4ec5f){var _0x2d5fc9={};_0x2d5fc9[_0xc4ec5f]={'$like':'%'+_0x93ad95[_0x3970('0x2c')][_0x3970('0x39')]+'%'};return _0x2d5fc9;})});}_0x549e19=_[_0x3970('0x3b')]({},_0x549e19,_0x93ad95['options']);return db[_0x3970('0x58')][_0x3970('0x1a')]({'where':_0x549e19[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0x301398){_0x2031cd['count']=_0x301398;if(_0x93ad95[_0x3970('0x2c')][_0x3970('0x3d')]){_0x549e19[_0x3970('0x3e')]=[{'all':!![]}];}return db['CmHopper'][_0x3970('0x40')](_0x549e19);})['then'](function(_0x5384bd){_0x2031cd[_0x3970('0x41')]=_0x5384bd;return _0x2031cd;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x85819b,_0x549e19))['catch'](handleError(_0x85819b,null));};exports['getHopperHistories']=function(_0x797568,_0x2fdcb7,_0x31d1ed){var _0x432231={'raw':!![],'where':{}};var _0x48df95={};var _0x1bb13e={'count':0x0,'rows':[]};return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x797568[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x2fdcb7,null))[_0x3970('0x20')](function(_0x5da887){if(_0x5da887){_0x48df95['model']=_[_0x3970('0x2d')](db[_0x3970('0x5a')]['rawAttributes']);_0x48df95[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x797568[_0x3970('0x2c')]);_0x48df95[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x48df95[_0x3970('0x30')],_0x48df95[_0x3970('0x2c')]);_0x432231[_0x3970('0x31')]=_[_0x3970('0x2f')](_0x48df95[_0x3970('0x30')],qs[_0x3970('0x45')](_0x797568[_0x3970('0x2c')][_0x3970('0x45')]));_0x432231[_0x3970('0x31')]=_0x432231['attributes'][_0x3970('0x32')]?_0x432231[_0x3970('0x31')]:_0x48df95[_0x3970('0x30')];if(!_0x797568[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x432231[_0x3970('0x35')]=qs['limit'](_0x797568[_0x3970('0x2c')][_0x3970('0x35')]);_0x432231[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x797568[_0x3970('0x2c')]['offset']);}_0x432231['order']=qs[_0x3970('0x37')](_0x797568[_0x3970('0x2c')][_0x3970('0x37')]);_0x432231[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_['pick'](_0x797568[_0x3970('0x2c')],_0x48df95[_0x3970('0x2e')]));_0x432231[_0x3970('0x3a')]['CampaignId']=_0x5da887['id'];if(_0x797568[_0x3970('0x2c')][_0x3970('0x39')]){_0x432231[_0x3970('0x3a')]=_['merge'](_0x432231['where'],{'$or':_['map'](_0x432231[_0x3970('0x31')],function(_0x2fff29){var _0x2bd475={};_0x2bd475[_0x2fff29]={'$like':'%'+_0x797568[_0x3970('0x2c')]['filter']+'%'};return _0x2bd475;})});}_0x432231=_[_0x3970('0x3b')]({},_0x432231,_0x797568[_0x3970('0x46')]);return db['CmHopperHistory'][_0x3970('0x1a')]({'where':_0x432231[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0x14a377){_0x1bb13e[_0x3970('0x1a')]=_0x14a377;if(_0x797568['query'][_0x3970('0x3d')]){_0x432231[_0x3970('0x3e')]=[{'all':!![]}];}return db[_0x3970('0x5a')][_0x3970('0x40')](_0x432231);})['then'](function(_0x29713c){_0x1bb13e[_0x3970('0x41')]=_0x29713c;return _0x1bb13e;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x2fdcb7,_0x432231))[_0x3970('0x42')](handleError(_0x2fdcb7,null));};exports[_0x3970('0x5b')]=function(_0x336024,_0x43ea9f,_0x36a459){var _0x4432eb={'raw':!![],'where':{}};var _0x1e9aa8={};var _0x14d573={'count':0x0,'rows':[]};return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x336024[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x43ea9f,null))[_0x3970('0x20')](function(_0xb8112f){if(_0xb8112f){_0x1e9aa8['model']=_['keys'](db['CmHopperFinal'][_0x3970('0x44')]);_0x1e9aa8['query']=_[_0x3970('0x2d')](_0x336024[_0x3970('0x2c')]);_0x1e9aa8[_0x3970('0x2e')]=_['intersection'](_0x1e9aa8['model'],_0x1e9aa8['query']);_0x4432eb[_0x3970('0x31')]=_['intersection'](_0x1e9aa8['model'],qs[_0x3970('0x45')](_0x336024[_0x3970('0x2c')][_0x3970('0x45')]));_0x4432eb[_0x3970('0x31')]=_0x4432eb[_0x3970('0x31')]['length']?_0x4432eb['attributes']:_0x1e9aa8[_0x3970('0x30')];if(!_0x336024[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x4432eb[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x336024[_0x3970('0x2c')]['limit']);_0x4432eb[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x336024[_0x3970('0x2c')][_0x3970('0x19')]);}_0x4432eb[_0x3970('0x36')]=qs[_0x3970('0x37')](_0x336024[_0x3970('0x2c')][_0x3970('0x37')]);_0x4432eb[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_[_0x3970('0x38')](_0x336024[_0x3970('0x2c')],_0x1e9aa8[_0x3970('0x2e')]));_0x4432eb[_0x3970('0x3a')]['CampaignId']=_0xb8112f['id'];if(_0x336024[_0x3970('0x2c')][_0x3970('0x39')]){_0x4432eb[_0x3970('0x3a')]=_['merge'](_0x4432eb[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x4432eb[_0x3970('0x31')],function(_0x45d85c){var _0x544a62={};_0x544a62[_0x45d85c]={'$like':'%'+_0x336024[_0x3970('0x2c')]['filter']+'%'};return _0x544a62;})});}_0x4432eb=_[_0x3970('0x3b')]({},_0x4432eb,_0x336024['options']);return db[_0x3970('0x5c')][_0x3970('0x1a')]({'where':_0x4432eb[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0xfd2c73){_0x14d573[_0x3970('0x1a')]=_0xfd2c73;if(_0x336024[_0x3970('0x2c')][_0x3970('0x3d')]){_0x4432eb[_0x3970('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3970('0x40')](_0x4432eb);})['then'](function(_0x3027ef){_0x14d573[_0x3970('0x41')]=_0x3027ef;return _0x14d573;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x43ea9f,_0x4432eb))[_0x3970('0x42')](handleError(_0x43ea9f,null));};exports[_0x3970('0x5d')]=function(_0x4259c4,_0x399252,_0x9458de){var _0x3e301f={'raw':!![],'where':{}};var _0x579db0={};var _0x54e3ff={'count':0x0,'rows':[]};return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x4259c4[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x399252,null))[_0x3970('0x20')](function(_0x13ebfc){if(_0x13ebfc){_0x579db0[_0x3970('0x30')]=_[_0x3970('0x2d')](db['CmHopperBlack'][_0x3970('0x44')]);_0x579db0[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x4259c4[_0x3970('0x2c')]);_0x579db0[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x579db0['model'],_0x579db0[_0x3970('0x2c')]);_0x3e301f[_0x3970('0x31')]=_[_0x3970('0x2f')](_0x579db0[_0x3970('0x30')],qs[_0x3970('0x45')](_0x4259c4[_0x3970('0x2c')]['fields']));_0x3e301f[_0x3970('0x31')]=_0x3e301f[_0x3970('0x31')]['length']?_0x3e301f[_0x3970('0x31')]:_0x579db0['model'];if(!_0x4259c4[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x3e301f['limit']=qs['limit'](_0x4259c4[_0x3970('0x2c')]['limit']);_0x3e301f['offset']=qs['offset'](_0x4259c4['query'][_0x3970('0x19')]);}_0x3e301f['order']=qs['sort'](_0x4259c4[_0x3970('0x2c')][_0x3970('0x37')]);_0x3e301f[_0x3970('0x3a')]=qs['filters'](_[_0x3970('0x38')](_0x4259c4[_0x3970('0x2c')],_0x579db0[_0x3970('0x2e')]));_0x3e301f[_0x3970('0x3a')][_0x3970('0x59')]=_0x13ebfc['id'];if(_0x4259c4['query'][_0x3970('0x39')]){_0x3e301f[_0x3970('0x3a')]=_['merge'](_0x3e301f[_0x3970('0x3a')],{'$or':_['map'](_0x3e301f['attributes'],function(_0x54bf08){var _0x5eebd8={};_0x5eebd8[_0x54bf08]={'$like':'%'+_0x4259c4['query'][_0x3970('0x39')]+'%'};return _0x5eebd8;})});}_0x3e301f=_['merge']({},_0x3e301f,_0x4259c4['options']);return db['CmHopperBlack'][_0x3970('0x1a')]({'where':_0x3e301f[_0x3970('0x3a')]})[_0x3970('0x20')](function(_0x234715){_0x54e3ff[_0x3970('0x1a')]=_0x234715;if(_0x4259c4[_0x3970('0x2c')]['includeAll']){_0x3e301f[_0x3970('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3970('0x40')](_0x3e301f);})[_0x3970('0x20')](function(_0x5a32d8){_0x54e3ff['rows']=_0x5a32d8;return _0x54e3ff;});}})[_0x3970('0x20')](respondWithFilteredResult(_0x399252,_0x3e301f))[_0x3970('0x42')](handleError(_0x399252,null));};exports[_0x3970('0x5e')]=function(_0x3b9b50,_0x47dce3,_0x631808){var _0xc673f5={};var _0x391fba={};var _0x19be5f;var _0x196a82;return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x3b9b50[_0x3970('0x43')]['id']}})['then'](handleEntityNotFound(_0x47dce3,null))[_0x3970('0x20')](function(_0x2e2e7c){if(_0x2e2e7c){_0x19be5f=_0x2e2e7c;_0x391fba[_0x3970('0x30')]=_[_0x3970('0x2d')](db[_0x3970('0x5f')][_0x3970('0x44')]);_0x391fba[_0x3970('0x2c')]=_[_0x3970('0x2d')](_0x3b9b50[_0x3970('0x2c')]);_0x391fba[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x391fba[_0x3970('0x30')],_0x391fba['query']);_0xc673f5[_0x3970('0x31')]=_['intersection'](_0x391fba[_0x3970('0x30')],qs['fields'](_0x3b9b50[_0x3970('0x2c')][_0x3970('0x45')]));_0xc673f5[_0x3970('0x31')]=_0xc673f5['attributes'][_0x3970('0x32')]?_0xc673f5[_0x3970('0x31')]:_0x391fba[_0x3970('0x30')];_0xc673f5[_0x3970('0x36')]=qs['sort'](_0x3b9b50[_0x3970('0x2c')]['sort']);_0xc673f5[_0x3970('0x3a')]=qs['filters'](_[_0x3970('0x38')](_0x3b9b50[_0x3970('0x2c')],_0x391fba[_0x3970('0x2e')]));if(_0x3b9b50[_0x3970('0x2c')]['filter']){_0xc673f5[_0x3970('0x3a')]=_['merge'](_0xc673f5[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0xc673f5['attributes'],function(_0x592b83){var _0x210ce4={};_0x210ce4[_0x592b83]={'$like':'%'+_0x3b9b50['query'][_0x3970('0x39')]+'%'};return _0x210ce4;})});}_0xc673f5=_[_0x3970('0x3b')]({},_0xc673f5,_0x3b9b50[_0x3970('0x46')]);return _0x19be5f[_0x3970('0x5e')](_0xc673f5);}})[_0x3970('0x20')](function(_0x362f18){if(_0x362f18){_0x196a82=_0x362f18[_0x3970('0x32')];if(!_0x3b9b50[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0xc673f5[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x3b9b50[_0x3970('0x2c')][_0x3970('0x35')]);_0xc673f5[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x3b9b50[_0x3970('0x2c')]['offset']);}return _0x19be5f[_0x3970('0x5e')](_0xc673f5);}})[_0x3970('0x20')](function(_0x3cc230){if(_0x3cc230){return _0x3cc230?{'count':_0x196a82,'rows':_0x3cc230}:null;}})[_0x3970('0x20')](respondWithResult(_0x47dce3,null))['catch'](handleError(_0x47dce3,null));};exports[_0x3970('0x60')]=function(_0x401359,_0x5198cd,_0x3a3fec){var _0x350d29,_0x14d136;var _0x2133b0=[];var _0x2d9810=moment()[_0x3970('0x61')](_0x3970('0x62'));return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x401359[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x5198cd,null))['then'](function(_0x12b7d2){if(_0x12b7d2){_0x14d136=_0x12b7d2;return _0x12b7d2[_0x3970('0x60')](_0x401359[_0x3970('0x48')][_0x3970('0x63')],_[_0x3970('0x52')](_0x401359[_0x3970('0x48')],[_0x3970('0x63'),'id'])||{});}return null;})[_0x3970('0x64')](function(_0x52978a){var _0x139a0e;var _0x56036a;_0x350d29=_0x52978a||[];var _0x2ddd93=[];if(_0x52978a){for(var _0x3d6106=0x0;_0x3d6106<_0x52978a[_0x3970('0x32')];_0x3d6106+=0x1){var _0x17dad1=_0x52978a[_0x3d6106][_0x3970('0x21')]({'plain':!![]});_0x14d136[_0x3970('0x65')]=_0x401359[_0x3970('0x48')][_0x3970('0x65')]?_0x401359[_0x3970('0x48')]['dialCheckDuplicateType']:_0x14d136[_0x3970('0x65')];switch(_0x14d136[_0x3970('0x65')]){case _0x3970('0x66'):_0x139a0e=squel[_0x3970('0x67')]()[_0x3970('0x68')](_0x3970('0x69'))[_0x3970('0x6a')]([_0x3970('0x6b'),_0x3970('0x6c'),_0x3970('0x6d'),_0x3970('0x6e'),_0x3970('0x59'),_0x3970('0x53'),_0x3970('0x54')],squel[_0x3970('0x6f')]()['field']('phone','phone')[_0x3970('0x70')](_0x3970('0x71'),_0x3970('0x6c'))['field']('id','ContactId')[_0x3970('0x70')](_0x17dad1['CmListId'][_0x3970('0x72')](),'ListId')[_0x3970('0x70')](_0x401359['params']['id']['toString'](),_0x3970('0x59'))['field']('\x27'+_0x2d9810+'\x27',_0x3970('0x53'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27','updatedAt')[_0x3970('0x73')](_0x3970('0x74'))[_0x3970('0x3a')](_0x3970('0x75'))['where'](_0x3970('0x76'),_0x17dad1[_0x3970('0x77')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x3970('0x78'),squel['select']()[_0x3970('0x70')](_0x3970('0x79'))[_0x3970('0x73')]('cm_hopper_final')[_0x3970('0x3a')](_0x3970('0x7a'),_0x401359[_0x3970('0x43')]['id'][_0x3970('0x72')]()))[_0x3970('0x3a')](_0x3970('0x78'),squel[_0x3970('0x6f')]()[_0x3970('0x70')](_0x3970('0x7b'))[_0x3970('0x73')](_0x3970('0x69'))[_0x3970('0x3a')](_0x3970('0x7a'),_0x401359[_0x3970('0x43')]['id'][_0x3970('0x72')]())))[_0x3970('0x72')]();break;case _0x3970('0x7c'):_0x139a0e=squel[_0x3970('0x67')]()['into'](_0x3970('0x69'))[_0x3970('0x6a')]([_0x3970('0x6b'),_0x3970('0x6c'),_0x3970('0x6d'),'ListId','CampaignId',_0x3970('0x53'),_0x3970('0x54')],squel['select']()[_0x3970('0x70')](_0x3970('0x6b'),_0x3970('0x6b'))[_0x3970('0x70')](_0x3970('0x71'),'scheduledAt')[_0x3970('0x70')]('id',_0x3970('0x6d'))[_0x3970('0x70')](_0x17dad1[_0x3970('0x77')][_0x3970('0x72')](),_0x3970('0x6e'))[_0x3970('0x70')](_0x401359[_0x3970('0x43')]['id'][_0x3970('0x72')](),_0x3970('0x59'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27',_0x3970('0x53'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27',_0x3970('0x54'))[_0x3970('0x73')](_0x3970('0x74'))[_0x3970('0x3a')](_0x3970('0x75'))['where']('ListId\x20=\x20?',_0x17dad1[_0x3970('0x77')]['toString']())['where'](_0x3970('0x7d'))[_0x3970('0x3a')](_0x3970('0x78'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x3970('0x73')](_0x3970('0x69'))[_0x3970('0x3a')](_0x3970('0x7a'),_0x401359[_0x3970('0x43')]['id']['toString']())))[_0x3970('0x72')]();break;default:_0x139a0e=squel[_0x3970('0x67')]()[_0x3970('0x68')](_0x3970('0x69'))[_0x3970('0x6a')]([_0x3970('0x6b'),'scheduledAt',_0x3970('0x6d'),'ListId',_0x3970('0x59'),_0x3970('0x53'),_0x3970('0x54')],squel['select']()[_0x3970('0x70')](_0x3970('0x6b'),'phone')[_0x3970('0x70')](_0x3970('0x71'),_0x3970('0x6c'))[_0x3970('0x70')]('id',_0x3970('0x6d'))[_0x3970('0x70')](_0x17dad1[_0x3970('0x77')][_0x3970('0x72')](),_0x3970('0x6e'))[_0x3970('0x70')](_0x401359[_0x3970('0x43')]['id']['toString'](),'CampaignId')[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27','createdAt')['field']('\x27'+_0x2d9810+'\x27',_0x3970('0x54'))[_0x3970('0x73')](_0x3970('0x74'))[_0x3970('0x3a')](_0x3970('0x75'))['where'](_0x3970('0x76'),_0x17dad1[_0x3970('0x77')][_0x3970('0x72')]())[_0x3970('0x3a')](_0x3970('0x7d')))[_0x3970('0x72')]();}_0x56036a=squel[_0x3970('0x67')]()[_0x3970('0x68')]('cm_hopper_additional_phones')['fromQuery'](['cmHopperId','scheduledAt','phone',_0x3970('0x7e'),_0x3970('0x53'),_0x3970('0x54')],squel[_0x3970('0x6f')]()[_0x3970('0x70')](_0x3970('0x7f'),'id')[_0x3970('0x70')](_0x3970('0x71'),_0x3970('0x6c'))[_0x3970('0x70')](_0x3970('0x80'),'phone')['field'](_0x3970('0x81'),_0x3970('0x7e'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27',_0x3970('0x53'))[_0x3970('0x70')]('\x27'+_0x2d9810+'\x27','updatedAt')[_0x3970('0x73')](_0x3970('0x82'),'ci')[_0x3970('0x83')](_0x3970('0x69'),'h',_0x3970('0x84'))['where'](_0x3970('0x85'),_0x17dad1[_0x3970('0x77')][_0x3970('0x72')]())['where'](_0x3970('0x86'),_0x401359['params']['id']['toString']())['where'](_0x3970('0x87'),_0x2d9810))[_0x3970('0x72')]();_0x2ddd93[_0x3970('0x88')](db[_0x3970('0x89')][_0x3970('0x2c')](_0x139a0e));_0x2133b0['push'](db[_0x3970('0x89')][_0x3970('0x2c')](_0x56036a));}return BPromise['all'](_0x2ddd93);}})[_0x3970('0x20')](function(){return BPromise[_0x3970('0x8a')](_0x2133b0);})['then'](function(){return _0x350d29;})[_0x3970('0x20')](respondWithResult(_0x5198cd,null))[_0x3970('0x42')](handleError(_0x5198cd,null));};exports['removeLists']=function(_0x16ba06,_0x3fba57,_0x1ed79b){return db[_0x3970('0x3f')]['find']({'where':{'id':_0x16ba06[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x3fba57,null))['then'](function(_0x4acda7){if(_0x4acda7){return _0x4acda7[_0x3970('0x8b')](_0x16ba06[_0x3970('0x2c')]['ids']);}})[_0x3970('0x20')](function(_0xf6a5fe){if(_0xf6a5fe){return db[_0x3970('0x58')]['destroy']({'where':{'ListId':_0x16ba06['query']['ids'],'CampaignId':_0x16ba06[_0x3970('0x43')]['id']}})[_0x3970('0x20')](function(){return _0xf6a5fe;});}})[_0x3970('0x20')](respondWithStatusCode(_0x3fba57,null))[_0x3970('0x42')](handleError(_0x3fba57,null));};exports[_0x3970('0x8c')]=function(_0x515da2,_0x3ee1eb,_0x981570){var _0x35c09c={};var _0x417aef={};var _0x79858e;var _0x47fe0e;return db[_0x3970('0x3f')][_0x3970('0x57')]({'where':{'id':_0x515da2[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x3ee1eb,null))[_0x3970('0x20')](function(_0x37b61b){if(_0x37b61b){_0x79858e=_0x37b61b;_0x417aef[_0x3970('0x30')]=_[_0x3970('0x2d')](db[_0x3970('0x5f')][_0x3970('0x44')]);_0x417aef[_0x3970('0x2c')]=_['keys'](_0x515da2['query']);_0x417aef[_0x3970('0x2e')]=_[_0x3970('0x2f')](_0x417aef[_0x3970('0x30')],_0x417aef[_0x3970('0x2c')]);_0x35c09c['attributes']=_[_0x3970('0x2f')](_0x417aef['model'],qs[_0x3970('0x45')](_0x515da2[_0x3970('0x2c')][_0x3970('0x45')]));_0x35c09c['attributes']=_0x35c09c[_0x3970('0x31')][_0x3970('0x32')]?_0x35c09c[_0x3970('0x31')]:_0x417aef[_0x3970('0x30')];_0x35c09c[_0x3970('0x36')]=qs['sort'](_0x515da2[_0x3970('0x2c')][_0x3970('0x37')]);_0x35c09c[_0x3970('0x3a')]=qs[_0x3970('0x2e')](_['pick'](_0x515da2['query'],_0x417aef[_0x3970('0x2e')]));if(_0x515da2[_0x3970('0x2c')][_0x3970('0x39')]){_0x35c09c[_0x3970('0x3a')]=_['merge'](_0x35c09c[_0x3970('0x3a')],{'$or':_[_0x3970('0x28')](_0x35c09c[_0x3970('0x31')],function(_0x13579b){var _0xf37367={};_0xf37367[_0x13579b]={'$like':'%'+_0x515da2[_0x3970('0x2c')][_0x3970('0x39')]+'%'};return _0xf37367;})});}_0x35c09c=_[_0x3970('0x3b')]({},_0x35c09c,_0x515da2[_0x3970('0x46')]);return _0x79858e[_0x3970('0x8c')](_0x35c09c);}})['then'](function(_0x2d4bc1){if(_0x2d4bc1){_0x47fe0e=_0x2d4bc1['length'];if(!_0x515da2[_0x3970('0x2c')][_0x3970('0x33')](_0x3970('0x34'))){_0x35c09c[_0x3970('0x35')]=qs[_0x3970('0x35')](_0x515da2['query'][_0x3970('0x35')]);_0x35c09c[_0x3970('0x19')]=qs[_0x3970('0x19')](_0x515da2[_0x3970('0x2c')]['offset']);}return _0x79858e['getBlackLists'](_0x35c09c);}})[_0x3970('0x20')](function(_0x5d4c52){if(_0x5d4c52){return _0x5d4c52?{'count':_0x47fe0e,'rows':_0x5d4c52}:null;}})[_0x3970('0x20')](respondWithResult(_0x3ee1eb,null))['catch'](handleError(_0x3ee1eb,null));};exports[_0x3970('0x8d')]=function(_0x235ee5,_0x3e4405,_0x141462){var _0x1fe68c,_0x4e1f2f;var _0x4629db=[];var _0x204704=moment()[_0x3970('0x61')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3970('0x3f')][_0x3970('0x4d')]({'where':{'id':_0x235ee5[_0x3970('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e4405,null))[_0x3970('0x20')](function(_0xb350b5){if(_0xb350b5){_0x4e1f2f=_0xb350b5;return _0xb350b5[_0x3970('0x8d')](_0x235ee5['body'][_0x3970('0x63')],_[_0x3970('0x52')](_0x235ee5[_0x3970('0x48')],[_0x3970('0x63'),'id'])||{});}return null;})[_0x3970('0x64')](function(_0x2c919d){var _0x15620a;var _0x3daa69;_0x1fe68c=_0x2c919d||[];var _0x751cbf=[];if(_0x2c919d){for(var _0x5947a3=0x0;_0x5947a3<_0x2c919d['length'];_0x5947a3+=0x1){var _0x543103=_0x2c919d[_0x5947a3][_0x3970('0x21')]({'plain':!![]});_0x15620a=squel[_0x3970('0x67')]()[_0x3970('0x68')](_0x3970('0x8e'))[_0x3970('0x6a')]([_0x3970('0x6b'),'ContactId',_0x3970('0x6e'),_0x3970('0x59'),'createdAt','updatedAt'],squel[_0x3970('0x6f')]()[_0x3970('0x70')](_0x3970('0x6b'),_0x3970('0x6b'))[_0x3970('0x70')]('id','ContactId')[_0x3970('0x70')](_0x543103[_0x3970('0x77')][_0x3970('0x72')](),_0x3970('0x6e'))['field'](_0x235ee5['params']['id'][_0x3970('0x72')](),_0x3970('0x59'))['field']('NOW()','createdAt')[_0x3970('0x70')](_0x3970('0x71'),'updatedAt')['from'](_0x3970('0x74'))['where'](_0x3970('0x75'))[_0x3970('0x3a')]('ListId\x20=\x20?',_0x543103['CmListId'][_0x3970('0x72')]())[_0x3970('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x3970('0x72')]();_0x751cbf[_0x3970('0x88')](db[_0x3970('0x89')][_0x3970('0x2c')](_0x15620a));}return BPromise['all'](_0x751cbf);}})[_0x3970('0x20')](function(){return _0x1fe68c;})[_0x3970('0x20')](respondWithResult(_0x3e4405,null))[_0x3970('0x42')](handleError(_0x3e4405,null));};exports[_0x3970('0x8f')]=function(_0x528062,_0x37cac5,_0x3f950f){return db['Campaign'][_0x3970('0x4d')]({'where':{'id':_0x528062[_0x3970('0x43')]['id']}})[_0x3970('0x20')](handleEntityNotFound(_0x37cac5,null))['then'](function(_0x3398ab){if(_0x3398ab){return _0x3398ab[_0x3970('0x8f')](_0x528062['query'][_0x3970('0x63')]);}})[_0x3970('0x20')](function(_0x45db02){if(_0x45db02){return db[_0x3970('0x90')]['destroy']({'where':{'ListId':_0x528062[_0x3970('0x2c')][_0x3970('0x63')],'CampaignId':_0x528062[_0x3970('0x43')]['id']}})['then'](function(){return _0x45db02;});}})[_0x3970('0x20')](respondWithStatusCode(_0x37cac5,null))[_0x3970('0x42')](handleError(_0x37cac5,null));};
\ No newline at end of file
+var _0xa512=['CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','into','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','rows','catch','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','user','autoAssociation','UserProfileResource','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','findAll'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0xa512,0xcb));var _0x2a51=function(_0xf32c6d,_0x372704){_0xf32c6d=_0xf32c6d-0x0;var _0x156c11=_0xa512[_0xf32c6d];return _0x156c11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a51('0x0'));var zipdir=require(_0x2a51('0x1'));var jsonpatch=require(_0x2a51('0x2'));var rp=require(_0x2a51('0x3'));var moment=require(_0x2a51('0x4'));var BPromise=require(_0x2a51('0x5'));var Mustache=require(_0x2a51('0x6'));var util=require(_0x2a51('0x7'));var path=require(_0x2a51('0x8'));var sox=require(_0x2a51('0x9'));var csv=require(_0x2a51('0xa'));var ejs=require(_0x2a51('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2a51('0xc'));var jsforce=require(_0x2a51('0xd'));var deskjs=require(_0x2a51('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2a51('0xf'));var Redis=require(_0x2a51('0x10'));var authService=require(_0x2a51('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2a51('0x12'));var hardwareService=require(_0x2a51('0x13'));var logger=require(_0x2a51('0x14'))(_0x2a51('0x15'));var utils=require(_0x2a51('0x16'));var config=require(_0x2a51('0x17'));var licenseUtil=require(_0x2a51('0x18'));var db=require(_0x2a51('0x19'))['db'];function respondWithStatusCode(_0x50000f,_0x1ea025){_0x1ea025=_0x1ea025||0xcc;return function(_0x19bab0){if(_0x19bab0){return _0x50000f[_0x2a51('0x1a')](_0x1ea025);}return _0x50000f[_0x2a51('0x1b')](_0x1ea025)[_0x2a51('0x1c')]();};}function respondWithResult(_0x491616,_0x56109d){_0x56109d=_0x56109d||0xc8;return function(_0x4b9a1b){if(_0x4b9a1b){return _0x491616[_0x2a51('0x1b')](_0x56109d)['json'](_0x4b9a1b);}};}function respondWithFilteredResult(_0x17eaf8,_0x4607fe){return function(_0x5ccd9e){if(_0x5ccd9e){var _0x219858=typeof _0x4607fe['offset']===_0x2a51('0x1d')&&typeof _0x4607fe[_0x2a51('0x1e')]===_0x2a51('0x1d');var _0x5221d7=_0x5ccd9e[_0x2a51('0x1f')];var _0x941c8a=_0x219858?0x0:_0x4607fe[_0x2a51('0x20')];var _0xc501aa=_0x219858?_0x5ccd9e['count']:_0x4607fe['offset']+_0x4607fe['limit'];var _0x586113;if(_0xc501aa>=_0x5221d7){_0xc501aa=_0x5221d7;_0x586113=0xc8;}else{_0x586113=0xce;}_0x17eaf8[_0x2a51('0x1b')](_0x586113);return _0x17eaf8[_0x2a51('0x21')]('Content-Range',_0x941c8a+'-'+_0xc501aa+'/'+_0x5221d7)[_0x2a51('0x22')](_0x5ccd9e);}return null;};}function patchUpdates(_0x9516ad){return function(_0x478c30){try{jsonpatch[_0x2a51('0x23')](_0x478c30,_0x9516ad,!![]);}catch(_0x501a68){return BPromise['reject'](_0x501a68);}return _0x478c30[_0x2a51('0x24')]();};}function saveUpdates(_0x5b6096,_0x9b5573){return function(_0x2e941e){if(_0x2e941e){return _0x2e941e[_0x2a51('0x25')](_0x5b6096)[_0x2a51('0x26')](function(_0x5a62ee){return _0x5a62ee;});}return null;};}function removeEntity(_0xa0c8f0,_0x1cf707){return function(_0x1ad13d){if(_0x1ad13d){return _0x1ad13d[_0x2a51('0x27')]()[_0x2a51('0x26')](function(){var _0x247c12=_0x1ad13d[_0x2a51('0x28')]({'plain':!![]});var _0x12ad44=_0x2a51('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x12ad44,'resourceId':_0x247c12['id']}})[_0x2a51('0x26')](function(){return _0x1ad13d;});})[_0x2a51('0x26')](function(){_0xa0c8f0[_0x2a51('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1689e4,_0x51729d){return function(_0x516d1f){if(!_0x516d1f){_0x1689e4[_0x2a51('0x1a')](0x194);}return _0x516d1f;};}function handleError(_0x204516,_0x3c8b51){_0x3c8b51=_0x3c8b51||0x1f4;return function(_0x5e047c){logger[_0x2a51('0x2a')](_0x5e047c[_0x2a51('0x2b')]);if(_0x5e047c['name']){delete _0x5e047c[_0x2a51('0x2c')];}_0x204516[_0x2a51('0x1b')](_0x3c8b51)[_0x2a51('0x2d')](_0x5e047c);};}exports[_0x2a51('0x2e')]=function(_0x1a00d,_0x27d9f5){var _0x59cc4e={},_0x57422d={},_0x4b49d0={'count':0x0,'rows':[]};var _0x3757f0=_['map'](db['Campaign'][_0x2a51('0x2f')],function(_0x332973){return{'name':_0x332973[_0x2a51('0x30')],'type':_0x332973[_0x2a51('0x31')][_0x2a51('0x32')]};});_0x57422d[_0x2a51('0x33')]=_[_0x2a51('0x34')](_0x3757f0,_0x2a51('0x2c'));_0x57422d[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x1a00d['query']);_0x57422d[_0x2a51('0x37')]=_['intersection'](_0x57422d[_0x2a51('0x33')],_0x57422d[_0x2a51('0x35')]);_0x59cc4e[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x57422d['model'],qs['fields'](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x59cc4e['attributes']=_0x59cc4e['attributes'][_0x2a51('0x3b')]?_0x59cc4e[_0x2a51('0x38')]:_0x57422d['model'];if(!_0x1a00d['query']['hasOwnProperty']('nolimit')){_0x59cc4e[_0x2a51('0x1e')]=qs[_0x2a51('0x1e')](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x59cc4e[_0x2a51('0x20')]=qs['offset'](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x20')]);}_0x59cc4e[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x1a00d[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x59cc4e[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x1a00d[_0x2a51('0x35')],_0x57422d[_0x2a51('0x37')]),_0x3757f0);if(_0x1a00d[_0x2a51('0x35')][_0x2a51('0x40')]){_0x59cc4e[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x59cc4e[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x3757f0,function(_0x3a9ec8){if(_0x3a9ec8[_0x2a51('0x31')]!==_0x2a51('0x42')){var _0x2daec4={};_0x2daec4[_0x3a9ec8['name']]={'$like':'%'+_0x1a00d[_0x2a51('0x35')][_0x2a51('0x40')]+'%'};return _0x2daec4;}})});}_0x59cc4e=_['merge']({},_0x59cc4e,_0x1a00d[_0x2a51('0x43')]);var _0x47f5f2={'where':_0x59cc4e[_0x2a51('0x3e')]};return db[_0x2a51('0x44')][_0x2a51('0x1f')](_0x47f5f2)['then'](function(_0x4a281e){_0x4b49d0[_0x2a51('0x1f')]=_0x4a281e;if(_0x1a00d[_0x2a51('0x35')][_0x2a51('0x45')]){_0x59cc4e[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x44')]['findAll'](_0x59cc4e);})[_0x2a51('0x26')](function(_0x52d25e){_0x4b49d0[_0x2a51('0x47')]=_0x52d25e;return _0x4b49d0;})['then'](respondWithFilteredResult(_0x27d9f5,_0x59cc4e))[_0x2a51('0x48')](handleError(_0x27d9f5,null));};exports['show']=function(_0x32fbc7,_0x1e39aa){var _0x28f7b8={'raw':![],'where':{'id':_0x32fbc7['params']['id']}},_0x71d842={};_0x71d842[_0x2a51('0x33')]=_['keys'](db[_0x2a51('0x44')][_0x2a51('0x2f')]);_0x71d842[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x32fbc7['query']);_0x71d842[_0x2a51('0x37')]=_[_0x2a51('0x39')](_0x71d842['model'],_0x71d842['query']);_0x28f7b8[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x71d842[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x32fbc7[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x28f7b8[_0x2a51('0x38')]=_0x28f7b8[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x28f7b8[_0x2a51('0x38')]:_0x71d842[_0x2a51('0x33')];if(_0x32fbc7[_0x2a51('0x35')][_0x2a51('0x45')]){_0x28f7b8[_0x2a51('0x46')]=[{'all':!![]}];}_0x28f7b8=_[_0x2a51('0x41')]({},_0x28f7b8,_0x32fbc7[_0x2a51('0x43')]);return db[_0x2a51('0x44')][_0x2a51('0x49')](_0x28f7b8)[_0x2a51('0x26')](handleEntityNotFound(_0x1e39aa,null))['then'](respondWithResult(_0x1e39aa,null))[_0x2a51('0x48')](handleError(_0x1e39aa,null));};exports['create']=function(_0x4d9841,_0x4f66ac){return db[_0x2a51('0x44')]['create'](_0x4d9841[_0x2a51('0x4a')],{})[_0x2a51('0x26')](function(_0x5d324b){var _0x34d833=_0x4d9841['user'][_0x2a51('0x28')]({'plain':!![]});if(!_0x34d833)throw new Error(_0x2a51('0x4b'));if(_0x34d833[_0x2a51('0x4c')]==='user'){var _0x1f9740=_0x5d324b[_0x2a51('0x28')]({'plain':!![]});var _0x4a36af=_0x2a51('0x29');return db[_0x2a51('0x4d')][_0x2a51('0x49')]({'where':{'name':_0x4a36af,'userProfileId':_0x34d833['userProfileId']},'raw':!![]})[_0x2a51('0x26')](function(_0x218fa8){if(_0x218fa8&&_0x218fa8['autoAssociation']===0x0){return db['UserProfileResource'][_0x2a51('0x4e')]({'name':_0x1f9740[_0x2a51('0x2c')],'resourceId':_0x1f9740['id'],'type':_0x218fa8[_0x2a51('0x2c')],'sectionId':_0x218fa8['id']},{})[_0x2a51('0x26')](function(){return _0x5d324b;});}else{return _0x5d324b;}})[_0x2a51('0x48')](function(_0x5918f6){logger[_0x2a51('0x2a')](_0x2a51('0x4f'),_0x5918f6);throw _0x5918f6;});}return _0x5d324b;})['then'](respondWithResult(_0x4f66ac,0xc9))[_0x2a51('0x48')](handleError(_0x4f66ac,null));};exports['clone']=function(_0x575265,_0x4a0e9a){var _0x4db059={'where':{'id':_0x575265[_0x2a51('0x50')]['id']}},_0x252bb7={};_0x252bb7[_0x2a51('0x33')]=_[_0x2a51('0x36')](db['Campaign'][_0x2a51('0x2f')]);_0x4db059['attributes']=_[_0x2a51('0x39')](_0x252bb7['model'],qs[_0x2a51('0x3a')](_0x575265[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x4db059['attributes']=_0x4db059[_0x2a51('0x38')]['length']?_0x4db059[_0x2a51('0x38')]:_0x252bb7[_0x2a51('0x33')];if(_0x575265[_0x2a51('0x35')]['includeAll']){_0x4db059[_0x2a51('0x46')]=[{'all':!![]}];}_0x4db059=_[_0x2a51('0x41')]({},_0x4db059,_0x575265[_0x2a51('0x43')]);return db[_0x2a51('0x44')][_0x2a51('0x49')](_0x4db059)[_0x2a51('0x26')](handleEntityNotFound(_0x4a0e9a,null))['then'](function(_0x1debdd){if(_0x1debdd){var _0x3c2b8b=_0x1debdd['get']({'plain':!![]});_0x3c2b8b=qs[_0x2a51('0x51')](_0x3c2b8b,['id',_0x2a51('0x52'),_0x2a51('0x53')]);_0x575265[_0x2a51('0x4a')]=_[_0x2a51('0x51')](_0x575265['body'],['id',_0x2a51('0x52'),_0x2a51('0x53')]);return db[_0x2a51('0x44')]['create'](_[_0x2a51('0x41')](_0x3c2b8b,_0x575265[_0x2a51('0x4a')]),{'include':_0x575265[_0x2a51('0x35')][_0x2a51('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x15c148){var _0x22c45f=_0x575265[_0x2a51('0x54')][_0x2a51('0x28')]({'plain':!![]});if(!_0x22c45f)throw new Error(_0x2a51('0x4b'));if(_0x22c45f[_0x2a51('0x4c')]===_0x2a51('0x54')){var _0x19a64e=_0x15c148['get']({'plain':!![]});var _0x213fb2=_0x2a51('0x29');return db['UserProfileSection'][_0x2a51('0x49')]({'where':{'name':_0x213fb2,'userProfileId':_0x22c45f['userProfileId']},'raw':!![]})[_0x2a51('0x26')](function(_0x384e90){if(_0x384e90&&_0x384e90[_0x2a51('0x55')]===0x0){return db[_0x2a51('0x56')][_0x2a51('0x4e')]({'name':_0x19a64e[_0x2a51('0x2c')],'resourceId':_0x19a64e['id'],'type':_0x384e90[_0x2a51('0x2c')],'sectionId':_0x384e90['id']},{})['then'](function(){return _0x15c148;});}else{return _0x15c148;}})['catch'](function(_0x31f0c1){logger[_0x2a51('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31f0c1);throw _0x31f0c1;});}return _0x15c148;});}})[_0x2a51('0x26')](respondWithResult(_0x4a0e9a,0xc9))[_0x2a51('0x48')](handleError(_0x4a0e9a,null));};exports[_0x2a51('0x25')]=function(_0x3c8818,_0x54c9f1){if(_0x3c8818[_0x2a51('0x4a')]['id']){delete _0x3c8818[_0x2a51('0x4a')]['id'];}return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x3c8818['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x54c9f1,null))[_0x2a51('0x26')](saveUpdates(_0x3c8818[_0x2a51('0x4a')],null))[_0x2a51('0x26')](respondWithResult(_0x54c9f1,null))[_0x2a51('0x48')](handleError(_0x54c9f1,null));};exports[_0x2a51('0x27')]=function(_0x12e107,_0x4e4f1c){return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x12e107['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x4e4f1c,null))[_0x2a51('0x26')](removeEntity(_0x4e4f1c,null))[_0x2a51('0x48')](handleError(_0x4e4f1c,null));};exports[_0x2a51('0x57')]=function(_0x1cc553,_0x5d6530,_0x27f51d){var _0x30c19b={'raw':!![],'where':{}};var _0x2e749c={};var _0x3f9612={'count':0x0,'rows':[]};return db['Campaign'][_0x2a51('0x58')]({'where':{'id':_0x1cc553['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x5d6530,null))[_0x2a51('0x26')](function(_0x7749e5){if(_0x7749e5){_0x2e749c[_0x2a51('0x33')]=_[_0x2a51('0x36')](db[_0x2a51('0x59')]['rawAttributes']);_0x2e749c['query']=_[_0x2a51('0x36')](_0x1cc553[_0x2a51('0x35')]);_0x2e749c['filters']=_[_0x2a51('0x39')](_0x2e749c[_0x2a51('0x33')],_0x2e749c[_0x2a51('0x35')]);_0x30c19b['attributes']=_[_0x2a51('0x39')](_0x2e749c[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x1cc553['query']['fields']));_0x30c19b[_0x2a51('0x38')]=_0x30c19b['attributes'][_0x2a51('0x3b')]?_0x30c19b[_0x2a51('0x38')]:_0x2e749c[_0x2a51('0x33')];if(!_0x1cc553[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x30c19b[_0x2a51('0x1e')]=qs['limit'](_0x1cc553[_0x2a51('0x35')]['limit']);_0x30c19b['offset']=qs[_0x2a51('0x20')](_0x1cc553['query']['offset']);}_0x30c19b[_0x2a51('0x3c')]=qs['sort'](_0x1cc553[_0x2a51('0x35')]['sort']);_0x30c19b[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x1cc553[_0x2a51('0x35')],_0x2e749c['filters']));_0x30c19b[_0x2a51('0x3e')]['CampaignId']=_0x7749e5['id'];if(_0x1cc553[_0x2a51('0x35')][_0x2a51('0x40')]){_0x30c19b[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x30c19b[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x30c19b[_0x2a51('0x38')],function(_0xc2ca62){var _0x2a7764={};_0x2a7764[_0xc2ca62]={'$like':'%'+_0x1cc553['query'][_0x2a51('0x40')]+'%'};return _0x2a7764;})});}_0x30c19b=_[_0x2a51('0x41')]({},_0x30c19b,_0x1cc553[_0x2a51('0x43')]);return db['CmHopper']['count']({'where':_0x30c19b[_0x2a51('0x3e')]})['then'](function(_0x53fb2d){_0x3f9612['count']=_0x53fb2d;if(_0x1cc553[_0x2a51('0x35')][_0x2a51('0x45')]){_0x30c19b[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x59')][_0x2a51('0x5c')](_0x30c19b);})[_0x2a51('0x26')](function(_0x2f35ca){_0x3f9612[_0x2a51('0x47')]=_0x2f35ca;return _0x3f9612;});}})['then'](respondWithFilteredResult(_0x5d6530,_0x30c19b))['catch'](handleError(_0x5d6530,null));};exports['getHopperHistories']=function(_0x1d357e,_0x48018e,_0x313aae){var _0x31c154={'raw':!![],'where':{}};var _0x333b9d={};var _0xa76fad={'count':0x0,'rows':[]};return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x1d357e['params']['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x48018e,null))[_0x2a51('0x26')](function(_0x4c7546){if(_0x4c7546){_0x333b9d['model']=_[_0x2a51('0x36')](db[_0x2a51('0x5d')]['rawAttributes']);_0x333b9d['query']=_[_0x2a51('0x36')](_0x1d357e[_0x2a51('0x35')]);_0x333b9d['filters']=_['intersection'](_0x333b9d[_0x2a51('0x33')],_0x333b9d['query']);_0x31c154[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x333b9d[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x1d357e[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x31c154[_0x2a51('0x38')]=_0x31c154[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x31c154[_0x2a51('0x38')]:_0x333b9d['model'];if(!_0x1d357e[_0x2a51('0x35')]['hasOwnProperty']('nolimit')){_0x31c154[_0x2a51('0x1e')]=qs['limit'](_0x1d357e[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x31c154[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x1d357e[_0x2a51('0x35')][_0x2a51('0x20')]);}_0x31c154[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x1d357e['query'][_0x2a51('0x3d')]);_0x31c154['where']=qs[_0x2a51('0x37')](_['pick'](_0x1d357e[_0x2a51('0x35')],_0x333b9d[_0x2a51('0x37')]));_0x31c154[_0x2a51('0x3e')][_0x2a51('0x5e')]=_0x4c7546['id'];if(_0x1d357e[_0x2a51('0x35')][_0x2a51('0x40')]){_0x31c154['where']=_[_0x2a51('0x41')](_0x31c154[_0x2a51('0x3e')],{'$or':_['map'](_0x31c154['attributes'],function(_0x54b47a){var _0x36e05f={};_0x36e05f[_0x54b47a]={'$like':'%'+_0x1d357e[_0x2a51('0x35')]['filter']+'%'};return _0x36e05f;})});}_0x31c154=_[_0x2a51('0x41')]({},_0x31c154,_0x1d357e[_0x2a51('0x43')]);return db[_0x2a51('0x5d')]['count']({'where':_0x31c154[_0x2a51('0x3e')]})[_0x2a51('0x26')](function(_0x371531){_0xa76fad[_0x2a51('0x1f')]=_0x371531;if(_0x1d357e[_0x2a51('0x35')][_0x2a51('0x45')]){_0x31c154[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x5d')][_0x2a51('0x5c')](_0x31c154);})['then'](function(_0x405721){_0xa76fad[_0x2a51('0x47')]=_0x405721;return _0xa76fad;});}})[_0x2a51('0x26')](respondWithFilteredResult(_0x48018e,_0x31c154))[_0x2a51('0x48')](handleError(_0x48018e,null));};exports[_0x2a51('0x5f')]=function(_0x1f313a,_0x258b6a,_0x49ff93){var _0x3f9caf={'raw':!![],'where':{}};var _0x1d5546={};var _0x1910c2={'count':0x0,'rows':[]};return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x1f313a[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x258b6a,null))[_0x2a51('0x26')](function(_0x1c0957){if(_0x1c0957){_0x1d5546[_0x2a51('0x33')]=_[_0x2a51('0x36')](db['CmHopperFinal'][_0x2a51('0x2f')]);_0x1d5546[_0x2a51('0x35')]=_['keys'](_0x1f313a[_0x2a51('0x35')]);_0x1d5546[_0x2a51('0x37')]=_[_0x2a51('0x39')](_0x1d5546['model'],_0x1d5546[_0x2a51('0x35')]);_0x3f9caf['attributes']=_['intersection'](_0x1d5546[_0x2a51('0x33')],qs['fields'](_0x1f313a[_0x2a51('0x35')]['fields']));_0x3f9caf['attributes']=_0x3f9caf[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x3f9caf['attributes']:_0x1d5546[_0x2a51('0x33')];if(!_0x1f313a['query'][_0x2a51('0x5a')]('nolimit')){_0x3f9caf['limit']=qs[_0x2a51('0x1e')](_0x1f313a[_0x2a51('0x35')]['limit']);_0x3f9caf[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x1f313a['query']['offset']);}_0x3f9caf['order']=qs[_0x2a51('0x3d')](_0x1f313a[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x3f9caf[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x1f313a[_0x2a51('0x35')],_0x1d5546[_0x2a51('0x37')]));_0x3f9caf['where'][_0x2a51('0x5e')]=_0x1c0957['id'];if(_0x1f313a[_0x2a51('0x35')][_0x2a51('0x40')]){_0x3f9caf[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x3f9caf[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x3f9caf['attributes'],function(_0x4df883){var _0x85b97c={};_0x85b97c[_0x4df883]={'$like':'%'+_0x1f313a[_0x2a51('0x35')][_0x2a51('0x40')]+'%'};return _0x85b97c;})});}_0x3f9caf=_[_0x2a51('0x41')]({},_0x3f9caf,_0x1f313a[_0x2a51('0x43')]);return db[_0x2a51('0x60')][_0x2a51('0x1f')]({'where':_0x3f9caf[_0x2a51('0x3e')]})[_0x2a51('0x26')](function(_0x2da208){_0x1910c2[_0x2a51('0x1f')]=_0x2da208;if(_0x1f313a[_0x2a51('0x35')][_0x2a51('0x45')]){_0x3f9caf[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x60')][_0x2a51('0x5c')](_0x3f9caf);})[_0x2a51('0x26')](function(_0x214d99){_0x1910c2['rows']=_0x214d99;return _0x1910c2;});}})[_0x2a51('0x26')](respondWithFilteredResult(_0x258b6a,_0x3f9caf))[_0x2a51('0x48')](handleError(_0x258b6a,null));};exports[_0x2a51('0x61')]=function(_0x23c357,_0x3d7f32,_0x4d2ff2){var _0x243e35={'raw':!![],'where':{}};var _0x2ec964={};var _0x2c0697={'count':0x0,'rows':[]};return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x23c357[_0x2a51('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d7f32,null))['then'](function(_0x5b8a6a){if(_0x5b8a6a){_0x2ec964['model']=_[_0x2a51('0x36')](db[_0x2a51('0x62')][_0x2a51('0x2f')]);_0x2ec964[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x23c357[_0x2a51('0x35')]);_0x2ec964[_0x2a51('0x37')]=_[_0x2a51('0x39')](_0x2ec964[_0x2a51('0x33')],_0x2ec964['query']);_0x243e35[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x2ec964[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x23c357[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x243e35[_0x2a51('0x38')]=_0x243e35[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x243e35[_0x2a51('0x38')]:_0x2ec964[_0x2a51('0x33')];if(!_0x23c357[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x243e35[_0x2a51('0x1e')]=qs['limit'](_0x23c357[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x243e35[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x23c357[_0x2a51('0x35')]['offset']);}_0x243e35[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x23c357[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x243e35['where']=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x23c357[_0x2a51('0x35')],_0x2ec964['filters']));_0x243e35[_0x2a51('0x3e')][_0x2a51('0x5e')]=_0x5b8a6a['id'];if(_0x23c357[_0x2a51('0x35')][_0x2a51('0x40')]){_0x243e35[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x243e35['where'],{'$or':_[_0x2a51('0x34')](_0x243e35[_0x2a51('0x38')],function(_0x28205e){var _0x63746b={};_0x63746b[_0x28205e]={'$like':'%'+_0x23c357[_0x2a51('0x35')][_0x2a51('0x40')]+'%'};return _0x63746b;})});}_0x243e35=_[_0x2a51('0x41')]({},_0x243e35,_0x23c357[_0x2a51('0x43')]);return db[_0x2a51('0x62')][_0x2a51('0x1f')]({'where':_0x243e35[_0x2a51('0x3e')]})['then'](function(_0x518b36){_0x2c0697['count']=_0x518b36;if(_0x23c357['query'][_0x2a51('0x45')]){_0x243e35[_0x2a51('0x46')]=[{'all':!![]}];}return db[_0x2a51('0x62')]['findAll'](_0x243e35);})[_0x2a51('0x26')](function(_0x36a057){_0x2c0697['rows']=_0x36a057;return _0x2c0697;});}})[_0x2a51('0x26')](respondWithFilteredResult(_0x3d7f32,_0x243e35))[_0x2a51('0x48')](handleError(_0x3d7f32,null));};exports[_0x2a51('0x63')]=function(_0x4db224,_0x466027,_0x296f2b){var _0x281596={};var _0x3003fa={};var _0x3bd62e;var _0x14c6e1;return db[_0x2a51('0x44')][_0x2a51('0x58')]({'where':{'id':_0x4db224[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x466027,null))[_0x2a51('0x26')](function(_0x531b2d){if(_0x531b2d){_0x3bd62e=_0x531b2d;_0x3003fa[_0x2a51('0x33')]=_[_0x2a51('0x36')](db[_0x2a51('0x64')][_0x2a51('0x2f')]);_0x3003fa[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x4db224[_0x2a51('0x35')]);_0x3003fa['filters']=_[_0x2a51('0x39')](_0x3003fa[_0x2a51('0x33')],_0x3003fa['query']);_0x281596[_0x2a51('0x38')]=_[_0x2a51('0x39')](_0x3003fa[_0x2a51('0x33')],qs['fields'](_0x4db224[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x281596[_0x2a51('0x38')]=_0x281596['attributes']['length']?_0x281596[_0x2a51('0x38')]:_0x3003fa['model'];_0x281596[_0x2a51('0x3c')]=qs[_0x2a51('0x3d')](_0x4db224[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x281596[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x4db224[_0x2a51('0x35')],_0x3003fa[_0x2a51('0x37')]));if(_0x4db224[_0x2a51('0x35')][_0x2a51('0x40')]){_0x281596['where']=_[_0x2a51('0x41')](_0x281596['where'],{'$or':_[_0x2a51('0x34')](_0x281596['attributes'],function(_0x53cfdb){var _0x4c8447={};_0x4c8447[_0x53cfdb]={'$like':'%'+_0x4db224['query'][_0x2a51('0x40')]+'%'};return _0x4c8447;})});}_0x281596=_[_0x2a51('0x41')]({},_0x281596,_0x4db224[_0x2a51('0x43')]);return _0x3bd62e[_0x2a51('0x63')](_0x281596);}})['then'](function(_0x12c9b8){if(_0x12c9b8){_0x14c6e1=_0x12c9b8[_0x2a51('0x3b')];if(!_0x4db224[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x281596[_0x2a51('0x1e')]=qs[_0x2a51('0x1e')](_0x4db224[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x281596[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x4db224['query'][_0x2a51('0x20')]);}return _0x3bd62e[_0x2a51('0x63')](_0x281596);}})[_0x2a51('0x26')](function(_0x3ed7fa){if(_0x3ed7fa){return _0x3ed7fa?{'count':_0x14c6e1,'rows':_0x3ed7fa}:null;}})[_0x2a51('0x26')](respondWithResult(_0x466027,null))[_0x2a51('0x48')](handleError(_0x466027,null));};exports[_0x2a51('0x65')]=function(_0x2b73b2,_0x392677,_0x1f1652){var _0x5198df,_0x36fbf1;var _0x2f07a1=[];var _0x234b6b=moment()[_0x2a51('0x66')](_0x2a51('0x67'));return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x2b73b2[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x392677,null))[_0x2a51('0x26')](function(_0x1f93ae){if(_0x1f93ae){_0x36fbf1=_0x1f93ae;return _0x1f93ae[_0x2a51('0x65')](_0x2b73b2[_0x2a51('0x4a')][_0x2a51('0x68')],_['omit'](_0x2b73b2['body'],['ids','id'])||{});}return null;})[_0x2a51('0x69')](function(_0x293eba){var _0x1af919;var _0x1fd0ab;_0x5198df=_0x293eba||[];var _0x299911=[];if(_0x293eba){for(var _0x4ecb2f=0x0;_0x4ecb2f<_0x293eba[_0x2a51('0x3b')];_0x4ecb2f+=0x1){var _0x144399=_0x293eba[_0x4ecb2f][_0x2a51('0x28')]({'plain':!![]});_0x36fbf1[_0x2a51('0x6a')]=_0x2b73b2[_0x2a51('0x4a')][_0x2a51('0x6a')]?_0x2b73b2[_0x2a51('0x4a')][_0x2a51('0x6a')]:_0x36fbf1[_0x2a51('0x6a')];switch(_0x36fbf1['dialCheckDuplicateType']){case _0x2a51('0x6b'):_0x1af919=squel[_0x2a51('0x6c')]()['into']('cm_hopper')[_0x2a51('0x6d')]([_0x2a51('0x6e'),_0x2a51('0x6f'),_0x2a51('0x70'),_0x2a51('0x71'),'CampaignId',_0x2a51('0x52'),'updatedAt'],squel[_0x2a51('0x72')]()[_0x2a51('0x73')]('phone',_0x2a51('0x6e'))[_0x2a51('0x73')](_0x2a51('0x74'),_0x2a51('0x6f'))[_0x2a51('0x73')]('id',_0x2a51('0x70'))[_0x2a51('0x73')](_0x144399[_0x2a51('0x75')]['toString'](),'ListId')['field'](_0x2b73b2[_0x2a51('0x50')]['id'][_0x2a51('0x76')](),'CampaignId')[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27','updatedAt')[_0x2a51('0x77')](_0x2a51('0x78'))[_0x2a51('0x3e')](_0x2a51('0x79'))[_0x2a51('0x3e')](_0x2a51('0x7a'),_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())[_0x2a51('0x3e')](_0x2a51('0x7b'))[_0x2a51('0x3e')](_0x2a51('0x7c'),squel[_0x2a51('0x72')]()[_0x2a51('0x73')](_0x2a51('0x7d'))[_0x2a51('0x77')]('cm_hopper_final')['where'](_0x2a51('0x7e'),_0x2b73b2[_0x2a51('0x50')]['id']['toString']()))[_0x2a51('0x3e')](_0x2a51('0x7c'),squel[_0x2a51('0x72')]()[_0x2a51('0x73')]('COALESCE(phone,\x27\x27)')[_0x2a51('0x77')](_0x2a51('0x7f'))[_0x2a51('0x3e')]('CampaignId\x20=\x20?',_0x2b73b2[_0x2a51('0x50')]['id'][_0x2a51('0x76')]())))[_0x2a51('0x76')]();break;case _0x2a51('0x80'):_0x1af919=squel[_0x2a51('0x6c')]()[_0x2a51('0x81')]('cm_hopper')[_0x2a51('0x6d')]([_0x2a51('0x6e'),_0x2a51('0x6f'),_0x2a51('0x70'),'ListId',_0x2a51('0x5e'),_0x2a51('0x52'),_0x2a51('0x53')],squel[_0x2a51('0x72')]()[_0x2a51('0x73')](_0x2a51('0x6e'),_0x2a51('0x6e'))[_0x2a51('0x73')]('NOW()',_0x2a51('0x6f'))['field']('id','ContactId')[_0x2a51('0x73')](_0x144399['CmListId']['toString'](),_0x2a51('0x71'))['field'](_0x2b73b2[_0x2a51('0x50')]['id']['toString'](),_0x2a51('0x5e'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x53'))[_0x2a51('0x77')](_0x2a51('0x78'))['where']('deletedAt\x20IS\x20NULL')[_0x2a51('0x3e')](_0x2a51('0x7a'),_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x2a51('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2a51('0x73')](_0x2a51('0x82'))['from'](_0x2a51('0x7f'))['where'](_0x2a51('0x7e'),_0x2b73b2[_0x2a51('0x50')]['id']['toString']())))[_0x2a51('0x76')]();break;default:_0x1af919=squel[_0x2a51('0x6c')]()['into'](_0x2a51('0x7f'))['fromQuery']([_0x2a51('0x6e'),_0x2a51('0x6f'),_0x2a51('0x70'),'ListId','CampaignId','createdAt',_0x2a51('0x53')],squel['select']()[_0x2a51('0x73')](_0x2a51('0x6e'),_0x2a51('0x6e'))[_0x2a51('0x73')]('NOW()',_0x2a51('0x6f'))[_0x2a51('0x73')]('id',_0x2a51('0x70'))[_0x2a51('0x73')](_0x144399['CmListId'][_0x2a51('0x76')](),_0x2a51('0x71'))[_0x2a51('0x73')](_0x2b73b2[_0x2a51('0x50')]['id'][_0x2a51('0x76')](),_0x2a51('0x5e'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))['field']('\x27'+_0x234b6b+'\x27',_0x2a51('0x53'))[_0x2a51('0x77')](_0x2a51('0x78'))[_0x2a51('0x3e')]('deletedAt\x20IS\x20NULL')[_0x2a51('0x3e')]('ListId\x20=\x20?',_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())[_0x2a51('0x3e')](_0x2a51('0x7b')))[_0x2a51('0x76')]();}_0x1fd0ab=squel['insert']()[_0x2a51('0x81')](_0x2a51('0x83'))[_0x2a51('0x6d')](['cmHopperId',_0x2a51('0x6f'),_0x2a51('0x6e'),_0x2a51('0x84'),_0x2a51('0x52'),'updatedAt'],squel['select']()[_0x2a51('0x73')]('h.id','id')[_0x2a51('0x73')]('NOW()','scheduledAt')[_0x2a51('0x73')]('ci.item','phone')[_0x2a51('0x73')](_0x2a51('0x85'),_0x2a51('0x84'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x52'))[_0x2a51('0x73')]('\x27'+_0x234b6b+'\x27',_0x2a51('0x53'))['from'](_0x2a51('0x86'),'ci')[_0x2a51('0x87')]('cm_hopper','h',_0x2a51('0x88'))[_0x2a51('0x3e')](_0x2a51('0x89'),_0x144399[_0x2a51('0x75')][_0x2a51('0x76')]())['where'](_0x2a51('0x8a'),_0x2b73b2[_0x2a51('0x50')]['id']['toString']())['where'](_0x2a51('0x8b'),_0x234b6b))['toString']();_0x299911[_0x2a51('0x8c')](db[_0x2a51('0x8d')][_0x2a51('0x35')](_0x1af919));_0x2f07a1[_0x2a51('0x8c')](db[_0x2a51('0x8d')][_0x2a51('0x35')](_0x1fd0ab));}return BPromise[_0x2a51('0x8e')](_0x299911);}})[_0x2a51('0x26')](function(){return BPromise[_0x2a51('0x8e')](_0x2f07a1);})[_0x2a51('0x26')](function(){return _0x5198df;})[_0x2a51('0x26')](respondWithResult(_0x392677,null))['catch'](handleError(_0x392677,null));};exports[_0x2a51('0x8f')]=function(_0x342b1a,_0x646eba,_0x2ff63e){return db[_0x2a51('0x44')]['find']({'where':{'id':_0x342b1a['params']['id']}})['then'](handleEntityNotFound(_0x646eba,null))[_0x2a51('0x26')](function(_0x4bb580){if(_0x4bb580){return _0x4bb580[_0x2a51('0x8f')](_0x342b1a[_0x2a51('0x35')][_0x2a51('0x68')]);}})[_0x2a51('0x26')](function(_0x3e84a6){if(_0x3e84a6){return db[_0x2a51('0x59')][_0x2a51('0x27')]({'where':{'ListId':_0x342b1a[_0x2a51('0x35')][_0x2a51('0x68')],'CampaignId':_0x342b1a[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](function(){return _0x3e84a6;});}})[_0x2a51('0x26')](respondWithStatusCode(_0x646eba,null))[_0x2a51('0x48')](handleError(_0x646eba,null));};exports[_0x2a51('0x90')]=function(_0x4fc957,_0x39c206,_0x43d8b2){var _0x3c23aa={};var _0x30c36a={};var _0x34bd9a;var _0x6cbb5e;return db['Campaign'][_0x2a51('0x58')]({'where':{'id':_0x4fc957[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x39c206,null))[_0x2a51('0x26')](function(_0x1ebb9f){if(_0x1ebb9f){_0x34bd9a=_0x1ebb9f;_0x30c36a[_0x2a51('0x33')]=_[_0x2a51('0x36')](db[_0x2a51('0x64')]['rawAttributes']);_0x30c36a[_0x2a51('0x35')]=_[_0x2a51('0x36')](_0x4fc957[_0x2a51('0x35')]);_0x30c36a['filters']=_[_0x2a51('0x39')](_0x30c36a[_0x2a51('0x33')],_0x30c36a[_0x2a51('0x35')]);_0x3c23aa['attributes']=_[_0x2a51('0x39')](_0x30c36a[_0x2a51('0x33')],qs[_0x2a51('0x3a')](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x3a')]));_0x3c23aa[_0x2a51('0x38')]=_0x3c23aa[_0x2a51('0x38')][_0x2a51('0x3b')]?_0x3c23aa[_0x2a51('0x38')]:_0x30c36a['model'];_0x3c23aa['order']=qs[_0x2a51('0x3d')](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x3d')]);_0x3c23aa[_0x2a51('0x3e')]=qs[_0x2a51('0x37')](_[_0x2a51('0x3f')](_0x4fc957[_0x2a51('0x35')],_0x30c36a['filters']));if(_0x4fc957[_0x2a51('0x35')][_0x2a51('0x40')]){_0x3c23aa[_0x2a51('0x3e')]=_[_0x2a51('0x41')](_0x3c23aa[_0x2a51('0x3e')],{'$or':_[_0x2a51('0x34')](_0x3c23aa[_0x2a51('0x38')],function(_0x549aff){var _0x12fe03={};_0x12fe03[_0x549aff]={'$like':'%'+_0x4fc957['query'][_0x2a51('0x40')]+'%'};return _0x12fe03;})});}_0x3c23aa=_['merge']({},_0x3c23aa,_0x4fc957[_0x2a51('0x43')]);return _0x34bd9a[_0x2a51('0x90')](_0x3c23aa);}})[_0x2a51('0x26')](function(_0x3aa9e9){if(_0x3aa9e9){_0x6cbb5e=_0x3aa9e9[_0x2a51('0x3b')];if(!_0x4fc957[_0x2a51('0x35')][_0x2a51('0x5a')](_0x2a51('0x5b'))){_0x3c23aa['limit']=qs['limit'](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x1e')]);_0x3c23aa[_0x2a51('0x20')]=qs[_0x2a51('0x20')](_0x4fc957[_0x2a51('0x35')][_0x2a51('0x20')]);}return _0x34bd9a[_0x2a51('0x90')](_0x3c23aa);}})['then'](function(_0x2d4109){if(_0x2d4109){return _0x2d4109?{'count':_0x6cbb5e,'rows':_0x2d4109}:null;}})[_0x2a51('0x26')](respondWithResult(_0x39c206,null))[_0x2a51('0x48')](handleError(_0x39c206,null));};exports[_0x2a51('0x91')]=function(_0x1d5e6f,_0x1a048b,_0x1a468){var _0x274892,_0x553c5d;var _0x27d1de=[];var _0x493455=moment()[_0x2a51('0x66')](_0x2a51('0x67'));return db[_0x2a51('0x44')]['find']({'where':{'id':_0x1d5e6f[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x1a048b,null))['then'](function(_0x1b228a){if(_0x1b228a){_0x553c5d=_0x1b228a;return _0x1b228a[_0x2a51('0x91')](_0x1d5e6f['body'][_0x2a51('0x68')],_[_0x2a51('0x51')](_0x1d5e6f[_0x2a51('0x4a')],['ids','id'])||{});}return null;})[_0x2a51('0x69')](function(_0x3aacb8){var _0x422fe1;var _0x5f3f50;_0x274892=_0x3aacb8||[];var _0x1ea4fb=[];if(_0x3aacb8){for(var _0x34aabc=0x0;_0x34aabc<_0x3aacb8[_0x2a51('0x3b')];_0x34aabc+=0x1){var _0x166e98=_0x3aacb8[_0x34aabc][_0x2a51('0x28')]({'plain':!![]});_0x422fe1=squel[_0x2a51('0x6c')]()[_0x2a51('0x81')](_0x2a51('0x92'))['fromQuery']([_0x2a51('0x6e'),_0x2a51('0x70'),'ListId',_0x2a51('0x5e'),_0x2a51('0x52'),'updatedAt'],squel[_0x2a51('0x72')]()[_0x2a51('0x73')](_0x2a51('0x6e'),_0x2a51('0x6e'))[_0x2a51('0x73')]('id','ContactId')[_0x2a51('0x73')](_0x166e98['CmListId']['toString'](),'ListId')[_0x2a51('0x73')](_0x1d5e6f['params']['id'][_0x2a51('0x76')](),_0x2a51('0x5e'))[_0x2a51('0x73')](_0x2a51('0x74'),_0x2a51('0x52'))[_0x2a51('0x73')](_0x2a51('0x74'),_0x2a51('0x53'))[_0x2a51('0x77')](_0x2a51('0x78'))[_0x2a51('0x3e')](_0x2a51('0x79'))[_0x2a51('0x3e')]('ListId\x20=\x20?',_0x166e98[_0x2a51('0x75')][_0x2a51('0x76')]())[_0x2a51('0x3e')](_0x2a51('0x7b')))[_0x2a51('0x76')]();_0x1ea4fb[_0x2a51('0x8c')](db[_0x2a51('0x8d')]['query'](_0x422fe1));}return BPromise[_0x2a51('0x8e')](_0x1ea4fb);}})[_0x2a51('0x26')](function(){return _0x274892;})[_0x2a51('0x26')](respondWithResult(_0x1a048b,null))[_0x2a51('0x48')](handleError(_0x1a048b,null));};exports[_0x2a51('0x93')]=function(_0x51d88a,_0x33701f,_0x118c9e){return db[_0x2a51('0x44')][_0x2a51('0x49')]({'where':{'id':_0x51d88a[_0x2a51('0x50')]['id']}})[_0x2a51('0x26')](handleEntityNotFound(_0x33701f,null))[_0x2a51('0x26')](function(_0x1ece21){if(_0x1ece21){return _0x1ece21[_0x2a51('0x93')](_0x51d88a[_0x2a51('0x35')][_0x2a51('0x68')]);}})[_0x2a51('0x26')](function(_0xd19a15){if(_0xd19a15){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x51d88a[_0x2a51('0x35')][_0x2a51('0x68')],'CampaignId':_0x51d88a['params']['id']}})[_0x2a51('0x26')](function(){return _0xd19a15;});}})[_0x2a51('0x26')](respondWithStatusCode(_0x33701f,null))[_0x2a51('0x48')](handleError(_0x33701f,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 3e8ae0c..3ef2aba 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(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5b50ae,_0x7da7e1){var _0x84eb56=function(_0xad6b38){while(--_0xad6b38){_0x5b50ae['push'](_0x5b50ae['shift']());}};_0x84eb56(++_0x7da7e1);}(_0x7a54,0x106));var _0x47a5=function(_0x413f2c,_0x59141a){_0x413f2c=_0x413f2c-0x0;var _0x8b143d=_0x7a54[_0x413f2c];return _0x8b143d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 1e372fb..a9713f8 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 _0x6f7f=['GetCampaign','Campaign','findAll','options','raw','where','include','map','attributes','model','debug','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Campaign,\x20%s,\x20%s','result'];(function(_0x14a872,_0x46902b){var _0x3ad0db=function(_0x5be2ef){while(--_0x5be2ef){_0x14a872['push'](_0x14a872['shift']());}};_0x3ad0db(++_0x46902b);}(_0x6f7f,0x177));var _0xf6f7=function(_0x2523fb,_0x507de7){_0x2523fb=_0x2523fb-0x0;var _0x201a7f=_0x6f7f[_0x2523fb];return _0x201a7f;};'use strict';var _=require('lodash');var util=require(_0xf6f7('0x0'));var moment=require(_0xf6f7('0x1'));var BPromise=require(_0xf6f7('0x2'));var rs=require(_0xf6f7('0x3'));var fs=require('fs');var Redis=require(_0xf6f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6f7('0x5'));var logger=require('../../config/logger')(_0xf6f7('0x6'));var config=require(_0xf6f7('0x7'));var jayson=require(_0xf6f7('0x8'));var client=jayson['client'][_0xf6f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x543eb3,_0x33a2b2,_0x3c641f){return new BPromise(function(_0xe86f3a,_0x279ed7){return client[_0xf6f7('0xa')](_0x543eb3,_0x3c641f)[_0xf6f7('0xb')](function(_0x506617){logger[_0xf6f7('0xc')]('Campaign,\x20%s,\x20%s',_0x33a2b2,'request\x20sent');logger['debug'](_0xf6f7('0xd'),_0x33a2b2,_0xf6f7('0xe'),JSON[_0xf6f7('0xf')](_0x506617));if(_0x506617[_0xf6f7('0x10')]){if(_0x506617[_0xf6f7('0x10')][_0xf6f7('0x11')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x33a2b2,_0x506617[_0xf6f7('0x10')][_0xf6f7('0x12')]);return _0x279ed7(_0x506617[_0xf6f7('0x10')][_0xf6f7('0x12')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x33a2b2,_0x506617[_0xf6f7('0x10')]['message']);return _0xe86f3a(_0x506617[_0xf6f7('0x10')]['message']);}else{logger[_0xf6f7('0xc')](_0xf6f7('0x13'),_0x33a2b2,_0xf6f7('0xe'));_0xe86f3a(_0x506617[_0xf6f7('0x14')][_0xf6f7('0x12')]);}})['catch'](function(_0x42aa26){logger[_0xf6f7('0x10')]('Campaign,\x20%s,\x20%s',_0x33a2b2,_0x42aa26);_0x279ed7(_0x42aa26);});});}exports[_0xf6f7('0x15')]=function(_0x438e3d){var _0xc23839=this;return new Promise(function(_0x5cc7a1,_0x5ba9f0){return db[_0xf6f7('0x16')][_0xf6f7('0x17')]({'raw':_0x438e3d['options']?_0x438e3d[_0xf6f7('0x18')][_0xf6f7('0x19')]===undefined?!![]:![]:!![],'where':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d[_0xf6f7('0x18')][_0xf6f7('0x1a')]||null:null,'attributes':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d[_0xf6f7('0x18')]['attributes']||null:null,'limit':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d['options']['limit']||null:null,'include':_0x438e3d[_0xf6f7('0x18')]?_0x438e3d['options'][_0xf6f7('0x1b')]?_[_0xf6f7('0x1c')](_0x438e3d['options'][_0xf6f7('0x1b')],function(_0x5ec44f){return{'model':db[_0x5ec44f['model']],'as':_0x5ec44f['as'],'attributes':_0x5ec44f[_0xf6f7('0x1d')],'include':_0x5ec44f[_0xf6f7('0x1b')]?_[_0xf6f7('0x1c')](_0x5ec44f[_0xf6f7('0x1b')],function(_0xa903ff){return{'model':db[_0xa903ff['model']],'as':_0xa903ff['as'],'attributes':_0xa903ff['attributes'],'include':_0xa903ff[_0xf6f7('0x1b')]?_[_0xf6f7('0x1c')](_0xa903ff[_0xf6f7('0x1b')],function(_0x1de269){return{'model':db[_0x1de269[_0xf6f7('0x1e')]],'as':_0x1de269['as'],'attributes':_0x1de269[_0xf6f7('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49dd11){logger[_0xf6f7('0xc')](_0xf6f7('0x15'),_0x438e3d);logger[_0xf6f7('0x1f')](_0xf6f7('0x15'),_0x438e3d,JSON[_0xf6f7('0xf')](_0x49dd11));_0x5cc7a1(_0x49dd11);})[_0xf6f7('0x20')](function(_0x4b3100){logger['error']('GetCampaign',_0x4b3100[_0xf6f7('0x12')],_0x438e3d);_0x5ba9f0(_0xc23839['error'](0x1f4,_0x4b3100[_0xf6f7('0x12')]));});});};
\ No newline at end of file
+var _0x7333=['info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x7333,0xfc));var _0x3733=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7333[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var moment=require(_0x3733('0x1'));var BPromise=require('bluebird');var rs=require(_0x3733('0x2'));var fs=require('fs');var Redis=require(_0x3733('0x3'));var db=require(_0x3733('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3733('0x5'))(_0x3733('0x6'));var config=require(_0x3733('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3733('0x8')][_0x3733('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3330c6,_0x3aab36,_0x5b5a50){return new BPromise(function(_0x1ee542,_0x5b184b){return client[_0x3733('0xa')](_0x3330c6,_0x5b5a50)[_0x3733('0xb')](function(_0x3bf4bc){logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));logger['debug'](_0x3733('0xe'),_0x3aab36,_0x3733('0xd'),JSON[_0x3733('0xf')](_0x3bf4bc));if(_0x3bf4bc[_0x3733('0x10')]){if(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x11')]===0x1f4){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x5b184b(_0x3bf4bc[_0x3733('0x10')]['message']);}logger['error'](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x1ee542(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);}else{logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));_0x1ee542(_0x3bf4bc[_0x3733('0x14')][_0x3733('0x13')]);}})[_0x3733('0x15')](function(_0x56c17a){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x56c17a);_0x5b184b(_0x56c17a);});});}exports[_0x3733('0x16')]=function(_0xd0f743){var _0x497600=this;return new Promise(function(_0x24a91e,_0x328490){return db[_0x3733('0x17')][_0x3733('0x18')]({'raw':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1a')]===undefined?!![]:![]:!![],'where':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')]['where']||null:null,'attributes':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1b')]||null:null,'limit':_0xd0f743['options']?_0xd0f743[_0x3733('0x19')][_0x3733('0x1c')]||null:null,'include':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1d')]?_[_0x3733('0x1e')](_0xd0f743[_0x3733('0x19')]['include'],function(_0x3187a3){return{'model':db[_0x3187a3['model']],'as':_0x3187a3['as'],'attributes':_0x3187a3[_0x3733('0x1b')],'include':_0x3187a3[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3187a3[_0x3733('0x1d')],function(_0x3f77d0){return{'model':db[_0x3f77d0[_0x3733('0x1f')]],'as':_0x3f77d0['as'],'attributes':_0x3f77d0[_0x3733('0x1b')],'include':_0x3f77d0[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3f77d0['include'],function(_0x1ce6c1){return{'model':db[_0x1ce6c1['model']],'as':_0x1ce6c1['as'],'attributes':_0x1ce6c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3733('0xb')](function(_0x12169e){logger[_0x3733('0xc')]('GetCampaign',_0xd0f743);logger[_0x3733('0x20')](_0x3733('0x16'),_0xd0f743,JSON[_0x3733('0xf')](_0x12169e));_0x24a91e(_0x12169e);})[_0x3733('0x15')](function(_0x13b66e){logger[_0x3733('0x10')](_0x3733('0x16'),_0x13b66e['message'],_0xd0f743);_0x328490(_0x497600[_0x3733('0x10')](0x1f4,_0x13b66e[_0x3733('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index dc7701f..b068556 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 _0x2b9a=['../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','put','update','delete','/:id/lists','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x36a4e0,_0x563105){var _0x1ee05d=function(_0x442538){while(--_0x442538){_0x36a4e0['push'](_0x36a4e0['shift']());}};_0x1ee05d(++_0x563105);}(_0x2b9a,0x164));var _0xa2b9=function(_0x5cc8b9,_0xd5a591){_0x5cc8b9=_0x5cc8b9-0x0;var _0x1e7ec9=_0x2b9a[_0x5cc8b9];return _0x1e7ec9;};'use strict';var multer=require(_0xa2b9('0x0'));var util=require(_0xa2b9('0x1'));var path=require(_0xa2b9('0x2'));var timeout=require(_0xa2b9('0x3'));var express=require(_0xa2b9('0x4'));var router=express[_0xa2b9('0x5')]();var fs_extra=require(_0xa2b9('0x6'));var auth=require(_0xa2b9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa2b9('0x8'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa2b9('0x9')]);router[_0xa2b9('0xa')](_0xa2b9('0xb'),auth[_0xa2b9('0xc')](),controller[_0xa2b9('0xd')]);router[_0xa2b9('0xa')]('/:id/hoppers',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0xe')]);router[_0xa2b9('0xa')](_0xa2b9('0xf'),auth['isAuthenticated'](),controller[_0xa2b9('0x10')]);router['get'](_0xa2b9('0x11'),auth['isAuthenticated'](),controller[_0xa2b9('0x12')]);router[_0xa2b9('0xa')]('/:id/hopper_black',auth[_0xa2b9('0xc')](),controller['getHopperBlacks']);router[_0xa2b9('0xa')]('/:id/lists',auth['isAuthenticated'](),controller[_0xa2b9('0x13')]);router[_0xa2b9('0xa')](_0xa2b9('0x14'),auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x15')]);router[_0xa2b9('0x16')]('/',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x17')]);router[_0xa2b9('0x16')]('/:id/clone',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x18')]);router[_0xa2b9('0x16')]('/:id/lists',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x19')]);router[_0xa2b9('0x16')]('/:id/blacklists',auth[_0xa2b9('0xc')](),controller[_0xa2b9('0x1a')]);router[_0xa2b9('0x1b')](_0xa2b9('0xb'),auth['isAuthenticated'](),controller[_0xa2b9('0x1c')]);router['delete']('/:id',auth[_0xa2b9('0xc')](),controller['destroy']);router[_0xa2b9('0x1d')](_0xa2b9('0x1e'),auth['isAuthenticated'](),controller[_0xa2b9('0x1f')]);router['delete'](_0xa2b9('0x14'),auth[_0xa2b9('0xc')](),controller['removeBlackLists']);module[_0xa2b9('0x20')]=router;
\ No newline at end of file
+var _0x0b96=['delete','/:id','destroy','removeLists','removeBlackLists','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0b96,0xc2));var _0x60b9=function(_0x327f41,_0x5c3672){_0x327f41=_0x327f41-0x0;var _0x3ffdae=_0x0b96[_0x327f41];return _0x3ffdae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x60b9('0x0'));var timeout=require(_0x60b9('0x1'));var express=require('express');var router=express[_0x60b9('0x2')]();var fs_extra=require(_0x60b9('0x3'));var auth=require(_0x60b9('0x4'));var interaction=require(_0x60b9('0x5'));var config=require('../../config/environment');var controller=require(_0x60b9('0x6'));router['get']('/',auth[_0x60b9('0x7')](),controller[_0x60b9('0x8')]);router[_0x60b9('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x60b9('0x9')](_0x60b9('0xa'),auth[_0x60b9('0x7')](),controller['getHoppers']);router[_0x60b9('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x60b9('0xb')]);router[_0x60b9('0x9')](_0x60b9('0xc'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x60b9('0xd')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x60b9('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0x60b9('0xe')]('/',auth[_0x60b9('0x7')](),controller['create']);router['post'](_0x60b9('0xf'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x10')]);router[_0x60b9('0xe')](_0x60b9('0x11'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x12')]);router[_0x60b9('0xe')](_0x60b9('0x13'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x14')]);router['put']('/:id',auth[_0x60b9('0x7')](),controller[_0x60b9('0x15')]);router[_0x60b9('0x16')](_0x60b9('0x17'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x18')]);router[_0x60b9('0x16')]('/:id/lists',auth[_0x60b9('0x7')](),controller[_0x60b9('0x19')]);router['delete'](_0x60b9('0x13'),auth[_0x60b9('0x7')](),controller[_0x60b9('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index e24c4c1..a383f38 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 _0x59c5=['TEXT','VIRTUAL','key','exports','STRING'];(function(_0x5f343f,_0x157119){var _0x509d92=function(_0x111a69){while(--_0x111a69){_0x5f343f['push'](_0x5f343f['shift']());}};_0x509d92(++_0x157119);}(_0x59c5,0x1c0));var _0x559c=function(_0x33727c,_0x170c69){_0x33727c=_0x33727c-0x0;var _0x7ce9d4=_0x59c5[_0x33727c];return _0x7ce9d4;};'use strict';var Sequelize=require('sequelize');module[_0x559c('0x0')]={'key':{'type':Sequelize[_0x559c('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x559c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x559c('0x1')]},'name':{'type':Sequelize[_0x559c('0x3')],'get':function(){return this['getDataValue'](_0x559c('0x4'));}}};
\ No newline at end of file
+var _0x1f54=['STRING','TEXT','VIRTUAL','key','exports'];(function(_0x312e53,_0xa57cae){var _0x4b69dd=function(_0x84d6fc){while(--_0x84d6fc){_0x312e53['push'](_0x312e53['shift']());}};_0x4b69dd(++_0xa57cae);}(_0x1f54,0x15d));var _0x41f5=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x1f54[_0x277fa3];return _0x2e4520;};'use strict';var Sequelize=require('sequelize');module[_0x41f5('0x0')]={'key':{'type':Sequelize[_0x41f5('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x41f5('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x41f5('0x3')],'get':function(){return this['getDataValue'](_0x41f5('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index ad8a7f2..29361cb 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 _0x779c=['type','key','map','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','include','rows','catch','show','fields','includeAll','body','find','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x779c,0x1dd));var _0xc779=function(_0x4f800d,_0x2824f2){_0x4f800d=_0x4f800d-0x0;var _0x25421b=_0x779c[_0x4f800d];return _0x25421b;};'use strict';var emlformat=require(_0xc779('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc779('0x1'));var jsonpatch=require(_0xc779('0x2'));var rp=require(_0xc779('0x3'));var moment=require(_0xc779('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc779('0x5'));var util=require(_0xc779('0x6'));var path=require('path');var sox=require(_0xc779('0x7'));var csv=require(_0xc779('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc779('0x9'));var squel=require('squel');var crypto=require(_0xc779('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc779('0xb'));var toCsv=require(_0xc779('0x8'));var querystring=require(_0xc779('0xc'));var Papa=require(_0xc779('0xd'));var Redis=require('ioredis');var authService=require(_0xc779('0xe'));var qs=require(_0xc779('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc779('0x10'))(_0xc779('0x11'));var utils=require(_0xc779('0x12'));var config=require(_0xc779('0x13'));var licenseUtil=require(_0xc779('0x14'));var db=require(_0xc779('0x15'))['db'];function respondWithStatusCode(_0x24ec0e,_0x567b63){_0x567b63=_0x567b63||0xcc;return function(_0x582828){if(_0x582828){return _0x24ec0e[_0xc779('0x16')](_0x567b63);}return _0x24ec0e['status'](_0x567b63)[_0xc779('0x17')]();};}function respondWithResult(_0x2d7d35,_0x5ef7e9){_0x5ef7e9=_0x5ef7e9||0xc8;return function(_0x373926){if(_0x373926){return _0x2d7d35[_0xc779('0x18')](_0x5ef7e9)['json'](_0x373926);}};}function respondWithFilteredResult(_0x191070,_0x24c542){return function(_0x248ca1){if(_0x248ca1){var _0x2fc76b=typeof _0x24c542['offset']===_0xc779('0x19')&&typeof _0x24c542[_0xc779('0x1a')]==='undefined';var _0x417f6c=_0x248ca1[_0xc779('0x1b')];var _0x1f0ebc=_0x2fc76b?0x0:_0x24c542[_0xc779('0x1c')];var _0x1191ea=_0x2fc76b?_0x248ca1['count']:_0x24c542['offset']+_0x24c542[_0xc779('0x1a')];var _0x53de87;if(_0x1191ea>=_0x417f6c){_0x1191ea=_0x417f6c;_0x53de87=0xc8;}else{_0x53de87=0xce;}_0x191070[_0xc779('0x18')](_0x53de87);return _0x191070['set'](_0xc779('0x1d'),_0x1f0ebc+'-'+_0x1191ea+'/'+_0x417f6c)[_0xc779('0x1e')](_0x248ca1);}return null;};}function patchUpdates(_0x55820b){return function(_0xe6d35f){try{jsonpatch[_0xc779('0x1f')](_0xe6d35f,_0x55820b,!![]);}catch(_0x437280){return BPromise[_0xc779('0x20')](_0x437280);}return _0xe6d35f['save']();};}function saveUpdates(_0x521972,_0x3898be){return function(_0x567af8){if(_0x567af8){return _0x567af8[_0xc779('0x21')](_0x521972)[_0xc779('0x22')](function(_0x3148cb){return _0x3148cb;});}return null;};}function removeEntity(_0x5dbcdc,_0x44f769){return function(_0x22fb90){if(_0x22fb90){return _0x22fb90[_0xc779('0x23')]()['then'](function(){var _0x42d964=_0x22fb90[_0xc779('0x24')]({'plain':!![]});var _0x3eced8='CannedAnswers';return db[_0xc779('0x25')]['destroy']({'where':{'type':_0x3eced8,'resourceId':_0x42d964['id']}})[_0xc779('0x22')](function(){return _0x22fb90;});})['then'](function(){_0x5dbcdc[_0xc779('0x18')](0xcc)[_0xc779('0x17')]();});}};}function handleEntityNotFound(_0x157842,_0x401a2e){return function(_0x250595){if(!_0x250595){_0x157842['sendStatus'](0x194);}return _0x250595;};}function handleError(_0x4db079,_0x22e594){_0x22e594=_0x22e594||0x1f4;return function(_0x437227){logger[_0xc779('0x26')](_0x437227[_0xc779('0x27')]);if(_0x437227[_0xc779('0x28')]){delete _0x437227[_0xc779('0x28')];}_0x4db079[_0xc779('0x18')](_0x22e594)[_0xc779('0x29')](_0x437227);};}exports[_0xc779('0x2a')]=function(_0x1de117,_0x54d47d){var _0x31008a={},_0x6b4686={},_0x1b1d15={'count':0x0,'rows':[]};var _0x50ad3c=_['map'](db['CannedAnswer'][_0xc779('0x2b')],function(_0xe8c4f7){return{'name':_0xe8c4f7[_0xc779('0x2c')],'type':_0xe8c4f7[_0xc779('0x2d')][_0xc779('0x2e')]};});_0x6b4686['model']=_[_0xc779('0x2f')](_0x50ad3c,'name');_0x6b4686[_0xc779('0x30')]=_[_0xc779('0x31')](_0x1de117[_0xc779('0x30')]);_0x6b4686['filters']=_[_0xc779('0x32')](_0x6b4686[_0xc779('0x33')],_0x6b4686['query']);_0x31008a[_0xc779('0x34')]=_[_0xc779('0x32')](_0x6b4686[_0xc779('0x33')],qs['fields'](_0x1de117[_0xc779('0x30')]['fields']));_0x31008a[_0xc779('0x34')]=_0x31008a[_0xc779('0x34')][_0xc779('0x35')]?_0x31008a[_0xc779('0x34')]:_0x6b4686['model'];if(!_0x1de117[_0xc779('0x30')][_0xc779('0x36')](_0xc779('0x37'))){_0x31008a['limit']=qs[_0xc779('0x1a')](_0x1de117[_0xc779('0x30')][_0xc779('0x1a')]);_0x31008a[_0xc779('0x1c')]=qs[_0xc779('0x1c')](_0x1de117['query'][_0xc779('0x1c')]);}_0x31008a[_0xc779('0x38')]=qs[_0xc779('0x39')](_0x1de117[_0xc779('0x30')][_0xc779('0x39')]);_0x31008a[_0xc779('0x3a')]=qs[_0xc779('0x3b')](_[_0xc779('0x3c')](_0x1de117['query'],_0x6b4686['filters']),_0x50ad3c);if(_0x1de117[_0xc779('0x30')][_0xc779('0x3d')]){_0x31008a[_0xc779('0x3a')]=_[_0xc779('0x3e')](_0x31008a['where'],{'$or':[{'key':{'$like':'%'+_0x1de117['query'][_0xc779('0x3d')]+'%'}},{'value':{'$like':'%'+_0x1de117[_0xc779('0x30')][_0xc779('0x3d')]+'%'}}]});}_0x31008a=_[_0xc779('0x3e')]({},_0x31008a,_0x1de117[_0xc779('0x3f')]);var _0x219c56={'where':_0x31008a[_0xc779('0x3a')]};return db[_0xc779('0x40')]['count'](_0x219c56)['then'](function(_0x40b16b){_0x1b1d15[_0xc779('0x1b')]=_0x40b16b;if(_0x1de117['query']['includeAll']){_0x31008a[_0xc779('0x41')]=[{'all':!![]}];}return db[_0xc779('0x40')]['findAll'](_0x31008a);})['then'](function(_0x15769c){_0x1b1d15[_0xc779('0x42')]=_0x15769c;return _0x1b1d15;})[_0xc779('0x22')](respondWithFilteredResult(_0x54d47d,_0x31008a))[_0xc779('0x43')](handleError(_0x54d47d,null));};exports[_0xc779('0x44')]=function(_0x25474e,_0x118499){var _0x1b3c3c={'raw':!![],'where':{'id':_0x25474e['params']['id']}},_0xb96ce0={};_0xb96ce0['model']=_[_0xc779('0x31')](db[_0xc779('0x40')][_0xc779('0x2b')]);_0xb96ce0[_0xc779('0x30')]=_['keys'](_0x25474e[_0xc779('0x30')]);_0xb96ce0[_0xc779('0x3b')]=_[_0xc779('0x32')](_0xb96ce0[_0xc779('0x33')],_0xb96ce0[_0xc779('0x30')]);_0x1b3c3c[_0xc779('0x34')]=_[_0xc779('0x32')](_0xb96ce0['model'],qs[_0xc779('0x45')](_0x25474e[_0xc779('0x30')]['fields']));_0x1b3c3c[_0xc779('0x34')]=_0x1b3c3c[_0xc779('0x34')][_0xc779('0x35')]?_0x1b3c3c[_0xc779('0x34')]:_0xb96ce0[_0xc779('0x33')];if(_0x25474e[_0xc779('0x30')][_0xc779('0x46')]){_0x1b3c3c[_0xc779('0x41')]=[{'all':!![]}];}_0x1b3c3c=_['merge']({},_0x1b3c3c,_0x25474e['options']);return db[_0xc779('0x40')]['find'](_0x1b3c3c)[_0xc779('0x22')](handleEntityNotFound(_0x118499,null))[_0xc779('0x22')](respondWithResult(_0x118499,null))[_0xc779('0x43')](handleError(_0x118499,null));};exports[_0xc779('0x21')]=function(_0x59379b,_0x26ad0d){if(_0x59379b[_0xc779('0x47')]['id']){delete _0x59379b['body']['id'];}return db[_0xc779('0x40')][_0xc779('0x48')]({'where':{'id':_0x59379b[_0xc779('0x49')]['id']}})['then'](handleEntityNotFound(_0x26ad0d,null))[_0xc779('0x22')](saveUpdates(_0x59379b[_0xc779('0x47')],null))[_0xc779('0x22')](respondWithResult(_0x26ad0d,null))[_0xc779('0x43')](handleError(_0x26ad0d,null));};exports[_0xc779('0x23')]=function(_0x8b571d,_0x185524){return db[_0xc779('0x40')][_0xc779('0x48')]({'where':{'id':_0x8b571d['params']['id']}})[_0xc779('0x22')](handleEntityNotFound(_0x185524,null))[_0xc779('0x22')](removeEntity(_0x185524,null))[_0xc779('0x43')](handleError(_0x185524,null));};exports[_0xc779('0x4a')]=function(_0x583199,_0x349356){var _0xc09ce3={'key':_0x583199['body'][_0xc779('0x2e')]};if(_0x583199[_0xc779('0x47')]['MailAccountId']){_0xc09ce3[_0xc779('0x4b')]=_0x583199[_0xc779('0x47')][_0xc779('0x4b')];}else if(_0x583199['body']['SmsAccountId']){_0xc09ce3[_0xc779('0x4c')]=_0x583199[_0xc779('0x47')][_0xc779('0x4c')];}else if(_0x583199[_0xc779('0x47')][_0xc779('0x4d')]){_0xc09ce3['OpenchannelAccountId']=_0x583199[_0xc779('0x47')][_0xc779('0x4d')];}else if(_0x583199[_0xc779('0x47')][_0xc779('0x4e')]){_0xc09ce3['ChatWebsiteId']=_0x583199[_0xc779('0x47')][_0xc779('0x4e')];}return db['CannedAnswer'][_0xc779('0x48')]({'where':_0xc09ce3})[_0xc779('0x22')](function(_0x1b4da0){if(_0x1b4da0){throw new db[(_0xc779('0x4f'))]['ValidationError'](_0xc779('0x50'));}return db[_0xc779('0x40')]['create'](_0x583199['body']);})[_0xc779('0x22')](function(_0x4837d0){var _0x2b84f0=_0x583199[_0xc779('0x51')]['get']({'plain':!![]});if(!_0x2b84f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b84f0[_0xc779('0x52')]===_0xc779('0x51')){var _0x1e613a=_0x4837d0[_0xc779('0x24')]({'plain':!![]});return db[_0xc779('0x53')][_0xc779('0x48')]({'where':{'name':_0xc779('0x54'),'userProfileId':_0x2b84f0[_0xc779('0x55')]},'raw':!![]})[_0xc779('0x22')](function(_0x46b19e){if(_0x46b19e&&_0x46b19e[_0xc779('0x56')]===0x0){return db['UserProfileResource'][_0xc779('0x4a')]({'name':_0x1e613a[_0xc779('0x28')],'resourceId':_0x1e613a['id'],'type':_0x46b19e[_0xc779('0x28')],'sectionId':_0x46b19e['id']},{})[_0xc779('0x22')](function(){return _0x4837d0;});}else{return _0x4837d0;}})[_0xc779('0x43')](function(_0x1f3fe0){logger[_0xc779('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f3fe0);throw _0x1f3fe0;});}return _0x4837d0;})['then'](respondWithResult(_0x349356,0xc9))[_0xc779('0x43')](handleError(_0x349356,null));};
\ No newline at end of file
+var _0x382e=['include','findAll','rows','show','find','catch','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','util','path','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','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','key','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll'];(function(_0x41eeed,_0x42dc83){var _0x1fa067=function(_0x545e32){while(--_0x545e32){_0x41eeed['push'](_0x41eeed['shift']());}};_0x1fa067(++_0x42dc83);}(_0x382e,0x6d));var _0xe382=function(_0x3507b4,_0x603d00){_0x3507b4=_0x3507b4-0x0;var _0x4b56cd=_0x382e[_0x3507b4];return _0x4b56cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe382('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe382('0x1'));var rp=require(_0xe382('0x2'));var moment=require('moment');var BPromise=require(_0xe382('0x3'));var Mustache=require('mustache');var util=require(_0xe382('0x4'));var path=require(_0xe382('0x5'));var sox=require(_0xe382('0x6'));var csv=require(_0xe382('0x7'));var ejs=require(_0xe382('0x8'));var fs=require('fs');var fs_extra=require(_0xe382('0x9'));var _=require('lodash');var squel=require(_0xe382('0xa'));var crypto=require(_0xe382('0xb'));var jsforce=require(_0xe382('0xc'));var deskjs=require(_0xe382('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe382('0xe'));var Papa=require(_0xe382('0xf'));var Redis=require(_0xe382('0x10'));var authService=require(_0xe382('0x11'));var qs=require(_0xe382('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe382('0x13'))(_0xe382('0x14'));var utils=require(_0xe382('0x15'));var config=require(_0xe382('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a4bb3,_0x5dcbef){_0x5dcbef=_0x5dcbef||0xcc;return function(_0x381e80){if(_0x381e80){return _0x2a4bb3[_0xe382('0x17')](_0x5dcbef);}return _0x2a4bb3['status'](_0x5dcbef)[_0xe382('0x18')]();};}function respondWithResult(_0x97dfb4,_0x929339){_0x929339=_0x929339||0xc8;return function(_0x4020c3){if(_0x4020c3){return _0x97dfb4[_0xe382('0x19')](_0x929339)['json'](_0x4020c3);}};}function respondWithFilteredResult(_0x50b3cf,_0x5ac6e3){return function(_0x170fcb){if(_0x170fcb){var _0x484f91=typeof _0x5ac6e3[_0xe382('0x1a')]===_0xe382('0x1b')&&typeof _0x5ac6e3['limit']===_0xe382('0x1b');var _0x46aaac=_0x170fcb[_0xe382('0x1c')];var _0x4ff142=_0x484f91?0x0:_0x5ac6e3[_0xe382('0x1a')];var _0x218e32=_0x484f91?_0x170fcb[_0xe382('0x1c')]:_0x5ac6e3[_0xe382('0x1a')]+_0x5ac6e3[_0xe382('0x1d')];var _0x472c99;if(_0x218e32>=_0x46aaac){_0x218e32=_0x46aaac;_0x472c99=0xc8;}else{_0x472c99=0xce;}_0x50b3cf[_0xe382('0x19')](_0x472c99);return _0x50b3cf['set'](_0xe382('0x1e'),_0x4ff142+'-'+_0x218e32+'/'+_0x46aaac)[_0xe382('0x1f')](_0x170fcb);}return null;};}function patchUpdates(_0x22bedc){return function(_0x3b6bbd){try{jsonpatch[_0xe382('0x20')](_0x3b6bbd,_0x22bedc,!![]);}catch(_0x2b5867){return BPromise[_0xe382('0x21')](_0x2b5867);}return _0x3b6bbd[_0xe382('0x22')]();};}function saveUpdates(_0x3c285a,_0x3be8be){return function(_0x633c46){if(_0x633c46){return _0x633c46['update'](_0x3c285a)[_0xe382('0x23')](function(_0x5cfbdb){return _0x5cfbdb;});}return null;};}function removeEntity(_0x48fb44,_0x5356f9){return function(_0x173eca){if(_0x173eca){return _0x173eca[_0xe382('0x24')]()['then'](function(){var _0x43ffdc=_0x173eca[_0xe382('0x25')]({'plain':!![]});var _0x100d16=_0xe382('0x26');return db[_0xe382('0x27')][_0xe382('0x24')]({'where':{'type':_0x100d16,'resourceId':_0x43ffdc['id']}})[_0xe382('0x23')](function(){return _0x173eca;});})[_0xe382('0x23')](function(){_0x48fb44[_0xe382('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477248,_0x1bdc49){return function(_0xf9827){if(!_0xf9827){_0x477248[_0xe382('0x17')](0x194);}return _0xf9827;};}function handleError(_0x1f9f39,_0xe840f3){_0xe840f3=_0xe840f3||0x1f4;return function(_0x5e1d7e){logger[_0xe382('0x28')](_0x5e1d7e[_0xe382('0x29')]);if(_0x5e1d7e[_0xe382('0x2a')]){delete _0x5e1d7e['name'];}_0x1f9f39[_0xe382('0x19')](_0xe840f3)[_0xe382('0x2b')](_0x5e1d7e);};}exports['index']=function(_0x130214,_0xa1224){var _0x140fb1={},_0x3b72c9={},_0x23c5da={'count':0x0,'rows':[]};var _0x139f87=_[_0xe382('0x2c')](db[_0xe382('0x2d')][_0xe382('0x2e')],function(_0x263406){return{'name':_0x263406[_0xe382('0x2f')],'type':_0x263406['type'][_0xe382('0x30')]};});_0x3b72c9['model']=_[_0xe382('0x2c')](_0x139f87,_0xe382('0x2a'));_0x3b72c9[_0xe382('0x31')]=_[_0xe382('0x32')](_0x130214[_0xe382('0x31')]);_0x3b72c9['filters']=_[_0xe382('0x33')](_0x3b72c9['model'],_0x3b72c9[_0xe382('0x31')]);_0x140fb1['attributes']=_[_0xe382('0x33')](_0x3b72c9['model'],qs['fields'](_0x130214[_0xe382('0x31')][_0xe382('0x34')]));_0x140fb1[_0xe382('0x35')]=_0x140fb1['attributes'][_0xe382('0x36')]?_0x140fb1['attributes']:_0x3b72c9[_0xe382('0x37')];if(!_0x130214[_0xe382('0x31')][_0xe382('0x38')](_0xe382('0x39'))){_0x140fb1['limit']=qs[_0xe382('0x1d')](_0x130214[_0xe382('0x31')]['limit']);_0x140fb1[_0xe382('0x1a')]=qs['offset'](_0x130214['query'][_0xe382('0x1a')]);}_0x140fb1[_0xe382('0x3a')]=qs['sort'](_0x130214['query'][_0xe382('0x3b')]);_0x140fb1['where']=qs[_0xe382('0x3c')](_[_0xe382('0x3d')](_0x130214['query'],_0x3b72c9[_0xe382('0x3c')]),_0x139f87);if(_0x130214[_0xe382('0x31')][_0xe382('0x3e')]){_0x140fb1[_0xe382('0x3f')]=_[_0xe382('0x40')](_0x140fb1[_0xe382('0x3f')],{'$or':[{'key':{'$like':'%'+_0x130214[_0xe382('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x130214[_0xe382('0x31')][_0xe382('0x3e')]+'%'}}]});}_0x140fb1=_[_0xe382('0x40')]({},_0x140fb1,_0x130214[_0xe382('0x41')]);var _0x412d38={'where':_0x140fb1[_0xe382('0x3f')]};return db[_0xe382('0x2d')][_0xe382('0x1c')](_0x412d38)[_0xe382('0x23')](function(_0x5d0c6e){_0x23c5da['count']=_0x5d0c6e;if(_0x130214[_0xe382('0x31')][_0xe382('0x42')]){_0x140fb1[_0xe382('0x43')]=[{'all':!![]}];}return db[_0xe382('0x2d')][_0xe382('0x44')](_0x140fb1);})[_0xe382('0x23')](function(_0x50594f){_0x23c5da[_0xe382('0x45')]=_0x50594f;return _0x23c5da;})[_0xe382('0x23')](respondWithFilteredResult(_0xa1224,_0x140fb1))['catch'](handleError(_0xa1224,null));};exports[_0xe382('0x46')]=function(_0x190727,_0x13abaf){var _0x5c1a3b={'raw':!![],'where':{'id':_0x190727['params']['id']}},_0x2b8c38={};_0x2b8c38['model']=_[_0xe382('0x32')](db[_0xe382('0x2d')][_0xe382('0x2e')]);_0x2b8c38[_0xe382('0x31')]=_['keys'](_0x190727[_0xe382('0x31')]);_0x2b8c38[_0xe382('0x3c')]=_[_0xe382('0x33')](_0x2b8c38['model'],_0x2b8c38[_0xe382('0x31')]);_0x5c1a3b['attributes']=_[_0xe382('0x33')](_0x2b8c38[_0xe382('0x37')],qs['fields'](_0x190727['query'][_0xe382('0x34')]));_0x5c1a3b[_0xe382('0x35')]=_0x5c1a3b[_0xe382('0x35')][_0xe382('0x36')]?_0x5c1a3b['attributes']:_0x2b8c38[_0xe382('0x37')];if(_0x190727[_0xe382('0x31')]['includeAll']){_0x5c1a3b[_0xe382('0x43')]=[{'all':!![]}];}_0x5c1a3b=_[_0xe382('0x40')]({},_0x5c1a3b,_0x190727['options']);return db[_0xe382('0x2d')][_0xe382('0x47')](_0x5c1a3b)[_0xe382('0x23')](handleEntityNotFound(_0x13abaf,null))['then'](respondWithResult(_0x13abaf,null))[_0xe382('0x48')](handleError(_0x13abaf,null));};exports[_0xe382('0x49')]=function(_0x194396,_0x3475a7){if(_0x194396[_0xe382('0x4a')]['id']){delete _0x194396['body']['id'];}return db[_0xe382('0x2d')][_0xe382('0x47')]({'where':{'id':_0x194396['params']['id']}})[_0xe382('0x23')](handleEntityNotFound(_0x3475a7,null))[_0xe382('0x23')](saveUpdates(_0x194396[_0xe382('0x4a')],null))['then'](respondWithResult(_0x3475a7,null))[_0xe382('0x48')](handleError(_0x3475a7,null));};exports[_0xe382('0x24')]=function(_0x46a99d,_0x1c7d74){return db[_0xe382('0x2d')][_0xe382('0x47')]({'where':{'id':_0x46a99d['params']['id']}})[_0xe382('0x23')](handleEntityNotFound(_0x1c7d74,null))[_0xe382('0x23')](removeEntity(_0x1c7d74,null))[_0xe382('0x48')](handleError(_0x1c7d74,null));};exports[_0xe382('0x4b')]=function(_0x39194e,_0xd92e24){var _0x3370c7={'key':_0x39194e[_0xe382('0x4a')]['key']};if(_0x39194e[_0xe382('0x4a')][_0xe382('0x4c')]){_0x3370c7[_0xe382('0x4c')]=_0x39194e[_0xe382('0x4a')]['MailAccountId'];}else if(_0x39194e[_0xe382('0x4a')][_0xe382('0x4d')]){_0x3370c7[_0xe382('0x4d')]=_0x39194e[_0xe382('0x4a')][_0xe382('0x4d')];}else if(_0x39194e[_0xe382('0x4a')][_0xe382('0x4e')]){_0x3370c7[_0xe382('0x4e')]=_0x39194e[_0xe382('0x4a')][_0xe382('0x4e')];}else if(_0x39194e[_0xe382('0x4a')]['ChatWebsiteId']){_0x3370c7[_0xe382('0x4f')]=_0x39194e[_0xe382('0x4a')]['ChatWebsiteId'];}return db['CannedAnswer'][_0xe382('0x47')]({'where':_0x3370c7})[_0xe382('0x23')](function(_0x1941f6){if(_0x1941f6){throw new db['Sequelize']['ValidationError'](_0xe382('0x50'));}return db[_0xe382('0x2d')][_0xe382('0x4b')](_0x39194e[_0xe382('0x4a')]);})['then'](function(_0xb7d3e){var _0x112920=_0x39194e['user'][_0xe382('0x25')]({'plain':!![]});if(!_0x112920)throw new Error(_0xe382('0x51'));if(_0x112920[_0xe382('0x52')]===_0xe382('0x53')){var _0x5cefbc=_0xb7d3e[_0xe382('0x25')]({'plain':!![]});return db[_0xe382('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x112920[_0xe382('0x55')]},'raw':!![]})[_0xe382('0x23')](function(_0x5966d0){if(_0x5966d0&&_0x5966d0[_0xe382('0x56')]===0x0){return db[_0xe382('0x27')][_0xe382('0x4b')]({'name':_0x5cefbc[_0xe382('0x2a')],'resourceId':_0x5cefbc['id'],'type':_0x5966d0[_0xe382('0x2a')],'sectionId':_0x5966d0['id']},{})[_0xe382('0x23')](function(){return _0xb7d3e;});}else{return _0xb7d3e;}})['catch'](function(_0x4eac31){logger[_0xe382('0x28')](_0xe382('0x57'),_0x4eac31);throw _0x4eac31;});}return _0xb7d3e;})['then'](respondWithResult(_0xd92e24,0xc9))[_0xe382('0x48')](handleError(_0xd92e24,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 81f184e..79566c4 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 _0x153c=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x177385,_0x323024){var _0x1d4376=function(_0x21af8b){while(--_0x21af8b){_0x177385['push'](_0x177385['shift']());}};_0x1d4376(++_0x323024);}(_0x153c,0x8c));var _0xc153=function(_0x3dea86,_0x32414d){_0x3dea86=_0x3dea86-0x0;var _0x5a9bd1=_0x153c[_0x3dea86];return _0x5a9bd1;};'use strict';var _=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var logger=require(_0xc153('0x2'))(_0xc153('0x3'));var moment=require('moment');var BPromise=require(_0xc153('0x4'));var rp=require(_0xc153('0x5'));var fs=require('fs');var path=require(_0xc153('0x6'));var rimraf=require(_0xc153('0x7'));var config=require(_0xc153('0x8'));var attributes=require(_0xc153('0x9'));module[_0xc153('0xa')]=function(_0x58f5c5,_0x267a79){return _0x58f5c5[_0xc153('0xb')](_0xc153('0xc'),attributes,{'tableName':_0xc153('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc153('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x08ff=['request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xce87e3,_0x58cae4){var _0x7d87f4=function(_0x5bc232){while(--_0x5bc232){_0xce87e3['push'](_0xce87e3['shift']());}};_0x7d87f4(++_0x58cae4);}(_0x08ff,0x72));var _0xf08f=function(_0x5017e8,_0x44bf12){_0x5017e8=_0x5017e8-0x0;var _0x4f36f0=_0x08ff[_0x5017e8];return _0x4f36f0;};'use strict';var _=require(_0xf08f('0x0'));var util=require(_0xf08f('0x1'));var logger=require(_0xf08f('0x2'))(_0xf08f('0x3'));var moment=require(_0xf08f('0x4'));var BPromise=require(_0xf08f('0x5'));var rp=require(_0xf08f('0x6'));var fs=require('fs');var path=require(_0xf08f('0x7'));var rimraf=require('rimraf');var config=require(_0xf08f('0x8'));var attributes=require(_0xf08f('0x9'));module[_0xf08f('0xa')]=function(_0x1bf734,_0x4a4e14){return _0x1bf734['define'](_0xf08f('0xb'),attributes,{'tableName':_0xf08f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf08f('0xd'),'collate':_0xf08f('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 36d3486..0962278 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(_0x2e9475,_0x47c48c){var _0x1106ca=function(_0x5c1cb2){while(--_0x5c1cb2){_0x2e9475['push'](_0x2e9475['shift']());}};_0x1106ca(++_0x47c48c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x4fda0c,_0x28b229){var _0x5e828a=function(_0x2e5604){while(--_0x2e5604){_0x4fda0c['push'](_0x4fda0c['shift']());}};_0x5e828a(++_0x28b229);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index e8defb0..e636f0c 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 _0xe47a=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id'];(function(_0x504d47,_0x59661f){var _0x238d51=function(_0x4658c5){while(--_0x4658c5){_0x504d47['push'](_0x504d47['shift']());}};_0x238d51(++_0x59661f);}(_0xe47a,0x13b));var _0xae47=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe47a[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0xae47('0x0'));var util=require(_0xae47('0x1'));var path=require(_0xae47('0x2'));var timeout=require(_0xae47('0x3'));var express=require(_0xae47('0x4'));var router=express[_0xae47('0x5')]();var fs_extra=require(_0xae47('0x6'));var auth=require(_0xae47('0x7'));var interaction=require(_0xae47('0x8'));var config=require(_0xae47('0x9'));var controller=require(_0xae47('0xa'));router[_0xae47('0xb')]('/',auth[_0xae47('0xc')](),controller[_0xae47('0xd')]);router[_0xae47('0xb')](_0xae47('0xe'),auth[_0xae47('0xc')](),controller[_0xae47('0xf')]);router['post']('/',auth[_0xae47('0xc')](),controller[_0xae47('0x10')]);router[_0xae47('0x11')](_0xae47('0xe'),auth[_0xae47('0xc')](),controller[_0xae47('0x12')]);router[_0xae47('0x13')](_0xae47('0xe'),auth[_0xae47('0xc')](),controller[_0xae47('0x14')]);module[_0xae47('0x15')]=router;
\ No newline at end of file
+var _0x38df=['isAuthenticated','index','get','/:id','post','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x31e94f,_0x42ecd6){var _0x1b8494=function(_0x5da15c){while(--_0x5da15c){_0x31e94f['push'](_0x31e94f['shift']());}};_0x1b8494(++_0x42ecd6);}(_0x38df,0x18d));var _0xf38d=function(_0xf6074f,_0x40fe18){_0xf6074f=_0xf6074f-0x0;var _0x4c6c10=_0x38df[_0xf6074f];return _0x4c6c10;};'use strict';var multer=require(_0xf38d('0x0'));var util=require(_0xf38d('0x1'));var path=require(_0xf38d('0x2'));var timeout=require('connect-timeout');var express=require(_0xf38d('0x3'));var router=express[_0xf38d('0x4')]();var fs_extra=require(_0xf38d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf38d('0x6'));var config=require(_0xf38d('0x7'));var controller=require(_0xf38d('0x8'));router['get']('/',auth[_0xf38d('0x9')](),controller[_0xf38d('0xa')]);router[_0xf38d('0xb')](_0xf38d('0xc'),auth[_0xf38d('0x9')](),controller['show']);router[_0xf38d('0xd')]('/',auth[_0xf38d('0x9')](),controller['create']);router['put'](_0xf38d('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf38d('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 2a6ae7d..2383894 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 _0xd404=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x4d6da3,_0x290a5a){var _0x224d75=function(_0x1b2ff7){while(--_0x1b2ff7){_0x4d6da3['push'](_0x4d6da3['shift']());}};_0x224d75(++_0x290a5a);}(_0xd404,0x15b));var _0x4d40=function(_0x4c3c81,_0x337b82){_0x4c3c81=_0x4c3c81-0x0;var _0x4949f6=_0xd404[_0x4c3c81];return _0x4949f6;};'use strict';var Sequelize=require(_0x4d40('0x0'));module[_0x4d40('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x4d40('0x2')},'clid':{'type':Sequelize[_0x4d40('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x4d40('0x3')]},'dcontext':{'type':Sequelize[_0x4d40('0x3')]},'channel':{'type':Sequelize[_0x4d40('0x3')]},'dstchannel':{'type':Sequelize[_0x4d40('0x3')]},'lastapp':{'type':Sequelize[_0x4d40('0x3')]},'lastdata':{'type':Sequelize[_0x4d40('0x3')]},'duration':{'type':Sequelize[_0x4d40('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4d40('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4d40('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4d40('0x3')]},'userfield':{'type':Sequelize[_0x4d40('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x4d40('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4d40('0x3')]},'tag':{'type':Sequelize[_0x4d40('0x3')]}};
\ No newline at end of file
+var _0x3fb7=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0xaaa012,_0x93128c){var _0x4ed948=function(_0x5acf29){while(--_0x5acf29){_0xaaa012['push'](_0xaaa012['shift']());}};_0x4ed948(++_0x93128c);}(_0x3fb7,0x187));var _0x73fb=function(_0x2cd286,_0x4cabb9){_0x2cd286=_0x2cd286-0x0;var _0x542b78=_0x3fb7[_0x2cd286];return _0x542b78;};'use strict';var Sequelize=require(_0x73fb('0x0'));module[_0x73fb('0x1')]={'calldate':{'type':Sequelize[_0x73fb('0x2')],'allowNull':![],'defaultValue':_0x73fb('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x73fb('0x4')]},'dst':{'type':Sequelize[_0x73fb('0x4')]},'dcontext':{'type':Sequelize[_0x73fb('0x4')]},'channel':{'type':Sequelize[_0x73fb('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x73fb('0x4')]},'lastdata':{'type':Sequelize[_0x73fb('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x73fb('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x73fb('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x73fb('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x73fb('0x4')]},'type':{'type':Sequelize[_0x73fb('0x4')]},'tag':{'type':Sequelize[_0x73fb('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 65457b0..ca3c3c7 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 _0x9335=['hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','include','findAll','then','rows','show','params','rawAttributes','includeAll','options','find','create','catch','update','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','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','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','error','name','send','map','Cdr','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x2960cd,_0x3aafb0){var _0x2df769=function(_0x38be58){while(--_0x38be58){_0x2960cd['push'](_0x2960cd['shift']());}};_0x2df769(++_0x3aafb0);}(_0x9335,0xab));var _0x5933=function(_0x27e9d3,_0x3b9b3e){_0x27e9d3=_0x27e9d3-0x0;var _0x325885=_0x9335[_0x27e9d3];return _0x325885;};'use strict';var emlformat=require(_0x5933('0x0'));var rimraf=require(_0x5933('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5933('0x2'));var rp=require(_0x5933('0x3'));var moment=require(_0x5933('0x4'));var BPromise=require(_0x5933('0x5'));var Mustache=require(_0x5933('0x6'));var util=require(_0x5933('0x7'));var path=require(_0x5933('0x8'));var sox=require('sox');var csv=require(_0x5933('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5933('0xa'));var squel=require(_0x5933('0xb'));var crypto=require(_0x5933('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5933('0xd'));var toCsv=require(_0x5933('0x9'));var querystring=require(_0x5933('0xe'));var Papa=require(_0x5933('0xf'));var Redis=require(_0x5933('0x10'));var authService=require(_0x5933('0x11'));var qs=require(_0x5933('0x12'));var as=require(_0x5933('0x13'));var hardwareService=require(_0x5933('0x14'));var logger=require(_0x5933('0x15'))(_0x5933('0x16'));var utils=require(_0x5933('0x17'));var config=require(_0x5933('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5933('0x19'))['db'];function respondWithStatusCode(_0x5af679,_0x8b6bad){_0x8b6bad=_0x8b6bad||0xcc;return function(_0x1b4428){if(_0x1b4428){return _0x5af679[_0x5933('0x1a')](_0x8b6bad);}return _0x5af679['status'](_0x8b6bad)[_0x5933('0x1b')]();};}function respondWithResult(_0x542448,_0x1ab3d0){_0x1ab3d0=_0x1ab3d0||0xc8;return function(_0x4fc51d){if(_0x4fc51d){return _0x542448[_0x5933('0x1c')](_0x1ab3d0)['json'](_0x4fc51d);}};}function respondWithFilteredResult(_0xf6321f,_0x5e91da){return function(_0x404555){if(_0x404555){var _0x34c035=typeof _0x5e91da[_0x5933('0x1d')]==='undefined'&&typeof _0x5e91da['limit']===_0x5933('0x1e');var _0x2a2532=_0x404555[_0x5933('0x1f')];var _0x51a525=_0x34c035?0x0:_0x5e91da['offset'];var _0x15263f=_0x34c035?_0x404555['count']:_0x5e91da[_0x5933('0x1d')]+_0x5e91da[_0x5933('0x20')];var _0x21b1d7;if(_0x15263f>=_0x2a2532){_0x15263f=_0x2a2532;_0x21b1d7=0xc8;}else{_0x21b1d7=0xce;}_0xf6321f['status'](_0x21b1d7);return _0xf6321f[_0x5933('0x21')](_0x5933('0x22'),_0x51a525+'-'+_0x15263f+'/'+_0x2a2532)[_0x5933('0x23')](_0x404555);}return null;};}function patchUpdates(_0x4d661c){return function(_0x59a2cd){try{jsonpatch['apply'](_0x59a2cd,_0x4d661c,!![]);}catch(_0x36d602){return BPromise['reject'](_0x36d602);}return _0x59a2cd[_0x5933('0x24')]();};}function saveUpdates(_0x4a5252,_0x2d0fb7){return function(_0x50026f){if(_0x50026f){return _0x50026f['update'](_0x4a5252)['then'](function(_0x4a1901){return _0x4a1901;});}return null;};}function removeEntity(_0x3d70ef,_0x5639c7){return function(_0x1a2f5d){if(_0x1a2f5d){return _0x1a2f5d['destroy']()['then'](function(){_0x3d70ef[_0x5933('0x1c')](0xcc)[_0x5933('0x1b')]();});}};}function handleEntityNotFound(_0x297b15,_0x56e8a9){return function(_0xd2320){if(!_0xd2320){_0x297b15[_0x5933('0x1a')](0x194);}return _0xd2320;};}function handleError(_0x2348bc,_0x5a0de4){_0x5a0de4=_0x5a0de4||0x1f4;return function(_0x1e24f6){logger[_0x5933('0x25')](_0x1e24f6['stack']);if(_0x1e24f6[_0x5933('0x26')]){delete _0x1e24f6[_0x5933('0x26')];}_0x2348bc['status'](_0x5a0de4)[_0x5933('0x27')](_0x1e24f6);};}exports['index']=function(_0x51dbae,_0x45039b){var _0x1af598={},_0x4adb80={},_0x255ed5={'count':0x0,'rows':[]};var _0x51e2d6=_[_0x5933('0x28')](db[_0x5933('0x29')]['rawAttributes'],function(_0x4fc086){return{'name':_0x4fc086['fieldName'],'type':_0x4fc086[_0x5933('0x2a')][_0x5933('0x2b')]};});_0x4adb80['model']=_[_0x5933('0x28')](_0x51e2d6,_0x5933('0x26'));_0x4adb80[_0x5933('0x2c')]=_[_0x5933('0x2d')](_0x51dbae['query']);_0x4adb80[_0x5933('0x2e')]=_['intersection'](_0x4adb80[_0x5933('0x2f')],_0x4adb80['query']);_0x1af598[_0x5933('0x30')]=_[_0x5933('0x31')](_0x4adb80[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x51dbae['query'][_0x5933('0x32')]));_0x1af598[_0x5933('0x30')]=_0x1af598['attributes']['length']?_0x1af598[_0x5933('0x30')]:_0x4adb80['model'];if(!_0x51dbae['query'][_0x5933('0x33')](_0x5933('0x34'))){_0x1af598[_0x5933('0x20')]=qs[_0x5933('0x20')](_0x51dbae['query']['limit']);_0x1af598['offset']=qs['offset'](_0x51dbae[_0x5933('0x2c')]['offset']);}_0x1af598['order']=qs['sort'](_0x51dbae[_0x5933('0x2c')][_0x5933('0x35')]);_0x1af598[_0x5933('0x36')]=qs[_0x5933('0x2e')](_[_0x5933('0x37')](_0x51dbae[_0x5933('0x2c')],_0x4adb80[_0x5933('0x2e')]),_0x51e2d6);if(_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]){_0x1af598[_0x5933('0x36')]=_['merge'](_0x1af598[_0x5933('0x36')],{'$or':_[_0x5933('0x28')](_0x51e2d6,function(_0x6e2a66){if(_0x6e2a66[_0x5933('0x2a')]!==_0x5933('0x39')){var _0x2c1484={};_0x2c1484[_0x6e2a66[_0x5933('0x26')]]={'$like':'%'+_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]+'%'};return _0x2c1484;}})});}_0x1af598=_[_0x5933('0x3a')]({},_0x1af598,_0x51dbae['options']);var _0x5c2bd0={'where':_0x1af598[_0x5933('0x36')]};return db[_0x5933('0x29')][_0x5933('0x1f')](_0x5c2bd0)['then'](function(_0x5d07da){_0x255ed5[_0x5933('0x1f')]=_0x5d07da;if(_0x51dbae[_0x5933('0x2c')]['includeAll']){_0x1af598[_0x5933('0x3b')]=[{'all':!![]}];}return db[_0x5933('0x29')][_0x5933('0x3c')](_0x1af598);})[_0x5933('0x3d')](function(_0x192576){_0x255ed5[_0x5933('0x3e')]=_0x192576;return _0x255ed5;})['then'](respondWithFilteredResult(_0x45039b,_0x1af598))['catch'](handleError(_0x45039b,null));};exports[_0x5933('0x3f')]=function(_0x1aef52,_0x36d072){var _0x293845={'raw':!![],'where':{'id':_0x1aef52[_0x5933('0x40')]['id']}},_0x247c65={};_0x247c65['model']=_[_0x5933('0x2d')](db[_0x5933('0x29')][_0x5933('0x41')]);_0x247c65['query']=_[_0x5933('0x2d')](_0x1aef52[_0x5933('0x2c')]);_0x247c65[_0x5933('0x2e')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],_0x247c65[_0x5933('0x2c')]);_0x293845[_0x5933('0x30')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x1aef52['query'][_0x5933('0x32')]));_0x293845['attributes']=_0x293845['attributes']['length']?_0x293845[_0x5933('0x30')]:_0x247c65['model'];if(_0x1aef52['query'][_0x5933('0x42')]){_0x293845[_0x5933('0x3b')]=[{'all':!![]}];}_0x293845=_['merge']({},_0x293845,_0x1aef52[_0x5933('0x43')]);return db['Cdr'][_0x5933('0x44')](_0x293845)[_0x5933('0x3d')](handleEntityNotFound(_0x36d072,null))['then'](respondWithResult(_0x36d072,null))['catch'](handleError(_0x36d072,null));};exports[_0x5933('0x45')]=function(_0x4622bd,_0x38e713){return db[_0x5933('0x29')][_0x5933('0x45')](_0x4622bd['body'],{})[_0x5933('0x3d')](respondWithResult(_0x38e713,0xc9))[_0x5933('0x46')](handleError(_0x38e713,null));};exports[_0x5933('0x47')]=function(_0x4c2e69,_0x2d5fd4){if(_0x4c2e69[_0x5933('0x48')]['id']){delete _0x4c2e69[_0x5933('0x48')]['id'];}return db[_0x5933('0x29')]['find']({'where':{'id':_0x4c2e69[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x2d5fd4,null))[_0x5933('0x3d')](saveUpdates(_0x4c2e69[_0x5933('0x48')],null))['then'](respondWithResult(_0x2d5fd4,null))[_0x5933('0x46')](handleError(_0x2d5fd4,null));};exports[_0x5933('0x49')]=function(_0x41be67,_0x38f681){return db[_0x5933('0x29')][_0x5933('0x44')]({'where':{'id':_0x41be67[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x38f681,null))[_0x5933('0x3d')](removeEntity(_0x38f681,null))[_0x5933('0x46')](handleError(_0x38f681,null));};exports['describe']=function(_0x3fdd78,_0x4d0bb8){return db[_0x5933('0x29')]['describe']()[_0x5933('0x3d')](respondWithResult(_0x4d0bb8,null))['catch'](handleError(_0x4d0bb8,null));};
\ No newline at end of file
+var _0x9009=['stack','name','index','Cdr','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','catch','show','params','includeAll','include','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x9009,0x1d4));var _0x9900=function(_0x38e707,_0x2432de){_0x38e707=_0x38e707-0x0;var _0x2816dd=_0x9009[_0x38e707];return _0x2816dd;};'use strict';var emlformat=require(_0x9900('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9900('0x1'));var jsonpatch=require(_0x9900('0x2'));var rp=require('request-promise');var moment=require(_0x9900('0x3'));var BPromise=require(_0x9900('0x4'));var Mustache=require(_0x9900('0x5'));var util=require(_0x9900('0x6'));var path=require('path');var sox=require(_0x9900('0x7'));var csv=require(_0x9900('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9900('0x9'));var squel=require(_0x9900('0xa'));var crypto=require('crypto');var jsforce=require(_0x9900('0xb'));var deskjs=require(_0x9900('0xc'));var toCsv=require(_0x9900('0x8'));var querystring=require(_0x9900('0xd'));var Papa=require('papaparse');var Redis=require(_0x9900('0xe'));var authService=require(_0x9900('0xf'));var qs=require(_0x9900('0x10'));var as=require(_0x9900('0x11'));var hardwareService=require(_0x9900('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9900('0x13'));var config=require(_0x9900('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17070a,_0x4e8312){_0x4e8312=_0x4e8312||0xcc;return function(_0x6bd4da){if(_0x6bd4da){return _0x17070a[_0x9900('0x15')](_0x4e8312);}return _0x17070a[_0x9900('0x16')](_0x4e8312)[_0x9900('0x17')]();};}function respondWithResult(_0x318fa5,_0x1014e8){_0x1014e8=_0x1014e8||0xc8;return function(_0x2eaf32){if(_0x2eaf32){return _0x318fa5[_0x9900('0x16')](_0x1014e8)[_0x9900('0x18')](_0x2eaf32);}};}function respondWithFilteredResult(_0x209b4d,_0x375ee0){return function(_0xce2dd6){if(_0xce2dd6){var _0x154e22=typeof _0x375ee0[_0x9900('0x19')]===_0x9900('0x1a')&&typeof _0x375ee0[_0x9900('0x1b')]===_0x9900('0x1a');var _0x5d9ec9=_0xce2dd6['count'];var _0x1017a5=_0x154e22?0x0:_0x375ee0[_0x9900('0x19')];var _0x1bd7a3=_0x154e22?_0xce2dd6[_0x9900('0x1c')]:_0x375ee0['offset']+_0x375ee0[_0x9900('0x1b')];var _0x57ae85;if(_0x1bd7a3>=_0x5d9ec9){_0x1bd7a3=_0x5d9ec9;_0x57ae85=0xc8;}else{_0x57ae85=0xce;}_0x209b4d['status'](_0x57ae85);return _0x209b4d[_0x9900('0x1d')]('Content-Range',_0x1017a5+'-'+_0x1bd7a3+'/'+_0x5d9ec9)[_0x9900('0x18')](_0xce2dd6);}return null;};}function patchUpdates(_0x596eff){return function(_0x48d6df){try{jsonpatch[_0x9900('0x1e')](_0x48d6df,_0x596eff,!![]);}catch(_0x2892ce){return BPromise[_0x9900('0x1f')](_0x2892ce);}return _0x48d6df[_0x9900('0x20')]();};}function saveUpdates(_0x5ee4ad,_0x215bd4){return function(_0x3e4cee){if(_0x3e4cee){return _0x3e4cee[_0x9900('0x21')](_0x5ee4ad)[_0x9900('0x22')](function(_0x45c0d0){return _0x45c0d0;});}return null;};}function removeEntity(_0x5368bf,_0x37842b){return function(_0x218d7e){if(_0x218d7e){return _0x218d7e['destroy']()[_0x9900('0x22')](function(){_0x5368bf[_0x9900('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a015,_0x43ed24){return function(_0x2ac147){if(!_0x2ac147){_0x54a015['sendStatus'](0x194);}return _0x2ac147;};}function handleError(_0x285d51,_0x4507a9){_0x4507a9=_0x4507a9||0x1f4;return function(_0x5e3e21){logger[_0x9900('0x23')](_0x5e3e21[_0x9900('0x24')]);if(_0x5e3e21[_0x9900('0x25')]){delete _0x5e3e21[_0x9900('0x25')];}_0x285d51[_0x9900('0x16')](_0x4507a9)['send'](_0x5e3e21);};}exports[_0x9900('0x26')]=function(_0x44d775,_0x10fbae){var _0x32e343={},_0x3b1b94={},_0x50f16a={'count':0x0,'rows':[]};var _0x4cef1f=_['map'](db[_0x9900('0x27')][_0x9900('0x28')],function(_0x4ef405){return{'name':_0x4ef405[_0x9900('0x29')],'type':_0x4ef405[_0x9900('0x2a')][_0x9900('0x2b')]};});_0x3b1b94['model']=_['map'](_0x4cef1f,_0x9900('0x25'));_0x3b1b94[_0x9900('0x2c')]=_[_0x9900('0x2d')](_0x44d775[_0x9900('0x2c')]);_0x3b1b94['filters']=_['intersection'](_0x3b1b94[_0x9900('0x2e')],_0x3b1b94[_0x9900('0x2c')]);_0x32e343[_0x9900('0x2f')]=_[_0x9900('0x30')](_0x3b1b94[_0x9900('0x2e')],qs[_0x9900('0x31')](_0x44d775[_0x9900('0x2c')][_0x9900('0x31')]));_0x32e343[_0x9900('0x2f')]=_0x32e343[_0x9900('0x2f')][_0x9900('0x32')]?_0x32e343[_0x9900('0x2f')]:_0x3b1b94[_0x9900('0x2e')];if(!_0x44d775['query']['hasOwnProperty'](_0x9900('0x33'))){_0x32e343['limit']=qs[_0x9900('0x1b')](_0x44d775[_0x9900('0x2c')][_0x9900('0x1b')]);_0x32e343[_0x9900('0x19')]=qs[_0x9900('0x19')](_0x44d775[_0x9900('0x2c')][_0x9900('0x19')]);}_0x32e343[_0x9900('0x34')]=qs[_0x9900('0x35')](_0x44d775['query']['sort']);_0x32e343['where']=qs[_0x9900('0x36')](_[_0x9900('0x37')](_0x44d775['query'],_0x3b1b94[_0x9900('0x36')]),_0x4cef1f);if(_0x44d775[_0x9900('0x2c')][_0x9900('0x38')]){_0x32e343['where']=_[_0x9900('0x39')](_0x32e343[_0x9900('0x3a')],{'$or':_[_0x9900('0x3b')](_0x4cef1f,function(_0x141131){if(_0x141131[_0x9900('0x2a')]!==_0x9900('0x3c')){var _0x510d6a={};_0x510d6a[_0x141131[_0x9900('0x25')]]={'$like':'%'+_0x44d775[_0x9900('0x2c')]['filter']+'%'};return _0x510d6a;}})});}_0x32e343=_[_0x9900('0x39')]({},_0x32e343,_0x44d775['options']);var _0x2cee90={'where':_0x32e343[_0x9900('0x3a')]};return db['Cdr'][_0x9900('0x1c')](_0x2cee90)[_0x9900('0x22')](function(_0x2595cc){_0x50f16a[_0x9900('0x1c')]=_0x2595cc;if(_0x44d775[_0x9900('0x2c')]['includeAll']){_0x32e343['include']=[{'all':!![]}];}return db[_0x9900('0x27')]['findAll'](_0x32e343);})['then'](function(_0x5e2765){_0x50f16a['rows']=_0x5e2765;return _0x50f16a;})['then'](respondWithFilteredResult(_0x10fbae,_0x32e343))[_0x9900('0x3d')](handleError(_0x10fbae,null));};exports[_0x9900('0x3e')]=function(_0x3c8f30,_0x42849a){var _0x31c003={'raw':!![],'where':{'id':_0x3c8f30[_0x9900('0x3f')]['id']}},_0xb94a40={};_0xb94a40[_0x9900('0x2e')]=_['keys'](db[_0x9900('0x27')][_0x9900('0x28')]);_0xb94a40['query']=_['keys'](_0x3c8f30[_0x9900('0x2c')]);_0xb94a40[_0x9900('0x36')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],_0xb94a40[_0x9900('0x2c')]);_0x31c003[_0x9900('0x2f')]=_[_0x9900('0x30')](_0xb94a40[_0x9900('0x2e')],qs['fields'](_0x3c8f30[_0x9900('0x2c')][_0x9900('0x31')]));_0x31c003['attributes']=_0x31c003[_0x9900('0x2f')][_0x9900('0x32')]?_0x31c003[_0x9900('0x2f')]:_0xb94a40[_0x9900('0x2e')];if(_0x3c8f30['query'][_0x9900('0x40')]){_0x31c003[_0x9900('0x41')]=[{'all':!![]}];}_0x31c003=_['merge']({},_0x31c003,_0x3c8f30[_0x9900('0x42')]);return db[_0x9900('0x27')][_0x9900('0x43')](_0x31c003)['then'](handleEntityNotFound(_0x42849a,null))[_0x9900('0x22')](respondWithResult(_0x42849a,null))['catch'](handleError(_0x42849a,null));};exports[_0x9900('0x44')]=function(_0x5ea06a,_0x1409a0){return db[_0x9900('0x27')][_0x9900('0x44')](_0x5ea06a['body'],{})[_0x9900('0x22')](respondWithResult(_0x1409a0,0xc9))['catch'](handleError(_0x1409a0,null));};exports[_0x9900('0x21')]=function(_0x11be07,_0x5ac239){if(_0x11be07[_0x9900('0x45')]['id']){delete _0x11be07[_0x9900('0x45')]['id'];}return db['Cdr'][_0x9900('0x43')]({'where':{'id':_0x11be07[_0x9900('0x3f')]['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x5ac239,null))[_0x9900('0x22')](saveUpdates(_0x11be07[_0x9900('0x45')],null))['then'](respondWithResult(_0x5ac239,null))['catch'](handleError(_0x5ac239,null));};exports[_0x9900('0x46')]=function(_0x43cf2c,_0x2aa081){return db[_0x9900('0x27')][_0x9900('0x43')]({'where':{'id':_0x43cf2c['params']['id']}})[_0x9900('0x22')](handleEntityNotFound(_0x2aa081,null))[_0x9900('0x22')](removeEntity(_0x2aa081,null))[_0x9900('0x3d')](handleError(_0x2aa081,null));};exports[_0x9900('0x47')]=function(_0x2f7f74,_0xb5512f){return db[_0x9900('0x27')]['describe']()[_0x9900('0x22')](respondWithResult(_0xb5512f,null))['catch'](handleError(_0xb5512f,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 6292934..07fede9 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x11c6b0,_0x1df7ee){var _0x3b2324=function(_0x5c76a1){while(--_0x5c76a1){_0x11c6b0['push'](_0x11c6b0['shift']());}};_0x3b2324(++_0x1df7ee);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2a3693,_0x4797a3){var _0x2334cc=function(_0x3423c2){while(--_0x3423c2){_0x2a3693['push'](_0x2a3693['shift']());}};_0x2334cc(++_0x4797a3);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab45,_0x55b7d6){_0x5ab45=_0x5ab45-0x0;var _0x1974cb=_0x7a54[_0x5ab45];return _0x1974cb;};'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 c463548..62489f0 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 _0xea8d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x470721,_0x59f687){var _0x6b0cfd=function(_0x548c03){while(--_0x548c03){_0x470721['push'](_0x470721['shift']());}};_0x6b0cfd(++_0x59f687);}(_0xea8d,0x141));var _0xdea8=function(_0x453dd4,_0x33ccb6){_0x453dd4=_0x453dd4-0x0;var _0x4b755e=_0xea8d[_0x453dd4];return _0x4b755e;};'use strict';var _=require(_0xdea8('0x0'));var util=require(_0xdea8('0x1'));var moment=require(_0xdea8('0x2'));var BPromise=require(_0xdea8('0x3'));var rs=require(_0xdea8('0x4'));var fs=require('fs');var Redis=require(_0xdea8('0x5'));var db=require(_0xdea8('0x6'))['db'];var utils=require(_0xdea8('0x7'));var logger=require(_0xdea8('0x8'))(_0xdea8('0x9'));var config=require(_0xdea8('0xa'));var jayson=require(_0xdea8('0xb'));var client=jayson[_0xdea8('0xc')][_0xdea8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28f62f,_0x3c9611,_0x4177ee){return new BPromise(function(_0x9a47cb,_0x2ab537){return client[_0xdea8('0xe')](_0x28f62f,_0x4177ee)[_0xdea8('0xf')](function(_0x2a5fc5){logger[_0xdea8('0x10')](_0xdea8('0x11'),_0x3c9611,_0xdea8('0x12'));logger['debug'](_0xdea8('0x13'),_0x3c9611,_0xdea8('0x12'),JSON[_0xdea8('0x14')](_0x2a5fc5));if(_0x2a5fc5[_0xdea8('0x15')]){if(_0x2a5fc5['error'][_0xdea8('0x16')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x3c9611,_0x2a5fc5[_0xdea8('0x15')]['message']);return _0x2ab537(_0x2a5fc5[_0xdea8('0x15')][_0xdea8('0x17')]);}logger['error'](_0xdea8('0x11'),_0x3c9611,_0x2a5fc5['error'][_0xdea8('0x17')]);return _0x9a47cb(_0x2a5fc5['error'][_0xdea8('0x17')]);}else{logger[_0xdea8('0x10')]('Cdr,\x20%s,\x20%s',_0x3c9611,'request\x20sent');_0x9a47cb(_0x2a5fc5['result'][_0xdea8('0x17')]);}})[_0xdea8('0x18')](function(_0x400d9e){logger[_0xdea8('0x15')](_0xdea8('0x11'),_0x3c9611,_0x400d9e);_0x2ab537(_0x400d9e);});});}
\ No newline at end of file
+var _0xa06c=['moment','bluebird','ioredis','../../config/logger','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x57c8c3,_0x3fca68){var _0x5cf569=function(_0x1294f7){while(--_0x1294f7){_0x57c8c3['push'](_0x57c8c3['shift']());}};_0x5cf569(++_0x3fca68);}(_0xa06c,0x198));var _0xca06=function(_0x34c2b6,_0x5f50d4){_0x34c2b6=_0x34c2b6-0x0;var _0x1debad=_0xa06c[_0x34c2b6];return _0x1debad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca06('0x0'));var BPromise=require(_0xca06('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca06('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xca06('0x3'))('rpc');var config=require(_0xca06('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xca06('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31e48b,_0x429f61,_0x2c8bf0){return new BPromise(function(_0x4ab328,_0x20929f){return client[_0xca06('0x6')](_0x31e48b,_0x2c8bf0)[_0xca06('0x7')](function(_0x6ec5ca){logger[_0xca06('0x8')](_0xca06('0x9'),_0x429f61,_0xca06('0xa'));logger[_0xca06('0xb')](_0xca06('0xc'),_0x429f61,'request\x20sent',JSON[_0xca06('0xd')](_0x6ec5ca));if(_0x6ec5ca[_0xca06('0xe')]){if(_0x6ec5ca[_0xca06('0xe')]['code']===0x1f4){logger[_0xca06('0xe')](_0xca06('0x9'),_0x429f61,_0x6ec5ca[_0xca06('0xe')][_0xca06('0xf')]);return _0x20929f(_0x6ec5ca[_0xca06('0xe')][_0xca06('0xf')]);}logger[_0xca06('0xe')](_0xca06('0x9'),_0x429f61,_0x6ec5ca[_0xca06('0xe')]['message']);return _0x4ab328(_0x6ec5ca[_0xca06('0xe')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x429f61,'request\x20sent');_0x4ab328(_0x6ec5ca['result'][_0xca06('0xf')]);}})[_0xca06('0x10')](function(_0x41ef87){logger['error']('Cdr,\x20%s,\x20%s',_0x429f61,_0x41ef87);_0x20929f(_0x41ef87);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 8ec7197..081d7f6 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xa4a9b3,_0x3b271c){var _0xb7a49e=function(_0x19e4ff){while(--_0x19e4ff){_0xa4a9b3['push'](_0xa4a9b3['shift']());}};_0xb7a49e(++_0x3b271c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 449f2d6..4a5f2f4 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 _0x3179=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x34fac8,_0x3f0373){var _0x30b379=function(_0x113e98){while(--_0x113e98){_0x34fac8['push'](_0x34fac8['shift']());}};_0x30b379(++_0x3f0373);}(_0x3179,0xc6));var _0x9317=function(_0x4517b3,_0x1f0b7f){_0x4517b3=_0x4517b3-0x0;var _0x3c7bbc=_0x3179[_0x4517b3];return _0x3c7bbc;};'use strict';var Sequelize=require(_0x9317('0x0'));module[_0x9317('0x1')]={'priority':{'type':Sequelize[_0x9317('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9317('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9317('0x3')]},'interval':{'type':Sequelize[_0x9317('0x3')],'defaultValue':_0x9317('0x4')}};
\ No newline at end of file
+var _0xad30=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x3a743f,_0x4eb9b8){var _0x17b633=function(_0x321660){while(--_0x321660){_0x3a743f['push'](_0x3a743f['shift']());}};_0x17b633(++_0x4eb9b8);}(_0xad30,0x111));var _0x0ad3=function(_0x1ab181,_0x43ee89){_0x1ab181=_0x1ab181-0x0;var _0x1fd4a9=_0xad30[_0x1ab181];return _0x1fd4a9;};'use strict';var Sequelize=require(_0x0ad3('0x0'));module[_0x0ad3('0x1')]={'priority':{'type':Sequelize[_0x0ad3('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ad3('0x3')},'appdata':{'type':Sequelize[_0x0ad3('0x4')]()},'description':{'type':Sequelize[_0x0ad3('0x5')]},'interval':{'type':Sequelize[_0x0ad3('0x5')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index b6a99b3..3659a38 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 _0x23a8=['destroy','error','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','params','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','reject','save','then'];(function(_0x486244,_0x38307b){var _0x4fcf10=function(_0x4519c3){while(--_0x4519c3){_0x486244['push'](_0x486244['shift']());}};_0x4fcf10(++_0x38307b);}(_0x23a8,0x172));var _0x823a=function(_0x21b55f,_0x3ad1c0){_0x21b55f=_0x21b55f-0x0;var _0xbedcb6=_0x23a8[_0x21b55f];return _0xbedcb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x823a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x823a('0x1'));var rp=require('request-promise');var moment=require(_0x823a('0x2'));var BPromise=require(_0x823a('0x3'));var Mustache=require('mustache');var util=require(_0x823a('0x4'));var path=require('path');var sox=require(_0x823a('0x5'));var csv=require(_0x823a('0x6'));var ejs=require(_0x823a('0x7'));var fs=require('fs');var fs_extra=require(_0x823a('0x8'));var _=require('lodash');var squel=require(_0x823a('0x9'));var crypto=require(_0x823a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x823a('0xb'));var toCsv=require(_0x823a('0x6'));var querystring=require('querystring');var Papa=require(_0x823a('0xc'));var Redis=require(_0x823a('0xd'));var authService=require(_0x823a('0xe'));var qs=require(_0x823a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x823a('0x10'));var logger=require(_0x823a('0x11'))(_0x823a('0x12'));var utils=require(_0x823a('0x13'));var config=require(_0x823a('0x14'));var licenseUtil=require(_0x823a('0x15'));var db=require(_0x823a('0x16'))['db'];function respondWithStatusCode(_0x283b1c,_0x4c898d){_0x4c898d=_0x4c898d||0xcc;return function(_0x1fae57){if(_0x1fae57){return _0x283b1c['sendStatus'](_0x4c898d);}return _0x283b1c[_0x823a('0x17')](_0x4c898d)[_0x823a('0x18')]();};}function respondWithResult(_0x27732a,_0x531298){_0x531298=_0x531298||0xc8;return function(_0x4a54da){if(_0x4a54da){return _0x27732a[_0x823a('0x17')](_0x531298)[_0x823a('0x19')](_0x4a54da);}};}function respondWithFilteredResult(_0x208182,_0x54989a){return function(_0x569d0f){if(_0x569d0f){var _0x525d16=typeof _0x54989a[_0x823a('0x1a')]===_0x823a('0x1b')&&typeof _0x54989a[_0x823a('0x1c')]===_0x823a('0x1b');var _0x25b92e=_0x569d0f[_0x823a('0x1d')];var _0xf66c9=_0x525d16?0x0:_0x54989a[_0x823a('0x1a')];var _0xedc3d1=_0x525d16?_0x569d0f[_0x823a('0x1d')]:_0x54989a[_0x823a('0x1a')]+_0x54989a[_0x823a('0x1c')];var _0x48b6ca;if(_0xedc3d1>=_0x25b92e){_0xedc3d1=_0x25b92e;_0x48b6ca=0xc8;}else{_0x48b6ca=0xce;}_0x208182[_0x823a('0x17')](_0x48b6ca);return _0x208182[_0x823a('0x1e')](_0x823a('0x1f'),_0xf66c9+'-'+_0xedc3d1+'/'+_0x25b92e)[_0x823a('0x19')](_0x569d0f);}return null;};}function patchUpdates(_0x305992){return function(_0x3dbc6b){try{jsonpatch[_0x823a('0x20')](_0x3dbc6b,_0x305992,!![]);}catch(_0x31ae96){return BPromise[_0x823a('0x21')](_0x31ae96);}return _0x3dbc6b[_0x823a('0x22')]();};}function saveUpdates(_0x4cabe1,_0x29d8a5){return function(_0x4b8ca1){if(_0x4b8ca1){return _0x4b8ca1['update'](_0x4cabe1)[_0x823a('0x23')](function(_0x196724){return _0x196724;});}return null;};}function removeEntity(_0x56286a,_0x2fb984){return function(_0x5d5cc0){if(_0x5d5cc0){return _0x5d5cc0[_0x823a('0x24')]()['then'](function(){_0x56286a[_0x823a('0x17')](0xcc)[_0x823a('0x18')]();});}};}function handleEntityNotFound(_0x4c898a,_0x1be429){return function(_0xc332dc){if(!_0xc332dc){_0x4c898a['sendStatus'](0x194);}return _0xc332dc;};}function handleError(_0x302926,_0xbca8f9){_0xbca8f9=_0xbca8f9||0x1f4;return function(_0x10bdf2){logger[_0x823a('0x25')](_0x10bdf2['stack']);if(_0x10bdf2[_0x823a('0x26')]){delete _0x10bdf2[_0x823a('0x26')];}_0x302926[_0x823a('0x17')](_0xbca8f9)[_0x823a('0x27')](_0x10bdf2);};}exports[_0x823a('0x28')]=function(_0x515393,_0x11450a){var _0x43c073={'raw':!![],'where':{'id':_0x515393['params']['id']}},_0x4cad01={};_0x4cad01[_0x823a('0x29')]=_[_0x823a('0x2a')](db[_0x823a('0x2b')]['rawAttributes']);_0x4cad01[_0x823a('0x2c')]=_[_0x823a('0x2a')](_0x515393[_0x823a('0x2c')]);_0x4cad01[_0x823a('0x2d')]=_[_0x823a('0x2e')](_0x4cad01[_0x823a('0x29')],_0x4cad01[_0x823a('0x2c')]);_0x43c073[_0x823a('0x2f')]=_[_0x823a('0x2e')](_0x4cad01[_0x823a('0x29')],qs[_0x823a('0x30')](_0x515393[_0x823a('0x2c')][_0x823a('0x30')]));_0x43c073[_0x823a('0x2f')]=_0x43c073[_0x823a('0x2f')][_0x823a('0x31')]?_0x43c073['attributes']:_0x4cad01[_0x823a('0x29')];if(_0x515393[_0x823a('0x2c')][_0x823a('0x32')]){_0x43c073[_0x823a('0x33')]=[{'all':!![]}];}_0x43c073=_[_0x823a('0x34')]({},_0x43c073,_0x515393[_0x823a('0x35')]);return db[_0x823a('0x2b')][_0x823a('0x36')](_0x43c073)['then'](handleEntityNotFound(_0x11450a,null))[_0x823a('0x23')](respondWithResult(_0x11450a,null))[_0x823a('0x37')](handleError(_0x11450a,null));};exports['update']=function(_0x52ba26,_0x2edc80){if(_0x52ba26[_0x823a('0x38')]['id']){delete _0x52ba26[_0x823a('0x38')]['id'];}return db[_0x823a('0x2b')]['find']({'where':{'id':_0x52ba26[_0x823a('0x39')]['id']}})[_0x823a('0x23')](handleEntityNotFound(_0x2edc80,null))['then'](saveUpdates(_0x52ba26[_0x823a('0x38')],null))[_0x823a('0x23')](respondWithResult(_0x2edc80,null))[_0x823a('0x37')](handleError(_0x2edc80,null));};exports[_0x823a('0x24')]=function(_0x36683d,_0x347768){return db[_0x823a('0x2b')]['find']({'where':{'id':_0x36683d[_0x823a('0x39')]['id']}})[_0x823a('0x23')](handleEntityNotFound(_0x347768,null))[_0x823a('0x23')](removeEntity(_0x347768,null))['catch'](handleError(_0x347768,null));};
\ No newline at end of file
+var _0x3fb7=['status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus'];(function(_0x718dc7,_0x46deb7){var _0x3fd038=function(_0x2d3f39){while(--_0x2d3f39){_0x718dc7['push'](_0x718dc7['shift']());}};_0x3fd038(++_0x46deb7);}(_0x3fb7,0x189));var _0x73fb=function(_0x52ed83,_0x4f7328){_0x52ed83=_0x52ed83-0x0;var _0x223b12=_0x3fb7[_0x52ed83];return _0x223b12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x73fb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73fb('0x1'));var rp=require(_0x73fb('0x2'));var moment=require('moment');var BPromise=require(_0x73fb('0x3'));var Mustache=require('mustache');var util=require(_0x73fb('0x4'));var path=require(_0x73fb('0x5'));var sox=require(_0x73fb('0x6'));var csv=require(_0x73fb('0x7'));var ejs=require(_0x73fb('0x8'));var fs=require('fs');var fs_extra=require(_0x73fb('0x9'));var _=require(_0x73fb('0xa'));var squel=require(_0x73fb('0xb'));var crypto=require(_0x73fb('0xc'));var jsforce=require(_0x73fb('0xd'));var deskjs=require(_0x73fb('0xe'));var toCsv=require(_0x73fb('0x7'));var querystring=require(_0x73fb('0xf'));var Papa=require(_0x73fb('0x10'));var Redis=require(_0x73fb('0x11'));var authService=require(_0x73fb('0x12'));var qs=require(_0x73fb('0x13'));var as=require(_0x73fb('0x14'));var hardwareService=require(_0x73fb('0x15'));var logger=require(_0x73fb('0x16'))(_0x73fb('0x17'));var utils=require(_0x73fb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x73fb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fc7ac,_0x1f7626){_0x1f7626=_0x1f7626||0xcc;return function(_0x45c502){if(_0x45c502){return _0x3fc7ac[_0x73fb('0x1a')](_0x1f7626);}return _0x3fc7ac[_0x73fb('0x1b')](_0x1f7626)[_0x73fb('0x1c')]();};}function respondWithResult(_0x394ac5,_0x10d931){_0x10d931=_0x10d931||0xc8;return function(_0x743f1a){if(_0x743f1a){return _0x394ac5[_0x73fb('0x1b')](_0x10d931)[_0x73fb('0x1d')](_0x743f1a);}};}function respondWithFilteredResult(_0xa0b4dd,_0x2161ac){return function(_0x4986c3){if(_0x4986c3){var _0x1f679b=typeof _0x2161ac['offset']==='undefined'&&typeof _0x2161ac[_0x73fb('0x1e')]===_0x73fb('0x1f');var _0x4f4dda=_0x4986c3[_0x73fb('0x20')];var _0x1c9fa3=_0x1f679b?0x0:_0x2161ac[_0x73fb('0x21')];var _0x3ea9dd=_0x1f679b?_0x4986c3['count']:_0x2161ac['offset']+_0x2161ac[_0x73fb('0x1e')];var _0x460ae9;if(_0x3ea9dd>=_0x4f4dda){_0x3ea9dd=_0x4f4dda;_0x460ae9=0xc8;}else{_0x460ae9=0xce;}_0xa0b4dd[_0x73fb('0x1b')](_0x460ae9);return _0xa0b4dd['set'](_0x73fb('0x22'),_0x1c9fa3+'-'+_0x3ea9dd+'/'+_0x4f4dda)[_0x73fb('0x1d')](_0x4986c3);}return null;};}function patchUpdates(_0x25b409){return function(_0x41b334){try{jsonpatch[_0x73fb('0x23')](_0x41b334,_0x25b409,!![]);}catch(_0x204abf){return BPromise['reject'](_0x204abf);}return _0x41b334[_0x73fb('0x24')]();};}function saveUpdates(_0x474aaa,_0x2ff0f3){return function(_0x4d9d9c){if(_0x4d9d9c){return _0x4d9d9c['update'](_0x474aaa)[_0x73fb('0x25')](function(_0x2ae708){return _0x2ae708;});}return null;};}function removeEntity(_0x5486ff,_0x26b839){return function(_0x12c139){if(_0x12c139){return _0x12c139[_0x73fb('0x26')]()[_0x73fb('0x25')](function(){_0x5486ff[_0x73fb('0x1b')](0xcc)[_0x73fb('0x1c')]();});}};}function handleEntityNotFound(_0x801c4d,_0x222b87){return function(_0x3d213f){if(!_0x3d213f){_0x801c4d['sendStatus'](0x194);}return _0x3d213f;};}function handleError(_0x4a9ba2,_0x405e36){_0x405e36=_0x405e36||0x1f4;return function(_0x30b88){logger[_0x73fb('0x27')](_0x30b88[_0x73fb('0x28')]);if(_0x30b88[_0x73fb('0x29')]){delete _0x30b88[_0x73fb('0x29')];}_0x4a9ba2[_0x73fb('0x1b')](_0x405e36)['send'](_0x30b88);};}exports[_0x73fb('0x2a')]=function(_0x281449,_0x1bba66){var _0x46034e={'raw':!![],'where':{'id':_0x281449[_0x73fb('0x2b')]['id']}},_0x23d6c0={};_0x23d6c0[_0x73fb('0x2c')]=_[_0x73fb('0x2d')](db['ChatApplication'][_0x73fb('0x2e')]);_0x23d6c0[_0x73fb('0x2f')]=_['keys'](_0x281449['query']);_0x23d6c0[_0x73fb('0x30')]=_[_0x73fb('0x31')](_0x23d6c0[_0x73fb('0x2c')],_0x23d6c0[_0x73fb('0x2f')]);_0x46034e[_0x73fb('0x32')]=_['intersection'](_0x23d6c0[_0x73fb('0x2c')],qs[_0x73fb('0x33')](_0x281449[_0x73fb('0x2f')][_0x73fb('0x33')]));_0x46034e[_0x73fb('0x32')]=_0x46034e[_0x73fb('0x32')][_0x73fb('0x34')]?_0x46034e[_0x73fb('0x32')]:_0x23d6c0[_0x73fb('0x2c')];if(_0x281449[_0x73fb('0x2f')]['includeAll']){_0x46034e[_0x73fb('0x35')]=[{'all':!![]}];}_0x46034e=_[_0x73fb('0x36')]({},_0x46034e,_0x281449[_0x73fb('0x37')]);return db[_0x73fb('0x38')][_0x73fb('0x39')](_0x46034e)['then'](handleEntityNotFound(_0x1bba66,null))[_0x73fb('0x25')](respondWithResult(_0x1bba66,null))[_0x73fb('0x3a')](handleError(_0x1bba66,null));};exports['update']=function(_0x41e3fc,_0x512db5){if(_0x41e3fc[_0x73fb('0x3b')]['id']){delete _0x41e3fc['body']['id'];}return db['ChatApplication'][_0x73fb('0x39')]({'where':{'id':_0x41e3fc[_0x73fb('0x2b')]['id']}})[_0x73fb('0x25')](handleEntityNotFound(_0x512db5,null))['then'](saveUpdates(_0x41e3fc[_0x73fb('0x3b')],null))[_0x73fb('0x25')](respondWithResult(_0x512db5,null))[_0x73fb('0x3a')](handleError(_0x512db5,null));};exports[_0x73fb('0x26')]=function(_0x3901a9,_0x787d37){return db['ChatApplication']['find']({'where':{'id':_0x3901a9[_0x73fb('0x2b')]['id']}})[_0x73fb('0x25')](handleEntityNotFound(_0x787d37,null))[_0x73fb('0x25')](removeEntity(_0x787d37,null))[_0x73fb('0x3a')](handleError(_0x787d37,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 9031028..90ecd38 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 _0x5309=['request-promise','path','rimraf','../../config/environment','define','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x5309,0x1aa));var _0x9530=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5309[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9530('0x0'));var util=require(_0x9530('0x1'));var logger=require(_0x9530('0x2'))(_0x9530('0x3'));var moment=require(_0x9530('0x4'));var BPromise=require(_0x9530('0x5'));var rp=require(_0x9530('0x6'));var fs=require('fs');var path=require(_0x9530('0x7'));var rimraf=require(_0x9530('0x8'));var config=require(_0x9530('0x9'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x1cb512,_0x187678){return _0x1cb512[_0x9530('0xa')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9530('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5c99=['api','moment','bluebird','request-promise','path','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5c99,0x169));var _0x95c9=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x5c99[_0x22377a];return _0x36f105;};'use strict';var _=require(_0x95c9('0x0'));var util=require(_0x95c9('0x1'));var logger=require(_0x95c9('0x2'))(_0x95c9('0x3'));var moment=require(_0x95c9('0x4'));var BPromise=require(_0x95c9('0x5'));var rp=require(_0x95c9('0x6'));var fs=require('fs');var path=require(_0x95c9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x95c9('0x8')]=function(_0x150cfd,_0x3ab33f){return _0x150cfd[_0x95c9('0x9')](_0x95c9('0xa'),attributes,{'tableName':_0x95c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95c9('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 8de4e5f..1048aa6 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 _0x811f=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2f216d,_0x3a23d6){var _0x5df2f1=function(_0x41f492){while(--_0x41f492){_0x2f216d['push'](_0x2f216d['shift']());}};_0x5df2f1(++_0x3a23d6);}(_0x811f,0x1b7));var _0xf811=function(_0x5a965f,_0x22d15f){_0x5a965f=_0x5a965f-0x0;var _0x188f8a=_0x811f[_0x5a965f];return _0x188f8a;};'use strict';var _=require(_0xf811('0x0'));var util=require('util');var moment=require(_0xf811('0x1'));var BPromise=require('bluebird');var rs=require(_0xf811('0x2'));var fs=require('fs');var Redis=require(_0xf811('0x3'));var db=require(_0xf811('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf811('0x5'))('rpc');var config=require(_0xf811('0x6'));var jayson=require(_0xf811('0x7'));var client=jayson[_0xf811('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45aaf8,_0x41102a,_0x51ef67){return new BPromise(function(_0x17d8a3,_0x146f54){return client['request'](_0x45aaf8,_0x51ef67)[_0xf811('0x9')](function(_0x42e837){logger[_0xf811('0xa')](_0xf811('0xb'),_0x41102a,_0xf811('0xc'));logger[_0xf811('0xd')](_0xf811('0xe'),_0x41102a,'request\x20sent',JSON[_0xf811('0xf')](_0x42e837));if(_0x42e837['error']){if(_0x42e837[_0xf811('0x10')][_0xf811('0x11')]===0x1f4){logger[_0xf811('0x10')](_0xf811('0xb'),_0x41102a,_0x42e837['error'][_0xf811('0x12')]);return _0x146f54(_0x42e837[_0xf811('0x10')][_0xf811('0x12')]);}logger[_0xf811('0x10')](_0xf811('0xb'),_0x41102a,_0x42e837[_0xf811('0x10')]['message']);return _0x17d8a3(_0x42e837['error']['message']);}else{logger['info'](_0xf811('0xb'),_0x41102a,_0xf811('0xc'));_0x17d8a3(_0x42e837[_0xf811('0x13')]['message']);}})[_0xf811('0x14')](function(_0x5220af){logger['error'](_0xf811('0xb'),_0x41102a,_0x5220af);_0x146f54(_0x5220af);});});}
\ No newline at end of file
+var _0xa807=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','client','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x555d6f,_0x3527d0){var _0x45929b=function(_0x22f076){while(--_0x22f076){_0x555d6f['push'](_0x555d6f['shift']());}};_0x45929b(++_0x3527d0);}(_0xa807,0x1e4));var _0x7a80=function(_0x1f2b89,_0x1dfc2f){_0x1f2b89=_0x1f2b89-0x0;var _0x376b20=_0xa807[_0x1f2b89];return _0x376b20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7a80('0x0'));var BPromise=require(_0x7a80('0x1'));var rs=require(_0x7a80('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a80('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a80('0x4')][_0x7a80('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x75eb7d,_0x19e5ff,_0x355166){return new BPromise(function(_0x3e472e,_0x5a0269){return client[_0x7a80('0x6')](_0x75eb7d,_0x355166)['then'](function(_0x258224){logger['info'](_0x7a80('0x7'),_0x19e5ff,_0x7a80('0x8'));logger[_0x7a80('0x9')](_0x7a80('0xa'),_0x19e5ff,'request\x20sent',JSON[_0x7a80('0xb')](_0x258224));if(_0x258224[_0x7a80('0xc')]){if(_0x258224[_0x7a80('0xc')][_0x7a80('0xd')]===0x1f4){logger[_0x7a80('0xc')](_0x7a80('0x7'),_0x19e5ff,_0x258224[_0x7a80('0xc')][_0x7a80('0xe')]);return _0x5a0269(_0x258224[_0x7a80('0xc')]['message']);}logger[_0x7a80('0xc')](_0x7a80('0x7'),_0x19e5ff,_0x258224[_0x7a80('0xc')][_0x7a80('0xe')]);return _0x3e472e(_0x258224['error']['message']);}else{logger['info'](_0x7a80('0x7'),_0x19e5ff,_0x7a80('0x8'));_0x3e472e(_0x258224[_0x7a80('0xf')]['message']);}})[_0x7a80('0x10')](function(_0x31876d){logger[_0x7a80('0xc')]('ChatApplication,\x20%s,\x20%s',_0x19e5ff,_0x31876d);_0x5a0269(_0x31876d);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index dced1b1..285f88a 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 _0xcc1c=['delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','isAuthenticated','show','put','/:id'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xcc1c,0x128));var _0xccc1=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0xcc1c[_0x1fc84d];return _0x2658fa;};'use strict';var multer=require(_0xccc1('0x0'));var util=require(_0xccc1('0x1'));var path=require('path');var timeout=require(_0xccc1('0x2'));var express=require(_0xccc1('0x3'));var router=express[_0xccc1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xccc1('0x5'));var interaction=require(_0xccc1('0x6'));var config=require('../../config/environment');var controller=require(_0xccc1('0x7'));router['get']('/:id',auth[_0xccc1('0x8')](),controller[_0xccc1('0x9')]);router[_0xccc1('0xa')](_0xccc1('0xb'),auth[_0xccc1('0x8')](),controller['update']);router[_0xccc1('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xccc1('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x4a4a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5965db,_0x19c677){var _0x31bd94=function(_0x44f497){while(--_0x44f497){_0x5965db['push'](_0x5965db['shift']());}};_0x31bd94(++_0x19c677);}(_0x4a4a,0x1b3));var _0xa4a4=function(_0x3a6b71,_0x50d52c){_0x3a6b71=_0x3a6b71-0x0;var _0x5d3f05=_0x4a4a[_0x3a6b71];return _0x5d3f05;};'use strict';var multer=require(_0xa4a4('0x0'));var util=require(_0xa4a4('0x1'));var path=require(_0xa4a4('0x2'));var timeout=require(_0xa4a4('0x3'));var express=require(_0xa4a4('0x4'));var router=express[_0xa4a4('0x5')]();var fs_extra=require(_0xa4a4('0x6'));var auth=require(_0xa4a4('0x7'));var interaction=require(_0xa4a4('0x8'));var config=require(_0xa4a4('0x9'));var controller=require(_0xa4a4('0xa'));router[_0xa4a4('0xb')](_0xa4a4('0xc'),auth[_0xa4a4('0xd')](),controller['show']);router[_0xa4a4('0xe')](_0xa4a4('0xc'),auth[_0xa4a4('0xd')](),controller[_0xa4a4('0xf')]);router[_0xa4a4('0x10')](_0xa4a4('0xc'),auth[_0xa4a4('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d460efa..cc0a39d 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 _0xb091=['exports','STRING','BOOLEAN'];(function(_0x1c24e9,_0x3a8e49){var _0xe4fdb2=function(_0x182eee){while(--_0x182eee){_0x1c24e9['push'](_0x1c24e9['shift']());}};_0xe4fdb2(++_0x3a8e49);}(_0xb091,0x16e));var _0x1b09=function(_0x3a7ad1,_0x3cd277){_0x3a7ad1=_0x3a7ad1-0x0;var _0x1a5904=_0xb091[_0x3a7ad1];return _0x1a5904;};'use strict';var Sequelize=require('sequelize');module[_0x1b09('0x0')]={'name':{'type':Sequelize[_0x1b09('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1b09('0x1')]},'write':{'type':Sequelize[_0x1b09('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x75ff=['BOOLEAN','sequelize','exports','STRING'];(function(_0x469d90,_0x4ddc77){var _0xb98ba5=function(_0x6979c3){while(--_0x6979c3){_0x469d90['push'](_0x469d90['shift']());}};_0xb98ba5(++_0x4ddc77);}(_0x75ff,0x131));var _0xf75f=function(_0x1ccf3d,_0x461209){_0x1ccf3d=_0x1ccf3d-0x0;var _0x5345c1=_0x75ff[_0x1ccf3d];return _0x5345c1;};'use strict';var Sequelize=require(_0xf75f('0x0'));module[_0xf75f('0x1')]={'name':{'type':Sequelize[_0xf75f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf75f('0x2')]},'write':{'type':Sequelize[_0xf75f('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 026889d..bae66c6 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 _0xfaee=['includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','removeMembers','ChatGroupId','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x35fdb4,_0x2ae585){var _0x335294=function(_0x46b9a6){while(--_0x46b9a6){_0x35fdb4['push'](_0x35fdb4['shift']());}};_0x335294(++_0x2ae585);}(_0xfaee,0x79));var _0xefae=function(_0x119961,_0x38c0a1){_0x119961=_0x119961-0x0;var _0x147fe2=_0xfaee[_0x119961];return _0x147fe2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xefae('0x0'));var rp=require(_0xefae('0x1'));var moment=require(_0xefae('0x2'));var BPromise=require(_0xefae('0x3'));var Mustache=require(_0xefae('0x4'));var util=require(_0xefae('0x5'));var path=require(_0xefae('0x6'));var sox=require('sox');var csv=require(_0xefae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefae('0x8'));var _=require(_0xefae('0x9'));var squel=require(_0xefae('0xa'));var crypto=require(_0xefae('0xb'));var jsforce=require(_0xefae('0xc'));var deskjs=require(_0xefae('0xd'));var toCsv=require(_0xefae('0x7'));var querystring=require(_0xefae('0xe'));var Papa=require(_0xefae('0xf'));var Redis=require('ioredis');var authService=require(_0xefae('0x10'));var qs=require(_0xefae('0x11'));var as=require(_0xefae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xefae('0x13'));var utils=require(_0xefae('0x14'));var config=require(_0xefae('0x15'));var licenseUtil=require(_0xefae('0x16'));var db=require(_0xefae('0x17'))['db'];config['redis']=_[_0xefae('0x18')](config['redis'],{'host':_0xefae('0x19'),'port':0x18eb});var socket=require(_0xefae('0x1a'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3e8379,_0x981f9f){_0x981f9f=_0x981f9f||0xcc;return function(_0x2f56e1){if(_0x2f56e1){return _0x3e8379[_0xefae('0x1b')](_0x981f9f);}return _0x3e8379['status'](_0x981f9f)['end']();};}function respondWithResult(_0x3530c2,_0x5eba43){_0x5eba43=_0x5eba43||0xc8;return function(_0x34ca36){if(_0x34ca36){return _0x3530c2[_0xefae('0x1c')](_0x5eba43)['json'](_0x34ca36);}};}function respondWithFilteredResult(_0x48ef11,_0x3ec554){return function(_0x2b4e4f){if(_0x2b4e4f){var _0x3a8779=typeof _0x3ec554['offset']===_0xefae('0x1d')&&typeof _0x3ec554[_0xefae('0x1e')]===_0xefae('0x1d');var _0x269d8c=_0x2b4e4f[_0xefae('0x1f')];var _0x4a6679=_0x3a8779?0x0:_0x3ec554['offset'];var _0x3c59c0=_0x3a8779?_0x2b4e4f[_0xefae('0x1f')]:_0x3ec554[_0xefae('0x20')]+_0x3ec554[_0xefae('0x1e')];var _0x3a7fde;if(_0x3c59c0>=_0x269d8c){_0x3c59c0=_0x269d8c;_0x3a7fde=0xc8;}else{_0x3a7fde=0xce;}_0x48ef11[_0xefae('0x1c')](_0x3a7fde);return _0x48ef11[_0xefae('0x21')]('Content-Range',_0x4a6679+'-'+_0x3c59c0+'/'+_0x269d8c)[_0xefae('0x22')](_0x2b4e4f);}return null;};}function patchUpdates(_0x671991){return function(_0x4ee8b1){try{jsonpatch[_0xefae('0x23')](_0x4ee8b1,_0x671991,!![]);}catch(_0x1fb2ab){return BPromise[_0xefae('0x24')](_0x1fb2ab);}return _0x4ee8b1[_0xefae('0x25')]();};}function saveUpdates(_0x296862,_0x52bbef){return function(_0x551044){if(_0x551044){return _0x551044[_0xefae('0x26')](_0x296862)[_0xefae('0x27')](function(_0x194c9e){return _0x194c9e;});}return null;};}function removeEntity(_0x2d2582,_0x201524){return function(_0x28fbb0){if(_0x28fbb0){return _0x28fbb0['destroy']()[_0xefae('0x27')](function(){_0x2d2582[_0xefae('0x1c')](0xcc)[_0xefae('0x28')]();});}};}function handleEntityNotFound(_0x2e70d0,_0x97c098){return function(_0x2ecdcd){if(!_0x2ecdcd){_0x2e70d0[_0xefae('0x1b')](0x194);}return _0x2ecdcd;};}function handleError(_0x52b0b3,_0x32ef51){_0x32ef51=_0x32ef51||0x1f4;return function(_0x47a4a7){logger[_0xefae('0x29')](_0x47a4a7[_0xefae('0x2a')]);if(_0x47a4a7[_0xefae('0x2b')]){delete _0x47a4a7['name'];}_0x52b0b3['status'](_0x32ef51)[_0xefae('0x2c')](_0x47a4a7);};}exports[_0xefae('0x2d')]=function(_0x256938,_0x1cb9f3){var _0x22956b={},_0x5083c2={},_0x5c1081={'count':0x0,'rows':[]};var _0xa1cef8=_[_0xefae('0x2e')](db[_0xefae('0x2f')][_0xefae('0x30')],function(_0x5b0164){return{'name':_0x5b0164['fieldName'],'type':_0x5b0164[_0xefae('0x31')][_0xefae('0x32')]};});_0x5083c2[_0xefae('0x33')]=_['map'](_0xa1cef8,_0xefae('0x2b'));_0x5083c2['query']=_[_0xefae('0x34')](_0x256938[_0xefae('0x35')]);_0x5083c2[_0xefae('0x36')]=_[_0xefae('0x37')](_0x5083c2[_0xefae('0x33')],_0x5083c2[_0xefae('0x35')]);_0x22956b['attributes']=_[_0xefae('0x37')](_0x5083c2[_0xefae('0x33')],qs['fields'](_0x256938[_0xefae('0x35')][_0xefae('0x38')]));_0x22956b['attributes']=_0x22956b[_0xefae('0x39')][_0xefae('0x3a')]?_0x22956b[_0xefae('0x39')]:_0x5083c2[_0xefae('0x33')];if(!_0x256938[_0xefae('0x35')][_0xefae('0x3b')](_0xefae('0x3c'))){_0x22956b[_0xefae('0x1e')]=qs[_0xefae('0x1e')](_0x256938['query'][_0xefae('0x1e')]);_0x22956b[_0xefae('0x20')]=qs['offset'](_0x256938['query']['offset']);}_0x22956b[_0xefae('0x3d')]=qs[_0xefae('0x3e')](_0x256938[_0xefae('0x35')][_0xefae('0x3e')]);_0x22956b[_0xefae('0x3f')]=qs[_0xefae('0x36')](_[_0xefae('0x40')](_0x256938['query'],_0x5083c2[_0xefae('0x36')]),_0xa1cef8);if(_0x256938[_0xefae('0x35')][_0xefae('0x41')]){_0x22956b['where']=_['merge'](_0x22956b['where'],{'$or':_['map'](_0xa1cef8,function(_0x3ec081){if(_0x3ec081[_0xefae('0x31')]!==_0xefae('0x42')){var _0x2fda63={};_0x2fda63[_0x3ec081[_0xefae('0x2b')]]={'$like':'%'+_0x256938['query'][_0xefae('0x41')]+'%'};return _0x2fda63;}})});}_0x22956b=_[_0xefae('0x43')]({},_0x22956b,_0x256938[_0xefae('0x44')]);var _0xf59669={'where':_0x22956b[_0xefae('0x3f')]};return db[_0xefae('0x2f')][_0xefae('0x1f')](_0xf59669)[_0xefae('0x27')](function(_0x1ce7e2){_0x5c1081[_0xefae('0x1f')]=_0x1ce7e2;if(_0x256938['query'][_0xefae('0x45')]){_0x22956b[_0xefae('0x46')]=[{'all':!![]}];}return db[_0xefae('0x2f')][_0xefae('0x47')](_0x22956b);})[_0xefae('0x27')](function(_0x5e846d){_0x5c1081[_0xefae('0x48')]=_0x5e846d;return _0x5c1081;})[_0xefae('0x27')](respondWithFilteredResult(_0x1cb9f3,_0x22956b))[_0xefae('0x49')](handleError(_0x1cb9f3,null));};exports[_0xefae('0x4a')]=function(_0x233d3e,_0x41f2a0){var _0x3d47ab={'raw':!![],'where':{'id':_0x233d3e[_0xefae('0x4b')]['id']}},_0x1aa2c8={};_0x1aa2c8[_0xefae('0x33')]=_[_0xefae('0x34')](db[_0xefae('0x2f')][_0xefae('0x30')]);_0x1aa2c8['query']=_[_0xefae('0x34')](_0x233d3e[_0xefae('0x35')]);_0x1aa2c8['filters']=_[_0xefae('0x37')](_0x1aa2c8['model'],_0x1aa2c8[_0xefae('0x35')]);_0x3d47ab[_0xefae('0x39')]=_[_0xefae('0x37')](_0x1aa2c8[_0xefae('0x33')],qs[_0xefae('0x38')](_0x233d3e[_0xefae('0x35')][_0xefae('0x38')]));_0x3d47ab[_0xefae('0x39')]=_0x3d47ab[_0xefae('0x39')][_0xefae('0x3a')]?_0x3d47ab[_0xefae('0x39')]:_0x1aa2c8[_0xefae('0x33')];if(_0x233d3e[_0xefae('0x35')][_0xefae('0x45')]){_0x3d47ab[_0xefae('0x46')]=[{'all':!![]}];}_0x3d47ab=_[_0xefae('0x43')]({},_0x3d47ab,_0x233d3e[_0xefae('0x44')]);return db[_0xefae('0x2f')][_0xefae('0x4c')](_0x3d47ab)[_0xefae('0x27')](handleEntityNotFound(_0x41f2a0,null))[_0xefae('0x27')](respondWithResult(_0x41f2a0,null))['catch'](handleError(_0x41f2a0,null));};exports[_0xefae('0x4d')]=function(_0x2bd222,_0x4956a7){return db['ChatGroup'][_0xefae('0x4d')](_0x2bd222['body'],{})[_0xefae('0x27')](respondWithResult(_0x4956a7,0xc9))[_0xefae('0x49')](handleError(_0x4956a7,null));};exports['update']=function(_0x2ad81f,_0x2998db){if(_0x2ad81f[_0xefae('0x4e')]['id']){delete _0x2ad81f['body']['id'];}return db[_0xefae('0x2f')][_0xefae('0x4c')]({'where':{'id':_0x2ad81f[_0xefae('0x4b')]['id']}})[_0xefae('0x27')](handleEntityNotFound(_0x2998db,null))[_0xefae('0x27')](saveUpdates(_0x2ad81f[_0xefae('0x4e')],null))[_0xefae('0x27')](respondWithResult(_0x2998db,null))[_0xefae('0x49')](handleError(_0x2998db,null));};exports[_0xefae('0x4f')]=function(_0x4fc47e,_0x1a0c48){return db[_0xefae('0x2f')]['find']({'where':{'id':_0x4fc47e[_0xefae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1a0c48,null))[_0xefae('0x27')](removeEntity(_0x1a0c48,null))['catch'](handleError(_0x1a0c48,null));};exports['describe']=function(_0x10dfd0,_0x12ba5f){return db[_0xefae('0x2f')][_0xefae('0x50')]()[_0xefae('0x27')](respondWithResult(_0x12ba5f,null))[_0xefae('0x49')](handleError(_0x12ba5f,null));};exports[_0xefae('0x51')]=function(_0x5453e8,_0x2fa163,_0x358571){return db[_0xefae('0x52')][_0xefae('0x1f')]({'where':{'ChatGroupId':_0x5453e8[_0xefae('0x4b')]['id'],'ToId':_0x5453e8['user']['id'],'read':![]}})[_0xefae('0x27')](function(_0x4afaa2){return{'id':_[_0xefae('0x53')](_0x5453e8[_0xefae('0x4b')]['id']),'count':_0x4afaa2};})[_0xefae('0x27')](respondWithResult(_0x2fa163,null))['catch'](handleError(_0x2fa163,null));};exports[_0xefae('0x54')]=function(_0x5953d5,_0x4c6d07,_0x4432ad){return db[_0xefae('0x2f')][_0xefae('0x4c')]({'where':{'id':_0x5953d5[_0xefae('0x4b')]['id']}})[_0xefae('0x27')](handleEntityNotFound(_0x4c6d07,null))['then'](function(_0x4852e0){if(_0x4852e0){return _0x4852e0[_0xefae('0x54')](_0x5953d5[_0xefae('0x4e')][_0xefae('0x55')],_[_0xefae('0x56')](_0x5953d5['body'],[_0xefae('0x55'),'id'])||{});}})[_0xefae('0x27')](respondWithResult(_0x4c6d07,null))['catch'](handleError(_0x4c6d07,null));};exports[_0xefae('0x57')]=function(_0x1a830b,_0x561b0b,_0x352525){var _0x385844={};var _0x2e9c32={};var _0x283aba;var _0x44057a;return db[_0xefae('0x2f')]['findOne']({'where':{'id':_0x1a830b[_0xefae('0x4b')]['id']}})[_0xefae('0x27')](handleEntityNotFound(_0x561b0b,null))[_0xefae('0x27')](function(_0x276c2c){if(_0x276c2c){_0x283aba=_0x276c2c;_0x2e9c32[_0xefae('0x33')]=_[_0xefae('0x34')](db[_0xefae('0x58')]['rawAttributes']);_0x2e9c32[_0xefae('0x35')]=_[_0xefae('0x34')](_0x1a830b[_0xefae('0x35')]);_0x2e9c32[_0xefae('0x36')]=_[_0xefae('0x37')](_0x2e9c32[_0xefae('0x33')],_0x2e9c32['query']);_0x385844[_0xefae('0x39')]=_[_0xefae('0x37')](_0x2e9c32['model'],qs[_0xefae('0x38')](_0x1a830b[_0xefae('0x35')][_0xefae('0x38')]));_0x385844[_0xefae('0x39')]=_0x385844[_0xefae('0x39')]['length']?_0x385844[_0xefae('0x39')]:_0x2e9c32['model'];_0x385844[_0xefae('0x3d')]=qs[_0xefae('0x3e')](_0x1a830b['query'][_0xefae('0x3e')]);_0x385844[_0xefae('0x3f')]=qs[_0xefae('0x36')](_[_0xefae('0x40')](_0x1a830b[_0xefae('0x35')],_0x2e9c32[_0xefae('0x36')]));if(_0x1a830b[_0xefae('0x35')][_0xefae('0x41')]){_0x385844[_0xefae('0x3f')]=_['merge'](_0x385844[_0xefae('0x3f')],{'$or':_['map'](_0x385844['attributes'],function(_0x205774){var _0x439c99={};_0x439c99[_0x205774]={'$like':'%'+_0x1a830b[_0xefae('0x35')][_0xefae('0x41')]+'%'};return _0x439c99;})});}_0x385844=_[_0xefae('0x43')]({},_0x385844,_0x1a830b['options']);return _0x283aba['getMembers'](_0x385844);}})['then'](function(_0x248882){if(_0x248882){_0x44057a=_0x248882['length'];if(!_0x1a830b['query'][_0xefae('0x3b')]('nolimit')){_0x385844[_0xefae('0x1e')]=qs['limit'](_0x1a830b[_0xefae('0x35')]['limit']);_0x385844[_0xefae('0x20')]=qs[_0xefae('0x20')](_0x1a830b[_0xefae('0x35')]['offset']);}return _0x283aba['getMembers'](_0x385844);}})['then'](function(_0x254852){if(_0x254852){return _0x254852?{'count':_0x44057a,'rows':_0x254852}:null;}})['then'](respondWithResult(_0x561b0b,null))[_0xefae('0x49')](handleError(_0x561b0b,null));};exports['removeMembers']=function(_0x4ba820,_0x8203f1,_0x2f188a){return db['ChatGroup']['find']({'where':{'id':_0x4ba820['params']['id']}})['then'](handleEntityNotFound(_0x8203f1,null))[_0xefae('0x27')](function(_0x1ecba7){if(_0x1ecba7){return _0x1ecba7[_0xefae('0x59')](_0x4ba820[_0xefae('0x35')]['ids']);}})[_0xefae('0x27')](respondWithStatusCode(_0x8203f1,null))['catch'](handleError(_0x8203f1,null));};exports['addMessage']=function(_0x5b8614,_0x26d1ea,_0x1a329f){if(_0x5b8614['body']['id']){delete _0x5b8614[_0xefae('0x4e')]['id'];}return db['ChatGroup'][_0xefae('0x4c')]({'where':{'id':_0x5b8614['params']['id']}})['then'](handleEntityNotFound(_0x26d1ea,null))[_0xefae('0x27')](function(_0x1e915a){if(_0x1e915a){_0x5b8614['body'][_0xefae('0x5a')]=_0x1e915a['id'];return db['ChatInternalMessage'][_0xefae('0x4d')](_0x5b8614[_0xefae('0x4e')]);}})[_0xefae('0x27')](respondWithResult(_0x26d1ea,null))['catch'](handleError(_0x26d1ea,null));};exports['getMessages']=function(_0x5013f3,_0x1ba19b,_0x12dc59){var _0x506a09={};var _0x35549c={};var _0x541570;var _0xf49e2e;return db[_0xefae('0x2f')][_0xefae('0x5b')]({'where':{'id':_0x5013f3['params']['id']}})['then'](handleEntityNotFound(_0x1ba19b,null))[_0xefae('0x27')](function(_0x40b604){if(_0x40b604){_0x541570=_0x40b604;_0x35549c[_0xefae('0x33')]=_[_0xefae('0x34')](db['ChatInternalMessage'][_0xefae('0x30')]);_0x35549c[_0xefae('0x35')]=_[_0xefae('0x34')](_0x5013f3['query']);_0x35549c['filters']=_['intersection'](_0x35549c[_0xefae('0x33')],_0x35549c['query']);_0x506a09[_0xefae('0x39')]=_['intersection'](_0x35549c[_0xefae('0x33')],qs['fields'](_0x5013f3['query']['fields']));_0x506a09[_0xefae('0x39')]=_0x506a09[_0xefae('0x39')][_0xefae('0x3a')]?_0x506a09[_0xefae('0x39')]:_0x35549c[_0xefae('0x33')];_0x506a09[_0xefae('0x3d')]=qs[_0xefae('0x3e')](_0x5013f3['query'][_0xefae('0x3e')]);_0x506a09['where']=qs[_0xefae('0x36')](_[_0xefae('0x40')](_0x5013f3[_0xefae('0x35')],_0x35549c[_0xefae('0x36')]));if(_0x5013f3[_0xefae('0x35')][_0xefae('0x41')]){_0x506a09['where']=_['merge'](_0x506a09[_0xefae('0x3f')],{'$or':_[_0xefae('0x2e')](_0x506a09[_0xefae('0x39')],function(_0x318a67){var _0x2dbe1a={};_0x2dbe1a[_0x318a67]={'$like':'%'+_0x5013f3['query']['filter']+'%'};return _0x2dbe1a;})});}if(_0x5013f3[_0xefae('0x35')][_0xefae('0x5c')]){var _0x2d4448=_0x5013f3[_0xefae('0x35')][_0xefae('0x5c')]['split'](',');var _0x31f6b8={};_0x31f6b8[_0x2d4448[0x0]]={'$gte':moment(_0x2d4448[0x1])['format'](_0xefae('0x5d'))};_0x506a09[_0xefae('0x3f')]=_[_0xefae('0x43')](_0x506a09[_0xefae('0x3f')],_0x31f6b8);}_0x506a09=_['merge']({},_0x506a09,_0x5013f3['options']);return _0x541570[_0xefae('0x5e')](_0x506a09);}})[_0xefae('0x27')](function(_0x1196e4){if(_0x1196e4){_0xf49e2e=_0x1196e4['length'];if(!_0x5013f3[_0xefae('0x35')]['hasOwnProperty']('nolimit')){_0x506a09[_0xefae('0x1e')]=qs[_0xefae('0x1e')](_0x5013f3[_0xefae('0x35')][_0xefae('0x1e')]);_0x506a09[_0xefae('0x20')]=qs[_0xefae('0x20')](_0x5013f3[_0xefae('0x35')][_0xefae('0x20')]);}return _0x541570[_0xefae('0x5e')](_0x506a09);}})[_0xefae('0x27')](function(_0x59d2e2){if(_0x59d2e2){return _0x59d2e2?{'count':_0xf49e2e,'rows':_0x59d2e2}:null;}})[_0xefae('0x27')](respondWithResult(_0x1ba19b,null))['catch'](handleError(_0x1ba19b,null));};
\ No newline at end of file
+var _0x7976=['addMembers','ids','omit','getMembers','findOne','User','nolimit','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','ChatGroup','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','destroy','describe','getUnread','user','toInteger','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7976,0x137));var _0x6797=function(_0x184b3d,_0x504fbc){_0x184b3d=_0x184b3d-0x0;var _0x27f867=_0x7976[_0x184b3d];return _0x27f867;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6797('0x0'));var zipdir=require(_0x6797('0x1'));var jsonpatch=require(_0x6797('0x2'));var rp=require(_0x6797('0x3'));var moment=require(_0x6797('0x4'));var BPromise=require(_0x6797('0x5'));var Mustache=require(_0x6797('0x6'));var util=require(_0x6797('0x7'));var path=require(_0x6797('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6797('0x9'));var fs=require('fs');var fs_extra=require(_0x6797('0xa'));var _=require(_0x6797('0xb'));var squel=require(_0x6797('0xc'));var crypto=require('crypto');var jsforce=require(_0x6797('0xd'));var deskjs=require(_0x6797('0xe'));var toCsv=require(_0x6797('0xf'));var querystring=require(_0x6797('0x10'));var Papa=require(_0x6797('0x11'));var Redis=require(_0x6797('0x12'));var authService=require(_0x6797('0x13'));var qs=require(_0x6797('0x14'));var as=require(_0x6797('0x15'));var hardwareService=require(_0x6797('0x16'));var logger=require('../../config/logger')(_0x6797('0x17'));var utils=require(_0x6797('0x18'));var config=require(_0x6797('0x19'));var licenseUtil=require(_0x6797('0x1a'));var db=require(_0x6797('0x1b'))['db'];config[_0x6797('0x1c')]=_[_0x6797('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6797('0x1e'))(new Redis(config[_0x6797('0x1c')]));require('./chatGroup.socket')[_0x6797('0x1f')](socket);function respondWithStatusCode(_0x296f41,_0x399722){_0x399722=_0x399722||0xcc;return function(_0x307318){if(_0x307318){return _0x296f41['sendStatus'](_0x399722);}return _0x296f41['status'](_0x399722)[_0x6797('0x20')]();};}function respondWithResult(_0x2991e0,_0x1e6c0c){_0x1e6c0c=_0x1e6c0c||0xc8;return function(_0x4ded4c){if(_0x4ded4c){return _0x2991e0['status'](_0x1e6c0c)[_0x6797('0x21')](_0x4ded4c);}};}function respondWithFilteredResult(_0x461ccc,_0x3e86df){return function(_0x467cc2){if(_0x467cc2){var _0x33b11d=typeof _0x3e86df[_0x6797('0x22')]==='undefined'&&typeof _0x3e86df[_0x6797('0x23')]===_0x6797('0x24');var _0x18f019=_0x467cc2[_0x6797('0x25')];var _0x38ee6e=_0x33b11d?0x0:_0x3e86df[_0x6797('0x22')];var _0x1d06f4=_0x33b11d?_0x467cc2['count']:_0x3e86df['offset']+_0x3e86df['limit'];var _0x3c2453;if(_0x1d06f4>=_0x18f019){_0x1d06f4=_0x18f019;_0x3c2453=0xc8;}else{_0x3c2453=0xce;}_0x461ccc[_0x6797('0x26')](_0x3c2453);return _0x461ccc['set'](_0x6797('0x27'),_0x38ee6e+'-'+_0x1d06f4+'/'+_0x18f019)['json'](_0x467cc2);}return null;};}function patchUpdates(_0x4ee356){return function(_0x306ec5){try{jsonpatch[_0x6797('0x28')](_0x306ec5,_0x4ee356,!![]);}catch(_0x34a199){return BPromise[_0x6797('0x29')](_0x34a199);}return _0x306ec5[_0x6797('0x2a')]();};}function saveUpdates(_0x1cc01c,_0x574caa){return function(_0x34ab16){if(_0x34ab16){return _0x34ab16['update'](_0x1cc01c)['then'](function(_0x1dc0d3){return _0x1dc0d3;});}return null;};}function removeEntity(_0x51fb55,_0x3ced40){return function(_0x18793b){if(_0x18793b){return _0x18793b['destroy']()[_0x6797('0x2b')](function(){_0x51fb55[_0x6797('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2981d2,_0x82ea90){return function(_0x171b19){if(!_0x171b19){_0x2981d2['sendStatus'](0x194);}return _0x171b19;};}function handleError(_0x318c8e,_0x35071c){_0x35071c=_0x35071c||0x1f4;return function(_0x2628b4){logger[_0x6797('0x2c')](_0x2628b4[_0x6797('0x2d')]);if(_0x2628b4['name']){delete _0x2628b4[_0x6797('0x2e')];}_0x318c8e['status'](_0x35071c)[_0x6797('0x2f')](_0x2628b4);};}exports[_0x6797('0x30')]=function(_0x53595c,_0x585f6e){var _0x19a15d={},_0x1a316f={},_0x4dc614={'count':0x0,'rows':[]};var _0x20f69c=_[_0x6797('0x31')](db['ChatGroup']['rawAttributes'],function(_0x4c94ff){return{'name':_0x4c94ff[_0x6797('0x32')],'type':_0x4c94ff[_0x6797('0x33')][_0x6797('0x34')]};});_0x1a316f['model']=_[_0x6797('0x31')](_0x20f69c,_0x6797('0x2e'));_0x1a316f['query']=_[_0x6797('0x35')](_0x53595c[_0x6797('0x36')]);_0x1a316f['filters']=_['intersection'](_0x1a316f[_0x6797('0x37')],_0x1a316f[_0x6797('0x36')]);_0x19a15d[_0x6797('0x38')]=_[_0x6797('0x39')](_0x1a316f[_0x6797('0x37')],qs[_0x6797('0x3a')](_0x53595c[_0x6797('0x36')]['fields']));_0x19a15d[_0x6797('0x38')]=_0x19a15d[_0x6797('0x38')][_0x6797('0x3b')]?_0x19a15d[_0x6797('0x38')]:_0x1a316f['model'];if(!_0x53595c[_0x6797('0x36')][_0x6797('0x3c')]('nolimit')){_0x19a15d[_0x6797('0x23')]=qs[_0x6797('0x23')](_0x53595c[_0x6797('0x36')]['limit']);_0x19a15d['offset']=qs[_0x6797('0x22')](_0x53595c[_0x6797('0x36')][_0x6797('0x22')]);}_0x19a15d[_0x6797('0x3d')]=qs['sort'](_0x53595c[_0x6797('0x36')][_0x6797('0x3e')]);_0x19a15d[_0x6797('0x3f')]=qs[_0x6797('0x40')](_[_0x6797('0x41')](_0x53595c[_0x6797('0x36')],_0x1a316f['filters']),_0x20f69c);if(_0x53595c['query']['filter']){_0x19a15d[_0x6797('0x3f')]=_['merge'](_0x19a15d[_0x6797('0x3f')],{'$or':_['map'](_0x20f69c,function(_0x1a9b05){if(_0x1a9b05[_0x6797('0x33')]!=='VIRTUAL'){var _0x1a0a37={};_0x1a0a37[_0x1a9b05[_0x6797('0x2e')]]={'$like':'%'+_0x53595c[_0x6797('0x36')][_0x6797('0x42')]+'%'};return _0x1a0a37;}})});}_0x19a15d=_[_0x6797('0x43')]({},_0x19a15d,_0x53595c[_0x6797('0x44')]);var _0x4dd525={'where':_0x19a15d[_0x6797('0x3f')]};return db[_0x6797('0x45')][_0x6797('0x25')](_0x4dd525)[_0x6797('0x2b')](function(_0x14ff60){_0x4dc614[_0x6797('0x25')]=_0x14ff60;if(_0x53595c['query'][_0x6797('0x46')]){_0x19a15d[_0x6797('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x6797('0x48')](_0x19a15d);})[_0x6797('0x2b')](function(_0x30d087){_0x4dc614['rows']=_0x30d087;return _0x4dc614;})[_0x6797('0x2b')](respondWithFilteredResult(_0x585f6e,_0x19a15d))[_0x6797('0x49')](handleError(_0x585f6e,null));};exports[_0x6797('0x4a')]=function(_0x124120,_0x413cb3){var _0xf8c992={'raw':!![],'where':{'id':_0x124120[_0x6797('0x4b')]['id']}},_0xcf2647={};_0xcf2647[_0x6797('0x37')]=_['keys'](db[_0x6797('0x45')][_0x6797('0x4c')]);_0xcf2647[_0x6797('0x36')]=_[_0x6797('0x35')](_0x124120[_0x6797('0x36')]);_0xcf2647[_0x6797('0x40')]=_[_0x6797('0x39')](_0xcf2647[_0x6797('0x37')],_0xcf2647[_0x6797('0x36')]);_0xf8c992[_0x6797('0x38')]=_[_0x6797('0x39')](_0xcf2647[_0x6797('0x37')],qs['fields'](_0x124120['query'][_0x6797('0x3a')]));_0xf8c992[_0x6797('0x38')]=_0xf8c992['attributes'][_0x6797('0x3b')]?_0xf8c992[_0x6797('0x38')]:_0xcf2647[_0x6797('0x37')];if(_0x124120[_0x6797('0x36')][_0x6797('0x46')]){_0xf8c992[_0x6797('0x47')]=[{'all':!![]}];}_0xf8c992=_['merge']({},_0xf8c992,_0x124120[_0x6797('0x44')]);return db[_0x6797('0x45')]['find'](_0xf8c992)[_0x6797('0x2b')](handleEntityNotFound(_0x413cb3,null))['then'](respondWithResult(_0x413cb3,null))['catch'](handleError(_0x413cb3,null));};exports[_0x6797('0x4d')]=function(_0x25bc23,_0x278de6){return db[_0x6797('0x45')]['create'](_0x25bc23[_0x6797('0x4e')],{})[_0x6797('0x2b')](respondWithResult(_0x278de6,0xc9))['catch'](handleError(_0x278de6,null));};exports['update']=function(_0x3bbdb8,_0x2aef4e){if(_0x3bbdb8[_0x6797('0x4e')]['id']){delete _0x3bbdb8[_0x6797('0x4e')]['id'];}return db[_0x6797('0x45')]['find']({'where':{'id':_0x3bbdb8[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x2aef4e,null))[_0x6797('0x2b')](saveUpdates(_0x3bbdb8[_0x6797('0x4e')],null))[_0x6797('0x2b')](respondWithResult(_0x2aef4e,null))[_0x6797('0x49')](handleError(_0x2aef4e,null));};exports[_0x6797('0x4f')]=function(_0x5ef5ce,_0x63a1bd){return db['ChatGroup']['find']({'where':{'id':_0x5ef5ce['params']['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x63a1bd,null))['then'](removeEntity(_0x63a1bd,null))[_0x6797('0x49')](handleError(_0x63a1bd,null));};exports['describe']=function(_0x53a49f,_0xc71123){return db[_0x6797('0x45')][_0x6797('0x50')]()[_0x6797('0x2b')](respondWithResult(_0xc71123,null))[_0x6797('0x49')](handleError(_0xc71123,null));};exports[_0x6797('0x51')]=function(_0x315ff0,_0x199c60,_0x39c4d7){return db['ChatInternalMessage'][_0x6797('0x25')]({'where':{'ChatGroupId':_0x315ff0['params']['id'],'ToId':_0x315ff0[_0x6797('0x52')]['id'],'read':![]}})['then'](function(_0x4f71e3){return{'id':_[_0x6797('0x53')](_0x315ff0[_0x6797('0x4b')]['id']),'count':_0x4f71e3};})[_0x6797('0x2b')](respondWithResult(_0x199c60,null))[_0x6797('0x49')](handleError(_0x199c60,null));};exports['addMembers']=function(_0x39bd28,_0x1b2965,_0x210d03){return db[_0x6797('0x45')][_0x6797('0x54')]({'where':{'id':_0x39bd28[_0x6797('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b2965,null))['then'](function(_0x3c6bb6){if(_0x3c6bb6){return _0x3c6bb6[_0x6797('0x55')](_0x39bd28[_0x6797('0x4e')][_0x6797('0x56')],_[_0x6797('0x57')](_0x39bd28[_0x6797('0x4e')],['ids','id'])||{});}})[_0x6797('0x2b')](respondWithResult(_0x1b2965,null))[_0x6797('0x49')](handleError(_0x1b2965,null));};exports[_0x6797('0x58')]=function(_0x3ac9d3,_0x18d2e2,_0x24debf){var _0x7c2174={};var _0x17d05d={};var _0x3e018f;var _0x5f473e;return db[_0x6797('0x45')][_0x6797('0x59')]({'where':{'id':_0x3ac9d3[_0x6797('0x4b')]['id']}})['then'](handleEntityNotFound(_0x18d2e2,null))['then'](function(_0x174f13){if(_0x174f13){_0x3e018f=_0x174f13;_0x17d05d[_0x6797('0x37')]=_['keys'](db[_0x6797('0x5a')][_0x6797('0x4c')]);_0x17d05d[_0x6797('0x36')]=_[_0x6797('0x35')](_0x3ac9d3[_0x6797('0x36')]);_0x17d05d['filters']=_[_0x6797('0x39')](_0x17d05d['model'],_0x17d05d[_0x6797('0x36')]);_0x7c2174[_0x6797('0x38')]=_[_0x6797('0x39')](_0x17d05d[_0x6797('0x37')],qs[_0x6797('0x3a')](_0x3ac9d3[_0x6797('0x36')][_0x6797('0x3a')]));_0x7c2174[_0x6797('0x38')]=_0x7c2174['attributes'][_0x6797('0x3b')]?_0x7c2174[_0x6797('0x38')]:_0x17d05d['model'];_0x7c2174['order']=qs[_0x6797('0x3e')](_0x3ac9d3[_0x6797('0x36')][_0x6797('0x3e')]);_0x7c2174[_0x6797('0x3f')]=qs[_0x6797('0x40')](_[_0x6797('0x41')](_0x3ac9d3[_0x6797('0x36')],_0x17d05d['filters']));if(_0x3ac9d3['query'][_0x6797('0x42')]){_0x7c2174[_0x6797('0x3f')]=_[_0x6797('0x43')](_0x7c2174[_0x6797('0x3f')],{'$or':_[_0x6797('0x31')](_0x7c2174[_0x6797('0x38')],function(_0x560a57){var _0x1c39ad={};_0x1c39ad[_0x560a57]={'$like':'%'+_0x3ac9d3['query'][_0x6797('0x42')]+'%'};return _0x1c39ad;})});}_0x7c2174=_[_0x6797('0x43')]({},_0x7c2174,_0x3ac9d3[_0x6797('0x44')]);return _0x3e018f[_0x6797('0x58')](_0x7c2174);}})[_0x6797('0x2b')](function(_0x1c4442){if(_0x1c4442){_0x5f473e=_0x1c4442[_0x6797('0x3b')];if(!_0x3ac9d3[_0x6797('0x36')][_0x6797('0x3c')](_0x6797('0x5b'))){_0x7c2174[_0x6797('0x23')]=qs[_0x6797('0x23')](_0x3ac9d3['query'][_0x6797('0x23')]);_0x7c2174[_0x6797('0x22')]=qs['offset'](_0x3ac9d3[_0x6797('0x36')][_0x6797('0x22')]);}return _0x3e018f['getMembers'](_0x7c2174);}})['then'](function(_0x2bdb9f){if(_0x2bdb9f){return _0x2bdb9f?{'count':_0x5f473e,'rows':_0x2bdb9f}:null;}})[_0x6797('0x2b')](respondWithResult(_0x18d2e2,null))[_0x6797('0x49')](handleError(_0x18d2e2,null));};exports['removeMembers']=function(_0x16f51d,_0x5b74b1,_0x3ff6b5){return db[_0x6797('0x45')][_0x6797('0x54')]({'where':{'id':_0x16f51d[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x5b74b1,null))[_0x6797('0x2b')](function(_0x4b5ae5){if(_0x4b5ae5){return _0x4b5ae5['removeMembers'](_0x16f51d['query']['ids']);}})[_0x6797('0x2b')](respondWithStatusCode(_0x5b74b1,null))[_0x6797('0x49')](handleError(_0x5b74b1,null));};exports['addMessage']=function(_0x28f567,_0x8dc1db,_0x11f842){if(_0x28f567[_0x6797('0x4e')]['id']){delete _0x28f567[_0x6797('0x4e')]['id'];}return db[_0x6797('0x45')][_0x6797('0x54')]({'where':{'id':_0x28f567[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x8dc1db,null))[_0x6797('0x2b')](function(_0x409100){if(_0x409100){_0x28f567['body'][_0x6797('0x5c')]=_0x409100['id'];return db[_0x6797('0x5d')]['create'](_0x28f567[_0x6797('0x4e')]);}})[_0x6797('0x2b')](respondWithResult(_0x8dc1db,null))[_0x6797('0x49')](handleError(_0x8dc1db,null));};exports[_0x6797('0x5e')]=function(_0x14e399,_0x38fe8a,_0xa236e){var _0x553527={};var _0x173b52={};var _0xa6ab98;var _0xfcf3de;return db[_0x6797('0x45')][_0x6797('0x59')]({'where':{'id':_0x14e399[_0x6797('0x4b')]['id']}})[_0x6797('0x2b')](handleEntityNotFound(_0x38fe8a,null))[_0x6797('0x2b')](function(_0x7e5799){if(_0x7e5799){_0xa6ab98=_0x7e5799;_0x173b52[_0x6797('0x37')]=_[_0x6797('0x35')](db[_0x6797('0x5d')][_0x6797('0x4c')]);_0x173b52[_0x6797('0x36')]=_[_0x6797('0x35')](_0x14e399[_0x6797('0x36')]);_0x173b52['filters']=_[_0x6797('0x39')](_0x173b52[_0x6797('0x37')],_0x173b52[_0x6797('0x36')]);_0x553527[_0x6797('0x38')]=_[_0x6797('0x39')](_0x173b52['model'],qs[_0x6797('0x3a')](_0x14e399['query'][_0x6797('0x3a')]));_0x553527[_0x6797('0x38')]=_0x553527['attributes'][_0x6797('0x3b')]?_0x553527['attributes']:_0x173b52['model'];_0x553527[_0x6797('0x3d')]=qs[_0x6797('0x3e')](_0x14e399[_0x6797('0x36')][_0x6797('0x3e')]);_0x553527[_0x6797('0x3f')]=qs[_0x6797('0x40')](_['pick'](_0x14e399[_0x6797('0x36')],_0x173b52[_0x6797('0x40')]));if(_0x14e399[_0x6797('0x36')][_0x6797('0x42')]){_0x553527[_0x6797('0x3f')]=_[_0x6797('0x43')](_0x553527[_0x6797('0x3f')],{'$or':_[_0x6797('0x31')](_0x553527['attributes'],function(_0x426cd5){var _0x72f8c5={};_0x72f8c5[_0x426cd5]={'$like':'%'+_0x14e399['query']['filter']+'%'};return _0x72f8c5;})});}if(_0x14e399[_0x6797('0x36')][_0x6797('0x5f')]){var _0x489133=_0x14e399[_0x6797('0x36')][_0x6797('0x5f')][_0x6797('0x60')](',');var _0x25312a={};_0x25312a[_0x489133[0x0]]={'$gte':moment(_0x489133[0x1])[_0x6797('0x61')](_0x6797('0x62'))};_0x553527[_0x6797('0x3f')]=_[_0x6797('0x43')](_0x553527[_0x6797('0x3f')],_0x25312a);}_0x553527=_[_0x6797('0x43')]({},_0x553527,_0x14e399[_0x6797('0x44')]);return _0xa6ab98[_0x6797('0x5e')](_0x553527);}})[_0x6797('0x2b')](function(_0x1bfb3a){if(_0x1bfb3a){_0xfcf3de=_0x1bfb3a[_0x6797('0x3b')];if(!_0x14e399['query'][_0x6797('0x3c')](_0x6797('0x5b'))){_0x553527[_0x6797('0x23')]=qs[_0x6797('0x23')](_0x14e399[_0x6797('0x36')][_0x6797('0x23')]);_0x553527['offset']=qs[_0x6797('0x22')](_0x14e399['query'][_0x6797('0x22')]);}return _0xa6ab98[_0x6797('0x5e')](_0x553527);}})[_0x6797('0x2b')](function(_0x12e321){if(_0x12e321){return _0x12e321?{'count':_0xfcf3de,'rows':_0x12e321}:null;}})[_0x6797('0x2b')](respondWithResult(_0x38fe8a,null))[_0x6797('0x49')](handleError(_0x38fe8a,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 18b02c0..2a7c88e 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 _0x69a0=['events','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x230bdd,_0x10d76d){var _0x4de116=function(_0x15b36d){while(--_0x15b36d){_0x230bdd['push'](_0x230bdd['shift']());}};_0x4de116(++_0x10d76d);}(_0x69a0,0x181));var _0x069a=function(_0x1f4748,_0x368e06){_0x1f4748=_0x1f4748-0x0;var _0x3802cb=_0x69a0[_0x1f4748];return _0x3802cb;};'use strict';var EventEmitter=require(_0x069a('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x069a('0x1'),'afterUpdate':_0x069a('0x2'),'afterDestroy':_0x069a('0x3')};function emitEvent(_0x2cde9f){return function(_0x39c93d,_0x51cf04,_0x5422a3){ChatGroupEvents[_0x069a('0x4')](_0x2cde9f+':'+_0x39c93d['id'],_0x39c93d);ChatGroupEvents[_0x069a('0x4')](_0x2cde9f,_0x39c93d);_0x5422a3(null);};}for(var e in events){if(events[_0x069a('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x069a('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0xf954=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x42e293,_0x2f3181){var _0xc8697c=function(_0x5ad749){while(--_0x5ad749){_0x42e293['push'](_0x42e293['shift']());}};_0xc8697c(++_0x2f3181);}(_0xf954,0x10e));var _0x4f95=function(_0x340e24,_0xde71e){_0x340e24=_0x340e24-0x0;var _0x1808a=_0xf954[_0x340e24];return _0x1808a;};'use strict';var EventEmitter=require(_0x4f95('0x0'));var ChatGroup=require(_0x4f95('0x1'))['db'][_0x4f95('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4f95('0x3')](0x0);var events={'afterCreate':_0x4f95('0x4'),'afterUpdate':_0x4f95('0x5'),'afterDestroy':_0x4f95('0x6')};function emitEvent(_0x56b04c){return function(_0x5476e1,_0x3e7ef4,_0x124804){ChatGroupEvents[_0x4f95('0x7')](_0x56b04c+':'+_0x5476e1['id'],_0x5476e1);ChatGroupEvents[_0x4f95('0x7')](_0x56b04c,_0x5476e1);_0x124804(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4f95('0x8')](e,emitEvent(event));}}module[_0x4f95('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 85f8573..155f8ff 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 _0x130e=['chat_groups','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatGroup'];(function(_0x1fff29,_0x3df123){var _0x46b43e=function(_0xcc74fb){while(--_0xcc74fb){_0x1fff29['push'](_0x1fff29['shift']());}};_0x46b43e(++_0x3df123);}(_0x130e,0x1e5));var _0xe130=function(_0x468161,_0x47cb9a){_0x468161=_0x468161-0x0;var _0x4f75d2=_0x130e[_0x468161];return _0x4f75d2;};'use strict';var _=require(_0xe130('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe130('0x1'));var moment=require(_0xe130('0x2'));var BPromise=require(_0xe130('0x3'));var rp=require(_0xe130('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe130('0x5'));var config=require(_0xe130('0x6'));var attributes=require('./chatGroup.attributes');module[_0xe130('0x7')]=function(_0x5412c1,_0x5290f4){return _0x5412c1[_0xe130('0x8')](_0xe130('0x9'),attributes,{'tableName':_0xe130('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf656=['chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xf656,0x139));var _0x6f65=function(_0x497386,_0x22d287){_0x497386=_0x497386-0x0;var _0x5be956=_0xf656[_0x497386];return _0x5be956;};'use strict';var _=require(_0x6f65('0x0'));var util=require('util');var logger=require(_0x6f65('0x1'))(_0x6f65('0x2'));var moment=require(_0x6f65('0x3'));var BPromise=require(_0x6f65('0x4'));var rp=require(_0x6f65('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f65('0x6'));var config=require('../../config/environment');var attributes=require(_0x6f65('0x7'));module[_0x6f65('0x8')]=function(_0x1c3d15,_0x2fdd28){return _0x1c3d15[_0x6f65('0x9')](_0x6f65('0xa'),attributes,{'tableName':_0x6f65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index a44fa3e..e4d3dbf 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 _0x6732=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x260664,_0xfc9cfb){var _0x294d27=function(_0x20c826){while(--_0x20c826){_0x260664['push'](_0x260664['shift']());}};_0x294d27(++_0xfc9cfb);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var moment=require(_0x2673('0x2'));var BPromise=require(_0x2673('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2673('0x4'));var db=require(_0x2673('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2673('0x6'))(_0x2673('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2673('0x8')][_0x2673('0x9')]({'port':0x232a});config[_0x2673('0xa')]=_[_0x2673('0xb')](config[_0x2673('0xa')],{'host':_0x2673('0xc'),'port':0x18eb});var socket=require(_0x2673('0xd'))(new Redis(config[_0x2673('0xa')]));require(_0x2673('0xe'))[_0x2673('0xf')](socket);function respondWithRpcPromise(_0x1cde0f,_0x3176be,_0xd9759d){return new BPromise(function(_0x29daef,_0x35b72e){return client[_0x2673('0x10')](_0x1cde0f,_0xd9759d)[_0x2673('0x11')](function(_0xacd8f7){logger[_0x2673('0x12')]('ChatGroup,\x20%s,\x20%s',_0x3176be,_0x2673('0x13'));logger['debug'](_0x2673('0x14'),_0x3176be,_0x2673('0x13'),JSON[_0x2673('0x15')](_0xacd8f7));if(_0xacd8f7[_0x2673('0x16')]){if(_0xacd8f7[_0x2673('0x16')]['code']===0x1f4){logger['error'](_0x2673('0x17'),_0x3176be,_0xacd8f7[_0x2673('0x16')][_0x2673('0x18')]);return _0x35b72e(_0xacd8f7[_0x2673('0x16')][_0x2673('0x18')]);}logger['error'](_0x2673('0x17'),_0x3176be,_0xacd8f7[_0x2673('0x16')][_0x2673('0x18')]);return _0x29daef(_0xacd8f7[_0x2673('0x16')]['message']);}else{logger[_0x2673('0x12')](_0x2673('0x17'),_0x3176be,_0x2673('0x13'));_0x29daef(_0xacd8f7[_0x2673('0x19')][_0x2673('0x18')]);}})['catch'](function(_0x585be4){logger[_0x2673('0x16')](_0x2673('0x17'),_0x3176be,_0x585be4);_0x35b72e(_0x585be4);});});}
\ No newline at end of file
+var _0xdd50=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x3c30a4,_0x152fd6){var _0x4f3e14=function(_0x28d11e){while(--_0x28d11e){_0x3c30a4['push'](_0x3c30a4['shift']());}};_0x4f3e14(++_0x152fd6);}(_0xdd50,0x172));var _0x0dd5=function(_0x51b19b,_0x5015d2){_0x51b19b=_0x51b19b-0x0;var _0x1a3cd6=_0xdd50[_0x51b19b];return _0x1a3cd6;};'use strict';var _=require('lodash');var util=require(_0x0dd5('0x0'));var moment=require(_0x0dd5('0x1'));var BPromise=require(_0x0dd5('0x2'));var rs=require(_0x0dd5('0x3'));var fs=require('fs');var Redis=require(_0x0dd5('0x4'));var db=require(_0x0dd5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0dd5('0x6'));var client=jayson[_0x0dd5('0x7')][_0x0dd5('0x8')]({'port':0x232a});config[_0x0dd5('0x9')]=_[_0x0dd5('0xa')](config['redis'],{'host':_0x0dd5('0xb'),'port':0x18eb});var socket=require(_0x0dd5('0xc'))(new Redis(config[_0x0dd5('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x2a07db,_0x22419f,_0x20b37b){return new BPromise(function(_0x53c590,_0x574b2e){return client[_0x0dd5('0xd')](_0x2a07db,_0x20b37b)[_0x0dd5('0xe')](function(_0x51b19a){logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,_0x0dd5('0x11'));logger[_0x0dd5('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x22419f,_0x0dd5('0x11'),JSON['stringify'](_0x51b19a));if(_0x51b19a[_0x0dd5('0x13')]){if(_0x51b19a['error'][_0x0dd5('0x14')]===0x1f4){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x574b2e(_0x51b19a[_0x0dd5('0x13')]['message']);}logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x51b19a[_0x0dd5('0x13')][_0x0dd5('0x15')]);return _0x53c590(_0x51b19a['error'][_0x0dd5('0x15')]);}else{logger[_0x0dd5('0xf')](_0x0dd5('0x10'),_0x22419f,'request\x20sent');_0x53c590(_0x51b19a[_0x0dd5('0x16')][_0x0dd5('0x15')]);}})[_0x0dd5('0x17')](function(_0x2cba7e){logger[_0x0dd5('0x13')](_0x0dd5('0x10'),_0x22419f,_0x2cba7e);_0x574b2e(_0x2cba7e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index d17cb83..037b988 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 _0xeab6=['remove','update','removeListener','length','chatGroup:','./chatGroup.events','save'];(function(_0x3a4515,_0x121874){var _0x1752cd=function(_0x14a7b2){while(--_0x14a7b2){_0x3a4515['push'](_0x3a4515['shift']());}};_0x1752cd(++_0x121874);}(_0xeab6,0x140));var _0x6eab=function(_0x21a098,_0x204c09){_0x21a098=_0x21a098-0x0;var _0x3233a5=_0xeab6[_0x21a098];return _0x3233a5;};'use strict';var ChatGroupEvents=require(_0x6eab('0x0'));var events=[_0x6eab('0x1'),_0x6eab('0x2'),_0x6eab('0x3')];function createListener(_0x3e28b7,_0x3feb4e){return function(_0x22194b){_0x3feb4e['emit'](_0x3e28b7,_0x22194b);};}function removeListener(_0x6882f1,_0x35218d){return function(){ChatGroupEvents[_0x6eab('0x4')](_0x6882f1,_0x35218d);};}exports['register']=function(_0x380306){for(var _0x6179ec=0x0,_0x10a5af=events[_0x6eab('0x5')];_0x6179ec<_0x10a5af;_0x6179ec++){var _0x81956=events[_0x6179ec];var _0x52d0ee=createListener(_0x6eab('0x6')+_0x81956,_0x380306);ChatGroupEvents['on'](_0x81956,_0x52d0ee);}};
\ No newline at end of file
+var _0x406e=['./chatGroup.events','remove','update','removeListener','length'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x406e,0x6e));var _0xe406=function(_0x5c3912,_0x115ce1){_0x5c3912=_0x5c3912-0x0;var _0xccad87=_0x406e[_0x5c3912];return _0xccad87;};'use strict';var ChatGroupEvents=require(_0xe406('0x0'));var events=['save',_0xe406('0x1'),_0xe406('0x2')];function createListener(_0x2526f0,_0x2cf799){return function(_0x139552){_0x2cf799['emit'](_0x2526f0,_0x139552);};}function removeListener(_0x141698,_0x3cd35e){return function(){ChatGroupEvents[_0xe406('0x3')](_0x141698,_0x3cd35e);};}exports['register']=function(_0x5c88f7){for(var _0x5b13b9=0x0,_0x14775a=events[_0xe406('0x4')];_0x5b13b9<_0x14775a;_0x5b13b9++){var _0x24e2ce=events[_0x5b13b9];var _0x7f1891=createListener('chatGroup:'+_0x24e2ce,_0x5c88f7);ChatGroupEvents['on'](_0x24e2ce,_0x7f1891);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 96a0612..42b6ed8 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 _0x52e3=['/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get'];(function(_0x41af54,_0x31e48f){var _0x5ae081=function(_0x29116d){while(--_0x29116d){_0x41af54['push'](_0x41af54['shift']());}};_0x5ae081(++_0x31e48f);}(_0x52e3,0x1b7));var _0x352e=function(_0x4f17db,_0x199bbd){_0x4f17db=_0x4f17db-0x0;var _0x46b69c=_0x52e3[_0x4f17db];return _0x46b69c;};'use strict';var multer=require(_0x352e('0x0'));var util=require('util');var path=require(_0x352e('0x1'));var timeout=require(_0x352e('0x2'));var express=require('express');var router=express[_0x352e('0x3')]();var fs_extra=require(_0x352e('0x4'));var auth=require(_0x352e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x352e('0x6'));var controller=require(_0x352e('0x7'));router['get']('/',auth[_0x352e('0x8')](),controller[_0x352e('0x9')]);router[_0x352e('0xa')](_0x352e('0xb'),auth[_0x352e('0x8')](),controller[_0x352e('0xc')]);router[_0x352e('0xa')](_0x352e('0xd'),auth[_0x352e('0x8')](),controller[_0x352e('0xe')]);router[_0x352e('0xa')](_0x352e('0xf'),auth[_0x352e('0x8')](),controller[_0x352e('0x10')]);router[_0x352e('0xa')](_0x352e('0x11'),auth[_0x352e('0x8')](),controller[_0x352e('0x12')]);router[_0x352e('0xa')](_0x352e('0x13'),auth[_0x352e('0x8')](),controller[_0x352e('0x14')]);router[_0x352e('0x15')]('/',auth[_0x352e('0x8')](),controller[_0x352e('0x16')]);router['post'](_0x352e('0x11'),auth[_0x352e('0x8')](),controller[_0x352e('0x17')]);router[_0x352e('0x15')](_0x352e('0x13'),auth['isAuthenticated'](),controller[_0x352e('0x18')]);router['put'](_0x352e('0xd'),auth[_0x352e('0x8')](),controller[_0x352e('0x19')]);router[_0x352e('0x1a')]('/:id',auth[_0x352e('0x8')](),controller[_0x352e('0x1b')]);router[_0x352e('0x1a')]('/:id/members',auth[_0x352e('0x8')](),controller[_0x352e('0x1c')]);module[_0x352e('0x1d')]=router;
\ No newline at end of file
+var _0xbb02=['destroy','/:id/members','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMessages','post','create','addMembers','/:id/messages','addMessage','update','delete'];(function(_0x30b881,_0x22d2ba){var _0x43444e=function(_0x208557){while(--_0x208557){_0x30b881['push'](_0x30b881['shift']());}};_0x43444e(++_0x22d2ba);}(_0xbb02,0x111));var _0x2bb0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbb02[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x2bb0('0x0'));var util=require(_0x2bb0('0x1'));var path=require(_0x2bb0('0x2'));var timeout=require(_0x2bb0('0x3'));var express=require(_0x2bb0('0x4'));var router=express['Router']();var fs_extra=require(_0x2bb0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2bb0('0x6'));var config=require('../../config/environment');var controller=require(_0x2bb0('0x7'));router[_0x2bb0('0x8')]('/',auth[_0x2bb0('0x9')](),controller[_0x2bb0('0xa')]);router['get'](_0x2bb0('0xb'),auth[_0x2bb0('0x9')](),controller['describe']);router[_0x2bb0('0x8')](_0x2bb0('0xc'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0xd')]);router[_0x2bb0('0x8')](_0x2bb0('0xe'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0xf')]);router[_0x2bb0('0x8')]('/:id/members',auth[_0x2bb0('0x9')](),controller['getMembers']);router[_0x2bb0('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2bb0('0x10')]);router[_0x2bb0('0x11')]('/',auth['isAuthenticated'](),controller[_0x2bb0('0x12')]);router[_0x2bb0('0x11')]('/:id/members',auth['isAuthenticated'](),controller[_0x2bb0('0x13')]);router[_0x2bb0('0x11')](_0x2bb0('0x14'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0x15')]);router['put'](_0x2bb0('0xc'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0x16')]);router[_0x2bb0('0x17')](_0x2bb0('0xc'),auth[_0x2bb0('0x9')](),controller[_0x2bb0('0x18')]);router[_0x2bb0('0x17')](_0x2bb0('0x19'),auth[_0x2bb0('0x9')](),controller['removeMembers']);module[_0x2bb0('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index c9d5207..67602ce 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 _0x97c1=['TEXT','STRING','long','DATE','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','thumb','star'];(function(_0x3e6a68,_0x29ac68){var _0x2e8b06=function(_0x587f73){while(--_0x587f73){_0x3e6a68['push'](_0x3e6a68['shift']());}};_0x2e8b06(++_0x29ac68);}(_0x97c1,0xdf));var _0x197c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x97c1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x197c('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x197c('0x3')),'defaultValue':_0x197c('0x4')},'ratingMessage':{'type':Sequelize[_0x197c('0x5')]},'pathTranscript':{'type':Sequelize[_0x197c('0x5')]},'mailTranscript':{'type':Sequelize[_0x197c('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x197c('0x6')]},'thirdDisposition':{'type':Sequelize[_0x197c('0x6')]},'note':{'type':Sequelize[_0x197c('0x6')]},'browserName':{'type':Sequelize[_0x197c('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x197c('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x197c('0x6')]},'deviceType':{'type':Sequelize[_0x197c('0x6')]},'referer':{'type':Sequelize[_0x197c('0x5')]},'customerIp':{'type':Sequelize[_0x197c('0x6')]},'formData':{'type':Sequelize['TEXT'](_0x197c('0x7'))},'read1stAt':{'type':Sequelize[_0x197c('0x8')]},'lastMsgAt':{'type':Sequelize[_0x197c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x197c('0x9')]('in',_0x197c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x197c('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x197c('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x197c('0xb')],'defaultValue':![]}};
\ No newline at end of file
+var _0x152f=['sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x152f,0x144));var _0xf152=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x152f[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'closed':{'type':Sequelize[_0xf152('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf152('0x3')]},'ratingType':{'type':Sequelize[_0xf152('0x4')]('star',_0xf152('0x5')),'defaultValue':_0xf152('0x6')},'ratingMessage':{'type':Sequelize[_0xf152('0x7')]},'pathTranscript':{'type':Sequelize[_0xf152('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf152('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf152('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf152('0x9')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf152('0x9')]},'osVersion':{'type':Sequelize[_0xf152('0x9')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf152('0x9')]},'deviceType':{'type':Sequelize[_0xf152('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf152('0x9')]},'formData':{'type':Sequelize[_0xf152('0x7')](_0xf152('0xa'))},'read1stAt':{'type':Sequelize[_0xf152('0x8')]},'lastMsgAt':{'type':Sequelize[_0xf152('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf152('0x4')]('in',_0xf152('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf152('0x9')]},'customerPort':{'type':Sequelize[_0xf152('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xf152('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xf152('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 f3763fe..6ca7c0e 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 _0x9f62=['findAll','getMyMessages','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','firstName','lastName','read','Account','Owner','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.ejs','.pdf','err','zip-dir','moment','bluebird','mustache','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','stack','name','send','render','merge','body','contact','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','talking','answered','unmanaged','abandoned','total','UserId','closed','waiting','disposition','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','sequelize','toString','ChatInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','o.fullname','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','include','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','ValidationError','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','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','getMessages','nolimit','sort','$gte','options'];(function(_0x3d593d,_0x1dec8d){var _0x501ec5=function(_0x1b7039){while(--_0x1b7039){_0x3d593d['push'](_0x3d593d['shift']());}};_0x501ec5(++_0x1dec8d);}(_0x9f62,0x154));var _0x29f6=function(_0x35d8fa,_0x245fb7){_0x35d8fa=_0x35d8fa-0x0;var _0x585992=_0x9f62[_0x35d8fa];return _0x585992;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x0'));var rp=require('request-promise');var moment=require(_0x29f6('0x1'));var BPromise=require(_0x29f6('0x2'));var Mustache=require(_0x29f6('0x3'));var util=require('util');var path=require('path');var ejs=require(_0x29f6('0x4'));var fs=require('fs');var _=require(_0x29f6('0x5'));var squel=require(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x29f6('0x8'));var pdf=require(_0x29f6('0x9'));var logger=require(_0x29f6('0xa'))(_0x29f6('0xb'));var config=require(_0x29f6('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x29f6('0xd'),'port':0x18eb});var socket=require(_0x29f6('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x29f6('0xf')](socket);var jayson=require(_0x29f6('0x10'));var client=jayson['client'][_0x29f6('0x11')]({'port':0x232b});var client9004=jayson[_0x29f6('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b9b6a,_0x559585,_0x57b2d2,_0x2ae0e4){return new BPromise(function(_0x55cf4,_0x189344){var _0x11a1fd=_0x2ae0e4||client;return _0x11a1fd[_0x29f6('0x13')](_0x5b9b6a,_0x57b2d2)[_0x29f6('0x14')](function(_0x35d2e2){logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));logger[_0x29f6('0x18')](_0x29f6('0x19'),_0x559585,_0x29f6('0x17'),JSON[_0x29f6('0x1a')](_0x35d2e2));if(_0x35d2e2[_0x29f6('0x1b')]){if(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x559585,_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x189344(_0x35d2e2[_0x29f6('0x1b')]['message']);}logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x35d2e2['error'][_0x29f6('0x1d')]);return _0x55cf4(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);}else{logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));_0x55cf4(_0x35d2e2['result'][_0x29f6('0x1d')]);}})['catch'](function(_0x4acb15){logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x4acb15);_0x189344(_0x4acb15);});});}function respondWithStatusCode(_0x39c6b3,_0xafb5dd){_0xafb5dd=_0xafb5dd||0xcc;return function(_0x54ddeb){if(_0x54ddeb){return _0x39c6b3[_0x29f6('0x1e')](_0xafb5dd);}return _0x39c6b3['status'](_0xafb5dd)[_0x29f6('0x1f')]();};}function respondWithResult(_0xcce041,_0x4200cc){_0x4200cc=_0x4200cc||0xc8;return function(_0x1b80aa){if(_0x1b80aa){return _0xcce041['status'](_0x4200cc)[_0x29f6('0x20')](_0x1b80aa);}};}function respondWithFilteredResult(_0x4d494f,_0x47c385){return function(_0x1401fb){if(_0x1401fb){var _0x45f792=typeof _0x47c385[_0x29f6('0x21')]===_0x29f6('0x22')&&typeof _0x47c385[_0x29f6('0x23')]===_0x29f6('0x22');var _0x23c630=_0x1401fb['count'];var _0x2183b7=_0x45f792?0x0:_0x47c385[_0x29f6('0x21')];var _0x1ab8d8=_0x45f792?_0x1401fb[_0x29f6('0x24')]:_0x47c385[_0x29f6('0x21')]+_0x47c385[_0x29f6('0x23')];var _0x3790f5;if(_0x1ab8d8>=_0x23c630){_0x1ab8d8=_0x23c630;_0x3790f5=0xc8;}else{_0x3790f5=0xce;}_0x4d494f[_0x29f6('0x25')](_0x3790f5);return _0x4d494f[_0x29f6('0x26')](_0x29f6('0x27'),_0x2183b7+'-'+_0x1ab8d8+'/'+_0x23c630)[_0x29f6('0x20')](_0x1401fb);}return null;};}function saveUpdates(_0x1c3f0b){return function(_0x40c830){if(_0x40c830){return _0x40c830[_0x29f6('0x28')](_0x1c3f0b)[_0x29f6('0x14')](function(_0x218931){return _0x218931;});}return null;};}function removeEntity(_0x3a7249){return function(_0x5492c2){if(_0x5492c2){return _0x5492c2['destroy']()[_0x29f6('0x14')](function(){_0x3a7249['status'](0xcc)[_0x29f6('0x1f')]();});}};}function handleEntityNotFound(_0xc8d2c5){return function(_0x1e1bb6){if(!_0x1e1bb6){_0xc8d2c5[_0x29f6('0x1e')](0x194);}return _0x1e1bb6;};}function handleError(_0x5e5d89,_0x53e11f){_0x53e11f=_0x53e11f||0x1f4;return function(_0x1bde69){logger[_0x29f6('0x1b')](_0x1bde69[_0x29f6('0x29')]);if(_0x1bde69[_0x29f6('0x2a')]){delete _0x1bde69[_0x29f6('0x2a')];}_0x5e5d89[_0x29f6('0x25')](_0x53e11f)[_0x29f6('0x2b')](_0x1bde69);};}function getMustacheRender(_0x1c3f0f,_0xad83a3){return Mustache[_0x29f6('0x2c')](_0x1c3f0f,_[_0x29f6('0x2d')](_0xad83a3[_0x29f6('0x2e')],{'contact':_0xad83a3[_0x29f6('0x2f')],'message':_0xad83a3[_0x29f6('0x1d')],'agent':_0xad83a3['agent'],'interaction':_0xad83a3['interaction'],'account':_0xad83a3[_0x29f6('0x30')]}))||'';}function getInteractionUsers(_0x44cf19,_0x1cd62a){return new BPromise(function(_0x5416dc,_0x3e1e25){try{if(_0x1cd62a[_0x44cf19['id']]){_0x44cf19[_0x29f6('0x31')]=_[_0x29f6('0x32')](_0x1cd62a[_0x44cf19['id']],function(_0x27d945){return{'id':_0x27d945['id'],'fullname':_0x27d945[_0x29f6('0x33')]};});}}catch(_0x48fbd1){_0x3e1e25(_0x48fbd1);}_0x5416dc(_0x44cf19);});}function getInteractionTags(_0x7695ee,_0x2ad06f){return new BPromise(function(_0x2c3441,_0x1b51cc){try{if(_0x7695ee['TagIds']){_0x7695ee[_0x29f6('0x34')]=[];_0x7695ee[_0x29f6('0x35')][_0x29f6('0x36')](',')[_0x29f6('0x37')](function(_0x5ddc09){_0x7695ee['Tags'][_0x29f6('0x38')](_0x2ad06f[_0x5ddc09]);});}delete _0x7695ee['TagIds'];}catch(_0x10f077){_0x1b51cc(_0x10f077);}_0x2c3441(_0x7695ee);});}function updateChatInteraction(_0x551411,_0x3a1a75,_0x537210){return new BPromise(function(_0x34b1ea,_0x11fb2d){return getInteractionUsers(_0x551411,_0x537210)['then'](function(_0x1431fc){return getInteractionTags(_0x1431fc,_0x3a1a75);})['then'](function(_0x3f3475){return getStateInteraction(_0x3f3475);})[_0x29f6('0x14')](function(_0x4aea11){_0x34b1ea(_0x4aea11);})[_0x29f6('0x39')](function(_0xc6a6b1){_0x11fb2d(_0xc6a6b1);});});}function getStateInteraction(_0x2cad42){return new BPromise(function(_0x1e9d5a){_0x2cad42['waiting']=0x0;_0x2cad42[_0x29f6('0x3a')]=0x0;_0x2cad42[_0x29f6('0x3b')]=0x0;_0x2cad42[_0x29f6('0x3c')]=0x0;_0x2cad42[_0x29f6('0x3d')]=0x0;_0x2cad42[_0x29f6('0x3e')]=0x0;if(!_0x2cad42['closed']&&!_0x2cad42[_0x29f6('0x3f')]){_0x2cad42['waiting']+=0x1;}if(!_0x2cad42[_0x29f6('0x40')]&&_0x2cad42['UserId']){_0x2cad42[_0x29f6('0x3a')]+=0x1;if(_0x2cad42[_0x29f6('0x41')]){_0x2cad42['waiting']-=0x1;}}if(_0x2cad42[_0x29f6('0x40')]&&_0x2cad42[_0x29f6('0x42')]===_0x29f6('0x3d')){_0x2cad42[_0x29f6('0x3d')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42[_0x29f6('0x40')]&&!_0x2cad42[_0x29f6('0x3f')]&&_0x2cad42['disposition']){_0x2cad42[_0x29f6('0x3c')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42['closed']&&_0x2cad42['UserId']){_0x2cad42['answered']+=0x1;if(_0x2cad42[_0x29f6('0x3a')]){_0x2cad42[_0x29f6('0x3a')]-=0x1;}}_0x2cad42[_0x29f6('0x3e')]+=0x1;_0x1e9d5a(_0x2cad42);});}exports[_0x29f6('0x43')]=function(_0x19fd60,_0x270842){var _0x29b3f6={},_0x155ffb={},_0x352119={'count':0x0,'rows':[]};var _0x1bde93=_['map'](db['ChatInteraction'][_0x29f6('0x44')],function(_0x450e76){return{'name':_0x450e76[_0x29f6('0x45')],'type':_0x450e76[_0x29f6('0x46')]['key']};});_0x155ffb[_0x29f6('0x47')]=_[_0x29f6('0x32')](_0x1bde93,'name');_0x155ffb[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x19fd60[_0x29f6('0x48')]);_0x155ffb[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],_0x155ffb[_0x29f6('0x48')]);_0x29b3f6[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x19fd60[_0x29f6('0x48')]['fields']));_0x29b3f6[_0x29f6('0x4c')]=_0x29b3f6[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x29b3f6[_0x29f6('0x4c')]:_0x155ffb[_0x29f6('0x47')];if(!_0x19fd60['query'][_0x29f6('0x4f')]('nolimit')){_0x29b3f6['limit']=qs[_0x29f6('0x23')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x23')]);_0x29b3f6[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x19fd60['query'][_0x29f6('0x21')]);}_0x29b3f6[_0x29f6('0x50')]=qs['sort'](_0x19fd60[_0x29f6('0x48')]['sort']);_0x29b3f6[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x19fd60[_0x29f6('0x48')],_0x155ffb['filters']),_0x1bde93);var _0x199060=[];var _0xaa915c=squel[_0x29f6('0x53')]()[_0x29f6('0x54')]('id')[_0x29f6('0x54')](_0x29f6('0x2a'))[_0x29f6('0x54')]('color')[_0x29f6('0x55')](_0x29f6('0x56'));var _0x3bca11=squel[_0x29f6('0x53')]()[_0x29f6('0x54')](_0x29f6('0x57'))[_0x29f6('0x54')](_0x29f6('0x58'))[_0x29f6('0x54')](_0x29f6('0x59'))['from']('user_has_chat_interactions','ui')[_0x29f6('0x5a')](_0x29f6('0x5b'),'u',_0x29f6('0x5c'));var _0x5ab84e=squel[_0x29f6('0x53')]()['from']('chat_interactions','i')[_0x29f6('0x5a')](_0x29f6('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x29f6('0x5b'),'o',_0x29f6('0x5e'))[_0x29f6('0x5a')]('chat_websites','a',_0x29f6('0x5f'))[_0x29f6('0x5a')](_0x29f6('0x60'),'me',_0x29f6('0x61'))[_0x29f6('0x5a')](_0x29f6('0x62'),'it',_0x29f6('0x63'))[_0x29f6('0x5a')](_0x29f6('0x56'),'t',_0x29f6('0x64'));var _0x2d4c8d=squel[_0x29f6('0x65')]();var _0x434e04=[];var _0x5078d1=squel['expr']();var _0x2bd7d9;if(_0x19fd60['query'][_0x29f6('0x66')]){_0x2bd7d9=as[_0x29f6('0x67')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x66')]);var _0x2f757b=_0x2bd7d9['sqlOperator'];for(var _0x56c442=0x0;_0x56c442<_0x2bd7d9[_0x29f6('0x68')][_0x29f6('0x4e')];_0x56c442++){var _0x293f9d=_0x2bd7d9[_0x29f6('0x68')][_0x56c442];var _0x56342e='i';var _0x32291b=_['find'](_0x1bde93,['name',_0x293f9d[_0x29f6('0x54')]]);if(!_0x32291b){switch(_0x293f9d[_0x29f6('0x54')]){case'unreadMessages':if(_0x293f9d[_0x29f6('0x69')]==0x1){_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d['field']+_0x29f6('0x6b'));}else{_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d[_0x29f6('0x54')]+_0x29f6('0x6c'));}break;case _0x29f6('0x6d'):if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){if(_0x293f9d['value'][_0x29f6('0x36')]('\x20')['length']>0x1){_0x2d4c8d[_0x2f757b](_0x29f6('0x70'),qs['getFullTextValue'](_0x293f9d['value']),null);}else{var _0x1a3357='%'+_0x293f9d[_0x29f6('0x69')]+'%';_0x2d4c8d[_0x2f757b](_0x29f6('0x71'),_0x1a3357,_0x1a3357,_0x1a3357);}}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x72')]);_0x293f9d[_0x29f6('0x54')]='ContactId';_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b[_0x29f6('0x46')],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x76'):var _0x56f3cb=_0x293f9d[_0x29f6('0x69')][_0x29f6('0x36')](',')[_0x29f6('0x32')](function(_0x456578){return Number(_0x456578);});_0x56f3cb[_0x29f6('0x37')](function(_0x122a1a){_0x5078d1['or'](_0x29f6('0x77'),'%,'+_0x122a1a+',%');});_0x434e04=_[_0x29f6('0x78')](_0x434e04,_0x56f3cb);break;case'User':if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){_0x2d4c8d[_0x2f757b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x293f9d[_0x29f6('0x69')]+'%',null);}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x3f')]);_0x293f9d['field']=_0x29f6('0x3f');_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e['text'],_0x411f3e['value'][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x2e'):_0x411f3e=as[_0x29f6('0x73')]('me',null,_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')]['start'],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);break;}}else{var _0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}}}else{var _0x478ed0=_(_0x19fd60[_0x29f6('0x48')])[_0x29f6('0x49')]()[_0x29f6('0x32')](function(_0x1f401c){return _[_0x29f6('0x79')](_0x1bde93,[_0x29f6('0x2a'),_0x1f401c])?_0x1f401c:undefined;})['compact']()[_0x29f6('0x69')]();if(!_['isEmpty'](_0x478ed0)){_0x478ed0['forEach'](function(_0x4f9907){if(_0x4f9907===_0x29f6('0x7a')){_0x5ab84e['where'](_0x29f6('0x7b'),[][_0x29f6('0x7c')](_0x19fd60[_0x29f6('0x48')][_0x4f9907]));}else if(_0x4f9907===_0x29f6('0x7d')){var _0x8a5e58=JSON[_0x29f6('0x7e')](_0x19fd60[_0x29f6('0x48')][_0x4f9907])['$gte'];var _0x3a23f3=JSON['parse'](_0x19fd60[_0x29f6('0x48')][_0x4f9907])[_0x29f6('0x7f')];_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x80'),_0x8a5e58,_0x3a23f3);}else{if(_0x19fd60[_0x29f6('0x48')][_0x4f9907]===_0x29f6('0x81')){_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x82'));}else{_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x83'),_0x19fd60[_0x29f6('0x48')][_0x4f9907]);}}});}if(_0x19fd60[_0x29f6('0x48')]['read']){if(_0x19fd60['query']['read']==0x1){_0x5ab84e[_0x29f6('0x6a')](_0x29f6('0x84'));}else{_0x5ab84e['having'](_0x29f6('0x85'));}}if(_0x19fd60['query'][_0x29f6('0x86')]){_0x434e04=_[_0x29f6('0x87')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')])?_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]:new Array(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]);_0x434e04[_0x29f6('0x37')](function(_0xa2ab9e){_0x5078d1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa2ab9e+',%');});}if(_0x19fd60[_0x29f6('0x48')]['filter']){var _0x16bb3c=_0x19fd60[_0x29f6('0x48')][_0x29f6('0x88')][_0x29f6('0x89')]('\x5c','\x5c\x5c')[_0x29f6('0x89')](/'/g,'\x27\x27');if(qs[_0x29f6('0x8a')](_0x16bb3c)){_0x2d4c8d['or'](_0x29f6('0x8b'),_0x16bb3c+'%');}else{_0x2d4c8d['or'](_0x29f6('0x8c'),qs['getFullTextValue'](_0x16bb3c))['or'](_0x29f6('0x8d'),_0x16bb3c+'%');}}}_0x5ab84e[_0x29f6('0x51')](_0x2d4c8d);_0x5ab84e['group']('i.id');var _0x216f51={'type':db[_0x29f6('0x8e')][_0x29f6('0x8f')][_0x29f6('0x90')],'raw':!![]};var _0x467dd2=_0x5ab84e[_0x29f6('0x91')]();_0x467dd2[_0x29f6('0x54')](_0x29f6('0x92'));_0x467dd2[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));if(_0x29b3f6[_0x29f6('0x50')]){_0x29b3f6['order']['forEach'](function(_0x2e2f16){var _0x180658=_0x2e2f16[0x0]==='contactName'?_0x2e2f16[0x0]:'i.'+_0x2e2f16[0x0];_0x5ab84e[_0x29f6('0x50')](_0x180658,_0x2e2f16[0x1]===_0x29f6('0x95')?![]:!![]);});}if(!_[_0x29f6('0x96')](_0x434e04)){_0x5ab84e[_0x29f6('0x6a')](_0x5078d1);_0x467dd2[_0x29f6('0x51')](_0x29f6('0x97'),_0x434e04);}BPromise[_0x29f6('0x98')]()['then'](function(){if(!_0x2bd7d9){if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return;_0x467dd2[_0x29f6('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x99'));return;}if(_0x19fd60['user'][_0x29f6('0x9a')]!==_0x29f6('0x9b'))return;return _0x19fd60['user'][_0x29f6('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x405124){if(_[_0x29f6('0x96')](_0x405124)){_0x467dd2[_0x29f6('0x51')](_0x29f6('0x9d'));_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x9d'));}else{_0x467dd2['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));_0x5ab84e[_0x29f6('0x51')]('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));}});})['then'](function(){if(_0x19fd60[_0x29f6('0x9e')][_0x29f6('0x9a')]===_0x29f6('0x9b')&&!_0x2bd7d9&&!_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return[];return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x467dd2['toString'](),_0x216f51);})[_0x29f6('0x14')](function(_0x365b6d){_0x352119[_0x29f6('0x24')]=_0x365b6d['length'];if(_0x352119['count']===0x0)return[];return db['sequelize']['query'](_0xaa915c[_0x29f6('0xa0')](),_0x216f51)['then'](function(_0x537a8d){_0x199060=_['keyBy'](_0x537a8d,'id');_0x216f51=_[_0x29f6('0x2d')](_0x216f51,{'model':db[_0x29f6('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x4d')]){_0x29b3f6[_0x29f6('0x4c')]['forEach'](function(_0x28cf80){_0x5ab84e['field']('i.'+_0x28cf80);});}else{_0x5ab84e[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));_0x5ab84e[_0x29f6('0x54')]('a.key','Account.key');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa2'),_0x29f6('0xa3'));_0x5ab84e['field'](_0x29f6('0xa4'),_0x29f6('0xa5'));_0x5ab84e['field'](_0x29f6('0xa6'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa7'),_0x29f6('0xa8'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa9'),_0x29f6('0xaa'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xab'),_0x29f6('0xac'));_0x5ab84e['field'](_0x29f6('0xad'),'Contact.phone');_0x5ab84e['field']('c.mobile',_0x29f6('0xae'));_0x5ab84e[_0x29f6('0x54')]('c.fax','Contact.fax');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xaf'),'Owner.fullname');_0x5ab84e['field']('o.internal','Owner.internal');_0x5ab84e[_0x29f6('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29f6('0x35'));}if(_0x29b3f6[_0x29f6('0x23')])_0x5ab84e['limit'](_0x29b3f6[_0x29f6('0x23')]);if(_0x29b3f6[_0x29f6('0x21')])_0x5ab84e['offset'](_0x29b3f6[_0x29f6('0x21')]);return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x5ab84e[_0x29f6('0xa0')](),_0x216f51);})[_0x29f6('0x14')](function(_0x399328){if(_0x399328[_0x29f6('0x4e')]>0x0)_0x3bca11[_0x29f6('0x51')](_0x29f6('0xb0'),_[_0x29f6('0x32')](_0x399328,'id'));return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x3bca11[_0x29f6('0xa0')](),_0x216f51)[_0x29f6('0x14')](function(_0x5076ed){var _0x24757e=_[_0x29f6('0xb1')](_0x5076ed,_0x29f6('0xb2'));var _0x264617=[];_0x399328[_0x29f6('0x37')](function(_0x3569f7){_0x264617[_0x29f6('0x38')](updateChatInteraction(_0x3569f7,_0x199060,_0x24757e));});return BPromise['all'](_0x264617);});});})[_0x29f6('0x14')](function(_0x4ec09d){_0x352119[_0x29f6('0xb3')]=_0x4ec09d;return _0x352119;})[_0x29f6('0x14')](respondWithFilteredResult(_0x270842,_0x29b3f6))[_0x29f6('0x39')](handleError(_0x270842,null));};exports[_0x29f6('0xb4')]=function(_0x43c44d,_0x63517e){var _0x2dc960={'raw':![],'where':{'id':_0x43c44d[_0x29f6('0xb5')]['id']}},_0x312a6f={};_0x312a6f['model']=_[_0x29f6('0x49')](db[_0x29f6('0xa1')]['rawAttributes']);_0x312a6f['query']=_[_0x29f6('0x49')](_0x43c44d[_0x29f6('0x48')]);_0x312a6f[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x312a6f['model'],_0x312a6f[_0x29f6('0x48')]);_0x2dc960[_0x29f6('0x4c')]=_['intersection'](_0x312a6f[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x43c44d[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x2dc960[_0x29f6('0x4c')]=_0x2dc960[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2dc960[_0x29f6('0x4c')]:_0x312a6f[_0x29f6('0x47')];if(_0x43c44d[_0x29f6('0x48')][_0x29f6('0xb6')]){_0x2dc960[_0x29f6('0xb7')]=[{'all':!![]}];}_0x2dc960=_[_0x29f6('0x2d')]({},_0x2dc960,_0x43c44d['options']);return db[_0x29f6('0xa1')][_0x29f6('0xb8')](_0x2dc960)[_0x29f6('0x14')](handleEntityNotFound(_0x63517e,null))[_0x29f6('0x14')](respondWithResult(_0x63517e,null))['catch'](handleError(_0x63517e,null));};exports[_0x29f6('0xb9')]=function(_0x2ffad1,_0x37ea1b){return db['ChatInteraction'][_0x29f6('0xb9')](_0x2ffad1[_0x29f6('0x2e')],{})['then'](respondWithResult(_0x37ea1b,0xc9))[_0x29f6('0x39')](handleError(_0x37ea1b,null));};exports[_0x29f6('0x28')]=function(_0x26f030,_0x247bce){if(_0x26f030[_0x29f6('0x2e')]['id']){delete _0x26f030[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x26f030[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x247bce,null))[_0x29f6('0x14')](saveUpdates(_0x26f030['body'],null))['then'](respondWithResult(_0x247bce,null))[_0x29f6('0x39')](handleError(_0x247bce,null));};exports[_0x29f6('0xba')]=function(_0x1621b7,_0x1f0e72){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x1621b7[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1f0e72,null))['then'](removeEntity(_0x1f0e72,null))['catch'](handleError(_0x1f0e72,null));};exports['describe']=function(_0x1fd477,_0x45dfd1){return db[_0x29f6('0xa1')][_0x29f6('0xbb')]()['then'](respondWithResult(_0x45dfd1,null))[_0x29f6('0x39')](handleError(_0x45dfd1,null));};exports[_0x29f6('0xbc')]=function(_0x4f2471,_0x1ef540){var _0x5a51c0=_0x4f2471[_0x29f6('0xb5')]['id'];var _0x2a2e0e;var _0xaccfb7;var _0x19c10d;return db['ChatInteraction'][_0x29f6('0xbd')]({'where':{'id':_0x5a51c0}})['then'](function(_0x47785a){_0x2a2e0e=_0x47785a;return db[_0x29f6('0xbe')][_0x29f6('0xbd')]({'where':{'id':_0x47785a[_0x29f6('0x7a')]},'attributes':['id',_0x29f6('0xbf'),_0x29f6('0xc0'),'vidaooTopic','vidaooNote',_0x29f6('0xc1')],'raw':!![]});})['then'](function(_0x5db958){if(_0x5db958&&_0x5db958[_0x29f6('0xbf')]&&_0x5db958['vidaooEscalation']){_0xaccfb7=_0x5db958;var _0x67c30a={'interaction':{'id':_0x5a51c0},'agent':{'id':_0x4f2471[_0x29f6('0x9e')]['id'],'name':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x2a')],'fullname':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x33')],'email':_0x4f2471['user'][_0x29f6('0xc2')]},'contact':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x2f')],'account':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x30')]};var _0x1cec09={'rejectUnauthorized':![],'method':_0x29f6('0xc3'),'url':_0x29f6('0xc4'),'headers':{'X-APIKEY':_0x5db958[_0x29f6('0xbf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f2471[_0x29f6('0x9e')][_0x29f6('0xc2')]],'buttons':null,'topic':_0xaccfb7['vidaooTopic'],'note':_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc6')])?null:getMustacheRender(_0xaccfb7['vidaooNote'],_0x67c30a),'metadata':null},'redirect':_0x29f6('0xc7'),'json':!![]};try{if(!_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc1')])){var _0x50d48d=getMustacheRender(_0xaccfb7['vidaooMetadata'],_0x67c30a);var _0x1413a5=JSON[_0x29f6('0x7e')](_0x50d48d);_0x1cec09[_0x29f6('0x2e')][_0x29f6('0xc8')]=_0x1413a5;}}catch(_0x2b6357){throw new db[(_0x29f6('0x8e'))]['ValidationError'](_0x29f6('0xc9'));}return rp(_0x1cec09);}else{throw new db[(_0x29f6('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x231f26){_0x19c10d=_0x231f26;if(_0x19c10d['id']){var _0x578d49={'body':_0x19c10d[_0x29f6('0xca')],'ChatWebsiteId':_0xaccfb7['id'],'ChatInteractionId':_0x2a2e0e['id'],'direction':'out','UserId':_0x4f2471[_0x29f6('0x9e')]['id']};return db[_0x29f6('0xcb')][_0x29f6('0xb9')](_0x578d49,{});}else{throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x29f6('0x14')](function(){return _0x2a2e0e['updateAttributes']({'vidaooSessionId':_0x19c10d['id']});})[_0x29f6('0x14')](respondWithResult(_0x1ef540,null))[_0x29f6('0x39')](handleError(_0x1ef540,null));};exports[_0x29f6('0xcd')]=function(_0x19d1cb,_0x478660){if(_0x19d1cb[_0x29f6('0x2e')]['id']){delete _0x19d1cb[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x19d1cb[_0x29f6('0xb5')]['id']},'include':[{'model':db['CmContact'],'as':_0x29f6('0x6d')}]})[_0x29f6('0x14')](handleEntityNotFound(_0x478660,null))['then'](saveUpdates(_0x19d1cb[_0x29f6('0x2e')],null))['then'](respondWithResult(_0x478660,null))[_0x29f6('0x39')](handleError(_0x478660,null));};exports[_0x29f6('0xce')]=function(_0x52c66d,_0x955f7){if(_0x52c66d[_0x29f6('0x2e')]['id']){delete _0x52c66d['body']['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x52c66d[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](function(_0x352a07){if(!_0x352a07){logger[_0x29f6('0x1b')](_0x29f6('0xcf'),_0x29f6('0xce'),0x194,'entity\x20not\x20found');_0x955f7[_0x29f6('0x1e')](0x194);}else{if(_0x352a07[_0x29f6('0x3f')]){throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Interaction\x20already\x20assigned');}}return _0x352a07;})[_0x29f6('0x14')](function(_0x10648e){if(_0x10648e){return _0x10648e[_0x29f6('0x28')]({'closed':_0x52c66d[_0x29f6('0x2e')][_0x29f6('0x40')],'disposition':_0x52c66d['body']['disposition']})[_0x29f6('0x14')](function(_0x1b3b27){return _0x1b3b27;});}})['then'](function(){return respondWithRpcPromise(_0x29f6('0xd0'),'abandon',_0x52c66d['body'],client9004);})[_0x29f6('0x14')](respondWithResult(_0x955f7,null))['catch'](handleError(_0x955f7,null));};exports[_0x29f6('0xd1')]=function(_0x24a7fb,_0x454c4c){_0x24a7fb[_0x29f6('0x2e')]['name']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd3')];_0x24a7fb[_0x29f6('0x2e')][_0x29f6('0xd4')]=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd5')];_0x24a7fb['body']['type']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd6')];return db[_0x29f6('0xd7')][_0x29f6('0xb9')](_0x24a7fb[_0x29f6('0x2e')])[_0x29f6('0x14')](respondWithResult(_0x454c4c,0xc9))[_0x29f6('0x39')](handleError(_0x454c4c,null));};exports[_0x29f6('0xd8')]=function(_0x3d131a,_0x2bc181){return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d131a[_0x29f6('0xb5')]['id']},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null))[_0x29f6('0x14')](function(_0x583f5f){if(_0x583f5f){if(_0x583f5f[_0x29f6('0x40')]){return _0x2bc181[_0x29f6('0x25')](0x193)[_0x29f6('0x20')]({'status':0x193,'message':_0x29f6('0xd9')});}return db[_0x29f6('0xd7')]['findOne']({'where':{'id':_0x3d131a[_0x29f6('0x48')][_0x29f6('0xda')]},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null));}})['then'](function(_0x2378b8){if(_0x2378b8){var _0x2a5414=_0x2378b8[_0x29f6('0xdb')]!==null;var _0x189048=path['join'](config[_0x29f6('0xdc')],'server/files/attachments/');if(_0x2a5414){_0x189048=path[_0x29f6('0xdd')](_0x189048,'offline-chat/');}var _0x2aa18b=path[_0x29f6('0xdd')](_0x189048,_0x2378b8[_0x29f6('0xd4')]);return _0x2bc181[_0x29f6('0xde')](_0x2aa18b);}})['catch'](handleError(_0x2bc181,null));};exports[_0x29f6('0xdf')]=function(_0x2216ef,_0x4577ee){var _0x2ef994=null;var _0x28e4c5=null;var _0x168724=null;if(_0x2216ef[_0x29f6('0x2e')]['id']){delete _0x2216ef[_0x29f6('0x2e')]['id'];}if(_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')]){_0x168724=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server/files/chat/upload/',util[_0x29f6('0xe1')](_0x29f6('0xe2'),Date[_0x29f6('0xe3')]()));_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe4')]=_0x168724;}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x2216ef[_0x29f6('0xb5')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x29f6('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x29f6('0x14')](handleEntityNotFound(_0x4577ee,null))['then'](saveUpdates(_0x2216ef[_0x29f6('0x2e')],null))[_0x29f6('0x14')](function(_0x4a3381){if(_0x4a3381){_0x2ef994=_0x4a3381;return db[_0x29f6('0xbe')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994[_0x29f6('0x7a')]}});}})[_0x29f6('0x14')](function(_0xdb766a){if(_0xdb766a){_0x28e4c5=_0xdb766a;return db[_0x29f6('0xe6')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994['ContactId']}});}})[_0x29f6('0x14')](function(_0x37735f){if(_0x37735f){if(_0x168724){var _0x399aed=null;for(var _0xe432b0=0x1;_0xe432b0<_0x2ef994[_0x29f6('0xe5')][_0x29f6('0x4e')];++_0xe432b0){_0x399aed=_0x2ef994['Messages'][_0xe432b0];var _0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):_0x29f6('0xe9');var _0x46a5da=_0x2216ef['body'][_0x29f6('0xea')]||util['format']('%s%d',_0x29f6('0xeb'),_0x399aed[_0x29f6('0x72')]);switch(_0x28e4c5[_0x29f6('0xec')]){case _0x29f6('0xed'):_0x21bc96=_0x399aed['UserId']?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed[_0x29f6('0x3f')]):_0x29f6('0xe9');break;case _0x29f6('0xee'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed[_0x29f6('0xef')][_0x29f6('0xf0')]||_0x399aed[_0x29f6('0xef')][_0x29f6('0x33')]:_0x29f6('0xe9');break;case _0x29f6('0xf1'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed['User']['fullname']:_0x29f6('0xe9');break;default:_0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):'System';}var _0x593d86=util[_0x29f6('0xe1')](_0x29f6('0xf2'),moment(_0x399aed[_0x29f6('0x7d')])[_0x29f6('0xe1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x399aed[_0x29f6('0xf3')]==='in'?_0x46a5da:_0x21bc96,_0x399aed[_0x29f6('0x2e')]);if(!_0x399aed[_0x29f6('0xf4')]){fs[_0x29f6('0xf5')](_0x168724,_0x593d86);}}return db[_0x29f6('0xf6')][_0x29f6('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0x29f6('0xf7')],'as':_0x29f6('0xf8'),'raw':!![],'include':[{'model':db[_0x29f6('0xf9')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29f6('0x14')](function(_0x294136){if(!_0x294136||!_0x294136[_0x29f6('0xf8')]||!_0x2216ef[_0x29f6('0x2e')])return _0x2ef994;var _0x59fb2a=_0x294136['getSmtpOptions']();return respondWithRpcPromise(_0x29f6('0xfa'),_0x29f6('0xfb'),{'account':_0x59fb2a,'message':{'from':util[_0x29f6('0xe1')](_0x29f6('0xfc'),_0x294136[_0x29f6('0x2a')],_0x294136['email']||_0x294136[_0x29f6('0xf8')][_0x29f6('0x9e')]),'to':_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')],'subject':_0x29f6('0xfd'),'text':util[_0x29f6('0xe1')](_0x29f6('0xfe'),_0x2216ef['body'][_0x29f6('0xe0')]),'attachments':[{'path':_0x168724}]}})[_0x29f6('0x14')](function(){return _0x2ef994;})[_0x29f6('0x39')](function(_0x3d027f){logger['error'](_0x3d027f);});})[_0x29f6('0x14')](respondWithStatusCode(_0x4577ee,0xc8))[_0x29f6('0x39')](handleError(_0x4577ee,null));};exports[_0x29f6('0xff')]=function(_0x2df557,_0x589222){return db[_0x29f6('0xcb')][_0x29f6('0xb8')]({'where':{'id':_0x2df557[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x589222,null))[_0x29f6('0x14')](function(_0x318fd1){if(_0x318fd1){return _0x318fd1[_0x29f6('0xff')](_0x2df557[_0x29f6('0x2e')]['ids'],_[_0x29f6('0x100')](_0x2df557[_0x29f6('0x2e')],['ids','id'])||{});}})['then'](respondWithResult(_0x589222,null))['catch'](handleError(_0x589222,null));};exports[_0x29f6('0x101')]=function(_0x29017d,_0x5863a2){var _0x2f7729={'raw':![],'where':{}};var _0x171342={};var _0x1dafb9={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x29017d['params']['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x5863a2,null))[_0x29f6('0x14')](function(_0x1207f7){if(_0x1207f7){_0x171342[_0x29f6('0x47')]=_[_0x29f6('0x49')](db[_0x29f6('0xcb')][_0x29f6('0x44')]);_0x171342[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x29017d[_0x29f6('0x48')]);_0x171342['filters']=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],_0x171342['query']);_0x2f7729[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x29017d[_0x29f6('0x48')]['fields']));_0x2f7729[_0x29f6('0x4c')]=_0x2f7729[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2f7729['attributes']:_0x171342['model'];if(!_0x29017d[_0x29f6('0x48')][_0x29f6('0x4f')](_0x29f6('0x102'))){_0x2f7729[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x29017d[_0x29f6('0x48')]['limit']);_0x2f7729['offset']=qs[_0x29f6('0x21')](_0x29017d[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x2f7729[_0x29f6('0x50')]=qs[_0x29f6('0x103')](_0x29017d[_0x29f6('0x48')]['sort']);_0x2f7729['where']=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x29017d[_0x29f6('0x48')],_0x171342['filters']));_0x2f7729['where']['ChatInteractionId']=_0x1207f7['id'];if(_0x29017d[_0x29f6('0x48')]['filter']){_0x2f7729[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x2f7729[_0x29f6('0x4c')],function(_0x25532f){var _0x31ebb3={};_0x31ebb3[_0x25532f]={'$like':'%'+_0x29017d[_0x29f6('0x48')][_0x29f6('0x88')]+'%'};return _0x31ebb3;})});}if(_0x29017d['query'][_0x29f6('0x104')]){var _0x173977=_0x29017d['query'][_0x29f6('0x104')][_0x29f6('0x36')](',');var _0x43acdc={};_0x43acdc[_0x173977[0x0]]={'$gte':moment(_0x173977[0x1])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f7729['where']=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],_0x43acdc);}_0x2f7729=_[_0x29f6('0x2d')]({},_0x2f7729,_0x29017d[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x2f7729['where']})[_0x29f6('0x14')](function(_0x216ad8){_0x1dafb9['count']=_0x216ad8;if(_0x29017d['query']['includeAll']){_0x2f7729[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')][_0x29f6('0x106')](_0x2f7729);})[_0x29f6('0x14')](function(_0x2b1808){_0x1dafb9['rows']=_0x2b1808;return _0x1dafb9;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x5863a2,_0x2f7729))[_0x29f6('0x39')](handleError(_0x5863a2,null));};exports[_0x29f6('0x107')]=function(_0x3d68f3,_0x1cb0c0){var _0x47e4e5={'where':{}},_0x3a19d2={},_0x3450c3={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d68f3[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1cb0c0,null))[_0x29f6('0x14')](function(_0x6a318b){if(_0x6a318b){_0x3a19d2['model']=_[_0x29f6('0x49')](db[_0x29f6('0xcb')]['rawAttributes']);_0x3a19d2[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x3d68f3[_0x29f6('0x48')]);_0x3a19d2['filters']=_['intersection'](_0x3a19d2['model'],_0x3a19d2['query']);_0x47e4e5[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x3a19d2[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x47e4e5[_0x29f6('0x4c')]=_0x47e4e5[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x47e4e5[_0x29f6('0x4c')]:_0x3a19d2['model'];if(!_0x3d68f3[_0x29f6('0x48')]['hasOwnProperty'](_0x29f6('0x102'))){_0x47e4e5[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x23')]);_0x47e4e5[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x47e4e5['order']=qs['sort'](_0x3d68f3[_0x29f6('0x48')]['sort']);_0x47e4e5[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x3d68f3[_0x29f6('0x48')],_0x3a19d2[_0x29f6('0x4a')]));_0x47e4e5['where'][_0x29f6('0xb2')]=_0x6a318b['id'];if(_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x88')]){_0x47e4e5[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x47e4e5[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x47e4e5[_0x29f6('0x4c')],function(_0x346ece){var _0xc22605={};_0xc22605[_0x346ece]={'$like':'%'+_0x3d68f3[_0x29f6('0x48')]['filter']+'%'};return _0xc22605;})});}_0x47e4e5[_0x29f6('0x51')]['secret']=![];if(_0x3d68f3[_0x29f6('0x48')]['id']){_0x47e4e5[_0x29f6('0x51')]['id']={'$gt':_0x3d68f3['query']['id']};}_0x47e4e5=_['merge']({},_0x47e4e5,_0x3d68f3[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x47e4e5[_0x29f6('0x51')]})[_0x29f6('0x14')](function(_0x15db8c){_0x3450c3[_0x29f6('0x24')]=_0x15db8c;_0x47e4e5[_0x29f6('0xb7')]=[];if(_0x3d68f3['query']['includeAgent']){_0x47e4e5[_0x29f6('0xb7')]['push']({'model':db[_0x29f6('0xef')],'as':_0x29f6('0xef'),'attributes':['id','fullname',_0x29f6('0xf0')]});}if(_0x3d68f3[_0x29f6('0x48')]['includeAll']){_0x47e4e5[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')]['findAll'](_0x47e4e5);})['then'](function(_0x37c860){_0x3450c3[_0x29f6('0xb3')]=_0x37c860;return _0x3450c3;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x1cb0c0,_0x47e4e5))[_0x29f6('0x39')](handleError(_0x1cb0c0,null));};exports[_0x29f6('0x108')]=function(_0x371548,_0x7a0ebf){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x371548[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x7a0ebf,null))[_0x29f6('0x14')](function(_0x1e05e2){if(_0x1e05e2){return _0x1e05e2[_0x29f6('0x109')](_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')],_[_0x29f6('0x100')](_0x371548[_0x29f6('0x2e')],[_0x29f6('0x10a'),'id'])||{})[_0x29f6('0x10b')](function(){return db[_0x29f6('0x76')]['findAll']({'attributes':['id',_0x29f6('0x2a'),_0x29f6('0x10c')],'where':{'id':_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')]}});})['then'](function(_0x5248ba){socket[_0x29f6('0x10d')](_0x29f6('0x10e'),{'id':Number(_0x371548[_0x29f6('0xb5')]['id']),'tags':_0x5248ba||[]});return{'id':Number(_0x371548['params']['id']),'tags':_0x5248ba||[]};});}})[_0x29f6('0x14')](respondWithResult(_0x7a0ebf,null))[_0x29f6('0x39')](handleError(_0x7a0ebf,null));};exports[_0x29f6('0x10f')]=function(_0x47028e,_0x410ab5){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x47028e[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x410ab5,null))[_0x29f6('0x14')](function(_0x281c49){if(_0x281c49){return _0x281c49[_0x29f6('0x10f')](_0x47028e[_0x29f6('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x410ab5,null))[_0x29f6('0x39')](handleError(_0x410ab5,null));};exports['download']=function(_0x5250bc,_0x31ba94){var _0x31dcfe=moment()[_0x29f6('0x110')]()[_0x29f6('0xa0')]();var _0x5cf3d4=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],_0x29f6('0x111'),'files',_0x29f6('0x112'));var _0x5dcaf2=path['join'](config['root'],'server',_0x29f6('0x113'),_0x29f6('0x114'));var _0xcf75fe=path[_0x29f6('0xdd')](_0x5cf3d4,_0x31dcfe);var _0x48ecb0=util['format']('transcript-%d-%s.zip',_0x5250bc[_0x29f6('0xb5')]['id'],_0x31dcfe);var _0x5de30e=path[_0x29f6('0xdd')](_0x5cf3d4,_0x48ecb0);var _0x10989a=[];_0x10989a[_0x29f6('0x38')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x10989a[_0x29f6('0x38')]({'model':db[_0x29f6('0xe6')],'as':_0x29f6('0x6d'),'attributes':['id',_0x29f6('0x115'),_0x29f6('0x116')],'raw':!![]});if(_0x5250bc['query'][_0x29f6('0x114')]){_0x10989a[_0x29f6('0x38')]({'model':db['Attachment'],'as':_0x29f6('0xd7'),'raw':!![]});}var _0x15c951=[{'model':db[_0x29f6('0xcb')],'as':'Messages','attributes':['id','body',_0x29f6('0x7d'),'direction',_0x29f6('0xf4'),_0x29f6('0x117')],'include':_0x10989a}];_0x15c951['push']({'model':db['ChatWebsite'],'as':_0x29f6('0x118'),'attributes':['id',_0x29f6('0x2a')]});_0x15c951[_0x29f6('0x38')]({'model':db['User'],'as':_0x29f6('0x119'),'attributes':['id',_0x29f6('0x33')]});return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x5250bc[_0x29f6('0xb5')]['id']},'include':_0x15c951})['then'](handleEntityNotFound(_0x31ba94,null))[_0x29f6('0x14')](function(_0x4ad41d){if(_0x4ad41d){var _0x598bcd=_0x4ad41d['get']({'plain':!![]});fs['mkdirSync'](_0xcf75fe);var _0x53751c={'channel':_0x29f6('0x11a'),'account':_0x598bcd['Account'][_0x29f6('0x2a')],'agent':_0x598bcd[_0x29f6('0x119')]?_0x598bcd[_0x29f6('0x119')][_0x29f6('0x33')]:_0x29f6('0x11b'),'createdAt':moment(_0x598bcd['createdAt'])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'closedAt':_0x598bcd['closed']?moment(_0x598bcd[_0x29f6('0x11d')])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29f6('0xa0')]():'','disposition':_0x598bcd['disposition'],'chatInfo':{'browser':_0x598bcd[_0x29f6('0x11e')],'os':_0x598bcd[_0x29f6('0x11f')],'referer':_0x598bcd[_0x29f6('0x120')],'customerIp':_0x598bcd[_0x29f6('0x121')],'customerPort':_0x598bcd[_0x29f6('0x122')]?_0x598bcd[_0x29f6('0x122')]:_0x29f6('0x11b')},'messages':_(_0x598bcd[_0x29f6('0xe5')])[_0x29f6('0x123')]()[_0x29f6('0x88')]({'secret':![]})[_0x29f6('0x32')](function(_0x2fd414){if(_0x2fd414['Attachment']){var _0x49c5f6=path[_0x29f6('0xdd')](_0x5dcaf2,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]);if(fs[_0x29f6('0x124')](_0x49c5f6)){fs[_0x29f6('0x125')](_0x49c5f6)[_0x29f6('0x126')](fs[_0x29f6('0x127')](path[_0x29f6('0xdd')](_0xcf75fe,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')])));}}return{'date':moment(_0x2fd414[_0x29f6('0x7d')])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'sender':_0x2fd414[_0x29f6('0xf3')]===_0x29f6('0x128')?_0x2fd414[_0x29f6('0xef')]?_0x2fd414[_0x29f6('0xef')]['fullname']:_0x29f6('0xe9'):_0x2fd414[_0x29f6('0x6d')]['firstName']+(_0x2fd414['Contact'][_0x29f6('0x116')]?'\x20'+_0x2fd414[_0x29f6('0x6d')][_0x29f6('0x116')]:''),'body':_0x2fd414[_0x29f6('0xd7')]?_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]:_0x2fd414[_0x29f6('0x2e')],'direction':_0x2fd414['direction']==='out'?'A':'C','secret':_0x2fd414['secret'],'read':_0x2fd414[_0x29f6('0x117')],'attachment':_0x2fd414[_0x29f6('0xd7')]};})[_0x29f6('0x69')]()};return ejs[_0x29f6('0x129')](path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server','views',_0x29f6('0x12a')),{'interaction':_0x53751c})[_0x29f6('0x14')](function(_0x3307a1){var _0x595aff=path[_0x29f6('0xdd')](_0xcf75fe,'transcript-'+_0x598bcd['id']+'-'+_0x31dcfe+_0x29f6('0x12b'));var _0x3101aa={'path':_0x595aff,'channel':'Chat','interactionId':_0x598bcd['id']};return pdf['createPdfFromHTML'](_0x3307a1,_0x3101aa);})[_0x29f6('0x14')](function(){return new Promise(function(_0x4c7b46,_0x41d45f){zipdir(_0xcf75fe,{'saveTo':_0x5de30e},function(_0x1f1679,_0x2dfc83){if(_0x1f1679)return _0x41d45f(_0x1f1679);return _0x4c7b46(_0x2dfc83);});})[_0x29f6('0x14')](function(){return new BPromise(function(_0x53cde9,_0x26eef7){rimraf(_0xcf75fe,function(_0x17b595){if(_0x17b595)_0x26eef7(_0x17b595);return _0x53cde9();});});})['then'](function(){return _0x31ba94[_0x29f6('0xde')](_0x5de30e,_0x48ecb0,function(_0x22fcde){if(_0x22fcde){logger[_0x29f6('0x1b')](_0x29f6('0x12c'),_0x22fcde);}else{fs['unlinkSync'](_0x5de30e);}});});});}else{return _0x31ba94[_0x29f6('0x1e')](0xc8);}})[_0x29f6('0x39')](handleError(_0x31ba94,null));};
\ No newline at end of file
+var _0x99e9=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','some','compact','isEmpty','forEach','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','rawAttributes','include','options','create','body','describe','createVidaooSession','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','attachmentUpload','file','basename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','ChatWebsite','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','includeAgent','addTags','setTags','spread','emit','removeTags','download','unix','server','files','tmp','attachments','lastName','createdAt','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','zip-dir','request-promise','moment','bluebird','util','path','ejs','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','render','merge','interaction','account','Users','fullname','Tags','split','push','TagIds','waiting','talking','unmanaged','abandoned','total','closed','UserId','disposition','map','ChatInteraction','fieldName','type','key','keys','intersection','model','attributes','fields','length','hasOwnProperty','query','sort','where','filters','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','ContactId','text','end','Tag','User'];(function(_0x1d1116,_0x498e8b){var _0x1ccae2=function(_0x4e421f){while(--_0x4e421f){_0x1d1116['push'](_0x1d1116['shift']());}};_0x1ccae2(++_0x498e8b);}(_0x99e9,0xb4));var _0x999e=function(_0x11b4fb,_0x10c784){_0x11b4fb=_0x11b4fb-0x0;var _0x56cbb5=_0x99e9[_0x11b4fb];return _0x56cbb5;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x999e('0x0'));var rp=require(_0x999e('0x1'));var moment=require(_0x999e('0x2'));var BPromise=require(_0x999e('0x3'));var Mustache=require('mustache');var util=require(_0x999e('0x4'));var path=require(_0x999e('0x5'));var ejs=require(_0x999e('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x999e('0x7'));var Redis=require('ioredis');var qs=require(_0x999e('0x8'));var as=require(_0x999e('0x9'));var pdf=require(_0x999e('0xa'));var logger=require(_0x999e('0xb'))('api');var config=require(_0x999e('0xc'));var db=require(_0x999e('0xd'))['db'];config[_0x999e('0xe')]=_[_0x999e('0xf')](config[_0x999e('0xe')],{'host':_0x999e('0x10'),'port':0x18eb});var socket=require(_0x999e('0x11'))(new Redis(config[_0x999e('0xe')]));require(_0x999e('0x12'))[_0x999e('0x13')](socket);var jayson=require(_0x999e('0x14'));var client=jayson[_0x999e('0x15')][_0x999e('0x16')]({'port':0x232b});var client9004=jayson[_0x999e('0x15')][_0x999e('0x16')]({'port':0x232c});function respondWithRpcPromise(_0xdb587b,_0x26b55a,_0x47a3c1,_0x15f771){return new BPromise(function(_0x54afad,_0x3e6f5a){var _0x387924=_0x15f771||client;return _0x387924[_0x999e('0x17')](_0xdb587b,_0x47a3c1)['then'](function(_0x28bdd1){logger['info'](_0x999e('0x18'),_0x26b55a,'request\x20sent');logger['debug'](_0x999e('0x19'),_0x26b55a,_0x999e('0x1a'),JSON[_0x999e('0x1b')](_0x28bdd1));if(_0x28bdd1[_0x999e('0x1c')]){if(_0x28bdd1[_0x999e('0x1c')][_0x999e('0x1d')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x26b55a,_0x28bdd1['error'][_0x999e('0x1e')]);return _0x3e6f5a(_0x28bdd1[_0x999e('0x1c')][_0x999e('0x1e')]);}logger[_0x999e('0x1c')](_0x999e('0x18'),_0x26b55a,_0x28bdd1[_0x999e('0x1c')]['message']);return _0x54afad(_0x28bdd1['error'][_0x999e('0x1e')]);}else{logger[_0x999e('0x1f')](_0x999e('0x18'),_0x26b55a,'request\x20sent');_0x54afad(_0x28bdd1[_0x999e('0x20')][_0x999e('0x1e')]);}})[_0x999e('0x21')](function(_0x36fce4){logger[_0x999e('0x1c')](_0x999e('0x18'),_0x26b55a,_0x36fce4);_0x3e6f5a(_0x36fce4);});});}function respondWithStatusCode(_0x427bcf,_0x4d4474){_0x4d4474=_0x4d4474||0xcc;return function(_0x54ad83){if(_0x54ad83){return _0x427bcf[_0x999e('0x22')](_0x4d4474);}return _0x427bcf[_0x999e('0x23')](_0x4d4474)['end']();};}function respondWithResult(_0x452acd,_0xe324d8){_0xe324d8=_0xe324d8||0xc8;return function(_0x3f548e){if(_0x3f548e){return _0x452acd[_0x999e('0x23')](_0xe324d8)[_0x999e('0x24')](_0x3f548e);}};}function respondWithFilteredResult(_0x320634,_0x4f8406){return function(_0x2e1cc5){if(_0x2e1cc5){var _0x4199ff=typeof _0x4f8406[_0x999e('0x25')]===_0x999e('0x26')&&typeof _0x4f8406[_0x999e('0x27')]===_0x999e('0x26');var _0x44b790=_0x2e1cc5['count'];var _0x28f803=_0x4199ff?0x0:_0x4f8406['offset'];var _0x4fed13=_0x4199ff?_0x2e1cc5[_0x999e('0x28')]:_0x4f8406[_0x999e('0x25')]+_0x4f8406[_0x999e('0x27')];var _0x555ca0;if(_0x4fed13>=_0x44b790){_0x4fed13=_0x44b790;_0x555ca0=0xc8;}else{_0x555ca0=0xce;}_0x320634[_0x999e('0x23')](_0x555ca0);return _0x320634[_0x999e('0x29')](_0x999e('0x2a'),_0x28f803+'-'+_0x4fed13+'/'+_0x44b790)[_0x999e('0x24')](_0x2e1cc5);}return null;};}function saveUpdates(_0x15dca1){return function(_0x327079){if(_0x327079){return _0x327079[_0x999e('0x2b')](_0x15dca1)[_0x999e('0x2c')](function(_0x27102b){return _0x27102b;});}return null;};}function removeEntity(_0x3ddacb){return function(_0x53ece1){if(_0x53ece1){return _0x53ece1[_0x999e('0x2d')]()[_0x999e('0x2c')](function(){_0x3ddacb[_0x999e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca5b8){return function(_0x5af72c){if(!_0x5af72c){_0x2ca5b8['sendStatus'](0x194);}return _0x5af72c;};}function handleError(_0x28a228,_0x332195){_0x332195=_0x332195||0x1f4;return function(_0x5aa206){logger['error'](_0x5aa206[_0x999e('0x2e')]);if(_0x5aa206[_0x999e('0x2f')]){delete _0x5aa206[_0x999e('0x2f')];}_0x28a228[_0x999e('0x23')](_0x332195)['send'](_0x5aa206);};}function getMustacheRender(_0x2724be,_0x41d6f1){return Mustache[_0x999e('0x30')](_0x2724be,_[_0x999e('0x31')](_0x41d6f1['body'],{'contact':_0x41d6f1['contact'],'message':_0x41d6f1[_0x999e('0x1e')],'agent':_0x41d6f1['agent'],'interaction':_0x41d6f1[_0x999e('0x32')],'account':_0x41d6f1[_0x999e('0x33')]}))||'';}function getInteractionUsers(_0x69e059,_0x14c9e0){return new BPromise(function(_0x5ad3f1,_0xebda67){try{if(_0x14c9e0[_0x69e059['id']]){_0x69e059[_0x999e('0x34')]=_['map'](_0x14c9e0[_0x69e059['id']],function(_0x4808d1){return{'id':_0x4808d1['id'],'fullname':_0x4808d1[_0x999e('0x35')]};});}}catch(_0x4aa98c){_0xebda67(_0x4aa98c);}_0x5ad3f1(_0x69e059);});}function getInteractionTags(_0xa0c150,_0x5dac45){return new BPromise(function(_0x518083,_0x504ac1){try{if(_0xa0c150['TagIds']){_0xa0c150[_0x999e('0x36')]=[];_0xa0c150['TagIds'][_0x999e('0x37')](',')['forEach'](function(_0x4cfa34){_0xa0c150['Tags'][_0x999e('0x38')](_0x5dac45[_0x4cfa34]);});}delete _0xa0c150[_0x999e('0x39')];}catch(_0xd529df){_0x504ac1(_0xd529df);}_0x518083(_0xa0c150);});}function updateChatInteraction(_0xe3c089,_0x379064,_0x368183){return new BPromise(function(_0x32e494,_0x176a8c){return getInteractionUsers(_0xe3c089,_0x368183)['then'](function(_0x3ff20a){return getInteractionTags(_0x3ff20a,_0x379064);})[_0x999e('0x2c')](function(_0x1e1229){return getStateInteraction(_0x1e1229);})[_0x999e('0x2c')](function(_0x5dd3db){_0x32e494(_0x5dd3db);})[_0x999e('0x21')](function(_0x53730c){_0x176a8c(_0x53730c);});});}function getStateInteraction(_0x36194c){return new BPromise(function(_0x35b318){_0x36194c[_0x999e('0x3a')]=0x0;_0x36194c[_0x999e('0x3b')]=0x0;_0x36194c['answered']=0x0;_0x36194c[_0x999e('0x3c')]=0x0;_0x36194c[_0x999e('0x3d')]=0x0;_0x36194c[_0x999e('0x3e')]=0x0;if(!_0x36194c['closed']&&!_0x36194c['UserId']){_0x36194c[_0x999e('0x3a')]+=0x1;}if(!_0x36194c[_0x999e('0x3f')]&&_0x36194c[_0x999e('0x40')]){_0x36194c[_0x999e('0x3b')]+=0x1;if(_0x36194c[_0x999e('0x3a')]){_0x36194c[_0x999e('0x3a')]-=0x1;}}if(_0x36194c[_0x999e('0x3f')]&&_0x36194c[_0x999e('0x41')]===_0x999e('0x3d')){_0x36194c[_0x999e('0x3d')]+=0x1;if(_0x36194c['waiting']){_0x36194c['waiting']-=0x1;}}else if(_0x36194c[_0x999e('0x3f')]&&!_0x36194c[_0x999e('0x40')]&&_0x36194c[_0x999e('0x41')]){_0x36194c[_0x999e('0x3c')]+=0x1;if(_0x36194c[_0x999e('0x3a')]){_0x36194c[_0x999e('0x3a')]-=0x1;}}else if(_0x36194c['closed']&&_0x36194c[_0x999e('0x40')]){_0x36194c['answered']+=0x1;if(_0x36194c['talking']){_0x36194c[_0x999e('0x3b')]-=0x1;}}_0x36194c['total']+=0x1;_0x35b318(_0x36194c);});}exports['index']=function(_0x5a7366,_0x4f904e){var _0xc89b1={},_0x2841f7={},_0x5e50f5={'count':0x0,'rows':[]};var _0x4542e6=_[_0x999e('0x42')](db[_0x999e('0x43')]['rawAttributes'],function(_0x4b230d){return{'name':_0x4b230d[_0x999e('0x44')],'type':_0x4b230d[_0x999e('0x45')][_0x999e('0x46')]};});_0x2841f7['model']=_['map'](_0x4542e6,'name');_0x2841f7['query']=_[_0x999e('0x47')](_0x5a7366['query']);_0x2841f7['filters']=_[_0x999e('0x48')](_0x2841f7[_0x999e('0x49')],_0x2841f7['query']);_0xc89b1[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x2841f7['model'],qs[_0x999e('0x4b')](_0x5a7366['query'][_0x999e('0x4b')]));_0xc89b1[_0x999e('0x4a')]=_0xc89b1['attributes'][_0x999e('0x4c')]?_0xc89b1[_0x999e('0x4a')]:_0x2841f7['model'];if(!_0x5a7366['query'][_0x999e('0x4d')]('nolimit')){_0xc89b1['limit']=qs['limit'](_0x5a7366[_0x999e('0x4e')][_0x999e('0x27')]);_0xc89b1[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x5a7366[_0x999e('0x4e')][_0x999e('0x25')]);}_0xc89b1['order']=qs[_0x999e('0x4f')](_0x5a7366[_0x999e('0x4e')]['sort']);_0xc89b1[_0x999e('0x50')]=qs[_0x999e('0x51')](_[_0x999e('0x52')](_0x5a7366[_0x999e('0x4e')],_0x2841f7[_0x999e('0x51')]),_0x4542e6);var _0x334d19=[];var _0x428842=squel[_0x999e('0x53')]()[_0x999e('0x54')]('id')['field'](_0x999e('0x2f'))[_0x999e('0x54')](_0x999e('0x55'))[_0x999e('0x56')]('tools_tags');var _0x392324=squel[_0x999e('0x53')]()[_0x999e('0x54')](_0x999e('0x57'))[_0x999e('0x54')](_0x999e('0x58'))[_0x999e('0x54')](_0x999e('0x59'))['from']('user_has_chat_interactions','ui')[_0x999e('0x5a')](_0x999e('0x5b'),'u',_0x999e('0x5c'));var _0xefd231=squel[_0x999e('0x53')]()[_0x999e('0x56')](_0x999e('0x5d'),'i')['left_join']('cm_contacts','c',_0x999e('0x5e'))[_0x999e('0x5a')](_0x999e('0x5b'),'o',_0x999e('0x5f'))[_0x999e('0x5a')]('chat_websites','a',_0x999e('0x60'))[_0x999e('0x5a')](_0x999e('0x61'),'me',_0x999e('0x62'))[_0x999e('0x5a')](_0x999e('0x63'),'it',_0x999e('0x64'))['left_join'](_0x999e('0x65'),'t','t.id\x20=\x20it.TagId');var _0xe35369=squel[_0x999e('0x66')]();var _0x2ce0b3=[];var _0x25f6a6=squel[_0x999e('0x66')]();var _0x53cfbc;if(_0x5a7366['query'][_0x999e('0x67')]){_0x53cfbc=as[_0x999e('0x68')](_0x5a7366[_0x999e('0x4e')][_0x999e('0x67')]);var _0x470e51=_0x53cfbc[_0x999e('0x69')];for(var _0x23fd58=0x0;_0x23fd58<_0x53cfbc[_0x999e('0x6a')][_0x999e('0x4c')];_0x23fd58++){var _0x7f9dfe=_0x53cfbc[_0x999e('0x6a')][_0x23fd58];var _0xcc200b='i';var _0x77a387=_[_0x999e('0x6b')](_0x4542e6,[_0x999e('0x2f'),_0x7f9dfe['field']]);if(!_0x77a387){switch(_0x7f9dfe[_0x999e('0x54')]){case _0x999e('0x6c'):if(_0x7f9dfe[_0x999e('0x6d')]==0x1){_0xefd231[_0x999e('0x6e')]('`'+_0x7f9dfe['field']+'`\x20=\x200');}else{_0xefd231[_0x999e('0x6e')]('`'+_0x7f9dfe[_0x999e('0x54')]+_0x999e('0x6f'));}break;case _0x999e('0x70'):if(_0x7f9dfe[_0x999e('0x71')]===_0x999e('0x72')){if(_0x7f9dfe[_0x999e('0x6d')][_0x999e('0x37')]('\x20')[_0x999e('0x4c')]>0x1){_0xe35369[_0x470e51]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x999e('0x73')](_0x7f9dfe['value']),null);}else{var _0x184b3e='%'+_0x7f9dfe[_0x999e('0x6d')]+'%';_0xe35369[_0x470e51]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x184b3e,_0x184b3e,_0x184b3e);}}else{_0x77a387=_[_0x999e('0x6b')](_0x4542e6,[_0x999e('0x2f'),_0x999e('0x74')]);_0x7f9dfe[_0x999e('0x54')]=_0x999e('0x74');_0x1f0dc3=as['buildExpression'](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value']['start'],_0x1f0dc3['value'][_0x999e('0x76')]);}break;case _0x999e('0x77'):var _0x3432fd=_0x7f9dfe[_0x999e('0x6d')][_0x999e('0x37')](',')['map'](function(_0x492a5a){return Number(_0x492a5a);});_0x3432fd['forEach'](function(_0x49293d){_0x25f6a6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x49293d+',%');});_0x2ce0b3=_['union'](_0x2ce0b3,_0x3432fd);break;case _0x999e('0x78'):if(_0x7f9dfe['operator']===_0x999e('0x72')){_0xe35369[_0x470e51](_0x999e('0x79'),'%'+_0x7f9dfe[_0x999e('0x6d')]+'%',null);}else{_0x77a387=_['find'](_0x4542e6,[_0x999e('0x2f'),_0x999e('0x40')]);_0x7f9dfe[_0x999e('0x54')]=_0x999e('0x40');_0x1f0dc3=as[_0x999e('0x7a')](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value'][_0x999e('0x7b')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x76')]);}break;case'body':_0x1f0dc3=as[_0x999e('0x7a')]('me',null,_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3['value'][_0x999e('0x7b')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x76')]);break;}}else{var _0x1f0dc3=as[_0x999e('0x7a')](_0xcc200b,_0x77a387[_0x999e('0x45')],_0x7f9dfe);_0xe35369[_0x470e51](_0x1f0dc3[_0x999e('0x75')],_0x1f0dc3[_0x999e('0x6d')][_0x999e('0x7b')],_0x1f0dc3['value'][_0x999e('0x76')]);}}}else{var _0x21a712=_(_0x5a7366[_0x999e('0x4e')])['keys']()[_0x999e('0x42')](function(_0x48e0ca){return _[_0x999e('0x7c')](_0x4542e6,[_0x999e('0x2f'),_0x48e0ca])?_0x48e0ca:undefined;})[_0x999e('0x7d')]()['value']();if(!_[_0x999e('0x7e')](_0x21a712)){_0x21a712[_0x999e('0x7f')](function(_0x1d6b40){if(_0x1d6b40===_0x999e('0x80')){_0xefd231[_0x999e('0x50')](_0x999e('0x81'),[]['concat'](_0x5a7366[_0x999e('0x4e')][_0x1d6b40]));}else if(_0x1d6b40==='createdAt'){var _0x34f25c=JSON['parse'](_0x5a7366['query'][_0x1d6b40])[_0x999e('0x82')];var _0x5d136c=JSON[_0x999e('0x83')](_0x5a7366[_0x999e('0x4e')][_0x1d6b40])['$lte'];_0xefd231[_0x999e('0x50')](_0x999e('0x84'),_0x34f25c,_0x5d136c);}else{if(_0x5a7366['query'][_0x1d6b40]===_0x999e('0x85')){_0xefd231[_0x999e('0x50')]('i.'+_0x1d6b40+_0x999e('0x86'));}else{_0xefd231[_0x999e('0x50')]('i.'+_0x1d6b40+_0x999e('0x87'),_0x5a7366[_0x999e('0x4e')][_0x1d6b40]);}}});}if(_0x5a7366[_0x999e('0x4e')][_0x999e('0x88')]){if(_0x5a7366['query']['read']==0x1){_0xefd231[_0x999e('0x6e')](_0x999e('0x89'));}else{_0xefd231[_0x999e('0x6e')](_0x999e('0x8a'));}}if(_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')]){_0x2ce0b3=_['isArray'](_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')])?_0x5a7366['query'][_0x999e('0x8b')]:new Array(_0x5a7366[_0x999e('0x4e')][_0x999e('0x8b')]);_0x2ce0b3['forEach'](function(_0x389520){_0x25f6a6['or'](_0x999e('0x8c'),'%,'+_0x389520+',%');});}if(_0x5a7366[_0x999e('0x4e')]['filter']){var _0x216040=_0x5a7366[_0x999e('0x4e')][_0x999e('0x8d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x999e('0x8e')](_0x216040)){_0xe35369['or']('i.id\x20LIKE\x20?',_0x216040+'%');}else{_0xe35369['or'](_0x999e('0x8f'),qs[_0x999e('0x73')](_0x216040))['or'](_0x999e('0x90'),_0x216040+'%');}}}_0xefd231[_0x999e('0x50')](_0xe35369);_0xefd231[_0x999e('0x91')](_0x999e('0x92'));var _0x43043a={'type':db['Sequelize'][_0x999e('0x93')]['SELECT'],'raw':!![]};var _0x5a65c8=_0xefd231[_0x999e('0x94')]();_0x5a65c8[_0x999e('0x54')](_0x999e('0x92'));_0x5a65c8[_0x999e('0x54')](_0x999e('0x95'),_0x999e('0x6c'));if(_0xc89b1['order']){_0xc89b1[_0x999e('0x96')]['forEach'](function(_0x302161){var _0x1f39c0=_0x302161[0x0]===_0x999e('0x97')?_0x302161[0x0]:'i.'+_0x302161[0x0];_0xefd231['order'](_0x1f39c0,_0x302161[0x1]===_0x999e('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x2ce0b3)){_0xefd231[_0x999e('0x6e')](_0x25f6a6);_0x5a65c8[_0x999e('0x50')](_0x999e('0x99'),_0x2ce0b3);}BPromise[_0x999e('0x9a')]()[_0x999e('0x2c')](function(){if(!_0x53cfbc){if(_0x5a7366['query']['ChatWebsiteId'])return;_0x5a65c8[_0x999e('0x50')](_0x999e('0x9b'));_0xefd231[_0x999e('0x50')](_0x999e('0x9b'));return;}if(_0x5a7366[_0x999e('0x9c')][_0x999e('0x9d')]!==_0x999e('0x9e'))return;return _0x5a7366[_0x999e('0x9c')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x999e('0x2c')](function(_0xaed39c){if(_[_0x999e('0x7e')](_0xaed39c)){_0x5a65c8[_0x999e('0x50')](_0x999e('0x9f'));_0xefd231[_0x999e('0x50')](_0x999e('0x9f'));}else{_0x5a65c8[_0x999e('0x50')]('i.ChatWebsiteId\x20IN\x20?',_[_0x999e('0x42')](_0xaed39c,'id'));_0xefd231[_0x999e('0x50')](_0x999e('0x81'),_[_0x999e('0x42')](_0xaed39c,'id'));}});})[_0x999e('0x2c')](function(){if(_0x5a7366[_0x999e('0x9c')][_0x999e('0x9d')]===_0x999e('0x9e')&&!_0x53cfbc&&!_0x5a7366['query'][_0x999e('0x80')])return[];return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x5a65c8['toString'](),_0x43043a);})[_0x999e('0x2c')](function(_0x3edea2){_0x5e50f5[_0x999e('0x28')]=_0x3edea2[_0x999e('0x4c')];if(_0x5e50f5[_0x999e('0x28')]===0x0)return[];return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x428842[_0x999e('0xa1')](),_0x43043a)[_0x999e('0x2c')](function(_0x4ee1d4){_0x334d19=_[_0x999e('0xa2')](_0x4ee1d4,'id');_0x43043a=_[_0x999e('0x31')](_0x43043a,{'model':db[_0x999e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a7366['query']['fields']){_0xc89b1[_0x999e('0x4a')][_0x999e('0x7f')](function(_0x421f60){_0xefd231['field']('i.'+_0x421f60);});}else{_0xefd231[_0x999e('0x54')](_0x999e('0x95'),_0x999e('0x6c'));_0xefd231['field'](_0x999e('0xa3'),_0x999e('0xa4'));_0xefd231['field'](_0x999e('0xa5'),'Account.mandatoryDisposition');_0xefd231['field'](_0x999e('0xa6'),_0x999e('0x97'));_0xefd231[_0x999e('0x54')](_0x999e('0xa7'));_0xefd231['field'](_0x999e('0xa8'),_0x999e('0xa9'));_0xefd231[_0x999e('0x54')](_0x999e('0xaa'),_0x999e('0xab'));_0xefd231['field'](_0x999e('0xac'),_0x999e('0xad'));_0xefd231[_0x999e('0x54')]('c.phone',_0x999e('0xae'));_0xefd231[_0x999e('0x54')](_0x999e('0xaf'),_0x999e('0xb0'));_0xefd231[_0x999e('0x54')](_0x999e('0xb1'),_0x999e('0xb2'));_0xefd231[_0x999e('0x54')]('o.fullname',_0x999e('0xb3'));_0xefd231[_0x999e('0x54')](_0x999e('0xb4'),_0x999e('0xb5'));_0xefd231['field'](_0x999e('0xb6'),_0x999e('0x39'));}if(_0xc89b1[_0x999e('0x27')])_0xefd231[_0x999e('0x27')](_0xc89b1[_0x999e('0x27')]);if(_0xc89b1['offset'])_0xefd231[_0x999e('0x25')](_0xc89b1[_0x999e('0x25')]);return db[_0x999e('0xa0')][_0x999e('0x4e')](_0xefd231[_0x999e('0xa1')](),_0x43043a);})[_0x999e('0x2c')](function(_0x5ca126){if(_0x5ca126['length']>0x0)_0x392324[_0x999e('0x50')](_0x999e('0xb7'),_['map'](_0x5ca126,'id'));return db[_0x999e('0xa0')][_0x999e('0x4e')](_0x392324['toString'](),_0x43043a)[_0x999e('0x2c')](function(_0x230dd6){var _0x131123=_[_0x999e('0xb8')](_0x230dd6,_0x999e('0xb9'));var _0x5e2f44=[];_0x5ca126[_0x999e('0x7f')](function(_0x33edad){_0x5e2f44[_0x999e('0x38')](updateChatInteraction(_0x33edad,_0x334d19,_0x131123));});return BPromise[_0x999e('0xba')](_0x5e2f44);});});})[_0x999e('0x2c')](function(_0x9361d5){_0x5e50f5[_0x999e('0xbb')]=_0x9361d5;return _0x5e50f5;})['then'](respondWithFilteredResult(_0x4f904e,_0xc89b1))[_0x999e('0x21')](handleError(_0x4f904e,null));};exports['show']=function(_0x2dfa8d,_0xd93cfb){var _0x2c9520={'raw':![],'where':{'id':_0x2dfa8d[_0x999e('0xbc')]['id']}},_0x2bcab1={};_0x2bcab1[_0x999e('0x49')]=_[_0x999e('0x47')](db[_0x999e('0x43')][_0x999e('0xbd')]);_0x2bcab1['query']=_[_0x999e('0x47')](_0x2dfa8d['query']);_0x2bcab1[_0x999e('0x51')]=_['intersection'](_0x2bcab1[_0x999e('0x49')],_0x2bcab1['query']);_0x2c9520['attributes']=_[_0x999e('0x48')](_0x2bcab1[_0x999e('0x49')],qs['fields'](_0x2dfa8d['query'][_0x999e('0x4b')]));_0x2c9520[_0x999e('0x4a')]=_0x2c9520[_0x999e('0x4a')][_0x999e('0x4c')]?_0x2c9520[_0x999e('0x4a')]:_0x2bcab1['model'];if(_0x2dfa8d[_0x999e('0x4e')]['includeAll']){_0x2c9520[_0x999e('0xbe')]=[{'all':!![]}];}_0x2c9520=_[_0x999e('0x31')]({},_0x2c9520,_0x2dfa8d[_0x999e('0xbf')]);return db[_0x999e('0x43')]['find'](_0x2c9520)[_0x999e('0x2c')](handleEntityNotFound(_0xd93cfb,null))[_0x999e('0x2c')](respondWithResult(_0xd93cfb,null))[_0x999e('0x21')](handleError(_0xd93cfb,null));};exports[_0x999e('0xc0')]=function(_0xf51d13,_0x1304f2){return db[_0x999e('0x43')][_0x999e('0xc0')](_0xf51d13[_0x999e('0xc1')],{})['then'](respondWithResult(_0x1304f2,0xc9))[_0x999e('0x21')](handleError(_0x1304f2,null));};exports[_0x999e('0x2b')]=function(_0x2fd5cd,_0x39dfbc){if(_0x2fd5cd[_0x999e('0xc1')]['id']){delete _0x2fd5cd[_0x999e('0xc1')]['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x2fd5cd['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x39dfbc,null))['then'](saveUpdates(_0x2fd5cd[_0x999e('0xc1')],null))[_0x999e('0x2c')](respondWithResult(_0x39dfbc,null))['catch'](handleError(_0x39dfbc,null));};exports[_0x999e('0x2d')]=function(_0x1daa73,_0x27c5d9){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x1daa73['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x27c5d9,null))['then'](removeEntity(_0x27c5d9,null))['catch'](handleError(_0x27c5d9,null));};exports[_0x999e('0xc2')]=function(_0x16b8f4,_0x1a8269){return db['ChatInteraction'][_0x999e('0xc2')]()[_0x999e('0x2c')](respondWithResult(_0x1a8269,null))[_0x999e('0x21')](handleError(_0x1a8269,null));};exports[_0x999e('0xc3')]=function(_0x28a9fe,_0x191506){var _0x392488=_0x28a9fe['params']['id'];var _0xe325ef;var _0x3bacb4;var _0x5e0400;return db[_0x999e('0x43')]['findOne']({'where':{'id':_0x392488}})[_0x999e('0x2c')](function(_0xc1a8ce){_0xe325ef=_0xc1a8ce;return db['ChatWebsite']['findOne']({'where':{'id':_0xc1a8ce['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0x999e('0xc4'),_0x999e('0xc5')],'raw':!![]});})[_0x999e('0x2c')](function(_0x1b1716){if(_0x1b1716&&_0x1b1716[_0x999e('0xc6')]&&_0x1b1716[_0x999e('0xc7')]){_0x3bacb4=_0x1b1716;var _0xf8fb4={'interaction':{'id':_0x392488},'agent':{'id':_0x28a9fe[_0x999e('0x9c')]['id'],'name':_0x28a9fe[_0x999e('0x9c')][_0x999e('0x2f')],'fullname':_0x28a9fe['user'][_0x999e('0x35')],'email':_0x28a9fe[_0x999e('0x9c')][_0x999e('0xc8')]},'contact':_0x28a9fe[_0x999e('0xc1')][_0x999e('0xc9')],'account':_0x28a9fe[_0x999e('0xc1')][_0x999e('0x33')]};var _0x2b9b50={'rejectUnauthorized':![],'method':_0x999e('0xca'),'url':_0x999e('0xcb'),'headers':{'X-APIKEY':_0x1b1716[_0x999e('0xc6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x28a9fe[_0x999e('0x9c')][_0x999e('0xc8')]],'buttons':null,'topic':_0x3bacb4[_0x999e('0xcc')],'note':_[_0x999e('0xcd')](_0x3bacb4[_0x999e('0xc4')])?null:getMustacheRender(_0x3bacb4['vidaooNote'],_0xf8fb4),'metadata':null},'redirect':_0x999e('0xce'),'json':!![]};try{if(!_['isNull'](_0x3bacb4['vidaooMetadata'])){var _0x20812f=getMustacheRender(_0x3bacb4['vidaooMetadata'],_0xf8fb4);var _0x459142=JSON['parse'](_0x20812f);_0x2b9b50[_0x999e('0xc1')]['metadata']=_0x459142;}}catch(_0x13caa5){throw new db['Sequelize'][(_0x999e('0xcf'))](_0x999e('0xd0'));}return rp(_0x2b9b50);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x999e('0x2c')](function(_0x2b8609){_0x5e0400=_0x2b8609;if(_0x5e0400['id']){var _0x1c324d={'body':_0x5e0400['join_url'],'ChatWebsiteId':_0x3bacb4['id'],'ChatInteractionId':_0xe325ef['id'],'direction':'out','UserId':_0x28a9fe[_0x999e('0x9c')]['id']};return db['ChatMessage'][_0x999e('0xc0')](_0x1c324d,{});}else{throw new db[(_0x999e('0xd1'))][(_0x999e('0xcf'))](_0x999e('0xd2'));}})[_0x999e('0x2c')](function(){return _0xe325ef[_0x999e('0xd3')]({'vidaooSessionId':_0x5e0400['id']});})[_0x999e('0x2c')](respondWithResult(_0x191506,null))[_0x999e('0x21')](handleError(_0x191506,null));};exports[_0x999e('0xd4')]=function(_0x2034f3,_0x4b9ec3){if(_0x2034f3[_0x999e('0xc1')]['id']){delete _0x2034f3['body']['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x2034f3['params']['id']},'include':[{'model':db[_0x999e('0xd5')],'as':_0x999e('0x70')}]})[_0x999e('0x2c')](handleEntityNotFound(_0x4b9ec3,null))[_0x999e('0x2c')](saveUpdates(_0x2034f3['body'],null))[_0x999e('0x2c')](respondWithResult(_0x4b9ec3,null))[_0x999e('0x21')](handleError(_0x4b9ec3,null));};exports[_0x999e('0xd6')]=function(_0x457f07,_0x4da13d){if(_0x457f07['body']['id']){delete _0x457f07[_0x999e('0xc1')]['id'];}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x457f07[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](function(_0x2e9dd0){if(!_0x2e9dd0){logger['error'](_0x999e('0xd7'),_0x999e('0xd6'),0x194,'entity\x20not\x20found');_0x4da13d['sendStatus'](0x194);}else{if(_0x2e9dd0[_0x999e('0x40')]){throw new db[(_0x999e('0xd1'))][(_0x999e('0xcf'))]('Interaction\x20already\x20assigned');}}return _0x2e9dd0;})[_0x999e('0x2c')](function(_0x1c1a62){if(_0x1c1a62){return _0x1c1a62[_0x999e('0x2b')]({'closed':_0x457f07[_0x999e('0xc1')]['closed'],'disposition':_0x457f07[_0x999e('0xc1')][_0x999e('0x41')]})[_0x999e('0x2c')](function(_0x5a04d3){return _0x5a04d3;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x999e('0xd6'),_0x457f07['body'],client9004);})[_0x999e('0x2c')](respondWithResult(_0x4da13d,null))[_0x999e('0x21')](handleError(_0x4da13d,null));};exports[_0x999e('0xd8')]=function(_0x27978d,_0x31c0c3){_0x27978d[_0x999e('0xc1')][_0x999e('0x2f')]=_0x27978d[_0x999e('0xd9')]['originalname'];_0x27978d['body'][_0x999e('0xda')]=_0x27978d[_0x999e('0xd9')]['filename'];_0x27978d[_0x999e('0xc1')]['type']=_0x27978d['file'][_0x999e('0xdb')];return db[_0x999e('0xdc')][_0x999e('0xc0')](_0x27978d[_0x999e('0xc1')])[_0x999e('0x2c')](respondWithResult(_0x31c0c3,0xc9))[_0x999e('0x21')](handleError(_0x31c0c3,null));};exports[_0x999e('0xdd')]=function(_0x3131a2,_0x31fa6c){return db[_0x999e('0x43')][_0x999e('0xde')]({'where':{'id':_0x3131a2['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x31fa6c,null))[_0x999e('0x2c')](function(_0x41b122){if(_0x41b122){if(_0x41b122['closed']){return _0x31fa6c[_0x999e('0x23')](0x193)['json']({'status':0x193,'message':_0x999e('0xdf')});}return db[_0x999e('0xdc')][_0x999e('0xde')]({'where':{'id':_0x3131a2['query'][_0x999e('0xe0')]},'raw':!![]})[_0x999e('0x2c')](handleEntityNotFound(_0x31fa6c,null));}})[_0x999e('0x2c')](function(_0x1b0128){if(_0x1b0128){var _0x10ea96=_0x1b0128['ChatOfflineMessageId']!==null;var _0x5d0f54=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0xe3'));if(_0x10ea96){_0x5d0f54=path[_0x999e('0xe1')](_0x5d0f54,_0x999e('0xe4'));}var _0xc91cf5=path[_0x999e('0xe1')](_0x5d0f54,_0x1b0128[_0x999e('0xda')]);return _0x31fa6c['download'](_0xc91cf5);}})[_0x999e('0x21')](handleError(_0x31fa6c,null));};exports[_0x999e('0xe5')]=function(_0x3cf88d,_0x31ff46){var _0x24bfd1=null;var _0x1a2a5e=null;var _0x57529d=null;if(_0x3cf88d['body']['id']){delete _0x3cf88d[_0x999e('0xc1')]['id'];}if(_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')]){_0x57529d=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0xe7'),util[_0x999e('0xe8')](_0x999e('0xe9'),Date[_0x999e('0xea')]()));_0x3cf88d[_0x999e('0xc1')][_0x999e('0xeb')]=_0x57529d;}return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x3cf88d['params']['id']},'include':[{'model':db[_0x999e('0xec')],'as':_0x999e('0xed'),'include':[{'model':db['User'],'as':_0x999e('0x78')}]}]})[_0x999e('0x2c')](handleEntityNotFound(_0x31ff46,null))[_0x999e('0x2c')](saveUpdates(_0x3cf88d[_0x999e('0xc1')],null))[_0x999e('0x2c')](function(_0x2f793c){if(_0x2f793c){_0x24bfd1=_0x2f793c;return db[_0x999e('0xee')][_0x999e('0x6b')]({'where':{'id':_0x24bfd1['ChatWebsiteId']}});}})[_0x999e('0x2c')](function(_0x459bbe){if(_0x459bbe){_0x1a2a5e=_0x459bbe;return db['CmContact'][_0x999e('0x6b')]({'where':{'id':_0x24bfd1[_0x999e('0x74')]}});}})[_0x999e('0x2c')](function(_0x2091a3){if(_0x2091a3){if(_0x57529d){var _0x5c51f9=null;for(var _0x572d81=0x1;_0x572d81<_0x24bfd1[_0x999e('0xed')][_0x999e('0x4c')];++_0x572d81){_0x5c51f9=_0x24bfd1[_0x999e('0xed')][_0x572d81];var _0x298c2c=_0x5c51f9['UserId']?util['format'](_0x999e('0xef'),_0x1a2a5e['agentAlias'],_0x5c51f9['UserId']):_0x999e('0xf0');var _0x53d3f1=_0x3cf88d['body'][_0x999e('0xf1')]||util['format'](_0x999e('0xef'),_0x999e('0xf2'),_0x5c51f9[_0x999e('0x74')]);switch(_0x1a2a5e[_0x999e('0xf3')]){case _0x999e('0xf4'):_0x298c2c=_0x5c51f9['UserId']?util[_0x999e('0xe8')]('%s%d',_0x1a2a5e[_0x999e('0xf5')],_0x5c51f9[_0x999e('0x40')]):_0x999e('0xf0');break;case _0x999e('0xf6'):_0x298c2c=_0x5c51f9[_0x999e('0x40')]?_0x5c51f9[_0x999e('0x78')]['alias']||_0x5c51f9[_0x999e('0x78')][_0x999e('0x35')]:_0x999e('0xf0');break;case _0x999e('0xf7'):_0x298c2c=_0x5c51f9[_0x999e('0x40')]?_0x5c51f9[_0x999e('0x78')]['fullname']:_0x999e('0xf0');break;default:_0x298c2c=_0x5c51f9[_0x999e('0x40')]?util['format'](_0x999e('0xef'),_0x1a2a5e[_0x999e('0xf5')],_0x5c51f9[_0x999e('0x40')]):'System';}var _0x18b2aa=util[_0x999e('0xe8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x5c51f9['createdAt'])[_0x999e('0xe8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x5c51f9[_0x999e('0xf8')]==='in'?_0x53d3f1:_0x298c2c,_0x5c51f9[_0x999e('0xc1')]);if(!_0x5c51f9[_0x999e('0xf9')]){fs[_0x999e('0xfa')](_0x57529d,_0x18b2aa);}}return db[_0x999e('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x999e('0xfc'),'raw':!![],'include':[{'model':db[_0x999e('0xfd')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x999e('0x2c')](function(_0x2e9c95){if(!_0x2e9c95||!_0x2e9c95['Smtp']||!_0x3cf88d[_0x999e('0xc1')])return _0x24bfd1;var _0x4cf199=_0x2e9c95['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x999e('0xfe'),{'account':_0x4cf199,'message':{'from':util[_0x999e('0xe8')]('\x22%s\x22\x20<%s>',_0x2e9c95['name'],_0x2e9c95['email']||_0x2e9c95[_0x999e('0xfc')]['user']),'to':_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')],'subject':_0x999e('0xff'),'text':util[_0x999e('0xe8')](_0x999e('0x100'),_0x3cf88d[_0x999e('0xc1')][_0x999e('0xe6')]),'attachments':[{'path':_0x57529d}]}})[_0x999e('0x2c')](function(){return _0x24bfd1;})['catch'](function(_0x4a32f7){logger[_0x999e('0x1c')](_0x4a32f7);});})[_0x999e('0x2c')](respondWithStatusCode(_0x31ff46,0xc8))[_0x999e('0x21')](handleError(_0x31ff46,null));};exports[_0x999e('0x101')]=function(_0x55b0e5,_0x516a01){return db[_0x999e('0xec')][_0x999e('0x6b')]({'where':{'id':_0x55b0e5[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x516a01,null))[_0x999e('0x2c')](function(_0x51966e){if(_0x51966e){return _0x51966e[_0x999e('0x101')](_0x55b0e5[_0x999e('0xc1')][_0x999e('0x102')],_['omit'](_0x55b0e5[_0x999e('0xc1')],[_0x999e('0x102'),'id'])||{});}})['then'](respondWithResult(_0x516a01,null))['catch'](handleError(_0x516a01,null));};exports[_0x999e('0x103')]=function(_0x51bffa,_0x542b39){var _0x237a69={'raw':![],'where':{}};var _0x3729e1={};var _0x4f1e06={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x51bffa['params']['id']}})['then'](handleEntityNotFound(_0x542b39,null))['then'](function(_0xd62f58){if(_0xd62f58){_0x3729e1[_0x999e('0x49')]=_[_0x999e('0x47')](db['ChatMessage'][_0x999e('0xbd')]);_0x3729e1[_0x999e('0x4e')]=_[_0x999e('0x47')](_0x51bffa['query']);_0x3729e1[_0x999e('0x51')]=_[_0x999e('0x48')](_0x3729e1[_0x999e('0x49')],_0x3729e1[_0x999e('0x4e')]);_0x237a69[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x3729e1['model'],qs[_0x999e('0x4b')](_0x51bffa['query'][_0x999e('0x4b')]));_0x237a69[_0x999e('0x4a')]=_0x237a69[_0x999e('0x4a')][_0x999e('0x4c')]?_0x237a69[_0x999e('0x4a')]:_0x3729e1[_0x999e('0x49')];if(!_0x51bffa['query'][_0x999e('0x4d')](_0x999e('0x104'))){_0x237a69['limit']=qs[_0x999e('0x27')](_0x51bffa['query']['limit']);_0x237a69[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x51bffa[_0x999e('0x4e')]['offset']);}_0x237a69['order']=qs[_0x999e('0x4f')](_0x51bffa[_0x999e('0x4e')][_0x999e('0x4f')]);_0x237a69[_0x999e('0x50')]=qs[_0x999e('0x51')](_['pick'](_0x51bffa[_0x999e('0x4e')],_0x3729e1[_0x999e('0x51')]));_0x237a69[_0x999e('0x50')][_0x999e('0xb9')]=_0xd62f58['id'];if(_0x51bffa[_0x999e('0x4e')]['filter']){_0x237a69[_0x999e('0x50')]=_[_0x999e('0x31')](_0x237a69[_0x999e('0x50')],{'$or':_[_0x999e('0x42')](_0x237a69['attributes'],function(_0x1dcd99){var _0x4a4cae={};_0x4a4cae[_0x1dcd99]={'$like':'%'+_0x51bffa[_0x999e('0x4e')][_0x999e('0x8d')]+'%'};return _0x4a4cae;})});}if(_0x51bffa['query']['$gte']){var _0x2c7f82=_0x51bffa[_0x999e('0x4e')][_0x999e('0x82')][_0x999e('0x37')](',');var _0x118c1e={};_0x118c1e[_0x2c7f82[0x0]]={'$gte':moment(_0x2c7f82[0x1])['format'](_0x999e('0x105'))};_0x237a69[_0x999e('0x50')]=_[_0x999e('0x31')](_0x237a69['where'],_0x118c1e);}_0x237a69=_[_0x999e('0x31')]({},_0x237a69,_0x51bffa['options']);return db[_0x999e('0xec')][_0x999e('0x28')]({'where':_0x237a69[_0x999e('0x50')]})[_0x999e('0x2c')](function(_0x597a35){_0x4f1e06['count']=_0x597a35;if(_0x51bffa[_0x999e('0x4e')][_0x999e('0x106')]){_0x237a69[_0x999e('0xbe')]=[{'all':!![]}];}return db[_0x999e('0xec')][_0x999e('0x107')](_0x237a69);})[_0x999e('0x2c')](function(_0x139487){_0x4f1e06['rows']=_0x139487;return _0x4f1e06;});}})[_0x999e('0x2c')](respondWithFilteredResult(_0x542b39,_0x237a69))['catch'](handleError(_0x542b39,null));};exports['getMyMessages']=function(_0x10d312,_0x1f19d0){var _0xf9a5ff={'where':{}},_0x3163f1={},_0x377931={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x999e('0xde')]({'where':{'id':_0x10d312[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x1f19d0,null))[_0x999e('0x2c')](function(_0x4f8e5c){if(_0x4f8e5c){_0x3163f1[_0x999e('0x49')]=_[_0x999e('0x47')](db[_0x999e('0xec')]['rawAttributes']);_0x3163f1[_0x999e('0x4e')]=_[_0x999e('0x47')](_0x10d312[_0x999e('0x4e')]);_0x3163f1[_0x999e('0x51')]=_['intersection'](_0x3163f1[_0x999e('0x49')],_0x3163f1[_0x999e('0x4e')]);_0xf9a5ff[_0x999e('0x4a')]=_[_0x999e('0x48')](_0x3163f1[_0x999e('0x49')],qs[_0x999e('0x4b')](_0x10d312[_0x999e('0x4e')][_0x999e('0x4b')]));_0xf9a5ff['attributes']=_0xf9a5ff[_0x999e('0x4a')]['length']?_0xf9a5ff['attributes']:_0x3163f1[_0x999e('0x49')];if(!_0x10d312[_0x999e('0x4e')][_0x999e('0x4d')](_0x999e('0x104'))){_0xf9a5ff['limit']=qs[_0x999e('0x27')](_0x10d312[_0x999e('0x4e')]['limit']);_0xf9a5ff[_0x999e('0x25')]=qs[_0x999e('0x25')](_0x10d312[_0x999e('0x4e')][_0x999e('0x25')]);}_0xf9a5ff[_0x999e('0x96')]=qs['sort'](_0x10d312[_0x999e('0x4e')]['sort']);_0xf9a5ff[_0x999e('0x50')]=qs[_0x999e('0x51')](_[_0x999e('0x52')](_0x10d312[_0x999e('0x4e')],_0x3163f1[_0x999e('0x51')]));_0xf9a5ff[_0x999e('0x50')][_0x999e('0xb9')]=_0x4f8e5c['id'];if(_0x10d312[_0x999e('0x4e')]['filter']){_0xf9a5ff[_0x999e('0x50')]=_[_0x999e('0x31')](_0xf9a5ff['where'],{'$or':_[_0x999e('0x42')](_0xf9a5ff['attributes'],function(_0x1db16c){var _0x4c6fad={};_0x4c6fad[_0x1db16c]={'$like':'%'+_0x10d312['query'][_0x999e('0x8d')]+'%'};return _0x4c6fad;})});}_0xf9a5ff[_0x999e('0x50')]['secret']=![];if(_0x10d312[_0x999e('0x4e')]['id']){_0xf9a5ff[_0x999e('0x50')]['id']={'$gt':_0x10d312[_0x999e('0x4e')]['id']};}_0xf9a5ff=_[_0x999e('0x31')]({},_0xf9a5ff,_0x10d312[_0x999e('0xbf')]);return db[_0x999e('0xec')][_0x999e('0x28')]({'where':_0xf9a5ff[_0x999e('0x50')]})['then'](function(_0x1a5fc2){_0x377931[_0x999e('0x28')]=_0x1a5fc2;_0xf9a5ff['include']=[];if(_0x10d312['query'][_0x999e('0x108')]){_0xf9a5ff['include'][_0x999e('0x38')]({'model':db[_0x999e('0x78')],'as':_0x999e('0x78'),'attributes':['id',_0x999e('0x35'),'alias']});}if(_0x10d312['query'][_0x999e('0x106')]){_0xf9a5ff[_0x999e('0xbe')]=[{'all':!![]}];}return db[_0x999e('0xec')][_0x999e('0x107')](_0xf9a5ff);})[_0x999e('0x2c')](function(_0x359277){_0x377931[_0x999e('0xbb')]=_0x359277;return _0x377931;});}})[_0x999e('0x2c')](respondWithFilteredResult(_0x1f19d0,_0xf9a5ff))['catch'](handleError(_0x1f19d0,null));};exports[_0x999e('0x109')]=function(_0x16323c,_0x4da0bc){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x16323c['params']['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x4da0bc,null))[_0x999e('0x2c')](function(_0x2707dc){if(_0x2707dc){return _0x2707dc[_0x999e('0x10a')](_0x16323c['body'][_0x999e('0x102')],_['omit'](_0x16323c[_0x999e('0xc1')],[_0x999e('0x102'),'id'])||{})[_0x999e('0x10b')](function(){return db['Tag']['findAll']({'attributes':['id',_0x999e('0x2f'),_0x999e('0x55')],'where':{'id':_0x16323c['body'][_0x999e('0x102')]}});})[_0x999e('0x2c')](function(_0x392d35){socket[_0x999e('0x10c')]('chatInteractionTags:save',{'id':Number(_0x16323c[_0x999e('0xbc')]['id']),'tags':_0x392d35||[]});return{'id':Number(_0x16323c['params']['id']),'tags':_0x392d35||[]};});}})[_0x999e('0x2c')](respondWithResult(_0x4da0bc,null))[_0x999e('0x21')](handleError(_0x4da0bc,null));};exports[_0x999e('0x10d')]=function(_0x3a63f5,_0x201add){return db[_0x999e('0x43')][_0x999e('0x6b')]({'where':{'id':_0x3a63f5[_0x999e('0xbc')]['id']}})[_0x999e('0x2c')](handleEntityNotFound(_0x201add,null))['then'](function(_0x563457){if(_0x563457){return _0x563457['removeTags'](_0x3a63f5['query']['ids']);}})[_0x999e('0x2c')](respondWithStatusCode(_0x201add,null))[_0x999e('0x21')](handleError(_0x201add,null));};exports[_0x999e('0x10e')]=function(_0x35c0e4,_0x49af7d){var _0x49ce92=moment()[_0x999e('0x10f')]()[_0x999e('0xa1')]();var _0x21ecc2=path['join'](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x111'),_0x999e('0x112'));var _0x3c0a39=path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x111'),_0x999e('0x113'));var _0x375777=path[_0x999e('0xe1')](_0x21ecc2,_0x49ce92);var _0x34323f=util[_0x999e('0xe8')]('transcript-%d-%s.zip',_0x35c0e4[_0x999e('0xbc')]['id'],_0x49ce92);var _0x527d6d=path[_0x999e('0xe1')](_0x21ecc2,_0x34323f);var _0x2b3e01=[];_0x2b3e01[_0x999e('0x38')]({'model':db['User'],'as':_0x999e('0x78'),'attributes':['id',_0x999e('0x35')],'raw':!![]});_0x2b3e01[_0x999e('0x38')]({'model':db[_0x999e('0xd5')],'as':_0x999e('0x70'),'attributes':['id','firstName',_0x999e('0x114')],'raw':!![]});if(_0x35c0e4[_0x999e('0x4e')][_0x999e('0x113')]){_0x2b3e01[_0x999e('0x38')]({'model':db[_0x999e('0xdc')],'as':_0x999e('0xdc'),'raw':!![]});}var _0x1c7b1e=[{'model':db['ChatMessage'],'as':_0x999e('0xed'),'attributes':['id',_0x999e('0xc1'),_0x999e('0x115'),_0x999e('0xf8'),_0x999e('0xf9'),_0x999e('0x88')],'include':_0x2b3e01}];_0x1c7b1e['push']({'model':db['ChatWebsite'],'as':_0x999e('0x116'),'attributes':['id','name']});_0x1c7b1e[_0x999e('0x38')]({'model':db[_0x999e('0x78')],'as':_0x999e('0x117'),'attributes':['id',_0x999e('0x35')]});return db['ChatInteraction'][_0x999e('0x6b')]({'where':{'id':_0x35c0e4['params']['id']},'include':_0x1c7b1e})[_0x999e('0x2c')](handleEntityNotFound(_0x49af7d,null))[_0x999e('0x2c')](function(_0x2d29ee){if(_0x2d29ee){var _0x14350e=_0x2d29ee[_0x999e('0x118')]({'plain':!![]});fs[_0x999e('0x119')](_0x375777);var _0x256c4c={'channel':_0x999e('0x11a'),'account':_0x14350e[_0x999e('0x116')][_0x999e('0x2f')],'agent':_0x14350e[_0x999e('0x117')]?_0x14350e[_0x999e('0x117')][_0x999e('0x35')]:_0x999e('0x11b'),'createdAt':moment(_0x14350e[_0x999e('0x115')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x14350e[_0x999e('0x3f')]?moment(_0x14350e[_0x999e('0x11c')])[_0x999e('0xe8')](_0x999e('0x105'))[_0x999e('0xa1')]():'','disposition':_0x14350e['disposition'],'chatInfo':{'browser':_0x14350e[_0x999e('0x11d')],'os':_0x14350e[_0x999e('0x11e')],'referer':_0x14350e[_0x999e('0x11f')],'customerIp':_0x14350e[_0x999e('0x120')],'customerPort':_0x14350e[_0x999e('0x121')]?_0x14350e[_0x999e('0x121')]:_0x999e('0x11b')},'messages':_(_0x14350e[_0x999e('0xed')])[_0x999e('0x122')]()[_0x999e('0x8d')]({'secret':![]})['map'](function(_0x2ec1e4){if(_0x2ec1e4[_0x999e('0xdc')]){var _0x5b7284=path[_0x999e('0xe1')](_0x3c0a39,_0x2ec1e4[_0x999e('0xdc')][_0x999e('0xda')]);if(fs[_0x999e('0x123')](_0x5b7284)){fs['createReadStream'](_0x5b7284)['pipe'](fs[_0x999e('0x124')](path['join'](_0x375777,_0x2ec1e4['Attachment']['basename'])));}}return{'date':moment(_0x2ec1e4[_0x999e('0x115')])[_0x999e('0xe8')](_0x999e('0x105'))[_0x999e('0xa1')](),'sender':_0x2ec1e4['direction']==='out'?_0x2ec1e4[_0x999e('0x78')]?_0x2ec1e4[_0x999e('0x78')]['fullname']:_0x999e('0xf0'):_0x2ec1e4['Contact']['firstName']+(_0x2ec1e4[_0x999e('0x70')][_0x999e('0x114')]?'\x20'+_0x2ec1e4[_0x999e('0x70')]['lastName']:''),'body':_0x2ec1e4[_0x999e('0xdc')]?_0x2ec1e4[_0x999e('0xdc')]['basename']:_0x2ec1e4[_0x999e('0xc1')],'direction':_0x2ec1e4['direction']===_0x999e('0x125')?'A':'C','secret':_0x2ec1e4['secret'],'read':_0x2ec1e4[_0x999e('0x88')],'attachment':_0x2ec1e4[_0x999e('0xdc')]};})[_0x999e('0x6d')]()};return ejs[_0x999e('0x126')](path[_0x999e('0xe1')](config[_0x999e('0xe2')],_0x999e('0x110'),_0x999e('0x127'),_0x999e('0x128')),{'interaction':_0x256c4c})[_0x999e('0x2c')](function(_0x17fff9){var _0x33763d=path[_0x999e('0xe1')](_0x375777,_0x999e('0x129')+_0x14350e['id']+'-'+_0x49ce92+_0x999e('0x12a'));var _0x29aeb7={'path':_0x33763d,'channel':'Chat','interactionId':_0x14350e['id']};return pdf[_0x999e('0x12b')](_0x17fff9,_0x29aeb7);})[_0x999e('0x2c')](function(){return new Promise(function(_0x1bebaf,_0x3cf4aa){zipdir(_0x375777,{'saveTo':_0x527d6d},function(_0x3141f3,_0x2c56b5){if(_0x3141f3)return _0x3cf4aa(_0x3141f3);return _0x1bebaf(_0x2c56b5);});})[_0x999e('0x2c')](function(){return new BPromise(function(_0x27eb61,_0x5a2902){rimraf(_0x375777,function(_0x5ec0a5){if(_0x5ec0a5)_0x5a2902(_0x5ec0a5);return _0x27eb61();});});})[_0x999e('0x2c')](function(){return _0x49af7d['download'](_0x527d6d,_0x34323f,function(_0x38b97e){if(_0x38b97e){logger[_0x999e('0x1c')](_0x999e('0x12c'),_0x38b97e);}else{fs['unlinkSync'](_0x527d6d);}});});});}else{return _0x49af7d['sendStatus'](0xc8);}})[_0x999e('0x21')](handleError(_0x49af7d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index b9b5de9..3c07c5c 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 _0xb4b2=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','ChatInteraction','save'];(function(_0x3596c7,_0x1061ba){var _0x413455=function(_0x5eacb2){while(--_0x5eacb2){_0x3596c7['push'](_0x3596c7['shift']());}};_0x413455(++_0x1061ba);}(_0xb4b2,0x151));var _0x2b4b=function(_0x27cc87,_0x2ce582){_0x27cc87=_0x27cc87-0x0;var _0x53dc98=_0xb4b2[_0x27cc87];return _0x53dc98;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x2b4b('0x0'))['db'][_0x2b4b('0x1')];var ChatMessage=require(_0x2b4b('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2b4b('0x2'),'afterUpdate':_0x2b4b('0x3'),'afterDestroy':_0x2b4b('0x4')};function emitEvent(_0x45c6ec){return function(_0x57a8fe,_0x226c2d,_0x5c2825){_0x57a8fe[_0x2b4b('0x5')]({'attributes':['id'],'raw':!![]})[_0x2b4b('0x6')](function(_0x53a2d6){_0x57a8fe[_0x2b4b('0x7')](_0x2b4b('0x8'),_0x53a2d6[_0x2b4b('0x9')](function(_0x2ca939){return{'id':_0x2ca939['id']};}));return ChatMessage[_0x2b4b('0xa')]({'where':{'ChatInteractionId':_0x57a8fe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2b4b('0x6')](function(_0x10586b){_0x57a8fe[_0x2b4b('0x7')](_0x2b4b('0xb'),_0x10586b[_0x2b4b('0xc')]);ChatInteractionEvents[_0x2b4b('0xd')](_0x45c6ec+':'+_0x57a8fe['id'],_0x57a8fe);ChatInteractionEvents['emit'](_0x45c6ec,_0x57a8fe);_0x5c2825(null);})[_0x2b4b('0xe')](_0x5c2825(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x2b4b('0xf')](e,emitEvent(event));}}module[_0x2b4b('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc00e=['hasOwnProperty','../../mysqldb','ChatMessage','setMaxListeners','save','then','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0xdca4a6,_0x4965f6){var _0x5c5b95=function(_0x2c8fe7){while(--_0x2c8fe7){_0xdca4a6['push'](_0xdca4a6['shift']());}};_0x5c5b95(++_0x4965f6);}(_0xc00e,0x17a));var _0xec00=function(_0x466d75,_0x2b7b3f){_0x466d75=_0x466d75-0x0;var _0x43233a=_0xc00e[_0x466d75];return _0x43233a;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xec00('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xec00('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xec00('0x2')](0x0);var events={'afterCreate':_0xec00('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x127c91){return function(_0x39a8ad,_0x49e3d6,_0x3e8e01){_0x39a8ad['getUsers']({'attributes':['id'],'raw':!![]})[_0xec00('0x4')](function(_0x5ba576){_0x39a8ad['setDataValue']('Users',_0x5ba576[_0xec00('0x5')](function(_0x1a3c92){return{'id':_0x1a3c92['id']};}));return ChatMessage[_0xec00('0x6')]({'where':{'ChatInteractionId':_0x39a8ad['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19a3a1){_0x39a8ad[_0xec00('0x7')](_0xec00('0x8'),_0x19a3a1[_0xec00('0x9')]);ChatInteractionEvents[_0xec00('0xa')](_0x127c91+':'+_0x39a8ad['id'],_0x39a8ad);ChatInteractionEvents[_0xec00('0xa')](_0x127c91,_0x39a8ad);_0x3e8e01(null);})[_0xec00('0xb')](_0x3e8e01(null));};}for(var e in events){if(events[_0xec00('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 3253280..d26be68 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 _0x9432=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x165da5,_0x22204d){var _0x56724c=function(_0x5a784c){while(--_0x5a784c){_0x165da5['push'](_0x165da5['shift']());}};_0x56724c(++_0x22204d);}(_0x9432,0xfc));var _0x2943=function(_0x29fd36,_0x4555a4){_0x29fd36=_0x29fd36-0x0;var _0x2ec196=_0x9432[_0x29fd36];return _0x2ec196;};'use strict';var _=require(_0x2943('0x0'));var util=require(_0x2943('0x1'));var logger=require(_0x2943('0x2'))(_0x2943('0x3'));var moment=require(_0x2943('0x4'));var BPromise=require(_0x2943('0x5'));var rp=require(_0x2943('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2943('0x7'));var config=require(_0x2943('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x27a263,_0x1c8e96){return _0x27a263[_0x2943('0x9')](_0x2943('0xa'),attributes,{'tableName':_0x2943('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29b612,_0x1dafc4,_0x4b524c){if(_0x29b612[_0x2943('0xc')](_0x2943('0xd'))){_0x29b612[_0x2943('0xe')]=moment()[_0x2943('0xf')](_0x2943('0x10'));}_0x4b524c(null,_0x29b612);}},'charset':_0x2943('0x11'),'collate':_0x2943('0x12')});};
\ No newline at end of file
+var _0xcc4c=['moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5acb40,_0x4be650){var _0x522760=function(_0x1e4b9e){while(--_0x1e4b9e){_0x5acb40['push'](_0x5acb40['shift']());}};_0x522760(++_0x4be650);}(_0xcc4c,0x1b7));var _0xccc4=function(_0x3715fc,_0xec8927){_0x3715fc=_0x3715fc-0x0;var _0x40a4cf=_0xcc4c[_0x3715fc];return _0x40a4cf;};'use strict';var _=require(_0xccc4('0x0'));var util=require('util');var logger=require(_0xccc4('0x1'))(_0xccc4('0x2'));var moment=require(_0xccc4('0x3'));var BPromise=require('bluebird');var rp=require(_0xccc4('0x4'));var fs=require('fs');var path=require(_0xccc4('0x5'));var rimraf=require(_0xccc4('0x6'));var config=require(_0xccc4('0x7'));var attributes=require(_0xccc4('0x8'));module[_0xccc4('0x9')]=function(_0x240039,_0x53af0f){return _0x240039['define']('ChatInteraction',attributes,{'tableName':_0xccc4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39aebd,_0x1542c1,_0x57a668){if(_0x39aebd[_0xccc4('0xb')]('closed')){_0x39aebd[_0xccc4('0xc')]=moment()[_0xccc4('0xd')](_0xccc4('0xe'));}_0x57a668(null,_0x39aebd);}},'charset':_0xccc4('0xf'),'collate':_0xccc4('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 50f5849..62a174c 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 _0x37d1=['error','code','message','result','catch','ChatInteraction','update','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','body','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x37d1,0x116));var _0x137d=function(_0x2b20aa,_0x168618){_0x2b20aa=_0x2b20aa-0x0;var _0x10fba0=_0x37d1[_0x2b20aa];return _0x10fba0;};'use strict';var _=require(_0x137d('0x0'));var util=require(_0x137d('0x1'));var moment=require(_0x137d('0x2'));var BPromise=require(_0x137d('0x3'));var rs=require(_0x137d('0x4'));var fs=require('fs');var Redis=require(_0x137d('0x5'));var db=require(_0x137d('0x6'))['db'];var utils=require(_0x137d('0x7'));var logger=require(_0x137d('0x8'))(_0x137d('0x9'));var config=require(_0x137d('0xa'));var jayson=require(_0x137d('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x137d('0xc')]=_[_0x137d('0xd')](config[_0x137d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x137d('0xe'))(new Redis(config[_0x137d('0xc')]));require(_0x137d('0xf'))[_0x137d('0x10')](socket);function respondWithRpcPromise(_0x3bb0da,_0x2e4722,_0x451482){return new BPromise(function(_0x30282a,_0x574327){return client['request'](_0x3bb0da,_0x451482)[_0x137d('0x11')](function(_0x4cb0fe){logger[_0x137d('0x12')](_0x137d('0x13'),_0x2e4722,_0x137d('0x14'));logger[_0x137d('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2e4722,'request\x20sent',JSON[_0x137d('0x16')](_0x4cb0fe));if(_0x4cb0fe[_0x137d('0x17')]){if(_0x4cb0fe[_0x137d('0x17')][_0x137d('0x18')]===0x1f4){logger[_0x137d('0x17')](_0x137d('0x13'),_0x2e4722,_0x4cb0fe['error']['message']);return _0x574327(_0x4cb0fe[_0x137d('0x17')][_0x137d('0x19')]);}logger[_0x137d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2e4722,_0x4cb0fe[_0x137d('0x17')][_0x137d('0x19')]);return _0x30282a(_0x4cb0fe[_0x137d('0x17')][_0x137d('0x19')]);}else{logger['info'](_0x137d('0x13'),_0x2e4722,_0x137d('0x14'));_0x30282a(_0x4cb0fe[_0x137d('0x1a')]['message']);}})[_0x137d('0x1b')](function(_0x5df994){logger[_0x137d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x2e4722,_0x5df994);_0x574327(_0x5df994);});});}exports['UpdateChatInteraction']=function(_0x29fd7d){var _0xa42d=this;return new Promise(function(_0x1f7e87,_0x40040b){return db[_0x137d('0x1c')][_0x137d('0x1d')](_0x29fd7d['body'],{'raw':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d[_0x137d('0x1e')][_0x137d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d[_0x137d('0x1e')][_0x137d('0x20')]||null:null,'attributes':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d[_0x137d('0x1e')][_0x137d('0x21')]||null:null,'limit':_0x29fd7d[_0x137d('0x1e')]?_0x29fd7d['options'][_0x137d('0x22')]||null:null})[_0x137d('0x11')](function(_0xb596d9){logger['info'](_0x137d('0x23'),_0x29fd7d);logger['debug']('UpdateChatInteraction',_0x29fd7d,JSON[_0x137d('0x16')](_0xb596d9));_0x1f7e87(_0xb596d9);})[_0x137d('0x1b')](function(_0x11398c){logger[_0x137d('0x17')](_0x137d('0x23'),_0x11398c[_0x137d('0x19')],_0x29fd7d);_0x40040b(_0xa42d[_0x137d('0x17')](0x1f4,_0x11398c[_0x137d('0x19')]));});});};exports[_0x137d('0x24')]=function(_0x180c4e){return new Promise(function(_0x10fb44,_0x157583){return db[_0x137d('0x1c')][_0x137d('0x25')]({'where':_0x180c4e['options']?_0x180c4e[_0x137d('0x1e')][_0x137d('0x20')]||null:null})[_0x137d('0x11')](function(_0x2c43fe){if(_0x2c43fe){return _0x2c43fe[_0x137d('0x26')](_0x180c4e[_0x137d('0x27')]['ids'],_[_0x137d('0x28')](_0x180c4e['body'],[_0x137d('0x29'),'id'])||{});}})['spread'](function(_0x7e9f04){logger[_0x137d('0x12')]('AddTags',_0x180c4e);logger[_0x137d('0x15')](_0x137d('0x2a'),_0x180c4e,JSON[_0x137d('0x16')](_0x7e9f04));_0x10fb44(_0x7e9f04);})[_0x137d('0x1b')](function(_0x36aaa6){logger[_0x137d('0x17')](_0x137d('0x2a'),_0x36aaa6[_0x137d('0x19')],_0x180c4e);_0x157583(_this[_0x137d('0x17')](0x1f4,_0x36aaa6[_0x137d('0x19')]));});});};
\ No newline at end of file
+var _0xafb5=['defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x39a4d0,_0x39d667){var _0x9078ca=function(_0x16c729){while(--_0x16c729){_0x39a4d0['push'](_0x39a4d0['shift']());}};_0x9078ca(++_0x39d667);}(_0xafb5,0xcb));var _0x5afb=function(_0x2ff990,_0x52dd2c){_0x2ff990=_0x2ff990-0x0;var _0x2e9ece=_0xafb5[_0x2ff990];return _0x2e9ece;};'use strict';var _=require('lodash');var util=require(_0x5afb('0x0'));var moment=require(_0x5afb('0x1'));var BPromise=require(_0x5afb('0x2'));var rs=require(_0x5afb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5afb('0x4'))['db'];var utils=require(_0x5afb('0x5'));var logger=require(_0x5afb('0x6'))(_0x5afb('0x7'));var config=require(_0x5afb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5afb('0x9')][_0x5afb('0xa')]({'port':0x232a});config[_0x5afb('0xb')]=_[_0x5afb('0xc')](config[_0x5afb('0xb')],{'host':_0x5afb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5afb('0xe'))[_0x5afb('0xf')](socket);function respondWithRpcPromise(_0x35cbce,_0xf93cd2,_0x7a9b34){return new BPromise(function(_0x4b83c2,_0x8acb76){return client[_0x5afb('0x10')](_0x35cbce,_0x7a9b34)[_0x5afb('0x11')](function(_0x32beb7){logger[_0x5afb('0x12')](_0x5afb('0x13'),_0xf93cd2,_0x5afb('0x14'));logger['debug'](_0x5afb('0x15'),_0xf93cd2,_0x5afb('0x14'),JSON['stringify'](_0x32beb7));if(_0x32beb7[_0x5afb('0x16')]){if(_0x32beb7[_0x5afb('0x16')]['code']===0x1f4){logger[_0x5afb('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xf93cd2,_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);return _0x8acb76(_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);}logger[_0x5afb('0x16')](_0x5afb('0x13'),_0xf93cd2,_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);return _0x4b83c2(_0x32beb7[_0x5afb('0x16')][_0x5afb('0x17')]);}else{logger[_0x5afb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0xf93cd2,_0x5afb('0x14'));_0x4b83c2(_0x32beb7[_0x5afb('0x18')]['message']);}})['catch'](function(_0x2c3944){logger[_0x5afb('0x16')](_0x5afb('0x13'),_0xf93cd2,_0x2c3944);_0x8acb76(_0x2c3944);});});}exports['UpdateChatInteraction']=function(_0x5697a3){var _0x528514=this;return new Promise(function(_0x47aa4a,_0x2a0157){return db[_0x5afb('0x19')][_0x5afb('0x1a')](_0x5697a3[_0x5afb('0x1b')],{'raw':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x1e')]||null:null,'attributes':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x1f')]||null:null,'limit':_0x5697a3[_0x5afb('0x1c')]?_0x5697a3[_0x5afb('0x1c')][_0x5afb('0x20')]||null:null})['then'](function(_0x1bf810){logger[_0x5afb('0x12')]('UpdateChatInteraction',_0x5697a3);logger['debug'](_0x5afb('0x21'),_0x5697a3,JSON[_0x5afb('0x22')](_0x1bf810));_0x47aa4a(_0x1bf810);})[_0x5afb('0x23')](function(_0x43820b){logger[_0x5afb('0x16')](_0x5afb('0x21'),_0x43820b['message'],_0x5697a3);_0x2a0157(_0x528514[_0x5afb('0x16')](0x1f4,_0x43820b[_0x5afb('0x17')]));});});};exports[_0x5afb('0x24')]=function(_0x4f3519){return new Promise(function(_0x5c5f35,_0x8f4c9d){return db[_0x5afb('0x19')][_0x5afb('0x25')]({'where':_0x4f3519[_0x5afb('0x1c')]?_0x4f3519[_0x5afb('0x1c')][_0x5afb('0x1e')]||null:null})[_0x5afb('0x11')](function(_0x1248b8){if(_0x1248b8){return _0x1248b8[_0x5afb('0x26')](_0x4f3519[_0x5afb('0x1b')]['ids'],_[_0x5afb('0x27')](_0x4f3519[_0x5afb('0x1b')],[_0x5afb('0x28'),'id'])||{});}})['spread'](function(_0x49447f){logger[_0x5afb('0x12')](_0x5afb('0x29'),_0x4f3519);logger[_0x5afb('0x2a')]('AddTags',_0x4f3519,JSON[_0x5afb('0x22')](_0x49447f));_0x5c5f35(_0x49447f);})[_0x5afb('0x23')](function(_0x58d015){logger[_0x5afb('0x16')](_0x5afb('0x29'),_0x58d015['message'],_0x4f3519);_0x8f4c9d(_this[_0x5afb('0x16')](0x1f4,_0x58d015[_0x5afb('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 1519256..5f1e96e 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 _0xa8a8=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x128b88,_0x3a3984){var _0x299b5c=function(_0x23694d){while(--_0x23694d){_0x128b88['push'](_0x128b88['shift']());}};_0x299b5c(++_0x3a3984);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3ffca4,_0x3cb819){_0x3ffca4=_0x3ffca4-0x0;var _0x2212ec=_0xa8a8[_0x3ffca4];return _0x2212ec;};'use strict';var ChatInteractionEvents=require(_0x8a8a('0x0'));var events=[_0x8a8a('0x1'),_0x8a8a('0x2'),_0x8a8a('0x3')];function createListener(_0x5221bc,_0x2a2676){return function(_0x3296a6){_0x2a2676[_0x8a8a('0x4')](_0x5221bc,_0x3296a6);};}function removeListener(_0x3ed1de,_0x45515d){return function(){ChatInteractionEvents[_0x8a8a('0x5')](_0x3ed1de,_0x45515d);};}exports[_0x8a8a('0x6')]=function(_0x12db82){for(var _0x2e8193=0x0,_0x315fe9=events[_0x8a8a('0x7')];_0x2e8193<_0x315fe9;_0x2e8193++){var _0x8e7aa0=events[_0x2e8193];var _0x4225b9=createListener(_0x8a8a('0x8')+_0x8e7aa0,_0x12db82);ChatInteractionEvents['on'](_0x8e7aa0,_0x4225b9);}};
\ No newline at end of file
+var _0xe56d=['./chatInteraction.events','emit','removeListener','register','length'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0xe56d,0x1ea));var _0xde56=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0xe56d[_0x280ae7];return _0x418b9e;};'use strict';var ChatInteractionEvents=require(_0xde56('0x0'));var events=['save','remove','update'];function createListener(_0x4ad900,_0x40c4f6){return function(_0x29abd9){_0x40c4f6[_0xde56('0x1')](_0x4ad900,_0x29abd9);};}function removeListener(_0x33f7ec,_0x56d503){return function(){ChatInteractionEvents[_0xde56('0x2')](_0x33f7ec,_0x56d503);};}exports[_0xde56('0x3')]=function(_0x2c6d08){for(var _0x13bea9=0x0,_0x1bf93e=events[_0xde56('0x4')];_0x13bea9<_0x1bf93e;_0x13bea9++){var _0x2eb29f=events[_0x13bea9];var _0x5a2268=createListener('chatInteraction:'+_0x2eb29f,_0x2c6d08);ChatInteractionEvents['on'](_0x2eb29f,_0x5a2268);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 32d1001..4c99685 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 _0x2779=['destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','chat','chatinteraction:addtags','/:id','tracked','chatinteraction:update','put','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2779,0x12f));var _0x9277=function(_0x198e30,_0x3275c7){_0x198e30=_0x198e30-0x0;var _0x18ce2f=_0x2779[_0x198e30];return _0x18ce2f;};'use strict';var multer=require(_0x9277('0x0'));var util=require('util');var path=require(_0x9277('0x1'));var timeout=require(_0x9277('0x2'));var express=require(_0x9277('0x3'));var router=express[_0x9277('0x4')]();var fs_extra=require(_0x9277('0x5'));var auth=require(_0x9277('0x6'));var interaction=require(_0x9277('0x7'));var config=require('../../config/environment');var controller=require(_0x9277('0x8'));router[_0x9277('0x9')]('/',auth[_0x9277('0xa')](),controller[_0x9277('0xb')]);router[_0x9277('0x9')](_0x9277('0xc'),auth['isAuthenticated'](),controller[_0x9277('0xd')]);router[_0x9277('0x9')]('/:id',auth[_0x9277('0xe')](),controller[_0x9277('0xf')]);router[_0x9277('0x9')](_0x9277('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x9277('0x11')]);router[_0x9277('0x9')](_0x9277('0x12'),auth[_0x9277('0xa')](),controller['getMessages']);router[_0x9277('0x9')](_0x9277('0x13'),auth[_0x9277('0xe')](),controller[_0x9277('0x14')]);router[_0x9277('0x9')](_0x9277('0x15'),auth[_0x9277('0xa')](),controller['download']);router[_0x9277('0x16')]('/',auth[_0x9277('0xa')](),controller[_0x9277('0x17')]);router[_0x9277('0x16')](_0x9277('0x18'),auth[_0x9277('0xa')](),controller[_0x9277('0x19')]);var upload=multer({'storage':multer[_0x9277('0x1a')]({'destination':function(_0x4918f4,_0x3430ca,_0x1b858c){_0x1b858c(null,path['join'](config['root'],_0x9277('0x1b')));},'filename':function(_0x25ed1c,_0x51ab30,_0x287dcc){_0x287dcc(null,util['format'](_0x9277('0x1c'),Date[_0x9277('0x1d')](),_0x51ab30[_0x9277('0x1e')][_0x9277('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9277('0x16')](_0x9277('0x20'),upload[_0x9277('0x21')]('file'),controller[_0x9277('0x22')]);router['post']('/:id/messages',auth[_0x9277('0xe')](),controller['addMessage']);router[_0x9277('0x16')]('/:id/tags',auth[_0x9277('0xa')](),interaction['tracked'](_0x9277('0x23'),_0x9277('0x24')),controller['addTags']);router['put'](_0x9277('0x25'),auth[_0x9277('0xa')](),interaction[_0x9277('0x26')](_0x9277('0x23'),_0x9277('0x27')),controller['update']);router[_0x9277('0x28')](_0x9277('0x29'),controller['customUpdate']);router['put'](_0x9277('0x2a'),auth[_0x9277('0xe')](),controller['abandon']);router['put'](_0x9277('0x2b'),controller[_0x9277('0x2c')]);router[_0x9277('0x2d')](_0x9277('0x25'),auth[_0x9277('0xa')](),interaction[_0x9277('0x26')](_0x9277('0x23'),_0x9277('0x2e')),controller[_0x9277('0x2f')]);router[_0x9277('0x2d')](_0x9277('0x30'),auth['isAuthenticated'](),controller[_0x9277('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xe6ba=['diskStorage','join','root','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','update','put','customUpdate','/:id/abandon','close','delete','chatinteraction:destroy','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession'];(function(_0x3bd24c,_0x5543e0){var _0x3c358e=function(_0x49e234){while(--_0x49e234){_0x3bd24c['push'](_0x3bd24c['shift']());}};_0x3c358e(++_0x5543e0);}(_0xe6ba,0x77));var _0xae6b=function(_0x4e8127,_0x442a92){_0x4e8127=_0x4e8127-0x0;var _0x9a68d1=_0xe6ba[_0x4e8127];return _0x9a68d1;};'use strict';var multer=require('multer');var util=require(_0xae6b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xae6b('0x1'));var router=express[_0xae6b('0x2')]();var fs_extra=require(_0xae6b('0x3'));var auth=require(_0xae6b('0x4'));var interaction=require(_0xae6b('0x5'));var config=require(_0xae6b('0x6'));var controller=require(_0xae6b('0x7'));router[_0xae6b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xae6b('0x8')]('/describe',auth[_0xae6b('0x9')](),controller[_0xae6b('0xa')]);router[_0xae6b('0x8')](_0xae6b('0xb'),auth[_0xae6b('0xc')](),controller[_0xae6b('0xd')]);router[_0xae6b('0x8')](_0xae6b('0xe'),auth[_0xae6b('0xc')](),controller[_0xae6b('0xf')]);router[_0xae6b('0x8')](_0xae6b('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0xae6b('0x8')](_0xae6b('0x11'),auth[_0xae6b('0xc')](),controller[_0xae6b('0x12')]);router['get'](_0xae6b('0x13'),auth[_0xae6b('0x9')](),controller[_0xae6b('0x14')]);router[_0xae6b('0x15')]('/',auth[_0xae6b('0x9')](),controller[_0xae6b('0x16')]);router[_0xae6b('0x15')](_0xae6b('0x17'),auth['isAuthenticated'](),controller[_0xae6b('0x18')]);var upload=multer({'storage':multer[_0xae6b('0x19')]({'destination':function(_0x22ca98,_0x489846,_0x2085ba){_0x2085ba(null,path[_0xae6b('0x1a')](config[_0xae6b('0x1b')],'server/files/attachments/'));},'filename':function(_0x18e956,_0x344f84,_0x28cae1){_0x28cae1(null,util[_0xae6b('0x1c')](_0xae6b('0x1d'),Date[_0xae6b('0x1e')](),_0x344f84['originalname'][_0xae6b('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xae6b('0x20'),upload['single'](_0xae6b('0x21')),controller[_0xae6b('0x22')]);router[_0xae6b('0x15')](_0xae6b('0x10'),auth[_0xae6b('0xc')](),controller[_0xae6b('0x23')]);router[_0xae6b('0x15')](_0xae6b('0x24'),auth[_0xae6b('0x9')](),interaction[_0xae6b('0x25')](_0xae6b('0x26'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0xae6b('0xb'),auth[_0xae6b('0x9')](),interaction[_0xae6b('0x25')](_0xae6b('0x26'),'chatinteraction:update'),controller[_0xae6b('0x27')]);router[_0xae6b('0x28')]('/:id/custom_update',controller[_0xae6b('0x29')]);router[_0xae6b('0x28')](_0xae6b('0x2a'),auth[_0xae6b('0xc')](),controller['abandon']);router[_0xae6b('0x28')]('/:id/close',controller[_0xae6b('0x2b')]);router[_0xae6b('0x2c')](_0xae6b('0xb'),auth[_0xae6b('0x9')](),interaction[_0xae6b('0x25')](_0xae6b('0x26'),_0xae6b('0x2d')),controller[_0xae6b('0x2e')]);router[_0xae6b('0x2c')]('/:id/tags',auth[_0xae6b('0x9')](),controller['removeTags']);module[_0xae6b('0x2f')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index fa94659..44b8b30 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 _0xc61c=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x207015,_0x570b4b){var _0x7c8426=function(_0xfa3c9e){while(--_0xfa3c9e){_0x207015['push'](_0x207015['shift']());}};_0x7c8426(++_0x570b4b);}(_0xc61c,0xb8));var _0xcc61=function(_0x5ccdd5,_0x137596){_0x5ccdd5=_0x5ccdd5-0x0;var _0x2bb303=_0xc61c[_0x5ccdd5];return _0x2bb303;};'use strict';var Sequelize=require('sequelize');module[_0xcc61('0x0')]={'body':{'type':Sequelize[_0xcc61('0x1')](_0xcc61('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcc61('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcc61('0x4')]}};
\ No newline at end of file
+var _0xa486=['sequelize','exports','TEXT','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa486,0xa0));var _0x6a48=function(_0x2ef72c,_0x4cee49){_0x2ef72c=_0x2ef72c-0x0;var _0x2a25b9=_0xa486[_0x2ef72c];return _0x2a25b9;};'use strict';var Sequelize=require(_0x6a48('0x0'));module[_0x6a48('0x1')]={'body':{'type':Sequelize[_0x6a48('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x6a48('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 052de60..d5e41b6 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 _0x3f7f=['fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','type','options','ChatInternalMessage','includeAll','findAll','catch','show','params','length','create','body','find','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId','ToId','read','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x3f7f,0x143));var _0xf3f7=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3f7f[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0xf3f7('0x0'));var rimraf=require(_0xf3f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3f7('0x2'));var rp=require(_0xf3f7('0x3'));var moment=require(_0xf3f7('0x4'));var BPromise=require(_0xf3f7('0x5'));var Mustache=require('mustache');var util=require(_0xf3f7('0x6'));var path=require(_0xf3f7('0x7'));var sox=require(_0xf3f7('0x8'));var csv=require(_0xf3f7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3f7('0xa'));var _=require(_0xf3f7('0xb'));var squel=require(_0xf3f7('0xc'));var crypto=require(_0xf3f7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf3f7('0x9'));var querystring=require(_0xf3f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xf3f7('0xf'));var authService=require(_0xf3f7('0x10'));var qs=require(_0xf3f7('0x11'));var as=require(_0xf3f7('0x12'));var hardwareService=require(_0xf3f7('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf3f7('0x14'));var config=require(_0xf3f7('0x15'));var licenseUtil=require(_0xf3f7('0x16'));var db=require(_0xf3f7('0x17'))['db'];config[_0xf3f7('0x18')]=_[_0xf3f7('0x19')](config[_0xf3f7('0x18')],{'host':_0xf3f7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf3f7('0x18')]));require(_0xf3f7('0x1b'))['register'](socket);function respondWithStatusCode(_0x53b6a5,_0x7d6a20){_0x7d6a20=_0x7d6a20||0xcc;return function(_0x1c575a){if(_0x1c575a){return _0x53b6a5['sendStatus'](_0x7d6a20);}return _0x53b6a5[_0xf3f7('0x1c')](_0x7d6a20)[_0xf3f7('0x1d')]();};}function respondWithResult(_0x286bd6,_0x3ce19c){_0x3ce19c=_0x3ce19c||0xc8;return function(_0x1c5f4b){if(_0x1c5f4b){return _0x286bd6[_0xf3f7('0x1c')](_0x3ce19c)[_0xf3f7('0x1e')](_0x1c5f4b);}};}function respondWithFilteredResult(_0x5a502b,_0xbe0ef5){return function(_0xe7836b){if(_0xe7836b){var _0x234db8=typeof _0xbe0ef5[_0xf3f7('0x1f')]===_0xf3f7('0x20')&&typeof _0xbe0ef5[_0xf3f7('0x21')]==='undefined';var _0x45bef7=_0xe7836b['count'];var _0x59773a=_0x234db8?0x0:_0xbe0ef5['offset'];var _0x5e7acb=_0x234db8?_0xe7836b[_0xf3f7('0x22')]:_0xbe0ef5[_0xf3f7('0x1f')]+_0xbe0ef5['limit'];var _0x1a57f9;if(_0x5e7acb>=_0x45bef7){_0x5e7acb=_0x45bef7;_0x1a57f9=0xc8;}else{_0x1a57f9=0xce;}_0x5a502b[_0xf3f7('0x1c')](_0x1a57f9);return _0x5a502b[_0xf3f7('0x23')](_0xf3f7('0x24'),_0x59773a+'-'+_0x5e7acb+'/'+_0x45bef7)[_0xf3f7('0x1e')](_0xe7836b);}return null;};}function patchUpdates(_0x5c6b58){return function(_0x25eba5){try{jsonpatch['apply'](_0x25eba5,_0x5c6b58,!![]);}catch(_0x27b42a){return BPromise[_0xf3f7('0x25')](_0x27b42a);}return _0x25eba5[_0xf3f7('0x26')]();};}function saveUpdates(_0x50a31f,_0x1352c2){return function(_0x5ec7de){if(_0x5ec7de){return _0x5ec7de[_0xf3f7('0x27')](_0x50a31f)[_0xf3f7('0x28')](function(_0x4ad9e3){return _0x4ad9e3;});}return null;};}function removeEntity(_0x76f15c,_0x14db43){return function(_0x29ca26){if(_0x29ca26){return _0x29ca26[_0xf3f7('0x29')]()[_0xf3f7('0x28')](function(){_0x76f15c[_0xf3f7('0x1c')](0xcc)[_0xf3f7('0x1d')]();});}};}function handleEntityNotFound(_0x550c19,_0x25219b){return function(_0x5a545e){if(!_0x5a545e){_0x550c19[_0xf3f7('0x2a')](0x194);}return _0x5a545e;};}function handleError(_0x1dec78,_0x32ede2){_0x32ede2=_0x32ede2||0x1f4;return function(_0x24efd9){logger[_0xf3f7('0x2b')](_0x24efd9[_0xf3f7('0x2c')]);if(_0x24efd9[_0xf3f7('0x2d')]){delete _0x24efd9[_0xf3f7('0x2d')];}_0x1dec78[_0xf3f7('0x1c')](_0x32ede2)[_0xf3f7('0x2e')](_0x24efd9);};}exports[_0xf3f7('0x2f')]=function(_0x49c071,_0x1519a3){var _0x229948={},_0x1beef4={},_0x4e0951={'count':0x0,'rows':[]};var _0x387198=_[_0xf3f7('0x30')](db['ChatInternalMessage'][_0xf3f7('0x31')],function(_0x2bad2d){return{'name':_0x2bad2d[_0xf3f7('0x32')],'type':_0x2bad2d['type']['key']};});_0x1beef4[_0xf3f7('0x33')]=_[_0xf3f7('0x30')](_0x387198,_0xf3f7('0x2d'));_0x1beef4[_0xf3f7('0x34')]=_[_0xf3f7('0x35')](_0x49c071[_0xf3f7('0x34')]);_0x1beef4[_0xf3f7('0x36')]=_['intersection'](_0x1beef4[_0xf3f7('0x33')],_0x1beef4[_0xf3f7('0x34')]);_0x229948['attributes']=_[_0xf3f7('0x37')](_0x1beef4[_0xf3f7('0x33')],qs[_0xf3f7('0x38')](_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x38')]));_0x229948[_0xf3f7('0x39')]=_0x229948[_0xf3f7('0x39')]['length']?_0x229948[_0xf3f7('0x39')]:_0x1beef4[_0xf3f7('0x33')];if(!_0x49c071['query']['hasOwnProperty'](_0xf3f7('0x3a'))){_0x229948[_0xf3f7('0x21')]=qs[_0xf3f7('0x21')](_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x21')]);_0x229948[_0xf3f7('0x1f')]=qs[_0xf3f7('0x1f')](_0x49c071[_0xf3f7('0x34')]['offset']);}_0x229948[_0xf3f7('0x3b')]=qs['sort'](_0x49c071['query'][_0xf3f7('0x3c')]);_0x229948['where']=qs['filters'](_[_0xf3f7('0x3d')](_0x49c071[_0xf3f7('0x34')],_0x1beef4[_0xf3f7('0x36')]),_0x387198);if(_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x3e')]){_0x229948[_0xf3f7('0x3f')]=_[_0xf3f7('0x40')](_0x229948[_0xf3f7('0x3f')],{'$or':_['map'](_0x387198,function(_0x145f7f){if(_0x145f7f[_0xf3f7('0x41')]!=='VIRTUAL'){var _0x4fd6fc={};_0x4fd6fc[_0x145f7f[_0xf3f7('0x2d')]]={'$like':'%'+_0x49c071[_0xf3f7('0x34')][_0xf3f7('0x3e')]+'%'};return _0x4fd6fc;}})});}_0x229948=_[_0xf3f7('0x40')]({},_0x229948,_0x49c071[_0xf3f7('0x42')]);var _0x49e102={'where':_0x229948[_0xf3f7('0x3f')]};return db[_0xf3f7('0x43')][_0xf3f7('0x22')](_0x49e102)['then'](function(_0x4901b0){_0x4e0951['count']=_0x4901b0;if(_0x49c071['query'][_0xf3f7('0x44')]){_0x229948['include']=[{'all':!![]}];}return db[_0xf3f7('0x43')][_0xf3f7('0x45')](_0x229948);})['then'](function(_0x361b4a){_0x4e0951['rows']=_0x361b4a;return _0x4e0951;})[_0xf3f7('0x28')](respondWithFilteredResult(_0x1519a3,_0x229948))[_0xf3f7('0x46')](handleError(_0x1519a3,null));};exports[_0xf3f7('0x47')]=function(_0x597fd2,_0x2105e2){var _0x2b9c05={'raw':!![],'where':{'id':_0x597fd2[_0xf3f7('0x48')]['id']}},_0x46808f={};_0x46808f[_0xf3f7('0x33')]=_[_0xf3f7('0x35')](db[_0xf3f7('0x43')][_0xf3f7('0x31')]);_0x46808f[_0xf3f7('0x34')]=_[_0xf3f7('0x35')](_0x597fd2[_0xf3f7('0x34')]);_0x46808f['filters']=_[_0xf3f7('0x37')](_0x46808f[_0xf3f7('0x33')],_0x46808f[_0xf3f7('0x34')]);_0x2b9c05[_0xf3f7('0x39')]=_[_0xf3f7('0x37')](_0x46808f[_0xf3f7('0x33')],qs[_0xf3f7('0x38')](_0x597fd2[_0xf3f7('0x34')][_0xf3f7('0x38')]));_0x2b9c05['attributes']=_0x2b9c05[_0xf3f7('0x39')][_0xf3f7('0x49')]?_0x2b9c05[_0xf3f7('0x39')]:_0x46808f[_0xf3f7('0x33')];if(_0x597fd2['query'][_0xf3f7('0x44')]){_0x2b9c05['include']=[{'all':!![]}];}_0x2b9c05=_[_0xf3f7('0x40')]({},_0x2b9c05,_0x597fd2['options']);return db[_0xf3f7('0x43')]['find'](_0x2b9c05)['then'](handleEntityNotFound(_0x2105e2,null))[_0xf3f7('0x28')](respondWithResult(_0x2105e2,null))['catch'](handleError(_0x2105e2,null));};exports['create']=function(_0x3932df,_0x1dba71){return db[_0xf3f7('0x43')][_0xf3f7('0x4a')](_0x3932df[_0xf3f7('0x4b')],{})[_0xf3f7('0x28')](respondWithResult(_0x1dba71,0xc9))[_0xf3f7('0x46')](handleError(_0x1dba71,null));};exports['update']=function(_0x49511b,_0x4eb97d){if(_0x49511b[_0xf3f7('0x4b')]['id']){delete _0x49511b[_0xf3f7('0x4b')]['id'];}return db['ChatInternalMessage'][_0xf3f7('0x4c')]({'where':{'id':_0x49511b[_0xf3f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x4eb97d,null))[_0xf3f7('0x28')](saveUpdates(_0x49511b[_0xf3f7('0x4b')],null))[_0xf3f7('0x28')](respondWithResult(_0x4eb97d,null))[_0xf3f7('0x46')](handleError(_0x4eb97d,null));};exports[_0xf3f7('0x29')]=function(_0x37990c,_0x29886a){return db[_0xf3f7('0x43')][_0xf3f7('0x4c')]({'where':{'id':_0x37990c[_0xf3f7('0x48')]['id']}})[_0xf3f7('0x28')](handleEntityNotFound(_0x29886a,null))[_0xf3f7('0x28')](removeEntity(_0x29886a,null))[_0xf3f7('0x46')](handleError(_0x29886a,null));};exports['describe']=function(_0x2c1cec,_0x33022e){return db[_0xf3f7('0x43')][_0xf3f7('0x4d')]()[_0xf3f7('0x28')](respondWithResult(_0x33022e,null))[_0xf3f7('0x46')](handleError(_0x33022e,null));};function wrapUser(_0x581d87){return function(_0x2b22f9){var _0x2294bf=_0x581d87[_0xf3f7('0x4e')]({'plain':!![]});_0x2294bf['messages']=[];if(_0x2b22f9){_0x2294bf['lastMessageAt']=_0x2b22f9[_0xf3f7('0x4f')];_0x2294bf[_0xf3f7('0x50')]=_0x2b22f9;}else{_0x2294bf[_0xf3f7('0x51')]=moment(0x0)[_0xf3f7('0x52')](_0xf3f7('0x53'));_0x2294bf[_0xf3f7('0x50')]={};}return _0x2294bf;};}exports[_0xf3f7('0x54')]=function(_0x59f2bf,_0x582116,_0x1979a6){var _0x1730f5=[];return db['User'][_0xf3f7('0x45')]({'where':{'role':[_0xf3f7('0x55'),_0xf3f7('0x56'),_0xf3f7('0x57')]},'attributes':['id',_0xf3f7('0x58'),_0xf3f7('0x2d'),_0xf3f7('0x59'),_0xf3f7('0x5a'),_0xf3f7('0x5b'),_0xf3f7('0x5c'),_0xf3f7('0x5d'),_0xf3f7('0x5e'),'showWebBar'],'order':qs[_0xf3f7('0x3c')](_0xf3f7('0x5f')),'include':[{'model':db[_0xf3f7('0x60')],'as':_0xf3f7('0x61'),'attributes':['id',_0xf3f7('0x2d'),_0xf3f7('0x41')],'through':{'attributes':[]}}]})[_0xf3f7('0x28')](function(_0x2a65cc){if(_0x2a65cc){var _0x452aef=_0x59f2bf[_0xf3f7('0x57')][_0xf3f7('0x4e')]({'plain':!![]});if(!_0x452aef)throw new Error(_0xf3f7('0x62'));if(_0x452aef['role']===_0xf3f7('0x57')){return db[_0xf3f7('0x63')]['find']({'where':{'name':_0xf3f7('0x64'),'userProfileId':_0x452aef[_0xf3f7('0x65')]},'raw':!![]})[_0xf3f7('0x28')](function(_0x4b2a98){if(_0x4b2a98){if(_0x4b2a98[_0xf3f7('0x66')]===0x0){return db[_0xf3f7('0x67')][_0xf3f7('0x45')]({'where':{'sectionId':_0x4b2a98['id']},'raw':!![]})[_0xf3f7('0x28')](function(_0x93a01){var _0x4b1c61=[];if(_['isEmpty'](_0x93a01)){_0x4b1c61=_['filter'](_0x2a65cc,function(_0x4be0a5){if(_0x4be0a5[_0xf3f7('0x59')]!==_0xf3f7('0x55')){return _0x4be0a5;}});return _0x4b1c61;}else{for(var _0x18b14f=0x0;_0x18b14f<_0x2a65cc['length'];_0x18b14f++){var _0x53f055=_0x2a65cc[_0x18b14f];if(_0x53f055[_0xf3f7('0x59')]===_0xf3f7('0x55')){var _0x2ffef3=_[_0xf3f7('0x4c')](_0x93a01,function(_0x456bed){return _0x456bed[_0xf3f7('0x68')]===_0x53f055['id'];});if(_0x2ffef3)_0x4b1c61[_0xf3f7('0x69')](_0x53f055);}else{_0x4b1c61[_0xf3f7('0x69')](_0x53f055);}}return _0x4b1c61;}});}else{return _0x2a65cc;}}else{var _0xfd7ac8=_[_0xf3f7('0x3e')](_0x2a65cc,function(_0x42edf5){if(_0x42edf5[_0xf3f7('0x59')]!==_0xf3f7('0x55')){return _0x42edf5;}});return _0xfd7ac8;}});}else{return _0x2a65cc;}}})[_0xf3f7('0x28')](function(_0x3f43b5){var _0x50a270=[];if(_0x3f43b5){_0x1730f5=_0x3f43b5;for(var _0x4c62d1=0x0;_0x4c62d1<_0x3f43b5['length'];_0x4c62d1+=0x1){_0x1730f5[_0x4c62d1][_0xf3f7('0x6a')]=[];_0x50a270[_0xf3f7('0x69')](db['ChatInternalMessage'][_0xf3f7('0x4c')]({'where':{'FromId':[_0x59f2bf['user']['id'],_0x3f43b5[_0x4c62d1]['id']],'ToId':[_0x59f2bf[_0xf3f7('0x57')]['id'],_0x3f43b5[_0x4c62d1]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xf3f7('0x6b'),_0xf3f7('0x6c'),_0xf3f7('0x6d'),_0xf3f7('0x4b')],'order':qs[_0xf3f7('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf3f7('0x28')](wrapUser(_0x3f43b5[_0x4c62d1])));}return BPromise[_0xf3f7('0x6e')](_0x50a270);}return[];})['then'](function(_0x505123){return{'rows':_0x505123,'count':_0x505123['length']};})['then'](respondWithResult(_0x582116,null))[_0xf3f7('0x46')](handleError(_0x582116,null));};
\ No newline at end of file
+var _0x3431=['filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','catch','create','body','find','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','push','ToId','-createdAt','all','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x2a1b86,_0x58ff06){var _0x33546b=function(_0x1cdf36){while(--_0x1cdf36){_0x2a1b86['push'](_0x2a1b86['shift']());}};_0x33546b(++_0x58ff06);}(_0x3431,0xfd));var _0x1343=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x3431[_0xa28b1a];return _0x4c9b78;};'use strict';var emlformat=require(_0x1343('0x0'));var rimraf=require(_0x1343('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1343('0x2'));var moment=require(_0x1343('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1343('0x4'));var util=require(_0x1343('0x5'));var path=require(_0x1343('0x6'));var sox=require(_0x1343('0x7'));var csv=require(_0x1343('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1343('0x9'));var _=require(_0x1343('0xa'));var squel=require('squel');var crypto=require(_0x1343('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1343('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1343('0xc'));var authService=require(_0x1343('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1343('0xe'));var logger=require(_0x1343('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x1343('0x10'));var licenseUtil=require(_0x1343('0x11'));var db=require(_0x1343('0x12'))['db'];config['redis']=_[_0x1343('0x13')](config[_0x1343('0x14')],{'host':_0x1343('0x15'),'port':0x18eb});var socket=require(_0x1343('0x16'))(new Redis(config[_0x1343('0x14')]));require(_0x1343('0x17'))[_0x1343('0x18')](socket);function respondWithStatusCode(_0x49f556,_0x1fcd2c){_0x1fcd2c=_0x1fcd2c||0xcc;return function(_0xf912dc){if(_0xf912dc){return _0x49f556['sendStatus'](_0x1fcd2c);}return _0x49f556[_0x1343('0x19')](_0x1fcd2c)[_0x1343('0x1a')]();};}function respondWithResult(_0x558ae8,_0x2b9c94){_0x2b9c94=_0x2b9c94||0xc8;return function(_0x4b953a){if(_0x4b953a){return _0x558ae8[_0x1343('0x19')](_0x2b9c94)[_0x1343('0x1b')](_0x4b953a);}};}function respondWithFilteredResult(_0x2b788e,_0x38388b){return function(_0x503022){if(_0x503022){var _0x2ac64f=typeof _0x38388b[_0x1343('0x1c')]===_0x1343('0x1d')&&typeof _0x38388b[_0x1343('0x1e')]===_0x1343('0x1d');var _0x3561c0=_0x503022['count'];var _0x526432=_0x2ac64f?0x0:_0x38388b[_0x1343('0x1c')];var _0x87afc=_0x2ac64f?_0x503022[_0x1343('0x1f')]:_0x38388b[_0x1343('0x1c')]+_0x38388b['limit'];var _0x22df3c;if(_0x87afc>=_0x3561c0){_0x87afc=_0x3561c0;_0x22df3c=0xc8;}else{_0x22df3c=0xce;}_0x2b788e[_0x1343('0x19')](_0x22df3c);return _0x2b788e[_0x1343('0x20')](_0x1343('0x21'),_0x526432+'-'+_0x87afc+'/'+_0x3561c0)[_0x1343('0x1b')](_0x503022);}return null;};}function patchUpdates(_0x9e1bc5){return function(_0x5dff77){try{jsonpatch['apply'](_0x5dff77,_0x9e1bc5,!![]);}catch(_0x55850f){return BPromise[_0x1343('0x22')](_0x55850f);}return _0x5dff77[_0x1343('0x23')]();};}function saveUpdates(_0x5b3dc7,_0x4788e4){return function(_0x16f160){if(_0x16f160){return _0x16f160[_0x1343('0x24')](_0x5b3dc7)[_0x1343('0x25')](function(_0x3be5fe){return _0x3be5fe;});}return null;};}function removeEntity(_0x3b93bc,_0xbe06fd){return function(_0x33ce25){if(_0x33ce25){return _0x33ce25[_0x1343('0x26')]()[_0x1343('0x25')](function(){_0x3b93bc[_0x1343('0x19')](0xcc)[_0x1343('0x1a')]();});}};}function handleEntityNotFound(_0x34b50c,_0xabb75d){return function(_0x4b2e64){if(!_0x4b2e64){_0x34b50c[_0x1343('0x27')](0x194);}return _0x4b2e64;};}function handleError(_0x382653,_0x35c9f7){_0x35c9f7=_0x35c9f7||0x1f4;return function(_0x1d2277){logger[_0x1343('0x28')](_0x1d2277[_0x1343('0x29')]);if(_0x1d2277[_0x1343('0x2a')]){delete _0x1d2277['name'];}_0x382653[_0x1343('0x19')](_0x35c9f7)[_0x1343('0x2b')](_0x1d2277);};}exports[_0x1343('0x2c')]=function(_0x3e316c,_0x2234bc){var _0x34e0c0={},_0x528d3e={},_0x4e0dae={'count':0x0,'rows':[]};var _0x1bc3d0=_[_0x1343('0x2d')](db[_0x1343('0x2e')]['rawAttributes'],function(_0x5b1c59){return{'name':_0x5b1c59[_0x1343('0x2f')],'type':_0x5b1c59[_0x1343('0x30')][_0x1343('0x31')]};});_0x528d3e[_0x1343('0x32')]=_[_0x1343('0x2d')](_0x1bc3d0,_0x1343('0x2a'));_0x528d3e[_0x1343('0x33')]=_[_0x1343('0x34')](_0x3e316c[_0x1343('0x33')]);_0x528d3e[_0x1343('0x35')]=_[_0x1343('0x36')](_0x528d3e[_0x1343('0x32')],_0x528d3e[_0x1343('0x33')]);_0x34e0c0[_0x1343('0x37')]=_[_0x1343('0x36')](_0x528d3e[_0x1343('0x32')],qs['fields'](_0x3e316c['query'][_0x1343('0x38')]));_0x34e0c0['attributes']=_0x34e0c0[_0x1343('0x37')]['length']?_0x34e0c0[_0x1343('0x37')]:_0x528d3e[_0x1343('0x32')];if(!_0x3e316c['query']['hasOwnProperty'](_0x1343('0x39'))){_0x34e0c0[_0x1343('0x1e')]=qs[_0x1343('0x1e')](_0x3e316c[_0x1343('0x33')][_0x1343('0x1e')]);_0x34e0c0[_0x1343('0x1c')]=qs[_0x1343('0x1c')](_0x3e316c[_0x1343('0x33')]['offset']);}_0x34e0c0[_0x1343('0x3a')]=qs[_0x1343('0x3b')](_0x3e316c[_0x1343('0x33')]['sort']);_0x34e0c0[_0x1343('0x3c')]=qs[_0x1343('0x35')](_[_0x1343('0x3d')](_0x3e316c['query'],_0x528d3e[_0x1343('0x35')]),_0x1bc3d0);if(_0x3e316c[_0x1343('0x33')][_0x1343('0x3e')]){_0x34e0c0[_0x1343('0x3c')]=_[_0x1343('0x3f')](_0x34e0c0[_0x1343('0x3c')],{'$or':_[_0x1343('0x2d')](_0x1bc3d0,function(_0x479864){if(_0x479864[_0x1343('0x30')]!==_0x1343('0x40')){var _0xf47e30={};_0xf47e30[_0x479864[_0x1343('0x2a')]]={'$like':'%'+_0x3e316c[_0x1343('0x33')][_0x1343('0x3e')]+'%'};return _0xf47e30;}})});}_0x34e0c0=_['merge']({},_0x34e0c0,_0x3e316c[_0x1343('0x41')]);var _0x3336b6={'where':_0x34e0c0[_0x1343('0x3c')]};return db[_0x1343('0x2e')][_0x1343('0x1f')](_0x3336b6)[_0x1343('0x25')](function(_0x19e9a8){_0x4e0dae['count']=_0x19e9a8;if(_0x3e316c[_0x1343('0x33')][_0x1343('0x42')]){_0x34e0c0[_0x1343('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x34e0c0);})[_0x1343('0x25')](function(_0x3452db){_0x4e0dae[_0x1343('0x44')]=_0x3452db;return _0x4e0dae;})['then'](respondWithFilteredResult(_0x2234bc,_0x34e0c0))['catch'](handleError(_0x2234bc,null));};exports[_0x1343('0x45')]=function(_0x248f60,_0x55307e){var _0x1ba198={'raw':!![],'where':{'id':_0x248f60[_0x1343('0x46')]['id']}},_0x17eb0f={};_0x17eb0f['model']=_[_0x1343('0x34')](db[_0x1343('0x2e')]['rawAttributes']);_0x17eb0f[_0x1343('0x33')]=_['keys'](_0x248f60['query']);_0x17eb0f[_0x1343('0x35')]=_[_0x1343('0x36')](_0x17eb0f['model'],_0x17eb0f[_0x1343('0x33')]);_0x1ba198[_0x1343('0x37')]=_[_0x1343('0x36')](_0x17eb0f['model'],qs[_0x1343('0x38')](_0x248f60[_0x1343('0x33')][_0x1343('0x38')]));_0x1ba198[_0x1343('0x37')]=_0x1ba198['attributes'][_0x1343('0x47')]?_0x1ba198[_0x1343('0x37')]:_0x17eb0f[_0x1343('0x32')];if(_0x248f60[_0x1343('0x33')][_0x1343('0x42')]){_0x1ba198['include']=[{'all':!![]}];}_0x1ba198=_[_0x1343('0x3f')]({},_0x1ba198,_0x248f60['options']);return db['ChatInternalMessage']['find'](_0x1ba198)[_0x1343('0x25')](handleEntityNotFound(_0x55307e,null))[_0x1343('0x25')](respondWithResult(_0x55307e,null))[_0x1343('0x48')](handleError(_0x55307e,null));};exports[_0x1343('0x49')]=function(_0x12deb1,_0x115083){return db[_0x1343('0x2e')][_0x1343('0x49')](_0x12deb1[_0x1343('0x4a')],{})[_0x1343('0x25')](respondWithResult(_0x115083,0xc9))[_0x1343('0x48')](handleError(_0x115083,null));};exports[_0x1343('0x24')]=function(_0x131f3c,_0x4bd890){if(_0x131f3c['body']['id']){delete _0x131f3c['body']['id'];}return db[_0x1343('0x2e')]['find']({'where':{'id':_0x131f3c['params']['id']}})[_0x1343('0x25')](handleEntityNotFound(_0x4bd890,null))[_0x1343('0x25')](saveUpdates(_0x131f3c['body'],null))[_0x1343('0x25')](respondWithResult(_0x4bd890,null))['catch'](handleError(_0x4bd890,null));};exports['destroy']=function(_0x1d46d6,_0x545228){return db[_0x1343('0x2e')][_0x1343('0x4b')]({'where':{'id':_0x1d46d6[_0x1343('0x46')]['id']}})['then'](handleEntityNotFound(_0x545228,null))[_0x1343('0x25')](removeEntity(_0x545228,null))['catch'](handleError(_0x545228,null));};exports['describe']=function(_0x53afd5,_0x2de8c3){return db[_0x1343('0x2e')]['describe']()['then'](respondWithResult(_0x2de8c3,null))[_0x1343('0x48')](handleError(_0x2de8c3,null));};function wrapUser(_0x4ada40){return function(_0x50d411){var _0x207a4f=_0x4ada40['get']({'plain':!![]});_0x207a4f[_0x1343('0x4c')]=[];if(_0x50d411){_0x207a4f[_0x1343('0x4d')]=_0x50d411[_0x1343('0x4e')];_0x207a4f['lastMessage']=_0x50d411;}else{_0x207a4f['lastMessageAt']=moment(0x0)[_0x1343('0x4f')](_0x1343('0x50'));_0x207a4f[_0x1343('0x51')]={};}return _0x207a4f;};}exports[_0x1343('0x52')]=function(_0x1ac6ca,_0x23aa9e,_0x299fe9){var _0x20a68d=[];return db[_0x1343('0x53')][_0x1343('0x54')]({'where':{'role':[_0x1343('0x55'),_0x1343('0x56'),_0x1343('0x57')]},'attributes':['id','fullname','name',_0x1343('0x58'),_0x1343('0x59'),_0x1343('0x5a'),_0x1343('0x5b'),_0x1343('0x5c'),_0x1343('0x5d'),_0x1343('0x5e')],'order':qs['sort'](_0x1343('0x5f')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x1343('0x30')],'through':{'attributes':[]}}]})[_0x1343('0x25')](function(_0x694790){if(_0x694790){var _0x21576c=_0x1ac6ca[_0x1343('0x57')][_0x1343('0x60')]({'plain':!![]});if(!_0x21576c)throw new Error(_0x1343('0x61'));if(_0x21576c[_0x1343('0x58')]===_0x1343('0x57')){return db[_0x1343('0x62')][_0x1343('0x4b')]({'where':{'name':_0x1343('0x63'),'userProfileId':_0x21576c['userProfileId']},'raw':!![]})['then'](function(_0x3b6ca8){if(_0x3b6ca8){if(_0x3b6ca8['autoAssociation']===0x0){return db[_0x1343('0x64')][_0x1343('0x54')]({'where':{'sectionId':_0x3b6ca8['id']},'raw':!![]})['then'](function(_0x53f705){var _0x3a6997=[];if(_['isEmpty'](_0x53f705)){_0x3a6997=_[_0x1343('0x3e')](_0x694790,function(_0x39227e){if(_0x39227e[_0x1343('0x58')]!==_0x1343('0x55')){return _0x39227e;}});return _0x3a6997;}else{for(var _0xb228bb=0x0;_0xb228bb<_0x694790['length'];_0xb228bb++){var _0x322bfa=_0x694790[_0xb228bb];if(_0x322bfa[_0x1343('0x58')]===_0x1343('0x55')){var _0x2a02c8=_[_0x1343('0x4b')](_0x53f705,function(_0x27cf55){return _0x27cf55['resourceId']===_0x322bfa['id'];});if(_0x2a02c8)_0x3a6997['push'](_0x322bfa);}else{_0x3a6997[_0x1343('0x65')](_0x322bfa);}}return _0x3a6997;}});}else{return _0x694790;}}else{var _0x44c44a=_[_0x1343('0x3e')](_0x694790,function(_0x49ea16){if(_0x49ea16[_0x1343('0x58')]!==_0x1343('0x55')){return _0x49ea16;}});return _0x44c44a;}});}else{return _0x694790;}}})['then'](function(_0x46e16b){var _0x1fd55d=[];if(_0x46e16b){_0x20a68d=_0x46e16b;for(var _0x2f0541=0x0;_0x2f0541<_0x46e16b[_0x1343('0x47')];_0x2f0541+=0x1){_0x20a68d[_0x2f0541][_0x1343('0x4c')]=[];_0x1fd55d[_0x1343('0x65')](db['ChatInternalMessage'][_0x1343('0x4b')]({'where':{'FromId':[_0x1ac6ca[_0x1343('0x57')]['id'],_0x46e16b[_0x2f0541]['id']],'ToId':[_0x1ac6ca[_0x1343('0x57')]['id'],_0x46e16b[_0x2f0541]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x1343('0x66'),'read','body'],'order':qs[_0x1343('0x3b')](_0x1343('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x46e16b[_0x2f0541])));}return BPromise[_0x1343('0x68')](_0x1fd55d);}return[];})[_0x1343('0x25')](function(_0x4297d3){return{'rows':_0x4297d3,'count':_0x4297d3['length']};})[_0x1343('0x25')](respondWithResult(_0x23aa9e,null))[_0x1343('0x48')](handleError(_0x23aa9e,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 7723c78..4ad91d3 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 _0x4668=['setMaxListeners','update','emit','hasOwnProperty','hook','events','ChatInternalMessage'];(function(_0x268790,_0x23ed2){var _0x5e3108=function(_0xbb9dbc){while(--_0xbb9dbc){_0x268790['push'](_0x268790['shift']());}};_0x5e3108(++_0x23ed2);}(_0x4668,0x101));var _0x8466=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4668[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x8466('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x8466('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8466('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8466('0x3'),'afterDestroy':'remove'};function emitEvent(_0x42537a){return function(_0x17a455,_0x531c2a,_0x4b702a){ChatInternalMessageEvents[_0x8466('0x4')](_0x42537a+':'+_0x17a455['id'],_0x17a455);ChatInternalMessageEvents[_0x8466('0x4')](_0x42537a,_0x17a455);_0x4b702a(null);};}for(var e in events){if(events[_0x8466('0x5')](e)){var event=events[e];ChatInternalMessage[_0x8466('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xd2f0=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x1406cc,_0x324383){var _0x19ea2e=function(_0x145dd6){while(--_0x145dd6){_0x1406cc['push'](_0x1406cc['shift']());}};_0x19ea2e(++_0x324383);}(_0xd2f0,0x13f));var _0x0d2f=function(_0x530538,_0x4e46d4){_0x530538=_0x530538-0x0;var _0x47b2a1=_0xd2f0[_0x530538];return _0x47b2a1;};'use strict';var EventEmitter=require(_0x0d2f('0x0'));var ChatInternalMessage=require(_0x0d2f('0x1'))['db'][_0x0d2f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0d2f('0x3')](0x0);var events={'afterCreate':_0x0d2f('0x4'),'afterUpdate':_0x0d2f('0x5'),'afterDestroy':_0x0d2f('0x6')};function emitEvent(_0x4389ac){return function(_0x3927f4,_0x1e6e66,_0x4467c1){ChatInternalMessageEvents['emit'](_0x4389ac+':'+_0x3927f4['id'],_0x3927f4);ChatInternalMessageEvents[_0x0d2f('0x7')](_0x4389ac,_0x3927f4);_0x4467c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0d2f('0x8')](e,emitEvent(event));}}module[_0x0d2f('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 83ec7ec..f519a27 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 _0x520f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x520f,0x1b2));var _0xf520=function(_0xadd0d2,_0x3bf5b9){_0xadd0d2=_0xadd0d2-0x0;var _0x2d564c=_0x520f[_0xadd0d2];return _0x2d564c;};'use strict';var _=require(_0xf520('0x0'));var util=require(_0xf520('0x1'));var logger=require(_0xf520('0x2'))('api');var moment=require(_0xf520('0x3'));var BPromise=require(_0xf520('0x4'));var rp=require(_0xf520('0x5'));var fs=require('fs');var path=require(_0xf520('0x6'));var rimraf=require('rimraf');var config=require(_0xf520('0x7'));var attributes=require(_0xf520('0x8'));module['exports']=function(_0x435e23,_0x4cb34e){return _0x435e23[_0xf520('0x9')](_0xf520('0xa'),attributes,{'tableName':_0xf520('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf520('0xc'),'collate':_0xf520('0xd')});};
\ No newline at end of file
+var _0x3d4d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1e3cc1,_0x458765){var _0x28fea1=function(_0x3bc9a4){while(--_0x3bc9a4){_0x1e3cc1['push'](_0x1e3cc1['shift']());}};_0x28fea1(++_0x458765);}(_0x3d4d,0x18d));var _0xd3d4=function(_0x399333,_0xbcfa38){_0x399333=_0x399333-0x0;var _0x8733a=_0x3d4d[_0x399333];return _0x8733a;};'use strict';var _=require(_0xd3d4('0x0'));var util=require(_0xd3d4('0x1'));var logger=require('../../config/logger')(_0xd3d4('0x2'));var moment=require(_0xd3d4('0x3'));var BPromise=require(_0xd3d4('0x4'));var rp=require(_0xd3d4('0x5'));var fs=require('fs');var path=require(_0xd3d4('0x6'));var rimraf=require(_0xd3d4('0x7'));var config=require(_0xd3d4('0x8'));var attributes=require(_0xd3d4('0x9'));module[_0xd3d4('0xa')]=function(_0x53661a,_0x10d2e9){return _0x53661a[_0xd3d4('0xb')](_0xd3d4('0xc'),attributes,{'tableName':_0xd3d4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd3d4('0xe'),'collate':_0xd3d4('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 56a362d..9710ec4 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 _0x3731=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','request'];(function(_0x10792c,_0x112ee2){var _0x2594eb=function(_0xff9fde){while(--_0xff9fde){_0x10792c['push'](_0x10792c['shift']());}};_0x2594eb(++_0x112ee2);}(_0x3731,0xba));var _0x1373=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3731[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1373('0x0'));var util=require('util');var moment=require(_0x1373('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1373('0x2'));var logger=require(_0x1373('0x3'))(_0x1373('0x4'));var config=require(_0x1373('0x5'));var jayson=require(_0x1373('0x6'));var client=jayson['client'][_0x1373('0x7')]({'port':0x232a});config[_0x1373('0x8')]=_[_0x1373('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1373('0xa'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x37ae78,_0x2e4c06,_0x2d72fd){return new BPromise(function(_0x248c27,_0x45e39d){return client[_0x1373('0xb')](_0x37ae78,_0x2d72fd)[_0x1373('0xc')](function(_0x46e0ce){logger[_0x1373('0xd')](_0x1373('0xe'),_0x2e4c06,_0x1373('0xf'));logger[_0x1373('0x10')](_0x1373('0x11'),_0x2e4c06,_0x1373('0xf'),JSON['stringify'](_0x46e0ce));if(_0x46e0ce['error']){if(_0x46e0ce[_0x1373('0x12')][_0x1373('0x13')]===0x1f4){logger[_0x1373('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x2e4c06,_0x46e0ce['error'][_0x1373('0x14')]);return _0x45e39d(_0x46e0ce[_0x1373('0x12')][_0x1373('0x14')]);}logger[_0x1373('0x12')](_0x1373('0xe'),_0x2e4c06,_0x46e0ce[_0x1373('0x12')]['message']);return _0x248c27(_0x46e0ce[_0x1373('0x12')]['message']);}else{logger[_0x1373('0xd')](_0x1373('0xe'),_0x2e4c06,'request\x20sent');_0x248c27(_0x46e0ce[_0x1373('0x15')][_0x1373('0x14')]);}})['catch'](function(_0xc3dd56){logger['error'](_0x1373('0xe'),_0x2e4c06,_0xc3dd56);_0x45e39d(_0xc3dd56);});});}
\ No newline at end of file
+var _0x16c6=['error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x16c6,0x18d));var _0x616c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x16c6[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x616c('0x0'));var util=require('util');var moment=require(_0x616c('0x1'));var BPromise=require(_0x616c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x616c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x616c('0x4'));var logger=require(_0x616c('0x5'))(_0x616c('0x6'));var config=require(_0x616c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x616c('0x8')]({'port':0x232a});config[_0x616c('0x9')]=_[_0x616c('0xa')](config[_0x616c('0x9')],{'host':_0x616c('0xb'),'port':0x18eb});var socket=require(_0x616c('0xc'))(new Redis(config['redis']));require(_0x616c('0xd'))[_0x616c('0xe')](socket);function respondWithRpcPromise(_0x39a811,_0x5c7484,_0x3edcfa){return new BPromise(function(_0x257bce,_0x1404c2){return client[_0x616c('0xf')](_0x39a811,_0x3edcfa)[_0x616c('0x10')](function(_0x3d88e6){logger[_0x616c('0x11')](_0x616c('0x12'),_0x5c7484,'request\x20sent');logger[_0x616c('0x13')](_0x616c('0x14'),_0x5c7484,_0x616c('0x15'),JSON[_0x616c('0x16')](_0x3d88e6));if(_0x3d88e6[_0x616c('0x17')]){if(_0x3d88e6[_0x616c('0x17')][_0x616c('0x18')]===0x1f4){logger['error'](_0x616c('0x12'),_0x5c7484,_0x3d88e6['error']['message']);return _0x1404c2(_0x3d88e6['error'][_0x616c('0x19')]);}logger[_0x616c('0x17')](_0x616c('0x12'),_0x5c7484,_0x3d88e6[_0x616c('0x17')][_0x616c('0x19')]);return _0x257bce(_0x3d88e6['error'][_0x616c('0x19')]);}else{logger['info'](_0x616c('0x12'),_0x5c7484,'request\x20sent');_0x257bce(_0x3d88e6[_0x616c('0x1a')][_0x616c('0x19')]);}})[_0x616c('0x1b')](function(_0x2d38f8){logger[_0x616c('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x5c7484,_0x2d38f8);_0x1404c2(_0x2d38f8);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 804c8b3..286ff48 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 _0x8b64=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x8b64,0xb4));var _0x48b6=function(_0x20ecec,_0x54a52f){_0x20ecec=_0x20ecec-0x0;var _0x5c669d=_0x8b64[_0x20ecec];return _0x5c669d;};'use strict';var ChatInternalMessageEvents=require(_0x48b6('0x0'));var events=[_0x48b6('0x1'),'remove',_0x48b6('0x2')];function createListener(_0x9738d,_0x227b4b){return function(_0x16f243){_0x227b4b['emit'](_0x9738d,_0x16f243);};}function removeListener(_0x29b186,_0x5b9eda){return function(){ChatInternalMessageEvents[_0x48b6('0x3')](_0x29b186,_0x5b9eda);};}exports[_0x48b6('0x4')]=function(_0x1d4192){for(var _0x561a1f=0x0,_0x522cd5=events[_0x48b6('0x5')];_0x561a1f<_0x522cd5;_0x561a1f++){var _0x507713=events[_0x561a1f];var _0x1d9fd5=createListener(_0x48b6('0x6')+_0x507713,_0x1d4192);ChatInternalMessageEvents['on'](_0x507713,_0x1d9fd5);}};
\ No newline at end of file
+var _0xe1cd=['length','./chatInternalMessage.events','save','remove','update','removeListener'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0xe1cd,0x175));var _0xde1c=function(_0x489413,_0xea1c39){_0x489413=_0x489413-0x0;var _0x22d38e=_0xe1cd[_0x489413];return _0x22d38e;};'use strict';var ChatInternalMessageEvents=require(_0xde1c('0x0'));var events=[_0xde1c('0x1'),_0xde1c('0x2'),_0xde1c('0x3')];function createListener(_0x1f3f23,_0x5b6d56){return function(_0x3841fd){_0x5b6d56['emit'](_0x1f3f23,_0x3841fd);};}function removeListener(_0x55996e,_0x30e60d){return function(){ChatInternalMessageEvents[_0xde1c('0x4')](_0x55996e,_0x30e60d);};}exports['register']=function(_0x5a1f11){for(var _0x25b398=0x0,_0x1f60df=events[_0xde1c('0x5')];_0x25b398<_0x1f60df;_0x25b398++){var _0xe515c1=events[_0x25b398];var _0x457850=createListener('chatInternalMessage:'+_0xe515c1,_0x5a1f11);ChatInternalMessageEvents['on'](_0xe515c1,_0x457850);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 432bf53..5e3a51d 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 _0xad74=['post','create','put','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0xad74,0x17e));var _0x4ad7=function(_0x34480a,_0x162f49){_0x34480a=_0x34480a-0x0;var _0x47f40d=_0xad74[_0x34480a];return _0x47f40d;};'use strict';var multer=require(_0x4ad7('0x0'));var util=require(_0x4ad7('0x1'));var path=require(_0x4ad7('0x2'));var timeout=require(_0x4ad7('0x3'));var express=require('express');var router=express[_0x4ad7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4ad7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4ad7('0x6'));var controller=require(_0x4ad7('0x7'));router[_0x4ad7('0x8')]('/',auth[_0x4ad7('0x9')](),controller[_0x4ad7('0xa')]);router[_0x4ad7('0x8')](_0x4ad7('0xb'),auth[_0x4ad7('0x9')](),controller[_0x4ad7('0xc')]);router[_0x4ad7('0x8')](_0x4ad7('0xd'),auth[_0x4ad7('0x9')](),controller[_0x4ad7('0xe')]);router['get'](_0x4ad7('0xf'),auth[_0x4ad7('0x9')](),controller[_0x4ad7('0x10')]);router[_0x4ad7('0x11')]('/',auth[_0x4ad7('0x9')](),controller[_0x4ad7('0x12')]);router[_0x4ad7('0x13')](_0x4ad7('0xf'),controller['update']);router[_0x4ad7('0x14')](_0x4ad7('0xf'),auth[_0x4ad7('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6902=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','/:id','update'];(function(_0x57d6e4,_0x8eb6e9){var _0x92c962=function(_0xfcf8be){while(--_0xfcf8be){_0x57d6e4['push'](_0x57d6e4['shift']());}};_0x92c962(++_0x8eb6e9);}(_0x6902,0x145));var _0x2690=function(_0x22d9e9,_0x6f5066){_0x22d9e9=_0x22d9e9-0x0;var _0x26a963=_0x6902[_0x22d9e9];return _0x26a963;};'use strict';var multer=require(_0x2690('0x0'));var util=require('util');var path=require(_0x2690('0x1'));var timeout=require('connect-timeout');var express=require(_0x2690('0x2'));var router=express[_0x2690('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2690('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2690('0x5'));var controller=require(_0x2690('0x6'));router[_0x2690('0x7')]('/',auth[_0x2690('0x8')](),controller[_0x2690('0x9')]);router[_0x2690('0x7')](_0x2690('0xa'),auth[_0x2690('0x8')](),controller[_0x2690('0xb')]);router[_0x2690('0x7')](_0x2690('0xc'),auth[_0x2690('0x8')](),controller[_0x2690('0xd')]);router[_0x2690('0x7')]('/:id',auth[_0x2690('0x8')](),controller[_0x2690('0xe')]);router[_0x2690('0xf')]('/',auth[_0x2690('0x8')](),controller[_0x2690('0x10')]);router[_0x2690('0x11')](_0x2690('0x12'),controller[_0x2690('0x13')]);router[_0x2690('0x14')](_0x2690('0x12'),auth[_0x2690('0x8')](),controller[_0x2690('0x15')]);module[_0x2690('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 4f9b4e2..869ca25 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 _0x263f=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0xddbc76,_0x4838a1){var _0x3d9eec=function(_0x2344e7){while(--_0x2344e7){_0xddbc76['push'](_0xddbc76['shift']());}};_0x3d9eec(++_0x4838a1);}(_0x263f,0x182));var _0xf263=function(_0x356c3e,_0x50dffc){_0x356c3e=_0x356c3e-0x0;var _0x562c2d=_0x263f[_0x356c3e];return _0x562c2d;};'use strict';var Sequelize=require(_0xf263('0x0'));module[_0xf263('0x1')]={'body':{'type':Sequelize[_0xf263('0x2')](_0xf263('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf263('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf263('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf263('0x5')),'defaultValue':_0xf263('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf263('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf263('0x2')]}};
\ No newline at end of file
+var _0x36ee=['ENUM','out','DATE','STRING','TEXT','BOOLEAN'];(function(_0x372ae9,_0x41ebad){var _0x123083=function(_0x515b14){while(--_0x515b14){_0x372ae9['push'](_0x372ae9['shift']());}};_0x123083(++_0x41ebad);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xe36e('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe36e('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe36e('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe36e('0x2')]('in',_0xe36e('0x3')),'defaultValue':_0xe36e('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe36e('0x4')]},'providerName':{'type':Sequelize[_0xe36e('0x5')]},'providerResponse':{'type':Sequelize[_0xe36e('0x0')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index fd04412..16f4bd5 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 _0xde26=['./chatMessage.socket','register','jayson/promise','http','request','then','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update','end','stack','name','send','index','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','ChatMessage','includeAll','show','params','rawAttributes','include','create','body','destroy','find','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','interaction','info','[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','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','parse','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','formData','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost'];(function(_0x4f0a61,_0x1df9a7){var _0x447ea6=function(_0x22577e){while(--_0x22577e){_0x4f0a61['push'](_0x4f0a61['shift']());}};_0x447ea6(++_0x1df9a7);}(_0xde26,0x69));var _0x6de2=function(_0x4a42f0,_0x2da65d){_0x4a42f0=_0x4a42f0-0x0;var _0x3dc532=_0xde26[_0x4a42f0];return _0x3dc532;};'use strict';var emlformat=require(_0x6de2('0x0'));var rimraf=require(_0x6de2('0x1'));var zipdir=require(_0x6de2('0x2'));var jsonpatch=require(_0x6de2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6de2('0x4'));var Mustache=require(_0x6de2('0x5'));var util=require(_0x6de2('0x6'));var path=require('path');var sox=require(_0x6de2('0x7'));var csv=require(_0x6de2('0x8'));var ejs=require(_0x6de2('0x9'));var fs=require('fs');var fs_extra=require(_0x6de2('0xa'));var _=require(_0x6de2('0xb'));var squel=require(_0x6de2('0xc'));var crypto=require(_0x6de2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6de2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6de2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6de2('0x10'));var qs=require(_0x6de2('0x11'));var as=require(_0x6de2('0x12'));var hardwareService=require(_0x6de2('0x13'));var logger=require(_0x6de2('0x14'))(_0x6de2('0x15'));var utils=require(_0x6de2('0x16'));var config=require(_0x6de2('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6de2('0x18')]=_[_0x6de2('0x19')](config[_0x6de2('0x18')],{'host':_0x6de2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6de2('0x18')]));require(_0x6de2('0x1b'))[_0x6de2('0x1c')](socket);var jayson=require(_0x6de2('0x1d'));var client=jayson['client'][_0x6de2('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x6de2('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4c921a,_0x3240d0,_0x507775,_0x258f16){return new BPromise(function(_0x37bb56,_0x4bd8f8){var _0x38c260=_0x258f16||client;return _0x38c260[_0x6de2('0x1f')](_0x4c921a,_0x507775)[_0x6de2('0x20')](function(_0x51a69a){logger['info'](_0x6de2('0x21'),_0x3240d0,'request\x20sent');logger['debug'](_0x6de2('0x22'),_0x3240d0,_0x6de2('0x23'),JSON[_0x6de2('0x24')](_0x51a69a));if(_0x51a69a['error']){if(_0x51a69a[_0x6de2('0x25')][_0x6de2('0x26')]===0x1f4){logger['error'](_0x6de2('0x21'),_0x3240d0,_0x51a69a[_0x6de2('0x25')][_0x6de2('0x27')]);return _0x4bd8f8(_0x51a69a[_0x6de2('0x25')][_0x6de2('0x27')]);}logger[_0x6de2('0x25')](_0x6de2('0x21'),_0x3240d0,_0x51a69a[_0x6de2('0x25')][_0x6de2('0x27')]);return _0x37bb56(_0x51a69a['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3240d0,_0x6de2('0x23'));_0x37bb56(_0x51a69a[_0x6de2('0x28')][_0x6de2('0x27')]);}})[_0x6de2('0x29')](function(_0x445b2e){logger[_0x6de2('0x25')](_0x6de2('0x21'),_0x3240d0,_0x445b2e);_0x4bd8f8(_0x445b2e);});});}function respondWithStatusCode(_0x1ed14e,_0x24d87a){_0x24d87a=_0x24d87a||0xcc;return function(_0x49168){if(_0x49168){return _0x1ed14e[_0x6de2('0x2a')](_0x24d87a);}return _0x1ed14e[_0x6de2('0x2b')](_0x24d87a)['end']();};}function respondWithResult(_0x501cee,_0x4ae355){_0x4ae355=_0x4ae355||0xc8;return function(_0x4731f7){if(_0x4731f7){return _0x501cee[_0x6de2('0x2b')](_0x4ae355)[_0x6de2('0x2c')](_0x4731f7);}};}function respondWithFilteredResult(_0x3c7409,_0x317676){return function(_0x36c422){if(_0x36c422){var _0x2ccf3d=typeof _0x317676[_0x6de2('0x2d')]===_0x6de2('0x2e')&&typeof _0x317676[_0x6de2('0x2f')]==='undefined';var _0x29cc9d=_0x36c422[_0x6de2('0x30')];var _0x338fae=_0x2ccf3d?0x0:_0x317676[_0x6de2('0x2d')];var _0x354cc2=_0x2ccf3d?_0x36c422['count']:_0x317676[_0x6de2('0x2d')]+_0x317676[_0x6de2('0x2f')];var _0x1a38d2;if(_0x354cc2>=_0x29cc9d){_0x354cc2=_0x29cc9d;_0x1a38d2=0xc8;}else{_0x1a38d2=0xce;}_0x3c7409[_0x6de2('0x2b')](_0x1a38d2);return _0x3c7409['set']('Content-Range',_0x338fae+'-'+_0x354cc2+'/'+_0x29cc9d)[_0x6de2('0x2c')](_0x36c422);}return null;};}function patchUpdates(_0x2bf1e2){return function(_0x2f2cd6){try{jsonpatch[_0x6de2('0x31')](_0x2f2cd6,_0x2bf1e2,!![]);}catch(_0x33b03e){return BPromise[_0x6de2('0x32')](_0x33b03e);}return _0x2f2cd6['save']();};}function saveUpdates(_0xfd6553,_0x4c8a31){return function(_0x58e760){if(_0x58e760){return _0x58e760[_0x6de2('0x33')](_0xfd6553)['then'](function(_0x32b07c){return _0x32b07c;});}return null;};}function removeEntity(_0x5d82dd,_0x4866c6){return function(_0x52c8c8){if(_0x52c8c8){return _0x52c8c8['destroy']()['then'](function(){_0x5d82dd[_0x6de2('0x2b')](0xcc)[_0x6de2('0x34')]();});}};}function handleEntityNotFound(_0x58f258,_0x21ba4f){return function(_0x2bd30f){if(!_0x2bd30f){_0x58f258[_0x6de2('0x2a')](0x194);}return _0x2bd30f;};}function handleError(_0x5dc00b,_0x42c820){_0x42c820=_0x42c820||0x1f4;return function(_0x15cb5e){logger[_0x6de2('0x25')](_0x15cb5e[_0x6de2('0x35')]);if(_0x15cb5e[_0x6de2('0x36')]){delete _0x15cb5e[_0x6de2('0x36')];}_0x5dc00b[_0x6de2('0x2b')](_0x42c820)[_0x6de2('0x37')](_0x15cb5e);};}exports[_0x6de2('0x38')]=function(_0x4ad952,_0x4dddd6){var _0x319630={},_0x48c399={},_0x108610={'count':0x0,'rows':[]};var _0x595208=_['map'](db['ChatMessage']['rawAttributes'],function(_0x40d62d){return{'name':_0x40d62d[_0x6de2('0x39')],'type':_0x40d62d[_0x6de2('0x3a')][_0x6de2('0x3b')]};});_0x48c399[_0x6de2('0x3c')]=_[_0x6de2('0x3d')](_0x595208,_0x6de2('0x36'));_0x48c399['query']=_[_0x6de2('0x3e')](_0x4ad952['query']);_0x48c399[_0x6de2('0x3f')]=_['intersection'](_0x48c399['model'],_0x48c399[_0x6de2('0x40')]);_0x319630[_0x6de2('0x41')]=_[_0x6de2('0x42')](_0x48c399[_0x6de2('0x3c')],qs['fields'](_0x4ad952[_0x6de2('0x40')][_0x6de2('0x43')]));_0x319630[_0x6de2('0x41')]=_0x319630[_0x6de2('0x41')]['length']?_0x319630[_0x6de2('0x41')]:_0x48c399[_0x6de2('0x3c')];if(!_0x4ad952[_0x6de2('0x40')][_0x6de2('0x44')](_0x6de2('0x45'))){_0x319630['limit']=qs[_0x6de2('0x2f')](_0x4ad952[_0x6de2('0x40')][_0x6de2('0x2f')]);_0x319630[_0x6de2('0x2d')]=qs[_0x6de2('0x2d')](_0x4ad952[_0x6de2('0x40')][_0x6de2('0x2d')]);}_0x319630[_0x6de2('0x46')]=qs[_0x6de2('0x47')](_0x4ad952[_0x6de2('0x40')]['sort']);_0x319630['where']=qs['filters'](_['pick'](_0x4ad952[_0x6de2('0x40')],_0x48c399[_0x6de2('0x3f')]),_0x595208);if(_0x4ad952[_0x6de2('0x40')]['filter']){_0x319630[_0x6de2('0x48')]=_['merge'](_0x319630[_0x6de2('0x48')],{'$or':_['map'](_0x595208,function(_0x4e2906){if(_0x4e2906['type']!==_0x6de2('0x49')){var _0x1db23d={};_0x1db23d[_0x4e2906[_0x6de2('0x36')]]={'$like':'%'+_0x4ad952[_0x6de2('0x40')][_0x6de2('0x4a')]+'%'};return _0x1db23d;}})});}_0x319630=_[_0x6de2('0x4b')]({},_0x319630,_0x4ad952[_0x6de2('0x4c')]);var _0x2ed357={'where':_0x319630['where']};return db[_0x6de2('0x4d')][_0x6de2('0x30')](_0x2ed357)['then'](function(_0x36accd){_0x108610[_0x6de2('0x30')]=_0x36accd;if(_0x4ad952['query'][_0x6de2('0x4e')]){_0x319630['include']=[{'all':!![]}];}return db[_0x6de2('0x4d')]['findAll'](_0x319630);})['then'](function(_0x5e920a){_0x108610['rows']=_0x5e920a;return _0x108610;})[_0x6de2('0x20')](respondWithFilteredResult(_0x4dddd6,_0x319630))['catch'](handleError(_0x4dddd6,null));};exports[_0x6de2('0x4f')]=function(_0x2de905,_0x123678){var _0x2ee7bd={'raw':!![],'where':{'id':_0x2de905[_0x6de2('0x50')]['id']}},_0x39babb={};_0x39babb[_0x6de2('0x3c')]=_[_0x6de2('0x3e')](db[_0x6de2('0x4d')][_0x6de2('0x51')]);_0x39babb[_0x6de2('0x40')]=_[_0x6de2('0x3e')](_0x2de905[_0x6de2('0x40')]);_0x39babb['filters']=_['intersection'](_0x39babb['model'],_0x39babb['query']);_0x2ee7bd['attributes']=_[_0x6de2('0x42')](_0x39babb[_0x6de2('0x3c')],qs[_0x6de2('0x43')](_0x2de905[_0x6de2('0x40')][_0x6de2('0x43')]));_0x2ee7bd[_0x6de2('0x41')]=_0x2ee7bd['attributes']['length']?_0x2ee7bd[_0x6de2('0x41')]:_0x39babb[_0x6de2('0x3c')];if(_0x2de905[_0x6de2('0x40')][_0x6de2('0x4e')]){_0x2ee7bd[_0x6de2('0x52')]=[{'all':!![]}];}_0x2ee7bd=_[_0x6de2('0x4b')]({},_0x2ee7bd,_0x2de905[_0x6de2('0x4c')]);return db[_0x6de2('0x4d')]['find'](_0x2ee7bd)[_0x6de2('0x20')](handleEntityNotFound(_0x123678,null))[_0x6de2('0x20')](respondWithResult(_0x123678,null))[_0x6de2('0x29')](handleError(_0x123678,null));};exports['create']=function(_0x49031d,_0x30d14b){return db[_0x6de2('0x4d')][_0x6de2('0x53')](_0x49031d[_0x6de2('0x54')],{})['then'](respondWithResult(_0x30d14b,0xc9))[_0x6de2('0x29')](handleError(_0x30d14b,null));};exports[_0x6de2('0x33')]=function(_0x550c70,_0x1945f2){if(_0x550c70[_0x6de2('0x54')]['id']){delete _0x550c70[_0x6de2('0x54')]['id'];}return db[_0x6de2('0x4d')]['find']({'where':{'id':_0x550c70[_0x6de2('0x50')]['id']}})[_0x6de2('0x20')](handleEntityNotFound(_0x1945f2,null))['then'](saveUpdates(_0x550c70[_0x6de2('0x54')],null))['then'](respondWithResult(_0x1945f2,null))['catch'](handleError(_0x1945f2,null));};exports[_0x6de2('0x55')]=function(_0x1c24e0,_0x38671d){return db[_0x6de2('0x4d')][_0x6de2('0x56')]({'where':{'id':_0x1c24e0[_0x6de2('0x50')]['id']}})[_0x6de2('0x20')](handleEntityNotFound(_0x38671d,null))['then'](removeEntity(_0x38671d,null))['catch'](handleError(_0x38671d,null));};exports[_0x6de2('0x57')]=function(_0x2411af,_0x28e5e4){return db[_0x6de2('0x4d')][_0x6de2('0x57')]()[_0x6de2('0x20')](respondWithResult(_0x28e5e4,null))[_0x6de2('0x29')](handleError(_0x28e5e4,null));};var interaction_log=require(_0x6de2('0x14'))(_0x6de2('0x58'));exports['accept']=function(_0x56e5c8,_0x1cbaa3,_0x56012){var _0x578d11={'agent':{},'channel':_0x6de2('0x59')};if(_0x56e5c8[_0x6de2('0x54')]['id']){delete _0x56e5c8[_0x6de2('0x54')]['id'];}_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5a')]=!![];_0x56e5c8['body'][_0x6de2('0x5b')]=moment()[_0x6de2('0x5c')](_0x6de2('0x5d'));_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')]=_0x56e5c8[_0x6de2('0x54')]['UserId']||_0x56e5c8[_0x6de2('0x5f')]['id'];_0x578d11[_0x6de2('0x60')]['id']=_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')];return db[_0x6de2('0x4d')][_0x6de2('0x56')]({'where':{'id':_0x56e5c8[_0x6de2('0x50')]['id'],'UserId':null}})[_0x6de2('0x20')](handleEntityNotFound(_0x1cbaa3,null))['then'](saveUpdates(_0x56e5c8[_0x6de2('0x54')],null))[_0x6de2('0x20')](function(_0x3b4381){if(_0x3b4381){_0x578d11[_0x6de2('0x27')]=_0x3b4381[_0x6de2('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x6de2('0x56')]({'where':{'id':_0x3b4381[_0x6de2('0x62')]}});}return null;})[_0x6de2('0x20')](handleEntityNotFound(_0x1cbaa3,null))['then'](function(_0x31c81e){if(_0x31c81e){return _0x31c81e[_0x6de2('0x33')]({'UserId':_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')],'read1stAt':_['isNil'](_0x31c81e[_0x6de2('0x63')])?moment()[_0x6de2('0x5c')](_0x6de2('0x5d')):undefined});}return null;})[_0x6de2('0x20')](function(_0x134502){if(_0x134502){_0x578d11[_0x6de2('0x64')]=_0x134502[_0x6de2('0x61')]({'plain':!![]});interaction_log[_0x6de2('0x65')](_0x6de2('0x66'),_0x56e5c8[_0x6de2('0x5f')]['id'],_0x56e5c8[_0x6de2('0x5f')][_0x6de2('0x36')],_0x56e5c8['user'][_0x6de2('0x67')],_0x578d11[_0x6de2('0x64')]['id'],_0x56e5c8[_0x6de2('0x54')]?JSON[_0x6de2('0x24')](_0x56e5c8[_0x6de2('0x54')]):_0x6de2('0x68'));return respondWithRpcPromise(_0x6de2('0x69'),_0x6de2('0x6a'),_0x578d11);}return null;})[_0x6de2('0x20')](function(_0x1c6431){var _0x15f220=_0x6de2('0x6b')+_0x1c6431[_0x6de2('0x27')][_0x6de2('0x6c')];return db[_0x6de2('0x6d')][_0x6de2('0x40')](_0x15f220,{'type':db[_0x6de2('0x6e')][_0x6de2('0x6f')][_0x6de2('0x70')],'raw':!![]})[_0x6de2('0x20')](function(_0x50ba0c){return _0x50ba0c;});})[_0x6de2('0x20')](function(_0x5d040a){if(_0x5d040a){_0x578d11[_0x6de2('0x27')][_0x6de2('0x71')]=_0x5d040a[0x0];if(!_0x56e5c8['body'][_0x6de2('0x5e')])return;return db[_0x6de2('0x72')]['find']({'where':{'id':_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x5e')],'role':_0x6de2('0x60')},'attributes':['id',_0x6de2('0x36'),_0x6de2('0x73'),'email',_0x6de2('0x74')],'raw':!![]});}return null;})[_0x6de2('0x20')](function(_0x1e6e60){if(!_0x1e6e60)return null;_0x578d11[_0x6de2('0x27')][_0x6de2('0x60')]=_0x1e6e60;return _0x578d11;})[_0x6de2('0x20')](function(_0x23fb7e){if(_0x23fb7e){if(_0x56e5c8[_0x6de2('0x54')][_0x6de2('0x75')]){_0x578d11[_0x6de2('0x27')][_0x6de2('0x76')]=util['format'](_0x6de2('0x77'),_0x56e5c8[_0x6de2('0x5f')][_0x6de2('0x36')]);_0x578d11[_0x6de2('0x27')][_0x6de2('0x78')]=_0x578d11[_0x6de2('0x78')];_0x578d11[_0x6de2('0x27')][_0x6de2('0x79')]=_0x578d11['channel'];_0x578d11[_0x6de2('0x27')]['event']=_0x6de2('0x7a');return respondWithRpcPromise(_0x6de2('0x7b'),_0x6de2('0x7b'),{'event':_0x6de2('0x7c'),'message':_['merge'](_0x578d11[_0x6de2('0x27')],JSON[_0x6de2('0x7d')](_0x578d11['interaction']['formData']))},client9002)[_0x6de2('0x20')](function(){return _0x578d11;});}return _0x578d11;}return null;})['then'](respondWithResult(_0x1cbaa3,null))['catch'](handleError(_0x1cbaa3,null));};var interaction_log=require(_0x6de2('0x14'))(_0x6de2('0x58'));exports['reject']=function(_0x58062e,_0x569237,_0x592867){var _0x4287d3={'agent':{},'channel':'chat'};if(_0x58062e[_0x6de2('0x54')]['id']){delete _0x58062e['body']['id'];}_0x58062e['body'][_0x6de2('0x5e')]=_0x58062e[_0x6de2('0x54')][_0x6de2('0x5e')]||_0x58062e['user']['id'];_0x4287d3[_0x6de2('0x60')]['id']=_0x58062e[_0x6de2('0x54')]['UserId'];return db[_0x6de2('0x4d')]['find']({'where':{'id':_0x58062e[_0x6de2('0x50')]['id'],'UserId':null}})[_0x6de2('0x20')](handleEntityNotFound(_0x569237,null))[_0x6de2('0x20')](function(_0x345371){if(_0x345371){_0x4287d3['message']=_0x345371['get']({'plain':!![]});return db[_0x6de2('0x7e')]['find']({'where':{'id':_0x345371[_0x6de2('0x62')]}});}return null;})[_0x6de2('0x20')](handleEntityNotFound(_0x569237,null))[_0x6de2('0x20')](function(_0x4d4d0e){if(_0x4d4d0e){_0x4287d3[_0x6de2('0x64')]=_0x4d4d0e[_0x6de2('0x61')]({'plain':!![]});interaction_log['info'](_0x6de2('0x7f'),_0x58062e[_0x6de2('0x5f')]['id'],_0x58062e[_0x6de2('0x5f')][_0x6de2('0x36')],_0x58062e[_0x6de2('0x5f')][_0x6de2('0x67')],_0x4287d3[_0x6de2('0x64')]['id'],_0x58062e['body']?JSON['stringify'](_0x58062e['body']):_0x6de2('0x68'));return respondWithRpcPromise(_0x6de2('0x80'),_0x6de2('0x81'),_0x4287d3);}return null;})[_0x6de2('0x20')](function(_0x4b0dc5){var _0x324861=_0x6de2('0x6b')+_0x4b0dc5[_0x6de2('0x27')][_0x6de2('0x6c')];return db[_0x6de2('0x6d')][_0x6de2('0x40')](_0x324861,{'type':db[_0x6de2('0x6e')][_0x6de2('0x6f')][_0x6de2('0x70')],'raw':!![]})[_0x6de2('0x20')](function(_0x3d1a18){return _0x3d1a18;});})[_0x6de2('0x20')](function(_0x3f5846){if(_0x3f5846){_0x4287d3[_0x6de2('0x27')]['contact']=_0x3f5846[0x0];if(!_0x58062e['body']['UserId'])return;return db[_0x6de2('0x72')]['find']({'where':{'id':_0x58062e[_0x6de2('0x54')]['UserId'],'role':_0x6de2('0x60')},'attributes':['id',_0x6de2('0x36'),'fullname','email',_0x6de2('0x74')],'raw':!![]});}return null;})[_0x6de2('0x20')](function(_0x3f8ce2){if(!_0x3f8ce2)return null;_0x4287d3[_0x6de2('0x27')][_0x6de2('0x60')]=_0x3f8ce2;return _0x4287d3;})[_0x6de2('0x20')](function(_0x55327d){if(_0x55327d){_0x55327d['message'][_0x6de2('0x76')]=util[_0x6de2('0x5c')](_0x6de2('0x77'),_0x58062e[_0x6de2('0x5f')][_0x6de2('0x36')]);_0x55327d['message'][_0x6de2('0x78')]=_0x4287d3[_0x6de2('0x78')];_0x55327d[_0x6de2('0x27')][_0x6de2('0x79')]=_0x4287d3[_0x6de2('0x78')];_0x55327d[_0x6de2('0x27')][_0x6de2('0x82')]='reject';respondWithRpcPromise(_0x6de2('0x7b'),_0x6de2('0x7b'),{'event':'rejectmessage','message':_[_0x6de2('0x4b')](_0x4287d3[_0x6de2('0x27')],JSON[_0x6de2('0x7d')](_0x4287d3[_0x6de2('0x64')][_0x6de2('0x83')]))},client9002);return _0x4287d3;}return null;})[_0x6de2('0x20')](respondWithResult(_0x569237,null))['catch'](handleError(_0x569237,null));};
\ No newline at end of file
+var _0x6c07=['user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','channel','motionChannel','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','interface','SIP/%s','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','then','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','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','filters','create','body','find','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x31d8a6,_0x32e347){var _0x54772a=function(_0x546322){while(--_0x546322){_0x31d8a6['push'](_0x31d8a6['shift']());}};_0x54772a(++_0x32e347);}(_0x6c07,0xaa));var _0x76c0=function(_0x5099d0,_0x48bd45){_0x5099d0=_0x5099d0-0x0;var _0x1cef16=_0x6c07[_0x5099d0];return _0x1cef16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76c0('0x0'));var zipdir=require(_0x76c0('0x1'));var jsonpatch=require(_0x76c0('0x2'));var rp=require(_0x76c0('0x3'));var moment=require(_0x76c0('0x4'));var BPromise=require(_0x76c0('0x5'));var Mustache=require(_0x76c0('0x6'));var util=require(_0x76c0('0x7'));var path=require('path');var sox=require(_0x76c0('0x8'));var csv=require('to-csv');var ejs=require(_0x76c0('0x9'));var fs=require('fs');var fs_extra=require(_0x76c0('0xa'));var _=require(_0x76c0('0xb'));var squel=require(_0x76c0('0xc'));var crypto=require(_0x76c0('0xd'));var jsforce=require(_0x76c0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x76c0('0xf'));var querystring=require(_0x76c0('0x10'));var Papa=require('papaparse');var Redis=require(_0x76c0('0x11'));var authService=require(_0x76c0('0x12'));var qs=require(_0x76c0('0x13'));var as=require(_0x76c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x76c0('0x15'))(_0x76c0('0x16'));var utils=require('../../config/utils');var config=require(_0x76c0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x76c0('0x18')]=_[_0x76c0('0x19')](config[_0x76c0('0x18')],{'host':_0x76c0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x76c0('0x1b'))['register'](socket);var jayson=require(_0x76c0('0x1c'));var client=jayson[_0x76c0('0x1d')][_0x76c0('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x76c0('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3ec4ec,_0x2d228d,_0x52bbc8,_0x28769f){return new BPromise(function(_0x49a69e,_0x35d77d){var _0x312f29=_0x28769f||client;return _0x312f29[_0x76c0('0x1f')](_0x3ec4ec,_0x52bbc8)[_0x76c0('0x20')](function(_0x4a904e){logger[_0x76c0('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2d228d,_0x76c0('0x22'));logger[_0x76c0('0x23')](_0x76c0('0x24'),_0x2d228d,_0x76c0('0x22'),JSON[_0x76c0('0x25')](_0x4a904e));if(_0x4a904e[_0x76c0('0x26')]){if(_0x4a904e[_0x76c0('0x26')][_0x76c0('0x27')]===0x1f4){logger['error'](_0x76c0('0x28'),_0x2d228d,_0x4a904e[_0x76c0('0x26')][_0x76c0('0x29')]);return _0x35d77d(_0x4a904e['error'][_0x76c0('0x29')]);}logger[_0x76c0('0x26')](_0x76c0('0x28'),_0x2d228d,_0x4a904e[_0x76c0('0x26')]['message']);return _0x49a69e(_0x4a904e[_0x76c0('0x26')][_0x76c0('0x29')]);}else{logger[_0x76c0('0x21')](_0x76c0('0x28'),_0x2d228d,'request\x20sent');_0x49a69e(_0x4a904e[_0x76c0('0x2a')][_0x76c0('0x29')]);}})[_0x76c0('0x2b')](function(_0x5bf23c){logger[_0x76c0('0x26')](_0x76c0('0x28'),_0x2d228d,_0x5bf23c);_0x35d77d(_0x5bf23c);});});}function respondWithStatusCode(_0x1a934f,_0x325db8){_0x325db8=_0x325db8||0xcc;return function(_0x381f30){if(_0x381f30){return _0x1a934f[_0x76c0('0x2c')](_0x325db8);}return _0x1a934f[_0x76c0('0x2d')](_0x325db8)[_0x76c0('0x2e')]();};}function respondWithResult(_0x20cd78,_0x2eb779){_0x2eb779=_0x2eb779||0xc8;return function(_0x275316){if(_0x275316){return _0x20cd78[_0x76c0('0x2d')](_0x2eb779)['json'](_0x275316);}};}function respondWithFilteredResult(_0x22792,_0x5ec8ae){return function(_0x160adb){if(_0x160adb){var _0x6bf734=typeof _0x5ec8ae[_0x76c0('0x2f')]===_0x76c0('0x30')&&typeof _0x5ec8ae[_0x76c0('0x31')]==='undefined';var _0x47c62c=_0x160adb[_0x76c0('0x32')];var _0x223372=_0x6bf734?0x0:_0x5ec8ae[_0x76c0('0x2f')];var _0x71580=_0x6bf734?_0x160adb[_0x76c0('0x32')]:_0x5ec8ae[_0x76c0('0x2f')]+_0x5ec8ae[_0x76c0('0x31')];var _0x5810e8;if(_0x71580>=_0x47c62c){_0x71580=_0x47c62c;_0x5810e8=0xc8;}else{_0x5810e8=0xce;}_0x22792['status'](_0x5810e8);return _0x22792[_0x76c0('0x33')](_0x76c0('0x34'),_0x223372+'-'+_0x71580+'/'+_0x47c62c)['json'](_0x160adb);}return null;};}function patchUpdates(_0x27ced0){return function(_0x169f9f){try{jsonpatch['apply'](_0x169f9f,_0x27ced0,!![]);}catch(_0xb7e9f0){return BPromise[_0x76c0('0x35')](_0xb7e9f0);}return _0x169f9f[_0x76c0('0x36')]();};}function saveUpdates(_0x64cbe2,_0x7d091b){return function(_0x499b7d){if(_0x499b7d){return _0x499b7d[_0x76c0('0x37')](_0x64cbe2)['then'](function(_0x57e671){return _0x57e671;});}return null;};}function removeEntity(_0x51872c,_0x5289e5){return function(_0x5910d1){if(_0x5910d1){return _0x5910d1[_0x76c0('0x38')]()[_0x76c0('0x20')](function(){_0x51872c[_0x76c0('0x2d')](0xcc)[_0x76c0('0x2e')]();});}};}function handleEntityNotFound(_0x185ee4,_0x4ac954){return function(_0x1f7b61){if(!_0x1f7b61){_0x185ee4[_0x76c0('0x2c')](0x194);}return _0x1f7b61;};}function handleError(_0xa83fa8,_0x127726){_0x127726=_0x127726||0x1f4;return function(_0x3c0878){logger['error'](_0x3c0878[_0x76c0('0x39')]);if(_0x3c0878[_0x76c0('0x3a')]){delete _0x3c0878[_0x76c0('0x3a')];}_0xa83fa8[_0x76c0('0x2d')](_0x127726)['send'](_0x3c0878);};}exports[_0x76c0('0x3b')]=function(_0x42e777,_0x2b02a3){var _0x251b2a={},_0x452289={},_0x8b8775={'count':0x0,'rows':[]};var _0x453d9a=_[_0x76c0('0x3c')](db[_0x76c0('0x3d')][_0x76c0('0x3e')],function(_0x5e9d0c){return{'name':_0x5e9d0c[_0x76c0('0x3f')],'type':_0x5e9d0c[_0x76c0('0x40')]['key']};});_0x452289[_0x76c0('0x41')]=_['map'](_0x453d9a,_0x76c0('0x3a'));_0x452289[_0x76c0('0x42')]=_['keys'](_0x42e777[_0x76c0('0x42')]);_0x452289['filters']=_[_0x76c0('0x43')](_0x452289[_0x76c0('0x41')],_0x452289[_0x76c0('0x42')]);_0x251b2a[_0x76c0('0x44')]=_[_0x76c0('0x43')](_0x452289[_0x76c0('0x41')],qs['fields'](_0x42e777[_0x76c0('0x42')][_0x76c0('0x45')]));_0x251b2a[_0x76c0('0x44')]=_0x251b2a[_0x76c0('0x44')][_0x76c0('0x46')]?_0x251b2a[_0x76c0('0x44')]:_0x452289['model'];if(!_0x42e777[_0x76c0('0x42')][_0x76c0('0x47')](_0x76c0('0x48'))){_0x251b2a['limit']=qs['limit'](_0x42e777['query'][_0x76c0('0x31')]);_0x251b2a['offset']=qs[_0x76c0('0x2f')](_0x42e777[_0x76c0('0x42')][_0x76c0('0x2f')]);}_0x251b2a[_0x76c0('0x49')]=qs[_0x76c0('0x4a')](_0x42e777[_0x76c0('0x42')][_0x76c0('0x4a')]);_0x251b2a[_0x76c0('0x4b')]=qs['filters'](_[_0x76c0('0x4c')](_0x42e777[_0x76c0('0x42')],_0x452289['filters']),_0x453d9a);if(_0x42e777[_0x76c0('0x42')][_0x76c0('0x4d')]){_0x251b2a[_0x76c0('0x4b')]=_[_0x76c0('0x4e')](_0x251b2a[_0x76c0('0x4b')],{'$or':_[_0x76c0('0x3c')](_0x453d9a,function(_0x522411){if(_0x522411[_0x76c0('0x40')]!=='VIRTUAL'){var _0x4c7c89={};_0x4c7c89[_0x522411[_0x76c0('0x3a')]]={'$like':'%'+_0x42e777['query'][_0x76c0('0x4d')]+'%'};return _0x4c7c89;}})});}_0x251b2a=_[_0x76c0('0x4e')]({},_0x251b2a,_0x42e777[_0x76c0('0x4f')]);var _0x528948={'where':_0x251b2a[_0x76c0('0x4b')]};return db[_0x76c0('0x3d')][_0x76c0('0x32')](_0x528948)[_0x76c0('0x20')](function(_0x3cbfe7){_0x8b8775['count']=_0x3cbfe7;if(_0x42e777[_0x76c0('0x42')][_0x76c0('0x50')]){_0x251b2a[_0x76c0('0x51')]=[{'all':!![]}];}return db[_0x76c0('0x3d')][_0x76c0('0x52')](_0x251b2a);})[_0x76c0('0x20')](function(_0x40c633){_0x8b8775[_0x76c0('0x53')]=_0x40c633;return _0x8b8775;})[_0x76c0('0x20')](respondWithFilteredResult(_0x2b02a3,_0x251b2a))[_0x76c0('0x2b')](handleError(_0x2b02a3,null));};exports[_0x76c0('0x54')]=function(_0x178f0f,_0x240654){var _0x16e282={'raw':!![],'where':{'id':_0x178f0f[_0x76c0('0x55')]['id']}},_0x592dfa={};_0x592dfa[_0x76c0('0x41')]=_[_0x76c0('0x56')](db[_0x76c0('0x3d')][_0x76c0('0x3e')]);_0x592dfa['query']=_[_0x76c0('0x56')](_0x178f0f[_0x76c0('0x42')]);_0x592dfa[_0x76c0('0x57')]=_[_0x76c0('0x43')](_0x592dfa[_0x76c0('0x41')],_0x592dfa[_0x76c0('0x42')]);_0x16e282[_0x76c0('0x44')]=_[_0x76c0('0x43')](_0x592dfa[_0x76c0('0x41')],qs[_0x76c0('0x45')](_0x178f0f[_0x76c0('0x42')]['fields']));_0x16e282[_0x76c0('0x44')]=_0x16e282['attributes'][_0x76c0('0x46')]?_0x16e282[_0x76c0('0x44')]:_0x592dfa[_0x76c0('0x41')];if(_0x178f0f[_0x76c0('0x42')][_0x76c0('0x50')]){_0x16e282[_0x76c0('0x51')]=[{'all':!![]}];}_0x16e282=_[_0x76c0('0x4e')]({},_0x16e282,_0x178f0f[_0x76c0('0x4f')]);return db[_0x76c0('0x3d')]['find'](_0x16e282)[_0x76c0('0x20')](handleEntityNotFound(_0x240654,null))[_0x76c0('0x20')](respondWithResult(_0x240654,null))[_0x76c0('0x2b')](handleError(_0x240654,null));};exports[_0x76c0('0x58')]=function(_0xd05651,_0x48d0e0){return db[_0x76c0('0x3d')][_0x76c0('0x58')](_0xd05651[_0x76c0('0x59')],{})[_0x76c0('0x20')](respondWithResult(_0x48d0e0,0xc9))['catch'](handleError(_0x48d0e0,null));};exports[_0x76c0('0x37')]=function(_0xda9571,_0x49d171){if(_0xda9571[_0x76c0('0x59')]['id']){delete _0xda9571[_0x76c0('0x59')]['id'];}return db['ChatMessage'][_0x76c0('0x5a')]({'where':{'id':_0xda9571[_0x76c0('0x55')]['id']}})[_0x76c0('0x20')](handleEntityNotFound(_0x49d171,null))['then'](saveUpdates(_0xda9571['body'],null))[_0x76c0('0x20')](respondWithResult(_0x49d171,null))[_0x76c0('0x2b')](handleError(_0x49d171,null));};exports[_0x76c0('0x38')]=function(_0x7a17a2,_0x12fe72){return db['ChatMessage'][_0x76c0('0x5a')]({'where':{'id':_0x7a17a2[_0x76c0('0x55')]['id']}})[_0x76c0('0x20')](handleEntityNotFound(_0x12fe72,null))[_0x76c0('0x20')](removeEntity(_0x12fe72,null))['catch'](handleError(_0x12fe72,null));};exports['describe']=function(_0x516009,_0x31f93c){return db[_0x76c0('0x3d')][_0x76c0('0x5b')]()[_0x76c0('0x20')](respondWithResult(_0x31f93c,null))[_0x76c0('0x2b')](handleError(_0x31f93c,null));};var interaction_log=require('../../config/logger')(_0x76c0('0x5c'));exports['accept']=function(_0x519d9b,_0x5a57c8,_0x59a980){var _0x431c82={'agent':{},'channel':'chat'};if(_0x519d9b[_0x76c0('0x59')]['id']){delete _0x519d9b[_0x76c0('0x59')]['id'];}_0x519d9b[_0x76c0('0x59')][_0x76c0('0x5d')]=!![];_0x519d9b[_0x76c0('0x59')][_0x76c0('0x5e')]=moment()[_0x76c0('0x5f')](_0x76c0('0x60'));_0x519d9b['body'][_0x76c0('0x61')]=_0x519d9b['body'][_0x76c0('0x61')]||_0x519d9b[_0x76c0('0x62')]['id'];_0x431c82['agent']['id']=_0x519d9b['body'][_0x76c0('0x61')];return db[_0x76c0('0x3d')][_0x76c0('0x5a')]({'where':{'id':_0x519d9b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5a57c8,null))['then'](saveUpdates(_0x519d9b[_0x76c0('0x59')],null))[_0x76c0('0x20')](function(_0x3040ee){if(_0x3040ee){_0x431c82['message']=_0x3040ee[_0x76c0('0x63')]({'plain':!![]});return db[_0x76c0('0x64')][_0x76c0('0x5a')]({'where':{'id':_0x3040ee[_0x76c0('0x65')]}});}return null;})[_0x76c0('0x20')](handleEntityNotFound(_0x5a57c8,null))[_0x76c0('0x20')](function(_0x23c820){if(_0x23c820){return _0x23c820[_0x76c0('0x37')]({'UserId':_0x519d9b[_0x76c0('0x59')][_0x76c0('0x61')],'read1stAt':_[_0x76c0('0x66')](_0x23c820[_0x76c0('0x67')])?moment()[_0x76c0('0x5f')](_0x76c0('0x60')):undefined});}return null;})[_0x76c0('0x20')](function(_0x2aa82c){if(_0x2aa82c){_0x431c82[_0x76c0('0x68')]=_0x2aa82c[_0x76c0('0x63')]({'plain':!![]});interaction_log[_0x76c0('0x21')](_0x76c0('0x69'),_0x519d9b[_0x76c0('0x62')]['id'],_0x519d9b['user'][_0x76c0('0x3a')],_0x519d9b['user'][_0x76c0('0x6a')],_0x431c82[_0x76c0('0x68')]['id'],_0x519d9b[_0x76c0('0x59')]?JSON['stringify'](_0x519d9b[_0x76c0('0x59')]):_0x76c0('0x6b'));return respondWithRpcPromise(_0x76c0('0x6c'),'acceptMessage',_0x431c82);}return null;})[_0x76c0('0x20')](function(_0x4969e1){var _0x583d80=_0x76c0('0x6d')+_0x4969e1['message'][_0x76c0('0x6e')];return db[_0x76c0('0x6f')][_0x76c0('0x42')](_0x583d80,{'type':db[_0x76c0('0x70')][_0x76c0('0x71')][_0x76c0('0x72')],'raw':!![]})[_0x76c0('0x20')](function(_0x3bb4e2){return _0x3bb4e2;});})[_0x76c0('0x20')](function(_0x393794){if(_0x393794){_0x431c82[_0x76c0('0x29')][_0x76c0('0x73')]=_0x393794[0x0];if(!_0x519d9b[_0x76c0('0x59')][_0x76c0('0x61')])return;return db[_0x76c0('0x74')][_0x76c0('0x5a')]({'where':{'id':_0x519d9b['body']['UserId'],'role':_0x76c0('0x75')},'attributes':['id',_0x76c0('0x3a'),_0x76c0('0x76'),_0x76c0('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1f80f3){if(!_0x1f80f3)return null;_0x431c82[_0x76c0('0x29')][_0x76c0('0x75')]=_0x1f80f3;return _0x431c82;})[_0x76c0('0x20')](function(_0xf86ae5){if(_0xf86ae5){if(_0x519d9b[_0x76c0('0x59')][_0x76c0('0x78')]){_0x431c82[_0x76c0('0x29')]['interface']=util[_0x76c0('0x5f')]('SIP/%s',_0x519d9b['user']['name']);_0x431c82[_0x76c0('0x29')][_0x76c0('0x79')]=_0x431c82[_0x76c0('0x79')];_0x431c82[_0x76c0('0x29')][_0x76c0('0x7a')]=_0x431c82['channel'];_0x431c82[_0x76c0('0x29')]['event']='accept';return respondWithRpcPromise('EventManager',_0x76c0('0x7b'),{'event':_0x76c0('0x7c'),'message':_[_0x76c0('0x4e')](_0x431c82[_0x76c0('0x29')],JSON[_0x76c0('0x7d')](_0x431c82[_0x76c0('0x68')][_0x76c0('0x7e')]))},client9002)[_0x76c0('0x20')](function(){return _0x431c82;});}return _0x431c82;}return null;})['then'](respondWithResult(_0x5a57c8,null))['catch'](handleError(_0x5a57c8,null));};var interaction_log=require(_0x76c0('0x15'))(_0x76c0('0x5c'));exports['reject']=function(_0x276640,_0x34893e,_0x5ca770){var _0x3768b0={'agent':{},'channel':'chat'};if(_0x276640[_0x76c0('0x59')]['id']){delete _0x276640[_0x76c0('0x59')]['id'];}_0x276640[_0x76c0('0x59')][_0x76c0('0x61')]=_0x276640[_0x76c0('0x59')]['UserId']||_0x276640[_0x76c0('0x62')]['id'];_0x3768b0['agent']['id']=_0x276640[_0x76c0('0x59')][_0x76c0('0x61')];return db['ChatMessage'][_0x76c0('0x5a')]({'where':{'id':_0x276640[_0x76c0('0x55')]['id'],'UserId':null}})[_0x76c0('0x20')](handleEntityNotFound(_0x34893e,null))[_0x76c0('0x20')](function(_0xbd131f){if(_0xbd131f){_0x3768b0[_0x76c0('0x29')]=_0xbd131f[_0x76c0('0x63')]({'plain':!![]});return db[_0x76c0('0x64')][_0x76c0('0x5a')]({'where':{'id':_0xbd131f[_0x76c0('0x65')]}});}return null;})[_0x76c0('0x20')](handleEntityNotFound(_0x34893e,null))[_0x76c0('0x20')](function(_0x71a724){if(_0x71a724){_0x3768b0[_0x76c0('0x68')]=_0x71a724[_0x76c0('0x63')]({'plain':!![]});interaction_log['info'](_0x76c0('0x7f'),_0x276640[_0x76c0('0x62')]['id'],_0x276640[_0x76c0('0x62')]['name'],_0x276640['user'][_0x76c0('0x6a')],_0x3768b0[_0x76c0('0x68')]['id'],_0x276640['body']?JSON[_0x76c0('0x25')](_0x276640[_0x76c0('0x59')]):'null');return respondWithRpcPromise(_0x76c0('0x80'),_0x76c0('0x81'),_0x3768b0);}return null;})[_0x76c0('0x20')](function(_0x4c6f2f){var _0x1fa1fe=_0x76c0('0x6d')+_0x4c6f2f[_0x76c0('0x29')][_0x76c0('0x6e')];return db['sequelize'][_0x76c0('0x42')](_0x1fa1fe,{'type':db[_0x76c0('0x70')]['QueryTypes'][_0x76c0('0x72')],'raw':!![]})[_0x76c0('0x20')](function(_0x83fae7){return _0x83fae7;});})['then'](function(_0x3ed278){if(_0x3ed278){_0x3768b0[_0x76c0('0x29')][_0x76c0('0x73')]=_0x3ed278[0x0];if(!_0x276640[_0x76c0('0x59')][_0x76c0('0x61')])return;return db[_0x76c0('0x74')][_0x76c0('0x5a')]({'where':{'id':_0x276640[_0x76c0('0x59')][_0x76c0('0x61')],'role':'agent'},'attributes':['id',_0x76c0('0x3a'),_0x76c0('0x76'),_0x76c0('0x77'),_0x76c0('0x82')],'raw':!![]});}return null;})['then'](function(_0x3d7b9b){if(!_0x3d7b9b)return null;_0x3768b0[_0x76c0('0x29')][_0x76c0('0x75')]=_0x3d7b9b;return _0x3768b0;})[_0x76c0('0x20')](function(_0x4cf777){if(_0x4cf777){_0x4cf777[_0x76c0('0x29')][_0x76c0('0x83')]=util[_0x76c0('0x5f')](_0x76c0('0x84'),_0x276640['user'][_0x76c0('0x3a')]);_0x4cf777[_0x76c0('0x29')]['channel']=_0x3768b0[_0x76c0('0x79')];_0x4cf777[_0x76c0('0x29')]['motionChannel']=_0x3768b0[_0x76c0('0x79')];_0x4cf777[_0x76c0('0x29')]['event']='reject';respondWithRpcPromise(_0x76c0('0x7b'),_0x76c0('0x7b'),{'event':_0x76c0('0x85'),'message':_[_0x76c0('0x4e')](_0x3768b0[_0x76c0('0x29')],JSON[_0x76c0('0x7d')](_0x3768b0[_0x76c0('0x68')][_0x76c0('0x7e')]))},client9002);return _0x3768b0;}return null;})[_0x76c0('0x20')](respondWithResult(_0x34893e,null))[_0x76c0('0x2b')](handleError(_0x34893e,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index cd80b7e..5bb3f7b 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 _0x4ede=['save','update','remove','emit','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x35a59c,_0x3c08ef){var _0x11bf0e=function(_0x154cec){while(--_0x154cec){_0x35a59c['push'](_0x35a59c['shift']());}};_0x11bf0e(++_0x3c08ef);}(_0x4ede,0x138));var _0xe4ed=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4ede[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0xe4ed('0x0'));var ChatMessage=require(_0xe4ed('0x1'))['db'][_0xe4ed('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4ed('0x3'),'afterUpdate':_0xe4ed('0x4'),'afterDestroy':_0xe4ed('0x5')};function emitEvent(_0x40e543){return function(_0x1abd31,_0xaa1f01,_0x42a69d){ChatMessageEvents[_0xe4ed('0x6')](_0x40e543+':'+_0x1abd31['id'],_0x1abd31);ChatMessageEvents[_0xe4ed('0x6')](_0x40e543,_0x1abd31);_0x42a69d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xe4ed('0x7')](e,emitEvent(event));}}module[_0xe4ed('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x80c5=['ChatMessage','save','update','emit','hasOwnProperty','events'];(function(_0xcd52ba,_0x1e9bdb){var _0x1f07a0=function(_0x5358db){while(--_0x5358db){_0xcd52ba['push'](_0xcd52ba['shift']());}};_0x1f07a0(++_0x1e9bdb);}(_0x80c5,0x15b));var _0x580c=function(_0x3a1770,_0x2a13da){_0x3a1770=_0x3a1770-0x0;var _0x517f6c=_0x80c5[_0x3a1770];return _0x517f6c;};'use strict';var EventEmitter=require(_0x580c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x580c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x580c('0x2'),'afterUpdate':_0x580c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2b32ae){return function(_0x24fad9,_0x2597c4,_0xb5ada7){ChatMessageEvents[_0x580c('0x4')](_0x2b32ae+':'+_0x24fad9['id'],_0x24fad9);ChatMessageEvents[_0x580c('0x4')](_0x2b32ae,_0x24fad9);_0xb5ada7(null);};}for(var e in events){if(events[_0x580c('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 2155cba..1eca3bc 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 _0xe30f=['chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','exports','ChatMessage'];(function(_0x2f6167,_0x432253){var _0x2e2548=function(_0x1da10){while(--_0x1da10){_0x2f6167['push'](_0x2f6167['shift']());}};_0x2e2548(++_0x432253);}(_0xe30f,0x11a));var _0xfe30=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe30f[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xfe30('0x0'));var util=require(_0xfe30('0x1'));var logger=require(_0xfe30('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfe30('0x3'));var fs=require('fs');var path=require(_0xfe30('0x4'));var rimraf=require(_0xfe30('0x5'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xfe30('0x6')]=function(_0x2a16f0,_0x3eb313){return _0x2a16f0['define'](_0xfe30('0x7'),attributes,{'tableName':_0xfe30('0x8'),'paranoid':![],'indexes':[{'name':_0xfe30('0x9'),'fields':[_0xfe30('0xa')],'type':_0xfe30('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54dc14,_0x39b3ee,_0xf33da1){var _0x288993=_0x2a16f0[_0xfe30('0xc')];var _0x47cbe5=_0x54dc14[_0xfe30('0xd')]({'plain':!![]});if(_0x47cbe5[_0xfe30('0xe')][_0xfe30('0xf')]()==='in'||_0x47cbe5[_0xfe30('0xe')][_0xfe30('0xf')]()===_0xfe30('0x10')&&!_0x47cbe5[_0xfe30('0x11')]&&!_[_0xfe30('0x12')](_0x47cbe5[_0xfe30('0x13')])){_0x288993['ChatInteraction'][_0xfe30('0x14')]({'where':{'id':_0x47cbe5[_0xfe30('0x15')]}})[_0xfe30('0x16')](function(_0x677747){if(_0x677747){_0x677747[_0xfe30('0x17')]({'lastMsgAt':_0x47cbe5[_0xfe30('0x18')],'lastMsgDirection':_0x47cbe5[_0xfe30('0xe')][_0xfe30('0xf')]()});}})[_0xfe30('0x19')](function(_0x41bca6){console[_0xfe30('0x1a')](_0x41bca6);});}_0xf33da1();}},'charset':_0xfe30('0x1b'),'collate':_0xfe30('0x1c')});};
\ No newline at end of file
+var _0xa94d=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','catch','error','utf8mb4','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa94d,0x80));var _0xda94=function(_0x351f4d,_0x43f5b7){_0x351f4d=_0x351f4d-0x0;var _0x779646=_0xa94d[_0x351f4d];return _0x779646;};'use strict';var _=require(_0xda94('0x0'));var util=require(_0xda94('0x1'));var logger=require(_0xda94('0x2'))(_0xda94('0x3'));var moment=require('moment');var BPromise=require(_0xda94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda94('0x5'));var rimraf=require(_0xda94('0x6'));var config=require(_0xda94('0x7'));var attributes=require('./chatMessage.attributes');module[_0xda94('0x8')]=function(_0x4b42a0,_0x278a7e){return _0x4b42a0[_0xda94('0x9')](_0xda94('0xa'),attributes,{'tableName':_0xda94('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xda94('0xc')],'type':_0xda94('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3812fc,_0x50b0f1,_0x22eb04){var _0x295765=_0x4b42a0[_0xda94('0xe')];var _0x3f30dd=_0x3812fc[_0xda94('0xf')]({'plain':!![]});if(_0x3f30dd[_0xda94('0x10')]['toLowerCase']()==='in'||_0x3f30dd[_0xda94('0x10')]['toLowerCase']()==='out'&&!_0x3f30dd[_0xda94('0x11')]&&!_[_0xda94('0x12')](_0x3f30dd[_0xda94('0x13')])){_0x295765[_0xda94('0x14')][_0xda94('0x15')]({'where':{'id':_0x3f30dd[_0xda94('0x16')]}})['then'](function(_0x374913){if(_0x374913){_0x374913['update']({'lastMsgAt':_0x3f30dd['createdAt'],'lastMsgDirection':_0x3f30dd[_0xda94('0x10')]['toLowerCase']()});}})[_0xda94('0x17')](function(_0x1e9cab){console[_0xda94('0x18')](_0x1e9cab);});}_0x22eb04();}},'charset':_0xda94('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 5160080..85cbe39 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 _0x7769=['then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x4d0e23,_0x4e03b7){var _0x4d2fc4=function(_0x26f074){while(--_0x26f074){_0x4d0e23['push'](_0x4d0e23['shift']());}};_0x4d2fc4(++_0x4e03b7);}(_0x7769,0x15e));var _0x9776=function(_0x19ad33,_0x62a060){_0x19ad33=_0x19ad33-0x0;var _0x547380=_0x7769[_0x19ad33];return _0x547380;};'use strict';var _=require(_0x9776('0x0'));var util=require(_0x9776('0x1'));var moment=require(_0x9776('0x2'));var BPromise=require(_0x9776('0x3'));var rs=require(_0x9776('0x4'));var fs=require('fs');var Redis=require(_0x9776('0x5'));var db=require(_0x9776('0x6'))['db'];var utils=require(_0x9776('0x7'));var logger=require(_0x9776('0x8'))(_0x9776('0x9'));var config=require(_0x9776('0xa'));var jayson=require(_0x9776('0xb'));var client=jayson[_0x9776('0xc')][_0x9776('0xd')]({'port':0x232a});config[_0x9776('0xe')]=_[_0x9776('0xf')](config[_0x9776('0xe')],{'host':_0x9776('0x10'),'port':0x18eb});var socket=require(_0x9776('0x11'))(new Redis(config['redis']));require(_0x9776('0x12'))[_0x9776('0x13')](socket);function respondWithRpcPromise(_0x16ce7f,_0xbfc7bf,_0x2e4ec4){return new BPromise(function(_0x269cbb,_0x1d9a5e){return client['request'](_0x16ce7f,_0x2e4ec4)[_0x9776('0x14')](function(_0x5f1a68){logger['info']('ChatMessage,\x20%s,\x20%s',_0xbfc7bf,'request\x20sent');logger[_0x9776('0x15')](_0x9776('0x16'),_0xbfc7bf,'request\x20sent',JSON[_0x9776('0x17')](_0x5f1a68));if(_0x5f1a68[_0x9776('0x18')]){if(_0x5f1a68[_0x9776('0x18')][_0x9776('0x19')]===0x1f4){logger[_0x9776('0x18')](_0x9776('0x1a'),_0xbfc7bf,_0x5f1a68[_0x9776('0x18')]['message']);return _0x1d9a5e(_0x5f1a68[_0x9776('0x18')][_0x9776('0x1b')]);}logger[_0x9776('0x18')](_0x9776('0x1a'),_0xbfc7bf,_0x5f1a68['error'][_0x9776('0x1b')]);return _0x269cbb(_0x5f1a68[_0x9776('0x18')][_0x9776('0x1b')]);}else{logger[_0x9776('0x1c')]('ChatMessage,\x20%s,\x20%s',_0xbfc7bf,_0x9776('0x1d'));_0x269cbb(_0x5f1a68[_0x9776('0x1e')][_0x9776('0x1b')]);}})[_0x9776('0x1f')](function(_0x4b1203){logger[_0x9776('0x18')](_0x9776('0x1a'),_0xbfc7bf,_0x4b1203);_0x1d9a5e(_0x4b1203);});});}exports[_0x9776('0x20')]=function(_0x10a80a){var _0x544863=this;return new Promise(function(_0x1d91a3,_0x3419de){return db[_0x9776('0x21')]['create'](_0x10a80a[_0x9776('0x22')],{'raw':_0x10a80a[_0x9776('0x23')]?_0x10a80a[_0x9776('0x23')][_0x9776('0x24')]===undefined?!![]:![]:!![]})[_0x9776('0x14')](function(_0xb4c629){logger[_0x9776('0x1c')](_0x9776('0x20'),_0x10a80a);logger['debug'](_0x9776('0x20'),_0x10a80a,JSON[_0x9776('0x17')](_0xb4c629));_0x1d91a3(_0xb4c629);})[_0x9776('0x1f')](function(_0x3b45a4){logger[_0x9776('0x18')](_0x9776('0x20'),_0x3b45a4[_0x9776('0x1b')],_0x10a80a);_0x3419de(_0x544863['error'](0x1f4,_0x3b45a4[_0x9776('0x1b')]));});});};
\ No newline at end of file
+var _0xcc5f=['error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','raw','then','debug','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','register','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0xb86b17,_0x2e1437){var _0x5e562e=function(_0x39ea82){while(--_0x39ea82){_0xb86b17['push'](_0xb86b17['shift']());}};_0x5e562e(++_0x2e1437);}(_0xcc5f,0x12f));var _0xfcc5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcc5f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xfcc5('0x0'));var util=require(_0xfcc5('0x1'));var moment=require(_0xfcc5('0x2'));var BPromise=require('bluebird');var rs=require(_0xfcc5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcc5('0x4'))['db'];var utils=require(_0xfcc5('0x5'));var logger=require(_0xfcc5('0x6'))(_0xfcc5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfcc5('0x8')][_0xfcc5('0x9')]({'port':0x232a});config[_0xfcc5('0xa')]=_['defaults'](config[_0xfcc5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcc5('0xb'))(new Redis(config[_0xfcc5('0xa')]));require('./chatMessage.socket')[_0xfcc5('0xc')](socket);function respondWithRpcPromise(_0x2a6ef8,_0x2bfebb,_0x3d822){return new BPromise(function(_0x390410,_0x21cadb){return client['request'](_0x2a6ef8,_0x3d822)['then'](function(_0x57a180){logger['info'](_0xfcc5('0xd'),_0x2bfebb,_0xfcc5('0xe'));logger['debug'](_0xfcc5('0xf'),_0x2bfebb,_0xfcc5('0xe'),JSON['stringify'](_0x57a180));if(_0x57a180[_0xfcc5('0x10')]){if(_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x11')]===0x1f4){logger['error'](_0xfcc5('0xd'),_0x2bfebb,_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x12')]);return _0x21cadb(_0x57a180['error'][_0xfcc5('0x12')]);}logger[_0xfcc5('0x10')]('ChatMessage,\x20%s,\x20%s',_0x2bfebb,_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x12')]);return _0x390410(_0x57a180[_0xfcc5('0x10')][_0xfcc5('0x12')]);}else{logger[_0xfcc5('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2bfebb,_0xfcc5('0xe'));_0x390410(_0x57a180[_0xfcc5('0x14')]['message']);}})[_0xfcc5('0x15')](function(_0x49f10e){logger[_0xfcc5('0x10')](_0xfcc5('0xd'),_0x2bfebb,_0x49f10e);_0x21cadb(_0x49f10e);});});}exports[_0xfcc5('0x16')]=function(_0xe34334){var _0x47eb6=this;return new Promise(function(_0x4f9a59,_0x1e313b){return db[_0xfcc5('0x17')][_0xfcc5('0x18')](_0xe34334['body'],{'raw':_0xe34334['options']?_0xe34334['options'][_0xfcc5('0x19')]===undefined?!![]:![]:!![]})[_0xfcc5('0x1a')](function(_0x9c3ed0){logger['info']('CreateChatMessage',_0xe34334);logger[_0xfcc5('0x1b')](_0xfcc5('0x16'),_0xe34334,JSON[_0xfcc5('0x1c')](_0x9c3ed0));_0x4f9a59(_0x9c3ed0);})[_0xfcc5('0x15')](function(_0xd8560a){logger[_0xfcc5('0x10')](_0xfcc5('0x16'),_0xd8560a[_0xfcc5('0x12')],_0xe34334);_0x1e313b(_0x47eb6[_0xfcc5('0x10')](0x1f4,_0xd8560a[_0xfcc5('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index b19fd55..8c6f648 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 _0x032e=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x7924fe,_0x363a57){var _0x418354=function(_0x489b02){while(--_0x489b02){_0x7924fe['push'](_0x7924fe['shift']());}};_0x418354(++_0x363a57);}(_0x032e,0x124));var _0xe032=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x032e[_0x2b5eae];return _0x5f3ac9;};'use strict';var ChatMessageEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatMessageEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatMessageEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
+var _0xe5d5=['length','chatMessage:','remove','removeListener','register'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0xe5d5,0x156));var _0x5e5d=function(_0x3d2a94,_0x27a633){_0x3d2a94=_0x3d2a94-0x0;var _0x315d9f=_0xe5d5[_0x3d2a94];return _0x315d9f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x5e5d('0x0'),'update'];function createListener(_0x9f47d6,_0x4b8ae9){return function(_0x50afd3){_0x4b8ae9['emit'](_0x9f47d6,_0x50afd3);};}function removeListener(_0x3e2410,_0x191980){return function(){ChatMessageEvents[_0x5e5d('0x1')](_0x3e2410,_0x191980);};}exports[_0x5e5d('0x2')]=function(_0x13bcb7){for(var _0x39077f=0x0,_0x3200d5=events[_0x5e5d('0x3')];_0x39077f<_0x3200d5;_0x39077f++){var _0x23de8d=events[_0x39077f];var _0x131a59=createListener(_0x5e5d('0x4')+_0x23de8d,_0x13bcb7);ChatMessageEvents['on'](_0x23de8d,_0x131a59);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 9a03b0f..207c750 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 _0x74c6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','delete','exports','util','path'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x74c6,0x178));var _0x674c=function(_0x2ffbf5,_0x5e9b1d){_0x2ffbf5=_0x2ffbf5-0x0;var _0x2bc37a=_0x74c6[_0x2ffbf5];return _0x2bc37a;};'use strict';var multer=require('multer');var util=require(_0x674c('0x0'));var path=require(_0x674c('0x1'));var timeout=require(_0x674c('0x2'));var express=require(_0x674c('0x3'));var router=express[_0x674c('0x4')]();var fs_extra=require(_0x674c('0x5'));var auth=require(_0x674c('0x6'));var interaction=require(_0x674c('0x7'));var config=require(_0x674c('0x8'));var controller=require(_0x674c('0x9'));router[_0x674c('0xa')]('/',auth[_0x674c('0xb')](),controller[_0x674c('0xc')]);router[_0x674c('0xa')](_0x674c('0xd'),auth[_0x674c('0xb')](),controller[_0x674c('0xe')]);router[_0x674c('0xa')](_0x674c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x674c('0x10')]('/',auth[_0x674c('0xb')](),interaction['tracked'](_0x674c('0x11'),_0x674c('0x12')),controller[_0x674c('0x13')]);router['put'](_0x674c('0xf'),controller[_0x674c('0x14')]);router[_0x674c('0x15')](_0x674c('0x16'),auth[_0x674c('0xb')](),controller[_0x674c('0x17')]);router[_0x674c('0x15')](_0x674c('0x18'),auth[_0x674c('0xb')](),controller['reject']);router[_0x674c('0x19')](_0x674c('0xf'),auth[_0x674c('0xb')](),controller['destroy']);module[_0x674c('0x1a')]=router;
\ No newline at end of file
+var _0x94bd=['show','post','chat','create','put','update','/:id/accept','accept','reject','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x54e331,_0x244a1d){var _0x39f511=function(_0x476649){while(--_0x476649){_0x54e331['push'](_0x54e331['shift']());}};_0x39f511(++_0x244a1d);}(_0x94bd,0x112));var _0xd94b=function(_0x1fd0c5,_0x241216){_0x1fd0c5=_0x1fd0c5-0x0;var _0xaece36=_0x94bd[_0x1fd0c5];return _0xaece36;};'use strict';var multer=require(_0xd94b('0x0'));var util=require(_0xd94b('0x1'));var path=require(_0xd94b('0x2'));var timeout=require(_0xd94b('0x3'));var express=require('express');var router=express[_0xd94b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd94b('0x5'));var interaction=require(_0xd94b('0x6'));var config=require(_0xd94b('0x7'));var controller=require(_0xd94b('0x8'));router[_0xd94b('0x9')]('/',auth[_0xd94b('0xa')](),controller[_0xd94b('0xb')]);router[_0xd94b('0x9')]('/describe',auth[_0xd94b('0xa')](),controller[_0xd94b('0xc')]);router[_0xd94b('0x9')](_0xd94b('0xd'),auth[_0xd94b('0xa')](),controller[_0xd94b('0xe')]);router[_0xd94b('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xd94b('0x10'),'chatmessage:create'),controller[_0xd94b('0x11')]);router[_0xd94b('0x12')]('/:id',controller[_0xd94b('0x13')]);router[_0xd94b('0x12')](_0xd94b('0x14'),auth[_0xd94b('0xa')](),controller[_0xd94b('0x15')]);router[_0xd94b('0x12')]('/:id/reject',auth[_0xd94b('0xa')](),controller[_0xd94b('0x16')]);router['delete'](_0xd94b('0xd'),auth[_0xd94b('0xa')](),controller[_0xd94b('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 5fa6fd5..431edee 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 _0x5f66=['medium','TEXT','exports'];(function(_0x986e18,_0x2b9185){var _0x436d06=function(_0x3930fc){while(--_0x3930fc){_0x986e18['push'](_0x986e18['shift']());}};_0x436d06(++_0x2b9185);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0x0b0e[_0x3caeb5];return _0x5eca7e;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 32044ab..cb1fd73 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7a54,0x106));var _0x47a5=function(_0x59fcd8,_0x22a3b4){_0x59fcd8=_0x59fcd8-0x0;var _0x506688=_0x7a54[_0x59fcd8];return _0x506688;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xf7f4e4,_0x13c7c3){var _0x2bfe72=function(_0x400799){while(--_0x400799){_0xf7f4e4['push'](_0xf7f4e4['shift']());}};_0x2bfe72(++_0x13c7c3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 868e9d5..aa39861 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 _0x5074=['save','update','emit','hasOwnProperty','hook','exports','ChatOfflineMessage','setMaxListeners'];(function(_0x36d48e,_0x4d3775){var _0x5c8ead=function(_0x333532){while(--_0x333532){_0x36d48e['push'](_0x36d48e['shift']());}};_0x5c8ead(++_0x4d3775);}(_0x5074,0x6e));var _0x4507=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0x5074[_0x189c9e];return _0x3f38ca;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x4507('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4507('0x1')](0x0);var events={'afterCreate':_0x4507('0x2'),'afterUpdate':_0x4507('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cb67e){return function(_0x24978f,_0x2af675,_0x34baca){ChatOfflineMessageEvents[_0x4507('0x4')](_0x3cb67e+':'+_0x24978f['id'],_0x24978f);ChatOfflineMessageEvents['emit'](_0x3cb67e,_0x24978f);_0x34baca(null);};}for(var e in events){if(events[_0x4507('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x4507('0x6')](e,emitEvent(event));}}module[_0x4507('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xafca=['ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x19569b,_0x4c1525){var _0x596579=function(_0x30525e){while(--_0x30525e){_0x19569b['push'](_0x19569b['shift']());}};_0x596579(++_0x4c1525);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xaafc('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xaafc('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xaafc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaafc('0x3')};function emitEvent(_0x2ba994){return function(_0x379add,_0xd5021b,_0xe1500d){ChatOfflineMessageEvents['emit'](_0x2ba994+':'+_0x379add['id'],_0x379add);ChatOfflineMessageEvents[_0xaafc('0x4')](_0x2ba994,_0x379add);_0xe1500d(null);};}for(var e in events){if(events[_0xaafc('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xaafc('0x6')](e,emitEvent(event));}}module[_0xaafc('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 3ff46b4..267fb0e 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 _0xa3d3=['exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3d3,0x1ef));var _0x3a3d=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa3d3[_0x51020b];return _0x371e47;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x3a3d('0x0')]=function(_0x5635c6){return _0x5635c6[_0x3a3d('0x1')](_0x3a3d('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a3d('0x3'),'collate':_0x3a3d('0x4')});};
\ No newline at end of file
+var _0x0429=['./chatOfflineMessage.attributes','define','utf8mb4_unicode_ci'];(function(_0x2bf5e9,_0x59fdc0){var _0x4cc16a=function(_0x3a6d63){while(--_0x3a6d63){_0x2bf5e9['push'](_0x2bf5e9['shift']());}};_0x4cc16a(++_0x59fdc0);}(_0x0429,0xea));var _0x9042=function(_0x31abdf,_0x5a77a3){_0x31abdf=_0x31abdf-0x0;var _0x4b25b4=_0x0429[_0x31abdf];return _0x4b25b4;};'use strict';var attributes=require(_0x9042('0x0'));module['exports']=function(_0x41add0){return _0x41add0[_0x9042('0x1')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9042('0x2')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index b6e4d7c..497504e 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 _0x63b6=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x26d931,_0x228d92){var _0x1d3c32=function(_0x5717ad){while(--_0x5717ad){_0x26d931['push'](_0x26d931['shift']());}};_0x1d3c32(++_0x228d92);}(_0x63b6,0x127));var _0x663b=function(_0x4e4c69,_0x5d7f1c){_0x4e4c69=_0x4e4c69-0x0;var _0x35def9=_0x63b6[_0x4e4c69];return _0x35def9;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var moment=require(_0x663b('0x2'));var BPromise=require('bluebird');var rs=require(_0x663b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x663b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x663b('0x5'))(_0x663b('0x6'));var config=require(_0x663b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x663b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210eb1,_0x53f5cf,_0x414dc2){return new BPromise(function(_0x2976ff,_0xf8f3ff){return client[_0x663b('0x9')](_0x210eb1,_0x414dc2)[_0x663b('0xa')](function(_0x1e1698){logger['info'](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));logger[_0x663b('0xd')](_0x663b('0xe'),_0x53f5cf,_0x663b('0xc'),JSON[_0x663b('0xf')](_0x1e1698));if(_0x1e1698[_0x663b('0x10')]){if(_0x1e1698[_0x663b('0x10')][_0x663b('0x11')]===0x1f4){logger[_0x663b('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x53f5cf,_0x1e1698['error'][_0x663b('0x12')]);return _0xf8f3ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x1e1698[_0x663b('0x10')]['message']);return _0x2976ff(_0x1e1698[_0x663b('0x10')][_0x663b('0x12')]);}else{logger[_0x663b('0x13')](_0x663b('0xb'),_0x53f5cf,_0x663b('0xc'));_0x2976ff(_0x1e1698[_0x663b('0x14')][_0x663b('0x12')]);}})[_0x663b('0x15')](function(_0x63443b){logger[_0x663b('0x10')](_0x663b('0xb'),_0x53f5cf,_0x63443b);_0xf8f3ff(_0x63443b);});});}
\ No newline at end of file
+var _0x0389=['../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','debug','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x343f5b,_0x5c5f5f){var _0x14d9cc=function(_0x5808ad){while(--_0x5808ad){_0x343f5b['push'](_0x343f5b['shift']());}};_0x14d9cc(++_0x5c5f5f);}(_0x0389,0x175));var _0x9038=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0x0389[_0x533132];return _0x1a7447;};'use strict';var _=require(_0x9038('0x0'));var util=require('util');var moment=require(_0x9038('0x1'));var BPromise=require(_0x9038('0x2'));var rs=require(_0x9038('0x3'));var fs=require('fs');var Redis=require(_0x9038('0x4'));var db=require(_0x9038('0x5'))['db'];var utils=require(_0x9038('0x6'));var logger=require(_0x9038('0x7'))('rpc');var config=require(_0x9038('0x8'));var jayson=require(_0x9038('0x9'));var client=jayson[_0x9038('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5be684,_0x5dea05,_0x394000){return new BPromise(function(_0x2a81c8,_0x23ab4a){return client[_0x9038('0xb')](_0x5be684,_0x394000)['then'](function(_0xbf1aea){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5dea05,_0x9038('0xc'));logger[_0x9038('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5dea05,_0x9038('0xc'),JSON['stringify'](_0xbf1aea));if(_0xbf1aea[_0x9038('0xe')]){if(_0xbf1aea[_0x9038('0xe')][_0x9038('0xf')]===0x1f4){logger['error'](_0x9038('0x10'),_0x5dea05,_0xbf1aea[_0x9038('0xe')][_0x9038('0x11')]);return _0x23ab4a(_0xbf1aea[_0x9038('0xe')]['message']);}logger[_0x9038('0xe')](_0x9038('0x10'),_0x5dea05,_0xbf1aea[_0x9038('0xe')][_0x9038('0x11')]);return _0x2a81c8(_0xbf1aea['error']['message']);}else{logger['info'](_0x9038('0x10'),_0x5dea05,_0x9038('0xc'));_0x2a81c8(_0xbf1aea[_0x9038('0x12')][_0x9038('0x11')]);}})[_0x9038('0x13')](function(_0x9b0929){logger[_0x9038('0xe')](_0x9038('0x10'),_0x5dea05,_0x9b0929);_0x23ab4a(_0x9b0929);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index aac57c7..f1e5396 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 _0xad28=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x28ecda,_0x445af6){var _0x516338=function(_0x5f2349){while(--_0x5f2349){_0x28ecda['push'](_0x28ecda['shift']());}};_0x516338(++_0x445af6);}(_0xad28,0x1ce));var _0x8ad2=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xad28[_0x34a8c8];return _0x1fe6e5;};'use strict';var multer=require(_0x8ad2('0x0'));var util=require(_0x8ad2('0x1'));var path=require(_0x8ad2('0x2'));var timeout=require(_0x8ad2('0x3'));var express=require('express');var router=express[_0x8ad2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8ad2('0x5'));var interaction=require(_0x8ad2('0x6'));var config=require(_0x8ad2('0x7'));var controller=require(_0x8ad2('0x8'));router[_0x8ad2('0x9')]('/',auth['isAuthenticated'](),controller[_0x8ad2('0xa')]);router[_0x8ad2('0x9')](_0x8ad2('0xb'),auth[_0x8ad2('0xc')](),controller[_0x8ad2('0xd')]);router['get'](_0x8ad2('0xe'),auth[_0x8ad2('0xc')](),controller[_0x8ad2('0xf')]);router[_0x8ad2('0x10')]('/',auth[_0x8ad2('0xc')](),controller[_0x8ad2('0x11')]);router[_0x8ad2('0x12')](_0x8ad2('0xe'),auth['isAuthenticated'](),controller[_0x8ad2('0x13')]);router[_0x8ad2('0x14')](_0x8ad2('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe433=['fs-extra','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x5485a0,_0xbc0839){var _0x401e68=function(_0x10250a){while(--_0x10250a){_0x5485a0['push'](_0x5485a0['shift']());}};_0x401e68(++_0xbc0839);}(_0xe433,0x1b4));var _0x3e43=function(_0x350976,_0x39f6cf){_0x350976=_0x350976-0x0;var _0xf0c14=_0xe433[_0x350976];return _0xf0c14;};'use strict';var multer=require('multer');var util=require(_0x3e43('0x0'));var path=require(_0x3e43('0x1'));var timeout=require(_0x3e43('0x2'));var express=require('express');var router=express[_0x3e43('0x3')]();var fs_extra=require(_0x3e43('0x4'));var auth=require(_0x3e43('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e43('0x6'));router[_0x3e43('0x7')]('/',auth[_0x3e43('0x8')](),controller[_0x3e43('0x9')]);router[_0x3e43('0x7')]('/describe',auth[_0x3e43('0x8')](),controller[_0x3e43('0xa')]);router[_0x3e43('0x7')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0xc')]);router[_0x3e43('0xd')]('/',auth[_0x3e43('0x8')](),controller[_0x3e43('0xe')]);router[_0x3e43('0xf')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0x10')]);router[_0x3e43('0x11')](_0x3e43('0xb'),auth[_0x3e43('0x8')](),controller[_0x3e43('0x12')]);module[_0x3e43('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index c988d7a..3599981 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 _0xe143=['mouseOver','timeout','INTEGER','exports','STRING','ENUM'];(function(_0x1f6e71,_0x19360b){var _0x2271aa=function(_0x2f0431){while(--_0x2f0431){_0x1f6e71['push'](_0x1f6e71['shift']());}};_0x2271aa(++_0x19360b);}(_0xe143,0x17d));var _0x3e14=function(_0x299f83,_0x1a1677){_0x299f83=_0x299f83-0x0;var _0x5200b1=_0xe143[_0x299f83];return _0x5200b1;};'use strict';var Sequelize=require('sequelize');module[_0x3e14('0x0')]={'name':{'type':Sequelize[_0x3e14('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3e14('0x2')](_0x3e14('0x3'),_0x3e14('0x4')),'defaultValue':_0x3e14('0x3')},'selector':{'type':Sequelize[_0x3e14('0x1')]},'timeout':{'type':Sequelize[_0x3e14('0x5')]}};
\ No newline at end of file
+var _0xb0f4=['mouseOver','INTEGER','exports','STRING','ENUM'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xb0f4,0x66));var _0x4b0f=function(_0x10e31a,_0x6a302d){_0x10e31a=_0x10e31a-0x0;var _0xa3e8a0=_0xb0f4[_0x10e31a];return _0xa3e8a0;};'use strict';var Sequelize=require('sequelize');module[_0x4b0f('0x0')]={'name':{'type':Sequelize[_0x4b0f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4b0f('0x2')]('mouseOver','timeout'),'defaultValue':_0x4b0f('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4b0f('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 6efa085..2c11350 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 _0x4491=['then','stack','send','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','create','body','catch','params','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x5ca318,_0x46d445){var _0x50879e=function(_0x1b993a){while(--_0x1b993a){_0x5ca318['push'](_0x5ca318['shift']());}};_0x50879e(++_0x46d445);}(_0x4491,0x1bb));var _0x1449=function(_0x2827d7,_0x4966fb){_0x2827d7=_0x2827d7-0x0;var _0x4e2d25=_0x4491[_0x2827d7];return _0x4e2d25;};'use strict';var emlformat=require(_0x1449('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1449('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1449('0x2'));var moment=require(_0x1449('0x3'));var BPromise=require(_0x1449('0x4'));var Mustache=require(_0x1449('0x5'));var util=require(_0x1449('0x6'));var path=require(_0x1449('0x7'));var sox=require('sox');var csv=require(_0x1449('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1449('0x9'));var _=require(_0x1449('0xa'));var squel=require(_0x1449('0xb'));var crypto=require(_0x1449('0xc'));var jsforce=require(_0x1449('0xd'));var deskjs=require(_0x1449('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1449('0xf'));var Papa=require(_0x1449('0x10'));var Redis=require('ioredis');var authService=require(_0x1449('0x11'));var qs=require(_0x1449('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1449('0x13'));var logger=require(_0x1449('0x14'))('api');var utils=require(_0x1449('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1449('0x16'))['db'];function respondWithStatusCode(_0x3f5424,_0x399815){_0x399815=_0x399815||0xcc;return function(_0x25bce3){if(_0x25bce3){return _0x3f5424[_0x1449('0x17')](_0x399815);}return _0x3f5424[_0x1449('0x18')](_0x399815)[_0x1449('0x19')]();};}function respondWithResult(_0x377c96,_0x267d9a){_0x267d9a=_0x267d9a||0xc8;return function(_0x41b34d){if(_0x41b34d){return _0x377c96[_0x1449('0x18')](_0x267d9a)[_0x1449('0x1a')](_0x41b34d);}};}function respondWithFilteredResult(_0x441344,_0x2cf76c){return function(_0x1ec7e8){if(_0x1ec7e8){var _0x59b128=typeof _0x2cf76c[_0x1449('0x1b')]===_0x1449('0x1c')&&typeof _0x2cf76c['limit']===_0x1449('0x1c');var _0x290b72=_0x1ec7e8[_0x1449('0x1d')];var _0x364878=_0x59b128?0x0:_0x2cf76c[_0x1449('0x1b')];var _0x30a65f=_0x59b128?_0x1ec7e8[_0x1449('0x1d')]:_0x2cf76c[_0x1449('0x1b')]+_0x2cf76c[_0x1449('0x1e')];var _0x2dbae1;if(_0x30a65f>=_0x290b72){_0x30a65f=_0x290b72;_0x2dbae1=0xc8;}else{_0x2dbae1=0xce;}_0x441344[_0x1449('0x18')](_0x2dbae1);return _0x441344[_0x1449('0x1f')](_0x1449('0x20'),_0x364878+'-'+_0x30a65f+'/'+_0x290b72)['json'](_0x1ec7e8);}return null;};}function patchUpdates(_0x108f41){return function(_0x49c4d6){try{jsonpatch[_0x1449('0x21')](_0x49c4d6,_0x108f41,!![]);}catch(_0xaaea1d){return BPromise[_0x1449('0x22')](_0xaaea1d);}return _0x49c4d6[_0x1449('0x23')]();};}function saveUpdates(_0x3a2c85,_0x4dcc1b){return function(_0x4c86b9){if(_0x4c86b9){return _0x4c86b9[_0x1449('0x24')](_0x3a2c85)[_0x1449('0x25')](function(_0x100ac6){return _0x100ac6;});}return null;};}function removeEntity(_0x356d6b,_0x545cee){return function(_0x29e254){if(_0x29e254){return _0x29e254['destroy']()[_0x1449('0x25')](function(){_0x356d6b[_0x1449('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a8cf0,_0x507a14){return function(_0x1ef1e3){if(!_0x1ef1e3){_0x5a8cf0[_0x1449('0x17')](0x194);}return _0x1ef1e3;};}function handleError(_0x39ad3c,_0x529dae){_0x529dae=_0x529dae||0x1f4;return function(_0x40e7d5){logger['error'](_0x40e7d5[_0x1449('0x26')]);if(_0x40e7d5['name']){delete _0x40e7d5['name'];}_0x39ad3c[_0x1449('0x18')](_0x529dae)[_0x1449('0x27')](_0x40e7d5);};}exports['show']=function(_0xe6900c,_0x5c3fdf){var _0x2836a1={'raw':!![],'where':{'id':_0xe6900c['params']['id']}},_0x36a74a={};_0x36a74a['model']=_[_0x1449('0x28')](db['ChatProactiveAction'][_0x1449('0x29')]);_0x36a74a[_0x1449('0x2a')]=_[_0x1449('0x28')](_0xe6900c[_0x1449('0x2a')]);_0x36a74a[_0x1449('0x2b')]=_[_0x1449('0x2c')](_0x36a74a[_0x1449('0x2d')],_0x36a74a[_0x1449('0x2a')]);_0x2836a1[_0x1449('0x2e')]=_[_0x1449('0x2c')](_0x36a74a[_0x1449('0x2d')],qs[_0x1449('0x2f')](_0xe6900c[_0x1449('0x2a')][_0x1449('0x2f')]));_0x2836a1[_0x1449('0x2e')]=_0x2836a1[_0x1449('0x2e')][_0x1449('0x30')]?_0x2836a1['attributes']:_0x36a74a[_0x1449('0x2d')];if(_0xe6900c['query'][_0x1449('0x31')]){_0x2836a1[_0x1449('0x32')]=[{'all':!![]}];}_0x2836a1=_[_0x1449('0x33')]({},_0x2836a1,_0xe6900c[_0x1449('0x34')]);return db[_0x1449('0x35')][_0x1449('0x36')](_0x2836a1)[_0x1449('0x25')](handleEntityNotFound(_0x5c3fdf,null))[_0x1449('0x25')](respondWithResult(_0x5c3fdf,null))['catch'](handleError(_0x5c3fdf,null));};exports['create']=function(_0x59c075,_0x19610c){return db[_0x1449('0x35')][_0x1449('0x37')](_0x59c075[_0x1449('0x38')],{})[_0x1449('0x25')](respondWithResult(_0x19610c,0xc9))[_0x1449('0x39')](handleError(_0x19610c,null));};exports[_0x1449('0x24')]=function(_0x2b7bd8,_0x5a1f92){if(_0x2b7bd8[_0x1449('0x38')]['id']){delete _0x2b7bd8[_0x1449('0x38')]['id'];}return db[_0x1449('0x35')][_0x1449('0x36')]({'where':{'id':_0x2b7bd8[_0x1449('0x3a')]['id']}})[_0x1449('0x25')](handleEntityNotFound(_0x5a1f92,null))['then'](saveUpdates(_0x2b7bd8[_0x1449('0x38')],null))[_0x1449('0x25')](respondWithResult(_0x5a1f92,null))['catch'](handleError(_0x5a1f92,null));};exports[_0x1449('0x3b')]=function(_0x4c8d2a,_0x2ccb90){return db[_0x1449('0x35')][_0x1449('0x36')]({'where':{'id':_0x4c8d2a[_0x1449('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2ccb90,null))[_0x1449('0x25')](removeEntity(_0x2ccb90,null))[_0x1449('0x39')](handleError(_0x2ccb90,null));};
\ No newline at end of file
+var _0xe49a=['status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xe49a,0xd7));var _0xae49=function(_0x5bfbc4,_0xceeb1){_0x5bfbc4=_0x5bfbc4-0x0;var _0x1489d3=_0xe49a[_0x5bfbc4];return _0x1489d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae49('0x0'));var zipdir=require(_0xae49('0x1'));var jsonpatch=require(_0xae49('0x2'));var rp=require(_0xae49('0x3'));var moment=require(_0xae49('0x4'));var BPromise=require(_0xae49('0x5'));var Mustache=require(_0xae49('0x6'));var util=require('util');var path=require(_0xae49('0x7'));var sox=require(_0xae49('0x8'));var csv=require(_0xae49('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae49('0xa'));var _=require('lodash');var squel=require(_0xae49('0xb'));var crypto=require(_0xae49('0xc'));var jsforce=require(_0xae49('0xd'));var deskjs=require(_0xae49('0xe'));var toCsv=require(_0xae49('0x9'));var querystring=require(_0xae49('0xf'));var Papa=require(_0xae49('0x10'));var Redis=require('ioredis');var authService=require(_0xae49('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xae49('0x12'));var hardwareService=require(_0xae49('0x13'));var logger=require(_0xae49('0x14'))('api');var utils=require(_0xae49('0x15'));var config=require(_0xae49('0x16'));var licenseUtil=require(_0xae49('0x17'));var db=require(_0xae49('0x18'))['db'];function respondWithStatusCode(_0x16d017,_0x3b7197){_0x3b7197=_0x3b7197||0xcc;return function(_0x56a96e){if(_0x56a96e){return _0x16d017['sendStatus'](_0x3b7197);}return _0x16d017[_0xae49('0x19')](_0x3b7197)[_0xae49('0x1a')]();};}function respondWithResult(_0x369b7e,_0xffb91e){_0xffb91e=_0xffb91e||0xc8;return function(_0x2e9256){if(_0x2e9256){return _0x369b7e[_0xae49('0x19')](_0xffb91e)[_0xae49('0x1b')](_0x2e9256);}};}function respondWithFilteredResult(_0x182d26,_0x296e27){return function(_0x603f4c){if(_0x603f4c){var _0x1a0965=typeof _0x296e27['offset']===_0xae49('0x1c')&&typeof _0x296e27[_0xae49('0x1d')]===_0xae49('0x1c');var _0x5ca474=_0x603f4c[_0xae49('0x1e')];var _0x1ec3be=_0x1a0965?0x0:_0x296e27['offset'];var _0x290d8b=_0x1a0965?_0x603f4c[_0xae49('0x1e')]:_0x296e27['offset']+_0x296e27['limit'];var _0x30ec79;if(_0x290d8b>=_0x5ca474){_0x290d8b=_0x5ca474;_0x30ec79=0xc8;}else{_0x30ec79=0xce;}_0x182d26['status'](_0x30ec79);return _0x182d26['set']('Content-Range',_0x1ec3be+'-'+_0x290d8b+'/'+_0x5ca474)[_0xae49('0x1b')](_0x603f4c);}return null;};}function patchUpdates(_0x454ae5){return function(_0x48562a){try{jsonpatch[_0xae49('0x1f')](_0x48562a,_0x454ae5,!![]);}catch(_0x836b55){return BPromise[_0xae49('0x20')](_0x836b55);}return _0x48562a[_0xae49('0x21')]();};}function saveUpdates(_0x16fa5b,_0x4b3830){return function(_0x76ed84){if(_0x76ed84){return _0x76ed84[_0xae49('0x22')](_0x16fa5b)[_0xae49('0x23')](function(_0x595129){return _0x595129;});}return null;};}function removeEntity(_0x3df402,_0x5d3fcc){return function(_0x1ca991){if(_0x1ca991){return _0x1ca991[_0xae49('0x24')]()[_0xae49('0x23')](function(){_0x3df402['status'](0xcc)[_0xae49('0x1a')]();});}};}function handleEntityNotFound(_0x38fdf4,_0x504e9e){return function(_0x54d4d0){if(!_0x54d4d0){_0x38fdf4['sendStatus'](0x194);}return _0x54d4d0;};}function handleError(_0x4167f4,_0x189e62){_0x189e62=_0x189e62||0x1f4;return function(_0xd79a45){logger[_0xae49('0x25')](_0xd79a45[_0xae49('0x26')]);if(_0xd79a45['name']){delete _0xd79a45[_0xae49('0x27')];}_0x4167f4[_0xae49('0x19')](_0x189e62)[_0xae49('0x28')](_0xd79a45);};}exports[_0xae49('0x29')]=function(_0x1178ce,_0x20015f){var _0x36ba34={'raw':!![],'where':{'id':_0x1178ce[_0xae49('0x2a')]['id']}},_0xb47cdf={};_0xb47cdf[_0xae49('0x2b')]=_[_0xae49('0x2c')](db['ChatProactiveAction'][_0xae49('0x2d')]);_0xb47cdf['query']=_[_0xae49('0x2c')](_0x1178ce['query']);_0xb47cdf[_0xae49('0x2e')]=_[_0xae49('0x2f')](_0xb47cdf[_0xae49('0x2b')],_0xb47cdf[_0xae49('0x30')]);_0x36ba34[_0xae49('0x31')]=_[_0xae49('0x2f')](_0xb47cdf[_0xae49('0x2b')],qs['fields'](_0x1178ce[_0xae49('0x30')]['fields']));_0x36ba34[_0xae49('0x31')]=_0x36ba34['attributes'][_0xae49('0x32')]?_0x36ba34['attributes']:_0xb47cdf[_0xae49('0x2b')];if(_0x1178ce[_0xae49('0x30')][_0xae49('0x33')]){_0x36ba34[_0xae49('0x34')]=[{'all':!![]}];}_0x36ba34=_[_0xae49('0x35')]({},_0x36ba34,_0x1178ce[_0xae49('0x36')]);return db[_0xae49('0x37')][_0xae49('0x38')](_0x36ba34)[_0xae49('0x23')](handleEntityNotFound(_0x20015f,null))[_0xae49('0x23')](respondWithResult(_0x20015f,null))[_0xae49('0x39')](handleError(_0x20015f,null));};exports[_0xae49('0x3a')]=function(_0x5b8907,_0x1278d7){return db[_0xae49('0x37')][_0xae49('0x3a')](_0x5b8907[_0xae49('0x3b')],{})[_0xae49('0x23')](respondWithResult(_0x1278d7,0xc9))[_0xae49('0x39')](handleError(_0x1278d7,null));};exports[_0xae49('0x22')]=function(_0x332d06,_0x4135d7){if(_0x332d06[_0xae49('0x3b')]['id']){delete _0x332d06['body']['id'];}return db[_0xae49('0x37')]['find']({'where':{'id':_0x332d06['params']['id']}})[_0xae49('0x23')](handleEntityNotFound(_0x4135d7,null))['then'](saveUpdates(_0x332d06['body'],null))[_0xae49('0x23')](respondWithResult(_0x4135d7,null))[_0xae49('0x39')](handleError(_0x4135d7,null));};exports['destroy']=function(_0x8b165,_0x4e7da8){return db['ChatProactiveAction'][_0xae49('0x38')]({'where':{'id':_0x8b165[_0xae49('0x2a')]['id']}})[_0xae49('0x23')](handleEntityNotFound(_0x4e7da8,null))[_0xae49('0x23')](removeEntity(_0x4e7da8,null))[_0xae49('0x39')](handleError(_0x4e7da8,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ec746e0..1efcd09 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 _0x9777=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9777,0x1bf));var _0x7977=function(_0x2475b7,_0x29fe3b){_0x2475b7=_0x2475b7-0x0;var _0x26d294=_0x9777[_0x2475b7];return _0x26d294;};'use strict';var _=require(_0x7977('0x0'));var util=require(_0x7977('0x1'));var logger=require(_0x7977('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7977('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7977('0x4'));var rimraf=require(_0x7977('0x5'));var config=require(_0x7977('0x6'));var attributes=require(_0x7977('0x7'));module[_0x7977('0x8')]=function(_0x48f859,_0x3581b9){return _0x48f859[_0x7977('0x9')](_0x7977('0xa'),attributes,{'tableName':_0x7977('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe479=['define','chat_proactive_actions','util','../../config/logger','api','moment','request-promise','path','./chatProactiveAction.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe479,0x156));var _0x9e47=function(_0x4a9061,_0x44e947){_0x4a9061=_0x4a9061-0x0;var _0x4a3843=_0xe479[_0x4a9061];return _0x4a3843;};'use strict';var _=require('lodash');var util=require(_0x9e47('0x0'));var logger=require(_0x9e47('0x1'))(_0x9e47('0x2'));var moment=require(_0x9e47('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e47('0x4'));var fs=require('fs');var path=require(_0x9e47('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e47('0x6'));module[_0x9e47('0x7')]=function(_0x58883e,_0x23d216){return _0x58883e[_0x9e47('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x9e47('0x9'),'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 ec9c342..60c746a 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 _0x1587=['ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','error','code','ChatProactiveAction,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0x6b25ac,_0xe9fa01){var _0x4c84e9=function(_0x2bf6ec){while(--_0x2bf6ec){_0x6b25ac['push'](_0x6b25ac['shift']());}};_0x4c84e9(++_0xe9fa01);}(_0x1587,0x6a));var _0x7158=function(_0x35d909,_0x58b59e){_0x35d909=_0x35d909-0x0;var _0x5874ba=_0x1587[_0x35d909];return _0x5874ba;};'use strict';var _=require('lodash');var util=require(_0x7158('0x0'));var moment=require(_0x7158('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7158('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7158('0x3'))('rpc');var config=require(_0x7158('0x4'));var jayson=require(_0x7158('0x5'));var client=jayson[_0x7158('0x6')][_0x7158('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x292df3,_0x2488d2,_0x1d68ac){return new BPromise(function(_0x257220,_0x37598e){return client[_0x7158('0x8')](_0x292df3,_0x1d68ac)[_0x7158('0x9')](function(_0x103b38){logger[_0x7158('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x2488d2,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2488d2,'request\x20sent',JSON['stringify'](_0x103b38));if(_0x103b38[_0x7158('0xb')]){if(_0x103b38['error'][_0x7158('0xc')]===0x1f4){logger[_0x7158('0xb')](_0x7158('0xd'),_0x2488d2,_0x103b38['error'][_0x7158('0xe')]);return _0x37598e(_0x103b38[_0x7158('0xb')]['message']);}logger[_0x7158('0xb')](_0x7158('0xd'),_0x2488d2,_0x103b38[_0x7158('0xb')][_0x7158('0xe')]);return _0x257220(_0x103b38[_0x7158('0xb')][_0x7158('0xe')]);}else{logger[_0x7158('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x2488d2,_0x7158('0xf'));_0x257220(_0x103b38[_0x7158('0x10')][_0x7158('0xe')]);}})[_0x7158('0x11')](function(_0x210fbe){logger[_0x7158('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x2488d2,_0x210fbe);_0x37598e(_0x210fbe);});});}
\ No newline at end of file
+var _0x2246=['moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x5e3cef,_0x3c57f5){var _0x34c370=function(_0x4bc3e4){while(--_0x4bc3e4){_0x5e3cef['push'](_0x5e3cef['shift']());}};_0x34c370(++_0x3c57f5);}(_0x2246,0xb3));var _0x6224=function(_0x2bfd84,_0x1b455c){_0x2bfd84=_0x2bfd84-0x0;var _0x143f36=_0x2246[_0x2bfd84];return _0x143f36;};'use strict';var _=require(_0x6224('0x0'));var util=require('util');var moment=require(_0x6224('0x1'));var BPromise=require('bluebird');var rs=require(_0x6224('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6224('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6224('0x4'));var config=require(_0x6224('0x5'));var jayson=require(_0x6224('0x6'));var client=jayson[_0x6224('0x7')][_0x6224('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2db4f3,_0x56a1c9,_0x90c8bb){return new BPromise(function(_0x1af029,_0x5d9c4f){return client[_0x6224('0x9')](_0x2db4f3,_0x90c8bb)['then'](function(_0x37eeab){logger[_0x6224('0xa')](_0x6224('0xb'),_0x56a1c9,_0x6224('0xc'));logger[_0x6224('0xd')](_0x6224('0xe'),_0x56a1c9,_0x6224('0xc'),JSON[_0x6224('0xf')](_0x37eeab));if(_0x37eeab[_0x6224('0x10')]){if(_0x37eeab[_0x6224('0x10')]['code']===0x1f4){logger[_0x6224('0x10')](_0x6224('0xb'),_0x56a1c9,_0x37eeab[_0x6224('0x10')][_0x6224('0x11')]);return _0x5d9c4f(_0x37eeab[_0x6224('0x10')][_0x6224('0x11')]);}logger[_0x6224('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x56a1c9,_0x37eeab['error'][_0x6224('0x11')]);return _0x1af029(_0x37eeab[_0x6224('0x10')]['message']);}else{logger['info'](_0x6224('0xb'),_0x56a1c9,'request\x20sent');_0x1af029(_0x37eeab[_0x6224('0x12')]['message']);}})[_0x6224('0x13')](function(_0x447097){logger[_0x6224('0x10')](_0x6224('0xb'),_0x56a1c9,_0x447097);_0x5d9c4f(_0x447097);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 4da3ff1..5eae47b 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 _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1fe29d,_0x1d05c5){var _0x5d5506=function(_0x9806c6){while(--_0x9806c6){_0x1fe29d['push'](_0x1fe29d['shift']());}};_0x5d5506(++_0x1d05c5);}(_0x2d17,0x17e));var _0x72d1=function(_0x4e2dd9,_0x117a37){_0x4e2dd9=_0x4e2dd9-0x0;var _0x3fc116=_0x2d17[_0x4e2dd9];return _0x3fc116;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router;
\ No newline at end of file
+var _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0xeda5dd,_0x2c1360){var _0x3f0237=function(_0x517dc2){while(--_0x517dc2){_0xeda5dd['push'](_0xeda5dd['shift']());}};_0x3f0237(++_0x2c1360);}(_0xdc97,0x13b));var _0x7dc9=function(_0x236fdf,_0x58fb28){_0x236fdf=_0x236fdf-0x0;var _0x40c49a=_0xdc97[_0x236fdf];return _0x40c49a;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d07d9b3..edcdddc 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 _0xc60a=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','beepall'];(function(_0x396f60,_0x44c360){var _0x569f36=function(_0x1b2f25){while(--_0x1b2f25){_0x396f60['push'](_0x396f60['shift']());}};_0x569f36(++_0x44c360);}(_0xc60a,0xa2));var _0xac60=function(_0x3a018d,_0xd6683a){_0x3a018d=_0x3a018d-0x0;var _0x301f6c=_0xc60a[_0x3a018d];return _0x301f6c;};'use strict';var Sequelize=require(_0xac60('0x0'));module[_0xac60('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac60('0x2')]},'timeout':{'type':Sequelize[_0xac60('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac60('0x4')]('rrmemory',_0xac60('0x5'),_0xac60('0x6'))}};
\ No newline at end of file
+var _0x0407=['ENUM','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x95ddad,_0x4d021a){var _0x51c73d=function(_0x227cff){while(--_0x227cff){_0x95ddad['push'](_0x95ddad['shift']());}};_0x51c73d(++_0x4d021a);}(_0x0407,0x1ad));var _0x7040=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x0407[_0x4b4277];return _0x1ff405;};'use strict';var Sequelize=require(_0x7040('0x0'));module[_0x7040('0x1')]={'name':{'type':Sequelize[_0x7040('0x2')],'unique':_0x7040('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7040('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7040('0x5')]('rrmemory',_0x7040('0x6'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 0c026e8..f2a546d 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 _0x0cf9=['path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','find','describe','findOne','UserChatQueue','order','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','Team','length','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','zip-dir','fast-json-patch','request-promise','util'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0x0cf9,0x8d));var _0x90cf=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x0cf9[_0x34e14d];return _0x3d8e08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x90cf('0x0'));var jsonpatch=require(_0x90cf('0x1'));var rp=require(_0x90cf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x90cf('0x3'));var path=require(_0x90cf('0x4'));var sox=require('sox');var csv=require(_0x90cf('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90cf('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x90cf('0x7'));var jsforce=require(_0x90cf('0x8'));var deskjs=require(_0x90cf('0x9'));var toCsv=require(_0x90cf('0x5'));var querystring=require(_0x90cf('0xa'));var Papa=require(_0x90cf('0xb'));var Redis=require(_0x90cf('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x90cf('0xd'));var as=require(_0x90cf('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90cf('0xf'))(_0x90cf('0x10'));var utils=require(_0x90cf('0x11'));var config=require(_0x90cf('0x12'));var licenseUtil=require(_0x90cf('0x13'));var db=require('../../mysqldb')['db'];config[_0x90cf('0x14')]=_[_0x90cf('0x15')](config[_0x90cf('0x14')],{'host':_0x90cf('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x90cf('0x14')]));require('./chatQueue.socket')[_0x90cf('0x17')](socket);var jayson=require(_0x90cf('0x18'));var client=jayson[_0x90cf('0x19')][_0x90cf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x187490,_0x3b0568,_0xbc473c,_0x48fc35){return new BPromise(function(_0x5cd5a5,_0x32c5e6){var _0xeaeeed=_0x48fc35||client;return _0xeaeeed['request'](_0x187490,_0xbc473c)['then'](function(_0x428f9a){logger[_0x90cf('0x1b')](_0x90cf('0x1c'),_0x3b0568,_0x90cf('0x1d'));logger['debug'](_0x90cf('0x1e'),_0x3b0568,_0x90cf('0x1d'),JSON['stringify'](_0x428f9a));if(_0x428f9a[_0x90cf('0x1f')]){if(_0x428f9a[_0x90cf('0x1f')]['code']===0x1f4){logger[_0x90cf('0x1f')](_0x90cf('0x1c'),_0x3b0568,_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);return _0x32c5e6(_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x3b0568,_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);return _0x5cd5a5(_0x428f9a[_0x90cf('0x1f')][_0x90cf('0x20')]);}else{logger[_0x90cf('0x1b')](_0x90cf('0x1c'),_0x3b0568,_0x90cf('0x1d'));_0x5cd5a5(_0x428f9a[_0x90cf('0x21')]['message']);}})['catch'](function(_0xf7939f){logger[_0x90cf('0x1f')](_0x90cf('0x1c'),_0x3b0568,_0xf7939f);_0x32c5e6(_0xf7939f);});});}function respondWithStatusCode(_0x1020bb,_0x13973b){_0x13973b=_0x13973b||0xcc;return function(_0x1426fe){if(_0x1426fe){return _0x1020bb[_0x90cf('0x22')](_0x13973b);}return _0x1020bb[_0x90cf('0x23')](_0x13973b)[_0x90cf('0x24')]();};}function respondWithResult(_0x239c06,_0x17542c){_0x17542c=_0x17542c||0xc8;return function(_0x555550){if(_0x555550){return _0x239c06['status'](_0x17542c)[_0x90cf('0x25')](_0x555550);}};}function respondWithFilteredResult(_0x10e6b7,_0x32ab34){return function(_0xcc0e0a){if(_0xcc0e0a){var _0x1123d4=typeof _0x32ab34[_0x90cf('0x26')]===_0x90cf('0x27')&&typeof _0x32ab34[_0x90cf('0x28')]===_0x90cf('0x27');var _0x417737=_0xcc0e0a[_0x90cf('0x29')];var _0x1c5dea=_0x1123d4?0x0:_0x32ab34['offset'];var _0x59f5e6=_0x1123d4?_0xcc0e0a[_0x90cf('0x29')]:_0x32ab34[_0x90cf('0x26')]+_0x32ab34['limit'];var _0x508f74;if(_0x59f5e6>=_0x417737){_0x59f5e6=_0x417737;_0x508f74=0xc8;}else{_0x508f74=0xce;}_0x10e6b7[_0x90cf('0x23')](_0x508f74);return _0x10e6b7[_0x90cf('0x2a')](_0x90cf('0x2b'),_0x1c5dea+'-'+_0x59f5e6+'/'+_0x417737)[_0x90cf('0x25')](_0xcc0e0a);}return null;};}function patchUpdates(_0x4035a1){return function(_0x45d900){try{jsonpatch['apply'](_0x45d900,_0x4035a1,!![]);}catch(_0x35f4a2){return BPromise[_0x90cf('0x2c')](_0x35f4a2);}return _0x45d900[_0x90cf('0x2d')]();};}function saveUpdates(_0x3e39e6,_0x2526c4){return function(_0x1b170a){if(_0x1b170a){return _0x1b170a['update'](_0x3e39e6)[_0x90cf('0x2e')](function(_0x6cf176){return _0x6cf176;});}return null;};}function removeEntity(_0x2cd268,_0x155e6b){return function(_0x34cfbc){if(_0x34cfbc){return _0x34cfbc[_0x90cf('0x2f')]()['then'](function(){var _0x218bd6=_0x34cfbc[_0x90cf('0x30')]({'plain':!![]});var _0x3cf026=_0x90cf('0x31');return db[_0x90cf('0x32')][_0x90cf('0x2f')]({'where':{'type':_0x3cf026,'resourceId':_0x218bd6['id']}})[_0x90cf('0x2e')](function(){return _0x34cfbc;});})[_0x90cf('0x2e')](function(){_0x2cd268[_0x90cf('0x23')](0xcc)[_0x90cf('0x24')]();});}};}function handleEntityNotFound(_0x3f4b27,_0x2fcc4c){return function(_0x204405){if(!_0x204405){_0x3f4b27[_0x90cf('0x22')](0x194);}return _0x204405;};}function handleError(_0x1abcf2,_0x4518ac){_0x4518ac=_0x4518ac||0x1f4;return function(_0x396bbb){logger[_0x90cf('0x1f')](_0x396bbb[_0x90cf('0x33')]);if(_0x396bbb['name']){delete _0x396bbb[_0x90cf('0x34')];}_0x1abcf2[_0x90cf('0x23')](_0x4518ac)[_0x90cf('0x35')](_0x396bbb);};}exports['index']=function(_0x25ddb3,_0xe4e6d3){var _0x265591={},_0x324ba2={},_0x442da3={'count':0x0,'rows':[]};var _0xdd105a=_[_0x90cf('0x36')](db[_0x90cf('0x37')]['rawAttributes'],function(_0x2b43e3){return{'name':_0x2b43e3[_0x90cf('0x38')],'type':_0x2b43e3[_0x90cf('0x39')][_0x90cf('0x3a')]};});_0x324ba2['model']=_[_0x90cf('0x36')](_0xdd105a,'name');_0x324ba2[_0x90cf('0x3b')]=_[_0x90cf('0x3c')](_0x25ddb3[_0x90cf('0x3b')]);_0x324ba2[_0x90cf('0x3d')]=_[_0x90cf('0x3e')](_0x324ba2[_0x90cf('0x3f')],_0x324ba2[_0x90cf('0x3b')]);_0x265591['attributes']=_[_0x90cf('0x3e')](_0x324ba2[_0x90cf('0x3f')],qs[_0x90cf('0x40')](_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x40')]));_0x265591[_0x90cf('0x41')]=_0x265591['attributes']['length']?_0x265591[_0x90cf('0x41')]:_0x324ba2[_0x90cf('0x3f')];if(!_0x25ddb3['query'][_0x90cf('0x42')](_0x90cf('0x43'))){_0x265591['limit']=qs[_0x90cf('0x28')](_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x28')]);_0x265591['offset']=qs['offset'](_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x26')]);}_0x265591['order']=qs[_0x90cf('0x44')](_0x25ddb3['query'][_0x90cf('0x44')]);_0x265591[_0x90cf('0x45')]=qs[_0x90cf('0x3d')](_[_0x90cf('0x46')](_0x25ddb3[_0x90cf('0x3b')],_0x324ba2['filters']),_0xdd105a);if(_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x47')]){_0x265591[_0x90cf('0x45')]=_[_0x90cf('0x48')](_0x265591[_0x90cf('0x45')],{'$or':_[_0x90cf('0x36')](_0xdd105a,function(_0x102233){if(_0x102233[_0x90cf('0x39')]!==_0x90cf('0x49')){var _0x3a399a={};_0x3a399a[_0x102233[_0x90cf('0x34')]]={'$like':'%'+_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x47')]+'%'};return _0x3a399a;}})});}_0x265591=_[_0x90cf('0x48')]({},_0x265591,_0x25ddb3[_0x90cf('0x4a')]);var _0x2a0699={'where':_0x265591[_0x90cf('0x45')]};return db[_0x90cf('0x37')][_0x90cf('0x29')](_0x2a0699)[_0x90cf('0x2e')](function(_0x21edcf){_0x442da3[_0x90cf('0x29')]=_0x21edcf;if(_0x25ddb3[_0x90cf('0x3b')][_0x90cf('0x4b')]){_0x265591['include']=[{'all':!![]}];}return db['ChatQueue'][_0x90cf('0x4c')](_0x265591);})[_0x90cf('0x2e')](function(_0x418b6a){_0x442da3[_0x90cf('0x4d')]=_0x418b6a;return _0x442da3;})['then'](respondWithFilteredResult(_0xe4e6d3,_0x265591))[_0x90cf('0x4e')](handleError(_0xe4e6d3,null));};exports[_0x90cf('0x4f')]=function(_0x4cf351,_0x1b3508){var _0x21fbf5={'raw':!![],'where':{'id':_0x4cf351['params']['id']}},_0x2b694a={};_0x2b694a[_0x90cf('0x3f')]=_[_0x90cf('0x3c')](db[_0x90cf('0x37')][_0x90cf('0x50')]);_0x2b694a[_0x90cf('0x3b')]=_['keys'](_0x4cf351['query']);_0x2b694a['filters']=_[_0x90cf('0x3e')](_0x2b694a[_0x90cf('0x3f')],_0x2b694a[_0x90cf('0x3b')]);_0x21fbf5[_0x90cf('0x41')]=_[_0x90cf('0x3e')](_0x2b694a[_0x90cf('0x3f')],qs[_0x90cf('0x40')](_0x4cf351[_0x90cf('0x3b')][_0x90cf('0x40')]));_0x21fbf5[_0x90cf('0x41')]=_0x21fbf5['attributes']['length']?_0x21fbf5['attributes']:_0x2b694a[_0x90cf('0x3f')];if(_0x4cf351[_0x90cf('0x3b')][_0x90cf('0x4b')]){_0x21fbf5['include']=[{'all':!![]}];}_0x21fbf5=_[_0x90cf('0x48')]({},_0x21fbf5,_0x4cf351[_0x90cf('0x4a')]);return db['ChatQueue']['find'](_0x21fbf5)['then'](handleEntityNotFound(_0x1b3508,null))[_0x90cf('0x2e')](respondWithResult(_0x1b3508,null))[_0x90cf('0x4e')](handleError(_0x1b3508,null));};exports['create']=function(_0x4974e6,_0x3199e0){return db[_0x90cf('0x37')][_0x90cf('0x51')](_0x4974e6['body'],{})[_0x90cf('0x2e')](function(_0x5b261a){var _0x265b6e=_0x4974e6[_0x90cf('0x52')][_0x90cf('0x30')]({'plain':!![]});if(!_0x265b6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x265b6e[_0x90cf('0x53')]===_0x90cf('0x52')){var _0x5875cb=_0x5b261a[_0x90cf('0x30')]({'plain':!![]});var _0x49b1a7=_0x90cf('0x31');return db[_0x90cf('0x54')]['find']({'where':{'name':_0x49b1a7,'userProfileId':_0x265b6e[_0x90cf('0x55')]},'raw':!![]})['then'](function(_0x5ca777){if(_0x5ca777&&_0x5ca777[_0x90cf('0x56')]===0x0){return db[_0x90cf('0x32')][_0x90cf('0x51')]({'name':_0x5875cb[_0x90cf('0x34')],'resourceId':_0x5875cb['id'],'type':_0x5ca777[_0x90cf('0x34')],'sectionId':_0x5ca777['id']},{})[_0x90cf('0x2e')](function(){return _0x5b261a;});}else{return _0x5b261a;}})[_0x90cf('0x4e')](function(_0x400cde){logger[_0x90cf('0x1f')](_0x90cf('0x57'),_0x400cde);throw _0x400cde;});}return _0x5b261a;})[_0x90cf('0x2e')](respondWithResult(_0x3199e0,0xc9))[_0x90cf('0x4e')](handleError(_0x3199e0,null));};exports[_0x90cf('0x58')]=function(_0x3ca6b8,_0x2c5139){if(_0x3ca6b8[_0x90cf('0x59')]['id']){delete _0x3ca6b8['body']['id'];}return db[_0x90cf('0x37')]['find']({'where':{'id':_0x3ca6b8[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x2c5139,null))['then'](saveUpdates(_0x3ca6b8[_0x90cf('0x59')],null))[_0x90cf('0x2e')](respondWithResult(_0x2c5139,null))[_0x90cf('0x4e')](handleError(_0x2c5139,null));};exports[_0x90cf('0x2f')]=function(_0x2903a4,_0x36f359){return db['ChatQueue'][_0x90cf('0x5b')]({'where':{'id':_0x2903a4[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x36f359,null))[_0x90cf('0x2e')](removeEntity(_0x36f359,null))['catch'](handleError(_0x36f359,null));};exports[_0x90cf('0x5c')]=function(_0x3d53ea,_0x442b57){return db[_0x90cf('0x37')][_0x90cf('0x5c')]()[_0x90cf('0x2e')](respondWithResult(_0x442b57,null))[_0x90cf('0x4e')](handleError(_0x442b57,null));};exports['getMembers']=function(_0x2ac6da,_0x40dd77,_0x2fefd0){var _0x112280={'raw':!![],'where':{}},_0x55b382={},_0x2dfa37;return db[_0x90cf('0x37')][_0x90cf('0x5d')]({'where':{'id':_0x2ac6da[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x40dd77,null))[_0x90cf('0x2e')](function(_0x394ea0){if(_0x394ea0){_0x2dfa37=_0x394ea0['get']({'plain':!![]});_0x55b382[_0x90cf('0x3f')]=_['keys'](db[_0x90cf('0x5e')]['rawAttributes']);_0x55b382[_0x90cf('0x3b')]=_[_0x90cf('0x3c')](_0x2ac6da['query']);_0x55b382[_0x90cf('0x3d')]=_['intersection'](_0x55b382['model'],_0x55b382[_0x90cf('0x3b')]);_0x112280[_0x90cf('0x41')]=_['intersection'](_0x55b382['model'],qs[_0x90cf('0x40')](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x40')]));_0x112280['attributes']=_0x112280[_0x90cf('0x41')]['length']?_0x112280[_0x90cf('0x41')]:_0x55b382[_0x90cf('0x3f')];if(!_0x2ac6da['query'][_0x90cf('0x42')](_0x90cf('0x43'))){_0x112280[_0x90cf('0x28')]=qs[_0x90cf('0x28')](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x28')]);_0x112280[_0x90cf('0x26')]=qs['offset'](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x26')]);}_0x112280[_0x90cf('0x5f')]=qs[_0x90cf('0x44')](_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x44')]);_0x112280[_0x90cf('0x45')]=qs[_0x90cf('0x3d')](_[_0x90cf('0x46')](_0x2ac6da['query'],_0x55b382[_0x90cf('0x3d')]));_0x112280[_0x90cf('0x45')]['ChatQueueId']=_0x394ea0['id'];if(_0x2ac6da[_0x90cf('0x3b')][_0x90cf('0x47')]){_0x112280[_0x90cf('0x45')]=_['merge'](_0x112280[_0x90cf('0x45')],{'$or':_[_0x90cf('0x36')](_0x112280[_0x90cf('0x41')],function(_0x325f24){var _0x1ce290={};_0x1ce290[_0x325f24]={'$like':'%'+_0x2ac6da['query'][_0x90cf('0x47')]+'%'};return _0x1ce290;})});}_0x112280=_[_0x90cf('0x48')]({},_0x112280,_0x2ac6da['options']);return db[_0x90cf('0x5e')]['findAll'](_0x112280);}})[_0x90cf('0x2e')](function(_0x4d8ef8){if(_0x4d8ef8){return db[_0x90cf('0x60')][_0x90cf('0x61')]({'where':{'id':_[_0x90cf('0x36')](_0x4d8ef8,_0x90cf('0x62')),'role':_0x90cf('0x63')},'attributes':['id',_0x90cf('0x34'),'chatPause',_0x90cf('0x64'),_0x90cf('0x65')]});}})[_0x90cf('0x2e')](function(_0x6b10d){if(_0x6b10d){return{'count':_0x6b10d[_0x90cf('0x29')],'rows':_['map'](_0x6b10d[_0x90cf('0x4d')],function(_0x32538b){return{'membername':_0x32538b[_0x90cf('0x34')],'UserId':_0x32538b['id'],'queue_name':_0x2dfa37[_0x90cf('0x34')],'ChatQueueId':_0x2dfa37['id'],'interface':util[_0x90cf('0x66')](_0x90cf('0x67'),'SIP',_0x32538b[_0x90cf('0x34')]),'penalty':0x0,'paused':_0x32538b['chatPause'],'createdAt':_0x32538b['createdAt'],'updatedAt':_0x32538b[_0x90cf('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x90cf('0x2e')](respondWithFilteredResult(_0x40dd77,_0x112280))[_0x90cf('0x4e')](handleError(_0x40dd77,null));};exports['getTeams']=function(_0x2a9d1b,_0x97176e,_0x1ddc5f){var _0x5db957={};var _0x15c468={};var _0x1a0c85;var _0x3d8716;return db[_0x90cf('0x37')]['findOne']({'where':{'id':_0x2a9d1b[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x97176e,null))['then'](function(_0x15feff){if(_0x15feff){_0x1a0c85=_0x15feff;_0x15c468[_0x90cf('0x3f')]=_[_0x90cf('0x3c')](db[_0x90cf('0x68')][_0x90cf('0x50')]);_0x15c468[_0x90cf('0x3b')]=_[_0x90cf('0x3c')](_0x2a9d1b[_0x90cf('0x3b')]);_0x15c468['filters']=_[_0x90cf('0x3e')](_0x15c468[_0x90cf('0x3f')],_0x15c468[_0x90cf('0x3b')]);_0x5db957['attributes']=_[_0x90cf('0x3e')](_0x15c468[_0x90cf('0x3f')],qs['fields'](_0x2a9d1b[_0x90cf('0x3b')]['fields']));_0x5db957['attributes']=_0x5db957[_0x90cf('0x41')][_0x90cf('0x69')]?_0x5db957[_0x90cf('0x41')]:_0x15c468['model'];_0x5db957[_0x90cf('0x5f')]=qs['sort'](_0x2a9d1b['query']['sort']);_0x5db957[_0x90cf('0x45')]=qs[_0x90cf('0x3d')](_['pick'](_0x2a9d1b[_0x90cf('0x3b')],_0x15c468['filters']));if(_0x2a9d1b[_0x90cf('0x3b')][_0x90cf('0x47')]){_0x5db957[_0x90cf('0x45')]=_[_0x90cf('0x48')](_0x5db957['where'],{'$or':_[_0x90cf('0x36')](_0x5db957['attributes'],function(_0x218f69){var _0x4af285={};_0x4af285[_0x218f69]={'$like':'%'+_0x2a9d1b[_0x90cf('0x3b')][_0x90cf('0x47')]+'%'};return _0x4af285;})});}_0x5db957=_[_0x90cf('0x48')]({},_0x5db957,_0x2a9d1b[_0x90cf('0x4a')]);return _0x1a0c85['getTeams'](_0x5db957);}})['then'](function(_0x2bd60b){if(_0x2bd60b){_0x3d8716=_0x2bd60b['length'];if(!_0x2a9d1b['query'][_0x90cf('0x42')]('nolimit')){_0x5db957[_0x90cf('0x28')]=qs['limit'](_0x2a9d1b['query']['limit']);_0x5db957[_0x90cf('0x26')]=qs[_0x90cf('0x26')](_0x2a9d1b[_0x90cf('0x3b')][_0x90cf('0x26')]);}return _0x1a0c85[_0x90cf('0x6a')](_0x5db957);}})[_0x90cf('0x2e')](function(_0x8cd9c0){if(_0x8cd9c0){return _0x8cd9c0?{'count':_0x3d8716,'rows':_0x8cd9c0}:null;}})[_0x90cf('0x2e')](respondWithResult(_0x97176e,null))['catch'](handleError(_0x97176e,null));};exports['addTeams']=function(_0x567726,_0x2f8f4b,_0x1e1d59){var _0x3661a0=_0x567726['body']['ids'];return db[_0x90cf('0x68')][_0x90cf('0x4c')]({'where':{'id':_0x3661a0},'attributes':['id'],'include':[{'model':db[_0x90cf('0x60')],'as':_0x90cf('0x6b'),'attributes':['id','name',_0x90cf('0x6c'),_0x90cf('0x6d'),_0x90cf('0x6e')],'raw':!![]}]})[_0x90cf('0x2e')](function(_0x5880fa){if(_0x5880fa){var _0x8e7f2d=_[_0x90cf('0x6f')](_0x5880fa,function(_0x4f86ed){var _0x14e52f=_0x4f86ed[_0x90cf('0x30')]({'plain':!![]});return _0x14e52f[_0x90cf('0x6b')];});return db[_0x90cf('0x37')][_0x90cf('0x5b')]({'where':{'id':_0x567726[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](function(_0x329ca2){return db[_0x90cf('0x70')][_0x90cf('0x71')](function(_0x4aa35d){return _0x329ca2[_0x90cf('0x72')](_0x3661a0,{'transaction':_0x4aa35d})[_0x90cf('0x2e')](function(){return BPromise[_0x90cf('0x73')](_0x8e7f2d,function(_0x2bd8cc){return db[_0x90cf('0x5e')][_0x90cf('0x74')]({'where':{'UserId':_0x2bd8cc['id'],'ChatQueueId':_0x567726[_0x90cf('0x5a')]['id']},'transaction':_0x4aa35d});});})[_0x90cf('0x2e')](function(){_0x8e7f2d[_0x90cf('0x75')](function(_0x17f6f8){socket[_0x90cf('0x76')](_0x90cf('0x77'),{'UserId':_0x17f6f8['id'],'ChatQueueId':_0x329ca2['id']});});});});});}})[_0x90cf('0x2e')](respondWithStatusCode(_0x2f8f4b,null))[_0x90cf('0x4e')](handleError(_0x2f8f4b,null));};exports[_0x90cf('0x78')]=function(_0x5cd31c,_0x559c4d,_0x4e6393){return db['Team'][_0x90cf('0x4c')]({'where':{'id':_0x5cd31c[_0x90cf('0x3b')][_0x90cf('0x79')]},'attributes':['id'],'include':[{'model':db[_0x90cf('0x60')],'as':_0x90cf('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x90cf('0x2e')](handleEntityNotFound(_0x559c4d,null))[_0x90cf('0x2e')](function(_0x3a2a56){var _0xb46a12=_['map'](_0x3a2a56,'id');var _0x1a5dda=[];var _0x590885=[];var _0x26dd8e=squel[_0x90cf('0x7a')]();_0x26dd8e[_0x90cf('0x7b')](_0x90cf('0x7c'))[_0x90cf('0x7d')](_0x90cf('0x7e'),'tq')[_0x90cf('0x7f')]('user_has_teams','ut',_0x90cf('0x80'))[_0x90cf('0x45')](_0x90cf('0x81'),_0x5cd31c[_0x90cf('0x5a')]['id']);for(var _0x5fd4ea=0x0;_0x5fd4ea<_0x3a2a56[_0x90cf('0x69')];_0x5fd4ea+=0x1){let _0x19ac69=_0x3a2a56[_0x5fd4ea];for(var _0x47f159=0x0;_0x47f159<_0x19ac69['Agents'][_0x90cf('0x69')];_0x47f159+=0x1){let _0x574396=_0x19ac69[_0x90cf('0x6b')][_0x47f159];var _0x20a4a1=_0x26dd8e[_0x90cf('0x82')]();_0x20a4a1[_0x90cf('0x45')]('ut.UserId\x20=\x20?',_0x574396['id']);_0x590885[_0x90cf('0x83')](db[_0x90cf('0x70')][_0x90cf('0x3b')](_0x20a4a1['toString'](),{'type':db[_0x90cf('0x70')]['QueryTypes']['SELECT']})[_0x90cf('0x2e')](function(_0x2ab0e){if(_0x2ab0e['length']===0x1){return _0x574396['id'];}else{var _0xc15d79=_[_0x90cf('0x84')](_[_0x90cf('0x36')](_0x2ab0e,_0x90cf('0x85')),function(_0x477f00){return _[_0x90cf('0x86')](_0xb46a12,_0x477f00);});if(_0xc15d79){return _0x574396['id'];}}}));}}return BPromise[_0x90cf('0x87')](_0x590885)[_0x90cf('0x2e')](function(_0x19dacd){_0x1a5dda=_(_0x1a5dda)[_0x90cf('0x88')](_0x19dacd)[_0x90cf('0x89')]()[_0x90cf('0x8a')]();return db[_0x90cf('0x37')][_0x90cf('0x5b')]({'where':{'id':_0x5cd31c['params']['id']}})[_0x90cf('0x2e')](function(_0x3a8377){return db['sequelize'][_0x90cf('0x71')](function(_0x110aeb){return _0x3a8377[_0x90cf('0x78')](_0x5cd31c[_0x90cf('0x3b')][_0x90cf('0x79')],{'transaction':_0x110aeb})['then'](function(){if(!_['isEmpty'](_0x1a5dda)){return _0x3a8377[_0x90cf('0x8b')](_0x1a5dda,{'transaction':_0x110aeb});}})['then'](function(){_0x1a5dda[_0x90cf('0x75')](function(_0x4de011){socket['emit'](_0x90cf('0x8c'),{'UserId':_0x4de011,'ChatQueueId':_0x3a8377['id']});});});});});});})['then'](respondWithStatusCode(_0x559c4d,null))[_0x90cf('0x4e')](handleError(_0x559c4d,null));};exports[_0x90cf('0x8d')]=function(_0x4bde0c,_0x104c5b,_0x2dece1){return db[_0x90cf('0x37')]['find']({'where':{'id':_0x4bde0c[_0x90cf('0x5a')]['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x104c5b,null))[_0x90cf('0x2e')](function(_0x11fcc2){if(_0x11fcc2){return _0x11fcc2[_0x90cf('0x8d')](_0x4bde0c[_0x90cf('0x59')]['ids'],_[_0x90cf('0x8e')](_0x4bde0c['body'],[_0x90cf('0x79'),'id'])||{})[_0x90cf('0x8f')](function(_0x3c5b2b){for(var _0x5b3dc0=0x0;_0x5b3dc0<_0x4bde0c[_0x90cf('0x59')]['ids'][_0x90cf('0x69')];_0x5b3dc0+=0x1){socket['emit'](_0x90cf('0x77'),{'UserId':Number(_0x4bde0c[_0x90cf('0x59')][_0x90cf('0x79')][_0x5b3dc0]),'ChatQueueId':Number(_0x4bde0c[_0x90cf('0x5a')]['id'])});}return _0x3c5b2b;});}})[_0x90cf('0x2e')](respondWithResult(_0x104c5b,null))[_0x90cf('0x4e')](handleError(_0x104c5b,null));};exports[_0x90cf('0x8b')]=function(_0x5c97c9,_0x1b2290,_0x8a1820){return db[_0x90cf('0x37')][_0x90cf('0x5b')]({'where':{'id':_0x5c97c9['params']['id']}})[_0x90cf('0x2e')](handleEntityNotFound(_0x1b2290,null))[_0x90cf('0x2e')](function(_0x42999a){if(_0x42999a){return _0x42999a[_0x90cf('0x8b')](_0x5c97c9['query'][_0x90cf('0x79')])[_0x90cf('0x2e')](function(){if(_[_0x90cf('0x90')](_0x5c97c9['query']['ids'])){for(var _0x4f3be5=0x0;_0x4f3be5<_0x5c97c9[_0x90cf('0x3b')]['ids'][_0x90cf('0x69')];_0x4f3be5+=0x1){socket['emit'](_0x90cf('0x8c'),{'UserId':Number(_0x5c97c9['query']['ids'][_0x4f3be5]),'ChatQueueId':Number(_0x5c97c9[_0x90cf('0x5a')]['id'])});}}else{socket['emit'](_0x90cf('0x8c'),{'UserId':Number(_0x5c97c9[_0x90cf('0x3b')][_0x90cf('0x79')]),'ChatQueueId':Number(_0x5c97c9[_0x90cf('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b2290,null))[_0x90cf('0x4e')](handleError(_0x1b2290,null));};exports['getAgents']=function(_0xeea30a,_0xbd7e60,_0x4d0bb9){var _0x5a7496={};var _0x3a10d6={};var _0x2ae4ba;var _0x42e7a5;return db['ChatQueue'][_0x90cf('0x5d')]({'where':{'id':_0xeea30a[_0x90cf('0x5a')]['id']}})['then'](handleEntityNotFound(_0xbd7e60,null))[_0x90cf('0x2e')](function(_0x1b8596){if(_0x1b8596){_0x2ae4ba=_0x1b8596;_0x3a10d6[_0x90cf('0x3f')]=_[_0x90cf('0x3c')](db[_0x90cf('0x60')]['rawAttributes']);_0x3a10d6['query']=_[_0x90cf('0x3c')](_0xeea30a[_0x90cf('0x3b')]);_0x3a10d6['filters']=_[_0x90cf('0x3e')](_0x3a10d6[_0x90cf('0x3f')],_0x3a10d6[_0x90cf('0x3b')]);_0x5a7496[_0x90cf('0x41')]=_[_0x90cf('0x3e')](_0x3a10d6[_0x90cf('0x3f')],qs[_0x90cf('0x40')](_0xeea30a[_0x90cf('0x3b')]['fields']));_0x5a7496[_0x90cf('0x41')]=_0x5a7496[_0x90cf('0x41')]['length']?_0x5a7496[_0x90cf('0x41')]:_0x3a10d6['model'];_0x5a7496[_0x90cf('0x5f')]=qs['sort'](_0xeea30a[_0x90cf('0x3b')][_0x90cf('0x44')]);_0x5a7496['where']=qs[_0x90cf('0x3d')](_['pick'](_0xeea30a['query'],_0x3a10d6[_0x90cf('0x3d')]));if(_0xeea30a[_0x90cf('0x3b')]['filter']){_0x5a7496['where']=_[_0x90cf('0x48')](_0x5a7496['where'],{'$or':_[_0x90cf('0x36')](_0x5a7496[_0x90cf('0x41')],function(_0x19876e){var _0x1d65d0={};_0x1d65d0[_0x19876e]={'$like':'%'+_0xeea30a[_0x90cf('0x3b')]['filter']+'%'};return _0x1d65d0;})});}_0x5a7496=_[_0x90cf('0x48')]({},_0x5a7496,_0xeea30a[_0x90cf('0x4a')]);return _0x2ae4ba['getAgents'](_0x5a7496);}})[_0x90cf('0x2e')](function(_0x4d8325){if(_0x4d8325){_0x42e7a5=_0x4d8325[_0x90cf('0x69')];if(!_0xeea30a[_0x90cf('0x3b')]['hasOwnProperty'](_0x90cf('0x43'))){_0x5a7496[_0x90cf('0x28')]=qs[_0x90cf('0x28')](_0xeea30a[_0x90cf('0x3b')]['limit']);_0x5a7496[_0x90cf('0x26')]=qs['offset'](_0xeea30a[_0x90cf('0x3b')]['offset']);}return _0x2ae4ba['getAgents'](_0x5a7496);}})['then'](function(_0x4bee70){if(_0x4bee70){return _0x4bee70?{'count':_0x42e7a5,'rows':_0x4bee70}:null;}})[_0x90cf('0x2e')](respondWithResult(_0xbd7e60,null))[_0x90cf('0x4e')](handleError(_0xbd7e60,null));};
\ No newline at end of file
+var _0xa39b=['includeAll','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','nolimit','order','pick','ChatQueueId','UserChatQueue','findAndCountAll','agent','chatPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','User','Agents','voicePause','interface','sequelize','each','forEach','emit','removeTeams','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','transaction','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','ChatQueues','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','options','include','findAll','rows'];(function(_0x58b3ce,_0x24e20b){var _0x1c8926=function(_0x59f620){while(--_0x59f620){_0x58b3ce['push'](_0x58b3ce['shift']());}};_0x1c8926(++_0x24e20b);}(_0xa39b,0x169));var _0xba39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa39b[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xba39('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba39('0x1'));var rp=require(_0xba39('0x2'));var moment=require('moment');var BPromise=require(_0xba39('0x3'));var Mustache=require(_0xba39('0x4'));var util=require(_0xba39('0x5'));var path=require(_0xba39('0x6'));var sox=require(_0xba39('0x7'));var csv=require(_0xba39('0x8'));var ejs=require(_0xba39('0x9'));var fs=require('fs');var fs_extra=require(_0xba39('0xa'));var _=require(_0xba39('0xb'));var squel=require(_0xba39('0xc'));var crypto=require(_0xba39('0xd'));var jsforce=require(_0xba39('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xba39('0x8'));var querystring=require('querystring');var Papa=require(_0xba39('0xf'));var Redis=require('ioredis');var authService=require(_0xba39('0x10'));var qs=require(_0xba39('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba39('0x12'));var utils=require(_0xba39('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xba39('0x14'));var db=require(_0xba39('0x15'))['db'];config['redis']=_[_0xba39('0x16')](config[_0xba39('0x17')],{'host':_0xba39('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xba39('0x19'))['register'](socket);var jayson=require(_0xba39('0x1a'));var client=jayson[_0xba39('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8428,_0x254a13,_0x568339,_0x3c42da){return new BPromise(function(_0x5df289,_0x5bdc87){var _0x5db731=_0x3c42da||client;return _0x5db731[_0xba39('0x1c')](_0x2d8428,_0x568339)['then'](function(_0x5644d4){logger[_0xba39('0x1d')](_0xba39('0x1e'),_0x254a13,_0xba39('0x1f'));logger[_0xba39('0x20')](_0xba39('0x21'),_0x254a13,_0xba39('0x1f'),JSON[_0xba39('0x22')](_0x5644d4));if(_0x5644d4[_0xba39('0x23')]){if(_0x5644d4['error'][_0xba39('0x24')]===0x1f4){logger[_0xba39('0x23')]('ChatQueue,\x20%s,\x20%s',_0x254a13,_0x5644d4[_0xba39('0x23')][_0xba39('0x25')]);return _0x5bdc87(_0x5644d4[_0xba39('0x23')][_0xba39('0x25')]);}logger[_0xba39('0x23')]('ChatQueue,\x20%s,\x20%s',_0x254a13,_0x5644d4[_0xba39('0x23')][_0xba39('0x25')]);return _0x5df289(_0x5644d4[_0xba39('0x23')]['message']);}else{logger[_0xba39('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x254a13,_0xba39('0x1f'));_0x5df289(_0x5644d4[_0xba39('0x26')]['message']);}})[_0xba39('0x27')](function(_0x2b1a01){logger['error'](_0xba39('0x1e'),_0x254a13,_0x2b1a01);_0x5bdc87(_0x2b1a01);});});}function respondWithStatusCode(_0x2fca5f,_0x1fb7bb){_0x1fb7bb=_0x1fb7bb||0xcc;return function(_0x1193e2){if(_0x1193e2){return _0x2fca5f['sendStatus'](_0x1fb7bb);}return _0x2fca5f['status'](_0x1fb7bb)['end']();};}function respondWithResult(_0x4574c3,_0x29c0ea){_0x29c0ea=_0x29c0ea||0xc8;return function(_0x5bfd84){if(_0x5bfd84){return _0x4574c3[_0xba39('0x28')](_0x29c0ea)[_0xba39('0x29')](_0x5bfd84);}};}function respondWithFilteredResult(_0x5b6ea2,_0x4fee87){return function(_0x31e8ae){if(_0x31e8ae){var _0x534784=typeof _0x4fee87['offset']===_0xba39('0x2a')&&typeof _0x4fee87[_0xba39('0x2b')]===_0xba39('0x2a');var _0x108f28=_0x31e8ae[_0xba39('0x2c')];var _0x364ded=_0x534784?0x0:_0x4fee87[_0xba39('0x2d')];var _0x53c97e=_0x534784?_0x31e8ae['count']:_0x4fee87[_0xba39('0x2d')]+_0x4fee87[_0xba39('0x2b')];var _0xed5250;if(_0x53c97e>=_0x108f28){_0x53c97e=_0x108f28;_0xed5250=0xc8;}else{_0xed5250=0xce;}_0x5b6ea2[_0xba39('0x28')](_0xed5250);return _0x5b6ea2[_0xba39('0x2e')](_0xba39('0x2f'),_0x364ded+'-'+_0x53c97e+'/'+_0x108f28)[_0xba39('0x29')](_0x31e8ae);}return null;};}function patchUpdates(_0x5c8b48){return function(_0x5914a5){try{jsonpatch['apply'](_0x5914a5,_0x5c8b48,!![]);}catch(_0x121f15){return BPromise['reject'](_0x121f15);}return _0x5914a5[_0xba39('0x30')]();};}function saveUpdates(_0x121da5,_0x2c7c12){return function(_0x4cf566){if(_0x4cf566){return _0x4cf566[_0xba39('0x31')](_0x121da5)[_0xba39('0x32')](function(_0x30a33b){return _0x30a33b;});}return null;};}function removeEntity(_0x5a7498,_0x3a238f){return function(_0x1b740e){if(_0x1b740e){return _0x1b740e[_0xba39('0x33')]()[_0xba39('0x32')](function(){var _0x87a12d=_0x1b740e[_0xba39('0x34')]({'plain':!![]});var _0x378ff8=_0xba39('0x35');return db['UserProfileResource'][_0xba39('0x33')]({'where':{'type':_0x378ff8,'resourceId':_0x87a12d['id']}})[_0xba39('0x32')](function(){return _0x1b740e;});})[_0xba39('0x32')](function(){_0x5a7498['status'](0xcc)[_0xba39('0x36')]();});}};}function handleEntityNotFound(_0x5caa2d,_0x30a726){return function(_0x1a7956){if(!_0x1a7956){_0x5caa2d['sendStatus'](0x194);}return _0x1a7956;};}function handleError(_0x2ca506,_0x32887f){_0x32887f=_0x32887f||0x1f4;return function(_0x74e0b5){logger[_0xba39('0x23')](_0x74e0b5[_0xba39('0x37')]);if(_0x74e0b5[_0xba39('0x38')]){delete _0x74e0b5[_0xba39('0x38')];}_0x2ca506['status'](_0x32887f)['send'](_0x74e0b5);};}exports[_0xba39('0x39')]=function(_0x44a77c,_0x4a6312){var _0x6e9c68={},_0x56ddf8={},_0x37dd75={'count':0x0,'rows':[]};var _0x39112d=_[_0xba39('0x3a')](db[_0xba39('0x3b')][_0xba39('0x3c')],function(_0x26631e){return{'name':_0x26631e[_0xba39('0x3d')],'type':_0x26631e[_0xba39('0x3e')][_0xba39('0x3f')]};});_0x56ddf8[_0xba39('0x40')]=_[_0xba39('0x3a')](_0x39112d,'name');_0x56ddf8[_0xba39('0x41')]=_[_0xba39('0x42')](_0x44a77c[_0xba39('0x41')]);_0x56ddf8[_0xba39('0x43')]=_[_0xba39('0x44')](_0x56ddf8[_0xba39('0x40')],_0x56ddf8[_0xba39('0x41')]);_0x6e9c68[_0xba39('0x45')]=_[_0xba39('0x44')](_0x56ddf8[_0xba39('0x40')],qs[_0xba39('0x46')](_0x44a77c[_0xba39('0x41')]['fields']));_0x6e9c68[_0xba39('0x45')]=_0x6e9c68['attributes'][_0xba39('0x47')]?_0x6e9c68[_0xba39('0x45')]:_0x56ddf8[_0xba39('0x40')];if(!_0x44a77c[_0xba39('0x41')]['hasOwnProperty']('nolimit')){_0x6e9c68['limit']=qs['limit'](_0x44a77c[_0xba39('0x41')][_0xba39('0x2b')]);_0x6e9c68[_0xba39('0x2d')]=qs[_0xba39('0x2d')](_0x44a77c[_0xba39('0x41')][_0xba39('0x2d')]);}_0x6e9c68['order']=qs['sort'](_0x44a77c[_0xba39('0x41')][_0xba39('0x48')]);_0x6e9c68[_0xba39('0x49')]=qs[_0xba39('0x43')](_['pick'](_0x44a77c['query'],_0x56ddf8[_0xba39('0x43')]),_0x39112d);if(_0x44a77c[_0xba39('0x41')][_0xba39('0x4a')]){_0x6e9c68['where']=_['merge'](_0x6e9c68[_0xba39('0x49')],{'$or':_[_0xba39('0x3a')](_0x39112d,function(_0x34c13b){if(_0x34c13b[_0xba39('0x3e')]!=='VIRTUAL'){var _0x526dc3={};_0x526dc3[_0x34c13b[_0xba39('0x38')]]={'$like':'%'+_0x44a77c[_0xba39('0x41')][_0xba39('0x4a')]+'%'};return _0x526dc3;}})});}_0x6e9c68=_[_0xba39('0x4b')]({},_0x6e9c68,_0x44a77c[_0xba39('0x4c')]);var _0x5cbf2b={'where':_0x6e9c68['where']};return db[_0xba39('0x3b')][_0xba39('0x2c')](_0x5cbf2b)[_0xba39('0x32')](function(_0x5289dd){_0x37dd75[_0xba39('0x2c')]=_0x5289dd;if(_0x44a77c[_0xba39('0x41')]['includeAll']){_0x6e9c68[_0xba39('0x4d')]=[{'all':!![]}];}return db[_0xba39('0x3b')][_0xba39('0x4e')](_0x6e9c68);})['then'](function(_0x3437c1){_0x37dd75[_0xba39('0x4f')]=_0x3437c1;return _0x37dd75;})['then'](respondWithFilteredResult(_0x4a6312,_0x6e9c68))[_0xba39('0x27')](handleError(_0x4a6312,null));};exports['show']=function(_0x2cdaba,_0x26224e){var _0x7467b1={'raw':!![],'where':{'id':_0x2cdaba['params']['id']}},_0x2c3edd={};_0x2c3edd[_0xba39('0x40')]=_[_0xba39('0x42')](db[_0xba39('0x3b')]['rawAttributes']);_0x2c3edd[_0xba39('0x41')]=_[_0xba39('0x42')](_0x2cdaba[_0xba39('0x41')]);_0x2c3edd[_0xba39('0x43')]=_[_0xba39('0x44')](_0x2c3edd[_0xba39('0x40')],_0x2c3edd[_0xba39('0x41')]);_0x7467b1[_0xba39('0x45')]=_[_0xba39('0x44')](_0x2c3edd[_0xba39('0x40')],qs['fields'](_0x2cdaba[_0xba39('0x41')][_0xba39('0x46')]));_0x7467b1[_0xba39('0x45')]=_0x7467b1['attributes'][_0xba39('0x47')]?_0x7467b1[_0xba39('0x45')]:_0x2c3edd[_0xba39('0x40')];if(_0x2cdaba[_0xba39('0x41')][_0xba39('0x50')]){_0x7467b1[_0xba39('0x4d')]=[{'all':!![]}];}_0x7467b1=_[_0xba39('0x4b')]({},_0x7467b1,_0x2cdaba['options']);return db['ChatQueue'][_0xba39('0x51')](_0x7467b1)['then'](handleEntityNotFound(_0x26224e,null))['then'](respondWithResult(_0x26224e,null))['catch'](handleError(_0x26224e,null));};exports['create']=function(_0x594e87,_0x1b2fe0){return db[_0xba39('0x3b')][_0xba39('0x52')](_0x594e87[_0xba39('0x53')],{})['then'](function(_0x239257){var _0x39be0f=_0x594e87[_0xba39('0x54')][_0xba39('0x34')]({'plain':!![]});if(!_0x39be0f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39be0f[_0xba39('0x55')]===_0xba39('0x54')){var _0x2a1c7b=_0x239257[_0xba39('0x34')]({'plain':!![]});var _0x1557e2=_0xba39('0x35');return db['UserProfileSection'][_0xba39('0x51')]({'where':{'name':_0x1557e2,'userProfileId':_0x39be0f[_0xba39('0x56')]},'raw':!![]})[_0xba39('0x32')](function(_0x3bd162){if(_0x3bd162&&_0x3bd162[_0xba39('0x57')]===0x0){return db[_0xba39('0x58')][_0xba39('0x52')]({'name':_0x2a1c7b['name'],'resourceId':_0x2a1c7b['id'],'type':_0x3bd162[_0xba39('0x38')],'sectionId':_0x3bd162['id']},{})['then'](function(){return _0x239257;});}else{return _0x239257;}})[_0xba39('0x27')](function(_0x2a85b2){logger[_0xba39('0x23')](_0xba39('0x59'),_0x2a85b2);throw _0x2a85b2;});}return _0x239257;})['then'](respondWithResult(_0x1b2fe0,0xc9))['catch'](handleError(_0x1b2fe0,null));};exports[_0xba39('0x31')]=function(_0x56b347,_0x4d1549){if(_0x56b347[_0xba39('0x53')]['id']){delete _0x56b347[_0xba39('0x53')]['id'];}return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x56b347['params']['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x4d1549,null))[_0xba39('0x32')](saveUpdates(_0x56b347['body'],null))['then'](respondWithResult(_0x4d1549,null))[_0xba39('0x27')](handleError(_0x4d1549,null));};exports[_0xba39('0x33')]=function(_0x33cf13,_0x54dd0c){return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x33cf13[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x54dd0c,null))[_0xba39('0x32')](removeEntity(_0x54dd0c,null))[_0xba39('0x27')](handleError(_0x54dd0c,null));};exports['describe']=function(_0x34da85,_0x8beac6){return db['ChatQueue'][_0xba39('0x5b')]()[_0xba39('0x32')](respondWithResult(_0x8beac6,null))[_0xba39('0x27')](handleError(_0x8beac6,null));};exports[_0xba39('0x5c')]=function(_0x4e5026,_0x581649,_0x26f47f){var _0x23ff61={'raw':!![],'where':{}},_0x1ce0b3={},_0x38714b;return db['ChatQueue'][_0xba39('0x5d')]({'where':{'id':_0x4e5026['params']['id']}})['then'](handleEntityNotFound(_0x581649,null))[_0xba39('0x32')](function(_0x4ca9c6){if(_0x4ca9c6){_0x38714b=_0x4ca9c6[_0xba39('0x34')]({'plain':!![]});_0x1ce0b3[_0xba39('0x40')]=_['keys'](db['UserChatQueue'][_0xba39('0x3c')]);_0x1ce0b3[_0xba39('0x41')]=_[_0xba39('0x42')](_0x4e5026[_0xba39('0x41')]);_0x1ce0b3[_0xba39('0x43')]=_[_0xba39('0x44')](_0x1ce0b3['model'],_0x1ce0b3[_0xba39('0x41')]);_0x23ff61[_0xba39('0x45')]=_[_0xba39('0x44')](_0x1ce0b3[_0xba39('0x40')],qs[_0xba39('0x46')](_0x4e5026[_0xba39('0x41')][_0xba39('0x46')]));_0x23ff61['attributes']=_0x23ff61[_0xba39('0x45')][_0xba39('0x47')]?_0x23ff61[_0xba39('0x45')]:_0x1ce0b3[_0xba39('0x40')];if(!_0x4e5026[_0xba39('0x41')][_0xba39('0x5e')](_0xba39('0x5f'))){_0x23ff61[_0xba39('0x2b')]=qs[_0xba39('0x2b')](_0x4e5026[_0xba39('0x41')]['limit']);_0x23ff61[_0xba39('0x2d')]=qs[_0xba39('0x2d')](_0x4e5026[_0xba39('0x41')][_0xba39('0x2d')]);}_0x23ff61[_0xba39('0x60')]=qs[_0xba39('0x48')](_0x4e5026[_0xba39('0x41')][_0xba39('0x48')]);_0x23ff61[_0xba39('0x49')]=qs[_0xba39('0x43')](_[_0xba39('0x61')](_0x4e5026[_0xba39('0x41')],_0x1ce0b3[_0xba39('0x43')]));_0x23ff61[_0xba39('0x49')][_0xba39('0x62')]=_0x4ca9c6['id'];if(_0x4e5026[_0xba39('0x41')][_0xba39('0x4a')]){_0x23ff61['where']=_[_0xba39('0x4b')](_0x23ff61[_0xba39('0x49')],{'$or':_['map'](_0x23ff61['attributes'],function(_0x22f9e2){var _0x1f6042={};_0x1f6042[_0x22f9e2]={'$like':'%'+_0x4e5026[_0xba39('0x41')]['filter']+'%'};return _0x1f6042;})});}_0x23ff61=_[_0xba39('0x4b')]({},_0x23ff61,_0x4e5026[_0xba39('0x4c')]);return db[_0xba39('0x63')][_0xba39('0x4e')](_0x23ff61);}})[_0xba39('0x32')](function(_0x1ff656){if(_0x1ff656){return db['User'][_0xba39('0x64')]({'where':{'id':_['map'](_0x1ff656,'UserId'),'role':_0xba39('0x65')},'attributes':['id','name',_0xba39('0x66'),'updatedAt',_0xba39('0x67')]});}})[_0xba39('0x32')](function(_0x4252c7){if(_0x4252c7){return{'count':_0x4252c7[_0xba39('0x2c')],'rows':_[_0xba39('0x3a')](_0x4252c7[_0xba39('0x4f')],function(_0x2d3568){return{'membername':_0x2d3568[_0xba39('0x38')],'UserId':_0x2d3568['id'],'queue_name':_0x38714b['name'],'ChatQueueId':_0x38714b['id'],'interface':util[_0xba39('0x68')](_0xba39('0x69'),_0xba39('0x6a'),_0x2d3568[_0xba39('0x38')]),'penalty':0x0,'paused':_0x2d3568[_0xba39('0x66')],'createdAt':_0x2d3568[_0xba39('0x67')],'updatedAt':_0x2d3568[_0xba39('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xba39('0x32')](respondWithFilteredResult(_0x581649,_0x23ff61))[_0xba39('0x27')](handleError(_0x581649,null));};exports['getTeams']=function(_0x5365a9,_0x573edd,_0x413137){var _0x504c3b={};var _0x2afc72={};var _0x3fa34b;var _0xe2d951;return db[_0xba39('0x3b')][_0xba39('0x5d')]({'where':{'id':_0x5365a9[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x573edd,null))[_0xba39('0x32')](function(_0x193884){if(_0x193884){_0x3fa34b=_0x193884;_0x2afc72[_0xba39('0x40')]=_[_0xba39('0x42')](db[_0xba39('0x6c')][_0xba39('0x3c')]);_0x2afc72[_0xba39('0x41')]=_[_0xba39('0x42')](_0x5365a9[_0xba39('0x41')]);_0x2afc72['filters']=_[_0xba39('0x44')](_0x2afc72[_0xba39('0x40')],_0x2afc72[_0xba39('0x41')]);_0x504c3b[_0xba39('0x45')]=_[_0xba39('0x44')](_0x2afc72[_0xba39('0x40')],qs['fields'](_0x5365a9['query'][_0xba39('0x46')]));_0x504c3b[_0xba39('0x45')]=_0x504c3b['attributes'][_0xba39('0x47')]?_0x504c3b[_0xba39('0x45')]:_0x2afc72['model'];_0x504c3b[_0xba39('0x60')]=qs[_0xba39('0x48')](_0x5365a9[_0xba39('0x41')]['sort']);_0x504c3b[_0xba39('0x49')]=qs['filters'](_[_0xba39('0x61')](_0x5365a9[_0xba39('0x41')],_0x2afc72[_0xba39('0x43')]));if(_0x5365a9[_0xba39('0x41')]['filter']){_0x504c3b['where']=_['merge'](_0x504c3b[_0xba39('0x49')],{'$or':_[_0xba39('0x3a')](_0x504c3b['attributes'],function(_0x4c77d4){var _0x5d4126={};_0x5d4126[_0x4c77d4]={'$like':'%'+_0x5365a9['query'][_0xba39('0x4a')]+'%'};return _0x5d4126;})});}_0x504c3b=_[_0xba39('0x4b')]({},_0x504c3b,_0x5365a9['options']);return _0x3fa34b['getTeams'](_0x504c3b);}})['then'](function(_0x74eb49){if(_0x74eb49){_0xe2d951=_0x74eb49[_0xba39('0x47')];if(!_0x5365a9['query'][_0xba39('0x5e')](_0xba39('0x5f'))){_0x504c3b[_0xba39('0x2b')]=qs['limit'](_0x5365a9[_0xba39('0x41')][_0xba39('0x2b')]);_0x504c3b[_0xba39('0x2d')]=qs['offset'](_0x5365a9[_0xba39('0x41')][_0xba39('0x2d')]);}return _0x3fa34b[_0xba39('0x6d')](_0x504c3b);}})['then'](function(_0x48b2f9){if(_0x48b2f9){return _0x48b2f9?{'count':_0xe2d951,'rows':_0x48b2f9}:null;}})[_0xba39('0x32')](respondWithResult(_0x573edd,null))[_0xba39('0x27')](handleError(_0x573edd,null));};exports[_0xba39('0x6e')]=function(_0x292ca4,_0x4a15e4,_0x5db4a4){var _0x22636d=_0x292ca4[_0xba39('0x53')][_0xba39('0x6f')];return db[_0xba39('0x6c')][_0xba39('0x4e')]({'where':{'id':_0x22636d},'attributes':['id'],'include':[{'model':db[_0xba39('0x70')],'as':_0xba39('0x71'),'attributes':['id',_0xba39('0x38'),'online',_0xba39('0x72'),_0xba39('0x73')],'raw':!![]}]})['then'](function(_0x2a3167){if(_0x2a3167){var _0x7b885c=_['flatMap'](_0x2a3167,function(_0x3f6eb0){var _0x5c4f01=_0x3f6eb0[_0xba39('0x34')]({'plain':!![]});return _0x5c4f01[_0xba39('0x71')];});return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x292ca4[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](function(_0x25a0f8){return db[_0xba39('0x74')]['transaction'](function(_0x2a360b){return _0x25a0f8[_0xba39('0x6e')](_0x22636d,{'transaction':_0x2a360b})[_0xba39('0x32')](function(){return BPromise[_0xba39('0x75')](_0x7b885c,function(_0xeef952){return db[_0xba39('0x63')]['findOrCreate']({'where':{'UserId':_0xeef952['id'],'ChatQueueId':_0x292ca4[_0xba39('0x5a')]['id']},'transaction':_0x2a360b});});})['then'](function(){_0x7b885c[_0xba39('0x76')](function(_0x201b19){socket[_0xba39('0x77')]('userChatQueue:save',{'UserId':_0x201b19['id'],'ChatQueueId':_0x25a0f8['id']});});});});});}})['then'](respondWithStatusCode(_0x4a15e4,null))[_0xba39('0x27')](handleError(_0x4a15e4,null));};exports[_0xba39('0x78')]=function(_0x35f238,_0x99e796,_0x4eee96){return db[_0xba39('0x6c')]['findAll']({'where':{'id':_0x35f238[_0xba39('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0xba39('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x99e796,null))[_0xba39('0x32')](function(_0x1e51ba){var _0x3e6e5c=_[_0xba39('0x3a')](_0x1e51ba,'id');var _0x1ef5ac=[];var _0x17637a=[];var _0x3b4418=squel[_0xba39('0x79')]();_0x3b4418[_0xba39('0x7a')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0xba39('0x7b')](_0xba39('0x7c'),'ut',_0xba39('0x7d'))[_0xba39('0x49')](_0xba39('0x7e'),_0x35f238['params']['id']);for(var _0x3eb45c=0x0;_0x3eb45c<_0x1e51ba[_0xba39('0x47')];_0x3eb45c+=0x1){let _0x251ed1=_0x1e51ba[_0x3eb45c];for(var _0x3a5cdb=0x0;_0x3a5cdb<_0x251ed1[_0xba39('0x71')][_0xba39('0x47')];_0x3a5cdb+=0x1){let _0x57d7fa=_0x251ed1['Agents'][_0x3a5cdb];var _0x49c1d9=_0x3b4418[_0xba39('0x7f')]();_0x49c1d9[_0xba39('0x49')](_0xba39('0x80'),_0x57d7fa['id']);_0x17637a[_0xba39('0x81')](db[_0xba39('0x74')][_0xba39('0x41')](_0x49c1d9[_0xba39('0x82')](),{'type':db['sequelize']['QueryTypes'][_0xba39('0x83')]})['then'](function(_0x35ac16){if(_0x35ac16[_0xba39('0x47')]===0x1){return _0x57d7fa['id'];}else{var _0x1379f2=_[_0xba39('0x84')](_[_0xba39('0x3a')](_0x35ac16,_0xba39('0x85')),function(_0x2d2cbb){return _[_0xba39('0x86')](_0x3e6e5c,_0x2d2cbb);});if(_0x1379f2){return _0x57d7fa['id'];}}}));}}return BPromise['all'](_0x17637a)[_0xba39('0x32')](function(_0x41aaa6){_0x1ef5ac=_(_0x1ef5ac)[_0xba39('0x87')](_0x41aaa6)[_0xba39('0x88')]()[_0xba39('0x89')]();return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x35f238[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](function(_0x41dee1){return db['sequelize'][_0xba39('0x8a')](function(_0x1fc0ea){return _0x41dee1[_0xba39('0x78')](_0x35f238[_0xba39('0x41')][_0xba39('0x6f')],{'transaction':_0x1fc0ea})[_0xba39('0x32')](function(){if(!_['isEmpty'](_0x1ef5ac)){return _0x41dee1[_0xba39('0x8b')](_0x1ef5ac,{'transaction':_0x1fc0ea});}})[_0xba39('0x32')](function(){_0x1ef5ac['forEach'](function(_0x1a8da4){socket[_0xba39('0x77')](_0xba39('0x8c'),{'UserId':_0x1a8da4,'ChatQueueId':_0x41dee1['id']});});});});});});})['then'](respondWithStatusCode(_0x99e796,null))['catch'](handleError(_0x99e796,null));};exports[_0xba39('0x8d')]=function(_0x83d921,_0x367b65,_0x426920){return db[_0xba39('0x3b')]['find']({'where':{'id':_0x83d921[_0xba39('0x5a')]['id']}})[_0xba39('0x32')](handleEntityNotFound(_0x367b65,null))[_0xba39('0x32')](function(_0x114c53){if(_0x114c53){return _0x114c53[_0xba39('0x8d')](_0x83d921['body'][_0xba39('0x6f')],_[_0xba39('0x8e')](_0x83d921[_0xba39('0x53')],[_0xba39('0x6f'),'id'])||{})[_0xba39('0x8f')](function(_0x14a356){for(var _0x29b49c=0x0;_0x29b49c<_0x83d921[_0xba39('0x53')][_0xba39('0x6f')][_0xba39('0x47')];_0x29b49c+=0x1){socket[_0xba39('0x77')](_0xba39('0x90'),{'UserId':Number(_0x83d921[_0xba39('0x53')]['ids'][_0x29b49c]),'ChatQueueId':Number(_0x83d921[_0xba39('0x5a')]['id'])});}return _0x14a356;});}})['then'](respondWithResult(_0x367b65,null))['catch'](handleError(_0x367b65,null));};exports[_0xba39('0x8b')]=function(_0x55fca0,_0x1eecf2,_0x36887f){return db[_0xba39('0x3b')][_0xba39('0x51')]({'where':{'id':_0x55fca0[_0xba39('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1eecf2,null))[_0xba39('0x32')](function(_0x273d04){if(_0x273d04){return _0x273d04[_0xba39('0x8b')](_0x55fca0[_0xba39('0x41')]['ids'])[_0xba39('0x32')](function(){if(_[_0xba39('0x91')](_0x55fca0[_0xba39('0x41')][_0xba39('0x6f')])){for(var _0x31ce75=0x0;_0x31ce75<_0x55fca0[_0xba39('0x41')]['ids'][_0xba39('0x47')];_0x31ce75+=0x1){socket[_0xba39('0x77')]('userChatQueue:remove',{'UserId':Number(_0x55fca0[_0xba39('0x41')][_0xba39('0x6f')][_0x31ce75]),'ChatQueueId':Number(_0x55fca0[_0xba39('0x5a')]['id'])});}}else{socket[_0xba39('0x77')](_0xba39('0x8c'),{'UserId':Number(_0x55fca0[_0xba39('0x41')][_0xba39('0x6f')]),'ChatQueueId':Number(_0x55fca0[_0xba39('0x5a')]['id'])});}});}})[_0xba39('0x32')](respondWithStatusCode(_0x1eecf2,null))[_0xba39('0x27')](handleError(_0x1eecf2,null));};exports[_0xba39('0x92')]=function(_0x25e317,_0xb70ff6,_0x158c2f){var _0x94cbe6={};var _0x2518f3={};var _0x2dce24;var _0x4cf931;return db[_0xba39('0x3b')][_0xba39('0x5d')]({'where':{'id':_0x25e317[_0xba39('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb70ff6,null))[_0xba39('0x32')](function(_0x35ec36){if(_0x35ec36){_0x2dce24=_0x35ec36;_0x2518f3['model']=_['keys'](db[_0xba39('0x70')][_0xba39('0x3c')]);_0x2518f3['query']=_[_0xba39('0x42')](_0x25e317['query']);_0x2518f3[_0xba39('0x43')]=_['intersection'](_0x2518f3['model'],_0x2518f3[_0xba39('0x41')]);_0x94cbe6[_0xba39('0x45')]=_[_0xba39('0x44')](_0x2518f3[_0xba39('0x40')],qs[_0xba39('0x46')](_0x25e317[_0xba39('0x41')]['fields']));_0x94cbe6['attributes']=_0x94cbe6[_0xba39('0x45')]['length']?_0x94cbe6[_0xba39('0x45')]:_0x2518f3[_0xba39('0x40')];_0x94cbe6[_0xba39('0x60')]=qs['sort'](_0x25e317[_0xba39('0x41')][_0xba39('0x48')]);_0x94cbe6['where']=qs[_0xba39('0x43')](_[_0xba39('0x61')](_0x25e317['query'],_0x2518f3['filters']));if(_0x25e317[_0xba39('0x41')]['filter']){_0x94cbe6[_0xba39('0x49')]=_['merge'](_0x94cbe6[_0xba39('0x49')],{'$or':_[_0xba39('0x3a')](_0x94cbe6[_0xba39('0x45')],function(_0x196bac){var _0x354994={};_0x354994[_0x196bac]={'$like':'%'+_0x25e317['query'][_0xba39('0x4a')]+'%'};return _0x354994;})});}_0x94cbe6=_[_0xba39('0x4b')]({},_0x94cbe6,_0x25e317[_0xba39('0x4c')]);return _0x2dce24[_0xba39('0x92')](_0x94cbe6);}})['then'](function(_0x50bba0){if(_0x50bba0){_0x4cf931=_0x50bba0['length'];if(!_0x25e317[_0xba39('0x41')][_0xba39('0x5e')](_0xba39('0x5f'))){_0x94cbe6[_0xba39('0x2b')]=qs[_0xba39('0x2b')](_0x25e317['query'][_0xba39('0x2b')]);_0x94cbe6[_0xba39('0x2d')]=qs['offset'](_0x25e317['query'][_0xba39('0x2d')]);}return _0x2dce24[_0xba39('0x92')](_0x94cbe6);}})['then'](function(_0xe43515){if(_0xe43515){return _0xe43515?{'count':_0x4cf931,'rows':_0xe43515}:null;}})[_0xba39('0x32')](respondWithResult(_0xb70ff6,null))[_0xba39('0x27')](handleError(_0xb70ff6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 816bc4a..e0de8c2 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 _0x673f=['hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x673f,0x64));var _0xf673=function(_0x1131f6,_0x4436b1){_0x1131f6=_0x1131f6-0x0;var _0x44a965=_0x673f[_0x1131f6];return _0x44a965;};'use strict';var EventEmitter=require(_0xf673('0x0'));var ChatQueue=require(_0xf673('0x1'))['db'][_0xf673('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf673('0x3')](0x0);var events={'afterCreate':_0xf673('0x4'),'afterUpdate':'update','afterDestroy':_0xf673('0x5')};function emitEvent(_0x136928){return function(_0x971d88,_0x1df3cc,_0xec2576){ChatQueueEvents[_0xf673('0x6')](_0x136928+':'+_0x971d88['id'],_0x971d88);ChatQueueEvents[_0xf673('0x6')](_0x136928,_0x971d88);_0xec2576(null);};}for(var e in events){if(events[_0xf673('0x7')](e)){var event=events[e];ChatQueue[_0xf673('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x7764=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7764,0xa4));var _0x4776=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x7764[_0x3f3f06];return _0x140feb;};'use strict';var EventEmitter=require(_0x4776('0x0'));var ChatQueue=require(_0x4776('0x1'))['db'][_0x4776('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4776('0x3')](0x0);var events={'afterCreate':_0x4776('0x4'),'afterUpdate':_0x4776('0x5'),'afterDestroy':_0x4776('0x6')};function emitEvent(_0x424a79){return function(_0x3b28ba,_0x1f5638,_0x5ab4c2){ChatQueueEvents['emit'](_0x424a79+':'+_0x3b28ba['id'],_0x3b28ba);ChatQueueEvents[_0x4776('0x7')](_0x424a79,_0x3b28ba);_0x5ab4c2(null);};}for(var e in events){if(events[_0x4776('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4776('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ebd231e..e6642eb 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 _0x2ad6=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','api','moment','bluebird','request-promise'];(function(_0x54577d,_0x4ec759){var _0x43da03=function(_0x12a99c){while(--_0x12a99c){_0x54577d['push'](_0x54577d['shift']());}};_0x43da03(++_0x4ec759);}(_0x2ad6,0x19f));var _0x62ad=function(_0x130ea6,_0x287e7d){_0x130ea6=_0x130ea6-0x0;var _0x2a95a8=_0x2ad6[_0x130ea6];return _0x2a95a8;};'use strict';var _=require(_0x62ad('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x62ad('0x1'));var moment=require(_0x62ad('0x2'));var BPromise=require(_0x62ad('0x3'));var rp=require(_0x62ad('0x4'));var fs=require('fs');var path=require(_0x62ad('0x5'));var rimraf=require(_0x62ad('0x6'));var config=require(_0x62ad('0x7'));var attributes=require(_0x62ad('0x8'));module[_0x62ad('0x9')]=function(_0x153148,_0x55683a){return _0x153148[_0x62ad('0xa')](_0x62ad('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e0d=['define','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x564093,_0x4dbd09){var _0x26b2fe=function(_0xc665bd){while(--_0xc665bd){_0x564093['push'](_0x564093['shift']());}};_0x26b2fe(++_0x4dbd09);}(_0x7e0d,0x16e));var _0xd7e0=function(_0x51c635,_0x375829){_0x51c635=_0x51c635-0x0;var _0x2a1710=_0x7e0d[_0x51c635];return _0x2a1710;};'use strict';var _=require(_0xd7e0('0x0'));var util=require(_0xd7e0('0x1'));var logger=require(_0xd7e0('0x2'))(_0xd7e0('0x3'));var moment=require(_0xd7e0('0x4'));var BPromise=require(_0xd7e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7e0('0x6'));var rimraf=require(_0xd7e0('0x7'));var config=require(_0xd7e0('0x8'));var attributes=require(_0xd7e0('0x9'));module[_0xd7e0('0xa')]=function(_0x276465,_0x5ddb11){return _0x276465[_0xd7e0('0xb')]('ChatQueue',attributes,{'tableName':_0xd7e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index e0be91f..80e972c 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 _0x20d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowChatQueue','catch'];(function(_0x319c7a,_0x4ba7f1){var _0x330284=function(_0x50f3d3){while(--_0x50f3d3){_0x319c7a['push'](_0x319c7a['shift']());}};_0x330284(++_0x4ba7f1);}(_0x20d6,0x1b8));var _0x620d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x20d6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var moment=require(_0x620d('0x2'));var BPromise=require(_0x620d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x620d('0x4'));var db=require(_0x620d('0x5'))['db'];var utils=require(_0x620d('0x6'));var logger=require(_0x620d('0x7'))(_0x620d('0x8'));var config=require(_0x620d('0x9'));var jayson=require(_0x620d('0xa'));var client=jayson[_0x620d('0xb')][_0x620d('0xc')]({'port':0x232a});config[_0x620d('0xd')]=_[_0x620d('0xe')](config['redis'],{'host':_0x620d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x620d('0x10'))[_0x620d('0x11')](socket);function respondWithRpcPromise(_0x3afc77,_0x4325de,_0x1fd32f){return new BPromise(function(_0x420803,_0x4812fd){return client[_0x620d('0x12')](_0x3afc77,_0x1fd32f)[_0x620d('0x13')](function(_0x498358){logger[_0x620d('0x14')](_0x620d('0x15'),_0x4325de,_0x620d('0x16'));logger[_0x620d('0x17')](_0x620d('0x18'),_0x4325de,_0x620d('0x16'),JSON[_0x620d('0x19')](_0x498358));if(_0x498358[_0x620d('0x1a')]){if(_0x498358['error'][_0x620d('0x1b')]===0x1f4){logger[_0x620d('0x1a')](_0x620d('0x15'),_0x4325de,_0x498358[_0x620d('0x1a')][_0x620d('0x1c')]);return _0x4812fd(_0x498358['error']['message']);}logger['error'](_0x620d('0x15'),_0x4325de,_0x498358['error'][_0x620d('0x1c')]);return _0x420803(_0x498358[_0x620d('0x1a')][_0x620d('0x1c')]);}else{logger[_0x620d('0x14')](_0x620d('0x15'),_0x4325de,_0x620d('0x16'));_0x420803(_0x498358[_0x620d('0x1d')]['message']);}})['catch'](function(_0x4538f3){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4325de,_0x4538f3);_0x4812fd(_0x4538f3);});});}exports[_0x620d('0x1e')]=function(_0x5bc792){var _0x437970=this;return new Promise(function(_0x502b02,_0x18347d){return db[_0x620d('0x1f')][_0x620d('0x20')]({'raw':_0x5bc792['options']?_0x5bc792[_0x620d('0x21')][_0x620d('0x22')]===undefined?!![]:![]:!![],'where':_0x5bc792[_0x620d('0x21')]?_0x5bc792[_0x620d('0x21')][_0x620d('0x23')]||null:null,'attributes':_0x5bc792['options']?_0x5bc792[_0x620d('0x21')]['attributes']||null:null,'limit':_0x5bc792[_0x620d('0x21')]?_0x5bc792[_0x620d('0x21')][_0x620d('0x24')]||null:null,'include':_0x5bc792[_0x620d('0x21')]?_0x5bc792[_0x620d('0x21')][_0x620d('0x25')]?_[_0x620d('0x26')](_0x5bc792[_0x620d('0x21')][_0x620d('0x25')],function(_0xd70df4){return{'model':db[_0xd70df4[_0x620d('0x27')]],'as':_0xd70df4['as'],'attributes':_0xd70df4[_0x620d('0x28')],'include':_0xd70df4[_0x620d('0x25')]?_[_0x620d('0x26')](_0xd70df4[_0x620d('0x25')],function(_0x2d5208){return{'model':db[_0x2d5208['model']],'as':_0x2d5208['as'],'attributes':_0x2d5208['attributes'],'include':_0x2d5208[_0x620d('0x25')]?_['map'](_0x2d5208[_0x620d('0x25')],function(_0x341904){return{'model':db[_0x341904[_0x620d('0x27')]],'as':_0x341904['as'],'attributes':_0x341904[_0x620d('0x28')]};}):[]};}):[]};}):[]:[]})[_0x620d('0x13')](function(_0x188f3e){logger[_0x620d('0x14')](_0x620d('0x1e'),_0x5bc792);logger[_0x620d('0x17')](_0x620d('0x1e'),_0x5bc792,JSON[_0x620d('0x19')](_0x188f3e));_0x502b02(_0x188f3e);})['catch'](function(_0x2ce266){logger[_0x620d('0x1a')](_0x620d('0x1e'),_0x2ce266[_0x620d('0x1c')],_0x5bc792);_0x18347d(_0x437970[_0x620d('0x1a')](0x1f4,_0x2ce266[_0x620d('0x1c')]));});});};exports['ShowChatQueue']=function(_0x2ece12){var _0x3a12ae=this;return new Promise(function(_0x540b74,_0x1be285){return db['ChatQueue'][_0x620d('0x29')]({'raw':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')][_0x620d('0x22')]===undefined?!![]:![]:!![],'where':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')][_0x620d('0x23')]||null:null,'attributes':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')]['attributes']||null:null,'include':_0x2ece12[_0x620d('0x21')]?_0x2ece12[_0x620d('0x21')][_0x620d('0x25')]?_[_0x620d('0x26')](_0x2ece12[_0x620d('0x21')]['include'],function(_0x553952){return{'model':db[_0x553952[_0x620d('0x27')]],'as':_0x553952['as'],'attributes':_0x553952[_0x620d('0x28')],'include':_0x553952[_0x620d('0x25')]?_[_0x620d('0x26')](_0x553952[_0x620d('0x25')],function(_0x41cc33){return{'model':db[_0x41cc33[_0x620d('0x27')]],'as':_0x41cc33['as'],'attributes':_0x41cc33[_0x620d('0x28')],'include':_0x41cc33['include']?_[_0x620d('0x26')](_0x41cc33[_0x620d('0x25')],function(_0x308b6d){return{'model':db[_0x308b6d[_0x620d('0x27')]],'as':_0x308b6d['as'],'attributes':_0x308b6d[_0x620d('0x28')]};}):[]};}):[]};}):[]:[]})[_0x620d('0x13')](function(_0x4b50f4){logger[_0x620d('0x14')](_0x620d('0x2a'),_0x2ece12);logger[_0x620d('0x17')](_0x620d('0x2a'),_0x2ece12,JSON[_0x620d('0x19')](_0x4b50f4));_0x540b74(_0x4b50f4);})[_0x620d('0x2b')](function(_0x5d8c2b){logger[_0x620d('0x1a')]('ShowChatQueue',_0x5d8c2b[_0x620d('0x1c')],_0x2ece12);_0x1be285(_0x3a12ae[_0x620d('0x1a')](0x1f4,_0x5d8c2b[_0x620d('0x1c')]));});});};
\ No newline at end of file
+var _0x0419=['socket.io-emitter','./chatQueue.socket','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','raw','limit','include','model','attributes','map','then','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x11efe8,_0xe6ad7e){var _0x5954b8=function(_0x48bc36){while(--_0x48bc36){_0x11efe8['push'](_0x11efe8['shift']());}};_0x5954b8(++_0xe6ad7e);}(_0x0419,0x153));var _0x9041=function(_0x5c8e81,_0x53351e){_0x5c8e81=_0x5c8e81-0x0;var _0x31e3a8=_0x0419[_0x5c8e81];return _0x31e3a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9041('0x0'));var BPromise=require(_0x9041('0x1'));var rs=require(_0x9041('0x2'));var fs=require('fs');var Redis=require(_0x9041('0x3'));var db=require(_0x9041('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9041('0x5'));var config=require(_0x9041('0x6'));var jayson=require(_0x9041('0x7'));var client=jayson[_0x9041('0x8')]['http']({'port':0x232a});config[_0x9041('0x9')]=_[_0x9041('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9041('0xb'))(new Redis(config[_0x9041('0x9')]));require(_0x9041('0xc'))['register'](socket);function respondWithRpcPromise(_0x33b812,_0x4d0aaf,_0x22487){return new BPromise(function(_0x2964e9,_0x992570){return client['request'](_0x33b812,_0x22487)['then'](function(_0x473271){logger[_0x9041('0xd')]('ChatQueue,\x20%s,\x20%s',_0x4d0aaf,'request\x20sent');logger[_0x9041('0xe')](_0x9041('0xf'),_0x4d0aaf,_0x9041('0x10'),JSON[_0x9041('0x11')](_0x473271));if(_0x473271[_0x9041('0x12')]){if(_0x473271[_0x9041('0x12')][_0x9041('0x13')]===0x1f4){logger[_0x9041('0x12')](_0x9041('0x14'),_0x4d0aaf,_0x473271[_0x9041('0x12')][_0x9041('0x15')]);return _0x992570(_0x473271['error']['message']);}logger['error'](_0x9041('0x14'),_0x4d0aaf,_0x473271[_0x9041('0x12')][_0x9041('0x15')]);return _0x2964e9(_0x473271['error'][_0x9041('0x15')]);}else{logger[_0x9041('0xd')](_0x9041('0x14'),_0x4d0aaf,'request\x20sent');_0x2964e9(_0x473271[_0x9041('0x16')][_0x9041('0x15')]);}})[_0x9041('0x17')](function(_0x36a5c2){logger[_0x9041('0x12')](_0x9041('0x14'),_0x4d0aaf,_0x36a5c2);_0x992570(_0x36a5c2);});});}exports[_0x9041('0x18')]=function(_0x2f52e0){var _0x5cff96=this;return new Promise(function(_0x3d527b,_0xa8ee07){return db[_0x9041('0x19')]['findAll']({'raw':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f52e0['options']?_0x2f52e0[_0x9041('0x1a')]['where']||null:null,'attributes':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')]['attributes']||null:null,'limit':_0x2f52e0['options']?_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1c')]||null:null,'include':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')]['include']?_['map'](_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1d')],function(_0x11401a){return{'model':db[_0x11401a[_0x9041('0x1e')]],'as':_0x11401a['as'],'attributes':_0x11401a[_0x9041('0x1f')],'include':_0x11401a['include']?_[_0x9041('0x20')](_0x11401a[_0x9041('0x1d')],function(_0x57a1db){return{'model':db[_0x57a1db[_0x9041('0x1e')]],'as':_0x57a1db['as'],'attributes':_0x57a1db[_0x9041('0x1f')],'include':_0x57a1db[_0x9041('0x1d')]?_[_0x9041('0x20')](_0x57a1db[_0x9041('0x1d')],function(_0x462620){return{'model':db[_0x462620[_0x9041('0x1e')]],'as':_0x462620['as'],'attributes':_0x462620[_0x9041('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9041('0x21')](function(_0xd3861e){logger[_0x9041('0xd')](_0x9041('0x18'),_0x2f52e0);logger[_0x9041('0xe')](_0x9041('0x18'),_0x2f52e0,JSON[_0x9041('0x11')](_0xd3861e));_0x3d527b(_0xd3861e);})[_0x9041('0x17')](function(_0x4fee5f){logger[_0x9041('0x12')](_0x9041('0x18'),_0x4fee5f[_0x9041('0x15')],_0x2f52e0);_0xa8ee07(_0x5cff96['error'](0x1f4,_0x4fee5f[_0x9041('0x15')]));});});};exports[_0x9041('0x22')]=function(_0x21c3d5){var _0x3c31e8=this;return new Promise(function(_0x2ea40a,_0x3370b0){return db['ChatQueue']['find']({'raw':_0x21c3d5['options']?_0x21c3d5['options'][_0x9041('0x1b')]===undefined?!![]:![]:!![],'where':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5['options']['where']||null:null,'attributes':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5[_0x9041('0x1a')][_0x9041('0x1f')]||null:null,'include':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5[_0x9041('0x1a')][_0x9041('0x1d')]?_['map'](_0x21c3d5['options']['include'],function(_0x152b15){return{'model':db[_0x152b15['model']],'as':_0x152b15['as'],'attributes':_0x152b15['attributes'],'include':_0x152b15[_0x9041('0x1d')]?_[_0x9041('0x20')](_0x152b15[_0x9041('0x1d')],function(_0xc22135){return{'model':db[_0xc22135[_0x9041('0x1e')]],'as':_0xc22135['as'],'attributes':_0xc22135[_0x9041('0x1f')],'include':_0xc22135[_0x9041('0x1d')]?_['map'](_0xc22135[_0x9041('0x1d')],function(_0x23b91e){return{'model':db[_0x23b91e[_0x9041('0x1e')]],'as':_0x23b91e['as'],'attributes':_0x23b91e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9041('0x21')](function(_0xe21f3){logger[_0x9041('0xd')]('ShowChatQueue',_0x21c3d5);logger[_0x9041('0xe')](_0x9041('0x22'),_0x21c3d5,JSON[_0x9041('0x11')](_0xe21f3));_0x2ea40a(_0xe21f3);})['catch'](function(_0x3745c0){logger[_0x9041('0x12')](_0x9041('0x22'),_0x3745c0[_0x9041('0x15')],_0x21c3d5);_0x3370b0(_0x3c31e8[_0x9041('0x12')](0x1f4,_0x3745c0[_0x9041('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 024930b..cda8aee 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 _0x4d9e=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x5a6646,_0x559c84){var _0xf4c087=function(_0x269e01){while(--_0x269e01){_0x5a6646['push'](_0x5a6646['shift']());}};_0xf4c087(++_0x559c84);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x369eae,_0x1628bc){_0x369eae=_0x369eae-0x0;var _0x11f827=_0x4d9e[_0x369eae];return _0x11f827;};'use strict';var ChatQueueEvents=require(_0xe4d9('0x0'));var events=['save','remove',_0xe4d9('0x1')];function createListener(_0x574c1d,_0x36adac){return function(_0x4d7687){_0x36adac[_0xe4d9('0x2')](_0x574c1d,_0x4d7687);};}function removeListener(_0x2deaef,_0x47a09f){return function(){ChatQueueEvents[_0xe4d9('0x3')](_0x2deaef,_0x47a09f);};}exports[_0xe4d9('0x4')]=function(_0x278035){for(var _0x34c2a2=0x0,_0x125dbc=events[_0xe4d9('0x5')];_0x34c2a2<_0x125dbc;_0x34c2a2++){var _0x54a63a=events[_0x34c2a2];var _0x36316f=createListener(_0xe4d9('0x6')+_0x54a63a,_0x278035);ChatQueueEvents['on'](_0x54a63a,_0x36316f);}};
\ No newline at end of file
+var _0x5636=['save','emit','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x10e2f2,_0x5492b2){var _0x1164b8=function(_0x1d422f){while(--_0x1d422f){_0x10e2f2['push'](_0x10e2f2['shift']());}};_0x1164b8(++_0x5492b2);}(_0x5636,0x102));var _0x6563=function(_0x5799a9,_0x39521b){_0x5799a9=_0x5799a9-0x0;var _0x37f3a4=_0x5636[_0x5799a9];return _0x37f3a4;};'use strict';var ChatQueueEvents=require(_0x6563('0x0'));var events=[_0x6563('0x1'),'remove','update'];function createListener(_0x579d5c,_0x44872c){return function(_0x3a95f7){_0x44872c[_0x6563('0x2')](_0x579d5c,_0x3a95f7);};}function removeListener(_0x4ac653,_0x166a58){return function(){ChatQueueEvents[_0x6563('0x3')](_0x4ac653,_0x166a58);};}exports[_0x6563('0x4')]=function(_0x39792f){for(var _0x29f687=0x0,_0x193942=events[_0x6563('0x5')];_0x29f687<_0x193942;_0x29f687++){var _0x2d57d5=events[_0x29f687];var _0x2d0d5b=createListener(_0x6563('0x6')+_0x2d57d5,_0x39792f);ChatQueueEvents['on'](_0x2d57d5,_0x2d0d5b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 24d7120..a85ccde 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x6bd897,_0x325332){var _0x5ee8fe=function(_0x5ba4f8){while(--_0x5ba4f8){_0x6bd897['push'](_0x6bd897['shift']());}};_0x5ee8fe(++_0x325332);}(_0xe14b,0x93));var _0xbe14=function(_0xa82736,_0x5edfd0){_0xa82736=_0xa82736-0x0;var _0x17f073=_0xe14b[_0xa82736];return _0x17f073;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x4fee66,_0x21e44d){var _0x341533=function(_0x213c15){while(--_0x213c15){_0x4fee66['push'](_0x4fee66['shift']());}};_0x341533(++_0x21e44d);}(_0x55ca,0x126));var _0xa55c=function(_0x5bf609,_0x5c1e35){_0x5bf609=_0x5bf609-0x0;var _0x3c3a74=_0x55ca[_0x5bf609];return _0x3c3a74;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index f6cfd73..7e38107 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 _0xf0c7=['sequelize','exports','STRING','DATE','moment'];(function(_0x2103e9,_0x5c985c){var _0x107d4c=function(_0x136f6c){while(--_0x136f6c){_0x2103e9['push'](_0x2103e9['shift']());}};_0x107d4c(++_0x5c985c);}(_0xf0c7,0x1c1));var _0x7f0c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf0c7[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0x7f0c('0x0'));var Sequelize=require(_0x7f0c('0x1'));module[_0x7f0c('0x2')]={'uniqueid':{'type':Sequelize[_0x7f0c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7f0c('0x4')]},'leaveAt':{'type':Sequelize[_0x7f0c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7f0c('0x4')]},'reason':{'type':Sequelize[_0x7f0c('0x3')]}};
\ No newline at end of file
+var _0x9f06=['sequelize','exports','STRING','DATE','moment'];(function(_0x3262bc,_0x18b462){var _0x138f45=function(_0x325b12){while(--_0x325b12){_0x3262bc['push'](_0x3262bc['shift']());}};_0x138f45(++_0x18b462);}(_0x9f06,0xfe));var _0x69f0=function(_0x2ff3db,_0x13ee40){_0x2ff3db=_0x2ff3db-0x0;var _0x4d0e9e=_0x9f06[_0x2ff3db];return _0x4d0e9e;};'use strict';var moment=require(_0x69f0('0x0'));var Sequelize=require(_0x69f0('0x1'));module[_0x69f0('0x2')]={'uniqueid':{'type':Sequelize[_0x69f0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x69f0('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x69f0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x69f0('0x4')]},'reason':{'type':Sequelize[_0x69f0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 1a28b44..a5a345b 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 _0xef17=['key','map','intersection','model','attributes','fields','length','query','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','offset','json','apply','reject','save','then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName'];(function(_0x4bbeeb,_0xf4af9f){var _0x125503=function(_0x3e2e52){while(--_0x3e2e52){_0x4bbeeb['push'](_0x4bbeeb['shift']());}};_0x125503(++_0xf4af9f);}(_0xef17,0x136));var _0x7ef1=function(_0x288748,_0x5dfdf5){_0x288748=_0x288748-0x0;var _0x5795a3=_0xef17[_0x288748];return _0x5795a3;};'use strict';var emlformat=require(_0x7ef1('0x0'));var rimraf=require(_0x7ef1('0x1'));var zipdir=require(_0x7ef1('0x2'));var jsonpatch=require(_0x7ef1('0x3'));var rp=require(_0x7ef1('0x4'));var moment=require(_0x7ef1('0x5'));var BPromise=require(_0x7ef1('0x6'));var Mustache=require(_0x7ef1('0x7'));var util=require(_0x7ef1('0x8'));var path=require('path');var sox=require(_0x7ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x7ef1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ef1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ef1('0xc'));var deskjs=require(_0x7ef1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7ef1('0xe'));var Papa=require(_0x7ef1('0xf'));var Redis=require(_0x7ef1('0x10'));var authService=require(_0x7ef1('0x11'));var qs=require(_0x7ef1('0x12'));var as=require(_0x7ef1('0x13'));var hardwareService=require(_0x7ef1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7ef1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122c8a,_0x51e226){_0x51e226=_0x51e226||0xcc;return function(_0x36ddf9){if(_0x36ddf9){return _0x122c8a[_0x7ef1('0x16')](_0x51e226);}return _0x122c8a[_0x7ef1('0x17')](_0x51e226)[_0x7ef1('0x18')]();};}function respondWithResult(_0x39ea9c,_0x317125){_0x317125=_0x317125||0xc8;return function(_0x26e9fb){if(_0x26e9fb){return _0x39ea9c[_0x7ef1('0x17')](_0x317125)['json'](_0x26e9fb);}};}function respondWithFilteredResult(_0x4de80f,_0x267f0e){return function(_0x5d0499){if(_0x5d0499){var _0x20b843=typeof _0x267f0e[_0x7ef1('0x19')]==='undefined'&&typeof _0x267f0e['limit']==='undefined';var _0x300645=_0x5d0499['count'];var _0x3a5835=_0x20b843?0x0:_0x267f0e['offset'];var _0x5a7b2b=_0x20b843?_0x5d0499['count']:_0x267f0e[_0x7ef1('0x19')]+_0x267f0e['limit'];var _0x38c5a7;if(_0x5a7b2b>=_0x300645){_0x5a7b2b=_0x300645;_0x38c5a7=0xc8;}else{_0x38c5a7=0xce;}_0x4de80f[_0x7ef1('0x17')](_0x38c5a7);return _0x4de80f['set']('Content-Range',_0x3a5835+'-'+_0x5a7b2b+'/'+_0x300645)[_0x7ef1('0x1a')](_0x5d0499);}return null;};}function patchUpdates(_0x5490b9){return function(_0x458459){try{jsonpatch[_0x7ef1('0x1b')](_0x458459,_0x5490b9,!![]);}catch(_0x2f8164){return BPromise[_0x7ef1('0x1c')](_0x2f8164);}return _0x458459[_0x7ef1('0x1d')]();};}function saveUpdates(_0xf24942,_0x20887b){return function(_0xd71594){if(_0xd71594){return _0xd71594['update'](_0xf24942)[_0x7ef1('0x1e')](function(_0x3b118f){return _0x3b118f;});}return null;};}function removeEntity(_0x3f26fb,_0x3324d4){return function(_0x31b5bf){if(_0x31b5bf){return _0x31b5bf[_0x7ef1('0x1f')]()[_0x7ef1('0x1e')](function(){_0x3f26fb[_0x7ef1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1ace,_0x33e008){return function(_0x12ef5a){if(!_0x12ef5a){_0x4b1ace[_0x7ef1('0x16')](0x194);}return _0x12ef5a;};}function handleError(_0xcfce5e,_0x19c2c2){_0x19c2c2=_0x19c2c2||0x1f4;return function(_0x4cfa16){logger[_0x7ef1('0x20')](_0x4cfa16[_0x7ef1('0x21')]);if(_0x4cfa16[_0x7ef1('0x22')]){delete _0x4cfa16[_0x7ef1('0x22')];}_0xcfce5e[_0x7ef1('0x17')](_0x19c2c2)[_0x7ef1('0x23')](_0x4cfa16);};}exports[_0x7ef1('0x24')]=function(_0x58e7ee,_0x2e8f1b){var _0x4b0380={},_0x3306b0={},_0x2546bf={'count':0x0,'rows':[]};var _0x4b5fde=_['map'](db[_0x7ef1('0x25')][_0x7ef1('0x26')],function(_0x5ab3a5){return{'name':_0x5ab3a5[_0x7ef1('0x27')],'type':_0x5ab3a5['type'][_0x7ef1('0x28')]};});_0x3306b0['model']=_[_0x7ef1('0x29')](_0x4b5fde,_0x7ef1('0x22'));_0x3306b0['query']=_['keys'](_0x58e7ee['query']);_0x3306b0['filters']=_[_0x7ef1('0x2a')](_0x3306b0[_0x7ef1('0x2b')],_0x3306b0['query']);_0x4b0380[_0x7ef1('0x2c')]=_['intersection'](_0x3306b0['model'],qs[_0x7ef1('0x2d')](_0x58e7ee['query'][_0x7ef1('0x2d')]));_0x4b0380[_0x7ef1('0x2c')]=_0x4b0380[_0x7ef1('0x2c')][_0x7ef1('0x2e')]?_0x4b0380['attributes']:_0x3306b0[_0x7ef1('0x2b')];if(!_0x58e7ee[_0x7ef1('0x2f')]['hasOwnProperty']('nolimit')){_0x4b0380['limit']=qs['limit'](_0x58e7ee[_0x7ef1('0x2f')]['limit']);_0x4b0380[_0x7ef1('0x19')]=qs[_0x7ef1('0x19')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x19')]);}_0x4b0380[_0x7ef1('0x30')]=qs[_0x7ef1('0x31')](_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x31')]);_0x4b0380[_0x7ef1('0x32')]=qs[_0x7ef1('0x33')](_[_0x7ef1('0x34')](_0x58e7ee['query'],_0x3306b0[_0x7ef1('0x33')]),_0x4b5fde);if(_0x58e7ee[_0x7ef1('0x2f')]['filter']){_0x4b0380[_0x7ef1('0x32')]=_[_0x7ef1('0x35')](_0x4b0380[_0x7ef1('0x32')],{'$or':_[_0x7ef1('0x29')](_0x4b5fde,function(_0x8ef5b3){if(_0x8ef5b3['type']!==_0x7ef1('0x36')){var _0x1ccbfb={};_0x1ccbfb[_0x8ef5b3[_0x7ef1('0x22')]]={'$like':'%'+_0x58e7ee[_0x7ef1('0x2f')][_0x7ef1('0x37')]+'%'};return _0x1ccbfb;}})});}_0x4b0380=_[_0x7ef1('0x35')]({},_0x4b0380,_0x58e7ee[_0x7ef1('0x38')]);var _0x238aa7={'where':_0x4b0380[_0x7ef1('0x32')]};return db[_0x7ef1('0x25')][_0x7ef1('0x39')](_0x238aa7)[_0x7ef1('0x1e')](function(_0x2da912){_0x2546bf[_0x7ef1('0x39')]=_0x2da912;if(_0x58e7ee[_0x7ef1('0x2f')]['includeAll']){_0x4b0380[_0x7ef1('0x3a')]=[{'all':!![]}];}return db[_0x7ef1('0x25')][_0x7ef1('0x3b')](_0x4b0380);})[_0x7ef1('0x1e')](function(_0x3889d7){_0x2546bf[_0x7ef1('0x3c')]=_0x3889d7;return _0x2546bf;})[_0x7ef1('0x1e')](respondWithFilteredResult(_0x2e8f1b,_0x4b0380))[_0x7ef1('0x3d')](handleError(_0x2e8f1b,null));};exports[_0x7ef1('0x3e')]=function(_0x1cff0b,_0x3e5ecd){var _0x374bf5={'raw':!![],'where':{'id':_0x1cff0b['params']['id']}},_0x2fb6c4={};_0x2fb6c4[_0x7ef1('0x2b')]=_[_0x7ef1('0x3f')](db[_0x7ef1('0x25')][_0x7ef1('0x26')]);_0x2fb6c4[_0x7ef1('0x2f')]=_[_0x7ef1('0x3f')](_0x1cff0b['query']);_0x2fb6c4[_0x7ef1('0x33')]=_[_0x7ef1('0x2a')](_0x2fb6c4[_0x7ef1('0x2b')],_0x2fb6c4[_0x7ef1('0x2f')]);_0x374bf5[_0x7ef1('0x2c')]=_[_0x7ef1('0x2a')](_0x2fb6c4['model'],qs[_0x7ef1('0x2d')](_0x1cff0b[_0x7ef1('0x2f')][_0x7ef1('0x2d')]));_0x374bf5[_0x7ef1('0x2c')]=_0x374bf5['attributes'][_0x7ef1('0x2e')]?_0x374bf5['attributes']:_0x2fb6c4['model'];if(_0x1cff0b[_0x7ef1('0x2f')]['includeAll']){_0x374bf5[_0x7ef1('0x3a')]=[{'all':!![]}];}_0x374bf5=_['merge']({},_0x374bf5,_0x1cff0b[_0x7ef1('0x38')]);return db[_0x7ef1('0x25')][_0x7ef1('0x40')](_0x374bf5)[_0x7ef1('0x1e')](handleEntityNotFound(_0x3e5ecd,null))[_0x7ef1('0x1e')](respondWithResult(_0x3e5ecd,null))[_0x7ef1('0x3d')](handleError(_0x3e5ecd,null));};exports[_0x7ef1('0x41')]=function(_0x106096,_0x49e089){return db['ChatQueueReport'][_0x7ef1('0x41')](_0x106096[_0x7ef1('0x42')],{})['then'](respondWithResult(_0x49e089,0xc9))[_0x7ef1('0x3d')](handleError(_0x49e089,null));};exports[_0x7ef1('0x43')]=function(_0xd06ca9,_0x5ce876){if(_0xd06ca9['body']['id']){delete _0xd06ca9[_0x7ef1('0x42')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0xd06ca9[_0x7ef1('0x44')]['id']}})[_0x7ef1('0x1e')](handleEntityNotFound(_0x5ce876,null))[_0x7ef1('0x1e')](saveUpdates(_0xd06ca9[_0x7ef1('0x42')],null))[_0x7ef1('0x1e')](respondWithResult(_0x5ce876,null))['catch'](handleError(_0x5ce876,null));};exports[_0x7ef1('0x1f')]=function(_0x4e425b,_0x350dde){return db['ChatQueueReport'][_0x7ef1('0x40')]({'where':{'id':_0x4e425b['params']['id']}})['then'](handleEntityNotFound(_0x350dde,null))[_0x7ef1('0x1e')](removeEntity(_0x350dde,null))['catch'](handleError(_0x350dde,null));};exports[_0x7ef1('0x45')]=function(_0x30a4ce,_0x54a0bb){return db[_0x7ef1('0x25')][_0x7ef1('0x45')]()[_0x7ef1('0x1e')](respondWithResult(_0x54a0bb,null))['catch'](handleError(_0x54a0bb,null));};
\ No newline at end of file
+var _0x7046=['map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ChatQueueReport','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send'];(function(_0x152c0c,_0x13059e){var _0x27cbcb=function(_0x5a63c2){while(--_0x5a63c2){_0x152c0c['push'](_0x152c0c['shift']());}};_0x27cbcb(++_0x13059e);}(_0x7046,0x144));var _0x6704=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7046[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x6704('0x0'));var rimraf=require(_0x6704('0x1'));var zipdir=require(_0x6704('0x2'));var jsonpatch=require(_0x6704('0x3'));var rp=require('request-promise');var moment=require(_0x6704('0x4'));var BPromise=require(_0x6704('0x5'));var Mustache=require(_0x6704('0x6'));var util=require('util');var path=require(_0x6704('0x7'));var sox=require(_0x6704('0x8'));var csv=require(_0x6704('0x9'));var ejs=require(_0x6704('0xa'));var fs=require('fs');var fs_extra=require(_0x6704('0xb'));var _=require('lodash');var squel=require(_0x6704('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6704('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6704('0xe'));var Redis=require(_0x6704('0xf'));var authService=require(_0x6704('0x10'));var qs=require(_0x6704('0x11'));var as=require(_0x6704('0x12'));var hardwareService=require(_0x6704('0x13'));var logger=require(_0x6704('0x14'))(_0x6704('0x15'));var utils=require('../../config/utils');var config=require(_0x6704('0x16'));var licenseUtil=require(_0x6704('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2feb52,_0x1db0ad){_0x1db0ad=_0x1db0ad||0xcc;return function(_0x327e03){if(_0x327e03){return _0x2feb52[_0x6704('0x18')](_0x1db0ad);}return _0x2feb52[_0x6704('0x19')](_0x1db0ad)[_0x6704('0x1a')]();};}function respondWithResult(_0x17b9bc,_0x2da4df){_0x2da4df=_0x2da4df||0xc8;return function(_0x24ece3){if(_0x24ece3){return _0x17b9bc['status'](_0x2da4df)[_0x6704('0x1b')](_0x24ece3);}};}function respondWithFilteredResult(_0x1752bc,_0x35082b){return function(_0x4fef80){if(_0x4fef80){var _0x11782a=typeof _0x35082b[_0x6704('0x1c')]===_0x6704('0x1d')&&typeof _0x35082b[_0x6704('0x1e')]===_0x6704('0x1d');var _0x5adb35=_0x4fef80[_0x6704('0x1f')];var _0x31d732=_0x11782a?0x0:_0x35082b[_0x6704('0x1c')];var _0xe49450=_0x11782a?_0x4fef80[_0x6704('0x1f')]:_0x35082b['offset']+_0x35082b[_0x6704('0x1e')];var _0x2f6eae;if(_0xe49450>=_0x5adb35){_0xe49450=_0x5adb35;_0x2f6eae=0xc8;}else{_0x2f6eae=0xce;}_0x1752bc[_0x6704('0x19')](_0x2f6eae);return _0x1752bc[_0x6704('0x20')](_0x6704('0x21'),_0x31d732+'-'+_0xe49450+'/'+_0x5adb35)[_0x6704('0x1b')](_0x4fef80);}return null;};}function patchUpdates(_0x42b27f){return function(_0x5bb33e){try{jsonpatch[_0x6704('0x22')](_0x5bb33e,_0x42b27f,!![]);}catch(_0xf6d433){return BPromise[_0x6704('0x23')](_0xf6d433);}return _0x5bb33e['save']();};}function saveUpdates(_0x4dca58,_0x48d829){return function(_0x3e183b){if(_0x3e183b){return _0x3e183b[_0x6704('0x24')](_0x4dca58)[_0x6704('0x25')](function(_0x41f89e){return _0x41f89e;});}return null;};}function removeEntity(_0x56d1e1,_0xf2c459){return function(_0xabb97a){if(_0xabb97a){return _0xabb97a[_0x6704('0x26')]()[_0x6704('0x25')](function(){_0x56d1e1[_0x6704('0x19')](0xcc)[_0x6704('0x1a')]();});}};}function handleEntityNotFound(_0x2acafd,_0x5d50ff){return function(_0x896227){if(!_0x896227){_0x2acafd[_0x6704('0x18')](0x194);}return _0x896227;};}function handleError(_0x36bea4,_0x1bdfee){_0x1bdfee=_0x1bdfee||0x1f4;return function(_0x118d93){logger['error'](_0x118d93['stack']);if(_0x118d93[_0x6704('0x27')]){delete _0x118d93[_0x6704('0x27')];}_0x36bea4[_0x6704('0x19')](_0x1bdfee)[_0x6704('0x28')](_0x118d93);};}exports['index']=function(_0x1def46,_0x18cd98){var _0x5c229d={},_0x588814={},_0x16e749={'count':0x0,'rows':[]};var _0x5363c9=_[_0x6704('0x29')](db['ChatQueueReport']['rawAttributes'],function(_0x7e193e){return{'name':_0x7e193e[_0x6704('0x2a')],'type':_0x7e193e[_0x6704('0x2b')]['key']};});_0x588814[_0x6704('0x2c')]=_[_0x6704('0x29')](_0x5363c9,_0x6704('0x27'));_0x588814[_0x6704('0x2d')]=_[_0x6704('0x2e')](_0x1def46[_0x6704('0x2d')]);_0x588814[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],_0x588814[_0x6704('0x2d')]);_0x5c229d[_0x6704('0x31')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x1def46[_0x6704('0x2d')][_0x6704('0x32')]));_0x5c229d[_0x6704('0x31')]=_0x5c229d[_0x6704('0x31')][_0x6704('0x33')]?_0x5c229d[_0x6704('0x31')]:_0x588814[_0x6704('0x2c')];if(!_0x1def46[_0x6704('0x2d')][_0x6704('0x34')](_0x6704('0x35'))){_0x5c229d[_0x6704('0x1e')]=qs['limit'](_0x1def46['query']['limit']);_0x5c229d[_0x6704('0x1c')]=qs[_0x6704('0x1c')](_0x1def46[_0x6704('0x2d')]['offset']);}_0x5c229d[_0x6704('0x36')]=qs['sort'](_0x1def46[_0x6704('0x2d')][_0x6704('0x37')]);_0x5c229d[_0x6704('0x38')]=qs[_0x6704('0x2f')](_[_0x6704('0x39')](_0x1def46[_0x6704('0x2d')],_0x588814[_0x6704('0x2f')]),_0x5363c9);if(_0x1def46[_0x6704('0x2d')]['filter']){_0x5c229d['where']=_[_0x6704('0x3a')](_0x5c229d[_0x6704('0x38')],{'$or':_['map'](_0x5363c9,function(_0x48f3c2){if(_0x48f3c2[_0x6704('0x2b')]!=='VIRTUAL'){var _0xd7e27b={};_0xd7e27b[_0x48f3c2[_0x6704('0x27')]]={'$like':'%'+_0x1def46[_0x6704('0x2d')][_0x6704('0x3b')]+'%'};return _0xd7e27b;}})});}_0x5c229d=_['merge']({},_0x5c229d,_0x1def46[_0x6704('0x3c')]);var _0x1ee017={'where':_0x5c229d['where']};return db[_0x6704('0x3d')]['count'](_0x1ee017)[_0x6704('0x25')](function(_0x714c83){_0x16e749[_0x6704('0x1f')]=_0x714c83;if(_0x1def46['query'][_0x6704('0x3e')]){_0x5c229d[_0x6704('0x3f')]=[{'all':!![]}];}return db[_0x6704('0x3d')]['findAll'](_0x5c229d);})[_0x6704('0x25')](function(_0x444d36){_0x16e749[_0x6704('0x40')]=_0x444d36;return _0x16e749;})[_0x6704('0x25')](respondWithFilteredResult(_0x18cd98,_0x5c229d))['catch'](handleError(_0x18cd98,null));};exports[_0x6704('0x41')]=function(_0x50cc74,_0x2defda){var _0x45a217={'raw':!![],'where':{'id':_0x50cc74[_0x6704('0x42')]['id']}},_0x10fc26={};_0x10fc26['model']=_['keys'](db['ChatQueueReport'][_0x6704('0x43')]);_0x10fc26['query']=_[_0x6704('0x2e')](_0x50cc74['query']);_0x10fc26[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x10fc26['model'],_0x10fc26[_0x6704('0x2d')]);_0x45a217[_0x6704('0x31')]=_[_0x6704('0x30')](_0x10fc26[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x50cc74['query'][_0x6704('0x32')]));_0x45a217[_0x6704('0x31')]=_0x45a217[_0x6704('0x31')][_0x6704('0x33')]?_0x45a217[_0x6704('0x31')]:_0x10fc26['model'];if(_0x50cc74[_0x6704('0x2d')]['includeAll']){_0x45a217[_0x6704('0x3f')]=[{'all':!![]}];}_0x45a217=_[_0x6704('0x3a')]({},_0x45a217,_0x50cc74[_0x6704('0x3c')]);return db[_0x6704('0x3d')][_0x6704('0x44')](_0x45a217)['then'](handleEntityNotFound(_0x2defda,null))[_0x6704('0x25')](respondWithResult(_0x2defda,null))[_0x6704('0x45')](handleError(_0x2defda,null));};exports['create']=function(_0x1b9d36,_0x17a98a){return db[_0x6704('0x3d')][_0x6704('0x46')](_0x1b9d36[_0x6704('0x47')],{})[_0x6704('0x25')](respondWithResult(_0x17a98a,0xc9))['catch'](handleError(_0x17a98a,null));};exports[_0x6704('0x24')]=function(_0x5b0713,_0xb73442){if(_0x5b0713['body']['id']){delete _0x5b0713[_0x6704('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5b0713[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0xb73442,null))[_0x6704('0x25')](saveUpdates(_0x5b0713[_0x6704('0x47')],null))[_0x6704('0x25')](respondWithResult(_0xb73442,null))[_0x6704('0x45')](handleError(_0xb73442,null));};exports['destroy']=function(_0x5b9e28,_0x254cf7){return db[_0x6704('0x3d')][_0x6704('0x44')]({'where':{'id':_0x5b9e28[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0x254cf7,null))[_0x6704('0x25')](removeEntity(_0x254cf7,null))[_0x6704('0x45')](handleError(_0x254cf7,null));};exports[_0x6704('0x48')]=function(_0x1fcfb0,_0x44e4a5){return db[_0x6704('0x3d')][_0x6704('0x48')]()[_0x6704('0x25')](respondWithResult(_0x44e4a5,null))[_0x6704('0x45')](handleError(_0x44e4a5,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 868d5f7..aeca127 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5baf45,_0x34bef2){var _0x44fc4b=function(_0xe70b6a){while(--_0xe70b6a){_0x5baf45['push'](_0x5baf45['shift']());}};_0x44fc4b(++_0x34bef2);}(_0x757a,0xde));var _0xa757=function(_0x4174e1,_0x48051d){_0x4174e1=_0x4174e1-0x0;var _0x1c59eb=_0x757a[_0x4174e1];return _0x1c59eb;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e1119,_0x32dc78){_0x4e1119=_0x4e1119-0x0;var _0x35f53d=_0xb10b[_0x4e1119];return _0x35f53d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index baef1ee..d506dc5 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 _0x1546=['ChatQueueReport','where','limit','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatQueueReport','body','options','raw','UpdateChatQueueReport'];(function(_0x3b40d8,_0x1954fc){var _0x2fe201=function(_0x3bcad8){while(--_0x3bcad8){_0x3b40d8['push'](_0x3b40d8['shift']());}};_0x2fe201(++_0x1954fc);}(_0x1546,0x18b));var _0x6154=function(_0x2e69ad,_0x4a50ae){_0x2e69ad=_0x2e69ad-0x0;var _0x320d9a=_0x1546[_0x2e69ad];return _0x320d9a;};'use strict';var _=require('lodash');var util=require(_0x6154('0x0'));var moment=require(_0x6154('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6154('0x2'))['db'];var utils=require(_0x6154('0x3'));var logger=require(_0x6154('0x4'))(_0x6154('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6154('0x6')][_0x6154('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x314d28,_0x39b763,_0x102541){return new BPromise(function(_0x44c302,_0x403229){return client[_0x6154('0x8')](_0x314d28,_0x102541)[_0x6154('0x9')](function(_0x4d0a7e){logger[_0x6154('0xa')](_0x6154('0xb'),_0x39b763,'request\x20sent');logger[_0x6154('0xc')](_0x6154('0xd'),_0x39b763,_0x6154('0xe'),JSON[_0x6154('0xf')](_0x4d0a7e));if(_0x4d0a7e[_0x6154('0x10')]){if(_0x4d0a7e[_0x6154('0x10')]['code']===0x1f4){logger[_0x6154('0x10')](_0x6154('0xb'),_0x39b763,_0x4d0a7e[_0x6154('0x10')]['message']);return _0x403229(_0x4d0a7e[_0x6154('0x10')][_0x6154('0x11')]);}logger[_0x6154('0x10')](_0x6154('0xb'),_0x39b763,_0x4d0a7e['error'][_0x6154('0x11')]);return _0x44c302(_0x4d0a7e[_0x6154('0x10')]['message']);}else{logger[_0x6154('0xa')](_0x6154('0xb'),_0x39b763,_0x6154('0xe'));_0x44c302(_0x4d0a7e[_0x6154('0x12')][_0x6154('0x11')]);}})[_0x6154('0x13')](function(_0x479a89){logger[_0x6154('0x10')](_0x6154('0xb'),_0x39b763,_0x479a89);_0x403229(_0x479a89);});});}exports[_0x6154('0x14')]=function(_0x283e31){var _0x34be0f=this;return new Promise(function(_0x53eb2b,_0x55af38){return db['ChatQueueReport']['create'](_0x283e31[_0x6154('0x15')],{'raw':_0x283e31[_0x6154('0x16')]?_0x283e31['options'][_0x6154('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x50b844){logger[_0x6154('0xa')](_0x6154('0x14'),_0x283e31);logger['debug']('CreateChatQueueReport',_0x283e31,JSON[_0x6154('0xf')](_0x50b844));_0x53eb2b(_0x50b844);})[_0x6154('0x13')](function(_0x4df022){logger['error'](_0x6154('0x14'),_0x4df022[_0x6154('0x11')],_0x283e31);_0x55af38(_0x34be0f[_0x6154('0x10')](0x1f4,_0x4df022[_0x6154('0x11')]));});});};exports[_0x6154('0x18')]=function(_0x7da997){var _0x438576=this;return new Promise(function(_0x10785c,_0x1711b9){return db[_0x6154('0x19')]['update'](_0x7da997['body'],{'raw':_0x7da997[_0x6154('0x16')]?_0x7da997[_0x6154('0x16')][_0x6154('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7da997[_0x6154('0x16')]?_0x7da997[_0x6154('0x16')][_0x6154('0x1a')]||null:null,'attributes':_0x7da997[_0x6154('0x16')]?_0x7da997[_0x6154('0x16')]['attributes']||null:null,'limit':_0x7da997['options']?_0x7da997[_0x6154('0x16')][_0x6154('0x1b')]||null:null})[_0x6154('0x9')](function(_0x1ce81b){logger[_0x6154('0xa')]('UpdateChatQueueReport',_0x7da997);logger[_0x6154('0xc')](_0x6154('0x18'),_0x7da997,JSON['stringify'](_0x1ce81b));_0x10785c(_0x1ce81b);})[_0x6154('0x13')](function(_0x3b934b){logger[_0x6154('0x10')]('UpdateChatQueueReport',_0x3b934b['message'],_0x7da997);_0x1711b9(_0x438576[_0x6154('0x10')](0x1f4,_0x3b934b[_0x6154('0x11')]));});});};
\ No newline at end of file
+var _0x900f=['info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','UpdateChatQueueReport','update','raw','attributes','limit','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x53e9d9,_0x39edc4){var _0x4f3de6=function(_0x5ba626){while(--_0x5ba626){_0x53e9d9['push'](_0x53e9d9['shift']());}};_0x4f3de6(++_0x39edc4);}(_0x900f,0x18a));var _0xf900=function(_0x20b9fc,_0x5dab92){_0x20b9fc=_0x20b9fc-0x0;var _0x511a2b=_0x900f[_0x20b9fc];return _0x511a2b;};'use strict';var _=require(_0xf900('0x0'));var util=require(_0xf900('0x1'));var moment=require('moment');var BPromise=require(_0xf900('0x2'));var rs=require(_0xf900('0x3'));var fs=require('fs');var Redis=require(_0xf900('0x4'));var db=require(_0xf900('0x5'))['db'];var utils=require(_0xf900('0x6'));var logger=require(_0xf900('0x7'))('rpc');var config=require(_0xf900('0x8'));var jayson=require(_0xf900('0x9'));var client=jayson[_0xf900('0xa')][_0xf900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f01ff,_0x56fcd4,_0x44153a){return new BPromise(function(_0x4cfc6d,_0x4cbf6b){return client[_0xf900('0xc')](_0x1f01ff,_0x44153a)[_0xf900('0xd')](function(_0x4bdc30){logger[_0xf900('0xe')](_0xf900('0xf'),_0x56fcd4,_0xf900('0x10'));logger['debug'](_0xf900('0x11'),_0x56fcd4,_0xf900('0x10'),JSON[_0xf900('0x12')](_0x4bdc30));if(_0x4bdc30[_0xf900('0x13')]){if(_0x4bdc30['error'][_0xf900('0x14')]===0x1f4){logger[_0xf900('0x13')](_0xf900('0xf'),_0x56fcd4,_0x4bdc30['error'][_0xf900('0x15')]);return _0x4cbf6b(_0x4bdc30[_0xf900('0x13')]['message']);}logger[_0xf900('0x13')](_0xf900('0xf'),_0x56fcd4,_0x4bdc30[_0xf900('0x13')]['message']);return _0x4cfc6d(_0x4bdc30[_0xf900('0x13')][_0xf900('0x15')]);}else{logger[_0xf900('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x56fcd4,_0xf900('0x10'));_0x4cfc6d(_0x4bdc30[_0xf900('0x16')][_0xf900('0x15')]);}})[_0xf900('0x17')](function(_0xc96578){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x56fcd4,_0xc96578);_0x4cbf6b(_0xc96578);});});}exports[_0xf900('0x18')]=function(_0x38e35){var _0x3a6afe=this;return new Promise(function(_0x394e8d,_0x48820b){return db[_0xf900('0x19')]['create'](_0x38e35[_0xf900('0x1a')],{'raw':_0x38e35['options']?_0x38e35[_0xf900('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf900('0xd')](function(_0x3d116d){logger[_0xf900('0xe')](_0xf900('0x18'),_0x38e35);logger['debug'](_0xf900('0x18'),_0x38e35,JSON['stringify'](_0x3d116d));_0x394e8d(_0x3d116d);})['catch'](function(_0x52f3cd){logger[_0xf900('0x13')](_0xf900('0x18'),_0x52f3cd['message'],_0x38e35);_0x48820b(_0x3a6afe['error'](0x1f4,_0x52f3cd['message']));});});};exports[_0xf900('0x1c')]=function(_0x427133){var _0x41d5c6=this;return new Promise(function(_0x33d371,_0x5926af){return db[_0xf900('0x19')][_0xf900('0x1d')](_0x427133['body'],{'raw':_0x427133[_0xf900('0x1b')]?_0x427133[_0xf900('0x1b')][_0xf900('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x427133['options']?_0x427133[_0xf900('0x1b')]['where']||null:null,'attributes':_0x427133[_0xf900('0x1b')]?_0x427133[_0xf900('0x1b')][_0xf900('0x1f')]||null:null,'limit':_0x427133[_0xf900('0x1b')]?_0x427133[_0xf900('0x1b')][_0xf900('0x20')]||null:null})[_0xf900('0xd')](function(_0xa6f659){logger[_0xf900('0xe')](_0xf900('0x1c'),_0x427133);logger[_0xf900('0x21')](_0xf900('0x1c'),_0x427133,JSON[_0xf900('0x12')](_0xa6f659));_0x33d371(_0xa6f659);})[_0xf900('0x17')](function(_0x1e44f3){logger[_0xf900('0x13')](_0xf900('0x1c'),_0x1e44f3[_0xf900('0x15')],_0x427133);_0x5926af(_0x41d5c6[_0xf900('0x13')](0x1f4,_0x1e44f3[_0xf900('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 209cbc8..4d84512 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 _0x3db2=['isAuthenticated','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x449225,_0xf44ffb){var _0x2b70a9=function(_0x3c62ab){while(--_0x3c62ab){_0x449225['push'](_0x449225['shift']());}};_0x2b70a9(++_0xf44ffb);}(_0x3db2,0x186));var _0x23db=function(_0x1d9d12,_0x2c7d98){_0x1d9d12=_0x1d9d12-0x0;var _0x4f680e=_0x3db2[_0x1d9d12];return _0x4f680e;};'use strict';var multer=require(_0x23db('0x0'));var util=require(_0x23db('0x1'));var path=require(_0x23db('0x2'));var timeout=require(_0x23db('0x3'));var express=require(_0x23db('0x4'));var router=express[_0x23db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x23db('0x6'));var interaction=require(_0x23db('0x7'));var config=require(_0x23db('0x8'));var controller=require('./chatQueueReport.controller');router[_0x23db('0x9')]('/',auth[_0x23db('0xa')](),controller['index']);router[_0x23db('0x9')](_0x23db('0xb'),auth[_0x23db('0xa')](),controller[_0x23db('0xc')]);router[_0x23db('0x9')](_0x23db('0xd'),auth[_0x23db('0xa')](),controller[_0x23db('0xe')]);router[_0x23db('0xf')]('/',auth[_0x23db('0xa')](),controller['create']);router[_0x23db('0x10')](_0x23db('0xd'),auth[_0x23db('0xa')](),controller['update']);router[_0x23db('0x11')](_0x23db('0xd'),auth[_0x23db('0xa')](),controller[_0x23db('0x12')]);module[_0x23db('0x13')]=router;
\ No newline at end of file
+var _0x23cb=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x23cb,0x1bb));var _0xb23c=function(_0x5e56db,_0x37f86e){_0x5e56db=_0x5e56db-0x0;var _0x2f49c9=_0x23cb[_0x5e56db];return _0x2f49c9;};'use strict';var multer=require(_0xb23c('0x0'));var util=require('util');var path=require(_0xb23c('0x1'));var timeout=require(_0xb23c('0x2'));var express=require(_0xb23c('0x3'));var router=express[_0xb23c('0x4')]();var fs_extra=require(_0xb23c('0x5'));var auth=require(_0xb23c('0x6'));var interaction=require(_0xb23c('0x7'));var config=require(_0xb23c('0x8'));var controller=require(_0xb23c('0x9'));router[_0xb23c('0xa')]('/',auth[_0xb23c('0xb')](),controller[_0xb23c('0xc')]);router[_0xb23c('0xa')](_0xb23c('0xd'),auth[_0xb23c('0xb')](),controller[_0xb23c('0xe')]);router['get'](_0xb23c('0xf'),auth[_0xb23c('0xb')](),controller[_0xb23c('0x10')]);router['post']('/',auth[_0xb23c('0xb')](),controller[_0xb23c('0x11')]);router['put'](_0xb23c('0xf'),auth['isAuthenticated'](),controller[_0xb23c('0x12')]);router[_0xb23c('0x13')](_0xb23c('0xf'),auth['isAuthenticated'](),controller[_0xb23c('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 048aa99..0848937 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x1bf3fa,_0x4daed8){var _0x31bddc=function(_0x4e324d){while(--_0x4e324d){_0x1bf3fa['push'](_0x1bf3fa['shift']());}};_0x31bddc(++_0x4daed8);}(_0xe706,0xa3));var _0x6e70=function(_0x126ee1,_0x4b9781){_0x126ee1=_0x126ee1-0x0;var _0x32524c=_0xe706[_0x126ee1];return _0x32524c;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4e8401,_0x51b328){var _0x17269f=function(_0x35ac65){while(--_0x35ac65){_0x4e8401['push'](_0x4e8401['shift']());}};_0x17269f(++_0x51b328);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 3777043..4d756d2 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 _0x6efc=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','stack','name','send','index','ChatTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','include','options','find','create','body','params','describe'];(function(_0x790c06,_0x1fe3ff){var _0xa6d4fe=function(_0x120a95){while(--_0x120a95){_0x790c06['push'](_0x790c06['shift']());}};_0xa6d4fe(++_0x1fe3ff);}(_0x6efc,0xcf));var _0xc6ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6efc[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc6ef('0x0'));var jsonpatch=require(_0xc6ef('0x1'));var rp=require(_0xc6ef('0x2'));var moment=require('moment');var BPromise=require(_0xc6ef('0x3'));var Mustache=require(_0xc6ef('0x4'));var util=require(_0xc6ef('0x5'));var path=require(_0xc6ef('0x6'));var sox=require(_0xc6ef('0x7'));var csv=require(_0xc6ef('0x8'));var ejs=require(_0xc6ef('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6ef('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc6ef('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6ef('0xc'));var Papa=require(_0xc6ef('0xd'));var Redis=require(_0xc6ef('0xe'));var authService=require(_0xc6ef('0xf'));var qs=require(_0xc6ef('0x10'));var as=require(_0xc6ef('0x11'));var hardwareService=require(_0xc6ef('0x12'));var logger=require(_0xc6ef('0x13'))('api');var utils=require(_0xc6ef('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6ef('0x15'))['db'];function respondWithStatusCode(_0x460164,_0x5ee6e3){_0x5ee6e3=_0x5ee6e3||0xcc;return function(_0x2469a1){if(_0x2469a1){return _0x460164[_0xc6ef('0x16')](_0x5ee6e3);}return _0x460164[_0xc6ef('0x17')](_0x5ee6e3)['end']();};}function respondWithResult(_0x4c2a38,_0x4cb10e){_0x4cb10e=_0x4cb10e||0xc8;return function(_0x5cd836){if(_0x5cd836){return _0x4c2a38['status'](_0x4cb10e)[_0xc6ef('0x18')](_0x5cd836);}};}function respondWithFilteredResult(_0x3ef1d9,_0x578731){return function(_0x32342c){if(_0x32342c){var _0x1be5f2=typeof _0x578731['offset']===_0xc6ef('0x19')&&typeof _0x578731[_0xc6ef('0x1a')]===_0xc6ef('0x19');var _0x36028d=_0x32342c[_0xc6ef('0x1b')];var _0xcc86ee=_0x1be5f2?0x0:_0x578731[_0xc6ef('0x1c')];var _0x191451=_0x1be5f2?_0x32342c[_0xc6ef('0x1b')]:_0x578731[_0xc6ef('0x1c')]+_0x578731[_0xc6ef('0x1a')];var _0x308fc1;if(_0x191451>=_0x36028d){_0x191451=_0x36028d;_0x308fc1=0xc8;}else{_0x308fc1=0xce;}_0x3ef1d9[_0xc6ef('0x17')](_0x308fc1);return _0x3ef1d9['set'](_0xc6ef('0x1d'),_0xcc86ee+'-'+_0x191451+'/'+_0x36028d)[_0xc6ef('0x18')](_0x32342c);}return null;};}function patchUpdates(_0x1803f9){return function(_0x5dab31){try{jsonpatch[_0xc6ef('0x1e')](_0x5dab31,_0x1803f9,!![]);}catch(_0x1f7138){return BPromise[_0xc6ef('0x1f')](_0x1f7138);}return _0x5dab31['save']();};}function saveUpdates(_0x19c368,_0x241982){return function(_0x103462){if(_0x103462){return _0x103462['update'](_0x19c368)[_0xc6ef('0x20')](function(_0x3a585e){return _0x3a585e;});}return null;};}function removeEntity(_0x123b92,_0x3f459b){return function(_0x4091e6){if(_0x4091e6){return _0x4091e6[_0xc6ef('0x21')]()['then'](function(){_0x123b92[_0xc6ef('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cd1ca,_0x25b371){return function(_0x20d858){if(!_0x20d858){_0x4cd1ca[_0xc6ef('0x16')](0x194);}return _0x20d858;};}function handleError(_0xf6eb1f,_0x56aa03){_0x56aa03=_0x56aa03||0x1f4;return function(_0x40d324){logger['error'](_0x40d324[_0xc6ef('0x22')]);if(_0x40d324[_0xc6ef('0x23')]){delete _0x40d324[_0xc6ef('0x23')];}_0xf6eb1f[_0xc6ef('0x17')](_0x56aa03)[_0xc6ef('0x24')](_0x40d324);};}exports[_0xc6ef('0x25')]=function(_0x5ac7bc,_0x2ca76d){var _0x1df934={},_0x583223={},_0x1edccd={'count':0x0,'rows':[]};var _0x5424db=_['map'](db[_0xc6ef('0x26')]['rawAttributes'],function(_0x55ce9d){return{'name':_0x55ce9d[_0xc6ef('0x27')],'type':_0x55ce9d[_0xc6ef('0x28')][_0xc6ef('0x29')]};});_0x583223[_0xc6ef('0x2a')]=_[_0xc6ef('0x2b')](_0x5424db,_0xc6ef('0x23'));_0x583223[_0xc6ef('0x2c')]=_[_0xc6ef('0x2d')](_0x5ac7bc[_0xc6ef('0x2c')]);_0x583223[_0xc6ef('0x2e')]=_['intersection'](_0x583223['model'],_0x583223[_0xc6ef('0x2c')]);_0x1df934['attributes']=_[_0xc6ef('0x2f')](_0x583223['model'],qs[_0xc6ef('0x30')](_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x30')]));_0x1df934[_0xc6ef('0x31')]=_0x1df934[_0xc6ef('0x31')]['length']?_0x1df934[_0xc6ef('0x31')]:_0x583223['model'];if(!_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x32')]('nolimit')){_0x1df934['limit']=qs[_0xc6ef('0x1a')](_0x5ac7bc[_0xc6ef('0x2c')]['limit']);_0x1df934['offset']=qs[_0xc6ef('0x1c')](_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x1c')]);}_0x1df934[_0xc6ef('0x33')]=qs[_0xc6ef('0x34')](_0x5ac7bc['query'][_0xc6ef('0x34')]);_0x1df934[_0xc6ef('0x35')]=qs[_0xc6ef('0x2e')](_[_0xc6ef('0x36')](_0x5ac7bc[_0xc6ef('0x2c')],_0x583223['filters']),_0x5424db);if(_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x37')]){_0x1df934[_0xc6ef('0x35')]=_[_0xc6ef('0x38')](_0x1df934[_0xc6ef('0x35')],{'$or':_['map'](_0x5424db,function(_0x4b028b){if(_0x4b028b[_0xc6ef('0x28')]!==_0xc6ef('0x39')){var _0x4da0c3={};_0x4da0c3[_0x4b028b[_0xc6ef('0x23')]]={'$like':'%'+_0x5ac7bc[_0xc6ef('0x2c')][_0xc6ef('0x37')]+'%'};return _0x4da0c3;}})});}_0x1df934=_['merge']({},_0x1df934,_0x5ac7bc['options']);var _0x10b364={'where':_0x1df934['where']};return db[_0xc6ef('0x26')][_0xc6ef('0x1b')](_0x10b364)[_0xc6ef('0x20')](function(_0x55360d){_0x1edccd[_0xc6ef('0x1b')]=_0x55360d;if(_0x5ac7bc['query'][_0xc6ef('0x3a')]){_0x1df934['include']=[{'all':!![]}];}return db[_0xc6ef('0x26')]['findAll'](_0x1df934);})[_0xc6ef('0x20')](function(_0x1e4d25){_0x1edccd[_0xc6ef('0x3b')]=_0x1e4d25;return _0x1edccd;})['then'](respondWithFilteredResult(_0x2ca76d,_0x1df934))[_0xc6ef('0x3c')](handleError(_0x2ca76d,null));};exports[_0xc6ef('0x3d')]=function(_0x21296c,_0x4c5b2a){var _0x1fd359={'raw':!![],'where':{'id':_0x21296c['params']['id']}},_0x18e210={};_0x18e210[_0xc6ef('0x2a')]=_[_0xc6ef('0x2d')](db['ChatTransferReport']['rawAttributes']);_0x18e210[_0xc6ef('0x2c')]=_[_0xc6ef('0x2d')](_0x21296c[_0xc6ef('0x2c')]);_0x18e210[_0xc6ef('0x2e')]=_[_0xc6ef('0x2f')](_0x18e210[_0xc6ef('0x2a')],_0x18e210[_0xc6ef('0x2c')]);_0x1fd359[_0xc6ef('0x31')]=_['intersection'](_0x18e210[_0xc6ef('0x2a')],qs[_0xc6ef('0x30')](_0x21296c[_0xc6ef('0x2c')][_0xc6ef('0x30')]));_0x1fd359[_0xc6ef('0x31')]=_0x1fd359[_0xc6ef('0x31')]['length']?_0x1fd359[_0xc6ef('0x31')]:_0x18e210[_0xc6ef('0x2a')];if(_0x21296c[_0xc6ef('0x2c')][_0xc6ef('0x3a')]){_0x1fd359[_0xc6ef('0x3e')]=[{'all':!![]}];}_0x1fd359=_[_0xc6ef('0x38')]({},_0x1fd359,_0x21296c[_0xc6ef('0x3f')]);return db[_0xc6ef('0x26')][_0xc6ef('0x40')](_0x1fd359)[_0xc6ef('0x20')](handleEntityNotFound(_0x4c5b2a,null))[_0xc6ef('0x20')](respondWithResult(_0x4c5b2a,null))['catch'](handleError(_0x4c5b2a,null));};exports[_0xc6ef('0x41')]=function(_0x390e70,_0xc602ff){return db['ChatTransferReport'][_0xc6ef('0x41')](_0x390e70['body'],{})['then'](respondWithResult(_0xc602ff,0xc9))[_0xc6ef('0x3c')](handleError(_0xc602ff,null));};exports['update']=function(_0x2bf7e8,_0x5c3785){if(_0x2bf7e8[_0xc6ef('0x42')]['id']){delete _0x2bf7e8[_0xc6ef('0x42')]['id'];}return db['ChatTransferReport'][_0xc6ef('0x40')]({'where':{'id':_0x2bf7e8[_0xc6ef('0x43')]['id']}})[_0xc6ef('0x20')](handleEntityNotFound(_0x5c3785,null))['then'](saveUpdates(_0x2bf7e8[_0xc6ef('0x42')],null))[_0xc6ef('0x20')](respondWithResult(_0x5c3785,null))[_0xc6ef('0x3c')](handleError(_0x5c3785,null));};exports[_0xc6ef('0x21')]=function(_0x2599f0,_0xf4da4a){return db['ChatTransferReport'][_0xc6ef('0x40')]({'where':{'id':_0x2599f0[_0xc6ef('0x43')]['id']}})['then'](handleEntityNotFound(_0xf4da4a,null))[_0xc6ef('0x20')](removeEntity(_0xf4da4a,null))[_0xc6ef('0x3c')](handleError(_0xf4da4a,null));};exports[_0xc6ef('0x44')]=function(_0x59652e,_0x56e2c4){return db[_0xc6ef('0x26')][_0xc6ef('0x44')]()[_0xc6ef('0x20')](respondWithResult(_0x56e2c4,null))[_0xc6ef('0x3c')](handleError(_0x56e2c4,null));};
\ No newline at end of file
+var _0x33c4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','eml-format'];(function(_0x2c4185,_0x28176d){var _0x2fb767=function(_0x4f862a){while(--_0x4f862a){_0x2c4185['push'](_0x2c4185['shift']());}};_0x2fb767(++_0x28176d);}(_0x33c4,0xef));var _0x433c=function(_0x30fdf9,_0x89096d){_0x30fdf9=_0x30fdf9-0x0;var _0x3c43bb=_0x33c4[_0x30fdf9];return _0x3c43bb;};'use strict';var emlformat=require(_0x433c('0x0'));var rimraf=require(_0x433c('0x1'));var zipdir=require(_0x433c('0x2'));var jsonpatch=require(_0x433c('0x3'));var rp=require(_0x433c('0x4'));var moment=require(_0x433c('0x5'));var BPromise=require(_0x433c('0x6'));var Mustache=require(_0x433c('0x7'));var util=require('util');var path=require(_0x433c('0x8'));var sox=require(_0x433c('0x9'));var csv=require(_0x433c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x433c('0xb'));var _=require(_0x433c('0xc'));var squel=require(_0x433c('0xd'));var crypto=require('crypto');var jsforce=require(_0x433c('0xe'));var deskjs=require(_0x433c('0xf'));var toCsv=require(_0x433c('0xa'));var querystring=require(_0x433c('0x10'));var Papa=require(_0x433c('0x11'));var Redis=require(_0x433c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x433c('0x13'));var as=require(_0x433c('0x14'));var hardwareService=require(_0x433c('0x15'));var logger=require('../../config/logger')(_0x433c('0x16'));var utils=require(_0x433c('0x17'));var config=require(_0x433c('0x18'));var licenseUtil=require(_0x433c('0x19'));var db=require(_0x433c('0x1a'))['db'];function respondWithStatusCode(_0xa984ab,_0x383752){_0x383752=_0x383752||0xcc;return function(_0x3ac2ae){if(_0x3ac2ae){return _0xa984ab['sendStatus'](_0x383752);}return _0xa984ab[_0x433c('0x1b')](_0x383752)[_0x433c('0x1c')]();};}function respondWithResult(_0x5a45d8,_0x52f8db){_0x52f8db=_0x52f8db||0xc8;return function(_0x9b2ff1){if(_0x9b2ff1){return _0x5a45d8[_0x433c('0x1b')](_0x52f8db)[_0x433c('0x1d')](_0x9b2ff1);}};}function respondWithFilteredResult(_0x578984,_0x164058){return function(_0x5151f2){if(_0x5151f2){var _0x242de7=typeof _0x164058[_0x433c('0x1e')]===_0x433c('0x1f')&&typeof _0x164058[_0x433c('0x20')]==='undefined';var _0x185b03=_0x5151f2[_0x433c('0x21')];var _0x1e30f2=_0x242de7?0x0:_0x164058[_0x433c('0x1e')];var _0x21adff=_0x242de7?_0x5151f2[_0x433c('0x21')]:_0x164058['offset']+_0x164058[_0x433c('0x20')];var _0x38d0c1;if(_0x21adff>=_0x185b03){_0x21adff=_0x185b03;_0x38d0c1=0xc8;}else{_0x38d0c1=0xce;}_0x578984['status'](_0x38d0c1);return _0x578984[_0x433c('0x22')]('Content-Range',_0x1e30f2+'-'+_0x21adff+'/'+_0x185b03)[_0x433c('0x1d')](_0x5151f2);}return null;};}function patchUpdates(_0x55db29){return function(_0x2dac54){try{jsonpatch['apply'](_0x2dac54,_0x55db29,!![]);}catch(_0x4d493a){return BPromise[_0x433c('0x23')](_0x4d493a);}return _0x2dac54[_0x433c('0x24')]();};}function saveUpdates(_0x26e3ef,_0x5a8531){return function(_0x275f65){if(_0x275f65){return _0x275f65['update'](_0x26e3ef)[_0x433c('0x25')](function(_0x41ed82){return _0x41ed82;});}return null;};}function removeEntity(_0x119bef,_0x642269){return function(_0x4309e5){if(_0x4309e5){return _0x4309e5[_0x433c('0x26')]()[_0x433c('0x25')](function(){_0x119bef[_0x433c('0x1b')](0xcc)[_0x433c('0x1c')]();});}};}function handleEntityNotFound(_0x20f0d8,_0x51f6bd){return function(_0xf7b528){if(!_0xf7b528){_0x20f0d8[_0x433c('0x27')](0x194);}return _0xf7b528;};}function handleError(_0x405606,_0x24f2a4){_0x24f2a4=_0x24f2a4||0x1f4;return function(_0x285817){logger[_0x433c('0x28')](_0x285817[_0x433c('0x29')]);if(_0x285817[_0x433c('0x2a')]){delete _0x285817[_0x433c('0x2a')];}_0x405606['status'](_0x24f2a4)[_0x433c('0x2b')](_0x285817);};}exports[_0x433c('0x2c')]=function(_0x4da59b,_0x383737){var _0x3cea21={},_0x56023c={},_0x1ee713={'count':0x0,'rows':[]};var _0x2d837d=_[_0x433c('0x2d')](db[_0x433c('0x2e')][_0x433c('0x2f')],function(_0x9effa3){return{'name':_0x9effa3[_0x433c('0x30')],'type':_0x9effa3[_0x433c('0x31')][_0x433c('0x32')]};});_0x56023c[_0x433c('0x33')]=_[_0x433c('0x2d')](_0x2d837d,_0x433c('0x2a'));_0x56023c[_0x433c('0x34')]=_['keys'](_0x4da59b[_0x433c('0x34')]);_0x56023c['filters']=_[_0x433c('0x35')](_0x56023c[_0x433c('0x33')],_0x56023c[_0x433c('0x34')]);_0x3cea21[_0x433c('0x36')]=_['intersection'](_0x56023c['model'],qs[_0x433c('0x37')](_0x4da59b['query']['fields']));_0x3cea21[_0x433c('0x36')]=_0x3cea21[_0x433c('0x36')][_0x433c('0x38')]?_0x3cea21[_0x433c('0x36')]:_0x56023c[_0x433c('0x33')];if(!_0x4da59b[_0x433c('0x34')][_0x433c('0x39')](_0x433c('0x3a'))){_0x3cea21[_0x433c('0x20')]=qs[_0x433c('0x20')](_0x4da59b[_0x433c('0x34')][_0x433c('0x20')]);_0x3cea21['offset']=qs['offset'](_0x4da59b[_0x433c('0x34')]['offset']);}_0x3cea21[_0x433c('0x3b')]=qs[_0x433c('0x3c')](_0x4da59b[_0x433c('0x34')][_0x433c('0x3c')]);_0x3cea21['where']=qs[_0x433c('0x3d')](_[_0x433c('0x3e')](_0x4da59b['query'],_0x56023c[_0x433c('0x3d')]),_0x2d837d);if(_0x4da59b[_0x433c('0x34')][_0x433c('0x3f')]){_0x3cea21[_0x433c('0x40')]=_[_0x433c('0x41')](_0x3cea21[_0x433c('0x40')],{'$or':_[_0x433c('0x2d')](_0x2d837d,function(_0x398aae){if(_0x398aae['type']!==_0x433c('0x42')){var _0x2d2123={};_0x2d2123[_0x398aae[_0x433c('0x2a')]]={'$like':'%'+_0x4da59b['query']['filter']+'%'};return _0x2d2123;}})});}_0x3cea21=_[_0x433c('0x41')]({},_0x3cea21,_0x4da59b[_0x433c('0x43')]);var _0x598af2={'where':_0x3cea21[_0x433c('0x40')]};return db[_0x433c('0x2e')]['count'](_0x598af2)['then'](function(_0x25a509){_0x1ee713[_0x433c('0x21')]=_0x25a509;if(_0x4da59b[_0x433c('0x34')][_0x433c('0x44')]){_0x3cea21[_0x433c('0x45')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x433c('0x46')](_0x3cea21);})['then'](function(_0x11574c){_0x1ee713[_0x433c('0x47')]=_0x11574c;return _0x1ee713;})[_0x433c('0x25')](respondWithFilteredResult(_0x383737,_0x3cea21))['catch'](handleError(_0x383737,null));};exports[_0x433c('0x48')]=function(_0x4af150,_0xe641ab){var _0x416466={'raw':!![],'where':{'id':_0x4af150[_0x433c('0x49')]['id']}},_0x111434={};_0x111434[_0x433c('0x33')]=_['keys'](db[_0x433c('0x2e')][_0x433c('0x2f')]);_0x111434['query']=_[_0x433c('0x4a')](_0x4af150[_0x433c('0x34')]);_0x111434['filters']=_[_0x433c('0x35')](_0x111434[_0x433c('0x33')],_0x111434[_0x433c('0x34')]);_0x416466[_0x433c('0x36')]=_[_0x433c('0x35')](_0x111434[_0x433c('0x33')],qs['fields'](_0x4af150[_0x433c('0x34')]['fields']));_0x416466[_0x433c('0x36')]=_0x416466[_0x433c('0x36')][_0x433c('0x38')]?_0x416466[_0x433c('0x36')]:_0x111434[_0x433c('0x33')];if(_0x4af150[_0x433c('0x34')][_0x433c('0x44')]){_0x416466[_0x433c('0x45')]=[{'all':!![]}];}_0x416466=_['merge']({},_0x416466,_0x4af150[_0x433c('0x43')]);return db['ChatTransferReport'][_0x433c('0x4b')](_0x416466)[_0x433c('0x25')](handleEntityNotFound(_0xe641ab,null))['then'](respondWithResult(_0xe641ab,null))[_0x433c('0x4c')](handleError(_0xe641ab,null));};exports[_0x433c('0x4d')]=function(_0x1ef56a,_0x48a583){return db[_0x433c('0x2e')][_0x433c('0x4d')](_0x1ef56a[_0x433c('0x4e')],{})[_0x433c('0x25')](respondWithResult(_0x48a583,0xc9))[_0x433c('0x4c')](handleError(_0x48a583,null));};exports[_0x433c('0x4f')]=function(_0x5dc935,_0x4b4324){if(_0x5dc935[_0x433c('0x4e')]['id']){delete _0x5dc935['body']['id'];}return db[_0x433c('0x2e')][_0x433c('0x4b')]({'where':{'id':_0x5dc935[_0x433c('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b4324,null))[_0x433c('0x25')](saveUpdates(_0x5dc935[_0x433c('0x4e')],null))[_0x433c('0x25')](respondWithResult(_0x4b4324,null))[_0x433c('0x4c')](handleError(_0x4b4324,null));};exports[_0x433c('0x26')]=function(_0x3a7d35,_0x528cf9){return db[_0x433c('0x2e')][_0x433c('0x4b')]({'where':{'id':_0x3a7d35[_0x433c('0x49')]['id']}})[_0x433c('0x25')](handleEntityNotFound(_0x528cf9,null))[_0x433c('0x25')](removeEntity(_0x528cf9,null))[_0x433c('0x4c')](handleError(_0x528cf9,null));};exports['describe']=function(_0x89f549,_0x29534e){return db[_0x433c('0x2e')]['describe']()['then'](respondWithResult(_0x29534e,null))[_0x433c('0x4c')](handleError(_0x29534e,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 85eb6d9..e3edc8e 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 _0x6520=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x6520,0x127));var _0x0652=function(_0x1bc937,_0xf06a04){_0x1bc937=_0x1bc937-0x0;var _0x56308c=_0x6520[_0x1bc937];return _0x56308c;};'use strict';var _=require(_0x0652('0x0'));var util=require(_0x0652('0x1'));var logger=require(_0x0652('0x2'))(_0x0652('0x3'));var moment=require(_0x0652('0x4'));var BPromise=require(_0x0652('0x5'));var rp=require(_0x0652('0x6'));var fs=require('fs');var path=require(_0x0652('0x7'));var rimraf=require(_0x0652('0x8'));var config=require('../../config/environment');var attributes=require(_0x0652('0x9'));module['exports']=function(_0x27c622,_0x58fd69){return _0x27c622[_0x0652('0xa')](_0x0652('0xb'),attributes,{'tableName':_0x0652('0xc'),'paranoid':![],'indexes':[{'name':_0x0652('0xd'),'fields':[_0x0652('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4241=['util','../../config/logger','api','moment','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid'];(function(_0x9711a9,_0x551293){var _0x41e0ae=function(_0x5ba288){while(--_0x5ba288){_0x9711a9['push'](_0x9711a9['shift']());}};_0x41e0ae(++_0x551293);}(_0x4241,0xd8));var _0x1424=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x4241[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0x1424('0x0'));var logger=require(_0x1424('0x1'))(_0x1424('0x2'));var moment=require(_0x1424('0x3'));var BPromise=require(_0x1424('0x4'));var rp=require(_0x1424('0x5'));var fs=require('fs');var path=require(_0x1424('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1424('0x7'));module[_0x1424('0x8')]=function(_0x2e7ecb,_0x1d1e23){return _0x2e7ecb[_0x1424('0x9')](_0x1424('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1424('0xb'),'fields':[_0x1424('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 209cd62..561f074 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 _0x555c=['client','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x555c,0x183));var _0xc555=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x555c[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xc555('0x0'));var moment=require('moment');var BPromise=require(_0xc555('0x1'));var rs=require(_0xc555('0x2'));var fs=require('fs');var Redis=require(_0xc555('0x3'));var db=require(_0xc555('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc555('0x5'))(_0xc555('0x6'));var config=require(_0xc555('0x7'));var jayson=require(_0xc555('0x8'));var client=jayson[_0xc555('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19d902,_0x58ee9c,_0x539330){return new BPromise(function(_0x3cdccc,_0x86ea63){return client['request'](_0x19d902,_0x539330)[_0xc555('0xa')](function(_0x5fd376){logger[_0xc555('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x58ee9c,'request\x20sent');logger[_0xc555('0xc')](_0xc555('0xd'),_0x58ee9c,_0xc555('0xe'),JSON[_0xc555('0xf')](_0x5fd376));if(_0x5fd376[_0xc555('0x10')]){if(_0x5fd376[_0xc555('0x10')][_0xc555('0x11')]===0x1f4){logger[_0xc555('0x10')](_0xc555('0x12'),_0x58ee9c,_0x5fd376[_0xc555('0x10')][_0xc555('0x13')]);return _0x86ea63(_0x5fd376['error'][_0xc555('0x13')]);}logger[_0xc555('0x10')](_0xc555('0x12'),_0x58ee9c,_0x5fd376[_0xc555('0x10')][_0xc555('0x13')]);return _0x3cdccc(_0x5fd376[_0xc555('0x10')][_0xc555('0x13')]);}else{logger['info'](_0xc555('0x12'),_0x58ee9c,_0xc555('0xe'));_0x3cdccc(_0x5fd376[_0xc555('0x14')]['message']);}})[_0xc555('0x15')](function(_0x204099){logger[_0xc555('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x58ee9c,_0x204099);_0x86ea63(_0x204099);});});}
\ No newline at end of file
+var _0xe86d=['../../config/logger','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18f94c,_0x335e09){var _0x22d8c5=function(_0x32ce21){while(--_0x32ce21){_0x18f94c['push'](_0x18f94c['shift']());}};_0x22d8c5(++_0x335e09);}(_0xe86d,0x144));var _0xde86=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe86d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xde86('0x0'));var util=require('util');var moment=require(_0xde86('0x1'));var BPromise=require(_0xde86('0x2'));var rs=require(_0xde86('0x3'));var fs=require('fs');var Redis=require(_0xde86('0x4'));var db=require(_0xde86('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde86('0x6'))('rpc');var config=require(_0xde86('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xde86('0x8')][_0xde86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33ecc8,_0x1419e8,_0x147be5){return new BPromise(function(_0x53d556,_0x54da1e){return client['request'](_0x33ecc8,_0x147be5)[_0xde86('0xa')](function(_0x3ae1d2){logger[_0xde86('0xb')](_0xde86('0xc'),_0x1419e8,_0xde86('0xd'));logger[_0xde86('0xe')](_0xde86('0xf'),_0x1419e8,_0xde86('0xd'),JSON[_0xde86('0x10')](_0x3ae1d2));if(_0x3ae1d2[_0xde86('0x11')]){if(_0x3ae1d2[_0xde86('0x11')][_0xde86('0x12')]===0x1f4){logger[_0xde86('0x11')](_0xde86('0xc'),_0x1419e8,_0x3ae1d2[_0xde86('0x11')][_0xde86('0x13')]);return _0x54da1e(_0x3ae1d2[_0xde86('0x11')]['message']);}logger[_0xde86('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1419e8,_0x3ae1d2[_0xde86('0x11')][_0xde86('0x13')]);return _0x53d556(_0x3ae1d2['error']['message']);}else{logger[_0xde86('0xb')](_0xde86('0xc'),_0x1419e8,'request\x20sent');_0x53d556(_0x3ae1d2[_0xde86('0x14')]['message']);}})[_0xde86('0x15')](function(_0x51590a){logger[_0xde86('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1419e8,_0x51590a);_0x54da1e(_0x51590a);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 14c4916..ddf5e35 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 _0x23b2=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1f30ca,_0x2ddb13){var _0x57f751=function(_0x4fb64f){while(--_0x4fb64f){_0x1f30ca['push'](_0x1f30ca['shift']());}};_0x57f751(++_0x2ddb13);}(_0x23b2,0x1df));var _0x223b=function(_0x7fa072,_0x356b25){_0x7fa072=_0x7fa072-0x0;var _0x31297f=_0x23b2[_0x7fa072];return _0x31297f;};'use strict';var multer=require(_0x223b('0x0'));var util=require(_0x223b('0x1'));var path=require(_0x223b('0x2'));var timeout=require(_0x223b('0x3'));var express=require(_0x223b('0x4'));var router=express[_0x223b('0x5')]();var fs_extra=require(_0x223b('0x6'));var auth=require(_0x223b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x223b('0x8'));var controller=require('./chatTransferReport.controller');router[_0x223b('0x9')]('/',auth[_0x223b('0xa')](),controller[_0x223b('0xb')]);router[_0x223b('0x9')](_0x223b('0xc'),auth[_0x223b('0xa')](),controller[_0x223b('0xd')]);router[_0x223b('0x9')]('/:id',auth[_0x223b('0xa')](),controller[_0x223b('0xe')]);router['post']('/',auth[_0x223b('0xa')](),controller[_0x223b('0xf')]);router[_0x223b('0x10')](_0x223b('0x11'),auth[_0x223b('0xa')](),controller[_0x223b('0x12')]);router[_0x223b('0x13')](_0x223b('0x11'),auth['isAuthenticated'](),controller[_0x223b('0x14')]);module[_0x223b('0x15')]=router;
\ No newline at end of file
+var _0x5128=['post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x55c2a2,_0x34fa87){var _0x1ac7e0=function(_0x51decc){while(--_0x51decc){_0x55c2a2['push'](_0x55c2a2['shift']());}};_0x1ac7e0(++_0x34fa87);}(_0x5128,0x16a));var _0x8512=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x5128[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x8512('0x0'));var util=require(_0x8512('0x1'));var path=require(_0x8512('0x2'));var timeout=require(_0x8512('0x3'));var express=require(_0x8512('0x4'));var router=express[_0x8512('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8512('0x6'));var config=require(_0x8512('0x7'));var controller=require(_0x8512('0x8'));router[_0x8512('0x9')]('/',auth['isAuthenticated'](),controller[_0x8512('0xa')]);router['get'](_0x8512('0xb'),auth[_0x8512('0xc')](),controller[_0x8512('0xd')]);router[_0x8512('0x9')](_0x8512('0xe'),auth[_0x8512('0xc')](),controller[_0x8512('0xf')]);router[_0x8512('0x10')]('/',auth[_0x8512('0xc')](),controller[_0x8512('0x11')]);router['put'](_0x8512('0xe'),auth[_0x8512('0xc')](),controller[_0x8512('0x12')]);router[_0x8512('0x13')](_0x8512('0xe'),auth[_0x8512('0xc')](),controller['destroy']);module[_0x8512('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 238f358..d45b42e 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 _0xf109=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','INTEGER','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','Agent'];(function(_0x47df00,_0x2762bc){var _0x6a0587=function(_0x255bd9){while(--_0x255bd9){_0x47df00['push'](_0x47df00['shift']());}};_0x6a0587(++_0x2762bc);}(_0xf109,0xce));var _0x9f10=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xf109[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x9f10('0x0'));var rs=require(_0x9f10('0x1'));module[_0x9f10('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x9f10('0x3')]},'mapKey':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x4')},'key':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x5')},'customerAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f10('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9f10('0x3')]},'animation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9f10('0x9')]('rounded','squared'),'defaultValue':_0x9f10('0xa')},'header_online':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xc')},'offline_chat_button':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xe')},'download_transcript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x12')},'noteTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x16')},'ratingType':{'type':Sequelize[_0x9f10('0x9')](_0x9f10('0x17'),_0x9f10('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':_0x9f10('0x1b'),'variable':null,'config':{'placeholder':_0x9f10('0x1c'),'type':'text','required':!![]},'props':{'title':_0x9f10('0x1c'),'helpText':''}},{'type':_0x9f10('0x1b'),'props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9f10('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x1e'))?JSON['parse'](this[_0x9f10('0x1d')](_0x9f10('0x1e'))):{};},'set':function(_0x11cae7){return this[_0x9f10('0x1f')]('onlineForm',JSON['stringify'](_0x11cae7));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9f10('0x1a')]({'items':[{'type':'input','props':{'title':_0x9f10('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9f10('0x4'),'type':_0x9f10('0x4')},'variable':null},{'type':_0x9f10('0x20'),'config':{'placeholder':_0x9f10('0x21')},'props':{'title':'Comments','helpText':_0x9f10('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x9f10('0x1d')](_0x9f10('0x23'))?JSON[_0x9f10('0x24')](this[_0x9f10('0x1d')](_0x9f10('0x23'))):{};},'set':function(_0x581b1d){return this[_0x9f10('0x1f')](_0x9f10('0x23'),JSON[_0x9f10('0x1a')](_0x581b1d));}},'token':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x25')},'waitingMessage':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x26')},'offlineMessageBody':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9f10('0x29')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9f10('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9f10('0x29')],'defaultValue':function(){return _0x9f10('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2c')},'verticalAlignment':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2d')},'messagesAlignment':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2e')},'defaultTitle':{'type':Sequelize[_0x9f10('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9f10('0x19')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f10('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9f10('0x3')],'defaultValue':_0x9f10('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9f10('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'comment':_0x9f10('0x31'),'set':function(_0x433e70){if(!_0x433e70)this[_0x9f10('0x1f')](_0x9f10('0x32'),null);this[_0x9f10('0x1f')](_0x9f10('0x33'),_0x433e70);}},'vidaooEscalation':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9f10('0x3')]},'vidaooTopic':{'type':Sequelize[_0x9f10('0x3')],'allowNull':![],'defaultValue':_0x9f10('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9f10('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2750=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Send','Feedback','thumb','star','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2750,0x13b));var _0x0275=function(_0x441b96,_0x33388d){_0x441b96=_0x441b96-0x0;var _0x291425=_0x2750[_0x441b96];return _0x291425;};'use strict';var Sequelize=require(_0x0275('0x0'));var rs=require('randomstring');module[_0x0275('0x1')]={'name':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'unique':_0x0275('0x3')},'description':{'type':Sequelize[_0x0275('0x2')]},'mapKey':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'key':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x5')},'customerAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0275('0xa')](_0x0275('0xb'),_0x0275('0xc')),'defaultValue':_0x0275('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0xd')},'start_chat_button':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xf')},'download_transcript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0275('0x11')]},'closingQuestion':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x13')},'noteTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x14')},'skipMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x15')},'ratingType':{'type':Sequelize['ENUM']('star',_0x0275('0x16')),'defaultValue':_0x0275('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0275('0x19'),'type':'text','required':!![]},'props':{'title':_0x0275('0x19'),'helpText':''}},{'type':_0x0275('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':_0x0275('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0275('0x1b')]('onlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x1d'))):{};},'set':function(_0x15813f){return this[_0x0275('0x1e')](_0x0275('0x1d'),JSON['stringify'](_0x15813f));}},'offlineForm':{'type':Sequelize[_0x0275('0x11')],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':_0x0275('0x1a'),'props':{'title':_0x0275('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':'email'},'variable':null},{'type':_0x0275('0x1f'),'config':{'placeholder':_0x0275('0x20')},'props':{'title':_0x0275('0x20'),'helpText':_0x0275('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x0275('0x1b')]('offlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x22'))):{};},'set':function(_0x489d7f){return this['setDataValue'](_0x0275('0x22'),JSON[_0x0275('0x18')](_0x489d7f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0275('0x23')]();}},'autoclose':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0275('0x2')]},'waitingTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0275('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0275('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0275('0x2a');}},'notificationSound':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2d')},'defaultTitle':{'type':Sequelize[_0x0275('0x2')]},'customerAvatar':{'type':Sequelize[_0x0275('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0275('0x8')],'comment':_0x0275('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0275('0x31'),'set':function(_0x76b8fa){if(!_0x76b8fa)this[_0x0275('0x1e')](_0x0275('0x32'),null);this[_0x0275('0x1e')](_0x0275('0x33'),_0x76b8fa);}},'vidaooEscalation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x34')},'vidaooNote':{'type':Sequelize[_0x0275('0x2')],'defaultValue':function(){return _0x0275('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0275('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index afac044..3ab9f27 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 _0x17cd=['index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','params','include','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatWebsites','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','../../config/license/util','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','DESC','ChatApplication','account','applications','Applications','list','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','iftime\x20%s,%s','interval','timezone','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','online','false','offlineForm','onlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','http','client','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','UserProfileResource','stack','name','send'];(function(_0x3ba2fb,_0x5e00d9){var _0x36d161=function(_0x5364d3){while(--_0x5364d3){_0x3ba2fb['push'](_0x3ba2fb['shift']());}};_0x36d161(++_0x5e00d9);}(_0x17cd,0xf9));var _0xd17c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x17cd[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xd17c('0x0'));var Mustache=require(_0xd17c('0x1'));var util=require('util');var path=require(_0xd17c('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd17c('0x3'));var _=require(_0xd17c('0x4'));var querystring=require(_0xd17c('0x5'));var Redis=require(_0xd17c('0x6'));var qs=require(_0xd17c('0x7'));var logger=require(_0xd17c('0x8'))('api');var config=require(_0xd17c('0x9'));var db=require(_0xd17c('0xa'))['db'];config[_0xd17c('0xb')]=_[_0xd17c('0xc')](config['redis'],{'host':_0xd17c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd17c('0xb')]));require(_0xd17c('0xe'))[_0xd17c('0xf')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson['client'][_0xd17c('0x10')]({'port':0x232c});var client9002=jayson[_0xd17c('0x11')][_0xd17c('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xd17c('0x10')]({'port':0x232b});var client9001=jayson[_0xd17c('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x34537c,_0x861413,_0x231719,_0x12c679){return new BPromise(function(_0x181a63,_0x2dd14c){var _0x599635=_0x12c679||client;return _0x599635[_0xd17c('0x12')](_0x34537c,_0x231719)[_0xd17c('0x13')](function(_0x1bf7dc){logger['info'](_0xd17c('0x14'),_0x861413,_0xd17c('0x15'));logger[_0xd17c('0x16')](_0xd17c('0x17'),_0x861413,'request\x20sent',JSON[_0xd17c('0x18')](_0x1bf7dc));if(_0x1bf7dc[_0xd17c('0x19')]){if(_0x1bf7dc[_0xd17c('0x19')][_0xd17c('0x1a')]===0x1f4){logger[_0xd17c('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x861413,_0x1bf7dc[_0xd17c('0x19')][_0xd17c('0x1b')]);return _0x2dd14c(_0x1bf7dc[_0xd17c('0x19')]['message']);}logger[_0xd17c('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x861413,_0x1bf7dc[_0xd17c('0x19')]['message']);return _0x181a63(_0x1bf7dc[_0xd17c('0x19')][_0xd17c('0x1b')]);}else{logger[_0xd17c('0x1c')](_0xd17c('0x14'),_0x861413,'request\x20sent');_0x181a63(_0x1bf7dc[_0xd17c('0x1d')][_0xd17c('0x1b')]);}})[_0xd17c('0x1e')](function(_0x4f565e){logger['error'](_0xd17c('0x14'),_0x861413,_0x4f565e);_0x2dd14c(_0x4f565e);});});}function respondWithStatusCode(_0x5b79b7,_0x20fc07){_0x20fc07=_0x20fc07||0xcc;return function(_0x4b37d8){if(_0x4b37d8){return _0x5b79b7[_0xd17c('0x1f')](_0x20fc07);}return _0x5b79b7['status'](_0x20fc07)[_0xd17c('0x20')]();};}function respondWithResult(_0xdd53ca,_0x67401c){_0x67401c=_0x67401c||0xc8;return function(_0x26f22e){if(_0x26f22e){return _0xdd53ca[_0xd17c('0x21')](_0x67401c)['json'](_0x26f22e);}};}function respondWithFilteredResult(_0x1bde18,_0x52270f){return function(_0x18d73b){if(_0x18d73b){var _0xbb1cb9=typeof _0x52270f[_0xd17c('0x22')]===_0xd17c('0x23')&&typeof _0x52270f[_0xd17c('0x24')]===_0xd17c('0x23');var _0x5f8b=_0x18d73b[_0xd17c('0x25')];var _0x58753c=_0xbb1cb9?0x0:_0x52270f[_0xd17c('0x22')];var _0x46c900=_0xbb1cb9?_0x18d73b['count']:_0x52270f[_0xd17c('0x22')]+_0x52270f[_0xd17c('0x24')];var _0x4cba58;if(_0x46c900>=_0x5f8b){_0x46c900=_0x5f8b;_0x4cba58=0xc8;}else{_0x4cba58=0xce;}_0x1bde18['status'](_0x4cba58);return _0x1bde18[_0xd17c('0x26')](_0xd17c('0x27'),_0x58753c+'-'+_0x46c900+'/'+_0x5f8b)[_0xd17c('0x28')](_0x18d73b);}return null;};}function saveUpdates(_0x135575){return function(_0x5479e8){if(_0x5479e8){return _0x5479e8[_0xd17c('0x29')](_0x135575)[_0xd17c('0x13')](function(_0x367b36){return _0x367b36;});}return null;};}function removeEntity(_0x4f567b){return function(_0x2c5b5f){if(_0x2c5b5f){return _0x2c5b5f[_0xd17c('0x2a')]()[_0xd17c('0x13')](function(){var _0x46ab00=_0x2c5b5f[_0xd17c('0x2b')]({'plain':!![]});var _0x333013='ChatWebsites';return db[_0xd17c('0x2c')]['destroy']({'where':{'type':_0x333013,'resourceId':_0x46ab00['id']}})[_0xd17c('0x13')](function(){return _0x2c5b5f;});})[_0xd17c('0x13')](function(){_0x4f567b[_0xd17c('0x21')](0xcc)[_0xd17c('0x20')]();});}};}function handleEntityNotFound(_0x4f2fe2){return function(_0x2339dd){if(!_0x2339dd){_0x4f2fe2['sendStatus'](0x194);}return _0x2339dd;};}function handleError(_0x366588,_0x27db77){_0x27db77=_0x27db77||0x1f4;return function(_0x47dc74){logger[_0xd17c('0x19')](_0x47dc74[_0xd17c('0x2d')]);if(_0x47dc74[_0xd17c('0x2e')]){delete _0x47dc74[_0xd17c('0x2e')];}_0x366588[_0xd17c('0x21')](_0x27db77)[_0xd17c('0x2f')](_0x47dc74);};}exports[_0xd17c('0x30')]=function(_0x30b419,_0xdbb232){var _0x13d917={'include':[{'model':db[_0xd17c('0x31')],'as':_0xd17c('0x32')}]},_0x5f10d9={},_0x2bc24f={'count':0x0,'rows':[]};var _0x5f1c6d=_[_0xd17c('0x33')](db[_0xd17c('0x34')][_0xd17c('0x35')],function(_0x4b95c7){return{'name':_0x4b95c7[_0xd17c('0x36')],'type':_0x4b95c7[_0xd17c('0x37')]['key']};});_0x5f10d9[_0xd17c('0x38')]=_[_0xd17c('0x33')](_0x5f1c6d,_0xd17c('0x2e'));_0x5f10d9[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x30b419[_0xd17c('0x39')]);_0x5f10d9['filters']=_[_0xd17c('0x3b')](_0x5f10d9[_0xd17c('0x38')],_0x5f10d9[_0xd17c('0x39')]);_0x13d917[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x5f10d9['model'],qs[_0xd17c('0x3d')](_0x30b419[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x13d917[_0xd17c('0x3c')]=_0x13d917[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x13d917[_0xd17c('0x3c')]:_0x5f10d9[_0xd17c('0x38')];if(!_0x30b419[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x13d917['limit']=qs[_0xd17c('0x24')](_0x30b419[_0xd17c('0x39')]['limit']);_0x13d917[_0xd17c('0x22')]=qs['offset'](_0x30b419[_0xd17c('0x39')][_0xd17c('0x22')]);}_0x13d917[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x30b419['query'][_0xd17c('0x42')]);_0x13d917[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_['pick'](_0x30b419['query'],_0x5f10d9[_0xd17c('0x44')]),_0x5f1c6d);if(_0x30b419[_0xd17c('0x39')][_0xd17c('0x45')]){_0x13d917[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x13d917['where'],{'$or':_[_0xd17c('0x33')](_0x5f1c6d,function(_0x14db40){if(_0x14db40[_0xd17c('0x37')]!==_0xd17c('0x47')){var _0x375aec={};_0x375aec[_0x14db40[_0xd17c('0x2e')]]={'$like':'%'+_0x30b419[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x375aec;}})});}_0x13d917=_[_0xd17c('0x46')]({},_0x13d917,_0x30b419[_0xd17c('0x48')]);var _0x50f732={'where':_0x13d917[_0xd17c('0x43')]};return db[_0xd17c('0x34')][_0xd17c('0x25')](_0x50f732)[_0xd17c('0x13')](function(_0x465e93){_0x2bc24f[_0xd17c('0x25')]=_0x465e93;if(_0x30b419[_0xd17c('0x39')][_0xd17c('0x49')]){_0x13d917['include']=[{'all':!![]}];}return db[_0xd17c('0x34')]['findAll'](_0x13d917);})['then'](function(_0x148a78){_0x2bc24f['rows']=_0x148a78;return _0x2bc24f;})[_0xd17c('0x13')](respondWithFilteredResult(_0xdbb232,_0x13d917))[_0xd17c('0x1e')](handleError(_0xdbb232,null));};exports['show']=function(_0x23c786,_0x52d4bd){var _0x75e627={'raw':![],'where':{'id':_0x23c786[_0xd17c('0x4a')]['id']},'include':[{'model':db['Pause'],'as':_0xd17c('0x32')}]},_0x2edd35={};_0x2edd35['model']=_['keys'](db['ChatWebsite'][_0xd17c('0x35')]);_0x2edd35[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x23c786['query']);_0x2edd35[_0xd17c('0x44')]=_['intersection'](_0x2edd35[_0xd17c('0x38')],_0x2edd35[_0xd17c('0x39')]);_0x75e627[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x2edd35['model'],qs[_0xd17c('0x3d')](_0x23c786[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x75e627[_0xd17c('0x3c')]=_0x75e627[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x75e627[_0xd17c('0x3c')]:_0x2edd35[_0xd17c('0x38')];if(_0x23c786['query'][_0xd17c('0x49')]){_0x75e627[_0xd17c('0x4b')]=[{'all':!![]}];}_0x75e627=_[_0xd17c('0x46')]({},_0x75e627,_0x23c786[_0xd17c('0x48')]);return db[_0xd17c('0x34')][_0xd17c('0x4c')](_0x75e627)[_0xd17c('0x13')](handleEntityNotFound(_0x52d4bd,null))[_0xd17c('0x13')](respondWithResult(_0x52d4bd,null))[_0xd17c('0x1e')](handleError(_0x52d4bd,null));};exports['create']=function(_0x1f6d54,_0x2bc363){return db[_0xd17c('0x34')]['create'](_0x1f6d54[_0xd17c('0x4d')],{})[_0xd17c('0x13')](function(_0x428d82){var _0x25de2c=_0x1f6d54['user'][_0xd17c('0x2b')]({'plain':!![]});if(!_0x25de2c)throw new Error(_0xd17c('0x4e'));if(_0x25de2c[_0xd17c('0x4f')]===_0xd17c('0x50')){var _0x30a6a7=_0x428d82[_0xd17c('0x2b')]({'plain':!![]});var _0x2c4d73=_0xd17c('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x2c4d73,'userProfileId':_0x25de2c[_0xd17c('0x52')]},'raw':!![]})[_0xd17c('0x13')](function(_0x514a1a){if(_0x514a1a&&_0x514a1a['autoAssociation']===0x0){return db[_0xd17c('0x2c')][_0xd17c('0x53')]({'name':_0x30a6a7[_0xd17c('0x2e')],'resourceId':_0x30a6a7['id'],'type':_0x514a1a[_0xd17c('0x2e')],'sectionId':_0x514a1a['id']},{})[_0xd17c('0x13')](function(){return _0x428d82;});}else{return _0x428d82;}})['catch'](function(_0x50fd60){logger[_0xd17c('0x19')](_0xd17c('0x54'),_0x50fd60);throw _0x50fd60;});}return _0x428d82;})[_0xd17c('0x13')](respondWithResult(_0x2bc363,0xc9))[_0xd17c('0x1e')](handleError(_0x2bc363,null));};exports['update']=function(_0x1a07b1,_0x411f1d){if(_0x1a07b1['body']['id']){delete _0x1a07b1[_0xd17c('0x4d')]['id'];}return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x1a07b1['params']['id']},'include':[{'model':db[_0xd17c('0x31')],'as':'mandatoryDispositionPause'}]})[_0xd17c('0x13')](handleEntityNotFound(_0x411f1d,null))[_0xd17c('0x13')](saveUpdates(_0x1a07b1['body'],null))[_0xd17c('0x13')](respondWithResult(_0x411f1d,null))[_0xd17c('0x1e')](handleError(_0x411f1d,null));};exports['destroy']=function(_0x95ef88,_0x500654){return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x95ef88['params']['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x500654,null))[_0xd17c('0x13')](removeEntity(_0x500654,null))[_0xd17c('0x1e')](handleError(_0x500654,null));};exports[_0xd17c('0x55')]=function(_0x4daa83,_0x1af564){return db[_0xd17c('0x34')][_0xd17c('0x55')]()[_0xd17c('0x13')](respondWithResult(_0x1af564,null))['catch'](handleError(_0x1af564,null));};exports[_0xd17c('0x56')]=function(_0x3af8cc,_0x101b36){if(_0x3af8cc['body']['id']){delete _0x3af8cc[_0xd17c('0x4d')]['id'];}return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x3af8cc[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x101b36,null))[_0xd17c('0x13')](function(_0x268c5c){if(_0x268c5c){_0x3af8cc[_0xd17c('0x4d')][_0xd17c('0x57')]=_0x268c5c['id'];return db[_0xd17c('0x58')][_0xd17c('0x53')](_0x3af8cc[_0xd17c('0x4d')]);}})[_0xd17c('0x13')](respondWithResult(_0x101b36,null))[_0xd17c('0x1e')](handleError(_0x101b36,null));};exports[_0xd17c('0x59')]=function(_0x637145,_0x5e4550){var _0x51ce2c={'raw':![],'where':{}};var _0x2430d2={};var _0x206a3d={'count':0x0,'rows':[]};return db[_0xd17c('0x34')]['findOne']({'where':{'id':_0x637145[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x5e4550,null))[_0xd17c('0x13')](function(_0x12ef5a){if(_0x12ef5a){_0x2430d2[_0xd17c('0x38')]=_[_0xd17c('0x3a')](db[_0xd17c('0x58')][_0xd17c('0x35')]);_0x2430d2[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x637145[_0xd17c('0x39')]);_0x2430d2[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x2430d2[_0xd17c('0x38')],_0x2430d2[_0xd17c('0x39')]);_0x51ce2c[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x2430d2['model'],qs['fields'](_0x637145[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x51ce2c[_0xd17c('0x3c')]=_0x51ce2c[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x51ce2c[_0xd17c('0x3c')]:_0x2430d2[_0xd17c('0x38')];if(!_0x637145[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x51ce2c[_0xd17c('0x24')]=qs['limit'](_0x637145['query'][_0xd17c('0x24')]);_0x51ce2c[_0xd17c('0x22')]=qs['offset'](_0x637145[_0xd17c('0x39')][_0xd17c('0x22')]);}_0x51ce2c[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x637145['query']['sort']);_0x51ce2c[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0x637145[_0xd17c('0x39')],_0x2430d2[_0xd17c('0x44')]));_0x51ce2c[_0xd17c('0x43')]['ChatWebsiteId']=_0x12ef5a['id'];if(_0x637145[_0xd17c('0x39')][_0xd17c('0x45')]){_0x51ce2c[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x51ce2c[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x51ce2c[_0xd17c('0x3c')],function(_0x316c94){var _0x5e193d={};_0x5e193d[_0x316c94]={'$like':'%'+_0x637145[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x5e193d;})});}_0x51ce2c=_[_0xd17c('0x46')]({},_0x51ce2c,_0x637145[_0xd17c('0x48')]);return db[_0xd17c('0x58')][_0xd17c('0x25')]({'where':_0x51ce2c[_0xd17c('0x43')]})[_0xd17c('0x13')](function(_0x381b13){_0x206a3d[_0xd17c('0x25')]=_0x381b13;if(_0x637145[_0xd17c('0x39')][_0xd17c('0x49')]){_0x51ce2c[_0xd17c('0x4b')]=[{'all':!![]}];}return db[_0xd17c('0x58')][_0xd17c('0x5b')](_0x51ce2c);})['then'](function(_0x3a952c){_0x206a3d[_0xd17c('0x5c')]=_0x3a952c;return _0x206a3d;});}})[_0xd17c('0x13')](respondWithFilteredResult(_0x5e4550,_0x51ce2c))['catch'](handleError(_0x5e4550,null));};exports[_0xd17c('0x5d')]=function(_0x19be6c,_0x3abd5c){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x19be6c['params']['id']}})['then'](handleEntityNotFound(_0x3abd5c,null))[_0xd17c('0x13')](function(_0xc9b314){if(_0xc9b314){return _0xc9b314[_0xd17c('0x5d')](_0x19be6c[_0xd17c('0x39')]['ids']);}})[_0xd17c('0x13')](respondWithStatusCode(_0x3abd5c,null))[_0xd17c('0x1e')](handleError(_0x3abd5c,null));};exports[_0xd17c('0x5e')]=function(_0x5841ce,_0xec7fd5){if(_0x5841ce[_0xd17c('0x4d')]['id']){delete _0x5841ce[_0xd17c('0x4d')]['id'];}return db[_0xd17c('0x34')]['find']({'where':{'id':_0x5841ce['params']['id']}})['then'](handleEntityNotFound(_0xec7fd5,null))[_0xd17c('0x13')](function(_0x59f8ff){if(_0x59f8ff){_0x5841ce[_0xd17c('0x4d')][_0xd17c('0x57')]=_0x59f8ff['id'];return db[_0xd17c('0x5f')][_0xd17c('0x53')](_0x5841ce[_0xd17c('0x4d')]);}})[_0xd17c('0x13')](respondWithResult(_0xec7fd5,null))['catch'](handleError(_0xec7fd5,null));};exports[_0xd17c('0x60')]=function(_0x3dc51d,_0x56f044){var _0x1bf8dc={'raw':![],'where':{}};var _0x444aa4={};var _0x263974={'count':0x0,'rows':[]};return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0x3dc51d[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x56f044,null))[_0xd17c('0x13')](function(_0x17d006){if(_0x17d006){_0x444aa4['model']=_[_0xd17c('0x3a')](db[_0xd17c('0x5f')][_0xd17c('0x35')]);_0x444aa4['query']=_['keys'](_0x3dc51d[_0xd17c('0x39')]);_0x444aa4[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x444aa4[_0xd17c('0x38')],_0x444aa4[_0xd17c('0x39')]);_0x1bf8dc[_0xd17c('0x3c')]=_['intersection'](_0x444aa4[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x1bf8dc['attributes']=_0x1bf8dc['attributes'][_0xd17c('0x3e')]?_0x1bf8dc[_0xd17c('0x3c')]:_0x444aa4[_0xd17c('0x38')];if(!_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x3f')]('nolimit')){_0x1bf8dc[_0xd17c('0x24')]=qs['limit'](_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x24')]);_0x1bf8dc[_0xd17c('0x22')]=qs[_0xd17c('0x22')](_0x3dc51d[_0xd17c('0x39')]['offset']);}_0x1bf8dc['order']=qs[_0xd17c('0x42')](_0x3dc51d['query'][_0xd17c('0x42')]);_0x1bf8dc['where']=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0x3dc51d[_0xd17c('0x39')],_0x444aa4['filters']));_0x1bf8dc[_0xd17c('0x43')][_0xd17c('0x57')]=_0x17d006['id'];if(_0x3dc51d[_0xd17c('0x39')][_0xd17c('0x45')]){_0x1bf8dc[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x1bf8dc[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x1bf8dc['attributes'],function(_0x453d3d){var _0xec75a8={};_0xec75a8[_0x453d3d]={'$like':'%'+_0x3dc51d[_0xd17c('0x39')]['filter']+'%'};return _0xec75a8;})});}_0x1bf8dc=_[_0xd17c('0x46')]({},_0x1bf8dc,_0x3dc51d['options']);return db[_0xd17c('0x5f')][_0xd17c('0x25')]({'where':_0x1bf8dc['where']})['then'](function(_0x278788){_0x263974[_0xd17c('0x25')]=_0x278788;if(_0x3dc51d['query'][_0xd17c('0x49')]){_0x1bf8dc[_0xd17c('0x4b')]=[{'all':!![]}];}return db[_0xd17c('0x5f')][_0xd17c('0x5b')](_0x1bf8dc);})['then'](function(_0x548dbf){_0x263974[_0xd17c('0x5c')]=_0x548dbf;return _0x263974;});}})[_0xd17c('0x13')](respondWithFilteredResult(_0x56f044,_0x1bf8dc))['catch'](handleError(_0x56f044,null));};exports[_0xd17c('0x62')]=function(_0x4287d4,_0x55ee45){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x4287d4[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x55ee45,null))[_0xd17c('0x13')](function(_0x2c7981){if(_0x2c7981){return _0x2c7981[_0xd17c('0x62')](_0x4287d4[_0xd17c('0x39')][_0xd17c('0x63')]);}})[_0xd17c('0x13')](respondWithStatusCode(_0x55ee45,null))[_0xd17c('0x1e')](handleError(_0x55ee45,null));};exports[_0xd17c('0x64')]=function(_0x1ce748,_0x5acde7){_0x1ce748[_0xd17c('0x4d')][_0xd17c('0x65')]=_0x1ce748['file'][_0xd17c('0x66')];return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x1ce748[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x5acde7,null))[_0xd17c('0x13')](saveUpdates(_0x1ce748[_0xd17c('0x4d')],null))['then'](respondWithResult(_0x5acde7,null))['catch'](handleError(_0x5acde7,null));};exports[_0xd17c('0x67')]=function(_0x385471,_0x39613f){_0x385471['body'][_0xd17c('0x68')]=_0x385471[_0xd17c('0x69')][_0xd17c('0x66')];return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x385471[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x39613f,null))[_0xd17c('0x13')](saveUpdates(_0x385471['body'],null))['then'](respondWithResult(_0x39613f,null))['catch'](handleError(_0x39613f,null));};exports[_0xd17c('0x6a')]=function(_0x3a05f1,_0x593e9c){_0x3a05f1['body'][_0xd17c('0x6b')]=_0x3a05f1[_0xd17c('0x69')][_0xd17c('0x66')];return db[_0xd17c('0x34')]['find']({'where':{'id':_0x3a05f1[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x593e9c,null))[_0xd17c('0x13')](saveUpdates(_0x3a05f1[_0xd17c('0x4d')],null))[_0xd17c('0x13')](respondWithResult(_0x593e9c,null))['catch'](handleError(_0x593e9c,null));};exports['addSystemAvatar']=function(_0x2d4932,_0x410ad8){_0x2d4932[_0xd17c('0x4d')][_0xd17c('0x6c')]=_0x2d4932[_0xd17c('0x69')][_0xd17c('0x66')];return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x2d4932[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x410ad8,null))[_0xd17c('0x13')](saveUpdates(_0x2d4932['body'],null))[_0xd17c('0x13')](respondWithResult(_0x410ad8,null))[_0xd17c('0x1e')](handleError(_0x410ad8,null));};exports[_0xd17c('0x6d')]=function(_0x5ebac5,_0x4a3645){var _0x250492=path['join'](config['root'],'server/files/images/logos/default_logo.svg');var _0x362265={'where':{'id':_0x5ebac5[_0xd17c('0x4a')]['id']},'attributes':['id',_0xd17c('0x65')],'raw':!![]};var _0x5ab70f=![];return require(_0xd17c('0x6e'))[_0xd17c('0x6f')]()['then'](function(_0x471938){if(_0x471938){_0x5ab70f=_0x471938[_0xd17c('0x70')];}})['then'](function(){return db[_0xd17c('0x34')][_0xd17c('0x4c')](_0x362265);})[_0xd17c('0x13')](handleEntityNotFound(_0x4a3645,null))['then'](function(_0xe33801){if(_0xe33801){if(!_[_0xd17c('0x71')](_0xe33801[_0xd17c('0x65')])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x75'),_0xe33801[_0xd17c('0x65')]))&&_0x5ab70f){_0x250492=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x75'),_0xe33801[_0xd17c('0x65')]);}}return _0x4a3645['download'](_0x250492);}})[_0xd17c('0x1e')](handleError(_0x4a3645,null));};exports[_0xd17c('0x76')]=function(_0xa7aef7,_0x1053ef){var _0x1902f7=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x77'));var _0xf53fd1={'where':{'id':_0xa7aef7['params']['id']},'attributes':['id',_0xd17c('0x68')],'raw':!![]};return db['ChatWebsite'][_0xd17c('0x4c')](_0xf53fd1)[_0xd17c('0x13')](handleEntityNotFound(_0x1053ef,null))['then'](function(_0x2a36df){if(_0x2a36df){if(!_[_0xd17c('0x71')](_0x2a36df['agentAvatar'])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config['root'],'server/files/images/avatars/',_0x2a36df['agentAvatar']))){_0x1902f7=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x78'),_0x2a36df[_0xd17c('0x68')]);}}return _0x1053ef['download'](_0x1902f7);}})[_0xd17c('0x1e')](handleError(_0x1053ef,null));};exports['getCustomerAvatar']=function(_0x846a37,_0x45fa23){var _0x322690=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x79'));var _0x51228d={'where':{'id':_0x846a37['params']['id']},'attributes':['id',_0xd17c('0x6b'),_0xd17c('0x7a')],'raw':!![]};return db[_0xd17c('0x34')][_0xd17c('0x4c')](_0x51228d)['then'](handleEntityNotFound(_0x45fa23,null))[_0xd17c('0x13')](function(_0x3402a6){if(_0x3402a6){if(!_[_0xd17c('0x71')](_0x3402a6[_0xd17c('0x6b')])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],'server/files/images/avatars/',_0x3402a6[_0xd17c('0x6b')]))&&_0x3402a6[_0xd17c('0x7a')]){_0x322690=path[_0xd17c('0x73')](config[_0xd17c('0x74')],'server/files/images/avatars/',_0x3402a6['customerAvatar']);}}return _0x45fa23[_0xd17c('0x7b')](_0x322690);}})['catch'](handleError(_0x45fa23,null));};exports[_0xd17c('0x7c')]=function(_0x29db72,_0x3fc1fd){var _0x1109aa=path['join'](config[_0xd17c('0x74')],_0xd17c('0x7d'));var _0x5448f2={'where':{'id':_0x29db72['params']['id']},'attributes':['id',_0xd17c('0x6c')],'raw':!![]};return db[_0xd17c('0x34')]['find'](_0x5448f2)[_0xd17c('0x13')](handleEntityNotFound(_0x3fc1fd,null))['then'](function(_0x353852){if(_0x353852){if(!_[_0xd17c('0x71')](_0x353852[_0xd17c('0x6c')])){if(fs[_0xd17c('0x72')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x78'),_0x353852[_0xd17c('0x6c')]))){_0x1109aa=path['join'](config[_0xd17c('0x74')],_0xd17c('0x78'),_0x353852[_0xd17c('0x6c')]);}}return _0x3fc1fd[_0xd17c('0x7b')](_0x1109aa);}})[_0xd17c('0x1e')](handleError(_0x3fc1fd,null));};exports[_0xd17c('0x7e')]=function(_0xb3dbd7,_0x403575){var _0x34a19c=require(_0xd17c('0x7f'));var _0x50e083=new _0x34a19c();var _0x1625ba=_0x50e083['setUA'](_0xb3dbd7[_0xd17c('0x80')]['user-agent'])[_0xd17c('0x81')]();var _0x5c106c={'body':_0xb3dbd7['body'],'channel':_0xd17c('0x82')};var _0x717316=[];var _0x1c251e=[];var _0x1123d7={};var _0x2664a1=![];return db['CmContact'][_0xd17c('0x55')]()[_0xd17c('0x13')](function(_0x2b531d){if(!_0x2b531d){throw new db['Sequelize'][(_0xd17c('0x83'))](_0xd17c('0x84'));}_0x717316=_[_0xd17c('0x85')](_[_0xd17c('0x3a')](_0x2b531d),[_0xd17c('0x86'),_0xd17c('0x87')]);_0x1c251e=_[_0xd17c('0x85')](_[_0xd17c('0x3a')](_0x2b531d),[_0xd17c('0x86'),_0xd17c('0x87'),_0xd17c('0x88'),_0xd17c('0x89')]);if(_0xb3dbd7[_0xd17c('0x4d')]['id']){delete _0xb3dbd7['body']['id'];}if(_[_0xd17c('0x71')](_0xb3dbd7[_0xd17c('0x4d')]['from'])){throw new db['Sequelize']['ValidationError'](_0xd17c('0x8a'));}if(_['isNil'](_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x4d')])||_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x4d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd17c('0x71')](_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x8b')])){throw new db['Sequelize'][(_0xd17c('0x83'))](_0xd17c('0x8c')+_0x1c251e);}if(!_[_0xd17c('0x8d')](_0x1c251e,_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x8b')])){throw new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))](_0xd17c('0x8f')+_0x1c251e);}_0x1123d7[_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x8b')]]=_0xb3dbd7['body'][_0xd17c('0x90')];})[_0xd17c('0x13')](function(){return db[_0xd17c('0x34')]['find']({'where':{'id':_0xb3dbd7[_0xd17c('0x4a')]['id']},'include':[{'model':db[_0xd17c('0x91')],'as':_0xd17c('0x92'),'include':[{'model':db[_0xd17c('0x93')],'as':'Contacts','where':_0x1123d7,'limit':0x1,'order':[[_0xd17c('0x87'),_0xd17c('0x94')]]}]},{'model':db[_0xd17c('0x95')],'as':'Applications'}]});})[_0xd17c('0x13')](handleEntityNotFound(_0x403575,null))[_0xd17c('0x13')](function(_0x4fbe2c){if(_0x4fbe2c&&_0x4fbe2c[_0xd17c('0x92')]){_0x5c106c[_0xd17c('0x96')]=_0x4fbe2c;_0x5c106c[_0xd17c('0x97')]=_0x4fbe2c[_0xd17c('0x98')];_0x5c106c[_0xd17c('0x99')]=_0x4fbe2c[_0xd17c('0x92')];_0x5c106c[_0xd17c('0x97')]=_['orderBy'](_0x5c106c[_0xd17c('0x97')],[_0xd17c('0x9a')],[_0xd17c('0x9b')]);if(_0x5c106c[_0xd17c('0x96')][_0xd17c('0x98')]){delete _0x5c106c[_0xd17c('0x96')]['Applications'];}if(_0x5c106c[_0xd17c('0x96')][_0xd17c('0x92')]&&_0x5c106c[_0xd17c('0x96')][_0xd17c('0x92')][_0xd17c('0x9c')][_0xd17c('0x3e')]){return _0x5c106c[_0xd17c('0x96')][_0xd17c('0x92')][_0xd17c('0x9c')][0x0];}var _0x3b0726=_[_0xd17c('0xc')](_0xb3dbd7['body'],{'firstName':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x90')],'ListId':_0x4fbe2c[_0xd17c('0x89')]});_0x3b0726[_0xb3dbd7[_0xd17c('0x4d')]['mapKey']]=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x90')];return db['CmContact'][_0xd17c('0x53')](_0x3b0726,{'fields':_0x717316,'raw':!![]});}})[_0xd17c('0x13')](handleEntityNotFound(_0x403575,null))[_0xd17c('0x13')](function(_0x55dc63){_0x5c106c[_0xd17c('0x9d')]=_0x55dc63;var _0x1d62d3=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x9e')];if(_0xb3dbd7['headers'][_0xd17c('0x9f')]){_0x1d62d3=_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0x9f')];}else if(_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa0')]){_0x1d62d3=_[_0xd17c('0xa1')](_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa0')][_0xd17c('0xa2')](','));}if(_0x55dc63){var _0x31f137={'ContactId':_0x55dc63['id'],'ChatWebsiteId':_0xb3dbd7[_0xd17c('0x4a')]['id'],'from':(_0x55dc63[_0xd17c('0xa3')]||'')+'\x20'+(_0x55dc63[_0xd17c('0xa4')]||''),'customerIp':_0x1d62d3,'customerPort':_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa5')]?_0xb3dbd7[_0xd17c('0x80')][_0xd17c('0xa5')]:null,'referer':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xa6')],'browserName':_0x1625ba[_0xd17c('0xa7')][_0xd17c('0x2e')]&&_0x1625ba[_0xd17c('0xa7')][_0xd17c('0xa8')]?util[_0xd17c('0xa9')](_0xd17c('0xaa'),_0x1625ba[_0xd17c('0xa7')][_0xd17c('0x2e')],_0x1625ba['browser'][_0xd17c('0xa8')]):'unknown','browserVersion':_0x1625ba[_0xd17c('0xa7')][_0xd17c('0xa8')]||_0xd17c('0xab'),'osName':util[_0xd17c('0xa9')](_0xd17c('0xaa'),_0x1625ba['os'][_0xd17c('0x2e')],_0x1625ba['os'][_0xd17c('0xa8')]),'osVersion':_0x1625ba['os'][_0xd17c('0xa8')],'deviceModel':_0x1625ba[_0xd17c('0xac')][_0xd17c('0x38')]&&_0x1625ba['device'][_0xd17c('0xad')]?util[_0xd17c('0xa9')](_0xd17c('0xae'),_0x1625ba['device']['model'],_0x1625ba[_0xd17c('0xac')]['vendor'],_0x1625ba[_0xd17c('0xac')]['type']):null,'deviceVendor':_0x1625ba[_0xd17c('0xac')]['vendor'],'deviceType':_0x1625ba[_0xd17c('0xac')]['type'],'formData':JSON[_0xd17c('0x18')](_0xb3dbd7[_0xd17c('0x4d')])};var _0x2e3b54={'ChatWebsiteId':_0xb3dbd7['params']['id'],'closed':![]};if(_0xb3dbd7['body'][_0xd17c('0xaf')]){_0x2e3b54[_0xd17c('0xaf')]=_0xb3dbd7['body']['threadId'];return db[_0xd17c('0xb0')]['find']({'where':_0x2e3b54})[_0xd17c('0x13')](function(_0x1b27e7){if(_0x1b27e7){return[_0x1b27e7,![]];}_0x31f137[_0xd17c('0xaf')]=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xaf')];_0x31f137[_0xd17c('0xb1')]=_0xb3dbd7['body'][_0xd17c('0xb1')];return db[_0xd17c('0xb0')][_0xd17c('0x53')](_0x31f137)[_0xd17c('0x13')](function(_0xccf14e){return[_0xccf14e,!![]];});});}_0x2e3b54['ContactId']=_0x55dc63['id'];if(_0xb3dbd7['body'][_0xd17c('0xb2')]&&_0xb3dbd7['body'][_0xd17c('0xb2')]['id']){_0x2e3b54['id']=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xb2')]['id'];return db[_0xd17c('0xb0')][_0xd17c('0x4c')]({'where':_0x2e3b54})[_0xd17c('0x13')](function(_0x6bbc0a){if(_0x6bbc0a){return[_0x6bbc0a,![]];}return db[_0xd17c('0xb0')][_0xd17c('0x53')](_0x31f137)[_0xd17c('0x13')](function(_0x276299){return[_0x276299,!![]];});});}return db[_0xd17c('0xb0')][_0xd17c('0x53')](_0x31f137)['then'](function(_0x49039e){return[_0x49039e,!![]];});}})[_0xd17c('0xb3')](function(_0x559704,_0x321b17){if(_0x559704){_0x2664a1=_0x321b17;if(!_0x321b17){var _0x14b476={'from':(_0x5c106c[_0xd17c('0x9d')]['firstName']||'')+'\x20'+(_0x5c106c[_0xd17c('0x9d')][_0xd17c('0xa4')]||'')};if(_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xaf')]&&_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xb4')]&&_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xaf')]!=_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xb4')]){_0x14b476[_0xd17c('0xaf')]=_0xb3dbd7['body'][_0xd17c('0xb4')];}return _0x559704['update'](_0x14b476);}else{return _0x559704;}}})['then'](function(_0x1143ba){_0x5c106c[_0xd17c('0xb2')]=_0x1143ba[_0xd17c('0x2b')]({'plain':!![]});_0x5c106c[_0xd17c('0xb2')][_0xd17c('0xb5')]=_0x2664a1;if(_0x5c106c[_0xd17c('0xb2')][_0xd17c('0xb5')]){if(_0x5c106c[_0xd17c('0x96')][_0xd17c('0xb6')]){_0x5c106c['applications'][_0xd17c('0xb7')]({'id':0x0,'priority':_0x5c106c[_0xd17c('0x97')][_0xd17c('0x3e')]+0x1,'app':_0xd17c('0xb8'),'appdata':_0xd17c('0xb9'),'interval':_0xd17c('0xba')});}}return db[_0xd17c('0xbb')][_0xd17c('0x53')]({'body':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0x4d')],'ChatWebsiteId':_0xb3dbd7[_0xd17c('0x4a')]['id'],'ChatInteractionId':_0x1143ba['id'],'direction':'in','ContactId':_0x5c106c[_0xd17c('0x9d')]['id'],'AttachmentId':_0xb3dbd7[_0xd17c('0x4d')][_0xd17c('0xbc')]});})[_0xd17c('0x13')](function(_0x325824){_0x5c106c[_0xd17c('0x1b')]=_0x325824;if(_0x5c106c[_0xd17c('0xb2')][_0xd17c('0xbd')]){return db[_0xd17c('0xbe')][_0xd17c('0x4c')]({'attributes':['id',_0xd17c('0x2e')],'where':{'id':_0x5c106c['interaction'][_0xd17c('0xbd')]}})['then'](function(_0x53587d){if(_0x53587d){_0x5c106c[_0xd17c('0x97')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd17c('0xbf'),'appdata':_0x53587d[_0xd17c('0x2e')]+','+(_0x5c106c[_0xd17c('0x96')][_0xd17c('0xc0')]||0xa),'interval':_0xd17c('0xba')});_0x5c106c['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xd17c('0xc1'),_0x5c106c);});}return respondWithRpcPromise(_0xd17c('0xc2'),_0xd17c('0xc1'),_0x5c106c);})[_0xd17c('0x13')](function(_0x4c5d23){respondWithRpcPromise(_0xd17c('0xc3'),_0xd17c('0xc3'),{'event':_0xd17c('0x7e'),'message':_0x4c5d23},client9002);return _0x4c5d23;})[_0xd17c('0x13')](respondWithResult(_0x403575,null))[_0xd17c('0x1e')](handleError(_0x403575,null));};exports[_0xd17c('0xc4')]=function(_0x54f92a,_0x594048){var _0x21ed6a,_0x35c8fa,_0x3433dd;var _0x521368=[];var _0x4bcb4b={};var _0x350d3a=_0x54f92a[_0xd17c('0xc5')]||[];var _0x3f2cb8=[];var _0x1e5967;return db[_0xd17c('0x93')][_0xd17c('0x55')]()[_0xd17c('0x13')](function(_0x309afd){if(!_0x309afd){throw new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))]('no\x20available\x20attributes');}_0x521368=_['difference'](_[_0xd17c('0x3a')](_0x309afd),[_0xd17c('0x86'),_0xd17c('0x87'),_0xd17c('0x88'),_0xd17c('0x89')]);if(_0x54f92a[_0xd17c('0x4d')]['id']){delete _0x54f92a['body']['id'];}if(_[_0xd17c('0x71')](_0x54f92a[_0xd17c('0x4d')]['from'])){throw _0x594048[_0xd17c('0x21')](0x1f4)['send'](new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))](_0xd17c('0x8a')));}if(_[_0xd17c('0x71')](_0x54f92a[_0xd17c('0x4d')]['body'])||_0x54f92a[_0xd17c('0x4d')][_0xd17c('0x4d')]===''){throw _0x594048[_0xd17c('0x21')](0x1f4)[_0xd17c('0x2f')](new db['Sequelize']['ValidationError'](_0xd17c('0xc6')));}if(_['isNil'](_0x54f92a[_0xd17c('0x4d')][_0xd17c('0xc7')])){throw _0x594048[_0xd17c('0x21')](0x1f4)[_0xd17c('0x2f')](new db[(_0xd17c('0x8e'))][(_0xd17c('0x83'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x521368));}if(!_['includes'](_0x521368,_0x54f92a['body'][_0xd17c('0xc7')])){throw _0x594048[_0xd17c('0x21')](0x1f4)[_0xd17c('0x2f')](new db[(_0xd17c('0x8e'))]['ValidationError'](_0xd17c('0xc8')+_0x521368));}_0x4bcb4b[_0x54f92a[_0xd17c('0x4d')][_0xd17c('0xc7')]]=_0x54f92a[_0xd17c('0x4d')][_0xd17c('0x90')];})[_0xd17c('0x13')](function(){return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'where':{'id':_0x54f92a[_0xd17c('0x4a')]['id']},'include':[{'model':db[_0xd17c('0x91')],'as':_0xd17c('0x92')},{'model':db[_0xd17c('0xc9')],'as':_0xd17c('0xc9')}]});})[_0xd17c('0x13')](handleEntityNotFound(_0x594048,null))[_0xd17c('0x13')](function(_0x4015e1){if(_0x4015e1&&_0x4015e1[_0xd17c('0x92')]){_0x35c8fa=_0x4015e1;var _0x16484c=_['defaults'](_0x54f92a['body'],{'firstName':_0x54f92a[_0xd17c('0x4d')]['from'],'phone':_0x54f92a[_0xd17c('0x4d')][_0xd17c('0x90')],'ListId':_0x4015e1[_0xd17c('0x89')]});_0x16484c[_0x54f92a[_0xd17c('0x4d')][_0xd17c('0xc7')]]=_0x54f92a['body']['from'];return db[_0xd17c('0x93')][_0xd17c('0xca')]({'where':_0x4bcb4b,'defaults':_0x16484c});}})[_0xd17c('0xb3')](function(_0x44bf05){if(_0x44bf05){_0x3433dd=_0x44bf05;var _0x50017f=fs[_0xd17c('0xcb')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0xcc')),_0xd17c('0xcd'));var _0x39a34b=ejs[_0xd17c('0xce')](_0x50017f,{'body':_[_0xd17c('0xcf')](_0x54f92a[_0xd17c('0x4d')]['body']),'bodyTitle':_0x35c8fa[_0xd17c('0xd0')]});return db[_0xd17c('0xd1')][_0xd17c('0x53')]({'body':_0x39a34b,'plainBody':htmlToText[_0xd17c('0xd2')](_0x39a34b),'ContactId':_0x44bf05['id'],'ChatWebsiteId':_0x35c8fa['id']});}})[_0xd17c('0x13')](function(_0x4fbb60){_0x1e5967=_0x4fbb60;if(_0x350d3a[_0xd17c('0x3e')]){var _0x52d0d5=_0x350d3a[_0xd17c('0x33')](function(_0x42bdf3){return{'name':_0x42bdf3[_0xd17c('0xd3')],'basename':_0x42bdf3[_0xd17c('0x66')],'type':_0x42bdf3[_0xd17c('0xd4')],'ChatOfflineMessageId':_0x4fbb60['id']};});_0x3f2cb8=_0x52d0d5[_0xd17c('0x33')](_0x478072=>{var _0x3e3a06={'filename':_0x478072[_0xd17c('0x2e')],'path':path['join'](config['root'],_0xd17c('0xd5'),_0xd17c('0xc5'),_0xd17c('0xd6'),_0xd17c('0xd7'),_0x478072[_0xd17c('0xd8')])};return _0x3e3a06;});if(!_0x35c8fa['openNewInteraction']){return db[_0xd17c('0xd9')][_0xd17c('0xda')](function(_0x7c0cb){return db['Attachment'][_0xd17c('0xdb')](_0x52d0d5,{'transaction':_0x7c0cb});});}}})[_0xd17c('0x13')](function(){if(_0x1e5967){_0x21ed6a=_0x1e5967;return db[_0xd17c('0xc9')][_0xd17c('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0xd17c('0xdc')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x37b5db){if(_0x37b5db&&_0x37b5db[_0xd17c('0xdd')]&&_0x35c8fa['forwardOffline']&&_0x35c8fa[_0xd17c('0xde')]){var _0x4c367b=_0x37b5db['getSmtpOptions']();return respondWithRpcPromise(_0xd17c('0xdf'),_0xd17c('0xe0'),{'account':_0x4c367b,'message':{'from':util[_0xd17c('0xa9')](_0xd17c('0xe1'),_0x37b5db['name'],_0x37b5db[_0xd17c('0xe2')]||_0x37b5db[_0xd17c('0xdd')]['user']),'to':_0x35c8fa[_0xd17c('0xde')],'subject':_0x35c8fa[_0xd17c('0xe3')],'html':_0x21ed6a[_0xd17c('0x4d')],'attachments':_0x3f2cb8}},client9003)[_0xd17c('0x13')](function(){return _0x21ed6a;})['catch'](function(_0x1ad7b8){logger['error'](_0x1ad7b8);});}})[_0xd17c('0x13')](function(){if(_0x35c8fa&&_0x35c8fa['openNewInteraction']&&_0x35c8fa[_0xd17c('0xe4')]){var _0x4fcee5=[];if(_0x350d3a[_0xd17c('0x3e')]){_0x4fcee5=_0x350d3a[_0xd17c('0x33')](function(_0x3dac57){return{'name':_0x3dac57[_0xd17c('0xd3')],'basename':_0x3dac57[_0xd17c('0x66')],'type':_0x3dac57[_0xd17c('0xd4')],'ChatOfflineMessageId':_0x1e5967['id']};});}var _0x52bfe3;if(!_[_0xd17c('0x71')](_0x35c8fa[_0xd17c('0xe5')])){var _0x286691=_[_0xd17c('0x33')](_0x54f92a[_0xd17c('0x4d')],function(_0x400ea0){return _0x400ea0;});var _0x26ba94=_[_0xd17c('0xe6')](_0x286691)[0x0];var _0x36c6e4=_[_0xd17c('0xe7')](_0x26ba94,function(_0x4c3e0c){return _0x4c3e0c;});_0x52bfe3=_0x36c6e4[0x1][_0x35c8fa[_0xd17c('0xe5')]];}var _0x3a655e={'from':_0x3433dd['email'],'firstName':_0x3433dd[_0xd17c('0xa3')],'lastName':_0x3433dd[_0xd17c('0xa4')],'mapKey':_0xd17c('0xe2'),'message':{'from':_0x3433dd[_0xd17c('0xe2')],'to':_0x35c8fa['MailAccount'][_0xd17c('0xe2')],'cc':'','subject':_[_0xd17c('0x71')](_0x52bfe3)?_0x35c8fa[_0xd17c('0xe3')]:_0x52bfe3,'messageId':'','sentAt':new Date(),'attach':_0x4fcee5[_0xd17c('0x3e')],'attachments':_0x4fcee5,'originChannel':'Chat','ChatWebsiteId':_0x35c8fa['id'],'ChatOfflineMessageId':_0x21ed6a['id'],'originTo':_0x35c8fa[_0xd17c('0xc9')][_0xd17c('0xe2')]},'body':_0x21ed6a['body']};var _0x5a9611={'account':{'id':_0x35c8fa[_0xd17c('0xe4')]},'body':_0x3a655e,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xd17c('0xe8'),_0xd17c('0xe9'),_0x5a9611,client9001)[_0xd17c('0x13')](function(){return _0x21ed6a;})[_0xd17c('0x1e')](function(_0x378052){logger[_0xd17c('0x19')](_0x378052);});}return;})[_0xd17c('0x13')](function(){if(_0x21ed6a){return _0x21ed6a;}})[_0xd17c('0x13')](respondWithResult(_0x594048,null))[_0xd17c('0x1e')](function(_0x31dfb4){logger[_0xd17c('0x19')](_0xd17c('0x1e'),_0x31dfb4);for(var _0x39346e of _0x350d3a){var _0xfc85e0=path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0xd5'),_0xd17c('0xc5'),'attachments','offline-chat',_0x39346e['filename']);fs_extra[_0xd17c('0xea')](_0xfc85e0)[_0xd17c('0x1e')](function(_0x1c91e7){logger[_0xd17c('0x19')](_0xd17c('0xeb'),_0xfc85e0,_0x1c91e7);});}});};exports[_0xd17c('0xec')]=function(_0x1fafb7,_0x27b3ec){return db[_0xd17c('0xb0')][_0xd17c('0x4c')]({'where':{'id':_0x1fafb7[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x27b3ec,null))[_0xd17c('0x13')](function(_0x2a32cd){if(_0x2a32cd){return _0x2a32cd[_0xd17c('0xec')](_0x1fafb7['body'][_0xd17c('0x63')],_[_0xd17c('0xed')](_0x1fafb7[_0xd17c('0x4d')],[_0xd17c('0x63'),'id'])||{});}})['then'](respondWithResult(_0x27b3ec,null))['catch'](handleError(_0x27b3ec,null));};exports[_0xd17c('0xee')]=function(_0x32d8f1,_0x141cad){var _0x183e53={'raw':![],'where':{}};var _0x226e84={};var _0x76e181={'count':0x0,'rows':[]};return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0x32d8f1[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x141cad,null))[_0xd17c('0x13')](function(_0x50566b){if(_0x50566b){_0x226e84['model']=_[_0xd17c('0x3a')](db[_0xd17c('0xb0')][_0xd17c('0x35')]);_0x226e84[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x32d8f1[_0xd17c('0x39')]);_0x226e84[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x226e84['model'],_0x226e84['query']);_0x183e53[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x226e84[_0xd17c('0x38')],qs['fields'](_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x183e53[_0xd17c('0x3c')]=_0x183e53[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x183e53[_0xd17c('0x3c')]:_0x226e84[_0xd17c('0x38')];if(!_0x32d8f1['query'][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x183e53[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0x32d8f1[_0xd17c('0x39')]['limit']);_0x183e53['offset']=qs[_0xd17c('0x22')](_0x32d8f1['query']['offset']);}_0x183e53[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x32d8f1[_0xd17c('0x39')]['sort']);_0x183e53[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_['pick'](_0x32d8f1[_0xd17c('0x39')],_0x226e84[_0xd17c('0x44')]));_0x183e53[_0xd17c('0x43')][_0xd17c('0x57')]=_0x50566b['id'];if(_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x45')]){_0x183e53[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x183e53[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x183e53[_0xd17c('0x3c')],function(_0x22b3be){var _0x5ee1d4={};_0x5ee1d4[_0x22b3be]={'$like':'%'+_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x5ee1d4;})});}_0x183e53=_[_0xd17c('0x46')]({},_0x183e53,_0x32d8f1[_0xd17c('0x48')]);return db[_0xd17c('0xb0')][_0xd17c('0x25')]({'where':_0x183e53[_0xd17c('0x43')]})[_0xd17c('0x13')](function(_0x5104c5){_0x76e181['count']=_0x5104c5;if(_0x32d8f1[_0xd17c('0x39')][_0xd17c('0x49')]){_0x183e53['include']=[{'model':db['CmContact'],'as':_0xd17c('0xef'),'required':![]},{'model':db[_0xd17c('0xbe')],'as':_0xd17c('0xf0'),'attributes':[_0xd17c('0x2e'),_0xd17c('0xf1'),_0xd17c('0xf2')],'required':![]},{'model':db['Tag'],'as':_0xd17c('0xf3'),'attributes':['id',_0xd17c('0x2e'),_0xd17c('0xf4')],'where':_0x32d8f1[_0xd17c('0x39')]['tag']?{'id':_0x32d8f1[_0xd17c('0x39')]['tag']}:undefined,'required':_0x32d8f1[_0xd17c('0x39')][_0xd17c('0xf5')]?!![]:![]}];}return db['ChatInteraction'][_0xd17c('0x5b')](_0x183e53);})['then'](function(_0x2241ce){_0x76e181[_0xd17c('0x5c')]=_0x2241ce;return _0x76e181;});}})[_0xd17c('0x13')](respondWithFilteredResult(_0x141cad,_0x183e53))['catch'](handleError(_0x141cad,null));};function iftimePromise(_0x3c5d61,_0x1293de){return respondWithRpcPromise('Command',_0xd17c('0xf6'),{'command':_0x1293de['timezone']?util[_0xd17c('0xa9')](_0xd17c('0xf7'),_0x3c5d61[_0xd17c('0xf8')],_0x1293de[_0xd17c('0xf9')]):util[_0xd17c('0xa9')]('iftime\x20%s',_0x3c5d61[_0xd17c('0xf8')])},client9002)[_0xd17c('0x13')](function(_0x254f4f){var _0x4323c6=_0x254f4f&&_0x254f4f[_0xd17c('0xfa')](_0xd17c('0xfb'))>=0x0?!![]:![];logger['info'](_0xd17c('0xfc'),_0x1293de['id'],_0x3c5d61['id'],_0x3c5d61[_0xd17c('0xf8')],_0x4323c6?_0xd17c('0xfd'):_0xd17c('0xfe'),_0x1293de['timezone']?_0x1293de[_0xd17c('0xf9')]:_0xd17c('0xff'));return _0x4323c6;})[_0xd17c('0x1e')](function(_0x4b7605){logger['error'](_0xd17c('0xfc'),_0x1293de['id'],_0x3c5d61['id'],_0x3c5d61[_0xd17c('0xf8')],util[_0xd17c('0x100')](_0x4b7605,{'showHidden':![],'depth':null}),_0x1293de[_0xd17c('0xf9')]?_0x1293de[_0xd17c('0xf9')]:_0xd17c('0xff'));return![];});}exports['getSnippet']=function(_0x121356,_0x4d690a){var _0x31d7f8=0x0;var _0x33eae5=0x0;var _0x5b40eb=![];var _0x45d06e;var _0x2e2a4a;return db['ChatWebsite'][_0xd17c('0x4c')]({'where':{'id':_0x121356[_0xd17c('0x4a')]['id']},'include':[{'model':db[_0xd17c('0x101')],'as':_0xd17c('0x101'),'include':[{'model':db[_0xd17c('0x101')],'as':_0xd17c('0x102'),'attributes':['id',_0xd17c('0xf8')],'raw':!![]}]}]})[_0xd17c('0x13')](handleEntityNotFound(_0x4d690a,null))['then'](function(_0x14562d){if(_0x14562d){_0x45d06e=_0x14562d;return _0x14562d['getProactiveActions']({'raw':!![]});}})[_0xd17c('0x13')](function(_0x162868){if(_0x45d06e){if(_0x162868){_0x2e2a4a=_0x162868;}}return require(_0xd17c('0x6e'))[_0xd17c('0x6f')]();})['then'](function(_0x27dc69){if(_0x27dc69){_0x33eae5=_0x27dc69[_0xd17c('0x103')];_0x5b40eb=_0x27dc69[_0xd17c('0x70')];}})['then'](function(){return db[_0xd17c('0xb0')][_0xd17c('0x25')]({'where':{'closed':![]}});})[_0xd17c('0x13')](function(_0x51c32a){_0x31d7f8=_0x51c32a;if(_0x33eae5&&_0x51c32a>_0x33eae5){return db[_0xd17c('0x104')]['findOne']({'where':{'id':0x1}})['then'](function(_0x2fa77f){if(_0x2fa77f){_0x2fa77f['increment'](_0xd17c('0x105'));}});}})['then'](function(){if(_0x45d06e[_0xd17c('0x101')]&&_0x45d06e[_0xd17c('0x101')][_0xd17c('0x102')]){var _0x3cc24a=[];for(var _0x200e95=0x0;_0x200e95<_0x45d06e['Interval'][_0xd17c('0x102')][_0xd17c('0x3e')];_0x200e95++){var _0xa13a9d=_0x45d06e[_0xd17c('0x101')]['Intervals'][_0x200e95][_0xd17c('0x2b')]({'plain':!![]});_0x3cc24a[_0xd17c('0xb7')](iftimePromise(_0xa13a9d,_0x45d06e));}return BPromise['all'](_0x3cc24a)['then'](function(_0x16c690){return _[_0xd17c('0x106')](_0x16c690);});}else{return!![];}})[_0xd17c('0x13')](function(_0x50e844){var _0x371ccc=fs[_0xd17c('0xcb')](path[_0xd17c('0x73')](config[_0xd17c('0x74')],_0xd17c('0x107')),'utf8');var _0x41c27a={'remote':_0x45d06e[_0xd17c('0x108')],'query':querystring[_0xd17c('0x18')](_[_0xd17c('0x46')](_0x45d06e[_0xd17c('0x2b')]({'plain':!![]}),{'customerIp':_0x121356[_0xd17c('0x80')][_0xd17c('0xa0')]||_0x121356['headers']['x-real-ip']||_0x121356[_0xd17c('0x109')][_0xd17c('0x10a')]||_0x121356['ip'],'referer':_0x121356[_0xd17c('0x80')][_0xd17c('0xa6')],'openedInteractions':_0x31d7f8,'maxInteractions':_0x33eae5,'virtual':_0x5b40eb[_0xd17c('0x103')],'online':_0x50e844,'custom':_0x5b40eb}))['replace'](/'/g,'\x5c\x27')};_0x4d690a['send'](ejs[_0xd17c('0xce')](Mustache['render'](_0x371ccc,_0x41c27a),{'proactiveActions':_0x2e2a4a,'alignment':_0x45d06e[_0xd17c('0x10b')],'verticalAlignment':_0x45d06e[_0xd17c('0x10c')],'div_color':_0x45d06e[_0xd17c('0xf4')],'labelText':_0x45d06e[_0xd17c('0x10d')],'text_color':_0x45d06e[_0xd17c('0x10e')],'text_button_color':_0x45d06e[_0xd17c('0x10f')],'button_color':_0x45d06e[_0xd17c('0x110')],'background_color':_0x45d06e['backgroundColor'],'hideWhenOffline':_0x45d06e[_0xd17c('0x111')],'interval':_0x45d06e[_0xd17c('0x112')]}));})[_0xd17c('0x1e')](handleError(_0x4d690a,null));};exports[_0xd17c('0x113')]=function(_0x3ba4ec,_0x4367c9){var _0x2d939e=_0x3ba4ec[_0xd17c('0x4a')]['id'];var _0x1a1217=_0x3ba4ec[_0xd17c('0x4d')];var _0x13cbcb=0xc8;var _0x4dc3c4=null;return db[_0xd17c('0xd9')][_0xd17c('0xda')]({'isolationLevel':db['sequelize'][_0xd17c('0x114')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x5563f0){return db[_0xd17c('0x34')]['findOne']({'where':{'id':_0x2d939e},'transaction':_0x5563f0})[_0xd17c('0x13')](function(_0x1027aa){if(_0x1027aa){return db[_0xd17c('0x95')][_0xd17c('0x2a')]({'where':{'ChatWebsiteId':_0x2d939e},'transaction':_0x5563f0})['then'](function(){var _0x5d89d1=_['map'](_0x1a1217,function(_0x30a8ef){_0x30a8ef[_0xd17c('0x57')]=_0x2d939e;return _0x30a8ef;});return db[_0xd17c('0x95')][_0xd17c('0xdb')](_0x5d89d1,{'transaction':_0x5563f0});});}else{_0x13cbcb=0x194;_0x4dc3c4=[];}});})['then'](function(){if(_0x13cbcb!==0x194){return db[_0xd17c('0x95')][_0xd17c('0x115')]({'where':{'ChatWebsiteId':_0x2d939e},'order':_0xd17c('0x9a')})[_0xd17c('0x13')](function(_0x242603){_0x4dc3c4=_0x242603;});}})[_0xd17c('0x1e')](function(_0x4dc52a){_0x13cbcb=0x1f4;logger[_0xd17c('0x19')](_0x4dc52a[_0xd17c('0x2d')]);if(_0x4dc52a[_0xd17c('0x2e')]){delete _0x4dc52a['name'];}_0x4dc3c4=_0x4dc52a;})[_0xd17c('0x116')](function(){if(_0x4dc3c4===null){_0x4367c9['sendStatus'](_0x13cbcb);}else{if(_0x13cbcb===0x1f4){_0x4367c9[_0xd17c('0x21')](_0x13cbcb)[_0xd17c('0x2f')](_0x4dc3c4);}else{_0x4367c9[_0xd17c('0x21')](_0x13cbcb)['json'](_0x4dc3c4);}}});};exports[_0xd17c('0x117')]=function(_0x144eec,_0x44c546){var _0x4f3ce1={};var _0x2b63a1={};var _0xae2b9a;var _0x4dbbde;return db[_0xd17c('0x34')]['findOne']({'where':{'id':_0x144eec['params']['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x44c546,null))[_0xd17c('0x13')](function(_0x2c166d){if(_0x2c166d){_0xae2b9a=_0x2c166d;_0x2b63a1[_0xd17c('0x38')]=_[_0xd17c('0x3a')](db['ChatApplication'][_0xd17c('0x35')]);_0x2b63a1['query']=_[_0xd17c('0x3a')](_0x144eec[_0xd17c('0x39')]);_0x2b63a1[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x2b63a1['model'],_0x2b63a1['query']);_0x4f3ce1[_0xd17c('0x3c')]=_['intersection'](_0x2b63a1[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x4f3ce1[_0xd17c('0x3c')]=_0x4f3ce1[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x4f3ce1[_0xd17c('0x3c')]:_0x2b63a1[_0xd17c('0x38')];_0x4f3ce1[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x42')]);_0x4f3ce1['where']=qs['filters'](_[_0xd17c('0x5a')](_0x144eec['query'],_0x2b63a1[_0xd17c('0x44')]));if(_0x144eec['query'][_0xd17c('0x45')]){_0x4f3ce1[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x4f3ce1[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x4f3ce1[_0xd17c('0x3c')],function(_0x2f0d91){var _0x3eb794={};_0x3eb794[_0x2f0d91]={'$like':'%'+_0x144eec[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x3eb794;})});}_0x4f3ce1=_['merge']({},_0x4f3ce1,_0x144eec[_0xd17c('0x48')]);return _0xae2b9a[_0xd17c('0x117')](_0x4f3ce1);}})['then'](function(_0x539afd){if(_0x539afd){_0x4dbbde=_0x539afd[_0xd17c('0x3e')];if(!_0x144eec[_0xd17c('0x39')]['hasOwnProperty'](_0xd17c('0x40'))){_0x4f3ce1['limit']=qs[_0xd17c('0x24')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x24')]);_0x4f3ce1[_0xd17c('0x22')]=qs[_0xd17c('0x22')](_0x144eec[_0xd17c('0x39')][_0xd17c('0x22')]);}return _0xae2b9a[_0xd17c('0x117')](_0x4f3ce1);}})[_0xd17c('0x13')](function(_0x5d6cfe){if(_0x5d6cfe){return _0x5d6cfe?{'count':_0x4dbbde,'rows':_0x5d6cfe}:null;}})[_0xd17c('0x13')](respondWithResult(_0x44c546,null))['catch'](handleError(_0x44c546,null));};exports['addProactiveActions']=function(_0x444b9f,_0x22c09c){return db['chatProactiveAction'][_0xd17c('0x4c')]({'where':{'id':_0x444b9f[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22c09c,null))[_0xd17c('0x13')](function(_0x268e6e){if(_0x268e6e){return _0x268e6e[_0xd17c('0x118')](_0x444b9f['body'][_0xd17c('0x63')],_[_0xd17c('0xed')](_0x444b9f[_0xd17c('0x4d')],[_0xd17c('0x63'),'id'])||{});}})[_0xd17c('0x13')](respondWithResult(_0x22c09c,null))[_0xd17c('0x1e')](handleError(_0x22c09c,null));};exports[_0xd17c('0x119')]=function(_0xc10f02,_0x2e6713){var _0x587a19={};var _0x6b6ea9={};var _0xd9aa97;var _0x589507;return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0xc10f02[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e6713,null))[_0xd17c('0x13')](function(_0x55d5ed){if(_0x55d5ed){_0xd9aa97=_0x55d5ed;_0x6b6ea9['model']=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x6b6ea9['query']=_[_0xd17c('0x3a')](_0xc10f02[_0xd17c('0x39')]);_0x6b6ea9[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x6b6ea9[_0xd17c('0x38')],_0x6b6ea9[_0xd17c('0x39')]);_0x587a19[_0xd17c('0x3c')]=_['intersection'](_0x6b6ea9[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0xc10f02[_0xd17c('0x39')]['fields']));_0x587a19[_0xd17c('0x3c')]=_0x587a19[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x587a19['attributes']:_0x6b6ea9[_0xd17c('0x38')];_0x587a19[_0xd17c('0x41')]=qs['sort'](_0xc10f02[_0xd17c('0x39')]['sort']);_0x587a19['where']=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0xc10f02['query'],_0x6b6ea9['filters']));if(_0xc10f02[_0xd17c('0x39')][_0xd17c('0x45')]){_0x587a19[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x587a19[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x587a19[_0xd17c('0x3c')],function(_0x169497){var _0x345e6c={};_0x345e6c[_0x169497]={'$like':'%'+_0xc10f02[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x345e6c;})});}_0x587a19=_['merge']({},_0x587a19,_0xc10f02[_0xd17c('0x48')]);return _0xd9aa97[_0xd17c('0x119')](_0x587a19);}})['then'](function(_0x58c70a){if(_0x58c70a){_0x589507=_0x58c70a[_0xd17c('0x3e')];if(!_0xc10f02[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x587a19[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0xc10f02[_0xd17c('0x39')][_0xd17c('0x24')]);_0x587a19['offset']=qs[_0xd17c('0x22')](_0xc10f02[_0xd17c('0x39')][_0xd17c('0x22')]);}return _0xd9aa97[_0xd17c('0x119')](_0x587a19);}})[_0xd17c('0x13')](function(_0x2eb49a){if(_0x2eb49a){return _0x2eb49a?{'count':_0x589507,'rows':_0x2eb49a}:null;}})[_0xd17c('0x13')](respondWithResult(_0x2e6713,null))['catch'](handleError(_0x2e6713,null));};exports['getFields']=function(_0x1c74a2,_0x49c779){var _0x31a352=_0x1c74a2[_0xd17c('0x39')][_0xd17c('0x11a')]===_0xd17c('0x11b')?_0xd17c('0x11c'):_0xd17c('0x11d');return db[_0xd17c('0x34')][_0xd17c('0x4c')]({'attributes':['id',_0x31a352],'where':{'id':_0x1c74a2[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x49c779,null))[_0xd17c('0x13')](function(_0x44c536){if(_0x44c536){var _0x284c97=_0x44c536[_0x31a352];var _0x2fea96=_0x284c97&&_0x284c97[_0xd17c('0x11e')]?_0x284c97[_0xd17c('0x11e')]:[];_0x49c779[_0xd17c('0x2f')]({'fromKey':_['isNil'](_0x284c97[_0xd17c('0x11f')])?undefined:_0x284c97[_0xd17c('0x11f')],'count':_0x2fea96[_0xd17c('0x3e')],'rows':_0x2fea96});}})[_0xd17c('0x1e')](handleError(_0x49c779,null));};exports['getOfflineMessages']=function(_0x112917,_0xa6364a){var _0x382e52={'raw':![],'where':{}};var _0x52cff6={};var _0x40a1f2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd17c('0x61')]({'where':{'id':_0x112917[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa6364a,null))[_0xd17c('0x13')](function(_0x2d2037){if(_0x2d2037){_0x52cff6['model']=_[_0xd17c('0x3a')](db['ChatOfflineMessage']['rawAttributes']);_0x52cff6['query']=_[_0xd17c('0x3a')](_0x112917[_0xd17c('0x39')]);_0x52cff6[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x52cff6[_0xd17c('0x38')],_0x52cff6[_0xd17c('0x39')]);_0x382e52[_0xd17c('0x3c')]=_['intersection'](_0x52cff6[_0xd17c('0x38')],qs[_0xd17c('0x3d')](_0x112917[_0xd17c('0x39')]['fields']));_0x382e52['attributes']=_0x382e52[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x382e52[_0xd17c('0x3c')]:_0x52cff6[_0xd17c('0x38')];if(!_0x112917[_0xd17c('0x39')]['hasOwnProperty'](_0xd17c('0x40'))){_0x382e52[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0x112917[_0xd17c('0x39')][_0xd17c('0x24')]);_0x382e52['offset']=qs[_0xd17c('0x22')](_0x112917['query'][_0xd17c('0x22')]);}_0x382e52[_0xd17c('0x41')]=qs['sort'](_0x112917['query']['sort']);_0x382e52['where']=qs[_0xd17c('0x44')](_[_0xd17c('0x5a')](_0x112917[_0xd17c('0x39')],_0x52cff6['filters']));_0x382e52[_0xd17c('0x43')]['ChatWebsiteId']=_0x2d2037['id'];if(_0x112917[_0xd17c('0x39')][_0xd17c('0x45')]){_0x382e52[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x382e52[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x382e52[_0xd17c('0x3c')],function(_0x368928){var _0x24bf24={};_0x24bf24[_0x368928]={'$like':'%'+_0x112917[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x24bf24;})});}_0x382e52=_[_0xd17c('0x46')]({},_0x382e52,_0x112917[_0xd17c('0x48')]);return db[_0xd17c('0xd1')][_0xd17c('0x25')]({'where':_0x382e52[_0xd17c('0x43')]})['then'](function(_0xdd721a){_0x40a1f2[_0xd17c('0x25')]=_0xdd721a;if(_0x112917[_0xd17c('0x39')]['includeAll']){_0x382e52[_0xd17c('0x4b')]=[{'all':!![]}];}else{_0x382e52['include']=[{'model':db[_0xd17c('0x93')],'as':'Contact','required':![]},{'model':db[_0xd17c('0x120')],'as':_0xd17c('0x121'),'required':![]}];}return db[_0xd17c('0xd1')][_0xd17c('0x5b')](_0x382e52);})[_0xd17c('0x13')](function(_0x30f76a){_0x40a1f2[_0xd17c('0x5c')]=_0x30f76a;return _0x40a1f2;});}})['then'](respondWithFilteredResult(_0xa6364a,_0x382e52))['catch'](handleError(_0xa6364a,null));};exports[_0xd17c('0x122')]=function(_0x58a0a7,_0x19b008){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x58a0a7[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x19b008,null))[_0xd17c('0x13')](function(_0x2913da){if(_0x2913da){return _0x2913da[_0xd17c('0x122')](_0x58a0a7['body']['ids'],_[_0xd17c('0xed')](_0x58a0a7['body'],[_0xd17c('0x63'),'id'])||{})[_0xd17c('0xb3')](function(_0x278dcd){for(var _0x986f0f=0x0;_0x986f0f<_0x58a0a7[_0xd17c('0x4d')][_0xd17c('0x63')][_0xd17c('0x3e')];_0x986f0f+=0x1){socket[_0xd17c('0x123')](_0xd17c('0x124'),{'UserId':Number(_0x58a0a7['body'][_0xd17c('0x63')][_0x986f0f]),'ChatWebsiteId':Number(_0x58a0a7[_0xd17c('0x4a')]['id'])});}return _0x278dcd;});}})[_0xd17c('0x13')](respondWithResult(_0x19b008,null))['catch'](handleError(_0x19b008,null));};exports['removeAgents']=function(_0x405ef5,_0x3f7301){return db[_0xd17c('0x34')]['find']({'where':{'id':_0x405ef5[_0xd17c('0x4a')]['id']}})[_0xd17c('0x13')](handleEntityNotFound(_0x3f7301,null))[_0xd17c('0x13')](function(_0x4bd7de){if(_0x4bd7de){return _0x4bd7de[_0xd17c('0x125')](_0x405ef5[_0xd17c('0x39')][_0xd17c('0x63')])[_0xd17c('0x13')](function(){if(_[_0xd17c('0x126')](_0x405ef5['query'][_0xd17c('0x63')])){for(var _0xc29225=0x0;_0xc29225<_0x405ef5[_0xd17c('0x39')][_0xd17c('0x63')]['length'];_0xc29225+=0x1){socket[_0xd17c('0x123')](_0xd17c('0x127'),{'UserId':Number(_0x405ef5[_0xd17c('0x39')]['ids'][_0xc29225]),'ChatWebsiteId':Number(_0x405ef5['params']['id'])});}}else{socket[_0xd17c('0x123')](_0xd17c('0x127'),{'UserId':Number(_0x405ef5['query'][_0xd17c('0x63')]),'ChatWebsiteId':Number(_0x405ef5['params']['id'])});}});}})[_0xd17c('0x13')](respondWithStatusCode(_0x3f7301,null))['catch'](handleError(_0x3f7301,null));};exports['getAgents']=function(_0x54f94a,_0x5f0856){var _0x336147={};var _0x460b3c={};var _0x5b05cf;var _0x1dd3e7;return db[_0xd17c('0x34')][_0xd17c('0x61')]({'where':{'id':_0x54f94a[_0xd17c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f0856,null))['then'](function(_0x433c35){if(_0x433c35){_0x5b05cf=_0x433c35;_0x460b3c[_0xd17c('0x38')]=_[_0xd17c('0x3a')](db[_0xd17c('0xbe')]['rawAttributes']);_0x460b3c[_0xd17c('0x39')]=_[_0xd17c('0x3a')](_0x54f94a[_0xd17c('0x39')]);_0x460b3c[_0xd17c('0x44')]=_[_0xd17c('0x3b')](_0x460b3c[_0xd17c('0x38')],_0x460b3c[_0xd17c('0x39')]);_0x336147[_0xd17c('0x3c')]=_[_0xd17c('0x3b')](_0x460b3c[_0xd17c('0x38')],qs['fields'](_0x54f94a[_0xd17c('0x39')][_0xd17c('0x3d')]));_0x336147[_0xd17c('0x3c')]=_0x336147[_0xd17c('0x3c')][_0xd17c('0x3e')]?_0x336147['attributes']:_0x460b3c[_0xd17c('0x38')];_0x336147[_0xd17c('0x41')]=qs[_0xd17c('0x42')](_0x54f94a[_0xd17c('0x39')][_0xd17c('0x42')]);_0x336147[_0xd17c('0x43')]=qs[_0xd17c('0x44')](_['pick'](_0x54f94a[_0xd17c('0x39')],_0x460b3c['filters']));if(_0x54f94a['query']['filter']){_0x336147[_0xd17c('0x43')]=_[_0xd17c('0x46')](_0x336147[_0xd17c('0x43')],{'$or':_[_0xd17c('0x33')](_0x336147['attributes'],function(_0x4e50a6){var _0x3b60e7={};_0x3b60e7[_0x4e50a6]={'$like':'%'+_0x54f94a[_0xd17c('0x39')][_0xd17c('0x45')]+'%'};return _0x3b60e7;})});}_0x336147=_[_0xd17c('0x46')]({},_0x336147,_0x54f94a['options']);return _0x5b05cf[_0xd17c('0x128')](_0x336147);}})[_0xd17c('0x13')](function(_0x25c5e9){if(_0x25c5e9){_0x1dd3e7=_0x25c5e9['length'];if(!_0x54f94a[_0xd17c('0x39')][_0xd17c('0x3f')](_0xd17c('0x40'))){_0x336147[_0xd17c('0x24')]=qs[_0xd17c('0x24')](_0x54f94a[_0xd17c('0x39')][_0xd17c('0x24')]);_0x336147['offset']=qs[_0xd17c('0x22')](_0x54f94a['query'][_0xd17c('0x22')]);}return _0x5b05cf[_0xd17c('0x128')](_0x336147);}})[_0xd17c('0x13')](function(_0x4ecfeb){if(_0x4ecfeb){return _0x4ecfeb?{'count':_0x1dd3e7,'rows':_0x4ecfeb}:null;}})[_0xd17c('0x13')](respondWithResult(_0x5f0856,null))[_0xd17c('0x1e')](handleError(_0x5f0856,null));};
\ No newline at end of file
+var _0x3d0f=['addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','filename','systemAvatar','join','root','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','Applications','account','applications','list','orderBy','asc','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','lastName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','CompanyId','from\x20is\x20mandatory','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','MailAccountId','NotifyMailAccount','server','remove','addInteraction','omit','getInteractions','options','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','getProactiveActions','virtual','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','x-real-ip','connection','remoteAddress','replace','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','priority','getApplications','addProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','destroy','then','get','UserProfileResource','end','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','mandatoryDispositionPause','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','find','update','describe','ChatWebsiteId','Disposition','findOne','rows','ids'];(function(_0x6b5894,_0x4e4acd){var _0x4a43d3=function(_0x4ee905){while(--_0x4ee905){_0x6b5894['push'](_0x6b5894['shift']());}};_0x4a43d3(++_0x4e4acd);}(_0x3d0f,0xc3));var _0xf3d0=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x3d0f[_0x4b174a];return _0x3cd7bf;};'use strict';var BPromise=require(_0xf3d0('0x0'));var Mustache=require(_0xf3d0('0x1'));var util=require('util');var path=require(_0xf3d0('0x2'));var ejs=require(_0xf3d0('0x3'));var fs=require('fs');var fs_extra=require(_0xf3d0('0x4'));var _=require(_0xf3d0('0x5'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0xf3d0('0x6'));var logger=require(_0xf3d0('0x7'))(_0xf3d0('0x8'));var config=require(_0xf3d0('0x9'));var db=require(_0xf3d0('0xa'))['db'];config[_0xf3d0('0xb')]=_[_0xf3d0('0xc')](config[_0xf3d0('0xb')],{'host':_0xf3d0('0xd'),'port':0x18eb});var socket=require(_0xf3d0('0xe'))(new Redis(config[_0xf3d0('0xb')]));require(_0xf3d0('0xf'))[_0xf3d0('0x10')](socket);var htmlToText=require(_0xf3d0('0x11'));var jayson=require(_0xf3d0('0x12'));var client=jayson[_0xf3d0('0x13')]['http']({'port':0x232c});var client9002=jayson[_0xf3d0('0x13')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xf3d0('0x13')][_0xf3d0('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x35ba1a,_0x22aba3,_0x50fc57,_0x41f253){return new BPromise(function(_0x3c229c,_0x3ff20a){var _0x3fc89a=_0x41f253||client;return _0x3fc89a['request'](_0x35ba1a,_0x50fc57)['then'](function(_0x5838e0){logger[_0xf3d0('0x15')](_0xf3d0('0x16'),_0x22aba3,_0xf3d0('0x17'));logger['debug'](_0xf3d0('0x18'),_0x22aba3,'request\x20sent',JSON[_0xf3d0('0x19')](_0x5838e0));if(_0x5838e0[_0xf3d0('0x1a')]){if(_0x5838e0['error'][_0xf3d0('0x1b')]===0x1f4){logger[_0xf3d0('0x1a')](_0xf3d0('0x16'),_0x22aba3,_0x5838e0['error'][_0xf3d0('0x1c')]);return _0x3ff20a(_0x5838e0[_0xf3d0('0x1a')][_0xf3d0('0x1c')]);}logger[_0xf3d0('0x1a')](_0xf3d0('0x16'),_0x22aba3,_0x5838e0['error']['message']);return _0x3c229c(_0x5838e0[_0xf3d0('0x1a')][_0xf3d0('0x1c')]);}else{logger[_0xf3d0('0x15')](_0xf3d0('0x16'),_0x22aba3,_0xf3d0('0x17'));_0x3c229c(_0x5838e0[_0xf3d0('0x1d')][_0xf3d0('0x1c')]);}})[_0xf3d0('0x1e')](function(_0x15e2db){logger[_0xf3d0('0x1a')](_0xf3d0('0x16'),_0x22aba3,_0x15e2db);_0x3ff20a(_0x15e2db);});});}function respondWithStatusCode(_0x4d4b7c,_0x3dbba9){_0x3dbba9=_0x3dbba9||0xcc;return function(_0x31c571){if(_0x31c571){return _0x4d4b7c[_0xf3d0('0x1f')](_0x3dbba9);}return _0x4d4b7c['status'](_0x3dbba9)['end']();};}function respondWithResult(_0x23e3d0,_0x589e0d){_0x589e0d=_0x589e0d||0xc8;return function(_0x3356aa){if(_0x3356aa){return _0x23e3d0['status'](_0x589e0d)[_0xf3d0('0x20')](_0x3356aa);}};}function respondWithFilteredResult(_0x3c5e5e,_0x5e4202){return function(_0x89e938){if(_0x89e938){var _0x5e3a37=typeof _0x5e4202[_0xf3d0('0x21')]==='undefined'&&typeof _0x5e4202[_0xf3d0('0x22')]===_0xf3d0('0x23');var _0x5959a7=_0x89e938['count'];var _0x4d9404=_0x5e3a37?0x0:_0x5e4202[_0xf3d0('0x21')];var _0xc3e71d=_0x5e3a37?_0x89e938[_0xf3d0('0x24')]:_0x5e4202['offset']+_0x5e4202['limit'];var _0x1b4641;if(_0xc3e71d>=_0x5959a7){_0xc3e71d=_0x5959a7;_0x1b4641=0xc8;}else{_0x1b4641=0xce;}_0x3c5e5e[_0xf3d0('0x25')](_0x1b4641);return _0x3c5e5e[_0xf3d0('0x26')](_0xf3d0('0x27'),_0x4d9404+'-'+_0xc3e71d+'/'+_0x5959a7)[_0xf3d0('0x20')](_0x89e938);}return null;};}function saveUpdates(_0x3da878){return function(_0x15f39d){if(_0x15f39d){return _0x15f39d['update'](_0x3da878)['then'](function(_0x1200ec){return _0x1200ec;});}return null;};}function removeEntity(_0x37178f){return function(_0x346f3b){if(_0x346f3b){return _0x346f3b[_0xf3d0('0x28')]()[_0xf3d0('0x29')](function(){var _0xf6bd10=_0x346f3b[_0xf3d0('0x2a')]({'plain':!![]});var _0x3d98b8='ChatWebsites';return db[_0xf3d0('0x2b')][_0xf3d0('0x28')]({'where':{'type':_0x3d98b8,'resourceId':_0xf6bd10['id']}})[_0xf3d0('0x29')](function(){return _0x346f3b;});})[_0xf3d0('0x29')](function(){_0x37178f[_0xf3d0('0x25')](0xcc)[_0xf3d0('0x2c')]();});}};}function handleEntityNotFound(_0x3845de){return function(_0x3cd689){if(!_0x3cd689){_0x3845de[_0xf3d0('0x1f')](0x194);}return _0x3cd689;};}function handleError(_0x2e2377,_0x53eefd){_0x53eefd=_0x53eefd||0x1f4;return function(_0x19a81b){logger['error'](_0x19a81b[_0xf3d0('0x2d')]);if(_0x19a81b[_0xf3d0('0x2e')]){delete _0x19a81b[_0xf3d0('0x2e')];}_0x2e2377['status'](_0x53eefd)[_0xf3d0('0x2f')](_0x19a81b);};}exports[_0xf3d0('0x30')]=function(_0x1fcbf6,_0x1d5c7f){var _0x3cc64e={'include':[{'model':db[_0xf3d0('0x31')],'as':'mandatoryDispositionPause'}]},_0x26c118={},_0x4c8ce3={'count':0x0,'rows':[]};var _0x4b477b=_[_0xf3d0('0x32')](db[_0xf3d0('0x33')][_0xf3d0('0x34')],function(_0x57a10d){return{'name':_0x57a10d[_0xf3d0('0x35')],'type':_0x57a10d[_0xf3d0('0x36')][_0xf3d0('0x37')]};});_0x26c118[_0xf3d0('0x38')]=_[_0xf3d0('0x32')](_0x4b477b,'name');_0x26c118[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x1fcbf6[_0xf3d0('0x39')]);_0x26c118[_0xf3d0('0x3b')]=_['intersection'](_0x26c118[_0xf3d0('0x38')],_0x26c118[_0xf3d0('0x39')]);_0x3cc64e['attributes']=_[_0xf3d0('0x3c')](_0x26c118[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x3d')]));_0x3cc64e[_0xf3d0('0x3e')]=_0x3cc64e[_0xf3d0('0x3e')]['length']?_0x3cc64e['attributes']:_0x26c118[_0xf3d0('0x38')];if(!_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x3cc64e[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x1fcbf6['query'][_0xf3d0('0x22')]);_0x3cc64e[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x1fcbf6['query'][_0xf3d0('0x21')]);}_0x3cc64e[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x3cc64e[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x1fcbf6[_0xf3d0('0x39')],_0x26c118[_0xf3d0('0x3b')]),_0x4b477b);if(_0x1fcbf6['query'][_0xf3d0('0x45')]){_0x3cc64e['where']=_[_0xf3d0('0x46')](_0x3cc64e[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x4b477b,function(_0x57cfbb){if(_0x57cfbb[_0xf3d0('0x36')]!==_0xf3d0('0x47')){var _0x2f4f3b={};_0x2f4f3b[_0x57cfbb[_0xf3d0('0x2e')]]={'$like':'%'+_0x1fcbf6[_0xf3d0('0x39')]['filter']+'%'};return _0x2f4f3b;}})});}_0x3cc64e=_['merge']({},_0x3cc64e,_0x1fcbf6['options']);var _0x28e1d5={'where':_0x3cc64e[_0xf3d0('0x43')]};return db[_0xf3d0('0x33')][_0xf3d0('0x24')](_0x28e1d5)[_0xf3d0('0x29')](function(_0x5ea041){_0x4c8ce3[_0xf3d0('0x24')]=_0x5ea041;if(_0x1fcbf6[_0xf3d0('0x39')][_0xf3d0('0x48')]){_0x3cc64e[_0xf3d0('0x49')]=[{'all':!![]}];}return db[_0xf3d0('0x33')][_0xf3d0('0x4a')](_0x3cc64e);})[_0xf3d0('0x29')](function(_0xc50ecb){_0x4c8ce3['rows']=_0xc50ecb;return _0x4c8ce3;})[_0xf3d0('0x29')](respondWithFilteredResult(_0x1d5c7f,_0x3cc64e))[_0xf3d0('0x1e')](handleError(_0x1d5c7f,null));};exports[_0xf3d0('0x4b')]=function(_0x533b3d,_0x29d25c){var _0x590d0a={'raw':![],'where':{'id':_0x533b3d[_0xf3d0('0x4c')]['id']},'include':[{'model':db[_0xf3d0('0x31')],'as':_0xf3d0('0x4d')}]},_0x436f72={};_0x436f72[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0x33')][_0xf3d0('0x34')]);_0x436f72[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x533b3d['query']);_0x436f72[_0xf3d0('0x3b')]=_['intersection'](_0x436f72['model'],_0x436f72[_0xf3d0('0x39')]);_0x590d0a[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x436f72['model'],qs[_0xf3d0('0x3d')](_0x533b3d['query'][_0xf3d0('0x3d')]));_0x590d0a[_0xf3d0('0x3e')]=_0x590d0a[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x590d0a[_0xf3d0('0x3e')]:_0x436f72[_0xf3d0('0x38')];if(_0x533b3d['query'][_0xf3d0('0x48')]){_0x590d0a[_0xf3d0('0x49')]=[{'all':!![]}];}_0x590d0a=_[_0xf3d0('0x46')]({},_0x590d0a,_0x533b3d['options']);return db[_0xf3d0('0x33')]['find'](_0x590d0a)['then'](handleEntityNotFound(_0x29d25c,null))['then'](respondWithResult(_0x29d25c,null))[_0xf3d0('0x1e')](handleError(_0x29d25c,null));};exports[_0xf3d0('0x4f')]=function(_0x101171,_0x29f776){return db['ChatWebsite'][_0xf3d0('0x4f')](_0x101171[_0xf3d0('0x50')],{})['then'](function(_0xe2d01f){var _0x6b385=_0x101171[_0xf3d0('0x51')][_0xf3d0('0x2a')]({'plain':!![]});if(!_0x6b385)throw new Error(_0xf3d0('0x52'));if(_0x6b385[_0xf3d0('0x53')]===_0xf3d0('0x51')){var _0x442eb5=_0xe2d01f[_0xf3d0('0x2a')]({'plain':!![]});var _0x15269a=_0xf3d0('0x54');return db[_0xf3d0('0x55')][_0xf3d0('0x56')]({'where':{'name':_0x15269a,'userProfileId':_0x6b385['userProfileId']},'raw':!![]})[_0xf3d0('0x29')](function(_0x42fde2){if(_0x42fde2&&_0x42fde2['autoAssociation']===0x0){return db[_0xf3d0('0x2b')][_0xf3d0('0x4f')]({'name':_0x442eb5[_0xf3d0('0x2e')],'resourceId':_0x442eb5['id'],'type':_0x42fde2['name'],'sectionId':_0x42fde2['id']},{})[_0xf3d0('0x29')](function(){return _0xe2d01f;});}else{return _0xe2d01f;}})[_0xf3d0('0x1e')](function(_0x868014){logger[_0xf3d0('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x868014);throw _0x868014;});}return _0xe2d01f;})['then'](respondWithResult(_0x29f776,0xc9))[_0xf3d0('0x1e')](handleError(_0x29f776,null));};exports[_0xf3d0('0x57')]=function(_0x4e191e,_0x5a9e15){if(_0x4e191e[_0xf3d0('0x50')]['id']){delete _0x4e191e['body']['id'];}return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x4e191e['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5a9e15,null))[_0xf3d0('0x29')](saveUpdates(_0x4e191e[_0xf3d0('0x50')],null))['then'](respondWithResult(_0x5a9e15,null))[_0xf3d0('0x1e')](handleError(_0x5a9e15,null));};exports[_0xf3d0('0x28')]=function(_0xb2f89,_0xf8f487){return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0xb2f89[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0xf8f487,null))[_0xf3d0('0x29')](removeEntity(_0xf8f487,null))[_0xf3d0('0x1e')](handleError(_0xf8f487,null));};exports[_0xf3d0('0x58')]=function(_0xbb08eb,_0x318ab0){return db[_0xf3d0('0x33')][_0xf3d0('0x58')]()[_0xf3d0('0x29')](respondWithResult(_0x318ab0,null))['catch'](handleError(_0x318ab0,null));};exports['addDisposition']=function(_0x377d15,_0x52c4e6){if(_0x377d15['body']['id']){delete _0x377d15[_0xf3d0('0x50')]['id'];}return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x377d15[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x52c4e6,null))[_0xf3d0('0x29')](function(_0x26ef9b){if(_0x26ef9b){_0x377d15[_0xf3d0('0x50')][_0xf3d0('0x59')]=_0x26ef9b['id'];return db[_0xf3d0('0x5a')][_0xf3d0('0x4f')](_0x377d15[_0xf3d0('0x50')]);}})['then'](respondWithResult(_0x52c4e6,null))[_0xf3d0('0x1e')](handleError(_0x52c4e6,null));};exports['getDispositions']=function(_0x3133ce,_0x55f95f){var _0x4890f3={'raw':![],'where':{}};var _0x2a63d6={};var _0x42f27c={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x3133ce[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x55f95f,null))[_0xf3d0('0x29')](function(_0x4deb61){if(_0x4deb61){_0x2a63d6['model']=_['keys'](db[_0xf3d0('0x5a')][_0xf3d0('0x34')]);_0x2a63d6[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x3133ce[_0xf3d0('0x39')]);_0x2a63d6[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0x2a63d6[_0xf3d0('0x38')],_0x2a63d6[_0xf3d0('0x39')]);_0x4890f3[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x2a63d6[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x3133ce['query'][_0xf3d0('0x3d')]));_0x4890f3[_0xf3d0('0x3e')]=_0x4890f3[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x4890f3['attributes']:_0x2a63d6['model'];if(!_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x4890f3['limit']=qs['limit'](_0x3133ce['query']['limit']);_0x4890f3['offset']=qs['offset'](_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x21')]);}_0x4890f3[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x4890f3[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x3133ce['query'],_0x2a63d6['filters']));_0x4890f3[_0xf3d0('0x43')][_0xf3d0('0x59')]=_0x4deb61['id'];if(_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x4890f3[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x4890f3[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x4890f3[_0xf3d0('0x3e')],function(_0x19235c){var _0x5a9e3d={};_0x5a9e3d[_0x19235c]={'$like':'%'+_0x3133ce[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x5a9e3d;})});}_0x4890f3=_[_0xf3d0('0x46')]({},_0x4890f3,_0x3133ce['options']);return db['Disposition'][_0xf3d0('0x24')]({'where':_0x4890f3['where']})[_0xf3d0('0x29')](function(_0x1cc134){_0x42f27c[_0xf3d0('0x24')]=_0x1cc134;if(_0x3133ce['query']['includeAll']){_0x4890f3[_0xf3d0('0x49')]=[{'all':!![]}];}return db['Disposition'][_0xf3d0('0x4a')](_0x4890f3);})['then'](function(_0x29887c){_0x42f27c[_0xf3d0('0x5c')]=_0x29887c;return _0x42f27c;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x55f95f,_0x4890f3))[_0xf3d0('0x1e')](handleError(_0x55f95f,null));};exports['removeDispositions']=function(_0x3ad1d1,_0x4596e9){return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x3ad1d1[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x4596e9,null))[_0xf3d0('0x29')](function(_0x3e687e){if(_0x3e687e){return _0x3e687e['removeDispositions'](_0x3ad1d1[_0xf3d0('0x39')][_0xf3d0('0x5d')]);}})[_0xf3d0('0x29')](respondWithStatusCode(_0x4596e9,null))[_0xf3d0('0x1e')](handleError(_0x4596e9,null));};exports[_0xf3d0('0x5e')]=function(_0x2ed1b,_0xd731a){if(_0x2ed1b['body']['id']){delete _0x2ed1b[_0xf3d0('0x50')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2ed1b[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0xd731a,null))[_0xf3d0('0x29')](function(_0x5c69c8){if(_0x5c69c8){_0x2ed1b[_0xf3d0('0x50')][_0xf3d0('0x59')]=_0x5c69c8['id'];return db[_0xf3d0('0x5f')][_0xf3d0('0x4f')](_0x2ed1b[_0xf3d0('0x50')]);}})[_0xf3d0('0x29')](respondWithResult(_0xd731a,null))[_0xf3d0('0x1e')](handleError(_0xd731a,null));};exports[_0xf3d0('0x60')]=function(_0x2460f9,_0x5cf23f){var _0x3ec379={'raw':![],'where':{}};var _0x5e9b86={};var _0x2a59ee={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x2460f9['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x5cf23f,null))[_0xf3d0('0x29')](function(_0x3cd0a0){if(_0x3cd0a0){_0x5e9b86[_0xf3d0('0x38')]=_['keys'](db[_0xf3d0('0x5f')][_0xf3d0('0x34')]);_0x5e9b86[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x2460f9[_0xf3d0('0x39')]);_0x5e9b86['filters']=_[_0xf3d0('0x3c')](_0x5e9b86[_0xf3d0('0x38')],_0x5e9b86[_0xf3d0('0x39')]);_0x3ec379[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x5e9b86[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x3d')]));_0x3ec379[_0xf3d0('0x3e')]=_0x3ec379[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x3ec379[_0xf3d0('0x3e')]:_0x5e9b86[_0xf3d0('0x38')];if(!_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x3ec379[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x3ec379[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x21')]);}_0x3ec379[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x3ec379['where']=qs['filters'](_[_0xf3d0('0x44')](_0x2460f9[_0xf3d0('0x39')],_0x5e9b86['filters']));_0x3ec379[_0xf3d0('0x43')][_0xf3d0('0x59')]=_0x3cd0a0['id'];if(_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x3ec379['where']=_[_0xf3d0('0x46')](_0x3ec379[_0xf3d0('0x43')],{'$or':_['map'](_0x3ec379['attributes'],function(_0x5bac08){var _0x937b37={};_0x937b37[_0x5bac08]={'$like':'%'+_0x2460f9[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x937b37;})});}_0x3ec379=_['merge']({},_0x3ec379,_0x2460f9['options']);return db[_0xf3d0('0x5f')][_0xf3d0('0x24')]({'where':_0x3ec379[_0xf3d0('0x43')]})[_0xf3d0('0x29')](function(_0x48c0fd){_0x2a59ee[_0xf3d0('0x24')]=_0x48c0fd;if(_0x2460f9['query'][_0xf3d0('0x48')]){_0x3ec379[_0xf3d0('0x49')]=[{'all':!![]}];}return db[_0xf3d0('0x5f')][_0xf3d0('0x4a')](_0x3ec379);})[_0xf3d0('0x29')](function(_0xe7f697){_0x2a59ee[_0xf3d0('0x5c')]=_0xe7f697;return _0x2a59ee;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x5cf23f,_0x3ec379))['catch'](handleError(_0x5cf23f,null));};exports[_0xf3d0('0x61')]=function(_0x3bf4ab,_0x469b5e){return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x3bf4ab[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x469b5e,null))['then'](function(_0xc80b71){if(_0xc80b71){return _0xc80b71[_0xf3d0('0x61')](_0x3bf4ab[_0xf3d0('0x39')][_0xf3d0('0x5d')]);}})[_0xf3d0('0x29')](respondWithStatusCode(_0x469b5e,null))[_0xf3d0('0x1e')](handleError(_0x469b5e,null));};exports['addLogo']=function(_0x24728f,_0x952a0){_0x24728f[_0xf3d0('0x50')][_0xf3d0('0x62')]=_0x24728f['file']['filename'];return db['ChatWebsite'][_0xf3d0('0x56')]({'where':{'id':_0x24728f[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x952a0,null))['then'](saveUpdates(_0x24728f[_0xf3d0('0x50')],null))['then'](respondWithResult(_0x952a0,null))['catch'](handleError(_0x952a0,null));};exports[_0xf3d0('0x63')]=function(_0x1fa666,_0x1f34a9){_0x1fa666[_0xf3d0('0x50')][_0xf3d0('0x64')]=_0x1fa666['file']['filename'];return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x1fa666[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x1f34a9,null))[_0xf3d0('0x29')](saveUpdates(_0x1fa666[_0xf3d0('0x50')],null))[_0xf3d0('0x29')](respondWithResult(_0x1f34a9,null))[_0xf3d0('0x1e')](handleError(_0x1f34a9,null));};exports[_0xf3d0('0x65')]=function(_0x4c813d,_0x23e6fe){_0x4c813d[_0xf3d0('0x50')][_0xf3d0('0x66')]=_0x4c813d[_0xf3d0('0x67')][_0xf3d0('0x68')];return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x4c813d[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23e6fe,null))[_0xf3d0('0x29')](saveUpdates(_0x4c813d[_0xf3d0('0x50')],null))[_0xf3d0('0x29')](respondWithResult(_0x23e6fe,null))[_0xf3d0('0x1e')](handleError(_0x23e6fe,null));};exports['addSystemAvatar']=function(_0x4b0f76,_0x137dfa){_0x4b0f76['body'][_0xf3d0('0x69')]=_0x4b0f76[_0xf3d0('0x67')][_0xf3d0('0x68')];return db['ChatWebsite'][_0xf3d0('0x56')]({'where':{'id':_0x4b0f76[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x137dfa,null))[_0xf3d0('0x29')](saveUpdates(_0x4b0f76[_0xf3d0('0x50')],null))[_0xf3d0('0x29')](respondWithResult(_0x137dfa,null))[_0xf3d0('0x1e')](handleError(_0x137dfa,null));};exports['getLogo']=function(_0x1187b5,_0x48f0c8){var _0x29657d=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server/files/images/logos/default_logo.svg');var _0x180277={'where':{'id':_0x1187b5[_0xf3d0('0x4c')]['id']},'attributes':['id',_0xf3d0('0x62')],'raw':!![]};var _0x17edd1=![];return require(_0xf3d0('0x6c'))[_0xf3d0('0x6d')]()[_0xf3d0('0x29')](function(_0xb64dbb){if(_0xb64dbb){_0x17edd1=_0xb64dbb[_0xf3d0('0x6e')];}})[_0xf3d0('0x29')](function(){return db[_0xf3d0('0x33')][_0xf3d0('0x56')](_0x180277);})[_0xf3d0('0x29')](handleEntityNotFound(_0x48f0c8,null))[_0xf3d0('0x29')](function(_0x55bbbe){if(_0x55bbbe){if(!_[_0xf3d0('0x6f')](_0x55bbbe[_0xf3d0('0x62')])){if(fs['existsSync'](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server/files/images/logos/',_0x55bbbe[_0xf3d0('0x62')]))&&_0x17edd1){_0x29657d=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x70'),_0x55bbbe[_0xf3d0('0x62')]);}}return _0x48f0c8['download'](_0x29657d);}})[_0xf3d0('0x1e')](handleError(_0x48f0c8,null));};exports[_0xf3d0('0x71')]=function(_0x22ebb2,_0x39ae51){var _0x115fe6=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x72'));var _0x1dd28b={'where':{'id':_0x22ebb2[_0xf3d0('0x4c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xf3d0('0x33')][_0xf3d0('0x56')](_0x1dd28b)['then'](handleEntityNotFound(_0x39ae51,null))[_0xf3d0('0x29')](function(_0x561564){if(_0x561564){if(!_['isNil'](_0x561564[_0xf3d0('0x64')])){if(fs[_0xf3d0('0x73')](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x561564[_0xf3d0('0x64')]))){_0x115fe6=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x561564[_0xf3d0('0x64')]);}}return _0x39ae51[_0xf3d0('0x75')](_0x115fe6);}})[_0xf3d0('0x1e')](handleError(_0x39ae51,null));};exports['getCustomerAvatar']=function(_0x59f777,_0x331741){var _0xd10c4e=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x76'));var _0x2d96b6={'where':{'id':_0x59f777[_0xf3d0('0x4c')]['id']},'attributes':['id','customerAvatar',_0xf3d0('0x77')],'raw':!![]};return db['ChatWebsite'][_0xf3d0('0x56')](_0x2d96b6)[_0xf3d0('0x29')](handleEntityNotFound(_0x331741,null))[_0xf3d0('0x29')](function(_0x4dada8){if(_0x4dada8){if(!_[_0xf3d0('0x6f')](_0x4dada8[_0xf3d0('0x66')])){if(fs[_0xf3d0('0x73')](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x4dada8['customerAvatar']))&&_0x4dada8[_0xf3d0('0x77')]){_0xd10c4e=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server/files/images/avatars/',_0x4dada8[_0xf3d0('0x66')]);}}return _0x331741['download'](_0xd10c4e);}})[_0xf3d0('0x1e')](handleError(_0x331741,null));};exports[_0xf3d0('0x78')]=function(_0x22b82c,_0x20206f){var _0xddf82e=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x79'));var _0x332ac1={'where':{'id':_0x22b82c[_0xf3d0('0x4c')]['id']},'attributes':['id',_0xf3d0('0x69')],'raw':!![]};return db[_0xf3d0('0x33')][_0xf3d0('0x56')](_0x332ac1)['then'](handleEntityNotFound(_0x20206f,null))[_0xf3d0('0x29')](function(_0x286c48){if(_0x286c48){if(!_[_0xf3d0('0x6f')](_0x286c48[_0xf3d0('0x69')])){if(fs['existsSync'](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x286c48[_0xf3d0('0x69')]))){_0xddf82e=path['join'](config[_0xf3d0('0x6b')],_0xf3d0('0x74'),_0x286c48[_0xf3d0('0x69')]);}}return _0x20206f['download'](_0xddf82e);}})['catch'](handleError(_0x20206f,null));};exports['notify']=function(_0x1a45b1,_0x57513d){var _0x344c29=require('user-agent-parser');var _0x4091b9=new _0x344c29();var _0x2488f0=_0x4091b9[_0xf3d0('0x7a')](_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x7c')])[_0xf3d0('0x7d')]();var _0x5ebfac={'body':_0x1a45b1[_0xf3d0('0x50')],'channel':_0xf3d0('0x7e')};var _0x15e596=[];var _0x34571e=[];var _0x2007f2={};var _0x373ed1=![];return db[_0xf3d0('0x7f')][_0xf3d0('0x58')]()[_0xf3d0('0x29')](function(_0x2d9604){if(!_0x2d9604){throw new db['Sequelize'][(_0xf3d0('0x80'))](_0xf3d0('0x81'));}_0x15e596=_[_0xf3d0('0x82')](_[_0xf3d0('0x3a')](_0x2d9604),['createdAt',_0xf3d0('0x83')]);_0x34571e=_[_0xf3d0('0x82')](_[_0xf3d0('0x3a')](_0x2d9604),['createdAt',_0xf3d0('0x83'),'CompanyId','ListId']);if(_0x1a45b1['body']['id']){delete _0x1a45b1['body']['id'];}if(_['isNil'](_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x84')])){throw new db[(_0xf3d0('0x85'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xf3d0('0x6f')](_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x50')])||_0x1a45b1['body'][_0xf3d0('0x50')]===''){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0x86'));}if(_[_0xf3d0('0x6f')](_0x1a45b1['body']['mapKey'])){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0x87')+_0x34571e);}if(!_[_0xf3d0('0x88')](_0x34571e,_0x1a45b1[_0xf3d0('0x50')]['mapKey'])){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0x89')+_0x34571e);}_0x2007f2[_0x1a45b1['body']['mapKey']]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x84')];})[_0xf3d0('0x29')](function(){return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x1a45b1[_0xf3d0('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0xf3d0('0x8a'),'include':[{'model':db[_0xf3d0('0x7f')],'as':_0xf3d0('0x8b'),'where':_0x2007f2,'limit':0x1,'order':[[_0xf3d0('0x83'),_0xf3d0('0x8c')]]}]},{'model':db['ChatApplication'],'as':_0xf3d0('0x8d')}]});})[_0xf3d0('0x29')](handleEntityNotFound(_0x57513d,null))['then'](function(_0x40558e){if(_0x40558e&&_0x40558e['List']){_0x5ebfac[_0xf3d0('0x8e')]=_0x40558e;_0x5ebfac[_0xf3d0('0x8f')]=_0x40558e[_0xf3d0('0x8d')];_0x5ebfac[_0xf3d0('0x90')]=_0x40558e[_0xf3d0('0x8a')];_0x5ebfac['applications']=_[_0xf3d0('0x91')](_0x5ebfac[_0xf3d0('0x8f')],['priority'],[_0xf3d0('0x92')]);if(_0x5ebfac['account']['Applications']){delete _0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0x8d')];}if(_0x5ebfac[_0xf3d0('0x8e')]['List']&&_0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0x8a')]['Contacts']['length']){return _0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0x8a')][_0xf3d0('0x8b')][0x0];}var _0x35868c=_[_0xf3d0('0xc')](_0x1a45b1[_0xf3d0('0x50')],{'firstName':_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x84')],'ListId':_0x40558e[_0xf3d0('0x93')]});_0x35868c[_0x1a45b1['body']['mapKey']]=_0x1a45b1[_0xf3d0('0x50')]['from'];return db['CmContact'][_0xf3d0('0x4f')](_0x35868c,{'fields':_0x15e596,'raw':!![]});}})[_0xf3d0('0x29')](handleEntityNotFound(_0x57513d,null))[_0xf3d0('0x29')](function(_0x51dc53){_0x5ebfac['contact']=_0x51dc53;var _0x58e7c0=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0x94')];if(_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x95')]){_0x58e7c0=_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x95')];}else if(_0x1a45b1[_0xf3d0('0x7b')][_0xf3d0('0x96')]){_0x58e7c0=_[_0xf3d0('0x97')](_0x1a45b1[_0xf3d0('0x7b')]['x-forwarded-for'][_0xf3d0('0x98')](','));}if(_0x51dc53){var _0x421dac={'ContactId':_0x51dc53['id'],'ChatWebsiteId':_0x1a45b1[_0xf3d0('0x4c')]['id'],'from':(_0x51dc53['firstName']||'')+'\x20'+(_0x51dc53['lastName']||''),'customerIp':_0x58e7c0,'customerPort':_0x1a45b1['headers']['x-real-port']?_0x1a45b1[_0xf3d0('0x7b')]['x-real-port']:null,'referer':_0x1a45b1['body'][_0xf3d0('0x99')],'browserName':_0x2488f0[_0xf3d0('0x9a')]['name']&&_0x2488f0[_0xf3d0('0x9a')][_0xf3d0('0x9b')]?util[_0xf3d0('0x9c')](_0xf3d0('0x9d'),_0x2488f0[_0xf3d0('0x9a')][_0xf3d0('0x2e')],_0x2488f0[_0xf3d0('0x9a')]['version']):_0xf3d0('0x9e'),'browserVersion':_0x2488f0['browser'][_0xf3d0('0x9b')]||_0xf3d0('0x9e'),'osName':util['format'](_0xf3d0('0x9d'),_0x2488f0['os']['name'],_0x2488f0['os'][_0xf3d0('0x9b')]),'osVersion':_0x2488f0['os'][_0xf3d0('0x9b')],'deviceModel':_0x2488f0[_0xf3d0('0x9f')]['model']&&_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0xa0')]?util[_0xf3d0('0x9c')](_0xf3d0('0xa1'),_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0x38')],_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0xa0')],_0x2488f0[_0xf3d0('0x9f')][_0xf3d0('0x36')]):null,'deviceVendor':_0x2488f0['device']['vendor'],'deviceType':_0x2488f0[_0xf3d0('0x9f')]['type'],'formData':JSON['stringify'](_0x1a45b1[_0xf3d0('0x50')])};var _0x1daae0={'ChatWebsiteId':_0x1a45b1['params']['id'],'closed':![]};if(_0x1a45b1[_0xf3d0('0x50')]['threadId']){_0x1daae0[_0xf3d0('0xa2')]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa2')];return db[_0xf3d0('0xa3')][_0xf3d0('0x56')]({'where':_0x1daae0})['then'](function(_0x568914){if(_0x568914){return[_0x568914,![]];}_0x421dac['threadId']=_0x1a45b1['body'][_0xf3d0('0xa2')];_0x421dac[_0xf3d0('0xa4')]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa4')];return db[_0xf3d0('0xa3')][_0xf3d0('0x4f')](_0x421dac)[_0xf3d0('0x29')](function(_0x55b5ee){return[_0x55b5ee,!![]];});});}_0x1daae0[_0xf3d0('0xa5')]=_0x51dc53['id'];if(_0x1a45b1[_0xf3d0('0x50')]['interaction']&&_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa6')]['id']){_0x1daae0['id']=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa6')]['id'];return db['ChatInteraction'][_0xf3d0('0x56')]({'where':_0x1daae0})[_0xf3d0('0x29')](function(_0x56353a){if(_0x56353a){return[_0x56353a,![]];}return db[_0xf3d0('0xa3')][_0xf3d0('0x4f')](_0x421dac)['then'](function(_0x302361){return[_0x302361,!![]];});});}return db['ChatInteraction'][_0xf3d0('0x4f')](_0x421dac)[_0xf3d0('0x29')](function(_0x223172){return[_0x223172,!![]];});}})[_0xf3d0('0xa7')](function(_0x460c1f,_0x3b5145){if(_0x460c1f){_0x373ed1=_0x3b5145;if(!_0x3b5145){var _0x1cb39a={'from':(_0x5ebfac[_0xf3d0('0xa8')][_0xf3d0('0xa9')]||'')+'\x20'+(_0x5ebfac['contact'][_0xf3d0('0xaa')]||'')};if(_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xa2')]&&_0x1a45b1['body'][_0xf3d0('0xab')]&&_0x1a45b1['body']['threadId']!=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xab')]){_0x1cb39a[_0xf3d0('0xa2')]=_0x1a45b1[_0xf3d0('0x50')][_0xf3d0('0xab')];}return _0x460c1f[_0xf3d0('0x57')](_0x1cb39a);}else{return _0x460c1f;}}})[_0xf3d0('0x29')](function(_0x140710){_0x5ebfac[_0xf3d0('0xa6')]=_0x140710[_0xf3d0('0x2a')]({'plain':!![]});_0x5ebfac['interaction'][_0xf3d0('0xac')]=_0x373ed1;if(_0x5ebfac[_0xf3d0('0xa6')][_0xf3d0('0xac')]){if(_0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0xad')]){_0x5ebfac[_0xf3d0('0x8f')][_0xf3d0('0xae')]({'id':0x0,'priority':_0x5ebfac[_0xf3d0('0x8f')][_0xf3d0('0x4e')]+0x1,'app':_0xf3d0('0xaf'),'appdata':_0xf3d0('0xb0'),'interval':'*,*,*,*'});}}return db[_0xf3d0('0xb1')][_0xf3d0('0x4f')]({'body':_0x1a45b1['body']['body'],'ChatWebsiteId':_0x1a45b1['params']['id'],'ChatInteractionId':_0x140710['id'],'direction':'in','ContactId':_0x5ebfac[_0xf3d0('0xa8')]['id'],'AttachmentId':_0x1a45b1['body'][_0xf3d0('0xb2')]});})[_0xf3d0('0x29')](function(_0x1b2581){_0x5ebfac[_0xf3d0('0x1c')]=_0x1b2581;if(_0x5ebfac[_0xf3d0('0xa6')]['UserId']){return db[_0xf3d0('0xb3')]['find']({'attributes':['id','name'],'where':{'id':_0x5ebfac['interaction'][_0xf3d0('0xb4')]}})['then'](function(_0x687d25){if(_0x687d25){_0x5ebfac['applications'][_0xf3d0('0xb5')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x687d25[_0xf3d0('0x2e')]+','+(_0x5ebfac[_0xf3d0('0x8e')][_0xf3d0('0xb6')]||0xa),'interval':'*,*,*,*'});_0x5ebfac[_0xf3d0('0xb7')]=!![];}return respondWithRpcPromise(_0xf3d0('0xb8'),_0xf3d0('0xb9'),_0x5ebfac);});}return respondWithRpcPromise(_0xf3d0('0xb8'),_0xf3d0('0xb9'),_0x5ebfac);})[_0xf3d0('0x29')](function(_0x40c24b){respondWithRpcPromise(_0xf3d0('0xba'),_0xf3d0('0xba'),{'event':_0xf3d0('0xbb'),'message':_0x40c24b},client9002);return _0x40c24b;})[_0xf3d0('0x29')](respondWithResult(_0x57513d,null))['catch'](handleError(_0x57513d,null));};exports[_0xf3d0('0xbc')]=function(_0x18588c,_0x392e9d){var _0x3087ad,_0x145022,_0x339953;var _0x1ddf5d=[];var _0x31e430={};var _0xb86039=_0x18588c[_0xf3d0('0xbd')]||[];var _0x382374=[];var _0x2ac327;return db[_0xf3d0('0x7f')][_0xf3d0('0x58')]()[_0xf3d0('0x29')](function(_0x5193d9){if(!_0x5193d9){throw new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))]('no\x20available\x20attributes');}_0x1ddf5d=_[_0xf3d0('0x82')](_['keys'](_0x5193d9),['createdAt',_0xf3d0('0x83'),_0xf3d0('0xbe'),_0xf3d0('0x93')]);if(_0x18588c[_0xf3d0('0x50')]['id']){delete _0x18588c[_0xf3d0('0x50')]['id'];}if(_['isNil'](_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x84')])){throw _0x392e9d['status'](0x1f4)[_0xf3d0('0x2f')](new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))](_0xf3d0('0xbf')));}if(_[_0xf3d0('0x6f')](_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x50')])||_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x50')]===''){throw _0x392e9d[_0xf3d0('0x25')](0x1f4)[_0xf3d0('0x2f')](new db['Sequelize'][(_0xf3d0('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf3d0('0x6f')](_0x18588c[_0xf3d0('0x50')][_0xf3d0('0xc0')])){throw _0x392e9d['status'](0x1f4)['send'](new db[(_0xf3d0('0x85'))][(_0xf3d0('0x80'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ddf5d));}if(!_[_0xf3d0('0x88')](_0x1ddf5d,_0x18588c[_0xf3d0('0x50')]['mapKeyOffline'])){throw _0x392e9d[_0xf3d0('0x25')](0x1f4)['send'](new db['Sequelize'][(_0xf3d0('0x80'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ddf5d));}_0x31e430[_0x18588c[_0xf3d0('0x50')]['mapKeyOffline']]=_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x84')];})[_0xf3d0('0x29')](function(){return db['ChatWebsite'][_0xf3d0('0x56')]({'where':{'id':_0x18588c[_0xf3d0('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0xf3d0('0x8a')},{'model':db[_0xf3d0('0xc1')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x392e9d,null))['then'](function(_0x442032){if(_0x442032&&_0x442032[_0xf3d0('0x8a')]){_0x145022=_0x442032;var _0x364830=_[_0xf3d0('0xc')](_0x18588c['body'],{'firstName':_0x18588c[_0xf3d0('0x50')]['from'],'phone':_0x18588c[_0xf3d0('0x50')][_0xf3d0('0x84')],'ListId':_0x442032['ListId']});_0x364830[_0x18588c[_0xf3d0('0x50')][_0xf3d0('0xc0')]]=_0x18588c['body'][_0xf3d0('0x84')];return db[_0xf3d0('0x7f')][_0xf3d0('0xc2')]({'where':_0x31e430,'defaults':_0x364830});}})[_0xf3d0('0xa7')](function(_0x16b747){if(_0x16b747){_0x339953=_0x16b747;var _0x6ffdf3=fs[_0xf3d0('0xc3')](path[_0xf3d0('0x6a')](config['root'],_0xf3d0('0xc4')),_0xf3d0('0xc5'));var _0x4b1b84=ejs[_0xf3d0('0xc6')](_0x6ffdf3,{'body':_[_0xf3d0('0xc7')](_0x18588c['body']['body']),'bodyTitle':_0x145022[_0xf3d0('0xc8')]});return db[_0xf3d0('0xc9')][_0xf3d0('0x4f')]({'body':_0x4b1b84,'plainBody':htmlToText[_0xf3d0('0xca')](_0x4b1b84),'ContactId':_0x16b747['id'],'ChatWebsiteId':_0x145022['id']});}})[_0xf3d0('0x29')](function(_0x507c93){_0x2ac327=_0x507c93;if(_0xb86039['length']){var _0x34e578=_0xb86039['map'](function(_0x3579ac){return{'name':_0x3579ac[_0xf3d0('0xcb')],'basename':_0x3579ac[_0xf3d0('0x68')],'type':_0x3579ac['mimetype'],'ChatOfflineMessageId':_0x507c93['id']};});_0x382374=_0x34e578['map'](_0x46c7a7=>{var _0x46040f={'filename':_0x46c7a7[_0xf3d0('0x2e')],'path':path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],'server',_0xf3d0('0xbd'),_0xf3d0('0xcc'),_0xf3d0('0xcd'),_0x46c7a7[_0xf3d0('0xce')])};return _0x46040f;});if(!_0x145022[_0xf3d0('0xcf')]){return db[_0xf3d0('0xd0')][_0xf3d0('0xd1')](function(_0x4500b7){return db[_0xf3d0('0xd2')][_0xf3d0('0xd3')](_0x34e578,{'transaction':_0x4500b7});});}}})[_0xf3d0('0x29')](function(){if(_0x2ac327){_0x3087ad=_0x2ac327;return db[_0xf3d0('0xc1')][_0xf3d0('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf3d0('0xd4'),'raw':!![],'include':[{'model':db[_0xf3d0('0xd5')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xf3d0('0x29')](function(_0x2c862a){if(_0x2c862a&&_0x2c862a[_0xf3d0('0xd4')]&&_0x145022[_0xf3d0('0xd6')]&&_0x145022[_0xf3d0('0xd7')]){var _0x2e6612=_0x2c862a[_0xf3d0('0xd8')]();return respondWithRpcPromise(_0xf3d0('0xd9'),'sendMail',{'account':_0x2e6612,'message':{'from':util[_0xf3d0('0x9c')](_0xf3d0('0xda'),_0x2c862a[_0xf3d0('0x2e')],_0x2c862a[_0xf3d0('0xdb')]||_0x2c862a['Smtp'][_0xf3d0('0x51')]),'to':_0x145022[_0xf3d0('0xd7')],'subject':_0x145022[_0xf3d0('0xdc')],'html':_0x3087ad[_0xf3d0('0x50')],'attachments':_0x382374}},client9003)['then'](function(){return _0x3087ad;})[_0xf3d0('0x1e')](function(_0x1f6ef2){logger['error'](_0x1f6ef2);});}})['then'](function(){if(_0x145022&&_0x145022[_0xf3d0('0xcf')]&&_0x145022['MailAccountId']){var _0x43cbcc=[];if(_0xb86039['length']){_0x43cbcc=_0xb86039['map'](function(_0x5e39c7){return{'name':_0x5e39c7['originalname'],'basename':_0x5e39c7[_0xf3d0('0x68')],'type':_0x5e39c7[_0xf3d0('0xdd')],'ChatOfflineMessageId':_0x2ac327['id']};});}var _0x6fb97a;if(!_['isNil'](_0x145022[_0xf3d0('0xde')])){var _0x90d109=_[_0xf3d0('0x32')](_0x18588c[_0xf3d0('0x50')],function(_0x1f7950){return _0x1f7950;});var _0x5c85c7=_[_0xf3d0('0xdf')](_0x90d109)[0x0];var _0x3424cc=_['mapValues'](_0x5c85c7,function(_0xf3a064){return _0xf3a064;});_0x6fb97a=_0x3424cc[0x1][_0x145022[_0xf3d0('0xde')]];}var _0x242b48={'from':_0x339953[_0xf3d0('0xdb')],'firstName':_0x339953[_0xf3d0('0xa9')],'lastName':_0x339953[_0xf3d0('0xaa')],'mapKey':'email','message':{'from':_0x339953[_0xf3d0('0xdb')],'to':_0x145022[_0xf3d0('0xc1')]['email'],'cc':'','subject':_['isNil'](_0x6fb97a)?_0x145022[_0xf3d0('0xdc')]:_0x6fb97a,'messageId':'','sentAt':new Date(),'attach':_0x43cbcc[_0xf3d0('0x4e')],'attachments':_0x43cbcc,'originChannel':'Chat','ChatWebsiteId':_0x145022['id'],'ChatOfflineMessageId':_0x3087ad['id'],'originTo':_0x145022[_0xf3d0('0xc1')][_0xf3d0('0xdb')]},'body':_0x3087ad['body']};var _0x48d449={'account':{'id':_0x145022[_0xf3d0('0xe0')]},'body':_0x242b48,'log':_0xf3d0('0xe1')};return respondWithRpcPromise(_0xf3d0('0xe1'),'notifyMail',_0x48d449,client9001)[_0xf3d0('0x29')](function(){return _0x3087ad;})[_0xf3d0('0x1e')](function(_0x49d73e){logger[_0xf3d0('0x1a')](_0x49d73e);});}return;})[_0xf3d0('0x29')](function(){if(_0x3087ad){return _0x3087ad;}})[_0xf3d0('0x29')](respondWithResult(_0x392e9d,null))[_0xf3d0('0x1e')](function(_0x90a8be){logger[_0xf3d0('0x1a')](_0xf3d0('0x1e'),_0x90a8be);for(var _0x1f302f of _0xb86039){var _0x4b8f10=path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0xe2'),_0xf3d0('0xbd'),'attachments',_0xf3d0('0xcd'),_0x1f302f[_0xf3d0('0x68')]);fs_extra[_0xf3d0('0xe3')](_0x4b8f10)['catch'](function(_0x28a89e){logger[_0xf3d0('0x1a')]('Could\x20not\x20remove\x20attachment\x20file',_0x4b8f10,_0x28a89e);});}});};exports[_0xf3d0('0xe4')]=function(_0x30359e,_0x228c9c){return db[_0xf3d0('0xa3')]['find']({'where':{'id':_0x30359e['params']['id']}})['then'](handleEntityNotFound(_0x228c9c,null))[_0xf3d0('0x29')](function(_0x140fb6){if(_0x140fb6){return _0x140fb6[_0xf3d0('0xe4')](_0x30359e['body']['ids'],_[_0xf3d0('0xe5')](_0x30359e[_0xf3d0('0x50')],['ids','id'])||{});}})[_0xf3d0('0x29')](respondWithResult(_0x228c9c,null))[_0xf3d0('0x1e')](handleError(_0x228c9c,null));};exports[_0xf3d0('0xe6')]=function(_0x4f5583,_0x241b49){var _0x5077bf={'raw':![],'where':{}};var _0x590f5d={};var _0xb42bd2={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')]['findOne']({'where':{'id':_0x4f5583[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x241b49,null))['then'](function(_0x16958c){if(_0x16958c){_0x590f5d[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db['ChatInteraction'][_0xf3d0('0x34')]);_0x590f5d[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x4f5583[_0xf3d0('0x39')]);_0x590f5d[_0xf3d0('0x3b')]=_['intersection'](_0x590f5d[_0xf3d0('0x38')],_0x590f5d[_0xf3d0('0x39')]);_0x5077bf[_0xf3d0('0x3e')]=_[_0xf3d0('0x3c')](_0x590f5d[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x4f5583['query'][_0xf3d0('0x3d')]));_0x5077bf['attributes']=_0x5077bf[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x5077bf['attributes']:_0x590f5d[_0xf3d0('0x38')];if(!_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x5077bf[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x5077bf['offset']=qs[_0xf3d0('0x21')](_0x4f5583[_0xf3d0('0x39')]['offset']);}_0x5077bf[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x4f5583[_0xf3d0('0x39')]['sort']);_0x5077bf[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x4f5583['query'],_0x590f5d[_0xf3d0('0x3b')]));_0x5077bf[_0xf3d0('0x43')][_0xf3d0('0x59')]=_0x16958c['id'];if(_0x4f5583['query'][_0xf3d0('0x45')]){_0x5077bf[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x5077bf[_0xf3d0('0x43')],{'$or':_['map'](_0x5077bf[_0xf3d0('0x3e')],function(_0x4c3d21){var _0x5e0df8={};_0x5e0df8[_0x4c3d21]={'$like':'%'+_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x5e0df8;})});}_0x5077bf=_[_0xf3d0('0x46')]({},_0x5077bf,_0x4f5583[_0xf3d0('0xe7')]);return db[_0xf3d0('0xa3')]['count']({'where':_0x5077bf[_0xf3d0('0x43')]})[_0xf3d0('0x29')](function(_0x5f162e){_0xb42bd2['count']=_0x5f162e;if(_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0x48')]){_0x5077bf[_0xf3d0('0x49')]=[{'model':db['CmContact'],'as':_0xf3d0('0xe8'),'required':![]},{'model':db[_0xf3d0('0xb3')],'as':_0xf3d0('0xe9'),'attributes':[_0xf3d0('0x2e'),_0xf3d0('0xea'),_0xf3d0('0xeb')],'required':![]},{'model':db[_0xf3d0('0xec')],'as':_0xf3d0('0xed'),'attributes':['id','name',_0xf3d0('0xee')],'where':_0x4f5583['query'][_0xf3d0('0xef')]?{'id':_0x4f5583[_0xf3d0('0x39')][_0xf3d0('0xef')]}:undefined,'required':_0x4f5583['query'][_0xf3d0('0xef')]?!![]:![]}];}return db[_0xf3d0('0xa3')][_0xf3d0('0x4a')](_0x5077bf);})[_0xf3d0('0x29')](function(_0x432f01){_0xb42bd2['rows']=_0x432f01;return _0xb42bd2;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x241b49,_0x5077bf))[_0xf3d0('0x1e')](handleError(_0x241b49,null));};function iftimePromise(_0x496736,_0x3f1f9d){return respondWithRpcPromise(_0xf3d0('0xf0'),_0xf3d0('0xf1'),{'command':_0x3f1f9d[_0xf3d0('0xf2')]?util[_0xf3d0('0x9c')]('iftime\x20%s,%s',_0x496736[_0xf3d0('0xf3')],_0x3f1f9d[_0xf3d0('0xf2')]):util['format']('iftime\x20%s',_0x496736['interval'])},client9002)[_0xf3d0('0x29')](function(_0x27cdc2){var _0x3dd850=_0x27cdc2&&_0x27cdc2['indexOf']('true')>=0x0?!![]:![];logger[_0xf3d0('0x15')](_0xf3d0('0xf4'),_0x3f1f9d['id'],_0x496736['id'],_0x496736[_0xf3d0('0xf3')],_0x3dd850?_0xf3d0('0xf5'):_0xf3d0('0xf6'),_0x3f1f9d[_0xf3d0('0xf2')]?_0x3f1f9d['timezone']:_0xf3d0('0xf7'));return _0x3dd850;})[_0xf3d0('0x1e')](function(_0x32e831){logger[_0xf3d0('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3f1f9d['id'],_0x496736['id'],_0x496736['interval'],util['inspect'](_0x32e831,{'showHidden':![],'depth':null}),_0x3f1f9d['timezone']?_0x3f1f9d['timezone']:_0xf3d0('0xf7'));return![];});}exports['getSnippet']=function(_0x3caef7,_0x3d7efe){var _0x4d4078=0x0;var _0x3ccac5=0x0;var _0x552e04=![];var _0x42c1ee;var _0xe65435;return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x3caef7[_0xf3d0('0x4c')]['id']},'include':[{'model':db[_0xf3d0('0xf8')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xf3d0('0xf3')],'raw':!![]}]}]})[_0xf3d0('0x29')](handleEntityNotFound(_0x3d7efe,null))[_0xf3d0('0x29')](function(_0x3c59e1){if(_0x3c59e1){_0x42c1ee=_0x3c59e1;return _0x3c59e1[_0xf3d0('0xf9')]({'raw':!![]});}})[_0xf3d0('0x29')](function(_0x458d29){if(_0x42c1ee){if(_0x458d29){_0xe65435=_0x458d29;}}return require(_0xf3d0('0x6c'))[_0xf3d0('0x6d')]();})[_0xf3d0('0x29')](function(_0x410152){if(_0x410152){_0x3ccac5=_0x410152[_0xf3d0('0xfa')];_0x552e04=_0x410152[_0xf3d0('0x6e')];}})['then'](function(){return db[_0xf3d0('0xa3')][_0xf3d0('0x24')]({'where':{'closed':![]}});})[_0xf3d0('0x29')](function(_0x472e11){_0x4d4078=_0x472e11;if(_0x3ccac5&&_0x472e11>_0x3ccac5){return db['License'][_0xf3d0('0x5b')]({'where':{'id':0x1}})[_0xf3d0('0x29')](function(_0x432c11){if(_0x432c11){_0x432c11[_0xf3d0('0xfb')](_0xf3d0('0xfc'));}});}})[_0xf3d0('0x29')](function(){if(_0x42c1ee[_0xf3d0('0xf8')]&&_0x42c1ee[_0xf3d0('0xf8')]['Intervals']){var _0x41002c=[];for(var _0x23a665=0x0;_0x23a665<_0x42c1ee['Interval'][_0xf3d0('0xfd')][_0xf3d0('0x4e')];_0x23a665++){var _0x7856df=_0x42c1ee[_0xf3d0('0xf8')][_0xf3d0('0xfd')][_0x23a665]['get']({'plain':!![]});_0x41002c[_0xf3d0('0xae')](iftimePromise(_0x7856df,_0x42c1ee));}return BPromise[_0xf3d0('0xfe')](_0x41002c)['then'](function(_0x34aa0e){return _['some'](_0x34aa0e);});}else{return!![];}})[_0xf3d0('0x29')](function(_0x119bf0){var _0x1d73c5=fs[_0xf3d0('0xc3')](path[_0xf3d0('0x6a')](config[_0xf3d0('0x6b')],_0xf3d0('0xff')),_0xf3d0('0xc5'));var _0x2e63df={'remote':_0x42c1ee['remote'],'query':querystring['stringify'](_[_0xf3d0('0x46')](_0x42c1ee['get']({'plain':!![]}),{'customerIp':_0x3caef7[_0xf3d0('0x7b')][_0xf3d0('0x96')]||_0x3caef7[_0xf3d0('0x7b')][_0xf3d0('0x100')]||_0x3caef7[_0xf3d0('0x101')][_0xf3d0('0x102')]||_0x3caef7['ip'],'referer':_0x3caef7[_0xf3d0('0x7b')][_0xf3d0('0x99')],'openedInteractions':_0x4d4078,'maxInteractions':_0x3ccac5,'virtual':_0x552e04['virtual'],'online':_0x119bf0,'custom':_0x552e04}))[_0xf3d0('0x103')](/'/g,'\x5c\x27')};_0x3d7efe['send'](ejs[_0xf3d0('0xc6')](Mustache[_0xf3d0('0xc6')](_0x1d73c5,_0x2e63df),{'proactiveActions':_0xe65435,'alignment':_0x42c1ee['alignment'],'verticalAlignment':_0x42c1ee[_0xf3d0('0x104')],'div_color':_0x42c1ee[_0xf3d0('0xee')],'labelText':_0x42c1ee[_0xf3d0('0x105')],'text_color':_0x42c1ee[_0xf3d0('0x106')],'text_button_color':_0x42c1ee['textButtonColor'],'button_color':_0x42c1ee[_0xf3d0('0x107')],'background_color':_0x42c1ee[_0xf3d0('0x108')],'hideWhenOffline':_0x42c1ee[_0xf3d0('0x109')],'interval':_0x42c1ee[_0xf3d0('0x10a')]}));})[_0xf3d0('0x1e')](handleError(_0x3d7efe,null));};exports[_0xf3d0('0x10b')]=function(_0x560fd3,_0x76980c){var _0xed510c=_0x560fd3[_0xf3d0('0x4c')]['id'];var _0x1e3141=_0x560fd3[_0xf3d0('0x50')];var _0xa2dbf2=0xc8;var _0x6daa6=null;return db['sequelize'][_0xf3d0('0xd1')]({'isolationLevel':db[_0xf3d0('0xd0')][_0xf3d0('0x10c')][_0xf3d0('0x10d')][_0xf3d0('0x10e')]},function(_0x10c3f4){return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0xed510c},'transaction':_0x10c3f4})[_0xf3d0('0x29')](function(_0x162e15){if(_0x162e15){return db[_0xf3d0('0x10f')][_0xf3d0('0x28')]({'where':{'ChatWebsiteId':_0xed510c},'transaction':_0x10c3f4})[_0xf3d0('0x29')](function(){var _0x4568ef=_[_0xf3d0('0x32')](_0x1e3141,function(_0x6c35a4){_0x6c35a4['ChatWebsiteId']=_0xed510c;return _0x6c35a4;});return db[_0xf3d0('0x10f')][_0xf3d0('0xd3')](_0x4568ef,{'transaction':_0x10c3f4});});}else{_0xa2dbf2=0x194;_0x6daa6=[];}});})[_0xf3d0('0x29')](function(){if(_0xa2dbf2!==0x194){return db[_0xf3d0('0x10f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0xed510c},'order':_0xf3d0('0x110')})[_0xf3d0('0x29')](function(_0x2290c5){_0x6daa6=_0x2290c5;});}})[_0xf3d0('0x1e')](function(_0x22af69){_0xa2dbf2=0x1f4;logger[_0xf3d0('0x1a')](_0x22af69['stack']);if(_0x22af69['name']){delete _0x22af69[_0xf3d0('0x2e')];}_0x6daa6=_0x22af69;})['finally'](function(){if(_0x6daa6===null){_0x76980c[_0xf3d0('0x1f')](_0xa2dbf2);}else{if(_0xa2dbf2===0x1f4){_0x76980c['status'](_0xa2dbf2)[_0xf3d0('0x2f')](_0x6daa6);}else{_0x76980c[_0xf3d0('0x25')](_0xa2dbf2)[_0xf3d0('0x20')](_0x6daa6);}}});};exports['getApplications']=function(_0x243676,_0x4b51c2){var _0x5551c6={};var _0xe0064a={};var _0x54eb60;var _0x4cadc1;return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x243676[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b51c2,null))['then'](function(_0x493e0b){if(_0x493e0b){_0x54eb60=_0x493e0b;_0xe0064a[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0x10f')][_0xf3d0('0x34')]);_0xe0064a['query']=_[_0xf3d0('0x3a')](_0x243676[_0xf3d0('0x39')]);_0xe0064a[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0xe0064a[_0xf3d0('0x38')],_0xe0064a['query']);_0x5551c6[_0xf3d0('0x3e')]=_['intersection'](_0xe0064a[_0xf3d0('0x38')],qs[_0xf3d0('0x3d')](_0x243676['query'][_0xf3d0('0x3d')]));_0x5551c6['attributes']=_0x5551c6[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x5551c6[_0xf3d0('0x3e')]:_0xe0064a[_0xf3d0('0x38')];_0x5551c6['order']=qs['sort'](_0x243676[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x5551c6[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x243676[_0xf3d0('0x39')],_0xe0064a[_0xf3d0('0x3b')]));if(_0x243676[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x5551c6[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x5551c6['where'],{'$or':_[_0xf3d0('0x32')](_0x5551c6['attributes'],function(_0x391c0c){var _0x385173={};_0x385173[_0x391c0c]={'$like':'%'+_0x243676['query'][_0xf3d0('0x45')]+'%'};return _0x385173;})});}_0x5551c6=_[_0xf3d0('0x46')]({},_0x5551c6,_0x243676[_0xf3d0('0xe7')]);return _0x54eb60[_0xf3d0('0x111')](_0x5551c6);}})[_0xf3d0('0x29')](function(_0x401b41){if(_0x401b41){_0x4cadc1=_0x401b41['length'];if(!_0x243676[_0xf3d0('0x39')]['hasOwnProperty']('nolimit')){_0x5551c6[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x243676[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x5551c6[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x243676['query'][_0xf3d0('0x21')]);}return _0x54eb60['getApplications'](_0x5551c6);}})[_0xf3d0('0x29')](function(_0x4967d5){if(_0x4967d5){return _0x4967d5?{'count':_0x4cadc1,'rows':_0x4967d5}:null;}})[_0xf3d0('0x29')](respondWithResult(_0x4b51c2,null))[_0xf3d0('0x1e')](handleError(_0x4b51c2,null));};exports[_0xf3d0('0x112')]=function(_0x5d9653,_0x3ad00a){return db['chatProactiveAction']['find']({'where':{'id':_0x5d9653['params']['id']}})['then'](handleEntityNotFound(_0x3ad00a,null))[_0xf3d0('0x29')](function(_0x1552ad){if(_0x1552ad){return _0x1552ad['addProactiveActions'](_0x5d9653['body'][_0xf3d0('0x5d')],_[_0xf3d0('0xe5')](_0x5d9653[_0xf3d0('0x50')],[_0xf3d0('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x3ad00a,null))['catch'](handleError(_0x3ad00a,null));};exports[_0xf3d0('0xf9')]=function(_0x2e7d2a,_0x1d7459){var _0x29d1e6={};var _0x58e3f4={};var _0x26de3b;var _0x5ecae9;return db['ChatWebsite'][_0xf3d0('0x5b')]({'where':{'id':_0x2e7d2a[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x1d7459,null))[_0xf3d0('0x29')](function(_0x371d03){if(_0x371d03){_0x26de3b=_0x371d03;_0x58e3f4[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0x113')][_0xf3d0('0x34')]);_0x58e3f4['query']=_[_0xf3d0('0x3a')](_0x2e7d2a[_0xf3d0('0x39')]);_0x58e3f4[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0x58e3f4['model'],_0x58e3f4['query']);_0x29d1e6['attributes']=_[_0xf3d0('0x3c')](_0x58e3f4[_0xf3d0('0x38')],qs['fields'](_0x2e7d2a[_0xf3d0('0x39')][_0xf3d0('0x3d')]));_0x29d1e6[_0xf3d0('0x3e')]=_0x29d1e6[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0x29d1e6[_0xf3d0('0x3e')]:_0x58e3f4[_0xf3d0('0x38')];_0x29d1e6[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x2e7d2a[_0xf3d0('0x39')][_0xf3d0('0x42')]);_0x29d1e6['where']=qs['filters'](_[_0xf3d0('0x44')](_0x2e7d2a[_0xf3d0('0x39')],_0x58e3f4[_0xf3d0('0x3b')]));if(_0x2e7d2a[_0xf3d0('0x39')]['filter']){_0x29d1e6[_0xf3d0('0x43')]=_[_0xf3d0('0x46')](_0x29d1e6[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x29d1e6['attributes'],function(_0x51ef1f){var _0x445298={};_0x445298[_0x51ef1f]={'$like':'%'+_0x2e7d2a['query'][_0xf3d0('0x45')]+'%'};return _0x445298;})});}_0x29d1e6=_[_0xf3d0('0x46')]({},_0x29d1e6,_0x2e7d2a[_0xf3d0('0xe7')]);return _0x26de3b[_0xf3d0('0xf9')](_0x29d1e6);}})[_0xf3d0('0x29')](function(_0x18b792){if(_0x18b792){_0x5ecae9=_0x18b792[_0xf3d0('0x4e')];if(!_0x2e7d2a['query'][_0xf3d0('0x3f')](_0xf3d0('0x40'))){_0x29d1e6[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x2e7d2a['query']['limit']);_0x29d1e6[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x2e7d2a['query'][_0xf3d0('0x21')]);}return _0x26de3b[_0xf3d0('0xf9')](_0x29d1e6);}})[_0xf3d0('0x29')](function(_0x3a4a9e){if(_0x3a4a9e){return _0x3a4a9e?{'count':_0x5ecae9,'rows':_0x3a4a9e}:null;}})[_0xf3d0('0x29')](respondWithResult(_0x1d7459,null))[_0xf3d0('0x1e')](handleError(_0x1d7459,null));};exports['getFields']=function(_0x21175f,_0x1c68c2){var _0x574e01=_0x21175f['query'][_0xf3d0('0x114')]===_0xf3d0('0x115')?_0xf3d0('0x116'):_0xf3d0('0x117');return db['ChatWebsite'][_0xf3d0('0x56')]({'attributes':['id',_0x574e01],'where':{'id':_0x21175f['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x1c68c2,null))[_0xf3d0('0x29')](function(_0x544174){if(_0x544174){var _0x57c410=_0x544174[_0x574e01];var _0x2536f9=_0x57c410&&_0x57c410[_0xf3d0('0x118')]?_0x57c410[_0xf3d0('0x118')]:[];_0x1c68c2[_0xf3d0('0x2f')]({'fromKey':_[_0xf3d0('0x6f')](_0x57c410[_0xf3d0('0x119')])?undefined:_0x57c410[_0xf3d0('0x119')],'count':_0x2536f9['length'],'rows':_0x2536f9});}})[_0xf3d0('0x1e')](handleError(_0x1c68c2,null));};exports[_0xf3d0('0x11a')]=function(_0x3aab92,_0x244f8d){var _0xdfd280={'raw':![],'where':{}};var _0x204f97={};var _0xbe3657={'count':0x0,'rows':[]};return db[_0xf3d0('0x33')][_0xf3d0('0x5b')]({'where':{'id':_0x3aab92['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x244f8d,null))[_0xf3d0('0x29')](function(_0x31d713){if(_0x31d713){_0x204f97[_0xf3d0('0x38')]=_['keys'](db[_0xf3d0('0xc9')][_0xf3d0('0x34')]);_0x204f97[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x3aab92['query']);_0x204f97[_0xf3d0('0x3b')]=_[_0xf3d0('0x3c')](_0x204f97[_0xf3d0('0x38')],_0x204f97[_0xf3d0('0x39')]);_0xdfd280['attributes']=_[_0xf3d0('0x3c')](_0x204f97['model'],qs[_0xf3d0('0x3d')](_0x3aab92['query'][_0xf3d0('0x3d')]));_0xdfd280[_0xf3d0('0x3e')]=_0xdfd280[_0xf3d0('0x3e')][_0xf3d0('0x4e')]?_0xdfd280[_0xf3d0('0x3e')]:_0x204f97['model'];if(!_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x3f')]('nolimit')){_0xdfd280[_0xf3d0('0x22')]=qs[_0xf3d0('0x22')](_0x3aab92['query'][_0xf3d0('0x22')]);_0xdfd280[_0xf3d0('0x21')]=qs[_0xf3d0('0x21')](_0x3aab92['query']['offset']);}_0xdfd280[_0xf3d0('0x41')]=qs['sort'](_0x3aab92['query'][_0xf3d0('0x42')]);_0xdfd280['where']=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x3aab92[_0xf3d0('0x39')],_0x204f97[_0xf3d0('0x3b')]));_0xdfd280[_0xf3d0('0x43')]['ChatWebsiteId']=_0x31d713['id'];if(_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0xdfd280[_0xf3d0('0x43')]=_['merge'](_0xdfd280[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0xdfd280[_0xf3d0('0x3e')],function(_0x30b442){var _0x5de6c8={};_0x5de6c8[_0x30b442]={'$like':'%'+_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x5de6c8;})});}_0xdfd280=_[_0xf3d0('0x46')]({},_0xdfd280,_0x3aab92[_0xf3d0('0xe7')]);return db['ChatOfflineMessage']['count']({'where':_0xdfd280[_0xf3d0('0x43')]})['then'](function(_0x27a156){_0xbe3657[_0xf3d0('0x24')]=_0x27a156;if(_0x3aab92[_0xf3d0('0x39')][_0xf3d0('0x48')]){_0xdfd280['include']=[{'all':!![]}];}else{_0xdfd280[_0xf3d0('0x49')]=[{'model':db[_0xf3d0('0x7f')],'as':_0xf3d0('0xe8'),'required':![]},{'model':db[_0xf3d0('0xd2')],'as':_0xf3d0('0x11b'),'required':![]}];}return db[_0xf3d0('0xc9')][_0xf3d0('0x4a')](_0xdfd280);})[_0xf3d0('0x29')](function(_0x5bdf5b){_0xbe3657[_0xf3d0('0x5c')]=_0x5bdf5b;return _0xbe3657;});}})[_0xf3d0('0x29')](respondWithFilteredResult(_0x244f8d,_0xdfd280))[_0xf3d0('0x1e')](handleError(_0x244f8d,null));};exports[_0xf3d0('0x11c')]=function(_0x106e5d,_0x55afde){return db[_0xf3d0('0x33')]['find']({'where':{'id':_0x106e5d[_0xf3d0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x55afde,null))[_0xf3d0('0x29')](function(_0x308ef){if(_0x308ef){return _0x308ef['addAgents'](_0x106e5d[_0xf3d0('0x50')][_0xf3d0('0x5d')],_['omit'](_0x106e5d[_0xf3d0('0x50')],[_0xf3d0('0x5d'),'id'])||{})[_0xf3d0('0xa7')](function(_0x4e5061){for(var _0x53cd38=0x0;_0x53cd38<_0x106e5d[_0xf3d0('0x50')]['ids'][_0xf3d0('0x4e')];_0x53cd38+=0x1){socket[_0xf3d0('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x106e5d['body'][_0xf3d0('0x5d')][_0x53cd38]),'ChatWebsiteId':Number(_0x106e5d[_0xf3d0('0x4c')]['id'])});}return _0x4e5061;});}})[_0xf3d0('0x29')](respondWithResult(_0x55afde,null))[_0xf3d0('0x1e')](handleError(_0x55afde,null));};exports[_0xf3d0('0x11e')]=function(_0x3269b4,_0x118616){return db[_0xf3d0('0x33')][_0xf3d0('0x56')]({'where':{'id':_0x3269b4[_0xf3d0('0x4c')]['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x118616,null))[_0xf3d0('0x29')](function(_0x325119){if(_0x325119){return _0x325119[_0xf3d0('0x11e')](_0x3269b4['query'][_0xf3d0('0x5d')])[_0xf3d0('0x29')](function(){if(_['isArray'](_0x3269b4[_0xf3d0('0x39')][_0xf3d0('0x5d')])){for(var _0xd54e7f=0x0;_0xd54e7f<_0x3269b4[_0xf3d0('0x39')][_0xf3d0('0x5d')]['length'];_0xd54e7f+=0x1){socket[_0xf3d0('0x11d')](_0xf3d0('0x11f'),{'UserId':Number(_0x3269b4[_0xf3d0('0x39')][_0xf3d0('0x5d')][_0xd54e7f]),'ChatWebsiteId':Number(_0x3269b4[_0xf3d0('0x4c')]['id'])});}}else{socket[_0xf3d0('0x11d')](_0xf3d0('0x11f'),{'UserId':Number(_0x3269b4[_0xf3d0('0x39')]['ids']),'ChatWebsiteId':Number(_0x3269b4[_0xf3d0('0x4c')]['id'])});}});}})[_0xf3d0('0x29')](respondWithStatusCode(_0x118616,null))['catch'](handleError(_0x118616,null));};exports['getAgents']=function(_0x495312,_0x30a2e8){var _0x200dbb={};var _0x20b76e={};var _0x19a8b7;var _0xfdb394;return db['ChatWebsite'][_0xf3d0('0x5b')]({'where':{'id':_0x495312['params']['id']}})[_0xf3d0('0x29')](handleEntityNotFound(_0x30a2e8,null))[_0xf3d0('0x29')](function(_0x121e09){if(_0x121e09){_0x19a8b7=_0x121e09;_0x20b76e[_0xf3d0('0x38')]=_[_0xf3d0('0x3a')](db[_0xf3d0('0xb3')][_0xf3d0('0x34')]);_0x20b76e[_0xf3d0('0x39')]=_[_0xf3d0('0x3a')](_0x495312[_0xf3d0('0x39')]);_0x20b76e['filters']=_[_0xf3d0('0x3c')](_0x20b76e[_0xf3d0('0x38')],_0x20b76e[_0xf3d0('0x39')]);_0x200dbb['attributes']=_[_0xf3d0('0x3c')](_0x20b76e['model'],qs[_0xf3d0('0x3d')](_0x495312['query']['fields']));_0x200dbb[_0xf3d0('0x3e')]=_0x200dbb[_0xf3d0('0x3e')]['length']?_0x200dbb[_0xf3d0('0x3e')]:_0x20b76e['model'];_0x200dbb[_0xf3d0('0x41')]=qs[_0xf3d0('0x42')](_0x495312[_0xf3d0('0x39')]['sort']);_0x200dbb[_0xf3d0('0x43')]=qs[_0xf3d0('0x3b')](_[_0xf3d0('0x44')](_0x495312[_0xf3d0('0x39')],_0x20b76e[_0xf3d0('0x3b')]));if(_0x495312[_0xf3d0('0x39')][_0xf3d0('0x45')]){_0x200dbb['where']=_[_0xf3d0('0x46')](_0x200dbb[_0xf3d0('0x43')],{'$or':_[_0xf3d0('0x32')](_0x200dbb[_0xf3d0('0x3e')],function(_0x4414da){var _0x1c357c={};_0x1c357c[_0x4414da]={'$like':'%'+_0x495312[_0xf3d0('0x39')][_0xf3d0('0x45')]+'%'};return _0x1c357c;})});}_0x200dbb=_['merge']({},_0x200dbb,_0x495312['options']);return _0x19a8b7[_0xf3d0('0x120')](_0x200dbb);}})[_0xf3d0('0x29')](function(_0x414a07){if(_0x414a07){_0xfdb394=_0x414a07[_0xf3d0('0x4e')];if(!_0x495312[_0xf3d0('0x39')]['hasOwnProperty'](_0xf3d0('0x40'))){_0x200dbb['limit']=qs[_0xf3d0('0x22')](_0x495312[_0xf3d0('0x39')][_0xf3d0('0x22')]);_0x200dbb['offset']=qs['offset'](_0x495312[_0xf3d0('0x39')][_0xf3d0('0x21')]);}return _0x19a8b7['getAgents'](_0x200dbb);}})['then'](function(_0x2b9849){if(_0x2b9849){return _0x2b9849?{'count':_0xfdb394,'rows':_0x2b9849}:null;}})[_0xf3d0('0x29')](respondWithResult(_0x30a2e8,null))['catch'](handleError(_0x30a2e8,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a0788bf..b46d900 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 _0x5a52=['update','remove','emit','hasOwnProperty','exports','events','save'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a52,0x18d));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x25a5('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x25a5('0x1'),'afterUpdate':_0x25a5('0x2'),'afterDestroy':_0x25a5('0x3')};function emitEvent(_0x2f17d9){return function(_0x2fc1db,_0x407636,_0x1d9132){ChatWebsiteEvents[_0x25a5('0x4')](_0x2f17d9+':'+_0x2fc1db['id'],_0x2fc1db);ChatWebsiteEvents['emit'](_0x2f17d9,_0x2fc1db);_0x1d9132(null);};}for(var e in events){if(events[_0x25a5('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x25a5('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa7b4=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','save'];(function(_0x4fe704,_0x243304){var _0x5e604b=function(_0x5562ca){while(--_0x5562ca){_0x4fe704['push'](_0x4fe704['shift']());}};_0x5e604b(++_0x243304);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x3f8dfa,_0x4ca511){_0x3f8dfa=_0x3f8dfa-0x0;var _0x4fd797=_0xa7b4[_0x3f8dfa];return _0x4fd797;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x4a7b('0x0'))['db'][_0x4a7b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4a7b('0x2'),'afterUpdate':_0x4a7b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5de6a2){return function(_0x4cadbf,_0x8c0229,_0x348341){ChatWebsiteEvents['emit'](_0x5de6a2+':'+_0x4cadbf['id'],_0x4cadbf);ChatWebsiteEvents[_0x4a7b('0x4')](_0x5de6a2,_0x4cadbf);_0x348341(null);};}for(var e in events){if(events[_0x4a7b('0x5')](e)){var event=events[e];ChatWebsite[_0x4a7b('0x6')](e,emitEvent(event));}}module[_0x4a7b('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 81ea3c2..41d8448 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 _0x3c86=['chat_websites','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x1e053f,_0x53ce14){var _0x4a0c43=function(_0x2518c3){while(--_0x2518c3){_0x1e053f['push'](_0x1e053f['shift']());}};_0x4a0c43(++_0x53ce14);}(_0x3c86,0x6d));var _0x63c8=function(_0x374bbd,_0x35a7b4){_0x374bbd=_0x374bbd-0x0;var _0x1470b7=_0x3c86[_0x374bbd];return _0x1470b7;};'use strict';var _=require('lodash');var util=require(_0x63c8('0x0'));var logger=require(_0x63c8('0x1'))(_0x63c8('0x2'));var moment=require('moment');var BPromise=require(_0x63c8('0x3'));var rp=require(_0x63c8('0x4'));var fs=require('fs');var path=require(_0x63c8('0x5'));var rimraf=require(_0x63c8('0x6'));var config=require('../../config/environment');var attributes=require(_0x63c8('0x7'));module[_0x63c8('0x8')]=function(_0x149023,_0xc8e0ca){return _0x149023[_0x63c8('0x9')](_0x63c8('0xa'),attributes,{'tableName':_0x63c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3075=['bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x3075,0x18f));var _0x5307=function(_0x45a003,_0x2d9b81){_0x45a003=_0x45a003-0x0;var _0x228bae=_0x3075[_0x45a003];return _0x228bae;};'use strict';var _=require(_0x5307('0x0'));var util=require(_0x5307('0x1'));var logger=require(_0x5307('0x2'))(_0x5307('0x3'));var moment=require('moment');var BPromise=require(_0x5307('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5307('0x5'));var rimraf=require(_0x5307('0x6'));var config=require(_0x5307('0x7'));var attributes=require(_0x5307('0x8'));module[_0x5307('0x9')]=function(_0x39ad95,_0x297ad5){return _0x39ad95[_0x5307('0xa')](_0x5307('0xb'),attributes,{'tableName':_0x5307('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index e1a3e86..3b17717 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 _0x4199=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4199,0xb4));var _0x9419=function(_0x300bc5,_0xde5424){_0x300bc5=_0x300bc5-0x0;var _0x2223b5=_0x4199[_0x300bc5];return _0x2223b5;};'use strict';var _=require(_0x9419('0x0'));var util=require(_0x9419('0x1'));var moment=require(_0x9419('0x2'));var BPromise=require('bluebird');var rs=require(_0x9419('0x3'));var fs=require('fs');var Redis=require(_0x9419('0x4'));var db=require(_0x9419('0x5'))['db'];var utils=require(_0x9419('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9419('0x7'));var jayson=require(_0x9419('0x8'));var client=jayson[_0x9419('0x9')][_0x9419('0xa')]({'port':0x232a});config[_0x9419('0xb')]=_[_0x9419('0xc')](config[_0x9419('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9419('0xd'))(new Redis(config[_0x9419('0xb')]));require(_0x9419('0xe'))[_0x9419('0xf')](socket);function respondWithRpcPromise(_0xb32e78,_0x2ffd0c,_0x4793e6){return new BPromise(function(_0x527c8d,_0x1955bc){return client['request'](_0xb32e78,_0x4793e6)[_0x9419('0x10')](function(_0x27bb4b){logger['info'](_0x9419('0x11'),_0x2ffd0c,_0x9419('0x12'));logger[_0x9419('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2ffd0c,_0x9419('0x12'),JSON['stringify'](_0x27bb4b));if(_0x27bb4b[_0x9419('0x14')]){if(_0x27bb4b[_0x9419('0x14')][_0x9419('0x15')]===0x1f4){logger[_0x9419('0x14')](_0x9419('0x11'),_0x2ffd0c,_0x27bb4b[_0x9419('0x14')]['message']);return _0x1955bc(_0x27bb4b[_0x9419('0x14')]['message']);}logger[_0x9419('0x14')](_0x9419('0x11'),_0x2ffd0c,_0x27bb4b['error'][_0x9419('0x16')]);return _0x527c8d(_0x27bb4b[_0x9419('0x14')][_0x9419('0x16')]);}else{logger[_0x9419('0x17')](_0x9419('0x11'),_0x2ffd0c,'request\x20sent');_0x527c8d(_0x27bb4b[_0x9419('0x18')][_0x9419('0x16')]);}})[_0x9419('0x19')](function(_0x2aace1){logger[_0x9419('0x14')](_0x9419('0x11'),_0x2ffd0c,_0x2aace1);_0x1955bc(_0x2aace1);});});}
\ No newline at end of file
+var _0x1c57=['code','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x438ce8,_0x1cb2c9){var _0x2a63aa=function(_0x57e609){while(--_0x57e609){_0x438ce8['push'](_0x438ce8['shift']());}};_0x2a63aa(++_0x1cb2c9);}(_0x1c57,0x1a6));var _0x71c5=function(_0x354b92,_0x5acc71){_0x354b92=_0x354b92-0x0;var _0x40c7fc=_0x1c57[_0x354b92];return _0x40c7fc;};'use strict';var _=require(_0x71c5('0x0'));var util=require(_0x71c5('0x1'));var moment=require(_0x71c5('0x2'));var BPromise=require(_0x71c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71c5('0x4'))['db'];var utils=require(_0x71c5('0x5'));var logger=require('../../config/logger')(_0x71c5('0x6'));var config=require(_0x71c5('0x7'));var jayson=require(_0x71c5('0x8'));var client=jayson[_0x71c5('0x9')][_0x71c5('0xa')]({'port':0x232a});config[_0x71c5('0xb')]=_[_0x71c5('0xc')](config['redis'],{'host':_0x71c5('0xd'),'port':0x18eb});var socket=require(_0x71c5('0xe'))(new Redis(config[_0x71c5('0xb')]));require(_0x71c5('0xf'))[_0x71c5('0x10')](socket);function respondWithRpcPromise(_0x562807,_0x2f2193,_0x4c2add){return new BPromise(function(_0x600169,_0x2eb548){return client[_0x71c5('0x11')](_0x562807,_0x4c2add)[_0x71c5('0x12')](function(_0x11b756){logger[_0x71c5('0x13')](_0x71c5('0x14'),_0x2f2193,_0x71c5('0x15'));logger[_0x71c5('0x16')](_0x71c5('0x17'),_0x2f2193,_0x71c5('0x15'),JSON[_0x71c5('0x18')](_0x11b756));if(_0x11b756[_0x71c5('0x19')]){if(_0x11b756['error'][_0x71c5('0x1a')]===0x1f4){logger['error'](_0x71c5('0x14'),_0x2f2193,_0x11b756[_0x71c5('0x19')][_0x71c5('0x1b')]);return _0x2eb548(_0x11b756[_0x71c5('0x19')]['message']);}logger[_0x71c5('0x19')](_0x71c5('0x14'),_0x2f2193,_0x11b756['error'][_0x71c5('0x1b')]);return _0x600169(_0x11b756['error']['message']);}else{logger[_0x71c5('0x13')](_0x71c5('0x14'),_0x2f2193,_0x71c5('0x15'));_0x600169(_0x11b756['result'][_0x71c5('0x1b')]);}})['catch'](function(_0x27f1a1){logger[_0x71c5('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x2f2193,_0x27f1a1);_0x2eb548(_0x27f1a1);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 049b975..507f622 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 _0xb526=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x11b70e,_0x6a143d){var _0x33c8a1=function(_0x2cb22f){while(--_0x2cb22f){_0x11b70e['push'](_0x11b70e['shift']());}};_0x33c8a1(++_0x6a143d);}(_0xb526,0x170));var _0x6b52=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xb526[_0xca1f0e];return _0x35e4ef;};'use strict';var ChatWebsiteEvents=require(_0x6b52('0x0'));var events=[_0x6b52('0x1'),_0x6b52('0x2'),_0x6b52('0x3')];function createListener(_0x438d11,_0x4f9de0){return function(_0x191358){_0x4f9de0[_0x6b52('0x4')](_0x438d11,_0x191358);};}function removeListener(_0x3f8e28,_0x577379){return function(){ChatWebsiteEvents[_0x6b52('0x5')](_0x3f8e28,_0x577379);};}exports[_0x6b52('0x6')]=function(_0x5d0d4b){for(var _0x766b28=0x0,_0x2196f8=events[_0x6b52('0x7')];_0x766b28<_0x2196f8;_0x766b28++){var _0x37fb06=events[_0x766b28];var _0x45c1f8=createListener('chatWebsite:'+_0x37fb06,_0x5d0d4b);ChatWebsiteEvents['on'](_0x37fb06,_0x45c1f8);}};
\ No newline at end of file
+var _0x565d=['update','emit','removeListener','register','length','./chatWebsite.events','save'];(function(_0x63de62,_0xe5cc89){var _0x3daddf=function(_0x2a5d79){while(--_0x2a5d79){_0x63de62['push'](_0x63de62['shift']());}};_0x3daddf(++_0xe5cc89);}(_0x565d,0xc9));var _0xd565=function(_0x4478d1,_0x4d7c0f){_0x4478d1=_0x4478d1-0x0;var _0x833119=_0x565d[_0x4478d1];return _0x833119;};'use strict';var ChatWebsiteEvents=require(_0xd565('0x0'));var events=[_0xd565('0x1'),'remove',_0xd565('0x2')];function createListener(_0x586786,_0x464cb5){return function(_0x2d2871){_0x464cb5[_0xd565('0x3')](_0x586786,_0x2d2871);};}function removeListener(_0x49a117,_0x516c14){return function(){ChatWebsiteEvents[_0xd565('0x4')](_0x49a117,_0x516c14);};}exports[_0xd565('0x5')]=function(_0x1da37a){for(var _0x16c144=0x0,_0xa3149c=events[_0xd565('0x6')];_0x16c144<_0xa3149c;_0x16c144++){var _0x166379=events[_0x16c144];var _0x4171d8=createListener('chatWebsite:'+_0x166379,_0x1da37a);ChatWebsiteEvents['on'](_0x166379,_0x4171d8);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index ac19b33..f5ec731 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 _0x8b25=['/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','file','root','server/files/images/avatars/','addAvatar','/:id/customer_avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','/:id/offline','offline','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x8b25,0x77));var _0x58b2=function(_0x3ef79e,_0x24e73c){_0x3ef79e=_0x3ef79e-0x0;var _0x172304=_0x8b25[_0x3ef79e];return _0x172304;};'use strict';var multer=require(_0x58b2('0x0'));var util=require('util');var path=require(_0x58b2('0x1'));var timeout=require(_0x58b2('0x2'));var express=require('express');var router=express[_0x58b2('0x3')]();var fs_extra=require(_0x58b2('0x4'));var auth=require(_0x58b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x58b2('0x6'));var controller=require(_0x58b2('0x7'));router[_0x58b2('0x8')]('/',auth[_0x58b2('0x9')](),controller[_0x58b2('0xa')]);router['get'](_0x58b2('0xb'),auth['isAuthenticated'](),controller[_0x58b2('0xc')]);router[_0x58b2('0x8')](_0x58b2('0xd'),auth[_0x58b2('0x9')](),controller[_0x58b2('0xe')]);router[_0x58b2('0x8')](_0x58b2('0xf'),auth[_0x58b2('0x9')](),controller['getDispositions']);router[_0x58b2('0x8')]('/:id/canned_answers',auth[_0x58b2('0x9')](),controller['getAnswers']);router[_0x58b2('0x8')](_0x58b2('0x10'),controller[_0x58b2('0x11')]);router['get'](_0x58b2('0x12'),controller[_0x58b2('0x13')]);router[_0x58b2('0x8')]('/:id/customer_avatar',controller[_0x58b2('0x14')]);router[_0x58b2('0x8')](_0x58b2('0x15'),controller[_0x58b2('0x16')]);router['get'](_0x58b2('0x17'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x18')]);router['get'](_0x58b2('0x19'),controller[_0x58b2('0x1a')]);router[_0x58b2('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x58b2('0x1b')]);router[_0x58b2('0x8')](_0x58b2('0x1c'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x1d')]);router[_0x58b2('0x8')]('/:id/fields',controller[_0x58b2('0x1e')]);router[_0x58b2('0x8')](_0x58b2('0x1f'),auth['isAuthenticated'](),controller[_0x58b2('0x20')]);router[_0x58b2('0x8')](_0x58b2('0x21'),auth[_0x58b2('0x9')](),controller['getAgents']);router[_0x58b2('0x22')]('/',auth[_0x58b2('0x9')](),controller[_0x58b2('0x23')]);router[_0x58b2('0x22')](_0x58b2('0xf'),auth[_0x58b2('0x9')](),controller['addDisposition']);router[_0x58b2('0x22')](_0x58b2('0x24'),auth['isAuthenticated'](),controller[_0x58b2('0x25')]);var upload=multer({'storage':multer[_0x58b2('0x26')]({'destination':function(_0x1f8765,_0x2c31b4,_0x53af45){_0x53af45(null,path[_0x58b2('0x27')](config['root'],_0x58b2('0x28')));},'filename':function(_0x3e1e09,_0x403644,_0x33c1c5){_0x33c1c5(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date[_0x58b2('0x2b')](),_0x403644[_0x58b2('0x2c')]));}})});router[_0x58b2('0x22')](_0x58b2('0x10'),upload['single'](_0x58b2('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x58b2('0x26')]({'destination':function(_0x2cf392,_0x22bfcf,_0x7a696e){_0x7a696e(null,path[_0x58b2('0x27')](config[_0x58b2('0x2e')],_0x58b2('0x2f')));},'filename':function(_0x942851,_0x2006d4,_0x4f49f0){_0x4f49f0(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date[_0x58b2('0x2b')](),_0x2006d4[_0x58b2('0x2c')]));}})});router[_0x58b2('0x22')](_0x58b2('0x12'),upload['single'](_0x58b2('0x2d')),controller[_0x58b2('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x384305,_0x30fd26,_0x1adf1c){_0x1adf1c(null,path[_0x58b2('0x27')](config[_0x58b2('0x2e')],_0x58b2('0x2f')));},'filename':function(_0x1b9716,_0x372808,_0x82f724){_0x82f724(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date['now'](),_0x372808['originalname']));}})});router[_0x58b2('0x22')](_0x58b2('0x31'),upload[_0x58b2('0x32')]('file'),controller[_0x58b2('0x33')]);var upload=multer({'storage':multer[_0x58b2('0x26')]({'destination':function(_0x58f058,_0x517319,_0x114218){_0x114218(null,path['join'](config[_0x58b2('0x2e')],_0x58b2('0x2f')));},'filename':function(_0x2913f8,_0x53e1cb,_0x3916c5){_0x3916c5(null,util[_0x58b2('0x29')](_0x58b2('0x2a'),Date[_0x58b2('0x2b')](),_0x53e1cb[_0x58b2('0x2c')]));}})});router['post'](_0x58b2('0x15'),upload[_0x58b2('0x32')]('file'),controller[_0x58b2('0x34')]);router[_0x58b2('0x22')](_0x58b2('0x35'),controller[_0x58b2('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0xcec58a,_0x21d01c,_0x111113){const _0x5d92ae=path['join'](config[_0x58b2('0x2e')],_0x58b2('0x37'),_0x58b2('0x38'),_0x58b2('0x39'));fs_extra['ensureDir'](_0x5d92ae,function(){_0x111113(null,_0x5d92ae);});},'filename':function(_0x1dee20,_0x15b92e,_0x4fff39){const _0x4e2082=_0x15b92e['originalname'][_0x58b2('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x38991d=path['extname'](_0x4e2082);const _0x20a913=Date['now']()+'-'+_0x4e2082[_0x58b2('0x3a')](_0x38991d,'')+_0x38991d;_0x4fff39(null,_0x20a913);}})});router['post'](_0x58b2('0x3b'),offlineUploadMulter['any'](),controller[_0x58b2('0x3c')]);router['post'](_0x58b2('0x17'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x3d')]);router[_0x58b2('0x22')](_0x58b2('0x3e'),auth[_0x58b2('0x9')](),controller['addApplications']);router['post'](_0x58b2('0x1c'),auth['isAuthenticated'](),controller[_0x58b2('0x3f')]);router[_0x58b2('0x22')](_0x58b2('0x21'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x40')]);router[_0x58b2('0x41')](_0x58b2('0xd'),auth['isAuthenticated'](),controller[_0x58b2('0x42')]);router[_0x58b2('0x43')](_0x58b2('0xd'),auth[_0x58b2('0x9')](),controller['destroy']);router['delete'](_0x58b2('0xf'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x44')]);router[_0x58b2('0x43')](_0x58b2('0x24'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x45')]);router[_0x58b2('0x43')](_0x58b2('0x21'),auth[_0x58b2('0x9')](),controller[_0x58b2('0x46')]);module[_0x58b2('0x47')]=router;
\ No newline at end of file
+var _0x4220=['put','delete','destroy','removeDispositions','removeAnswers','exports','multer','connect-timeout','express','Router','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','addAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions'];(function(_0x25ff12,_0x2d0522){var _0x428ce4=function(_0xc214fd){while(--_0xc214fd){_0x25ff12['push'](_0x25ff12['shift']());}};_0x428ce4(++_0x2d0522);}(_0x4220,0xde));var _0x0422=function(_0x62d10c,_0x563e59){_0x62d10c=_0x62d10c-0x0;var _0x338a0c=_0x4220[_0x62d10c];return _0x338a0c;};'use strict';var multer=require(_0x0422('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0422('0x1'));var express=require(_0x0422('0x2'));var router=express[_0x0422('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0422('0x4'));var controller=require(_0x0422('0x5'));router[_0x0422('0x6')]('/',auth[_0x0422('0x7')](),controller[_0x0422('0x8')]);router[_0x0422('0x6')](_0x0422('0x9'),auth[_0x0422('0x7')](),controller[_0x0422('0xa')]);router['get'](_0x0422('0xb'),auth[_0x0422('0x7')](),controller['show']);router[_0x0422('0x6')](_0x0422('0xc'),auth['isAuthenticated'](),controller[_0x0422('0xd')]);router[_0x0422('0x6')](_0x0422('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x0422('0x6')](_0x0422('0xf'),controller[_0x0422('0x10')]);router['get'](_0x0422('0x11'),controller[_0x0422('0x12')]);router[_0x0422('0x6')](_0x0422('0x13'),controller[_0x0422('0x14')]);router['get'](_0x0422('0x15'),controller[_0x0422('0x16')]);router['get'](_0x0422('0x17'),auth[_0x0422('0x7')](),controller[_0x0422('0x18')]);router[_0x0422('0x6')](_0x0422('0x19'),controller[_0x0422('0x1a')]);router[_0x0422('0x6')]('/:id/applications',auth[_0x0422('0x7')](),controller[_0x0422('0x1b')]);router[_0x0422('0x6')]('/:id/proactive_actions',auth[_0x0422('0x7')](),controller[_0x0422('0x1c')]);router[_0x0422('0x6')]('/:id/fields',controller[_0x0422('0x1d')]);router['get'](_0x0422('0x1e'),auth[_0x0422('0x7')](),controller[_0x0422('0x1f')]);router[_0x0422('0x6')](_0x0422('0x20'),auth[_0x0422('0x7')](),controller['getAgents']);router[_0x0422('0x21')]('/',auth[_0x0422('0x7')](),controller['create']);router['post'](_0x0422('0xc'),auth[_0x0422('0x7')](),controller[_0x0422('0x22')]);router[_0x0422('0x21')](_0x0422('0xe'),auth['isAuthenticated'](),controller[_0x0422('0x23')]);var upload=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x344709,_0x15454b,_0x5c202a){_0x5c202a(null,path[_0x0422('0x25')](config[_0x0422('0x26')],_0x0422('0x27')));},'filename':function(_0x1ca6bf,_0x14caf4,_0x53496a){_0x53496a(null,util[_0x0422('0x28')](_0x0422('0x29'),Date[_0x0422('0x2a')](),_0x14caf4[_0x0422('0x2b')]));}})});router[_0x0422('0x21')]('/:id/logo',upload[_0x0422('0x2c')](_0x0422('0x2d')),controller[_0x0422('0x2e')]);var upload=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x4b414e,_0x4db660,_0x406a24){_0x406a24(null,path[_0x0422('0x25')](config[_0x0422('0x26')],'server/files/images/avatars/'));},'filename':function(_0x5d1db3,_0x5bb631,_0x89593a){_0x89593a(null,util[_0x0422('0x28')](_0x0422('0x29'),Date[_0x0422('0x2a')](),_0x5bb631[_0x0422('0x2b')]));}})});router[_0x0422('0x21')]('/:id/avatar',upload['single'](_0x0422('0x2d')),controller[_0x0422('0x2f')]);var upload=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x3ea73f,_0xc48748,_0x131da4){_0x131da4(null,path[_0x0422('0x25')](config[_0x0422('0x26')],_0x0422('0x30')));},'filename':function(_0x78915a,_0x4d77e1,_0x29d6d6){_0x29d6d6(null,util[_0x0422('0x28')](_0x0422('0x29'),Date['now'](),_0x4d77e1['originalname']));}})});router['post']('/:id/customer_avatar',upload['single'](_0x0422('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38025a,_0xd07962,_0x21df8b){_0x21df8b(null,path[_0x0422('0x25')](config['root'],_0x0422('0x30')));},'filename':function(_0x13869f,_0x2e8bd0,_0x337395){_0x337395(null,util[_0x0422('0x28')](_0x0422('0x29'),Date[_0x0422('0x2a')](),_0x2e8bd0[_0x0422('0x2b')]));}})});router[_0x0422('0x21')](_0x0422('0x15'),upload[_0x0422('0x2c')](_0x0422('0x2d')),controller[_0x0422('0x31')]);router[_0x0422('0x21')](_0x0422('0x32'),controller[_0x0422('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x0422('0x24')]({'destination':function(_0x2a118b,_0x4e5d35,_0x23c6b4){const _0x2f5658=path[_0x0422('0x25')](config[_0x0422('0x26')],_0x0422('0x34'),_0x0422('0x35'),_0x0422('0x36'));fs_extra[_0x0422('0x37')](_0x2f5658,function(){_0x23c6b4(null,_0x2f5658);});},'filename':function(_0x284b7a,_0x51de32,_0x3b79b2){const _0x4617cb=_0x51de32[_0x0422('0x2b')][_0x0422('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x25a5bc=path[_0x0422('0x39')](_0x4617cb);const _0x1b250e=Date['now']()+'-'+_0x4617cb[_0x0422('0x38')](_0x25a5bc,'')+_0x25a5bc;_0x3b79b2(null,_0x1b250e);}})});router[_0x0422('0x21')](_0x0422('0x3a'),offlineUploadMulter[_0x0422('0x3b')](),controller[_0x0422('0x3c')]);router[_0x0422('0x21')](_0x0422('0x17'),auth['isAuthenticated'](),controller[_0x0422('0x3d')]);router[_0x0422('0x21')](_0x0422('0x3e'),auth['isAuthenticated'](),controller[_0x0422('0x3f')]);router['post'](_0x0422('0x40'),auth['isAuthenticated'](),controller[_0x0422('0x41')]);router[_0x0422('0x21')](_0x0422('0x20'),auth[_0x0422('0x7')](),controller['addAgents']);router[_0x0422('0x42')](_0x0422('0xb'),auth[_0x0422('0x7')](),controller['update']);router[_0x0422('0x43')](_0x0422('0xb'),auth['isAuthenticated'](),controller[_0x0422('0x44')]);router[_0x0422('0x43')](_0x0422('0xc'),auth[_0x0422('0x7')](),controller[_0x0422('0x45')]);router[_0x0422('0x43')](_0x0422('0xe'),auth[_0x0422('0x7')](),controller[_0x0422('0x46')]);router[_0x0422('0x43')](_0x0422('0x20'),auth[_0x0422('0x7')](),controller['removeAgents']);module[_0x0422('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 50f414e..160ca3a 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 _0x0a10=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../config/environment','Router','env','production','app'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0a10,0x174));var _0x00a1=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0x0a10[_0x1d29f6];return _0x491093;};var beaverLogger=require('beaver-logger/server');var express=require(_0x00a1('0x0'));var auth=require('../components/auth/service');var config=require(_0x00a1('0x1'));var router=express[_0x00a1('0x2')]();var isProduction=config[_0x00a1('0x3')]===_0x00a1('0x4')||![];function clientSideLogs(_0x2208c2,_0x341b88,_0x2b6fd3){var _0x45f26b=_0x2208c2[_0x00a1('0x5')][_0x00a1('0x6')](_0x00a1('0x7'));if(!_0x45f26b){throw new Error(_0x00a1('0x8'));}return beaverLogger[_0x00a1('0x9')]({'uri':_0x00a1('0xa'),'logger':_0x45f26b,'enableCors':!isProduction})(_0x2208c2,_0x341b88,_0x2b6fd3);}router[_0x00a1('0xb')](auth[_0x00a1('0xc')](),clientSideLogs);module[_0x00a1('0xd')]=router;
\ No newline at end of file
+var _0x5784=['Client-Side\x20logger\x20not\x20found!','/client-logs','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','production','app','get','client-side-logger'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x5784,0x10c));var _0x4578=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5784[_0x59ee6f];return _0x4c0979;};var beaverLogger=require(_0x4578('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x4578('0x1'));var router=express[_0x4578('0x2')]();var isProduction=config[_0x4578('0x3')]===_0x4578('0x4')||![];function clientSideLogs(_0x32b7cd,_0x1beb3a,_0x3e82a5){var _0x3e2897=_0x32b7cd[_0x4578('0x5')][_0x4578('0x6')](_0x4578('0x7'));if(!_0x3e2897){throw new Error(_0x4578('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x4578('0x9'),'logger':_0x3e2897,'enableCors':!isProduction})(_0x32b7cd,_0x1beb3a,_0x3e82a5);}router['use'](auth[_0x4578('0xa')](),clientSideLogs);module[_0x4578('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index cfac6fb..350e86b 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 _0x43e0=['AmazonAWS','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM'];(function(_0x9f53db,_0x7b3878){var _0x407025=function(_0x24c908){while(--_0x24c908){_0x9f53db['push'](_0x9f53db['shift']());}};_0x407025(++_0x7b3878);}(_0x43e0,0x6b));var _0x043e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x43e0[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0x043e('0x0')]={'name':{'type':Sequelize[_0x043e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x043e('0x2')](_0x043e('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x043e('0x2')]('Outlook365',_0x043e('0x4'))},'data1':{'type':Sequelize[_0x043e('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x043e('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x043e('0x1')],'comment':_0x043e('0x5')},'data4':{'type':Sequelize[_0x043e('0x1')],'comment':_0x043e('0x6')},'data5':{'type':Sequelize[_0x043e('0x7')],'comment':_0x043e('0x8')},'data6':{'type':Sequelize['TEXT'],'comment':_0x043e('0x9')},'data7':{'type':Sequelize[_0x043e('0x7')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xd033=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','AmazonAWS','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x62ff30,_0x131488){var _0x5f5904=function(_0x5bded9){while(--_0x5bded9){_0x62ff30['push'](_0x62ff30['shift']());}};_0x5f5904(++_0x131488);}(_0xd033,0x16d));var _0x3d03=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xd033[_0x2becba];return _0x90b5dd;};'use strict';var Sequelize=require(_0x3d03('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d03('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x3d03('0x2'),'Google',_0x3d03('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3d03('0x4')](_0x3d03('0x5'),_0x3d03('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x3d03('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x3d03('0x8')},'data3':{'type':Sequelize[_0x3d03('0x1')],'comment':_0x3d03('0x9')},'data4':{'type':Sequelize[_0x3d03('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x3d03('0xa')],'comment':_0x3d03('0xb')},'data6':{'type':Sequelize[_0x3d03('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x3d03('0xa')],'comment':_0x3d03('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b00f203..5df8cd8 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 _0x7c7a=['decryptString','data3','show','MicrosoftAzure','includes','join','body','encryptString','catch','update','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','parse','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','then','destroy','error','stack','name','send','padEnd','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','service'];(function(_0x410ff6,_0x4b4011){var _0x32cb57=function(_0x467876){while(--_0x467876){_0x410ff6['push'](_0x410ff6['shift']());}};_0x32cb57(++_0x4b4011);}(_0x7c7a,0x184));var _0xa7c7=function(_0x460851,_0x1b333e){_0x460851=_0x460851-0x0;var _0x2a1c04=_0x7c7a[_0x460851];return _0x2a1c04;};'use strict';var _=require(_0xa7c7('0x0'));var Redis=require(_0xa7c7('0x1'));var qs=require(_0xa7c7('0x2'));var encryptor=require(_0xa7c7('0x3'));var config=require(_0xa7c7('0x4'));var logger=require('../../config/logger')(_0xa7c7('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xa7c7('0x6'));config[_0xa7c7('0x7')]=_[_0xa7c7('0x8')](config[_0xa7c7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c7('0x9'))(new Redis(config[_0xa7c7('0x7')]));var redis=new Redis(config[_0xa7c7('0x7')]);function respondWithStatusCode(_0x8a0f49,_0x594ce5){_0x594ce5=_0x594ce5||0xcc;return function(_0xe290fd){if(_0xe290fd){return _0x8a0f49[_0xa7c7('0xa')](_0x594ce5);}return _0x8a0f49[_0xa7c7('0xb')](_0x594ce5)[_0xa7c7('0xc')]();};}function respondWithResult(_0x369700,_0xa0e408){_0xa0e408=_0xa0e408||0xc8;return function(_0x53a120){if(_0x53a120){return _0x369700[_0xa7c7('0xb')](_0xa0e408)[_0xa7c7('0xd')](_0x53a120);}};}function respondWithFilteredResult(_0xe0cc56,_0x22063a){return function(_0x2c51d0){if(_0x2c51d0){var _0x33ba17=typeof _0x22063a[_0xa7c7('0xe')]===_0xa7c7('0xf')&&typeof _0x22063a['limit']===_0xa7c7('0xf');var _0x3493a2=_0x2c51d0[_0xa7c7('0x10')];var _0x3fa940=_0x33ba17?0x0:_0x22063a['offset'];var _0x410f0d=_0x33ba17?_0x2c51d0['count']:_0x22063a[_0xa7c7('0xe')]+_0x22063a[_0xa7c7('0x11')];var _0x531ed9;if(_0x410f0d>=_0x3493a2){_0x410f0d=_0x3493a2;_0x531ed9=0xc8;}else{_0x531ed9=0xce;}_0xe0cc56[_0xa7c7('0xb')](_0x531ed9);return _0xe0cc56['set'](_0xa7c7('0x12'),_0x3fa940+'-'+_0x410f0d+'/'+_0x3493a2)[_0xa7c7('0xd')](_0x2c51d0);}return null;};}function saveUpdates(_0x197394){return function(_0x3b2f0e){if(_0x3b2f0e){return _0x3b2f0e['update'](_0x197394)[_0xa7c7('0x13')](function(_0x4ee588){return _0x4ee588;});}return null;};}function removeEntity(_0x429d96){return function(_0x9bb775){if(_0x9bb775){return _0x9bb775[_0xa7c7('0x14')]()[_0xa7c7('0x13')](function(){_0x429d96['status'](0xcc)[_0xa7c7('0xc')]();});}};}function handleEntityNotFound(_0x50a733){return function(_0x3123ee){if(!_0x3123ee){_0x50a733[_0xa7c7('0xa')](0x194);}return _0x3123ee;};}function handleError(_0x126f05,_0x472891){_0x472891=_0x472891||0x1f4;return function(_0x1df083){logger[_0xa7c7('0x15')](_0x1df083[_0xa7c7('0x16')]);if(_0x1df083[_0xa7c7('0x17')]){delete _0x1df083[_0xa7c7('0x17')];}_0x126f05[_0xa7c7('0xb')](_0x472891)[_0xa7c7('0x18')](_0x1df083);};}function maskClientSecret(_0x8c96a5){return _[_0xa7c7('0x19')](_0x8c96a5['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0xe4741f,_0x3358e4){var _0x583c22={},_0x50e4fa={},_0x4fb095={'count':0x0,'rows':[]};var _0x2e862d=_[_0xa7c7('0x1a')](db['CloudProvider'][_0xa7c7('0x1b')],function(_0x4266b9){return{'name':_0x4266b9['fieldName'],'type':_0x4266b9[_0xa7c7('0x1c')][_0xa7c7('0x1d')]};});_0x50e4fa[_0xa7c7('0x1e')]=_['map'](_0x2e862d,'name');_0x50e4fa[_0xa7c7('0x1f')]=_[_0xa7c7('0x20')](_0xe4741f[_0xa7c7('0x1f')]);_0x50e4fa[_0xa7c7('0x21')]=_[_0xa7c7('0x22')](_0x50e4fa[_0xa7c7('0x1e')],_0x50e4fa['query']);_0x583c22[_0xa7c7('0x23')]=_[_0xa7c7('0x22')](_0x50e4fa[_0xa7c7('0x1e')],qs[_0xa7c7('0x24')](_0xe4741f['query']['fields']));_0x583c22[_0xa7c7('0x23')]=_0x583c22[_0xa7c7('0x23')][_0xa7c7('0x25')]?_0x583c22[_0xa7c7('0x23')]:_0x50e4fa[_0xa7c7('0x1e')];if(!_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0x26')]('nolimit')){_0x583c22[_0xa7c7('0x11')]=qs[_0xa7c7('0x11')](_0xe4741f['query'][_0xa7c7('0x11')]);_0x583c22[_0xa7c7('0xe')]=qs[_0xa7c7('0xe')](_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0xe')]);}_0x583c22[_0xa7c7('0x27')]=qs[_0xa7c7('0x28')](_0xe4741f['query'][_0xa7c7('0x28')]);_0x583c22[_0xa7c7('0x29')]=qs[_0xa7c7('0x21')](_[_0xa7c7('0x2a')](_0xe4741f['query'],_0x50e4fa['filters']),_0x2e862d);if(_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0x2b')]){_0x583c22['where']=_[_0xa7c7('0x2c')](_0x583c22[_0xa7c7('0x29')],{'$or':_['map'](_0x2e862d,function(_0x153ae2){if(_0x153ae2[_0xa7c7('0x1c')]!==_0xa7c7('0x2d')){var _0x273c1e={};_0x273c1e[_0x153ae2[_0xa7c7('0x17')]]={'$like':'%'+_0xe4741f['query'][_0xa7c7('0x2b')]+'%'};return _0x273c1e;}})});}_0x583c22=_['merge']({},_0x583c22,_0xe4741f[_0xa7c7('0x2e')]);var _0x141b2e={'where':_0x583c22[_0xa7c7('0x29')]};return db[_0xa7c7('0x2f')][_0xa7c7('0x10')](_0x141b2e)[_0xa7c7('0x13')](function(_0x261db9){_0x4fb095[_0xa7c7('0x10')]=_0x261db9;if(_0xe4741f[_0xa7c7('0x1f')][_0xa7c7('0x30')]){_0x583c22[_0xa7c7('0x31')]=[{'all':!![]}];}return db[_0xa7c7('0x2f')][_0xa7c7('0x32')](_0x583c22);})[_0xa7c7('0x13')](function(_0x5d5d1e){_0x4fb095['rows']=_[_0xa7c7('0x1a')](_0x5d5d1e,function(_0x5cc27a){if(_0x5cc27a[_0xa7c7('0x33')]==='MicrosoftAzure'){var _0x55ccb6=encryptor[_0xa7c7('0x34')](_0x5cc27a[_0xa7c7('0x35')]);_0x5cc27a[_0xa7c7('0x35')]=maskClientSecret(_0x55ccb6);}return _0x5cc27a;});return _0x4fb095;})[_0xa7c7('0x13')](respondWithFilteredResult(_0x3358e4,_0x583c22))['catch'](handleError(_0x3358e4,null));};exports[_0xa7c7('0x36')]=function(_0x27d7b7,_0x94b5a4){var _0x55e83c={'raw':!![],'where':{'id':_0x27d7b7['params']['id']}},_0xfce3c0={};_0xfce3c0[_0xa7c7('0x1e')]=_[_0xa7c7('0x20')](db[_0xa7c7('0x2f')][_0xa7c7('0x1b')]);_0xfce3c0['query']=_['keys'](_0x27d7b7['query']);_0xfce3c0[_0xa7c7('0x21')]=_[_0xa7c7('0x22')](_0xfce3c0[_0xa7c7('0x1e')],_0xfce3c0[_0xa7c7('0x1f')]);_0x55e83c[_0xa7c7('0x23')]=_[_0xa7c7('0x22')](_0xfce3c0[_0xa7c7('0x1e')],qs['fields'](_0x27d7b7['query'][_0xa7c7('0x24')]));_0x55e83c['attributes']=_0x55e83c[_0xa7c7('0x23')][_0xa7c7('0x25')]?_0x55e83c[_0xa7c7('0x23')]:_0xfce3c0['model'];if(_0x27d7b7[_0xa7c7('0x1f')][_0xa7c7('0x30')]){_0x55e83c[_0xa7c7('0x31')]=[{'all':!![]}];}_0x55e83c=_[_0xa7c7('0x2c')]({},_0x55e83c,_0x27d7b7['options']);return db[_0xa7c7('0x2f')]['find'](_0x55e83c)['then'](handleEntityNotFound(_0x94b5a4,null))['then'](function(_0x3a271f){if(_0x3a271f[_0xa7c7('0x33')]===_0xa7c7('0x37')){var _0x1b235e=encryptor[_0xa7c7('0x34')](_0x3a271f[_0xa7c7('0x35')]);_0x3a271f[_0xa7c7('0x35')]=maskClientSecret(_0x1b235e);}return _0x3a271f;})['then'](respondWithResult(_0x94b5a4,null))['catch'](handleError(_0x94b5a4,null));};exports['create']=function(_0x27f553,_0x385bab){if(!_0x27f553['body'][_0xa7c7('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x27f553['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x50c121=db[_0xa7c7('0x2f')][_0xa7c7('0x1b')][_0xa7c7('0x33')]['values'];if(!_0x50c121[_0xa7c7('0x38')](_0x27f553['body'][_0xa7c7('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x50c121[_0xa7c7('0x39')](',\x20'));if(_0x27f553[_0xa7c7('0x3a')][_0xa7c7('0x33')]===_0xa7c7('0x37')&&_0x27f553[_0xa7c7('0x3a')][_0xa7c7('0x35')]){_0x27f553[_0xa7c7('0x3a')][_0xa7c7('0x35')]=encryptor[_0xa7c7('0x3b')](_0x27f553[_0xa7c7('0x3a')]['data3']);}return db['CloudProvider']['create'](_0x27f553[_0xa7c7('0x3a')],{})['then'](respondWithResult(_0x385bab,0xc9))[_0xa7c7('0x3c')](handleError(_0x385bab,null));};exports[_0xa7c7('0x3d')]=function(_0x55d165,_0x277cca){if(_0x55d165[_0xa7c7('0x3a')]['id']){delete _0x55d165[_0xa7c7('0x3a')]['id'];}return db['CloudProvider'][_0xa7c7('0x3e')]({'where':{'id':_0x55d165['params']['id']}})[_0xa7c7('0x13')](handleEntityNotFound(_0x277cca,null))[_0xa7c7('0x13')](function(_0x4d5df3){if(_0x4d5df3['service']===_0xa7c7('0x37')&&_0x55d165[_0xa7c7('0x3a')]['data3']){_0x55d165[_0xa7c7('0x3a')][_0xa7c7('0x35')]=encryptor[_0xa7c7('0x3b')](_0x55d165[_0xa7c7('0x3a')][_0xa7c7('0x35')]);}return _0x4d5df3;})['then'](saveUpdates(_0x55d165['body'],null))[_0xa7c7('0x13')](respondWithResult(_0x277cca,null))[_0xa7c7('0x3c')](handleError(_0x277cca,null));};exports[_0xa7c7('0x14')]=function(_0x2feba2,_0x37b039){return db[_0xa7c7('0x2f')][_0xa7c7('0x3e')]({'where':{'id':_0x2feba2['params']['id']}})[_0xa7c7('0x13')](handleEntityNotFound(_0x37b039,null))[_0xa7c7('0x13')](removeEntity(_0x37b039,null))['catch'](handleError(_0x37b039,null));};exports[_0xa7c7('0x3f')]=function(_0x5d0be6,_0x16ac4f){return db[_0xa7c7('0x2f')][_0xa7c7('0x40')]({'where':{'id':_0x5d0be6['params']['id']},'raw':!![]})[_0xa7c7('0x13')](function(_0x2a9d02){if(!_0x2a9d02)return _0x16ac4f['sendStatus'](0x194);return{'url':oauth[_0xa7c7('0x41')](_0x2a9d02,_0x5d0be6['user']['id'])};})['then'](respondWithResult(_0x16ac4f,null))[_0xa7c7('0x3c')](handleError(_0x16ac4f,null));};exports[_0xa7c7('0x42')]=function(_0x11a191,_0x4fbd1c){var _0x311792=_0x11a191[_0xa7c7('0x3a')];var _0xacb7c5;var _0x552c2b;if(_0x311792[_0xa7c7('0x15')])throw _0x311792;redis[_0xa7c7('0x43')](_0x311792[_0xa7c7('0x44')])['then'](function(_0x4e6bf7){if(!_0x4e6bf7)throw new Error('Invalid\x20state\x20parameter');_0xacb7c5=JSON[_0xa7c7('0x45')](_0x4e6bf7);var _0x4ad845=Buffer['from'](_0x311792[_0xa7c7('0x44')],_0xa7c7('0x46'))['toString'](_0xa7c7('0x47'));_0x552c2b=JSON[_0xa7c7('0x45')](_0x4ad845);if(!oauth[_0xa7c7('0x48')](_0x311792[_0xa7c7('0x49')],_0xacb7c5[_0xa7c7('0x4a')]))throw new Error(_0xa7c7('0x4b'));redis[_0xa7c7('0x4c')](_0x311792[_0xa7c7('0x44')]);return oauth[_0xa7c7('0x4d')](_0x311792[_0xa7c7('0x4e')],_0xacb7c5);})[_0xa7c7('0x13')](function(_0x1e83b1){_0xacb7c5[_0xa7c7('0x4f')]=_0x1e83b1[_0xa7c7('0x50')];_0xacb7c5[_0xa7c7('0x51')]=_0x1e83b1[_0xa7c7('0x52')];return db[_0xa7c7('0x2f')][_0xa7c7('0x3d')]({'data5':_0xacb7c5[_0xa7c7('0x4f')],'data6':_0xacb7c5[_0xa7c7('0x51')]},{'where':{'id':_0xacb7c5['id']}});})['then'](function(){oauth[_0xa7c7('0x53')](_0xacb7c5);socket[_0xa7c7('0x54')]('microsoftAuthorization:success',{'id':_0x552c2b['id']});return;})['then'](respondWithStatusCode(_0x4fbd1c,null))[_0xa7c7('0x3c')](function(_0x197ff9){if(_0x552c2b){socket[_0xa7c7('0x54')]('microsoftAuthorization:error',{'id':_0x552c2b['id']});}if(!_0xacb7c5){logger[_0xa7c7('0x15')](_0xa7c7('0x55'),_0x197ff9);return _0x4fbd1c[_0xa7c7('0xb')](0x1f4)[_0xa7c7('0x18')](_0x197ff9['message']);}logger[_0xa7c7('0x15')](_0xa7c7('0x56'),_0xacb7c5['id'],JSON[_0xa7c7('0x57')](_0x197ff9));});};
\ No newline at end of file
+var _0xe800=['service','MicrosoftAzure','decryptString','data3','show','keys','rawAttributes','length','find','catch','create','body','Name\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','from','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','end','json','offset','undefined','limit','count','status','set','Content-Range','update','then','error','name','send','padEnd','slice','index','map','CloudProvider','key','model','query','filters','intersection','fields','attributes','nolimit','order','where','filter','merge','type','options','includeAll','include','findAll','rows'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0xe800,0x1e7));var _0x0e80=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xe800[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x0e80('0x0'));var Redis=require(_0x0e80('0x1'));var qs=require(_0x0e80('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x0e80('0x3'));var logger=require(_0x0e80('0x4'))(_0x0e80('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x0e80('0x6'));config[_0x0e80('0x7')]=_[_0x0e80('0x8')](config['redis'],{'host':_0x0e80('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x0e80('0x7')]);function respondWithStatusCode(_0x1f196e,_0x566df9){_0x566df9=_0x566df9||0xcc;return function(_0x2f9fee){if(_0x2f9fee){return _0x1f196e['sendStatus'](_0x566df9);}return _0x1f196e['status'](_0x566df9)[_0x0e80('0xa')]();};}function respondWithResult(_0x4141da,_0x4aab11){_0x4aab11=_0x4aab11||0xc8;return function(_0x121f31){if(_0x121f31){return _0x4141da['status'](_0x4aab11)[_0x0e80('0xb')](_0x121f31);}};}function respondWithFilteredResult(_0x2882a6,_0x3f9fb8){return function(_0x11eff5){if(_0x11eff5){var _0x5d2159=typeof _0x3f9fb8[_0x0e80('0xc')]===_0x0e80('0xd')&&typeof _0x3f9fb8[_0x0e80('0xe')]===_0x0e80('0xd');var _0x401dfc=_0x11eff5[_0x0e80('0xf')];var _0x5ebf43=_0x5d2159?0x0:_0x3f9fb8[_0x0e80('0xc')];var _0x368654=_0x5d2159?_0x11eff5['count']:_0x3f9fb8[_0x0e80('0xc')]+_0x3f9fb8[_0x0e80('0xe')];var _0x8d4492;if(_0x368654>=_0x401dfc){_0x368654=_0x401dfc;_0x8d4492=0xc8;}else{_0x8d4492=0xce;}_0x2882a6[_0x0e80('0x10')](_0x8d4492);return _0x2882a6[_0x0e80('0x11')](_0x0e80('0x12'),_0x5ebf43+'-'+_0x368654+'/'+_0x401dfc)[_0x0e80('0xb')](_0x11eff5);}return null;};}function saveUpdates(_0x43e74b){return function(_0x3c8f67){if(_0x3c8f67){return _0x3c8f67[_0x0e80('0x13')](_0x43e74b)[_0x0e80('0x14')](function(_0x56116f){return _0x56116f;});}return null;};}function removeEntity(_0x17064f){return function(_0x3c96ce){if(_0x3c96ce){return _0x3c96ce['destroy']()[_0x0e80('0x14')](function(){_0x17064f['status'](0xcc)[_0x0e80('0xa')]();});}};}function handleEntityNotFound(_0x58ce94){return function(_0x44b191){if(!_0x44b191){_0x58ce94['sendStatus'](0x194);}return _0x44b191;};}function handleError(_0x5cf301,_0xfaf502){_0xfaf502=_0xfaf502||0x1f4;return function(_0x16c5dd){logger[_0x0e80('0x15')](_0x16c5dd['stack']);if(_0x16c5dd[_0x0e80('0x16')]){delete _0x16c5dd[_0x0e80('0x16')];}_0x5cf301[_0x0e80('0x10')](_0xfaf502)[_0x0e80('0x17')](_0x16c5dd);};}function maskClientSecret(_0x14c245){return _[_0x0e80('0x18')](_0x14c245[_0x0e80('0x19')](0x0,0x3),0x14,'*');}exports[_0x0e80('0x1a')]=function(_0xb8cde,_0x34fbce){var _0x2f6969={},_0x1285a8={},_0xfb2cc8={'count':0x0,'rows':[]};var _0x4cdfcb=_[_0x0e80('0x1b')](db[_0x0e80('0x1c')]['rawAttributes'],function(_0x4046b0){return{'name':_0x4046b0['fieldName'],'type':_0x4046b0['type'][_0x0e80('0x1d')]};});_0x1285a8[_0x0e80('0x1e')]=_[_0x0e80('0x1b')](_0x4cdfcb,_0x0e80('0x16'));_0x1285a8[_0x0e80('0x1f')]=_['keys'](_0xb8cde[_0x0e80('0x1f')]);_0x1285a8[_0x0e80('0x20')]=_[_0x0e80('0x21')](_0x1285a8[_0x0e80('0x1e')],_0x1285a8[_0x0e80('0x1f')]);_0x2f6969['attributes']=_[_0x0e80('0x21')](_0x1285a8[_0x0e80('0x1e')],qs[_0x0e80('0x22')](_0xb8cde['query'][_0x0e80('0x22')]));_0x2f6969['attributes']=_0x2f6969[_0x0e80('0x23')]['length']?_0x2f6969[_0x0e80('0x23')]:_0x1285a8[_0x0e80('0x1e')];if(!_0xb8cde[_0x0e80('0x1f')]['hasOwnProperty'](_0x0e80('0x24'))){_0x2f6969[_0x0e80('0xe')]=qs[_0x0e80('0xe')](_0xb8cde[_0x0e80('0x1f')][_0x0e80('0xe')]);_0x2f6969[_0x0e80('0xc')]=qs[_0x0e80('0xc')](_0xb8cde[_0x0e80('0x1f')][_0x0e80('0xc')]);}_0x2f6969[_0x0e80('0x25')]=qs['sort'](_0xb8cde[_0x0e80('0x1f')]['sort']);_0x2f6969[_0x0e80('0x26')]=qs[_0x0e80('0x20')](_['pick'](_0xb8cde[_0x0e80('0x1f')],_0x1285a8['filters']),_0x4cdfcb);if(_0xb8cde['query'][_0x0e80('0x27')]){_0x2f6969[_0x0e80('0x26')]=_[_0x0e80('0x28')](_0x2f6969[_0x0e80('0x26')],{'$or':_[_0x0e80('0x1b')](_0x4cdfcb,function(_0x4dc03d){if(_0x4dc03d[_0x0e80('0x29')]!=='VIRTUAL'){var _0x2369b4={};_0x2369b4[_0x4dc03d[_0x0e80('0x16')]]={'$like':'%'+_0xb8cde['query'][_0x0e80('0x27')]+'%'};return _0x2369b4;}})});}_0x2f6969=_['merge']({},_0x2f6969,_0xb8cde[_0x0e80('0x2a')]);var _0x141e54={'where':_0x2f6969['where']};return db['CloudProvider'][_0x0e80('0xf')](_0x141e54)[_0x0e80('0x14')](function(_0x229206){_0xfb2cc8['count']=_0x229206;if(_0xb8cde[_0x0e80('0x1f')][_0x0e80('0x2b')]){_0x2f6969[_0x0e80('0x2c')]=[{'all':!![]}];}return db['CloudProvider'][_0x0e80('0x2d')](_0x2f6969);})[_0x0e80('0x14')](function(_0x1aea88){_0xfb2cc8[_0x0e80('0x2e')]=_['map'](_0x1aea88,function(_0x5e1cd2){if(_0x5e1cd2[_0x0e80('0x2f')]===_0x0e80('0x30')){var _0x26f315=encryptor[_0x0e80('0x31')](_0x5e1cd2['data3']);_0x5e1cd2[_0x0e80('0x32')]=maskClientSecret(_0x26f315);}return _0x5e1cd2;});return _0xfb2cc8;})[_0x0e80('0x14')](respondWithFilteredResult(_0x34fbce,_0x2f6969))['catch'](handleError(_0x34fbce,null));};exports[_0x0e80('0x33')]=function(_0x366abf,_0x3a4e8e){var _0x298ccb={'raw':!![],'where':{'id':_0x366abf['params']['id']}},_0x4fbedd={};_0x4fbedd[_0x0e80('0x1e')]=_[_0x0e80('0x34')](db[_0x0e80('0x1c')][_0x0e80('0x35')]);_0x4fbedd[_0x0e80('0x1f')]=_[_0x0e80('0x34')](_0x366abf['query']);_0x4fbedd['filters']=_[_0x0e80('0x21')](_0x4fbedd[_0x0e80('0x1e')],_0x4fbedd[_0x0e80('0x1f')]);_0x298ccb[_0x0e80('0x23')]=_[_0x0e80('0x21')](_0x4fbedd[_0x0e80('0x1e')],qs['fields'](_0x366abf[_0x0e80('0x1f')][_0x0e80('0x22')]));_0x298ccb[_0x0e80('0x23')]=_0x298ccb[_0x0e80('0x23')][_0x0e80('0x36')]?_0x298ccb[_0x0e80('0x23')]:_0x4fbedd[_0x0e80('0x1e')];if(_0x366abf[_0x0e80('0x1f')]['includeAll']){_0x298ccb[_0x0e80('0x2c')]=[{'all':!![]}];}_0x298ccb=_[_0x0e80('0x28')]({},_0x298ccb,_0x366abf['options']);return db[_0x0e80('0x1c')][_0x0e80('0x37')](_0x298ccb)['then'](handleEntityNotFound(_0x3a4e8e,null))[_0x0e80('0x14')](function(_0x5a3f6d){if(_0x5a3f6d['service']===_0x0e80('0x30')){var _0x5d510c=encryptor[_0x0e80('0x31')](_0x5a3f6d['data3']);_0x5a3f6d[_0x0e80('0x32')]=maskClientSecret(_0x5d510c);}return _0x5a3f6d;})[_0x0e80('0x14')](respondWithResult(_0x3a4e8e,null))[_0x0e80('0x38')](handleError(_0x3a4e8e,null));};exports[_0x0e80('0x39')]=function(_0x54902e,_0x4a1af8){if(!_0x54902e[_0x0e80('0x3a')][_0x0e80('0x16')])throw new Error(_0x0e80('0x3b'));if(!_0x54902e[_0x0e80('0x3a')][_0x0e80('0x2f')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5b94d2=db[_0x0e80('0x1c')]['rawAttributes'][_0x0e80('0x2f')][_0x0e80('0x3c')];if(!_0x5b94d2[_0x0e80('0x3d')](_0x54902e['body'][_0x0e80('0x2f')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5b94d2[_0x0e80('0x3e')](',\x20'));if(_0x54902e['body']['service']==='MicrosoftAzure'&&_0x54902e[_0x0e80('0x3a')][_0x0e80('0x32')]){_0x54902e[_0x0e80('0x3a')][_0x0e80('0x32')]=encryptor[_0x0e80('0x3f')](_0x54902e['body']['data3']);}return db[_0x0e80('0x1c')][_0x0e80('0x39')](_0x54902e['body'],{})['then'](respondWithResult(_0x4a1af8,0xc9))[_0x0e80('0x38')](handleError(_0x4a1af8,null));};exports[_0x0e80('0x13')]=function(_0x25b599,_0x59f6b3){if(_0x25b599['body']['id']){delete _0x25b599[_0x0e80('0x3a')]['id'];}return db[_0x0e80('0x1c')][_0x0e80('0x37')]({'where':{'id':_0x25b599[_0x0e80('0x40')]['id']}})[_0x0e80('0x14')](handleEntityNotFound(_0x59f6b3,null))[_0x0e80('0x14')](function(_0x4ebcc7){if(_0x4ebcc7[_0x0e80('0x2f')]===_0x0e80('0x30')&&_0x25b599[_0x0e80('0x3a')]['data3']){_0x25b599['body']['data3']=encryptor[_0x0e80('0x3f')](_0x25b599[_0x0e80('0x3a')]['data3']);}return _0x4ebcc7;})[_0x0e80('0x14')](saveUpdates(_0x25b599[_0x0e80('0x3a')],null))['then'](respondWithResult(_0x59f6b3,null))['catch'](handleError(_0x59f6b3,null));};exports['destroy']=function(_0x35a3fe,_0x4a2c35){return db[_0x0e80('0x1c')][_0x0e80('0x37')]({'where':{'id':_0x35a3fe['params']['id']}})[_0x0e80('0x14')](handleEntityNotFound(_0x4a2c35,null))[_0x0e80('0x14')](removeEntity(_0x4a2c35,null))[_0x0e80('0x38')](handleError(_0x4a2c35,null));};exports[_0x0e80('0x41')]=function(_0x514763,_0x2d37a0){return db[_0x0e80('0x1c')][_0x0e80('0x42')]({'where':{'id':_0x514763['params']['id']},'raw':!![]})['then'](function(_0x910ff6){if(!_0x910ff6)return _0x2d37a0['sendStatus'](0x194);return{'url':oauth[_0x0e80('0x43')](_0x910ff6,_0x514763[_0x0e80('0x44')]['id'])};})[_0x0e80('0x14')](respondWithResult(_0x2d37a0,null))[_0x0e80('0x38')](handleError(_0x2d37a0,null));};exports['oauth2MicrosoftCallback']=function(_0x304048,_0x216173){var _0x282f73=_0x304048[_0x0e80('0x3a')];var _0x1f970d;var _0x4c1853;if(_0x282f73[_0x0e80('0x15')])throw _0x282f73;redis[_0x0e80('0x45')](_0x282f73[_0x0e80('0x46')])[_0x0e80('0x14')](function(_0x166b09){if(!_0x166b09)throw new Error(_0x0e80('0x47'));_0x1f970d=JSON['parse'](_0x166b09);var _0x6de0d5=Buffer[_0x0e80('0x48')](_0x282f73[_0x0e80('0x46')],'base64')[_0x0e80('0x49')](_0x0e80('0x4a'));_0x4c1853=JSON[_0x0e80('0x4b')](_0x6de0d5);if(!oauth[_0x0e80('0x4c')](_0x282f73[_0x0e80('0x4d')],_0x1f970d[_0x0e80('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x282f73[_0x0e80('0x46')]);return oauth[_0x0e80('0x4f')](_0x282f73[_0x0e80('0x50')],_0x1f970d);})[_0x0e80('0x14')](function(_0x112a5c){_0x1f970d[_0x0e80('0x51')]=_0x112a5c['access_token'];_0x1f970d[_0x0e80('0x52')]=_0x112a5c['refresh_token'];return db[_0x0e80('0x1c')]['update']({'data5':_0x1f970d[_0x0e80('0x51')],'data6':_0x1f970d[_0x0e80('0x52')]},{'where':{'id':_0x1f970d['id']}});})[_0x0e80('0x14')](function(){oauth[_0x0e80('0x53')](_0x1f970d);socket[_0x0e80('0x54')](_0x0e80('0x55'),{'id':_0x4c1853['id']});return;})[_0x0e80('0x14')](respondWithStatusCode(_0x216173,null))['catch'](function(_0x3097e3){if(_0x4c1853){socket[_0x0e80('0x54')]('microsoftAuthorization:error',{'id':_0x4c1853['id']});}if(!_0x1f970d){logger[_0x0e80('0x15')](_0x0e80('0x56'),_0x3097e3);return _0x216173[_0x0e80('0x10')](0x1f4)[_0x0e80('0x17')](_0x3097e3[_0x0e80('0x57')]);}logger[_0x0e80('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x1f970d['id'],JSON[_0x0e80('0x58')](_0x3097e3));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index dbeab2a..3a10014 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 _0x150b=['cloud_providers','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','CloudProvider'];(function(_0x80b901,_0x1e708f){var _0x496487=function(_0x52b6b7){while(--_0x52b6b7){_0x80b901['push'](_0x80b901['shift']());}};_0x496487(++_0x1e708f);}(_0x150b,0xb1));var _0xb150=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x150b[_0x5d860f];return _0x236490;};'use strict';var _=require('lodash');var util=require(_0xb150('0x0'));var logger=require(_0xb150('0x1'))('api');var moment=require(_0xb150('0x2'));var BPromise=require(_0xb150('0x3'));var rp=require(_0xb150('0x4'));var fs=require('fs');var path=require(_0xb150('0x5'));var rimraf=require(_0xb150('0x6'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0xb150('0x7')]=function(_0x244d64,_0x36ff8b){return _0x244d64[_0xb150('0x8')](_0xb150('0x9'),attributes,{'tableName':_0xb150('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd111=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','../../config/logger','moment','bluebird'];(function(_0x32dd39,_0x991f90){var _0x463bf3=function(_0x165e0a){while(--_0x165e0a){_0x32dd39['push'](_0x32dd39['shift']());}};_0x463bf3(++_0x991f90);}(_0xd111,0x1f4));var _0x1d11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd111[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1d11('0x0'));var util=require('util');var logger=require(_0x1d11('0x1'))('api');var moment=require(_0x1d11('0x2'));var BPromise=require(_0x1d11('0x3'));var rp=require(_0x1d11('0x4'));var fs=require('fs');var path=require(_0x1d11('0x5'));var rimraf=require(_0x1d11('0x6'));var config=require(_0x1d11('0x7'));var attributes=require(_0x1d11('0x8'));module[_0x1d11('0x9')]=function(_0x4c4469,_0xa8ed94){return _0x4c4469[_0x1d11('0xa')]('CloudProvider',attributes,{'tableName':_0x1d11('0xb'),'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 92b94b9..28d7207 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 _0x5ffc=['push','data7','/.default','join','Outlook365','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','data4','form_post','scope','nonce','login','key','oauth2Claims','replace','oauth2/','set','payload','issuer','aud','audience','isAfter','data3','CloudProvider','findOne','then','refresh_token','data6','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','intervals','bind','findAll','map','all','exports','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','type','Dynamics365'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0x5ffc,0x7e));var _0xc5ff=function(_0x454589,_0x3e852e){_0x454589=_0x454589-0x0;var _0x468c5c=_0x5ffc[_0x454589];return _0x468c5c;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xc5ff('0x0'));var moment=require(_0xc5ff('0x1'));var Redis=require(_0xc5ff('0x2'));var rp=require(_0xc5ff('0x3'));var util=require(_0xc5ff('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0xc5ff('0x5'));var logger=require(_0xc5ff('0x6'))(_0xc5ff('0x7'));var schedule=require(_0xc5ff('0x8'));var db=require(_0xc5ff('0x9'))['db'];config[_0xc5ff('0xa')]=_[_0xc5ff('0xb')](config[_0xc5ff('0xa')],{'host':_0xc5ff('0xc'),'port':0x18eb});var redis=new Redis(config[_0xc5ff('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xc5ff('0xd'),_0xc5ff('0xe'),_0xc5ff('0xf'),'offline_access',_0xc5ff('0x10'),_0xc5ff('0x11'),_0xc5ff('0x12')],'Dynamics365':[_0xc5ff('0xd'),_0xc5ff('0x13')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1f0bcd){var _0x5f1d59=_['map'](AZURE_AUTH_SCOPES[_0x1f0bcd[_0xc5ff('0x14')]]);if(_0x1f0bcd[_0xc5ff('0x14')]===_0xc5ff('0x15'))_0x5f1d59[_0xc5ff('0x16')](_0x1f0bcd[_0xc5ff('0x17')]+_0xc5ff('0x18'));return _0x5f1d59[_0xc5ff('0x19')]('\x20');}function getAccessTokenScope(_0x18948b){if(_0x18948b[_0xc5ff('0x14')]===_0xc5ff('0x1a'))return _0xc5ff('0x10');if(_0x18948b[_0xc5ff('0x14')]===_0xc5ff('0x15'))return _0x18948b[_0xc5ff('0x17')]+_0xc5ff('0x18');}function generateMicrosoftAuthorizationUrl(_0x7a71e3,_0x5ced2b){var _0xc6492e=MICROSOFT_AUTH_URL['replace'](_0xc5ff('0x1b'),_0x7a71e3[_0xc5ff('0x1c')]);var _0x255915=['code',_0xc5ff('0x1d')];var _0x189b41=Buffer[_0xc5ff('0x1e')](JSON[_0xc5ff('0x1f')]({'id':_0x5ced2b}))[_0xc5ff('0x20')](_0xc5ff('0x21'));var _0x1b9990=crypto[_0xc5ff('0x22')](0x10)[_0xc5ff('0x20')](_0xc5ff('0x23'));var _0x16ce71=getAuthorizationScopes(_0x7a71e3);var _0xc5d714=[{'key':_0xc5ff('0x24'),'value':_0x7a71e3[_0xc5ff('0x25')]},{'key':_0xc5ff('0x26'),'value':encodeURIComponent(_0x255915['join']('\x20'))},{'key':'redirect_uri','value':_0x7a71e3[_0xc5ff('0x27')]},{'key':'response_mode','value':_0xc5ff('0x28')},{'key':_0xc5ff('0x29'),'value':encodeURIComponent(_0x16ce71)},{'key':'state','value':_0x189b41},{'key':_0xc5ff('0x2a'),'value':_0x1b9990},{'key':'prompt','value':_0xc5ff('0x2b')}];var _0x263971=_0xc6492e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xc5d714,function(_0x1ef3c3){return _0x1ef3c3[_0xc5ff('0x2c')]+'='+_0x1ef3c3['value'];})['join']('&');_0x7a71e3[_0xc5ff('0x2d')]={'issuer':_0xc6492e[_0xc5ff('0x2e')](_0xc5ff('0x2f'),''),'audience':_0x7a71e3[_0xc5ff('0x25')],'state':_0x189b41,'nonce':_0x1b9990};redis[_0xc5ff('0x30')](_0x189b41,JSON['stringify'](_0x7a71e3));return _0x263971;}function isValidIdToken(_0x46575d,_0x4a7f8d){try{var _0x145de0=jwt['decode'](_0x46575d,{'complete':!![]});var _0x2770d1=_0x145de0[_0xc5ff('0x31')];if(_0x2770d1['iss']!==_0x4a7f8d[_0xc5ff('0x32')])return![];if(_0x2770d1[_0xc5ff('0x33')]!==_0x4a7f8d[_0xc5ff('0x34')])return![];if(_0x2770d1['nonce']!==_0x4a7f8d[_0xc5ff('0x2a')])return![];if(moment()[_0xc5ff('0x35')](moment['unix'](_0x2770d1['exp'])))return![];return!![];}catch(_0x258f90){throw _0x258f90;}}function refreshOauth2MicrosoftAccessToken(_0x26929b){return Promise['resolve']()['then'](function(){if(_0x26929b[_0xc5ff('0x36')])return _0x26929b;return db[_0xc5ff('0x37')][_0xc5ff('0x38')]({'where':{'id':_0x26929b['id']},'raw':!![]});})[_0xc5ff('0x39')](function(_0xa4e9ee){var _0x58f94d={'grant_type':_0xc5ff('0x3a'),'refresh_token':_0xa4e9ee[_0xc5ff('0x3b')],'scope':getAccessTokenScope(_0xa4e9ee),'redirect_uri':_0xa4e9ee[_0xc5ff('0x27')],'client_id':_0xa4e9ee[_0xc5ff('0x25')],'client_secret':encryptor['decryptString'](_0xa4e9ee[_0xc5ff('0x36')])};var _0x3fe621={'method':_0xc5ff('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xc5ff('0x2e')]('{TENANT_ID}',_0xa4e9ee[_0xc5ff('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x58f94d,'json':!![]};return rp(_0x3fe621);})['then'](function(_0x3d6930){_0x26929b[_0xc5ff('0x3d')]=_0x3d6930[_0xc5ff('0x3e')];_0x26929b[_0xc5ff('0x3b')]=_0x3d6930[_0xc5ff('0x3a')];return db[_0xc5ff('0x37')][_0xc5ff('0x3f')]({'data5':_0x26929b[_0xc5ff('0x3d')],'data6':_0x26929b[_0xc5ff('0x3b')]},{'where':{'id':_0x26929b['id']}});})[_0xc5ff('0x39')](function(){return _0x26929b;})[_0xc5ff('0x40')](function(_0x1d955b){logger[_0xc5ff('0x41')](_0xc5ff('0x42'),_0x26929b['id'],_0x1d955b);});}function getOauth2MicrosoftAccessToken(_0x35571a,_0x1e8c9f){var _0x3f4dc8={'grant_type':'authorization_code','code':_0x35571a,'scope':getAccessTokenScope(_0x1e8c9f),'redirect_uri':_0x1e8c9f['data4'],'client_id':_0x1e8c9f[_0xc5ff('0x25')],'client_secret':encryptor[_0xc5ff('0x43')](_0x1e8c9f[_0xc5ff('0x36')])};var _0x145501={'method':_0xc5ff('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xc5ff('0x2e')]('{TENANT_ID}',_0x1e8c9f[_0xc5ff('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f4dc8,'json':!![]};return rp(_0x145501);}function startRefreshInterval(_0x400091){var _0x1dae10=schedule[_0xc5ff('0x44')];if(_0x1dae10[_0x400091['id']])clearInterval(_0x1dae10[_0x400091['id']]);_0x1dae10[_0x400091['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc5ff('0x45')](this,{'id':_0x400091['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xc5ff('0x44')]=_0x1dae10;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xc5ff('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc5ff('0x39')](function(_0x10a4a3){var _0x45ad84=_0x10a4a3[_0xc5ff('0x47')](function(_0x3790ec){return refreshOauth2MicrosoftAccessToken(_0x3790ec)[_0xc5ff('0x39')](function(_0x418117){startRefreshInterval(_0x418117);});});return Promise[_0xc5ff('0x48')](_0x45ad84);})['catch'](function(_0x5d5839){var _0x5c9a2b=_0x5d5839?util['inspect'](_0x5d5839,{'showHidden':![],'depth':null}):'';logger[_0xc5ff('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x5c9a2b);});}module[_0xc5ff('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x1046=['iss','issuer','aud','isAfter','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','all','inspect','exports','lodash','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','data7','/.default','Outlook365','replace','data2','code','id_token','from','stringify','base64','randomBytes','toString','hex','data1','response_type','data4','response_mode','scope','state','nonce','value','join','oauth2/','set','decode','payload'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0x1046,0x18d));var _0x6104=function(_0x5d8e01,_0x2eb597){_0x5d8e01=_0x5d8e01-0x0;var _0x48db39=_0x1046[_0x5d8e01];return _0x48db39;};'use strict';var _=require(_0x6104('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x6104('0x1'));var rp=require(_0x6104('0x2'));var util=require(_0x6104('0x3'));var encryptor=require(_0x6104('0x4'));var config=require(_0x6104('0x5'));var logger=require(_0x6104('0x6'))(_0x6104('0x7'));var schedule=require(_0x6104('0x8'));var db=require(_0x6104('0x9'))['db'];config[_0x6104('0xa')]=_['defaults'](config[_0x6104('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x6104('0xa')]);var MICROSOFT_AUTH_URL=_0x6104('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6104('0xc'),_0x6104('0xd'),'email',_0x6104('0xe'),_0x6104('0xf'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x6104('0xc'),_0x6104('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x6104('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x6104('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x117316){var _0x4ea6a8=_[_0x6104('0x12')](AZURE_AUTH_SCOPES[_0x117316[_0x6104('0x13')]]);if(_0x117316[_0x6104('0x13')]===_0x6104('0x14'))_0x4ea6a8['push'](_0x117316[_0x6104('0x15')]+_0x6104('0x16'));return _0x4ea6a8['join']('\x20');}function getAccessTokenScope(_0x142ca2){if(_0x142ca2['type']===_0x6104('0x17'))return _0x6104('0xf');if(_0x142ca2['type']===_0x6104('0x14'))return _0x142ca2[_0x6104('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0xe0cbba,_0x29fe33){var _0xb9e162=MICROSOFT_AUTH_URL[_0x6104('0x18')]('{TENANT_ID}',_0xe0cbba[_0x6104('0x19')]);var _0x10c940=[_0x6104('0x1a'),_0x6104('0x1b')];var _0x5aa639=Buffer[_0x6104('0x1c')](JSON[_0x6104('0x1d')]({'id':_0x29fe33}))['toString'](_0x6104('0x1e'));var _0x44e08c=crypto[_0x6104('0x1f')](0x10)[_0x6104('0x20')](_0x6104('0x21'));var _0x56c61c=getAuthorizationScopes(_0xe0cbba);var _0x1afa94=[{'key':'client_id','value':_0xe0cbba[_0x6104('0x22')]},{'key':_0x6104('0x23'),'value':encodeURIComponent(_0x10c940['join']('\x20'))},{'key':'redirect_uri','value':_0xe0cbba[_0x6104('0x24')]},{'key':_0x6104('0x25'),'value':'form_post'},{'key':_0x6104('0x26'),'value':encodeURIComponent(_0x56c61c)},{'key':_0x6104('0x27'),'value':_0x5aa639},{'key':_0x6104('0x28'),'value':_0x44e08c},{'key':'prompt','value':'login'}];var _0xb83003=_0xb9e162+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6104('0x12')](_0x1afa94,function(_0x4dfd3f){return _0x4dfd3f['key']+'='+_0x4dfd3f[_0x6104('0x29')];})[_0x6104('0x2a')]('&');_0xe0cbba['oauth2Claims']={'issuer':_0xb9e162[_0x6104('0x18')](_0x6104('0x2b'),''),'audience':_0xe0cbba[_0x6104('0x22')],'state':_0x5aa639,'nonce':_0x44e08c};redis[_0x6104('0x2c')](_0x5aa639,JSON['stringify'](_0xe0cbba));return _0xb83003;}function isValidIdToken(_0x20de8e,_0x15f168){try{var _0x38f3f3=jwt[_0x6104('0x2d')](_0x20de8e,{'complete':!![]});var _0x18d346=_0x38f3f3[_0x6104('0x2e')];if(_0x18d346[_0x6104('0x2f')]!==_0x15f168[_0x6104('0x30')])return![];if(_0x18d346[_0x6104('0x31')]!==_0x15f168['audience'])return![];if(_0x18d346[_0x6104('0x28')]!==_0x15f168['nonce'])return![];if(moment()[_0x6104('0x32')](moment['unix'](_0x18d346[_0x6104('0x33')])))return![];return!![];}catch(_0x4c591d){throw _0x4c591d;}}function refreshOauth2MicrosoftAccessToken(_0x43c160){return Promise[_0x6104('0x34')]()[_0x6104('0x35')](function(){if(_0x43c160['data3'])return _0x43c160;return db[_0x6104('0x36')][_0x6104('0x37')]({'where':{'id':_0x43c160['id']},'raw':!![]});})[_0x6104('0x35')](function(_0xc0b0dd){var _0xfc2339={'grant_type':_0x6104('0x38'),'refresh_token':_0xc0b0dd[_0x6104('0x39')],'scope':getAccessTokenScope(_0xc0b0dd),'redirect_uri':_0xc0b0dd[_0x6104('0x24')],'client_id':_0xc0b0dd['data1'],'client_secret':encryptor[_0x6104('0x3a')](_0xc0b0dd[_0x6104('0x3b')])};var _0x5a9f98={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x6104('0x18')](_0x6104('0x3c'),_0xc0b0dd['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xfc2339,'json':!![]};return rp(_0x5a9f98);})[_0x6104('0x35')](function(_0x1731ad){_0x43c160[_0x6104('0x3d')]=_0x1731ad[_0x6104('0x3e')];_0x43c160[_0x6104('0x39')]=_0x1731ad[_0x6104('0x38')];return db[_0x6104('0x36')][_0x6104('0x3f')]({'data5':_0x43c160[_0x6104('0x3d')],'data6':_0x43c160['data6']},{'where':{'id':_0x43c160['id']}});})[_0x6104('0x35')](function(){return _0x43c160;})[_0x6104('0x40')](function(_0x54e165){logger[_0x6104('0x41')](_0x6104('0x42'),_0x43c160['id'],_0x54e165);});}function getOauth2MicrosoftAccessToken(_0x375592,_0x176473){var _0x567bd0={'grant_type':'authorization_code','code':_0x375592,'scope':getAccessTokenScope(_0x176473),'redirect_uri':_0x176473[_0x6104('0x24')],'client_id':_0x176473['data1'],'client_secret':encryptor['decryptString'](_0x176473[_0x6104('0x3b')])};var _0x3321b4={'method':_0x6104('0x43'),'uri':MICROSOFT_AUTH_URL[_0x6104('0x18')](_0x6104('0x3c'),_0x176473[_0x6104('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x567bd0,'json':!![]};return rp(_0x3321b4);}function startRefreshInterval(_0x604988){var _0x3b191d=schedule[_0x6104('0x44')];if(_0x3b191d[_0x604988['id']])clearInterval(_0x3b191d[_0x604988['id']]);_0x3b191d[_0x604988['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6104('0x45')](this,{'id':_0x604988['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6104('0x44')]=_0x3b191d;}function startAllRefreshIntervals(){return db[_0x6104('0x36')][_0x6104('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x89db04){var _0x3c7a1c=_0x89db04[_0x6104('0x12')](function(_0x1b103c){return refreshOauth2MicrosoftAccessToken(_0x1b103c)['then'](function(_0x20c6ff){startRefreshInterval(_0x20c6ff);});});return Promise[_0x6104('0x47')](_0x3c7a1c);})[_0x6104('0x40')](function(_0x4c56ed){var _0x366206=_0x4c56ed?util[_0x6104('0x48')](_0x4c56ed,{'showHidden':![],'depth':null}):'';logger[_0x6104('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x366206);});}module[_0x6104('0x49')]={'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 378ae69..e9d3507 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 _0x9805=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4adf81,_0x27f409){var _0x3dda91=function(_0xfd5090){while(--_0xfd5090){_0x4adf81['push'](_0x4adf81['shift']());}};_0x3dda91(++_0x27f409);}(_0x9805,0x18f));var _0x5980=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x9805[_0x5a7f64];return _0x3d30f1;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var moment=require(_0x5980('0x2'));var BPromise=require(_0x5980('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5980('0x4'))['db'];var utils=require(_0x5980('0x5'));var logger=require(_0x5980('0x6'))(_0x5980('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5980('0x8')][_0x5980('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9b,_0x1d6536,_0x175728){return new BPromise(function(_0x3399a9,_0xf8b3c0){return client[_0x5980('0xa')](_0x326b9b,_0x175728)[_0x5980('0xb')](function(_0x35b0ad){logger[_0x5980('0xc')](_0x5980('0xd'),_0x1d6536,'request\x20sent');logger['debug'](_0x5980('0xe'),_0x1d6536,_0x5980('0xf'),JSON[_0x5980('0x10')](_0x35b0ad));if(_0x35b0ad[_0x5980('0x11')]){if(_0x35b0ad['error'][_0x5980('0x12')]===0x1f4){logger[_0x5980('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1d6536,_0x35b0ad['error'][_0x5980('0x13')]);return _0xf8b3c0(_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);}logger[_0x5980('0x11')](_0x5980('0xd'),_0x1d6536,_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);return _0x3399a9(_0x35b0ad[_0x5980('0x11')]['message']);}else{logger[_0x5980('0xc')]('CloudProvider,\x20%s,\x20%s',_0x1d6536,_0x5980('0xf'));_0x3399a9(_0x35b0ad[_0x5980('0x14')][_0x5980('0x13')]);}})[_0x5980('0x15')](function(_0x183261){logger['error'](_0x5980('0xd'),_0x1d6536,_0x183261);_0xf8b3c0(_0x183261);});});}
\ No newline at end of file
+var _0x731b=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x731b,0xf7));var _0xb731=function(_0x47c534,_0x595faa){_0x47c534=_0x47c534-0x0;var _0x2b16fc=_0x731b[_0x47c534];return _0x2b16fc;};'use strict';var _=require(_0xb731('0x0'));var util=require(_0xb731('0x1'));var moment=require('moment');var BPromise=require(_0xb731('0x2'));var rs=require(_0xb731('0x3'));var fs=require('fs');var Redis=require(_0xb731('0x4'));var db=require(_0xb731('0x5'))['db'];var utils=require(_0xb731('0x6'));var logger=require(_0xb731('0x7'))('rpc');var config=require(_0xb731('0x8'));var jayson=require(_0xb731('0x9'));var client=jayson[_0xb731('0xa')][_0xb731('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12c59b,_0x2b475d,_0x173768){return new BPromise(function(_0x58b83c,_0x2ab04b){return client[_0xb731('0xc')](_0x12c59b,_0x173768)[_0xb731('0xd')](function(_0x26488c){logger[_0xb731('0xe')](_0xb731('0xf'),_0x2b475d,_0xb731('0x10'));logger[_0xb731('0x11')](_0xb731('0x12'),_0x2b475d,_0xb731('0x10'),JSON[_0xb731('0x13')](_0x26488c));if(_0x26488c[_0xb731('0x14')]){if(_0x26488c[_0xb731('0x14')][_0xb731('0x15')]===0x1f4){logger[_0xb731('0x14')]('CloudProvider,\x20%s,\x20%s',_0x2b475d,_0x26488c[_0xb731('0x14')]['message']);return _0x2ab04b(_0x26488c[_0xb731('0x14')][_0xb731('0x16')]);}logger[_0xb731('0x14')]('CloudProvider,\x20%s,\x20%s',_0x2b475d,_0x26488c[_0xb731('0x14')]['message']);return _0x58b83c(_0x26488c['error']['message']);}else{logger[_0xb731('0xe')](_0xb731('0xf'),_0x2b475d,'request\x20sent');_0x58b83c(_0x26488c[_0xb731('0x17')][_0xb731('0x16')]);}})['catch'](function(_0x30da75){logger[_0xb731('0x14')](_0xb731('0xf'),_0x2b475d,_0x30da75);_0x2ab04b(_0x30da75);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8019b22..d9c6b6c 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0xb1b48e,_0x28af0b){var _0xffa622=function(_0x4bea8f){while(--_0x4bea8f){_0xb1b48e['push'](_0xb1b48e['shift']());}};_0xffa622(++_0x28af0b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x5a79cd,_0x101690){var _0x83aaf0=function(_0x4eec07){while(--_0x4eec07){_0x5a79cd['push'](_0x5a79cd['shift']());}};_0x83aaf0(++_0x101690);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xc4aa[_0x4a747d];return _0x3a5b5c;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 691cdc0..1d28345 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 _0x076b=['STRING','name','sequelize','exports'];(function(_0xc29e65,_0x7f1e9e){var _0x36240d=function(_0x29a1ce){while(--_0x29a1ce){_0xc29e65['push'](_0xc29e65['shift']());}};_0x36240d(++_0x7f1e9e);}(_0x076b,0x76));var _0xb076=function(_0x36fa2c,_0x3c3374){_0x36fa2c=_0x36fa2c-0x0;var _0x51529e=_0x076b[_0x36fa2c];return _0x51529e;};'use strict';var Sequelize=require(_0xb076('0x0'));module[_0xb076('0x1')]={'name':{'type':Sequelize[_0xb076('0x2')],'unique':_0xb076('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb076('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xb076('0x2')]},'phone':{'type':Sequelize[_0xb076('0x2')]},'fax':{'type':Sequelize[_0xb076('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xb076('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb076('0x2')]},'country':{'type':Sequelize[_0xb076('0x2')]},'email':{'type':Sequelize[_0xb076('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb076('0x2')]},'sStreet':{'type':Sequelize[_0xb076('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb076('0x2')]}};
\ No newline at end of file
+var _0x85ac=['sequelize','exports','STRING','name'];(function(_0x53012f,_0xaa1316){var _0x2e7670=function(_0x50b547){while(--_0x50b547){_0x53012f['push'](_0x53012f['shift']());}};_0x2e7670(++_0xaa1316);}(_0x85ac,0x1c4));var _0xc85a=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x85ac[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0xc85a('0x0'));module[_0xc85a('0x1')]={'name':{'type':Sequelize[_0xc85a('0x2')],'unique':_0xc85a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc85a('0x2')]},'phone':{'type':Sequelize[_0xc85a('0x2')]},'fax':{'type':Sequelize[_0xc85a('0x2')]},'type':{'type':Sequelize[_0xc85a('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc85a('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xc85a('0x2')]},'email':{'type':Sequelize[_0xc85a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc85a('0x2')]},'sStreet':{'type':Sequelize[_0xc85a('0x2')]},'sPostalCode':{'type':Sequelize[_0xc85a('0x2')]},'sCity':{'type':Sequelize[_0xc85a('0x2')]},'sCountry':{'type':Sequelize[_0xc85a('0x2')]},'description':{'type':Sequelize[_0xc85a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 69e2cc7..0875793 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 _0xff0b=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','findOne','getContacts','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','error','stack','index','CmCompany','describe','model'];(function(_0x69fea6,_0x3fdef5){var _0x2d7038=function(_0x1c7c64){while(--_0x1c7c64){_0x69fea6['push'](_0x69fea6['shift']());}};_0x2d7038(++_0x3fdef5);}(_0xff0b,0x12e));var _0xbff0=function(_0x56966a,_0x4783c2){_0x56966a=_0x56966a-0x0;var _0x477527=_0xff0b[_0x56966a];return _0x477527;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbff0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbff0('0x1'));var rp=require(_0xbff0('0x2'));var moment=require(_0xbff0('0x3'));var BPromise=require(_0xbff0('0x4'));var Mustache=require(_0xbff0('0x5'));var util=require(_0xbff0('0x6'));var path=require('path');var sox=require(_0xbff0('0x7'));var csv=require(_0xbff0('0x8'));var ejs=require(_0xbff0('0x9'));var fs=require('fs');var fs_extra=require(_0xbff0('0xa'));var _=require(_0xbff0('0xb'));var squel=require(_0xbff0('0xc'));var crypto=require(_0xbff0('0xd'));var jsforce=require(_0xbff0('0xe'));var deskjs=require(_0xbff0('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbff0('0x10'));var Redis=require(_0xbff0('0x11'));var authService=require(_0xbff0('0x12'));var qs=require(_0xbff0('0x13'));var as=require(_0xbff0('0x14'));var hardwareService=require(_0xbff0('0x15'));var logger=require(_0xbff0('0x16'))(_0xbff0('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbff0('0x18'))['db'];function respondWithStatusCode(_0x53d1b7,_0x1bf3bb){_0x1bf3bb=_0x1bf3bb||0xcc;return function(_0xa3bc73){if(_0xa3bc73){return _0x53d1b7[_0xbff0('0x19')](_0x1bf3bb);}return _0x53d1b7[_0xbff0('0x1a')](_0x1bf3bb)[_0xbff0('0x1b')]();};}function respondWithResult(_0x2f7f85,_0x114b97){_0x114b97=_0x114b97||0xc8;return function(_0x25d37f){if(_0x25d37f){return _0x2f7f85[_0xbff0('0x1a')](_0x114b97)[_0xbff0('0x1c')](_0x25d37f);}};}function respondWithFilteredResult(_0x391880,_0x24cff3){return function(_0x355174){if(_0x355174){var _0x7778ae=typeof _0x24cff3['offset']===_0xbff0('0x1d')&&typeof _0x24cff3[_0xbff0('0x1e')]===_0xbff0('0x1d');var _0x4440da=_0x355174[_0xbff0('0x1f')];var _0x2918cd=_0x7778ae?0x0:_0x24cff3['offset'];var _0x2763d6=_0x7778ae?_0x355174[_0xbff0('0x1f')]:_0x24cff3[_0xbff0('0x20')]+_0x24cff3['limit'];var _0x163d1e;if(_0x2763d6>=_0x4440da){_0x2763d6=_0x4440da;_0x163d1e=0xc8;}else{_0x163d1e=0xce;}_0x391880[_0xbff0('0x1a')](_0x163d1e);return _0x391880[_0xbff0('0x21')](_0xbff0('0x22'),_0x2918cd+'-'+_0x2763d6+'/'+_0x4440da)[_0xbff0('0x1c')](_0x355174);}return null;};}function patchUpdates(_0x42039b){return function(_0x199924){try{jsonpatch[_0xbff0('0x23')](_0x199924,_0x42039b,!![]);}catch(_0x2f7ac6){return BPromise[_0xbff0('0x24')](_0x2f7ac6);}return _0x199924[_0xbff0('0x25')]();};}function saveUpdates(_0x2814ca,_0x259b0b){return function(_0x5c8fca){if(_0x5c8fca){return _0x5c8fca[_0xbff0('0x26')](_0x2814ca)[_0xbff0('0x27')](function(_0x33b0a8){return _0x33b0a8;});}return null;};}function removeEntity(_0x1decb5,_0x3ce2ea){return function(_0x195697){if(_0x195697){return _0x195697['destroy']()['then'](function(){var _0x997e74=_0x195697[_0xbff0('0x28')]({'plain':!![]});var _0x268887=_0xbff0('0x29');return db[_0xbff0('0x2a')][_0xbff0('0x2b')]({'where':{'type':_0x268887,'resourceId':_0x997e74['id']}})['then'](function(){return _0x195697;});})[_0xbff0('0x27')](function(){_0x1decb5[_0xbff0('0x1a')](0xcc)[_0xbff0('0x1b')]();});}};}function handleEntityNotFound(_0x42d466,_0xcde13f){return function(_0x56da66){if(!_0x56da66){_0x42d466[_0xbff0('0x19')](0x194);}return _0x56da66;};}function handleError(_0x40f725,_0x1e9010){_0x1e9010=_0x1e9010||0x1f4;return function(_0x2493e6){logger[_0xbff0('0x2c')](_0x2493e6[_0xbff0('0x2d')]);if(_0x2493e6['name']){delete _0x2493e6['name'];}_0x40f725['status'](_0x1e9010)['send'](_0x2493e6);};}exports[_0xbff0('0x2e')]=function(_0x2bf86b,_0x4be646){var _0xe0c6b5={},_0xdec686={},_0x3467d8={'count':0x0,'rows':[]};return db[_0xbff0('0x2f')][_0xbff0('0x30')]()['then'](function(_0x59532f){_0xdec686[_0xbff0('0x31')]=_[_0xbff0('0x32')](_0x59532f);_0xdec686['query']=_[_0xbff0('0x32')](_0x2bf86b[_0xbff0('0x33')]);_0xdec686[_0xbff0('0x34')]=_[_0xbff0('0x35')](_0xdec686['model'],_0xdec686[_0xbff0('0x33')]);_0xe0c6b5[_0xbff0('0x36')]=_['intersection'](_0xdec686[_0xbff0('0x31')],qs[_0xbff0('0x37')](_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x37')]));_0xe0c6b5[_0xbff0('0x36')]=_0xe0c6b5['attributes'][_0xbff0('0x38')]?_0xe0c6b5[_0xbff0('0x36')]:_0xdec686['model'];if(!_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x39')](_0xbff0('0x3a'))){_0xe0c6b5[_0xbff0('0x1e')]=qs['limit'](_0x2bf86b['query'][_0xbff0('0x1e')]);_0xe0c6b5[_0xbff0('0x20')]=qs[_0xbff0('0x20')](_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x20')]);}_0xe0c6b5[_0xbff0('0x3b')]=qs[_0xbff0('0x3c')](_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x3c')]);_0xe0c6b5[_0xbff0('0x3d')]=qs[_0xbff0('0x34')](_[_0xbff0('0x3e')](_0x2bf86b['query'],_0xdec686[_0xbff0('0x34')]),_0x59532f);if(_0x2bf86b['query'][_0xbff0('0x3f')]){_0xe0c6b5[_0xbff0('0x3d')]=_[_0xbff0('0x40')](_0xe0c6b5[_0xbff0('0x3d')],{'$or':_[_0xbff0('0x41')](_0xe0c6b5[_0xbff0('0x36')],function(_0x53823d){var _0x51d584={};_0x51d584[_0x53823d]={'$like':'%'+_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x3f')]+'%'};return _0x51d584;})});}_0xe0c6b5=_['merge']({},_0xe0c6b5,_0x2bf86b[_0xbff0('0x42')]);var _0x60c4db={'where':_0xe0c6b5['where']};return db[_0xbff0('0x2f')][_0xbff0('0x1f')](_0x60c4db)[_0xbff0('0x27')](function(_0x1bc67c){_0x3467d8['count']=_0x1bc67c;if(_0x2bf86b[_0xbff0('0x33')][_0xbff0('0x43')]){_0xe0c6b5[_0xbff0('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0xbff0('0x45')](_0xe0c6b5);})[_0xbff0('0x27')](function(_0x3d181){_0x3467d8[_0xbff0('0x46')]=_0x3d181;return _0x3467d8;})['then'](respondWithFilteredResult(_0x4be646,_0xe0c6b5))[_0xbff0('0x47')](handleError(_0x4be646,null));})[_0xbff0('0x47')](handleError(_0x4be646,null));};exports[_0xbff0('0x48')]=function(_0x4a9b77,_0x14a963){var _0x5607c5={'raw':![],'where':{'id':_0x4a9b77[_0xbff0('0x49')]['id']}},_0xa82e83={};_0xa82e83['model']=_['keys'](db[_0xbff0('0x2f')][_0xbff0('0x4a')]);_0xa82e83['query']=_['keys'](_0x4a9b77['query']);_0xa82e83['filters']=_[_0xbff0('0x35')](_0xa82e83[_0xbff0('0x31')],_0xa82e83['query']);_0x5607c5[_0xbff0('0x36')]=_[_0xbff0('0x35')](_0xa82e83['model'],qs['fields'](_0x4a9b77['query'][_0xbff0('0x37')]));_0x5607c5[_0xbff0('0x36')]=_0x5607c5[_0xbff0('0x36')]['length']?_0x5607c5['attributes']:_0xa82e83[_0xbff0('0x31')];if(_0x4a9b77[_0xbff0('0x33')][_0xbff0('0x43')]){_0x5607c5['include']=[{'all':!![]}];}_0x5607c5=_[_0xbff0('0x40')]({},_0x5607c5,_0x4a9b77['options']);return db[_0xbff0('0x2f')][_0xbff0('0x4b')](_0x5607c5)['then'](handleEntityNotFound(_0x14a963,null))[_0xbff0('0x27')](respondWithResult(_0x14a963,null))[_0xbff0('0x47')](handleError(_0x14a963,null));};exports[_0xbff0('0x4c')]=function(_0x496857,_0x28663b){return db[_0xbff0('0x2f')][_0xbff0('0x4c')](_0x496857[_0xbff0('0x4d')],{})[_0xbff0('0x27')](function(_0xa56c60){var _0x1eb8de=_0x496857[_0xbff0('0x4e')][_0xbff0('0x28')]({'plain':!![]});if(!_0x1eb8de)throw new Error(_0xbff0('0x4f'));if(_0x1eb8de['role']===_0xbff0('0x4e')){var _0x8ca120=_0xa56c60[_0xbff0('0x28')]({'plain':!![]});var _0x49e142=_0xbff0('0x29');return db[_0xbff0('0x50')]['find']({'where':{'name':_0x49e142,'userProfileId':_0x1eb8de['userProfileId']},'raw':!![]})[_0xbff0('0x27')](function(_0x155e70){if(_0x155e70&&_0x155e70[_0xbff0('0x51')]===0x0){return db[_0xbff0('0x2a')][_0xbff0('0x4c')]({'name':_0x8ca120[_0xbff0('0x52')],'resourceId':_0x8ca120['id'],'type':_0x155e70[_0xbff0('0x52')],'sectionId':_0x155e70['id']},{})[_0xbff0('0x27')](function(){return _0xa56c60;});}else{return _0xa56c60;}})[_0xbff0('0x47')](function(_0x556abd){logger[_0xbff0('0x2c')](_0xbff0('0x53'),_0x556abd);throw _0x556abd;});}return _0xa56c60;})[_0xbff0('0x27')](respondWithResult(_0x28663b,0xc9))['catch'](handleError(_0x28663b,null));};exports[_0xbff0('0x26')]=function(_0x4abd3e,_0x5888cb){if(_0x4abd3e[_0xbff0('0x4d')]['id']){delete _0x4abd3e[_0xbff0('0x4d')]['id'];}return db[_0xbff0('0x2f')]['find']({'where':{'id':_0x4abd3e[_0xbff0('0x49')]['id']}})[_0xbff0('0x27')](handleEntityNotFound(_0x5888cb,null))['then'](saveUpdates(_0x4abd3e[_0xbff0('0x4d')],null))['then'](respondWithResult(_0x5888cb,null))['catch'](handleError(_0x5888cb,null));};exports[_0xbff0('0x2b')]=function(_0x4f29df,_0xd7dc93){return db[_0xbff0('0x2f')]['find']({'where':{'id':_0x4f29df[_0xbff0('0x49')]['id']}})[_0xbff0('0x27')](handleEntityNotFound(_0xd7dc93,null))[_0xbff0('0x27')](removeEntity(_0xd7dc93,null))[_0xbff0('0x47')](handleError(_0xd7dc93,null));};exports[_0xbff0('0x30')]=function(_0x1aee34,_0x3a4a2a){return db[_0xbff0('0x2f')][_0xbff0('0x30')]()[_0xbff0('0x27')](respondWithResult(_0x3a4a2a,null))[_0xbff0('0x47')](handleError(_0x3a4a2a,null));};exports[_0xbff0('0x54')]=function(_0x531579,_0xa183ab,_0x14143a){return db['CmContact'][_0xbff0('0x4b')]({'where':{'id':_0x531579[_0xbff0('0x49')]['id']}})['then'](handleEntityNotFound(_0xa183ab,null))[_0xbff0('0x27')](function(_0x59d70d){if(_0x59d70d){return _0x59d70d['addContacts'](_0x531579['body']['ids'],_[_0xbff0('0x55')](_0x531579['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xa183ab,null))[_0xbff0('0x47')](handleError(_0xa183ab,null));};exports['getContacts']=function(_0x49743c,_0x10b1c3,_0x4248a3){var _0x30b1ba={};var _0x4fa915={};var _0x398e39;var _0x41d0a1;return db[_0xbff0('0x2f')][_0xbff0('0x56')]({'where':{'id':_0x49743c[_0xbff0('0x49')]['id']}})[_0xbff0('0x27')](handleEntityNotFound(_0x10b1c3,null))['then'](function(_0x313bb3){if(_0x313bb3){_0x398e39=_0x313bb3;_0x4fa915[_0xbff0('0x31')]=_[_0xbff0('0x32')](db['CmContact'][_0xbff0('0x4a')]);_0x4fa915[_0xbff0('0x33')]=_[_0xbff0('0x32')](_0x49743c[_0xbff0('0x33')]);_0x4fa915[_0xbff0('0x34')]=_[_0xbff0('0x35')](_0x4fa915[_0xbff0('0x31')],_0x4fa915[_0xbff0('0x33')]);_0x30b1ba[_0xbff0('0x36')]=_['intersection'](_0x4fa915[_0xbff0('0x31')],qs[_0xbff0('0x37')](_0x49743c[_0xbff0('0x33')][_0xbff0('0x37')]));_0x30b1ba[_0xbff0('0x36')]=_0x30b1ba[_0xbff0('0x36')]['length']?_0x30b1ba['attributes']:_0x4fa915['model'];_0x30b1ba[_0xbff0('0x3b')]=qs['sort'](_0x49743c['query']['sort']);_0x30b1ba[_0xbff0('0x3d')]=qs['filters'](_[_0xbff0('0x3e')](_0x49743c[_0xbff0('0x33')],_0x4fa915[_0xbff0('0x34')]));if(_0x49743c['query'][_0xbff0('0x3f')]){_0x30b1ba[_0xbff0('0x3d')]=_[_0xbff0('0x40')](_0x30b1ba[_0xbff0('0x3d')],{'$or':_[_0xbff0('0x41')](_0x30b1ba[_0xbff0('0x36')],function(_0x5a662e){var _0x2bc885={};_0x2bc885[_0x5a662e]={'$like':'%'+_0x49743c['query'][_0xbff0('0x3f')]+'%'};return _0x2bc885;})});}_0x30b1ba=_[_0xbff0('0x40')]({},_0x30b1ba,_0x49743c['options']);return _0x398e39[_0xbff0('0x57')](_0x30b1ba);}})['then'](function(_0x21884c){if(_0x21884c){_0x41d0a1=_0x21884c[_0xbff0('0x38')];if(!_0x49743c[_0xbff0('0x33')][_0xbff0('0x39')]('nolimit')){_0x30b1ba[_0xbff0('0x1e')]=qs['limit'](_0x49743c[_0xbff0('0x33')]['limit']);_0x30b1ba[_0xbff0('0x20')]=qs['offset'](_0x49743c[_0xbff0('0x33')][_0xbff0('0x20')]);}return _0x398e39[_0xbff0('0x57')](_0x30b1ba);}})[_0xbff0('0x27')](function(_0x167d72){if(_0x167d72){return _0x167d72?{'count':_0x41d0a1,'rows':_0x167d72}:null;}})[_0xbff0('0x27')](respondWithResult(_0x10b1c3,null))['catch'](handleError(_0x10b1c3,null));};
\ No newline at end of file
+var _0x50cc=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','Companies','UserProfileResource','stack','name','send','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x24f430,_0x523751){var _0x23cc82=function(_0x2bf6fc){while(--_0x2bf6fc){_0x24f430['push'](_0x24f430['shift']());}};_0x23cc82(++_0x523751);}(_0x50cc,0x9c));var _0xc50c=function(_0x163ff5,_0x45cd16){_0x163ff5=_0x163ff5-0x0;var _0x5a09bf=_0x50cc[_0x163ff5];return _0x5a09bf;};'use strict';var emlformat=require(_0xc50c('0x0'));var rimraf=require(_0xc50c('0x1'));var zipdir=require(_0xc50c('0x2'));var jsonpatch=require(_0xc50c('0x3'));var rp=require(_0xc50c('0x4'));var moment=require(_0xc50c('0x5'));var BPromise=require(_0xc50c('0x6'));var Mustache=require(_0xc50c('0x7'));var util=require(_0xc50c('0x8'));var path=require(_0xc50c('0x9'));var sox=require(_0xc50c('0xa'));var csv=require('to-csv');var ejs=require(_0xc50c('0xb'));var fs=require('fs');var fs_extra=require(_0xc50c('0xc'));var _=require(_0xc50c('0xd'));var squel=require(_0xc50c('0xe'));var crypto=require(_0xc50c('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc50c('0x10'));var querystring=require(_0xc50c('0x11'));var Papa=require(_0xc50c('0x12'));var Redis=require(_0xc50c('0x13'));var authService=require(_0xc50c('0x14'));var qs=require(_0xc50c('0x15'));var as=require(_0xc50c('0x16'));var hardwareService=require(_0xc50c('0x17'));var logger=require(_0xc50c('0x18'))(_0xc50c('0x19'));var utils=require('../../config/utils');var config=require(_0xc50c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xc50c('0x1b'))['db'];function respondWithStatusCode(_0x4505f1,_0x5f2142){_0x5f2142=_0x5f2142||0xcc;return function(_0x793588){if(_0x793588){return _0x4505f1[_0xc50c('0x1c')](_0x5f2142);}return _0x4505f1[_0xc50c('0x1d')](_0x5f2142)['end']();};}function respondWithResult(_0x1663b2,_0x29dc4d){_0x29dc4d=_0x29dc4d||0xc8;return function(_0x1866b4){if(_0x1866b4){return _0x1663b2['status'](_0x29dc4d)[_0xc50c('0x1e')](_0x1866b4);}};}function respondWithFilteredResult(_0x15ec93,_0x2a8fe8){return function(_0x44bbf5){if(_0x44bbf5){var _0x41865d=typeof _0x2a8fe8[_0xc50c('0x1f')]===_0xc50c('0x20')&&typeof _0x2a8fe8[_0xc50c('0x21')]===_0xc50c('0x20');var _0xcb32b8=_0x44bbf5[_0xc50c('0x22')];var _0x48c661=_0x41865d?0x0:_0x2a8fe8[_0xc50c('0x1f')];var _0x132888=_0x41865d?_0x44bbf5[_0xc50c('0x22')]:_0x2a8fe8[_0xc50c('0x1f')]+_0x2a8fe8[_0xc50c('0x21')];var _0xafeeca;if(_0x132888>=_0xcb32b8){_0x132888=_0xcb32b8;_0xafeeca=0xc8;}else{_0xafeeca=0xce;}_0x15ec93[_0xc50c('0x1d')](_0xafeeca);return _0x15ec93[_0xc50c('0x23')]('Content-Range',_0x48c661+'-'+_0x132888+'/'+_0xcb32b8)['json'](_0x44bbf5);}return null;};}function patchUpdates(_0x179c4a){return function(_0x3e4005){try{jsonpatch[_0xc50c('0x24')](_0x3e4005,_0x179c4a,!![]);}catch(_0x2e2ba3){return BPromise[_0xc50c('0x25')](_0x2e2ba3);}return _0x3e4005[_0xc50c('0x26')]();};}function saveUpdates(_0x4aa4a6,_0x52da06){return function(_0x40911a){if(_0x40911a){return _0x40911a['update'](_0x4aa4a6)[_0xc50c('0x27')](function(_0x3e534a){return _0x3e534a;});}return null;};}function removeEntity(_0x20f35f,_0x52bf4f){return function(_0x15827b){if(_0x15827b){return _0x15827b[_0xc50c('0x28')]()['then'](function(){var _0x176844=_0x15827b[_0xc50c('0x29')]({'plain':!![]});var _0x44a540=_0xc50c('0x2a');return db[_0xc50c('0x2b')][_0xc50c('0x28')]({'where':{'type':_0x44a540,'resourceId':_0x176844['id']}})[_0xc50c('0x27')](function(){return _0x15827b;});})['then'](function(){_0x20f35f[_0xc50c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x377135,_0x555802){return function(_0x4cbb00){if(!_0x4cbb00){_0x377135[_0xc50c('0x1c')](0x194);}return _0x4cbb00;};}function handleError(_0x5898a7,_0x3fa10f){_0x3fa10f=_0x3fa10f||0x1f4;return function(_0x5935cf){logger['error'](_0x5935cf[_0xc50c('0x2c')]);if(_0x5935cf[_0xc50c('0x2d')]){delete _0x5935cf[_0xc50c('0x2d')];}_0x5898a7[_0xc50c('0x1d')](_0x3fa10f)[_0xc50c('0x2e')](_0x5935cf);};}exports['index']=function(_0x259bb9,_0x219d37){var _0x4317e0={},_0x17d0b8={},_0x1dd557={'count':0x0,'rows':[]};return db[_0xc50c('0x2f')][_0xc50c('0x30')]()['then'](function(_0x28edd6){_0x17d0b8['model']=_[_0xc50c('0x31')](_0x28edd6);_0x17d0b8[_0xc50c('0x32')]=_[_0xc50c('0x31')](_0x259bb9[_0xc50c('0x32')]);_0x17d0b8[_0xc50c('0x33')]=_[_0xc50c('0x34')](_0x17d0b8[_0xc50c('0x35')],_0x17d0b8[_0xc50c('0x32')]);_0x4317e0[_0xc50c('0x36')]=_['intersection'](_0x17d0b8[_0xc50c('0x35')],qs[_0xc50c('0x37')](_0x259bb9[_0xc50c('0x32')]['fields']));_0x4317e0[_0xc50c('0x36')]=_0x4317e0[_0xc50c('0x36')][_0xc50c('0x38')]?_0x4317e0[_0xc50c('0x36')]:_0x17d0b8['model'];if(!_0x259bb9['query'][_0xc50c('0x39')](_0xc50c('0x3a'))){_0x4317e0[_0xc50c('0x21')]=qs[_0xc50c('0x21')](_0x259bb9['query'][_0xc50c('0x21')]);_0x4317e0['offset']=qs[_0xc50c('0x1f')](_0x259bb9[_0xc50c('0x32')][_0xc50c('0x1f')]);}_0x4317e0['order']=qs[_0xc50c('0x3b')](_0x259bb9[_0xc50c('0x32')]['sort']);_0x4317e0[_0xc50c('0x3c')]=qs[_0xc50c('0x33')](_[_0xc50c('0x3d')](_0x259bb9[_0xc50c('0x32')],_0x17d0b8['filters']),_0x28edd6);if(_0x259bb9[_0xc50c('0x32')][_0xc50c('0x3e')]){_0x4317e0[_0xc50c('0x3c')]=_['merge'](_0x4317e0[_0xc50c('0x3c')],{'$or':_[_0xc50c('0x3f')](_0x4317e0['attributes'],function(_0x377708){var _0x4128e3={};_0x4128e3[_0x377708]={'$like':'%'+_0x259bb9[_0xc50c('0x32')][_0xc50c('0x3e')]+'%'};return _0x4128e3;})});}_0x4317e0=_[_0xc50c('0x40')]({},_0x4317e0,_0x259bb9['options']);var _0x127903={'where':_0x4317e0[_0xc50c('0x3c')]};return db['CmCompany']['count'](_0x127903)[_0xc50c('0x27')](function(_0x58ea15){_0x1dd557[_0xc50c('0x22')]=_0x58ea15;if(_0x259bb9[_0xc50c('0x32')][_0xc50c('0x41')]){_0x4317e0[_0xc50c('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0xc50c('0x43')](_0x4317e0);})[_0xc50c('0x27')](function(_0x97711){_0x1dd557[_0xc50c('0x44')]=_0x97711;return _0x1dd557;})['then'](respondWithFilteredResult(_0x219d37,_0x4317e0))['catch'](handleError(_0x219d37,null));})[_0xc50c('0x45')](handleError(_0x219d37,null));};exports[_0xc50c('0x46')]=function(_0x299d57,_0x3a9aac){var _0x232d4d={'raw':![],'where':{'id':_0x299d57[_0xc50c('0x47')]['id']}},_0x329338={};_0x329338[_0xc50c('0x35')]=_['keys'](db['CmCompany']['rawAttributes']);_0x329338['query']=_[_0xc50c('0x31')](_0x299d57['query']);_0x329338[_0xc50c('0x33')]=_['intersection'](_0x329338[_0xc50c('0x35')],_0x329338[_0xc50c('0x32')]);_0x232d4d[_0xc50c('0x36')]=_['intersection'](_0x329338[_0xc50c('0x35')],qs[_0xc50c('0x37')](_0x299d57[_0xc50c('0x32')][_0xc50c('0x37')]));_0x232d4d['attributes']=_0x232d4d[_0xc50c('0x36')][_0xc50c('0x38')]?_0x232d4d['attributes']:_0x329338[_0xc50c('0x35')];if(_0x299d57['query'][_0xc50c('0x41')]){_0x232d4d['include']=[{'all':!![]}];}_0x232d4d=_[_0xc50c('0x40')]({},_0x232d4d,_0x299d57[_0xc50c('0x48')]);return db[_0xc50c('0x2f')][_0xc50c('0x49')](_0x232d4d)[_0xc50c('0x27')](handleEntityNotFound(_0x3a9aac,null))[_0xc50c('0x27')](respondWithResult(_0x3a9aac,null))['catch'](handleError(_0x3a9aac,null));};exports['create']=function(_0x2513f9,_0x1066ee){return db[_0xc50c('0x2f')][_0xc50c('0x4a')](_0x2513f9[_0xc50c('0x4b')],{})['then'](function(_0x22fbc7){var _0x2941c8=_0x2513f9[_0xc50c('0x4c')][_0xc50c('0x29')]({'plain':!![]});if(!_0x2941c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2941c8[_0xc50c('0x4d')]===_0xc50c('0x4c')){var _0x437a1f=_0x22fbc7[_0xc50c('0x29')]({'plain':!![]});var _0x1ab655=_0xc50c('0x2a');return db[_0xc50c('0x4e')]['find']({'where':{'name':_0x1ab655,'userProfileId':_0x2941c8[_0xc50c('0x4f')]},'raw':!![]})[_0xc50c('0x27')](function(_0x473f68){if(_0x473f68&&_0x473f68[_0xc50c('0x50')]===0x0){return db[_0xc50c('0x2b')][_0xc50c('0x4a')]({'name':_0x437a1f[_0xc50c('0x2d')],'resourceId':_0x437a1f['id'],'type':_0x473f68[_0xc50c('0x2d')],'sectionId':_0x473f68['id']},{})[_0xc50c('0x27')](function(){return _0x22fbc7;});}else{return _0x22fbc7;}})['catch'](function(_0xe5fcd3){logger['error'](_0xc50c('0x51'),_0xe5fcd3);throw _0xe5fcd3;});}return _0x22fbc7;})['then'](respondWithResult(_0x1066ee,0xc9))[_0xc50c('0x45')](handleError(_0x1066ee,null));};exports[_0xc50c('0x52')]=function(_0x3dfab5,_0x49b81a){if(_0x3dfab5[_0xc50c('0x4b')]['id']){delete _0x3dfab5[_0xc50c('0x4b')]['id'];}return db[_0xc50c('0x2f')][_0xc50c('0x49')]({'where':{'id':_0x3dfab5['params']['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x49b81a,null))[_0xc50c('0x27')](saveUpdates(_0x3dfab5[_0xc50c('0x4b')],null))[_0xc50c('0x27')](respondWithResult(_0x49b81a,null))[_0xc50c('0x45')](handleError(_0x49b81a,null));};exports[_0xc50c('0x28')]=function(_0x56d35f,_0x4182e5){return db[_0xc50c('0x2f')][_0xc50c('0x49')]({'where':{'id':_0x56d35f[_0xc50c('0x47')]['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x4182e5,null))['then'](removeEntity(_0x4182e5,null))[_0xc50c('0x45')](handleError(_0x4182e5,null));};exports[_0xc50c('0x30')]=function(_0x4a43cb,_0x226e56){return db[_0xc50c('0x2f')][_0xc50c('0x30')]()[_0xc50c('0x27')](respondWithResult(_0x226e56,null))[_0xc50c('0x45')](handleError(_0x226e56,null));};exports[_0xc50c('0x53')]=function(_0x32bc3f,_0x285ce2,_0x11d8c6){return db[_0xc50c('0x54')][_0xc50c('0x49')]({'where':{'id':_0x32bc3f[_0xc50c('0x47')]['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x285ce2,null))[_0xc50c('0x27')](function(_0x2a8fc8){if(_0x2a8fc8){return _0x2a8fc8[_0xc50c('0x53')](_0x32bc3f[_0xc50c('0x4b')][_0xc50c('0x55')],_[_0xc50c('0x56')](_0x32bc3f[_0xc50c('0x4b')],[_0xc50c('0x55'),'id'])||{});}})[_0xc50c('0x27')](respondWithResult(_0x285ce2,null))[_0xc50c('0x45')](handleError(_0x285ce2,null));};exports[_0xc50c('0x57')]=function(_0x4bd894,_0x585457,_0x281b37){var _0x2faecf={};var _0x23f9fd={};var _0x4649da;var _0x49a25b;return db[_0xc50c('0x2f')][_0xc50c('0x58')]({'where':{'id':_0x4bd894[_0xc50c('0x47')]['id']}})[_0xc50c('0x27')](handleEntityNotFound(_0x585457,null))['then'](function(_0x9749f){if(_0x9749f){_0x4649da=_0x9749f;_0x23f9fd[_0xc50c('0x35')]=_[_0xc50c('0x31')](db['CmContact'][_0xc50c('0x59')]);_0x23f9fd[_0xc50c('0x32')]=_['keys'](_0x4bd894[_0xc50c('0x32')]);_0x23f9fd[_0xc50c('0x33')]=_[_0xc50c('0x34')](_0x23f9fd[_0xc50c('0x35')],_0x23f9fd[_0xc50c('0x32')]);_0x2faecf[_0xc50c('0x36')]=_['intersection'](_0x23f9fd[_0xc50c('0x35')],qs[_0xc50c('0x37')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x37')]));_0x2faecf[_0xc50c('0x36')]=_0x2faecf[_0xc50c('0x36')][_0xc50c('0x38')]?_0x2faecf[_0xc50c('0x36')]:_0x23f9fd['model'];_0x2faecf[_0xc50c('0x5a')]=qs[_0xc50c('0x3b')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x3b')]);_0x2faecf[_0xc50c('0x3c')]=qs[_0xc50c('0x33')](_['pick'](_0x4bd894['query'],_0x23f9fd['filters']));if(_0x4bd894[_0xc50c('0x32')][_0xc50c('0x3e')]){_0x2faecf['where']=_[_0xc50c('0x40')](_0x2faecf[_0xc50c('0x3c')],{'$or':_[_0xc50c('0x3f')](_0x2faecf['attributes'],function(_0x31236c){var _0x7be25d={};_0x7be25d[_0x31236c]={'$like':'%'+_0x4bd894['query'][_0xc50c('0x3e')]+'%'};return _0x7be25d;})});}_0x2faecf=_[_0xc50c('0x40')]({},_0x2faecf,_0x4bd894[_0xc50c('0x48')]);return _0x4649da[_0xc50c('0x57')](_0x2faecf);}})[_0xc50c('0x27')](function(_0x53c510){if(_0x53c510){_0x49a25b=_0x53c510[_0xc50c('0x38')];if(!_0x4bd894[_0xc50c('0x32')][_0xc50c('0x39')]('nolimit')){_0x2faecf[_0xc50c('0x21')]=qs[_0xc50c('0x21')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x21')]);_0x2faecf[_0xc50c('0x1f')]=qs[_0xc50c('0x1f')](_0x4bd894[_0xc50c('0x32')][_0xc50c('0x1f')]);}return _0x4649da['getContacts'](_0x2faecf);}})[_0xc50c('0x27')](function(_0x27e650){if(_0x27e650){return _0x27e650?{'count':_0x49a25b,'rows':_0x27e650}:null;}})[_0xc50c('0x27')](respondWithResult(_0x585457,null))[_0xc50c('0x45')](handleError(_0x585457,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 5911930..0d18fdb 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 _0x7e81=['api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x7e81,0xa7));var _0x17e8=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7e81[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var util=require(_0x17e8('0x0'));var logger=require('../../config/logger')(_0x17e8('0x1'));var moment=require(_0x17e8('0x2'));var BPromise=require(_0x17e8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17e8('0x4'));var rimraf=require(_0x17e8('0x5'));var config=require(_0x17e8('0x6'));var attributes=require(_0x17e8('0x7'));module[_0x17e8('0x8')]=function(_0x1bb44e,_0x1b81af){return _0x1bb44e[_0x17e8('0x9')](_0x17e8('0xa'),attributes,{'tableName':_0x17e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12ca=['path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12ca,0x85));var _0xa12c=function(_0x41667c,_0x5151be){_0x41667c=_0x41667c-0x0;var _0x4a2870=_0x12ca[_0x41667c];return _0x4a2870;};'use strict';var _=require(_0xa12c('0x0'));var util=require(_0xa12c('0x1'));var logger=require(_0xa12c('0x2'))(_0xa12c('0x3'));var moment=require(_0xa12c('0x4'));var BPromise=require(_0xa12c('0x5'));var rp=require(_0xa12c('0x6'));var fs=require('fs');var path=require(_0xa12c('0x7'));var rimraf=require(_0xa12c('0x8'));var config=require(_0xa12c('0x9'));var attributes=require('./cmCompany.attributes');module[_0xa12c('0xa')]=function(_0x5286e2,_0x6d77a5){return _0x5286e2[_0xa12c('0xb')](_0xa12c('0xc'),attributes,{'tableName':_0xa12c('0xd'),'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 f015cb0..d13d715 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 _0x7f6b=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7f6b,0x11f));var _0xb7f6=function(_0x1591b2,_0x1546f3){_0x1591b2=_0x1591b2-0x0;var _0x627a49=_0x7f6b[_0x1591b2];return _0x627a49;};'use strict';var _=require(_0xb7f6('0x0'));var util=require('util');var moment=require(_0xb7f6('0x1'));var BPromise=require('bluebird');var rs=require(_0xb7f6('0x2'));var fs=require('fs');var Redis=require(_0xb7f6('0x3'));var db=require(_0xb7f6('0x4'))['db'];var utils=require(_0xb7f6('0x5'));var logger=require(_0xb7f6('0x6'))(_0xb7f6('0x7'));var config=require(_0xb7f6('0x8'));var jayson=require(_0xb7f6('0x9'));var client=jayson[_0xb7f6('0xa')][_0xb7f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x330343,_0x556014,_0xf6b34b){return new BPromise(function(_0xe2f6f0,_0x46d8c9){return client['request'](_0x330343,_0xf6b34b)[_0xb7f6('0xc')](function(_0xd85c89){logger['info'](_0xb7f6('0xd'),_0x556014,'request\x20sent');logger[_0xb7f6('0xe')](_0xb7f6('0xf'),_0x556014,_0xb7f6('0x10'),JSON[_0xb7f6('0x11')](_0xd85c89));if(_0xd85c89[_0xb7f6('0x12')]){if(_0xd85c89[_0xb7f6('0x12')][_0xb7f6('0x13')]===0x1f4){logger['error'](_0xb7f6('0xd'),_0x556014,_0xd85c89[_0xb7f6('0x12')][_0xb7f6('0x14')]);return _0x46d8c9(_0xd85c89['error'][_0xb7f6('0x14')]);}logger[_0xb7f6('0x12')]('CmCompany,\x20%s,\x20%s',_0x556014,_0xd85c89['error'][_0xb7f6('0x14')]);return _0xe2f6f0(_0xd85c89[_0xb7f6('0x12')][_0xb7f6('0x14')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x556014,_0xb7f6('0x10'));_0xe2f6f0(_0xd85c89['result'][_0xb7f6('0x14')]);}})[_0xb7f6('0x15')](function(_0x1d5c1d){logger[_0xb7f6('0x12')](_0xb7f6('0xd'),_0x556014,_0x1d5c1d);_0x46d8c9(_0x1d5c1d);});});}
\ No newline at end of file
+var _0x482a=['CmCompany,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x29c61c,_0x5c2c78){var _0x253c3e=function(_0x40f3d1){while(--_0x40f3d1){_0x29c61c['push'](_0x29c61c['shift']());}};_0x253c3e(++_0x5c2c78);}(_0x482a,0xfa));var _0xa482=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x482a[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xa482('0x0'));var moment=require(_0xa482('0x1'));var BPromise=require(_0xa482('0x2'));var rs=require(_0xa482('0x3'));var fs=require('fs');var Redis=require(_0xa482('0x4'));var db=require(_0xa482('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa482('0x6'))(_0xa482('0x7'));var config=require(_0xa482('0x8'));var jayson=require(_0xa482('0x9'));var client=jayson[_0xa482('0xa')][_0xa482('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171125,_0x31e568,_0x2a4a76){return new BPromise(function(_0x4e6749,_0x27ba54){return client[_0xa482('0xc')](_0x171125,_0x2a4a76)[_0xa482('0xd')](function(_0x5daa90){logger['info'](_0xa482('0xe'),_0x31e568,'request\x20sent');logger[_0xa482('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x31e568,'request\x20sent',JSON[_0xa482('0x10')](_0x5daa90));if(_0x5daa90[_0xa482('0x11')]){if(_0x5daa90[_0xa482('0x11')][_0xa482('0x12')]===0x1f4){logger[_0xa482('0x11')](_0xa482('0xe'),_0x31e568,_0x5daa90[_0xa482('0x11')][_0xa482('0x13')]);return _0x27ba54(_0x5daa90[_0xa482('0x11')][_0xa482('0x13')]);}logger['error'](_0xa482('0xe'),_0x31e568,_0x5daa90['error']['message']);return _0x4e6749(_0x5daa90[_0xa482('0x11')][_0xa482('0x13')]);}else{logger[_0xa482('0x14')](_0xa482('0xe'),_0x31e568,_0xa482('0x15'));_0x4e6749(_0x5daa90[_0xa482('0x16')]['message']);}})[_0xa482('0x17')](function(_0x5db1ed){logger['error'](_0xa482('0xe'),_0x31e568,_0x5db1ed);_0x27ba54(_0x5db1ed);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 700ff49..9bee232 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 _0xfa41=['create','addContacts','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x2052a1,_0x1dd53a){var _0xa7b1e7=function(_0x3f4861){while(--_0x3f4861){_0x2052a1['push'](_0x2052a1['shift']());}};_0xa7b1e7(++_0x1dd53a);}(_0xfa41,0xeb));var _0x1fa4=function(_0xa81926,_0x38e368){_0xa81926=_0xa81926-0x0;var _0x8177ef=_0xfa41[_0xa81926];return _0x8177ef;};'use strict';var multer=require(_0x1fa4('0x0'));var util=require('util');var path=require(_0x1fa4('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fa4('0x2'));var router=express[_0x1fa4('0x3')]();var fs_extra=require(_0x1fa4('0x4'));var auth=require(_0x1fa4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa4('0x6'));var controller=require(_0x1fa4('0x7'));router[_0x1fa4('0x8')]('/',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xa')]);router[_0x1fa4('0x8')](_0x1fa4('0xb'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xc')]);router[_0x1fa4('0x8')](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xe')]);router[_0x1fa4('0x8')](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x10')]);router[_0x1fa4('0x11')]('/',auth['isAuthenticated'](),controller[_0x1fa4('0x12')]);router['post'](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x13')]);router[_0x1fa4('0x14')]('/:id',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x15')]);router['delete'](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x3124=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getContacts','post','create','/:id/contacts','addContacts','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x432624,_0x3b0230){var _0x407609=function(_0x3e2dd7){while(--_0x3e2dd7){_0x432624['push'](_0x432624['shift']());}};_0x407609(++_0x3b0230);}(_0x3124,0x149));var _0x4312=function(_0x3b7fc8,_0x55a9ae){_0x3b7fc8=_0x3b7fc8-0x0;var _0x1c362e=_0x3124[_0x3b7fc8];return _0x1c362e;};'use strict';var multer=require(_0x4312('0x0'));var util=require(_0x4312('0x1'));var path=require(_0x4312('0x2'));var timeout=require(_0x4312('0x3'));var express=require('express');var router=express[_0x4312('0x4')]();var fs_extra=require(_0x4312('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4312('0x6'));var config=require(_0x4312('0x7'));var controller=require('./cmCompany.controller');router[_0x4312('0x8')]('/',auth[_0x4312('0x9')](),controller[_0x4312('0xa')]);router[_0x4312('0x8')](_0x4312('0xb'),auth[_0x4312('0x9')](),controller[_0x4312('0xc')]);router[_0x4312('0x8')](_0x4312('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4312('0x8')]('/:id/contacts',auth[_0x4312('0x9')](),controller[_0x4312('0xe')]);router[_0x4312('0xf')]('/',auth[_0x4312('0x9')](),controller[_0x4312('0x10')]);router[_0x4312('0xf')](_0x4312('0x11'),auth[_0x4312('0x9')](),controller[_0x4312('0x12')]);router[_0x4312('0x13')](_0x4312('0xd'),auth[_0x4312('0x9')](),controller[_0x4312('0x14')]);router['delete'](_0x4312('0xd'),auth[_0x4312('0x9')](),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 83fda3c..2b32cc0 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 _0xf894=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x476355,_0x1eed50){var _0x292a65=function(_0x52bec5){while(--_0x52bec5){_0x476355['push'](_0x476355['shift']());}};_0x292a65(++_0x1eed50);}(_0xf894,0x112));var _0x4f89=function(_0x2c65d2,_0x734727){_0x2c65d2=_0x2c65d2-0x0;var _0x1114a1=_0xf894[_0x2c65d2];return _0x1114a1;};'use strict';var _=require(_0x4f89('0x0'));var Sequelize=require(_0x4f89('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4f89('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4f89('0x2')]},'street':{'type':Sequelize[_0x4f89('0x2')]},'postalCode':{'type':Sequelize[_0x4f89('0x2')]},'city':{'type':Sequelize[_0x4f89('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x4f89('0x2')]},'description':{'type':Sequelize[_0x4f89('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x4f89('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4f89('0x2')]},'url':{'type':Sequelize[_0x4f89('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x4f89('0x2')]},'teams':{'type':Sequelize[_0x4f89('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x4f89('0x2')]},'wechat':{'type':Sequelize[_0x4f89('0x2')]},'telegram':{'type':Sequelize[_0x4f89('0x2')]},'UserId':{'type':Sequelize[_0x4f89('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x4f89('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x4f89('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4f89('0x6')],'defaultValue':Sequelize[_0x4f89('0x7')]},'dialTimezone':{'type':Sequelize[_0x4f89('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xfdca=['NOW','INTEGER','lodash','sequelize','exports','STRING','TEXT','UNSIGNED','DATE'];(function(_0xac42f5,_0xf79119){var _0x417f77=function(_0x825d82){while(--_0x825d82){_0xac42f5['push'](_0xac42f5['shift']());}};_0x417f77(++_0xf79119);}(_0xfdca,0xc8));var _0xafdc=function(_0x168462,_0x417f34){_0x168462=_0x168462-0x0;var _0x34c0d0=_0xfdca[_0x168462];return _0x34c0d0;};'use strict';var _=require(_0xafdc('0x0'));var Sequelize=require(_0xafdc('0x1'));module[_0xafdc('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xafdc('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xafdc('0x3')]},'city':{'type':Sequelize[_0xafdc('0x3')]},'country':{'type':Sequelize[_0xafdc('0x3')]},'dateOfBirth':{'type':Sequelize[_0xafdc('0x3')]},'description':{'type':Sequelize[_0xafdc('0x4')]},'phone':{'type':Sequelize[_0xafdc('0x3')]},'mobile':{'type':Sequelize[_0xafdc('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xafdc('0x3')]},'url':{'type':Sequelize[_0xafdc('0x3')]},'facebook':{'type':Sequelize[_0xafdc('0x3')]},'fb_data':{'type':Sequelize[_0xafdc('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xafdc('0x3')]},'teams':{'type':Sequelize[_0xafdc('0x3')]},'viber':{'type':Sequelize[_0xafdc('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xafdc('0x3')]},'telegram':{'type':Sequelize[_0xafdc('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xafdc('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xafdc('0x6')],'defaultValue':Sequelize[_0xafdc('0x7')]},'dialTimezone':{'type':Sequelize[_0xafdc('0x3')]},'utcOffset':{'type':Sequelize[_0xafdc('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index d07d03e..4a26a41 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 _0x5ded=['join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','$or','findOrCreate','spread','show','ItemType','literal','$and','omit','format','pickBy','cf_%d','table','cm_contacts','setFields','toParam','phone','findOne','rawAttributes','filters','options','getTags','setTags','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','ContactId','includeAll','include','getHopperHistories','rows','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','socket_timestamp','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','meta','binding','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','importUpdates','message','error\x20child\x20process','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20createdAt\x20filter','source','callerid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','fullname','alias','createdAt','findAndCountAll','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Account','key','Owner','DESC','chat','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','moment','bluebird','util','path','squel','../../config/logger','api','../../config/environment','../../config/environment/shared','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','sendStatus','error','name','send','index','CmContact','describe','length','keys','startsWith','push','CmCustomField','cf_','all','fieldType','type','model','query','intersection','attributes','fields','nolimit','order','sort','pick','select','field','color','tools_tags','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','having','t.id\x20IN\x20?','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','catch','params','columnName','analytics','findAll','displayName','custom','values','hasOwnProperty','body','get','isArray','tags'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5ded,0x1dc));var _0xd5de=function(_0x5a0af1,_0x50e73b){_0x5a0af1=_0x5a0af1-0x0;var _0x456e76=_0x5ded[_0x5a0af1];return _0x456e76;};'use strict';var moment=require(_0xd5de('0x0'));var BPromise=require(_0xd5de('0x1'));var util=require(_0xd5de('0x2'));var path=require(_0xd5de('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd5de('0x4'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xd5de('0x5'))(_0xd5de('0x6'));var config=require(_0xd5de('0x7'));var shared=require(_0xd5de('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd5de('0x9')](config[_0xd5de('0xa')],{'host':_0xd5de('0xb'),'port':0x18eb});var socket=require(_0xd5de('0xc'))(new Redis(config[_0xd5de('0xa')]));require(_0xd5de('0xd'))['register'](socket);function respondWithResult(_0x44d9cd,_0x327f3c){_0x327f3c=_0x327f3c||0xc8;return function(_0x5d89df){if(_0x5d89df){return _0x44d9cd[_0xd5de('0xe')](_0x327f3c)['json'](_0x5d89df);}};}function respondWithFilteredResult(_0x44ff08,_0x11e7c2){return function(_0x33b420){if(_0x33b420){var _0x17770e=typeof _0x11e7c2[_0xd5de('0xf')]===_0xd5de('0x10')&&typeof _0x11e7c2[_0xd5de('0x11')]==='undefined';var _0x37a7a0=_0x33b420[_0xd5de('0x12')];var _0x18b49f=_0x17770e?0x0:_0x11e7c2[_0xd5de('0xf')];var _0x4cfe7f=_0x17770e?_0x33b420[_0xd5de('0x12')]:_0x11e7c2[_0xd5de('0xf')]+_0x11e7c2[_0xd5de('0x11')];var _0x192535;if(_0x4cfe7f>=_0x37a7a0){_0x4cfe7f=_0x37a7a0;_0x192535=0xc8;}else{_0x192535=0xce;}_0x44ff08['status'](_0x192535);return _0x44ff08[_0xd5de('0x13')](_0xd5de('0x14'),_0x18b49f+'-'+_0x4cfe7f+'/'+_0x37a7a0)[_0xd5de('0x15')](_0x33b420);}return null;};}function saveUpdates(_0x3f6a06){return function(_0x4c9323){if(_0x4c9323){return _0x4c9323[_0xd5de('0x16')](_0x3f6a06)[_0xd5de('0x17')](function(_0x572b74){return _0x572b74;});}return null;};}function removeEntity(_0x54439d){return function(_0x5d6638){if(_0x5d6638){return _0x5d6638[_0xd5de('0x18')]()['then'](function(){_0x54439d[_0xd5de('0xe')](0xcc)[_0xd5de('0x19')]();});}};}function handleEntityNotFound(_0xc09fd9){return function(_0x34f93a){if(!_0x34f93a){_0xc09fd9[_0xd5de('0x1a')](0x194);}return _0x34f93a;};}function handleError(_0x390362,_0x32de58){_0x32de58=_0x32de58||0x1f4;return function(_0x76cc05){logger[_0xd5de('0x1b')](_0x76cc05['stack']);if(_0x76cc05['name']){delete _0x76cc05[_0xd5de('0x1c')];}_0x390362['status'](_0x32de58)[_0xd5de('0x1d')](_0x76cc05);};}exports[_0xd5de('0x1e')]=function(_0x497842,_0xcf51cb){var _0x55d185={},_0x211fa9={},_0xf0b4a9={'count':0x0,'rows':[]};return db[_0xd5de('0x1f')][_0xd5de('0x20')]()[_0xd5de('0x17')](function(_0x4b4a38){var _0x560dd6=[];for(var _0x1a260b=0x0;_0x1a260b
','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','toString','base64'];(function(_0x5cae5f,_0x14b690){var _0x162594=function(_0x168450){while(--_0x168450){_0x5cae5f['push'](_0x5cae5f['shift']());}};_0x162594(++_0x14b690);}(_0x8207,0x8a));var _0x7820=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8207[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7820('0x0'));var moment=require('moment');var random=require(_0x7820('0x1'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x7820('0x2'));var logger=require(_0x7820('0x3'))(_0x7820('0x4'));var config=require('../../../config/environment');function getAddress(_0x2583ec){var _0xb56bb3=_['head'](_0x2583ec[_0x7820('0x5')]);return _0xb56bb3&&_0xb56bb3[_0x7820('0x6')]?_0xb56bb3[_0x7820('0x6')]:_0x7820('0x7')+random['generate'](0x6)+_0x7820('0x8');}function getFirstName(_0x409577){var _0x5b0c7d=_[_0x7820('0x9')](_0x409577[_0x7820('0x5')]);if(_0x5b0c7d&&_0x5b0c7d[_0x7820('0xa')]){if(_0x5b0c7d[_0x7820('0xa')]==_0x5b0c7d['address']){return _0x5b0c7d['name'][_0x7820('0xb')](0x0,_0x5b0c7d[_0x7820('0xa')]['indexOf']('@'));}var _0x199247=_0x5b0c7d[_0x7820('0xa')][_0x7820('0xc')](/\s+/);return _0x199247['length']>0x1?_0x199247[_0x7820('0xd')](0x0,-0x1)[_0x7820('0xe')]('\x20'):_0x5b0c7d[_0x7820('0xa')];}return _0x7820('0xf');}function getLastName(_0x4796c8){var _0x560618=_[_0x7820('0x9')](_0x4796c8[_0x7820('0x5')]);if(_0x560618&&_0x560618[_0x7820('0xa')]){var _0x5674a8=_0x560618['name'][_0x7820('0xc')](/\s+/);return _0x5674a8[_0x7820('0x10')]>0x1?_0x5674a8['pop']():'';}return'';}function getMails(_0x4dd1af,_0x53ea83){var _0xf45926='';for(var _0x34d781=0x0;_0x34d781<_0x53ea83[_0x7820('0x5')]['length'];_0x34d781+=0x1){if(_0x53ea83[_0x7820('0x5')][_0x34d781][_0x7820('0x6')]!==_0x4dd1af){if(!_[_0x7820('0x11')](_0xf45926)){_0xf45926+=',';}_0xf45926+=_0x53ea83[_0x7820('0x5')][_0x34d781]['name']||_0x53ea83[_0x7820('0x5')][_0x34d781][_0x7820('0x6')]||'';_0xf45926+='\x20<';_0xf45926+=_0x53ea83[_0x7820('0x5')][_0x34d781]['address']?_0x53ea83[_0x7820('0x5')][_0x34d781][_0x7820('0x6')]:_0x7820('0x7')+random[_0x7820('0x12')](0x6)+_0x7820('0x8');_0xf45926+='>';}}return _0xf45926;}function parseEmail(_0x22d29b,_0x479764,_0x52f226){if(_0x479764[_0x7820('0x13')]){var _0x5ef38f=/