From b87a575034fe6ab852b6f61630f54ac63937759a Mon Sep 17 00:00:00 2001
From: support
Date: Tue, 28 Mar 2023 08:32:21 +0000
Subject: [PATCH] Built motion from commit d6d69adf.|2.6.33
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
.../chatWebsite/helpers/wildcard-expressions.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailInteractionHasTag/index.js | 2 +-
.../mailInteractionHasTag.controller.js | 2 +-
.../mailInteractionHasTag/mailInteractionHasTag.js | 2 +-
.../mailInteractionHasTag.model.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/contacts/index.js | 2 +-
server/components/contacts/sql-utils.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/accept-message.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/api.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/events.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/project.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/voiceQueueSummary.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/realtime/utils.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/interval.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/misc.js | 2 +-
server/utils/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1210 files changed, 1210 insertions(+), 1210 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 71a49a3..b9e4532 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-27T15:51:14.173Z",
+ "time": "2023-03-28T08:22:22.752Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 9896e72..041f9c9 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-03-27T15:51:14.173Z",
+ "time": "2023-03-28T08:22:22.752Z",
"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 a9e22a9..bd1495d 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 _0x6877=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','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]'];(function(_0x758e7f,_0x128061){var _0x1ad1e6=function(_0x1c1e6d){while(--_0x1c1e6d){_0x758e7f['push'](_0x758e7f['shift']());}};_0x1ad1e6(++_0x128061);}(_0x6877,0xb5));var _0x7687=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x6877[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0x7687('0x0'));module[_0x7687('0x1')]={'name':{'type':Sequelize[_0x7687('0x2')],'get':function(_0x3e8c55){return this[_0x7687('0x3')](_0x7687('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7687('0x5'),_0x7687('0x6'),_0x7687('0x7'),_0x7687('0x8'),_0x7687('0x9'),_0x7687('0xa'),_0x7687('0xb'),_0x7687('0xc')]],'msg':_0x7687('0xd')}},'comment':_0x7687('0xd')},'data1':{'type':Sequelize[_0x7687('0xe')](0x1000),'comment':_0x7687('0xf')},'data2':{'type':Sequelize[_0x7687('0xe')](0x1000),'comment':_0x7687('0x10')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x7687('0x11')},'data5':{'type':Sequelize[_0x7687('0xe')](0x1000),'comments':_0x7687('0x12')},'data6':{'type':Sequelize['STRING'],'comments':_0x7687('0x13')},'data7':{'type':Sequelize[_0x7687('0x14')],'comments':_0x7687('0x15')}};
\ No newline at end of file
+var _0xabdb=['jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','STRING','integration','motionbar'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xabdb,0x93));var _0xbabd=function(_0x5ded12,_0xed47a){_0x5ded12=_0x5ded12-0x0;var _0x1c01b0=_0xabdb[_0x5ded12];return _0x1c01b0;};'use strict';var Sequelize=require('sequelize');module[_0xbabd('0x0')]={'name':{'type':Sequelize[_0xbabd('0x1')],'get':function(_0xb14022){return this[_0xbabd('0x2')]('action');}},'action':{'type':Sequelize[_0xbabd('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbabd('0x4'),_0xbabd('0x5'),_0xbabd('0x6'),'urlForward',_0xbabd('0x7'),'bot',_0xbabd('0x8')]],'msg':_0xbabd('0x9')}},'comment':_0xbabd('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xbabd('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xbabd('0xb')},'data3':{'type':Sequelize[_0xbabd('0x3')](0x1000),'comment':_0xbabd('0xc')},'data4':{'type':Sequelize[_0xbabd('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xbabd('0xd')},'data6':{'type':Sequelize['STRING'],'comments':_0xbabd('0xe')},'data7':{'type':Sequelize[_0xbabd('0xf')],'comments':_0xbabd('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 811263a..a27b8bd 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 _0x9322=['limit','undefined','count','set','Content-Range','reject','then','destroy','end','error','stack','name','send','body','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x1098bf,_0x1adfc5){var _0x1e130a=function(_0x55e577){while(--_0x55e577){_0x1098bf['push'](_0x1098bf['shift']());}};_0x1e130a(++_0x1adfc5);}(_0x9322,0x1c0));var _0x2932=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9322[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x2932('0x0'));var rimraf=require(_0x2932('0x1'));var zipdir=require(_0x2932('0x2'));var jsonpatch=require(_0x2932('0x3'));var rp=require(_0x2932('0x4'));var moment=require(_0x2932('0x5'));var BPromise=require(_0x2932('0x6'));var Mustache=require(_0x2932('0x7'));var util=require('util');var path=require(_0x2932('0x8'));var sox=require(_0x2932('0x9'));var csv=require('to-csv');var ejs=require(_0x2932('0xa'));var fs=require('fs');var fs_extra=require(_0x2932('0xb'));var _=require('lodash');var squel=require(_0x2932('0xc'));var crypto=require('crypto');var jsforce=require(_0x2932('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2932('0xe'));var querystring=require(_0x2932('0xf'));var Papa=require(_0x2932('0x10'));var Redis=require(_0x2932('0x11'));var authService=require(_0x2932('0x12'));var qs=require(_0x2932('0x13'));var as=require(_0x2932('0x14'));var hardwareService=require(_0x2932('0x15'));var logger=require(_0x2932('0x16'))(_0x2932('0x17'));var utils=require(_0x2932('0x18'));var config=require(_0x2932('0x19'));var licenseUtil=require(_0x2932('0x1a'));var db=require(_0x2932('0x1b'))['db'];function respondWithStatusCode(_0x4dda2a,_0x4b233c){_0x4b233c=_0x4b233c||0xcc;return function(_0x407dde){if(_0x407dde){return _0x4dda2a[_0x2932('0x1c')](_0x4b233c);}return _0x4dda2a[_0x2932('0x1d')](_0x4b233c)['end']();};}function respondWithResult(_0x465df5,_0x299b97){_0x299b97=_0x299b97||0xc8;return function(_0x13b5b9){if(_0x13b5b9){return _0x465df5[_0x2932('0x1d')](_0x299b97)[_0x2932('0x1e')](_0x13b5b9);}};}function respondWithFilteredResult(_0xf9cc74,_0xcfc2a1){return function(_0x238a76){if(_0x238a76){var _0x4a1d21=typeof _0xcfc2a1[_0x2932('0x1f')]==='undefined'&&typeof _0xcfc2a1[_0x2932('0x20')]===_0x2932('0x21');var _0x5c89e7=_0x238a76[_0x2932('0x22')];var _0x3f8387=_0x4a1d21?0x0:_0xcfc2a1[_0x2932('0x1f')];var _0x4eb3ee=_0x4a1d21?_0x238a76[_0x2932('0x22')]:_0xcfc2a1['offset']+_0xcfc2a1[_0x2932('0x20')];var _0x2147ee;if(_0x4eb3ee>=_0x5c89e7){_0x4eb3ee=_0x5c89e7;_0x2147ee=0xc8;}else{_0x2147ee=0xce;}_0xf9cc74['status'](_0x2147ee);return _0xf9cc74[_0x2932('0x23')](_0x2932('0x24'),_0x3f8387+'-'+_0x4eb3ee+'/'+_0x5c89e7)[_0x2932('0x1e')](_0x238a76);}return null;};}function patchUpdates(_0x181126){return function(_0x326012){try{jsonpatch['apply'](_0x326012,_0x181126,!![]);}catch(_0x8018a7){return BPromise[_0x2932('0x25')](_0x8018a7);}return _0x326012['save']();};}function saveUpdates(_0x587598,_0x5cf397){return function(_0x3765ea){if(_0x3765ea){return _0x3765ea['update'](_0x587598)[_0x2932('0x26')](function(_0x5df732){return _0x5df732;});}return null;};}function removeEntity(_0x289d68,_0x3deb36){return function(_0x57b872){if(_0x57b872){return _0x57b872[_0x2932('0x27')]()[_0x2932('0x26')](function(){_0x289d68['status'](0xcc)[_0x2932('0x28')]();});}};}function handleEntityNotFound(_0x2e5b52,_0x2d971c){return function(_0x329c7c){if(!_0x329c7c){_0x2e5b52[_0x2932('0x1c')](0x194);}return _0x329c7c;};}function handleError(_0x4e9951,_0x1c4711){_0x1c4711=_0x1c4711||0x1f4;return function(_0x1047b2){logger[_0x2932('0x29')](_0x1047b2[_0x2932('0x2a')]);if(_0x1047b2[_0x2932('0x2b')]){delete _0x1047b2['name'];}_0x4e9951[_0x2932('0x1d')](_0x1c4711)[_0x2932('0x2c')](_0x1047b2);};}exports['update']=function(_0x4efe19,_0x3a1070){if(_0x4efe19[_0x2932('0x2d')]['id']){delete _0x4efe19[_0x2932('0x2d')]['id'];}return db[_0x2932('0x2e')]['find']({'where':{'id':_0x4efe19[_0x2932('0x2f')]['id']}})[_0x2932('0x26')](handleEntityNotFound(_0x3a1070,null))[_0x2932('0x26')](saveUpdates(_0x4efe19[_0x2932('0x2d')],null))[_0x2932('0x26')](respondWithResult(_0x3a1070,null))['catch'](handleError(_0x3a1070,null));};exports[_0x2932('0x27')]=function(_0x4f2767,_0xf50b6f){return db[_0x2932('0x2e')]['find']({'where':{'id':_0x4f2767[_0x2932('0x2f')]['id']}})[_0x2932('0x26')](handleEntityNotFound(_0xf50b6f,null))['then'](removeEntity(_0xf50b6f,null))['catch'](handleError(_0xf50b6f,null));};
\ No newline at end of file
+var _0xfae3=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','body','Action','params','catch','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfae3,0xa1));var _0x3fae=function(_0x416f4e,_0x46a4b1){_0x416f4e=_0x416f4e-0x0;var _0x230028=_0xfae3[_0x416f4e];return _0x230028;};'use strict';var emlformat=require(_0x3fae('0x0'));var rimraf=require(_0x3fae('0x1'));var zipdir=require(_0x3fae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fae('0x3'));var moment=require(_0x3fae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3fae('0x5'));var util=require(_0x3fae('0x6'));var path=require('path');var sox=require(_0x3fae('0x7'));var csv=require(_0x3fae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fae('0x9'));var _=require(_0x3fae('0xa'));var squel=require(_0x3fae('0xb'));var crypto=require(_0x3fae('0xc'));var jsforce=require(_0x3fae('0xd'));var deskjs=require(_0x3fae('0xe'));var toCsv=require(_0x3fae('0x8'));var querystring=require('querystring');var Papa=require(_0x3fae('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3fae('0x10'));var as=require(_0x3fae('0x11'));var hardwareService=require(_0x3fae('0x12'));var logger=require(_0x3fae('0x13'))(_0x3fae('0x14'));var utils=require(_0x3fae('0x15'));var config=require(_0x3fae('0x16'));var licenseUtil=require(_0x3fae('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x588541,_0x17c764){_0x17c764=_0x17c764||0xcc;return function(_0x2bef52){if(_0x2bef52){return _0x588541[_0x3fae('0x18')](_0x17c764);}return _0x588541[_0x3fae('0x19')](_0x17c764)[_0x3fae('0x1a')]();};}function respondWithResult(_0x2da9f0,_0x5e055d){_0x5e055d=_0x5e055d||0xc8;return function(_0x222428){if(_0x222428){return _0x2da9f0[_0x3fae('0x19')](_0x5e055d)[_0x3fae('0x1b')](_0x222428);}};}function respondWithFilteredResult(_0x455260,_0x17f28b){return function(_0x3d6322){if(_0x3d6322){var _0x167b6f=typeof _0x17f28b[_0x3fae('0x1c')]===_0x3fae('0x1d')&&typeof _0x17f28b[_0x3fae('0x1e')]==='undefined';var _0x10021d=_0x3d6322[_0x3fae('0x1f')];var _0x401886=_0x167b6f?0x0:_0x17f28b['offset'];var _0x30c016=_0x167b6f?_0x3d6322[_0x3fae('0x1f')]:_0x17f28b[_0x3fae('0x1c')]+_0x17f28b['limit'];var _0x26663d;if(_0x30c016>=_0x10021d){_0x30c016=_0x10021d;_0x26663d=0xc8;}else{_0x26663d=0xce;}_0x455260['status'](_0x26663d);return _0x455260[_0x3fae('0x20')](_0x3fae('0x21'),_0x401886+'-'+_0x30c016+'/'+_0x10021d)[_0x3fae('0x1b')](_0x3d6322);}return null;};}function patchUpdates(_0x4aeb49){return function(_0x34fb1c){try{jsonpatch[_0x3fae('0x22')](_0x34fb1c,_0x4aeb49,!![]);}catch(_0x308e18){return BPromise[_0x3fae('0x23')](_0x308e18);}return _0x34fb1c['save']();};}function saveUpdates(_0x186db1,_0x3efe3e){return function(_0x14c9eb){if(_0x14c9eb){return _0x14c9eb['update'](_0x186db1)[_0x3fae('0x24')](function(_0x12ce06){return _0x12ce06;});}return null;};}function removeEntity(_0x5bb7c5,_0x4effd3){return function(_0x3b4131){if(_0x3b4131){return _0x3b4131[_0x3fae('0x25')]()['then'](function(){_0x5bb7c5[_0x3fae('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c62e7,_0x41694a){return function(_0x281dd7){if(!_0x281dd7){_0x3c62e7[_0x3fae('0x18')](0x194);}return _0x281dd7;};}function handleError(_0x54dcdd,_0x5511de){_0x5511de=_0x5511de||0x1f4;return function(_0x241950){logger[_0x3fae('0x26')](_0x241950['stack']);if(_0x241950['name']){delete _0x241950[_0x3fae('0x27')];}_0x54dcdd[_0x3fae('0x19')](_0x5511de)['send'](_0x241950);};}exports['update']=function(_0x35b32a,_0x7e19da){if(_0x35b32a[_0x3fae('0x28')]['id']){delete _0x35b32a[_0x3fae('0x28')]['id'];}return db[_0x3fae('0x29')]['find']({'where':{'id':_0x35b32a[_0x3fae('0x2a')]['id']}})[_0x3fae('0x24')](handleEntityNotFound(_0x7e19da,null))['then'](saveUpdates(_0x35b32a[_0x3fae('0x28')],null))[_0x3fae('0x24')](respondWithResult(_0x7e19da,null))[_0x3fae('0x2b')](handleError(_0x7e19da,null));};exports[_0x3fae('0x25')]=function(_0x129c01,_0x44a4eb){return db['Action'][_0x3fae('0x2c')]({'where':{'id':_0x129c01[_0x3fae('0x2a')]['id']}})['then'](handleEntityNotFound(_0x44a4eb,null))[_0x3fae('0x24')](removeEntity(_0x44a4eb,null))[_0x3fae('0x2b')](handleError(_0x44a4eb,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index dad8473..0e346a2 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 _0x6208=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','util'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x6208,0x192));var _0x8620=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x6208[_0x44c768];return _0x55daf5;};'use strict';var _=require('lodash');var util=require(_0x8620('0x0'));var logger=require(_0x8620('0x1'))(_0x8620('0x2'));var moment=require(_0x8620('0x3'));var BPromise=require(_0x8620('0x4'));var rp=require(_0x8620('0x5'));var fs=require('fs');var path=require(_0x8620('0x6'));var rimraf=require(_0x8620('0x7'));var config=require(_0x8620('0x8'));var attributes=require(_0x8620('0x9'));module['exports']=function(_0x1069e7,_0x431cfc){return _0x1069e7[_0x8620('0xa')](_0x8620('0xb'),attributes,{'tableName':_0x8620('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7615=['path','rimraf','./action.attributes','exports','define','Action','lodash','api','bluebird','request-promise'];(function(_0x14d3cc,_0x567831){var _0x1f822b=function(_0x1eeeb9){while(--_0x1eeeb9){_0x14d3cc['push'](_0x14d3cc['shift']());}};_0x1f822b(++_0x567831);}(_0x7615,0xec));var _0x5761=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x7615[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0x5761('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5761('0x1'));var moment=require('moment');var BPromise=require(_0x5761('0x2'));var rp=require(_0x5761('0x3'));var fs=require('fs');var path=require(_0x5761('0x4'));var rimraf=require(_0x5761('0x5'));var config=require('../../config/environment');var attributes=require(_0x5761('0x6'));module[_0x5761('0x7')]=function(_0x17609e,_0x1e81a2){return _0x17609e[_0x5761('0x8')](_0x5761('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index b11187b..950ad33 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x65a7d8,_0x481040){var _0x3207bf=function(_0x199b26){while(--_0x199b26){_0x65a7d8['push'](_0x65a7d8['shift']());}};_0x3207bf(++_0x481040);}(_0xe14b,0x93));var _0xbe14=function(_0x492bf9,_0x3494c9){_0x492bf9=_0x492bf9-0x0;var _0x2df282=_0xe14b[_0x492bf9];return _0x2df282;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x7a54=['info','Action,\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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x4c571f,_0x520dd9){_0x4c571f=_0x4c571f-0x0;var _0x13c69e=_0x7a54[_0x4c571f];return _0x13c69e;};'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')]('Action,\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/action/index.js b/server/api/action/index.js
index b9a6156..e2de447 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 _0xad91=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x4c538c,_0x46c4dc){var _0x236796=function(_0x10c34f){while(--_0x10c34f){_0x4c538c['push'](_0x4c538c['shift']());}};_0x236796(++_0x46c4dc);}(_0xad91,0x91));var _0x1ad9=function(_0x593b33,_0x1ea034){_0x593b33=_0x593b33-0x0;var _0x2f17a2=_0xad91[_0x593b33];return _0x2f17a2;};'use strict';var multer=require('multer');var util=require(_0x1ad9('0x0'));var path=require(_0x1ad9('0x1'));var timeout=require(_0x1ad9('0x2'));var express=require(_0x1ad9('0x3'));var router=express[_0x1ad9('0x4')]();var fs_extra=require(_0x1ad9('0x5'));var auth=require(_0x1ad9('0x6'));var interaction=require(_0x1ad9('0x7'));var config=require(_0x1ad9('0x8'));var controller=require(_0x1ad9('0x9'));router[_0x1ad9('0xa')](_0x1ad9('0xb'),auth[_0x1ad9('0xc')](),controller['update']);router['delete'](_0x1ad9('0xb'),auth[_0x1ad9('0xc')](),controller[_0x1ad9('0xd')]);module[_0x1ad9('0xe')]=router;
\ No newline at end of file
+var _0x3f1a=['/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./action.controller','put'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3f1a,0x104));var _0xa3f1=function(_0x248701,_0x27e401){_0x248701=_0x248701-0x0;var _0x557185=_0x3f1a[_0x248701];return _0x557185;};'use strict';var multer=require(_0xa3f1('0x0'));var util=require(_0xa3f1('0x1'));var path=require(_0xa3f1('0x2'));var timeout=require(_0xa3f1('0x3'));var express=require(_0xa3f1('0x4'));var router=express[_0xa3f1('0x5')]();var fs_extra=require(_0xa3f1('0x6'));var auth=require(_0xa3f1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa3f1('0x8'));router[_0xa3f1('0x9')](_0xa3f1('0xa'),auth[_0xa3f1('0xb')](),controller[_0xa3f1('0xc')]);router[_0xa3f1('0xd')](_0xa3f1('0xa'),auth[_0xa3f1('0xb')](),controller[_0xa3f1('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index c6166d1..762882a 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x340d49,_0x4ee2b4){var _0x2cf1ec=function(_0x12f166){while(--_0x12f166){_0x340d49['push'](_0x340d49['shift']());}};_0x2cf1ec(++_0x4ee2b4);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
+var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x4b9438,_0x1f41c){var _0x128b3a=function(_0x546826){while(--_0x546826){_0x4b9438['push'](_0x4b9438['shift']());}};_0x128b3a(++_0x1f41c);}(_0xeff8,0x186));var _0x8eff=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xeff8[_0x1780f8];return _0x33a410;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 762a761..470a4a1 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 _0xb39f=['where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','select','replace','DESC','web','fullPath','%s-%s.%s','randomstring','output','csv','AnalyticExtractedReport','cdr','endDate','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','clone','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','order','sort'];(function(_0x212f52,_0x8241e8){var _0x3c912f=function(_0x51d5ef){while(--_0x51d5ef){_0x212f52['push'](_0x212f52['shift']());}};_0x3c912f(++_0x8241e8);}(_0xb39f,0x66));var _0xfb39=function(_0xda8baa,_0x52664d){_0xda8baa=_0xda8baa-0x0;var _0x339249=_0xb39f[_0xda8baa];return _0x339249;};'use strict';var emlformat=require(_0xfb39('0x0'));var rimraf=require(_0xfb39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfb39('0x2'));var moment=require(_0xfb39('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfb39('0x4'));var util=require(_0xfb39('0x5'));var path=require(_0xfb39('0x6'));var sox=require(_0xfb39('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb39('0x8'));var squel=require('squel');var crypto=require(_0xfb39('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfb39('0xa'));var toCsv=require(_0xfb39('0xb'));var querystring=require(_0xfb39('0xc'));var Papa=require(_0xfb39('0xd'));var Redis=require(_0xfb39('0xe'));var authService=require(_0xfb39('0xf'));var qs=require(_0xfb39('0x10'));var as=require(_0xfb39('0x11'));var hardwareService=require(_0xfb39('0x12'));var logger=require(_0xfb39('0x13'))(_0xfb39('0x14'));var utils=require(_0xfb39('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfb39('0x16'));var db=require(_0xfb39('0x17'))['db'];var dbH=require(_0xfb39('0x17'))[_0xfb39('0x18')];function respondWithStatusCode(_0x16b436,_0x588e7e){_0x588e7e=_0x588e7e||0xcc;return function(_0x14dfdd){if(_0x14dfdd){return _0x16b436['sendStatus'](_0x588e7e);}return _0x16b436[_0xfb39('0x19')](_0x588e7e)[_0xfb39('0x1a')]();};}function respondWithResult(_0x18d7ce,_0x464b35){_0x464b35=_0x464b35||0xc8;return function(_0x29c4fb){if(_0x29c4fb){return _0x18d7ce['status'](_0x464b35)[_0xfb39('0x1b')](_0x29c4fb);}};}function respondWithFilteredResult(_0x58fece,_0xfcc91f){return function(_0x2b08bb){if(_0x2b08bb){var _0x133edf=typeof _0xfcc91f[_0xfb39('0x1c')]===_0xfb39('0x1d')&&typeof _0xfcc91f[_0xfb39('0x1e')]===_0xfb39('0x1d');var _0x57edbc=_0x2b08bb[_0xfb39('0x1f')];var _0x8c28b=_0x133edf?0x0:_0xfcc91f[_0xfb39('0x1c')];var _0x12465b=_0x133edf?_0x2b08bb[_0xfb39('0x1f')]:_0xfcc91f['offset']+_0xfcc91f['limit'];var _0xfc03ea;if(_0x12465b>=_0x57edbc){_0x12465b=_0x57edbc;_0xfc03ea=0xc8;}else{_0xfc03ea=0xce;}_0x58fece[_0xfb39('0x19')](_0xfc03ea);return _0x58fece[_0xfb39('0x20')](_0xfb39('0x21'),_0x8c28b+'-'+_0x12465b+'/'+_0x57edbc)['json'](_0x2b08bb);}return null;};}function patchUpdates(_0x7e837e){return function(_0x99239b){try{jsonpatch[_0xfb39('0x22')](_0x99239b,_0x7e837e,!![]);}catch(_0x1bac02){return BPromise['reject'](_0x1bac02);}return _0x99239b['save']();};}function saveUpdates(_0x3d59a2,_0x4451f5){return function(_0x29f1ea){if(_0x29f1ea){return _0x29f1ea[_0xfb39('0x23')](_0x3d59a2)[_0xfb39('0x24')](function(_0x2a276e){return _0x2a276e;});}return null;};}function removeEntity(_0x1e1d7f,_0x235449){return function(_0x6551af){if(_0x6551af){return _0x6551af[_0xfb39('0x25')]()[_0xfb39('0x24')](function(){var _0x44e515=_0x6551af[_0xfb39('0x26')]({'plain':!![]});var _0x8bce2d='CustomReports';return db[_0xfb39('0x27')][_0xfb39('0x25')]({'where':{'type':_0x8bce2d,'resourceId':_0x44e515['id']}})[_0xfb39('0x24')](function(){return _0x6551af;});})[_0xfb39('0x24')](function(){_0x1e1d7f[_0xfb39('0x19')](0xcc)[_0xfb39('0x1a')]();});}};}function handleEntityNotFound(_0x460e00,_0x2f6879){return function(_0x549911){if(!_0x549911){_0x460e00[_0xfb39('0x28')](0x194);}return _0x549911;};}function handleError(_0x1b95d3,_0x42d220){_0x42d220=_0x42d220||0x1f4;return function(_0x520ebf){logger[_0xfb39('0x29')](_0x520ebf[_0xfb39('0x2a')]);if(_0x520ebf[_0xfb39('0x2b')]){delete _0x520ebf[_0xfb39('0x2b')];}_0x1b95d3['status'](_0x42d220)[_0xfb39('0x2c')](_0x520ebf);};}exports[_0xfb39('0x2d')]=function(_0x3804a6,_0x1eb1b3){var _0x1fd532={},_0x51a9f4={},_0x811993={'count':0x0,'rows':[]};var _0x1fd560=_[_0xfb39('0x2e')](db[_0xfb39('0x2f')]['rawAttributes'],function(_0x4c2ab5){return{'name':_0x4c2ab5[_0xfb39('0x30')],'type':_0x4c2ab5[_0xfb39('0x31')][_0xfb39('0x32')]};});_0x51a9f4[_0xfb39('0x33')]=_[_0xfb39('0x2e')](_0x1fd560,_0xfb39('0x2b'));_0x51a9f4['query']=_[_0xfb39('0x34')](_0x3804a6[_0xfb39('0x35')]);_0x51a9f4[_0xfb39('0x36')]=_[_0xfb39('0x37')](_0x51a9f4['model'],_0x51a9f4[_0xfb39('0x35')]);_0x1fd532[_0xfb39('0x38')]=_[_0xfb39('0x37')](_0x51a9f4[_0xfb39('0x33')],qs[_0xfb39('0x39')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x39')]));_0x1fd532[_0xfb39('0x38')]=_0x1fd532[_0xfb39('0x38')]['length']?_0x1fd532[_0xfb39('0x38')]:_0x51a9f4[_0xfb39('0x33')];if(!_0x3804a6['query']['hasOwnProperty']('nolimit')){_0x1fd532[_0xfb39('0x1e')]=qs[_0xfb39('0x1e')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x1e')]);_0x1fd532[_0xfb39('0x1c')]=qs[_0xfb39('0x1c')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x1c')]);}_0x1fd532[_0xfb39('0x3a')]=qs[_0xfb39('0x3b')](_0x3804a6[_0xfb39('0x35')][_0xfb39('0x3b')]);_0x1fd532[_0xfb39('0x3c')]=qs[_0xfb39('0x36')](_[_0xfb39('0x3d')](_0x3804a6['query'],_0x51a9f4['filters']),_0x1fd560);if(_0x3804a6[_0xfb39('0x35')][_0xfb39('0x3e')]){_0x1fd532[_0xfb39('0x3c')]=_['merge'](_0x1fd532[_0xfb39('0x3c')],{'$or':_[_0xfb39('0x2e')](_0x1fd560,function(_0x5bebf0){if(_0x5bebf0[_0xfb39('0x31')]!==_0xfb39('0x3f')){var _0x449525={};_0x449525[_0x5bebf0[_0xfb39('0x2b')]]={'$like':'%'+_0x3804a6['query'][_0xfb39('0x3e')]+'%'};return _0x449525;}})});}_0x1fd532=_[_0xfb39('0x40')]({},_0x1fd532,_0x3804a6[_0xfb39('0x41')]);var _0x5abc5a={'where':_0x1fd532[_0xfb39('0x3c')]};return db[_0xfb39('0x2f')][_0xfb39('0x1f')](_0x5abc5a)[_0xfb39('0x24')](function(_0x428bfc){_0x811993['count']=_0x428bfc;if(_0x3804a6[_0xfb39('0x35')]['includeAll']){_0x1fd532[_0xfb39('0x42')]=[{'all':!![]}];}return db[_0xfb39('0x2f')][_0xfb39('0x43')](_0x1fd532);})['then'](function(_0x369964){_0x811993[_0xfb39('0x44')]=_0x369964;return _0x811993;})[_0xfb39('0x24')](respondWithFilteredResult(_0x1eb1b3,_0x1fd532))['catch'](handleError(_0x1eb1b3,null));};exports[_0xfb39('0x45')]=function(_0x48d612,_0x1a1271){var _0x5f56ea={'raw':![],'where':{'id':_0x48d612[_0xfb39('0x46')]['id']}},_0x54125e={};_0x54125e['model']=_[_0xfb39('0x34')](db[_0xfb39('0x2f')][_0xfb39('0x47')]);_0x54125e[_0xfb39('0x35')]=_[_0xfb39('0x34')](_0x48d612[_0xfb39('0x35')]);_0x54125e[_0xfb39('0x36')]=_[_0xfb39('0x37')](_0x54125e['model'],_0x54125e['query']);_0x5f56ea[_0xfb39('0x38')]=_[_0xfb39('0x37')](_0x54125e[_0xfb39('0x33')],qs[_0xfb39('0x39')](_0x48d612[_0xfb39('0x35')][_0xfb39('0x39')]));_0x5f56ea[_0xfb39('0x38')]=_0x5f56ea[_0xfb39('0x38')][_0xfb39('0x48')]?_0x5f56ea[_0xfb39('0x38')]:_0x54125e[_0xfb39('0x33')];if(_0x48d612[_0xfb39('0x35')][_0xfb39('0x49')]){_0x5f56ea[_0xfb39('0x42')]=[{'all':!![]}];}_0x5f56ea=_[_0xfb39('0x40')]({},_0x5f56ea,_0x48d612[_0xfb39('0x41')]);return db[_0xfb39('0x2f')][_0xfb39('0x4a')](_0x5f56ea)['then'](handleEntityNotFound(_0x1a1271,null))['then'](respondWithResult(_0x1a1271,null))['catch'](handleError(_0x1a1271,null));};exports[_0xfb39('0x4b')]=function(_0x91671f,_0x32e869){return db[_0xfb39('0x2f')][_0xfb39('0x4b')](_0x91671f[_0xfb39('0x4c')],{})[_0xfb39('0x24')](function(_0x11ca18){var _0x373c3e=_0x91671f[_0xfb39('0x4d')]['get']({'plain':!![]});if(!_0x373c3e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x373c3e['role']===_0xfb39('0x4d')){var _0x17cf88=_0x11ca18[_0xfb39('0x26')]({'plain':!![]});var _0xd6d6e7=_0xfb39('0x4e');return db[_0xfb39('0x4f')][_0xfb39('0x4a')]({'where':{'name':_0xd6d6e7,'userProfileId':_0x373c3e[_0xfb39('0x50')]},'raw':!![]})[_0xfb39('0x24')](function(_0xab2cf2){if(_0xab2cf2&&_0xab2cf2[_0xfb39('0x51')]===0x0){return db[_0xfb39('0x27')][_0xfb39('0x4b')]({'name':_0x17cf88[_0xfb39('0x2b')],'resourceId':_0x17cf88['id'],'type':'CustomReports','sectionId':_0xab2cf2['id']},{})[_0xfb39('0x24')](function(){return _0x11ca18;});}else{return _0x11ca18;}})[_0xfb39('0x52')](function(_0x37fb70){logger[_0xfb39('0x29')](_0xfb39('0x53'),_0x37fb70);throw _0x37fb70;});}return _0x11ca18;})[_0xfb39('0x24')](respondWithResult(_0x32e869,0xc9))['catch'](handleError(_0x32e869,null));};exports[_0xfb39('0x23')]=function(_0x1bd26f,_0x308f6e){if(_0x1bd26f[_0xfb39('0x4c')]['id']){delete _0x1bd26f[_0xfb39('0x4c')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x1bd26f[_0xfb39('0x46')]['id']}})[_0xfb39('0x24')](handleEntityNotFound(_0x308f6e,null))[_0xfb39('0x24')](saveUpdates(_0x1bd26f['body'],null))['then'](respondWithResult(_0x308f6e,null))[_0xfb39('0x52')](handleError(_0x308f6e,null));};exports['destroy']=function(_0x31bb04,_0x1f0123){return db['AnalyticCustomReport'][_0xfb39('0x4a')]({'where':{'id':_0x31bb04['params']['id']}})['then'](handleEntityNotFound(_0x1f0123,null))[_0xfb39('0x24')](removeEntity(_0x1f0123,null))[_0xfb39('0x52')](handleError(_0x1f0123,null));};exports['preview']=function(_0x54292e,_0x307517){var _0x34ef1a=0xa;var _0xfc6653=[_0xfb39('0x54'),_0xfb39('0x55'),_0xfb39('0x56'),_0xfb39('0x57')];var _0x2dfb1c={'SUM':_0xfb39('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfb39('0x59'),'MAX':_0xfb39('0x5a'),'MIN':_0xfb39('0x5b'),'AVG':_0xfb39('0x5c'),'GROUP_CONCAT':_0xfb39('0x5d'),'GROUP_CONCAT ASC':_0xfb39('0x5e'),'GROUP_CONCAT DESC':_0xfb39('0x5f')};var _0x2c57cd={'SEC_TO_TIME':_0xfb39('0x60'),'DATE':_0xfb39('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xfb39('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3ba86a=function(_0x48fcad){return!_[_0xfb39('0x63')](['IS\x20NULL',_0xfb39('0x64'),_0xfb39('0x65'),_0xfb39('0x66')],_0x48fcad);};var _0xb97dbd=function(_0x5b12ae){if(!_0x5b12ae||!_0x5b12ae[_0xfb39('0x67')][_0xfb39('0x48')]){return'';}for(var _0x4297a7='(',_0x28eadd=0x0;_0x28eadd<_0x5b12ae[_0xfb39('0x67')]['length'];_0x28eadd+=0x1){_0x28eadd>0x0&&(_0x4297a7+='\x20'+_0x5b12ae[_0xfb39('0x68')]+'\x20');_0x4297a7+=_0x5b12ae['rules'][_0x28eadd][_0xfb39('0x69')]?_0xb97dbd(_0x5b12ae[_0xfb39('0x67')][_0x28eadd][_0xfb39('0x69')]):_0x5b12ae[_0xfb39('0x67')][_0x28eadd][_0xfb39('0x6a')]+'\x20'+_0x5b12ae[_0xfb39('0x67')][_0x28eadd]['condition']+(_0x3ba86a(_0x5b12ae['rules'][_0x28eadd][_0xfb39('0x6b')])?'\x20'+_0x5b12ae[_0xfb39('0x67')][_0x28eadd][_0xfb39('0x6c')]:'');}return _0x4297a7+')';};var _0xf1f612={'where':{'id':_0x54292e[_0xfb39('0x46')]['id']}},_0x529851,_0x534b80,_0x4ff81e,_0x3d4539,_0x6fec66;_0xf1f612=_['merge']({},_0xf1f612,_0x54292e[_0xfb39('0x41')]);return db[_0xfb39('0x2f')]['find'](_0xf1f612)[_0xfb39('0x24')](function(_0x400c54){if(_0x400c54){_0x529851=_0x400c54;return _0x400c54[_0xfb39('0x6d')]();}return null;})[_0xfb39('0x24')](function(_0x226193){if(_0x226193){if(!_0x226193['length']){throw new db['Sequelize'][(_0xfb39('0x6e'))](_0xfb39('0x6f'),0x193);}_0x534b80=_0x226193;return db[_0xfb39('0x70')][_0xfb39('0x43')]({'raw':!![]});}return null;})['then'](function(_0x5eee12){if(_0x5eee12){_0x4ff81e=_[_0xfb39('0x71')](_0x5eee12,'id');var _0x1c2296;var _0x584065=squel['select']();_0x584065[_0xfb39('0x72')](_0x529851[_0xfb39('0x73')]);for(var _0x56a9f8=0x0;_0x56a9f8<_0x534b80[_0xfb39('0x48')];_0x56a9f8+=0x1){_0x1c2296=_0x534b80[_0x56a9f8][_0xfb39('0x74')]?_0x4ff81e[_0x534b80[_0x56a9f8][_0xfb39('0x74')]][_0xfb39('0x75')]:_0x534b80[_0x56a9f8][_0xfb39('0x6a')];_0x1c2296=_0x534b80[_0x56a9f8][_0xfb39('0x76')]?_['replace'](_0x2dfb1c[_0x534b80[_0x56a9f8]['function']],'%s',_0x1c2296):_0x1c2296;_0x1c2296=_0x534b80[_0x56a9f8]['format']?_['replace'](_0x2c57cd[_0x534b80[_0x56a9f8][_0xfb39('0x77')]],'%s',_0x1c2296):_0x1c2296;if(_0x534b80[_0x56a9f8][_0xfb39('0x78')]){_0x584065['group'](_0x1c2296);}_0x534b80[_0x56a9f8][_0xfb39('0x79')]&&_0x584065['order'](_0x1c2296,_0x534b80[_0x56a9f8][_0xfb39('0x79')]==='DESC'?![]:!![]);_0x584065[_0xfb39('0x6a')](_0x1c2296,_0x534b80[_0x56a9f8][_0xfb39('0x7a')]||_0x1c2296);}if(_0x529851[_0xfb39('0x7b')]){_0x529851[_0xfb39('0x7b')]=JSON[_0xfb39('0x7c')](_0x529851[_0xfb39('0x7b')]);for(var _0x55f2dc=0x0;_0x55f2dc<_0x529851[_0xfb39('0x7b')][_0xfb39('0x48')];_0x55f2dc+=0x1){if(_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x31')]&&_[_0xfb39('0x63')](_0xfc6653,_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x31')])&&_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7d')]&&_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7e')]&&_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7f')]){_0x584065[_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x31')]](_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7e')],null,util[_0xfb39('0x77')]('%s.%s\x20=\x20%s.%s',_0x529851['table'],_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7d')],_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7e')],_0x529851[_0xfb39('0x7b')][_0x55f2dc][_0xfb39('0x7f')]));}}}if(_0x529851[_0xfb39('0x80')]){_0x529851[_0xfb39('0x80')]=JSON['parse'](_0x529851[_0xfb39('0x80')]);_0x584065[_0xfb39('0x3c')](_0xb97dbd(_0x529851[_0xfb39('0x80')][_0xfb39('0x69')]));}_0x6fec66=_0x584065['clone']();_0x584065[_0xfb39('0x1e')](_0x34ef1a);_0x584065[_0xfb39('0x1c')](0x0);logger[_0xfb39('0x81')](_0xfb39('0x82'),_0x584065[_0xfb39('0x83')]());return dbH[_0xfb39('0x84')][_0xfb39('0x35')](_0x584065[_0xfb39('0x83')](),{'type':dbH[_0xfb39('0x84')][_0xfb39('0x85')][_0xfb39('0x86')]});}})[_0xfb39('0x24')](respondWithResult(_0x307517,null))[_0xfb39('0x52')](handleError(_0x307517,null));};function runReport(_0x221165,_0x315f88,_0x1750ad){var _0x359995=_0x315f88[_0xfb39('0x2b')];var _0x3c08ea=0xa;var _0x1e0837=[_0xfb39('0x54'),_0xfb39('0x55'),_0xfb39('0x56'),_0xfb39('0x57')];var _0x3753c6={'SUM':_0xfb39('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfb39('0x5a'),'MIN':'MIN(%s)','AVG':_0xfb39('0x5c'),'GROUP_CONCAT':_0xfb39('0x5d'),'GROUP_CONCAT ASC':_0xfb39('0x5e'),'GROUP_CONCAT DESC':_0xfb39('0x5f')};var _0x3b0251={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfb39('0x61'),'HOUR':_0xfb39('0x87'),'ROUND':_0xfb39('0x62'),'UNIX_TIMESTAMP':_0xfb39('0x88')};var _0x2b9c0d=function(_0x339177){return!_[_0xfb39('0x63')]([_0xfb39('0x89'),'IS\x20NOT\x20NULL',_0xfb39('0x65'),_0xfb39('0x66')],_0x339177);};var _0xf26627=function(_0x590718){if(!_0x590718||!_0x590718['rules'][_0xfb39('0x48')]){return'';}for(var _0x1d6cf7='(',_0x31006d=0x0;_0x31006d<_0x590718['rules'][_0xfb39('0x48')];_0x31006d+=0x1){_0x31006d>0x0&&(_0x1d6cf7+='\x20'+_0x590718[_0xfb39('0x68')]+'\x20');_0x1d6cf7+=_0x590718[_0xfb39('0x67')][_0x31006d]['group']?_0xf26627(_0x590718[_0xfb39('0x67')][_0x31006d][_0xfb39('0x69')]):_0x590718[_0xfb39('0x67')][_0x31006d][_0xfb39('0x6a')]+'\x20'+_0x590718[_0xfb39('0x67')][_0x31006d]['condition']+(_0x2b9c0d(_0x590718[_0xfb39('0x67')][_0x31006d][_0xfb39('0x6b')])?'\x20'+_0x590718['rules'][_0x31006d]['value']:'');}return _0x1d6cf7+')';};var _0x11f252={'where':{'id':_0x221165['id']}},_0x2e01c7,_0x2198f4,_0x57e81d,_0x451418,_0xce83ac;_0x11f252=_[_0xfb39('0x40')]({},_0x11f252,_0x1750ad);return db[_0xfb39('0x2f')][_0xfb39('0x4a')](_0x11f252)['then'](function(_0x26f1da){if(_0x26f1da){_0x2e01c7=_0x26f1da;return _0x26f1da[_0xfb39('0x6d')]();}return null;})[_0xfb39('0x24')](function(_0x345bc5){if(_0x345bc5){if(!_0x345bc5[_0xfb39('0x48')]){throw new db['Sequelize'][(_0xfb39('0x6e'))](_0xfb39('0x6f'),0x193);}_0x2198f4=_0x345bc5;return db[_0xfb39('0x70')][_0xfb39('0x43')]({'raw':!![]});}return null;})[_0xfb39('0x24')](function(_0x3e2d5e){if(_0x3e2d5e){_0x57e81d=_['keyBy'](_0x3e2d5e,'id');var _0x19ce10;var _0x337cac=squel[_0xfb39('0x8a')]();_0x337cac[_0xfb39('0x72')](_0x2e01c7[_0xfb39('0x73')]);for(var _0x53a218=0x0;_0x53a218<_0x2198f4[_0xfb39('0x48')];_0x53a218+=0x1){_0x19ce10=_0x2198f4[_0x53a218][_0xfb39('0x74')]?_0x57e81d[_0x2198f4[_0x53a218]['MetricId']][_0xfb39('0x75')]:_0x2198f4[_0x53a218][_0xfb39('0x6a')];_0x19ce10=_0x2198f4[_0x53a218][_0xfb39('0x76')]?_[_0xfb39('0x8b')](_0x3753c6[_0x2198f4[_0x53a218]['function']],'%s',_0x19ce10):_0x19ce10;_0x19ce10=_0x2198f4[_0x53a218][_0xfb39('0x77')]?_[_0xfb39('0x8b')](_0x3b0251[_0x2198f4[_0x53a218][_0xfb39('0x77')]],'%s',_0x19ce10):_0x19ce10;if(_0x2198f4[_0x53a218][_0xfb39('0x78')]){_0x337cac[_0xfb39('0x69')](_0x19ce10);}_0x2198f4[_0x53a218][_0xfb39('0x79')]&&_0x337cac['order'](_0x19ce10,_0x2198f4[_0x53a218][_0xfb39('0x79')]===_0xfb39('0x8c')?![]:!![]);_0x337cac[_0xfb39('0x6a')](_0x19ce10,_0x2198f4[_0x53a218]['alias']||_0x19ce10);}if(_0x2e01c7[_0xfb39('0x7b')]){_0x2e01c7[_0xfb39('0x7b')]=JSON[_0xfb39('0x7c')](_0x2e01c7[_0xfb39('0x7b')]);for(var _0xa4dbd2=0x0;_0xa4dbd2<_0x2e01c7[_0xfb39('0x7b')][_0xfb39('0x48')];_0xa4dbd2+=0x1){if(_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x31')]&&_[_0xfb39('0x63')](_0x1e0837,_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x31')])&&_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7d')]&&_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7e')]&&_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x7f')]){_0x337cac[_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x31')]](_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7e')],null,util[_0xfb39('0x77')]('%s.%s\x20=\x20%s.%s',_0x2e01c7['table'],_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7d')],_0x2e01c7['joins'][_0xa4dbd2][_0xfb39('0x7e')],_0x2e01c7[_0xfb39('0x7b')][_0xa4dbd2][_0xfb39('0x7f')]));}}}if(_0x2e01c7['conditions']){_0x2e01c7[_0xfb39('0x80')]=JSON[_0xfb39('0x7c')](_0x2e01c7[_0xfb39('0x80')]);_0x337cac['where'](_0xf26627(_0x2e01c7['conditions'][_0xfb39('0x69')]));}_0xce83ac=_0x337cac['clone']();_0x337cac[_0xfb39('0x1e')](_0x3c08ea);_0x337cac['offset'](0x0);return;}})['then'](function(){if(_0x315f88['output']===_0xfb39('0x8d')){return null;}var _0x533c82=_['merge'](_0x315f88,{'name':_0x315f88[_0xfb39('0x8e')]||_0x315f88['name']||_0x2e01c7[_0xfb39('0x2b')],'basename':_0x359995,'savename':util[_0xfb39('0x77')](_0xfb39('0x8f'),_0x315f88[_0xfb39('0x2b')]||_0x2e01c7[_0xfb39('0x2b')],require(_0xfb39('0x90'))['generate'](0x4),_0x315f88[_0xfb39('0x91')]||_0xfb39('0x92')),'reportId':_0x2e01c7['id'],'reportType':'custom'});return db[_0xfb39('0x93')][_0xfb39('0x4b')](_0x533c82,{'raw':!![]});})[_0xfb39('0x24')](function(_0x12e8d1){if(_0x2e01c7[_0xfb39('0x73')]===_0xfb39('0x94')){_0xce83ac[_0xfb39('0x3c')](_0x2e01c7['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x315f88['startDate'],_0x315f88[_0xfb39('0x95')]);}else{_0xce83ac['where'](_0x2e01c7[_0xfb39('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x315f88[_0xfb39('0x96')],_0x315f88['endDate']);}if(_0x12e8d1){logger[_0xfb39('0x97')](_0xfb39('0x98'),_0xce83ac[_0xfb39('0x83')]());require(_0xfb39('0x99'))['fork'](path[_0xfb39('0x54')](__dirname,_0xfb39('0x9a'),_0x12e8d1[_0xfb39('0x91')]),[_0x12e8d1['id'],_0xce83ac[_0xfb39('0x83')](),path[_0xfb39('0x54')](__dirname,_0xfb39('0x9b'),_0x12e8d1[_0xfb39('0x9c')]),_0x359995]);return _0x12e8d1;}else{var _0x5403e6=squel[_0xfb39('0x8a')]();_0x5403e6[_0xfb39('0x72')]('('+_0xce83ac[_0xfb39('0x83')]()+')',_0xfb39('0x9d'));_0x5403e6[_0xfb39('0x6a')](_0xfb39('0x9e'),_0xfb39('0x1f'));_0xce83ac[_0xfb39('0x1e')](_0x315f88[_0xfb39('0x1e')]||_0x3c08ea);_0xce83ac[_0xfb39('0x1c')](_0x315f88[_0xfb39('0x1c')]||0x0);return dbH['sequelize'][_0xfb39('0x35')](_0x5403e6['toString'](),{'type':dbH[_0xfb39('0x84')][_0xfb39('0x85')][_0xfb39('0x86')]})[_0xfb39('0x24')](function(_0x41972c){if(!_0x41972c[_0xfb39('0x48')]){_0x451418=0x0;}else{_0x451418=_0x41972c[0x0]['count']||0x0;}return dbH[_0xfb39('0x84')]['query'](_0xce83ac[_0xfb39('0x83')](),{'type':dbH[_0xfb39('0x84')]['QueryTypes'][_0xfb39('0x86')]});})[_0xfb39('0x24')](function(_0x283d9d){return{'rows':_0x283d9d||[],'count':_0x451418};});}});}exports[_0xfb39('0x9f')]=function(_0x920abf,_0x15c5f0){return runReport(_0x920abf[_0xfb39('0x46')],_0x920abf[_0xfb39('0x35')],_0x920abf['options'])[_0xfb39('0x24')](respondWithResult(_0x15c5f0,null))[_0xfb39('0x52')](handleError(_0x15c5f0,null));};exports[_0xfb39('0xa0')]=runReport;exports['query']=function(_0xbab3d1,_0x5b8750){var _0x2b7e42=0xa;var _0x18f47a=[_0xfb39('0x54'),_0xfb39('0x55'),_0xfb39('0x56'),'cross_join'];var _0x3c8928={'SUM':_0xfb39('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfb39('0x5a'),'MIN':_0xfb39('0x5b'),'AVG':_0xfb39('0x5c'),'GROUP_CONCAT':_0xfb39('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1d2280={'SEC_TO_TIME':_0xfb39('0x60'),'DATE':'DATE(%s)','HOUR':_0xfb39('0x87'),'ROUND':_0xfb39('0x62'),'UNIX_TIMESTAMP':_0xfb39('0x88')};var _0x3c825c=function(_0x15375d){return!_[_0xfb39('0x63')]([_0xfb39('0x89'),_0xfb39('0x64'),_0xfb39('0x65'),_0xfb39('0x66')],_0x15375d);};var _0x2830e6=function(_0x386641){if(!_0x386641||!_0x386641[_0xfb39('0x67')]['length']){return'';}for(var _0x78c6e1='(',_0x241528=0x0;_0x241528<_0x386641[_0xfb39('0x67')][_0xfb39('0x48')];_0x241528+=0x1){_0x241528>0x0&&(_0x78c6e1+='\x20'+_0x386641[_0xfb39('0x68')]+'\x20');_0x78c6e1+=_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x69')]?_0x2830e6(_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x69')]):_0x386641[_0xfb39('0x67')][_0x241528]['field']+'\x20'+_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x6b')]+(_0x3c825c(_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x6b')])?'\x20'+_0x386641[_0xfb39('0x67')][_0x241528][_0xfb39('0x6c')]:'');}return _0x78c6e1+')';};var _0x2dc8ab={'where':{'id':_0xbab3d1[_0xfb39('0x46')]['id']}},_0x33f556,_0x2f11ef,_0x2a78fd,_0x339bfc,_0x5e8e6b;_0x2dc8ab=_[_0xfb39('0x40')]({},_0x2dc8ab,_0xbab3d1[_0xfb39('0x41')]);return db['AnalyticCustomReport'][_0xfb39('0x4a')](_0x2dc8ab)[_0xfb39('0x24')](function(_0x8bc759){if(_0x8bc759){_0x33f556=_0x8bc759;return _0x8bc759[_0xfb39('0x6d')]();}return null;})['then'](function(_0x342298){if(_0x342298){if(!_0x342298['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xfb39('0x6f'),0x193);}_0x2f11ef=_0x342298;return db[_0xfb39('0x70')][_0xfb39('0x43')]({'raw':!![]});}return null;})[_0xfb39('0x24')](function(_0x474f9b){if(_0x474f9b){_0x2a78fd=_['keyBy'](_0x474f9b,'id');var _0x188a0f;var _0x3efef9=squel['select']();_0x3efef9['from'](_0x33f556[_0xfb39('0x73')]);for(var _0x5e4b33=0x0;_0x5e4b33<_0x2f11ef[_0xfb39('0x48')];_0x5e4b33+=0x1){_0x188a0f=_0x2f11ef[_0x5e4b33][_0xfb39('0x74')]?_0x2a78fd[_0x2f11ef[_0x5e4b33][_0xfb39('0x74')]][_0xfb39('0x75')]:_0x2f11ef[_0x5e4b33][_0xfb39('0x6a')];_0x188a0f=_0x2f11ef[_0x5e4b33][_0xfb39('0x76')]?_[_0xfb39('0x8b')](_0x3c8928[_0x2f11ef[_0x5e4b33][_0xfb39('0x76')]],'%s',_0x188a0f):_0x188a0f;_0x188a0f=_0x2f11ef[_0x5e4b33][_0xfb39('0x77')]?_[_0xfb39('0x8b')](_0x1d2280[_0x2f11ef[_0x5e4b33]['format']],'%s',_0x188a0f):_0x188a0f;if(_0x2f11ef[_0x5e4b33][_0xfb39('0x78')]){_0x3efef9['group'](_0x188a0f);}_0x2f11ef[_0x5e4b33][_0xfb39('0x79')]&&_0x3efef9['order'](_0x188a0f,_0x2f11ef[_0x5e4b33][_0xfb39('0x79')]===_0xfb39('0x8c')?![]:!![]);_0x3efef9[_0xfb39('0x6a')](_0x188a0f,_0x2f11ef[_0x5e4b33][_0xfb39('0x7a')]||_0x188a0f);}if(_0x33f556[_0xfb39('0x7b')]){_0x33f556['joins']=JSON[_0xfb39('0x7c')](_0x33f556[_0xfb39('0x7b')]);for(var _0x51eee5=0x0;_0x51eee5<_0x33f556[_0xfb39('0x7b')][_0xfb39('0x48')];_0x51eee5+=0x1){if(_0x33f556[_0xfb39('0x7b')][_0x51eee5]['type']&&_[_0xfb39('0x63')](_0x18f47a,_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x31')])&&_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7d')]&&_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7e')]&&_0x33f556['joins'][_0x51eee5]['foreignKey']){_0x3efef9[_0x33f556['joins'][_0x51eee5][_0xfb39('0x31')]](_0x33f556[_0xfb39('0x7b')][_0x51eee5]['foreignTable'],null,util[_0xfb39('0x77')]('%s.%s\x20=\x20%s.%s',_0x33f556[_0xfb39('0x73')],_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7d')],_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7e')],_0x33f556[_0xfb39('0x7b')][_0x51eee5][_0xfb39('0x7f')]));}}}if(_0x33f556['conditions']){_0x33f556['conditions']=JSON[_0xfb39('0x7c')](_0x33f556[_0xfb39('0x80')]);_0x3efef9[_0xfb39('0x3c')](_0x2830e6(_0x33f556[_0xfb39('0x80')]['group']));}_0x5e8e6b=_0x3efef9[_0xfb39('0xa1')]();_0x3efef9[_0xfb39('0x1e')](_0x2b7e42);_0x3efef9[_0xfb39('0x1c')](0x0);logger[_0xfb39('0x81')](_0xfb39('0x82'),_0x3efef9[_0xfb39('0x83')]());return dbH[_0xfb39('0x84')]['query'](_0x3efef9[_0xfb39('0x83')](),{'type':dbH[_0xfb39('0x84')][_0xfb39('0x85')]['SELECT']});}})[_0xfb39('0x24')](function(){return{'sql':_0x5e8e6b['toString']()};})['then'](respondWithResult(_0x5b8750,null))['catch'](handleError(_0x5b8750,null));};
\ No newline at end of file
+var _0xc0ac=['filters','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','HOUR(%s)','operator','getFields','Sequelize','keyBy','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','QueryTypes','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','end','json','offset','count','status','set','Content-Range','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where'];(function(_0x1cc0b8,_0x3bdfe7){var _0x4b1daf=function(_0x4edc04){while(--_0x4edc04){_0x1cc0b8['push'](_0x1cc0b8['shift']());}};_0x4b1daf(++_0x3bdfe7);}(_0xc0ac,0x65));var _0xcc0a=function(_0x83195f,_0x48c6d6){_0x83195f=_0x83195f-0x0;var _0x409b61=_0xc0ac[_0x83195f];return _0x409b61;};'use strict';var emlformat=require(_0xcc0a('0x0'));var rimraf=require(_0xcc0a('0x1'));var zipdir=require(_0xcc0a('0x2'));var jsonpatch=require(_0xcc0a('0x3'));var rp=require(_0xcc0a('0x4'));var moment=require(_0xcc0a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcc0a('0x6'));var path=require('path');var sox=require(_0xcc0a('0x7'));var csv=require('to-csv');var ejs=require(_0xcc0a('0x8'));var fs=require('fs');var fs_extra=require(_0xcc0a('0x9'));var _=require(_0xcc0a('0xa'));var squel=require(_0xcc0a('0xb'));var crypto=require('crypto');var jsforce=require(_0xcc0a('0xc'));var deskjs=require(_0xcc0a('0xd'));var toCsv=require(_0xcc0a('0xe'));var querystring=require('querystring');var Papa=require(_0xcc0a('0xf'));var Redis=require('ioredis');var authService=require(_0xcc0a('0x10'));var qs=require(_0xcc0a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc0a('0x12'));var logger=require(_0xcc0a('0x13'))(_0xcc0a('0x14'));var utils=require(_0xcc0a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcc0a('0x16'));var db=require(_0xcc0a('0x17'))['db'];var dbH=require(_0xcc0a('0x17'))[_0xcc0a('0x18')];function respondWithStatusCode(_0x116e7a,_0x41c1e2){_0x41c1e2=_0x41c1e2||0xcc;return function(_0x2b41db){if(_0x2b41db){return _0x116e7a[_0xcc0a('0x19')](_0x41c1e2);}return _0x116e7a['status'](_0x41c1e2)[_0xcc0a('0x1a')]();};}function respondWithResult(_0x6c390b,_0x3fdb7f){_0x3fdb7f=_0x3fdb7f||0xc8;return function(_0x1238aa){if(_0x1238aa){return _0x6c390b['status'](_0x3fdb7f)[_0xcc0a('0x1b')](_0x1238aa);}};}function respondWithFilteredResult(_0x4cc3d6,_0x302bd2){return function(_0x5d60c1){if(_0x5d60c1){var _0x421f02=typeof _0x302bd2[_0xcc0a('0x1c')]==='undefined'&&typeof _0x302bd2['limit']==='undefined';var _0x4230ee=_0x5d60c1[_0xcc0a('0x1d')];var _0x27433e=_0x421f02?0x0:_0x302bd2[_0xcc0a('0x1c')];var _0x33befe=_0x421f02?_0x5d60c1[_0xcc0a('0x1d')]:_0x302bd2[_0xcc0a('0x1c')]+_0x302bd2['limit'];var _0x39b122;if(_0x33befe>=_0x4230ee){_0x33befe=_0x4230ee;_0x39b122=0xc8;}else{_0x39b122=0xce;}_0x4cc3d6[_0xcc0a('0x1e')](_0x39b122);return _0x4cc3d6[_0xcc0a('0x1f')](_0xcc0a('0x20'),_0x27433e+'-'+_0x33befe+'/'+_0x4230ee)[_0xcc0a('0x1b')](_0x5d60c1);}return null;};}function patchUpdates(_0x561a6a){return function(_0x250b3b){try{jsonpatch['apply'](_0x250b3b,_0x561a6a,!![]);}catch(_0x465aa5){return BPromise['reject'](_0x465aa5);}return _0x250b3b[_0xcc0a('0x21')]();};}function saveUpdates(_0x233ea8,_0x7a16ca){return function(_0x3cdaf4){if(_0x3cdaf4){return _0x3cdaf4[_0xcc0a('0x22')](_0x233ea8)[_0xcc0a('0x23')](function(_0x2633c1){return _0x2633c1;});}return null;};}function removeEntity(_0x290579,_0x328b53){return function(_0x304791){if(_0x304791){return _0x304791[_0xcc0a('0x24')]()[_0xcc0a('0x23')](function(){var _0x29843d=_0x304791[_0xcc0a('0x25')]({'plain':!![]});var _0x16969f=_0xcc0a('0x26');return db[_0xcc0a('0x27')][_0xcc0a('0x24')]({'where':{'type':_0x16969f,'resourceId':_0x29843d['id']}})[_0xcc0a('0x23')](function(){return _0x304791;});})['then'](function(){_0x290579[_0xcc0a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec74f,_0x2e51b1){return function(_0x4f5728){if(!_0x4f5728){_0x5ec74f[_0xcc0a('0x19')](0x194);}return _0x4f5728;};}function handleError(_0x43f4a7,_0x52d3dd){_0x52d3dd=_0x52d3dd||0x1f4;return function(_0x56046a){logger['error'](_0x56046a[_0xcc0a('0x28')]);if(_0x56046a[_0xcc0a('0x29')]){delete _0x56046a[_0xcc0a('0x29')];}_0x43f4a7[_0xcc0a('0x1e')](_0x52d3dd)[_0xcc0a('0x2a')](_0x56046a);};}exports[_0xcc0a('0x2b')]=function(_0x335782,_0x42c098){var _0x3ce04c={},_0x55a0c8={},_0x33f3b8={'count':0x0,'rows':[]};var _0xe504c1=_['map'](db[_0xcc0a('0x2c')][_0xcc0a('0x2d')],function(_0x424bcf){return{'name':_0x424bcf[_0xcc0a('0x2e')],'type':_0x424bcf['type'][_0xcc0a('0x2f')]};});_0x55a0c8['model']=_['map'](_0xe504c1,_0xcc0a('0x29'));_0x55a0c8['query']=_[_0xcc0a('0x30')](_0x335782[_0xcc0a('0x31')]);_0x55a0c8['filters']=_[_0xcc0a('0x32')](_0x55a0c8[_0xcc0a('0x33')],_0x55a0c8[_0xcc0a('0x31')]);_0x3ce04c[_0xcc0a('0x34')]=_[_0xcc0a('0x32')](_0x55a0c8[_0xcc0a('0x33')],qs[_0xcc0a('0x35')](_0x335782[_0xcc0a('0x31')][_0xcc0a('0x35')]));_0x3ce04c[_0xcc0a('0x34')]=_0x3ce04c[_0xcc0a('0x34')][_0xcc0a('0x36')]?_0x3ce04c['attributes']:_0x55a0c8[_0xcc0a('0x33')];if(!_0x335782[_0xcc0a('0x31')][_0xcc0a('0x37')]('nolimit')){_0x3ce04c['limit']=qs['limit'](_0x335782['query'][_0xcc0a('0x38')]);_0x3ce04c[_0xcc0a('0x1c')]=qs['offset'](_0x335782['query'][_0xcc0a('0x1c')]);}_0x3ce04c[_0xcc0a('0x39')]=qs[_0xcc0a('0x3a')](_0x335782['query'][_0xcc0a('0x3a')]);_0x3ce04c[_0xcc0a('0x3b')]=qs[_0xcc0a('0x3c')](_[_0xcc0a('0x3d')](_0x335782['query'],_0x55a0c8[_0xcc0a('0x3c')]),_0xe504c1);if(_0x335782['query'][_0xcc0a('0x3e')]){_0x3ce04c['where']=_[_0xcc0a('0x3f')](_0x3ce04c['where'],{'$or':_[_0xcc0a('0x40')](_0xe504c1,function(_0x9ddea7){if(_0x9ddea7[_0xcc0a('0x41')]!==_0xcc0a('0x42')){var _0x43e705={};_0x43e705[_0x9ddea7[_0xcc0a('0x29')]]={'$like':'%'+_0x335782['query'][_0xcc0a('0x3e')]+'%'};return _0x43e705;}})});}_0x3ce04c=_['merge']({},_0x3ce04c,_0x335782[_0xcc0a('0x43')]);var _0xb9ea9={'where':_0x3ce04c[_0xcc0a('0x3b')]};return db[_0xcc0a('0x2c')][_0xcc0a('0x1d')](_0xb9ea9)[_0xcc0a('0x23')](function(_0x31f637){_0x33f3b8[_0xcc0a('0x1d')]=_0x31f637;if(_0x335782[_0xcc0a('0x31')]['includeAll']){_0x3ce04c['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xcc0a('0x44')](_0x3ce04c);})[_0xcc0a('0x23')](function(_0x5687e4){_0x33f3b8[_0xcc0a('0x45')]=_0x5687e4;return _0x33f3b8;})[_0xcc0a('0x23')](respondWithFilteredResult(_0x42c098,_0x3ce04c))['catch'](handleError(_0x42c098,null));};exports[_0xcc0a('0x46')]=function(_0x2a6e2d,_0xb1eef1){var _0x32873c={'raw':![],'where':{'id':_0x2a6e2d[_0xcc0a('0x47')]['id']}},_0x38d28b={};_0x38d28b[_0xcc0a('0x33')]=_['keys'](db['AnalyticCustomReport'][_0xcc0a('0x2d')]);_0x38d28b[_0xcc0a('0x31')]=_[_0xcc0a('0x30')](_0x2a6e2d['query']);_0x38d28b[_0xcc0a('0x3c')]=_[_0xcc0a('0x32')](_0x38d28b[_0xcc0a('0x33')],_0x38d28b['query']);_0x32873c[_0xcc0a('0x34')]=_[_0xcc0a('0x32')](_0x38d28b['model'],qs['fields'](_0x2a6e2d[_0xcc0a('0x31')][_0xcc0a('0x35')]));_0x32873c[_0xcc0a('0x34')]=_0x32873c[_0xcc0a('0x34')][_0xcc0a('0x36')]?_0x32873c['attributes']:_0x38d28b[_0xcc0a('0x33')];if(_0x2a6e2d[_0xcc0a('0x31')][_0xcc0a('0x48')]){_0x32873c[_0xcc0a('0x49')]=[{'all':!![]}];}_0x32873c=_[_0xcc0a('0x3f')]({},_0x32873c,_0x2a6e2d[_0xcc0a('0x43')]);return db[_0xcc0a('0x2c')][_0xcc0a('0x4a')](_0x32873c)['then'](handleEntityNotFound(_0xb1eef1,null))[_0xcc0a('0x23')](respondWithResult(_0xb1eef1,null))[_0xcc0a('0x4b')](handleError(_0xb1eef1,null));};exports[_0xcc0a('0x4c')]=function(_0x4fa3bb,_0x4253ff){return db['AnalyticCustomReport'][_0xcc0a('0x4c')](_0x4fa3bb[_0xcc0a('0x4d')],{})[_0xcc0a('0x23')](function(_0x45f3e8){var _0x58be84=_0x4fa3bb[_0xcc0a('0x4e')][_0xcc0a('0x25')]({'plain':!![]});if(!_0x58be84)throw new Error(_0xcc0a('0x4f'));if(_0x58be84[_0xcc0a('0x50')]===_0xcc0a('0x4e')){var _0x58ce00=_0x45f3e8[_0xcc0a('0x25')]({'plain':!![]});var _0x198770='Reports';return db['UserProfileSection'][_0xcc0a('0x4a')]({'where':{'name':_0x198770,'userProfileId':_0x58be84[_0xcc0a('0x51')]},'raw':!![]})['then'](function(_0x156c9c){if(_0x156c9c&&_0x156c9c[_0xcc0a('0x52')]===0x0){return db[_0xcc0a('0x27')]['create']({'name':_0x58ce00['name'],'resourceId':_0x58ce00['id'],'type':'CustomReports','sectionId':_0x156c9c['id']},{})[_0xcc0a('0x23')](function(){return _0x45f3e8;});}else{return _0x45f3e8;}})[_0xcc0a('0x4b')](function(_0x211834){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211834);throw _0x211834;});}return _0x45f3e8;})[_0xcc0a('0x23')](respondWithResult(_0x4253ff,0xc9))['catch'](handleError(_0x4253ff,null));};exports[_0xcc0a('0x22')]=function(_0xd85fec,_0x488235){if(_0xd85fec[_0xcc0a('0x4d')]['id']){delete _0xd85fec[_0xcc0a('0x4d')]['id'];}return db[_0xcc0a('0x2c')][_0xcc0a('0x4a')]({'where':{'id':_0xd85fec[_0xcc0a('0x47')]['id']}})['then'](handleEntityNotFound(_0x488235,null))[_0xcc0a('0x23')](saveUpdates(_0xd85fec[_0xcc0a('0x4d')],null))[_0xcc0a('0x23')](respondWithResult(_0x488235,null))['catch'](handleError(_0x488235,null));};exports[_0xcc0a('0x24')]=function(_0x465502,_0x4b49d4){return db[_0xcc0a('0x2c')][_0xcc0a('0x4a')]({'where':{'id':_0x465502['params']['id']}})['then'](handleEntityNotFound(_0x4b49d4,null))[_0xcc0a('0x23')](removeEntity(_0x4b49d4,null))[_0xcc0a('0x4b')](handleError(_0x4b49d4,null));};exports[_0xcc0a('0x53')]=function(_0x20c7ca,_0x40934a){var _0x482ff8=0xa;var _0xb18262=[_0xcc0a('0x54'),_0xcc0a('0x55'),_0xcc0a('0x56'),_0xcc0a('0x57')];var _0x12f584={'SUM':_0xcc0a('0x58'),'COUNT':_0xcc0a('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc0a('0x5a'),'MIN':_0xcc0a('0x5b'),'AVG':_0xcc0a('0x5c'),'GROUP_CONCAT':_0xcc0a('0x5d'),'GROUP_CONCAT ASC':_0xcc0a('0x5e'),'GROUP_CONCAT DESC':_0xcc0a('0x5f')};var _0x12b24c={'SEC_TO_TIME':_0xcc0a('0x60'),'DATE':_0xcc0a('0x61'),'HOUR':'HOUR(%s)','ROUND':_0xcc0a('0x62'),'UNIX_TIMESTAMP':_0xcc0a('0x63')};var _0x5f1bbd=function(_0x16f0bf){return!_[_0xcc0a('0x64')]([_0xcc0a('0x65'),_0xcc0a('0x66'),_0xcc0a('0x67'),_0xcc0a('0x68')],_0x16f0bf);};var _0x2509eb=function(_0x3c38ee){if(!_0x3c38ee||!_0x3c38ee[_0xcc0a('0x69')][_0xcc0a('0x36')]){return'';}for(var _0x21355a='(',_0x3d40f3=0x0;_0x3d40f3<_0x3c38ee['rules'][_0xcc0a('0x36')];_0x3d40f3+=0x1){_0x3d40f3>0x0&&(_0x21355a+='\x20'+_0x3c38ee['operator']+'\x20');_0x21355a+=_0x3c38ee[_0xcc0a('0x69')][_0x3d40f3][_0xcc0a('0x6a')]?_0x2509eb(_0x3c38ee['rules'][_0x3d40f3][_0xcc0a('0x6a')]):_0x3c38ee[_0xcc0a('0x69')][_0x3d40f3][_0xcc0a('0x6b')]+'\x20'+_0x3c38ee[_0xcc0a('0x69')][_0x3d40f3][_0xcc0a('0x6c')]+(_0x5f1bbd(_0x3c38ee['rules'][_0x3d40f3]['condition'])?'\x20'+_0x3c38ee[_0xcc0a('0x69')][_0x3d40f3][_0xcc0a('0x6d')]:'');}return _0x21355a+')';};var _0x12a824={'where':{'id':_0x20c7ca[_0xcc0a('0x47')]['id']}},_0x3b8e1d,_0x581f27,_0x16c444,_0x1625ec,_0x354b60;_0x12a824=_['merge']({},_0x12a824,_0x20c7ca[_0xcc0a('0x43')]);return db[_0xcc0a('0x2c')]['find'](_0x12a824)['then'](function(_0x14257c){if(_0x14257c){_0x3b8e1d=_0x14257c;return _0x14257c['getFields']();}return null;})['then'](function(_0x300216){if(_0x300216){if(!_0x300216[_0xcc0a('0x36')]){throw new db['Sequelize'][(_0xcc0a('0x6e'))](_0xcc0a('0x6f'),0x193);}_0x581f27=_0x300216;return db[_0xcc0a('0x70')][_0xcc0a('0x44')]({'raw':!![]});}return null;})['then'](function(_0x545f2d){if(_0x545f2d){_0x16c444=_['keyBy'](_0x545f2d,'id');var _0xdadb47;var _0x4da418=squel[_0xcc0a('0x71')]();_0x4da418[_0xcc0a('0x72')](_0x3b8e1d[_0xcc0a('0x73')]);for(var _0x302302=0x0;_0x302302<_0x581f27[_0xcc0a('0x36')];_0x302302+=0x1){_0xdadb47=_0x581f27[_0x302302][_0xcc0a('0x74')]?_0x16c444[_0x581f27[_0x302302]['MetricId']][_0xcc0a('0x75')]:_0x581f27[_0x302302][_0xcc0a('0x6b')];_0xdadb47=_0x581f27[_0x302302][_0xcc0a('0x76')]?_[_0xcc0a('0x77')](_0x12f584[_0x581f27[_0x302302][_0xcc0a('0x76')]],'%s',_0xdadb47):_0xdadb47;_0xdadb47=_0x581f27[_0x302302][_0xcc0a('0x78')]?_[_0xcc0a('0x77')](_0x12b24c[_0x581f27[_0x302302][_0xcc0a('0x78')]],'%s',_0xdadb47):_0xdadb47;if(_0x581f27[_0x302302]['groupBy']){_0x4da418[_0xcc0a('0x6a')](_0xdadb47);}_0x581f27[_0x302302][_0xcc0a('0x79')]&&_0x4da418[_0xcc0a('0x39')](_0xdadb47,_0x581f27[_0x302302][_0xcc0a('0x79')]===_0xcc0a('0x7a')?![]:!![]);_0x4da418[_0xcc0a('0x6b')](_0xdadb47,_0x581f27[_0x302302][_0xcc0a('0x7b')]||_0xdadb47);}if(_0x3b8e1d[_0xcc0a('0x7c')]){_0x3b8e1d['joins']=JSON[_0xcc0a('0x7d')](_0x3b8e1d['joins']);for(var _0x2f19a1=0x0;_0x2f19a1<_0x3b8e1d[_0xcc0a('0x7c')][_0xcc0a('0x36')];_0x2f19a1+=0x1){if(_0x3b8e1d['joins'][_0x2f19a1][_0xcc0a('0x41')]&&_['includes'](_0xb18262,_0x3b8e1d['joins'][_0x2f19a1][_0xcc0a('0x41')])&&_0x3b8e1d['joins'][_0x2f19a1][_0xcc0a('0x7e')]&&_0x3b8e1d[_0xcc0a('0x7c')][_0x2f19a1][_0xcc0a('0x7f')]&&_0x3b8e1d[_0xcc0a('0x7c')][_0x2f19a1][_0xcc0a('0x80')]){_0x4da418[_0x3b8e1d[_0xcc0a('0x7c')][_0x2f19a1][_0xcc0a('0x41')]](_0x3b8e1d[_0xcc0a('0x7c')][_0x2f19a1][_0xcc0a('0x7f')],null,util[_0xcc0a('0x78')](_0xcc0a('0x81'),_0x3b8e1d[_0xcc0a('0x73')],_0x3b8e1d[_0xcc0a('0x7c')][_0x2f19a1][_0xcc0a('0x7e')],_0x3b8e1d[_0xcc0a('0x7c')][_0x2f19a1][_0xcc0a('0x7f')],_0x3b8e1d[_0xcc0a('0x7c')][_0x2f19a1][_0xcc0a('0x80')]));}}}if(_0x3b8e1d[_0xcc0a('0x82')]){_0x3b8e1d['conditions']=JSON[_0xcc0a('0x7d')](_0x3b8e1d[_0xcc0a('0x82')]);_0x4da418[_0xcc0a('0x3b')](_0x2509eb(_0x3b8e1d[_0xcc0a('0x82')][_0xcc0a('0x6a')]));}_0x354b60=_0x4da418['clone']();_0x4da418['limit'](_0x482ff8);_0x4da418['offset'](0x0);logger[_0xcc0a('0x83')](_0xcc0a('0x84'),_0x4da418[_0xcc0a('0x85')]());return dbH[_0xcc0a('0x86')][_0xcc0a('0x31')](_0x4da418['toString'](),{'type':dbH[_0xcc0a('0x86')]['QueryTypes'][_0xcc0a('0x87')]});}})[_0xcc0a('0x23')](respondWithResult(_0x40934a,null))[_0xcc0a('0x4b')](handleError(_0x40934a,null));};function runReport(_0x305b37,_0x428f9f,_0x2ceee5){var _0x1f75e4=_0x428f9f[_0xcc0a('0x29')];var _0x1a9b6c=0xa;var _0x426f9b=[_0xcc0a('0x54'),'left_join','right_join',_0xcc0a('0x57')];var _0x22f1b3={'SUM':_0xcc0a('0x58'),'COUNT':_0xcc0a('0x59'),'COUNT DISTINCT':_0xcc0a('0x88'),'MAX':_0xcc0a('0x5a'),'MIN':_0xcc0a('0x5b'),'AVG':_0xcc0a('0x5c'),'GROUP_CONCAT':_0xcc0a('0x5d'),'GROUP_CONCAT ASC':_0xcc0a('0x5e'),'GROUP_CONCAT DESC':_0xcc0a('0x5f')};var _0x1a12a0={'SEC_TO_TIME':_0xcc0a('0x60'),'DATE':'DATE(%s)','HOUR':_0xcc0a('0x89'),'ROUND':_0xcc0a('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc0f9f6=function(_0x27e5e9){return!_[_0xcc0a('0x64')]([_0xcc0a('0x65'),_0xcc0a('0x66'),_0xcc0a('0x67'),_0xcc0a('0x68')],_0x27e5e9);};var _0x114ae8=function(_0x15348d){if(!_0x15348d||!_0x15348d[_0xcc0a('0x69')][_0xcc0a('0x36')]){return'';}for(var _0x5f1497='(',_0x3a7154=0x0;_0x3a7154<_0x15348d[_0xcc0a('0x69')][_0xcc0a('0x36')];_0x3a7154+=0x1){_0x3a7154>0x0&&(_0x5f1497+='\x20'+_0x15348d[_0xcc0a('0x8a')]+'\x20');_0x5f1497+=_0x15348d[_0xcc0a('0x69')][_0x3a7154][_0xcc0a('0x6a')]?_0x114ae8(_0x15348d[_0xcc0a('0x69')][_0x3a7154][_0xcc0a('0x6a')]):_0x15348d[_0xcc0a('0x69')][_0x3a7154][_0xcc0a('0x6b')]+'\x20'+_0x15348d[_0xcc0a('0x69')][_0x3a7154]['condition']+(_0xc0f9f6(_0x15348d['rules'][_0x3a7154][_0xcc0a('0x6c')])?'\x20'+_0x15348d['rules'][_0x3a7154][_0xcc0a('0x6d')]:'');}return _0x5f1497+')';};var _0x2821ab={'where':{'id':_0x305b37['id']}},_0x1c2419,_0xa3263b,_0x115445,_0x501428,_0x34be1c;_0x2821ab=_[_0xcc0a('0x3f')]({},_0x2821ab,_0x2ceee5);return db['AnalyticCustomReport'][_0xcc0a('0x4a')](_0x2821ab)[_0xcc0a('0x23')](function(_0x2b061d){if(_0x2b061d){_0x1c2419=_0x2b061d;return _0x2b061d[_0xcc0a('0x8b')]();}return null;})['then'](function(_0x239392){if(_0x239392){if(!_0x239392['length']){throw new db[(_0xcc0a('0x8c'))][(_0xcc0a('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa3263b=_0x239392;return db[_0xcc0a('0x70')][_0xcc0a('0x44')]({'raw':!![]});}return null;})[_0xcc0a('0x23')](function(_0x1f91b8){if(_0x1f91b8){_0x115445=_[_0xcc0a('0x8d')](_0x1f91b8,'id');var _0xf3a820;var _0x462cd1=squel[_0xcc0a('0x71')]();_0x462cd1[_0xcc0a('0x72')](_0x1c2419[_0xcc0a('0x73')]);for(var _0x1c7121=0x0;_0x1c7121<_0xa3263b[_0xcc0a('0x36')];_0x1c7121+=0x1){_0xf3a820=_0xa3263b[_0x1c7121]['MetricId']?_0x115445[_0xa3263b[_0x1c7121][_0xcc0a('0x74')]]['metric']:_0xa3263b[_0x1c7121][_0xcc0a('0x6b')];_0xf3a820=_0xa3263b[_0x1c7121][_0xcc0a('0x76')]?_[_0xcc0a('0x77')](_0x22f1b3[_0xa3263b[_0x1c7121][_0xcc0a('0x76')]],'%s',_0xf3a820):_0xf3a820;_0xf3a820=_0xa3263b[_0x1c7121][_0xcc0a('0x78')]?_['replace'](_0x1a12a0[_0xa3263b[_0x1c7121][_0xcc0a('0x78')]],'%s',_0xf3a820):_0xf3a820;if(_0xa3263b[_0x1c7121]['groupBy']){_0x462cd1[_0xcc0a('0x6a')](_0xf3a820);}_0xa3263b[_0x1c7121][_0xcc0a('0x79')]&&_0x462cd1[_0xcc0a('0x39')](_0xf3a820,_0xa3263b[_0x1c7121][_0xcc0a('0x79')]===_0xcc0a('0x7a')?![]:!![]);_0x462cd1[_0xcc0a('0x6b')](_0xf3a820,_0xa3263b[_0x1c7121]['alias']||_0xf3a820);}if(_0x1c2419['joins']){_0x1c2419[_0xcc0a('0x7c')]=JSON['parse'](_0x1c2419['joins']);for(var _0x26224b=0x0;_0x26224b<_0x1c2419['joins'][_0xcc0a('0x36')];_0x26224b+=0x1){if(_0x1c2419[_0xcc0a('0x7c')][_0x26224b][_0xcc0a('0x41')]&&_[_0xcc0a('0x64')](_0x426f9b,_0x1c2419['joins'][_0x26224b][_0xcc0a('0x41')])&&_0x1c2419[_0xcc0a('0x7c')][_0x26224b][_0xcc0a('0x7e')]&&_0x1c2419[_0xcc0a('0x7c')][_0x26224b][_0xcc0a('0x7f')]&&_0x1c2419[_0xcc0a('0x7c')][_0x26224b][_0xcc0a('0x80')]){_0x462cd1[_0x1c2419[_0xcc0a('0x7c')][_0x26224b][_0xcc0a('0x41')]](_0x1c2419['joins'][_0x26224b]['foreignTable'],null,util[_0xcc0a('0x78')](_0xcc0a('0x81'),_0x1c2419['table'],_0x1c2419[_0xcc0a('0x7c')][_0x26224b][_0xcc0a('0x7e')],_0x1c2419[_0xcc0a('0x7c')][_0x26224b]['foreignTable'],_0x1c2419[_0xcc0a('0x7c')][_0x26224b][_0xcc0a('0x80')]));}}}if(_0x1c2419[_0xcc0a('0x82')]){_0x1c2419[_0xcc0a('0x82')]=JSON[_0xcc0a('0x7d')](_0x1c2419[_0xcc0a('0x82')]);_0x462cd1[_0xcc0a('0x3b')](_0x114ae8(_0x1c2419[_0xcc0a('0x82')]['group']));}_0x34be1c=_0x462cd1['clone']();_0x462cd1[_0xcc0a('0x38')](_0x1a9b6c);_0x462cd1[_0xcc0a('0x1c')](0x0);return;}})[_0xcc0a('0x23')](function(){if(_0x428f9f[_0xcc0a('0x8e')]===_0xcc0a('0x8f')){return null;}var _0x4276a1=_[_0xcc0a('0x3f')](_0x428f9f,{'name':_0x428f9f[_0xcc0a('0x90')]||_0x428f9f[_0xcc0a('0x29')]||_0x1c2419['name'],'basename':_0x1f75e4,'savename':util[_0xcc0a('0x78')]('%s-%s.%s',_0x428f9f[_0xcc0a('0x29')]||_0x1c2419[_0xcc0a('0x29')],require(_0xcc0a('0x91'))[_0xcc0a('0x92')](0x4),_0x428f9f[_0xcc0a('0x8e')]||_0xcc0a('0x93')),'reportId':_0x1c2419['id'],'reportType':_0xcc0a('0x94')});return db[_0xcc0a('0x95')][_0xcc0a('0x4c')](_0x4276a1,{'raw':!![]});})[_0xcc0a('0x23')](function(_0x4cf13d){if(_0x1c2419[_0xcc0a('0x73')]==='cdr'){_0x34be1c[_0xcc0a('0x3b')](_0x1c2419[_0xcc0a('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x428f9f[_0xcc0a('0x96')],_0x428f9f['endDate']);}else{_0x34be1c[_0xcc0a('0x3b')](_0x1c2419[_0xcc0a('0x73')]+_0xcc0a('0x97'),_0x428f9f[_0xcc0a('0x96')],_0x428f9f['endDate']);}if(_0x4cf13d){logger[_0xcc0a('0x98')](_0xcc0a('0x99'),_0x34be1c['toString']());require(_0xcc0a('0x9a'))[_0xcc0a('0x9b')](path[_0xcc0a('0x54')](__dirname,_0xcc0a('0x9c'),_0x4cf13d[_0xcc0a('0x8e')]),[_0x4cf13d['id'],_0x34be1c[_0xcc0a('0x85')](),path['join'](__dirname,_0xcc0a('0x9d'),_0x4cf13d['savename']),_0x1f75e4]);return _0x4cf13d;}else{var _0x472356=squel[_0xcc0a('0x71')]();_0x472356[_0xcc0a('0x72')]('('+_0x34be1c[_0xcc0a('0x85')]()+')',_0xcc0a('0x9e'));_0x472356[_0xcc0a('0x6b')]('COUNT(*)',_0xcc0a('0x1d'));_0x34be1c['limit'](_0x428f9f[_0xcc0a('0x38')]||_0x1a9b6c);_0x34be1c[_0xcc0a('0x1c')](_0x428f9f['offset']||0x0);return dbH[_0xcc0a('0x86')][_0xcc0a('0x31')](_0x472356['toString'](),{'type':dbH[_0xcc0a('0x86')][_0xcc0a('0x9f')][_0xcc0a('0x87')]})[_0xcc0a('0x23')](function(_0x218289){if(!_0x218289[_0xcc0a('0x36')]){_0x501428=0x0;}else{_0x501428=_0x218289[0x0][_0xcc0a('0x1d')]||0x0;}return dbH['sequelize'][_0xcc0a('0x31')](_0x34be1c[_0xcc0a('0x85')](),{'type':dbH[_0xcc0a('0x86')][_0xcc0a('0x9f')][_0xcc0a('0x87')]});})[_0xcc0a('0x23')](function(_0x42778e){return{'rows':_0x42778e||[],'count':_0x501428};});}});}exports[_0xcc0a('0xa0')]=function(_0x48f4b9,_0x525ec5){return runReport(_0x48f4b9[_0xcc0a('0x47')],_0x48f4b9[_0xcc0a('0x31')],_0x48f4b9[_0xcc0a('0x43')])[_0xcc0a('0x23')](respondWithResult(_0x525ec5,null))[_0xcc0a('0x4b')](handleError(_0x525ec5,null));};exports['runReport']=runReport;exports[_0xcc0a('0x31')]=function(_0x4a7952,_0x8a991a){var _0x42c962=0xa;var _0x20eebd=['join',_0xcc0a('0x55'),'right_join','cross_join'];var _0x517ecb={'SUM':_0xcc0a('0x58'),'COUNT':_0xcc0a('0x59'),'COUNT DISTINCT':_0xcc0a('0x88'),'MAX':_0xcc0a('0x5a'),'MIN':_0xcc0a('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcc0a('0x5d'),'GROUP_CONCAT ASC':_0xcc0a('0x5e'),'GROUP_CONCAT DESC':_0xcc0a('0x5f')};var _0x151371={'SEC_TO_TIME':_0xcc0a('0x60'),'DATE':_0xcc0a('0x61'),'HOUR':_0xcc0a('0x89'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ff6d2=function(_0x190351){return!_[_0xcc0a('0x64')]([_0xcc0a('0x65'),_0xcc0a('0x66'),_0xcc0a('0x67'),_0xcc0a('0x68')],_0x190351);};var _0x3efd22=function(_0x52774c){if(!_0x52774c||!_0x52774c[_0xcc0a('0x69')]['length']){return'';}for(var _0xda857d='(',_0x1612f4=0x0;_0x1612f4<_0x52774c[_0xcc0a('0x69')][_0xcc0a('0x36')];_0x1612f4+=0x1){_0x1612f4>0x0&&(_0xda857d+='\x20'+_0x52774c[_0xcc0a('0x8a')]+'\x20');_0xda857d+=_0x52774c['rules'][_0x1612f4]['group']?_0x3efd22(_0x52774c['rules'][_0x1612f4][_0xcc0a('0x6a')]):_0x52774c[_0xcc0a('0x69')][_0x1612f4][_0xcc0a('0x6b')]+'\x20'+_0x52774c[_0xcc0a('0x69')][_0x1612f4][_0xcc0a('0x6c')]+(_0x2ff6d2(_0x52774c[_0xcc0a('0x69')][_0x1612f4][_0xcc0a('0x6c')])?'\x20'+_0x52774c['rules'][_0x1612f4]['value']:'');}return _0xda857d+')';};var _0x1e7249={'where':{'id':_0x4a7952[_0xcc0a('0x47')]['id']}},_0x5446d8,_0x307d3e,_0x2fdc86,_0x3e3c2f,_0x332abd;_0x1e7249=_[_0xcc0a('0x3f')]({},_0x1e7249,_0x4a7952['options']);return db['AnalyticCustomReport'][_0xcc0a('0x4a')](_0x1e7249)[_0xcc0a('0x23')](function(_0x2b1468){if(_0x2b1468){_0x5446d8=_0x2b1468;return _0x2b1468['getFields']();}return null;})[_0xcc0a('0x23')](function(_0x11b29a){if(_0x11b29a){if(!_0x11b29a[_0xcc0a('0x36')]){throw new db[(_0xcc0a('0x8c'))][(_0xcc0a('0x6e'))](_0xcc0a('0x6f'),0x193);}_0x307d3e=_0x11b29a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xcc0a('0x23')](function(_0x592734){if(_0x592734){_0x2fdc86=_[_0xcc0a('0x8d')](_0x592734,'id');var _0x2bf625;var _0x368779=squel[_0xcc0a('0x71')]();_0x368779[_0xcc0a('0x72')](_0x5446d8[_0xcc0a('0x73')]);for(var _0x246cfd=0x0;_0x246cfd<_0x307d3e[_0xcc0a('0x36')];_0x246cfd+=0x1){_0x2bf625=_0x307d3e[_0x246cfd][_0xcc0a('0x74')]?_0x2fdc86[_0x307d3e[_0x246cfd][_0xcc0a('0x74')]]['metric']:_0x307d3e[_0x246cfd][_0xcc0a('0x6b')];_0x2bf625=_0x307d3e[_0x246cfd][_0xcc0a('0x76')]?_[_0xcc0a('0x77')](_0x517ecb[_0x307d3e[_0x246cfd][_0xcc0a('0x76')]],'%s',_0x2bf625):_0x2bf625;_0x2bf625=_0x307d3e[_0x246cfd][_0xcc0a('0x78')]?_[_0xcc0a('0x77')](_0x151371[_0x307d3e[_0x246cfd][_0xcc0a('0x78')]],'%s',_0x2bf625):_0x2bf625;if(_0x307d3e[_0x246cfd]['groupBy']){_0x368779[_0xcc0a('0x6a')](_0x2bf625);}_0x307d3e[_0x246cfd][_0xcc0a('0x79')]&&_0x368779['order'](_0x2bf625,_0x307d3e[_0x246cfd][_0xcc0a('0x79')]===_0xcc0a('0x7a')?![]:!![]);_0x368779[_0xcc0a('0x6b')](_0x2bf625,_0x307d3e[_0x246cfd][_0xcc0a('0x7b')]||_0x2bf625);}if(_0x5446d8[_0xcc0a('0x7c')]){_0x5446d8[_0xcc0a('0x7c')]=JSON[_0xcc0a('0x7d')](_0x5446d8[_0xcc0a('0x7c')]);for(var _0x5cd454=0x0;_0x5cd454<_0x5446d8[_0xcc0a('0x7c')]['length'];_0x5cd454+=0x1){if(_0x5446d8[_0xcc0a('0x7c')][_0x5cd454][_0xcc0a('0x41')]&&_[_0xcc0a('0x64')](_0x20eebd,_0x5446d8[_0xcc0a('0x7c')][_0x5cd454][_0xcc0a('0x41')])&&_0x5446d8[_0xcc0a('0x7c')][_0x5cd454][_0xcc0a('0x7e')]&&_0x5446d8[_0xcc0a('0x7c')][_0x5cd454][_0xcc0a('0x7f')]&&_0x5446d8[_0xcc0a('0x7c')][_0x5cd454]['foreignKey']){_0x368779[_0x5446d8['joins'][_0x5cd454][_0xcc0a('0x41')]](_0x5446d8[_0xcc0a('0x7c')][_0x5cd454][_0xcc0a('0x7f')],null,util[_0xcc0a('0x78')](_0xcc0a('0x81'),_0x5446d8[_0xcc0a('0x73')],_0x5446d8['joins'][_0x5cd454]['parentKey'],_0x5446d8[_0xcc0a('0x7c')][_0x5cd454][_0xcc0a('0x7f')],_0x5446d8[_0xcc0a('0x7c')][_0x5cd454][_0xcc0a('0x80')]));}}}if(_0x5446d8[_0xcc0a('0x82')]){_0x5446d8[_0xcc0a('0x82')]=JSON[_0xcc0a('0x7d')](_0x5446d8['conditions']);_0x368779[_0xcc0a('0x3b')](_0x3efd22(_0x5446d8[_0xcc0a('0x82')]['group']));}_0x332abd=_0x368779['clone']();_0x368779[_0xcc0a('0x38')](_0x42c962);_0x368779[_0xcc0a('0x1c')](0x0);logger[_0xcc0a('0x83')](_0xcc0a('0x84'),_0x368779[_0xcc0a('0x85')]());return dbH[_0xcc0a('0x86')]['query'](_0x368779[_0xcc0a('0x85')](),{'type':dbH[_0xcc0a('0x86')]['QueryTypes'][_0xcc0a('0x87')]});}})[_0xcc0a('0x23')](function(){return{'sql':_0x332abd[_0xcc0a('0x85')]()};})[_0xcc0a('0x23')](respondWithResult(_0x8a991a,null))['catch'](handleError(_0x8a991a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 94b0705..2484517 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 _0xdcaf=['exports','define','analytics_custom_reports','lodash','util','moment','bluebird'];(function(_0x434d68,_0xcbdfed){var _0x56f3ce=function(_0x3553ab){while(--_0x3553ab){_0x434d68['push'](_0x434d68['shift']());}};_0x56f3ce(++_0xcbdfed);}(_0xdcaf,0x88));var _0xfdca=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdcaf[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfdca('0x0'));var util=require(_0xfdca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfdca('0x2'));var BPromise=require(_0xfdca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xfdca('0x4')]=function(_0x31558c,_0x3b54bc){return _0x31558c[_0xfdca('0x5')]('AnalyticCustomReport',attributes,{'tableName':_0xfdca('0x6'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3855=['path','rimraf','./analyticCustomReport.attributes','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1df0a9,_0xc0d944){var _0x13238e=function(_0x12db5c){while(--_0x12db5c){_0x1df0a9['push'](_0x1df0a9['shift']());}};_0x13238e(++_0xc0d944);}(_0x3855,0xea));var _0x5385=function(_0x186b4c,_0x376b66){_0x186b4c=_0x186b4c-0x0;var _0x48346b=_0x3855[_0x186b4c];return _0x48346b;};'use strict';var _=require(_0x5385('0x0'));var util=require(_0x5385('0x1'));var logger=require('../../config/logger')(_0x5385('0x2'));var moment=require(_0x5385('0x3'));var BPromise=require(_0x5385('0x4'));var rp=require(_0x5385('0x5'));var fs=require('fs');var path=require(_0x5385('0x6'));var rimraf=require(_0x5385('0x7'));var config=require('../../config/environment');var attributes=require(_0x5385('0x8'));module['exports']=function(_0x1e15c3,_0x58f0e1){return _0x1e15c3['define']('AnalyticCustomReport',attributes,{'tableName':_0x5385('0x9'),'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 272b455..0123fa3 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 _0x74db=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','lodash','bluebird','randomstring','ioredis'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x74db,0x165));var _0xb74d=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x74db[_0x2fdf82];return _0x2382f5;};'use strict';var _=require(_0xb74d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb74d('0x1'));var rs=require(_0xb74d('0x2'));var fs=require('fs');var Redis=require(_0xb74d('0x3'));var db=require(_0xb74d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb74d('0x5'))(_0xb74d('0x6'));var config=require(_0xb74d('0x7'));var jayson=require(_0xb74d('0x8'));var client=jayson['client'][_0xb74d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19ba6f,_0x401180,_0x2b5728){return new BPromise(function(_0x1a1d4a,_0x2d6c4f){return client[_0xb74d('0xa')](_0x19ba6f,_0x2b5728)['then'](function(_0x3e7a76){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x401180,_0xb74d('0xb'));logger['debug'](_0xb74d('0xc'),_0x401180,'request\x20sent',JSON[_0xb74d('0xd')](_0x3e7a76));if(_0x3e7a76[_0xb74d('0xe')]){if(_0x3e7a76['error'][_0xb74d('0xf')]===0x1f4){logger[_0xb74d('0xe')](_0xb74d('0x10'),_0x401180,_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);return _0x2d6c4f(_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);}logger[_0xb74d('0xe')](_0xb74d('0x10'),_0x401180,_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);return _0x1a1d4a(_0x3e7a76[_0xb74d('0xe')][_0xb74d('0x11')]);}else{logger[_0xb74d('0x12')](_0xb74d('0x10'),_0x401180,'request\x20sent');_0x1a1d4a(_0x3e7a76['result']['message']);}})['catch'](function(_0x2d545f){logger[_0xb74d('0xe')](_0xb74d('0x10'),_0x401180,_0x2d545f);_0x2d6c4f(_0x2d545f);});});}
\ No newline at end of file
+var _0xbbc9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3794db,_0x5e1968){var _0x3a7499=function(_0x1f4241){while(--_0x1f4241){_0x3794db['push'](_0x3794db['shift']());}};_0x3a7499(++_0x5e1968);}(_0xbbc9,0x15a));var _0x9bbc=function(_0x4efa2a,_0x1dbe0e){_0x4efa2a=_0x4efa2a-0x0;var _0x1055f7=_0xbbc9[_0x4efa2a];return _0x1055f7;};'use strict';var _=require(_0x9bbc('0x0'));var util=require(_0x9bbc('0x1'));var moment=require(_0x9bbc('0x2'));var BPromise=require(_0x9bbc('0x3'));var rs=require(_0x9bbc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bbc('0x5'))['db'];var utils=require(_0x9bbc('0x6'));var logger=require(_0x9bbc('0x7'))(_0x9bbc('0x8'));var config=require(_0x9bbc('0x9'));var jayson=require(_0x9bbc('0xa'));var client=jayson[_0x9bbc('0xb')][_0x9bbc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x396af3,_0x40d49f,_0x2825b4){return new BPromise(function(_0x4ccd0a,_0x421e32){return client['request'](_0x396af3,_0x2825b4)[_0x9bbc('0xd')](function(_0x3ced5f){logger[_0x9bbc('0xe')](_0x9bbc('0xf'),_0x40d49f,_0x9bbc('0x10'));logger[_0x9bbc('0x11')](_0x9bbc('0x12'),_0x40d49f,_0x9bbc('0x10'),JSON[_0x9bbc('0x13')](_0x3ced5f));if(_0x3ced5f[_0x9bbc('0x14')]){if(_0x3ced5f[_0x9bbc('0x14')][_0x9bbc('0x15')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x40d49f,_0x3ced5f[_0x9bbc('0x14')]['message']);return _0x421e32(_0x3ced5f[_0x9bbc('0x14')]['message']);}logger[_0x9bbc('0x14')](_0x9bbc('0xf'),_0x40d49f,_0x3ced5f[_0x9bbc('0x14')][_0x9bbc('0x16')]);return _0x4ccd0a(_0x3ced5f[_0x9bbc('0x14')][_0x9bbc('0x16')]);}else{logger[_0x9bbc('0xe')](_0x9bbc('0xf'),_0x40d49f,_0x9bbc('0x10'));_0x4ccd0a(_0x3ced5f[_0x9bbc('0x17')][_0x9bbc('0x16')]);}})[_0x9bbc('0x18')](function(_0x48daee){logger[_0x9bbc('0x14')](_0x9bbc('0xf'),_0x40d49f,_0x48daee);_0x421e32(_0x48daee);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 4abc718..b1a9367 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 _0x2bce=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','/:id/run','run','query','post','create','put','update','/:id'];(function(_0x37d1e4,_0x2eeb58){var _0x13155a=function(_0x435f88){while(--_0x435f88){_0x37d1e4['push'](_0x37d1e4['shift']());}};_0x13155a(++_0x2eeb58);}(_0x2bce,0x199));var _0xe2bc=function(_0x150667,_0x3bbe53){_0x150667=_0x150667-0x0;var _0x36f17e=_0x2bce[_0x150667];return _0x36f17e;};'use strict';var multer=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var path=require(_0xe2bc('0x2'));var timeout=require(_0xe2bc('0x3'));var express=require(_0xe2bc('0x4'));var router=express[_0xe2bc('0x5')]();var fs_extra=require(_0xe2bc('0x6'));var auth=require(_0xe2bc('0x7'));var interaction=require(_0xe2bc('0x8'));var config=require(_0xe2bc('0x9'));var controller=require(_0xe2bc('0xa'));router[_0xe2bc('0xb')]('/',auth[_0xe2bc('0xc')](),controller[_0xe2bc('0xd')]);router[_0xe2bc('0xb')]('/:id',auth[_0xe2bc('0xc')](),controller['show']);router[_0xe2bc('0xb')](_0xe2bc('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0xe2bc('0xb')](_0xe2bc('0xf'),auth[_0xe2bc('0xc')](),controller[_0xe2bc('0x10')]);router[_0xe2bc('0xb')]('/:id/query',auth[_0xe2bc('0xc')](),controller[_0xe2bc('0x11')]);router[_0xe2bc('0x12')]('/',auth['isAuthenticated'](),controller[_0xe2bc('0x13')]);router[_0xe2bc('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe2bc('0x15')]);router['delete'](_0xe2bc('0x16'),auth[_0xe2bc('0xc')](),controller[_0xe2bc('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xd9d1=['/:id/preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index'];(function(_0x4b416c,_0x53ef9e){var _0x2037fa=function(_0x5d9816){while(--_0x5d9816){_0x4b416c['push'](_0x4b416c['shift']());}};_0x2037fa(++_0x53ef9e);}(_0xd9d1,0x12a));var _0x1d9d=function(_0x476f8a,_0x492fac){_0x476f8a=_0x476f8a-0x0;var _0x4a3dda=_0xd9d1[_0x476f8a];return _0x4a3dda;};'use strict';var multer=require('multer');var util=require(_0x1d9d('0x0'));var path=require(_0x1d9d('0x1'));var timeout=require(_0x1d9d('0x2'));var express=require(_0x1d9d('0x3'));var router=express[_0x1d9d('0x4')]();var fs_extra=require(_0x1d9d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1d9d('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x1d9d('0x7')]('/',auth[_0x1d9d('0x8')](),controller[_0x1d9d('0x9')]);router[_0x1d9d('0x7')]('/:id',auth[_0x1d9d('0x8')](),controller['show']);router[_0x1d9d('0x7')](_0x1d9d('0xa'),auth[_0x1d9d('0x8')](),controller['preview']);router['get'](_0x1d9d('0xb'),auth[_0x1d9d('0x8')](),controller[_0x1d9d('0xc')]);router[_0x1d9d('0x7')](_0x1d9d('0xd'),auth[_0x1d9d('0x8')](),controller[_0x1d9d('0xe')]);router[_0x1d9d('0xf')]('/',auth['isAuthenticated'](),controller[_0x1d9d('0x10')]);router[_0x1d9d('0x11')](_0x1d9d('0x12'),auth[_0x1d9d('0x8')](),controller[_0x1d9d('0x13')]);router[_0x1d9d('0x14')]('/:id',auth[_0x1d9d('0x8')](),controller[_0x1d9d('0x15')]);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 e3b3f17..00bc2ff 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0xfdbd[_0x2a390b];return _0x5df10a;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
+var _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x6bcc5,_0x9c28f0){_0x6bcc5=_0x6bcc5-0x0;var _0x345542=_0xb4c7[_0x6bcc5];return _0x345542;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 57ae404..43fa31a 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 _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x220909,_0x4fa78a){_0x220909=_0x220909-0x0;var _0x1119ae=_0xc6ac[_0x220909];return _0x1119ae;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
+var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x415a01,_0x4a47df){var _0x3ad4ed=function(_0x1ab653){while(--_0x1ab653){_0x415a01['push'](_0x415a01['shift']());}};_0x3ad4ed(++_0x4a47df);}(_0x1967,0x173));var _0x7196=function(_0x7da333,_0x180e53){_0x7da333=_0x7da333-0x0;var _0x5d878e=_0x1967[_0x7da333];return _0x5d878e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index b76627b..264d171 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 _0x30d6=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','util','../../config/logger','api','moment','request-promise','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x30d6,0x192));var _0x630d=function(_0x8e7772,_0x9d77b0){_0x8e7772=_0x8e7772-0x0;var _0x408200=_0x30d6[_0x8e7772];return _0x408200;};'use strict';var _=require('lodash');var util=require(_0x630d('0x0'));var logger=require(_0x630d('0x1'))(_0x630d('0x2'));var moment=require(_0x630d('0x3'));var BPromise=require('bluebird');var rp=require(_0x630d('0x4'));var fs=require('fs');var path=require(_0x630d('0x5'));var rimraf=require(_0x630d('0x6'));var config=require(_0x630d('0x7'));var attributes=require(_0x630d('0x8'));module[_0x630d('0x9')]=function(_0x1bb227,_0x40b96b){return _0x1bb227[_0x630d('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x630d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2468=['analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x18392d,_0x1646af){var _0x300409=function(_0x352c54){while(--_0x352c54){_0x18392d['push'](_0x18392d['shift']());}};_0x300409(++_0x1646af);}(_0x2468,0x145));var _0x8246=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x2468[_0x3f5dca];return _0x5b833a;};'use strict';var _=require(_0x8246('0x0'));var util=require('util');var logger=require(_0x8246('0x1'))(_0x8246('0x2'));var moment=require(_0x8246('0x3'));var BPromise=require(_0x8246('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8246('0x5'));var rimraf=require(_0x8246('0x6'));var config=require(_0x8246('0x7'));var attributes=require(_0x8246('0x8'));module[_0x8246('0x9')]=function(_0x737d2f,_0x4b830d){return _0x737d2f['define'](_0x8246('0xa'),attributes,{'tableName':_0x8246('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 90dbb89..0634619 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 _0x8db8=['request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info'];(function(_0x162def,_0x4fdb79){var _0x2e19f1=function(_0x446f98){while(--_0x446f98){_0x162def['push'](_0x162def['shift']());}};_0x2e19f1(++_0x4fdb79);}(_0x8db8,0xb1));var _0x88db=function(_0x4501fe,_0x5727e9){_0x4501fe=_0x4501fe-0x0;var _0x170487=_0x8db8[_0x4501fe];return _0x170487;};'use strict';var _=require(_0x88db('0x0'));var util=require(_0x88db('0x1'));var moment=require(_0x88db('0x2'));var BPromise=require(_0x88db('0x3'));var rs=require(_0x88db('0x4'));var fs=require('fs');var Redis=require(_0x88db('0x5'));var db=require(_0x88db('0x6'))['db'];var utils=require(_0x88db('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x88db('0x8'));var client=jayson['client'][_0x88db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a7794,_0x2d31a6,_0x23388b){return new BPromise(function(_0x2eafe0,_0x318d5b){return client['request'](_0x3a7794,_0x23388b)[_0x88db('0xa')](function(_0x3175c8){logger[_0x88db('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d31a6,_0x88db('0xc'));logger['debug'](_0x88db('0xd'),_0x2d31a6,_0x88db('0xc'),JSON[_0x88db('0xe')](_0x3175c8));if(_0x3175c8[_0x88db('0xf')]){if(_0x3175c8['error'][_0x88db('0x10')]===0x1f4){logger[_0x88db('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d31a6,_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);return _0x318d5b(_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);}logger[_0x88db('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d31a6,_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);return _0x2eafe0(_0x3175c8[_0x88db('0xf')][_0x88db('0x11')]);}else{logger[_0x88db('0xb')](_0x88db('0x12'),_0x2d31a6,_0x88db('0xc'));_0x2eafe0(_0x3175c8[_0x88db('0x13')][_0x88db('0x11')]);}})[_0x88db('0x14')](function(_0x127e20){logger[_0x88db('0xf')](_0x88db('0x12'),_0x2d31a6,_0x127e20);_0x318d5b(_0x127e20);});});}
\ No newline at end of file
+var _0x8f5a=['AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','info'];(function(_0x493b42,_0x3161e5){var _0x1ab527=function(_0x54ec08){while(--_0x54ec08){_0x493b42['push'](_0x493b42['shift']());}};_0x1ab527(++_0x3161e5);}(_0x8f5a,0x138));var _0xa8f5=function(_0x4760a0,_0x1d1ee2){_0x4760a0=_0x4760a0-0x0;var _0x5d7ebc=_0x8f5a[_0x4760a0];return _0x5d7ebc;};'use strict';var _=require(_0xa8f5('0x0'));var util=require(_0xa8f5('0x1'));var moment=require(_0xa8f5('0x2'));var BPromise=require(_0xa8f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8f5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8f5('0x6'));var jayson=require(_0xa8f5('0x7'));var client=jayson[_0xa8f5('0x8')][_0xa8f5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f8cd4,_0x22d627,_0xc4165b){return new BPromise(function(_0xaee3a1,_0x2adf97){return client['request'](_0x2f8cd4,_0xc4165b)['then'](function(_0x450fbb){logger[_0xa8f5('0xa')](_0xa8f5('0xb'),_0x22d627,'request\x20sent');logger['debug'](_0xa8f5('0xc'),_0x22d627,_0xa8f5('0xd'),JSON[_0xa8f5('0xe')](_0x450fbb));if(_0x450fbb[_0xa8f5('0xf')]){if(_0x450fbb['error'][_0xa8f5('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x22d627,_0x450fbb[_0xa8f5('0xf')][_0xa8f5('0x11')]);return _0x2adf97(_0x450fbb[_0xa8f5('0xf')][_0xa8f5('0x11')]);}logger['error'](_0xa8f5('0xb'),_0x22d627,_0x450fbb[_0xa8f5('0xf')][_0xa8f5('0x11')]);return _0xaee3a1(_0x450fbb[_0xa8f5('0xf')][_0xa8f5('0x11')]);}else{logger[_0xa8f5('0xa')](_0xa8f5('0xb'),_0x22d627,_0xa8f5('0xd'));_0xaee3a1(_0x450fbb['result'][_0xa8f5('0x11')]);}})[_0xa8f5('0x12')](function(_0x58fec7){logger[_0xa8f5('0xf')](_0xa8f5('0xb'),_0x22d627,_0x58fec7);_0x2adf97(_0x58fec7);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index deffc97..d22d806 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 _0xe321=['preview','run','/:id/query','query','post','put','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x4a6702,_0x405e77){var _0x3c5e45=function(_0x2e841f){while(--_0x2e841f){_0x4a6702['push'](_0x4a6702['shift']());}};_0x3c5e45(++_0x405e77);}(_0xe321,0x194));var _0x1e32=function(_0x2e67a4,_0x281041){_0x2e67a4=_0x2e67a4-0x0;var _0x4cb738=_0xe321[_0x2e67a4];return _0x4cb738;};'use strict';var multer=require('multer');var util=require(_0x1e32('0x0'));var path=require(_0x1e32('0x1'));var timeout=require(_0x1e32('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e32('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1e32('0x4'));var controller=require(_0x1e32('0x5'));router[_0x1e32('0x6')]('/',auth[_0x1e32('0x7')](),controller[_0x1e32('0x8')]);router[_0x1e32('0x6')](_0x1e32('0x9'),auth[_0x1e32('0x7')](),controller['show']);router[_0x1e32('0x6')]('/:id/preview',auth[_0x1e32('0x7')](),controller[_0x1e32('0xa')]);router['get']('/:id/run',auth[_0x1e32('0x7')](),controller[_0x1e32('0xb')]);router['get'](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0xd')]);router[_0x1e32('0xe')]('/',auth[_0x1e32('0x7')](),controller['create']);router[_0x1e32('0xf')]('/:id',auth[_0x1e32('0x7')](),controller['update']);router['delete'](_0x1e32('0x9'),auth[_0x1e32('0x7')](),controller[_0x1e32('0x10')]);module[_0x1e32('0x11')]=router;
\ No newline at end of file
+var _0xc00b=['put','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','run','post','create'];(function(_0x374fab,_0x32970f){var _0x3dc5c9=function(_0x5d1160){while(--_0x5d1160){_0x374fab['push'](_0x374fab['shift']());}};_0x3dc5c9(++_0x32970f);}(_0xc00b,0x1e5));var _0xbc00=function(_0x12a020,_0x85b476){_0x12a020=_0x12a020-0x0;var _0x63cddd=_0xc00b[_0x12a020];return _0x63cddd;};'use strict';var multer=require(_0xbc00('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc00('0x1'));var router=express['Router']();var fs_extra=require(_0xbc00('0x2'));var auth=require(_0xbc00('0x3'));var interaction=require(_0xbc00('0x4'));var config=require(_0xbc00('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0xbc00('0x6')]('/',auth['isAuthenticated'](),controller[_0xbc00('0x7')]);router['get'](_0xbc00('0x8'),auth[_0xbc00('0x9')](),controller[_0xbc00('0xa')]);router[_0xbc00('0x6')](_0xbc00('0xb'),auth[_0xbc00('0x9')](),controller['preview']);router[_0xbc00('0x6')]('/:id/run',auth[_0xbc00('0x9')](),controller[_0xbc00('0xc')]);router[_0xbc00('0x6')]('/:id/query',auth[_0xbc00('0x9')](),controller['query']);router[_0xbc00('0xd')]('/',auth['isAuthenticated'](),controller[_0xbc00('0xe')]);router[_0xbc00('0xf')](_0xbc00('0x8'),auth['isAuthenticated'](),controller[_0xbc00('0x10')]);router[_0xbc00('0x11')](_0xbc00('0x8'),auth['isAuthenticated'](),controller[_0xbc00('0x12')]);module[_0xbc00('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ad197ae..e22745e 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 _0x04d1=['Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x04d1,0x1d9));var _0x104d=function(_0x33fb6c,_0xdf875b){_0x33fb6c=_0x33fb6c-0x0;var _0x291370=_0x04d1[_0x33fb6c];return _0x291370;};'use strict';var Sequelize=require(_0x104d('0x0'));var moment=require('moment');module[_0x104d('0x1')]={'name':{'type':Sequelize[_0x104d('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x104d('0x3')](_0x104d('0x4'),_0x104d('0x5'),_0x104d('0x6')),'allowNull':![],'defaultValue':_0x104d('0x4')},'savename':{'type':Sequelize[_0x104d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x104d('0x7')]},'status':{'type':Sequelize[_0x104d('0x2')],'defaultValue':_0x104d('0x8')},'type':{'type':Sequelize[_0x104d('0x3')]('manual',_0x104d('0x9')),'allowNull':![],'defaultValue':_0x104d('0xa')},'reportId':{'type':Sequelize[_0x104d('0xb')](0xb)[_0x104d('0xc')]},'reportType':{'type':Sequelize[_0x104d('0x2')]}};
\ No newline at end of file
+var _0xd3c4=['pdf','xlsx','csv','DATE','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x5e0ad7,_0x527a48){var _0x1da054=function(_0x2d040c){while(--_0x2d040c){_0x5e0ad7['push'](_0x5e0ad7['shift']());}};_0x1da054(++_0x527a48);}(_0xd3c4,0x1c3));var _0x4d3c=function(_0x1f7a55,_0x352d22){_0x1f7a55=_0x1f7a55-0x0;var _0x2a291b=_0xd3c4[_0x1f7a55];return _0x2a291b;};'use strict';var Sequelize=require(_0x4d3c('0x0'));var moment=require(_0x4d3c('0x1'));module[_0x4d3c('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x4d3c('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x4d3c('0x4'),_0x4d3c('0x5')),'allowNull':![],'defaultValue':_0x4d3c('0x6')},'savename':{'type':Sequelize[_0x4d3c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x4d3c('0x7')]},'status':{'type':Sequelize[_0x4d3c('0x3')],'defaultValue':_0x4d3c('0x8')},'type':{'type':Sequelize[_0x4d3c('0x9')](_0x4d3c('0xa'),_0x4d3c('0xb')),'allowNull':![],'defaultValue':_0x4d3c('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x4d3c('0xc')]},'reportType':{'type':Sequelize[_0x4d3c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index fdbfc6e..c2a8c66 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 _0xbc07=['status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','name','send','AnalyticExtractedReport','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','savename','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','end'];(function(_0x11cd67,_0x5402e2){var _0x4f1f3b=function(_0x308392){while(--_0x308392){_0x11cd67['push'](_0x11cd67['shift']());}};_0x4f1f3b(++_0x5402e2);}(_0xbc07,0xf3));var _0x7bc0=function(_0x17f12e,_0x3621e6){_0x17f12e=_0x17f12e-0x0;var _0x286ca2=_0xbc07[_0x17f12e];return _0x286ca2;};'use strict';var emlformat=require(_0x7bc0('0x0'));var rimraf=require(_0x7bc0('0x1'));var zipdir=require(_0x7bc0('0x2'));var jsonpatch=require(_0x7bc0('0x3'));var rp=require(_0x7bc0('0x4'));var moment=require(_0x7bc0('0x5'));var BPromise=require(_0x7bc0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7bc0('0x7'));var csv=require(_0x7bc0('0x8'));var ejs=require(_0x7bc0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bc0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bc0('0xb'));var deskjs=require(_0x7bc0('0xc'));var toCsv=require(_0x7bc0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7bc0('0xd'));var authService=require(_0x7bc0('0xe'));var qs=require(_0x7bc0('0xf'));var as=require(_0x7bc0('0x10'));var hardwareService=require(_0x7bc0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7bc0('0x12'));var config=require(_0x7bc0('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48cd37,_0x170a84){_0x170a84=_0x170a84||0xcc;return function(_0x34ce1e){if(_0x34ce1e){return _0x48cd37['sendStatus'](_0x170a84);}return _0x48cd37['status'](_0x170a84)[_0x7bc0('0x14')]();};}function respondWithResult(_0x554189,_0x1bba64){_0x1bba64=_0x1bba64||0xc8;return function(_0x30d2f3){if(_0x30d2f3){return _0x554189[_0x7bc0('0x15')](_0x1bba64)['json'](_0x30d2f3);}};}function respondWithFilteredResult(_0x24e610,_0x4107f1){return function(_0xcddba7){if(_0xcddba7){var _0x1c512e=typeof _0x4107f1[_0x7bc0('0x16')]===_0x7bc0('0x17')&&typeof _0x4107f1[_0x7bc0('0x18')]===_0x7bc0('0x17');var _0x2c6752=_0xcddba7[_0x7bc0('0x19')];var _0x150245=_0x1c512e?0x0:_0x4107f1[_0x7bc0('0x16')];var _0x9271c4=_0x1c512e?_0xcddba7[_0x7bc0('0x19')]:_0x4107f1['offset']+_0x4107f1['limit'];var _0x5275d8;if(_0x9271c4>=_0x2c6752){_0x9271c4=_0x2c6752;_0x5275d8=0xc8;}else{_0x5275d8=0xce;}_0x24e610[_0x7bc0('0x15')](_0x5275d8);return _0x24e610[_0x7bc0('0x1a')]('Content-Range',_0x150245+'-'+_0x9271c4+'/'+_0x2c6752)[_0x7bc0('0x1b')](_0xcddba7);}return null;};}function patchUpdates(_0x3179a8){return function(_0x1ba038){try{jsonpatch[_0x7bc0('0x1c')](_0x1ba038,_0x3179a8,!![]);}catch(_0x5d2100){return BPromise['reject'](_0x5d2100);}return _0x1ba038[_0x7bc0('0x1d')]();};}function saveUpdates(_0x48c9a8,_0x16c784){return function(_0x3d54a9){if(_0x3d54a9){return _0x3d54a9[_0x7bc0('0x1e')](_0x48c9a8)[_0x7bc0('0x1f')](function(_0x3a47ba){return _0x3a47ba;});}return null;};}function removeEntity(_0x45a66e,_0x2f3f62){return function(_0x110094){if(_0x110094){return _0x110094[_0x7bc0('0x20')]()[_0x7bc0('0x1f')](function(){var _0x1bc121=_0x110094[_0x7bc0('0x21')]({'plain':!![]});var _0x1ab057=_0x7bc0('0x22');return db[_0x7bc0('0x23')][_0x7bc0('0x20')]({'where':{'type':_0x1ab057,'resourceId':_0x1bc121['id']}})[_0x7bc0('0x1f')](function(){return _0x110094;});})[_0x7bc0('0x1f')](function(){_0x45a66e['status'](0xcc)[_0x7bc0('0x14')]();});}};}function handleEntityNotFound(_0x475b52,_0x1e884c){return function(_0x4216cc){if(!_0x4216cc){_0x475b52[_0x7bc0('0x24')](0x194);}return _0x4216cc;};}function handleError(_0x307895,_0x5d090c){_0x5d090c=_0x5d090c||0x1f4;return function(_0x46b941){logger[_0x7bc0('0x25')](_0x46b941['stack']);if(_0x46b941[_0x7bc0('0x26')]){delete _0x46b941['name'];}_0x307895[_0x7bc0('0x15')](_0x5d090c)[_0x7bc0('0x27')](_0x46b941);};}exports['index']=function(_0x1ba845,_0x3ba533){var _0x2f841f={},_0x63acc3={},_0x1b3bd2={'count':0x0,'rows':[]};var _0x4c9817=_['map'](db[_0x7bc0('0x28')]['rawAttributes'],function(_0x393cc6){return{'name':_0x393cc6['fieldName'],'type':_0x393cc6[_0x7bc0('0x29')][_0x7bc0('0x2a')]};});_0x63acc3[_0x7bc0('0x2b')]=_['map'](_0x4c9817,_0x7bc0('0x26'));_0x63acc3[_0x7bc0('0x2c')]=_['keys'](_0x1ba845[_0x7bc0('0x2c')]);_0x63acc3[_0x7bc0('0x2d')]=_[_0x7bc0('0x2e')](_0x63acc3[_0x7bc0('0x2b')],_0x63acc3[_0x7bc0('0x2c')]);_0x2f841f['attributes']=_['intersection'](_0x63acc3['model'],qs[_0x7bc0('0x2f')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x2f')]));_0x2f841f['attributes']=_0x2f841f[_0x7bc0('0x30')][_0x7bc0('0x31')]?_0x2f841f['attributes']:_0x63acc3[_0x7bc0('0x2b')];if(!_0x1ba845[_0x7bc0('0x2c')]['hasOwnProperty'](_0x7bc0('0x32'))){_0x2f841f[_0x7bc0('0x18')]=qs[_0x7bc0('0x18')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x18')]);_0x2f841f[_0x7bc0('0x16')]=qs[_0x7bc0('0x16')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x16')]);}_0x2f841f[_0x7bc0('0x33')]=qs[_0x7bc0('0x34')](_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x34')]);_0x2f841f[_0x7bc0('0x35')]=qs[_0x7bc0('0x2d')](_[_0x7bc0('0x36')](_0x1ba845[_0x7bc0('0x2c')],_0x63acc3[_0x7bc0('0x2d')]),_0x4c9817);if(_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x37')]){_0x2f841f[_0x7bc0('0x35')]=_[_0x7bc0('0x38')](_0x2f841f[_0x7bc0('0x35')],{'$or':_[_0x7bc0('0x39')](_0x4c9817,function(_0x549973){if(_0x549973['type']!==_0x7bc0('0x3a')){var _0x3ded29={};_0x3ded29[_0x549973[_0x7bc0('0x26')]]={'$like':'%'+_0x1ba845[_0x7bc0('0x2c')][_0x7bc0('0x37')]+'%'};return _0x3ded29;}})});}_0x2f841f=_['merge']({},_0x2f841f,_0x1ba845[_0x7bc0('0x3b')]);var _0x34ad15={'where':_0x2f841f[_0x7bc0('0x35')]};return db[_0x7bc0('0x28')][_0x7bc0('0x19')](_0x34ad15)[_0x7bc0('0x1f')](function(_0x497dd7){_0x1b3bd2[_0x7bc0('0x19')]=_0x497dd7;if(_0x1ba845['query'][_0x7bc0('0x3c')]){_0x2f841f[_0x7bc0('0x3d')]=[{'all':!![]}];}return db[_0x7bc0('0x28')]['findAll'](_0x2f841f);})[_0x7bc0('0x1f')](function(_0x5ebd5e){_0x1b3bd2[_0x7bc0('0x3e')]=_0x5ebd5e;return _0x1b3bd2;})['then'](respondWithFilteredResult(_0x3ba533,_0x2f841f))['catch'](handleError(_0x3ba533,null));};exports['show']=function(_0x12ba49,_0x572ae9){var _0x2ce726={'raw':!![],'where':{'id':_0x12ba49['params']['id']}},_0x643185={};_0x643185['model']=_[_0x7bc0('0x3f')](db[_0x7bc0('0x28')][_0x7bc0('0x40')]);_0x643185[_0x7bc0('0x2c')]=_[_0x7bc0('0x3f')](_0x12ba49['query']);_0x643185[_0x7bc0('0x2d')]=_[_0x7bc0('0x2e')](_0x643185[_0x7bc0('0x2b')],_0x643185[_0x7bc0('0x2c')]);_0x2ce726[_0x7bc0('0x30')]=_['intersection'](_0x643185[_0x7bc0('0x2b')],qs[_0x7bc0('0x2f')](_0x12ba49[_0x7bc0('0x2c')][_0x7bc0('0x2f')]));_0x2ce726[_0x7bc0('0x30')]=_0x2ce726[_0x7bc0('0x30')][_0x7bc0('0x31')]?_0x2ce726[_0x7bc0('0x30')]:_0x643185[_0x7bc0('0x2b')];if(_0x12ba49[_0x7bc0('0x2c')][_0x7bc0('0x3c')]){_0x2ce726['include']=[{'all':!![]}];}_0x2ce726=_[_0x7bc0('0x38')]({},_0x2ce726,_0x12ba49[_0x7bc0('0x3b')]);return db[_0x7bc0('0x28')][_0x7bc0('0x41')](_0x2ce726)[_0x7bc0('0x1f')](handleEntityNotFound(_0x572ae9,null))[_0x7bc0('0x1f')](respondWithResult(_0x572ae9,null))[_0x7bc0('0x42')](handleError(_0x572ae9,null));};exports[_0x7bc0('0x43')]=function(_0x551174,_0x4d20e2){return db[_0x7bc0('0x28')][_0x7bc0('0x43')](_0x551174[_0x7bc0('0x44')],{})['then'](function(_0x4e563e){var _0x4b8f90=_0x551174[_0x7bc0('0x45')][_0x7bc0('0x21')]({'plain':!![]});if(!_0x4b8f90)throw new Error(_0x7bc0('0x46'));if(_0x4b8f90['role']===_0x7bc0('0x45')){var _0x281cc8=_0x4e563e['get']({'plain':!![]});var _0x18137e=_0x7bc0('0x22');return db[_0x7bc0('0x47')]['find']({'where':{'name':_0x18137e,'userProfileId':_0x4b8f90[_0x7bc0('0x48')]},'raw':!![]})[_0x7bc0('0x1f')](function(_0xfa168f){if(_0xfa168f&&_0xfa168f[_0x7bc0('0x49')]===0x0){return db[_0x7bc0('0x23')][_0x7bc0('0x43')]({'name':_0x281cc8['name'],'resourceId':_0x281cc8['id'],'type':_0xfa168f[_0x7bc0('0x26')],'sectionId':_0xfa168f['id']},{})[_0x7bc0('0x1f')](function(){return _0x4e563e;});}else{return _0x4e563e;}})[_0x7bc0('0x42')](function(_0x5cddc8){logger[_0x7bc0('0x25')](_0x7bc0('0x4a'),_0x5cddc8);throw _0x5cddc8;});}return _0x4e563e;})[_0x7bc0('0x1f')](respondWithResult(_0x4d20e2,0xc9))[_0x7bc0('0x42')](handleError(_0x4d20e2,null));};exports[_0x7bc0('0x1e')]=function(_0xe78c1e,_0x5e9042){if(_0xe78c1e[_0x7bc0('0x44')]['id']){delete _0xe78c1e[_0x7bc0('0x44')]['id'];}return db[_0x7bc0('0x28')][_0x7bc0('0x41')]({'where':{'id':_0xe78c1e[_0x7bc0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5e9042,null))[_0x7bc0('0x1f')](saveUpdates(_0xe78c1e[_0x7bc0('0x44')],null))['then'](respondWithResult(_0x5e9042,null))[_0x7bc0('0x42')](handleError(_0x5e9042,null));};exports[_0x7bc0('0x20')]=function(_0x315774,_0x3bbda3){return db[_0x7bc0('0x28')][_0x7bc0('0x41')]({'where':{'id':_0x315774[_0x7bc0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3bbda3,null))['then'](removeEntity(_0x3bbda3,null))['catch'](handleError(_0x3bbda3,null));};exports[_0x7bc0('0x4c')]=function(_0x551481,_0x4fb3da,_0x33b42e){return db[_0x7bc0('0x28')][_0x7bc0('0x41')]({'where':{'id':_0x551481['params']['id']},'attributes':['name',_0x7bc0('0x4d'),'savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x4fb3da,null))[_0x7bc0('0x1f')](function(_0x1db9fa){if(_0x1db9fa){if(!fs[_0x7bc0('0x4e')](path[_0x7bc0('0x4f')](config[_0x7bc0('0x50')],_0x7bc0('0x51'),_0x1db9fa['savename']))){throw new db[(_0x7bc0('0x52'))][(_0x7bc0('0x53'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x551481[_0x7bc0('0x2c')][_0x7bc0('0x54')]){return _0x4fb3da[_0x7bc0('0x24')](0xc8);}return _0x4fb3da[_0x7bc0('0x4c')](path[_0x7bc0('0x4f')](config['root'],'server/files/reports',_0x1db9fa[_0x7bc0('0x55')]),util['format'](_0x7bc0('0x56'),_0x1db9fa[_0x7bc0('0x4d')]||_0x1db9fa[_0x7bc0('0x26')],_0x1db9fa['output'][_0x7bc0('0x57')]()));}})[_0x7bc0('0x42')](handleError(_0x4fb3da,null));};
\ No newline at end of file
+var _0xd653=['keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','savename','output','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','server/files/reports','format','%s.%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','key','map'];(function(_0x270f63,_0x4d27f6){var _0x2d7cd8=function(_0x377acf){while(--_0x377acf){_0x270f63['push'](_0x270f63['shift']());}};_0x2d7cd8(++_0x4d27f6);}(_0xd653,0x163));var _0x3d65=function(_0x350587,_0x11849d){_0x350587=_0x350587-0x0;var _0x329a56=_0xd653[_0x350587];return _0x329a56;};'use strict';var emlformat=require(_0x3d65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d65('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d65('0x2'));var moment=require(_0x3d65('0x3'));var BPromise=require(_0x3d65('0x4'));var Mustache=require(_0x3d65('0x5'));var util=require(_0x3d65('0x6'));var path=require('path');var sox=require(_0x3d65('0x7'));var csv=require('to-csv');var ejs=require(_0x3d65('0x8'));var fs=require('fs');var fs_extra=require(_0x3d65('0x9'));var _=require('lodash');var squel=require(_0x3d65('0xa'));var crypto=require(_0x3d65('0xb'));var jsforce=require(_0x3d65('0xc'));var deskjs=require(_0x3d65('0xd'));var toCsv=require(_0x3d65('0xe'));var querystring=require(_0x3d65('0xf'));var Papa=require(_0x3d65('0x10'));var Redis=require(_0x3d65('0x11'));var authService=require(_0x3d65('0x12'));var qs=require(_0x3d65('0x13'));var as=require(_0x3d65('0x14'));var hardwareService=require(_0x3d65('0x15'));var logger=require(_0x3d65('0x16'))(_0x3d65('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3d65('0x18'));var db=require(_0x3d65('0x19'))['db'];function respondWithStatusCode(_0x12e4fd,_0x49cd75){_0x49cd75=_0x49cd75||0xcc;return function(_0x29663c){if(_0x29663c){return _0x12e4fd[_0x3d65('0x1a')](_0x49cd75);}return _0x12e4fd[_0x3d65('0x1b')](_0x49cd75)[_0x3d65('0x1c')]();};}function respondWithResult(_0x4e53f0,_0x21f8b5){_0x21f8b5=_0x21f8b5||0xc8;return function(_0x2fc2b3){if(_0x2fc2b3){return _0x4e53f0[_0x3d65('0x1b')](_0x21f8b5)[_0x3d65('0x1d')](_0x2fc2b3);}};}function respondWithFilteredResult(_0x99e6e3,_0x15bcec){return function(_0x387955){if(_0x387955){var _0x103cab=typeof _0x15bcec[_0x3d65('0x1e')]===_0x3d65('0x1f')&&typeof _0x15bcec[_0x3d65('0x20')]==='undefined';var _0x83ef15=_0x387955[_0x3d65('0x21')];var _0x54c136=_0x103cab?0x0:_0x15bcec[_0x3d65('0x1e')];var _0x2049a7=_0x103cab?_0x387955['count']:_0x15bcec[_0x3d65('0x1e')]+_0x15bcec[_0x3d65('0x20')];var _0x33d95f;if(_0x2049a7>=_0x83ef15){_0x2049a7=_0x83ef15;_0x33d95f=0xc8;}else{_0x33d95f=0xce;}_0x99e6e3[_0x3d65('0x1b')](_0x33d95f);return _0x99e6e3[_0x3d65('0x22')](_0x3d65('0x23'),_0x54c136+'-'+_0x2049a7+'/'+_0x83ef15)[_0x3d65('0x1d')](_0x387955);}return null;};}function patchUpdates(_0x4ed88d){return function(_0x5e510d){try{jsonpatch[_0x3d65('0x24')](_0x5e510d,_0x4ed88d,!![]);}catch(_0x4c0061){return BPromise['reject'](_0x4c0061);}return _0x5e510d[_0x3d65('0x25')]();};}function saveUpdates(_0x22d480,_0x4e3b36){return function(_0x33146b){if(_0x33146b){return _0x33146b['update'](_0x22d480)[_0x3d65('0x26')](function(_0x44c07d){return _0x44c07d;});}return null;};}function removeEntity(_0x386dbf,_0x5b10ce){return function(_0x50b441){if(_0x50b441){return _0x50b441[_0x3d65('0x27')]()[_0x3d65('0x26')](function(){var _0x88cf70=_0x50b441[_0x3d65('0x28')]({'plain':!![]});var _0x16c87b=_0x3d65('0x29');return db[_0x3d65('0x2a')]['destroy']({'where':{'type':_0x16c87b,'resourceId':_0x88cf70['id']}})[_0x3d65('0x26')](function(){return _0x50b441;});})['then'](function(){_0x386dbf['status'](0xcc)[_0x3d65('0x1c')]();});}};}function handleEntityNotFound(_0x1cf784,_0x4e05d0){return function(_0x66813e){if(!_0x66813e){_0x1cf784['sendStatus'](0x194);}return _0x66813e;};}function handleError(_0x49108d,_0x42816c){_0x42816c=_0x42816c||0x1f4;return function(_0x3939c2){logger[_0x3d65('0x2b')](_0x3939c2[_0x3d65('0x2c')]);if(_0x3939c2[_0x3d65('0x2d')]){delete _0x3939c2[_0x3d65('0x2d')];}_0x49108d[_0x3d65('0x1b')](_0x42816c)[_0x3d65('0x2e')](_0x3939c2);};}exports[_0x3d65('0x2f')]=function(_0x51afcf,_0xcbcd12){var _0x2330dc={},_0x4963be={},_0x5e810b={'count':0x0,'rows':[]};var _0x1929ac=_['map'](db[_0x3d65('0x30')][_0x3d65('0x31')],function(_0x28deb2){return{'name':_0x28deb2[_0x3d65('0x32')],'type':_0x28deb2['type'][_0x3d65('0x33')]};});_0x4963be['model']=_[_0x3d65('0x34')](_0x1929ac,'name');_0x4963be['query']=_[_0x3d65('0x35')](_0x51afcf[_0x3d65('0x36')]);_0x4963be[_0x3d65('0x37')]=_[_0x3d65('0x38')](_0x4963be[_0x3d65('0x39')],_0x4963be[_0x3d65('0x36')]);_0x2330dc['attributes']=_[_0x3d65('0x38')](_0x4963be[_0x3d65('0x39')],qs[_0x3d65('0x3a')](_0x51afcf[_0x3d65('0x36')][_0x3d65('0x3a')]));_0x2330dc[_0x3d65('0x3b')]=_0x2330dc[_0x3d65('0x3b')][_0x3d65('0x3c')]?_0x2330dc[_0x3d65('0x3b')]:_0x4963be[_0x3d65('0x39')];if(!_0x51afcf['query'][_0x3d65('0x3d')](_0x3d65('0x3e'))){_0x2330dc[_0x3d65('0x20')]=qs[_0x3d65('0x20')](_0x51afcf[_0x3d65('0x36')][_0x3d65('0x20')]);_0x2330dc[_0x3d65('0x1e')]=qs[_0x3d65('0x1e')](_0x51afcf['query'][_0x3d65('0x1e')]);}_0x2330dc[_0x3d65('0x3f')]=qs[_0x3d65('0x40')](_0x51afcf[_0x3d65('0x36')][_0x3d65('0x40')]);_0x2330dc[_0x3d65('0x41')]=qs[_0x3d65('0x37')](_[_0x3d65('0x42')](_0x51afcf[_0x3d65('0x36')],_0x4963be[_0x3d65('0x37')]),_0x1929ac);if(_0x51afcf[_0x3d65('0x36')][_0x3d65('0x43')]){_0x2330dc[_0x3d65('0x41')]=_[_0x3d65('0x44')](_0x2330dc[_0x3d65('0x41')],{'$or':_['map'](_0x1929ac,function(_0x636ecc){if(_0x636ecc[_0x3d65('0x45')]!==_0x3d65('0x46')){var _0x4e8997={};_0x4e8997[_0x636ecc['name']]={'$like':'%'+_0x51afcf[_0x3d65('0x36')][_0x3d65('0x43')]+'%'};return _0x4e8997;}})});}_0x2330dc=_[_0x3d65('0x44')]({},_0x2330dc,_0x51afcf[_0x3d65('0x47')]);var _0x371663={'where':_0x2330dc[_0x3d65('0x41')]};return db[_0x3d65('0x30')][_0x3d65('0x21')](_0x371663)['then'](function(_0x201e08){_0x5e810b[_0x3d65('0x21')]=_0x201e08;if(_0x51afcf['query']['includeAll']){_0x2330dc[_0x3d65('0x48')]=[{'all':!![]}];}return db[_0x3d65('0x30')]['findAll'](_0x2330dc);})[_0x3d65('0x26')](function(_0x459957){_0x5e810b[_0x3d65('0x49')]=_0x459957;return _0x5e810b;})[_0x3d65('0x26')](respondWithFilteredResult(_0xcbcd12,_0x2330dc))[_0x3d65('0x4a')](handleError(_0xcbcd12,null));};exports[_0x3d65('0x4b')]=function(_0x55cda1,_0x3e9786){var _0x260cca={'raw':!![],'where':{'id':_0x55cda1[_0x3d65('0x4c')]['id']}},_0x3ce11e={};_0x3ce11e[_0x3d65('0x39')]=_['keys'](db[_0x3d65('0x30')][_0x3d65('0x31')]);_0x3ce11e[_0x3d65('0x36')]=_[_0x3d65('0x35')](_0x55cda1[_0x3d65('0x36')]);_0x3ce11e[_0x3d65('0x37')]=_[_0x3d65('0x38')](_0x3ce11e[_0x3d65('0x39')],_0x3ce11e[_0x3d65('0x36')]);_0x260cca[_0x3d65('0x3b')]=_[_0x3d65('0x38')](_0x3ce11e[_0x3d65('0x39')],qs[_0x3d65('0x3a')](_0x55cda1['query'][_0x3d65('0x3a')]));_0x260cca['attributes']=_0x260cca[_0x3d65('0x3b')][_0x3d65('0x3c')]?_0x260cca[_0x3d65('0x3b')]:_0x3ce11e[_0x3d65('0x39')];if(_0x55cda1[_0x3d65('0x36')][_0x3d65('0x4d')]){_0x260cca['include']=[{'all':!![]}];}_0x260cca=_[_0x3d65('0x44')]({},_0x260cca,_0x55cda1[_0x3d65('0x47')]);return db[_0x3d65('0x30')][_0x3d65('0x4e')](_0x260cca)['then'](handleEntityNotFound(_0x3e9786,null))[_0x3d65('0x26')](respondWithResult(_0x3e9786,null))[_0x3d65('0x4a')](handleError(_0x3e9786,null));};exports[_0x3d65('0x4f')]=function(_0x34041,_0x415f11){return db[_0x3d65('0x30')][_0x3d65('0x4f')](_0x34041[_0x3d65('0x50')],{})['then'](function(_0x5646f2){var _0x50c762=_0x34041[_0x3d65('0x51')][_0x3d65('0x28')]({'plain':!![]});if(!_0x50c762)throw new Error(_0x3d65('0x52'));if(_0x50c762[_0x3d65('0x53')]==='user'){var _0x367d12=_0x5646f2[_0x3d65('0x28')]({'plain':!![]});var _0x3c35ce=_0x3d65('0x29');return db[_0x3d65('0x54')][_0x3d65('0x4e')]({'where':{'name':_0x3c35ce,'userProfileId':_0x50c762[_0x3d65('0x55')]},'raw':!![]})['then'](function(_0x494718){if(_0x494718&&_0x494718[_0x3d65('0x56')]===0x0){return db['UserProfileResource'][_0x3d65('0x4f')]({'name':_0x367d12['name'],'resourceId':_0x367d12['id'],'type':_0x494718[_0x3d65('0x2d')],'sectionId':_0x494718['id']},{})[_0x3d65('0x26')](function(){return _0x5646f2;});}else{return _0x5646f2;}})[_0x3d65('0x4a')](function(_0x5d60eb){logger[_0x3d65('0x2b')](_0x3d65('0x57'),_0x5d60eb);throw _0x5d60eb;});}return _0x5646f2;})[_0x3d65('0x26')](respondWithResult(_0x415f11,0xc9))[_0x3d65('0x4a')](handleError(_0x415f11,null));};exports[_0x3d65('0x58')]=function(_0x40613c,_0x30da0e){if(_0x40613c[_0x3d65('0x50')]['id']){delete _0x40613c[_0x3d65('0x50')]['id'];}return db[_0x3d65('0x30')][_0x3d65('0x4e')]({'where':{'id':_0x40613c[_0x3d65('0x4c')]['id']}})[_0x3d65('0x26')](handleEntityNotFound(_0x30da0e,null))[_0x3d65('0x26')](saveUpdates(_0x40613c['body'],null))[_0x3d65('0x26')](respondWithResult(_0x30da0e,null))[_0x3d65('0x4a')](handleError(_0x30da0e,null));};exports['destroy']=function(_0xf3488,_0x58c76e){return db[_0x3d65('0x30')][_0x3d65('0x4e')]({'where':{'id':_0xf3488[_0x3d65('0x4c')]['id']}})[_0x3d65('0x26')](handleEntityNotFound(_0x58c76e,null))[_0x3d65('0x26')](removeEntity(_0x58c76e,null))[_0x3d65('0x4a')](handleError(_0x58c76e,null));};exports['download']=function(_0x41cb21,_0x53793d,_0x2feed2){return db[_0x3d65('0x30')]['find']({'where':{'id':_0x41cb21['params']['id']},'attributes':['name',_0x3d65('0x59'),_0x3d65('0x5a'),_0x3d65('0x5b')],'raw':!![]})[_0x3d65('0x26')](handleEntityNotFound(_0x53793d,null))['then'](function(_0x57b0d0){if(_0x57b0d0){if(!fs['existsSync'](path[_0x3d65('0x5c')](config['root'],'server/files/reports',_0x57b0d0['savename']))){throw new db[(_0x3d65('0x5d'))][(_0x3d65('0x5e'))](_0x3d65('0x5f'));}if(_0x41cb21[_0x3d65('0x36')][_0x3d65('0x60')]){return _0x53793d[_0x3d65('0x1a')](0xc8);}return _0x53793d[_0x3d65('0x61')](path['join'](config[_0x3d65('0x62')],_0x3d65('0x63'),_0x57b0d0[_0x3d65('0x5a')]),util[_0x3d65('0x64')](_0x3d65('0x65'),_0x57b0d0['basename']||_0x57b0d0[_0x3d65('0x2d')],_0x57b0d0['output']['toLowerCase']()));}})[_0x3d65('0x4a')](handleError(_0x53793d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index ce74c02..63ba31d 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 _0x1955=['define','AnalyticExtractedReport','lodash','util','../../config/logger','api','bluebird','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x277d73,_0x3f7311){var _0x5b0a43=function(_0x54b1b1){while(--_0x54b1b1){_0x277d73['push'](_0x277d73['shift']());}};_0x5b0a43(++_0x3f7311);}(_0x1955,0xca));var _0x5195=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1955[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x5195('0x0'));var util=require(_0x5195('0x1'));var logger=require(_0x5195('0x2'))(_0x5195('0x3'));var moment=require('moment');var BPromise=require(_0x5195('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5195('0x5'));var config=require('../../config/environment');var attributes=require(_0x5195('0x6'));module[_0x5195('0x7')]=function(_0x2ec9b8,_0x1a7ab9){return _0x2ec9b8[_0x5195('0x8')](_0x5195('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c43=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x691117,_0x5f26ca){var _0x55479c=function(_0x5af2e9){while(--_0x5af2e9){_0x691117['push'](_0x691117['shift']());}};_0x55479c(++_0x5f26ca);}(_0x2c43,0x6a));var _0x32c4=function(_0x3597c9,_0x4a27b6){_0x3597c9=_0x3597c9-0x0;var _0x4c7a54=_0x2c43[_0x3597c9];return _0x4c7a54;};'use strict';var _=require(_0x32c4('0x0'));var util=require(_0x32c4('0x1'));var logger=require('../../config/logger')(_0x32c4('0x2'));var moment=require(_0x32c4('0x3'));var BPromise=require(_0x32c4('0x4'));var rp=require(_0x32c4('0x5'));var fs=require('fs');var path=require(_0x32c4('0x6'));var rimraf=require('rimraf');var config=require(_0x32c4('0x7'));var attributes=require(_0x32c4('0x8'));module[_0x32c4('0x9')]=function(_0x41056e,_0x248fa5){return _0x41056e[_0x32c4('0xa')](_0x32c4('0xb'),attributes,{'tableName':_0x32c4('0xc'),'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 9d718a4..4aaecf3 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 _0x4189=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1fb2e9,_0x240de2){var _0x327c7c=function(_0x361e94){while(--_0x361e94){_0x1fb2e9['push'](_0x1fb2e9['shift']());}};_0x327c7c(++_0x240de2);}(_0x4189,0x160));var _0x9418=function(_0x2a22b8,_0x228cdf){_0x2a22b8=_0x2a22b8-0x0;var _0x2715fd=_0x4189[_0x2a22b8];return _0x2715fd;};'use strict';var _=require(_0x9418('0x0'));var util=require('util');var moment=require(_0x9418('0x1'));var BPromise=require(_0x9418('0x2'));var rs=require(_0x9418('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9418('0x4'))['db'];var utils=require(_0x9418('0x5'));var logger=require('../../config/logger')(_0x9418('0x6'));var config=require(_0x9418('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9418('0x8')][_0x9418('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c3134,_0x215e21,_0x7cd70d){return new BPromise(function(_0x2ac01b,_0x1e902e){return client[_0x9418('0xa')](_0x4c3134,_0x7cd70d)[_0x9418('0xb')](function(_0x3d59dd){logger[_0x9418('0xc')](_0x9418('0xd'),_0x215e21,_0x9418('0xe'));logger['debug'](_0x9418('0xf'),_0x215e21,'request\x20sent',JSON[_0x9418('0x10')](_0x3d59dd));if(_0x3d59dd[_0x9418('0x11')]){if(_0x3d59dd[_0x9418('0x11')]['code']===0x1f4){logger[_0x9418('0x11')](_0x9418('0xd'),_0x215e21,_0x3d59dd[_0x9418('0x11')][_0x9418('0x12')]);return _0x1e902e(_0x3d59dd[_0x9418('0x11')][_0x9418('0x12')]);}logger[_0x9418('0x11')](_0x9418('0xd'),_0x215e21,_0x3d59dd[_0x9418('0x11')]['message']);return _0x2ac01b(_0x3d59dd[_0x9418('0x11')]['message']);}else{logger[_0x9418('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x215e21,'request\x20sent');_0x2ac01b(_0x3d59dd[_0x9418('0x13')][_0x9418('0x12')]);}})[_0x9418('0x14')](function(_0x1fdbfa){logger[_0x9418('0x11')](_0x9418('0xd'),_0x215e21,_0x1fdbfa);_0x1e902e(_0x1fdbfa);});});}
\ No newline at end of file
+var _0x528e=['catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x544d92,_0x42421d){var _0x2dd78b=function(_0x54dd0c){while(--_0x54dd0c){_0x544d92['push'](_0x544d92['shift']());}};_0x2dd78b(++_0x42421d);}(_0x528e,0x157));var _0xe528=function(_0x292047,_0x24abc5){_0x292047=_0x292047-0x0;var _0x550376=_0x528e[_0x292047];return _0x550376;};'use strict';var _=require(_0xe528('0x0'));var util=require(_0xe528('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe528('0x2'))['db'];var utils=require(_0xe528('0x3'));var logger=require(_0xe528('0x4'))('rpc');var config=require(_0xe528('0x5'));var jayson=require(_0xe528('0x6'));var client=jayson[_0xe528('0x7')][_0xe528('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x331d1e,_0x27a49b,_0x3c4d62){return new BPromise(function(_0x21913e,_0x4e0525){return client['request'](_0x331d1e,_0x3c4d62)['then'](function(_0xc050ff){logger[_0xe528('0x9')](_0xe528('0xa'),_0x27a49b,_0xe528('0xb'));logger[_0xe528('0xc')](_0xe528('0xd'),_0x27a49b,_0xe528('0xb'),JSON['stringify'](_0xc050ff));if(_0xc050ff['error']){if(_0xc050ff[_0xe528('0xe')][_0xe528('0xf')]===0x1f4){logger[_0xe528('0xe')](_0xe528('0xa'),_0x27a49b,_0xc050ff[_0xe528('0xe')][_0xe528('0x10')]);return _0x4e0525(_0xc050ff[_0xe528('0xe')][_0xe528('0x10')]);}logger[_0xe528('0xe')](_0xe528('0xa'),_0x27a49b,_0xc050ff['error']['message']);return _0x21913e(_0xc050ff[_0xe528('0xe')][_0xe528('0x10')]);}else{logger[_0xe528('0x9')](_0xe528('0xa'),_0x27a49b,_0xe528('0xb'));_0x21913e(_0xc050ff['result'][_0xe528('0x10')]);}})[_0xe528('0x11')](function(_0x52494b){logger[_0xe528('0xe')](_0xe528('0xa'),_0x27a49b,_0x52494b);_0x4e0525(_0x52494b);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 0b28e22..ec57a82 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 _0x1c09=['get','isAuthenticated','index','/:id','show','/:id/download','post','create','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbaf5c4,_0x162678){var _0x531a72=function(_0x1705e0){while(--_0x1705e0){_0xbaf5c4['push'](_0xbaf5c4['shift']());}};_0x531a72(++_0x162678);}(_0x1c09,0xf3));var _0x91c0=function(_0x3f8ab6,_0x428986){_0x3f8ab6=_0x3f8ab6-0x0;var _0x4a977c=_0x1c09[_0x3f8ab6];return _0x4a977c;};'use strict';var multer=require(_0x91c0('0x0'));var util=require(_0x91c0('0x1'));var path=require(_0x91c0('0x2'));var timeout=require(_0x91c0('0x3'));var express=require('express');var router=express[_0x91c0('0x4')]();var fs_extra=require(_0x91c0('0x5'));var auth=require(_0x91c0('0x6'));var interaction=require(_0x91c0('0x7'));var config=require(_0x91c0('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x91c0('0x9')]('/',auth[_0x91c0('0xa')](),controller[_0x91c0('0xb')]);router[_0x91c0('0x9')](_0x91c0('0xc'),auth['isAuthenticated'](),controller[_0x91c0('0xd')]);router[_0x91c0('0x9')](_0x91c0('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x91c0('0xf')]('/',auth[_0x91c0('0xa')](),controller[_0x91c0('0x10')]);router['put']('/:id',auth[_0x91c0('0xa')](),controller[_0x91c0('0x11')]);router['delete'](_0x91c0('0xc'),auth[_0x91c0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbce5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','create','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xbce5,0x1ad));var _0x5bce=function(_0x2860ab,_0x27440f){_0x2860ab=_0x2860ab-0x0;var _0x3037c4=_0xbce5[_0x2860ab];return _0x3037c4;};'use strict';var multer=require(_0x5bce('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5bce('0x1'));var express=require(_0x5bce('0x2'));var router=express[_0x5bce('0x3')]();var fs_extra=require(_0x5bce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5bce('0x5'));var config=require(_0x5bce('0x6'));var controller=require(_0x5bce('0x7'));router[_0x5bce('0x8')]('/',auth[_0x5bce('0x9')](),controller[_0x5bce('0xa')]);router[_0x5bce('0x8')](_0x5bce('0xb'),auth['isAuthenticated'](),controller[_0x5bce('0xc')]);router['get']('/:id/download',auth[_0x5bce('0x9')](),controller[_0x5bce('0xd')]);router['post']('/',auth[_0x5bce('0x9')](),controller[_0x5bce('0xe')]);router['put']('/:id',auth[_0x5bce('0x9')](),controller['update']);router[_0x5bce('0xf')](_0x5bce('0xb'),auth[_0x5bce('0x9')](),controller[_0x5bce('0x10')]);module[_0x5bce('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 9f027bd..de586d0 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 _0xf766=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x14feb2,_0x59bdae){var _0x4a7e1c=function(_0x45a51e){while(--_0x45a51e){_0x14feb2['push'](_0x14feb2['shift']());}};_0x4a7e1c(++_0x59bdae);}(_0xf766,0x1b0));var _0x6f76=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0xf766[_0xbbfe59];return _0x28a2a4;};'use strict';var Sequelize=require(_0x6f76('0x0'));module[_0x6f76('0x1')]={'field':{'type':Sequelize[_0x6f76('0x2')]},'alias':{'type':Sequelize[_0x6f76('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x6f76('0x3')]},'groupBy':{'type':Sequelize[_0x6f76('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xaed8=['STRING','sequelize','TEXT'];(function(_0x27b671,_0x1b91e2){var _0x865f50=function(_0x21f1a4){while(--_0x21f1a4){_0x27b671['push'](_0x27b671['shift']());}};_0x865f50(++_0x1b91e2);}(_0xaed8,0x109));var _0x8aed=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xaed8[_0x3cea78];return _0x33b66b;};'use strict';var Sequelize=require(_0x8aed('0x0'));module['exports']={'field':{'type':Sequelize[_0x8aed('0x1')]},'alias':{'type':Sequelize[_0x8aed('0x2')]},'function':{'type':Sequelize[_0x8aed('0x2')]},'format':{'type':Sequelize[_0x8aed('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8aed('0x2')]},'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 60fbb8a..35c6dc8 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 _0xb92a=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','AnalyticFieldReport','include','findAll','rows','show','rawAttributes','includeAll','options','find','catch','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','fieldName','type','key','map','query'];(function(_0x187839,_0x2fe76b){var _0x2cdebd=function(_0x28de5e){while(--_0x28de5e){_0x187839['push'](_0x187839['shift']());}};_0x2cdebd(++_0x2fe76b);}(_0xb92a,0x76));var _0xab92=function(_0x50ac6d,_0x1c15b){_0x50ac6d=_0x50ac6d-0x0;var _0x1c39a2=_0xb92a[_0x50ac6d];return _0x1c39a2;};'use strict';var emlformat=require(_0xab92('0x0'));var rimraf=require(_0xab92('0x1'));var zipdir=require(_0xab92('0x2'));var jsonpatch=require(_0xab92('0x3'));var rp=require('request-promise');var moment=require(_0xab92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xab92('0x5'));var util=require(_0xab92('0x6'));var path=require(_0xab92('0x7'));var sox=require('sox');var csv=require(_0xab92('0x8'));var ejs=require(_0xab92('0x9'));var fs=require('fs');var fs_extra=require(_0xab92('0xa'));var _=require('lodash');var squel=require(_0xab92('0xb'));var crypto=require(_0xab92('0xc'));var jsforce=require(_0xab92('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab92('0xe'));var Papa=require('papaparse');var Redis=require(_0xab92('0xf'));var authService=require(_0xab92('0x10'));var qs=require(_0xab92('0x11'));var as=require(_0xab92('0x12'));var hardwareService=require(_0xab92('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xab92('0x14'));var config=require(_0xab92('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xab92('0x16'))['db'];function respondWithStatusCode(_0x1fc5aa,_0x1cb1d3){_0x1cb1d3=_0x1cb1d3||0xcc;return function(_0x25fffa){if(_0x25fffa){return _0x1fc5aa[_0xab92('0x17')](_0x1cb1d3);}return _0x1fc5aa[_0xab92('0x18')](_0x1cb1d3)[_0xab92('0x19')]();};}function respondWithResult(_0x5b8743,_0x1d8e17){_0x1d8e17=_0x1d8e17||0xc8;return function(_0x245f42){if(_0x245f42){return _0x5b8743[_0xab92('0x18')](_0x1d8e17)['json'](_0x245f42);}};}function respondWithFilteredResult(_0x4fc4a4,_0x477acf){return function(_0x33c095){if(_0x33c095){var _0x15654f=typeof _0x477acf[_0xab92('0x1a')]===_0xab92('0x1b')&&typeof _0x477acf[_0xab92('0x1c')]===_0xab92('0x1b');var _0x202fa7=_0x33c095['count'];var _0x4cdec9=_0x15654f?0x0:_0x477acf['offset'];var _0x2ae7c8=_0x15654f?_0x33c095[_0xab92('0x1d')]:_0x477acf['offset']+_0x477acf[_0xab92('0x1c')];var _0xe6a211;if(_0x2ae7c8>=_0x202fa7){_0x2ae7c8=_0x202fa7;_0xe6a211=0xc8;}else{_0xe6a211=0xce;}_0x4fc4a4[_0xab92('0x18')](_0xe6a211);return _0x4fc4a4[_0xab92('0x1e')](_0xab92('0x1f'),_0x4cdec9+'-'+_0x2ae7c8+'/'+_0x202fa7)['json'](_0x33c095);}return null;};}function patchUpdates(_0x156d68){return function(_0x2e6872){try{jsonpatch[_0xab92('0x20')](_0x2e6872,_0x156d68,!![]);}catch(_0x58bb41){return BPromise[_0xab92('0x21')](_0x58bb41);}return _0x2e6872[_0xab92('0x22')]();};}function saveUpdates(_0x3a2d4e,_0x25f6cb){return function(_0x3a287d){if(_0x3a287d){return _0x3a287d['update'](_0x3a2d4e)['then'](function(_0x8cc438){return _0x8cc438;});}return null;};}function removeEntity(_0x51731e,_0x114f0c){return function(_0x666a55){if(_0x666a55){return _0x666a55[_0xab92('0x23')]()[_0xab92('0x24')](function(){_0x51731e['status'](0xcc)[_0xab92('0x19')]();});}};}function handleEntityNotFound(_0x1f4326,_0x36c5f8){return function(_0x48a662){if(!_0x48a662){_0x1f4326[_0xab92('0x17')](0x194);}return _0x48a662;};}function handleError(_0x3bfd66,_0x45e871){_0x45e871=_0x45e871||0x1f4;return function(_0xb386e4){logger['error'](_0xb386e4[_0xab92('0x25')]);if(_0xb386e4[_0xab92('0x26')]){delete _0xb386e4[_0xab92('0x26')];}_0x3bfd66[_0xab92('0x18')](_0x45e871)[_0xab92('0x27')](_0xb386e4);};}exports[_0xab92('0x28')]=function(_0x21b0ca,_0x2fc461){var _0x537038={},_0x29f060={},_0x2217cb={'count':0x0,'rows':[]};var _0x46b2c5=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x3fb0b7){return{'name':_0x3fb0b7[_0xab92('0x29')],'type':_0x3fb0b7[_0xab92('0x2a')][_0xab92('0x2b')]};});_0x29f060['model']=_[_0xab92('0x2c')](_0x46b2c5,_0xab92('0x26'));_0x29f060[_0xab92('0x2d')]=_[_0xab92('0x2e')](_0x21b0ca['query']);_0x29f060[_0xab92('0x2f')]=_[_0xab92('0x30')](_0x29f060[_0xab92('0x31')],_0x29f060[_0xab92('0x2d')]);_0x537038[_0xab92('0x32')]=_[_0xab92('0x30')](_0x29f060[_0xab92('0x31')],qs[_0xab92('0x33')](_0x21b0ca[_0xab92('0x2d')][_0xab92('0x33')]));_0x537038['attributes']=_0x537038[_0xab92('0x32')][_0xab92('0x34')]?_0x537038['attributes']:_0x29f060[_0xab92('0x31')];if(!_0x21b0ca[_0xab92('0x2d')][_0xab92('0x35')](_0xab92('0x36'))){_0x537038[_0xab92('0x1c')]=qs[_0xab92('0x1c')](_0x21b0ca['query'][_0xab92('0x1c')]);_0x537038[_0xab92('0x1a')]=qs['offset'](_0x21b0ca[_0xab92('0x2d')][_0xab92('0x1a')]);}_0x537038['order']=qs[_0xab92('0x37')](_0x21b0ca[_0xab92('0x2d')][_0xab92('0x37')]);_0x537038[_0xab92('0x38')]=qs[_0xab92('0x2f')](_[_0xab92('0x39')](_0x21b0ca['query'],_0x29f060[_0xab92('0x2f')]),_0x46b2c5);if(_0x21b0ca[_0xab92('0x2d')][_0xab92('0x3a')]){_0x537038['where']=_[_0xab92('0x3b')](_0x537038[_0xab92('0x38')],{'$or':_[_0xab92('0x2c')](_0x46b2c5,function(_0x3b2d19){if(_0x3b2d19[_0xab92('0x2a')]!==_0xab92('0x3c')){var _0x397288={};_0x397288[_0x3b2d19[_0xab92('0x26')]]={'$like':'%'+_0x21b0ca[_0xab92('0x2d')][_0xab92('0x3a')]+'%'};return _0x397288;}})});}_0x537038=_[_0xab92('0x3b')]({},_0x537038,_0x21b0ca['options']);var _0x3dc8c7={'where':_0x537038[_0xab92('0x38')]};return db[_0xab92('0x3d')][_0xab92('0x1d')](_0x3dc8c7)[_0xab92('0x24')](function(_0x544410){_0x2217cb['count']=_0x544410;if(_0x21b0ca[_0xab92('0x2d')]['includeAll']){_0x537038[_0xab92('0x3e')]=[{'all':!![]}];}return db[_0xab92('0x3d')][_0xab92('0x3f')](_0x537038);})[_0xab92('0x24')](function(_0x5cfbd6){_0x2217cb[_0xab92('0x40')]=_0x5cfbd6;return _0x2217cb;})[_0xab92('0x24')](respondWithFilteredResult(_0x2fc461,_0x537038))['catch'](handleError(_0x2fc461,null));};exports[_0xab92('0x41')]=function(_0x2f2a4d,_0x190012){var _0x238dfc={'raw':![],'where':{'id':_0x2f2a4d['params']['id']}},_0x2ee560={};_0x2ee560[_0xab92('0x31')]=_['keys'](db[_0xab92('0x3d')][_0xab92('0x42')]);_0x2ee560[_0xab92('0x2d')]=_['keys'](_0x2f2a4d[_0xab92('0x2d')]);_0x2ee560[_0xab92('0x2f')]=_[_0xab92('0x30')](_0x2ee560[_0xab92('0x31')],_0x2ee560[_0xab92('0x2d')]);_0x238dfc[_0xab92('0x32')]=_[_0xab92('0x30')](_0x2ee560[_0xab92('0x31')],qs[_0xab92('0x33')](_0x2f2a4d[_0xab92('0x2d')][_0xab92('0x33')]));_0x238dfc['attributes']=_0x238dfc[_0xab92('0x32')]['length']?_0x238dfc[_0xab92('0x32')]:_0x2ee560[_0xab92('0x31')];if(_0x2f2a4d['query'][_0xab92('0x43')]){_0x238dfc[_0xab92('0x3e')]=[{'all':!![]}];}_0x238dfc=_['merge']({},_0x238dfc,_0x2f2a4d[_0xab92('0x44')]);return db[_0xab92('0x3d')][_0xab92('0x45')](_0x238dfc)[_0xab92('0x24')](handleEntityNotFound(_0x190012,null))[_0xab92('0x24')](respondWithResult(_0x190012,null))[_0xab92('0x46')](handleError(_0x190012,null));};exports['create']=function(_0x121d24,_0x4d3c41){return db['AnalyticFieldReport'][_0xab92('0x47')](_0x121d24[_0xab92('0x48')],{})[_0xab92('0x24')](respondWithResult(_0x4d3c41,0xc9))['catch'](handleError(_0x4d3c41,null));};exports['bulkCreate']=function(_0x324f6b,_0xf1f1f9){return db[_0xab92('0x3d')][_0xab92('0x49')](_0x324f6b[_0xab92('0x48')],{'raw':![],'individualHooks':!![]})[_0xab92('0x24')](respondWithResult(_0xf1f1f9,0xc9))[_0xab92('0x46')](handleError(_0xf1f1f9,null));};exports[_0xab92('0x4a')]=function(_0x40258b,_0x40e84d){if(_0x40258b[_0xab92('0x48')]['id']){delete _0x40258b[_0xab92('0x48')]['id'];}return db['AnalyticFieldReport'][_0xab92('0x45')]({'where':{'id':_0x40258b[_0xab92('0x4b')]['id']}})[_0xab92('0x24')](handleEntityNotFound(_0x40e84d,null))[_0xab92('0x24')](saveUpdates(_0x40258b['body'],null))[_0xab92('0x24')](respondWithResult(_0x40e84d,null))[_0xab92('0x46')](handleError(_0x40e84d,null));};exports[_0xab92('0x23')]=function(_0x3ee5bd,_0x475c99){return db[_0xab92('0x3d')][_0xab92('0x45')]({'where':{'id':_0x3ee5bd[_0xab92('0x4b')]['id']}})['then'](handleEntityNotFound(_0x475c99,null))[_0xab92('0x24')](removeEntity(_0x475c99,null))[_0xab92('0x46')](handleError(_0x475c99,null));};exports[_0xab92('0x4c')]=function(_0x14956a,_0x558265){return db[_0xab92('0x3d')][_0xab92('0x23')]({'where':{'id':_0x14956a[_0xab92('0x2d')][_0xab92('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xab92('0x24')](respondWithResult(_0x558265,0xcc))[_0xab92('0x46')](handleError(_0x558265,null));};exports[_0xab92('0x4e')]=function(_0xf0fd98,_0x45ad47,_0x4af58b){return db[_0xab92('0x4f')]['findOne']({'where':{'id':_0xf0fd98[_0xab92('0x4b')]['id']}})[_0xab92('0x24')](handleEntityNotFound(_0x45ad47,null))[_0xab92('0x24')](function(_0x43dfaf){if(_0x43dfaf){return db[_0xab92('0x50')]['transaction'](function(_0x3b6d46){return db[_0xab92('0x3d')][_0xab92('0x23')]({'where':{'CustomReportId':_0xf0fd98[_0xab92('0x4b')]['id']},'transaction':_0x3b6d46})['then'](function(_0x3af75c){var _0x3c5ea0=_[_0xab92('0x2c')](_0xf0fd98[_0xab92('0x48')],function(_0x3e818c){delete _0x3e818c['id'];_0x3e818c[_0xab92('0x51')]=_0xf0fd98[_0xab92('0x4b')]['id'];return _0x3e818c;});return db[_0xab92('0x3d')][_0xab92('0x49')](_0x3c5ea0,{'transaction':_0x3b6d46});});})['then'](function(){return db[_0xab92('0x3d')][_0xab92('0x3f')]({'where':{'CustomReportId':_0xf0fd98['params']['id']}});});}})['then'](respondWithResult(_0x45ad47,null))[_0xab92('0x46')](handleError(_0x45ad47,null));};
\ No newline at end of file
+var _0x99f5=['model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','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','end','status','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type'];(function(_0x4650fd,_0x453fd1){var _0x392588=function(_0xc153c1){while(--_0xc153c1){_0x4650fd['push'](_0x4650fd['shift']());}};_0x392588(++_0x453fd1);}(_0x99f5,0xc4));var _0x599f=function(_0x51c9b0,_0x106a90){_0x51c9b0=_0x51c9b0-0x0;var _0x4a08e9=_0x99f5[_0x51c9b0];return _0x4a08e9;};'use strict';var emlformat=require(_0x599f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x599f('0x1'));var jsonpatch=require(_0x599f('0x2'));var rp=require(_0x599f('0x3'));var moment=require(_0x599f('0x4'));var BPromise=require(_0x599f('0x5'));var Mustache=require(_0x599f('0x6'));var util=require('util');var path=require(_0x599f('0x7'));var sox=require(_0x599f('0x8'));var csv=require(_0x599f('0x9'));var ejs=require(_0x599f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x599f('0xb'));var squel=require(_0x599f('0xc'));var crypto=require('crypto');var jsforce=require(_0x599f('0xd'));var deskjs=require(_0x599f('0xe'));var toCsv=require(_0x599f('0x9'));var querystring=require('querystring');var Papa=require(_0x599f('0xf'));var Redis=require(_0x599f('0x10'));var authService=require(_0x599f('0x11'));var qs=require(_0x599f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x599f('0x13'));var logger=require(_0x599f('0x14'))('api');var utils=require(_0x599f('0x15'));var config=require(_0x599f('0x16'));var licenseUtil=require(_0x599f('0x17'));var db=require(_0x599f('0x18'))['db'];function respondWithStatusCode(_0x1654cb,_0x179519){_0x179519=_0x179519||0xcc;return function(_0x218bf5){if(_0x218bf5){return _0x1654cb[_0x599f('0x19')](_0x179519);}return _0x1654cb['status'](_0x179519)[_0x599f('0x1a')]();};}function respondWithResult(_0x47224c,_0x44e739){_0x44e739=_0x44e739||0xc8;return function(_0x401ddb){if(_0x401ddb){return _0x47224c[_0x599f('0x1b')](_0x44e739)['json'](_0x401ddb);}};}function respondWithFilteredResult(_0x19b198,_0x5c7a29){return function(_0x25d1f6){if(_0x25d1f6){var _0x20e7ac=typeof _0x5c7a29[_0x599f('0x1c')]===_0x599f('0x1d')&&typeof _0x5c7a29[_0x599f('0x1e')]===_0x599f('0x1d');var _0x1b532f=_0x25d1f6['count'];var _0x28fa5f=_0x20e7ac?0x0:_0x5c7a29[_0x599f('0x1c')];var _0x5c040c=_0x20e7ac?_0x25d1f6['count']:_0x5c7a29['offset']+_0x5c7a29[_0x599f('0x1e')];var _0x166e65;if(_0x5c040c>=_0x1b532f){_0x5c040c=_0x1b532f;_0x166e65=0xc8;}else{_0x166e65=0xce;}_0x19b198['status'](_0x166e65);return _0x19b198[_0x599f('0x1f')]('Content-Range',_0x28fa5f+'-'+_0x5c040c+'/'+_0x1b532f)[_0x599f('0x20')](_0x25d1f6);}return null;};}function patchUpdates(_0x3b3f22){return function(_0x5e569f){try{jsonpatch[_0x599f('0x21')](_0x5e569f,_0x3b3f22,!![]);}catch(_0x4a1c1f){return BPromise[_0x599f('0x22')](_0x4a1c1f);}return _0x5e569f[_0x599f('0x23')]();};}function saveUpdates(_0x5a9e43,_0x4f8ce7){return function(_0x4b3457){if(_0x4b3457){return _0x4b3457[_0x599f('0x24')](_0x5a9e43)[_0x599f('0x25')](function(_0x58f81e){return _0x58f81e;});}return null;};}function removeEntity(_0x1ac9a3,_0x1cc2ff){return function(_0x2c80cc){if(_0x2c80cc){return _0x2c80cc[_0x599f('0x26')]()[_0x599f('0x25')](function(){_0x1ac9a3['status'](0xcc)[_0x599f('0x1a')]();});}};}function handleEntityNotFound(_0x182bab,_0x3e8d25){return function(_0x29673a){if(!_0x29673a){_0x182bab[_0x599f('0x19')](0x194);}return _0x29673a;};}function handleError(_0x411759,_0x175287){_0x175287=_0x175287||0x1f4;return function(_0x3de57c){logger['error'](_0x3de57c[_0x599f('0x27')]);if(_0x3de57c[_0x599f('0x28')]){delete _0x3de57c[_0x599f('0x28')];}_0x411759[_0x599f('0x1b')](_0x175287)['send'](_0x3de57c);};}exports[_0x599f('0x29')]=function(_0x57056f,_0x51d45c){var _0x1054d3={},_0x4e6ea2={},_0x22c393={'count':0x0,'rows':[]};var _0x34004b=_[_0x599f('0x2a')](db[_0x599f('0x2b')][_0x599f('0x2c')],function(_0x36833c){return{'name':_0x36833c[_0x599f('0x2d')],'type':_0x36833c[_0x599f('0x2e')]['key']};});_0x4e6ea2[_0x599f('0x2f')]=_['map'](_0x34004b,_0x599f('0x28'));_0x4e6ea2[_0x599f('0x30')]=_[_0x599f('0x31')](_0x57056f[_0x599f('0x30')]);_0x4e6ea2[_0x599f('0x32')]=_[_0x599f('0x33')](_0x4e6ea2['model'],_0x4e6ea2[_0x599f('0x30')]);_0x1054d3[_0x599f('0x34')]=_[_0x599f('0x33')](_0x4e6ea2[_0x599f('0x2f')],qs['fields'](_0x57056f[_0x599f('0x30')][_0x599f('0x35')]));_0x1054d3[_0x599f('0x34')]=_0x1054d3[_0x599f('0x34')][_0x599f('0x36')]?_0x1054d3['attributes']:_0x4e6ea2[_0x599f('0x2f')];if(!_0x57056f['query']['hasOwnProperty'](_0x599f('0x37'))){_0x1054d3[_0x599f('0x1e')]=qs[_0x599f('0x1e')](_0x57056f['query'][_0x599f('0x1e')]);_0x1054d3[_0x599f('0x1c')]=qs[_0x599f('0x1c')](_0x57056f[_0x599f('0x30')][_0x599f('0x1c')]);}_0x1054d3['order']=qs[_0x599f('0x38')](_0x57056f['query'][_0x599f('0x38')]);_0x1054d3['where']=qs['filters'](_[_0x599f('0x39')](_0x57056f[_0x599f('0x30')],_0x4e6ea2[_0x599f('0x32')]),_0x34004b);if(_0x57056f[_0x599f('0x30')][_0x599f('0x3a')]){_0x1054d3[_0x599f('0x3b')]=_['merge'](_0x1054d3[_0x599f('0x3b')],{'$or':_[_0x599f('0x2a')](_0x34004b,function(_0x21806b){if(_0x21806b[_0x599f('0x2e')]!==_0x599f('0x3c')){var _0x33aed2={};_0x33aed2[_0x21806b[_0x599f('0x28')]]={'$like':'%'+_0x57056f[_0x599f('0x30')][_0x599f('0x3a')]+'%'};return _0x33aed2;}})});}_0x1054d3=_[_0x599f('0x3d')]({},_0x1054d3,_0x57056f[_0x599f('0x3e')]);var _0x52945e={'where':_0x1054d3[_0x599f('0x3b')]};return db[_0x599f('0x2b')][_0x599f('0x3f')](_0x52945e)[_0x599f('0x25')](function(_0x2ea9d3){_0x22c393[_0x599f('0x3f')]=_0x2ea9d3;if(_0x57056f[_0x599f('0x30')][_0x599f('0x40')]){_0x1054d3[_0x599f('0x41')]=[{'all':!![]}];}return db[_0x599f('0x2b')][_0x599f('0x42')](_0x1054d3);})[_0x599f('0x25')](function(_0x518bc7){_0x22c393[_0x599f('0x43')]=_0x518bc7;return _0x22c393;})[_0x599f('0x25')](respondWithFilteredResult(_0x51d45c,_0x1054d3))[_0x599f('0x44')](handleError(_0x51d45c,null));};exports['show']=function(_0x448032,_0x30e7bb){var _0x3ab9a4={'raw':![],'where':{'id':_0x448032[_0x599f('0x45')]['id']}},_0x41fee2={};_0x41fee2[_0x599f('0x2f')]=_[_0x599f('0x31')](db[_0x599f('0x2b')][_0x599f('0x2c')]);_0x41fee2['query']=_[_0x599f('0x31')](_0x448032['query']);_0x41fee2['filters']=_[_0x599f('0x33')](_0x41fee2[_0x599f('0x2f')],_0x41fee2['query']);_0x3ab9a4[_0x599f('0x34')]=_[_0x599f('0x33')](_0x41fee2[_0x599f('0x2f')],qs['fields'](_0x448032[_0x599f('0x30')][_0x599f('0x35')]));_0x3ab9a4[_0x599f('0x34')]=_0x3ab9a4[_0x599f('0x34')][_0x599f('0x36')]?_0x3ab9a4[_0x599f('0x34')]:_0x41fee2[_0x599f('0x2f')];if(_0x448032['query'][_0x599f('0x40')]){_0x3ab9a4[_0x599f('0x41')]=[{'all':!![]}];}_0x3ab9a4=_['merge']({},_0x3ab9a4,_0x448032[_0x599f('0x3e')]);return db[_0x599f('0x2b')][_0x599f('0x46')](_0x3ab9a4)['then'](handleEntityNotFound(_0x30e7bb,null))[_0x599f('0x25')](respondWithResult(_0x30e7bb,null))['catch'](handleError(_0x30e7bb,null));};exports['create']=function(_0x1edda8,_0x51a468){return db['AnalyticFieldReport'][_0x599f('0x47')](_0x1edda8[_0x599f('0x48')],{})[_0x599f('0x25')](respondWithResult(_0x51a468,0xc9))['catch'](handleError(_0x51a468,null));};exports[_0x599f('0x49')]=function(_0x554fb4,_0x150703){return db[_0x599f('0x2b')][_0x599f('0x49')](_0x554fb4[_0x599f('0x48')],{'raw':![],'individualHooks':!![]})[_0x599f('0x25')](respondWithResult(_0x150703,0xc9))[_0x599f('0x44')](handleError(_0x150703,null));};exports[_0x599f('0x24')]=function(_0x17aff6,_0xcbab6){if(_0x17aff6[_0x599f('0x48')]['id']){delete _0x17aff6[_0x599f('0x48')]['id'];}return db[_0x599f('0x2b')]['find']({'where':{'id':_0x17aff6['params']['id']}})[_0x599f('0x25')](handleEntityNotFound(_0xcbab6,null))[_0x599f('0x25')](saveUpdates(_0x17aff6[_0x599f('0x48')],null))[_0x599f('0x25')](respondWithResult(_0xcbab6,null))[_0x599f('0x44')](handleError(_0xcbab6,null));};exports[_0x599f('0x26')]=function(_0x567f9c,_0x26d43e){return db[_0x599f('0x2b')][_0x599f('0x46')]({'where':{'id':_0x567f9c['params']['id']}})[_0x599f('0x25')](handleEntityNotFound(_0x26d43e,null))[_0x599f('0x25')](removeEntity(_0x26d43e,null))[_0x599f('0x44')](handleError(_0x26d43e,null));};exports[_0x599f('0x4a')]=function(_0x30e97b,_0x11b790){return db[_0x599f('0x2b')][_0x599f('0x26')]({'where':{'id':_0x30e97b[_0x599f('0x30')][_0x599f('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x599f('0x25')](respondWithResult(_0x11b790,0xcc))[_0x599f('0x44')](handleError(_0x11b790,null));};exports[_0x599f('0x4c')]=function(_0x59a36d,_0x3b5d2c,_0x8e4745){return db[_0x599f('0x4d')][_0x599f('0x4e')]({'where':{'id':_0x59a36d['params']['id']}})[_0x599f('0x25')](handleEntityNotFound(_0x3b5d2c,null))[_0x599f('0x25')](function(_0x183b70){if(_0x183b70){return db['sequelize'][_0x599f('0x4f')](function(_0x38210a){return db[_0x599f('0x2b')][_0x599f('0x26')]({'where':{'CustomReportId':_0x59a36d[_0x599f('0x45')]['id']},'transaction':_0x38210a})[_0x599f('0x25')](function(_0x422bec){var _0x2ff754=_['map'](_0x59a36d['body'],function(_0x140129){delete _0x140129['id'];_0x140129[_0x599f('0x50')]=_0x59a36d['params']['id'];return _0x140129;});return db[_0x599f('0x2b')][_0x599f('0x49')](_0x2ff754,{'transaction':_0x38210a});});})[_0x599f('0x25')](function(){return db[_0x599f('0x2b')][_0x599f('0x42')]({'where':{'CustomReportId':_0x59a36d[_0x599f('0x45')]['id']}});});}})[_0x599f('0x25')](respondWithResult(_0x3b5d2c,null))[_0x599f('0x44')](handleError(_0x3b5d2c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index e359645..db34d62 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 _0x1cc0=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x450b91,_0x2589a9){var _0x42a2d0=function(_0x41b9a4){while(--_0x41b9a4){_0x450b91['push'](_0x450b91['shift']());}};_0x42a2d0(++_0x2589a9);}(_0x1cc0,0x15f));var _0x01cc=function(_0x14e892,_0x3a9e8a){_0x14e892=_0x14e892-0x0;var _0x3593b4=_0x1cc0[_0x14e892];return _0x3593b4;};'use strict';var _=require(_0x01cc('0x0'));var util=require(_0x01cc('0x1'));var logger=require(_0x01cc('0x2'))(_0x01cc('0x3'));var moment=require(_0x01cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x01cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01cc('0x6'));var attributes=require(_0x01cc('0x7'));module[_0x01cc('0x8')]=function(_0xc9f9c0,_0x134466){return _0xc9f9c0[_0x01cc('0x9')](_0x01cc('0xa'),attributes,{'tableName':_0x01cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0039=['moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x50a843,_0x4de0b0){var _0x270d03=function(_0x228107){while(--_0x228107){_0x50a843['push'](_0x50a843['shift']());}};_0x270d03(++_0x4de0b0);}(_0x0039,0xf9));var _0x9003=function(_0x1ff110,_0xb6cef2){_0x1ff110=_0x1ff110-0x0;var _0x342283=_0x0039[_0x1ff110];return _0x342283;};'use strict';var _=require(_0x9003('0x0'));var util=require(_0x9003('0x1'));var logger=require(_0x9003('0x2'))('api');var moment=require(_0x9003('0x3'));var BPromise=require(_0x9003('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9003('0x5'));var rimraf=require(_0x9003('0x6'));var config=require(_0x9003('0x7'));var attributes=require(_0x9003('0x8'));module[_0x9003('0x9')]=function(_0x46fc59,_0x52f40f){return _0x46fc59['define'](_0x9003('0xa'),attributes,{'tableName':_0x9003('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 641fd67..ae0f0c4 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 _0x2077=['code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x287ab7,_0x5f2d08){var _0x13c959=function(_0x44a45c){while(--_0x44a45c){_0x287ab7['push'](_0x287ab7['shift']());}};_0x13c959(++_0x5f2d08);}(_0x2077,0x180));var _0x7207=function(_0x93aa47,_0xaeb5f9){_0x93aa47=_0x93aa47-0x0;var _0x26d122=_0x2077[_0x93aa47];return _0x26d122;};'use strict';var _=require(_0x7207('0x0'));var util=require(_0x7207('0x1'));var moment=require(_0x7207('0x2'));var BPromise=require(_0x7207('0x3'));var rs=require(_0x7207('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7207('0x5'));var jayson=require(_0x7207('0x6'));var client=jayson[_0x7207('0x7')][_0x7207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a0d08,_0x5de24,_0x6ef448){return new BPromise(function(_0x358ce8,_0x4cb3d5){return client[_0x7207('0x9')](_0x4a0d08,_0x6ef448)[_0x7207('0xa')](function(_0x1d1615){logger['info'](_0x7207('0xb'),_0x5de24,'request\x20sent');logger[_0x7207('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5de24,_0x7207('0xd'),JSON[_0x7207('0xe')](_0x1d1615));if(_0x1d1615[_0x7207('0xf')]){if(_0x1d1615[_0x7207('0xf')][_0x7207('0x10')]===0x1f4){logger[_0x7207('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5de24,_0x1d1615[_0x7207('0xf')][_0x7207('0x11')]);return _0x4cb3d5(_0x1d1615[_0x7207('0xf')][_0x7207('0x11')]);}logger[_0x7207('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5de24,_0x1d1615[_0x7207('0xf')][_0x7207('0x11')]);return _0x358ce8(_0x1d1615['error'][_0x7207('0x11')]);}else{logger[_0x7207('0x12')](_0x7207('0xb'),_0x5de24,_0x7207('0xd'));_0x358ce8(_0x1d1615[_0x7207('0x13')]['message']);}})['catch'](function(_0x5a39ec){logger[_0x7207('0xf')](_0x7207('0xb'),_0x5de24,_0x5a39ec);_0x4cb3d5(_0x5a39ec);});});}
\ No newline at end of file
+var _0x2435=['code','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify'];(function(_0x557d3f,_0xf772a2){var _0x19155e=function(_0x497853){while(--_0x497853){_0x557d3f['push'](_0x557d3f['shift']());}};_0x19155e(++_0xf772a2);}(_0x2435,0x8a));var _0x5243=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x2435[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x5243('0x0'));var util=require(_0x5243('0x1'));var moment=require(_0x5243('0x2'));var BPromise=require(_0x5243('0x3'));var rs=require(_0x5243('0x4'));var fs=require('fs');var Redis=require(_0x5243('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5243('0x6'));var logger=require('../../config/logger')(_0x5243('0x7'));var config=require(_0x5243('0x8'));var jayson=require(_0x5243('0x9'));var client=jayson[_0x5243('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa98f6,_0x2a7746,_0x4f6d48){return new BPromise(function(_0xb03a30,_0x45ff08){return client[_0x5243('0xb')](_0xa98f6,_0x4f6d48)['then'](function(_0x419d7c){logger[_0x5243('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2a7746,_0x5243('0xd'));logger[_0x5243('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2a7746,_0x5243('0xd'),JSON[_0x5243('0xf')](_0x419d7c));if(_0x419d7c['error']){if(_0x419d7c['error'][_0x5243('0x10')]===0x1f4){logger[_0x5243('0x11')](_0x5243('0x12'),_0x2a7746,_0x419d7c[_0x5243('0x11')][_0x5243('0x13')]);return _0x45ff08(_0x419d7c[_0x5243('0x11')]['message']);}logger[_0x5243('0x11')](_0x5243('0x12'),_0x2a7746,_0x419d7c[_0x5243('0x11')]['message']);return _0xb03a30(_0x419d7c['error'][_0x5243('0x13')]);}else{logger[_0x5243('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2a7746,_0x5243('0xd'));_0xb03a30(_0x419d7c[_0x5243('0x14')][_0x5243('0x13')]);}})[_0x5243('0x15')](function(_0x5bdcf9){logger[_0x5243('0x11')](_0x5243('0x12'),_0x2a7746,_0x5bdcf9);_0x45ff08(_0x5bdcf9);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index bc8e460..69bb356 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(_0x5bbabd,_0x987538){var _0x103712=function(_0x35b6){while(--_0x35b6){_0x5bbabd['push'](_0x5bbabd['shift']());}};_0x103712(++_0x987538);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x3b2fd8,_0x1f5100){var _0x1c1b8a=function(_0x1fbd07){while(--_0x1fbd07){_0x3b2fd8['push'](_0x3b2fd8['shift']());}};_0x1c1b8a(++_0x1f5100);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 5b63997..c65f969 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 _0x7b37=['STRING','sequelize','exports','name'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x7b37,0xd9));var _0x77b3=function(_0x4250b4,_0x3fd543){_0x4250b4=_0x4250b4-0x0;var _0x8a4807=_0x7b37[_0x4250b4];return _0x8a4807;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x77b3('0x2')},'table':{'type':Sequelize[_0x77b3('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x77b3('0x3')]}};
\ No newline at end of file
+var _0x9f4d=['TEXT','sequelize','exports','STRING','name'];(function(_0x2c0a07,_0x56553b){var _0x515ba5=function(_0x384f1e){while(--_0x384f1e){_0x2c0a07['push'](_0x2c0a07['shift']());}};_0x515ba5(++_0x56553b);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x2b7567,_0x412715){_0x2b7567=_0x2b7567-0x0;var _0x2522dc=_0x9f4d[_0x2b7567];return _0x2522dc;};'use strict';var Sequelize=require(_0xd9f4('0x0'));module[_0xd9f4('0x1')]={'name':{'type':Sequelize[_0xd9f4('0x2')],'allowNull':![],'unique':_0xd9f4('0x3')},'table':{'type':Sequelize[_0xd9f4('0x2')]},'metric':{'type':Sequelize[_0xd9f4('0x4')]},'description':{'type':Sequelize[_0xd9f4('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 62dc01a..fbc7d88 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 _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(_0x250a85,_0x49f110){var _0x216492=function(_0x5866c6){while(--_0x5866c6){_0x250a85['push'](_0x250a85['shift']());}};_0x216492(++_0x49f110);}(_0x00bb,0x1d8));var _0xb00b=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x00bb[_0x491a7f];return _0x3d8f44;};'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
+var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xd0a0ae,_0x239a61){var _0x4da1a4=function(_0x10554c){while(--_0x10554c){_0xd0a0ae['push'](_0xd0a0ae['shift']());}};_0x4da1a4(++_0x239a61);}(_0x008c,0x188));var _0xc008=function(_0x121737,_0x37e36b){_0x121737=_0x121737-0x0;var _0x5f4d4b=_0x008c[_0x121737];return _0x5f4d4b;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index c2f0728..fe66b94 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 _0x5bd7=['analytics_metrics','util','../../config/logger','api','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xf9b115,_0x499f75){var _0x2f3525=function(_0x6cec4a){while(--_0x6cec4a){_0xf9b115['push'](_0xf9b115['shift']());}};_0x2f3525(++_0x499f75);}(_0x5bd7,0x12a));var _0x75bd=function(_0x134019,_0x3a1963){_0x134019=_0x134019-0x0;var _0x1807e7=_0x5bd7[_0x134019];return _0x1807e7;};'use strict';var _=require('lodash');var util=require(_0x75bd('0x0'));var logger=require(_0x75bd('0x1'))(_0x75bd('0x2'));var moment=require('moment');var BPromise=require(_0x75bd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75bd('0x4'));var rimraf=require(_0x75bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x75bd('0x6'));module[_0x75bd('0x7')]=function(_0x2aaa6a,_0x47c9c7){return _0x2aaa6a[_0x75bd('0x8')](_0x75bd('0x9'),attributes,{'tableName':_0x75bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb3d8=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xecea29,_0x1a5257){var _0x2d0701=function(_0x16b646){while(--_0x16b646){_0xecea29['push'](_0xecea29['shift']());}};_0x2d0701(++_0x1a5257);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x1db2d6,_0x4445f3){_0x1db2d6=_0x1db2d6-0x0;var _0x3f52f8=_0xb3d8[_0x1db2d6];return _0x3f52f8;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var logger=require(_0x8b3d('0x1'))(_0x8b3d('0x2'));var moment=require(_0x8b3d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b3d('0x4'));var rimraf=require(_0x8b3d('0x5'));var config=require(_0x8b3d('0x6'));var attributes=require(_0x8b3d('0x7'));module[_0x8b3d('0x8')]=function(_0x22d97b,_0x3b0f04){return _0x22d97b[_0x8b3d('0x9')](_0x8b3d('0xa'),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 7fce14d..0f7e457 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 _0x33b3=['AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x555164,_0x13e97c){var _0x541861=function(_0x55d3c3){while(--_0x55d3c3){_0x555164['push'](_0x555164['shift']());}};_0x541861(++_0x13e97c);}(_0x33b3,0x154));var _0x333b=function(_0x5388e4,_0x5eb0ad){_0x5388e4=_0x5388e4-0x0;var _0x208b64=_0x33b3[_0x5388e4];return _0x208b64;};'use strict';var _=require(_0x333b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x333b('0x1'));var rs=require(_0x333b('0x2'));var fs=require('fs');var Redis=require(_0x333b('0x3'));var db=require(_0x333b('0x4'))['db'];var utils=require(_0x333b('0x5'));var logger=require(_0x333b('0x6'))(_0x333b('0x7'));var config=require(_0x333b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x333b('0x9')][_0x333b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x438890,_0x435a4b,_0x29efdb){return new BPromise(function(_0x48373b,_0x4c38c6){return client[_0x333b('0xb')](_0x438890,_0x29efdb)[_0x333b('0xc')](function(_0x3ff2e7){logger[_0x333b('0xd')](_0x333b('0xe'),_0x435a4b,_0x333b('0xf'));logger[_0x333b('0x10')](_0x333b('0x11'),_0x435a4b,_0x333b('0xf'),JSON['stringify'](_0x3ff2e7));if(_0x3ff2e7[_0x333b('0x12')]){if(_0x3ff2e7[_0x333b('0x12')][_0x333b('0x13')]===0x1f4){logger[_0x333b('0x12')](_0x333b('0xe'),_0x435a4b,_0x3ff2e7['error'][_0x333b('0x14')]);return _0x4c38c6(_0x3ff2e7[_0x333b('0x12')]['message']);}logger['error'](_0x333b('0xe'),_0x435a4b,_0x3ff2e7[_0x333b('0x12')][_0x333b('0x14')]);return _0x48373b(_0x3ff2e7['error'][_0x333b('0x14')]);}else{logger['info'](_0x333b('0xe'),_0x435a4b,_0x333b('0xf'));_0x48373b(_0x3ff2e7['result'][_0x333b('0x14')]);}})['catch'](function(_0x3af1ea){logger[_0x333b('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x435a4b,_0x3af1ea);_0x4c38c6(_0x3af1ea);});});}
\ No newline at end of file
+var _0x482b=['../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x47f19b,_0x56f361){var _0x2af1aa=function(_0x430768){while(--_0x430768){_0x47f19b['push'](_0x47f19b['shift']());}};_0x2af1aa(++_0x56f361);}(_0x482b,0xb8));var _0xb482=function(_0x5f07d0,_0x30a246){_0x5f07d0=_0x5f07d0-0x0;var _0x1c83f1=_0x482b[_0x5f07d0];return _0x1c83f1;};'use strict';var _=require(_0xb482('0x0'));var util=require(_0xb482('0x1'));var moment=require('moment');var BPromise=require(_0xb482('0x2'));var rs=require(_0xb482('0x3'));var fs=require('fs');var Redis=require(_0xb482('0x4'));var db=require(_0xb482('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb482('0x6'))(_0xb482('0x7'));var config=require(_0xb482('0x8'));var jayson=require(_0xb482('0x9'));var client=jayson['client'][_0xb482('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x475438,_0x15753c,_0x3bbcbd){return new BPromise(function(_0x2a2b2c,_0x3a0598){return client[_0xb482('0xb')](_0x475438,_0x3bbcbd)[_0xb482('0xc')](function(_0x40dc09){logger[_0xb482('0xd')](_0xb482('0xe'),_0x15753c,_0xb482('0xf'));logger[_0xb482('0x10')](_0xb482('0x11'),_0x15753c,'request\x20sent',JSON[_0xb482('0x12')](_0x40dc09));if(_0x40dc09[_0xb482('0x13')]){if(_0x40dc09[_0xb482('0x13')][_0xb482('0x14')]===0x1f4){logger[_0xb482('0x13')](_0xb482('0xe'),_0x15753c,_0x40dc09['error'][_0xb482('0x15')]);return _0x3a0598(_0x40dc09[_0xb482('0x13')]['message']);}logger[_0xb482('0x13')](_0xb482('0xe'),_0x15753c,_0x40dc09[_0xb482('0x13')][_0xb482('0x15')]);return _0x2a2b2c(_0x40dc09[_0xb482('0x13')][_0xb482('0x15')]);}else{logger['info'](_0xb482('0xe'),_0x15753c,'request\x20sent');_0x2a2b2c(_0x40dc09[_0xb482('0x16')][_0xb482('0x15')]);}})[_0xb482('0x17')](function(_0x25df00){logger[_0xb482('0x13')](_0xb482('0xe'),_0x15753c,_0x25df00);_0x3a0598(_0x25df00);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index cfe2c6b..f347e6e 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 _0xfa45=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x111283,_0x58ddcb){var _0x1e5f06=function(_0x2b30a4){while(--_0x2b30a4){_0x111283['push'](_0x111283['shift']());}};_0x1e5f06(++_0x58ddcb);}(_0xfa45,0x11b));var _0x5fa4=function(_0x2ff24c,_0x92e17f){_0x2ff24c=_0x2ff24c-0x0;var _0x373ecd=_0xfa45[_0x2ff24c];return _0x373ecd;};'use strict';var multer=require(_0x5fa4('0x0'));var util=require(_0x5fa4('0x1'));var path=require(_0x5fa4('0x2'));var timeout=require(_0x5fa4('0x3'));var express=require(_0x5fa4('0x4'));var router=express[_0x5fa4('0x5')]();var fs_extra=require(_0x5fa4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5fa4('0x7'));var config=require('../../config/environment');var controller=require(_0x5fa4('0x8'));router[_0x5fa4('0x9')]('/',auth[_0x5fa4('0xa')](),controller[_0x5fa4('0xb')]);router[_0x5fa4('0x9')](_0x5fa4('0xc'),auth[_0x5fa4('0xa')](),controller[_0x5fa4('0xd')]);router[_0x5fa4('0xe')]('/',auth[_0x5fa4('0xa')](),controller['create']);router[_0x5fa4('0xf')]('/:id',auth[_0x5fa4('0xa')](),controller[_0x5fa4('0x10')]);router[_0x5fa4('0x11')](_0x5fa4('0xc'),auth[_0x5fa4('0xa')](),controller[_0x5fa4('0x12')]);module[_0x5fa4('0x13')]=router;
\ No newline at end of file
+var _0xa74a=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','delete','destroy'];(function(_0x3f932d,_0x46d3e9){var _0x39fea1=function(_0x4ba570){while(--_0x4ba570){_0x3f932d['push'](_0x3f932d['shift']());}};_0x39fea1(++_0x46d3e9);}(_0xa74a,0x66));var _0xaa74=function(_0x4979fb,_0x1e0921){_0x4979fb=_0x4979fb-0x0;var _0x58fbea=_0xa74a[_0x4979fb];return _0x58fbea;};'use strict';var multer=require(_0xaa74('0x0'));var util=require(_0xaa74('0x1'));var path=require(_0xaa74('0x2'));var timeout=require(_0xaa74('0x3'));var express=require(_0xaa74('0x4'));var router=express[_0xaa74('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaa74('0x6'));var interaction=require(_0xaa74('0x7'));var config=require(_0xaa74('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xaa74('0x9')](),controller[_0xaa74('0xa')]);router[_0xaa74('0xb')](_0xaa74('0xc'),auth[_0xaa74('0x9')](),controller['show']);router[_0xaa74('0xd')]('/',auth['isAuthenticated'](),controller[_0xaa74('0xe')]);router['put'](_0xaa74('0xc'),auth[_0xaa74('0x9')](),controller['update']);router[_0xaa74('0xf')]('/:id',auth[_0xaa74('0x9')](),controller[_0xaa74('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a112de7..ccd8e10 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 _0xed55=['exports','TEXT','sequelize'];(function(_0x3e2e1c,_0x182117){var _0x4c9c90=function(_0x54221c){while(--_0x54221c){_0x3e2e1c['push'](_0x3e2e1c['shift']());}};_0x4c9c90(++_0x182117);}(_0xed55,0x161));var _0x5ed5=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0xed55[_0x3cb152];return _0x4f54c3;};'use strict';var Sequelize=require(_0x5ed5('0x0'));module[_0x5ed5('0x1')]={'tree':{'type':Sequelize[_0x5ed5('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x433e=['exports','TEXT','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x433e,0xbf));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe433('0x0'));module[_0xe433('0x1')]={'tree':{'type':Sequelize[_0xe433('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 66de523..92532d5 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 _0x71f6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x39dd10,_0x134622){var _0x35bd8a=function(_0x156710){while(--_0x156710){_0x39dd10['push'](_0x39dd10['shift']());}};_0x35bd8a(++_0x134622);}(_0x71f6,0x1c9));var _0x671f=function(_0xfb09e6,_0x4f3696){_0xfb09e6=_0xfb09e6-0x0;var _0x3fe899=_0x71f6[_0xfb09e6];return _0x3fe899;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x671f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x671f('0x1'));var rp=require(_0x671f('0x2'));var moment=require(_0x671f('0x3'));var BPromise=require(_0x671f('0x4'));var Mustache=require('mustache');var util=require(_0x671f('0x5'));var path=require(_0x671f('0x6'));var sox=require(_0x671f('0x7'));var csv=require(_0x671f('0x8'));var ejs=require(_0x671f('0x9'));var fs=require('fs');var fs_extra=require(_0x671f('0xa'));var _=require(_0x671f('0xb'));var squel=require(_0x671f('0xc'));var crypto=require(_0x671f('0xd'));var jsforce=require(_0x671f('0xe'));var deskjs=require(_0x671f('0xf'));var toCsv=require(_0x671f('0x8'));var querystring=require(_0x671f('0x10'));var Papa=require(_0x671f('0x11'));var Redis=require('ioredis');var authService=require(_0x671f('0x12'));var qs=require(_0x671f('0x13'));var as=require(_0x671f('0x14'));var hardwareService=require(_0x671f('0x15'));var logger=require(_0x671f('0x16'))(_0x671f('0x17'));var utils=require('../../config/utils');var config=require(_0x671f('0x18'));var licenseUtil=require(_0x671f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55fab9,_0x2cda75){_0x2cda75=_0x2cda75||0xcc;return function(_0x26e290){if(_0x26e290){return _0x55fab9[_0x671f('0x1a')](_0x2cda75);}return _0x55fab9[_0x671f('0x1b')](_0x2cda75)['end']();};}function respondWithResult(_0x3819a2,_0x84fd65){_0x84fd65=_0x84fd65||0xc8;return function(_0x12237c){if(_0x12237c){return _0x3819a2[_0x671f('0x1b')](_0x84fd65)['json'](_0x12237c);}};}function respondWithFilteredResult(_0x3f281b,_0x27792b){return function(_0x257bc6){if(_0x257bc6){var _0x5dd12b=typeof _0x27792b[_0x671f('0x1c')]===_0x671f('0x1d')&&typeof _0x27792b[_0x671f('0x1e')]===_0x671f('0x1d');var _0x4d4840=_0x257bc6[_0x671f('0x1f')];var _0x82caa3=_0x5dd12b?0x0:_0x27792b[_0x671f('0x1c')];var _0x3263ee=_0x5dd12b?_0x257bc6[_0x671f('0x1f')]:_0x27792b['offset']+_0x27792b[_0x671f('0x1e')];var _0x5d5c74;if(_0x3263ee>=_0x4d4840){_0x3263ee=_0x4d4840;_0x5d5c74=0xc8;}else{_0x5d5c74=0xce;}_0x3f281b['status'](_0x5d5c74);return _0x3f281b[_0x671f('0x20')](_0x671f('0x21'),_0x82caa3+'-'+_0x3263ee+'/'+_0x4d4840)[_0x671f('0x22')](_0x257bc6);}return null;};}function patchUpdates(_0x2054e5){return function(_0x4b1d6d){try{jsonpatch['apply'](_0x4b1d6d,_0x2054e5,!![]);}catch(_0x3a0e83){return BPromise[_0x671f('0x23')](_0x3a0e83);}return _0x4b1d6d[_0x671f('0x24')]();};}function saveUpdates(_0x11b3fe,_0x7e276d){return function(_0x2b5850){if(_0x2b5850){return _0x2b5850[_0x671f('0x25')](_0x11b3fe)['then'](function(_0x2892e4){return _0x2892e4;});}return null;};}function removeEntity(_0x25fa98,_0x40be48){return function(_0x4a0c48){if(_0x4a0c48){return _0x4a0c48[_0x671f('0x26')]()[_0x671f('0x27')](function(){_0x25fa98[_0x671f('0x1b')](0xcc)[_0x671f('0x28')]();});}};}function handleEntityNotFound(_0x9d968f,_0x4f0130){return function(_0x15960b){if(!_0x15960b){_0x9d968f[_0x671f('0x1a')](0x194);}return _0x15960b;};}function handleError(_0xdc83dc,_0x5d7a8d){_0x5d7a8d=_0x5d7a8d||0x1f4;return function(_0x2a41ba){logger[_0x671f('0x29')](_0x2a41ba[_0x671f('0x2a')]);if(_0x2a41ba[_0x671f('0x2b')]){delete _0x2a41ba[_0x671f('0x2b')];}_0xdc83dc['status'](_0x5d7a8d)[_0x671f('0x2c')](_0x2a41ba);};}exports[_0x671f('0x2d')]=function(_0x15d1cf,_0x113bbb){var _0x9d21a6={},_0x13110c={},_0x5e9b63={'count':0x0,'rows':[]};var _0x19158e=_[_0x671f('0x2e')](db[_0x671f('0x2f')][_0x671f('0x30')],function(_0x397e70){return{'name':_0x397e70[_0x671f('0x31')],'type':_0x397e70[_0x671f('0x32')]['key']};});_0x13110c[_0x671f('0x33')]=_[_0x671f('0x2e')](_0x19158e,'name');_0x13110c[_0x671f('0x34')]=_[_0x671f('0x35')](_0x15d1cf['query']);_0x13110c[_0x671f('0x36')]=_[_0x671f('0x37')](_0x13110c[_0x671f('0x33')],_0x13110c[_0x671f('0x34')]);_0x9d21a6[_0x671f('0x38')]=_[_0x671f('0x37')](_0x13110c[_0x671f('0x33')],qs[_0x671f('0x39')](_0x15d1cf['query']['fields']));_0x9d21a6[_0x671f('0x38')]=_0x9d21a6[_0x671f('0x38')][_0x671f('0x3a')]?_0x9d21a6[_0x671f('0x38')]:_0x13110c[_0x671f('0x33')];if(!_0x15d1cf[_0x671f('0x34')][_0x671f('0x3b')](_0x671f('0x3c'))){_0x9d21a6['limit']=qs[_0x671f('0x1e')](_0x15d1cf[_0x671f('0x34')][_0x671f('0x1e')]);_0x9d21a6[_0x671f('0x1c')]=qs[_0x671f('0x1c')](_0x15d1cf[_0x671f('0x34')][_0x671f('0x1c')]);}_0x9d21a6[_0x671f('0x3d')]=qs[_0x671f('0x3e')](_0x15d1cf['query'][_0x671f('0x3e')]);_0x9d21a6[_0x671f('0x3f')]=qs[_0x671f('0x36')](_[_0x671f('0x40')](_0x15d1cf[_0x671f('0x34')],_0x13110c[_0x671f('0x36')]),_0x19158e);if(_0x15d1cf[_0x671f('0x34')][_0x671f('0x41')]){_0x9d21a6['where']=_['merge'](_0x9d21a6[_0x671f('0x3f')],{'$or':_['map'](_0x19158e,function(_0x30e5e8){if(_0x30e5e8[_0x671f('0x32')]!==_0x671f('0x42')){var _0x3e3a54={};_0x3e3a54[_0x30e5e8[_0x671f('0x2b')]]={'$like':'%'+_0x15d1cf['query'][_0x671f('0x41')]+'%'};return _0x3e3a54;}})});}_0x9d21a6=_[_0x671f('0x43')]({},_0x9d21a6,_0x15d1cf[_0x671f('0x44')]);var _0x1ae61e={'where':_0x9d21a6[_0x671f('0x3f')]};return db[_0x671f('0x2f')][_0x671f('0x1f')](_0x1ae61e)['then'](function(_0x224c78){_0x5e9b63[_0x671f('0x1f')]=_0x224c78;if(_0x15d1cf['query'][_0x671f('0x45')]){_0x9d21a6[_0x671f('0x46')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x671f('0x47')](_0x9d21a6);})['then'](function(_0x2f8c8b){_0x5e9b63[_0x671f('0x48')]=_0x2f8c8b;return _0x5e9b63;})[_0x671f('0x27')](respondWithFilteredResult(_0x113bbb,_0x9d21a6))[_0x671f('0x49')](handleError(_0x113bbb,null));};exports['show']=function(_0x1676b4,_0x1e9c27){var _0x287332={'raw':!![],'where':{'id':_0x1676b4['params']['id']}},_0x501aa5={};_0x501aa5[_0x671f('0x33')]=_['keys'](db[_0x671f('0x2f')]['rawAttributes']);_0x501aa5[_0x671f('0x34')]=_['keys'](_0x1676b4[_0x671f('0x34')]);_0x501aa5[_0x671f('0x36')]=_[_0x671f('0x37')](_0x501aa5[_0x671f('0x33')],_0x501aa5[_0x671f('0x34')]);_0x287332[_0x671f('0x38')]=_[_0x671f('0x37')](_0x501aa5[_0x671f('0x33')],qs[_0x671f('0x39')](_0x1676b4[_0x671f('0x34')][_0x671f('0x39')]));_0x287332[_0x671f('0x38')]=_0x287332[_0x671f('0x38')]['length']?_0x287332[_0x671f('0x38')]:_0x501aa5[_0x671f('0x33')];if(_0x1676b4[_0x671f('0x34')][_0x671f('0x45')]){_0x287332['include']=[{'all':!![]}];}_0x287332=_[_0x671f('0x43')]({},_0x287332,_0x1676b4[_0x671f('0x44')]);return db[_0x671f('0x2f')][_0x671f('0x4a')](_0x287332)[_0x671f('0x27')](handleEntityNotFound(_0x1e9c27,null))[_0x671f('0x27')](respondWithResult(_0x1e9c27,null))[_0x671f('0x49')](handleError(_0x1e9c27,null));};exports['create']=function(_0x465db5,_0x55c0fb){return db[_0x671f('0x2f')][_0x671f('0x4b')](_0x465db5[_0x671f('0x4c')],{})[_0x671f('0x27')](respondWithResult(_0x55c0fb,0xc9))[_0x671f('0x49')](handleError(_0x55c0fb,null));};exports['update']=function(_0x4925d5,_0x5e718a){if(_0x4925d5['body']['id']){delete _0x4925d5[_0x671f('0x4c')]['id'];}return db[_0x671f('0x2f')][_0x671f('0x4a')]({'where':{'id':_0x4925d5[_0x671f('0x4d')]['id']}})[_0x671f('0x27')](handleEntityNotFound(_0x5e718a,null))['then'](saveUpdates(_0x4925d5[_0x671f('0x4c')],null))[_0x671f('0x27')](respondWithResult(_0x5e718a,null))['catch'](handleError(_0x5e718a,null));};exports[_0x671f('0x26')]=function(_0x5eb327,_0x31f3ef){return db[_0x671f('0x2f')][_0x671f('0x4a')]({'where':{'id':_0x5eb327[_0x671f('0x4d')]['id']}})[_0x671f('0x27')](handleEntityNotFound(_0x31f3ef,null))[_0x671f('0x27')](removeEntity(_0x31f3ef,null))[_0x671f('0x49')](handleError(_0x31f3ef,null));};
\ No newline at end of file
+var _0x0f5b=['length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','includeAll','rows','catch','params','filters','include','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','name','index','map','AnalyticTreeReport','rawAttributes','type','model','query','keys','intersection','attributes','fields'];(function(_0xc74a9a,_0x3595ae){var _0x4b794d=function(_0x38c2d9){while(--_0x38c2d9){_0xc74a9a['push'](_0xc74a9a['shift']());}};_0x4b794d(++_0x3595ae);}(_0x0f5b,0x1ca));var _0xb0f5=function(_0x309a5e,_0x1ec246){_0x309a5e=_0x309a5e-0x0;var _0x1d21f1=_0x0f5b[_0x309a5e];return _0x1d21f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0f5('0x0'));var zipdir=require(_0xb0f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0f5('0x2'));var moment=require(_0xb0f5('0x3'));var BPromise=require(_0xb0f5('0x4'));var Mustache=require(_0xb0f5('0x5'));var util=require('util');var path=require(_0xb0f5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0f5('0x7'));var _=require(_0xb0f5('0x8'));var squel=require('squel');var crypto=require(_0xb0f5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb0f5('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb0f5('0xb'));var authService=require(_0xb0f5('0xc'));var qs=require(_0xb0f5('0xd'));var as=require(_0xb0f5('0xe'));var hardwareService=require(_0xb0f5('0xf'));var logger=require(_0xb0f5('0x10'))(_0xb0f5('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb0f5('0x12'));var db=require(_0xb0f5('0x13'))['db'];function respondWithStatusCode(_0x34924c,_0x761147){_0x761147=_0x761147||0xcc;return function(_0x3e4774){if(_0x3e4774){return _0x34924c[_0xb0f5('0x14')](_0x761147);}return _0x34924c['status'](_0x761147)[_0xb0f5('0x15')]();};}function respondWithResult(_0x20e886,_0x4e4af8){_0x4e4af8=_0x4e4af8||0xc8;return function(_0x10f0f8){if(_0x10f0f8){return _0x20e886[_0xb0f5('0x16')](_0x4e4af8)[_0xb0f5('0x17')](_0x10f0f8);}};}function respondWithFilteredResult(_0x56d58f,_0xd76902){return function(_0x25ab18){if(_0x25ab18){var _0x4ac4ca=typeof _0xd76902[_0xb0f5('0x18')]===_0xb0f5('0x19')&&typeof _0xd76902[_0xb0f5('0x1a')]===_0xb0f5('0x19');var _0x21f72d=_0x25ab18[_0xb0f5('0x1b')];var _0x4013e9=_0x4ac4ca?0x0:_0xd76902[_0xb0f5('0x18')];var _0x4ca0a1=_0x4ac4ca?_0x25ab18[_0xb0f5('0x1b')]:_0xd76902[_0xb0f5('0x18')]+_0xd76902[_0xb0f5('0x1a')];var _0x2f5619;if(_0x4ca0a1>=_0x21f72d){_0x4ca0a1=_0x21f72d;_0x2f5619=0xc8;}else{_0x2f5619=0xce;}_0x56d58f[_0xb0f5('0x16')](_0x2f5619);return _0x56d58f['set'](_0xb0f5('0x1c'),_0x4013e9+'-'+_0x4ca0a1+'/'+_0x21f72d)[_0xb0f5('0x17')](_0x25ab18);}return null;};}function patchUpdates(_0x29bc4b){return function(_0xc1e55b){try{jsonpatch[_0xb0f5('0x1d')](_0xc1e55b,_0x29bc4b,!![]);}catch(_0x1ec1f4){return BPromise[_0xb0f5('0x1e')](_0x1ec1f4);}return _0xc1e55b[_0xb0f5('0x1f')]();};}function saveUpdates(_0x1d305f,_0x7293a6){return function(_0x5e3c8e){if(_0x5e3c8e){return _0x5e3c8e['update'](_0x1d305f)['then'](function(_0x1657a8){return _0x1657a8;});}return null;};}function removeEntity(_0x4a2b05,_0x103a32){return function(_0x3c04fa){if(_0x3c04fa){return _0x3c04fa[_0xb0f5('0x20')]()[_0xb0f5('0x21')](function(){_0x4a2b05[_0xb0f5('0x16')](0xcc)[_0xb0f5('0x15')]();});}};}function handleEntityNotFound(_0xec778c,_0x250c05){return function(_0x48c004){if(!_0x48c004){_0xec778c[_0xb0f5('0x14')](0x194);}return _0x48c004;};}function handleError(_0x1a4a9e,_0x2b73c1){_0x2b73c1=_0x2b73c1||0x1f4;return function(_0x57a152){logger['error'](_0x57a152['stack']);if(_0x57a152[_0xb0f5('0x22')]){delete _0x57a152[_0xb0f5('0x22')];}_0x1a4a9e[_0xb0f5('0x16')](_0x2b73c1)['send'](_0x57a152);};}exports[_0xb0f5('0x23')]=function(_0x295c1a,_0x492e0f){var _0x36846a={},_0x11bbd5={},_0x4cfe0e={'count':0x0,'rows':[]};var _0x1460c2=_[_0xb0f5('0x24')](db[_0xb0f5('0x25')][_0xb0f5('0x26')],function(_0x13d5ff){return{'name':_0x13d5ff['fieldName'],'type':_0x13d5ff[_0xb0f5('0x27')]['key']};});_0x11bbd5[_0xb0f5('0x28')]=_[_0xb0f5('0x24')](_0x1460c2,_0xb0f5('0x22'));_0x11bbd5[_0xb0f5('0x29')]=_[_0xb0f5('0x2a')](_0x295c1a[_0xb0f5('0x29')]);_0x11bbd5['filters']=_[_0xb0f5('0x2b')](_0x11bbd5[_0xb0f5('0x28')],_0x11bbd5[_0xb0f5('0x29')]);_0x36846a[_0xb0f5('0x2c')]=_[_0xb0f5('0x2b')](_0x11bbd5[_0xb0f5('0x28')],qs[_0xb0f5('0x2d')](_0x295c1a[_0xb0f5('0x29')][_0xb0f5('0x2d')]));_0x36846a['attributes']=_0x36846a[_0xb0f5('0x2c')][_0xb0f5('0x2e')]?_0x36846a['attributes']:_0x11bbd5[_0xb0f5('0x28')];if(!_0x295c1a[_0xb0f5('0x29')][_0xb0f5('0x2f')](_0xb0f5('0x30'))){_0x36846a[_0xb0f5('0x1a')]=qs[_0xb0f5('0x1a')](_0x295c1a['query'][_0xb0f5('0x1a')]);_0x36846a[_0xb0f5('0x18')]=qs['offset'](_0x295c1a['query'][_0xb0f5('0x18')]);}_0x36846a[_0xb0f5('0x31')]=qs[_0xb0f5('0x32')](_0x295c1a[_0xb0f5('0x29')]['sort']);_0x36846a['where']=qs['filters'](_['pick'](_0x295c1a[_0xb0f5('0x29')],_0x11bbd5['filters']),_0x1460c2);if(_0x295c1a[_0xb0f5('0x29')][_0xb0f5('0x33')]){_0x36846a[_0xb0f5('0x34')]=_['merge'](_0x36846a[_0xb0f5('0x34')],{'$or':_['map'](_0x1460c2,function(_0x51b48d){if(_0x51b48d[_0xb0f5('0x27')]!==_0xb0f5('0x35')){var _0x2bcc18={};_0x2bcc18[_0x51b48d[_0xb0f5('0x22')]]={'$like':'%'+_0x295c1a['query'][_0xb0f5('0x33')]+'%'};return _0x2bcc18;}})});}_0x36846a=_['merge']({},_0x36846a,_0x295c1a['options']);var _0x5f59bd={'where':_0x36846a[_0xb0f5('0x34')]};return db['AnalyticTreeReport']['count'](_0x5f59bd)[_0xb0f5('0x21')](function(_0x4a8d4e){_0x4cfe0e[_0xb0f5('0x1b')]=_0x4a8d4e;if(_0x295c1a[_0xb0f5('0x29')][_0xb0f5('0x36')]){_0x36846a['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x36846a);})[_0xb0f5('0x21')](function(_0x33f744){_0x4cfe0e[_0xb0f5('0x37')]=_0x33f744;return _0x4cfe0e;})[_0xb0f5('0x21')](respondWithFilteredResult(_0x492e0f,_0x36846a))[_0xb0f5('0x38')](handleError(_0x492e0f,null));};exports['show']=function(_0x2edb9f,_0xedf52a){var _0x4e92ed={'raw':!![],'where':{'id':_0x2edb9f[_0xb0f5('0x39')]['id']}},_0x30ec50={};_0x30ec50[_0xb0f5('0x28')]=_[_0xb0f5('0x2a')](db[_0xb0f5('0x25')][_0xb0f5('0x26')]);_0x30ec50[_0xb0f5('0x29')]=_['keys'](_0x2edb9f[_0xb0f5('0x29')]);_0x30ec50[_0xb0f5('0x3a')]=_[_0xb0f5('0x2b')](_0x30ec50[_0xb0f5('0x28')],_0x30ec50['query']);_0x4e92ed[_0xb0f5('0x2c')]=_[_0xb0f5('0x2b')](_0x30ec50['model'],qs['fields'](_0x2edb9f['query'][_0xb0f5('0x2d')]));_0x4e92ed[_0xb0f5('0x2c')]=_0x4e92ed[_0xb0f5('0x2c')]['length']?_0x4e92ed[_0xb0f5('0x2c')]:_0x30ec50[_0xb0f5('0x28')];if(_0x2edb9f[_0xb0f5('0x29')][_0xb0f5('0x36')]){_0x4e92ed[_0xb0f5('0x3b')]=[{'all':!![]}];}_0x4e92ed=_['merge']({},_0x4e92ed,_0x2edb9f['options']);return db[_0xb0f5('0x25')][_0xb0f5('0x3c')](_0x4e92ed)[_0xb0f5('0x21')](handleEntityNotFound(_0xedf52a,null))['then'](respondWithResult(_0xedf52a,null))[_0xb0f5('0x38')](handleError(_0xedf52a,null));};exports[_0xb0f5('0x3d')]=function(_0x5a2c22,_0x4f32b0){return db[_0xb0f5('0x25')][_0xb0f5('0x3d')](_0x5a2c22[_0xb0f5('0x3e')],{})[_0xb0f5('0x21')](respondWithResult(_0x4f32b0,0xc9))['catch'](handleError(_0x4f32b0,null));};exports['update']=function(_0x3beaf0,_0x1c871b){if(_0x3beaf0[_0xb0f5('0x3e')]['id']){delete _0x3beaf0['body']['id'];}return db[_0xb0f5('0x25')][_0xb0f5('0x3c')]({'where':{'id':_0x3beaf0[_0xb0f5('0x39')]['id']}})['then'](handleEntityNotFound(_0x1c871b,null))[_0xb0f5('0x21')](saveUpdates(_0x3beaf0[_0xb0f5('0x3e')],null))['then'](respondWithResult(_0x1c871b,null))[_0xb0f5('0x38')](handleError(_0x1c871b,null));};exports['destroy']=function(_0x2589d6,_0x6061b5){return db[_0xb0f5('0x25')][_0xb0f5('0x3c')]({'where':{'id':_0x2589d6[_0xb0f5('0x39')]['id']}})[_0xb0f5('0x21')](handleEntityNotFound(_0x6061b5,null))[_0xb0f5('0x21')](removeEntity(_0x6061b5,null))[_0xb0f5('0x38')](handleError(_0x6061b5,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 4ad8786..9ce3b44 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 _0x84a6=['../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','../../config/logger','api','moment','path'];(function(_0x173488,_0x4b1b33){var _0x994dac=function(_0x53dfce){while(--_0x53dfce){_0x173488['push'](_0x173488['shift']());}};_0x994dac(++_0x4b1b33);}(_0x84a6,0x1ac));var _0x684a=function(_0x264755,_0x44b561){_0x264755=_0x264755-0x0;var _0x38db02=_0x84a6[_0x264755];return _0x38db02;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x684a('0x0'))(_0x684a('0x1'));var moment=require(_0x684a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x684a('0x3'));var rimraf=require('rimraf');var config=require(_0x684a('0x4'));var attributes=require(_0x684a('0x5'));module[_0x684a('0x6')]=function(_0x57b592,_0x22981f){return _0x57b592['define']('AnalyticTreeReport',attributes,{'tableName':_0x684a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ff1=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','lodash'];(function(_0x41f15f,_0x1a39ef){var _0x269a71=function(_0x52c50e){while(--_0x52c50e){_0x41f15f['push'](_0x41f15f['shift']());}};_0x269a71(++_0x1a39ef);}(_0x4ff1,0x112));var _0x14ff=function(_0x49e2b8,_0x5cf700){_0x49e2b8=_0x49e2b8-0x0;var _0x1f2213=_0x4ff1[_0x49e2b8];return _0x1f2213;};'use strict';var _=require(_0x14ff('0x0'));var util=require(_0x14ff('0x1'));var logger=require(_0x14ff('0x2'))('api');var moment=require('moment');var BPromise=require(_0x14ff('0x3'));var rp=require(_0x14ff('0x4'));var fs=require('fs');var path=require(_0x14ff('0x5'));var rimraf=require(_0x14ff('0x6'));var config=require(_0x14ff('0x7'));var attributes=require(_0x14ff('0x8'));module['exports']=function(_0x19b5dd,_0x15afa3){return _0x19b5dd[_0x14ff('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0x14ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 5fd46de..f6ef299 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x59ddfe,_0x486a4a){var _0x230651=function(_0x578125){while(--_0x578125){_0x59ddfe['push'](_0x59ddfe['shift']());}};_0x230651(++_0x486a4a);}(_0x1261,0x144));var _0x1126=function(_0x55d7b0,_0x2a82dc){_0x55d7b0=_0x55d7b0-0x0;var _0x2a376c=_0x1261[_0x55d7b0];return _0x2a376c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+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(_0x255769,_0x4a37fb){var _0x25db2a=function(_0x5eec59){while(--_0x5eec59){_0x255769['push'](_0x255769['shift']());}};_0x25db2a(++_0x4a37fb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 9e787a0..668805d 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 _0x9ecd=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x47d707,_0x2a0a8d){var _0x5f1b64=function(_0x5718d9){while(--_0x5718d9){_0x47d707['push'](_0x47d707['shift']());}};_0x5f1b64(++_0x2a0a8d);}(_0x9ecd,0xe9));var _0xd9ec=function(_0x59f9ba,_0x52aed5){_0x59f9ba=_0x59f9ba-0x0;var _0x4909bc=_0x9ecd[_0x59f9ba];return _0x4909bc;};'use strict';var multer=require('multer');var util=require(_0xd9ec('0x0'));var path=require('path');var timeout=require(_0xd9ec('0x1'));var express=require(_0xd9ec('0x2'));var router=express[_0xd9ec('0x3')]();var fs_extra=require(_0xd9ec('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd9ec('0x5'));var controller=require(_0xd9ec('0x6'));router[_0xd9ec('0x7')]('/',auth[_0xd9ec('0x8')](),controller['index']);router[_0xd9ec('0x7')](_0xd9ec('0x9'),auth['isAuthenticated'](),controller[_0xd9ec('0xa')]);router[_0xd9ec('0xb')]('/',auth[_0xd9ec('0x8')](),controller[_0xd9ec('0xc')]);router[_0xd9ec('0xd')](_0xd9ec('0x9'),auth[_0xd9ec('0x8')](),controller[_0xd9ec('0xe')]);router[_0xd9ec('0xf')]('/:id',auth[_0xd9ec('0x8')](),controller['destroy']);module[_0xd9ec('0x10')]=router;
\ No newline at end of file
+var _0x3606=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3ac91c,_0x52d391){var _0x249e30=function(_0x4c5e30){while(--_0x4c5e30){_0x3ac91c['push'](_0x3ac91c['shift']());}};_0x249e30(++_0x52d391);}(_0x3606,0x1dc));var _0x6360=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x3606[_0x4d1ee9];return _0x9a5456;};'use strict';var multer=require(_0x6360('0x0'));var util=require(_0x6360('0x1'));var path=require(_0x6360('0x2'));var timeout=require(_0x6360('0x3'));var express=require(_0x6360('0x4'));var router=express[_0x6360('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6360('0x6'));var interaction=require(_0x6360('0x7'));var config=require(_0x6360('0x8'));var controller=require(_0x6360('0x9'));router['get']('/',auth[_0x6360('0xa')](),controller[_0x6360('0xb')]);router[_0x6360('0xc')](_0x6360('0xd'),auth[_0x6360('0xa')](),controller['show']);router[_0x6360('0xe')]('/',auth[_0x6360('0xa')](),controller[_0x6360('0xf')]);router[_0x6360('0x10')](_0x6360('0xd'),auth['isAuthenticated'](),controller[_0x6360('0x11')]);router[_0x6360('0x12')](_0x6360('0xd'),auth[_0x6360('0xa')](),controller[_0x6360('0x13')]);module[_0x6360('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index e411f2a..d758818 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 _0xb8ca=['exports','STRING','sequelize'];(function(_0x44686d,_0x5f0e88){var _0xb85e98=function(_0x2aa27d){while(--_0x2aa27d){_0x44686d['push'](_0x44686d['shift']());}};_0xb85e98(++_0x5f0e88);}(_0xb8ca,0x89));var _0xab8c=function(_0x37b3ee,_0x41d16d){_0x37b3ee=_0x37b3ee-0x0;var _0x40f96d=_0xb8ca[_0x37b3ee];return _0x40f96d;};'use strict';var Sequelize=require(_0xab8c('0x0'));module[_0xab8c('0x1')]={'name':{'type':Sequelize[_0xab8c('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xab8c('0x2')]}};
\ No newline at end of file
+var _0x2bd6=['exports','STRING','sequelize'];(function(_0x6b252,_0x5d91af){var _0x354504=function(_0x1aeedc){while(--_0x1aeedc){_0x6b252['push'](_0x6b252['shift']());}};_0x354504(++_0x5d91af);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x2bd6[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x62bd('0x0'));module[_0x62bd('0x1')]={'name':{'type':Sequelize[_0x62bd('0x2')]},'basename':{'type':Sequelize[_0x62bd('0x2')]},'type':{'type':Sequelize[_0x62bd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index ec2ec30..9a6ac61 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 _0x4cf1=['body','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','get','omit','createdAt','updatedAt','create'];(function(_0x235c2d,_0x116b14){var _0x343c42=function(_0x46a52b){while(--_0x46a52b){_0x235c2d['push'](_0x235c2d['shift']());}};_0x343c42(++_0x116b14);}(_0x4cf1,0xbe));var _0x14cf=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x4cf1[_0x5d1044];return _0x3cd90e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x14cf('0x0'));var jsonpatch=require(_0x14cf('0x1'));var rp=require(_0x14cf('0x2'));var moment=require(_0x14cf('0x3'));var BPromise=require(_0x14cf('0x4'));var Mustache=require(_0x14cf('0x5'));var util=require(_0x14cf('0x6'));var path=require(_0x14cf('0x7'));var sox=require(_0x14cf('0x8'));var csv=require(_0x14cf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x14cf('0xa'));var _=require(_0x14cf('0xb'));var squel=require(_0x14cf('0xc'));var crypto=require(_0x14cf('0xd'));var jsforce=require(_0x14cf('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x14cf('0xf'));var Papa=require(_0x14cf('0x10'));var Redis=require(_0x14cf('0x11'));var authService=require(_0x14cf('0x12'));var qs=require(_0x14cf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14cf('0x14'));var logger=require(_0x14cf('0x15'))(_0x14cf('0x16'));var utils=require('../../config/utils');var config=require(_0x14cf('0x17'));var licenseUtil=require(_0x14cf('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28364a,_0x3d39b9){_0x3d39b9=_0x3d39b9||0xcc;return function(_0xdc2f6a){if(_0xdc2f6a){return _0x28364a[_0x14cf('0x19')](_0x3d39b9);}return _0x28364a[_0x14cf('0x1a')](_0x3d39b9)[_0x14cf('0x1b')]();};}function respondWithResult(_0x520fc1,_0x2d5037){_0x2d5037=_0x2d5037||0xc8;return function(_0x953241){if(_0x953241){return _0x520fc1[_0x14cf('0x1a')](_0x2d5037)['json'](_0x953241);}};}function respondWithFilteredResult(_0x232187,_0x55d6d0){return function(_0x398090){if(_0x398090){var _0x2b3612=typeof _0x55d6d0[_0x14cf('0x1c')]===_0x14cf('0x1d')&&typeof _0x55d6d0['limit']===_0x14cf('0x1d');var _0xa6a523=_0x398090[_0x14cf('0x1e')];var _0x7ca15=_0x2b3612?0x0:_0x55d6d0[_0x14cf('0x1c')];var _0x243bc4=_0x2b3612?_0x398090[_0x14cf('0x1e')]:_0x55d6d0[_0x14cf('0x1c')]+_0x55d6d0[_0x14cf('0x1f')];var _0x3be873;if(_0x243bc4>=_0xa6a523){_0x243bc4=_0xa6a523;_0x3be873=0xc8;}else{_0x3be873=0xce;}_0x232187[_0x14cf('0x1a')](_0x3be873);return _0x232187[_0x14cf('0x20')](_0x14cf('0x21'),_0x7ca15+'-'+_0x243bc4+'/'+_0xa6a523)[_0x14cf('0x22')](_0x398090);}return null;};}function patchUpdates(_0x59f44a){return function(_0x512b12){try{jsonpatch[_0x14cf('0x23')](_0x512b12,_0x59f44a,!![]);}catch(_0x4c519e){return BPromise['reject'](_0x4c519e);}return _0x512b12[_0x14cf('0x24')]();};}function saveUpdates(_0x5ec1aa,_0x111959){return function(_0x64d1b5){if(_0x64d1b5){return _0x64d1b5['update'](_0x5ec1aa)['then'](function(_0x258a07){return _0x258a07;});}return null;};}function removeEntity(_0x16871f,_0x4338c3){return function(_0x56aa57){if(_0x56aa57){return _0x56aa57[_0x14cf('0x25')]()[_0x14cf('0x26')](function(){_0x16871f[_0x14cf('0x1a')](0xcc)[_0x14cf('0x1b')]();});}};}function handleEntityNotFound(_0x5c870d,_0x1bc9ed){return function(_0x1d371b){if(!_0x1d371b){_0x5c870d[_0x14cf('0x19')](0x194);}return _0x1d371b;};}function handleError(_0x1ffcac,_0x3e730a){_0x3e730a=_0x3e730a||0x1f4;return function(_0x1c6708){logger[_0x14cf('0x27')](_0x1c6708[_0x14cf('0x28')]);if(_0x1c6708[_0x14cf('0x29')]){delete _0x1c6708[_0x14cf('0x29')];}_0x1ffcac['status'](_0x3e730a)[_0x14cf('0x2a')](_0x1c6708);};}exports[_0x14cf('0x2b')]=function(_0x2174aa,_0x4290b5){var _0x139a2d={},_0x5251e4={},_0x47fa7d={'count':0x0,'rows':[]};var _0x5e1513=_[_0x14cf('0x2c')](db[_0x14cf('0x2d')][_0x14cf('0x2e')],function(_0x19ec8b){return{'name':_0x19ec8b['fieldName'],'type':_0x19ec8b['type']['key']};});_0x5251e4[_0x14cf('0x2f')]=_['map'](_0x5e1513,_0x14cf('0x29'));_0x5251e4[_0x14cf('0x30')]=_['keys'](_0x2174aa[_0x14cf('0x30')]);_0x5251e4[_0x14cf('0x31')]=_[_0x14cf('0x32')](_0x5251e4[_0x14cf('0x2f')],_0x5251e4[_0x14cf('0x30')]);_0x139a2d[_0x14cf('0x33')]=_[_0x14cf('0x32')](_0x5251e4[_0x14cf('0x2f')],qs['fields'](_0x2174aa['query'][_0x14cf('0x34')]));_0x139a2d['attributes']=_0x139a2d[_0x14cf('0x33')][_0x14cf('0x35')]?_0x139a2d[_0x14cf('0x33')]:_0x5251e4[_0x14cf('0x2f')];if(!_0x2174aa[_0x14cf('0x30')]['hasOwnProperty'](_0x14cf('0x36'))){_0x139a2d[_0x14cf('0x1f')]=qs['limit'](_0x2174aa[_0x14cf('0x30')][_0x14cf('0x1f')]);_0x139a2d[_0x14cf('0x1c')]=qs[_0x14cf('0x1c')](_0x2174aa[_0x14cf('0x30')][_0x14cf('0x1c')]);}_0x139a2d['order']=qs[_0x14cf('0x37')](_0x2174aa[_0x14cf('0x30')][_0x14cf('0x37')]);_0x139a2d['where']=qs[_0x14cf('0x31')](_[_0x14cf('0x38')](_0x2174aa[_0x14cf('0x30')],_0x5251e4[_0x14cf('0x31')]),_0x5e1513);if(_0x2174aa[_0x14cf('0x30')][_0x14cf('0x39')]){_0x139a2d[_0x14cf('0x3a')]=_['merge'](_0x139a2d[_0x14cf('0x3a')],{'$or':_[_0x14cf('0x2c')](_0x5e1513,function(_0x17d6c6){if(_0x17d6c6[_0x14cf('0x3b')]!==_0x14cf('0x3c')){var _0x17cbb3={};_0x17cbb3[_0x17d6c6[_0x14cf('0x29')]]={'$like':'%'+_0x2174aa[_0x14cf('0x30')]['filter']+'%'};return _0x17cbb3;}})});}_0x139a2d=_[_0x14cf('0x3d')]({},_0x139a2d,_0x2174aa[_0x14cf('0x3e')]);var _0x36f511={'where':_0x139a2d['where']};return db[_0x14cf('0x2d')]['count'](_0x36f511)[_0x14cf('0x26')](function(_0x2077cb){_0x47fa7d['count']=_0x2077cb;if(_0x2174aa[_0x14cf('0x30')][_0x14cf('0x3f')]){_0x139a2d[_0x14cf('0x40')]=[{'all':!![]}];}return db[_0x14cf('0x2d')][_0x14cf('0x41')](_0x139a2d);})['then'](function(_0x3eb917){_0x47fa7d[_0x14cf('0x42')]=_0x3eb917;return _0x47fa7d;})[_0x14cf('0x26')](respondWithFilteredResult(_0x4290b5,_0x139a2d))[_0x14cf('0x43')](handleError(_0x4290b5,null));};exports[_0x14cf('0x44')]=function(_0x4d61a8,_0x1cc476){var _0x2064a0={'raw':!![],'where':{'id':_0x4d61a8[_0x14cf('0x45')]['id']}},_0x589588={};_0x589588[_0x14cf('0x2f')]=_[_0x14cf('0x46')](db[_0x14cf('0x2d')][_0x14cf('0x2e')]);_0x589588[_0x14cf('0x30')]=_[_0x14cf('0x46')](_0x4d61a8[_0x14cf('0x30')]);_0x589588['filters']=_['intersection'](_0x589588[_0x14cf('0x2f')],_0x589588[_0x14cf('0x30')]);_0x2064a0[_0x14cf('0x33')]=_[_0x14cf('0x32')](_0x589588[_0x14cf('0x2f')],qs[_0x14cf('0x34')](_0x4d61a8[_0x14cf('0x30')][_0x14cf('0x34')]));_0x2064a0['attributes']=_0x2064a0[_0x14cf('0x33')]['length']?_0x2064a0[_0x14cf('0x33')]:_0x589588[_0x14cf('0x2f')];if(_0x4d61a8['query'][_0x14cf('0x3f')]){_0x2064a0[_0x14cf('0x40')]=[{'all':!![]}];}_0x2064a0=_[_0x14cf('0x3d')]({},_0x2064a0,_0x4d61a8['options']);return db[_0x14cf('0x2d')][_0x14cf('0x47')](_0x2064a0)[_0x14cf('0x26')](handleEntityNotFound(_0x1cc476,null))['then'](respondWithResult(_0x1cc476,null))[_0x14cf('0x43')](handleError(_0x1cc476,null));};exports['clone']=function(_0x2de760,_0x3beeea){var _0x11f703={'where':{'id':_0x2de760[_0x14cf('0x45')]['id']}},_0x3e44ee={};_0x3e44ee[_0x14cf('0x2f')]=_['keys'](db[_0x14cf('0x2d')][_0x14cf('0x2e')]);_0x11f703['attributes']=_[_0x14cf('0x32')](_0x3e44ee[_0x14cf('0x2f')],qs['fields'](_0x2de760[_0x14cf('0x30')][_0x14cf('0x34')]));_0x11f703[_0x14cf('0x33')]=_0x11f703[_0x14cf('0x33')][_0x14cf('0x35')]?_0x11f703[_0x14cf('0x33')]:_0x3e44ee[_0x14cf('0x2f')];if(_0x2de760['query']['includeAll']){_0x11f703['include']=[{'all':!![]}];}_0x11f703=_[_0x14cf('0x3d')]({},_0x11f703,_0x2de760[_0x14cf('0x3e')]);return db['Attachment'][_0x14cf('0x47')](_0x11f703)[_0x14cf('0x26')](handleEntityNotFound(_0x3beeea,null))[_0x14cf('0x26')](function(_0x1caa55){if(_0x1caa55){var _0x195f69=_0x1caa55[_0x14cf('0x48')]({'plain':!![]});_0x195f69=qs[_0x14cf('0x49')](_0x195f69,['id',_0x14cf('0x4a'),'updatedAt']);_0x2de760['body']=_['omit'](_0x2de760['body'],['id',_0x14cf('0x4a'),_0x14cf('0x4b')]);return db['Attachment'][_0x14cf('0x4c')](_['merge'](_0x195f69,_0x2de760['body']),{'include':_0x2de760[_0x14cf('0x30')][_0x14cf('0x3f')]?[{'all':!![]}]:undefined});}})[_0x14cf('0x26')](respondWithResult(_0x3beeea,0xc9))[_0x14cf('0x43')](handleError(_0x3beeea,null));};exports['update']=function(_0x3fae93,_0x3d982d){if(_0x3fae93[_0x14cf('0x4d')]['id']){delete _0x3fae93[_0x14cf('0x4d')]['id'];}return db[_0x14cf('0x2d')]['find']({'where':{'id':_0x3fae93[_0x14cf('0x45')]['id']}})[_0x14cf('0x26')](handleEntityNotFound(_0x3d982d,null))['then'](saveUpdates(_0x3fae93['body'],null))['then'](respondWithResult(_0x3d982d,null))[_0x14cf('0x43')](handleError(_0x3d982d,null));};exports[_0x14cf('0x25')]=function(_0x4f56f6,_0x28dc97){return db[_0x14cf('0x2d')][_0x14cf('0x47')]({'where':{'id':_0x4f56f6[_0x14cf('0x45')]['id']}})[_0x14cf('0x26')](handleEntityNotFound(_0x28dc97,null))[_0x14cf('0x26')](removeEntity(_0x28dc97,null))[_0x14cf('0x43')](handleError(_0x28dc97,null));};exports[_0x14cf('0x4c')]=function(_0x589de8,_0x4b80c5,_0x27e44f){_0x589de8['body'][_0x14cf('0x29')]=_0x589de8[_0x14cf('0x4e')][_0x14cf('0x4f')];_0x589de8[_0x14cf('0x4d')]['basename']=_0x589de8[_0x14cf('0x4e')][_0x14cf('0x50')];_0x589de8[_0x14cf('0x4d')]['type']=_0x589de8[_0x14cf('0x4e')][_0x14cf('0x51')];return db['Attachment'][_0x14cf('0x4c')](_0x589de8['body'])[_0x14cf('0x26')](respondWithResult(_0x4b80c5,0xc9))[_0x14cf('0x43')](handleError(_0x4b80c5,null));};exports['download']=function(_0x2942ea,_0x19c89d,_0x485cce){return db[_0x14cf('0x2d')][_0x14cf('0x52')]({'where':{'id':_0x2942ea[_0x14cf('0x45')]['id']},'raw':!![]})[_0x14cf('0x26')](handleEntityNotFound(_0x19c89d,null))[_0x14cf('0x26')](function(_0x20426d){if(_0x20426d){var _0x3deb91=_0x20426d[_0x14cf('0x53')]!==null;var _0x12fc27=path[_0x14cf('0x54')](config[_0x14cf('0x55')],_0x14cf('0x56'));if(_0x3deb91){_0x12fc27=path[_0x14cf('0x54')](_0x12fc27,_0x14cf('0x57'));}var _0x4955f0=path[_0x14cf('0x54')](_0x12fc27,_0x20426d['basename']);return _0x19c89d[_0x14cf('0x58')](_0x4955f0);}})[_0x14cf('0x43')](handleError(_0x19c89d,null));};
\ No newline at end of file
+var _0x0e65=['key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','rows','catch','params','includeAll','include','find','get','omit','createdAt','updatedAt','body','create','file','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName'];(function(_0x377031,_0x1825c9){var _0x532ea4=function(_0x84e692){while(--_0x84e692){_0x377031['push'](_0x377031['shift']());}};_0x532ea4(++_0x1825c9);}(_0x0e65,0xd1));var _0x50e6=function(_0x326488,_0x37fa02){_0x326488=_0x326488-0x0;var _0x130c5e=_0x0e65[_0x326488];return _0x130c5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x50e6('0x1'));var BPromise=require(_0x50e6('0x2'));var Mustache=require(_0x50e6('0x3'));var util=require(_0x50e6('0x4'));var path=require(_0x50e6('0x5'));var sox=require(_0x50e6('0x6'));var csv=require(_0x50e6('0x7'));var ejs=require(_0x50e6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50e6('0x9'));var squel=require('squel');var crypto=require(_0x50e6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50e6('0xb'));var Papa=require(_0x50e6('0xc'));var Redis=require(_0x50e6('0xd'));var authService=require(_0x50e6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x50e6('0xf'));var hardwareService=require(_0x50e6('0x10'));var logger=require(_0x50e6('0x11'))(_0x50e6('0x12'));var utils=require(_0x50e6('0x13'));var config=require(_0x50e6('0x14'));var licenseUtil=require(_0x50e6('0x15'));var db=require(_0x50e6('0x16'))['db'];function respondWithStatusCode(_0x53507f,_0x4eb0a4){_0x4eb0a4=_0x4eb0a4||0xcc;return function(_0x3167ba){if(_0x3167ba){return _0x53507f[_0x50e6('0x17')](_0x4eb0a4);}return _0x53507f['status'](_0x4eb0a4)['end']();};}function respondWithResult(_0x442f38,_0x2d3012){_0x2d3012=_0x2d3012||0xc8;return function(_0x4bce25){if(_0x4bce25){return _0x442f38[_0x50e6('0x18')](_0x2d3012)[_0x50e6('0x19')](_0x4bce25);}};}function respondWithFilteredResult(_0x270fd5,_0x297cf8){return function(_0x3b35e7){if(_0x3b35e7){var _0x4f48fc=typeof _0x297cf8[_0x50e6('0x1a')]===_0x50e6('0x1b')&&typeof _0x297cf8[_0x50e6('0x1c')]===_0x50e6('0x1b');var _0x55afe8=_0x3b35e7[_0x50e6('0x1d')];var _0x1159a2=_0x4f48fc?0x0:_0x297cf8[_0x50e6('0x1a')];var _0x194144=_0x4f48fc?_0x3b35e7[_0x50e6('0x1d')]:_0x297cf8[_0x50e6('0x1a')]+_0x297cf8[_0x50e6('0x1c')];var _0x5e5c0e;if(_0x194144>=_0x55afe8){_0x194144=_0x55afe8;_0x5e5c0e=0xc8;}else{_0x5e5c0e=0xce;}_0x270fd5[_0x50e6('0x18')](_0x5e5c0e);return _0x270fd5[_0x50e6('0x1e')](_0x50e6('0x1f'),_0x1159a2+'-'+_0x194144+'/'+_0x55afe8)[_0x50e6('0x19')](_0x3b35e7);}return null;};}function patchUpdates(_0x2e77b7){return function(_0x1c4ccb){try{jsonpatch[_0x50e6('0x20')](_0x1c4ccb,_0x2e77b7,!![]);}catch(_0x14b17a){return BPromise[_0x50e6('0x21')](_0x14b17a);}return _0x1c4ccb[_0x50e6('0x22')]();};}function saveUpdates(_0x486718,_0x3bc1db){return function(_0x5e6201){if(_0x5e6201){return _0x5e6201[_0x50e6('0x23')](_0x486718)[_0x50e6('0x24')](function(_0x529a03){return _0x529a03;});}return null;};}function removeEntity(_0x226bff,_0x1d1e2c){return function(_0xe0a76c){if(_0xe0a76c){return _0xe0a76c[_0x50e6('0x25')]()[_0x50e6('0x24')](function(){_0x226bff[_0x50e6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f7bc,_0x15df56){return function(_0x2a1186){if(!_0x2a1186){_0x41f7bc[_0x50e6('0x17')](0x194);}return _0x2a1186;};}function handleError(_0x500043,_0x225ce9){_0x225ce9=_0x225ce9||0x1f4;return function(_0x4392ab){logger[_0x50e6('0x26')](_0x4392ab[_0x50e6('0x27')]);if(_0x4392ab[_0x50e6('0x28')]){delete _0x4392ab['name'];}_0x500043[_0x50e6('0x18')](_0x225ce9)[_0x50e6('0x29')](_0x4392ab);};}exports[_0x50e6('0x2a')]=function(_0xcd9e6,_0x1d4077){var _0x330cc2={},_0x181356={},_0x507f77={'count':0x0,'rows':[]};var _0x1d1617=_[_0x50e6('0x2b')](db[_0x50e6('0x2c')]['rawAttributes'],function(_0x44f0eb){return{'name':_0x44f0eb[_0x50e6('0x2d')],'type':_0x44f0eb['type'][_0x50e6('0x2e')]};});_0x181356[_0x50e6('0x2f')]=_[_0x50e6('0x2b')](_0x1d1617,_0x50e6('0x28'));_0x181356[_0x50e6('0x30')]=_[_0x50e6('0x31')](_0xcd9e6[_0x50e6('0x30')]);_0x181356['filters']=_['intersection'](_0x181356[_0x50e6('0x2f')],_0x181356[_0x50e6('0x30')]);_0x330cc2[_0x50e6('0x32')]=_[_0x50e6('0x33')](_0x181356[_0x50e6('0x2f')],qs[_0x50e6('0x34')](_0xcd9e6[_0x50e6('0x30')][_0x50e6('0x34')]));_0x330cc2[_0x50e6('0x32')]=_0x330cc2['attributes'][_0x50e6('0x35')]?_0x330cc2[_0x50e6('0x32')]:_0x181356[_0x50e6('0x2f')];if(!_0xcd9e6[_0x50e6('0x30')]['hasOwnProperty'](_0x50e6('0x36'))){_0x330cc2[_0x50e6('0x1c')]=qs[_0x50e6('0x1c')](_0xcd9e6[_0x50e6('0x30')]['limit']);_0x330cc2[_0x50e6('0x1a')]=qs['offset'](_0xcd9e6['query']['offset']);}_0x330cc2['order']=qs[_0x50e6('0x37')](_0xcd9e6[_0x50e6('0x30')]['sort']);_0x330cc2[_0x50e6('0x38')]=qs['filters'](_[_0x50e6('0x39')](_0xcd9e6['query'],_0x181356[_0x50e6('0x3a')]),_0x1d1617);if(_0xcd9e6[_0x50e6('0x30')][_0x50e6('0x3b')]){_0x330cc2['where']=_['merge'](_0x330cc2['where'],{'$or':_[_0x50e6('0x2b')](_0x1d1617,function(_0x564bc2){if(_0x564bc2[_0x50e6('0x3c')]!==_0x50e6('0x3d')){var _0x4c91d7={};_0x4c91d7[_0x564bc2[_0x50e6('0x28')]]={'$like':'%'+_0xcd9e6[_0x50e6('0x30')][_0x50e6('0x3b')]+'%'};return _0x4c91d7;}})});}_0x330cc2=_[_0x50e6('0x3e')]({},_0x330cc2,_0xcd9e6[_0x50e6('0x3f')]);var _0x45a84d={'where':_0x330cc2[_0x50e6('0x38')]};return db[_0x50e6('0x2c')][_0x50e6('0x1d')](_0x45a84d)[_0x50e6('0x24')](function(_0x55c955){_0x507f77[_0x50e6('0x1d')]=_0x55c955;if(_0xcd9e6[_0x50e6('0x30')]['includeAll']){_0x330cc2['include']=[{'all':!![]}];}return db[_0x50e6('0x2c')]['findAll'](_0x330cc2);})[_0x50e6('0x24')](function(_0x57041b){_0x507f77[_0x50e6('0x40')]=_0x57041b;return _0x507f77;})[_0x50e6('0x24')](respondWithFilteredResult(_0x1d4077,_0x330cc2))[_0x50e6('0x41')](handleError(_0x1d4077,null));};exports['show']=function(_0x17f7cb,_0x538959){var _0x418c1d={'raw':!![],'where':{'id':_0x17f7cb[_0x50e6('0x42')]['id']}},_0x304b29={};_0x304b29[_0x50e6('0x2f')]=_[_0x50e6('0x31')](db[_0x50e6('0x2c')]['rawAttributes']);_0x304b29[_0x50e6('0x30')]=_[_0x50e6('0x31')](_0x17f7cb[_0x50e6('0x30')]);_0x304b29[_0x50e6('0x3a')]=_['intersection'](_0x304b29[_0x50e6('0x2f')],_0x304b29[_0x50e6('0x30')]);_0x418c1d[_0x50e6('0x32')]=_[_0x50e6('0x33')](_0x304b29['model'],qs['fields'](_0x17f7cb[_0x50e6('0x30')][_0x50e6('0x34')]));_0x418c1d[_0x50e6('0x32')]=_0x418c1d[_0x50e6('0x32')][_0x50e6('0x35')]?_0x418c1d[_0x50e6('0x32')]:_0x304b29[_0x50e6('0x2f')];if(_0x17f7cb[_0x50e6('0x30')][_0x50e6('0x43')]){_0x418c1d[_0x50e6('0x44')]=[{'all':!![]}];}_0x418c1d=_['merge']({},_0x418c1d,_0x17f7cb[_0x50e6('0x3f')]);return db[_0x50e6('0x2c')][_0x50e6('0x45')](_0x418c1d)[_0x50e6('0x24')](handleEntityNotFound(_0x538959,null))['then'](respondWithResult(_0x538959,null))[_0x50e6('0x41')](handleError(_0x538959,null));};exports['clone']=function(_0x5a0cf6,_0x2b6a93){var _0x57f5b4={'where':{'id':_0x5a0cf6['params']['id']}},_0x538ca1={};_0x538ca1[_0x50e6('0x2f')]=_[_0x50e6('0x31')](db['Attachment']['rawAttributes']);_0x57f5b4[_0x50e6('0x32')]=_[_0x50e6('0x33')](_0x538ca1[_0x50e6('0x2f')],qs['fields'](_0x5a0cf6['query'][_0x50e6('0x34')]));_0x57f5b4[_0x50e6('0x32')]=_0x57f5b4[_0x50e6('0x32')][_0x50e6('0x35')]?_0x57f5b4[_0x50e6('0x32')]:_0x538ca1[_0x50e6('0x2f')];if(_0x5a0cf6[_0x50e6('0x30')][_0x50e6('0x43')]){_0x57f5b4[_0x50e6('0x44')]=[{'all':!![]}];}_0x57f5b4=_[_0x50e6('0x3e')]({},_0x57f5b4,_0x5a0cf6['options']);return db[_0x50e6('0x2c')][_0x50e6('0x45')](_0x57f5b4)[_0x50e6('0x24')](handleEntityNotFound(_0x2b6a93,null))['then'](function(_0x5266ea){if(_0x5266ea){var _0x350431=_0x5266ea[_0x50e6('0x46')]({'plain':!![]});_0x350431=qs[_0x50e6('0x47')](_0x350431,['id',_0x50e6('0x48'),_0x50e6('0x49')]);_0x5a0cf6[_0x50e6('0x4a')]=_['omit'](_0x5a0cf6[_0x50e6('0x4a')],['id','createdAt',_0x50e6('0x49')]);return db[_0x50e6('0x2c')][_0x50e6('0x4b')](_['merge'](_0x350431,_0x5a0cf6['body']),{'include':_0x5a0cf6[_0x50e6('0x30')][_0x50e6('0x43')]?[{'all':!![]}]:undefined});}})[_0x50e6('0x24')](respondWithResult(_0x2b6a93,0xc9))[_0x50e6('0x41')](handleError(_0x2b6a93,null));};exports[_0x50e6('0x23')]=function(_0x5bf954,_0x1f7e76){if(_0x5bf954[_0x50e6('0x4a')]['id']){delete _0x5bf954[_0x50e6('0x4a')]['id'];}return db[_0x50e6('0x2c')][_0x50e6('0x45')]({'where':{'id':_0x5bf954['params']['id']}})[_0x50e6('0x24')](handleEntityNotFound(_0x1f7e76,null))[_0x50e6('0x24')](saveUpdates(_0x5bf954['body'],null))['then'](respondWithResult(_0x1f7e76,null))[_0x50e6('0x41')](handleError(_0x1f7e76,null));};exports['destroy']=function(_0x4fc356,_0x1ff127){return db[_0x50e6('0x2c')][_0x50e6('0x45')]({'where':{'id':_0x4fc356[_0x50e6('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ff127,null))[_0x50e6('0x24')](removeEntity(_0x1ff127,null))[_0x50e6('0x41')](handleError(_0x1ff127,null));};exports[_0x50e6('0x4b')]=function(_0x27086e,_0xa21f70,_0x54cf56){_0x27086e['body'][_0x50e6('0x28')]=_0x27086e[_0x50e6('0x4c')]['originalname'];_0x27086e['body'][_0x50e6('0x4d')]=_0x27086e[_0x50e6('0x4c')]['filename'];_0x27086e[_0x50e6('0x4a')][_0x50e6('0x3c')]=_0x27086e[_0x50e6('0x4c')][_0x50e6('0x4e')];return db[_0x50e6('0x2c')][_0x50e6('0x4b')](_0x27086e[_0x50e6('0x4a')])['then'](respondWithResult(_0xa21f70,0xc9))[_0x50e6('0x41')](handleError(_0xa21f70,null));};exports[_0x50e6('0x4f')]=function(_0x4bea5d,_0x588fda,_0x46f158){return db[_0x50e6('0x2c')][_0x50e6('0x50')]({'where':{'id':_0x4bea5d[_0x50e6('0x42')]['id']},'raw':!![]})[_0x50e6('0x24')](handleEntityNotFound(_0x588fda,null))[_0x50e6('0x24')](function(_0x5e831a){if(_0x5e831a){var _0x5d70b6=_0x5e831a[_0x50e6('0x51')]!==null;var _0x31875f=path[_0x50e6('0x52')](config[_0x50e6('0x53')],_0x50e6('0x54'));if(_0x5d70b6){_0x31875f=path[_0x50e6('0x52')](_0x31875f,'offline-chat/');}var _0x321c45=path['join'](_0x31875f,_0x5e831a[_0x50e6('0x4d')]);return _0x588fda[_0x50e6('0x4f')](_0x321c45);}})[_0x50e6('0x41')](handleError(_0x588fda,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index f3317a5..4dfc112 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 _0x82f0=['Attachment','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x1d8e83,_0x3a44be){var _0x30d861=function(_0xc4fd25){while(--_0xc4fd25){_0x1d8e83['push'](_0x1d8e83['shift']());}};_0x30d861(++_0x3a44be);}(_0x82f0,0x10b));var _0x082f=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x82f0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x082f('0x0'));var util=require(_0x082f('0x1'));var logger=require(_0x082f('0x2'))(_0x082f('0x3'));var moment=require(_0x082f('0x4'));var BPromise=require(_0x082f('0x5'));var rp=require(_0x082f('0x6'));var fs=require('fs');var path=require(_0x082f('0x7'));var rimraf=require(_0x082f('0x8'));var config=require(_0x082f('0x9'));var attributes=require(_0x082f('0xa'));module[_0x082f('0xb')]=function(_0x424804,_0x190fc4){return _0x424804[_0x082f('0xc')](_0x082f('0xd'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e05=['path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','api','moment','request-promise'];(function(_0x4e8fb5,_0x5bb89a){var _0x198b65=function(_0x2c6be8){while(--_0x2c6be8){_0x4e8fb5['push'](_0x4e8fb5['shift']());}};_0x198b65(++_0x5bb89a);}(_0x7e05,0x19f));var _0x57e0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7e05[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x57e0('0x0'));var util=require(_0x57e0('0x1'));var logger=require('../../config/logger')(_0x57e0('0x2'));var moment=require(_0x57e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x57e0('0x4'));var fs=require('fs');var path=require(_0x57e0('0x5'));var rimraf=require('rimraf');var config=require(_0x57e0('0x6'));var attributes=require(_0x57e0('0x7'));module[_0x57e0('0x8')]=function(_0x5af8d8,_0x1c28d4){return _0x5af8d8[_0x57e0('0x9')](_0x57e0('0xa'),attributes,{'tableName':_0x57e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index c7e682c..d1527d4 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 _0xf874=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','Attachment','create','body','options','raw','CreateAttachment','moment','bluebird','randomstring'];(function(_0x11273e,_0x3821a6){var _0x1e8616=function(_0x439d86){while(--_0x439d86){_0x11273e['push'](_0x11273e['shift']());}};_0x1e8616(++_0x3821a6);}(_0xf874,0xed));var _0x4f87=function(_0x5bdd43,_0x1ba582){_0x5bdd43=_0x5bdd43-0x0;var _0x2df923=_0xf874[_0x5bdd43];return _0x2df923;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f87('0x0'));var BPromise=require(_0x4f87('0x1'));var rs=require(_0x4f87('0x2'));var fs=require('fs');var Redis=require(_0x4f87('0x3'));var db=require(_0x4f87('0x4'))['db'];var utils=require(_0x4f87('0x5'));var logger=require('../../config/logger')(_0x4f87('0x6'));var config=require(_0x4f87('0x7'));var jayson=require(_0x4f87('0x8'));var client=jayson[_0x4f87('0x9')][_0x4f87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fea6,_0x4a0662,_0x3a89e3){return new BPromise(function(_0x194853,_0x592008){return client[_0x4f87('0xb')](_0x44fea6,_0x3a89e3)[_0x4f87('0xc')](function(_0x4d8354){logger[_0x4f87('0xd')](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));logger[_0x4f87('0x10')](_0x4f87('0x11'),_0x4a0662,_0x4f87('0xf'),JSON[_0x4f87('0x12')](_0x4d8354));if(_0x4d8354['error']){if(_0x4d8354['error'][_0x4f87('0x13')]===0x1f4){logger[_0x4f87('0x14')](_0x4f87('0xe'),_0x4a0662,_0x4d8354['error']['message']);return _0x592008(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}logger[_0x4f87('0x14')]('Attachment,\x20%s,\x20%s',_0x4a0662,_0x4d8354[_0x4f87('0x14')]['message']);return _0x194853(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}else{logger['info'](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));_0x194853(_0x4d8354[_0x4f87('0x16')][_0x4f87('0x15')]);}})[_0x4f87('0x17')](function(_0x3bd90f){logger['error'](_0x4f87('0xe'),_0x4a0662,_0x3bd90f);_0x592008(_0x3bd90f);});});}exports['CreateAttachment']=function(_0x10551e){var _0x6a3017=this;return new Promise(function(_0x46492d,_0x42c399){return db[_0x4f87('0x18')][_0x4f87('0x19')](_0x10551e[_0x4f87('0x1a')],{'raw':_0x10551e[_0x4f87('0x1b')]?_0x10551e[_0x4f87('0x1b')][_0x4f87('0x1c')]===undefined?!![]:![]:!![]})[_0x4f87('0xc')](function(_0x2c13a0){logger[_0x4f87('0xd')]('CreateAttachment',_0x10551e);logger['debug'](_0x4f87('0x1d'),_0x10551e,JSON[_0x4f87('0x12')](_0x2c13a0));_0x46492d(_0x2c13a0);})['catch'](function(_0x592edd){logger[_0x4f87('0x14')]('CreateAttachment',_0x592edd['message'],_0x10551e);_0x42c399(_0x6a3017[_0x4f87('0x14')](0x1f4,_0x592edd[_0x4f87('0x15')]));});});};
\ No newline at end of file
+var _0xe812=['error','code','message','info','result','CreateAttachment','Attachment','create','body','options','raw','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x50d160,_0x447b4f){var _0x28172e=function(_0x569824){while(--_0x569824){_0x50d160['push'](_0x50d160['shift']());}};_0x28172e(++_0x447b4f);}(_0xe812,0x1f2));var _0x2e81=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe812[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var moment=require(_0x2e81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e81('0x2'));var db=require(_0x2e81('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e81('0x4'))(_0x2e81('0x5'));var config=require('../../config/environment');var jayson=require(_0x2e81('0x6'));var client=jayson[_0x2e81('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36604d,_0x32b221,_0x27f9c6){return new BPromise(function(_0x5559ca,_0x142cab){return client[_0x2e81('0x8')](_0x36604d,_0x27f9c6)[_0x2e81('0x9')](function(_0x11a56b){logger['info'](_0x2e81('0xa'),_0x32b221,_0x2e81('0xb'));logger[_0x2e81('0xc')](_0x2e81('0xd'),_0x32b221,_0x2e81('0xb'),JSON[_0x2e81('0xe')](_0x11a56b));if(_0x11a56b[_0x2e81('0xf')]){if(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x10')]===0x1f4){logger[_0x2e81('0xf')](_0x2e81('0xa'),_0x32b221,_0x11a56b['error'][_0x2e81('0x11')]);return _0x142cab(_0x11a56b[_0x2e81('0xf')]['message']);}logger[_0x2e81('0xf')]('Attachment,\x20%s,\x20%s',_0x32b221,_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);return _0x5559ca(_0x11a56b[_0x2e81('0xf')][_0x2e81('0x11')]);}else{logger[_0x2e81('0x12')](_0x2e81('0xa'),_0x32b221,'request\x20sent');_0x5559ca(_0x11a56b[_0x2e81('0x13')][_0x2e81('0x11')]);}})['catch'](function(_0x330131){logger['error'](_0x2e81('0xa'),_0x32b221,_0x330131);_0x142cab(_0x330131);});});}exports[_0x2e81('0x14')]=function(_0x4c1b11){var _0x402992=this;return new Promise(function(_0x2bb9b6,_0xbb61a4){return db[_0x2e81('0x15')][_0x2e81('0x16')](_0x4c1b11[_0x2e81('0x17')],{'raw':_0x4c1b11[_0x2e81('0x18')]?_0x4c1b11[_0x2e81('0x18')][_0x2e81('0x19')]===undefined?!![]:![]:!![]})[_0x2e81('0x9')](function(_0x524694){logger[_0x2e81('0x12')](_0x2e81('0x14'),_0x4c1b11);logger[_0x2e81('0xc')](_0x2e81('0x14'),_0x4c1b11,JSON[_0x2e81('0xe')](_0x524694));_0x2bb9b6(_0x524694);})[_0x2e81('0x1a')](function(_0x18b9be){logger[_0x2e81('0xf')]('CreateAttachment',_0x18b9be[_0x2e81('0x11')],_0x4c1b11);_0xbb61a4(_0x402992['error'](0x1f4,_0x18b9be[_0x2e81('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index b288c5e..de6e249 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4569f4,_0x30d93f){var _0x1421e5=function(_0x515aaa){while(--_0x515aaa){_0x4569f4['push'](_0x4569f4['shift']());}};_0x1421e5(++_0x30d93f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x584eed,_0x5ab3e8){_0x584eed=_0x584eed-0x0;var _0x112b46=_0x5f2f[_0x584eed];return _0x112b46;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _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(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x20ae3b,_0x23a21c){_0x20ae3b=_0x20ae3b-0x0;var _0x391475=_0x0b0e[_0x20ae3b];return _0x391475;};'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 72257f8..b798b2a 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 _0x0bae=['undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blockedAt','agent','then','blockDuration','blocked','add','clearBlockUser','getLicense','catch','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x0bae,0x146));var _0xe0ba=function(_0x18e1bf,_0x2fbc81){_0x18e1bf=_0x18e1bf-0x0;var _0x4bd981=_0x0bae[_0x18e1bf];return _0x4bd981;};'use strict';var passport=require(_0xe0ba('0x0'));var LocalStrategy=require(_0xe0ba('0x1'))[_0xe0ba('0x2')];var moment=require(_0xe0ba('0x3'));var ActiveDirectory=require(_0xe0ba('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xe0ba('0x5'));var utils=require(_0xe0ba('0x6'));var config=require(_0xe0ba('0x7'));var logger=require(_0xe0ba('0x8'))(_0xe0ba('0x9'));function isActiveDirectoryConfigured(_0x21ff6f){var _0x27e0d8=![];if(typeof _0x21ff6f['activedirectory']!==_0xe0ba('0xa')){_0x27e0d8=_0x21ff6f[_0xe0ba('0xb')][_0xe0ba('0xc')]&&_0x21ff6f[_0xe0ba('0xb')][_0xe0ba('0xd')]&&_0x21ff6f['activedirectory'][_0xe0ba('0xe')];}return _0x27e0d8;}function adAuthenticate(_0x2c9d7a,_0x48fb8e,_0x4538fd){return new BPromise(function(_0x8b5354,_0x3d8504){try{var _0x2d801b=new ActiveDirectory(_0x2c9d7a);_0x2d801b[_0xe0ba('0xf')](_0x48fb8e,_0x4538fd,function(_0x303911,_0x29167c){if(_0x303911){logger[_0xe0ba('0x10')](_0xe0ba('0x11'),_0x48fb8e,util['inspect'](_0x303911,{'showHidden':![],'depth':null}));_0x3d8504(_0xe0ba('0x12'));}else if(!_0x29167c){logger['error'](_0xe0ba('0x13'),_0x48fb8e);_0x3d8504(_0xe0ba('0x12'));}else{_0x8b5354(_0x29167c);}});}catch(_0x5c73fc){_0x3d8504(_0x5c73fc);}});}function ActiveDirectoryAuthenticate(_0x42a03c,_0x4f9f91,_0x1e2bf0,_0x1c4fef){var _0x54f21e,_0x3b019a;if(!isActiveDirectoryConfigured(config)){logger[_0xe0ba('0x10')](_0xe0ba('0x14'),_0x4f9f91);return _0x1c4fef(null,![],{'message':_0xe0ba('0x12')});}return db[_0xe0ba('0x15')][_0xe0ba('0x16')]({'where':{'id':0x1},'attributes':[_0xe0ba('0x17'),'blockDuration'],'raw':!![]})['then'](function(_0x26f5c3){_0x54f21e=_0x26f5c3;if(!_0x54f21e[_0xe0ba('0x17')]){logger[_0xe0ba('0x10')](_0xe0ba('0x18'),_0x4f9f91);throw new Error(_0xe0ba('0x12'));}return _0x42a03c[_0xe0ba('0x16')]({'attributes':['id',_0xe0ba('0x19'),_0xe0ba('0x1a'),'salt',_0xe0ba('0x1b'),_0xe0ba('0x1c'),'blocked',_0xe0ba('0x1d'),'online'],'where':{'name':_0x4f9f91,'role':{'$or':['admin','user',_0xe0ba('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x23efac){if(!_0x23efac||_0x23efac&&_0x23efac['name']!==_0x4f9f91){throw new Error(_0xe0ba('0x12'));}_0x3b019a=_0x23efac;var _0x1fe832=_0x3b019a[_0xe0ba('0x19')]+'@'+config[_0xe0ba('0xb')][_0xe0ba('0xe')];return adAuthenticate(config[_0xe0ba('0xb')],_0x1fe832,_0x1e2bf0);})[_0xe0ba('0x1f')](function(_0x152d6c){if(_0x3b019a[_0xe0ba('0x1c')]){throw new Error(_0xe0ba('0x12'));}if(_0x54f21e[_0xe0ba('0x20')]>0x0){if(_0x3b019a[_0xe0ba('0x21')]){if(moment(_0x3b019a[_0xe0ba('0x1d')])[_0xe0ba('0x22')](_0x54f21e['blockDuration'],'minutes')>moment()){throw new Error(_0xe0ba('0x12'));}return utils[_0xe0ba('0x23')](_0x3b019a,0x0,![],null)[_0xe0ba('0x1f')](function(){return utils[_0xe0ba('0x24')](_0x3b019a);})[_0xe0ba('0x1f')](function(){return _0x1c4fef(null,_0x3b019a);});}else{return utils[_0xe0ba('0x24')](_0x3b019a)[_0xe0ba('0x1f')](function(){return _0x1c4fef(null,_0x3b019a);});}}else{return utils[_0xe0ba('0x24')](_0x3b019a)[_0xe0ba('0x1f')](function(){return _0x1c4fef(null,_0x3b019a);});}})[_0xe0ba('0x25')](function(_0x53954f){return _0x1c4fef(null,![],_0x53954f);});}function handleError(_0x6d286a,_0x59fead,_0x5a2d2e){return _0x6d286a[_0xe0ba('0x26')](_0x59fead||0x1f4)[_0xe0ba('0x27')]({'message':_0x5a2d2e?_0x5a2d2e['message']||_0x5a2d2e:''});}exports[_0xe0ba('0x28')]=function(_0x507d57,_0x37d6ba,_0x3d5e62){passport[_0xe0ba('0xf')]('ad-login',function(_0x298fcd,_0x47576a,_0x2a9180){var _0x32cc58=_0x298fcd||_0x2a9180;if(_0x32cc58){return handleError(_0x37d6ba,0x191,_0x32cc58);}if(!_0x47576a){return handleError(_0x37d6ba,0x194,{'message':_0xe0ba('0x29')});}else{var _0x5cf830={'payload':{'id':_0x47576a['id'],'role':_0x47576a[_0xe0ba('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xe0ba('0x2a')](_0x5cf830)[_0xe0ba('0x1f')](function(_0x1fb069){_0x37d6ba[_0xe0ba('0x2b')]({'id':_0x47576a['id'],'token':_0x1fb069,'statusCall':'','isAlreadyLogged':_0x47576a[_0xe0ba('0x2c')]});});}})(_0x507d57,_0x37d6ba,_0x3d5e62);};passport[_0xe0ba('0x2d')](_0xe0ba('0x2e'),new LocalStrategy({'usernameField':_0xe0ba('0x19'),'passwordField':_0xe0ba('0x1a')},function(_0x392837,_0x1ee0b1,_0x4ee26d){return ActiveDirectoryAuthenticate(db[_0xe0ba('0x2f')],_0x392837,_0x1ee0b1,_0x4ee26d);}));
\ No newline at end of file
+var _0x6c25=['findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','name','salt','disabled','blocked','blockedAt','online','admin','user','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','use','password','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured'];(function(_0x159378,_0x280501){var _0x4abb7c=function(_0x3eaffa){while(--_0x3eaffa){_0x159378['push'](_0x159378['shift']());}};_0x4abb7c(++_0x280501);}(_0x6c25,0x143));var _0x56c2=function(_0x2937af,_0xf5d16b){_0x2937af=_0x2937af-0x0;var _0x1c272d=_0x6c25[_0x2937af];return _0x1c272d;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x56c2('0x0'))[_0x56c2('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x56c2('0x2'));var BPromise=require(_0x56c2('0x3'));var util=require(_0x56c2('0x4'));var db=require(_0x56c2('0x5'))['db'];var authService=require(_0x56c2('0x6'));var utils=require(_0x56c2('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x56c2('0x8'));function isActiveDirectoryConfigured(_0xbeb27e){var _0x5b67e5=![];if(typeof _0xbeb27e[_0x56c2('0x9')]!==_0x56c2('0xa')){_0x5b67e5=_0xbeb27e[_0x56c2('0x9')][_0x56c2('0xb')]&&_0xbeb27e['activedirectory'][_0x56c2('0xc')]&&_0xbeb27e[_0x56c2('0x9')][_0x56c2('0xd')];}return _0x5b67e5;}function adAuthenticate(_0x3783ba,_0x13d6ca,_0x555454){return new BPromise(function(_0x2acc9e,_0x2ffddc){try{var _0x5c883e=new ActiveDirectory(_0x3783ba);_0x5c883e[_0x56c2('0xe')](_0x13d6ca,_0x555454,function(_0x499780,_0x3a776d){if(_0x499780){logger[_0x56c2('0xf')](_0x56c2('0x10'),_0x13d6ca,util[_0x56c2('0x11')](_0x499780,{'showHidden':![],'depth':null}));_0x2ffddc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3a776d){logger['error'](_0x56c2('0x12'),_0x13d6ca);_0x2ffddc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2acc9e(_0x3a776d);}});}catch(_0x106147){_0x2ffddc(_0x106147);}});}function ActiveDirectoryAuthenticate(_0x5e7292,_0x499557,_0x2eec30,_0x3430fe){var _0xc6df82,_0x14ae4b;if(!isActiveDirectoryConfigured(config)){logger[_0x56c2('0xf')](_0x56c2('0x13'),_0x499557);return _0x3430fe(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x56c2('0x14')]({'where':{'id':0x1},'attributes':[_0x56c2('0x15'),_0x56c2('0x16')],'raw':!![]})[_0x56c2('0x17')](function(_0x5d711d){_0xc6df82=_0x5d711d;if(!_0xc6df82[_0x56c2('0x15')]){logger[_0x56c2('0xf')](_0x56c2('0x18'),_0x499557);throw new Error(_0x56c2('0x19'));}return _0x5e7292[_0x56c2('0x14')]({'attributes':['id',_0x56c2('0x1a'),'password',_0x56c2('0x1b'),'role',_0x56c2('0x1c'),_0x56c2('0x1d'),_0x56c2('0x1e'),_0x56c2('0x1f')],'where':{'name':_0x499557,'role':{'$or':[_0x56c2('0x20'),_0x56c2('0x21'),_0x56c2('0x22')]},'adSsoEnabled':!![]}});})[_0x56c2('0x17')](function(_0x470e6d){if(!_0x470e6d||_0x470e6d&&_0x470e6d['name']!==_0x499557){throw new Error(_0x56c2('0x19'));}_0x14ae4b=_0x470e6d;var _0x4064f3=_0x14ae4b['name']+'@'+config[_0x56c2('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x4064f3,_0x2eec30);})[_0x56c2('0x17')](function(_0x246358){if(_0x14ae4b[_0x56c2('0x1c')]){throw new Error(_0x56c2('0x19'));}if(_0xc6df82[_0x56c2('0x16')]>0x0){if(_0x14ae4b[_0x56c2('0x1d')]){if(moment(_0x14ae4b[_0x56c2('0x1e')])[_0x56c2('0x23')](_0xc6df82[_0x56c2('0x16')],_0x56c2('0x24'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x56c2('0x25')](_0x14ae4b,0x0,![],null)[_0x56c2('0x17')](function(){return utils['getLicense'](_0x14ae4b);})[_0x56c2('0x17')](function(){return _0x3430fe(null,_0x14ae4b);});}else{return utils[_0x56c2('0x26')](_0x14ae4b)[_0x56c2('0x17')](function(){return _0x3430fe(null,_0x14ae4b);});}}else{return utils[_0x56c2('0x26')](_0x14ae4b)['then'](function(){return _0x3430fe(null,_0x14ae4b);});}})[_0x56c2('0x27')](function(_0x20ee11){return _0x3430fe(null,![],_0x20ee11);});}function handleError(_0x5e5826,_0xe59a86,_0x164c48){return _0x5e5826[_0x56c2('0x28')](_0xe59a86||0x1f4)[_0x56c2('0x29')]({'message':_0x164c48?_0x164c48[_0x56c2('0x2a')]||_0x164c48:''});}exports[_0x56c2('0x2b')]=function(_0x26fe6a,_0x50b59c,_0x183e09){passport['authenticate']('ad-login',function(_0x2229e1,_0x55edc9,_0x2135c1){var _0x1126cf=_0x2229e1||_0x2135c1;if(_0x1126cf){return handleError(_0x50b59c,0x191,_0x1126cf);}if(!_0x55edc9){return handleError(_0x50b59c,0x194,{'message':_0x56c2('0x2c')});}else{var _0x51eb09={'payload':{'id':_0x55edc9['id'],'role':_0x55edc9[_0x56c2('0x2d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x51eb09)[_0x56c2('0x17')](function(_0x1a3a5e){_0x50b59c[_0x56c2('0x2e')]({'id':_0x55edc9['id'],'token':_0x1a3a5e,'statusCall':'','isAlreadyLogged':_0x55edc9['online']});});}})(_0x26fe6a,_0x50b59c,_0x183e09);};passport[_0x56c2('0x2f')]('ad-login',new LocalStrategy({'usernameField':_0x56c2('0x1a'),'passwordField':_0x56c2('0x30')},function(_0x661d39,_0x3cb47c,_0x4364b4){return ActiveDirectoryAuthenticate(db['User'],_0x661d39,_0x3cb47c,_0x4364b4);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 469c386..69ff908 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 _0x6c48=['Router','./authActiveDirectory.controller','exports','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c48,0x193));var _0x86c4=function(_0xce9f7b,_0x4e38f5){_0xce9f7b=_0xce9f7b-0x0;var _0x2379fd=_0x6c48[_0xce9f7b];return _0x2379fd;};'use strict';var express=require(_0x86c4('0x0'));var router=express[_0x86c4('0x1')]();var controller=require(_0x86c4('0x2'));router['post']('/',controller['login']);module[_0x86c4('0x3')]=router;
\ No newline at end of file
+var _0x2c09=['express','exports'];(function(_0x5c9364,_0x27d6b1){var _0x5f52fa=function(_0x122bc6){while(--_0x122bc6){_0x5c9364['push'](_0x5c9364['shift']());}};_0x5f52fa(++_0x27d6b1);}(_0x2c09,0x188));var _0x92c0=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x2c09[_0x278e3c];return _0x3e2d9b;};'use strict';var express=require(_0x92c0('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0x92c0('0x1')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index b8440fe..c9d4000 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(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5b3a,_0x3a1d9d){_0x4a5b3a=_0x4a5b3a-0x0;var _0x483e5c=_0x7a54[_0x4a5b3a];return _0x483e5c;};'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(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7a54,0x106));var _0x47a5=function(_0x2cade3,_0x57de32){_0x2cade3=_0x2cade3-0x0;var _0x5a4877=_0x7a54[_0x2cade3];return _0x5a4877;};'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 5d6ee1a..67a315c 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 _0xf78b=['isMiddleware','login','setTokenCookie','express','Router','./authGoogle.controller','get','/callback','callback'];(function(_0x4884bc,_0x315521){var _0xff9945=function(_0x59af0){while(--_0x59af0){_0x4884bc['push'](_0x4884bc['shift']());}};_0xff9945(++_0x315521);}(_0xf78b,0x78));var _0xbf78=function(_0x54edab,_0x49b7ad){_0x54edab=_0x54edab-0x0;var _0x35c7c9=_0xf78b[_0x54edab];return _0x35c7c9;};'use strict';var express=require(_0xbf78('0x0'));var passport=require('passport');var router=express[_0xbf78('0x1')]();var controller=require(_0xbf78('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xbf78('0x3')]('/',controller['login']);router[_0xbf78('0x3')](_0xbf78('0x4'),controller[_0xbf78('0x5')],authService[_0xbf78('0x6')],userController[_0xbf78('0x7')],authService[_0xbf78('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x8c52=['login','/callback','callback','isMiddleware','setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x299ffa,_0x4609df){var _0x17fe64=function(_0x41de7c){while(--_0x41de7c){_0x299ffa['push'](_0x299ffa['shift']());}};_0x17fe64(++_0x4609df);}(_0x8c52,0x7e));var _0x28c5=function(_0x5d8778,_0x3c2f0e){_0x5d8778=_0x5d8778-0x0;var _0x133e42=_0x8c52[_0x5d8778];return _0x133e42;};'use strict';var express=require(_0x28c5('0x0'));var passport=require('passport');var router=express[_0x28c5('0x1')]();var controller=require(_0x28c5('0x2'));var userController=require(_0x28c5('0x3'));var authService=require(_0x28c5('0x4'));router[_0x28c5('0x5')]('/',controller[_0x28c5('0x6')]);router[_0x28c5('0x5')](_0x28c5('0x7'),controller[_0x28c5('0x8')],authService[_0x28c5('0x9')],userController[_0x28c5('0x6')],authService[_0x28c5('0xa')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 966835f..0d8e840 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 _0x9795=['MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','resetPasswordToken','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','use','local-login','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../components/auth/service','client','Setting','findOne','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','allowedLoginAttempts','add','clearBlockUser','catch'];(function(_0x2331f4,_0xe518c3){var _0x224d15=function(_0xa917c5){while(--_0xa917c5){_0x2331f4['push'](_0x2331f4['shift']());}};_0x224d15(++_0xe518c3);}(_0x9795,0x157));var _0x5979=function(_0x46344e,_0x516028){_0x46344e=_0x46344e-0x0;var _0x42a4f5=_0x9795[_0x46344e];return _0x42a4f5;};'use strict';var util=require(_0x5979('0x0'));var passport=require(_0x5979('0x1'));var LocalStrategy=require(_0x5979('0x2'))[_0x5979('0x3')];var jayson=require(_0x5979('0x4'));var _=require('lodash');var rs=require(_0x5979('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x5979('0x6'));var utils=require('../../config/utils');var client=jayson[_0x5979('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x2d74c9,_0xabd45a,_0x505829,_0x33b227){var _0x2bb3cd,_0x341f98;return db[_0x5979('0x8')][_0x5979('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5979('0xa')],'raw':!![]})['then'](function(_0x5d389e){_0x2bb3cd=_0x5d389e;return _0x2d74c9['findOne']({'attributes':['id',_0x5979('0xb'),_0x5979('0xc'),_0x5979('0xd'),_0x5979('0xe'),_0x5979('0xf'),_0x5979('0x10'),_0x5979('0x11'),_0x5979('0x12')],'where':{'name':_0xabd45a,'role':{'$or':['admin','user',_0x5979('0x13')]}}});})['then'](function(_0x15497e){if(!_0x15497e||_0x15497e&&_0x15497e['name']!==_0xabd45a){throw new Error(_0x5979('0x14'));}else{_0x341f98=_0x15497e;return _0x341f98;}})[_0x5979('0x15')](function(){_0x341f98[_0x5979('0x16')](_0x505829,function(_0x466f73,_0x6243ed){var _0x41275b=_0x341f98[_0x5979('0x12')]+0x1;if(_0x466f73){return _0x33b227(_0x466f73);}else if(!_0x6243ed){if(_0x341f98[_0x5979('0xf')]){return _0x33b227(null,![],{'message':_0x5979('0x14')});}else if(_0x2bb3cd['allowedLoginAttempts']>0x0){if(_0x341f98[_0x5979('0x10')]){if(_0x2bb3cd[_0x5979('0xa')]>0x0){if(moment(_0x341f98[_0x5979('0x11')])['add'](_0x2bb3cd[_0x5979('0xa')],'minutes')>moment()){return _0x33b227(null,![],{'message':_0x5979('0x14')});}else{return utils['clearBlockUser'](_0x341f98,_0x41275b,![],null)[_0x5979('0x15')](function(){return _0x33b227(null,![],{'message':_0x5979('0x14')});});}}else{return _0x33b227(null,![],{'message':_0x5979('0x14')});}}else{if(_0x41275b>=_0x2bb3cd[_0x5979('0x17')]){return utils['clearBlockUser'](_0x341f98,0x0,!![],moment())[_0x5979('0x15')](function(){return _0x33b227(null,![],{'message':_0x5979('0x14')});});}else{return utils['clearBlockUser'](_0x341f98,_0x41275b,![],null)[_0x5979('0x15')](function(){return _0x33b227(null,![],{'message':_0x5979('0x14')});});}}}else{return _0x33b227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x341f98['disabled']){return _0x33b227(null,![],{'message':_0x5979('0x14')});}else if(_0x2bb3cd[_0x5979('0x17')]>0x0){if(_0x341f98['blocked']){if(_0x2bb3cd[_0x5979('0xa')]>0x0){if(moment(_0x341f98[_0x5979('0x11')])[_0x5979('0x18')](_0x2bb3cd['blockDuration'],'minutes')>moment()){return _0x33b227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5979('0x19')](_0x341f98,0x0,![],null)['then'](function(){return utils['getLicense'](_0x341f98);})[_0x5979('0x15')](function(){return _0x33b227(null,_0x341f98);});}}else{return _0x33b227(null,![],{'message':_0x5979('0x14')});}}else{return utils[_0x5979('0x19')](_0x341f98,0x0,![],null)[_0x5979('0x15')](function(){return utils['getLicense'](_0x341f98);})[_0x5979('0x15')](function(){return _0x33b227(null,_0x341f98);})[_0x5979('0x1a')](function(_0x514b51){return _0x33b227(null,![],_0x514b51);});}}else{if(_0x341f98[_0x5979('0x10')]){return _0x33b227(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x341f98)[_0x5979('0x15')](function(){return _0x33b227(null,_0x341f98);});}}}});})['catch'](function(_0x1478b7){return _0x33b227(null,![],_0x1478b7);});}function sendServiceMail(_0x5c0d5f){return db[_0x5979('0x1b')]['find']({'where':{'service':!![]},'attributes':['id',_0x5979('0xb'),_0x5979('0x1c')],'include':[{'model':db[_0x5979('0x1d')],'as':_0x5979('0x1e'),'include':[{'model':db[_0x5979('0x1f')],'as':_0x5979('0x1f')}]}]})[_0x5979('0x15')](function(_0x9b3932){if(!_0x9b3932){throw new Error(_0x5979('0x20'));}var _0x1adf1a=_0x9b3932[_0x5979('0x21')]();var _0x30421e={'account':_0x1adf1a,'message':_['merge']({'from':util[_0x5979('0x22')](_0x5979('0x23'),_0x9b3932[_0x5979('0xb')],_0x9b3932[_0x5979('0x1c')]||_0x9b3932[_0x5979('0x1e')][_0x5979('0x24')])},_0x5c0d5f)};return client[_0x5979('0x25')](_0x5979('0x26'),_0x30421e);})['then'](function(_0x3e06c0){if(_0x3e06c0[_0x5979('0x27')]){throw new Error(util[_0x5979('0x22')](_0x5979('0x28'),_0x3e06c0[_0x5979('0x27')]['message']||JSON[_0x5979('0x29')](_0x3e06c0[_0x5979('0x27')])));}return!![];});}function handleError(_0x4539b7,_0x449259,_0x3b9958){return _0x4539b7[_0x5979('0x2a')](_0x449259||0x1f4)[_0x5979('0x2b')]({'message':_0x3b9958?_0x3b9958[_0x5979('0x2c')]||_0x3b9958:''});}exports[_0x5979('0x2d')]=function(_0x539525,_0x42b317,_0x560fa3){passport[_0x5979('0x16')]('local-login',function(_0x452ba7,_0x1a9497,_0x24f00b){var _0x5c7203=_0x452ba7||_0x24f00b;if(_0x5c7203){return handleError(_0x42b317,0x191,_0x5c7203);}if(!_0x1a9497){return handleError(_0x42b317,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4443ac={'payload':{'id':_0x1a9497['id'],'role':_0x1a9497[_0x5979('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4443ac)[_0x5979('0x15')](function(_0x2935b6){_0x42b317[_0x5979('0x2e')]({'id':_0x1a9497['id'],'token':_0x2935b6,'statusCall':'','isAlreadyLogged':_0x1a9497[_0x5979('0x2f')]});});}})(_0x539525,_0x42b317,_0x560fa3);};exports[_0x5979('0x30')]=function(_0x36d130,_0x23e1d0){if(!_0x36d130['body']['email']){return handleError(_0x23e1d0,0x1f4,{'message':_0x5979('0x31')});}var _0xc72589=rs[_0x5979('0x32')]();_0x36d130['body']['email']=_0x36d130[_0x5979('0x33')][_0x5979('0x1c')]['trim']()[_0x5979('0x34')]();var _0x1eb186;return db[_0x5979('0x8')][_0x5979('0x9')]({'where':{'id':0x1},'attributes':[_0x5979('0x17'),_0x5979('0xa')],'raw':!![]})[_0x5979('0x15')](function(_0x8838b1){_0x1eb186=_0x8838b1;return db[_0x5979('0x35')][_0x5979('0x36')]({'where':{'email':_0x36d130[_0x5979('0x33')][_0x5979('0x1c')]}});})['then'](function(_0x54106f){if(!_0x54106f){throw new Error(_0x5979('0x37'));}if(_0x54106f[_0x5979('0xf')]){throw new Error(_0x5979('0x38'));}if(_0x54106f[_0x5979('0x10')]){if(moment(_0x54106f['blockedAt'])[_0x5979('0x18')](_0x1eb186['blockDuration'],_0x5979('0x39'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x54106f['blocked']=![];_0x54106f['blockedAt']=null;}}_0x54106f[_0x5979('0x3a')]=_0xc72589;_0x54106f[_0x5979('0x3b')]=Date['now']()+0x36ee80;return _0x54106f[_0x5979('0x3c')]();})[_0x5979('0x15')](function(){return sendServiceMail({'to':_0x36d130[_0x5979('0x33')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5979('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x36d130[_0x5979('0x3e')]['host']+_0x5979('0x3f')+_0xc72589+'\x0a\x0a'+_0x5979('0x40')});})[_0x5979('0x15')](function(){_0x23e1d0['status'](0xc8)[_0x5979('0x2b')]({'message':'Reset\x20Email\x20sent!'});})[_0x5979('0x1a')](function(_0x314691){return handleError(_0x23e1d0,0x1f4,_0x314691);});};exports[_0x5979('0x41')]=function(_0x46a5be,_0x532883){return db[_0x5979('0x35')][_0x5979('0x36')]({'where':{'resetPasswordToken':_0x46a5be[_0x5979('0x42')][_0x5979('0x43')],'resetPasswordExpires':{'$gt':Date[_0x5979('0x44')]()}}})[_0x5979('0x15')](function(_0x27ea76){if(!_0x27ea76){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x5979('0x9')]({'attributes':['id',_0x5979('0x45'),_0x5979('0x46'),_0x5979('0x47')]})['then'](function(_0x571d44){if(_0x571d44[_0x5979('0x45')])authService['validatePasswordPattern'](_0x46a5be[_0x5979('0x33')][_0x5979('0xc')]);if(!_0x571d44['enforcePasswordHistory']||!_0x27ea76['previousPasswords'])return _0x27ea76;authService['validatePasswordHistory'](_0x46a5be[_0x5979('0x33')][_0x5979('0xc')],_0x27ea76['previousPasswords'],_0x571d44[_0x5979('0x47')]);return _0x27ea76;})[_0x5979('0x15')](function(){_0x27ea76[_0x5979('0xc')]=_0x46a5be[_0x5979('0x33')]['password'];_0x27ea76[_0x5979('0x3a')]=null;_0x27ea76[_0x5979('0x3b')]=null;return _0x27ea76[_0x5979('0x3c')]();});})[_0x5979('0x15')](function(){_0x532883[_0x5979('0x2a')](0xc8)[_0x5979('0x2b')]({'message':'Password\x20reset!'});})[_0x5979('0x1a')](function(_0x5ef745){return handleError(_0x532883,0x1f4,_0x5ef745);});};passport[_0x5979('0x48')](_0x5979('0x49'),new LocalStrategy({'usernameField':_0x5979('0xb'),'passwordField':_0x5979('0xc')},function(_0x324610,_0x8649c4,_0x4edec4){return localAuthenticate(db[_0x5979('0x35')],_0x324610,_0x8649c4,_0x4edec4);}));
\ No newline at end of file
+var _0xf5a2=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','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\x20Email\x20sent!','catch','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','Strategy','jayson/promise','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','blockDuration','clearBlockUser','minutes','getLicense','blocked','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request'];(function(_0xf73dcd,_0x15c363){var _0x44c1e2=function(_0x5f1996){while(--_0x5f1996){_0xf73dcd['push'](_0xf73dcd['shift']());}};_0x44c1e2(++_0x15c363);}(_0xf5a2,0x185));var _0x2f5a=function(_0x480c57,_0x5bba33){_0x480c57=_0x480c57-0x0;var _0x1109b7=_0xf5a2[_0x480c57];return _0x1109b7;};'use strict';var util=require(_0x2f5a('0x0'));var passport=require(_0x2f5a('0x1'));var LocalStrategy=require('passport-local')[_0x2f5a('0x2')];var jayson=require(_0x2f5a('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x2f5a('0x4'));var utils=require(_0x2f5a('0x5'));var client=jayson[_0x2f5a('0x6')][_0x2f5a('0x7')]({'port':0x232b});function localAuthenticate(_0x5ee553,_0x2cd5f2,_0xbb0bec,_0x1186a6){var _0x4adae1,_0x112fb9;return db[_0x2f5a('0x8')][_0x2f5a('0x9')]({'where':{'id':0x1},'attributes':[_0x2f5a('0xa'),'blockDuration'],'raw':!![]})[_0x2f5a('0xb')](function(_0x173089){_0x4adae1=_0x173089;return _0x5ee553['findOne']({'attributes':['id','name','password',_0x2f5a('0xc'),_0x2f5a('0xd'),_0x2f5a('0xe'),'blocked',_0x2f5a('0xf'),_0x2f5a('0x10')],'where':{'name':_0x2cd5f2,'role':{'$or':[_0x2f5a('0x11'),_0x2f5a('0x12'),_0x2f5a('0x13')]}}});})['then'](function(_0x2d4e15){if(!_0x2d4e15||_0x2d4e15&&_0x2d4e15[_0x2f5a('0x14')]!==_0x2cd5f2){throw new Error(_0x2f5a('0x15'));}else{_0x112fb9=_0x2d4e15;return _0x112fb9;}})[_0x2f5a('0xb')](function(){_0x112fb9[_0x2f5a('0x16')](_0xbb0bec,function(_0x5ca12f,_0x5cbe8b){var _0x3cdc3a=_0x112fb9[_0x2f5a('0x10')]+0x1;if(_0x5ca12f){return _0x1186a6(_0x5ca12f);}else if(!_0x5cbe8b){if(_0x112fb9['disabled']){return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}else if(_0x4adae1['allowedLoginAttempts']>0x0){if(_0x112fb9['blocked']){if(_0x4adae1['blockDuration']>0x0){if(moment(_0x112fb9[_0x2f5a('0xf')])[_0x2f5a('0x17')](_0x4adae1[_0x2f5a('0x18')],'minutes')>moment()){return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}else{return utils['clearBlockUser'](_0x112fb9,_0x3cdc3a,![],null)[_0x2f5a('0xb')](function(){return _0x1186a6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}}else{if(_0x3cdc3a>=_0x4adae1['allowedLoginAttempts']){return utils[_0x2f5a('0x19')](_0x112fb9,0x0,!![],moment())[_0x2f5a('0xb')](function(){return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});});}else{return utils['clearBlockUser'](_0x112fb9,_0x3cdc3a,![],null)[_0x2f5a('0xb')](function(){return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});});}}}else{return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}}else{if(_0x112fb9['disabled']){return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}else if(_0x4adae1[_0x2f5a('0xa')]>0x0){if(_0x112fb9['blocked']){if(_0x4adae1[_0x2f5a('0x18')]>0x0){if(moment(_0x112fb9[_0x2f5a('0xf')])['add'](_0x4adae1[_0x2f5a('0x18')],_0x2f5a('0x1a'))>moment()){return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}else{return utils['clearBlockUser'](_0x112fb9,0x0,![],null)[_0x2f5a('0xb')](function(){return utils[_0x2f5a('0x1b')](_0x112fb9);})[_0x2f5a('0xb')](function(){return _0x1186a6(null,_0x112fb9);});}}else{return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}}else{return utils['clearBlockUser'](_0x112fb9,0x0,![],null)[_0x2f5a('0xb')](function(){return utils['getLicense'](_0x112fb9);})[_0x2f5a('0xb')](function(){return _0x1186a6(null,_0x112fb9);})['catch'](function(_0x4470f4){return _0x1186a6(null,![],_0x4470f4);});}}else{if(_0x112fb9[_0x2f5a('0x1c')]){return _0x1186a6(null,![],{'message':_0x2f5a('0x15')});}else{return utils['getLicense'](_0x112fb9)['then'](function(){return _0x1186a6(null,_0x112fb9);});}}}});})['catch'](function(_0x416c24){return _0x1186a6(null,![],_0x416c24);});}function sendServiceMail(_0x3f5900){return db[_0x2f5a('0x1d')][_0x2f5a('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x2f5a('0x14'),_0x2f5a('0x1f')],'include':[{'model':db[_0x2f5a('0x20')],'as':'Smtp','include':[{'model':db[_0x2f5a('0x21')],'as':_0x2f5a('0x21')}]}]})[_0x2f5a('0xb')](function(_0x502342){if(!_0x502342){throw new Error(_0x2f5a('0x22'));}var _0xd082c=_0x502342[_0x2f5a('0x23')]();var _0x597904={'account':_0xd082c,'message':_[_0x2f5a('0x24')]({'from':util[_0x2f5a('0x25')](_0x2f5a('0x26'),_0x502342[_0x2f5a('0x14')],_0x502342[_0x2f5a('0x1f')]||_0x502342[_0x2f5a('0x27')][_0x2f5a('0x12')])},_0x3f5900)};return client[_0x2f5a('0x28')]('SendMail',_0x597904);})['then'](function(_0x6f51f9){if(_0x6f51f9[_0x2f5a('0x29')]){throw new Error(util[_0x2f5a('0x25')](_0x2f5a('0x2a'),_0x6f51f9[_0x2f5a('0x29')][_0x2f5a('0x2b')]||JSON['stringify'](_0x6f51f9['error'])));}return!![];});}function handleError(_0x454afd,_0x1a1446,_0x5ec2e7){return _0x454afd[_0x2f5a('0x2c')](_0x1a1446||0x1f4)[_0x2f5a('0x2d')]({'message':_0x5ec2e7?_0x5ec2e7['message']||_0x5ec2e7:''});}exports[_0x2f5a('0x2e')]=function(_0x453127,_0x3a057b,_0x1cff3b){passport[_0x2f5a('0x16')](_0x2f5a('0x2f'),function(_0xdafc3a,_0x2958d4,_0x5f2410){var _0x32640c=_0xdafc3a||_0x5f2410;if(_0x32640c){return handleError(_0x3a057b,0x191,_0x32640c);}if(!_0x2958d4){return handleError(_0x3a057b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x55b2d4={'payload':{'id':_0x2958d4['id'],'role':_0x2958d4[_0x2f5a('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x2f5a('0x30')](_0x55b2d4)[_0x2f5a('0xb')](function(_0x593144){_0x3a057b['json']({'id':_0x2958d4['id'],'token':_0x593144,'statusCall':'','isAlreadyLogged':_0x2958d4[_0x2f5a('0x31')]});});}})(_0x453127,_0x3a057b,_0x1cff3b);};exports[_0x2f5a('0x32')]=function(_0xe517df,_0x1f57bc){if(!_0xe517df[_0x2f5a('0x33')]['email']){return handleError(_0x1f57bc,0x1f4,{'message':_0x2f5a('0x34')});}var _0x32e11d=rs[_0x2f5a('0x35')]();_0xe517df[_0x2f5a('0x33')][_0x2f5a('0x1f')]=_0xe517df[_0x2f5a('0x33')][_0x2f5a('0x1f')][_0x2f5a('0x36')]()[_0x2f5a('0x37')]();var _0x51b6d5;return db['Setting'][_0x2f5a('0x9')]({'where':{'id':0x1},'attributes':[_0x2f5a('0xa'),'blockDuration'],'raw':!![]})['then'](function(_0x339708){_0x51b6d5=_0x339708;return db[_0x2f5a('0x38')][_0x2f5a('0x1e')]({'where':{'email':_0xe517df['body']['email']}});})[_0x2f5a('0xb')](function(_0x5ea25f){if(!_0x5ea25f){throw new Error(_0x2f5a('0x39'));}if(_0x5ea25f[_0x2f5a('0xe')]){throw new Error(_0x2f5a('0x3a'));}if(_0x5ea25f[_0x2f5a('0x1c')]){if(moment(_0x5ea25f[_0x2f5a('0xf')])[_0x2f5a('0x17')](_0x51b6d5['blockDuration'],_0x2f5a('0x1a'))>moment()){throw new Error(_0x2f5a('0x3b'));}else{_0x5ea25f[_0x2f5a('0x1c')]=![];_0x5ea25f[_0x2f5a('0xf')]=null;}}_0x5ea25f[_0x2f5a('0x3c')]=_0x32e11d;_0x5ea25f[_0x2f5a('0x3d')]=Date[_0x2f5a('0x3e')]()+0x36ee80;return _0x5ea25f[_0x2f5a('0x3f')]();})[_0x2f5a('0xb')](function(){return sendServiceMail({'to':_0xe517df[_0x2f5a('0x33')][_0x2f5a('0x1f')],'subject':_0x2f5a('0x40'),'text':_0x2f5a('0x41')+_0x2f5a('0x42')+_0x2f5a('0x43')+_0xe517df[_0x2f5a('0x44')][_0x2f5a('0x45')]+_0x2f5a('0x46')+_0x32e11d+'\x0a\x0a'+_0x2f5a('0x47')});})[_0x2f5a('0xb')](function(){_0x1f57bc[_0x2f5a('0x2c')](0xc8)[_0x2f5a('0x2d')]({'message':_0x2f5a('0x48')});})[_0x2f5a('0x49')](function(_0x496a17){return handleError(_0x1f57bc,0x1f4,_0x496a17);});};exports['reset']=function(_0x222707,_0x4cbb84){return db['User']['find']({'where':{'resetPasswordToken':_0x222707[_0x2f5a('0x4a')][_0x2f5a('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x2f5a('0x3e')]()}}})[_0x2f5a('0xb')](function(_0x2cd422){if(!_0x2cd422){throw new Error(_0x2f5a('0x4c'));}return db['Setting'][_0x2f5a('0x9')]({'attributes':['id',_0x2f5a('0x4d'),_0x2f5a('0x4e'),_0x2f5a('0x4f')]})[_0x2f5a('0xb')](function(_0x16127c){if(_0x16127c[_0x2f5a('0x4d')])authService[_0x2f5a('0x50')](_0x222707[_0x2f5a('0x33')][_0x2f5a('0x51')]);if(!_0x16127c[_0x2f5a('0x4e')]||!_0x2cd422[_0x2f5a('0x52')])return _0x2cd422;authService[_0x2f5a('0x53')](_0x222707['body'][_0x2f5a('0x51')],_0x2cd422['previousPasswords'],_0x16127c['passwordHistoryLimit']);return _0x2cd422;})[_0x2f5a('0xb')](function(){_0x2cd422[_0x2f5a('0x51')]=_0x222707['body']['password'];_0x2cd422['resetPasswordToken']=null;_0x2cd422[_0x2f5a('0x3d')]=null;return _0x2cd422[_0x2f5a('0x3f')]();});})[_0x2f5a('0xb')](function(){_0x4cbb84[_0x2f5a('0x2c')](0xc8)['send']({'message':_0x2f5a('0x54')});})[_0x2f5a('0x49')](function(_0x3ed5e0){return handleError(_0x4cbb84,0x1f4,_0x3ed5e0);});};passport[_0x2f5a('0x55')]('local-login',new LocalStrategy({'usernameField':_0x2f5a('0x14'),'passwordField':'password'},function(_0x410a1e,_0x19985f,_0x4f7d77){return localAuthenticate(db[_0x2f5a('0x38')],_0x410a1e,_0x19985f,_0x4f7d77);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 9825d85..7cc5328 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 _0xc115=['post','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller'];(function(_0x13e77a,_0xadf480){var _0x499845=function(_0x55cd3c){while(--_0x55cd3c){_0x13e77a['push'](_0x13e77a['shift']());}};_0x499845(++_0xadf480);}(_0xc115,0x145));var _0x5c11=function(_0x57a60f,_0x410a3a){_0x57a60f=_0x57a60f-0x0;var _0x19cfe3=_0xc115[_0x57a60f];return _0x19cfe3;};'use strict';var express=require(_0x5c11('0x0'));var router=express[_0x5c11('0x1')]();var controller=require(_0x5c11('0x2'));router[_0x5c11('0x3')]('/',controller['login']);router['post'](_0x5c11('0x4'),controller[_0x5c11('0x5')]);router[_0x5c11('0x3')](_0x5c11('0x6'),controller[_0x5c11('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0xe73e=['forgot','/reset/:token','exports','Router','./authLocal.controller','login','post','/forgot'];(function(_0x2a8443,_0x43f6a8){var _0x1ccfac=function(_0x3a533c){while(--_0x3a533c){_0x2a8443['push'](_0x2a8443['shift']());}};_0x1ccfac(++_0x43f6a8);}(_0xe73e,0x1f3));var _0xee73=function(_0x5ae190,_0x104c8a){_0x5ae190=_0x5ae190-0x0;var _0x42d1c5=_0xe73e[_0x5ae190];return _0x42d1c5;};'use strict';var express=require('express');var router=express[_0xee73('0x0')]();var controller=require(_0xee73('0x1'));router['post']('/',controller[_0xee73('0x2')]);router[_0xee73('0x3')](_0xee73('0x4'),controller[_0xee73('0x5')]);router['post'](_0xee73('0x6'),controller['reset']);module[_0xee73('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 36c63d6..d70345b 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 _0xa2b8=['INTEGER','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2b8,0x177));var _0x8a2b=function(_0x5338dc,_0x529f8f){_0x5338dc=_0x5338dc-0x0;var _0x3b1f77=_0xa2b8[_0x5338dc];return _0x3b1f77;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a2b('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x8a2b('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8a2b('0x1')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3d29=['exports','BOOLEAN','sequelize'];(function(_0x2b3cad,_0x573629){var _0x2175c4=function(_0x2f5a4f){while(--_0x2f5a4f){_0x2b3cad['push'](_0x2b3cad['shift']());}};_0x2175c4(++_0x573629);}(_0x3d29,0x110));var _0x93d2=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x3d29[_0x3afe18];return _0x19ed1f;};'use strict';var Sequelize=require(_0x93d2('0x0'));module[_0x93d2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x93d2('0x2')],'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 13af6ab..03d0320 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 _0x44bd=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','apply','reject','save','update','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','findAll','rows','catch','params','includeAll','include','find','create','body','destroy','addConditions','Condition','omit','ids','getConditions','findOne','pick','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44bd,0x143));var _0xd44b=function(_0x4ae83e,_0x518979){_0x4ae83e=_0x4ae83e-0x0;var _0x5add5e=_0x44bd[_0x4ae83e];return _0x5add5e;};'use strict';var emlformat=require(_0xd44b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd44b('0x1'));var jsonpatch=require(_0xd44b('0x2'));var rp=require(_0xd44b('0x3'));var moment=require(_0xd44b('0x4'));var BPromise=require(_0xd44b('0x5'));var Mustache=require(_0xd44b('0x6'));var util=require('util');var path=require(_0xd44b('0x7'));var sox=require(_0xd44b('0x8'));var csv=require(_0xd44b('0x9'));var ejs=require(_0xd44b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd44b('0xb'));var squel=require(_0xd44b('0xc'));var crypto=require('crypto');var jsforce=require(_0xd44b('0xd'));var deskjs=require(_0xd44b('0xe'));var toCsv=require(_0xd44b('0x9'));var querystring=require(_0xd44b('0xf'));var Papa=require(_0xd44b('0x10'));var Redis=require(_0xd44b('0x11'));var authService=require(_0xd44b('0x12'));var qs=require(_0xd44b('0x13'));var as=require(_0xd44b('0x14'));var hardwareService=require(_0xd44b('0x15'));var logger=require(_0xd44b('0x16'))(_0xd44b('0x17'));var utils=require('../../config/utils');var config=require(_0xd44b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd44b('0x19'))['db'];function respondWithStatusCode(_0x4176dd,_0x43a0b9){_0x43a0b9=_0x43a0b9||0xcc;return function(_0x2980c9){if(_0x2980c9){return _0x4176dd[_0xd44b('0x1a')](_0x43a0b9);}return _0x4176dd['status'](_0x43a0b9)['end']();};}function respondWithResult(_0x37e371,_0x49645e){_0x49645e=_0x49645e||0xc8;return function(_0x41a7dc){if(_0x41a7dc){return _0x37e371[_0xd44b('0x1b')](_0x49645e)[_0xd44b('0x1c')](_0x41a7dc);}};}function respondWithFilteredResult(_0x3e1044,_0x2e2a67){return function(_0x5d7ff3){if(_0x5d7ff3){var _0x5e6d8b=typeof _0x2e2a67[_0xd44b('0x1d')]==='undefined'&&typeof _0x2e2a67[_0xd44b('0x1e')]===_0xd44b('0x1f');var _0x51402e=_0x5d7ff3['count'];var _0x12c86c=_0x5e6d8b?0x0:_0x2e2a67[_0xd44b('0x1d')];var _0x9fd116=_0x5e6d8b?_0x5d7ff3['count']:_0x2e2a67[_0xd44b('0x1d')]+_0x2e2a67[_0xd44b('0x1e')];var _0x48422d;if(_0x9fd116>=_0x51402e){_0x9fd116=_0x51402e;_0x48422d=0xc8;}else{_0x48422d=0xce;}_0x3e1044[_0xd44b('0x1b')](_0x48422d);return _0x3e1044['set']('Content-Range',_0x12c86c+'-'+_0x9fd116+'/'+_0x51402e)['json'](_0x5d7ff3);}return null;};}function patchUpdates(_0x41e8ef){return function(_0x1dc02b){try{jsonpatch[_0xd44b('0x20')](_0x1dc02b,_0x41e8ef,!![]);}catch(_0x166521){return BPromise[_0xd44b('0x21')](_0x166521);}return _0x1dc02b[_0xd44b('0x22')]();};}function saveUpdates(_0x2ea0cc,_0x2c8633){return function(_0x24bd4f){if(_0x24bd4f){return _0x24bd4f[_0xd44b('0x23')](_0x2ea0cc)[_0xd44b('0x24')](function(_0x3223d8){return _0x3223d8;});}return null;};}function removeEntity(_0x226aff,_0x46c108){return function(_0x3d2be9){if(_0x3d2be9){return _0x3d2be9['destroy']()[_0xd44b('0x24')](function(){_0x226aff[_0xd44b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10f825,_0x2b213a){return function(_0x14f23e){if(!_0x14f23e){_0x10f825['sendStatus'](0x194);}return _0x14f23e;};}function handleError(_0x219c4d,_0x4c343e){_0x4c343e=_0x4c343e||0x1f4;return function(_0x516356){logger[_0xd44b('0x25')](_0x516356[_0xd44b('0x26')]);if(_0x516356[_0xd44b('0x27')]){delete _0x516356[_0xd44b('0x27')];}_0x219c4d[_0xd44b('0x1b')](_0x4c343e)[_0xd44b('0x28')](_0x516356);};}exports[_0xd44b('0x29')]=function(_0x457b5d,_0x2b90c){var _0x21e3b5={},_0x293a98={},_0x5ec3d2={'count':0x0,'rows':[]};var _0x513484=_[_0xd44b('0x2a')](db[_0xd44b('0x2b')][_0xd44b('0x2c')],function(_0x1215db){return{'name':_0x1215db[_0xd44b('0x2d')],'type':_0x1215db[_0xd44b('0x2e')][_0xd44b('0x2f')]};});_0x293a98['model']=_[_0xd44b('0x2a')](_0x513484,'name');_0x293a98[_0xd44b('0x30')]=_[_0xd44b('0x31')](_0x457b5d[_0xd44b('0x30')]);_0x293a98['filters']=_[_0xd44b('0x32')](_0x293a98[_0xd44b('0x33')],_0x293a98['query']);_0x21e3b5['attributes']=_['intersection'](_0x293a98[_0xd44b('0x33')],qs['fields'](_0x457b5d['query'][_0xd44b('0x34')]));_0x21e3b5[_0xd44b('0x35')]=_0x21e3b5[_0xd44b('0x35')][_0xd44b('0x36')]?_0x21e3b5['attributes']:_0x293a98[_0xd44b('0x33')];if(!_0x457b5d[_0xd44b('0x30')][_0xd44b('0x37')](_0xd44b('0x38'))){_0x21e3b5['limit']=qs[_0xd44b('0x1e')](_0x457b5d['query'][_0xd44b('0x1e')]);_0x21e3b5[_0xd44b('0x1d')]=qs[_0xd44b('0x1d')](_0x457b5d[_0xd44b('0x30')]['offset']);}_0x21e3b5[_0xd44b('0x39')]=qs[_0xd44b('0x3a')](_0x457b5d[_0xd44b('0x30')][_0xd44b('0x3a')]);_0x21e3b5[_0xd44b('0x3b')]=qs['filters'](_['pick'](_0x457b5d[_0xd44b('0x30')],_0x293a98[_0xd44b('0x3c')]),_0x513484);if(_0x457b5d['query'][_0xd44b('0x3d')]){_0x21e3b5['where']=_['merge'](_0x21e3b5[_0xd44b('0x3b')],{'$or':_[_0xd44b('0x2a')](_0x513484,function(_0x273ccf){if(_0x273ccf[_0xd44b('0x2e')]!=='VIRTUAL'){var _0x34762c={};_0x34762c[_0x273ccf['name']]={'$like':'%'+_0x457b5d[_0xd44b('0x30')][_0xd44b('0x3d')]+'%'};return _0x34762c;}})});}_0x21e3b5=_[_0xd44b('0x3e')]({},_0x21e3b5,_0x457b5d[_0xd44b('0x3f')]);var _0x289739={'where':_0x21e3b5['where']};return db[_0xd44b('0x2b')][_0xd44b('0x40')](_0x289739)[_0xd44b('0x24')](function(_0x17618f){_0x5ec3d2['count']=_0x17618f;if(_0x457b5d['query']['includeAll']){_0x21e3b5['include']=[{'all':!![]}];}return db['Automation'][_0xd44b('0x41')](_0x21e3b5);})[_0xd44b('0x24')](function(_0x295068){_0x5ec3d2[_0xd44b('0x42')]=_0x295068;return _0x5ec3d2;})[_0xd44b('0x24')](respondWithFilteredResult(_0x2b90c,_0x21e3b5))[_0xd44b('0x43')](handleError(_0x2b90c,null));};exports['show']=function(_0x2be128,_0x3073db){var _0x3f5903={'raw':![],'where':{'id':_0x2be128[_0xd44b('0x44')]['id']}},_0x2519ea={};_0x2519ea[_0xd44b('0x33')]=_['keys'](db[_0xd44b('0x2b')]['rawAttributes']);_0x2519ea['query']=_[_0xd44b('0x31')](_0x2be128[_0xd44b('0x30')]);_0x2519ea['filters']=_['intersection'](_0x2519ea['model'],_0x2519ea[_0xd44b('0x30')]);_0x3f5903[_0xd44b('0x35')]=_[_0xd44b('0x32')](_0x2519ea[_0xd44b('0x33')],qs[_0xd44b('0x34')](_0x2be128[_0xd44b('0x30')][_0xd44b('0x34')]));_0x3f5903[_0xd44b('0x35')]=_0x3f5903[_0xd44b('0x35')][_0xd44b('0x36')]?_0x3f5903['attributes']:_0x2519ea['model'];if(_0x2be128['query'][_0xd44b('0x45')]){_0x3f5903[_0xd44b('0x46')]=[{'all':!![]}];}_0x3f5903=_[_0xd44b('0x3e')]({},_0x3f5903,_0x2be128[_0xd44b('0x3f')]);return db['Automation'][_0xd44b('0x47')](_0x3f5903)[_0xd44b('0x24')](handleEntityNotFound(_0x3073db,null))[_0xd44b('0x24')](respondWithResult(_0x3073db,null))[_0xd44b('0x43')](handleError(_0x3073db,null));};exports[_0xd44b('0x48')]=function(_0x274833,_0x2d17be){return db[_0xd44b('0x2b')]['create'](_0x274833[_0xd44b('0x49')],{})[_0xd44b('0x24')](respondWithResult(_0x2d17be,0xc9))[_0xd44b('0x43')](handleError(_0x2d17be,null));};exports[_0xd44b('0x23')]=function(_0x5d04a2,_0x27c800){if(_0x5d04a2[_0xd44b('0x49')]['id']){delete _0x5d04a2[_0xd44b('0x49')]['id'];}return db[_0xd44b('0x2b')][_0xd44b('0x47')]({'where':{'id':_0x5d04a2[_0xd44b('0x44')]['id']}})['then'](handleEntityNotFound(_0x27c800,null))[_0xd44b('0x24')](saveUpdates(_0x5d04a2[_0xd44b('0x49')],null))['then'](respondWithResult(_0x27c800,null))[_0xd44b('0x43')](handleError(_0x27c800,null));};exports[_0xd44b('0x4a')]=function(_0x2ce26a,_0x4b5dd2){return db[_0xd44b('0x2b')][_0xd44b('0x47')]({'where':{'id':_0x2ce26a[_0xd44b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b5dd2,null))[_0xd44b('0x24')](removeEntity(_0x4b5dd2,null))[_0xd44b('0x43')](handleError(_0x4b5dd2,null));};exports[_0xd44b('0x4b')]=function(_0xae08,_0x4ef50b,_0x133649){return db[_0xd44b('0x4c')]['find']({'where':{'id':_0xae08['params']['id']}})['then'](handleEntityNotFound(_0x4ef50b,null))[_0xd44b('0x24')](function(_0x55d5ce){if(_0x55d5ce){return _0x55d5ce[_0xd44b('0x4b')](_0xae08[_0xd44b('0x49')]['ids'],_[_0xd44b('0x4d')](_0xae08[_0xd44b('0x49')],[_0xd44b('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x4ef50b,null))['catch'](handleError(_0x4ef50b,null));};exports[_0xd44b('0x4f')]=function(_0x3ac6f4,_0x55fdc6,_0x5f3b52){var _0x481523={};var _0x25af26={};var _0xb2b393;var _0x2f5c5c;return db['Automation'][_0xd44b('0x50')]({'where':{'id':_0x3ac6f4['params']['id']}})[_0xd44b('0x24')](handleEntityNotFound(_0x55fdc6,null))[_0xd44b('0x24')](function(_0x426f7e){if(_0x426f7e){_0xb2b393=_0x426f7e;_0x25af26[_0xd44b('0x33')]=_[_0xd44b('0x31')](db[_0xd44b('0x4c')][_0xd44b('0x2c')]);_0x25af26['query']=_[_0xd44b('0x31')](_0x3ac6f4[_0xd44b('0x30')]);_0x25af26[_0xd44b('0x3c')]=_['intersection'](_0x25af26[_0xd44b('0x33')],_0x25af26[_0xd44b('0x30')]);_0x481523[_0xd44b('0x35')]=_[_0xd44b('0x32')](_0x25af26[_0xd44b('0x33')],qs[_0xd44b('0x34')](_0x3ac6f4['query'][_0xd44b('0x34')]));_0x481523['attributes']=_0x481523['attributes'][_0xd44b('0x36')]?_0x481523[_0xd44b('0x35')]:_0x25af26[_0xd44b('0x33')];_0x481523[_0xd44b('0x39')]=qs[_0xd44b('0x3a')](_0x3ac6f4[_0xd44b('0x30')]['sort']);_0x481523[_0xd44b('0x3b')]=qs['filters'](_[_0xd44b('0x51')](_0x3ac6f4[_0xd44b('0x30')],_0x25af26['filters']));if(_0x3ac6f4[_0xd44b('0x30')]['filter']){_0x481523['where']=_[_0xd44b('0x3e')](_0x481523[_0xd44b('0x3b')],{'$or':_[_0xd44b('0x2a')](_0x481523[_0xd44b('0x35')],function(_0x2e274b){var _0x41c0a9={};_0x41c0a9[_0x2e274b]={'$like':'%'+_0x3ac6f4[_0xd44b('0x30')][_0xd44b('0x3d')]+'%'};return _0x41c0a9;})});}_0x481523=_['merge']({},_0x481523,_0x3ac6f4[_0xd44b('0x3f')]);return _0xb2b393['getConditions'](_0x481523);}})[_0xd44b('0x24')](function(_0x2438fe){if(_0x2438fe){_0x2f5c5c=_0x2438fe['length'];if(!_0x3ac6f4[_0xd44b('0x30')]['hasOwnProperty']('nolimit')){_0x481523[_0xd44b('0x1e')]=qs[_0xd44b('0x1e')](_0x3ac6f4['query']['limit']);_0x481523['offset']=qs[_0xd44b('0x1d')](_0x3ac6f4[_0xd44b('0x30')][_0xd44b('0x1d')]);}return _0xb2b393[_0xd44b('0x4f')](_0x481523);}})[_0xd44b('0x24')](function(_0x6e8ede){if(_0x6e8ede){return _0x6e8ede?{'count':_0x2f5c5c,'rows':_0x6e8ede}:null;}})[_0xd44b('0x24')](respondWithResult(_0x55fdc6,null))[_0xd44b('0x43')](handleError(_0x55fdc6,null));};exports[_0xd44b('0x52')]=function(_0x5f4f66,_0x1d55b1,_0x3beaff){return db[_0xd44b('0x53')][_0xd44b('0x47')]({'where':{'id':_0x5f4f66['params']['id']}})[_0xd44b('0x24')](handleEntityNotFound(_0x1d55b1,null))['then'](function(_0x2b2036){if(_0x2b2036){return _0x2b2036[_0xd44b('0x52')](_0x5f4f66[_0xd44b('0x49')]['ids'],_[_0xd44b('0x4d')](_0x5f4f66['body'],['ids','id'])||{});}})[_0xd44b('0x24')](respondWithResult(_0x1d55b1,null))[_0xd44b('0x43')](handleError(_0x1d55b1,null));};exports[_0xd44b('0x54')]=function(_0x886cf8,_0x22ca85,_0xd9bb1c){var _0x29d234={};var _0x2db881={};var _0xef1de9;var _0x42df86;return db[_0xd44b('0x2b')]['findOne']({'where':{'id':_0x886cf8[_0xd44b('0x44')]['id']}})[_0xd44b('0x24')](handleEntityNotFound(_0x22ca85,null))[_0xd44b('0x24')](function(_0x434915){if(_0x434915){_0xef1de9=_0x434915;_0x2db881[_0xd44b('0x33')]=_['keys'](db[_0xd44b('0x53')][_0xd44b('0x2c')]);_0x2db881[_0xd44b('0x30')]=_[_0xd44b('0x31')](_0x886cf8[_0xd44b('0x30')]);_0x2db881[_0xd44b('0x3c')]=_[_0xd44b('0x32')](_0x2db881[_0xd44b('0x33')],_0x2db881['query']);_0x29d234['attributes']=_[_0xd44b('0x32')](_0x2db881['model'],qs[_0xd44b('0x34')](_0x886cf8['query'][_0xd44b('0x34')]));_0x29d234[_0xd44b('0x35')]=_0x29d234[_0xd44b('0x35')]['length']?_0x29d234['attributes']:_0x2db881[_0xd44b('0x33')];_0x29d234[_0xd44b('0x39')]=qs[_0xd44b('0x3a')](_0x886cf8[_0xd44b('0x30')][_0xd44b('0x3a')]);_0x29d234['where']=qs[_0xd44b('0x3c')](_[_0xd44b('0x51')](_0x886cf8[_0xd44b('0x30')],_0x2db881[_0xd44b('0x3c')]));if(_0x886cf8[_0xd44b('0x30')][_0xd44b('0x3d')]){_0x29d234[_0xd44b('0x3b')]=_[_0xd44b('0x3e')](_0x29d234['where'],{'$or':_['map'](_0x29d234[_0xd44b('0x35')],function(_0x204111){var _0x283e66={};_0x283e66[_0x204111]={'$like':'%'+_0x886cf8[_0xd44b('0x30')][_0xd44b('0x3d')]+'%'};return _0x283e66;})});}_0x29d234=_['merge']({},_0x29d234,_0x886cf8['options']);return _0xef1de9['getActions'](_0x29d234);}})[_0xd44b('0x24')](function(_0x3a86fe){if(_0x3a86fe){_0x42df86=_0x3a86fe[_0xd44b('0x36')];if(!_0x886cf8['query'][_0xd44b('0x37')](_0xd44b('0x38'))){_0x29d234['limit']=qs[_0xd44b('0x1e')](_0x886cf8[_0xd44b('0x30')][_0xd44b('0x1e')]);_0x29d234['offset']=qs[_0xd44b('0x1d')](_0x886cf8[_0xd44b('0x30')]['offset']);}return _0xef1de9[_0xd44b('0x54')](_0x29d234);}})['then'](function(_0x3f4377){if(_0x3f4377){return _0x3f4377?{'count':_0x42df86,'rows':_0x3f4377}:null;}})[_0xd44b('0x24')](respondWithResult(_0x22ca85,null))[_0xd44b('0x43')](handleError(_0x22ca85,null));};
\ No newline at end of file
+var _0xeeb1=['includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','ids','findOne','Condition','getConditions','hasOwnProperty','addActions','omit','getActions','Action','nolimit','eml-format','zip-dir','fast-json-patch','moment','util','lodash','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','name','send','index','Automation','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','merge'];(function(_0x3fabbf,_0xe1b751){var _0x3186ea=function(_0x1f9493){while(--_0x1f9493){_0x3fabbf['push'](_0x3fabbf['shift']());}};_0x3186ea(++_0xe1b751);}(_0xeeb1,0x14e));var _0x1eeb=function(_0x6a7421,_0x20b4f5){_0x6a7421=_0x6a7421-0x0;var _0x33f5d1=_0xeeb1[_0x6a7421];return _0x33f5d1;};'use strict';var emlformat=require(_0x1eeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1eeb('0x1'));var jsonpatch=require(_0x1eeb('0x2'));var rp=require('request-promise');var moment=require(_0x1eeb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1eeb('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1eeb('0x5'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1eeb('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x1eeb('0x7'));var querystring=require(_0x1eeb('0x8'));var Papa=require(_0x1eeb('0x9'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1eeb('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1eeb('0xb'));var logger=require(_0x1eeb('0xc'))(_0x1eeb('0xd'));var utils=require(_0x1eeb('0xe'));var config=require(_0x1eeb('0xf'));var licenseUtil=require(_0x1eeb('0x10'));var db=require(_0x1eeb('0x11'))['db'];function respondWithStatusCode(_0x2faa7b,_0x2d460a){_0x2d460a=_0x2d460a||0xcc;return function(_0x46f067){if(_0x46f067){return _0x2faa7b[_0x1eeb('0x12')](_0x2d460a);}return _0x2faa7b[_0x1eeb('0x13')](_0x2d460a)[_0x1eeb('0x14')]();};}function respondWithResult(_0x1f6566,_0x17312b){_0x17312b=_0x17312b||0xc8;return function(_0x3d7596){if(_0x3d7596){return _0x1f6566[_0x1eeb('0x13')](_0x17312b)[_0x1eeb('0x15')](_0x3d7596);}};}function respondWithFilteredResult(_0x461be8,_0xdc3c33){return function(_0x4e6d49){if(_0x4e6d49){var _0x92c488=typeof _0xdc3c33['offset']===_0x1eeb('0x16')&&typeof _0xdc3c33[_0x1eeb('0x17')]==='undefined';var _0x53a297=_0x4e6d49['count'];var _0x216d77=_0x92c488?0x0:_0xdc3c33['offset'];var _0x2c7b98=_0x92c488?_0x4e6d49[_0x1eeb('0x18')]:_0xdc3c33[_0x1eeb('0x19')]+_0xdc3c33[_0x1eeb('0x17')];var _0x3fcb29;if(_0x2c7b98>=_0x53a297){_0x2c7b98=_0x53a297;_0x3fcb29=0xc8;}else{_0x3fcb29=0xce;}_0x461be8[_0x1eeb('0x13')](_0x3fcb29);return _0x461be8['set'](_0x1eeb('0x1a'),_0x216d77+'-'+_0x2c7b98+'/'+_0x53a297)['json'](_0x4e6d49);}return null;};}function patchUpdates(_0x42b665){return function(_0x2b5b0b){try{jsonpatch[_0x1eeb('0x1b')](_0x2b5b0b,_0x42b665,!![]);}catch(_0x5ac8a9){return BPromise['reject'](_0x5ac8a9);}return _0x2b5b0b[_0x1eeb('0x1c')]();};}function saveUpdates(_0x1fe93f,_0xc73ff8){return function(_0x5b72fc){if(_0x5b72fc){return _0x5b72fc[_0x1eeb('0x1d')](_0x1fe93f)[_0x1eeb('0x1e')](function(_0x3ddb59){return _0x3ddb59;});}return null;};}function removeEntity(_0x2e0484,_0x2540a6){return function(_0x787ddc){if(_0x787ddc){return _0x787ddc[_0x1eeb('0x1f')]()['then'](function(){_0x2e0484[_0x1eeb('0x13')](0xcc)[_0x1eeb('0x14')]();});}};}function handleEntityNotFound(_0x159561,_0xf56d6a){return function(_0x36d557){if(!_0x36d557){_0x159561[_0x1eeb('0x12')](0x194);}return _0x36d557;};}function handleError(_0x41e2a4,_0x16da5f){_0x16da5f=_0x16da5f||0x1f4;return function(_0xd30c4d){logger[_0x1eeb('0x20')](_0xd30c4d['stack']);if(_0xd30c4d[_0x1eeb('0x21')]){delete _0xd30c4d[_0x1eeb('0x21')];}_0x41e2a4[_0x1eeb('0x13')](_0x16da5f)[_0x1eeb('0x22')](_0xd30c4d);};}exports[_0x1eeb('0x23')]=function(_0x369065,_0x3ace44){var _0x323bb5={},_0x2e6cb2={},_0x2cda05={'count':0x0,'rows':[]};var _0x933be1=_['map'](db[_0x1eeb('0x24')][_0x1eeb('0x25')],function(_0x5c0f97){return{'name':_0x5c0f97[_0x1eeb('0x26')],'type':_0x5c0f97[_0x1eeb('0x27')][_0x1eeb('0x28')]};});_0x2e6cb2[_0x1eeb('0x29')]=_[_0x1eeb('0x2a')](_0x933be1,_0x1eeb('0x21'));_0x2e6cb2[_0x1eeb('0x2b')]=_['keys'](_0x369065['query']);_0x2e6cb2['filters']=_['intersection'](_0x2e6cb2[_0x1eeb('0x29')],_0x2e6cb2[_0x1eeb('0x2b')]);_0x323bb5[_0x1eeb('0x2c')]=_[_0x1eeb('0x2d')](_0x2e6cb2[_0x1eeb('0x29')],qs['fields'](_0x369065[_0x1eeb('0x2b')][_0x1eeb('0x2e')]));_0x323bb5[_0x1eeb('0x2c')]=_0x323bb5[_0x1eeb('0x2c')][_0x1eeb('0x2f')]?_0x323bb5[_0x1eeb('0x2c')]:_0x2e6cb2[_0x1eeb('0x29')];if(!_0x369065[_0x1eeb('0x2b')]['hasOwnProperty']('nolimit')){_0x323bb5['limit']=qs[_0x1eeb('0x17')](_0x369065[_0x1eeb('0x2b')][_0x1eeb('0x17')]);_0x323bb5[_0x1eeb('0x19')]=qs['offset'](_0x369065[_0x1eeb('0x2b')][_0x1eeb('0x19')]);}_0x323bb5[_0x1eeb('0x30')]=qs['sort'](_0x369065[_0x1eeb('0x2b')][_0x1eeb('0x31')]);_0x323bb5[_0x1eeb('0x32')]=qs[_0x1eeb('0x33')](_[_0x1eeb('0x34')](_0x369065[_0x1eeb('0x2b')],_0x2e6cb2[_0x1eeb('0x33')]),_0x933be1);if(_0x369065[_0x1eeb('0x2b')][_0x1eeb('0x35')]){_0x323bb5['where']=_['merge'](_0x323bb5[_0x1eeb('0x32')],{'$or':_[_0x1eeb('0x2a')](_0x933be1,function(_0x2868a1){if(_0x2868a1[_0x1eeb('0x27')]!==_0x1eeb('0x36')){var _0x47fa0c={};_0x47fa0c[_0x2868a1[_0x1eeb('0x21')]]={'$like':'%'+_0x369065[_0x1eeb('0x2b')]['filter']+'%'};return _0x47fa0c;}})});}_0x323bb5=_[_0x1eeb('0x37')]({},_0x323bb5,_0x369065['options']);var _0x1bd5ed={'where':_0x323bb5[_0x1eeb('0x32')]};return db[_0x1eeb('0x24')][_0x1eeb('0x18')](_0x1bd5ed)['then'](function(_0x266edb){_0x2cda05['count']=_0x266edb;if(_0x369065[_0x1eeb('0x2b')][_0x1eeb('0x38')]){_0x323bb5[_0x1eeb('0x39')]=[{'all':!![]}];}return db[_0x1eeb('0x24')][_0x1eeb('0x3a')](_0x323bb5);})[_0x1eeb('0x1e')](function(_0x53d459){_0x2cda05[_0x1eeb('0x3b')]=_0x53d459;return _0x2cda05;})[_0x1eeb('0x1e')](respondWithFilteredResult(_0x3ace44,_0x323bb5))[_0x1eeb('0x3c')](handleError(_0x3ace44,null));};exports[_0x1eeb('0x3d')]=function(_0x2aba74,_0x59b7df){var _0x5ac76f={'raw':![],'where':{'id':_0x2aba74[_0x1eeb('0x3e')]['id']}},_0x20d4a7={};_0x20d4a7[_0x1eeb('0x29')]=_[_0x1eeb('0x3f')](db[_0x1eeb('0x24')][_0x1eeb('0x25')]);_0x20d4a7[_0x1eeb('0x2b')]=_['keys'](_0x2aba74[_0x1eeb('0x2b')]);_0x20d4a7[_0x1eeb('0x33')]=_[_0x1eeb('0x2d')](_0x20d4a7[_0x1eeb('0x29')],_0x20d4a7[_0x1eeb('0x2b')]);_0x5ac76f[_0x1eeb('0x2c')]=_[_0x1eeb('0x2d')](_0x20d4a7[_0x1eeb('0x29')],qs['fields'](_0x2aba74['query'][_0x1eeb('0x2e')]));_0x5ac76f[_0x1eeb('0x2c')]=_0x5ac76f[_0x1eeb('0x2c')][_0x1eeb('0x2f')]?_0x5ac76f[_0x1eeb('0x2c')]:_0x20d4a7[_0x1eeb('0x29')];if(_0x2aba74[_0x1eeb('0x2b')][_0x1eeb('0x38')]){_0x5ac76f[_0x1eeb('0x39')]=[{'all':!![]}];}_0x5ac76f=_[_0x1eeb('0x37')]({},_0x5ac76f,_0x2aba74[_0x1eeb('0x40')]);return db[_0x1eeb('0x24')]['find'](_0x5ac76f)[_0x1eeb('0x1e')](handleEntityNotFound(_0x59b7df,null))[_0x1eeb('0x1e')](respondWithResult(_0x59b7df,null))[_0x1eeb('0x3c')](handleError(_0x59b7df,null));};exports[_0x1eeb('0x41')]=function(_0xfe982c,_0x498153){return db['Automation'][_0x1eeb('0x41')](_0xfe982c['body'],{})[_0x1eeb('0x1e')](respondWithResult(_0x498153,0xc9))[_0x1eeb('0x3c')](handleError(_0x498153,null));};exports[_0x1eeb('0x1d')]=function(_0x13ff3d,_0x44d64f){if(_0x13ff3d[_0x1eeb('0x42')]['id']){delete _0x13ff3d['body']['id'];}return db[_0x1eeb('0x24')][_0x1eeb('0x43')]({'where':{'id':_0x13ff3d[_0x1eeb('0x3e')]['id']}})[_0x1eeb('0x1e')](handleEntityNotFound(_0x44d64f,null))[_0x1eeb('0x1e')](saveUpdates(_0x13ff3d[_0x1eeb('0x42')],null))[_0x1eeb('0x1e')](respondWithResult(_0x44d64f,null))[_0x1eeb('0x3c')](handleError(_0x44d64f,null));};exports[_0x1eeb('0x1f')]=function(_0x327041,_0x5ce347){return db[_0x1eeb('0x24')]['find']({'where':{'id':_0x327041[_0x1eeb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5ce347,null))['then'](removeEntity(_0x5ce347,null))[_0x1eeb('0x3c')](handleError(_0x5ce347,null));};exports['addConditions']=function(_0x291252,_0x5706d2,_0x2e97ca){return db['Condition'][_0x1eeb('0x43')]({'where':{'id':_0x291252['params']['id']}})[_0x1eeb('0x1e')](handleEntityNotFound(_0x5706d2,null))['then'](function(_0x111a2a){if(_0x111a2a){return _0x111a2a['addConditions'](_0x291252[_0x1eeb('0x42')][_0x1eeb('0x44')],_['omit'](_0x291252['body'],[_0x1eeb('0x44'),'id'])||{});}})[_0x1eeb('0x1e')](respondWithResult(_0x5706d2,null))[_0x1eeb('0x3c')](handleError(_0x5706d2,null));};exports['getConditions']=function(_0x48e214,_0x226869,_0x2f11bb){var _0x271066={};var _0x4a36d0={};var _0x2648e1;var _0x458e00;return db[_0x1eeb('0x24')][_0x1eeb('0x45')]({'where':{'id':_0x48e214[_0x1eeb('0x3e')]['id']}})[_0x1eeb('0x1e')](handleEntityNotFound(_0x226869,null))[_0x1eeb('0x1e')](function(_0x1e08a7){if(_0x1e08a7){_0x2648e1=_0x1e08a7;_0x4a36d0[_0x1eeb('0x29')]=_[_0x1eeb('0x3f')](db[_0x1eeb('0x46')][_0x1eeb('0x25')]);_0x4a36d0[_0x1eeb('0x2b')]=_[_0x1eeb('0x3f')](_0x48e214[_0x1eeb('0x2b')]);_0x4a36d0[_0x1eeb('0x33')]=_[_0x1eeb('0x2d')](_0x4a36d0['model'],_0x4a36d0[_0x1eeb('0x2b')]);_0x271066[_0x1eeb('0x2c')]=_[_0x1eeb('0x2d')](_0x4a36d0[_0x1eeb('0x29')],qs[_0x1eeb('0x2e')](_0x48e214[_0x1eeb('0x2b')][_0x1eeb('0x2e')]));_0x271066['attributes']=_0x271066[_0x1eeb('0x2c')][_0x1eeb('0x2f')]?_0x271066[_0x1eeb('0x2c')]:_0x4a36d0[_0x1eeb('0x29')];_0x271066[_0x1eeb('0x30')]=qs[_0x1eeb('0x31')](_0x48e214[_0x1eeb('0x2b')][_0x1eeb('0x31')]);_0x271066['where']=qs[_0x1eeb('0x33')](_[_0x1eeb('0x34')](_0x48e214['query'],_0x4a36d0['filters']));if(_0x48e214[_0x1eeb('0x2b')][_0x1eeb('0x35')]){_0x271066[_0x1eeb('0x32')]=_[_0x1eeb('0x37')](_0x271066[_0x1eeb('0x32')],{'$or':_['map'](_0x271066[_0x1eeb('0x2c')],function(_0x1387b1){var _0x117e88={};_0x117e88[_0x1387b1]={'$like':'%'+_0x48e214[_0x1eeb('0x2b')][_0x1eeb('0x35')]+'%'};return _0x117e88;})});}_0x271066=_[_0x1eeb('0x37')]({},_0x271066,_0x48e214['options']);return _0x2648e1[_0x1eeb('0x47')](_0x271066);}})[_0x1eeb('0x1e')](function(_0x2c2057){if(_0x2c2057){_0x458e00=_0x2c2057['length'];if(!_0x48e214[_0x1eeb('0x2b')][_0x1eeb('0x48')]('nolimit')){_0x271066['limit']=qs['limit'](_0x48e214[_0x1eeb('0x2b')][_0x1eeb('0x17')]);_0x271066[_0x1eeb('0x19')]=qs[_0x1eeb('0x19')](_0x48e214[_0x1eeb('0x2b')][_0x1eeb('0x19')]);}return _0x2648e1[_0x1eeb('0x47')](_0x271066);}})['then'](function(_0x2aed06){if(_0x2aed06){return _0x2aed06?{'count':_0x458e00,'rows':_0x2aed06}:null;}})[_0x1eeb('0x1e')](respondWithResult(_0x226869,null))[_0x1eeb('0x3c')](handleError(_0x226869,null));};exports[_0x1eeb('0x49')]=function(_0x2b9544,_0x102749,_0x226c9b){return db['Action'][_0x1eeb('0x43')]({'where':{'id':_0x2b9544[_0x1eeb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x102749,null))['then'](function(_0x43b9e0){if(_0x43b9e0){return _0x43b9e0[_0x1eeb('0x49')](_0x2b9544[_0x1eeb('0x42')]['ids'],_[_0x1eeb('0x4a')](_0x2b9544[_0x1eeb('0x42')],[_0x1eeb('0x44'),'id'])||{});}})['then'](respondWithResult(_0x102749,null))[_0x1eeb('0x3c')](handleError(_0x102749,null));};exports[_0x1eeb('0x4b')]=function(_0x3e4f1c,_0x1e36ca,_0x224938){var _0xda9f5a={};var _0x31a455={};var _0x51f467;var _0x2306e5;return db['Automation']['findOne']({'where':{'id':_0x3e4f1c[_0x1eeb('0x3e')]['id']}})[_0x1eeb('0x1e')](handleEntityNotFound(_0x1e36ca,null))['then'](function(_0x4bcad8){if(_0x4bcad8){_0x51f467=_0x4bcad8;_0x31a455['model']=_['keys'](db[_0x1eeb('0x4c')][_0x1eeb('0x25')]);_0x31a455[_0x1eeb('0x2b')]=_[_0x1eeb('0x3f')](_0x3e4f1c[_0x1eeb('0x2b')]);_0x31a455['filters']=_[_0x1eeb('0x2d')](_0x31a455['model'],_0x31a455[_0x1eeb('0x2b')]);_0xda9f5a[_0x1eeb('0x2c')]=_['intersection'](_0x31a455[_0x1eeb('0x29')],qs[_0x1eeb('0x2e')](_0x3e4f1c[_0x1eeb('0x2b')]['fields']));_0xda9f5a[_0x1eeb('0x2c')]=_0xda9f5a[_0x1eeb('0x2c')][_0x1eeb('0x2f')]?_0xda9f5a[_0x1eeb('0x2c')]:_0x31a455[_0x1eeb('0x29')];_0xda9f5a['order']=qs['sort'](_0x3e4f1c[_0x1eeb('0x2b')][_0x1eeb('0x31')]);_0xda9f5a['where']=qs[_0x1eeb('0x33')](_[_0x1eeb('0x34')](_0x3e4f1c[_0x1eeb('0x2b')],_0x31a455[_0x1eeb('0x33')]));if(_0x3e4f1c[_0x1eeb('0x2b')][_0x1eeb('0x35')]){_0xda9f5a[_0x1eeb('0x32')]=_[_0x1eeb('0x37')](_0xda9f5a[_0x1eeb('0x32')],{'$or':_[_0x1eeb('0x2a')](_0xda9f5a['attributes'],function(_0x3a3af7){var _0x51639f={};_0x51639f[_0x3a3af7]={'$like':'%'+_0x3e4f1c[_0x1eeb('0x2b')][_0x1eeb('0x35')]+'%'};return _0x51639f;})});}_0xda9f5a=_[_0x1eeb('0x37')]({},_0xda9f5a,_0x3e4f1c[_0x1eeb('0x40')]);return _0x51f467[_0x1eeb('0x4b')](_0xda9f5a);}})['then'](function(_0x49b19d){if(_0x49b19d){_0x2306e5=_0x49b19d[_0x1eeb('0x2f')];if(!_0x3e4f1c[_0x1eeb('0x2b')][_0x1eeb('0x48')](_0x1eeb('0x4d'))){_0xda9f5a[_0x1eeb('0x17')]=qs[_0x1eeb('0x17')](_0x3e4f1c[_0x1eeb('0x2b')][_0x1eeb('0x17')]);_0xda9f5a[_0x1eeb('0x19')]=qs[_0x1eeb('0x19')](_0x3e4f1c[_0x1eeb('0x2b')][_0x1eeb('0x19')]);}return _0x51f467[_0x1eeb('0x4b')](_0xda9f5a);}})['then'](function(_0x494eae){if(_0x494eae){return _0x494eae?{'count':_0x2306e5,'rows':_0x494eae}:null;}})[_0x1eeb('0x1e')](respondWithResult(_0x1e36ca,null))[_0x1eeb('0x3c')](handleError(_0x1e36ca,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 72399be..7e28f5c 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 _0xa59c=['Automation','tools_automations','lodash','util','request-promise','path','../../config/environment','./automation.attributes','define'];(function(_0x3aa88e,_0x4f2dc8){var _0x3bbdee=function(_0x459c2d){while(--_0x459c2d){_0x3aa88e['push'](_0x3aa88e['shift']());}};_0x3bbdee(++_0x4f2dc8);}(_0xa59c,0x14f));var _0xca59=function(_0x2c2616,_0x14ec49){_0x2c2616=_0x2c2616-0x0;var _0x327d21=_0xa59c[_0x2c2616];return _0x327d21;};'use strict';var _=require(_0xca59('0x0'));var util=require(_0xca59('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca59('0x2'));var fs=require('fs');var path=require(_0xca59('0x3'));var rimraf=require('rimraf');var config=require(_0xca59('0x4'));var attributes=require(_0xca59('0x5'));module['exports']=function(_0x4cdeaa,_0x161d65){return _0x4cdeaa[_0xca59('0x6')](_0xca59('0x7'),attributes,{'tableName':_0xca59('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x864c=['../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x864c,0x125));var _0xc864=function(_0x121789,_0x24bd14){_0x121789=_0x121789-0x0;var _0x108646=_0x864c[_0x121789];return _0x108646;};'use strict';var _=require(_0xc864('0x0'));var util=require(_0xc864('0x1'));var logger=require(_0xc864('0x2'))(_0xc864('0x3'));var moment=require(_0xc864('0x4'));var BPromise=require(_0xc864('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc864('0x6'));var rimraf=require('rimraf');var config=require(_0xc864('0x7'));var attributes=require(_0xc864('0x8'));module['exports']=function(_0x42b298,_0x15dd9b){return _0x42b298[_0xc864('0x9')](_0xc864('0xa'),attributes,{'tableName':_0xc864('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 5150ce8..8babc30 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 _0x958a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x2713e1,_0xfd4305){var _0x4bd714=function(_0x359529){while(--_0x359529){_0x2713e1['push'](_0x2713e1['shift']());}};_0x4bd714(++_0xfd4305);}(_0x958a,0x128));var _0xa958=function(_0x3aaa0b,_0xe53b50){_0x3aaa0b=_0x3aaa0b-0x0;var _0x29e865=_0x958a[_0x3aaa0b];return _0x29e865;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}
\ No newline at end of file
+var _0x390a=['jayson/promise','client','request','then','info','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x9ead04,_0x5abdf1){var _0x1fa9c8=function(_0x9c348){while(--_0x9c348){_0x9ead04['push'](_0x9ead04['shift']());}};_0x1fa9c8(++_0x5abdf1);}(_0x390a,0xc9));var _0xa390=function(_0x1289a7,_0x51e6d8){_0x1289a7=_0x1289a7-0x0;var _0x341185=_0x390a[_0x1289a7];return _0x341185;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var moment=require(_0xa390('0x2'));var BPromise=require(_0xa390('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa390('0x4'));var db=require(_0xa390('0x5'))['db'];var utils=require(_0xa390('0x6'));var logger=require(_0xa390('0x7'))('rpc');var config=require(_0xa390('0x8'));var jayson=require(_0xa390('0x9'));var client=jayson[_0xa390('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d49cc,_0x1f9de0,_0x53bfb4){return new BPromise(function(_0x492418,_0xc8cd85){return client[_0xa390('0xb')](_0x2d49cc,_0x53bfb4)[_0xa390('0xc')](function(_0x226003){logger[_0xa390('0xd')]('Automation,\x20%s,\x20%s',_0x1f9de0,'request\x20sent');logger[_0xa390('0xe')](_0xa390('0xf'),_0x1f9de0,_0xa390('0x10'),JSON['stringify'](_0x226003));if(_0x226003[_0xa390('0x11')]){if(_0x226003[_0xa390('0x11')]['code']===0x1f4){logger[_0xa390('0x11')](_0xa390('0x12'),_0x1f9de0,_0x226003['error']['message']);return _0xc8cd85(_0x226003[_0xa390('0x11')][_0xa390('0x13')]);}logger['error'](_0xa390('0x12'),_0x1f9de0,_0x226003['error']['message']);return _0x492418(_0x226003['error'][_0xa390('0x13')]);}else{logger['info'](_0xa390('0x12'),_0x1f9de0,_0xa390('0x10'));_0x492418(_0x226003['result'][_0xa390('0x13')]);}})[_0xa390('0x14')](function(_0x59d609){logger[_0xa390('0x11')]('Automation,\x20%s,\x20%s',_0x1f9de0,_0x59d609);_0xc8cd85(_0x59d609);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 8a2f13e..1e15159 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 _0x074a=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x074a,0x97));var _0xa074=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x074a[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xa074('0x0'));var util=require(_0xa074('0x1'));var path=require(_0xa074('0x2'));var timeout=require(_0xa074('0x3'));var express=require('express');var router=express[_0xa074('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa074('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa074('0x6'));router[_0xa074('0x7')]('/',auth[_0xa074('0x8')](),controller[_0xa074('0x9')]);router[_0xa074('0x7')](_0xa074('0xa'),auth[_0xa074('0x8')](),controller[_0xa074('0xb')]);router[_0xa074('0x7')](_0xa074('0xc'),auth[_0xa074('0x8')](),controller[_0xa074('0xd')]);router[_0xa074('0x7')](_0xa074('0xe'),auth[_0xa074('0x8')](),controller[_0xa074('0xf')]);router[_0xa074('0x10')]('/',auth[_0xa074('0x8')](),controller[_0xa074('0x11')]);router[_0xa074('0x10')](_0xa074('0xc'),auth[_0xa074('0x8')](),controller[_0xa074('0x12')]);router[_0xa074('0x10')](_0xa074('0xe'),auth[_0xa074('0x8')](),controller[_0xa074('0x13')]);router[_0xa074('0x14')](_0xa074('0xa'),auth[_0xa074('0x8')](),controller[_0xa074('0x15')]);router[_0xa074('0x16')]('/:id',auth[_0xa074('0x8')](),controller[_0xa074('0x17')]);module[_0xa074('0x18')]=router;
\ No newline at end of file
+var _0xdecb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','post','/:id/actions','addActions','put','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0x4d87a1,_0x3029fe){var _0x4c0343=function(_0x5355d0){while(--_0x5355d0){_0x4d87a1['push'](_0x4d87a1['shift']());}};_0x4c0343(++_0x3029fe);}(_0xdecb,0xe2));var _0xbdec=function(_0x498a6a,_0x3136d8){_0x498a6a=_0x498a6a-0x0;var _0x1fb842=_0xdecb[_0x498a6a];return _0x1fb842;};'use strict';var multer=require('multer');var util=require(_0xbdec('0x0'));var path=require(_0xbdec('0x1'));var timeout=require(_0xbdec('0x2'));var express=require('express');var router=express[_0xbdec('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbdec('0x4'));var interaction=require(_0xbdec('0x5'));var config=require(_0xbdec('0x6'));var controller=require(_0xbdec('0x7'));router[_0xbdec('0x8')]('/',auth[_0xbdec('0x9')](),controller[_0xbdec('0xa')]);router['get'](_0xbdec('0xb'),auth[_0xbdec('0x9')](),controller[_0xbdec('0xc')]);router[_0xbdec('0x8')](_0xbdec('0xd'),auth[_0xbdec('0x9')](),controller[_0xbdec('0xe')]);router[_0xbdec('0x8')]('/:id/actions',auth[_0xbdec('0x9')](),controller[_0xbdec('0xf')]);router[_0xbdec('0x10')]('/',auth[_0xbdec('0x9')](),controller['create']);router[_0xbdec('0x10')](_0xbdec('0xd'),auth[_0xbdec('0x9')](),controller['addConditions']);router[_0xbdec('0x10')](_0xbdec('0x11'),auth[_0xbdec('0x9')](),controller[_0xbdec('0x12')]);router[_0xbdec('0x13')](_0xbdec('0xb'),auth[_0xbdec('0x9')](),controller[_0xbdec('0x14')]);router[_0xbdec('0x15')](_0xbdec('0xb'),auth[_0xbdec('0x9')](),controller[_0xbdec('0x16')]);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 475a2b3..b8e7b55 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 _0x42a1=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','INTEGER','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x115fdb,_0x338195){var _0x36edb7=function(_0xefbbe0){while(--_0xefbbe0){_0x115fdb['push'](_0x115fdb['shift']());}};_0x36edb7(++_0x338195);}(_0x42a1,0x123));var _0x142a=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x42a1[_0x4a5494];return _0x57cbb5;};'use strict';var Sequelize=require(_0x142a('0x0'));module[_0x142a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x142a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x142a('0x3')](_0x142a('0x4')),'allowNull':![],'defaultValue':_0x142a('0x4')},'description':{'type':Sequelize[_0x142a('0x5')]},'active':{'type':Sequelize[_0x142a('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x142a('0x7')](0x4)[_0x142a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x142a('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'comment':_0x142a('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x142a('0xd')},'dialTimezone':{'type':Sequelize[_0x142a('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x142a('0x5')],'defaultValue':_0x142a('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x142a('0x3')](_0x142a('0xf'),_0x142a('0x10'),_0x142a('0x11')),'defaultValue':_0x142a('0xf')},'dialAMDActive':{'type':Sequelize[_0x142a('0x6')],'defaultValue':0x0,'comment':_0x142a('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x142a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x142a('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x142a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x142a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x142a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x142a('0x7')](0x9)[_0x142a('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x142a('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x142a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x142a('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x142a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x142a('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x142a('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x142a('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x142a('0x3')](_0x142a('0x1b'),_0x142a('0x1c')),'defaultValue':_0x142a('0x1b')},'dialPrefix':{'type':Sequelize[_0x142a('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x142a('0x1d')},'dialCutDigit':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x142a('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x142a('0x7')](0x3)[_0x142a('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x142a('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x142a('0x7')](0x5)[_0x142a('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x142a('0x25')}};
\ No newline at end of file
+var _0x69ed=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x69ed,0x1b6));var _0xd69e=function(_0xfc68da,_0x14afb0){_0xfc68da=_0xfc68da-0x0;var _0x10919e=_0x69ed[_0xfc68da];return _0x10919e;};'use strict';var Sequelize=require(_0xd69e('0x0'));module['exports']={'name':{'type':Sequelize[_0xd69e('0x1')],'unique':_0xd69e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd69e('0x3')](_0xd69e('0x4')),'allowNull':![],'defaultValue':_0xd69e('0x4')},'description':{'type':Sequelize[_0xd69e('0x1')]},'active':{'type':Sequelize[_0xd69e('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xd69e('0x6')](0x4)[_0xd69e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd69e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd69e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd69e('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd69e('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd69e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd69e('0x6')](0x3)[_0xd69e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd69e('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd69e('0x6')](0x5)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xd69e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd69e('0x6')](0x5)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd69e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd69e('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd69e('0xc')},'dialTimezone':{'type':Sequelize[_0xd69e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd69e('0x1')],'defaultValue':_0xd69e('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xd69e('0x3')]('always','never',_0xd69e('0xe')),'defaultValue':_0xd69e('0xf')},'dialAMDActive':{'type':Sequelize[_0xd69e('0x5')],'defaultValue':0x0,'comment':_0xd69e('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0xd69e('0x6')](0x9)[_0xd69e('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd69e('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xd69e('0x6')](0x9)[_0xd69e('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd69e('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd69e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd69e('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd69e('0x6')](0x9)[_0xd69e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd69e('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd69e('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd69e('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd69e('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd69e('0x6')](0x9)[_0xd69e('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd69e('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd69e('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd69e('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd69e('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd69e('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd69e('0x3')]('DESC',_0xd69e('0x19')),'defaultValue':_0xd69e('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd69e('0x6')](0x3)[_0xd69e('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd69e('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd69e('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd69e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd69e('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd69e('0x6')](0x5)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd69e('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xd69e('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd69e('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xd69e('0x6')](0x5)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd69e('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd69e('0x6')](0x3)[_0xd69e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd69e('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd69e('0x6')](0x5)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd69e('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd69e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd69e('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd69e('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd69e('0x6')](0x3)[_0xd69e('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd69e('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd69e('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd69e('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 4ddcb25..284d1e5 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 _0x8307=['getHopperHistories','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','select','field','scheduledAt','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','from','onlyIfOpen','fromQuery','NOW()','cm_contacts','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','rows'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8307,0xc4));var _0x7830=function(_0x2969f0,_0x11b411){_0x2969f0=_0x2969f0-0x0;var _0x2ca8c0=_0x8307[_0x2969f0];return _0x2ca8c0;};'use strict';var emlformat=require(_0x7830('0x0'));var rimraf=require(_0x7830('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7830('0x2'));var rp=require(_0x7830('0x3'));var moment=require(_0x7830('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7830('0x5'));var util=require(_0x7830('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7830('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7830('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7830('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7830('0xa'));var toCsv=require(_0x7830('0x7'));var querystring=require('querystring');var Papa=require(_0x7830('0xb'));var Redis=require(_0x7830('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7830('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7830('0xe'))(_0x7830('0xf'));var utils=require(_0x7830('0x10'));var config=require(_0x7830('0x11'));var licenseUtil=require(_0x7830('0x12'));var db=require(_0x7830('0x13'))['db'];function respondWithStatusCode(_0x36e303,_0x39450e){_0x39450e=_0x39450e||0xcc;return function(_0x4fdb60){if(_0x4fdb60){return _0x36e303[_0x7830('0x14')](_0x39450e);}return _0x36e303[_0x7830('0x15')](_0x39450e)[_0x7830('0x16')]();};}function respondWithResult(_0x5db865,_0x4dd3e0){_0x4dd3e0=_0x4dd3e0||0xc8;return function(_0x5818f6){if(_0x5818f6){return _0x5db865[_0x7830('0x15')](_0x4dd3e0)['json'](_0x5818f6);}};}function respondWithFilteredResult(_0x27d88a,_0x16b7e7){return function(_0x29a4bd){if(_0x29a4bd){var _0x38906b=typeof _0x16b7e7[_0x7830('0x17')]===_0x7830('0x18')&&typeof _0x16b7e7[_0x7830('0x19')]===_0x7830('0x18');var _0x355c4e=_0x29a4bd[_0x7830('0x1a')];var _0x3bc49a=_0x38906b?0x0:_0x16b7e7[_0x7830('0x17')];var _0xf5cda=_0x38906b?_0x29a4bd[_0x7830('0x1a')]:_0x16b7e7[_0x7830('0x17')]+_0x16b7e7['limit'];var _0x40674b;if(_0xf5cda>=_0x355c4e){_0xf5cda=_0x355c4e;_0x40674b=0xc8;}else{_0x40674b=0xce;}_0x27d88a[_0x7830('0x15')](_0x40674b);return _0x27d88a[_0x7830('0x1b')](_0x7830('0x1c'),_0x3bc49a+'-'+_0xf5cda+'/'+_0x355c4e)[_0x7830('0x1d')](_0x29a4bd);}return null;};}function patchUpdates(_0x3966bd){return function(_0x1eaf27){try{jsonpatch[_0x7830('0x1e')](_0x1eaf27,_0x3966bd,!![]);}catch(_0x492be9){return BPromise[_0x7830('0x1f')](_0x492be9);}return _0x1eaf27[_0x7830('0x20')]();};}function saveUpdates(_0x8d90af,_0x152213){return function(_0x3ab7d6){if(_0x3ab7d6){return _0x3ab7d6['update'](_0x8d90af)[_0x7830('0x21')](function(_0x168546){return _0x168546;});}return null;};}function removeEntity(_0x3da993,_0x56efc3){return function(_0x2f69d3){if(_0x2f69d3){return _0x2f69d3['destroy']()['then'](function(){var _0x11668a=_0x2f69d3[_0x7830('0x22')]({'plain':!![]});var _0x449d4b=_0x7830('0x23');return db[_0x7830('0x24')][_0x7830('0x25')]({'where':{'type':_0x449d4b,'resourceId':_0x11668a['id']}})[_0x7830('0x21')](function(){return _0x2f69d3;});})[_0x7830('0x21')](function(){_0x3da993[_0x7830('0x15')](0xcc)[_0x7830('0x16')]();});}};}function handleEntityNotFound(_0xc6ca8e,_0x17b1c6){return function(_0x5cbfc2){if(!_0x5cbfc2){_0xc6ca8e[_0x7830('0x14')](0x194);}return _0x5cbfc2;};}function handleError(_0x214f4b,_0x555eab){_0x555eab=_0x555eab||0x1f4;return function(_0x2a6018){logger[_0x7830('0x26')](_0x2a6018['stack']);if(_0x2a6018[_0x7830('0x27')]){delete _0x2a6018[_0x7830('0x27')];}_0x214f4b['status'](_0x555eab)[_0x7830('0x28')](_0x2a6018);};}exports[_0x7830('0x29')]=function(_0x14a345,_0x12debf){var _0x461fe={},_0x172bb7={},_0x4f798d={'count':0x0,'rows':[]};var _0x116fdd=_[_0x7830('0x2a')](db[_0x7830('0x2b')][_0x7830('0x2c')],function(_0x10baa5){return{'name':_0x10baa5[_0x7830('0x2d')],'type':_0x10baa5[_0x7830('0x2e')][_0x7830('0x2f')]};});_0x172bb7[_0x7830('0x30')]=_[_0x7830('0x2a')](_0x116fdd,_0x7830('0x27'));_0x172bb7[_0x7830('0x31')]=_[_0x7830('0x32')](_0x14a345[_0x7830('0x31')]);_0x172bb7[_0x7830('0x33')]=_['intersection'](_0x172bb7[_0x7830('0x30')],_0x172bb7[_0x7830('0x31')]);_0x461fe['attributes']=_[_0x7830('0x34')](_0x172bb7['model'],qs['fields'](_0x14a345[_0x7830('0x31')][_0x7830('0x35')]));_0x461fe[_0x7830('0x36')]=_0x461fe[_0x7830('0x36')][_0x7830('0x37')]?_0x461fe[_0x7830('0x36')]:_0x172bb7[_0x7830('0x30')];if(!_0x14a345['query'][_0x7830('0x38')](_0x7830('0x39'))){_0x461fe[_0x7830('0x19')]=qs[_0x7830('0x19')](_0x14a345[_0x7830('0x31')][_0x7830('0x19')]);_0x461fe['offset']=qs['offset'](_0x14a345[_0x7830('0x31')][_0x7830('0x17')]);}_0x461fe[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x14a345[_0x7830('0x31')][_0x7830('0x3b')]);_0x461fe[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x14a345[_0x7830('0x31')],_0x172bb7[_0x7830('0x33')]),_0x116fdd);if(_0x14a345[_0x7830('0x31')][_0x7830('0x3e')]){_0x461fe[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x461fe[_0x7830('0x3c')],{'$or':_['map'](_0x116fdd,function(_0x4cf61c){if(_0x4cf61c[_0x7830('0x2e')]!==_0x7830('0x40')){var _0x5487cf={};_0x5487cf[_0x4cf61c[_0x7830('0x27')]]={'$like':'%'+_0x14a345[_0x7830('0x31')]['filter']+'%'};return _0x5487cf;}})});}_0x461fe=_[_0x7830('0x3f')]({},_0x461fe,_0x14a345['options']);var _0x50579b={'where':_0x461fe[_0x7830('0x3c')]};return db['Campaign']['count'](_0x50579b)[_0x7830('0x21')](function(_0x623843){_0x4f798d[_0x7830('0x1a')]=_0x623843;if(_0x14a345['query'][_0x7830('0x41')]){_0x461fe[_0x7830('0x42')]=[{'all':!![]}];}return db['Campaign'][_0x7830('0x43')](_0x461fe);})[_0x7830('0x21')](function(_0xfb5857){_0x4f798d['rows']=_0xfb5857;return _0x4f798d;})[_0x7830('0x21')](respondWithFilteredResult(_0x12debf,_0x461fe))[_0x7830('0x44')](handleError(_0x12debf,null));};exports[_0x7830('0x45')]=function(_0x25b00d,_0x3bfaab){var _0x525fcc={'raw':![],'where':{'id':_0x25b00d[_0x7830('0x46')]['id']}},_0x3f2a4a={};_0x3f2a4a[_0x7830('0x30')]=_[_0x7830('0x32')](db['Campaign']['rawAttributes']);_0x3f2a4a[_0x7830('0x31')]=_[_0x7830('0x32')](_0x25b00d[_0x7830('0x31')]);_0x3f2a4a[_0x7830('0x33')]=_[_0x7830('0x34')](_0x3f2a4a[_0x7830('0x30')],_0x3f2a4a[_0x7830('0x31')]);_0x525fcc['attributes']=_[_0x7830('0x34')](_0x3f2a4a[_0x7830('0x30')],qs[_0x7830('0x35')](_0x25b00d[_0x7830('0x31')][_0x7830('0x35')]));_0x525fcc[_0x7830('0x36')]=_0x525fcc[_0x7830('0x36')]['length']?_0x525fcc[_0x7830('0x36')]:_0x3f2a4a[_0x7830('0x30')];if(_0x25b00d[_0x7830('0x31')][_0x7830('0x41')]){_0x525fcc[_0x7830('0x42')]=[{'all':!![]}];}_0x525fcc=_[_0x7830('0x3f')]({},_0x525fcc,_0x25b00d[_0x7830('0x47')]);return db['Campaign'][_0x7830('0x48')](_0x525fcc)[_0x7830('0x21')](handleEntityNotFound(_0x3bfaab,null))['then'](respondWithResult(_0x3bfaab,null))[_0x7830('0x44')](handleError(_0x3bfaab,null));};exports[_0x7830('0x49')]=function(_0x28c373,_0x1e74e0){return db[_0x7830('0x2b')][_0x7830('0x49')](_0x28c373[_0x7830('0x4a')],{})[_0x7830('0x21')](function(_0x3b03bb){var _0x357300=_0x28c373[_0x7830('0x4b')]['get']({'plain':!![]});if(!_0x357300)throw new Error(_0x7830('0x4c'));if(_0x357300[_0x7830('0x4d')]===_0x7830('0x4b')){var _0x3d789b=_0x3b03bb['get']({'plain':!![]});var _0x42ebde=_0x7830('0x23');return db[_0x7830('0x4e')][_0x7830('0x48')]({'where':{'name':_0x42ebde,'userProfileId':_0x357300[_0x7830('0x4f')]},'raw':!![]})[_0x7830('0x21')](function(_0x32e7bf){if(_0x32e7bf&&_0x32e7bf[_0x7830('0x50')]===0x0){return db['UserProfileResource'][_0x7830('0x49')]({'name':_0x3d789b[_0x7830('0x27')],'resourceId':_0x3d789b['id'],'type':_0x32e7bf[_0x7830('0x27')],'sectionId':_0x32e7bf['id']},{})[_0x7830('0x21')](function(){return _0x3b03bb;});}else{return _0x3b03bb;}})[_0x7830('0x44')](function(_0x341ca9){logger[_0x7830('0x26')](_0x7830('0x51'),_0x341ca9);throw _0x341ca9;});}return _0x3b03bb;})[_0x7830('0x21')](respondWithResult(_0x1e74e0,0xc9))[_0x7830('0x44')](handleError(_0x1e74e0,null));};exports[_0x7830('0x52')]=function(_0xc09d5a,_0x35f188){var _0x7985bb={'where':{'id':_0xc09d5a[_0x7830('0x46')]['id']}},_0x5a7b5c={};_0x5a7b5c[_0x7830('0x30')]=_['keys'](db[_0x7830('0x2b')]['rawAttributes']);_0x7985bb[_0x7830('0x36')]=_[_0x7830('0x34')](_0x5a7b5c['model'],qs[_0x7830('0x35')](_0xc09d5a['query']['fields']));_0x7985bb[_0x7830('0x36')]=_0x7985bb[_0x7830('0x36')][_0x7830('0x37')]?_0x7985bb[_0x7830('0x36')]:_0x5a7b5c[_0x7830('0x30')];if(_0xc09d5a[_0x7830('0x31')][_0x7830('0x41')]){_0x7985bb['include']=[{'all':!![]}];}_0x7985bb=_[_0x7830('0x3f')]({},_0x7985bb,_0xc09d5a[_0x7830('0x47')]);return db[_0x7830('0x2b')][_0x7830('0x48')](_0x7985bb)[_0x7830('0x21')](handleEntityNotFound(_0x35f188,null))[_0x7830('0x21')](function(_0x3e6d34){if(_0x3e6d34){var _0x139608=_0x3e6d34[_0x7830('0x22')]({'plain':!![]});_0x139608=qs[_0x7830('0x53')](_0x139608,['id',_0x7830('0x54'),_0x7830('0x55')]);_0xc09d5a[_0x7830('0x4a')]=_[_0x7830('0x53')](_0xc09d5a['body'],['id',_0x7830('0x54'),_0x7830('0x55')]);return db['Campaign'][_0x7830('0x49')](_['merge'](_0x139608,_0xc09d5a[_0x7830('0x4a')]),{'include':_0xc09d5a[_0x7830('0x31')][_0x7830('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x315df4){var _0x598f98=_0xc09d5a[_0x7830('0x4b')][_0x7830('0x22')]({'plain':!![]});if(!_0x598f98)throw new Error(_0x7830('0x4c'));if(_0x598f98[_0x7830('0x4d')]===_0x7830('0x4b')){var _0x4edc54=_0x315df4[_0x7830('0x22')]({'plain':!![]});var _0xced78a=_0x7830('0x23');return db[_0x7830('0x4e')][_0x7830('0x48')]({'where':{'name':_0xced78a,'userProfileId':_0x598f98[_0x7830('0x4f')]},'raw':!![]})['then'](function(_0x2f683e){if(_0x2f683e&&_0x2f683e['autoAssociation']===0x0){return db[_0x7830('0x24')][_0x7830('0x49')]({'name':_0x4edc54['name'],'resourceId':_0x4edc54['id'],'type':_0x2f683e[_0x7830('0x27')],'sectionId':_0x2f683e['id']},{})['then'](function(){return _0x315df4;});}else{return _0x315df4;}})[_0x7830('0x44')](function(_0x184883){logger[_0x7830('0x26')](_0x7830('0x51'),_0x184883);throw _0x184883;});}return _0x315df4;});}})[_0x7830('0x21')](respondWithResult(_0x35f188,0xc9))[_0x7830('0x44')](handleError(_0x35f188,null));};exports['update']=function(_0x407be0,_0x189009){if(_0x407be0[_0x7830('0x4a')]['id']){delete _0x407be0['body']['id'];}return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x407be0[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x189009,null))[_0x7830('0x21')](saveUpdates(_0x407be0[_0x7830('0x4a')],null))[_0x7830('0x21')](respondWithResult(_0x189009,null))[_0x7830('0x44')](handleError(_0x189009,null));};exports[_0x7830('0x25')]=function(_0xda6837,_0x4b1162){return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0xda6837[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x4b1162,null))['then'](removeEntity(_0x4b1162,null))[_0x7830('0x44')](handleError(_0x4b1162,null));};exports[_0x7830('0x56')]=function(_0x384da4,_0x590f92,_0x3c05ab){var _0xda1b4f={'raw':!![],'where':{}};var _0xde637c={};var _0x3a0b0b={'count':0x0,'rows':[]};return db['Campaign'][_0x7830('0x57')]({'where':{'id':_0x384da4[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x590f92,null))[_0x7830('0x21')](function(_0x8ed649){if(_0x8ed649){_0xde637c[_0x7830('0x30')]=_['keys'](db[_0x7830('0x58')][_0x7830('0x2c')]);_0xde637c[_0x7830('0x31')]=_[_0x7830('0x32')](_0x384da4[_0x7830('0x31')]);_0xde637c['filters']=_['intersection'](_0xde637c[_0x7830('0x30')],_0xde637c[_0x7830('0x31')]);_0xda1b4f[_0x7830('0x36')]=_['intersection'](_0xde637c[_0x7830('0x30')],qs['fields'](_0x384da4[_0x7830('0x31')][_0x7830('0x35')]));_0xda1b4f[_0x7830('0x36')]=_0xda1b4f[_0x7830('0x36')]['length']?_0xda1b4f[_0x7830('0x36')]:_0xde637c['model'];if(!_0x384da4[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0xda1b4f['limit']=qs[_0x7830('0x19')](_0x384da4[_0x7830('0x31')]['limit']);_0xda1b4f[_0x7830('0x17')]=qs['offset'](_0x384da4[_0x7830('0x31')][_0x7830('0x17')]);}_0xda1b4f[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x384da4[_0x7830('0x31')][_0x7830('0x3b')]);_0xda1b4f[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x384da4['query'],_0xde637c[_0x7830('0x33')]));_0xda1b4f[_0x7830('0x3c')]['CampaignId']=_0x8ed649['id'];if(_0x384da4['query']['filter']){_0xda1b4f[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0xda1b4f[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0xda1b4f[_0x7830('0x36')],function(_0x262c2c){var _0xf39aed={};_0xf39aed[_0x262c2c]={'$like':'%'+_0x384da4['query'][_0x7830('0x3e')]+'%'};return _0xf39aed;})});}_0xda1b4f=_['merge']({},_0xda1b4f,_0x384da4[_0x7830('0x47')]);return db['CmHopper'][_0x7830('0x1a')]({'where':_0xda1b4f[_0x7830('0x3c')]})[_0x7830('0x21')](function(_0x4787){_0x3a0b0b['count']=_0x4787;if(_0x384da4[_0x7830('0x31')][_0x7830('0x41')]){_0xda1b4f[_0x7830('0x42')]=[{'all':!![]}];}return db[_0x7830('0x58')][_0x7830('0x43')](_0xda1b4f);})['then'](function(_0x4d3b6f){_0x3a0b0b[_0x7830('0x59')]=_0x4d3b6f;return _0x3a0b0b;});}})['then'](respondWithFilteredResult(_0x590f92,_0xda1b4f))['catch'](handleError(_0x590f92,null));};exports[_0x7830('0x5a')]=function(_0x5a7400,_0x21e6be,_0x41843e){var _0x59ead9={'raw':!![],'where':{}};var _0x2f2289={};var _0x4b0559={'count':0x0,'rows':[]};return db[_0x7830('0x2b')]['findOne']({'where':{'id':_0x5a7400[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x21e6be,null))[_0x7830('0x21')](function(_0x4c8fea){if(_0x4c8fea){_0x2f2289[_0x7830('0x30')]=_[_0x7830('0x32')](db['CmHopperHistory'][_0x7830('0x2c')]);_0x2f2289['query']=_[_0x7830('0x32')](_0x5a7400[_0x7830('0x31')]);_0x2f2289[_0x7830('0x33')]=_['intersection'](_0x2f2289[_0x7830('0x30')],_0x2f2289[_0x7830('0x31')]);_0x59ead9[_0x7830('0x36')]=_[_0x7830('0x34')](_0x2f2289['model'],qs['fields'](_0x5a7400[_0x7830('0x31')][_0x7830('0x35')]));_0x59ead9[_0x7830('0x36')]=_0x59ead9['attributes'][_0x7830('0x37')]?_0x59ead9[_0x7830('0x36')]:_0x2f2289[_0x7830('0x30')];if(!_0x5a7400['query']['hasOwnProperty'](_0x7830('0x39'))){_0x59ead9[_0x7830('0x19')]=qs['limit'](_0x5a7400[_0x7830('0x31')]['limit']);_0x59ead9['offset']=qs[_0x7830('0x17')](_0x5a7400['query'][_0x7830('0x17')]);}_0x59ead9['order']=qs['sort'](_0x5a7400[_0x7830('0x31')][_0x7830('0x3b')]);_0x59ead9['where']=qs['filters'](_['pick'](_0x5a7400['query'],_0x2f2289[_0x7830('0x33')]));_0x59ead9[_0x7830('0x3c')][_0x7830('0x5b')]=_0x4c8fea['id'];if(_0x5a7400[_0x7830('0x31')]['filter']){_0x59ead9[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x59ead9[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x59ead9[_0x7830('0x36')],function(_0x3fedc0){var _0xecdac8={};_0xecdac8[_0x3fedc0]={'$like':'%'+_0x5a7400[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0xecdac8;})});}_0x59ead9=_['merge']({},_0x59ead9,_0x5a7400[_0x7830('0x47')]);return db[_0x7830('0x5c')][_0x7830('0x1a')]({'where':_0x59ead9[_0x7830('0x3c')]})[_0x7830('0x21')](function(_0x3ecf35){_0x4b0559[_0x7830('0x1a')]=_0x3ecf35;if(_0x5a7400[_0x7830('0x31')][_0x7830('0x41')]){_0x59ead9['include']=[{'all':!![]}];}return db[_0x7830('0x5c')][_0x7830('0x43')](_0x59ead9);})[_0x7830('0x21')](function(_0x2ec5d7){_0x4b0559[_0x7830('0x59')]=_0x2ec5d7;return _0x4b0559;});}})['then'](respondWithFilteredResult(_0x21e6be,_0x59ead9))[_0x7830('0x44')](handleError(_0x21e6be,null));};exports['getHopperFinals']=function(_0x2751ee,_0x31a950,_0x59008f){var _0x225aa3={'raw':!![],'where':{}};var _0xadfa94={};var _0x367f64={'count':0x0,'rows':[]};return db[_0x7830('0x2b')][_0x7830('0x57')]({'where':{'id':_0x2751ee[_0x7830('0x46')]['id']}})['then'](handleEntityNotFound(_0x31a950,null))[_0x7830('0x21')](function(_0x13c2fd){if(_0x13c2fd){_0xadfa94[_0x7830('0x30')]=_[_0x7830('0x32')](db[_0x7830('0x5d')]['rawAttributes']);_0xadfa94[_0x7830('0x31')]=_['keys'](_0x2751ee[_0x7830('0x31')]);_0xadfa94[_0x7830('0x33')]=_['intersection'](_0xadfa94['model'],_0xadfa94[_0x7830('0x31')]);_0x225aa3[_0x7830('0x36')]=_[_0x7830('0x34')](_0xadfa94[_0x7830('0x30')],qs[_0x7830('0x35')](_0x2751ee[_0x7830('0x31')][_0x7830('0x35')]));_0x225aa3[_0x7830('0x36')]=_0x225aa3[_0x7830('0x36')][_0x7830('0x37')]?_0x225aa3[_0x7830('0x36')]:_0xadfa94[_0x7830('0x30')];if(!_0x2751ee[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0x225aa3['limit']=qs[_0x7830('0x19')](_0x2751ee[_0x7830('0x31')][_0x7830('0x19')]);_0x225aa3[_0x7830('0x17')]=qs[_0x7830('0x17')](_0x2751ee[_0x7830('0x31')][_0x7830('0x17')]);}_0x225aa3[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x2751ee['query'][_0x7830('0x3b')]);_0x225aa3['where']=qs[_0x7830('0x33')](_['pick'](_0x2751ee[_0x7830('0x31')],_0xadfa94['filters']));_0x225aa3[_0x7830('0x3c')][_0x7830('0x5b')]=_0x13c2fd['id'];if(_0x2751ee[_0x7830('0x31')]['filter']){_0x225aa3[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x225aa3[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x225aa3[_0x7830('0x36')],function(_0xf28c68){var _0x27815d={};_0x27815d[_0xf28c68]={'$like':'%'+_0x2751ee[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x27815d;})});}_0x225aa3=_[_0x7830('0x3f')]({},_0x225aa3,_0x2751ee[_0x7830('0x47')]);return db[_0x7830('0x5d')][_0x7830('0x1a')]({'where':_0x225aa3[_0x7830('0x3c')]})[_0x7830('0x21')](function(_0x1c568a){_0x367f64[_0x7830('0x1a')]=_0x1c568a;if(_0x2751ee[_0x7830('0x31')]['includeAll']){_0x225aa3[_0x7830('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x225aa3);})[_0x7830('0x21')](function(_0x325b60){_0x367f64[_0x7830('0x59')]=_0x325b60;return _0x367f64;});}})['then'](respondWithFilteredResult(_0x31a950,_0x225aa3))[_0x7830('0x44')](handleError(_0x31a950,null));};exports[_0x7830('0x5e')]=function(_0x424175,_0x1a019d,_0x53b465){var _0x266888={'raw':!![],'where':{}};var _0x54bf0c={};var _0x386c1f={'count':0x0,'rows':[]};return db[_0x7830('0x2b')][_0x7830('0x57')]({'where':{'id':_0x424175[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x1a019d,null))[_0x7830('0x21')](function(_0xb1473b){if(_0xb1473b){_0x54bf0c[_0x7830('0x30')]=_[_0x7830('0x32')](db[_0x7830('0x5f')][_0x7830('0x2c')]);_0x54bf0c[_0x7830('0x31')]=_['keys'](_0x424175[_0x7830('0x31')]);_0x54bf0c[_0x7830('0x33')]=_[_0x7830('0x34')](_0x54bf0c[_0x7830('0x30')],_0x54bf0c[_0x7830('0x31')]);_0x266888[_0x7830('0x36')]=_['intersection'](_0x54bf0c[_0x7830('0x30')],qs[_0x7830('0x35')](_0x424175[_0x7830('0x31')][_0x7830('0x35')]));_0x266888['attributes']=_0x266888[_0x7830('0x36')][_0x7830('0x37')]?_0x266888[_0x7830('0x36')]:_0x54bf0c[_0x7830('0x30')];if(!_0x424175[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0x266888[_0x7830('0x19')]=qs[_0x7830('0x19')](_0x424175[_0x7830('0x31')][_0x7830('0x19')]);_0x266888[_0x7830('0x17')]=qs['offset'](_0x424175[_0x7830('0x31')][_0x7830('0x17')]);}_0x266888[_0x7830('0x3a')]=qs[_0x7830('0x3b')](_0x424175[_0x7830('0x31')][_0x7830('0x3b')]);_0x266888[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x424175[_0x7830('0x31')],_0x54bf0c[_0x7830('0x33')]));_0x266888[_0x7830('0x3c')]['CampaignId']=_0xb1473b['id'];if(_0x424175[_0x7830('0x31')][_0x7830('0x3e')]){_0x266888[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x266888[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x266888[_0x7830('0x36')],function(_0x2e731b){var _0x45bdb0={};_0x45bdb0[_0x2e731b]={'$like':'%'+_0x424175[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x45bdb0;})});}_0x266888=_['merge']({},_0x266888,_0x424175[_0x7830('0x47')]);return db['CmHopperBlack']['count']({'where':_0x266888['where']})[_0x7830('0x21')](function(_0x5a6d81){_0x386c1f[_0x7830('0x1a')]=_0x5a6d81;if(_0x424175[_0x7830('0x31')][_0x7830('0x41')]){_0x266888['include']=[{'all':!![]}];}return db[_0x7830('0x5f')]['findAll'](_0x266888);})[_0x7830('0x21')](function(_0x59f8dd){_0x386c1f[_0x7830('0x59')]=_0x59f8dd;return _0x386c1f;});}})['then'](respondWithFilteredResult(_0x1a019d,_0x266888))['catch'](handleError(_0x1a019d,null));};exports['getLists']=function(_0x424bab,_0x51b20e,_0x366e0f){var _0x244a2d={};var _0x334a9e={};var _0x2b8074;var _0x51682a;return db['Campaign']['findOne']({'where':{'id':_0x424bab['params']['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x51b20e,null))[_0x7830('0x21')](function(_0x40332d){if(_0x40332d){_0x2b8074=_0x40332d;_0x334a9e[_0x7830('0x30')]=_[_0x7830('0x32')](db[_0x7830('0x60')][_0x7830('0x2c')]);_0x334a9e[_0x7830('0x31')]=_[_0x7830('0x32')](_0x424bab['query']);_0x334a9e[_0x7830('0x33')]=_[_0x7830('0x34')](_0x334a9e[_0x7830('0x30')],_0x334a9e[_0x7830('0x31')]);_0x244a2d['attributes']=_[_0x7830('0x34')](_0x334a9e[_0x7830('0x30')],qs[_0x7830('0x35')](_0x424bab[_0x7830('0x31')][_0x7830('0x35')]));_0x244a2d[_0x7830('0x36')]=_0x244a2d[_0x7830('0x36')][_0x7830('0x37')]?_0x244a2d[_0x7830('0x36')]:_0x334a9e[_0x7830('0x30')];_0x244a2d[_0x7830('0x3a')]=qs['sort'](_0x424bab[_0x7830('0x31')]['sort']);_0x244a2d[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x424bab[_0x7830('0x31')],_0x334a9e[_0x7830('0x33')]));if(_0x424bab[_0x7830('0x31')][_0x7830('0x3e')]){_0x244a2d['where']=_[_0x7830('0x3f')](_0x244a2d[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x244a2d['attributes'],function(_0x59ccff){var _0x13f0b2={};_0x13f0b2[_0x59ccff]={'$like':'%'+_0x424bab[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x13f0b2;})});}_0x244a2d=_[_0x7830('0x3f')]({},_0x244a2d,_0x424bab[_0x7830('0x47')]);return _0x2b8074[_0x7830('0x61')](_0x244a2d);}})['then'](function(_0x4e40a3){if(_0x4e40a3){_0x51682a=_0x4e40a3[_0x7830('0x37')];if(!_0x424bab[_0x7830('0x31')]['hasOwnProperty'](_0x7830('0x39'))){_0x244a2d['limit']=qs[_0x7830('0x19')](_0x424bab[_0x7830('0x31')][_0x7830('0x19')]);_0x244a2d[_0x7830('0x17')]=qs[_0x7830('0x17')](_0x424bab['query']['offset']);}return _0x2b8074[_0x7830('0x61')](_0x244a2d);}})[_0x7830('0x21')](function(_0x2235c7){if(_0x2235c7){return _0x2235c7?{'count':_0x51682a,'rows':_0x2235c7}:null;}})[_0x7830('0x21')](respondWithResult(_0x51b20e,null))['catch'](handleError(_0x51b20e,null));};exports[_0x7830('0x62')]=function(_0x1ac28f,_0x3a4614,_0x2477d4){var _0x242559,_0x5237df;var _0x25383b=[];var _0x192d31=moment()['format'](_0x7830('0x63'));return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x1ac28f[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x3a4614,null))[_0x7830('0x21')](function(_0x13e144){if(_0x13e144){_0x5237df=_0x13e144;return _0x13e144[_0x7830('0x62')](_0x1ac28f[_0x7830('0x4a')][_0x7830('0x64')],_['omit'](_0x1ac28f[_0x7830('0x4a')],[_0x7830('0x64'),'id'])||{});}return null;})['spread'](function(_0x765635){var _0xe9c1b5;var _0x4d404e;_0x242559=_0x765635||[];var _0x2d44a5=[];if(_0x765635){for(var _0x3ebfe6=0x0;_0x3ebfe6<_0x765635[_0x7830('0x37')];_0x3ebfe6+=0x1){var _0x5c67dd=_0x765635[_0x3ebfe6][_0x7830('0x22')]({'plain':!![]});_0x5237df[_0x7830('0x65')]=_0x1ac28f[_0x7830('0x4a')]['dialCheckDuplicateType']?_0x1ac28f['body'][_0x7830('0x65')]:_0x5237df[_0x7830('0x65')];switch(_0x5237df[_0x7830('0x65')]){case _0x7830('0x66'):_0xe9c1b5=squel[_0x7830('0x67')]()[_0x7830('0x68')](_0x7830('0x69'))['fromQuery']([_0x7830('0x6a'),'scheduledAt',_0x7830('0x6b'),_0x7830('0x6c'),_0x7830('0x5b'),_0x7830('0x54'),_0x7830('0x55')],squel[_0x7830('0x6d')]()[_0x7830('0x6e')](_0x7830('0x6a'),_0x7830('0x6a'))[_0x7830('0x6e')]('NOW()',_0x7830('0x6f'))[_0x7830('0x6e')]('id',_0x7830('0x6b'))[_0x7830('0x6e')](_0x5c67dd['CmListId'][_0x7830('0x70')](),_0x7830('0x6c'))['field'](_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')](),_0x7830('0x5b'))['field']('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x55'))['from']('cm_contacts')[_0x7830('0x3c')](_0x7830('0x71'))['where'](_0x7830('0x72'),_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')](_0x7830('0x74'))[_0x7830('0x3c')](_0x7830('0x75'),squel[_0x7830('0x6d')]()[_0x7830('0x6e')](_0x7830('0x76'))['from'](_0x7830('0x77'))[_0x7830('0x3c')](_0x7830('0x78'),_0x1ac28f['params']['id']['toString']()))[_0x7830('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7830('0x6d')]()[_0x7830('0x6e')]('COALESCE(phone,\x27\x27)')[_0x7830('0x79')](_0x7830('0x69'))[_0x7830('0x3c')](_0x7830('0x78'),_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')]())))[_0x7830('0x70')]();break;case _0x7830('0x7a'):_0xe9c1b5=squel['insert']()[_0x7830('0x68')](_0x7830('0x69'))[_0x7830('0x7b')](['phone',_0x7830('0x6f'),_0x7830('0x6b'),_0x7830('0x6c'),_0x7830('0x5b'),'createdAt',_0x7830('0x55')],squel[_0x7830('0x6d')]()['field'](_0x7830('0x6a'),_0x7830('0x6a'))[_0x7830('0x6e')](_0x7830('0x7c'),'scheduledAt')[_0x7830('0x6e')]('id',_0x7830('0x6b'))[_0x7830('0x6e')](_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')](),_0x7830('0x6c'))['field'](_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')](),_0x7830('0x5b'))['field']('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x55'))[_0x7830('0x79')](_0x7830('0x7d'))[_0x7830('0x3c')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')](_0x7830('0x74'))[_0x7830('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7830('0x6d')]()['field'](_0x7830('0x7e'))[_0x7830('0x79')](_0x7830('0x69'))[_0x7830('0x3c')]('CampaignId\x20=\x20?',_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')]())))[_0x7830('0x70')]();break;default:_0xe9c1b5=squel[_0x7830('0x67')]()[_0x7830('0x68')](_0x7830('0x69'))['fromQuery'](['phone','scheduledAt','ContactId',_0x7830('0x6c'),_0x7830('0x5b'),_0x7830('0x54'),_0x7830('0x55')],squel[_0x7830('0x6d')]()['field'](_0x7830('0x6a'),_0x7830('0x6a'))[_0x7830('0x6e')](_0x7830('0x7c'),_0x7830('0x6f'))['field']('id',_0x7830('0x6b'))['field'](_0x5c67dd[_0x7830('0x73')]['toString'](),'ListId')[_0x7830('0x6e')](_0x1ac28f['params']['id'][_0x7830('0x70')](),_0x7830('0x5b'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27','updatedAt')[_0x7830('0x79')](_0x7830('0x7d'))[_0x7830('0x3c')](_0x7830('0x71'))[_0x7830('0x3c')]('ListId\x20=\x20?',_0x5c67dd[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0x7830('0x70')]();}_0x4d404e=squel[_0x7830('0x67')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x7830('0x7f'),_0x7830('0x6f'),'phone',_0x7830('0x80'),'createdAt',_0x7830('0x55')],squel[_0x7830('0x6d')]()[_0x7830('0x6e')](_0x7830('0x81'),'id')[_0x7830('0x6e')]('NOW()',_0x7830('0x6f'))['field'](_0x7830('0x82'),_0x7830('0x6a'))[_0x7830('0x6e')]('ci.OrderBY','OrderBy')[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x54'))[_0x7830('0x6e')]('\x27'+_0x192d31+'\x27',_0x7830('0x55'))['from'](_0x7830('0x83'),'ci')[_0x7830('0x84')](_0x7830('0x69'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x7830('0x85'),_0x5c67dd['CmListId'][_0x7830('0x70')]())['where']('h.CampaignId=?',_0x1ac28f[_0x7830('0x46')]['id'][_0x7830('0x70')]())['where'](_0x7830('0x86'),_0x192d31))[_0x7830('0x70')]();_0x2d44a5[_0x7830('0x87')](db[_0x7830('0x88')][_0x7830('0x31')](_0xe9c1b5));_0x25383b[_0x7830('0x87')](db['sequelize'][_0x7830('0x31')](_0x4d404e));}return BPromise[_0x7830('0x89')](_0x2d44a5);}})['then'](function(){return BPromise[_0x7830('0x89')](_0x25383b);})['then'](function(){return _0x242559;})[_0x7830('0x21')](respondWithResult(_0x3a4614,null))[_0x7830('0x44')](handleError(_0x3a4614,null));};exports[_0x7830('0x8a')]=function(_0x23d9b3,_0xdb7cd6,_0x29bdbc){return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x23d9b3['params']['id']}})[_0x7830('0x21')](handleEntityNotFound(_0xdb7cd6,null))[_0x7830('0x21')](function(_0x3204f0){if(_0x3204f0){return _0x3204f0[_0x7830('0x8a')](_0x23d9b3[_0x7830('0x31')][_0x7830('0x64')]);}})[_0x7830('0x21')](function(_0xe0245e){if(_0xe0245e){return db['CmHopper'][_0x7830('0x25')]({'where':{'ListId':_0x23d9b3[_0x7830('0x31')][_0x7830('0x64')],'CampaignId':_0x23d9b3[_0x7830('0x46')]['id']}})[_0x7830('0x21')](function(){return _0xe0245e;});}})['then'](respondWithStatusCode(_0xdb7cd6,null))[_0x7830('0x44')](handleError(_0xdb7cd6,null));};exports[_0x7830('0x8b')]=function(_0x24318a,_0x3f82b3,_0x302aa4){var _0x3915e0={};var _0x11ddcd={};var _0x187a73;var _0x200870;return db['Campaign'][_0x7830('0x57')]({'where':{'id':_0x24318a['params']['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x3f82b3,null))['then'](function(_0x1534da){if(_0x1534da){_0x187a73=_0x1534da;_0x11ddcd[_0x7830('0x30')]=_[_0x7830('0x32')](db['CmList'][_0x7830('0x2c')]);_0x11ddcd[_0x7830('0x31')]=_[_0x7830('0x32')](_0x24318a[_0x7830('0x31')]);_0x11ddcd[_0x7830('0x33')]=_[_0x7830('0x34')](_0x11ddcd['model'],_0x11ddcd[_0x7830('0x31')]);_0x3915e0['attributes']=_[_0x7830('0x34')](_0x11ddcd[_0x7830('0x30')],qs[_0x7830('0x35')](_0x24318a[_0x7830('0x31')][_0x7830('0x35')]));_0x3915e0[_0x7830('0x36')]=_0x3915e0[_0x7830('0x36')][_0x7830('0x37')]?_0x3915e0[_0x7830('0x36')]:_0x11ddcd[_0x7830('0x30')];_0x3915e0[_0x7830('0x3a')]=qs['sort'](_0x24318a['query']['sort']);_0x3915e0[_0x7830('0x3c')]=qs[_0x7830('0x33')](_[_0x7830('0x3d')](_0x24318a['query'],_0x11ddcd[_0x7830('0x33')]));if(_0x24318a['query']['filter']){_0x3915e0[_0x7830('0x3c')]=_[_0x7830('0x3f')](_0x3915e0[_0x7830('0x3c')],{'$or':_[_0x7830('0x2a')](_0x3915e0['attributes'],function(_0x49da77){var _0x41e095={};_0x41e095[_0x49da77]={'$like':'%'+_0x24318a[_0x7830('0x31')][_0x7830('0x3e')]+'%'};return _0x41e095;})});}_0x3915e0=_[_0x7830('0x3f')]({},_0x3915e0,_0x24318a['options']);return _0x187a73[_0x7830('0x8b')](_0x3915e0);}})[_0x7830('0x21')](function(_0xf1ec90){if(_0xf1ec90){_0x200870=_0xf1ec90[_0x7830('0x37')];if(!_0x24318a[_0x7830('0x31')][_0x7830('0x38')](_0x7830('0x39'))){_0x3915e0[_0x7830('0x19')]=qs[_0x7830('0x19')](_0x24318a[_0x7830('0x31')][_0x7830('0x19')]);_0x3915e0['offset']=qs[_0x7830('0x17')](_0x24318a[_0x7830('0x31')]['offset']);}return _0x187a73[_0x7830('0x8b')](_0x3915e0);}})[_0x7830('0x21')](function(_0xf9532f){if(_0xf9532f){return _0xf9532f?{'count':_0x200870,'rows':_0xf9532f}:null;}})[_0x7830('0x21')](respondWithResult(_0x3f82b3,null))[_0x7830('0x44')](handleError(_0x3f82b3,null));};exports[_0x7830('0x8c')]=function(_0x16329c,_0x38e751,_0x4713af){var _0x599903,_0x59f7d1;var _0x3514df=[];var _0x164ccd=moment()[_0x7830('0x8d')](_0x7830('0x63'));return db[_0x7830('0x2b')][_0x7830('0x48')]({'where':{'id':_0x16329c[_0x7830('0x46')]['id']}})['then'](handleEntityNotFound(_0x38e751,null))[_0x7830('0x21')](function(_0xce6fbb){if(_0xce6fbb){_0x59f7d1=_0xce6fbb;return _0xce6fbb[_0x7830('0x8c')](_0x16329c[_0x7830('0x4a')][_0x7830('0x64')],_[_0x7830('0x53')](_0x16329c[_0x7830('0x4a')],['ids','id'])||{});}return null;})['spread'](function(_0xf9e8b){var _0x382886;var _0x48a5cf;_0x599903=_0xf9e8b||[];var _0x429a54=[];if(_0xf9e8b){for(var _0x417741=0x0;_0x417741<_0xf9e8b[_0x7830('0x37')];_0x417741+=0x1){var _0xa11841=_0xf9e8b[_0x417741][_0x7830('0x22')]({'plain':!![]});_0x382886=squel[_0x7830('0x67')]()['into']('cm_hopper_black')[_0x7830('0x7b')]([_0x7830('0x6a'),_0x7830('0x6b'),_0x7830('0x6c'),_0x7830('0x5b'),_0x7830('0x54'),_0x7830('0x55')],squel[_0x7830('0x6d')]()['field']('phone',_0x7830('0x6a'))[_0x7830('0x6e')]('id',_0x7830('0x6b'))[_0x7830('0x6e')](_0xa11841[_0x7830('0x73')][_0x7830('0x70')](),_0x7830('0x6c'))['field'](_0x16329c['params']['id']['toString'](),_0x7830('0x5b'))[_0x7830('0x6e')]('NOW()',_0x7830('0x54'))[_0x7830('0x6e')](_0x7830('0x7c'),_0x7830('0x55'))[_0x7830('0x79')](_0x7830('0x7d'))[_0x7830('0x3c')](_0x7830('0x71'))[_0x7830('0x3c')]('ListId\x20=\x20?',_0xa11841[_0x7830('0x73')][_0x7830('0x70')]())[_0x7830('0x3c')](_0x7830('0x74')))[_0x7830('0x70')]();_0x429a54[_0x7830('0x87')](db[_0x7830('0x88')]['query'](_0x382886));}return BPromise[_0x7830('0x89')](_0x429a54);}})[_0x7830('0x21')](function(){return _0x599903;})[_0x7830('0x21')](respondWithResult(_0x38e751,null))[_0x7830('0x44')](handleError(_0x38e751,null));};exports[_0x7830('0x8e')]=function(_0x31cc6a,_0x4f81cb,_0x4aad4d){return db['Campaign'][_0x7830('0x48')]({'where':{'id':_0x31cc6a[_0x7830('0x46')]['id']}})[_0x7830('0x21')](handleEntityNotFound(_0x4f81cb,null))[_0x7830('0x21')](function(_0x27213d){if(_0x27213d){return _0x27213d['removeBlackLists'](_0x31cc6a[_0x7830('0x31')][_0x7830('0x64')]);}})[_0x7830('0x21')](function(_0x2c5ce6){if(_0x2c5ce6){return db['CmHopperBlack'][_0x7830('0x25')]({'where':{'ListId':_0x31cc6a[_0x7830('0x31')]['ids'],'CampaignId':_0x31cc6a[_0x7830('0x46')]['id']}})[_0x7830('0x21')](function(){return _0x2c5ce6;});}})[_0x7830('0x21')](respondWithStatusCode(_0x4f81cb,null))[_0x7830('0x44')](handleError(_0x4f81cb,null));};
\ No newline at end of file
+var _0x0647=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','field','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','insert','into','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','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','format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','then','IvrCampaigns','UserProfileResource','error','stack','name','send','index','type','key','map','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','Campaign','includeAll','include','findAll','rows','catch','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','clone','rawAttributes','length','find','omit','createdAt','updatedAt','body','role','userProfileId'];(function(_0x392890,_0xb8d3dd){var _0x2b2e30=function(_0x4b355f){while(--_0x4b355f){_0x392890['push'](_0x392890['shift']());}};_0x2b2e30(++_0xb8d3dd);}(_0x0647,0xd0));var _0x7064=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x0647[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require(_0x7064('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7064('0x1'));var jsonpatch=require(_0x7064('0x2'));var rp=require(_0x7064('0x3'));var moment=require(_0x7064('0x4'));var BPromise=require(_0x7064('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7064('0x6'));var sox=require(_0x7064('0x7'));var csv=require(_0x7064('0x8'));var ejs=require(_0x7064('0x9'));var fs=require('fs');var fs_extra=require(_0x7064('0xa'));var _=require(_0x7064('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7064('0xc'));var deskjs=require(_0x7064('0xd'));var toCsv=require(_0x7064('0x8'));var querystring=require('querystring');var Papa=require(_0x7064('0xe'));var Redis=require(_0x7064('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7064('0x10'));var as=require(_0x7064('0x11'));var hardwareService=require(_0x7064('0x12'));var logger=require('../../config/logger')(_0x7064('0x13'));var utils=require(_0x7064('0x14'));var config=require(_0x7064('0x15'));var licenseUtil=require(_0x7064('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x303dcd,_0x4151b6){_0x4151b6=_0x4151b6||0xcc;return function(_0x268a94){if(_0x268a94){return _0x303dcd[_0x7064('0x17')](_0x4151b6);}return _0x303dcd[_0x7064('0x18')](_0x4151b6)[_0x7064('0x19')]();};}function respondWithResult(_0x265aa6,_0x3badc8){_0x3badc8=_0x3badc8||0xc8;return function(_0x57e440){if(_0x57e440){return _0x265aa6['status'](_0x3badc8)['json'](_0x57e440);}};}function respondWithFilteredResult(_0x39f83b,_0x15a1c0){return function(_0x36378c){if(_0x36378c){var _0x4b39db=typeof _0x15a1c0[_0x7064('0x1a')]===_0x7064('0x1b')&&typeof _0x15a1c0['limit']===_0x7064('0x1b');var _0x38d20c=_0x36378c[_0x7064('0x1c')];var _0x203633=_0x4b39db?0x0:_0x15a1c0[_0x7064('0x1a')];var _0x17f306=_0x4b39db?_0x36378c[_0x7064('0x1c')]:_0x15a1c0[_0x7064('0x1a')]+_0x15a1c0[_0x7064('0x1d')];var _0x19b456;if(_0x17f306>=_0x38d20c){_0x17f306=_0x38d20c;_0x19b456=0xc8;}else{_0x19b456=0xce;}_0x39f83b[_0x7064('0x18')](_0x19b456);return _0x39f83b[_0x7064('0x1e')](_0x7064('0x1f'),_0x203633+'-'+_0x17f306+'/'+_0x38d20c)['json'](_0x36378c);}return null;};}function patchUpdates(_0x431fac){return function(_0x141983){try{jsonpatch[_0x7064('0x20')](_0x141983,_0x431fac,!![]);}catch(_0x2d49a9){return BPromise['reject'](_0x2d49a9);}return _0x141983[_0x7064('0x21')]();};}function saveUpdates(_0x51ae69,_0x446730){return function(_0x6eed9e){if(_0x6eed9e){return _0x6eed9e['update'](_0x51ae69)[_0x7064('0x22')](function(_0x14b006){return _0x14b006;});}return null;};}function removeEntity(_0x1a62a2,_0x464e8a){return function(_0x167149){if(_0x167149){return _0x167149['destroy']()['then'](function(){var _0x33f470=_0x167149['get']({'plain':!![]});var _0x2eec57=_0x7064('0x23');return db[_0x7064('0x24')]['destroy']({'where':{'type':_0x2eec57,'resourceId':_0x33f470['id']}})[_0x7064('0x22')](function(){return _0x167149;});})[_0x7064('0x22')](function(){_0x1a62a2[_0x7064('0x18')](0xcc)[_0x7064('0x19')]();});}};}function handleEntityNotFound(_0x358e67,_0x57039f){return function(_0x561186){if(!_0x561186){_0x358e67['sendStatus'](0x194);}return _0x561186;};}function handleError(_0x5e2a06,_0x2fc640){_0x2fc640=_0x2fc640||0x1f4;return function(_0x4aad53){logger[_0x7064('0x25')](_0x4aad53[_0x7064('0x26')]);if(_0x4aad53['name']){delete _0x4aad53[_0x7064('0x27')];}_0x5e2a06[_0x7064('0x18')](_0x2fc640)[_0x7064('0x28')](_0x4aad53);};}exports[_0x7064('0x29')]=function(_0x19749e,_0x5c1b1d){var _0x41db8a={},_0x230f24={},_0x2a95b2={'count':0x0,'rows':[]};var _0x16f422=_['map'](db['Campaign']['rawAttributes'],function(_0x21192d){return{'name':_0x21192d['fieldName'],'type':_0x21192d[_0x7064('0x2a')][_0x7064('0x2b')]};});_0x230f24['model']=_[_0x7064('0x2c')](_0x16f422,_0x7064('0x27'));_0x230f24[_0x7064('0x2d')]=_[_0x7064('0x2e')](_0x19749e['query']);_0x230f24['filters']=_[_0x7064('0x2f')](_0x230f24['model'],_0x230f24[_0x7064('0x2d')]);_0x41db8a[_0x7064('0x30')]=_[_0x7064('0x2f')](_0x230f24['model'],qs[_0x7064('0x31')](_0x19749e[_0x7064('0x2d')][_0x7064('0x31')]));_0x41db8a[_0x7064('0x30')]=_0x41db8a['attributes']['length']?_0x41db8a[_0x7064('0x30')]:_0x230f24[_0x7064('0x32')];if(!_0x19749e['query'][_0x7064('0x33')](_0x7064('0x34'))){_0x41db8a[_0x7064('0x1d')]=qs[_0x7064('0x1d')](_0x19749e[_0x7064('0x2d')][_0x7064('0x1d')]);_0x41db8a[_0x7064('0x1a')]=qs[_0x7064('0x1a')](_0x19749e[_0x7064('0x2d')][_0x7064('0x1a')]);}_0x41db8a[_0x7064('0x35')]=qs['sort'](_0x19749e[_0x7064('0x2d')][_0x7064('0x36')]);_0x41db8a[_0x7064('0x37')]=qs[_0x7064('0x38')](_[_0x7064('0x39')](_0x19749e['query'],_0x230f24[_0x7064('0x38')]),_0x16f422);if(_0x19749e[_0x7064('0x2d')][_0x7064('0x3a')]){_0x41db8a[_0x7064('0x37')]=_[_0x7064('0x3b')](_0x41db8a[_0x7064('0x37')],{'$or':_['map'](_0x16f422,function(_0x1c301e){if(_0x1c301e[_0x7064('0x2a')]!=='VIRTUAL'){var _0x995bec={};_0x995bec[_0x1c301e[_0x7064('0x27')]]={'$like':'%'+_0x19749e[_0x7064('0x2d')][_0x7064('0x3a')]+'%'};return _0x995bec;}})});}_0x41db8a=_[_0x7064('0x3b')]({},_0x41db8a,_0x19749e[_0x7064('0x3c')]);var _0x73d2c0={'where':_0x41db8a[_0x7064('0x37')]};return db[_0x7064('0x3d')][_0x7064('0x1c')](_0x73d2c0)[_0x7064('0x22')](function(_0x329dfa){_0x2a95b2[_0x7064('0x1c')]=_0x329dfa;if(_0x19749e['query'][_0x7064('0x3e')]){_0x41db8a[_0x7064('0x3f')]=[{'all':!![]}];}return db['Campaign'][_0x7064('0x40')](_0x41db8a);})[_0x7064('0x22')](function(_0x10e45f){_0x2a95b2[_0x7064('0x41')]=_0x10e45f;return _0x2a95b2;})[_0x7064('0x22')](respondWithFilteredResult(_0x5c1b1d,_0x41db8a))[_0x7064('0x42')](handleError(_0x5c1b1d,null));};exports['show']=function(_0x5b1cac,_0x24f6b9){var _0x173d43={'raw':![],'where':{'id':_0x5b1cac[_0x7064('0x43')]['id']}},_0x5d4040={};_0x5d4040[_0x7064('0x32')]=_['keys'](db[_0x7064('0x3d')]['rawAttributes']);_0x5d4040['query']=_['keys'](_0x5b1cac[_0x7064('0x2d')]);_0x5d4040[_0x7064('0x38')]=_['intersection'](_0x5d4040[_0x7064('0x32')],_0x5d4040[_0x7064('0x2d')]);_0x173d43['attributes']=_[_0x7064('0x2f')](_0x5d4040[_0x7064('0x32')],qs['fields'](_0x5b1cac[_0x7064('0x2d')][_0x7064('0x31')]));_0x173d43[_0x7064('0x30')]=_0x173d43['attributes']['length']?_0x173d43[_0x7064('0x30')]:_0x5d4040[_0x7064('0x32')];if(_0x5b1cac[_0x7064('0x2d')][_0x7064('0x3e')]){_0x173d43[_0x7064('0x3f')]=[{'all':!![]}];}_0x173d43=_[_0x7064('0x3b')]({},_0x173d43,_0x5b1cac[_0x7064('0x3c')]);return db['Campaign']['find'](_0x173d43)[_0x7064('0x22')](handleEntityNotFound(_0x24f6b9,null))[_0x7064('0x22')](respondWithResult(_0x24f6b9,null))[_0x7064('0x42')](handleError(_0x24f6b9,null));};exports[_0x7064('0x44')]=function(_0x1db6f7,_0x56fda1){return db[_0x7064('0x3d')]['create'](_0x1db6f7['body'],{})['then'](function(_0x4d0829){var _0x58ee99=_0x1db6f7['user']['get']({'plain':!![]});if(!_0x58ee99)throw new Error(_0x7064('0x45'));if(_0x58ee99['role']===_0x7064('0x46')){var _0x249e43=_0x4d0829[_0x7064('0x47')]({'plain':!![]});var _0x43bbdc=_0x7064('0x23');return db[_0x7064('0x48')]['find']({'where':{'name':_0x43bbdc,'userProfileId':_0x58ee99['userProfileId']},'raw':!![]})['then'](function(_0x1a713a){if(_0x1a713a&&_0x1a713a[_0x7064('0x49')]===0x0){return db['UserProfileResource'][_0x7064('0x44')]({'name':_0x249e43[_0x7064('0x27')],'resourceId':_0x249e43['id'],'type':_0x1a713a[_0x7064('0x27')],'sectionId':_0x1a713a['id']},{})[_0x7064('0x22')](function(){return _0x4d0829;});}else{return _0x4d0829;}})[_0x7064('0x42')](function(_0x4f7e16){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7e16);throw _0x4f7e16;});}return _0x4d0829;})[_0x7064('0x22')](respondWithResult(_0x56fda1,0xc9))['catch'](handleError(_0x56fda1,null));};exports[_0x7064('0x4a')]=function(_0x388a59,_0x10c14b){var _0x22a0bd={'where':{'id':_0x388a59['params']['id']}},_0x3c73a6={};_0x3c73a6['model']=_[_0x7064('0x2e')](db['Campaign'][_0x7064('0x4b')]);_0x22a0bd[_0x7064('0x30')]=_[_0x7064('0x2f')](_0x3c73a6[_0x7064('0x32')],qs[_0x7064('0x31')](_0x388a59[_0x7064('0x2d')]['fields']));_0x22a0bd['attributes']=_0x22a0bd[_0x7064('0x30')][_0x7064('0x4c')]?_0x22a0bd[_0x7064('0x30')]:_0x3c73a6[_0x7064('0x32')];if(_0x388a59[_0x7064('0x2d')][_0x7064('0x3e')]){_0x22a0bd[_0x7064('0x3f')]=[{'all':!![]}];}_0x22a0bd=_['merge']({},_0x22a0bd,_0x388a59[_0x7064('0x3c')]);return db['Campaign'][_0x7064('0x4d')](_0x22a0bd)[_0x7064('0x22')](handleEntityNotFound(_0x10c14b,null))['then'](function(_0x3c16a5){if(_0x3c16a5){var _0xc26fc1=_0x3c16a5[_0x7064('0x47')]({'plain':!![]});_0xc26fc1=qs[_0x7064('0x4e')](_0xc26fc1,['id',_0x7064('0x4f'),_0x7064('0x50')]);_0x388a59[_0x7064('0x51')]=_[_0x7064('0x4e')](_0x388a59[_0x7064('0x51')],['id','createdAt',_0x7064('0x50')]);return db[_0x7064('0x3d')][_0x7064('0x44')](_['merge'](_0xc26fc1,_0x388a59['body']),{'include':_0x388a59[_0x7064('0x2d')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3f5275){var _0x4d71f9=_0x388a59[_0x7064('0x46')][_0x7064('0x47')]({'plain':!![]});if(!_0x4d71f9)throw new Error(_0x7064('0x45'));if(_0x4d71f9[_0x7064('0x52')]===_0x7064('0x46')){var _0x4fb294=_0x3f5275['get']({'plain':!![]});var _0x47e7f4='IvrCampaigns';return db['UserProfileSection'][_0x7064('0x4d')]({'where':{'name':_0x47e7f4,'userProfileId':_0x4d71f9[_0x7064('0x53')]},'raw':!![]})[_0x7064('0x22')](function(_0x22b5d1){if(_0x22b5d1&&_0x22b5d1[_0x7064('0x49')]===0x0){return db[_0x7064('0x24')][_0x7064('0x44')]({'name':_0x4fb294[_0x7064('0x27')],'resourceId':_0x4fb294['id'],'type':_0x22b5d1[_0x7064('0x27')],'sectionId':_0x22b5d1['id']},{})['then'](function(){return _0x3f5275;});}else{return _0x3f5275;}})['catch'](function(_0xf9ceda){logger[_0x7064('0x25')](_0x7064('0x54'),_0xf9ceda);throw _0xf9ceda;});}return _0x3f5275;});}})[_0x7064('0x22')](respondWithResult(_0x10c14b,0xc9))['catch'](handleError(_0x10c14b,null));};exports['update']=function(_0xe7fb0e,_0x1457f7){if(_0xe7fb0e[_0x7064('0x51')]['id']){delete _0xe7fb0e[_0x7064('0x51')]['id'];}return db['Campaign'][_0x7064('0x4d')]({'where':{'id':_0xe7fb0e[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x1457f7,null))[_0x7064('0x22')](saveUpdates(_0xe7fb0e[_0x7064('0x51')],null))[_0x7064('0x22')](respondWithResult(_0x1457f7,null))[_0x7064('0x42')](handleError(_0x1457f7,null));};exports[_0x7064('0x55')]=function(_0x5ec835,_0xc71b4a){return db[_0x7064('0x3d')][_0x7064('0x4d')]({'where':{'id':_0x5ec835[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0xc71b4a,null))[_0x7064('0x22')](removeEntity(_0xc71b4a,null))['catch'](handleError(_0xc71b4a,null));};exports[_0x7064('0x56')]=function(_0xf94d89,_0x17dbdb,_0x37cbc5){var _0x4c08f2={'raw':!![],'where':{}};var _0x158a10={};var _0x4d194a={'count':0x0,'rows':[]};return db[_0x7064('0x3d')]['findOne']({'where':{'id':_0xf94d89[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x17dbdb,null))[_0x7064('0x22')](function(_0x2eb5cd){if(_0x2eb5cd){_0x158a10[_0x7064('0x32')]=_['keys'](db[_0x7064('0x57')][_0x7064('0x4b')]);_0x158a10[_0x7064('0x2d')]=_['keys'](_0xf94d89[_0x7064('0x2d')]);_0x158a10[_0x7064('0x38')]=_[_0x7064('0x2f')](_0x158a10[_0x7064('0x32')],_0x158a10[_0x7064('0x2d')]);_0x4c08f2[_0x7064('0x30')]=_[_0x7064('0x2f')](_0x158a10['model'],qs['fields'](_0xf94d89[_0x7064('0x2d')][_0x7064('0x31')]));_0x4c08f2[_0x7064('0x30')]=_0x4c08f2[_0x7064('0x30')][_0x7064('0x4c')]?_0x4c08f2[_0x7064('0x30')]:_0x158a10[_0x7064('0x32')];if(!_0xf94d89[_0x7064('0x2d')]['hasOwnProperty'](_0x7064('0x34'))){_0x4c08f2['limit']=qs[_0x7064('0x1d')](_0xf94d89[_0x7064('0x2d')][_0x7064('0x1d')]);_0x4c08f2[_0x7064('0x1a')]=qs[_0x7064('0x1a')](_0xf94d89[_0x7064('0x2d')]['offset']);}_0x4c08f2[_0x7064('0x35')]=qs[_0x7064('0x36')](_0xf94d89[_0x7064('0x2d')]['sort']);_0x4c08f2[_0x7064('0x37')]=qs[_0x7064('0x38')](_['pick'](_0xf94d89[_0x7064('0x2d')],_0x158a10[_0x7064('0x38')]));_0x4c08f2[_0x7064('0x37')][_0x7064('0x58')]=_0x2eb5cd['id'];if(_0xf94d89[_0x7064('0x2d')][_0x7064('0x3a')]){_0x4c08f2[_0x7064('0x37')]=_[_0x7064('0x3b')](_0x4c08f2[_0x7064('0x37')],{'$or':_[_0x7064('0x2c')](_0x4c08f2[_0x7064('0x30')],function(_0x596d8f){var _0x53fad1={};_0x53fad1[_0x596d8f]={'$like':'%'+_0xf94d89[_0x7064('0x2d')][_0x7064('0x3a')]+'%'};return _0x53fad1;})});}_0x4c08f2=_[_0x7064('0x3b')]({},_0x4c08f2,_0xf94d89[_0x7064('0x3c')]);return db[_0x7064('0x57')][_0x7064('0x1c')]({'where':_0x4c08f2[_0x7064('0x37')]})['then'](function(_0x54e172){_0x4d194a[_0x7064('0x1c')]=_0x54e172;if(_0xf94d89[_0x7064('0x2d')]['includeAll']){_0x4c08f2[_0x7064('0x3f')]=[{'all':!![]}];}return db[_0x7064('0x57')][_0x7064('0x40')](_0x4c08f2);})[_0x7064('0x22')](function(_0x520ac5){_0x4d194a[_0x7064('0x41')]=_0x520ac5;return _0x4d194a;});}})[_0x7064('0x22')](respondWithFilteredResult(_0x17dbdb,_0x4c08f2))[_0x7064('0x42')](handleError(_0x17dbdb,null));};exports[_0x7064('0x59')]=function(_0x3c51b7,_0xe0995a,_0x2a39c2){var _0x343e44={'raw':!![],'where':{}};var _0x5784e4={};var _0x281bcb={'count':0x0,'rows':[]};return db[_0x7064('0x3d')][_0x7064('0x5a')]({'where':{'id':_0x3c51b7[_0x7064('0x43')]['id']}})['then'](handleEntityNotFound(_0xe0995a,null))['then'](function(_0x1e5e14){if(_0x1e5e14){_0x5784e4['model']=_[_0x7064('0x2e')](db[_0x7064('0x5b')][_0x7064('0x4b')]);_0x5784e4[_0x7064('0x2d')]=_[_0x7064('0x2e')](_0x3c51b7[_0x7064('0x2d')]);_0x5784e4[_0x7064('0x38')]=_['intersection'](_0x5784e4[_0x7064('0x32')],_0x5784e4['query']);_0x343e44[_0x7064('0x30')]=_['intersection'](_0x5784e4['model'],qs[_0x7064('0x31')](_0x3c51b7[_0x7064('0x2d')][_0x7064('0x31')]));_0x343e44[_0x7064('0x30')]=_0x343e44[_0x7064('0x30')]['length']?_0x343e44['attributes']:_0x5784e4['model'];if(!_0x3c51b7[_0x7064('0x2d')][_0x7064('0x33')]('nolimit')){_0x343e44[_0x7064('0x1d')]=qs[_0x7064('0x1d')](_0x3c51b7[_0x7064('0x2d')]['limit']);_0x343e44[_0x7064('0x1a')]=qs['offset'](_0x3c51b7[_0x7064('0x2d')][_0x7064('0x1a')]);}_0x343e44[_0x7064('0x35')]=qs['sort'](_0x3c51b7['query']['sort']);_0x343e44[_0x7064('0x37')]=qs[_0x7064('0x38')](_['pick'](_0x3c51b7[_0x7064('0x2d')],_0x5784e4[_0x7064('0x38')]));_0x343e44[_0x7064('0x37')]['CampaignId']=_0x1e5e14['id'];if(_0x3c51b7[_0x7064('0x2d')][_0x7064('0x3a')]){_0x343e44[_0x7064('0x37')]=_[_0x7064('0x3b')](_0x343e44['where'],{'$or':_[_0x7064('0x2c')](_0x343e44[_0x7064('0x30')],function(_0x8450fc){var _0x4cffb4={};_0x4cffb4[_0x8450fc]={'$like':'%'+_0x3c51b7[_0x7064('0x2d')][_0x7064('0x3a')]+'%'};return _0x4cffb4;})});}_0x343e44=_['merge']({},_0x343e44,_0x3c51b7[_0x7064('0x3c')]);return db['CmHopperHistory'][_0x7064('0x1c')]({'where':_0x343e44[_0x7064('0x37')]})['then'](function(_0x5b0d95){_0x281bcb['count']=_0x5b0d95;if(_0x3c51b7[_0x7064('0x2d')][_0x7064('0x3e')]){_0x343e44[_0x7064('0x3f')]=[{'all':!![]}];}return db[_0x7064('0x5b')][_0x7064('0x40')](_0x343e44);})['then'](function(_0x3c2fb4){_0x281bcb[_0x7064('0x41')]=_0x3c2fb4;return _0x281bcb;});}})['then'](respondWithFilteredResult(_0xe0995a,_0x343e44))['catch'](handleError(_0xe0995a,null));};exports['getHopperFinals']=function(_0x3e2524,_0x50a8a4,_0x14440c){var _0x3c66a1={'raw':!![],'where':{}};var _0x510e3={};var _0x18afb6={'count':0x0,'rows':[]};return db['Campaign'][_0x7064('0x5a')]({'where':{'id':_0x3e2524['params']['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x50a8a4,null))[_0x7064('0x22')](function(_0x553210){if(_0x553210){_0x510e3[_0x7064('0x32')]=_[_0x7064('0x2e')](db[_0x7064('0x5c')][_0x7064('0x4b')]);_0x510e3[_0x7064('0x2d')]=_['keys'](_0x3e2524['query']);_0x510e3['filters']=_[_0x7064('0x2f')](_0x510e3['model'],_0x510e3[_0x7064('0x2d')]);_0x3c66a1[_0x7064('0x30')]=_[_0x7064('0x2f')](_0x510e3[_0x7064('0x32')],qs['fields'](_0x3e2524[_0x7064('0x2d')][_0x7064('0x31')]));_0x3c66a1[_0x7064('0x30')]=_0x3c66a1[_0x7064('0x30')][_0x7064('0x4c')]?_0x3c66a1[_0x7064('0x30')]:_0x510e3[_0x7064('0x32')];if(!_0x3e2524['query'][_0x7064('0x33')](_0x7064('0x34'))){_0x3c66a1['limit']=qs[_0x7064('0x1d')](_0x3e2524[_0x7064('0x2d')][_0x7064('0x1d')]);_0x3c66a1['offset']=qs[_0x7064('0x1a')](_0x3e2524['query'][_0x7064('0x1a')]);}_0x3c66a1[_0x7064('0x35')]=qs[_0x7064('0x36')](_0x3e2524[_0x7064('0x2d')]['sort']);_0x3c66a1[_0x7064('0x37')]=qs[_0x7064('0x38')](_[_0x7064('0x39')](_0x3e2524[_0x7064('0x2d')],_0x510e3[_0x7064('0x38')]));_0x3c66a1[_0x7064('0x37')][_0x7064('0x58')]=_0x553210['id'];if(_0x3e2524['query']['filter']){_0x3c66a1[_0x7064('0x37')]=_[_0x7064('0x3b')](_0x3c66a1[_0x7064('0x37')],{'$or':_['map'](_0x3c66a1[_0x7064('0x30')],function(_0x17fdb1){var _0x4af513={};_0x4af513[_0x17fdb1]={'$like':'%'+_0x3e2524[_0x7064('0x2d')]['filter']+'%'};return _0x4af513;})});}_0x3c66a1=_['merge']({},_0x3c66a1,_0x3e2524[_0x7064('0x3c')]);return db['CmHopperFinal'][_0x7064('0x1c')]({'where':_0x3c66a1[_0x7064('0x37')]})['then'](function(_0x49da1d){_0x18afb6['count']=_0x49da1d;if(_0x3e2524[_0x7064('0x2d')][_0x7064('0x3e')]){_0x3c66a1[_0x7064('0x3f')]=[{'all':!![]}];}return db[_0x7064('0x5c')][_0x7064('0x40')](_0x3c66a1);})[_0x7064('0x22')](function(_0x5f9ec9){_0x18afb6[_0x7064('0x41')]=_0x5f9ec9;return _0x18afb6;});}})[_0x7064('0x22')](respondWithFilteredResult(_0x50a8a4,_0x3c66a1))['catch'](handleError(_0x50a8a4,null));};exports[_0x7064('0x5d')]=function(_0x331edd,_0x31df93,_0x3e81dc){var _0x434dae={'raw':!![],'where':{}};var _0x5a561c={};var _0x306ebe={'count':0x0,'rows':[]};return db['Campaign'][_0x7064('0x5a')]({'where':{'id':_0x331edd[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x31df93,null))[_0x7064('0x22')](function(_0x1e3d34){if(_0x1e3d34){_0x5a561c[_0x7064('0x32')]=_[_0x7064('0x2e')](db[_0x7064('0x5e')]['rawAttributes']);_0x5a561c[_0x7064('0x2d')]=_[_0x7064('0x2e')](_0x331edd[_0x7064('0x2d')]);_0x5a561c[_0x7064('0x38')]=_['intersection'](_0x5a561c[_0x7064('0x32')],_0x5a561c['query']);_0x434dae[_0x7064('0x30')]=_[_0x7064('0x2f')](_0x5a561c[_0x7064('0x32')],qs[_0x7064('0x31')](_0x331edd['query'][_0x7064('0x31')]));_0x434dae[_0x7064('0x30')]=_0x434dae[_0x7064('0x30')][_0x7064('0x4c')]?_0x434dae[_0x7064('0x30')]:_0x5a561c['model'];if(!_0x331edd[_0x7064('0x2d')]['hasOwnProperty'](_0x7064('0x34'))){_0x434dae[_0x7064('0x1d')]=qs['limit'](_0x331edd[_0x7064('0x2d')][_0x7064('0x1d')]);_0x434dae[_0x7064('0x1a')]=qs[_0x7064('0x1a')](_0x331edd['query'][_0x7064('0x1a')]);}_0x434dae[_0x7064('0x35')]=qs[_0x7064('0x36')](_0x331edd[_0x7064('0x2d')][_0x7064('0x36')]);_0x434dae[_0x7064('0x37')]=qs[_0x7064('0x38')](_[_0x7064('0x39')](_0x331edd[_0x7064('0x2d')],_0x5a561c[_0x7064('0x38')]));_0x434dae['where'][_0x7064('0x58')]=_0x1e3d34['id'];if(_0x331edd[_0x7064('0x2d')][_0x7064('0x3a')]){_0x434dae['where']=_[_0x7064('0x3b')](_0x434dae[_0x7064('0x37')],{'$or':_['map'](_0x434dae[_0x7064('0x30')],function(_0x26e373){var _0xa140d6={};_0xa140d6[_0x26e373]={'$like':'%'+_0x331edd['query'][_0x7064('0x3a')]+'%'};return _0xa140d6;})});}_0x434dae=_[_0x7064('0x3b')]({},_0x434dae,_0x331edd[_0x7064('0x3c')]);return db[_0x7064('0x5e')][_0x7064('0x1c')]({'where':_0x434dae['where']})[_0x7064('0x22')](function(_0x589c92){_0x306ebe[_0x7064('0x1c')]=_0x589c92;if(_0x331edd[_0x7064('0x2d')]['includeAll']){_0x434dae[_0x7064('0x3f')]=[{'all':!![]}];}return db[_0x7064('0x5e')]['findAll'](_0x434dae);})[_0x7064('0x22')](function(_0x5a6d9e){_0x306ebe['rows']=_0x5a6d9e;return _0x306ebe;});}})['then'](respondWithFilteredResult(_0x31df93,_0x434dae))['catch'](handleError(_0x31df93,null));};exports[_0x7064('0x5f')]=function(_0x24cc3c,_0x5e5d29,_0x4d47cb){var _0x5c61a0={};var _0x8d755e={};var _0x710297;var _0x50ebfe;return db[_0x7064('0x3d')][_0x7064('0x5a')]({'where':{'id':_0x24cc3c[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x5e5d29,null))[_0x7064('0x22')](function(_0x771372){if(_0x771372){_0x710297=_0x771372;_0x8d755e[_0x7064('0x32')]=_[_0x7064('0x2e')](db[_0x7064('0x60')][_0x7064('0x4b')]);_0x8d755e['query']=_[_0x7064('0x2e')](_0x24cc3c[_0x7064('0x2d')]);_0x8d755e[_0x7064('0x38')]=_[_0x7064('0x2f')](_0x8d755e[_0x7064('0x32')],_0x8d755e[_0x7064('0x2d')]);_0x5c61a0[_0x7064('0x30')]=_['intersection'](_0x8d755e[_0x7064('0x32')],qs[_0x7064('0x31')](_0x24cc3c[_0x7064('0x2d')][_0x7064('0x31')]));_0x5c61a0['attributes']=_0x5c61a0[_0x7064('0x30')]['length']?_0x5c61a0['attributes']:_0x8d755e[_0x7064('0x32')];_0x5c61a0[_0x7064('0x35')]=qs[_0x7064('0x36')](_0x24cc3c[_0x7064('0x2d')][_0x7064('0x36')]);_0x5c61a0[_0x7064('0x37')]=qs[_0x7064('0x38')](_['pick'](_0x24cc3c['query'],_0x8d755e['filters']));if(_0x24cc3c[_0x7064('0x2d')]['filter']){_0x5c61a0[_0x7064('0x37')]=_[_0x7064('0x3b')](_0x5c61a0[_0x7064('0x37')],{'$or':_[_0x7064('0x2c')](_0x5c61a0[_0x7064('0x30')],function(_0x34e187){var _0x211d94={};_0x211d94[_0x34e187]={'$like':'%'+_0x24cc3c[_0x7064('0x2d')]['filter']+'%'};return _0x211d94;})});}_0x5c61a0=_[_0x7064('0x3b')]({},_0x5c61a0,_0x24cc3c['options']);return _0x710297[_0x7064('0x5f')](_0x5c61a0);}})[_0x7064('0x22')](function(_0x4ef45b){if(_0x4ef45b){_0x50ebfe=_0x4ef45b['length'];if(!_0x24cc3c[_0x7064('0x2d')][_0x7064('0x33')]('nolimit')){_0x5c61a0[_0x7064('0x1d')]=qs['limit'](_0x24cc3c[_0x7064('0x2d')][_0x7064('0x1d')]);_0x5c61a0[_0x7064('0x1a')]=qs[_0x7064('0x1a')](_0x24cc3c[_0x7064('0x2d')]['offset']);}return _0x710297['getLists'](_0x5c61a0);}})[_0x7064('0x22')](function(_0xe1d574){if(_0xe1d574){return _0xe1d574?{'count':_0x50ebfe,'rows':_0xe1d574}:null;}})[_0x7064('0x22')](respondWithResult(_0x5e5d29,null))[_0x7064('0x42')](handleError(_0x5e5d29,null));};exports[_0x7064('0x61')]=function(_0x8c906d,_0x3b00d2,_0x3b7629){var _0x2aa6dc,_0x14c746;var _0x2355de=[];var _0x1b8159=moment()['format'](_0x7064('0x62'));return db[_0x7064('0x3d')][_0x7064('0x4d')]({'where':{'id':_0x8c906d[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x3b00d2,null))[_0x7064('0x22')](function(_0x109b58){if(_0x109b58){_0x14c746=_0x109b58;return _0x109b58[_0x7064('0x61')](_0x8c906d['body'][_0x7064('0x63')],_[_0x7064('0x4e')](_0x8c906d['body'],[_0x7064('0x63'),'id'])||{});}return null;})[_0x7064('0x64')](function(_0x155196){var _0x1cc3dc;var _0x5d774b;_0x2aa6dc=_0x155196||[];var _0x187826=[];if(_0x155196){for(var _0x41bde3=0x0;_0x41bde3<_0x155196['length'];_0x41bde3+=0x1){var _0xa3d60e=_0x155196[_0x41bde3][_0x7064('0x47')]({'plain':!![]});_0x14c746[_0x7064('0x65')]=_0x8c906d[_0x7064('0x51')][_0x7064('0x65')]?_0x8c906d[_0x7064('0x51')][_0x7064('0x65')]:_0x14c746[_0x7064('0x65')];switch(_0x14c746[_0x7064('0x65')]){case _0x7064('0x66'):_0x1cc3dc=squel['insert']()['into'](_0x7064('0x67'))[_0x7064('0x68')]([_0x7064('0x69'),_0x7064('0x6a'),_0x7064('0x6b'),_0x7064('0x6c'),_0x7064('0x58'),'createdAt','updatedAt'],squel['select']()['field'](_0x7064('0x69'),'phone')['field'](_0x7064('0x6d'),_0x7064('0x6a'))['field']('id','ContactId')[_0x7064('0x6e')](_0xa3d60e['CmListId'][_0x7064('0x6f')](),'ListId')[_0x7064('0x6e')](_0x8c906d[_0x7064('0x43')]['id']['toString'](),'CampaignId')[_0x7064('0x6e')]('\x27'+_0x1b8159+'\x27',_0x7064('0x4f'))[_0x7064('0x6e')]('\x27'+_0x1b8159+'\x27',_0x7064('0x50'))[_0x7064('0x70')]('cm_contacts')[_0x7064('0x37')](_0x7064('0x71'))[_0x7064('0x37')](_0x7064('0x72'),_0xa3d60e[_0x7064('0x73')][_0x7064('0x6f')]())[_0x7064('0x37')](_0x7064('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7064('0x75')]()[_0x7064('0x6e')](_0x7064('0x76'))[_0x7064('0x70')]('cm_hopper_final')['where'](_0x7064('0x77'),_0x8c906d[_0x7064('0x43')]['id'][_0x7064('0x6f')]()))[_0x7064('0x37')](_0x7064('0x78'),squel[_0x7064('0x75')]()[_0x7064('0x6e')]('COALESCE(phone,\x27\x27)')[_0x7064('0x70')](_0x7064('0x67'))[_0x7064('0x37')](_0x7064('0x77'),_0x8c906d[_0x7064('0x43')]['id'][_0x7064('0x6f')]())))[_0x7064('0x6f')]();break;case _0x7064('0x79'):_0x1cc3dc=squel['insert']()['into'](_0x7064('0x67'))['fromQuery']([_0x7064('0x69'),_0x7064('0x6a'),_0x7064('0x6b'),_0x7064('0x6c'),_0x7064('0x58'),_0x7064('0x4f'),'updatedAt'],squel[_0x7064('0x75')]()[_0x7064('0x6e')](_0x7064('0x69'),_0x7064('0x69'))['field']('NOW()',_0x7064('0x6a'))[_0x7064('0x6e')]('id',_0x7064('0x6b'))['field'](_0xa3d60e[_0x7064('0x73')][_0x7064('0x6f')](),'ListId')[_0x7064('0x6e')](_0x8c906d['params']['id'][_0x7064('0x6f')](),_0x7064('0x58'))[_0x7064('0x6e')]('\x27'+_0x1b8159+'\x27',_0x7064('0x4f'))['field']('\x27'+_0x1b8159+'\x27',_0x7064('0x50'))[_0x7064('0x70')](_0x7064('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x7064('0x72'),_0xa3d60e[_0x7064('0x73')][_0x7064('0x6f')]())[_0x7064('0x37')](_0x7064('0x74'))['where'](_0x7064('0x78'),squel[_0x7064('0x75')]()[_0x7064('0x6e')](_0x7064('0x7b'))[_0x7064('0x70')](_0x7064('0x67'))[_0x7064('0x37')](_0x7064('0x77'),_0x8c906d[_0x7064('0x43')]['id'][_0x7064('0x6f')]())))['toString']();break;default:_0x1cc3dc=squel[_0x7064('0x7c')]()[_0x7064('0x7d')](_0x7064('0x67'))[_0x7064('0x68')]([_0x7064('0x69'),_0x7064('0x6a'),'ContactId','ListId',_0x7064('0x58'),_0x7064('0x4f'),_0x7064('0x50')],squel[_0x7064('0x75')]()[_0x7064('0x6e')](_0x7064('0x69'),_0x7064('0x69'))[_0x7064('0x6e')]('NOW()','scheduledAt')['field']('id',_0x7064('0x6b'))['field'](_0xa3d60e[_0x7064('0x73')]['toString'](),_0x7064('0x6c'))['field'](_0x8c906d[_0x7064('0x43')]['id'][_0x7064('0x6f')](),_0x7064('0x58'))[_0x7064('0x6e')]('\x27'+_0x1b8159+'\x27',_0x7064('0x4f'))[_0x7064('0x6e')]('\x27'+_0x1b8159+'\x27',_0x7064('0x50'))[_0x7064('0x70')](_0x7064('0x7a'))[_0x7064('0x37')](_0x7064('0x71'))['where'](_0x7064('0x72'),_0xa3d60e[_0x7064('0x73')][_0x7064('0x6f')]())[_0x7064('0x37')](_0x7064('0x74')))[_0x7064('0x6f')]();}_0x5d774b=squel[_0x7064('0x7c')]()[_0x7064('0x7d')](_0x7064('0x7e'))[_0x7064('0x68')]([_0x7064('0x7f'),_0x7064('0x6a'),_0x7064('0x69'),_0x7064('0x80'),_0x7064('0x4f'),_0x7064('0x50')],squel[_0x7064('0x75')]()[_0x7064('0x6e')](_0x7064('0x81'),'id')[_0x7064('0x6e')]('NOW()',_0x7064('0x6a'))[_0x7064('0x6e')]('ci.item',_0x7064('0x69'))[_0x7064('0x6e')](_0x7064('0x82'),_0x7064('0x80'))[_0x7064('0x6e')]('\x27'+_0x1b8159+'\x27',_0x7064('0x4f'))[_0x7064('0x6e')]('\x27'+_0x1b8159+'\x27',_0x7064('0x50'))['from'](_0x7064('0x83'),'ci')[_0x7064('0x84')](_0x7064('0x67'),'h',_0x7064('0x85'))[_0x7064('0x37')](_0x7064('0x86'),_0xa3d60e['CmListId'][_0x7064('0x6f')]())[_0x7064('0x37')](_0x7064('0x87'),_0x8c906d[_0x7064('0x43')]['id']['toString']())[_0x7064('0x37')](_0x7064('0x88'),_0x1b8159))[_0x7064('0x6f')]();_0x187826[_0x7064('0x89')](db[_0x7064('0x8a')][_0x7064('0x2d')](_0x1cc3dc));_0x2355de[_0x7064('0x89')](db[_0x7064('0x8a')][_0x7064('0x2d')](_0x5d774b));}return BPromise[_0x7064('0x8b')](_0x187826);}})[_0x7064('0x22')](function(){return BPromise[_0x7064('0x8b')](_0x2355de);})['then'](function(){return _0x2aa6dc;})[_0x7064('0x22')](respondWithResult(_0x3b00d2,null))['catch'](handleError(_0x3b00d2,null));};exports[_0x7064('0x8c')]=function(_0x1d14de,_0x300bba,_0x3fc398){return db[_0x7064('0x3d')][_0x7064('0x4d')]({'where':{'id':_0x1d14de[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x300bba,null))['then'](function(_0x5f4db2){if(_0x5f4db2){return _0x5f4db2[_0x7064('0x8c')](_0x1d14de[_0x7064('0x2d')][_0x7064('0x63')]);}})[_0x7064('0x22')](function(_0x5d080f){if(_0x5d080f){return db[_0x7064('0x57')]['destroy']({'where':{'ListId':_0x1d14de['query'][_0x7064('0x63')],'CampaignId':_0x1d14de['params']['id']}})[_0x7064('0x22')](function(){return _0x5d080f;});}})[_0x7064('0x22')](respondWithStatusCode(_0x300bba,null))[_0x7064('0x42')](handleError(_0x300bba,null));};exports['getBlackLists']=function(_0x204954,_0x4c82d2,_0x46d142){var _0x2663b6={};var _0x5608ea={};var _0x3c5c30;var _0x2a7226;return db[_0x7064('0x3d')][_0x7064('0x5a')]({'where':{'id':_0x204954[_0x7064('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c82d2,null))['then'](function(_0x540fae){if(_0x540fae){_0x3c5c30=_0x540fae;_0x5608ea[_0x7064('0x32')]=_[_0x7064('0x2e')](db[_0x7064('0x60')][_0x7064('0x4b')]);_0x5608ea[_0x7064('0x2d')]=_[_0x7064('0x2e')](_0x204954[_0x7064('0x2d')]);_0x5608ea[_0x7064('0x38')]=_[_0x7064('0x2f')](_0x5608ea[_0x7064('0x32')],_0x5608ea[_0x7064('0x2d')]);_0x2663b6[_0x7064('0x30')]=_['intersection'](_0x5608ea[_0x7064('0x32')],qs[_0x7064('0x31')](_0x204954[_0x7064('0x2d')]['fields']));_0x2663b6[_0x7064('0x30')]=_0x2663b6[_0x7064('0x30')][_0x7064('0x4c')]?_0x2663b6[_0x7064('0x30')]:_0x5608ea[_0x7064('0x32')];_0x2663b6['order']=qs['sort'](_0x204954[_0x7064('0x2d')][_0x7064('0x36')]);_0x2663b6[_0x7064('0x37')]=qs[_0x7064('0x38')](_['pick'](_0x204954[_0x7064('0x2d')],_0x5608ea['filters']));if(_0x204954[_0x7064('0x2d')][_0x7064('0x3a')]){_0x2663b6['where']=_[_0x7064('0x3b')](_0x2663b6[_0x7064('0x37')],{'$or':_['map'](_0x2663b6[_0x7064('0x30')],function(_0x5b2206){var _0x502520={};_0x502520[_0x5b2206]={'$like':'%'+_0x204954[_0x7064('0x2d')][_0x7064('0x3a')]+'%'};return _0x502520;})});}_0x2663b6=_[_0x7064('0x3b')]({},_0x2663b6,_0x204954[_0x7064('0x3c')]);return _0x3c5c30[_0x7064('0x8d')](_0x2663b6);}})['then'](function(_0x47fb5c){if(_0x47fb5c){_0x2a7226=_0x47fb5c[_0x7064('0x4c')];if(!_0x204954[_0x7064('0x2d')][_0x7064('0x33')](_0x7064('0x34'))){_0x2663b6[_0x7064('0x1d')]=qs[_0x7064('0x1d')](_0x204954['query'][_0x7064('0x1d')]);_0x2663b6[_0x7064('0x1a')]=qs[_0x7064('0x1a')](_0x204954['query'][_0x7064('0x1a')]);}return _0x3c5c30[_0x7064('0x8d')](_0x2663b6);}})[_0x7064('0x22')](function(_0x5d8c1b){if(_0x5d8c1b){return _0x5d8c1b?{'count':_0x2a7226,'rows':_0x5d8c1b}:null;}})[_0x7064('0x22')](respondWithResult(_0x4c82d2,null))[_0x7064('0x42')](handleError(_0x4c82d2,null));};exports[_0x7064('0x8e')]=function(_0x5662e9,_0x5e0899,_0x51ee08){var _0x4e52b8,_0x4d91e0;var _0x26c475=[];var _0x11bd8e=moment()[_0x7064('0x8f')](_0x7064('0x62'));return db[_0x7064('0x3d')][_0x7064('0x4d')]({'where':{'id':_0x5662e9[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x5e0899,null))[_0x7064('0x22')](function(_0x3a693a){if(_0x3a693a){_0x4d91e0=_0x3a693a;return _0x3a693a[_0x7064('0x8e')](_0x5662e9[_0x7064('0x51')][_0x7064('0x63')],_[_0x7064('0x4e')](_0x5662e9[_0x7064('0x51')],['ids','id'])||{});}return null;})[_0x7064('0x64')](function(_0x196ef9){var _0xb89e04;var _0x904c1b;_0x4e52b8=_0x196ef9||[];var _0x5ac7b0=[];if(_0x196ef9){for(var _0x41ee85=0x0;_0x41ee85<_0x196ef9[_0x7064('0x4c')];_0x41ee85+=0x1){var _0x49be4b=_0x196ef9[_0x41ee85]['get']({'plain':!![]});_0xb89e04=squel[_0x7064('0x7c')]()[_0x7064('0x7d')](_0x7064('0x90'))[_0x7064('0x68')]([_0x7064('0x69'),_0x7064('0x6b'),'ListId',_0x7064('0x58'),'createdAt',_0x7064('0x50')],squel[_0x7064('0x75')]()[_0x7064('0x6e')](_0x7064('0x69'),'phone')[_0x7064('0x6e')]('id',_0x7064('0x6b'))[_0x7064('0x6e')](_0x49be4b['CmListId'][_0x7064('0x6f')](),'ListId')['field'](_0x5662e9[_0x7064('0x43')]['id'][_0x7064('0x6f')](),'CampaignId')[_0x7064('0x6e')](_0x7064('0x6d'),_0x7064('0x4f'))[_0x7064('0x6e')](_0x7064('0x6d'),_0x7064('0x50'))[_0x7064('0x70')]('cm_contacts')[_0x7064('0x37')]('deletedAt\x20IS\x20NULL')[_0x7064('0x37')](_0x7064('0x72'),_0x49be4b[_0x7064('0x73')][_0x7064('0x6f')]())[_0x7064('0x37')](_0x7064('0x74')))['toString']();_0x5ac7b0[_0x7064('0x89')](db['sequelize']['query'](_0xb89e04));}return BPromise['all'](_0x5ac7b0);}})['then'](function(){return _0x4e52b8;})[_0x7064('0x22')](respondWithResult(_0x5e0899,null))[_0x7064('0x42')](handleError(_0x5e0899,null));};exports[_0x7064('0x91')]=function(_0x205f3f,_0x1bd14f,_0x3b6a67){return db[_0x7064('0x3d')]['find']({'where':{'id':_0x205f3f[_0x7064('0x43')]['id']}})[_0x7064('0x22')](handleEntityNotFound(_0x1bd14f,null))['then'](function(_0x544db7){if(_0x544db7){return _0x544db7[_0x7064('0x91')](_0x205f3f[_0x7064('0x2d')]['ids']);}})[_0x7064('0x22')](function(_0x80c877){if(_0x80c877){return db[_0x7064('0x5e')][_0x7064('0x55')]({'where':{'ListId':_0x205f3f[_0x7064('0x2d')][_0x7064('0x63')],'CampaignId':_0x205f3f[_0x7064('0x43')]['id']}})[_0x7064('0x22')](function(){return _0x80c877;});}})[_0x7064('0x22')](respondWithStatusCode(_0x1bd14f,null))[_0x7064('0x42')](handleError(_0x1bd14f,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index b8f080b..113c0dd 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(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x13c312,_0xb56507){var _0x1c31fe=function(_0x4fa80b){while(--_0x4fa80b){_0x13c312['push'](_0x13c312['shift']());}};_0x1c31fe(++_0xb56507);}(_0x7a54,0x106));var _0x47a5=function(_0x1445dd,_0x5843bd){_0x1445dd=_0x1445dd-0x0;var _0x5818c5=_0x7a54[_0x1445dd];return _0x5818c5;};'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 9a66789..e87b1cf 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 _0x70e0=['findAll','options','raw','attributes','include','map','model','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign'];(function(_0x760968,_0x2c607c){var _0x1c707b=function(_0x4cfd81){while(--_0x4cfd81){_0x760968['push'](_0x760968['shift']());}};_0x1c707b(++_0x2c607c);}(_0x70e0,0x17b));var _0x070e=function(_0x4a8e60,_0x59d8ec){_0x4a8e60=_0x4a8e60-0x0;var _0x5902f9=_0x70e0[_0x4a8e60];return _0x5902f9;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Campaign,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Campaign,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}exports[_0x070e('0x16')]=function(_0x38f6e6){var _0x2060cc=this;return new Promise(function(_0x364b3f,_0x5037eb){return db[_0x070e('0x17')][_0x070e('0x18')]({'raw':_0x38f6e6[_0x070e('0x19')]?_0x38f6e6[_0x070e('0x19')][_0x070e('0x1a')]===undefined?!![]:![]:!![],'where':_0x38f6e6['options']?_0x38f6e6['options']['where']||null:null,'attributes':_0x38f6e6[_0x070e('0x19')]?_0x38f6e6[_0x070e('0x19')][_0x070e('0x1b')]||null:null,'limit':_0x38f6e6['options']?_0x38f6e6[_0x070e('0x19')]['limit']||null:null,'include':_0x38f6e6[_0x070e('0x19')]?_0x38f6e6[_0x070e('0x19')][_0x070e('0x1c')]?_[_0x070e('0x1d')](_0x38f6e6[_0x070e('0x19')][_0x070e('0x1c')],function(_0xe405e){return{'model':db[_0xe405e[_0x070e('0x1e')]],'as':_0xe405e['as'],'attributes':_0xe405e['attributes'],'include':_0xe405e[_0x070e('0x1c')]?_[_0x070e('0x1d')](_0xe405e[_0x070e('0x1c')],function(_0x503f4d){return{'model':db[_0x503f4d[_0x070e('0x1e')]],'as':_0x503f4d['as'],'attributes':_0x503f4d['attributes'],'include':_0x503f4d['include']?_[_0x070e('0x1d')](_0x503f4d[_0x070e('0x1c')],function(_0x41deb1){return{'model':db[_0x41deb1[_0x070e('0x1e')]],'as':_0x41deb1['as'],'attributes':_0x41deb1[_0x070e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x374c54){logger[_0x070e('0xb')](_0x070e('0x16'),_0x38f6e6);logger[_0x070e('0xc')](_0x070e('0x16'),_0x38f6e6,JSON[_0x070e('0xf')](_0x374c54));_0x364b3f(_0x374c54);})[_0x070e('0x15')](function(_0x26373b){logger['error'](_0x070e('0x16'),_0x26373b[_0x070e('0x13')],_0x38f6e6);_0x5037eb(_0x2060cc[_0x070e('0x10')](0x1f4,_0x26373b['message']));});});};
\ No newline at end of file
+var _0x8b7c=['debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x3e235d,_0x4ec78a){var _0x3bfa12=function(_0x7f9c34){while(--_0x7f9c34){_0x3e235d['push'](_0x3e235d['shift']());}};_0x3bfa12(++_0x4ec78a);}(_0x8b7c,0x119));var _0xc8b7=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0x8b7c[_0x5b87ce];return _0x597aa7;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var moment=require(_0xc8b7('0x2'));var BPromise=require(_0xc8b7('0x3'));var rs=require(_0xc8b7('0x4'));var fs=require('fs');var Redis=require(_0xc8b7('0x5'));var db=require(_0xc8b7('0x6'))['db'];var utils=require(_0xc8b7('0x7'));var logger=require('../../config/logger')(_0xc8b7('0x8'));var config=require(_0xc8b7('0x9'));var jayson=require(_0xc8b7('0xa'));var client=jayson['client'][_0xc8b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x90cb38,_0x42d65e,_0x2c7807){return new BPromise(function(_0x9e4763,_0x2f149d){return client['request'](_0x90cb38,_0x2c7807)[_0xc8b7('0xc')](function(_0x504550){logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,_0xc8b7('0xf'));logger[_0xc8b7('0x10')](_0xc8b7('0x11'),_0x42d65e,'request\x20sent',JSON['stringify'](_0x504550));if(_0x504550['error']){if(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x13')]===0x1f4){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error']['message']);return _0x2f149d(_0x504550['error'][_0xc8b7('0x14')]);}logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error'][_0xc8b7('0x14')]);return _0x9e4763(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x14')]);}else{logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,'request\x20sent');_0x9e4763(_0x504550[_0xc8b7('0x15')][_0xc8b7('0x14')]);}})[_0xc8b7('0x16')](function(_0x3323de){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x3323de);_0x2f149d(_0x3323de);});});}exports[_0xc8b7('0x17')]=function(_0x485415){var _0x5ae36a=this;return new Promise(function(_0x1cf47c,_0x403659){return db[_0xc8b7('0x18')]['findAll']({'raw':_0x485415['options']?_0x485415[_0xc8b7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1a')]||null:null,'attributes':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1b')]||null:null,'limit':_0x485415['options']?_0x485415[_0xc8b7('0x19')][_0xc8b7('0x1c')]||null:null,'include':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1d')]?_[_0xc8b7('0x1e')](_0x485415[_0xc8b7('0x19')]['include'],function(_0x3b0e47){return{'model':db[_0x3b0e47[_0xc8b7('0x1f')]],'as':_0x3b0e47['as'],'attributes':_0x3b0e47[_0xc8b7('0x1b')],'include':_0x3b0e47[_0xc8b7('0x1d')]?_[_0xc8b7('0x1e')](_0x3b0e47[_0xc8b7('0x1d')],function(_0x2acda2){return{'model':db[_0x2acda2[_0xc8b7('0x1f')]],'as':_0x2acda2['as'],'attributes':_0x2acda2[_0xc8b7('0x1b')],'include':_0x2acda2[_0xc8b7('0x1d')]?_[_0xc8b7('0x1e')](_0x2acda2['include'],function(_0x28e65d){return{'model':db[_0x28e65d[_0xc8b7('0x1f')]],'as':_0x28e65d['as'],'attributes':_0x28e65d[_0xc8b7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc8b7('0xc')](function(_0x2046f5){logger[_0xc8b7('0xd')]('GetCampaign',_0x485415);logger['debug'](_0xc8b7('0x17'),_0x485415,JSON[_0xc8b7('0x20')](_0x2046f5));_0x1cf47c(_0x2046f5);})[_0xc8b7('0x16')](function(_0x2a2b25){logger[_0xc8b7('0x12')](_0xc8b7('0x17'),_0x2a2b25[_0xc8b7('0x14')],_0x485415);_0x403659(_0x5ae36a['error'](0x1f4,_0x2a2b25[_0xc8b7('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index b19d9f2..d93cc9b 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 _0xff94=['addLists','put','update','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','/:id/hoppers','getHoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x3e16c0,_0x4fcb17){var _0x2abad6=function(_0x50c82d){while(--_0x50c82d){_0x3e16c0['push'](_0x3e16c0['shift']());}};_0x2abad6(++_0x4fcb17);}(_0xff94,0x130));var _0x4ff9=function(_0xf1e5da,_0x3ecd47){_0xf1e5da=_0xf1e5da-0x0;var _0x331120=_0xff94[_0xf1e5da];return _0x331120;};'use strict';var multer=require(_0x4ff9('0x0'));var util=require(_0x4ff9('0x1'));var path=require(_0x4ff9('0x2'));var timeout=require(_0x4ff9('0x3'));var express=require(_0x4ff9('0x4'));var router=express[_0x4ff9('0x5')]();var fs_extra=require(_0x4ff9('0x6'));var auth=require(_0x4ff9('0x7'));var interaction=require(_0x4ff9('0x8'));var config=require(_0x4ff9('0x9'));var controller=require(_0x4ff9('0xa'));router[_0x4ff9('0xb')]('/',auth[_0x4ff9('0xc')](),controller['index']);router[_0x4ff9('0xb')](_0x4ff9('0xd'),auth[_0x4ff9('0xc')](),controller['show']);router[_0x4ff9('0xb')](_0x4ff9('0xe'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0xf')]);router[_0x4ff9('0xb')]('/:id/hopper_histories',auth[_0x4ff9('0xc')](),controller['getHopperHistories']);router[_0x4ff9('0xb')]('/:id/hopper_finals',auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x10')]);router[_0x4ff9('0xb')](_0x4ff9('0x11'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x12')]);router['get'](_0x4ff9('0x13'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x14')]);router[_0x4ff9('0xb')](_0x4ff9('0x15'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x16')]);router[_0x4ff9('0x17')]('/',auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x18')]);router['post'](_0x4ff9('0x19'),auth[_0x4ff9('0xc')](),controller['clone']);router[_0x4ff9('0x17')](_0x4ff9('0x13'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1a')]);router['post'](_0x4ff9('0x15'),auth[_0x4ff9('0xc')](),controller['addBlackLists']);router[_0x4ff9('0x1b')](_0x4ff9('0xd'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1c')]);router['delete'](_0x4ff9('0xd'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1d')]);router[_0x4ff9('0x1e')](_0x4ff9('0x13'),auth[_0x4ff9('0xc')](),controller['removeLists']);router[_0x4ff9('0x1e')](_0x4ff9('0x15'),auth[_0x4ff9('0xc')](),controller[_0x4ff9('0x1f')]);module[_0x4ff9('0x20')]=router;
\ No newline at end of file
+var _0x303a=['/:id/hoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id'];(function(_0x30f78d,_0x41a626){var _0x70a7dd=function(_0x563da5){while(--_0x563da5){_0x30f78d['push'](_0x30f78d['shift']());}};_0x70a7dd(++_0x41a626);}(_0x303a,0x1a0));var _0xa303=function(_0x5e2a0f,_0x447ab4){_0x5e2a0f=_0x5e2a0f-0x0;var _0x3e8c10=_0x303a[_0x5e2a0f];return _0x3e8c10;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller['getHoppers']);router[_0xa303('0x9')]('/:id/hopper_histories',auth[_0xa303('0xa')](),controller['getHopperHistories']);router[_0xa303('0x9')](_0xa303('0xe'),auth[_0xa303('0xa')](),controller[_0xa303('0xf')]);router['get'](_0xa303('0x10'),auth['isAuthenticated'](),controller[_0xa303('0x11')]);router[_0xa303('0x9')](_0xa303('0x12'),auth['isAuthenticated'](),controller[_0xa303('0x13')]);router[_0xa303('0x9')](_0xa303('0x14'),auth[_0xa303('0xa')](),controller[_0xa303('0x15')]);router[_0xa303('0x16')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0x17')]);router['post'](_0xa303('0x18'),auth[_0xa303('0xa')](),controller[_0xa303('0x19')]);router[_0xa303('0x16')](_0xa303('0x12'),auth[_0xa303('0xa')](),controller['addLists']);router[_0xa303('0x16')]('/:id/blacklists',auth[_0xa303('0xa')](),controller['addBlackLists']);router[_0xa303('0x1a')]('/:id',auth[_0xa303('0xa')](),controller[_0xa303('0x1b')]);router[_0xa303('0x1c')]('/:id',auth[_0xa303('0xa')](),controller[_0xa303('0x1d')]);router[_0xa303('0x1c')]('/:id/lists',auth[_0xa303('0xa')](),controller[_0xa303('0x1e')]);router[_0xa303('0x1c')](_0xa303('0x14'),auth['isAuthenticated'](),controller[_0xa303('0x1f')]);module[_0xa303('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ddeac35..9fc812b 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 _0x6f06=['sequelize','STRING'];(function(_0x5e32f3,_0x3386c1){var _0x4d4e03=function(_0xe86f5){while(--_0xe86f5){_0x5e32f3['push'](_0x5e32f3['shift']());}};_0x4d4e03(++_0x3386c1);}(_0x6f06,0x1b2));var _0x66f0=function(_0x7342e,_0x1c3fe7){_0x7342e=_0x7342e-0x0;var _0x524ece=_0x6f06[_0x7342e];return _0x524ece;};'use strict';var Sequelize=require(_0x66f0('0x0'));module['exports']={'key':{'type':Sequelize[_0x66f0('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x66f0('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x185a=['STRING','TEXT','medium','getDataValue','sequelize','exports'];(function(_0x14e1cb,_0xd3465e){var _0x18a337=function(_0x3b97f3){while(--_0x3b97f3){_0x14e1cb['push'](_0x14e1cb['shift']());}};_0x18a337(++_0xd3465e);}(_0x185a,0x1ae));var _0xa185=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x185a[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xa185('0x0'));module[_0xa185('0x1')]={'key':{'type':Sequelize[_0xa185('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa185('0x3')],'length':_0xa185('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xa185('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa185('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 849e275..775a24e 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 _0x69f7=['eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0x5272e0,_0x169ce5){var _0xa4fc96=function(_0x4f359a){while(--_0x4f359a){_0x5272e0['push'](_0x5272e0['shift']());}};_0xa4fc96(++_0x169ce5);}(_0x69f7,0x10b));var _0x769f=function(_0x2b5520,_0x2d77b4){_0x2b5520=_0x2b5520-0x0;var _0x5873db=_0x69f7[_0x2b5520];return _0x5873db;};'use strict';var emlformat=require(_0x769f('0x0'));var rimraf=require(_0x769f('0x1'));var zipdir=require(_0x769f('0x2'));var jsonpatch=require(_0x769f('0x3'));var rp=require('request-promise');var moment=require(_0x769f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x769f('0x5'));var util=require(_0x769f('0x6'));var path=require(_0x769f('0x7'));var sox=require(_0x769f('0x8'));var csv=require('to-csv');var ejs=require(_0x769f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x769f('0xa'));var crypto=require(_0x769f('0xb'));var jsforce=require(_0x769f('0xc'));var deskjs=require(_0x769f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x769f('0xe'));var Papa=require(_0x769f('0xf'));var Redis=require(_0x769f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x769f('0x11'));var as=require(_0x769f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x769f('0x13'))(_0x769f('0x14'));var utils=require(_0x769f('0x15'));var config=require(_0x769f('0x16'));var licenseUtil=require(_0x769f('0x17'));var db=require(_0x769f('0x18'))['db'];function respondWithStatusCode(_0x31e7b8,_0x41c336){_0x41c336=_0x41c336||0xcc;return function(_0x4145cd){if(_0x4145cd){return _0x31e7b8[_0x769f('0x19')](_0x41c336);}return _0x31e7b8['status'](_0x41c336)[_0x769f('0x1a')]();};}function respondWithResult(_0x4a4f09,_0x5e4857){_0x5e4857=_0x5e4857||0xc8;return function(_0x12aa50){if(_0x12aa50){return _0x4a4f09[_0x769f('0x1b')](_0x5e4857)['json'](_0x12aa50);}};}function respondWithFilteredResult(_0x3d3279,_0x26ea7c){return function(_0x40074c){if(_0x40074c){var _0x45ba69=typeof _0x26ea7c['offset']===_0x769f('0x1c')&&typeof _0x26ea7c[_0x769f('0x1d')]==='undefined';var _0x2fc324=_0x40074c[_0x769f('0x1e')];var _0x49dacb=_0x45ba69?0x0:_0x26ea7c['offset'];var _0x47d7fd=_0x45ba69?_0x40074c[_0x769f('0x1e')]:_0x26ea7c[_0x769f('0x1f')]+_0x26ea7c[_0x769f('0x1d')];var _0x4a1b81;if(_0x47d7fd>=_0x2fc324){_0x47d7fd=_0x2fc324;_0x4a1b81=0xc8;}else{_0x4a1b81=0xce;}_0x3d3279['status'](_0x4a1b81);return _0x3d3279[_0x769f('0x20')](_0x769f('0x21'),_0x49dacb+'-'+_0x47d7fd+'/'+_0x2fc324)['json'](_0x40074c);}return null;};}function patchUpdates(_0x47e6a6){return function(_0x9ebcdd){try{jsonpatch[_0x769f('0x22')](_0x9ebcdd,_0x47e6a6,!![]);}catch(_0x74a59f){return BPromise['reject'](_0x74a59f);}return _0x9ebcdd['save']();};}function saveUpdates(_0x372dc7,_0x1d30eb){return function(_0x5f2197){if(_0x5f2197){return _0x5f2197[_0x769f('0x23')](_0x372dc7)['then'](function(_0x2bae5e){return _0x2bae5e;});}return null;};}function removeEntity(_0x427d26,_0x37592a){return function(_0x47774e){if(_0x47774e){return _0x47774e[_0x769f('0x24')]()[_0x769f('0x25')](function(){var _0x35a90d=_0x47774e[_0x769f('0x26')]({'plain':!![]});var _0x323f6c=_0x769f('0x27');return db[_0x769f('0x28')][_0x769f('0x24')]({'where':{'type':_0x323f6c,'resourceId':_0x35a90d['id']}})[_0x769f('0x25')](function(){return _0x47774e;});})[_0x769f('0x25')](function(){_0x427d26[_0x769f('0x1b')](0xcc)[_0x769f('0x1a')]();});}};}function handleEntityNotFound(_0x5c7b46,_0x3f056){return function(_0x33bb7c){if(!_0x33bb7c){_0x5c7b46[_0x769f('0x19')](0x194);}return _0x33bb7c;};}function handleError(_0x1610fa,_0x36ee61){_0x36ee61=_0x36ee61||0x1f4;return function(_0x35040a){logger['error'](_0x35040a[_0x769f('0x29')]);if(_0x35040a[_0x769f('0x2a')]){delete _0x35040a[_0x769f('0x2a')];}_0x1610fa[_0x769f('0x1b')](_0x36ee61)[_0x769f('0x2b')](_0x35040a);};}exports[_0x769f('0x2c')]=function(_0x5107d3,_0x5d831c){var _0x46fded={},_0x10dbaa={},_0x5c677b={'count':0x0,'rows':[]};var _0x3c1384=_[_0x769f('0x2d')](db[_0x769f('0x2e')][_0x769f('0x2f')],function(_0x35d7fb){return{'name':_0x35d7fb['fieldName'],'type':_0x35d7fb[_0x769f('0x30')][_0x769f('0x31')]};});_0x10dbaa['model']=_[_0x769f('0x2d')](_0x3c1384,_0x769f('0x2a'));_0x10dbaa['query']=_[_0x769f('0x32')](_0x5107d3[_0x769f('0x33')]);_0x10dbaa['filters']=_['intersection'](_0x10dbaa[_0x769f('0x34')],_0x10dbaa[_0x769f('0x33')]);_0x46fded[_0x769f('0x35')]=_[_0x769f('0x36')](_0x10dbaa[_0x769f('0x34')],qs[_0x769f('0x37')](_0x5107d3['query']['fields']));_0x46fded[_0x769f('0x35')]=_0x46fded['attributes'][_0x769f('0x38')]?_0x46fded[_0x769f('0x35')]:_0x10dbaa[_0x769f('0x34')];if(!_0x5107d3['query'][_0x769f('0x39')]('nolimit')){_0x46fded[_0x769f('0x1d')]=qs['limit'](_0x5107d3[_0x769f('0x33')][_0x769f('0x1d')]);_0x46fded['offset']=qs[_0x769f('0x1f')](_0x5107d3[_0x769f('0x33')][_0x769f('0x1f')]);}_0x46fded[_0x769f('0x3a')]=qs['sort'](_0x5107d3[_0x769f('0x33')][_0x769f('0x3b')]);_0x46fded[_0x769f('0x3c')]=qs[_0x769f('0x3d')](_['pick'](_0x5107d3[_0x769f('0x33')],_0x10dbaa[_0x769f('0x3d')]),_0x3c1384);if(_0x5107d3[_0x769f('0x33')][_0x769f('0x3e')]){_0x46fded[_0x769f('0x3c')]=_[_0x769f('0x3f')](_0x46fded['where'],{'$or':[{'key':{'$like':'%'+_0x5107d3[_0x769f('0x33')][_0x769f('0x3e')]+'%'}},{'value':{'$like':'%'+_0x5107d3[_0x769f('0x33')]['filter']+'%'}}]});}_0x46fded=_[_0x769f('0x3f')]({},_0x46fded,_0x5107d3['options']);var _0x5f6251={'where':_0x46fded[_0x769f('0x3c')]};return db[_0x769f('0x2e')]['count'](_0x5f6251)[_0x769f('0x25')](function(_0x3792ec){_0x5c677b[_0x769f('0x1e')]=_0x3792ec;if(_0x5107d3[_0x769f('0x33')][_0x769f('0x40')]){_0x46fded[_0x769f('0x41')]=[{'all':!![]}];}return db[_0x769f('0x2e')][_0x769f('0x42')](_0x46fded);})['then'](function(_0x4f8a5b){_0x5c677b[_0x769f('0x43')]=_0x4f8a5b;return _0x5c677b;})[_0x769f('0x25')](respondWithFilteredResult(_0x5d831c,_0x46fded))[_0x769f('0x44')](handleError(_0x5d831c,null));};exports[_0x769f('0x45')]=function(_0x593712,_0x5a7822){var _0x43af02={'raw':!![],'where':{'id':_0x593712[_0x769f('0x46')]['id']}},_0x57d17e={};_0x57d17e[_0x769f('0x34')]=_['keys'](db[_0x769f('0x2e')][_0x769f('0x2f')]);_0x57d17e['query']=_[_0x769f('0x32')](_0x593712['query']);_0x57d17e[_0x769f('0x3d')]=_[_0x769f('0x36')](_0x57d17e[_0x769f('0x34')],_0x57d17e[_0x769f('0x33')]);_0x43af02[_0x769f('0x35')]=_[_0x769f('0x36')](_0x57d17e[_0x769f('0x34')],qs[_0x769f('0x37')](_0x593712[_0x769f('0x33')][_0x769f('0x37')]));_0x43af02['attributes']=_0x43af02['attributes']['length']?_0x43af02[_0x769f('0x35')]:_0x57d17e[_0x769f('0x34')];if(_0x593712[_0x769f('0x33')][_0x769f('0x40')]){_0x43af02[_0x769f('0x41')]=[{'all':!![]}];}_0x43af02=_[_0x769f('0x3f')]({},_0x43af02,_0x593712[_0x769f('0x47')]);return db[_0x769f('0x2e')][_0x769f('0x48')](_0x43af02)[_0x769f('0x25')](handleEntityNotFound(_0x5a7822,null))['then'](respondWithResult(_0x5a7822,null))['catch'](handleError(_0x5a7822,null));};exports[_0x769f('0x23')]=function(_0x5e35f9,_0x4b3fe6){if(_0x5e35f9[_0x769f('0x49')]['id']){delete _0x5e35f9[_0x769f('0x49')]['id'];}return db[_0x769f('0x2e')][_0x769f('0x48')]({'where':{'id':_0x5e35f9[_0x769f('0x46')]['id']}})[_0x769f('0x25')](handleEntityNotFound(_0x4b3fe6,null))[_0x769f('0x25')](saveUpdates(_0x5e35f9[_0x769f('0x49')],null))[_0x769f('0x25')](respondWithResult(_0x4b3fe6,null))[_0x769f('0x44')](handleError(_0x4b3fe6,null));};exports[_0x769f('0x24')]=function(_0x171240,_0xf411f0){return db[_0x769f('0x2e')][_0x769f('0x48')]({'where':{'id':_0x171240[_0x769f('0x46')]['id']}})[_0x769f('0x25')](handleEntityNotFound(_0xf411f0,null))[_0x769f('0x25')](removeEntity(_0xf411f0,null))[_0x769f('0x44')](handleError(_0xf411f0,null));};exports[_0x769f('0x4a')]=function(_0x36cb80,_0xf80bba){var _0x53ab9a={'key':_0x36cb80[_0x769f('0x49')][_0x769f('0x31')]};if(_0x36cb80[_0x769f('0x49')][_0x769f('0x4b')]){_0x53ab9a['MailAccountId']=_0x36cb80[_0x769f('0x49')][_0x769f('0x4b')];}else if(_0x36cb80[_0x769f('0x49')][_0x769f('0x4c')]){_0x53ab9a[_0x769f('0x4c')]=_0x36cb80[_0x769f('0x49')][_0x769f('0x4c')];}else if(_0x36cb80[_0x769f('0x49')][_0x769f('0x4d')]){_0x53ab9a['OpenchannelAccountId']=_0x36cb80[_0x769f('0x49')]['OpenchannelAccountId'];}else if(_0x36cb80[_0x769f('0x49')]['ChatWebsiteId']){_0x53ab9a[_0x769f('0x4e')]=_0x36cb80[_0x769f('0x49')]['ChatWebsiteId'];}return db[_0x769f('0x2e')][_0x769f('0x48')]({'where':_0x53ab9a})[_0x769f('0x25')](function(_0x377176){if(_0x377176){throw new db[(_0x769f('0x4f'))][(_0x769f('0x50'))](_0x769f('0x51'));}return db[_0x769f('0x2e')][_0x769f('0x4a')](_0x36cb80[_0x769f('0x49')]);})[_0x769f('0x25')](function(_0x1b1023){var _0x476a96=_0x36cb80['user'][_0x769f('0x26')]({'plain':!![]});if(!_0x476a96)throw new Error(_0x769f('0x52'));if(_0x476a96[_0x769f('0x53')]===_0x769f('0x54')){var _0x5f2487=_0x1b1023['get']({'plain':!![]});return db[_0x769f('0x55')][_0x769f('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x476a96[_0x769f('0x56')]},'raw':!![]})[_0x769f('0x25')](function(_0x6c3807){if(_0x6c3807&&_0x6c3807[_0x769f('0x57')]===0x0){return db[_0x769f('0x28')][_0x769f('0x4a')]({'name':_0x5f2487[_0x769f('0x2a')],'resourceId':_0x5f2487['id'],'type':_0x6c3807['name'],'sectionId':_0x6c3807['id']},{})[_0x769f('0x25')](function(){return _0x1b1023;});}else{return _0x1b1023;}})[_0x769f('0x44')](function(_0x36455c){logger[_0x769f('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36455c);throw _0x36455c;});}return _0x1b1023;})['then'](respondWithResult(_0xf80bba,0xc9))[_0x769f('0x44')](handleError(_0xf80bba,null));};
\ No newline at end of file
+var _0x1444=['merge','options','includeAll','rows','show','params','include','body','find','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','error','name','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter'];(function(_0x1fcca4,_0x4e1a61){var _0x3568a4=function(_0x187191){while(--_0x187191){_0x1fcca4['push'](_0x1fcca4['shift']());}};_0x3568a4(++_0x4e1a61);}(_0x1444,0x123));var _0x4144=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x1444[_0x1b4b23];return _0x2a325b;};'use strict';var emlformat=require(_0x4144('0x0'));var rimraf=require(_0x4144('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4144('0x2'));var rp=require(_0x4144('0x3'));var moment=require(_0x4144('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4144('0x5'));var util=require(_0x4144('0x6'));var path=require(_0x4144('0x7'));var sox=require(_0x4144('0x8'));var csv=require(_0x4144('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4144('0xa'));var _=require(_0x4144('0xb'));var squel=require(_0x4144('0xc'));var crypto=require(_0x4144('0xd'));var jsforce=require(_0x4144('0xe'));var deskjs=require(_0x4144('0xf'));var toCsv=require(_0x4144('0x9'));var querystring=require(_0x4144('0x10'));var Papa=require('papaparse');var Redis=require(_0x4144('0x11'));var authService=require(_0x4144('0x12'));var qs=require(_0x4144('0x13'));var as=require(_0x4144('0x14'));var hardwareService=require(_0x4144('0x15'));var logger=require(_0x4144('0x16'))(_0x4144('0x17'));var utils=require('../../config/utils');var config=require(_0x4144('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4144('0x19'))['db'];function respondWithStatusCode(_0x1637cc,_0x424853){_0x424853=_0x424853||0xcc;return function(_0x26f558){if(_0x26f558){return _0x1637cc[_0x4144('0x1a')](_0x424853);}return _0x1637cc['status'](_0x424853)[_0x4144('0x1b')]();};}function respondWithResult(_0x500b98,_0x506f71){_0x506f71=_0x506f71||0xc8;return function(_0x11927d){if(_0x11927d){return _0x500b98[_0x4144('0x1c')](_0x506f71)[_0x4144('0x1d')](_0x11927d);}};}function respondWithFilteredResult(_0x54aad2,_0x47f568){return function(_0x119ddf){if(_0x119ddf){var _0x1486a3=typeof _0x47f568[_0x4144('0x1e')]===_0x4144('0x1f')&&typeof _0x47f568['limit']===_0x4144('0x1f');var _0x4fbb9e=_0x119ddf[_0x4144('0x20')];var _0x289b9d=_0x1486a3?0x0:_0x47f568['offset'];var _0x11a9e7=_0x1486a3?_0x119ddf[_0x4144('0x20')]:_0x47f568[_0x4144('0x1e')]+_0x47f568[_0x4144('0x21')];var _0x4e3cc4;if(_0x11a9e7>=_0x4fbb9e){_0x11a9e7=_0x4fbb9e;_0x4e3cc4=0xc8;}else{_0x4e3cc4=0xce;}_0x54aad2[_0x4144('0x1c')](_0x4e3cc4);return _0x54aad2[_0x4144('0x22')]('Content-Range',_0x289b9d+'-'+_0x11a9e7+'/'+_0x4fbb9e)[_0x4144('0x1d')](_0x119ddf);}return null;};}function patchUpdates(_0x4222f1){return function(_0x16e83f){try{jsonpatch[_0x4144('0x23')](_0x16e83f,_0x4222f1,!![]);}catch(_0x1b9f18){return BPromise[_0x4144('0x24')](_0x1b9f18);}return _0x16e83f[_0x4144('0x25')]();};}function saveUpdates(_0x1170ea,_0x22ee17){return function(_0x4b3efc){if(_0x4b3efc){return _0x4b3efc[_0x4144('0x26')](_0x1170ea)[_0x4144('0x27')](function(_0x383af2){return _0x383af2;});}return null;};}function removeEntity(_0x22a89e,_0x38dffb){return function(_0x575a8f){if(_0x575a8f){return _0x575a8f[_0x4144('0x28')]()[_0x4144('0x27')](function(){var _0x53ef19=_0x575a8f['get']({'plain':!![]});var _0x3f13c7=_0x4144('0x29');return db[_0x4144('0x2a')]['destroy']({'where':{'type':_0x3f13c7,'resourceId':_0x53ef19['id']}})[_0x4144('0x27')](function(){return _0x575a8f;});})['then'](function(){_0x22a89e[_0x4144('0x1c')](0xcc)[_0x4144('0x1b')]();});}};}function handleEntityNotFound(_0x58773a,_0x49e142){return function(_0x1162fb){if(!_0x1162fb){_0x58773a[_0x4144('0x1a')](0x194);}return _0x1162fb;};}function handleError(_0x3a40e4,_0xdfe3e4){_0xdfe3e4=_0xdfe3e4||0x1f4;return function(_0x2c63e6){logger[_0x4144('0x2b')](_0x2c63e6['stack']);if(_0x2c63e6['name']){delete _0x2c63e6[_0x4144('0x2c')];}_0x3a40e4['status'](_0xdfe3e4)['send'](_0x2c63e6);};}exports['index']=function(_0x3dda7f,_0x5b14cf){var _0x4a480c={},_0x18a9f3={},_0x4d15f9={'count':0x0,'rows':[]};var _0x534c99=_[_0x4144('0x2d')](db[_0x4144('0x2e')][_0x4144('0x2f')],function(_0x5331ab){return{'name':_0x5331ab[_0x4144('0x30')],'type':_0x5331ab[_0x4144('0x31')][_0x4144('0x32')]};});_0x18a9f3['model']=_['map'](_0x534c99,_0x4144('0x2c'));_0x18a9f3[_0x4144('0x33')]=_[_0x4144('0x34')](_0x3dda7f[_0x4144('0x33')]);_0x18a9f3['filters']=_[_0x4144('0x35')](_0x18a9f3[_0x4144('0x36')],_0x18a9f3[_0x4144('0x33')]);_0x4a480c[_0x4144('0x37')]=_[_0x4144('0x35')](_0x18a9f3[_0x4144('0x36')],qs[_0x4144('0x38')](_0x3dda7f[_0x4144('0x33')]['fields']));_0x4a480c[_0x4144('0x37')]=_0x4a480c[_0x4144('0x37')][_0x4144('0x39')]?_0x4a480c['attributes']:_0x18a9f3[_0x4144('0x36')];if(!_0x3dda7f['query'][_0x4144('0x3a')](_0x4144('0x3b'))){_0x4a480c[_0x4144('0x21')]=qs[_0x4144('0x21')](_0x3dda7f[_0x4144('0x33')][_0x4144('0x21')]);_0x4a480c[_0x4144('0x1e')]=qs[_0x4144('0x1e')](_0x3dda7f[_0x4144('0x33')][_0x4144('0x1e')]);}_0x4a480c[_0x4144('0x3c')]=qs[_0x4144('0x3d')](_0x3dda7f['query']['sort']);_0x4a480c[_0x4144('0x3e')]=qs[_0x4144('0x3f')](_['pick'](_0x3dda7f[_0x4144('0x33')],_0x18a9f3[_0x4144('0x3f')]),_0x534c99);if(_0x3dda7f['query']['filter']){_0x4a480c[_0x4144('0x3e')]=_['merge'](_0x4a480c[_0x4144('0x3e')],{'$or':[{'key':{'$like':'%'+_0x3dda7f['query'][_0x4144('0x40')]+'%'}},{'value':{'$like':'%'+_0x3dda7f['query'][_0x4144('0x40')]+'%'}}]});}_0x4a480c=_[_0x4144('0x41')]({},_0x4a480c,_0x3dda7f[_0x4144('0x42')]);var _0x4103c3={'where':_0x4a480c[_0x4144('0x3e')]};return db[_0x4144('0x2e')][_0x4144('0x20')](_0x4103c3)[_0x4144('0x27')](function(_0x2156e9){_0x4d15f9[_0x4144('0x20')]=_0x2156e9;if(_0x3dda7f[_0x4144('0x33')][_0x4144('0x43')]){_0x4a480c['include']=[{'all':!![]}];}return db[_0x4144('0x2e')]['findAll'](_0x4a480c);})[_0x4144('0x27')](function(_0x4b9d05){_0x4d15f9[_0x4144('0x44')]=_0x4b9d05;return _0x4d15f9;})[_0x4144('0x27')](respondWithFilteredResult(_0x5b14cf,_0x4a480c))['catch'](handleError(_0x5b14cf,null));};exports[_0x4144('0x45')]=function(_0x35d89c,_0x586ff6){var _0x20226d={'raw':!![],'where':{'id':_0x35d89c[_0x4144('0x46')]['id']}},_0x245d5b={};_0x245d5b[_0x4144('0x36')]=_[_0x4144('0x34')](db[_0x4144('0x2e')][_0x4144('0x2f')]);_0x245d5b[_0x4144('0x33')]=_[_0x4144('0x34')](_0x35d89c['query']);_0x245d5b[_0x4144('0x3f')]=_[_0x4144('0x35')](_0x245d5b[_0x4144('0x36')],_0x245d5b[_0x4144('0x33')]);_0x20226d['attributes']=_[_0x4144('0x35')](_0x245d5b[_0x4144('0x36')],qs['fields'](_0x35d89c[_0x4144('0x33')][_0x4144('0x38')]));_0x20226d[_0x4144('0x37')]=_0x20226d['attributes']['length']?_0x20226d['attributes']:_0x245d5b[_0x4144('0x36')];if(_0x35d89c['query'][_0x4144('0x43')]){_0x20226d[_0x4144('0x47')]=[{'all':!![]}];}_0x20226d=_['merge']({},_0x20226d,_0x35d89c[_0x4144('0x42')]);return db['CannedAnswer']['find'](_0x20226d)[_0x4144('0x27')](handleEntityNotFound(_0x586ff6,null))[_0x4144('0x27')](respondWithResult(_0x586ff6,null))['catch'](handleError(_0x586ff6,null));};exports['update']=function(_0x17ed3d,_0x1eddbc){if(_0x17ed3d['body']['id']){delete _0x17ed3d[_0x4144('0x48')]['id'];}return db[_0x4144('0x2e')][_0x4144('0x49')]({'where':{'id':_0x17ed3d[_0x4144('0x46')]['id']}})[_0x4144('0x27')](handleEntityNotFound(_0x1eddbc,null))[_0x4144('0x27')](saveUpdates(_0x17ed3d[_0x4144('0x48')],null))[_0x4144('0x27')](respondWithResult(_0x1eddbc,null))[_0x4144('0x4a')](handleError(_0x1eddbc,null));};exports[_0x4144('0x28')]=function(_0xadd6d,_0x36040e){return db[_0x4144('0x2e')][_0x4144('0x49')]({'where':{'id':_0xadd6d['params']['id']}})['then'](handleEntityNotFound(_0x36040e,null))[_0x4144('0x27')](removeEntity(_0x36040e,null))[_0x4144('0x4a')](handleError(_0x36040e,null));};exports[_0x4144('0x4b')]=function(_0x2e0eb5,_0x394b40){var _0x9d5ee9={'key':_0x2e0eb5['body'][_0x4144('0x32')]};if(_0x2e0eb5['body']['MailAccountId']){_0x9d5ee9[_0x4144('0x4c')]=_0x2e0eb5[_0x4144('0x48')][_0x4144('0x4c')];}else if(_0x2e0eb5[_0x4144('0x48')][_0x4144('0x4d')]){_0x9d5ee9[_0x4144('0x4d')]=_0x2e0eb5[_0x4144('0x48')][_0x4144('0x4d')];}else if(_0x2e0eb5[_0x4144('0x48')][_0x4144('0x4e')]){_0x9d5ee9['OpenchannelAccountId']=_0x2e0eb5[_0x4144('0x48')][_0x4144('0x4e')];}else if(_0x2e0eb5[_0x4144('0x48')][_0x4144('0x4f')]){_0x9d5ee9[_0x4144('0x4f')]=_0x2e0eb5[_0x4144('0x48')][_0x4144('0x4f')];}return db[_0x4144('0x2e')][_0x4144('0x49')]({'where':_0x9d5ee9})[_0x4144('0x27')](function(_0x2f58f3){if(_0x2f58f3){throw new db['Sequelize']['ValidationError'](_0x4144('0x50'));}return db[_0x4144('0x2e')][_0x4144('0x4b')](_0x2e0eb5['body']);})['then'](function(_0x1ad4bb){var _0x15fb25=_0x2e0eb5['user']['get']({'plain':!![]});if(!_0x15fb25)throw new Error(_0x4144('0x51'));if(_0x15fb25[_0x4144('0x52')]===_0x4144('0x53')){var _0x1a1c7f=_0x1ad4bb[_0x4144('0x54')]({'plain':!![]});return db[_0x4144('0x55')][_0x4144('0x49')]({'where':{'name':_0x4144('0x29'),'userProfileId':_0x15fb25[_0x4144('0x56')]},'raw':!![]})[_0x4144('0x27')](function(_0xbe6dc9){if(_0xbe6dc9&&_0xbe6dc9[_0x4144('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x1a1c7f[_0x4144('0x2c')],'resourceId':_0x1a1c7f['id'],'type':_0xbe6dc9[_0x4144('0x2c')],'sectionId':_0xbe6dc9['id']},{})[_0x4144('0x27')](function(){return _0x1ad4bb;});}else{return _0x1ad4bb;}})[_0x4144('0x4a')](function(_0x2a10a0){logger[_0x4144('0x2b')](_0x4144('0x58'),_0x2a10a0);throw _0x2a10a0;});}return _0x1ad4bb;})['then'](respondWithResult(_0x394b40,0xc9))[_0x4144('0x4a')](handleError(_0x394b40,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index d6e4200..8736492 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 _0x5e32=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise','path','rimraf','exports','define'];(function(_0x3a0228,_0x2725a6){var _0x5dc524=function(_0xc656fb){while(--_0xc656fb){_0x3a0228['push'](_0x3a0228['shift']());}};_0x5dc524(++_0x2725a6);}(_0x5e32,0x17f));var _0x25e3=function(_0xc0e2c4,_0xa4c81e){_0xc0e2c4=_0xc0e2c4-0x0;var _0x3e378c=_0x5e32[_0xc0e2c4];return _0x3e378c;};'use strict';var _=require(_0x25e3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x25e3('0x1'));var BPromise=require('bluebird');var rp=require(_0x25e3('0x2'));var fs=require('fs');var path=require(_0x25e3('0x3'));var rimraf=require(_0x25e3('0x4'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x25e3('0x5')]=function(_0x874d86,_0x4bc3e0){return _0x874d86[_0x25e3('0x6')](_0x25e3('0x7'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x25e3('0x8'),'collate':_0x25e3('0x9')});};
\ No newline at end of file
+var _0x2b80=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CannedAnswer'];(function(_0x38f6a6,_0x1ffef2){var _0x210267=function(_0x40122e){while(--_0x40122e){_0x38f6a6['push'](_0x38f6a6['shift']());}};_0x210267(++_0x1ffef2);}(_0x2b80,0x139));var _0x02b8=function(_0x3abc9f,_0x49440e){_0x3abc9f=_0x3abc9f-0x0;var _0x486bc4=_0x2b80[_0x3abc9f];return _0x486bc4;};'use strict';var _=require('lodash');var util=require(_0x02b8('0x0'));var logger=require(_0x02b8('0x1'))(_0x02b8('0x2'));var moment=require(_0x02b8('0x3'));var BPromise=require(_0x02b8('0x4'));var rp=require(_0x02b8('0x5'));var fs=require('fs');var path=require(_0x02b8('0x6'));var rimraf=require(_0x02b8('0x7'));var config=require(_0x02b8('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x02b8('0x9')]=function(_0x363531,_0x3949b8){return _0x363531['define'](_0x02b8('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x02b8('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 834b904..3270bc6 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(_0x4ca0fe,_0x15679a){var _0x55fd76=function(_0x4ffb61){while(--_0x4ffb61){_0x4ca0fe['push'](_0x4ca0fe['shift']());}};_0x55fd76(++_0x15679a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x597b07,_0x3586d4){var _0x515abd=function(_0x313916){while(--_0x313916){_0x597b07['push'](_0x597b07['shift']());}};_0x515abd(++_0x3586d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index c2451b6..e3c7148 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 _0x392b=['./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x392b,0xdc));var _0xb392=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x392b[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xb392('0x0'));var util=require('util');var path=require(_0xb392('0x1'));var timeout=require(_0xb392('0x2'));var express=require(_0xb392('0x3'));var router=express[_0xb392('0x4')]();var fs_extra=require(_0xb392('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb392('0x6'));var config=require(_0xb392('0x7'));var controller=require(_0xb392('0x8'));router[_0xb392('0x9')]('/',auth[_0xb392('0xa')](),controller['index']);router['get'](_0xb392('0xb'),auth['isAuthenticated'](),controller[_0xb392('0xc')]);router[_0xb392('0xd')]('/',auth[_0xb392('0xa')](),controller[_0xb392('0xe')]);router['put'](_0xb392('0xb'),auth[_0xb392('0xa')](),controller[_0xb392('0xf')]);router[_0xb392('0x10')](_0xb392('0xb'),auth[_0xb392('0xa')](),controller[_0xb392('0x11')]);module[_0xb392('0x12')]=router;
\ No newline at end of file
+var _0xb51b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','path','express'];(function(_0x2a71d2,_0x35bcda){var _0x200112=function(_0x40735f){while(--_0x40735f){_0x2a71d2['push'](_0x2a71d2['shift']());}};_0x200112(++_0x35bcda);}(_0xb51b,0x1be));var _0xbb51=function(_0x452856,_0x4b73e2){_0x452856=_0x452856-0x0;var _0x340ecc=_0xb51b[_0x452856];return _0x340ecc;};'use strict';var multer=require(_0xbb51('0x0'));var util=require(_0xbb51('0x1'));var path=require(_0xbb51('0x2'));var timeout=require('connect-timeout');var express=require(_0xbb51('0x3'));var router=express[_0xbb51('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb51('0x5'));var interaction=require(_0xbb51('0x6'));var config=require(_0xbb51('0x7'));var controller=require('./cannedAnswer.controller');router[_0xbb51('0x8')]('/',auth[_0xbb51('0x9')](),controller[_0xbb51('0xa')]);router[_0xbb51('0x8')](_0xbb51('0xb'),auth[_0xbb51('0x9')](),controller[_0xbb51('0xc')]);router[_0xbb51('0xd')]('/',auth[_0xbb51('0x9')](),controller[_0xbb51('0xe')]);router['put'](_0xbb51('0xb'),auth[_0xbb51('0x9')](),controller[_0xbb51('0xf')]);router[_0xbb51('0x10')](_0xbb51('0xb'),auth['isAuthenticated'](),controller[_0xbb51('0x11')]);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 84993b1..8fbc656 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 _0xde71=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xde71,0x1c1));var _0x1de7=function(_0x2ef8c1,_0x2f72f4){_0x2ef8c1=_0x2ef8c1-0x0;var _0x288305=_0xde71[_0x2ef8c1];return _0x288305;};'use strict';var Sequelize=require(_0x1de7('0x0'));module[_0x1de7('0x1')]={'calldate':{'type':Sequelize[_0x1de7('0x2')],'allowNull':![],'defaultValue':_0x1de7('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x1de7('0x4')]},'dst':{'type':Sequelize[_0x1de7('0x4')]},'dcontext':{'type':Sequelize[_0x1de7('0x4')]},'channel':{'type':Sequelize[_0x1de7('0x4')]},'dstchannel':{'type':Sequelize[_0x1de7('0x4')]},'lastapp':{'type':Sequelize[_0x1de7('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1de7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1de7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1de7('0x4')]},'amaflags':{'type':Sequelize[_0x1de7('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1de7('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x1de7('0x4')]},'sequence':{'type':Sequelize[_0x1de7('0x4')]},'peeraccount':{'type':Sequelize[_0x1de7('0x4')]},'type':{'type':Sequelize[_0x1de7('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xecf8=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0xecf8,0xd4));var _0x8ecf=function(_0xe7f95,_0x3699cf){_0xe7f95=_0xe7f95-0x0;var _0x245a31=_0xecf8[_0xe7f95];return _0x245a31;};'use strict';var Sequelize=require(_0x8ecf('0x0'));module[_0x8ecf('0x1')]={'calldate':{'type':Sequelize[_0x8ecf('0x2')],'allowNull':![],'defaultValue':_0x8ecf('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8ecf('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x8ecf('0x4')]},'channel':{'type':Sequelize[_0x8ecf('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x8ecf('0x4')]},'lastdata':{'type':Sequelize[_0x8ecf('0x4')]},'duration':{'type':Sequelize[_0x8ecf('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8ecf('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8ecf('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8ecf('0x4')]},'userfield':{'type':Sequelize[_0x8ecf('0x4')]},'uniqueid':{'type':Sequelize[_0x8ecf('0x4')]},'linkedid':{'type':Sequelize[_0x8ecf('0x4')]},'sequence':{'type':Sequelize[_0x8ecf('0x4')]},'peeraccount':{'type':Sequelize[_0x8ecf('0x4')]},'type':{'type':Sequelize[_0x8ecf('0x4')]},'tag':{'type':Sequelize[_0x8ecf('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 1a6838f..101a090 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 _0x0bde=['findAll','rows','create','body','catch','update','find','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bd('0x1'));var rp=require(_0xe0bd('0x2'));var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0bd('0x15'));var db=require(_0xe0bd('0x16'))['db'];function respondWithStatusCode(_0x54d40e,_0xc492b4){_0xc492b4=_0xc492b4||0xcc;return function(_0x5272ca){if(_0x5272ca){return _0x54d40e[_0xe0bd('0x17')](_0xc492b4);}return _0x54d40e[_0xe0bd('0x18')](_0xc492b4)[_0xe0bd('0x19')]();};}function respondWithResult(_0x20ab47,_0x47664e){_0x47664e=_0x47664e||0xc8;return function(_0x335f17){if(_0x335f17){return _0x20ab47[_0xe0bd('0x18')](_0x47664e)[_0xe0bd('0x1a')](_0x335f17);}};}function respondWithFilteredResult(_0x4f63fa,_0x50891d){return function(_0x4fb006){if(_0x4fb006){var _0x2ff887=typeof _0x50891d[_0xe0bd('0x1b')]===_0xe0bd('0x1c')&&typeof _0x50891d[_0xe0bd('0x1d')]===_0xe0bd('0x1c');var _0x55f304=_0x4fb006['count'];var _0x1becc8=_0x2ff887?0x0:_0x50891d['offset'];var _0x4f36f7=_0x2ff887?_0x4fb006[_0xe0bd('0x1e')]:_0x50891d[_0xe0bd('0x1b')]+_0x50891d[_0xe0bd('0x1d')];var _0x5f22e2;if(_0x4f36f7>=_0x55f304){_0x4f36f7=_0x55f304;_0x5f22e2=0xc8;}else{_0x5f22e2=0xce;}_0x4f63fa[_0xe0bd('0x18')](_0x5f22e2);return _0x4f63fa[_0xe0bd('0x1f')](_0xe0bd('0x20'),_0x1becc8+'-'+_0x4f36f7+'/'+_0x55f304)['json'](_0x4fb006);}return null;};}function patchUpdates(_0x1bf742){return function(_0x25f595){try{jsonpatch[_0xe0bd('0x21')](_0x25f595,_0x1bf742,!![]);}catch(_0x532584){return BPromise[_0xe0bd('0x22')](_0x532584);}return _0x25f595[_0xe0bd('0x23')]();};}function saveUpdates(_0x2b4f7d,_0x5378d2){return function(_0x1d6a19){if(_0x1d6a19){return _0x1d6a19['update'](_0x2b4f7d)[_0xe0bd('0x24')](function(_0x2bcfcc){return _0x2bcfcc;});}return null;};}function removeEntity(_0x4bcd48,_0xa4a4e9){return function(_0xf6d956){if(_0xf6d956){return _0xf6d956[_0xe0bd('0x25')]()[_0xe0bd('0x24')](function(){_0x4bcd48[_0xe0bd('0x18')](0xcc)[_0xe0bd('0x19')]();});}};}function handleEntityNotFound(_0x2096a2,_0x162356){return function(_0x537708){if(!_0x537708){_0x2096a2['sendStatus'](0x194);}return _0x537708;};}function handleError(_0x275f14,_0x39c98e){_0x39c98e=_0x39c98e||0x1f4;return function(_0x47d171){logger['error'](_0x47d171[_0xe0bd('0x26')]);if(_0x47d171[_0xe0bd('0x27')]){delete _0x47d171[_0xe0bd('0x27')];}_0x275f14[_0xe0bd('0x18')](_0x39c98e)['send'](_0x47d171);};}exports[_0xe0bd('0x28')]=function(_0x4ef39b,_0x9146fe){var _0x170874={},_0x42bea7={},_0x1b857c={'count':0x0,'rows':[]};var _0x1e2020=_[_0xe0bd('0x29')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')],function(_0x25d515){return{'name':_0x25d515[_0xe0bd('0x2c')],'type':_0x25d515[_0xe0bd('0x2d')][_0xe0bd('0x2e')]};});_0x42bea7[_0xe0bd('0x2f')]=_['map'](_0x1e2020,_0xe0bd('0x27'));_0x42bea7[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x4ef39b[_0xe0bd('0x30')]);_0x42bea7[_0xe0bd('0x32')]=_[_0xe0bd('0x33')](_0x42bea7['model'],_0x42bea7['query']);_0x170874[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x42bea7[_0xe0bd('0x2f')],qs[_0xe0bd('0x35')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x170874[_0xe0bd('0x34')]=_0x170874['attributes'][_0xe0bd('0x36')]?_0x170874[_0xe0bd('0x34')]:_0x42bea7[_0xe0bd('0x2f')];if(!_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x37')](_0xe0bd('0x38'))){_0x170874['limit']=qs[_0xe0bd('0x1d')](_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x1d')]);_0x170874[_0xe0bd('0x1b')]=qs[_0xe0bd('0x1b')](_0x4ef39b['query']['offset']);}_0x170874[_0xe0bd('0x39')]=qs[_0xe0bd('0x3a')](_0x4ef39b[_0xe0bd('0x30')]['sort']);_0x170874[_0xe0bd('0x3b')]=qs['filters'](_['pick'](_0x4ef39b[_0xe0bd('0x30')],_0x42bea7[_0xe0bd('0x32')]),_0x1e2020);if(_0x4ef39b['query']['filter']){_0x170874['where']=_[_0xe0bd('0x3c')](_0x170874[_0xe0bd('0x3b')],{'$or':_[_0xe0bd('0x29')](_0x1e2020,function(_0x5d2aff){if(_0x5d2aff[_0xe0bd('0x2d')]!==_0xe0bd('0x3d')){var _0x1e6823={};_0x1e6823[_0x5d2aff['name']]={'$like':'%'+_0x4ef39b['query'][_0xe0bd('0x3e')]+'%'};return _0x1e6823;}})});}_0x170874=_['merge']({},_0x170874,_0x4ef39b[_0xe0bd('0x3f')]);var _0x195f0f={'where':_0x170874['where']};return db[_0xe0bd('0x2a')][_0xe0bd('0x1e')](_0x195f0f)[_0xe0bd('0x24')](function(_0xb65059){_0x1b857c[_0xe0bd('0x1e')]=_0xb65059;if(_0x4ef39b[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x170874['include']=[{'all':!![]}];}return db[_0xe0bd('0x2a')][_0xe0bd('0x41')](_0x170874);})[_0xe0bd('0x24')](function(_0x3c138e){_0x1b857c[_0xe0bd('0x42')]=_0x3c138e;return _0x1b857c;})['then'](respondWithFilteredResult(_0x9146fe,_0x170874))['catch'](handleError(_0x9146fe,null));};exports['show']=function(_0x2b27b1,_0x1a121f){var _0x15de49={'raw':!![],'where':{'id':_0x2b27b1['params']['id']}},_0x32ed4f={};_0x32ed4f['model']=_[_0xe0bd('0x31')](db[_0xe0bd('0x2a')][_0xe0bd('0x2b')]);_0x32ed4f[_0xe0bd('0x30')]=_[_0xe0bd('0x31')](_0x2b27b1[_0xe0bd('0x30')]);_0x32ed4f[_0xe0bd('0x32')]=_['intersection'](_0x32ed4f[_0xe0bd('0x2f')],_0x32ed4f['query']);_0x15de49[_0xe0bd('0x34')]=_[_0xe0bd('0x33')](_0x32ed4f['model'],qs['fields'](_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x35')]));_0x15de49[_0xe0bd('0x34')]=_0x15de49[_0xe0bd('0x34')][_0xe0bd('0x36')]?_0x15de49[_0xe0bd('0x34')]:_0x32ed4f[_0xe0bd('0x2f')];if(_0x2b27b1[_0xe0bd('0x30')][_0xe0bd('0x40')]){_0x15de49['include']=[{'all':!![]}];}_0x15de49=_[_0xe0bd('0x3c')]({},_0x15de49,_0x2b27b1[_0xe0bd('0x3f')]);return db[_0xe0bd('0x2a')]['find'](_0x15de49)[_0xe0bd('0x24')](handleEntityNotFound(_0x1a121f,null))[_0xe0bd('0x24')](respondWithResult(_0x1a121f,null))['catch'](handleError(_0x1a121f,null));};exports[_0xe0bd('0x43')]=function(_0x136ac6,_0x578792){return db[_0xe0bd('0x2a')][_0xe0bd('0x43')](_0x136ac6[_0xe0bd('0x44')],{})['then'](respondWithResult(_0x578792,0xc9))[_0xe0bd('0x45')](handleError(_0x578792,null));};exports[_0xe0bd('0x46')]=function(_0x147438,_0x21ae20){if(_0x147438[_0xe0bd('0x44')]['id']){delete _0x147438[_0xe0bd('0x44')]['id'];}return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0x147438[_0xe0bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](saveUpdates(_0x147438['body'],null))[_0xe0bd('0x24')](respondWithResult(_0x21ae20,null))[_0xe0bd('0x45')](handleError(_0x21ae20,null));};exports['destroy']=function(_0xacd120,_0x284ea3){return db[_0xe0bd('0x2a')][_0xe0bd('0x47')]({'where':{'id':_0xacd120[_0xe0bd('0x48')]['id']}})[_0xe0bd('0x24')](handleEntityNotFound(_0x284ea3,null))[_0xe0bd('0x24')](removeEntity(_0x284ea3,null))[_0xe0bd('0x45')](handleError(_0x284ea3,null));};exports[_0xe0bd('0x49')]=function(_0x2631f5,_0x503939){return db[_0xe0bd('0x2a')][_0xe0bd('0x49')]()[_0xe0bd('0x24')](respondWithResult(_0x503939,null))['catch'](handleError(_0x503939,null));};
\ No newline at end of file
+var _0x60c2=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','filters','filter','merge','where','VIRTUAL','options','includeAll','include','Cdr','findAll','rows','params','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x2cf9f9,_0x52b995){var _0x44e2b3=function(_0x5d76ae){while(--_0x5d76ae){_0x2cf9f9['push'](_0x2cf9f9['shift']());}};_0x44e2b3(++_0x52b995);}(_0x60c2,0x8f));var _0x260c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x60c2[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x260c('0x0'));var zipdir=require(_0x260c('0x1'));var jsonpatch=require(_0x260c('0x2'));var rp=require(_0x260c('0x3'));var moment=require(_0x260c('0x4'));var BPromise=require(_0x260c('0x5'));var Mustache=require(_0x260c('0x6'));var util=require(_0x260c('0x7'));var path=require(_0x260c('0x8'));var sox=require(_0x260c('0x9'));var csv=require(_0x260c('0xa'));var ejs=require(_0x260c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x260c('0xc'));var squel=require(_0x260c('0xd'));var crypto=require(_0x260c('0xe'));var jsforce=require(_0x260c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x260c('0xa'));var querystring=require(_0x260c('0x10'));var Papa=require(_0x260c('0x11'));var Redis=require(_0x260c('0x12'));var authService=require(_0x260c('0x13'));var qs=require(_0x260c('0x14'));var as=require(_0x260c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x260c('0x16'))(_0x260c('0x17'));var utils=require(_0x260c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x260c('0x19'));var db=require(_0x260c('0x1a'))['db'];function respondWithStatusCode(_0x191490,_0x5aed37){_0x5aed37=_0x5aed37||0xcc;return function(_0xc44e8d){if(_0xc44e8d){return _0x191490[_0x260c('0x1b')](_0x5aed37);}return _0x191490[_0x260c('0x1c')](_0x5aed37)[_0x260c('0x1d')]();};}function respondWithResult(_0x1d3775,_0x53df53){_0x53df53=_0x53df53||0xc8;return function(_0x3930b6){if(_0x3930b6){return _0x1d3775['status'](_0x53df53)[_0x260c('0x1e')](_0x3930b6);}};}function respondWithFilteredResult(_0x5a021c,_0x47edc1){return function(_0xd8b310){if(_0xd8b310){var _0x5299a4=typeof _0x47edc1[_0x260c('0x1f')]===_0x260c('0x20')&&typeof _0x47edc1[_0x260c('0x21')]===_0x260c('0x20');var _0x2bf3b8=_0xd8b310[_0x260c('0x22')];var _0x11e634=_0x5299a4?0x0:_0x47edc1[_0x260c('0x1f')];var _0x201e59=_0x5299a4?_0xd8b310[_0x260c('0x22')]:_0x47edc1[_0x260c('0x1f')]+_0x47edc1['limit'];var _0xd977b;if(_0x201e59>=_0x2bf3b8){_0x201e59=_0x2bf3b8;_0xd977b=0xc8;}else{_0xd977b=0xce;}_0x5a021c['status'](_0xd977b);return _0x5a021c[_0x260c('0x23')](_0x260c('0x24'),_0x11e634+'-'+_0x201e59+'/'+_0x2bf3b8)['json'](_0xd8b310);}return null;};}function patchUpdates(_0x1ccf81){return function(_0xe824db){try{jsonpatch[_0x260c('0x25')](_0xe824db,_0x1ccf81,!![]);}catch(_0x1c53e1){return BPromise[_0x260c('0x26')](_0x1c53e1);}return _0xe824db[_0x260c('0x27')]();};}function saveUpdates(_0x4b5b7a,_0xd5b7d8){return function(_0x158bc6){if(_0x158bc6){return _0x158bc6[_0x260c('0x28')](_0x4b5b7a)[_0x260c('0x29')](function(_0x58688c){return _0x58688c;});}return null;};}function removeEntity(_0x3f299f,_0x304961){return function(_0x461c8a){if(_0x461c8a){return _0x461c8a[_0x260c('0x2a')]()['then'](function(){_0x3f299f[_0x260c('0x1c')](0xcc)[_0x260c('0x1d')]();});}};}function handleEntityNotFound(_0x3bdfce,_0x29e10e){return function(_0x4cf0f9){if(!_0x4cf0f9){_0x3bdfce[_0x260c('0x1b')](0x194);}return _0x4cf0f9;};}function handleError(_0x2957e5,_0x480179){_0x480179=_0x480179||0x1f4;return function(_0x5def72){logger[_0x260c('0x2b')](_0x5def72[_0x260c('0x2c')]);if(_0x5def72[_0x260c('0x2d')]){delete _0x5def72[_0x260c('0x2d')];}_0x2957e5[_0x260c('0x1c')](_0x480179)[_0x260c('0x2e')](_0x5def72);};}exports['index']=function(_0xf1ad3e,_0x2e49dd){var _0x16b663={},_0x233a61={},_0x5993fd={'count':0x0,'rows':[]};var _0xc6868a=_[_0x260c('0x2f')](db['Cdr'][_0x260c('0x30')],function(_0xcb8c28){return{'name':_0xcb8c28[_0x260c('0x31')],'type':_0xcb8c28[_0x260c('0x32')][_0x260c('0x33')]};});_0x233a61[_0x260c('0x34')]=_[_0x260c('0x2f')](_0xc6868a,_0x260c('0x2d'));_0x233a61['query']=_[_0x260c('0x35')](_0xf1ad3e[_0x260c('0x36')]);_0x233a61['filters']=_[_0x260c('0x37')](_0x233a61['model'],_0x233a61['query']);_0x16b663['attributes']=_[_0x260c('0x37')](_0x233a61[_0x260c('0x34')],qs['fields'](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x38')]));_0x16b663[_0x260c('0x39')]=_0x16b663[_0x260c('0x39')][_0x260c('0x3a')]?_0x16b663[_0x260c('0x39')]:_0x233a61['model'];if(!_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3b')](_0x260c('0x3c'))){_0x16b663[_0x260c('0x21')]=qs[_0x260c('0x21')](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x21')]);_0x16b663[_0x260c('0x1f')]=qs[_0x260c('0x1f')](_0xf1ad3e['query'][_0x260c('0x1f')]);}_0x16b663['order']=qs['sort'](_0xf1ad3e['query']['sort']);_0x16b663['where']=qs['filters'](_['pick'](_0xf1ad3e[_0x260c('0x36')],_0x233a61[_0x260c('0x3d')]),_0xc6868a);if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3e')]){_0x16b663['where']=_[_0x260c('0x3f')](_0x16b663[_0x260c('0x40')],{'$or':_['map'](_0xc6868a,function(_0x35afd6){if(_0x35afd6[_0x260c('0x32')]!==_0x260c('0x41')){var _0x1dbc8a={};_0x1dbc8a[_0x35afd6[_0x260c('0x2d')]]={'$like':'%'+_0xf1ad3e['query']['filter']+'%'};return _0x1dbc8a;}})});}_0x16b663=_[_0x260c('0x3f')]({},_0x16b663,_0xf1ad3e[_0x260c('0x42')]);var _0x1de711={'where':_0x16b663[_0x260c('0x40')]};return db['Cdr'][_0x260c('0x22')](_0x1de711)[_0x260c('0x29')](function(_0x265bd8){_0x5993fd[_0x260c('0x22')]=_0x265bd8;if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x43')]){_0x16b663[_0x260c('0x44')]=[{'all':!![]}];}return db[_0x260c('0x45')][_0x260c('0x46')](_0x16b663);})[_0x260c('0x29')](function(_0x3392df){_0x5993fd[_0x260c('0x47')]=_0x3392df;return _0x5993fd;})[_0x260c('0x29')](respondWithFilteredResult(_0x2e49dd,_0x16b663))['catch'](handleError(_0x2e49dd,null));};exports['show']=function(_0x19ab59,_0x30b3f9){var _0xccd9c1={'raw':!![],'where':{'id':_0x19ab59[_0x260c('0x48')]['id']}},_0x50ed87={};_0x50ed87['model']=_['keys'](db[_0x260c('0x45')]['rawAttributes']);_0x50ed87[_0x260c('0x36')]=_[_0x260c('0x35')](_0x19ab59[_0x260c('0x36')]);_0x50ed87[_0x260c('0x3d')]=_['intersection'](_0x50ed87[_0x260c('0x34')],_0x50ed87[_0x260c('0x36')]);_0xccd9c1['attributes']=_[_0x260c('0x37')](_0x50ed87['model'],qs[_0x260c('0x38')](_0x19ab59[_0x260c('0x36')][_0x260c('0x38')]));_0xccd9c1['attributes']=_0xccd9c1[_0x260c('0x39')][_0x260c('0x3a')]?_0xccd9c1[_0x260c('0x39')]:_0x50ed87[_0x260c('0x34')];if(_0x19ab59[_0x260c('0x36')][_0x260c('0x43')]){_0xccd9c1[_0x260c('0x44')]=[{'all':!![]}];}_0xccd9c1=_[_0x260c('0x3f')]({},_0xccd9c1,_0x19ab59[_0x260c('0x42')]);return db[_0x260c('0x45')][_0x260c('0x49')](_0xccd9c1)[_0x260c('0x29')](handleEntityNotFound(_0x30b3f9,null))['then'](respondWithResult(_0x30b3f9,null))['catch'](handleError(_0x30b3f9,null));};exports[_0x260c('0x4a')]=function(_0x4517be,_0x18321f){return db[_0x260c('0x45')]['create'](_0x4517be[_0x260c('0x4b')],{})[_0x260c('0x29')](respondWithResult(_0x18321f,0xc9))[_0x260c('0x4c')](handleError(_0x18321f,null));};exports[_0x260c('0x28')]=function(_0x45175a,_0x1d0890){if(_0x45175a[_0x260c('0x4b')]['id']){delete _0x45175a[_0x260c('0x4b')]['id'];}return db[_0x260c('0x45')]['find']({'where':{'id':_0x45175a[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1d0890,null))['then'](saveUpdates(_0x45175a[_0x260c('0x4b')],null))['then'](respondWithResult(_0x1d0890,null))[_0x260c('0x4c')](handleError(_0x1d0890,null));};exports['destroy']=function(_0x4dcdca,_0x1e34fe){return db[_0x260c('0x45')][_0x260c('0x49')]({'where':{'id':_0x4dcdca[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1e34fe,null))[_0x260c('0x29')](removeEntity(_0x1e34fe,null))[_0x260c('0x4c')](handleError(_0x1e34fe,null));};exports['describe']=function(_0x12fbe5,_0x49b350){return db[_0x260c('0x45')][_0x260c('0x4d')]()[_0x260c('0x29')](respondWithResult(_0x49b350,null))[_0x260c('0x4c')](handleError(_0x49b350,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 9a848d3..47d9d20 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(_0xc1385f,_0x9c0bea){var _0x2d1bee=function(_0x4b5d8d){while(--_0x4b5d8d){_0xc1385f['push'](_0xc1385f['shift']());}};_0x2d1bee(++_0x9c0bea);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x517db2,_0x22e5f6){var _0x636271=function(_0x4af022){while(--_0x4af022){_0x517db2['push'](_0x517db2['shift']());}};_0x636271(++_0x22e5f6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index bdde1a6..faea156 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 _0x88d7=['Cdr,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5bc1fe,_0x458299){var _0x482b91=function(_0xeb37d0){while(--_0xeb37d0){_0x5bc1fe['push'](_0x5bc1fe['shift']());}};_0x482b91(++_0x458299);}(_0x88d7,0x107));var _0x788d=function(_0xd9d17d,_0x3f089b){_0xd9d17d=_0xd9d17d-0x0;var _0x487156=_0x88d7[_0xd9d17d];return _0x487156;};'use strict';var _=require(_0x788d('0x0'));var util=require(_0x788d('0x1'));var moment=require('moment');var BPromise=require(_0x788d('0x2'));var rs=require(_0x788d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x788d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x788d('0x5'))(_0x788d('0x6'));var config=require(_0x788d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x788d('0x8')][_0x788d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2679d0,_0x3497b6,_0x4babe1){return new BPromise(function(_0x100dc7,_0x50dbfa){return client['request'](_0x2679d0,_0x4babe1)[_0x788d('0xa')](function(_0x4af167){logger[_0x788d('0xb')]('Cdr,\x20%s,\x20%s',_0x3497b6,'request\x20sent');logger['debug'](_0x788d('0xc'),_0x3497b6,_0x788d('0xd'),JSON[_0x788d('0xe')](_0x4af167));if(_0x4af167[_0x788d('0xf')]){if(_0x4af167[_0x788d('0xf')][_0x788d('0x10')]===0x1f4){logger[_0x788d('0xf')](_0x788d('0x11'),_0x3497b6,_0x4af167['error'][_0x788d('0x12')]);return _0x50dbfa(_0x4af167['error']['message']);}logger[_0x788d('0xf')](_0x788d('0x11'),_0x3497b6,_0x4af167['error'][_0x788d('0x12')]);return _0x100dc7(_0x4af167[_0x788d('0xf')][_0x788d('0x12')]);}else{logger[_0x788d('0xb')]('Cdr,\x20%s,\x20%s',_0x3497b6,_0x788d('0xd'));_0x100dc7(_0x4af167['result']['message']);}})[_0x788d('0x13')](function(_0x113d90){logger[_0x788d('0xf')]('Cdr,\x20%s,\x20%s',_0x3497b6,_0x113d90);_0x50dbfa(_0x113d90);});});}
\ No newline at end of file
+var _0x3e2c=['then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x431344,_0x1840f8){var _0x3a6bf6=function(_0xae0376){while(--_0xae0376){_0x431344['push'](_0x431344['shift']());}};_0x3a6bf6(++_0x1840f8);}(_0x3e2c,0x174));var _0xc3e2=function(_0x455afa,_0x235bfc){_0x455afa=_0x455afa-0x0;var _0x46ee43=_0x3e2c[_0x455afa];return _0x46ee43;};'use strict';var _=require(_0xc3e2('0x0'));var util=require(_0xc3e2('0x1'));var moment=require(_0xc3e2('0x2'));var BPromise=require(_0xc3e2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3e2('0x4'));var db=require(_0xc3e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3e2('0x6'))('rpc');var config=require(_0xc3e2('0x7'));var jayson=require(_0xc3e2('0x8'));var client=jayson[_0xc3e2('0x9')][_0xc3e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x277700,_0x17fb54,_0x54a486){return new BPromise(function(_0x2ea2d2,_0x1f1b72){return client[_0xc3e2('0xb')](_0x277700,_0x54a486)[_0xc3e2('0xc')](function(_0xacbf8e){logger[_0xc3e2('0xd')]('Cdr,\x20%s,\x20%s',_0x17fb54,'request\x20sent');logger[_0xc3e2('0xe')](_0xc3e2('0xf'),_0x17fb54,_0xc3e2('0x10'),JSON[_0xc3e2('0x11')](_0xacbf8e));if(_0xacbf8e[_0xc3e2('0x12')]){if(_0xacbf8e[_0xc3e2('0x12')][_0xc3e2('0x13')]===0x1f4){logger[_0xc3e2('0x12')](_0xc3e2('0x14'),_0x17fb54,_0xacbf8e['error']['message']);return _0x1f1b72(_0xacbf8e['error']['message']);}logger[_0xc3e2('0x12')](_0xc3e2('0x14'),_0x17fb54,_0xacbf8e[_0xc3e2('0x12')][_0xc3e2('0x15')]);return _0x2ea2d2(_0xacbf8e[_0xc3e2('0x12')][_0xc3e2('0x15')]);}else{logger[_0xc3e2('0xd')](_0xc3e2('0x14'),_0x17fb54,'request\x20sent');_0x2ea2d2(_0xacbf8e[_0xc3e2('0x16')]['message']);}})[_0xc3e2('0x17')](function(_0x4b1baf){logger[_0xc3e2('0x12')](_0xc3e2('0x14'),_0x17fb54,_0x4b1baf);_0x1f1b72(_0x4b1baf);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 9e01cdf..c0c547f 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(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x53ff3b,_0x58f396){var _0x4d7ac2=function(_0x13e433){while(--_0x13e433){_0x53ff3b['push'](_0x53ff3b['shift']());}};_0x4d7ac2(++_0x58f396);}(_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 49d83e5..5d0801c 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 _0xd56d=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xd56d,0x15a));var _0xdd56=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0xd56d[_0x4b9dc9];return _0x57b302;};'use strict';var Sequelize=require(_0xdd56('0x0'));module['exports']={'priority':{'type':Sequelize[_0xdd56('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xdd56('0x2')],'allowNull':![],'defaultValue':_0xdd56('0x3')},'appdata':{'type':Sequelize[_0xdd56('0x4')]()},'description':{'type':Sequelize[_0xdd56('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdd56('0x5')}};
\ No newline at end of file
+var _0x655d=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0x655d,0x15e));var _0xd655=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x655d[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0xd655('0x0'));module[_0xd655('0x1')]={'priority':{'type':Sequelize[_0xd655('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd655('0x3')],'allowNull':![],'defaultValue':_0xd655('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd655('0x3')]},'interval':{'type':Sequelize[_0xd655('0x3')],'defaultValue':_0xd655('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 46eafdf..fb0dd21 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 _0x6427=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','status','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','body','params','catch','rimraf','zip-dir'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x6427,0xbe));var _0x7642=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x6427[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7642('0x0'));var zipdir=require(_0x7642('0x1'));var jsonpatch=require(_0x7642('0x2'));var rp=require(_0x7642('0x3'));var moment=require(_0x7642('0x4'));var BPromise=require(_0x7642('0x5'));var Mustache=require('mustache');var util=require(_0x7642('0x6'));var path=require(_0x7642('0x7'));var sox=require(_0x7642('0x8'));var csv=require(_0x7642('0x9'));var ejs=require(_0x7642('0xa'));var fs=require('fs');var fs_extra=require(_0x7642('0xb'));var _=require(_0x7642('0xc'));var squel=require(_0x7642('0xd'));var crypto=require(_0x7642('0xe'));var jsforce=require(_0x7642('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7642('0x10'));var Papa=require(_0x7642('0x11'));var Redis=require(_0x7642('0x12'));var authService=require(_0x7642('0x13'));var qs=require(_0x7642('0x14'));var as=require(_0x7642('0x15'));var hardwareService=require(_0x7642('0x16'));var logger=require(_0x7642('0x17'))(_0x7642('0x18'));var utils=require(_0x7642('0x19'));var config=require(_0x7642('0x1a'));var licenseUtil=require(_0x7642('0x1b'));var db=require(_0x7642('0x1c'))['db'];function respondWithStatusCode(_0x3e5f50,_0x3c1291){_0x3c1291=_0x3c1291||0xcc;return function(_0x32e5c9){if(_0x32e5c9){return _0x3e5f50[_0x7642('0x1d')](_0x3c1291);}return _0x3e5f50['status'](_0x3c1291)[_0x7642('0x1e')]();};}function respondWithResult(_0x3adb30,_0x4930f4){_0x4930f4=_0x4930f4||0xc8;return function(_0x146ef9){if(_0x146ef9){return _0x3adb30['status'](_0x4930f4)[_0x7642('0x1f')](_0x146ef9);}};}function respondWithFilteredResult(_0x506c94,_0x1aa890){return function(_0x37964a){if(_0x37964a){var _0x3b87aa=typeof _0x1aa890[_0x7642('0x20')]===_0x7642('0x21')&&typeof _0x1aa890[_0x7642('0x22')]===_0x7642('0x21');var _0x4b04a7=_0x37964a[_0x7642('0x23')];var _0x392686=_0x3b87aa?0x0:_0x1aa890[_0x7642('0x20')];var _0x96bc79=_0x3b87aa?_0x37964a['count']:_0x1aa890['offset']+_0x1aa890[_0x7642('0x22')];var _0x42db03;if(_0x96bc79>=_0x4b04a7){_0x96bc79=_0x4b04a7;_0x42db03=0xc8;}else{_0x42db03=0xce;}_0x506c94['status'](_0x42db03);return _0x506c94[_0x7642('0x24')](_0x7642('0x25'),_0x392686+'-'+_0x96bc79+'/'+_0x4b04a7)['json'](_0x37964a);}return null;};}function patchUpdates(_0x503c13){return function(_0xb6b0c4){try{jsonpatch[_0x7642('0x26')](_0xb6b0c4,_0x503c13,!![]);}catch(_0x580573){return BPromise['reject'](_0x580573);}return _0xb6b0c4[_0x7642('0x27')]();};}function saveUpdates(_0xc23c3,_0x37de2b){return function(_0x4f55d4){if(_0x4f55d4){return _0x4f55d4[_0x7642('0x28')](_0xc23c3)[_0x7642('0x29')](function(_0x508265){return _0x508265;});}return null;};}function removeEntity(_0x606a05,_0x812f9){return function(_0xf31489){if(_0xf31489){return _0xf31489[_0x7642('0x2a')]()['then'](function(){_0x606a05[_0x7642('0x2b')](0xcc)[_0x7642('0x1e')]();});}};}function handleEntityNotFound(_0x1b8eac,_0x15148a){return function(_0x5b74c3){if(!_0x5b74c3){_0x1b8eac[_0x7642('0x1d')](0x194);}return _0x5b74c3;};}function handleError(_0x5c2750,_0x1993e3){_0x1993e3=_0x1993e3||0x1f4;return function(_0x2083f6){logger['error'](_0x2083f6[_0x7642('0x2c')]);if(_0x2083f6[_0x7642('0x2d')]){delete _0x2083f6[_0x7642('0x2d')];}_0x5c2750['status'](_0x1993e3)[_0x7642('0x2e')](_0x2083f6);};}exports['show']=function(_0x3f4764,_0x6e04c5){var _0x4a4fee={'raw':!![],'where':{'id':_0x3f4764['params']['id']}},_0x788aa9={};_0x788aa9[_0x7642('0x2f')]=_[_0x7642('0x30')](db[_0x7642('0x31')][_0x7642('0x32')]);_0x788aa9[_0x7642('0x33')]=_[_0x7642('0x30')](_0x3f4764[_0x7642('0x33')]);_0x788aa9[_0x7642('0x34')]=_[_0x7642('0x35')](_0x788aa9[_0x7642('0x2f')],_0x788aa9[_0x7642('0x33')]);_0x4a4fee[_0x7642('0x36')]=_['intersection'](_0x788aa9['model'],qs[_0x7642('0x37')](_0x3f4764[_0x7642('0x33')][_0x7642('0x37')]));_0x4a4fee['attributes']=_0x4a4fee[_0x7642('0x36')][_0x7642('0x38')]?_0x4a4fee['attributes']:_0x788aa9[_0x7642('0x2f')];if(_0x3f4764['query'][_0x7642('0x39')]){_0x4a4fee[_0x7642('0x3a')]=[{'all':!![]}];}_0x4a4fee=_[_0x7642('0x3b')]({},_0x4a4fee,_0x3f4764['options']);return db['ChatApplication'][_0x7642('0x3c')](_0x4a4fee)['then'](handleEntityNotFound(_0x6e04c5,null))['then'](respondWithResult(_0x6e04c5,null))['catch'](handleError(_0x6e04c5,null));};exports['update']=function(_0x3dd01f,_0x160c10){if(_0x3dd01f[_0x7642('0x3d')]['id']){delete _0x3dd01f[_0x7642('0x3d')]['id'];}return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0x3dd01f[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x160c10,null))[_0x7642('0x29')](saveUpdates(_0x3dd01f[_0x7642('0x3d')],null))['then'](respondWithResult(_0x160c10,null))['catch'](handleError(_0x160c10,null));};exports['destroy']=function(_0xc5edf3,_0x22ed74){return db[_0x7642('0x31')][_0x7642('0x3c')]({'where':{'id':_0xc5edf3[_0x7642('0x3e')]['id']}})[_0x7642('0x29')](handleEntityNotFound(_0x22ed74,null))[_0x7642('0x29')](removeEntity(_0x22ed74,null))[_0x7642('0x3f')](handleError(_0x22ed74,null));};
\ No newline at end of file
+var _0x515d=['filters','attributes','intersection','fields','length','includeAll','include','merge','ChatApplication','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','query'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x515d,0x104));var _0xd515=function(_0x40472f,_0x577cb8){_0x40472f=_0x40472f-0x0;var _0x1a819e=_0x515d[_0x40472f];return _0x1a819e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd515('0x0'));var zipdir=require(_0xd515('0x1'));var jsonpatch=require(_0xd515('0x2'));var rp=require(_0xd515('0x3'));var moment=require(_0xd515('0x4'));var BPromise=require(_0xd515('0x5'));var Mustache=require(_0xd515('0x6'));var util=require(_0xd515('0x7'));var path=require('path');var sox=require(_0xd515('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd515('0x9'));var _=require(_0xd515('0xa'));var squel=require(_0xd515('0xb'));var crypto=require(_0xd515('0xc'));var jsforce=require(_0xd515('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd515('0xe'));var querystring=require(_0xd515('0xf'));var Papa=require(_0xd515('0x10'));var Redis=require(_0xd515('0x11'));var authService=require(_0xd515('0x12'));var qs=require(_0xd515('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd515('0x14'));var logger=require(_0xd515('0x15'))(_0xd515('0x16'));var utils=require(_0xd515('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd515('0x18'));var db=require(_0xd515('0x19'))['db'];function respondWithStatusCode(_0x29c078,_0x33b905){_0x33b905=_0x33b905||0xcc;return function(_0x1d6bda){if(_0x1d6bda){return _0x29c078[_0xd515('0x1a')](_0x33b905);}return _0x29c078[_0xd515('0x1b')](_0x33b905)[_0xd515('0x1c')]();};}function respondWithResult(_0x1f23b7,_0x43384b){_0x43384b=_0x43384b||0xc8;return function(_0x10620b){if(_0x10620b){return _0x1f23b7[_0xd515('0x1b')](_0x43384b)[_0xd515('0x1d')](_0x10620b);}};}function respondWithFilteredResult(_0x589d04,_0x274550){return function(_0xc41eca){if(_0xc41eca){var _0xc8fbf=typeof _0x274550[_0xd515('0x1e')]===_0xd515('0x1f')&&typeof _0x274550[_0xd515('0x20')]===_0xd515('0x1f');var _0x139e91=_0xc41eca[_0xd515('0x21')];var _0x564c4e=_0xc8fbf?0x0:_0x274550['offset'];var _0x43bb12=_0xc8fbf?_0xc41eca[_0xd515('0x21')]:_0x274550[_0xd515('0x1e')]+_0x274550[_0xd515('0x20')];var _0x1ef858;if(_0x43bb12>=_0x139e91){_0x43bb12=_0x139e91;_0x1ef858=0xc8;}else{_0x1ef858=0xce;}_0x589d04[_0xd515('0x1b')](_0x1ef858);return _0x589d04[_0xd515('0x22')](_0xd515('0x23'),_0x564c4e+'-'+_0x43bb12+'/'+_0x139e91)[_0xd515('0x1d')](_0xc41eca);}return null;};}function patchUpdates(_0x5c7fef){return function(_0x57e1f4){try{jsonpatch[_0xd515('0x24')](_0x57e1f4,_0x5c7fef,!![]);}catch(_0x5b1649){return BPromise[_0xd515('0x25')](_0x5b1649);}return _0x57e1f4[_0xd515('0x26')]();};}function saveUpdates(_0x2b2ed5,_0x4e9d06){return function(_0xb422bc){if(_0xb422bc){return _0xb422bc[_0xd515('0x27')](_0x2b2ed5)[_0xd515('0x28')](function(_0x299b46){return _0x299b46;});}return null;};}function removeEntity(_0x519b7f,_0x430153){return function(_0x11cc9f){if(_0x11cc9f){return _0x11cc9f[_0xd515('0x29')]()[_0xd515('0x28')](function(){_0x519b7f[_0xd515('0x1b')](0xcc)[_0xd515('0x1c')]();});}};}function handleEntityNotFound(_0x130533,_0x84adb){return function(_0x19ce0c){if(!_0x19ce0c){_0x130533['sendStatus'](0x194);}return _0x19ce0c;};}function handleError(_0x5b6a98,_0x2e4455){_0x2e4455=_0x2e4455||0x1f4;return function(_0x2b803a){logger[_0xd515('0x2a')](_0x2b803a[_0xd515('0x2b')]);if(_0x2b803a[_0xd515('0x2c')]){delete _0x2b803a[_0xd515('0x2c')];}_0x5b6a98[_0xd515('0x1b')](_0x2e4455)[_0xd515('0x2d')](_0x2b803a);};}exports['show']=function(_0x38766a,_0x290489){var _0x3c2841={'raw':!![],'where':{'id':_0x38766a[_0xd515('0x2e')]['id']}},_0x154c02={};_0x154c02[_0xd515('0x2f')]=_[_0xd515('0x30')](db['ChatApplication']['rawAttributes']);_0x154c02['query']=_[_0xd515('0x30')](_0x38766a[_0xd515('0x31')]);_0x154c02[_0xd515('0x32')]=_['intersection'](_0x154c02['model'],_0x154c02['query']);_0x3c2841[_0xd515('0x33')]=_[_0xd515('0x34')](_0x154c02[_0xd515('0x2f')],qs[_0xd515('0x35')](_0x38766a[_0xd515('0x31')]['fields']));_0x3c2841[_0xd515('0x33')]=_0x3c2841['attributes'][_0xd515('0x36')]?_0x3c2841[_0xd515('0x33')]:_0x154c02[_0xd515('0x2f')];if(_0x38766a[_0xd515('0x31')][_0xd515('0x37')]){_0x3c2841[_0xd515('0x38')]=[{'all':!![]}];}_0x3c2841=_[_0xd515('0x39')]({},_0x3c2841,_0x38766a['options']);return db[_0xd515('0x3a')][_0xd515('0x3b')](_0x3c2841)[_0xd515('0x28')](handleEntityNotFound(_0x290489,null))[_0xd515('0x28')](respondWithResult(_0x290489,null))[_0xd515('0x3c')](handleError(_0x290489,null));};exports['update']=function(_0x21c3dc,_0x599054){if(_0x21c3dc[_0xd515('0x3d')]['id']){delete _0x21c3dc[_0xd515('0x3d')]['id'];}return db[_0xd515('0x3a')][_0xd515('0x3b')]({'where':{'id':_0x21c3dc[_0xd515('0x2e')]['id']}})[_0xd515('0x28')](handleEntityNotFound(_0x599054,null))[_0xd515('0x28')](saveUpdates(_0x21c3dc[_0xd515('0x3d')],null))[_0xd515('0x28')](respondWithResult(_0x599054,null))[_0xd515('0x3c')](handleError(_0x599054,null));};exports[_0xd515('0x29')]=function(_0x4201c3,_0x59a029){return db[_0xd515('0x3a')][_0xd515('0x3b')]({'where':{'id':_0x4201c3[_0xd515('0x2e')]['id']}})['then'](handleEntityNotFound(_0x59a029,null))[_0xd515('0x28')](removeEntity(_0x59a029,null))['catch'](handleError(_0x59a029,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index e571437..e82bed4 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 _0x4971=['bluebird','request-promise','path','rimraf','../../config/environment','define','chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x27b095,_0x2ead9b){var _0x282066=function(_0x3ace01){while(--_0x3ace01){_0x27b095['push'](_0x27b095['shift']());}};_0x282066(++_0x2ead9b);}(_0x4971,0xa4));var _0x1497=function(_0x3120e6,_0x324456){_0x3120e6=_0x3120e6-0x0;var _0x5b739f=_0x4971[_0x3120e6];return _0x5b739f;};'use strict';var _=require(_0x1497('0x0'));var util=require('util');var logger=require(_0x1497('0x1'))(_0x1497('0x2'));var moment=require(_0x1497('0x3'));var BPromise=require(_0x1497('0x4'));var rp=require(_0x1497('0x5'));var fs=require('fs');var path=require(_0x1497('0x6'));var rimraf=require(_0x1497('0x7'));var config=require(_0x1497('0x8'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x57b934,_0x53edf1){return _0x57b934[_0x1497('0x9')]('ChatApplication',attributes,{'tableName':_0x1497('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1497('0xb')});};
\ No newline at end of file
+var _0x1502=['moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x1502,0x1c3));var _0x2150=function(_0x196d3e,_0x2c56da){_0x196d3e=_0x196d3e-0x0;var _0x160f54=_0x1502[_0x196d3e];return _0x160f54;};'use strict';var _=require(_0x2150('0x0'));var util=require(_0x2150('0x1'));var logger=require(_0x2150('0x2'))(_0x2150('0x3'));var moment=require(_0x2150('0x4'));var BPromise=require(_0x2150('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2150('0x6'));var rimraf=require(_0x2150('0x7'));var config=require(_0x2150('0x8'));var attributes=require(_0x2150('0x9'));module['exports']=function(_0x2e34e9,_0x38dbdf){return _0x2e34e9['define'](_0x2150('0xa'),attributes,{'tableName':_0x2150('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2150('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 305d974..c99f67e 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 _0x7bc8=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x23dabd,_0x577de7){var _0x3580a1=function(_0x39204e){while(--_0x39204e){_0x23dabd['push'](_0x23dabd['shift']());}};_0x3580a1(++_0x577de7);}(_0x7bc8,0x16a));var _0x87bc=function(_0x3a832f,_0x1de647){_0x3a832f=_0x3a832f-0x0;var _0x13f6c2=_0x7bc8[_0x3a832f];return _0x13f6c2;};'use strict';var _=require(_0x87bc('0x0'));var util=require(_0x87bc('0x1'));var moment=require('moment');var BPromise=require(_0x87bc('0x2'));var rs=require(_0x87bc('0x3'));var fs=require('fs');var Redis=require(_0x87bc('0x4'));var db=require(_0x87bc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x87bc('0x6'))('rpc');var config=require(_0x87bc('0x7'));var jayson=require(_0x87bc('0x8'));var client=jayson[_0x87bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a2fa,_0x1329fe,_0xc2b90b){return new BPromise(function(_0x582fbb,_0x5038af){return client[_0x87bc('0xa')](_0x12a2fa,_0xc2b90b)[_0x87bc('0xb')](function(_0x211610){logger[_0x87bc('0xc')](_0x87bc('0xd'),_0x1329fe,_0x87bc('0xe'));logger[_0x87bc('0xf')](_0x87bc('0x10'),_0x1329fe,_0x87bc('0xe'),JSON[_0x87bc('0x11')](_0x211610));if(_0x211610[_0x87bc('0x12')]){if(_0x211610[_0x87bc('0x12')][_0x87bc('0x13')]===0x1f4){logger[_0x87bc('0x12')](_0x87bc('0xd'),_0x1329fe,_0x211610[_0x87bc('0x12')][_0x87bc('0x14')]);return _0x5038af(_0x211610['error']['message']);}logger[_0x87bc('0x12')](_0x87bc('0xd'),_0x1329fe,_0x211610[_0x87bc('0x12')]['message']);return _0x582fbb(_0x211610[_0x87bc('0x12')][_0x87bc('0x14')]);}else{logger[_0x87bc('0xc')](_0x87bc('0xd'),_0x1329fe,'request\x20sent');_0x582fbb(_0x211610[_0x87bc('0x15')][_0x87bc('0x14')]);}})[_0x87bc('0x16')](function(_0x22a6c4){logger[_0x87bc('0x12')](_0x87bc('0xd'),_0x1329fe,_0x22a6c4);_0x5038af(_0x22a6c4);});});}
\ No newline at end of file
+var _0x1cd2=['stringify','error','message','ChatApplication,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x1cd2,0xae));var _0x21cd=function(_0x20af23,_0x3b4d17){_0x20af23=_0x20af23-0x0;var _0x20983d=_0x1cd2[_0x20af23];return _0x20983d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x21cd('0x0'));var BPromise=require(_0x21cd('0x1'));var rs=require(_0x21cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21cd('0x3'))['db'];var utils=require(_0x21cd('0x4'));var logger=require(_0x21cd('0x5'))(_0x21cd('0x6'));var config=require('../../config/environment');var jayson=require(_0x21cd('0x7'));var client=jayson['client'][_0x21cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a2abd,_0x52f6b7,_0x321233){return new BPromise(function(_0x5853ad,_0x16c012){return client[_0x21cd('0x9')](_0x5a2abd,_0x321233)[_0x21cd('0xa')](function(_0x5e532a){logger[_0x21cd('0xb')]('ChatApplication,\x20%s,\x20%s',_0x52f6b7,_0x21cd('0xc'));logger[_0x21cd('0xd')](_0x21cd('0xe'),_0x52f6b7,_0x21cd('0xc'),JSON[_0x21cd('0xf')](_0x5e532a));if(_0x5e532a[_0x21cd('0x10')]){if(_0x5e532a['error']['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x52f6b7,_0x5e532a[_0x21cd('0x10')]['message']);return _0x16c012(_0x5e532a[_0x21cd('0x10')][_0x21cd('0x11')]);}logger[_0x21cd('0x10')](_0x21cd('0x12'),_0x52f6b7,_0x5e532a[_0x21cd('0x10')][_0x21cd('0x11')]);return _0x5853ad(_0x5e532a[_0x21cd('0x10')][_0x21cd('0x11')]);}else{logger['info'](_0x21cd('0x12'),_0x52f6b7,_0x21cd('0xc'));_0x5853ad(_0x5e532a[_0x21cd('0x13')][_0x21cd('0x11')]);}})[_0x21cd('0x14')](function(_0x391958){logger['error'](_0x21cd('0x12'),_0x52f6b7,_0x391958);_0x16c012(_0x391958);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 8c272e4..3cc1b87 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 _0x9001=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','/:id','put','isAuthenticated'];(function(_0x2074a3,_0x45500a){var _0x5562a2=function(_0x46323b){while(--_0x46323b){_0x2074a3['push'](_0x2074a3['shift']());}};_0x5562a2(++_0x45500a);}(_0x9001,0x154));var _0x1900=function(_0x1fda64,_0x440db3){_0x1fda64=_0x1fda64-0x0;var _0x377bfc=_0x9001[_0x1fda64];return _0x377bfc;};'use strict';var multer=require(_0x1900('0x0'));var util=require(_0x1900('0x1'));var path=require(_0x1900('0x2'));var timeout=require(_0x1900('0x3'));var express=require(_0x1900('0x4'));var router=express[_0x1900('0x5')]();var fs_extra=require(_0x1900('0x6'));var auth=require(_0x1900('0x7'));var interaction=require(_0x1900('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0x1900('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1900('0xa')]('/:id',auth[_0x1900('0xb')](),controller[_0x1900('0xc')]);router[_0x1900('0xd')]('/:id',auth[_0x1900('0xb')](),controller[_0x1900('0xe')]);module[_0x1900('0xf')]=router;
\ No newline at end of file
+var _0xeb70=['../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports','util','path','express','fs-extra'];(function(_0x5addbe,_0x3978c9){var _0x6287f2=function(_0x14af78){while(--_0x14af78){_0x5addbe['push'](_0x5addbe['shift']());}};_0x6287f2(++_0x3978c9);}(_0xeb70,0x173));var _0x0eb7=function(_0x117c97,_0x3ebe2b){_0x117c97=_0x117c97-0x0;var _0x47dedc=_0xeb70[_0x117c97];return _0x47dedc;};'use strict';var multer=require('multer');var util=require(_0x0eb7('0x0'));var path=require(_0x0eb7('0x1'));var timeout=require('connect-timeout');var express=require(_0x0eb7('0x2'));var router=express['Router']();var fs_extra=require(_0x0eb7('0x3'));var auth=require(_0x0eb7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0eb7('0x5'));var controller=require(_0x0eb7('0x6'));router[_0x0eb7('0x7')](_0x0eb7('0x8'),auth[_0x0eb7('0x9')](),controller[_0x0eb7('0xa')]);router['put'](_0x0eb7('0x8'),auth[_0x0eb7('0x9')](),controller[_0x0eb7('0xb')]);router[_0x0eb7('0xc')](_0x0eb7('0x8'),auth[_0x0eb7('0x9')](),controller[_0x0eb7('0xd')]);module[_0x0eb7('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 37bdd1b..692c7bd 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 _0x1f2e=['STRING','BOOLEAN'];(function(_0xb976c9,_0x5eb949){var _0x95a87e=function(_0x5d6e0c){while(--_0x5d6e0c){_0xb976c9['push'](_0xb976c9['shift']());}};_0x95a87e(++_0x5eb949);}(_0x1f2e,0x82));var _0xe1f2=function(_0x52cd03,_0x49f262){_0x52cd03=_0x52cd03-0x0;var _0x4ccba2=_0x1f2e[_0x52cd03];return _0x4ccba2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe1f2('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe1f2('0x0')]},'write':{'type':Sequelize[_0xe1f2('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd367=['exports','STRING'];(function(_0x440c0e,_0x2124b9){var _0x1bfaf4=function(_0x688b9f){while(--_0x688b9f){_0x440c0e['push'](_0x440c0e['shift']());}};_0x1bfaf4(++_0x2124b9);}(_0xd367,0x1dc));var _0x7d36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd367[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x7d36('0x0')]={'name':{'type':Sequelize[_0x7d36('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7d36('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index abceea9..a5c7ec4 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 _0xc956=['includeAll','include','options','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','undefined','limit','count','offset','set','apply','save','update','then','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','catch','show','params'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xc956,0x7a));var _0x6c95=function(_0x5d3569,_0x2753b7){_0x5d3569=_0x5d3569-0x0;var _0x233fbb=_0xc956[_0x5d3569];return _0x233fbb;};'use strict';var emlformat=require(_0x6c95('0x0'));var rimraf=require(_0x6c95('0x1'));var zipdir=require(_0x6c95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c95('0x3'));var moment=require(_0x6c95('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c95('0x5'));var util=require('util');var path=require(_0x6c95('0x6'));var sox=require(_0x6c95('0x7'));var csv=require(_0x6c95('0x8'));var ejs=require(_0x6c95('0x9'));var fs=require('fs');var fs_extra=require(_0x6c95('0xa'));var _=require(_0x6c95('0xb'));var squel=require(_0x6c95('0xc'));var crypto=require(_0x6c95('0xd'));var jsforce=require(_0x6c95('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6c95('0x8'));var querystring=require(_0x6c95('0xf'));var Papa=require(_0x6c95('0x10'));var Redis=require(_0x6c95('0x11'));var authService=require(_0x6c95('0x12'));var qs=require(_0x6c95('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c95('0x14'));var logger=require('../../config/logger')(_0x6c95('0x15'));var utils=require(_0x6c95('0x16'));var config=require(_0x6c95('0x17'));var licenseUtil=require(_0x6c95('0x18'));var db=require(_0x6c95('0x19'))['db'];config[_0x6c95('0x1a')]=_[_0x6c95('0x1b')](config[_0x6c95('0x1a')],{'host':_0x6c95('0x1c'),'port':0x18eb});var socket=require(_0x6c95('0x1d'))(new Redis(config[_0x6c95('0x1a')]));require(_0x6c95('0x1e'))[_0x6c95('0x1f')](socket);function respondWithStatusCode(_0xb027a2,_0x524a15){_0x524a15=_0x524a15||0xcc;return function(_0x17c2c7){if(_0x17c2c7){return _0xb027a2['sendStatus'](_0x524a15);}return _0xb027a2[_0x6c95('0x20')](_0x524a15)['end']();};}function respondWithResult(_0x57469e,_0x2ce12c){_0x2ce12c=_0x2ce12c||0xc8;return function(_0x5e0ac4){if(_0x5e0ac4){return _0x57469e[_0x6c95('0x20')](_0x2ce12c)[_0x6c95('0x21')](_0x5e0ac4);}};}function respondWithFilteredResult(_0x59344a,_0x5394a1){return function(_0x48482f){if(_0x48482f){var _0x51fc8a=typeof _0x5394a1['offset']===_0x6c95('0x22')&&typeof _0x5394a1[_0x6c95('0x23')]===_0x6c95('0x22');var _0x51b2d6=_0x48482f[_0x6c95('0x24')];var _0x578b19=_0x51fc8a?0x0:_0x5394a1[_0x6c95('0x25')];var _0x48ede1=_0x51fc8a?_0x48482f[_0x6c95('0x24')]:_0x5394a1[_0x6c95('0x25')]+_0x5394a1[_0x6c95('0x23')];var _0x17df05;if(_0x48ede1>=_0x51b2d6){_0x48ede1=_0x51b2d6;_0x17df05=0xc8;}else{_0x17df05=0xce;}_0x59344a['status'](_0x17df05);return _0x59344a[_0x6c95('0x26')]('Content-Range',_0x578b19+'-'+_0x48ede1+'/'+_0x51b2d6)['json'](_0x48482f);}return null;};}function patchUpdates(_0x499fd3){return function(_0x2b3744){try{jsonpatch[_0x6c95('0x27')](_0x2b3744,_0x499fd3,!![]);}catch(_0x3c8c1c){return BPromise['reject'](_0x3c8c1c);}return _0x2b3744[_0x6c95('0x28')]();};}function saveUpdates(_0x421dca,_0x536c16){return function(_0x7b1c30){if(_0x7b1c30){return _0x7b1c30[_0x6c95('0x29')](_0x421dca)[_0x6c95('0x2a')](function(_0x2285aa){return _0x2285aa;});}return null;};}function removeEntity(_0xf55bdd,_0xc7a7e8){return function(_0x5c7475){if(_0x5c7475){return _0x5c7475['destroy']()['then'](function(){_0xf55bdd[_0x6c95('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a68e9,_0x162303){return function(_0x2a14a0){if(!_0x2a14a0){_0x3a68e9[_0x6c95('0x2b')](0x194);}return _0x2a14a0;};}function handleError(_0x1935af,_0x2af40a){_0x2af40a=_0x2af40a||0x1f4;return function(_0x38b615){logger[_0x6c95('0x2c')](_0x38b615['stack']);if(_0x38b615[_0x6c95('0x2d')]){delete _0x38b615[_0x6c95('0x2d')];}_0x1935af[_0x6c95('0x20')](_0x2af40a)[_0x6c95('0x2e')](_0x38b615);};}exports[_0x6c95('0x2f')]=function(_0x2c90cd,_0x43250f){var _0x1f244e={},_0x21ae40={},_0x2af7ba={'count':0x0,'rows':[]};var _0x4525c7=_[_0x6c95('0x30')](db[_0x6c95('0x31')][_0x6c95('0x32')],function(_0x6fa692){return{'name':_0x6fa692['fieldName'],'type':_0x6fa692['type'][_0x6c95('0x33')]};});_0x21ae40[_0x6c95('0x34')]=_[_0x6c95('0x30')](_0x4525c7,_0x6c95('0x2d'));_0x21ae40[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x2c90cd[_0x6c95('0x35')]);_0x21ae40[_0x6c95('0x37')]=_[_0x6c95('0x38')](_0x21ae40[_0x6c95('0x34')],_0x21ae40['query']);_0x1f244e['attributes']=_[_0x6c95('0x38')](_0x21ae40['model'],qs[_0x6c95('0x39')](_0x2c90cd[_0x6c95('0x35')][_0x6c95('0x39')]));_0x1f244e[_0x6c95('0x3a')]=_0x1f244e[_0x6c95('0x3a')][_0x6c95('0x3b')]?_0x1f244e[_0x6c95('0x3a')]:_0x21ae40[_0x6c95('0x34')];if(!_0x2c90cd[_0x6c95('0x35')]['hasOwnProperty'](_0x6c95('0x3c'))){_0x1f244e[_0x6c95('0x23')]=qs[_0x6c95('0x23')](_0x2c90cd[_0x6c95('0x35')][_0x6c95('0x23')]);_0x1f244e[_0x6c95('0x25')]=qs['offset'](_0x2c90cd[_0x6c95('0x35')]['offset']);}_0x1f244e[_0x6c95('0x3d')]=qs[_0x6c95('0x3e')](_0x2c90cd[_0x6c95('0x35')]['sort']);_0x1f244e['where']=qs[_0x6c95('0x37')](_[_0x6c95('0x3f')](_0x2c90cd[_0x6c95('0x35')],_0x21ae40[_0x6c95('0x37')]),_0x4525c7);if(_0x2c90cd[_0x6c95('0x35')][_0x6c95('0x40')]){_0x1f244e[_0x6c95('0x41')]=_[_0x6c95('0x42')](_0x1f244e[_0x6c95('0x41')],{'$or':_[_0x6c95('0x30')](_0x4525c7,function(_0x121f16){if(_0x121f16[_0x6c95('0x43')]!==_0x6c95('0x44')){var _0x3ca387={};_0x3ca387[_0x121f16[_0x6c95('0x2d')]]={'$like':'%'+_0x2c90cd['query'][_0x6c95('0x40')]+'%'};return _0x3ca387;}})});}_0x1f244e=_['merge']({},_0x1f244e,_0x2c90cd['options']);var _0x5ad004={'where':_0x1f244e[_0x6c95('0x41')]};return db['ChatGroup']['count'](_0x5ad004)[_0x6c95('0x2a')](function(_0xb8159e){_0x2af7ba[_0x6c95('0x24')]=_0xb8159e;if(_0x2c90cd[_0x6c95('0x35')]['includeAll']){_0x1f244e['include']=[{'all':!![]}];}return db[_0x6c95('0x31')]['findAll'](_0x1f244e);})[_0x6c95('0x2a')](function(_0x54a5fc){_0x2af7ba['rows']=_0x54a5fc;return _0x2af7ba;})[_0x6c95('0x2a')](respondWithFilteredResult(_0x43250f,_0x1f244e))[_0x6c95('0x45')](handleError(_0x43250f,null));};exports[_0x6c95('0x46')]=function(_0x254f95,_0x3daa2a){var _0x246417={'raw':!![],'where':{'id':_0x254f95[_0x6c95('0x47')]['id']}},_0x1dd579={};_0x1dd579[_0x6c95('0x34')]=_[_0x6c95('0x36')](db[_0x6c95('0x31')][_0x6c95('0x32')]);_0x1dd579[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x254f95[_0x6c95('0x35')]);_0x1dd579['filters']=_[_0x6c95('0x38')](_0x1dd579[_0x6c95('0x34')],_0x1dd579[_0x6c95('0x35')]);_0x246417['attributes']=_['intersection'](_0x1dd579[_0x6c95('0x34')],qs[_0x6c95('0x39')](_0x254f95[_0x6c95('0x35')][_0x6c95('0x39')]));_0x246417[_0x6c95('0x3a')]=_0x246417['attributes'][_0x6c95('0x3b')]?_0x246417[_0x6c95('0x3a')]:_0x1dd579[_0x6c95('0x34')];if(_0x254f95[_0x6c95('0x35')][_0x6c95('0x48')]){_0x246417[_0x6c95('0x49')]=[{'all':!![]}];}_0x246417=_['merge']({},_0x246417,_0x254f95[_0x6c95('0x4a')]);return db[_0x6c95('0x31')][_0x6c95('0x4b')](_0x246417)['then'](handleEntityNotFound(_0x3daa2a,null))[_0x6c95('0x2a')](respondWithResult(_0x3daa2a,null))[_0x6c95('0x45')](handleError(_0x3daa2a,null));};exports[_0x6c95('0x4c')]=function(_0x15c4e4,_0x18e802){return db[_0x6c95('0x31')][_0x6c95('0x4c')](_0x15c4e4[_0x6c95('0x4d')],{})[_0x6c95('0x2a')](respondWithResult(_0x18e802,0xc9))[_0x6c95('0x45')](handleError(_0x18e802,null));};exports[_0x6c95('0x29')]=function(_0x1a7ec1,_0x1ea200){if(_0x1a7ec1['body']['id']){delete _0x1a7ec1[_0x6c95('0x4d')]['id'];}return db['ChatGroup'][_0x6c95('0x4b')]({'where':{'id':_0x1a7ec1['params']['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x1ea200,null))[_0x6c95('0x2a')](saveUpdates(_0x1a7ec1[_0x6c95('0x4d')],null))['then'](respondWithResult(_0x1ea200,null))[_0x6c95('0x45')](handleError(_0x1ea200,null));};exports[_0x6c95('0x4e')]=function(_0x867fcf,_0x43b4bc){return db[_0x6c95('0x31')][_0x6c95('0x4b')]({'where':{'id':_0x867fcf[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x43b4bc,null))[_0x6c95('0x2a')](removeEntity(_0x43b4bc,null))['catch'](handleError(_0x43b4bc,null));};exports[_0x6c95('0x4f')]=function(_0x18af3e,_0x57f37e){return db[_0x6c95('0x31')][_0x6c95('0x4f')]()[_0x6c95('0x2a')](respondWithResult(_0x57f37e,null))['catch'](handleError(_0x57f37e,null));};exports[_0x6c95('0x50')]=function(_0x360102,_0x5b6187,_0x5d5985){return db[_0x6c95('0x51')][_0x6c95('0x24')]({'where':{'ChatGroupId':_0x360102[_0x6c95('0x47')]['id'],'ToId':_0x360102['user']['id'],'read':![]}})[_0x6c95('0x2a')](function(_0x402010){return{'id':_[_0x6c95('0x52')](_0x360102[_0x6c95('0x47')]['id']),'count':_0x402010};})[_0x6c95('0x2a')](respondWithResult(_0x5b6187,null))[_0x6c95('0x45')](handleError(_0x5b6187,null));};exports['addMembers']=function(_0x5dbd4b,_0x2ca4f9,_0x4adc88){return db[_0x6c95('0x31')][_0x6c95('0x4b')]({'where':{'id':_0x5dbd4b[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x2ca4f9,null))[_0x6c95('0x2a')](function(_0x2d0d2b){if(_0x2d0d2b){return _0x2d0d2b['addMembers'](_0x5dbd4b[_0x6c95('0x4d')][_0x6c95('0x53')],_[_0x6c95('0x54')](_0x5dbd4b['body'],[_0x6c95('0x53'),'id'])||{});}})['then'](respondWithResult(_0x2ca4f9,null))[_0x6c95('0x45')](handleError(_0x2ca4f9,null));};exports[_0x6c95('0x55')]=function(_0x390300,_0x461316,_0x4d30c3){var _0x775e37={};var _0x34b443={};var _0x196192;var _0x5b13ae;return db[_0x6c95('0x31')][_0x6c95('0x56')]({'where':{'id':_0x390300[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x461316,null))[_0x6c95('0x2a')](function(_0x3e3ab8){if(_0x3e3ab8){_0x196192=_0x3e3ab8;_0x34b443[_0x6c95('0x34')]=_[_0x6c95('0x36')](db[_0x6c95('0x57')][_0x6c95('0x32')]);_0x34b443[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x390300[_0x6c95('0x35')]);_0x34b443[_0x6c95('0x37')]=_[_0x6c95('0x38')](_0x34b443['model'],_0x34b443['query']);_0x775e37[_0x6c95('0x3a')]=_[_0x6c95('0x38')](_0x34b443[_0x6c95('0x34')],qs[_0x6c95('0x39')](_0x390300[_0x6c95('0x35')][_0x6c95('0x39')]));_0x775e37['attributes']=_0x775e37[_0x6c95('0x3a')][_0x6c95('0x3b')]?_0x775e37[_0x6c95('0x3a')]:_0x34b443['model'];_0x775e37[_0x6c95('0x3d')]=qs['sort'](_0x390300[_0x6c95('0x35')][_0x6c95('0x3e')]);_0x775e37[_0x6c95('0x41')]=qs[_0x6c95('0x37')](_[_0x6c95('0x3f')](_0x390300[_0x6c95('0x35')],_0x34b443[_0x6c95('0x37')]));if(_0x390300[_0x6c95('0x35')][_0x6c95('0x40')]){_0x775e37['where']=_[_0x6c95('0x42')](_0x775e37['where'],{'$or':_[_0x6c95('0x30')](_0x775e37[_0x6c95('0x3a')],function(_0x415acc){var _0x2f668f={};_0x2f668f[_0x415acc]={'$like':'%'+_0x390300[_0x6c95('0x35')]['filter']+'%'};return _0x2f668f;})});}_0x775e37=_[_0x6c95('0x42')]({},_0x775e37,_0x390300[_0x6c95('0x4a')]);return _0x196192[_0x6c95('0x55')](_0x775e37);}})[_0x6c95('0x2a')](function(_0x5a89ad){if(_0x5a89ad){_0x5b13ae=_0x5a89ad[_0x6c95('0x3b')];if(!_0x390300[_0x6c95('0x35')][_0x6c95('0x58')](_0x6c95('0x3c'))){_0x775e37[_0x6c95('0x23')]=qs[_0x6c95('0x23')](_0x390300[_0x6c95('0x35')][_0x6c95('0x23')]);_0x775e37[_0x6c95('0x25')]=qs[_0x6c95('0x25')](_0x390300['query'][_0x6c95('0x25')]);}return _0x196192['getMembers'](_0x775e37);}})[_0x6c95('0x2a')](function(_0x29a10a){if(_0x29a10a){return _0x29a10a?{'count':_0x5b13ae,'rows':_0x29a10a}:null;}})[_0x6c95('0x2a')](respondWithResult(_0x461316,null))[_0x6c95('0x45')](handleError(_0x461316,null));};exports['removeMembers']=function(_0x42a487,_0x515855,_0x3ae3f5){return db[_0x6c95('0x31')]['find']({'where':{'id':_0x42a487[_0x6c95('0x47')]['id']}})[_0x6c95('0x2a')](handleEntityNotFound(_0x515855,null))[_0x6c95('0x2a')](function(_0x42d001){if(_0x42d001){return _0x42d001[_0x6c95('0x59')](_0x42a487['query'][_0x6c95('0x53')]);}})[_0x6c95('0x2a')](respondWithStatusCode(_0x515855,null))[_0x6c95('0x45')](handleError(_0x515855,null));};exports[_0x6c95('0x5a')]=function(_0x21d4b4,_0x267649,_0x333e1e){if(_0x21d4b4[_0x6c95('0x4d')]['id']){delete _0x21d4b4[_0x6c95('0x4d')]['id'];}return db[_0x6c95('0x31')]['find']({'where':{'id':_0x21d4b4[_0x6c95('0x47')]['id']}})['then'](handleEntityNotFound(_0x267649,null))[_0x6c95('0x2a')](function(_0x5d4e37){if(_0x5d4e37){_0x21d4b4[_0x6c95('0x4d')][_0x6c95('0x5b')]=_0x5d4e37['id'];return db['ChatInternalMessage'][_0x6c95('0x4c')](_0x21d4b4[_0x6c95('0x4d')]);}})['then'](respondWithResult(_0x267649,null))[_0x6c95('0x45')](handleError(_0x267649,null));};exports[_0x6c95('0x5c')]=function(_0x38f735,_0x4f851a,_0x37bf36){var _0x4b942b={};var _0x505190={};var _0x4a1b6e;var _0x5ae177;return db['ChatGroup'][_0x6c95('0x56')]({'where':{'id':_0x38f735['params']['id']}})['then'](handleEntityNotFound(_0x4f851a,null))[_0x6c95('0x2a')](function(_0x317cb8){if(_0x317cb8){_0x4a1b6e=_0x317cb8;_0x505190[_0x6c95('0x34')]=_[_0x6c95('0x36')](db[_0x6c95('0x51')][_0x6c95('0x32')]);_0x505190[_0x6c95('0x35')]=_[_0x6c95('0x36')](_0x38f735[_0x6c95('0x35')]);_0x505190['filters']=_['intersection'](_0x505190[_0x6c95('0x34')],_0x505190[_0x6c95('0x35')]);_0x4b942b[_0x6c95('0x3a')]=_['intersection'](_0x505190[_0x6c95('0x34')],qs['fields'](_0x38f735['query'][_0x6c95('0x39')]));_0x4b942b[_0x6c95('0x3a')]=_0x4b942b[_0x6c95('0x3a')][_0x6c95('0x3b')]?_0x4b942b[_0x6c95('0x3a')]:_0x505190[_0x6c95('0x34')];_0x4b942b[_0x6c95('0x3d')]=qs[_0x6c95('0x3e')](_0x38f735[_0x6c95('0x35')][_0x6c95('0x3e')]);_0x4b942b[_0x6c95('0x41')]=qs[_0x6c95('0x37')](_['pick'](_0x38f735[_0x6c95('0x35')],_0x505190[_0x6c95('0x37')]));if(_0x38f735[_0x6c95('0x35')][_0x6c95('0x40')]){_0x4b942b[_0x6c95('0x41')]=_['merge'](_0x4b942b[_0x6c95('0x41')],{'$or':_[_0x6c95('0x30')](_0x4b942b['attributes'],function(_0x31c756){var _0x3294a8={};_0x3294a8[_0x31c756]={'$like':'%'+_0x38f735[_0x6c95('0x35')][_0x6c95('0x40')]+'%'};return _0x3294a8;})});}if(_0x38f735['query'][_0x6c95('0x5d')]){var _0x3e7803=_0x38f735[_0x6c95('0x35')][_0x6c95('0x5d')][_0x6c95('0x5e')](',');var _0x45b1d7={};_0x45b1d7[_0x3e7803[0x0]]={'$gte':moment(_0x3e7803[0x1])[_0x6c95('0x5f')](_0x6c95('0x60'))};_0x4b942b[_0x6c95('0x41')]=_[_0x6c95('0x42')](_0x4b942b[_0x6c95('0x41')],_0x45b1d7);}_0x4b942b=_[_0x6c95('0x42')]({},_0x4b942b,_0x38f735['options']);return _0x4a1b6e[_0x6c95('0x5c')](_0x4b942b);}})[_0x6c95('0x2a')](function(_0x2634e1){if(_0x2634e1){_0x5ae177=_0x2634e1[_0x6c95('0x3b')];if(!_0x38f735[_0x6c95('0x35')][_0x6c95('0x58')](_0x6c95('0x3c'))){_0x4b942b[_0x6c95('0x23')]=qs['limit'](_0x38f735[_0x6c95('0x35')][_0x6c95('0x23')]);_0x4b942b[_0x6c95('0x25')]=qs[_0x6c95('0x25')](_0x38f735[_0x6c95('0x35')][_0x6c95('0x25')]);}return _0x4a1b6e[_0x6c95('0x5c')](_0x4b942b);}})[_0x6c95('0x2a')](function(_0x4b53ae){if(_0x4b53ae){return _0x4b53ae?{'count':_0x5ae177,'rows':_0x4b53ae}:null;}})[_0x6c95('0x2a')](respondWithResult(_0x4f851a,null))['catch'](handleError(_0x4f851a,null));};
\ No newline at end of file
+var _0x7b4b=['YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','intersection','attributes','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','params','fields','length','find','catch','create','body','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','pick','options','removeMembers','addMessage','getMessages','$gte','format'];(function(_0x1e5d56,_0x8a4924){var _0x37f85b=function(_0x250679){while(--_0x250679){_0x1e5d56['push'](_0x1e5d56['shift']());}};_0x37f85b(++_0x8a4924);}(_0x7b4b,0x1ce));var _0xb7b4=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x7b4b[_0x513aa5];return _0x1a1a7c;};'use strict';var emlformat=require(_0xb7b4('0x0'));var rimraf=require(_0xb7b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7b4('0x2'));var moment=require(_0xb7b4('0x3'));var BPromise=require(_0xb7b4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb7b4('0x5'));var sox=require(_0xb7b4('0x6'));var csv=require(_0xb7b4('0x7'));var ejs=require(_0xb7b4('0x8'));var fs=require('fs');var fs_extra=require(_0xb7b4('0x9'));var _=require('lodash');var squel=require(_0xb7b4('0xa'));var crypto=require('crypto');var jsforce=require(_0xb7b4('0xb'));var deskjs=require(_0xb7b4('0xc'));var toCsv=require(_0xb7b4('0x7'));var querystring=require(_0xb7b4('0xd'));var Papa=require(_0xb7b4('0xe'));var Redis=require(_0xb7b4('0xf'));var authService=require(_0xb7b4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb7b4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb7b4('0x12'));var utils=require(_0xb7b4('0x13'));var config=require(_0xb7b4('0x14'));var licenseUtil=require(_0xb7b4('0x15'));var db=require(_0xb7b4('0x16'))['db'];config[_0xb7b4('0x17')]=_['defaults'](config[_0xb7b4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb7b4('0x18'))(new Redis(config[_0xb7b4('0x17')]));require('./chatGroup.socket')[_0xb7b4('0x19')](socket);function respondWithStatusCode(_0x2cbed4,_0x3fb267){_0x3fb267=_0x3fb267||0xcc;return function(_0x14f4de){if(_0x14f4de){return _0x2cbed4[_0xb7b4('0x1a')](_0x3fb267);}return _0x2cbed4[_0xb7b4('0x1b')](_0x3fb267)[_0xb7b4('0x1c')]();};}function respondWithResult(_0x4d70a9,_0x27ebad){_0x27ebad=_0x27ebad||0xc8;return function(_0x1064d0){if(_0x1064d0){return _0x4d70a9[_0xb7b4('0x1b')](_0x27ebad)[_0xb7b4('0x1d')](_0x1064d0);}};}function respondWithFilteredResult(_0x2fe1b6,_0x2eb336){return function(_0x1daaa8){if(_0x1daaa8){var _0x321917=typeof _0x2eb336[_0xb7b4('0x1e')]===_0xb7b4('0x1f')&&typeof _0x2eb336[_0xb7b4('0x20')]===_0xb7b4('0x1f');var _0x707168=_0x1daaa8['count'];var _0x484de4=_0x321917?0x0:_0x2eb336[_0xb7b4('0x1e')];var _0xfe6849=_0x321917?_0x1daaa8[_0xb7b4('0x21')]:_0x2eb336['offset']+_0x2eb336['limit'];var _0x427fb7;if(_0xfe6849>=_0x707168){_0xfe6849=_0x707168;_0x427fb7=0xc8;}else{_0x427fb7=0xce;}_0x2fe1b6['status'](_0x427fb7);return _0x2fe1b6[_0xb7b4('0x22')](_0xb7b4('0x23'),_0x484de4+'-'+_0xfe6849+'/'+_0x707168)['json'](_0x1daaa8);}return null;};}function patchUpdates(_0x51cfd1){return function(_0x1fd025){try{jsonpatch[_0xb7b4('0x24')](_0x1fd025,_0x51cfd1,!![]);}catch(_0x2c33cf){return BPromise[_0xb7b4('0x25')](_0x2c33cf);}return _0x1fd025[_0xb7b4('0x26')]();};}function saveUpdates(_0x23c38b,_0x45555b){return function(_0x34c8e2){if(_0x34c8e2){return _0x34c8e2[_0xb7b4('0x27')](_0x23c38b)[_0xb7b4('0x28')](function(_0x3d8af7){return _0x3d8af7;});}return null;};}function removeEntity(_0x2e0e99,_0x12ee93){return function(_0x5b6d5a){if(_0x5b6d5a){return _0x5b6d5a[_0xb7b4('0x29')]()[_0xb7b4('0x28')](function(){_0x2e0e99[_0xb7b4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xba8502,_0x4f7d5c){return function(_0x50e37c){if(!_0x50e37c){_0xba8502[_0xb7b4('0x1a')](0x194);}return _0x50e37c;};}function handleError(_0xfd7c76,_0x14c7c1){_0x14c7c1=_0x14c7c1||0x1f4;return function(_0x6e39b6){logger[_0xb7b4('0x2a')](_0x6e39b6['stack']);if(_0x6e39b6[_0xb7b4('0x2b')]){delete _0x6e39b6[_0xb7b4('0x2b')];}_0xfd7c76[_0xb7b4('0x1b')](_0x14c7c1)[_0xb7b4('0x2c')](_0x6e39b6);};}exports[_0xb7b4('0x2d')]=function(_0x5dd56f,_0x11cbdb){var _0x46a0a9={},_0x2350cf={},_0x2b9798={'count':0x0,'rows':[]};var _0x2ab287=_[_0xb7b4('0x2e')](db[_0xb7b4('0x2f')][_0xb7b4('0x30')],function(_0x42a2a1){return{'name':_0x42a2a1['fieldName'],'type':_0x42a2a1[_0xb7b4('0x31')][_0xb7b4('0x32')]};});_0x2350cf[_0xb7b4('0x33')]=_['map'](_0x2ab287,_0xb7b4('0x2b'));_0x2350cf[_0xb7b4('0x34')]=_[_0xb7b4('0x35')](_0x5dd56f[_0xb7b4('0x34')]);_0x2350cf['filters']=_[_0xb7b4('0x36')](_0x2350cf['model'],_0x2350cf[_0xb7b4('0x34')]);_0x46a0a9[_0xb7b4('0x37')]=_[_0xb7b4('0x36')](_0x2350cf[_0xb7b4('0x33')],qs['fields'](_0x5dd56f[_0xb7b4('0x34')]['fields']));_0x46a0a9['attributes']=_0x46a0a9['attributes']['length']?_0x46a0a9['attributes']:_0x2350cf[_0xb7b4('0x33')];if(!_0x5dd56f[_0xb7b4('0x34')]['hasOwnProperty'](_0xb7b4('0x38'))){_0x46a0a9[_0xb7b4('0x20')]=qs[_0xb7b4('0x20')](_0x5dd56f['query'][_0xb7b4('0x20')]);_0x46a0a9[_0xb7b4('0x1e')]=qs['offset'](_0x5dd56f[_0xb7b4('0x34')][_0xb7b4('0x1e')]);}_0x46a0a9[_0xb7b4('0x39')]=qs['sort'](_0x5dd56f['query'][_0xb7b4('0x3a')]);_0x46a0a9['where']=qs[_0xb7b4('0x3b')](_['pick'](_0x5dd56f[_0xb7b4('0x34')],_0x2350cf[_0xb7b4('0x3b')]),_0x2ab287);if(_0x5dd56f['query'][_0xb7b4('0x3c')]){_0x46a0a9[_0xb7b4('0x3d')]=_[_0xb7b4('0x3e')](_0x46a0a9[_0xb7b4('0x3d')],{'$or':_[_0xb7b4('0x2e')](_0x2ab287,function(_0x365f31){if(_0x365f31[_0xb7b4('0x31')]!==_0xb7b4('0x3f')){var _0x50a47f={};_0x50a47f[_0x365f31['name']]={'$like':'%'+_0x5dd56f[_0xb7b4('0x34')][_0xb7b4('0x3c')]+'%'};return _0x50a47f;}})});}_0x46a0a9=_[_0xb7b4('0x3e')]({},_0x46a0a9,_0x5dd56f['options']);var _0xf59747={'where':_0x46a0a9[_0xb7b4('0x3d')]};return db[_0xb7b4('0x2f')][_0xb7b4('0x21')](_0xf59747)['then'](function(_0x1abde1){_0x2b9798[_0xb7b4('0x21')]=_0x1abde1;if(_0x5dd56f[_0xb7b4('0x34')][_0xb7b4('0x40')]){_0x46a0a9[_0xb7b4('0x41')]=[{'all':!![]}];}return db[_0xb7b4('0x2f')][_0xb7b4('0x42')](_0x46a0a9);})[_0xb7b4('0x28')](function(_0xd1e414){_0x2b9798['rows']=_0xd1e414;return _0x2b9798;})[_0xb7b4('0x28')](respondWithFilteredResult(_0x11cbdb,_0x46a0a9))['catch'](handleError(_0x11cbdb,null));};exports['show']=function(_0x579826,_0xc1652){var _0x594a02={'raw':!![],'where':{'id':_0x579826[_0xb7b4('0x43')]['id']}},_0x235455={};_0x235455[_0xb7b4('0x33')]=_['keys'](db[_0xb7b4('0x2f')][_0xb7b4('0x30')]);_0x235455[_0xb7b4('0x34')]=_['keys'](_0x579826[_0xb7b4('0x34')]);_0x235455[_0xb7b4('0x3b')]=_['intersection'](_0x235455[_0xb7b4('0x33')],_0x235455[_0xb7b4('0x34')]);_0x594a02['attributes']=_[_0xb7b4('0x36')](_0x235455[_0xb7b4('0x33')],qs[_0xb7b4('0x44')](_0x579826['query']['fields']));_0x594a02[_0xb7b4('0x37')]=_0x594a02[_0xb7b4('0x37')][_0xb7b4('0x45')]?_0x594a02[_0xb7b4('0x37')]:_0x235455['model'];if(_0x579826[_0xb7b4('0x34')][_0xb7b4('0x40')]){_0x594a02[_0xb7b4('0x41')]=[{'all':!![]}];}_0x594a02=_['merge']({},_0x594a02,_0x579826['options']);return db['ChatGroup'][_0xb7b4('0x46')](_0x594a02)[_0xb7b4('0x28')](handleEntityNotFound(_0xc1652,null))[_0xb7b4('0x28')](respondWithResult(_0xc1652,null))[_0xb7b4('0x47')](handleError(_0xc1652,null));};exports[_0xb7b4('0x48')]=function(_0x33cfd8,_0x4db448){return db[_0xb7b4('0x2f')]['create'](_0x33cfd8['body'],{})[_0xb7b4('0x28')](respondWithResult(_0x4db448,0xc9))[_0xb7b4('0x47')](handleError(_0x4db448,null));};exports[_0xb7b4('0x27')]=function(_0x46235b,_0x12a505){if(_0x46235b[_0xb7b4('0x49')]['id']){delete _0x46235b[_0xb7b4('0x49')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x46235b['params']['id']}})[_0xb7b4('0x28')](handleEntityNotFound(_0x12a505,null))[_0xb7b4('0x28')](saveUpdates(_0x46235b[_0xb7b4('0x49')],null))[_0xb7b4('0x28')](respondWithResult(_0x12a505,null))[_0xb7b4('0x47')](handleError(_0x12a505,null));};exports[_0xb7b4('0x29')]=function(_0x1b9a9c,_0x38c20c){return db['ChatGroup']['find']({'where':{'id':_0x1b9a9c[_0xb7b4('0x43')]['id']}})['then'](handleEntityNotFound(_0x38c20c,null))[_0xb7b4('0x28')](removeEntity(_0x38c20c,null))['catch'](handleError(_0x38c20c,null));};exports['describe']=function(_0x3277a6,_0xf96752){return db['ChatGroup']['describe']()[_0xb7b4('0x28')](respondWithResult(_0xf96752,null))[_0xb7b4('0x47')](handleError(_0xf96752,null));};exports[_0xb7b4('0x4a')]=function(_0x20b864,_0x54dce6,_0x1134ff){return db[_0xb7b4('0x4b')][_0xb7b4('0x21')]({'where':{'ChatGroupId':_0x20b864[_0xb7b4('0x43')]['id'],'ToId':_0x20b864[_0xb7b4('0x4c')]['id'],'read':![]}})[_0xb7b4('0x28')](function(_0x18f4ee){return{'id':_['toInteger'](_0x20b864[_0xb7b4('0x43')]['id']),'count':_0x18f4ee};})['then'](respondWithResult(_0x54dce6,null))['catch'](handleError(_0x54dce6,null));};exports['addMembers']=function(_0x1b0633,_0x245a52,_0x44edcc){return db[_0xb7b4('0x2f')][_0xb7b4('0x46')]({'where':{'id':_0x1b0633[_0xb7b4('0x43')]['id']}})[_0xb7b4('0x28')](handleEntityNotFound(_0x245a52,null))[_0xb7b4('0x28')](function(_0x558c0d){if(_0x558c0d){return _0x558c0d[_0xb7b4('0x4d')](_0x1b0633[_0xb7b4('0x49')][_0xb7b4('0x4e')],_[_0xb7b4('0x4f')](_0x1b0633[_0xb7b4('0x49')],[_0xb7b4('0x4e'),'id'])||{});}})[_0xb7b4('0x28')](respondWithResult(_0x245a52,null))[_0xb7b4('0x47')](handleError(_0x245a52,null));};exports[_0xb7b4('0x50')]=function(_0xf65a67,_0x2616ce,_0x4a1101){var _0x1f9917={};var _0x31eb25={};var _0x26017b;var _0xec4c98;return db[_0xb7b4('0x2f')][_0xb7b4('0x51')]({'where':{'id':_0xf65a67[_0xb7b4('0x43')]['id']}})[_0xb7b4('0x28')](handleEntityNotFound(_0x2616ce,null))[_0xb7b4('0x28')](function(_0x3039e2){if(_0x3039e2){_0x26017b=_0x3039e2;_0x31eb25[_0xb7b4('0x33')]=_[_0xb7b4('0x35')](db[_0xb7b4('0x52')]['rawAttributes']);_0x31eb25['query']=_[_0xb7b4('0x35')](_0xf65a67['query']);_0x31eb25[_0xb7b4('0x3b')]=_[_0xb7b4('0x36')](_0x31eb25[_0xb7b4('0x33')],_0x31eb25[_0xb7b4('0x34')]);_0x1f9917[_0xb7b4('0x37')]=_[_0xb7b4('0x36')](_0x31eb25[_0xb7b4('0x33')],qs[_0xb7b4('0x44')](_0xf65a67[_0xb7b4('0x34')][_0xb7b4('0x44')]));_0x1f9917[_0xb7b4('0x37')]=_0x1f9917[_0xb7b4('0x37')][_0xb7b4('0x45')]?_0x1f9917['attributes']:_0x31eb25[_0xb7b4('0x33')];_0x1f9917[_0xb7b4('0x39')]=qs[_0xb7b4('0x3a')](_0xf65a67['query'][_0xb7b4('0x3a')]);_0x1f9917[_0xb7b4('0x3d')]=qs['filters'](_[_0xb7b4('0x53')](_0xf65a67[_0xb7b4('0x34')],_0x31eb25['filters']));if(_0xf65a67[_0xb7b4('0x34')]['filter']){_0x1f9917['where']=_[_0xb7b4('0x3e')](_0x1f9917[_0xb7b4('0x3d')],{'$or':_[_0xb7b4('0x2e')](_0x1f9917[_0xb7b4('0x37')],function(_0x518ef5){var _0x4c54a5={};_0x4c54a5[_0x518ef5]={'$like':'%'+_0xf65a67[_0xb7b4('0x34')][_0xb7b4('0x3c')]+'%'};return _0x4c54a5;})});}_0x1f9917=_[_0xb7b4('0x3e')]({},_0x1f9917,_0xf65a67[_0xb7b4('0x54')]);return _0x26017b[_0xb7b4('0x50')](_0x1f9917);}})[_0xb7b4('0x28')](function(_0x55553e){if(_0x55553e){_0xec4c98=_0x55553e[_0xb7b4('0x45')];if(!_0xf65a67[_0xb7b4('0x34')]['hasOwnProperty']('nolimit')){_0x1f9917[_0xb7b4('0x20')]=qs[_0xb7b4('0x20')](_0xf65a67[_0xb7b4('0x34')][_0xb7b4('0x20')]);_0x1f9917['offset']=qs[_0xb7b4('0x1e')](_0xf65a67['query'][_0xb7b4('0x1e')]);}return _0x26017b[_0xb7b4('0x50')](_0x1f9917);}})[_0xb7b4('0x28')](function(_0xab212d){if(_0xab212d){return _0xab212d?{'count':_0xec4c98,'rows':_0xab212d}:null;}})[_0xb7b4('0x28')](respondWithResult(_0x2616ce,null))[_0xb7b4('0x47')](handleError(_0x2616ce,null));};exports[_0xb7b4('0x55')]=function(_0x3cfdb3,_0x396892,_0x2baf50){return db[_0xb7b4('0x2f')][_0xb7b4('0x46')]({'where':{'id':_0x3cfdb3['params']['id']}})[_0xb7b4('0x28')](handleEntityNotFound(_0x396892,null))[_0xb7b4('0x28')](function(_0x55a054){if(_0x55a054){return _0x55a054[_0xb7b4('0x55')](_0x3cfdb3[_0xb7b4('0x34')][_0xb7b4('0x4e')]);}})[_0xb7b4('0x28')](respondWithStatusCode(_0x396892,null))['catch'](handleError(_0x396892,null));};exports[_0xb7b4('0x56')]=function(_0x5aca2b,_0x3477e0,_0x109ae8){if(_0x5aca2b[_0xb7b4('0x49')]['id']){delete _0x5aca2b[_0xb7b4('0x49')]['id'];}return db['ChatGroup'][_0xb7b4('0x46')]({'where':{'id':_0x5aca2b['params']['id']}})['then'](handleEntityNotFound(_0x3477e0,null))[_0xb7b4('0x28')](function(_0x4599d7){if(_0x4599d7){_0x5aca2b[_0xb7b4('0x49')]['ChatGroupId']=_0x4599d7['id'];return db[_0xb7b4('0x4b')][_0xb7b4('0x48')](_0x5aca2b[_0xb7b4('0x49')]);}})[_0xb7b4('0x28')](respondWithResult(_0x3477e0,null))[_0xb7b4('0x47')](handleError(_0x3477e0,null));};exports[_0xb7b4('0x57')]=function(_0x1aeb63,_0x3afbce,_0x2d7693){var _0x20dcaa={};var _0x3632d1={};var _0x5b5748;var _0x185170;return db[_0xb7b4('0x2f')][_0xb7b4('0x51')]({'where':{'id':_0x1aeb63['params']['id']}})[_0xb7b4('0x28')](handleEntityNotFound(_0x3afbce,null))[_0xb7b4('0x28')](function(_0x2f5892){if(_0x2f5892){_0x5b5748=_0x2f5892;_0x3632d1['model']=_['keys'](db[_0xb7b4('0x4b')][_0xb7b4('0x30')]);_0x3632d1[_0xb7b4('0x34')]=_['keys'](_0x1aeb63[_0xb7b4('0x34')]);_0x3632d1[_0xb7b4('0x3b')]=_[_0xb7b4('0x36')](_0x3632d1['model'],_0x3632d1[_0xb7b4('0x34')]);_0x20dcaa[_0xb7b4('0x37')]=_[_0xb7b4('0x36')](_0x3632d1['model'],qs[_0xb7b4('0x44')](_0x1aeb63[_0xb7b4('0x34')]['fields']));_0x20dcaa[_0xb7b4('0x37')]=_0x20dcaa['attributes'][_0xb7b4('0x45')]?_0x20dcaa['attributes']:_0x3632d1[_0xb7b4('0x33')];_0x20dcaa[_0xb7b4('0x39')]=qs[_0xb7b4('0x3a')](_0x1aeb63[_0xb7b4('0x34')][_0xb7b4('0x3a')]);_0x20dcaa[_0xb7b4('0x3d')]=qs[_0xb7b4('0x3b')](_[_0xb7b4('0x53')](_0x1aeb63[_0xb7b4('0x34')],_0x3632d1[_0xb7b4('0x3b')]));if(_0x1aeb63[_0xb7b4('0x34')][_0xb7b4('0x3c')]){_0x20dcaa[_0xb7b4('0x3d')]=_[_0xb7b4('0x3e')](_0x20dcaa[_0xb7b4('0x3d')],{'$or':_[_0xb7b4('0x2e')](_0x20dcaa['attributes'],function(_0x235fc6){var _0x46b99a={};_0x46b99a[_0x235fc6]={'$like':'%'+_0x1aeb63[_0xb7b4('0x34')]['filter']+'%'};return _0x46b99a;})});}if(_0x1aeb63[_0xb7b4('0x34')][_0xb7b4('0x58')]){var _0x2616fd=_0x1aeb63['query'][_0xb7b4('0x58')]['split'](',');var _0x886b41={};_0x886b41[_0x2616fd[0x0]]={'$gte':moment(_0x2616fd[0x1])[_0xb7b4('0x59')](_0xb7b4('0x5a'))};_0x20dcaa[_0xb7b4('0x3d')]=_[_0xb7b4('0x3e')](_0x20dcaa[_0xb7b4('0x3d')],_0x886b41);}_0x20dcaa=_[_0xb7b4('0x3e')]({},_0x20dcaa,_0x1aeb63[_0xb7b4('0x54')]);return _0x5b5748[_0xb7b4('0x57')](_0x20dcaa);}})[_0xb7b4('0x28')](function(_0x786b72){if(_0x786b72){_0x185170=_0x786b72['length'];if(!_0x1aeb63[_0xb7b4('0x34')][_0xb7b4('0x5b')](_0xb7b4('0x38'))){_0x20dcaa[_0xb7b4('0x20')]=qs[_0xb7b4('0x20')](_0x1aeb63[_0xb7b4('0x34')][_0xb7b4('0x20')]);_0x20dcaa[_0xb7b4('0x1e')]=qs[_0xb7b4('0x1e')](_0x1aeb63[_0xb7b4('0x34')][_0xb7b4('0x1e')]);}return _0x5b5748[_0xb7b4('0x57')](_0x20dcaa);}})[_0xb7b4('0x28')](function(_0x4b99a9){if(_0x4b99a9){return _0x4b99a9?{'count':_0x185170,'rows':_0x4b99a9}:null;}})[_0xb7b4('0x28')](respondWithResult(_0x3afbce,null))[_0xb7b4('0x47')](handleError(_0x3afbce,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 76040da..f68cb39 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 _0x9b25=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','save'];(function(_0x55a8a0,_0x313c62){var _0x581017=function(_0x5cf328){while(--_0x5cf328){_0x55a8a0['push'](_0x55a8a0['shift']());}};_0x581017(++_0x313c62);}(_0x9b25,0x1be));var _0x59b2=function(_0x394d5a,_0x23c990){_0x394d5a=_0x394d5a-0x0;var _0x281461=_0x9b25[_0x394d5a];return _0x281461;};'use strict';var EventEmitter=require(_0x59b2('0x0'));var ChatGroup=require(_0x59b2('0x1'))['db'][_0x59b2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x59b2('0x3'),'afterUpdate':_0x59b2('0x4'),'afterDestroy':_0x59b2('0x5')};function emitEvent(_0x459769){return function(_0x72ea4a,_0x48e4ca,_0x4dd11d){ChatGroupEvents[_0x59b2('0x6')](_0x459769+':'+_0x72ea4a['id'],_0x72ea4a);ChatGroupEvents[_0x59b2('0x6')](_0x459769,_0x72ea4a);_0x4dd11d(null);};}for(var e in events){if(events[_0x59b2('0x7')](e)){var event=events[e];ChatGroup[_0x59b2('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x22a7=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4a8e2d,_0x4aefc9){var _0x11bc28=function(_0x17b594){while(--_0x17b594){_0x4a8e2d['push'](_0x4a8e2d['shift']());}};_0x11bc28(++_0x4aefc9);}(_0x22a7,0xe4));var _0x722a=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x22a7[_0x1911ed];return _0x11edaa;};'use strict';var EventEmitter=require(_0x722a('0x0'));var ChatGroup=require(_0x722a('0x1'))['db'][_0x722a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x722a('0x3')](0x0);var events={'afterCreate':_0x722a('0x4'),'afterUpdate':_0x722a('0x5'),'afterDestroy':_0x722a('0x6')};function emitEvent(_0x43a0f5){return function(_0x464d07,_0x462040,_0x2b51f3){ChatGroupEvents['emit'](_0x43a0f5+':'+_0x464d07['id'],_0x464d07);ChatGroupEvents[_0x722a('0x7')](_0x43a0f5,_0x464d07);_0x2b51f3(null);};}for(var e in events){if(events[_0x722a('0x8')](e)){var event=events[e];ChatGroup[_0x722a('0x9')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 17919f2..dfd2bd3 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 _0x0044=['ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x5f2c4f,_0x413414){var _0x498c51=function(_0x3fb596){while(--_0x3fb596){_0x5f2c4f['push'](_0x5f2c4f['shift']());}};_0x498c51(++_0x413414);}(_0x0044,0x12a));var _0x4004=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0044[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x4004('0x0'));var util=require(_0x4004('0x1'));var logger=require(_0x4004('0x2'))(_0x4004('0x3'));var moment=require(_0x4004('0x4'));var BPromise=require(_0x4004('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4004('0x6'));var rimraf=require('rimraf');var config=require(_0x4004('0x7'));var attributes=require('./chatGroup.attributes');module[_0x4004('0x8')]=function(_0x3d6186,_0x1d85a7){return _0x3d6186[_0x4004('0x9')](_0x4004('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb92d=['path','rimraf','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb92d,0xa1));var _0xdb92=function(_0x4fb9ed,_0x187ea0){_0x4fb9ed=_0x4fb9ed-0x0;var _0x263645=_0xb92d[_0x4fb9ed];return _0x263645;};'use strict';var _=require(_0xdb92('0x0'));var util=require(_0xdb92('0x1'));var logger=require(_0xdb92('0x2'))(_0xdb92('0x3'));var moment=require(_0xdb92('0x4'));var BPromise=require(_0xdb92('0x5'));var rp=require(_0xdb92('0x6'));var fs=require('fs');var path=require(_0xdb92('0x7'));var rimraf=require(_0xdb92('0x8'));var config=require('../../config/environment');var attributes=require(_0xdb92('0x9'));module['exports']=function(_0xf77bdd,_0x2ed444){return _0xf77bdd['define'](_0xdb92('0xa'),attributes,{'tableName':_0xdb92('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 3c2e399..0ca96ee 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 _0xacc8=['request\x20sent','debug','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x182093,_0x19eca5){var _0x180469=function(_0x3ec641){while(--_0x3ec641){_0x182093['push'](_0x182093['shift']());}};_0x180469(++_0x19eca5);}(_0xacc8,0xc5));var _0x8acc=function(_0x5c8440,_0x262351){_0x5c8440=_0x5c8440-0x0;var _0x301008=_0xacc8[_0x5c8440];return _0x301008;};'use strict';var _=require(_0x8acc('0x0'));var util=require('util');var moment=require(_0x8acc('0x1'));var BPromise=require(_0x8acc('0x2'));var rs=require(_0x8acc('0x3'));var fs=require('fs');var Redis=require(_0x8acc('0x4'));var db=require(_0x8acc('0x5'))['db'];var utils=require(_0x8acc('0x6'));var logger=require('../../config/logger')(_0x8acc('0x7'));var config=require(_0x8acc('0x8'));var jayson=require(_0x8acc('0x9'));var client=jayson['client'][_0x8acc('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8acc('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8acc('0xc'))(new Redis(config['redis']));require(_0x8acc('0xd'))[_0x8acc('0xe')](socket);function respondWithRpcPromise(_0x5a7185,_0x3fd766,_0x1c0d87){return new BPromise(function(_0x3669fb,_0x2bf3ad){return client[_0x8acc('0xf')](_0x5a7185,_0x1c0d87)[_0x8acc('0x10')](function(_0x390080){logger[_0x8acc('0x11')](_0x8acc('0x12'),_0x3fd766,_0x8acc('0x13'));logger[_0x8acc('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3fd766,_0x8acc('0x13'),JSON['stringify'](_0x390080));if(_0x390080[_0x8acc('0x15')]){if(_0x390080[_0x8acc('0x15')]['code']===0x1f4){logger[_0x8acc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x3fd766,_0x390080[_0x8acc('0x15')][_0x8acc('0x16')]);return _0x2bf3ad(_0x390080['error'][_0x8acc('0x16')]);}logger[_0x8acc('0x15')](_0x8acc('0x12'),_0x3fd766,_0x390080['error'][_0x8acc('0x16')]);return _0x3669fb(_0x390080[_0x8acc('0x15')][_0x8acc('0x16')]);}else{logger[_0x8acc('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3fd766,_0x8acc('0x13'));_0x3669fb(_0x390080['result']['message']);}})[_0x8acc('0x17')](function(_0x5c9f47){logger['error'](_0x8acc('0x12'),_0x3fd766,_0x5c9f47);_0x2bf3ad(_0x5c9f47);});});}
\ No newline at end of file
+var _0x5a52=['code','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x35eaf7,_0xe9b5ef){var _0x1ecb45=function(_0x289852){while(--_0x289852){_0x35eaf7['push'](_0x35eaf7['shift']());}};_0x1ecb45(++_0xe9b5ef);}(_0x5a52,0x18d));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x25a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x25a5('0x1'));var fs=require('fs');var Redis=require(_0x25a5('0x2'));var db=require(_0x25a5('0x3'))['db'];var utils=require(_0x25a5('0x4'));var logger=require(_0x25a5('0x5'))(_0x25a5('0x6'));var config=require(_0x25a5('0x7'));var jayson=require(_0x25a5('0x8'));var client=jayson['client'][_0x25a5('0x9')]({'port':0x232a});config['redis']=_[_0x25a5('0xa')](config[_0x25a5('0xb')],{'host':_0x25a5('0xc'),'port':0x18eb});var socket=require(_0x25a5('0xd'))(new Redis(config[_0x25a5('0xb')]));require(_0x25a5('0xe'))['register'](socket);function respondWithRpcPromise(_0x4dcda5,_0x428795,_0x304a26){return new BPromise(function(_0x107e85,_0x2a6e38){return client[_0x25a5('0xf')](_0x4dcda5,_0x304a26)[_0x25a5('0x10')](function(_0x1610b8){logger[_0x25a5('0x11')]('ChatGroup,\x20%s,\x20%s',_0x428795,_0x25a5('0x12'));logger[_0x25a5('0x13')](_0x25a5('0x14'),_0x428795,'request\x20sent',JSON[_0x25a5('0x15')](_0x1610b8));if(_0x1610b8['error']){if(_0x1610b8[_0x25a5('0x16')][_0x25a5('0x17')]===0x1f4){logger[_0x25a5('0x16')]('ChatGroup,\x20%s,\x20%s',_0x428795,_0x1610b8['error'][_0x25a5('0x18')]);return _0x2a6e38(_0x1610b8['error'][_0x25a5('0x18')]);}logger[_0x25a5('0x16')](_0x25a5('0x19'),_0x428795,_0x1610b8[_0x25a5('0x16')]['message']);return _0x107e85(_0x1610b8[_0x25a5('0x16')]['message']);}else{logger['info'](_0x25a5('0x19'),_0x428795,_0x25a5('0x12'));_0x107e85(_0x1610b8[_0x25a5('0x1a')][_0x25a5('0x18')]);}})[_0x25a5('0x1b')](function(_0x54987f){logger['error'](_0x25a5('0x19'),_0x428795,_0x54987f);_0x2a6e38(_0x54987f);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 0ff4292..e243f53 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 _0xe240=['emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x2d731f,_0x1a7db6){var _0x3bc2bf=function(_0x510010){while(--_0x510010){_0x2d731f['push'](_0x2d731f['shift']());}};_0x3bc2bf(++_0x1a7db6);}(_0xe240,0x135));var _0x0e24=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe240[_0x5c2e3e];return _0x53f64a;};'use strict';var ChatGroupEvents=require(_0x0e24('0x0'));var events=['save','remove','update'];function createListener(_0x4c5346,_0x1d68ea){return function(_0x2d3140){_0x1d68ea[_0x0e24('0x1')](_0x4c5346,_0x2d3140);};}function removeListener(_0x1f2955,_0x1e75ac){return function(){ChatGroupEvents[_0x0e24('0x2')](_0x1f2955,_0x1e75ac);};}exports['register']=function(_0x45ff05){for(var _0x464d74=0x0,_0x4a6690=events[_0x0e24('0x3')];_0x464d74<_0x4a6690;_0x464d74++){var _0x45f727=events[_0x464d74];var _0x106bee=createListener(_0x0e24('0x4')+_0x45f727,_0x45ff05);ChatGroupEvents['on'](_0x45f727,_0x106bee);}};
\ No newline at end of file
+var _0x001d=['removeListener','register','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x1e2f5b,_0x60bf47){var _0x2bb7bc=function(_0x1ddf91){while(--_0x1ddf91){_0x1e2f5b['push'](_0x1e2f5b['shift']());}};_0x2bb7bc(++_0x60bf47);}(_0x001d,0x1d3));var _0xd001=function(_0x4054f7,_0x44b868){_0x4054f7=_0x4054f7-0x0;var _0x62b262=_0x001d[_0x4054f7];return _0x62b262;};'use strict';var ChatGroupEvents=require(_0xd001('0x0'));var events=[_0xd001('0x1'),_0xd001('0x2'),_0xd001('0x3')];function createListener(_0x2a0ee9,_0x30958b){return function(_0xa19fd4){_0x30958b[_0xd001('0x4')](_0x2a0ee9,_0xa19fd4);};}function removeListener(_0x16f820,_0x2fd4c6){return function(){ChatGroupEvents[_0xd001('0x5')](_0x16f820,_0x2fd4c6);};}exports[_0xd001('0x6')]=function(_0x1bd914){for(var _0x553afb=0x0,_0x4db95c=events['length'];_0x553afb<_0x4db95c;_0x553afb++){var _0x58335b=events[_0x553afb];var _0x194f3d=createListener(_0xd001('0x7')+_0x58335b,_0x1bd914);ChatGroupEvents['on'](_0x58335b,_0x194f3d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index afa761e..4175eec 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 _0xd1b8=['/:id/members','getMembers','/:id/messages','post','create','put','update','delete','destroy','removeMembers','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','getUnread'];(function(_0xa4098e,_0x4c9e5c){var _0xeeffcb=function(_0x42b2ac){while(--_0x42b2ac){_0xa4098e['push'](_0xa4098e['shift']());}};_0xeeffcb(++_0x4c9e5c);}(_0xd1b8,0x1a8));var _0x8d1b=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xd1b8[_0x4de586];return _0x46baf5;};'use strict';var multer=require(_0x8d1b('0x0'));var util=require(_0x8d1b('0x1'));var path=require('path');var timeout=require(_0x8d1b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8d1b('0x3'));var interaction=require(_0x8d1b('0x4'));var config=require(_0x8d1b('0x5'));var controller=require(_0x8d1b('0x6'));router[_0x8d1b('0x7')]('/',auth[_0x8d1b('0x8')](),controller['index']);router[_0x8d1b('0x7')]('/describe',auth[_0x8d1b('0x8')](),controller['describe']);router[_0x8d1b('0x7')](_0x8d1b('0x9'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0xa')]);router[_0x8d1b('0x7')](_0x8d1b('0xb'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0xc')]);router[_0x8d1b('0x7')](_0x8d1b('0xd'),auth['isAuthenticated'](),controller[_0x8d1b('0xe')]);router['get'](_0x8d1b('0xf'),auth[_0x8d1b('0x8')](),controller['getMessages']);router[_0x8d1b('0x10')]('/',auth['isAuthenticated'](),controller[_0x8d1b('0x11')]);router[_0x8d1b('0x10')](_0x8d1b('0xd'),auth['isAuthenticated'](),controller['addMembers']);router['post'](_0x8d1b('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8d1b('0x12')](_0x8d1b('0x9'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0x13')]);router[_0x8d1b('0x14')](_0x8d1b('0x9'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0x15')]);router[_0x8d1b('0x14')](_0x8d1b('0xd'),auth[_0x8d1b('0x8')](),controller[_0x8d1b('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x6db0=['exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy'];(function(_0x1c6e46,_0x173536){var _0x236239=function(_0x6a5894){while(--_0x6a5894){_0x1c6e46['push'](_0x1c6e46['shift']());}};_0x236239(++_0x173536);}(_0x6db0,0x12a));var _0x06db=function(_0x2daf14,_0x2ec184){_0x2daf14=_0x2daf14-0x0;var _0x2aa029=_0x6db0[_0x2daf14];return _0x2aa029;};'use strict';var multer=require('multer');var util=require(_0x06db('0x0'));var path=require(_0x06db('0x1'));var timeout=require(_0x06db('0x2'));var express=require(_0x06db('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x06db('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x06db('0x5'));var controller=require(_0x06db('0x6'));router[_0x06db('0x7')]('/',auth[_0x06db('0x8')](),controller[_0x06db('0x9')]);router[_0x06db('0x7')](_0x06db('0xa'),auth['isAuthenticated'](),controller[_0x06db('0xb')]);router[_0x06db('0x7')](_0x06db('0xc'),auth['isAuthenticated'](),controller[_0x06db('0xd')]);router[_0x06db('0x7')](_0x06db('0xe'),auth[_0x06db('0x8')](),controller[_0x06db('0xf')]);router[_0x06db('0x7')](_0x06db('0x10'),auth[_0x06db('0x8')](),controller['getMembers']);router[_0x06db('0x7')]('/:id/messages',auth[_0x06db('0x8')](),controller[_0x06db('0x11')]);router[_0x06db('0x12')]('/',auth[_0x06db('0x8')](),controller[_0x06db('0x13')]);router[_0x06db('0x12')]('/:id/members',auth[_0x06db('0x8')](),controller[_0x06db('0x14')]);router[_0x06db('0x12')]('/:id/messages',auth[_0x06db('0x8')](),controller[_0x06db('0x15')]);router[_0x06db('0x16')](_0x06db('0xc'),auth[_0x06db('0x8')](),controller[_0x06db('0x17')]);router[_0x06db('0x18')](_0x06db('0xc'),auth['isAuthenticated'](),controller[_0x06db('0x19')]);router[_0x06db('0x18')](_0x06db('0x10'),auth[_0x06db('0x8')](),controller['removeMembers']);module[_0x06db('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 ffb5e13..c443495 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 _0x8fe4=['out','INTEGER','sequelize','exports','BOOLEAN','star','TEXT','STRING','DATE','long','ENUM'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x8fe4,0x14c));var _0x48fe=function(_0x35cd06,_0x577a99){_0x35cd06=_0x35cd06-0x0;var _0x5c4f34=_0x8fe4[_0x35cd06];return _0x5c4f34;};'use strict';var Sequelize=require(_0x48fe('0x0'));module[_0x48fe('0x1')]={'closed':{'type':Sequelize[_0x48fe('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x48fe('0x3'),'thumb'),'defaultValue':_0x48fe('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x48fe('0x4')]},'mailTranscript':{'type':Sequelize[_0x48fe('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x48fe('0x6')]},'disposition':{'type':Sequelize[_0x48fe('0x5')]},'secondDisposition':{'type':Sequelize[_0x48fe('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48fe('0x5')]},'browserName':{'type':Sequelize[_0x48fe('0x5')]},'browserVersion':{'type':Sequelize[_0x48fe('0x5')]},'osName':{'type':Sequelize[_0x48fe('0x5')]},'osVersion':{'type':Sequelize[_0x48fe('0x5')]},'deviceModel':{'type':Sequelize[_0x48fe('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x48fe('0x5')]},'referer':{'type':Sequelize[_0x48fe('0x4')]},'customerIp':{'type':Sequelize[_0x48fe('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x48fe('0x7'))},'read1stAt':{'type':Sequelize[_0x48fe('0x6')]},'lastMsgAt':{'type':Sequelize[_0x48fe('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x48fe('0x8')]('in',_0x48fe('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x48fe('0x5')]},'customerPort':{'type':Sequelize[_0x48fe('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x48fe('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x48fe('0xa')]}};
\ No newline at end of file
+var _0x28b7=['sequelize','exports','BOOLEAN','star','TEXT','STRING','DATE','ENUM','out'];(function(_0x1cd43e,_0x3c9426){var _0x2d32fa=function(_0x2c22b4){while(--_0x2c22b4){_0x1cd43e['push'](_0x1cd43e['shift']());}};_0x2d32fa(++_0x3c9426);}(_0x28b7,0x1dd));var _0x728b=function(_0x4a3baa,_0x19cb30){_0x4a3baa=_0x4a3baa-0x0;var _0x1e8aef=_0x28b7[_0x4a3baa];return _0x1e8aef;};'use strict';var Sequelize=require(_0x728b('0x0'));module[_0x728b('0x1')]={'closed':{'type':Sequelize[_0x728b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':_0x728b('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x728b('0x4')]},'mailTranscript':{'type':Sequelize[_0x728b('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x728b('0x6')]},'disposition':{'type':Sequelize[_0x728b('0x5')]},'secondDisposition':{'type':Sequelize[_0x728b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x728b('0x5')]},'note':{'type':Sequelize[_0x728b('0x5')]},'browserName':{'type':Sequelize[_0x728b('0x5')]},'browserVersion':{'type':Sequelize[_0x728b('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x728b('0x5')]},'deviceModel':{'type':Sequelize[_0x728b('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x728b('0x5')]},'referer':{'type':Sequelize[_0x728b('0x4')]},'customerIp':{'type':Sequelize[_0x728b('0x5')]},'formData':{'type':Sequelize[_0x728b('0x4')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x728b('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x728b('0x7')]('in',_0x728b('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x728b('0x5')]},'customerPort':{'type':Sequelize[_0x728b('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x728b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index e06125d..85abb50 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 _0xa802=['mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','ContactId','UserId','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','ids','order','sort','where','ChatInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','getMyMessages','hasOwnProperty','secret','includeAgent','alias','findAll','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','tmp','server','files','attachments','transcript-%d-%s.zip','push','direction','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','Contact','firstName','lastName','read','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','bluebird','mustache','util','path','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','end','stack','name','render','body','contact','agent','interaction','account','index','map','ChatInteraction','type','key','getOptions','query','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','find','create','params','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','closed','attachmentUpload','file','originalname','basename'];(function(_0x342ebe,_0x459563){var _0x2898af=function(_0x4bf08d){while(--_0x4bf08d){_0x342ebe['push'](_0x342ebe['shift']());}};_0x2898af(++_0x459563);}(_0xa802,0x67));var _0x2a80=function(_0x18dfcf,_0x4709ca){_0x18dfcf=_0x18dfcf-0x0;var _0x422850=_0xa802[_0x18dfcf];return _0x422850;};'use strict';var rimraf=require(_0x2a80('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2a80('0x1'));var Mustache=require(_0x2a80('0x2'));var util=require(_0x2a80('0x3'));var path=require(_0x2a80('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2a80('0x5'));var Redis=require(_0x2a80('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x2a80('0x7'));var pdf=require(_0x2a80('0x8'));var logger=require(_0x2a80('0x9'))('api');var config=require(_0x2a80('0xa'));var db=require(_0x2a80('0xb'))['db'];config[_0x2a80('0xc')]=_[_0x2a80('0xd')](config['redis'],{'host':_0x2a80('0xe'),'port':0x18eb});var socket=require(_0x2a80('0xf'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2a80('0x10')](socket);var jayson=require(_0x2a80('0x11'));var client=jayson[_0x2a80('0x12')][_0x2a80('0x13')]({'port':0x232b});var client9004=jayson[_0x2a80('0x12')][_0x2a80('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x5819de,_0x3ade2c,_0x15b660,_0x56e43f){return new BPromise(function(_0xc17ce7,_0x449713){var _0x5d8f21=_0x56e43f||client;return _0x5d8f21[_0x2a80('0x14')](_0x5819de,_0x15b660)['then'](function(_0x1de562){logger[_0x2a80('0x15')](_0x2a80('0x16'),_0x3ade2c,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3ade2c,'request\x20sent',JSON[_0x2a80('0x17')](_0x1de562));if(_0x1de562['error']){if(_0x1de562[_0x2a80('0x18')][_0x2a80('0x19')]===0x1f4){logger[_0x2a80('0x18')](_0x2a80('0x16'),_0x3ade2c,_0x1de562['error'][_0x2a80('0x1a')]);return _0x449713(_0x1de562[_0x2a80('0x18')][_0x2a80('0x1a')]);}logger['error'](_0x2a80('0x16'),_0x3ade2c,_0x1de562['error']['message']);return _0xc17ce7(_0x1de562[_0x2a80('0x18')][_0x2a80('0x1a')]);}else{logger[_0x2a80('0x15')](_0x2a80('0x16'),_0x3ade2c,_0x2a80('0x1b'));_0xc17ce7(_0x1de562['result'][_0x2a80('0x1a')]);}})[_0x2a80('0x1c')](function(_0x20424b){logger[_0x2a80('0x18')](_0x2a80('0x16'),_0x3ade2c,_0x20424b);_0x449713(_0x20424b);});});}function respondWithStatusCode(_0x4f9185,_0x3a2d0e){_0x3a2d0e=_0x3a2d0e||0xcc;return function(_0x49c2c6){if(_0x49c2c6){return _0x4f9185[_0x2a80('0x1d')](_0x3a2d0e);}return _0x4f9185['status'](_0x3a2d0e)['end']();};}function respondWithResult(_0x16e922,_0x483f92){_0x483f92=_0x483f92||0xc8;return function(_0x39f2de){if(_0x39f2de){return _0x16e922[_0x2a80('0x1e')](_0x483f92)[_0x2a80('0x1f')](_0x39f2de);}};}function respondWithFilteredResult(_0x47bfb2,_0x2803e5){return function(_0xb4fdfa){if(_0xb4fdfa){var _0x15059d=typeof _0x2803e5[_0x2a80('0x20')]===_0x2a80('0x21')&&typeof _0x2803e5[_0x2a80('0x22')]==='undefined';var _0x2ef3b7=_0xb4fdfa['count'];var _0x5bfe69=_0x15059d?0x0:_0x2803e5[_0x2a80('0x20')];var _0x23c8a5=_0x15059d?_0xb4fdfa[_0x2a80('0x23')]:_0x2803e5[_0x2a80('0x20')]+_0x2803e5[_0x2a80('0x22')];var _0x1a4903;if(_0x23c8a5>=_0x2ef3b7){_0x23c8a5=_0x2ef3b7;_0x1a4903=0xc8;}else{_0x1a4903=0xce;}_0x47bfb2[_0x2a80('0x1e')](_0x1a4903);return _0x47bfb2[_0x2a80('0x24')](_0x2a80('0x25'),_0x5bfe69+'-'+_0x23c8a5+'/'+_0x2ef3b7)['json'](_0xb4fdfa);}return null;};}function saveUpdates(_0x58d46f){return function(_0x3ad276){if(_0x3ad276){return _0x3ad276[_0x2a80('0x26')](_0x58d46f)['then'](function(_0x1078c3){return _0x1078c3;});}return null;};}function removeEntity(_0x46c4b6){return function(_0xbde15a){if(_0xbde15a){return _0xbde15a[_0x2a80('0x27')]()[_0x2a80('0x28')](function(){_0x46c4b6[_0x2a80('0x1e')](0xcc)[_0x2a80('0x29')]();});}};}function handleEntityNotFound(_0x5afffb){return function(_0xf3b647){if(!_0xf3b647){_0x5afffb['sendStatus'](0x194);}return _0xf3b647;};}function handleError(_0x134638,_0x4ef250){_0x4ef250=_0x4ef250||0x1f4;return function(_0x136d71){logger['error'](_0x136d71[_0x2a80('0x2a')]);if(_0x136d71[_0x2a80('0x2b')]){delete _0x136d71[_0x2a80('0x2b')];}_0x134638[_0x2a80('0x1e')](_0x4ef250)['send'](_0x136d71);};}function getMustacheRender(_0xca47ac,_0x341d12){return Mustache[_0x2a80('0x2c')](_0xca47ac,_['merge'](_0x341d12[_0x2a80('0x2d')],{'contact':_0x341d12[_0x2a80('0x2e')],'message':_0x341d12[_0x2a80('0x1a')],'agent':_0x341d12[_0x2a80('0x2f')],'interaction':_0x341d12[_0x2a80('0x30')],'account':_0x341d12[_0x2a80('0x31')]}))||'';}exports[_0x2a80('0x32')]=function(_0x3ce1e6,_0x33115a){var _0x9edccb={};var _0x2f9a99=_[_0x2a80('0x33')](db[_0x2a80('0x34')]['rawAttributes'],function(_0x810e4a){return{'name':_0x810e4a['fieldName'],'type':_0x810e4a[_0x2a80('0x35')][_0x2a80('0x36')]};});_0x9edccb=qs[_0x2a80('0x37')](_0x2f9a99,_0x3ce1e6);return interaction['findAll']('chat',_0x3ce1e6[_0x2a80('0x38')],_0x3ce1e6['user'],_0x9edccb,_0x2f9a99)[_0x2a80('0x28')](respondWithFilteredResult(_0x33115a,_0x9edccb))[_0x2a80('0x1c')](handleError(_0x33115a,null));};exports[_0x2a80('0x39')]=function(_0x405982,_0xdb004f){var _0x18c957={'raw':![],'where':{'id':_0x405982['params']['id']}},_0x5e934b={};_0x5e934b[_0x2a80('0x3a')]=_[_0x2a80('0x3b')](db[_0x2a80('0x34')][_0x2a80('0x3c')]);_0x5e934b[_0x2a80('0x38')]=_[_0x2a80('0x3b')](_0x405982[_0x2a80('0x38')]);_0x5e934b[_0x2a80('0x3d')]=_[_0x2a80('0x3e')](_0x5e934b[_0x2a80('0x3a')],_0x5e934b[_0x2a80('0x38')]);_0x18c957[_0x2a80('0x3f')]=_[_0x2a80('0x3e')](_0x5e934b[_0x2a80('0x3a')],qs['fields'](_0x405982[_0x2a80('0x38')][_0x2a80('0x40')]));_0x18c957[_0x2a80('0x3f')]=_0x18c957[_0x2a80('0x3f')][_0x2a80('0x41')]?_0x18c957[_0x2a80('0x3f')]:_0x5e934b[_0x2a80('0x3a')];if(_0x405982[_0x2a80('0x38')][_0x2a80('0x42')]){_0x18c957['include']=[{'all':!![]}];}_0x18c957=_['merge']({},_0x18c957,_0x405982['options']);return db[_0x2a80('0x34')][_0x2a80('0x43')](_0x18c957)[_0x2a80('0x28')](handleEntityNotFound(_0xdb004f,null))['then'](respondWithResult(_0xdb004f,null))[_0x2a80('0x1c')](handleError(_0xdb004f,null));};exports[_0x2a80('0x44')]=function(_0x596960,_0x4a29a2){return db[_0x2a80('0x34')][_0x2a80('0x44')](_0x596960[_0x2a80('0x2d')],{})[_0x2a80('0x28')](respondWithResult(_0x4a29a2,0xc9))[_0x2a80('0x1c')](handleError(_0x4a29a2,null));};exports[_0x2a80('0x26')]=function(_0x1f4735,_0x166e60){if(_0x1f4735[_0x2a80('0x2d')]['id']){delete _0x1f4735['body']['id'];}return db['ChatInteraction'][_0x2a80('0x43')]({'where':{'id':_0x1f4735[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x166e60,null))[_0x2a80('0x28')](saveUpdates(_0x1f4735[_0x2a80('0x2d')],null))[_0x2a80('0x28')](respondWithResult(_0x166e60,null))[_0x2a80('0x1c')](handleError(_0x166e60,null));};exports[_0x2a80('0x27')]=function(_0x399513,_0x2380fe){return db[_0x2a80('0x34')]['find']({'where':{'id':_0x399513[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x2380fe,null))['then'](removeEntity(_0x2380fe,null))[_0x2a80('0x1c')](handleError(_0x2380fe,null));};exports[_0x2a80('0x46')]=function(_0x596ad7,_0x478d02){return db[_0x2a80('0x34')][_0x2a80('0x46')]()['then'](respondWithResult(_0x478d02,null))['catch'](handleError(_0x478d02,null));};exports[_0x2a80('0x47')]=function(_0x4653a1,_0x5eb007){var _0x35ec34=_0x4653a1[_0x2a80('0x45')]['id'];var _0x1e6ae8;var _0x5732b9;var _0x2410ae;return db[_0x2a80('0x34')][_0x2a80('0x48')]({'where':{'id':_0x35ec34}})['then'](function(_0x37a375){_0x1e6ae8=_0x37a375;return db['ChatWebsite'][_0x2a80('0x48')]({'where':{'id':_0x37a375[_0x2a80('0x49')]},'attributes':['id',_0x2a80('0x4a'),_0x2a80('0x4b'),_0x2a80('0x4c'),_0x2a80('0x4d'),_0x2a80('0x4e')],'raw':!![]});})[_0x2a80('0x28')](function(_0x285df3){if(_0x285df3&&_0x285df3[_0x2a80('0x4a')]&&_0x285df3[_0x2a80('0x4b')]){_0x5732b9=_0x285df3;var _0x5e354d={'interaction':{'id':_0x35ec34},'agent':{'id':_0x4653a1['user']['id'],'name':_0x4653a1[_0x2a80('0x4f')]['name'],'fullname':_0x4653a1[_0x2a80('0x4f')][_0x2a80('0x50')],'email':_0x4653a1[_0x2a80('0x4f')][_0x2a80('0x51')]},'contact':_0x4653a1[_0x2a80('0x2d')]['contact'],'account':_0x4653a1['body']['account']};var _0x49cbeb={'rejectUnauthorized':![],'method':_0x2a80('0x52'),'url':_0x2a80('0x53'),'headers':{'X-APIKEY':_0x285df3[_0x2a80('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4653a1[_0x2a80('0x4f')][_0x2a80('0x51')]],'buttons':null,'topic':_0x5732b9[_0x2a80('0x4c')],'note':_[_0x2a80('0x54')](_0x5732b9[_0x2a80('0x4d')])?null:getMustacheRender(_0x5732b9[_0x2a80('0x4d')],_0x5e354d),'metadata':null},'redirect':_0x2a80('0x55'),'json':!![]};try{if(!_['isNull'](_0x5732b9['vidaooMetadata'])){var _0x4bf632=getMustacheRender(_0x5732b9['vidaooMetadata'],_0x5e354d);var _0x269fc2=JSON[_0x2a80('0x56')](_0x4bf632);_0x49cbeb[_0x2a80('0x2d')][_0x2a80('0x57')]=_0x269fc2;}}catch(_0x4a938f){throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))](_0x2a80('0x5a'));}return rp(_0x49cbeb);}else{throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x15db2c){_0x2410ae=_0x15db2c;if(_0x2410ae['id']){var _0x4811da={'body':_0x2410ae['join_url'],'ChatWebsiteId':_0x5732b9['id'],'ChatInteractionId':_0x1e6ae8['id'],'direction':_0x2a80('0x5b'),'UserId':_0x4653a1[_0x2a80('0x4f')]['id']};return db[_0x2a80('0x5c')]['create'](_0x4811da,{});}else{throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x1e6ae8['updateAttributes']({'vidaooSessionId':_0x2410ae['id']});})['then'](respondWithResult(_0x5eb007,null))['catch'](handleError(_0x5eb007,null));};exports[_0x2a80('0x5d')]=function(_0x313fb1,_0x3022a1){if(_0x313fb1[_0x2a80('0x2d')]['id']){delete _0x313fb1['body']['id'];}return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x313fb1[_0x2a80('0x45')]['id']},'include':[{'model':db[_0x2a80('0x5e')],'as':'Contact'}]})[_0x2a80('0x28')](handleEntityNotFound(_0x3022a1,null))[_0x2a80('0x28')](saveUpdates(_0x313fb1[_0x2a80('0x2d')],null))[_0x2a80('0x28')](respondWithResult(_0x3022a1,null))['catch'](handleError(_0x3022a1,null));};exports[_0x2a80('0x5f')]=function(_0x3fdd1c,_0x432284){if(_0x3fdd1c['body']['id']){delete _0x3fdd1c['body']['id'];}return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x3fdd1c[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](function(_0x79a41c){if(!_0x79a41c){logger[_0x2a80('0x18')](_0x2a80('0x60'),_0x2a80('0x5f'),0x194,'entity\x20not\x20found');_0x432284['sendStatus'](0x194);}else{if(_0x79a41c['UserId']){throw new db[(_0x2a80('0x58'))][(_0x2a80('0x59'))]('Interaction\x20already\x20assigned');}}return _0x79a41c;})[_0x2a80('0x28')](function(_0xd37d00){if(_0xd37d00){return _0xd37d00[_0x2a80('0x26')]({'closed':_0x3fdd1c[_0x2a80('0x2d')][_0x2a80('0x61')],'disposition':_0x3fdd1c[_0x2a80('0x2d')]['disposition']})[_0x2a80('0x28')](function(_0x747ebe){return _0x747ebe;});}})[_0x2a80('0x28')](function(){return respondWithRpcPromise('AbandonInteraction',_0x2a80('0x5f'),_0x3fdd1c[_0x2a80('0x2d')],client9004);})[_0x2a80('0x28')](respondWithResult(_0x432284,null))['catch'](handleError(_0x432284,null));};exports[_0x2a80('0x62')]=function(_0x55a432,_0x1e9f02){_0x55a432[_0x2a80('0x2d')][_0x2a80('0x2b')]=_0x55a432[_0x2a80('0x63')][_0x2a80('0x64')];_0x55a432['body'][_0x2a80('0x65')]=_0x55a432['file']['filename'];_0x55a432[_0x2a80('0x2d')][_0x2a80('0x35')]=_0x55a432[_0x2a80('0x63')][_0x2a80('0x66')];return db[_0x2a80('0x67')][_0x2a80('0x44')](_0x55a432[_0x2a80('0x2d')])[_0x2a80('0x28')](respondWithResult(_0x1e9f02,0xc9))['catch'](handleError(_0x1e9f02,null));};exports['attachmentDownload']=function(_0x2b9c7e,_0x55b52a){return db[_0x2a80('0x34')]['findOne']({'where':{'id':_0x2b9c7e[_0x2a80('0x45')]['id']},'raw':!![]})[_0x2a80('0x28')](handleEntityNotFound(_0x55b52a,null))[_0x2a80('0x28')](function(_0x56968c){if(_0x56968c){if(_0x56968c[_0x2a80('0x61')]){return _0x55b52a['status'](0x193)[_0x2a80('0x1f')]({'status':0x193,'message':_0x2a80('0x68')});}return db['Attachment'][_0x2a80('0x48')]({'where':{'id':_0x2b9c7e[_0x2a80('0x38')][_0x2a80('0x69')]},'raw':!![]})['then'](handleEntityNotFound(_0x55b52a,null));}})['then'](function(_0x1363dd){if(_0x1363dd){var _0x28771d=_0x1363dd[_0x2a80('0x6a')]!==null;var _0x2dd35f=path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],_0x2a80('0x6d'));if(_0x28771d){_0x2dd35f=path[_0x2a80('0x6b')](_0x2dd35f,_0x2a80('0x6e'));}var _0x170736=path['join'](_0x2dd35f,_0x1363dd['basename']);return _0x55b52a[_0x2a80('0x6f')](_0x170736);}})['catch'](handleError(_0x55b52a,null));};exports[_0x2a80('0x70')]=function(_0x2c843a,_0x4cdd96){var _0x5cb57b=null;var _0x24bd89=null;var _0x5d6511=null;if(_0x2c843a['body']['id']){delete _0x2c843a[_0x2a80('0x2d')]['id'];}if(_0x2c843a['body'][_0x2a80('0x71')]){_0x5d6511=path['join'](config['root'],'server/files/chat/upload/',util[_0x2a80('0x72')](_0x2a80('0x73'),Date['now']()));_0x2c843a[_0x2a80('0x2d')][_0x2a80('0x74')]=_0x5d6511;}return db['ChatInteraction'][_0x2a80('0x43')]({'where':{'id':_0x2c843a[_0x2a80('0x45')]['id']},'include':[{'model':db[_0x2a80('0x5c')],'as':_0x2a80('0x75'),'include':[{'model':db[_0x2a80('0x76')],'as':'User'}]}]})[_0x2a80('0x28')](handleEntityNotFound(_0x4cdd96,null))[_0x2a80('0x28')](saveUpdates(_0x2c843a[_0x2a80('0x2d')],null))[_0x2a80('0x28')](function(_0x3542fb){if(_0x3542fb){_0x5cb57b=_0x3542fb;return db[_0x2a80('0x77')][_0x2a80('0x43')]({'where':{'id':_0x5cb57b[_0x2a80('0x49')]}});}})[_0x2a80('0x28')](function(_0x499360){if(_0x499360){_0x24bd89=_0x499360;return db[_0x2a80('0x5e')][_0x2a80('0x43')]({'where':{'id':_0x5cb57b[_0x2a80('0x78')]}});}})[_0x2a80('0x28')](function(_0x2bdc5f){if(_0x2bdc5f){if(_0x5d6511){var _0x420c5a=null;for(var _0x327b83=0x1;_0x327b83<_0x5cb57b['Messages'][_0x2a80('0x41')];++_0x327b83){_0x420c5a=_0x5cb57b[_0x2a80('0x75')][_0x327b83];var _0x4e8382=_0x420c5a[_0x2a80('0x79')]?util['format'](_0x2a80('0x7a'),_0x24bd89[_0x2a80('0x7b')],_0x420c5a['UserId']):_0x2a80('0x7c');var _0x27f868=_0x2c843a[_0x2a80('0x2d')][_0x2a80('0x7d')]||util[_0x2a80('0x72')](_0x2a80('0x7a'),'Visitor',_0x420c5a[_0x2a80('0x78')]);switch(_0x24bd89[_0x2a80('0x7e')]){case _0x2a80('0x7f'):_0x4e8382=_0x420c5a[_0x2a80('0x79')]?util[_0x2a80('0x72')]('%s%d',_0x24bd89['agentAlias'],_0x420c5a[_0x2a80('0x79')]):_0x2a80('0x7c');break;case _0x2a80('0x80'):_0x4e8382=_0x420c5a[_0x2a80('0x79')]?_0x420c5a[_0x2a80('0x76')]['alias']||_0x420c5a[_0x2a80('0x76')]['fullname']:_0x2a80('0x7c');break;case'agent_fullname':_0x4e8382=_0x420c5a[_0x2a80('0x79')]?_0x420c5a[_0x2a80('0x76')]['fullname']:_0x2a80('0x7c');break;default:_0x4e8382=_0x420c5a[_0x2a80('0x79')]?util['format'](_0x2a80('0x7a'),_0x24bd89[_0x2a80('0x7b')],_0x420c5a[_0x2a80('0x79')]):_0x2a80('0x7c');}var _0x511070=util[_0x2a80('0x72')](_0x2a80('0x81'),moment(_0x420c5a[_0x2a80('0x82')])[_0x2a80('0x72')](_0x2a80('0x83')),_0x420c5a['direction']==='in'?_0x27f868:_0x4e8382,_0x420c5a[_0x2a80('0x2d')]);if(!_0x420c5a['secret']){fs[_0x2a80('0x84')](_0x5d6511,_0x511070);}}return db[_0x2a80('0x85')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2a80('0x86'),'raw':!![],'include':[{'model':db[_0x2a80('0x87')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x41370e){if(!_0x41370e||!_0x41370e[_0x2a80('0x86')]||!_0x2c843a[_0x2a80('0x2d')])return _0x5cb57b;var _0x10d27d=_0x41370e[_0x2a80('0x88')]();return respondWithRpcPromise(_0x2a80('0x89'),_0x2a80('0x8a'),{'account':_0x10d27d,'message':{'from':util[_0x2a80('0x72')](_0x2a80('0x8b'),_0x41370e[_0x2a80('0x2b')],_0x41370e[_0x2a80('0x51')]||_0x41370e[_0x2a80('0x86')][_0x2a80('0x4f')]),'to':_0x2c843a[_0x2a80('0x2d')]['mailTranscript'],'subject':_0x2a80('0x8c'),'text':util[_0x2a80('0x72')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2c843a['body'][_0x2a80('0x71')]),'attachments':[{'path':_0x5d6511}]}})[_0x2a80('0x28')](function(){return _0x5cb57b;})[_0x2a80('0x1c')](function(_0x265256){logger['error'](_0x265256);});})['then'](respondWithStatusCode(_0x4cdd96,0xc8))[_0x2a80('0x1c')](handleError(_0x4cdd96,null));};exports[_0x2a80('0x8d')]=function(_0x569a43,_0x1d5f6f){return db[_0x2a80('0x5c')][_0x2a80('0x43')]({'where':{'id':_0x569a43['params']['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x1d5f6f,null))[_0x2a80('0x28')](function(_0x840be0){if(_0x840be0){return _0x840be0['addMessage'](_0x569a43['body']['ids'],_[_0x2a80('0x8e')](_0x569a43[_0x2a80('0x2d')],[_0x2a80('0x8f'),'id'])||{});}})['then'](respondWithResult(_0x1d5f6f,null))['catch'](handleError(_0x1d5f6f,null));};exports['getMessages']=function(_0x2f851c,_0x52e202){var _0x2633bd={'raw':![],'where':{}};var _0x36bc88={};var _0x54b6a5={'count':0x0,'rows':[]};return db[_0x2a80('0x34')]['findOne']({'where':{'id':_0x2f851c[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x52e202,null))[_0x2a80('0x28')](function(_0x17dae5){if(_0x17dae5){_0x36bc88[_0x2a80('0x3a')]=_[_0x2a80('0x3b')](db['ChatMessage']['rawAttributes']);_0x36bc88[_0x2a80('0x38')]=_[_0x2a80('0x3b')](_0x2f851c['query']);_0x36bc88[_0x2a80('0x3d')]=_[_0x2a80('0x3e')](_0x36bc88[_0x2a80('0x3a')],_0x36bc88[_0x2a80('0x38')]);_0x2633bd[_0x2a80('0x3f')]=_[_0x2a80('0x3e')](_0x36bc88['model'],qs[_0x2a80('0x40')](_0x2f851c['query'][_0x2a80('0x40')]));_0x2633bd['attributes']=_0x2633bd[_0x2a80('0x3f')][_0x2a80('0x41')]?_0x2633bd[_0x2a80('0x3f')]:_0x36bc88[_0x2a80('0x3a')];if(!_0x2f851c[_0x2a80('0x38')]['hasOwnProperty']('nolimit')){_0x2633bd[_0x2a80('0x22')]=qs[_0x2a80('0x22')](_0x2f851c[_0x2a80('0x38')][_0x2a80('0x22')]);_0x2633bd[_0x2a80('0x20')]=qs[_0x2a80('0x20')](_0x2f851c[_0x2a80('0x38')][_0x2a80('0x20')]);}_0x2633bd[_0x2a80('0x90')]=qs[_0x2a80('0x91')](_0x2f851c[_0x2a80('0x38')][_0x2a80('0x91')]);_0x2633bd['where']=qs[_0x2a80('0x3d')](_['pick'](_0x2f851c['query'],_0x36bc88['filters']));_0x2633bd[_0x2a80('0x92')][_0x2a80('0x93')]=_0x17dae5['id'];if(_0x2f851c['query'][_0x2a80('0x94')]){_0x2633bd[_0x2a80('0x92')]=_[_0x2a80('0x95')](_0x2633bd[_0x2a80('0x92')],{'$or':_['map'](_0x2633bd[_0x2a80('0x3f')],function(_0x2aae8c){var _0x7d2b18={};_0x7d2b18[_0x2aae8c]={'$like':'%'+_0x2f851c[_0x2a80('0x38')][_0x2a80('0x94')]+'%'};return _0x7d2b18;})});}if(_0x2f851c[_0x2a80('0x38')]['$gte']){var _0x33d5d=_0x2f851c['query'][_0x2a80('0x96')][_0x2a80('0x97')](',');var _0x5e007f={};_0x5e007f[_0x33d5d[0x0]]={'$gte':moment(_0x33d5d[0x1])[_0x2a80('0x72')](_0x2a80('0x98'))};_0x2633bd[_0x2a80('0x92')]=_[_0x2a80('0x95')](_0x2633bd['where'],_0x5e007f);}_0x2633bd=_[_0x2a80('0x95')]({},_0x2633bd,_0x2f851c[_0x2a80('0x99')]);return db[_0x2a80('0x5c')][_0x2a80('0x23')]({'where':_0x2633bd[_0x2a80('0x92')]})[_0x2a80('0x28')](function(_0x342a29){_0x54b6a5[_0x2a80('0x23')]=_0x342a29;if(_0x2f851c[_0x2a80('0x38')][_0x2a80('0x42')]){_0x2633bd[_0x2a80('0x9a')]=[{'all':!![]}];}return db[_0x2a80('0x5c')]['findAll'](_0x2633bd);})[_0x2a80('0x28')](function(_0x19ccee){_0x54b6a5[_0x2a80('0x9b')]=_0x19ccee;return _0x54b6a5;});}})[_0x2a80('0x28')](respondWithFilteredResult(_0x52e202,_0x2633bd))[_0x2a80('0x1c')](handleError(_0x52e202,null));};exports[_0x2a80('0x9c')]=function(_0x5a218c,_0x4be3ec){var _0x58da3a={'where':{}},_0x2abf5c={},_0x2b40cc={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2a80('0x48')]({'where':{'id':_0x5a218c[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x4be3ec,null))[_0x2a80('0x28')](function(_0x34ee72){if(_0x34ee72){_0x2abf5c['model']=_[_0x2a80('0x3b')](db[_0x2a80('0x5c')]['rawAttributes']);_0x2abf5c['query']=_[_0x2a80('0x3b')](_0x5a218c[_0x2a80('0x38')]);_0x2abf5c[_0x2a80('0x3d')]=_['intersection'](_0x2abf5c[_0x2a80('0x3a')],_0x2abf5c['query']);_0x58da3a[_0x2a80('0x3f')]=_[_0x2a80('0x3e')](_0x2abf5c[_0x2a80('0x3a')],qs['fields'](_0x5a218c[_0x2a80('0x38')][_0x2a80('0x40')]));_0x58da3a['attributes']=_0x58da3a['attributes'][_0x2a80('0x41')]?_0x58da3a[_0x2a80('0x3f')]:_0x2abf5c[_0x2a80('0x3a')];if(!_0x5a218c['query'][_0x2a80('0x9d')]('nolimit')){_0x58da3a[_0x2a80('0x22')]=qs[_0x2a80('0x22')](_0x5a218c[_0x2a80('0x38')][_0x2a80('0x22')]);_0x58da3a[_0x2a80('0x20')]=qs['offset'](_0x5a218c['query']['offset']);}_0x58da3a[_0x2a80('0x90')]=qs['sort'](_0x5a218c[_0x2a80('0x38')]['sort']);_0x58da3a[_0x2a80('0x92')]=qs[_0x2a80('0x3d')](_['pick'](_0x5a218c[_0x2a80('0x38')],_0x2abf5c['filters']));_0x58da3a['where'][_0x2a80('0x93')]=_0x34ee72['id'];if(_0x5a218c[_0x2a80('0x38')][_0x2a80('0x94')]){_0x58da3a[_0x2a80('0x92')]=_['merge'](_0x58da3a[_0x2a80('0x92')],{'$or':_[_0x2a80('0x33')](_0x58da3a[_0x2a80('0x3f')],function(_0x3a4a2c){var _0xe73cf3={};_0xe73cf3[_0x3a4a2c]={'$like':'%'+_0x5a218c['query']['filter']+'%'};return _0xe73cf3;})});}_0x58da3a[_0x2a80('0x92')][_0x2a80('0x9e')]=![];if(_0x5a218c[_0x2a80('0x38')]['id']){_0x58da3a['where']['id']={'$gt':_0x5a218c[_0x2a80('0x38')]['id']};}_0x58da3a=_[_0x2a80('0x95')]({},_0x58da3a,_0x5a218c[_0x2a80('0x99')]);return db[_0x2a80('0x5c')][_0x2a80('0x23')]({'where':_0x58da3a[_0x2a80('0x92')]})[_0x2a80('0x28')](function(_0x21a697){_0x2b40cc[_0x2a80('0x23')]=_0x21a697;_0x58da3a[_0x2a80('0x9a')]=[];if(_0x5a218c[_0x2a80('0x38')][_0x2a80('0x9f')]){_0x58da3a[_0x2a80('0x9a')]['push']({'model':db['User'],'as':_0x2a80('0x76'),'attributes':['id',_0x2a80('0x50'),_0x2a80('0xa0')]});}if(_0x5a218c[_0x2a80('0x38')][_0x2a80('0x42')]){_0x58da3a['include']=[{'all':!![]}];}return db[_0x2a80('0x5c')][_0x2a80('0xa1')](_0x58da3a);})[_0x2a80('0x28')](function(_0x5afebe){_0x2b40cc[_0x2a80('0x9b')]=_0x5afebe;return _0x2b40cc;});}})[_0x2a80('0x28')](respondWithFilteredResult(_0x4be3ec,_0x58da3a))['catch'](handleError(_0x4be3ec,null));};exports[_0x2a80('0xa2')]=function(_0x69bc1d,_0xdbac0d){return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x69bc1d['params']['id']}})['then'](handleEntityNotFound(_0xdbac0d,null))[_0x2a80('0x28')](function(_0x3e0595){if(_0x3e0595){return _0x3e0595[_0x2a80('0xa3')](_0x69bc1d[_0x2a80('0x2d')]['ids'],_[_0x2a80('0x8e')](_0x69bc1d[_0x2a80('0x2d')],[_0x2a80('0x8f'),'id'])||{})[_0x2a80('0xa4')](function(){return db[_0x2a80('0xa5')][_0x2a80('0xa1')]({'attributes':['id',_0x2a80('0x2b'),_0x2a80('0xa6')],'where':{'id':_0x69bc1d[_0x2a80('0x2d')]['ids']}});})[_0x2a80('0x28')](function(_0x513eec){socket[_0x2a80('0xa7')](_0x2a80('0xa8'),{'id':Number(_0x69bc1d[_0x2a80('0x45')]['id']),'tags':_0x513eec||[]});return{'id':Number(_0x69bc1d['params']['id']),'tags':_0x513eec||[]};});}})[_0x2a80('0x28')](respondWithResult(_0xdbac0d,null))[_0x2a80('0x1c')](handleError(_0xdbac0d,null));};exports[_0x2a80('0xa9')]=function(_0x52a402,_0x4da365){return db['ChatInteraction'][_0x2a80('0x43')]({'where':{'id':_0x52a402[_0x2a80('0x45')]['id']}})[_0x2a80('0x28')](handleEntityNotFound(_0x4da365,null))[_0x2a80('0x28')](function(_0x412093){if(_0x412093){return _0x412093[_0x2a80('0xa9')](_0x52a402[_0x2a80('0x38')]['ids']);}})[_0x2a80('0x28')](respondWithStatusCode(_0x4da365,null))[_0x2a80('0x1c')](handleError(_0x4da365,null));};exports[_0x2a80('0x6f')]=function(_0x59db0d,_0x2afa41){var _0x503f3d=moment()[_0x2a80('0xaa')]()[_0x2a80('0xab')]();var _0x69ffab=path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],'server','files',_0x2a80('0xac'));var _0x111dfe=path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],_0x2a80('0xad'),_0x2a80('0xae'),_0x2a80('0xaf'));var _0x988ee3=path['join'](_0x69ffab,_0x503f3d);var _0xa7224b=util[_0x2a80('0x72')](_0x2a80('0xb0'),_0x59db0d[_0x2a80('0x45')]['id'],_0x503f3d);var _0x46d2e2=path[_0x2a80('0x6b')](_0x69ffab,_0xa7224b);var _0x28002a=[];_0x28002a['push']({'model':db[_0x2a80('0x76')],'as':_0x2a80('0x76'),'attributes':['id','fullname'],'raw':!![]});_0x28002a[_0x2a80('0xb1')]({'model':db[_0x2a80('0x5e')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x59db0d['query'][_0x2a80('0xaf')]){_0x28002a[_0x2a80('0xb1')]({'model':db[_0x2a80('0x67')],'as':_0x2a80('0x67'),'raw':!![]});}var _0x3bc1fd=[{'model':db[_0x2a80('0x5c')],'as':_0x2a80('0x75'),'attributes':['id',_0x2a80('0x2d'),_0x2a80('0x82'),_0x2a80('0xb2'),'secret','read'],'include':_0x28002a}];_0x3bc1fd[_0x2a80('0xb1')]({'model':db[_0x2a80('0x77')],'as':_0x2a80('0xb3'),'attributes':['id',_0x2a80('0x2b')]});_0x3bc1fd[_0x2a80('0xb1')]({'model':db[_0x2a80('0x76')],'as':_0x2a80('0xb4'),'attributes':['id',_0x2a80('0x50')]});return db[_0x2a80('0x34')][_0x2a80('0x43')]({'where':{'id':_0x59db0d[_0x2a80('0x45')]['id']},'include':_0x3bc1fd})[_0x2a80('0x28')](handleEntityNotFound(_0x2afa41,null))[_0x2a80('0x28')](function(_0x5ddf5c){if(_0x5ddf5c){var _0x4cc4ec=_0x5ddf5c[_0x2a80('0xb5')]({'plain':!![]});fs[_0x2a80('0xb6')](_0x988ee3);var _0x5d6ff2={'channel':_0x2a80('0xb7'),'account':_0x4cc4ec[_0x2a80('0xb3')][_0x2a80('0x2b')],'agent':_0x4cc4ec[_0x2a80('0xb4')]?_0x4cc4ec[_0x2a80('0xb4')][_0x2a80('0x50')]:_0x2a80('0xb8'),'createdAt':moment(_0x4cc4ec[_0x2a80('0x82')])[_0x2a80('0x72')](_0x2a80('0x98'))['toString'](),'closedAt':_0x4cc4ec[_0x2a80('0x61')]?moment(_0x4cc4ec[_0x2a80('0xb9')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4cc4ec[_0x2a80('0xba')],'chatInfo':{'browser':_0x4cc4ec['browserName'],'os':_0x4cc4ec['osName'],'referer':_0x4cc4ec['referer'],'customerIp':_0x4cc4ec[_0x2a80('0xbb')],'customerPort':_0x4cc4ec[_0x2a80('0xbc')]?_0x4cc4ec[_0x2a80('0xbc')]:'N.A.'},'messages':_(_0x4cc4ec[_0x2a80('0x75')])[_0x2a80('0xbd')]()['filter']({'secret':![]})[_0x2a80('0x33')](function(_0x3ec931){if(_0x3ec931[_0x2a80('0x67')]){var _0x1c5251=path[_0x2a80('0x6b')](_0x111dfe,_0x3ec931[_0x2a80('0x67')][_0x2a80('0x65')]);if(fs[_0x2a80('0xbe')](_0x1c5251)){fs[_0x2a80('0xbf')](_0x1c5251)[_0x2a80('0xc0')](fs[_0x2a80('0xc1')](path[_0x2a80('0x6b')](_0x988ee3,_0x3ec931['Attachment']['basename'])));}}return{'date':moment(_0x3ec931[_0x2a80('0x82')])[_0x2a80('0x72')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3ec931['direction']===_0x2a80('0x5b')?_0x3ec931[_0x2a80('0x76')]?_0x3ec931[_0x2a80('0x76')][_0x2a80('0x50')]:_0x2a80('0x7c'):_0x3ec931[_0x2a80('0xc2')][_0x2a80('0xc3')]+(_0x3ec931[_0x2a80('0xc2')][_0x2a80('0xc4')]?'\x20'+_0x3ec931[_0x2a80('0xc2')]['lastName']:''),'body':_0x3ec931[_0x2a80('0x67')]?_0x3ec931[_0x2a80('0x67')][_0x2a80('0x65')]:_0x3ec931[_0x2a80('0x2d')],'direction':_0x3ec931[_0x2a80('0xb2')]===_0x2a80('0x5b')?'A':'C','secret':_0x3ec931['secret'],'read':_0x3ec931[_0x2a80('0xc5')],'attachment':_0x3ec931[_0x2a80('0x67')]};})[_0x2a80('0xc6')]()};return ejs['renderFile'](path[_0x2a80('0x6b')](config[_0x2a80('0x6c')],_0x2a80('0xad'),_0x2a80('0xc7'),_0x2a80('0xc8')),{'interaction':_0x5d6ff2})[_0x2a80('0x28')](function(_0x442201){var _0x5374e9=path[_0x2a80('0x6b')](_0x988ee3,_0x2a80('0xc9')+_0x4cc4ec['id']+'-'+_0x503f3d+_0x2a80('0xca'));var _0x15dc02={'path':_0x5374e9,'channel':_0x2a80('0xb7'),'interactionId':_0x4cc4ec['id']};return pdf[_0x2a80('0xcb')](_0x442201,_0x15dc02);})[_0x2a80('0x28')](function(){return new Promise(function(_0x1f9bf8,_0x3bd597){zipdir(_0x988ee3,{'saveTo':_0x46d2e2},function(_0x51ecb2,_0x4e524c){if(_0x51ecb2)return _0x3bd597(_0x51ecb2);return _0x1f9bf8(_0x4e524c);});})[_0x2a80('0x28')](function(){return new BPromise(function(_0x13a087,_0x1f77e2){rimraf(_0x988ee3,function(_0x3569d3){if(_0x3569d3)_0x1f77e2(_0x3569d3);return _0x13a087();});});})[_0x2a80('0x28')](function(){return _0x2afa41[_0x2a80('0x6f')](_0x46d2e2,_0xa7224b,function(_0x586217){if(_0x586217){logger[_0x2a80('0x18')](_0x2a80('0xcc'),_0x586217);}else{fs['unlinkSync'](_0x46d2e2);}});});});}else{return _0x2afa41[_0x2a80('0x1d')](0xc8);}})[_0x2a80('0x1c')](handleError(_0x2afa41,null));};
\ No newline at end of file
+var _0xd463=['Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','CmContact','length','%s%d','agentAlias','System','customer','Visitor','ContactId','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','intersection','hasOwnProperty','nolimit','limit','sort','where','ChatInteractionId','filter','$gte','options','include','rows','getMyMessages','pick','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','transcript-%d-%s.zip','push','firstName','attachments','read','Owner','get','mkdirSync','Account','N.A.','toString','disposition','browserName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','lastName','value','renderFile','views','downloadInteraction.ejs','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','util','path','ejs','../../components/interaction/service','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','client','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','status','json','offset','undefined','count','set','update','then','destroy','end','stack','name','render','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','findAll','chat','show','params','model','keys','query','filters','fields','attributes','includeAll','find','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','parse'];(function(_0xdb255f,_0x3e9f0d){var _0x922e3c=function(_0x3da198){while(--_0x3da198){_0xdb255f['push'](_0xdb255f['shift']());}};_0x922e3c(++_0x3e9f0d);}(_0xd463,0x139));var _0x3d46=function(_0x5484f4,_0x4f2c3a){_0x5484f4=_0x5484f4-0x0;var _0x7f7dc9=_0xd463[_0x5484f4];return _0x7f7dc9;};'use strict';var rimraf=require(_0x3d46('0x0'));var zipdir=require(_0x3d46('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3d46('0x2'));var path=require(_0x3d46('0x3'));var ejs=require(_0x3d46('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x3d46('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x3d46('0x6'));var logger=require('../../config/logger')('api');var config=require(_0x3d46('0x7'));var db=require(_0x3d46('0x8'))['db'];config[_0x3d46('0x9')]=_[_0x3d46('0xa')](config[_0x3d46('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d46('0xb'))(new Redis(config[_0x3d46('0x9')]));require(_0x3d46('0xc'))[_0x3d46('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d46('0xe')]['http']({'port':0x232b});var client9004=jayson[_0x3d46('0xe')]['http']({'port':0x232c});function respondWithRpcPromise(_0x424dca,_0x38f9e8,_0x48ded,_0x18ec0b){return new BPromise(function(_0x285583,_0x378d28){var _0x51b499=_0x18ec0b||client;return _0x51b499['request'](_0x424dca,_0x48ded)['then'](function(_0x19b5f2){logger['info'](_0x3d46('0xf'),_0x38f9e8,_0x3d46('0x10'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x38f9e8,'request\x20sent',JSON['stringify'](_0x19b5f2));if(_0x19b5f2[_0x3d46('0x11')]){if(_0x19b5f2['error']['code']===0x1f4){logger['error'](_0x3d46('0xf'),_0x38f9e8,_0x19b5f2[_0x3d46('0x11')]['message']);return _0x378d28(_0x19b5f2[_0x3d46('0x11')][_0x3d46('0x12')]);}logger[_0x3d46('0x11')](_0x3d46('0xf'),_0x38f9e8,_0x19b5f2[_0x3d46('0x11')][_0x3d46('0x12')]);return _0x285583(_0x19b5f2['error'][_0x3d46('0x12')]);}else{logger[_0x3d46('0x13')](_0x3d46('0xf'),_0x38f9e8,_0x3d46('0x10'));_0x285583(_0x19b5f2[_0x3d46('0x14')][_0x3d46('0x12')]);}})[_0x3d46('0x15')](function(_0x501a80){logger[_0x3d46('0x11')](_0x3d46('0xf'),_0x38f9e8,_0x501a80);_0x378d28(_0x501a80);});});}function respondWithStatusCode(_0x3dc3dd,_0xb51e08){_0xb51e08=_0xb51e08||0xcc;return function(_0x2ec010){if(_0x2ec010){return _0x3dc3dd['sendStatus'](_0xb51e08);}return _0x3dc3dd[_0x3d46('0x16')](_0xb51e08)['end']();};}function respondWithResult(_0x28a58a,_0x2d52aa){_0x2d52aa=_0x2d52aa||0xc8;return function(_0x485c32){if(_0x485c32){return _0x28a58a[_0x3d46('0x16')](_0x2d52aa)[_0x3d46('0x17')](_0x485c32);}};}function respondWithFilteredResult(_0x21b97e,_0x2fcd83){return function(_0x5e46e5){if(_0x5e46e5){var _0x26c600=typeof _0x2fcd83[_0x3d46('0x18')]==='undefined'&&typeof _0x2fcd83['limit']===_0x3d46('0x19');var _0x2f135a=_0x5e46e5[_0x3d46('0x1a')];var _0x30f56a=_0x26c600?0x0:_0x2fcd83['offset'];var _0x53161b=_0x26c600?_0x5e46e5[_0x3d46('0x1a')]:_0x2fcd83[_0x3d46('0x18')]+_0x2fcd83['limit'];var _0x101381;if(_0x53161b>=_0x2f135a){_0x53161b=_0x2f135a;_0x101381=0xc8;}else{_0x101381=0xce;}_0x21b97e[_0x3d46('0x16')](_0x101381);return _0x21b97e[_0x3d46('0x1b')]('Content-Range',_0x30f56a+'-'+_0x53161b+'/'+_0x2f135a)[_0x3d46('0x17')](_0x5e46e5);}return null;};}function saveUpdates(_0x57ccc9){return function(_0x10a76b){if(_0x10a76b){return _0x10a76b[_0x3d46('0x1c')](_0x57ccc9)[_0x3d46('0x1d')](function(_0x46da00){return _0x46da00;});}return null;};}function removeEntity(_0x3f43f8){return function(_0x23544d){if(_0x23544d){return _0x23544d[_0x3d46('0x1e')]()[_0x3d46('0x1d')](function(){_0x3f43f8[_0x3d46('0x16')](0xcc)[_0x3d46('0x1f')]();});}};}function handleEntityNotFound(_0x44021a){return function(_0x2d57f2){if(!_0x2d57f2){_0x44021a['sendStatus'](0x194);}return _0x2d57f2;};}function handleError(_0xca5409,_0x4ceb12){_0x4ceb12=_0x4ceb12||0x1f4;return function(_0x6775d){logger[_0x3d46('0x11')](_0x6775d[_0x3d46('0x20')]);if(_0x6775d[_0x3d46('0x21')]){delete _0x6775d['name'];}_0xca5409[_0x3d46('0x16')](_0x4ceb12)['send'](_0x6775d);};}function getMustacheRender(_0x222ef0,_0xe1cf44){return Mustache[_0x3d46('0x22')](_0x222ef0,_[_0x3d46('0x23')](_0xe1cf44[_0x3d46('0x24')],{'contact':_0xe1cf44[_0x3d46('0x25')],'message':_0xe1cf44[_0x3d46('0x12')],'agent':_0xe1cf44['agent'],'interaction':_0xe1cf44[_0x3d46('0x26')],'account':_0xe1cf44[_0x3d46('0x27')]}))||'';}exports[_0x3d46('0x28')]=function(_0x53d1f8,_0x3a9e3){var _0x2f5b8a={};var _0x416a60=_[_0x3d46('0x29')](db[_0x3d46('0x2a')][_0x3d46('0x2b')],function(_0x5e61ec){return{'name':_0x5e61ec[_0x3d46('0x2c')],'type':_0x5e61ec[_0x3d46('0x2d')]['key']};});_0x2f5b8a=qs['getOptions'](_0x416a60,_0x53d1f8);return interaction[_0x3d46('0x2e')](_0x3d46('0x2f'),_0x53d1f8['query'],_0x53d1f8['user'],_0x2f5b8a,_0x416a60)[_0x3d46('0x1d')](respondWithFilteredResult(_0x3a9e3,_0x2f5b8a))['catch'](handleError(_0x3a9e3,null));};exports[_0x3d46('0x30')]=function(_0x5672b8,_0x18ff05){var _0x1d5460={'raw':![],'where':{'id':_0x5672b8[_0x3d46('0x31')]['id']}},_0x20b87a={};_0x20b87a[_0x3d46('0x32')]=_[_0x3d46('0x33')](db[_0x3d46('0x2a')][_0x3d46('0x2b')]);_0x20b87a[_0x3d46('0x34')]=_['keys'](_0x5672b8['query']);_0x20b87a[_0x3d46('0x35')]=_['intersection'](_0x20b87a[_0x3d46('0x32')],_0x20b87a[_0x3d46('0x34')]);_0x1d5460['attributes']=_['intersection'](_0x20b87a[_0x3d46('0x32')],qs[_0x3d46('0x36')](_0x5672b8[_0x3d46('0x34')][_0x3d46('0x36')]));_0x1d5460[_0x3d46('0x37')]=_0x1d5460['attributes']['length']?_0x1d5460['attributes']:_0x20b87a[_0x3d46('0x32')];if(_0x5672b8[_0x3d46('0x34')][_0x3d46('0x38')]){_0x1d5460['include']=[{'all':!![]}];}_0x1d5460=_[_0x3d46('0x23')]({},_0x1d5460,_0x5672b8['options']);return db[_0x3d46('0x2a')][_0x3d46('0x39')](_0x1d5460)['then'](handleEntityNotFound(_0x18ff05,null))[_0x3d46('0x1d')](respondWithResult(_0x18ff05,null))['catch'](handleError(_0x18ff05,null));};exports[_0x3d46('0x3a')]=function(_0x32ac59,_0x5f379f){return db[_0x3d46('0x2a')][_0x3d46('0x3a')](_0x32ac59[_0x3d46('0x24')],{})[_0x3d46('0x1d')](respondWithResult(_0x5f379f,0xc9))[_0x3d46('0x15')](handleError(_0x5f379f,null));};exports[_0x3d46('0x1c')]=function(_0x70993d,_0x5ea568){if(_0x70993d['body']['id']){delete _0x70993d[_0x3d46('0x24')]['id'];}return db[_0x3d46('0x2a')][_0x3d46('0x39')]({'where':{'id':_0x70993d[_0x3d46('0x31')]['id']}})[_0x3d46('0x1d')](handleEntityNotFound(_0x5ea568,null))[_0x3d46('0x1d')](saveUpdates(_0x70993d[_0x3d46('0x24')],null))[_0x3d46('0x1d')](respondWithResult(_0x5ea568,null))[_0x3d46('0x15')](handleError(_0x5ea568,null));};exports[_0x3d46('0x1e')]=function(_0x15885d,_0x47d4ef){return db[_0x3d46('0x2a')][_0x3d46('0x39')]({'where':{'id':_0x15885d['params']['id']}})[_0x3d46('0x1d')](handleEntityNotFound(_0x47d4ef,null))[_0x3d46('0x1d')](removeEntity(_0x47d4ef,null))['catch'](handleError(_0x47d4ef,null));};exports[_0x3d46('0x3b')]=function(_0xbdbeb3,_0x4cf737){return db[_0x3d46('0x2a')][_0x3d46('0x3b')]()[_0x3d46('0x1d')](respondWithResult(_0x4cf737,null))['catch'](handleError(_0x4cf737,null));};exports[_0x3d46('0x3c')]=function(_0x20adc3,_0x4eab29){var _0x2591b4=_0x20adc3[_0x3d46('0x31')]['id'];var _0x5768c0;var _0x13a411;var _0x89cc38;return db[_0x3d46('0x2a')][_0x3d46('0x3d')]({'where':{'id':_0x2591b4}})[_0x3d46('0x1d')](function(_0x30d60){_0x5768c0=_0x30d60;return db[_0x3d46('0x3e')][_0x3d46('0x3d')]({'where':{'id':_0x30d60['ChatWebsiteId']},'attributes':['id',_0x3d46('0x3f'),_0x3d46('0x40'),_0x3d46('0x41'),_0x3d46('0x42'),_0x3d46('0x43')],'raw':!![]});})['then'](function(_0xcd8955){if(_0xcd8955&&_0xcd8955['vidaooApiKey']&&_0xcd8955[_0x3d46('0x40')]){_0x13a411=_0xcd8955;var _0x59ae11={'interaction':{'id':_0x2591b4},'agent':{'id':_0x20adc3[_0x3d46('0x44')]['id'],'name':_0x20adc3[_0x3d46('0x44')]['name'],'fullname':_0x20adc3['user'][_0x3d46('0x45')],'email':_0x20adc3[_0x3d46('0x44')][_0x3d46('0x46')]},'contact':_0x20adc3[_0x3d46('0x24')][_0x3d46('0x25')],'account':_0x20adc3[_0x3d46('0x24')]['account']};var _0x396bee={'rejectUnauthorized':![],'method':_0x3d46('0x47'),'url':_0x3d46('0x48'),'headers':{'X-APIKEY':_0xcd8955[_0x3d46('0x3f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x20adc3[_0x3d46('0x44')][_0x3d46('0x46')]],'buttons':null,'topic':_0x13a411[_0x3d46('0x41')],'note':_['isNull'](_0x13a411['vidaooNote'])?null:getMustacheRender(_0x13a411[_0x3d46('0x42')],_0x59ae11),'metadata':null},'redirect':_0x3d46('0x49'),'json':!![]};try{if(!_['isNull'](_0x13a411['vidaooMetadata'])){var _0x567a7b=getMustacheRender(_0x13a411[_0x3d46('0x43')],_0x59ae11);var _0x235377=JSON[_0x3d46('0x4a')](_0x567a7b);_0x396bee[_0x3d46('0x24')]['metadata']=_0x235377;}}catch(_0x342ee3){throw new db[(_0x3d46('0x4b'))][(_0x3d46('0x4c'))](_0x3d46('0x4d'));}return rp(_0x396bee);}else{throw new db[(_0x3d46('0x4b'))][(_0x3d46('0x4c'))](_0x3d46('0x4e'));}})[_0x3d46('0x1d')](function(_0x49fda3){_0x89cc38=_0x49fda3;if(_0x89cc38['id']){var _0xacaa4e={'body':_0x89cc38[_0x3d46('0x4f')],'ChatWebsiteId':_0x13a411['id'],'ChatInteractionId':_0x5768c0['id'],'direction':_0x3d46('0x50'),'UserId':_0x20adc3[_0x3d46('0x44')]['id']};return db[_0x3d46('0x51')][_0x3d46('0x3a')](_0xacaa4e,{});}else{throw new db[(_0x3d46('0x4b'))][(_0x3d46('0x4c'))](_0x3d46('0x52'));}})[_0x3d46('0x1d')](function(){return _0x5768c0['updateAttributes']({'vidaooSessionId':_0x89cc38['id']});})[_0x3d46('0x1d')](respondWithResult(_0x4eab29,null))[_0x3d46('0x15')](handleError(_0x4eab29,null));};exports[_0x3d46('0x53')]=function(_0x15b84b,_0xb02869){if(_0x15b84b[_0x3d46('0x24')]['id']){delete _0x15b84b['body']['id'];}return db[_0x3d46('0x2a')][_0x3d46('0x39')]({'where':{'id':_0x15b84b[_0x3d46('0x31')]['id']},'include':[{'model':db['CmContact'],'as':_0x3d46('0x54')}]})['then'](handleEntityNotFound(_0xb02869,null))[_0x3d46('0x1d')](saveUpdates(_0x15b84b[_0x3d46('0x24')],null))['then'](respondWithResult(_0xb02869,null))[_0x3d46('0x15')](handleError(_0xb02869,null));};exports[_0x3d46('0x55')]=function(_0x490169,_0x3a79a6){if(_0x490169[_0x3d46('0x24')]['id']){delete _0x490169[_0x3d46('0x24')]['id'];}return db['ChatInteraction'][_0x3d46('0x39')]({'where':{'id':_0x490169['params']['id']}})[_0x3d46('0x1d')](function(_0x147e59){if(!_0x147e59){logger[_0x3d46('0x11')](_0x3d46('0x56'),_0x3d46('0x55'),0x194,_0x3d46('0x57'));_0x3a79a6['sendStatus'](0x194);}else{if(_0x147e59[_0x3d46('0x58')]){throw new db['Sequelize'][(_0x3d46('0x4c'))]('Interaction\x20already\x20assigned');}}return _0x147e59;})[_0x3d46('0x1d')](function(_0x80f85a){if(_0x80f85a){return _0x80f85a[_0x3d46('0x1c')]({'closed':_0x490169[_0x3d46('0x24')][_0x3d46('0x59')],'disposition':_0x490169['body']['disposition']})[_0x3d46('0x1d')](function(_0x5c7037){return _0x5c7037;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x3d46('0x55'),_0x490169[_0x3d46('0x24')],client9004);})['then'](respondWithResult(_0x3a79a6,null))[_0x3d46('0x15')](handleError(_0x3a79a6,null));};exports[_0x3d46('0x5a')]=function(_0x35daaa,_0x1a5e66){_0x35daaa['body'][_0x3d46('0x21')]=_0x35daaa[_0x3d46('0x5b')][_0x3d46('0x5c')];_0x35daaa[_0x3d46('0x24')][_0x3d46('0x5d')]=_0x35daaa[_0x3d46('0x5b')][_0x3d46('0x5e')];_0x35daaa[_0x3d46('0x24')][_0x3d46('0x2d')]=_0x35daaa[_0x3d46('0x5b')][_0x3d46('0x5f')];return db[_0x3d46('0x60')][_0x3d46('0x3a')](_0x35daaa[_0x3d46('0x24')])[_0x3d46('0x1d')](respondWithResult(_0x1a5e66,0xc9))[_0x3d46('0x15')](handleError(_0x1a5e66,null));};exports['attachmentDownload']=function(_0x238a7f,_0x2bf2fd){return db[_0x3d46('0x2a')][_0x3d46('0x3d')]({'where':{'id':_0x238a7f[_0x3d46('0x31')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2bf2fd,null))[_0x3d46('0x1d')](function(_0x16189c){if(_0x16189c){if(_0x16189c[_0x3d46('0x59')]){return _0x2bf2fd['status'](0x193)[_0x3d46('0x17')]({'status':0x193,'message':'Unauthorized'});}return db[_0x3d46('0x60')][_0x3d46('0x3d')]({'where':{'id':_0x238a7f[_0x3d46('0x34')][_0x3d46('0x61')]},'raw':!![]})['then'](handleEntityNotFound(_0x2bf2fd,null));}})[_0x3d46('0x1d')](function(_0x4e3b7a){if(_0x4e3b7a){var _0x1baee4=_0x4e3b7a[_0x3d46('0x62')]!==null;var _0x7f920c=path[_0x3d46('0x63')](config[_0x3d46('0x64')],_0x3d46('0x65'));if(_0x1baee4){_0x7f920c=path['join'](_0x7f920c,_0x3d46('0x66'));}var _0x2b7716=path[_0x3d46('0x63')](_0x7f920c,_0x4e3b7a['basename']);return _0x2bf2fd[_0x3d46('0x67')](_0x2b7716);}})[_0x3d46('0x15')](handleError(_0x2bf2fd,null));};exports['close']=function(_0x423a54,_0x417bf7){var _0x3c6d16=null;var _0x4b1225=null;var _0x5789cc=null;if(_0x423a54[_0x3d46('0x24')]['id']){delete _0x423a54[_0x3d46('0x24')]['id'];}if(_0x423a54['body'][_0x3d46('0x68')]){_0x5789cc=path['join'](config['root'],_0x3d46('0x69'),util[_0x3d46('0x6a')](_0x3d46('0x6b'),Date[_0x3d46('0x6c')]()));_0x423a54['body'][_0x3d46('0x6d')]=_0x5789cc;}return db[_0x3d46('0x2a')][_0x3d46('0x39')]({'where':{'id':_0x423a54['params']['id']},'include':[{'model':db[_0x3d46('0x51')],'as':_0x3d46('0x6e'),'include':[{'model':db[_0x3d46('0x6f')],'as':_0x3d46('0x6f')}]}]})[_0x3d46('0x1d')](handleEntityNotFound(_0x417bf7,null))[_0x3d46('0x1d')](saveUpdates(_0x423a54[_0x3d46('0x24')],null))[_0x3d46('0x1d')](function(_0x3dd1f8){if(_0x3dd1f8){_0x3c6d16=_0x3dd1f8;return db[_0x3d46('0x3e')][_0x3d46('0x39')]({'where':{'id':_0x3c6d16[_0x3d46('0x70')]}});}})[_0x3d46('0x1d')](function(_0x347ccc){if(_0x347ccc){_0x4b1225=_0x347ccc;return db[_0x3d46('0x71')][_0x3d46('0x39')]({'where':{'id':_0x3c6d16['ContactId']}});}})[_0x3d46('0x1d')](function(_0x431524){if(_0x431524){if(_0x5789cc){var _0x5898b0=null;for(var _0x1a1093=0x1;_0x1a1093<_0x3c6d16['Messages'][_0x3d46('0x72')];++_0x1a1093){_0x5898b0=_0x3c6d16[_0x3d46('0x6e')][_0x1a1093];var _0x5cbb27=_0x5898b0[_0x3d46('0x58')]?util[_0x3d46('0x6a')](_0x3d46('0x73'),_0x4b1225[_0x3d46('0x74')],_0x5898b0['UserId']):_0x3d46('0x75');var _0x5c0032=_0x423a54[_0x3d46('0x24')][_0x3d46('0x76')]||util['format'](_0x3d46('0x73'),_0x3d46('0x77'),_0x5898b0[_0x3d46('0x78')]);switch(_0x4b1225['agentIdentifier']){case _0x3d46('0x79'):_0x5cbb27=_0x5898b0[_0x3d46('0x58')]?util[_0x3d46('0x6a')]('%s%d',_0x4b1225[_0x3d46('0x74')],_0x5898b0[_0x3d46('0x58')]):_0x3d46('0x75');break;case _0x3d46('0x7a'):_0x5cbb27=_0x5898b0['UserId']?_0x5898b0['User'][_0x3d46('0x7b')]||_0x5898b0[_0x3d46('0x6f')][_0x3d46('0x45')]:_0x3d46('0x75');break;case _0x3d46('0x7c'):_0x5cbb27=_0x5898b0[_0x3d46('0x58')]?_0x5898b0[_0x3d46('0x6f')][_0x3d46('0x45')]:'System';break;default:_0x5cbb27=_0x5898b0[_0x3d46('0x58')]?util['format'](_0x3d46('0x73'),_0x4b1225['agentAlias'],_0x5898b0[_0x3d46('0x58')]):_0x3d46('0x75');}var _0xb8b4a4=util[_0x3d46('0x6a')](_0x3d46('0x7d'),moment(_0x5898b0[_0x3d46('0x7e')])[_0x3d46('0x6a')](_0x3d46('0x7f')),_0x5898b0[_0x3d46('0x80')]==='in'?_0x5c0032:_0x5cbb27,_0x5898b0[_0x3d46('0x24')]);if(!_0x5898b0[_0x3d46('0x81')]){fs['appendFileSync'](_0x5789cc,_0xb8b4a4);}}return db[_0x3d46('0x82')][_0x3d46('0x3d')]({'where':{'service':!![]},'include':[{'model':db[_0x3d46('0x83')],'as':_0x3d46('0x84'),'raw':!![],'include':[{'model':db[_0x3d46('0x85')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x3d46('0x1d')](function(_0x1ed05f){if(!_0x1ed05f||!_0x1ed05f[_0x3d46('0x84')]||!_0x423a54['body'])return _0x3c6d16;var _0x4d49f9=_0x1ed05f[_0x3d46('0x86')]();return respondWithRpcPromise(_0x3d46('0x87'),'sendMail',{'account':_0x4d49f9,'message':{'from':util[_0x3d46('0x6a')](_0x3d46('0x88'),_0x1ed05f['name'],_0x1ed05f['email']||_0x1ed05f[_0x3d46('0x84')][_0x3d46('0x44')]),'to':_0x423a54['body'][_0x3d46('0x68')],'subject':'Mail\x20Transcript','text':util[_0x3d46('0x6a')](_0x3d46('0x89'),_0x423a54[_0x3d46('0x24')][_0x3d46('0x68')]),'attachments':[{'path':_0x5789cc}]}})[_0x3d46('0x1d')](function(){return _0x3c6d16;})[_0x3d46('0x15')](function(_0x35f43f){logger[_0x3d46('0x11')](_0x35f43f);});})[_0x3d46('0x1d')](respondWithStatusCode(_0x417bf7,0xc8))['catch'](handleError(_0x417bf7,null));};exports['addMessage']=function(_0x10e2bd,_0x16c65e){return db[_0x3d46('0x51')][_0x3d46('0x39')]({'where':{'id':_0x10e2bd[_0x3d46('0x31')]['id']}})[_0x3d46('0x1d')](handleEntityNotFound(_0x16c65e,null))[_0x3d46('0x1d')](function(_0x51428a){if(_0x51428a){return _0x51428a['addMessage'](_0x10e2bd['body'][_0x3d46('0x8a')],_[_0x3d46('0x8b')](_0x10e2bd[_0x3d46('0x24')],[_0x3d46('0x8a'),'id'])||{});}})[_0x3d46('0x1d')](respondWithResult(_0x16c65e,null))[_0x3d46('0x15')](handleError(_0x16c65e,null));};exports[_0x3d46('0x8c')]=function(_0x5a8218,_0x28f91c){var _0x10db33={'raw':![],'where':{}};var _0xa5843c={};var _0x3f9be6={'count':0x0,'rows':[]};return db[_0x3d46('0x2a')][_0x3d46('0x3d')]({'where':{'id':_0x5a8218['params']['id']}})[_0x3d46('0x1d')](handleEntityNotFound(_0x28f91c,null))[_0x3d46('0x1d')](function(_0x297a09){if(_0x297a09){_0xa5843c[_0x3d46('0x32')]=_[_0x3d46('0x33')](db[_0x3d46('0x51')][_0x3d46('0x2b')]);_0xa5843c[_0x3d46('0x34')]=_[_0x3d46('0x33')](_0x5a8218['query']);_0xa5843c[_0x3d46('0x35')]=_[_0x3d46('0x8d')](_0xa5843c[_0x3d46('0x32')],_0xa5843c[_0x3d46('0x34')]);_0x10db33[_0x3d46('0x37')]=_['intersection'](_0xa5843c[_0x3d46('0x32')],qs['fields'](_0x5a8218['query'][_0x3d46('0x36')]));_0x10db33[_0x3d46('0x37')]=_0x10db33[_0x3d46('0x37')][_0x3d46('0x72')]?_0x10db33[_0x3d46('0x37')]:_0xa5843c[_0x3d46('0x32')];if(!_0x5a8218[_0x3d46('0x34')][_0x3d46('0x8e')](_0x3d46('0x8f'))){_0x10db33[_0x3d46('0x90')]=qs['limit'](_0x5a8218[_0x3d46('0x34')][_0x3d46('0x90')]);_0x10db33[_0x3d46('0x18')]=qs['offset'](_0x5a8218[_0x3d46('0x34')]['offset']);}_0x10db33['order']=qs[_0x3d46('0x91')](_0x5a8218['query']['sort']);_0x10db33[_0x3d46('0x92')]=qs[_0x3d46('0x35')](_['pick'](_0x5a8218[_0x3d46('0x34')],_0xa5843c[_0x3d46('0x35')]));_0x10db33[_0x3d46('0x92')][_0x3d46('0x93')]=_0x297a09['id'];if(_0x5a8218[_0x3d46('0x34')][_0x3d46('0x94')]){_0x10db33[_0x3d46('0x92')]=_[_0x3d46('0x23')](_0x10db33['where'],{'$or':_[_0x3d46('0x29')](_0x10db33[_0x3d46('0x37')],function(_0x249e1f){var _0x23c5e6={};_0x23c5e6[_0x249e1f]={'$like':'%'+_0x5a8218[_0x3d46('0x34')][_0x3d46('0x94')]+'%'};return _0x23c5e6;})});}if(_0x5a8218[_0x3d46('0x34')]['$gte']){var _0x2a69ba=_0x5a8218['query'][_0x3d46('0x95')]['split'](',');var _0x24c1f5={};_0x24c1f5[_0x2a69ba[0x0]]={'$gte':moment(_0x2a69ba[0x1])[_0x3d46('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x10db33['where']=_['merge'](_0x10db33[_0x3d46('0x92')],_0x24c1f5);}_0x10db33=_[_0x3d46('0x23')]({},_0x10db33,_0x5a8218[_0x3d46('0x96')]);return db['ChatMessage'][_0x3d46('0x1a')]({'where':_0x10db33[_0x3d46('0x92')]})[_0x3d46('0x1d')](function(_0x41be3f){_0x3f9be6['count']=_0x41be3f;if(_0x5a8218[_0x3d46('0x34')][_0x3d46('0x38')]){_0x10db33[_0x3d46('0x97')]=[{'all':!![]}];}return db[_0x3d46('0x51')][_0x3d46('0x2e')](_0x10db33);})['then'](function(_0x4e1c61){_0x3f9be6[_0x3d46('0x98')]=_0x4e1c61;return _0x3f9be6;});}})[_0x3d46('0x1d')](respondWithFilteredResult(_0x28f91c,_0x10db33))[_0x3d46('0x15')](handleError(_0x28f91c,null));};exports[_0x3d46('0x99')]=function(_0x19d951,_0x420612){var _0x4c9d86={'where':{}},_0x3637d0={},_0x1bad8f={'count':0x0,'rows':[]};return db[_0x3d46('0x2a')][_0x3d46('0x3d')]({'where':{'id':_0x19d951[_0x3d46('0x31')]['id']}})[_0x3d46('0x1d')](handleEntityNotFound(_0x420612,null))[_0x3d46('0x1d')](function(_0x406cde){if(_0x406cde){_0x3637d0[_0x3d46('0x32')]=_['keys'](db[_0x3d46('0x51')][_0x3d46('0x2b')]);_0x3637d0[_0x3d46('0x34')]=_['keys'](_0x19d951['query']);_0x3637d0[_0x3d46('0x35')]=_[_0x3d46('0x8d')](_0x3637d0[_0x3d46('0x32')],_0x3637d0['query']);_0x4c9d86[_0x3d46('0x37')]=_['intersection'](_0x3637d0[_0x3d46('0x32')],qs[_0x3d46('0x36')](_0x19d951[_0x3d46('0x34')]['fields']));_0x4c9d86[_0x3d46('0x37')]=_0x4c9d86[_0x3d46('0x37')][_0x3d46('0x72')]?_0x4c9d86[_0x3d46('0x37')]:_0x3637d0[_0x3d46('0x32')];if(!_0x19d951[_0x3d46('0x34')][_0x3d46('0x8e')](_0x3d46('0x8f'))){_0x4c9d86[_0x3d46('0x90')]=qs[_0x3d46('0x90')](_0x19d951[_0x3d46('0x34')][_0x3d46('0x90')]);_0x4c9d86[_0x3d46('0x18')]=qs['offset'](_0x19d951['query']['offset']);}_0x4c9d86['order']=qs[_0x3d46('0x91')](_0x19d951['query'][_0x3d46('0x91')]);_0x4c9d86[_0x3d46('0x92')]=qs[_0x3d46('0x35')](_[_0x3d46('0x9a')](_0x19d951[_0x3d46('0x34')],_0x3637d0[_0x3d46('0x35')]));_0x4c9d86[_0x3d46('0x92')][_0x3d46('0x93')]=_0x406cde['id'];if(_0x19d951['query'][_0x3d46('0x94')]){_0x4c9d86[_0x3d46('0x92')]=_[_0x3d46('0x23')](_0x4c9d86['where'],{'$or':_[_0x3d46('0x29')](_0x4c9d86[_0x3d46('0x37')],function(_0x379edf){var _0x38bd50={};_0x38bd50[_0x379edf]={'$like':'%'+_0x19d951[_0x3d46('0x34')]['filter']+'%'};return _0x38bd50;})});}_0x4c9d86[_0x3d46('0x92')][_0x3d46('0x81')]=![];if(_0x19d951['query']['id']){_0x4c9d86[_0x3d46('0x92')]['id']={'$gt':_0x19d951[_0x3d46('0x34')]['id']};}_0x4c9d86=_['merge']({},_0x4c9d86,_0x19d951[_0x3d46('0x96')]);return db[_0x3d46('0x51')][_0x3d46('0x1a')]({'where':_0x4c9d86[_0x3d46('0x92')]})[_0x3d46('0x1d')](function(_0x1f6509){_0x1bad8f[_0x3d46('0x1a')]=_0x1f6509;_0x4c9d86[_0x3d46('0x97')]=[];if(_0x19d951['query']['includeAgent']){_0x4c9d86['include']['push']({'model':db[_0x3d46('0x6f')],'as':'User','attributes':['id',_0x3d46('0x45'),_0x3d46('0x7b')]});}if(_0x19d951[_0x3d46('0x34')]['includeAll']){_0x4c9d86[_0x3d46('0x97')]=[{'all':!![]}];}return db[_0x3d46('0x51')]['findAll'](_0x4c9d86);})[_0x3d46('0x1d')](function(_0x240a35){_0x1bad8f[_0x3d46('0x98')]=_0x240a35;return _0x1bad8f;});}})[_0x3d46('0x1d')](respondWithFilteredResult(_0x420612,_0x4c9d86))[_0x3d46('0x15')](handleError(_0x420612,null));};exports[_0x3d46('0x9b')]=function(_0x26b33a,_0x2117f5){return db[_0x3d46('0x2a')][_0x3d46('0x39')]({'where':{'id':_0x26b33a[_0x3d46('0x31')]['id']}})['then'](handleEntityNotFound(_0x2117f5,null))['then'](function(_0x3effaf){if(_0x3effaf){return _0x3effaf[_0x3d46('0x9c')](_0x26b33a[_0x3d46('0x24')][_0x3d46('0x8a')],_['omit'](_0x26b33a[_0x3d46('0x24')],['ids','id'])||{})[_0x3d46('0x9d')](function(){return db[_0x3d46('0x9e')]['findAll']({'attributes':['id',_0x3d46('0x21'),_0x3d46('0x9f')],'where':{'id':_0x26b33a[_0x3d46('0x24')][_0x3d46('0x8a')]}});})['then'](function(_0x16e785){socket['emit'](_0x3d46('0xa0'),{'id':Number(_0x26b33a[_0x3d46('0x31')]['id']),'tags':_0x16e785||[]});return{'id':Number(_0x26b33a[_0x3d46('0x31')]['id']),'tags':_0x16e785||[]};});}})['then'](respondWithResult(_0x2117f5,null))['catch'](handleError(_0x2117f5,null));};exports[_0x3d46('0xa1')]=function(_0x38e78a,_0x3a2d7f){return db[_0x3d46('0x2a')][_0x3d46('0x39')]({'where':{'id':_0x38e78a[_0x3d46('0x31')]['id']}})[_0x3d46('0x1d')](handleEntityNotFound(_0x3a2d7f,null))[_0x3d46('0x1d')](function(_0x3969a9){if(_0x3969a9){return _0x3969a9[_0x3d46('0xa1')](_0x38e78a[_0x3d46('0x34')][_0x3d46('0x8a')]);}})[_0x3d46('0x1d')](respondWithStatusCode(_0x3a2d7f,null))[_0x3d46('0x15')](handleError(_0x3a2d7f,null));};exports[_0x3d46('0x67')]=function(_0x5251b3,_0xaae522){var _0x550375=moment()['unix']()['toString']();var _0x35e908=path[_0x3d46('0x63')](config[_0x3d46('0x64')],_0x3d46('0xa2'),_0x3d46('0xa3'),'tmp');var _0x4b21bf=path[_0x3d46('0x63')](config[_0x3d46('0x64')],_0x3d46('0xa2'),'files','attachments');var _0x34e107=path[_0x3d46('0x63')](_0x35e908,_0x550375);var _0x471f1c=util['format'](_0x3d46('0xa4'),_0x5251b3['params']['id'],_0x550375);var _0x2d4e1b=path[_0x3d46('0x63')](_0x35e908,_0x471f1c);var _0xfa3c95=[];_0xfa3c95[_0x3d46('0xa5')]({'model':db['User'],'as':_0x3d46('0x6f'),'attributes':['id',_0x3d46('0x45')],'raw':!![]});_0xfa3c95[_0x3d46('0xa5')]({'model':db[_0x3d46('0x71')],'as':_0x3d46('0x54'),'attributes':['id',_0x3d46('0xa6'),'lastName'],'raw':!![]});if(_0x5251b3[_0x3d46('0x34')][_0x3d46('0xa7')]){_0xfa3c95['push']({'model':db['Attachment'],'as':_0x3d46('0x60'),'raw':!![]});}var _0x480b40=[{'model':db[_0x3d46('0x51')],'as':_0x3d46('0x6e'),'attributes':['id',_0x3d46('0x24'),_0x3d46('0x7e'),_0x3d46('0x80'),_0x3d46('0x81'),_0x3d46('0xa8')],'include':_0xfa3c95}];_0x480b40[_0x3d46('0xa5')]({'model':db[_0x3d46('0x3e')],'as':'Account','attributes':['id','name']});_0x480b40[_0x3d46('0xa5')]({'model':db[_0x3d46('0x6f')],'as':_0x3d46('0xa9'),'attributes':['id',_0x3d46('0x45')]});return db['ChatInteraction'][_0x3d46('0x39')]({'where':{'id':_0x5251b3['params']['id']},'include':_0x480b40})[_0x3d46('0x1d')](handleEntityNotFound(_0xaae522,null))[_0x3d46('0x1d')](function(_0x12b45b){if(_0x12b45b){var _0x262fcd=_0x12b45b[_0x3d46('0xaa')]({'plain':!![]});fs[_0x3d46('0xab')](_0x34e107);var _0x4adb53={'channel':'Chat','account':_0x262fcd[_0x3d46('0xac')][_0x3d46('0x21')],'agent':_0x262fcd[_0x3d46('0xa9')]?_0x262fcd[_0x3d46('0xa9')]['fullname']:_0x3d46('0xad'),'createdAt':moment(_0x262fcd[_0x3d46('0x7e')])[_0x3d46('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x262fcd[_0x3d46('0x59')]?moment(_0x262fcd['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x3d46('0xae')]():'','disposition':_0x262fcd[_0x3d46('0xaf')],'chatInfo':{'browser':_0x262fcd[_0x3d46('0xb0')],'os':_0x262fcd['osName'],'referer':_0x262fcd[_0x3d46('0xb1')],'customerIp':_0x262fcd[_0x3d46('0xb2')],'customerPort':_0x262fcd[_0x3d46('0xb3')]?_0x262fcd[_0x3d46('0xb3')]:_0x3d46('0xad')},'messages':_(_0x262fcd['Messages'])['tail']()[_0x3d46('0x94')]({'secret':![]})['map'](function(_0x7bd9bb){if(_0x7bd9bb['Attachment']){var _0x33523a=path[_0x3d46('0x63')](_0x4b21bf,_0x7bd9bb[_0x3d46('0x60')]['basename']);if(fs[_0x3d46('0xb4')](_0x33523a)){fs[_0x3d46('0xb5')](_0x33523a)[_0x3d46('0xb6')](fs[_0x3d46('0xb7')](path[_0x3d46('0x63')](_0x34e107,_0x7bd9bb['Attachment'][_0x3d46('0x5d')])));}}return{'date':moment(_0x7bd9bb[_0x3d46('0x7e')])[_0x3d46('0x6a')](_0x3d46('0xb8'))[_0x3d46('0xae')](),'sender':_0x7bd9bb[_0x3d46('0x80')]==='out'?_0x7bd9bb['User']?_0x7bd9bb[_0x3d46('0x6f')][_0x3d46('0x45')]:_0x3d46('0x75'):_0x7bd9bb['Contact'][_0x3d46('0xa6')]+(_0x7bd9bb[_0x3d46('0x54')][_0x3d46('0xb9')]?'\x20'+_0x7bd9bb[_0x3d46('0x54')][_0x3d46('0xb9')]:''),'body':_0x7bd9bb[_0x3d46('0x60')]?_0x7bd9bb[_0x3d46('0x60')][_0x3d46('0x5d')]:_0x7bd9bb['body'],'direction':_0x7bd9bb[_0x3d46('0x80')]==='out'?'A':'C','secret':_0x7bd9bb['secret'],'read':_0x7bd9bb[_0x3d46('0xa8')],'attachment':_0x7bd9bb['Attachment']};})[_0x3d46('0xba')]()};return ejs[_0x3d46('0xbb')](path[_0x3d46('0x63')](config['root'],_0x3d46('0xa2'),_0x3d46('0xbc'),_0x3d46('0xbd')),{'interaction':_0x4adb53})['then'](function(_0x2190dc){var _0x1aff82=path[_0x3d46('0x63')](_0x34e107,'transcript-'+_0x262fcd['id']+'-'+_0x550375+'.pdf');var _0x144269={'path':_0x1aff82,'channel':_0x3d46('0xbe'),'interactionId':_0x262fcd['id']};return pdf[_0x3d46('0xbf')](_0x2190dc,_0x144269);})[_0x3d46('0x1d')](function(){return new Promise(function(_0x2e24a4,_0x436b79){zipdir(_0x34e107,{'saveTo':_0x2d4e1b},function(_0x223f05,_0x164996){if(_0x223f05)return _0x436b79(_0x223f05);return _0x2e24a4(_0x164996);});})['then'](function(){return new BPromise(function(_0x516f96,_0x2aa33c){rimraf(_0x34e107,function(_0x3c1744){if(_0x3c1744)_0x2aa33c(_0x3c1744);return _0x516f96();});});})[_0x3d46('0x1d')](function(){return _0xaae522[_0x3d46('0x67')](_0x2d4e1b,_0x471f1c,function(_0x37bda7){if(_0x37bda7){logger[_0x3d46('0x11')](_0x3d46('0xc0'),_0x37bda7);}else{fs[_0x3d46('0xc1')](_0x2d4e1b);}});});});}else{return _0xaae522['sendStatus'](0xc8);}})['catch'](handleError(_0xaae522,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index daee97d..c666144 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 _0x8b9b=['emit','hook','../../mysqldb','ChatInteraction','ChatMessage','save','update','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x14b72e,_0x3420ef){var _0x38fc95=function(_0x3a9c49){while(--_0x3a9c49){_0x14b72e['push'](_0x14b72e['shift']());}};_0x38fc95(++_0x3420ef);}(_0x8b9b,0x13a));var _0xb8b9=function(_0x31edbe,_0x34d231){_0x31edbe=_0x31edbe-0x0;var _0x37fcee=_0x8b9b[_0x31edbe];return _0x37fcee;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xb8b9('0x0'))['db'][_0xb8b9('0x1')];var ChatMessage=require(_0xb8b9('0x0'))['db'][_0xb8b9('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb8b9('0x3'),'afterUpdate':_0xb8b9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fae47){return function(_0x294d8a,_0x581e0a,_0x365739){_0x294d8a['getUsers']({'attributes':['id'],'raw':!![]})[_0xb8b9('0x5')](function(_0x281aca){_0x294d8a[_0xb8b9('0x6')]('Users',_0x281aca[_0xb8b9('0x7')](function(_0x3cae41){return{'id':_0x3cae41['id']};}));return ChatMessage[_0xb8b9('0x8')]({'where':{'ChatInteractionId':_0x294d8a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb8b9('0x5')](function(_0x3c5383){_0x294d8a['setDataValue'](_0xb8b9('0x9'),_0x3c5383[_0xb8b9('0xa')]);ChatInteractionEvents[_0xb8b9('0xb')](_0x2fae47+':'+_0x294d8a['id'],_0x294d8a);ChatInteractionEvents[_0xb8b9('0xb')](_0x2fae47,_0x294d8a);_0x365739(null);})['catch'](_0x365739(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xb8b9('0xc')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x0c56=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','setDataValue','Users','then','unreadMessages','emit','hasOwnProperty','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0c56,0x97));var _0x60c5=function(_0x55c334,_0x2529b0){_0x55c334=_0x55c334-0x0;var _0xc2fc54=_0x0c56[_0x55c334];return _0xc2fc54;};'use strict';var EventEmitter=require(_0x60c5('0x0'));var ChatInteraction=require(_0x60c5('0x1'))['db'][_0x60c5('0x2')];var ChatMessage=require(_0x60c5('0x1'))['db'][_0x60c5('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x60c5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x60c5('0x5'),'afterDestroy':_0x60c5('0x6')};function emitEvent(_0x5cf68f){return function(_0x1ac38b,_0x3e22ec,_0x27f8a8){_0x1ac38b['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3a11eb){_0x1ac38b[_0x60c5('0x7')](_0x60c5('0x8'),_0x3a11eb['map'](function(_0x3d8ffa){return{'id':_0x3d8ffa['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1ac38b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x60c5('0x9')](function(_0x5b6501){_0x1ac38b[_0x60c5('0x7')](_0x60c5('0xa'),_0x5b6501['length']);ChatInteractionEvents['emit'](_0x5cf68f+':'+_0x1ac38b['id'],_0x1ac38b);ChatInteractionEvents[_0x60c5('0xb')](_0x5cf68f,_0x1ac38b);_0x27f8a8(null);})['catch'](_0x27f8a8(null));};}for(var e in events){if(events[_0x60c5('0xc')](e)){var event=events[e];ChatInteraction[_0x60c5('0xd')](e,emitEvent(event));}}module[_0x60c5('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e6023e9..e8f792c 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 _0x7ce9=['define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x1155d7,_0x1cc6dd){var _0x5c2d4f=function(_0x437cac){while(--_0x437cac){_0x1155d7['push'](_0x1155d7['shift']());}};_0x5c2d4f(++_0x1cc6dd);}(_0x7ce9,0xd8));var _0x97ce=function(_0x21bad5,_0x23a39d){_0x21bad5=_0x21bad5-0x0;var _0x235106=_0x7ce9[_0x21bad5];return _0x235106;};'use strict';var _=require(_0x97ce('0x0'));var util=require(_0x97ce('0x1'));var logger=require('../../config/logger')(_0x97ce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x97ce('0x3'));var rimraf=require(_0x97ce('0x4'));var config=require(_0x97ce('0x5'));var attributes=require(_0x97ce('0x6'));module[_0x97ce('0x7')]=function(_0x3f37b9,_0x1894ec){return _0x3f37b9[_0x97ce('0x8')](_0x97ce('0x9'),attributes,{'tableName':_0x97ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24f548,_0xfa20e0,_0x344fc7){if(_0x24f548[_0x97ce('0xb')](_0x97ce('0xc'))){_0x24f548['closedAt']=moment()[_0x97ce('0xd')](_0x97ce('0xe'));}_0x344fc7(null,_0x24f548);}},'charset':'utf8mb4','collate':_0x97ce('0xf')});};
\ No newline at end of file
+var _0xc518=['bluebird','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment'];(function(_0x5367c5,_0x439de4){var _0x22c25e=function(_0x54317c){while(--_0x54317c){_0x5367c5['push'](_0x5367c5['shift']());}};_0x22c25e(++_0x439de4);}(_0xc518,0x6d));var _0x8c51=function(_0x12ac1f,_0x461a52){_0x12ac1f=_0x12ac1f-0x0;var _0x724467=_0xc518[_0x12ac1f];return _0x724467;};'use strict';var _=require(_0x8c51('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8c51('0x1'));var moment=require(_0x8c51('0x2'));var BPromise=require(_0x8c51('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c51('0x4'));var rimraf=require(_0x8c51('0x5'));var config=require(_0x8c51('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x8c51('0x7')]=function(_0x23586e,_0x573f86){return _0x23586e[_0x8c51('0x8')](_0x8c51('0x9'),attributes,{'tableName':_0x8c51('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11a8a2,_0x25e78e,_0x439a9f){if(_0x11a8a2[_0x8c51('0xb')]('closed')){_0x11a8a2[_0x8c51('0xc')]=moment()['format'](_0x8c51('0xd'));}_0x439a9f(null,_0x11a8a2);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 90889b8..3607628 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 _0x0b76=['spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','ChatInteraction','update','raw','where','attributes','options','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','find','omit','body','ids'];(function(_0x33d22b,_0x30364b){var _0x2abcd5=function(_0x5d14da){while(--_0x5d14da){_0x33d22b['push'](_0x33d22b['shift']());}};_0x2abcd5(++_0x30364b);}(_0x0b76,0x1d6));var _0x60b7=function(_0x14682b,_0x32aa32){_0x14682b=_0x14682b-0x0;var _0x1fa061=_0x0b76[_0x14682b];return _0x1fa061;};'use strict';var _=require(_0x60b7('0x0'));var util=require(_0x60b7('0x1'));var moment=require(_0x60b7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x60b7('0x4'));var logger=require(_0x60b7('0x5'))('rpc');var config=require(_0x60b7('0x6'));var jayson=require(_0x60b7('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x60b7('0x8')]=_[_0x60b7('0x9')](config[_0x60b7('0x8')],{'host':_0x60b7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x60b7('0x8')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x227b65,_0x2298a7,_0x2b9e56){return new BPromise(function(_0xff0a07,_0xc371e8){return client[_0x60b7('0xb')](_0x227b65,_0x2b9e56)[_0x60b7('0xc')](function(_0x56ab71){logger['info'](_0x60b7('0xd'),_0x2298a7,_0x60b7('0xe'));logger[_0x60b7('0xf')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2298a7,'request\x20sent',JSON['stringify'](_0x56ab71));if(_0x56ab71['error']){if(_0x56ab71[_0x60b7('0x10')][_0x60b7('0x11')]===0x1f4){logger[_0x60b7('0x10')](_0x60b7('0xd'),_0x2298a7,_0x56ab71[_0x60b7('0x10')][_0x60b7('0x12')]);return _0xc371e8(_0x56ab71[_0x60b7('0x10')]['message']);}logger[_0x60b7('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2298a7,_0x56ab71[_0x60b7('0x10')][_0x60b7('0x12')]);return _0xff0a07(_0x56ab71[_0x60b7('0x10')][_0x60b7('0x12')]);}else{logger['info'](_0x60b7('0xd'),_0x2298a7,_0x60b7('0xe'));_0xff0a07(_0x56ab71[_0x60b7('0x13')][_0x60b7('0x12')]);}})['catch'](function(_0x3414f3){logger[_0x60b7('0x10')](_0x60b7('0xd'),_0x2298a7,_0x3414f3);_0xc371e8(_0x3414f3);});});}exports['UpdateChatInteraction']=function(_0xc0f31){var _0x46a176=this;return new Promise(function(_0x1b59e7,_0x537605){return db[_0x60b7('0x14')][_0x60b7('0x15')](_0xc0f31['body'],{'raw':_0xc0f31['options']?_0xc0f31['options'][_0x60b7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc0f31['options']?_0xc0f31['options'][_0x60b7('0x17')]||null:null,'attributes':_0xc0f31['options']?_0xc0f31['options'][_0x60b7('0x18')]||null:null,'limit':_0xc0f31[_0x60b7('0x19')]?_0xc0f31[_0x60b7('0x19')]['limit']||null:null})[_0x60b7('0xc')](function(_0x1bdd64){logger['info'](_0x60b7('0x1a'),_0xc0f31);logger[_0x60b7('0xf')](_0x60b7('0x1a'),_0xc0f31,JSON[_0x60b7('0x1b')](_0x1bdd64));_0x1b59e7(_0x1bdd64);})[_0x60b7('0x1c')](function(_0x41a00b){logger[_0x60b7('0x10')](_0x60b7('0x1a'),_0x41a00b[_0x60b7('0x12')],_0xc0f31);_0x537605(_0x46a176[_0x60b7('0x10')](0x1f4,_0x41a00b[_0x60b7('0x12')]));});});};exports[_0x60b7('0x1d')]=function(_0x4aa7b4){return new Promise(function(_0x54a446,_0x522963){return db[_0x60b7('0x14')][_0x60b7('0x1e')]({'where':_0x4aa7b4[_0x60b7('0x19')]?_0x4aa7b4[_0x60b7('0x19')]['where']||null:null})[_0x60b7('0xc')](function(_0xce1570){if(_0xce1570){return _0xce1570['addTags'](_0x4aa7b4['body']['ids'],_[_0x60b7('0x1f')](_0x4aa7b4[_0x60b7('0x20')],[_0x60b7('0x21'),'id'])||{});}})[_0x60b7('0x22')](function(_0x1cb9bf){logger['info']('AddTags',_0x4aa7b4);logger[_0x60b7('0xf')](_0x60b7('0x23'),_0x4aa7b4,JSON['stringify'](_0x1cb9bf));_0x54a446(_0x1cb9bf);})['catch'](function(_0x2a5af0){logger['error']('AddTags',_0x2a5af0[_0x60b7('0x12')],_0x4aa7b4);_0x522963(_this[_0x60b7('0x10')](0x1f4,_0x2a5af0['message']));});});};
\ No newline at end of file
+var _0x63ce=['body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','update'];(function(_0x4ccefa,_0xcbf16){var _0x163fc6=function(_0x3baec4){while(--_0x3baec4){_0x4ccefa['push'](_0x4ccefa['shift']());}};_0x163fc6(++_0xcbf16);}(_0x63ce,0x111));var _0xe63c=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0x63ce[_0xad57ee];return _0x3eaea9;};'use strict';var _=require(_0xe63c('0x0'));var util=require(_0xe63c('0x1'));var moment=require('moment');var BPromise=require(_0xe63c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe63c('0x3'));var db=require(_0xe63c('0x4'))['db'];var utils=require(_0xe63c('0x5'));var logger=require('../../config/logger')(_0xe63c('0x6'));var config=require(_0xe63c('0x7'));var jayson=require(_0xe63c('0x8'));var client=jayson[_0xe63c('0x9')][_0xe63c('0xa')]({'port':0x232a});config['redis']=_[_0xe63c('0xb')](config[_0xe63c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe63c('0xd'))(new Redis(config[_0xe63c('0xc')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x313de5,_0x1e3230,_0x3c03d1){return new BPromise(function(_0x542c71,_0x75c546){return client[_0xe63c('0xe')](_0x313de5,_0x3c03d1)[_0xe63c('0xf')](function(_0x8cf663){logger['info'](_0xe63c('0x10'),_0x1e3230,_0xe63c('0x11'));logger[_0xe63c('0x12')](_0xe63c('0x13'),_0x1e3230,_0xe63c('0x11'),JSON[_0xe63c('0x14')](_0x8cf663));if(_0x8cf663[_0xe63c('0x15')]){if(_0x8cf663[_0xe63c('0x15')][_0xe63c('0x16')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1e3230,_0x8cf663[_0xe63c('0x15')]['message']);return _0x75c546(_0x8cf663[_0xe63c('0x15')]['message']);}logger['error'](_0xe63c('0x10'),_0x1e3230,_0x8cf663[_0xe63c('0x15')][_0xe63c('0x17')]);return _0x542c71(_0x8cf663[_0xe63c('0x15')][_0xe63c('0x17')]);}else{logger[_0xe63c('0x18')](_0xe63c('0x10'),_0x1e3230,_0xe63c('0x11'));_0x542c71(_0x8cf663[_0xe63c('0x19')][_0xe63c('0x17')]);}})[_0xe63c('0x1a')](function(_0x24a802){logger[_0xe63c('0x15')](_0xe63c('0x10'),_0x1e3230,_0x24a802);_0x75c546(_0x24a802);});});}exports['UpdateChatInteraction']=function(_0x20a9d9){var _0xc4c00e=this;return new Promise(function(_0x4519b3,_0x5034ef){return db['ChatInteraction'][_0xe63c('0x1b')](_0x20a9d9[_0xe63c('0x1c')],{'raw':_0x20a9d9[_0xe63c('0x1d')]?_0x20a9d9['options'][_0xe63c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20a9d9['options']?_0x20a9d9['options'][_0xe63c('0x1f')]||null:null,'attributes':_0x20a9d9[_0xe63c('0x1d')]?_0x20a9d9[_0xe63c('0x1d')][_0xe63c('0x20')]||null:null,'limit':_0x20a9d9[_0xe63c('0x1d')]?_0x20a9d9['options'][_0xe63c('0x21')]||null:null})[_0xe63c('0xf')](function(_0xb37f){logger[_0xe63c('0x18')]('UpdateChatInteraction',_0x20a9d9);logger[_0xe63c('0x12')](_0xe63c('0x22'),_0x20a9d9,JSON[_0xe63c('0x14')](_0xb37f));_0x4519b3(_0xb37f);})[_0xe63c('0x1a')](function(_0x55fc85){logger[_0xe63c('0x15')]('UpdateChatInteraction',_0x55fc85[_0xe63c('0x17')],_0x20a9d9);_0x5034ef(_0xc4c00e['error'](0x1f4,_0x55fc85[_0xe63c('0x17')]));});});};exports[_0xe63c('0x23')]=function(_0x44b183){return new Promise(function(_0x43075a,_0x3ff052){return db[_0xe63c('0x24')][_0xe63c('0x25')]({'where':_0x44b183[_0xe63c('0x1d')]?_0x44b183[_0xe63c('0x1d')]['where']||null:null})[_0xe63c('0xf')](function(_0x1188c6){if(_0x1188c6){return _0x1188c6[_0xe63c('0x26')](_0x44b183[_0xe63c('0x1c')][_0xe63c('0x27')],_[_0xe63c('0x28')](_0x44b183[_0xe63c('0x1c')],[_0xe63c('0x27'),'id'])||{});}})[_0xe63c('0x29')](function(_0x426509){logger['info'](_0xe63c('0x2a'),_0x44b183);logger[_0xe63c('0x12')](_0xe63c('0x2a'),_0x44b183,JSON[_0xe63c('0x14')](_0x426509));_0x43075a(_0x426509);})['catch'](function(_0x471d42){logger[_0xe63c('0x15')]('AddTags',_0x471d42[_0xe63c('0x17')],_0x44b183);_0x3ff052(_this[_0xe63c('0x15')](0x1f4,_0x471d42['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 864cce1..090d614 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 _0x07ef=['save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x1aa825,_0x3c8504){var _0x18c654=function(_0x3aa5dc){while(--_0x3aa5dc){_0x1aa825['push'](_0x1aa825['shift']());}};_0x18c654(++_0x3c8504);}(_0x07ef,0x12d));var _0xf07e=function(_0x55c3d9,_0x3bf75c){_0x55c3d9=_0x55c3d9-0x0;var _0x19fd97=_0x07ef[_0x55c3d9];return _0x19fd97;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xf07e('0x0'),_0xf07e('0x1'),_0xf07e('0x2')];function createListener(_0x52d43b,_0x39aa77){return function(_0x245689){_0x39aa77[_0xf07e('0x3')](_0x52d43b,_0x245689);};}function removeListener(_0x1b282e,_0x1f8b13){return function(){ChatInteractionEvents[_0xf07e('0x4')](_0x1b282e,_0x1f8b13);};}exports['register']=function(_0x1cabd8){for(var _0x3f685a=0x0,_0x151a67=events[_0xf07e('0x5')];_0x3f685a<_0x151a67;_0x3f685a++){var _0x34c899=events[_0x3f685a];var _0x471e1d=createListener(_0xf07e('0x6')+_0x34c899,_0x1cabd8);ChatInteractionEvents['on'](_0x34c899,_0x471e1d);}};
\ No newline at end of file
+var _0x69db=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x57a2a6,_0x3d21b2){var _0x74724a=function(_0x5918cc){while(--_0x5918cc){_0x57a2a6['push'](_0x57a2a6['shift']());}};_0x74724a(++_0x3d21b2);}(_0x69db,0x106));var _0xb69d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x69db[_0x2dafbe];return _0x58a45a;};'use strict';var ChatInteractionEvents=require(_0xb69d('0x0'));var events=[_0xb69d('0x1'),'remove',_0xb69d('0x2')];function createListener(_0x264d83,_0xb8a9d7){return function(_0x4334fa){_0xb8a9d7[_0xb69d('0x3')](_0x264d83,_0x4334fa);};}function removeListener(_0x40ad08,_0x1ac2c6){return function(){ChatInteractionEvents[_0xb69d('0x4')](_0x40ad08,_0x1ac2c6);};}exports[_0xb69d('0x5')]=function(_0x13d2c1){for(var _0x29ed58=0x0,_0x2f39b5=events[_0xb69d('0x6')];_0x29ed58<_0x2f39b5;_0x29ed58++){var _0x297707=events[_0x29ed58];var _0x51b684=createListener(_0xb69d('0x7')+_0x297707,_0x13d2c1);ChatInteractionEvents['on'](_0x297707,_0x51b684);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 943d114..ebce9a2 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 _0xc03d=['path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','/:id','chat','chatinteraction:update','update','customUpdate','abandon','delete','chatinteraction:destroy','destroy','removeTags','exports','util'];(function(_0x53be66,_0x9ec3be){var _0x9e5520=function(_0x5c4742){while(--_0x5c4742){_0x53be66['push'](_0x53be66['shift']());}};_0x9e5520(++_0x9ec3be);}(_0xc03d,0xf4));var _0xdc03=function(_0x38ef05,_0x39b256){_0x38ef05=_0x38ef05-0x0;var _0x4352a4=_0xc03d[_0x38ef05];return _0x4352a4;};'use strict';var multer=require('multer');var util=require(_0xdc03('0x0'));var path=require(_0xdc03('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc03('0x2'));var router=express[_0xdc03('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdc03('0x4'));var interaction=require(_0xdc03('0x5'));var config=require('../../config/environment');var controller=require(_0xdc03('0x6'));router[_0xdc03('0x7')]('/',auth[_0xdc03('0x8')](),controller['index']);router[_0xdc03('0x7')](_0xdc03('0x9'),auth['isAuthenticated'](),controller[_0xdc03('0xa')]);router[_0xdc03('0x7')]('/:id',auth[_0xdc03('0xb')](),controller['show']);router[_0xdc03('0x7')](_0xdc03('0xc'),auth[_0xdc03('0xb')](),controller['attachmentDownload']);router['get'](_0xdc03('0xd'),auth[_0xdc03('0x8')](),controller[_0xdc03('0xe')]);router[_0xdc03('0x7')]('/:id/my_messages',auth[_0xdc03('0xb')](),controller[_0xdc03('0xf')]);router[_0xdc03('0x7')](_0xdc03('0x10'),auth['isAuthenticated'](),controller[_0xdc03('0x11')]);router[_0xdc03('0x12')]('/',auth[_0xdc03('0x8')](),controller[_0xdc03('0x13')]);router[_0xdc03('0x12')](_0xdc03('0x14'),auth[_0xdc03('0x8')](),controller[_0xdc03('0x15')]);var upload=multer({'storage':multer[_0xdc03('0x16')]({'destination':function(_0x560650,_0x18035f,_0xa6b666){_0xa6b666(null,path[_0xdc03('0x17')](config[_0xdc03('0x18')],_0xdc03('0x19')));},'filename':function(_0x1b738b,_0x3c1899,_0x78c27b){_0x78c27b(null,util[_0xdc03('0x1a')](_0xdc03('0x1b'),Date[_0xdc03('0x1c')](),_0x3c1899['originalname'][_0xdc03('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdc03('0x12')](_0xdc03('0x1e'),upload[_0xdc03('0x1f')]('file'),controller[_0xdc03('0x20')]);router[_0xdc03('0x12')](_0xdc03('0xd'),auth[_0xdc03('0xb')](),controller[_0xdc03('0x21')]);router[_0xdc03('0x12')](_0xdc03('0x22'),auth['isAuthenticated'](),interaction[_0xdc03('0x23')]('chat',_0xdc03('0x24')),controller['addTags']);router[_0xdc03('0x25')](_0xdc03('0x26'),auth[_0xdc03('0x8')](),interaction[_0xdc03('0x23')](_0xdc03('0x27'),_0xdc03('0x28')),controller[_0xdc03('0x29')]);router['put']('/:id/custom_update',controller[_0xdc03('0x2a')]);router[_0xdc03('0x25')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xdc03('0x2b')]);router[_0xdc03('0x25')]('/:id/close',controller['close']);router[_0xdc03('0x2c')](_0xdc03('0x26'),auth[_0xdc03('0x8')](),interaction['tracked'](_0xdc03('0x27'),_0xdc03('0x2d')),controller[_0xdc03('0x2e')]);router[_0xdc03('0x2c')](_0xdc03('0x22'),auth[_0xdc03('0x8')](),controller[_0xdc03('0x2f')]);module[_0xdc03('0x30')]=router;
\ No newline at end of file
+var _0x5749=['/:id/tags','tracked','chat','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage'];(function(_0x4a538c,_0x50804b){var _0x552930=function(_0x49e6db){while(--_0x49e6db){_0x4a538c['push'](_0x4a538c['shift']());}};_0x552930(++_0x50804b);}(_0x5749,0x148));var _0x9574=function(_0x4584a2,_0x56e5d9){_0x4584a2=_0x4584a2-0x0;var _0x2510e0=_0x5749[_0x4584a2];return _0x2510e0;};'use strict';var multer=require('multer');var util=require(_0x9574('0x0'));var path=require('path');var timeout=require(_0x9574('0x1'));var express=require(_0x9574('0x2'));var router=express[_0x9574('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9574('0x4'));var interaction=require(_0x9574('0x5'));var config=require(_0x9574('0x6'));var controller=require('./chatInteraction.controller');router[_0x9574('0x7')]('/',auth[_0x9574('0x8')](),controller[_0x9574('0x9')]);router[_0x9574('0x7')](_0x9574('0xa'),auth[_0x9574('0x8')](),controller[_0x9574('0xb')]);router['get'](_0x9574('0xc'),auth[_0x9574('0xd')](),controller['show']);router[_0x9574('0x7')](_0x9574('0xe'),auth[_0x9574('0xd')](),controller[_0x9574('0xf')]);router[_0x9574('0x7')](_0x9574('0x10'),auth[_0x9574('0x8')](),controller[_0x9574('0x11')]);router[_0x9574('0x7')]('/:id/my_messages',auth[_0x9574('0xd')](),controller[_0x9574('0x12')]);router[_0x9574('0x7')](_0x9574('0x13'),auth[_0x9574('0x8')](),controller[_0x9574('0x14')]);router[_0x9574('0x15')]('/',auth[_0x9574('0x8')](),controller['create']);router['post']('/:id/vidaoo',auth[_0x9574('0x8')](),controller[_0x9574('0x16')]);var upload=multer({'storage':multer[_0x9574('0x17')]({'destination':function(_0x19c507,_0x1019c5,_0x3ec19f){_0x3ec19f(null,path[_0x9574('0x18')](config[_0x9574('0x19')],_0x9574('0x1a')));},'filename':function(_0x5ad45b,_0x1fff1a,_0x871cdf){_0x871cdf(null,util[_0x9574('0x1b')](_0x9574('0x1c'),Date[_0x9574('0x1d')](),_0x1fff1a[_0x9574('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9574('0x15')](_0x9574('0x1f'),upload[_0x9574('0x20')](_0x9574('0x21')),controller[_0x9574('0x22')]);router[_0x9574('0x15')](_0x9574('0x10'),auth[_0x9574('0xd')](),controller[_0x9574('0x23')]);router[_0x9574('0x15')](_0x9574('0x24'),auth[_0x9574('0x8')](),interaction[_0x9574('0x25')](_0x9574('0x26'),'chatinteraction:addtags'),controller[_0x9574('0x27')]);router[_0x9574('0x28')](_0x9574('0xc'),auth[_0x9574('0x8')](),interaction[_0x9574('0x25')](_0x9574('0x26'),'chatinteraction:update'),controller[_0x9574('0x29')]);router[_0x9574('0x28')](_0x9574('0x2a'),controller[_0x9574('0x2b')]);router['put'](_0x9574('0x2c'),auth[_0x9574('0xd')](),controller[_0x9574('0x2d')]);router[_0x9574('0x28')](_0x9574('0x2e'),controller[_0x9574('0x2f')]);router[_0x9574('0x30')]('/:id',auth[_0x9574('0x8')](),interaction[_0x9574('0x25')](_0x9574('0x26'),_0x9574('0x31')),controller[_0x9574('0x32')]);router['delete'](_0x9574('0x24'),auth['isAuthenticated'](),controller[_0x9574('0x33')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 31c8b44..016b01e 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 _0x8dc7=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x2b1d63,_0x143c51){var _0x56dec0=function(_0x5dad38){while(--_0x5dad38){_0x2b1d63['push'](_0x2b1d63['shift']());}};_0x56dec0(++_0x143c51);}(_0x8dc7,0x1b5));var _0x78dc=function(_0x1da56b,_0x356602){_0x1da56b=_0x1da56b-0x0;var _0x51e2ba=_0x8dc7[_0x1da56b];return _0x51e2ba;};'use strict';var Sequelize=require(_0x78dc('0x0'));module[_0x78dc('0x1')]={'body':{'type':Sequelize[_0x78dc('0x2')](_0x78dc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x78dc('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x78dc('0x5')]}};
\ No newline at end of file
+var _0x7fc9=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7fc9,0xee));var _0x97fc=function(_0xe61544,_0x30b2d2){_0xe61544=_0xe61544-0x0;var _0x58cc3e=_0x7fc9[_0xe61544];return _0x58cc3e;};'use strict';var Sequelize=require(_0x97fc('0x0'));module[_0x97fc('0x1')]={'body':{'type':Sequelize[_0x97fc('0x2')](_0x97fc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x97fc('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x97fc('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 046bd8e..8dcfc30 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 _0x5a92=['UserProfileResource','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','keys','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x1a8b6f,_0x3aebf7){var _0x2f8ff2=function(_0x47f677){while(--_0x47f677){_0x1a8b6f['push'](_0x1a8b6f['shift']());}};_0x2f8ff2(++_0x3aebf7);}(_0x5a92,0x75));var _0x25a9=function(_0x591583,_0x255a3e){_0x591583=_0x591583-0x0;var _0x345ddd=_0x5a92[_0x591583];return _0x345ddd;};'use strict';var emlformat=require(_0x25a9('0x0'));var rimraf=require(_0x25a9('0x1'));var zipdir=require(_0x25a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25a9('0x3'));var moment=require(_0x25a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x25a9('0x5'));var util=require(_0x25a9('0x6'));var path=require('path');var sox=require(_0x25a9('0x7'));var csv=require(_0x25a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25a9('0x9'));var squel=require('squel');var crypto=require(_0x25a9('0xa'));var jsforce=require(_0x25a9('0xb'));var deskjs=require(_0x25a9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x25a9('0xd'));var Papa=require(_0x25a9('0xe'));var Redis=require(_0x25a9('0xf'));var authService=require(_0x25a9('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25a9('0x11'));var logger=require(_0x25a9('0x12'))(_0x25a9('0x13'));var utils=require(_0x25a9('0x14'));var config=require(_0x25a9('0x15'));var licenseUtil=require(_0x25a9('0x16'));var db=require('../../mysqldb')['db'];config[_0x25a9('0x17')]=_[_0x25a9('0x18')](config[_0x25a9('0x17')],{'host':_0x25a9('0x19'),'port':0x18eb});var socket=require(_0x25a9('0x1a'))(new Redis(config[_0x25a9('0x17')]));require(_0x25a9('0x1b'))['register'](socket);function respondWithStatusCode(_0x47e807,_0x3e0608){_0x3e0608=_0x3e0608||0xcc;return function(_0x19addf){if(_0x19addf){return _0x47e807[_0x25a9('0x1c')](_0x3e0608);}return _0x47e807[_0x25a9('0x1d')](_0x3e0608)[_0x25a9('0x1e')]();};}function respondWithResult(_0x714890,_0x99d906){_0x99d906=_0x99d906||0xc8;return function(_0x5f3cd0){if(_0x5f3cd0){return _0x714890['status'](_0x99d906)['json'](_0x5f3cd0);}};}function respondWithFilteredResult(_0x7e31e0,_0x346591){return function(_0x41ecf2){if(_0x41ecf2){var _0x544cda=typeof _0x346591[_0x25a9('0x1f')]===_0x25a9('0x20')&&typeof _0x346591[_0x25a9('0x21')]===_0x25a9('0x20');var _0x4b54b0=_0x41ecf2[_0x25a9('0x22')];var _0x3d0c31=_0x544cda?0x0:_0x346591[_0x25a9('0x1f')];var _0x3dd674=_0x544cda?_0x41ecf2['count']:_0x346591[_0x25a9('0x1f')]+_0x346591['limit'];var _0x1621f1;if(_0x3dd674>=_0x4b54b0){_0x3dd674=_0x4b54b0;_0x1621f1=0xc8;}else{_0x1621f1=0xce;}_0x7e31e0['status'](_0x1621f1);return _0x7e31e0[_0x25a9('0x23')](_0x25a9('0x24'),_0x3d0c31+'-'+_0x3dd674+'/'+_0x4b54b0)[_0x25a9('0x25')](_0x41ecf2);}return null;};}function patchUpdates(_0x53c73f){return function(_0x3998d7){try{jsonpatch['apply'](_0x3998d7,_0x53c73f,!![]);}catch(_0x436e48){return BPromise[_0x25a9('0x26')](_0x436e48);}return _0x3998d7[_0x25a9('0x27')]();};}function saveUpdates(_0x1ac89e,_0x17dac6){return function(_0x271586){if(_0x271586){return _0x271586['update'](_0x1ac89e)[_0x25a9('0x28')](function(_0x468964){return _0x468964;});}return null;};}function removeEntity(_0x360c74,_0x5e660a){return function(_0x515c2e){if(_0x515c2e){return _0x515c2e[_0x25a9('0x29')]()[_0x25a9('0x28')](function(){_0x360c74['status'](0xcc)[_0x25a9('0x1e')]();});}};}function handleEntityNotFound(_0x5b4931,_0x279672){return function(_0x2622f8){if(!_0x2622f8){_0x5b4931['sendStatus'](0x194);}return _0x2622f8;};}function handleError(_0x1c0641,_0x1e35ba){_0x1e35ba=_0x1e35ba||0x1f4;return function(_0x3c1d81){logger[_0x25a9('0x2a')](_0x3c1d81['stack']);if(_0x3c1d81[_0x25a9('0x2b')]){delete _0x3c1d81['name'];}_0x1c0641[_0x25a9('0x1d')](_0x1e35ba)[_0x25a9('0x2c')](_0x3c1d81);};}exports[_0x25a9('0x2d')]=function(_0x10166b,_0x308c5e){var _0x9a02a2={},_0x127987={},_0x132f5a={'count':0x0,'rows':[]};var _0x2e725d=_['map'](db[_0x25a9('0x2e')][_0x25a9('0x2f')],function(_0x1e605d){return{'name':_0x1e605d[_0x25a9('0x30')],'type':_0x1e605d[_0x25a9('0x31')][_0x25a9('0x32')]};});_0x127987[_0x25a9('0x33')]=_[_0x25a9('0x34')](_0x2e725d,_0x25a9('0x2b'));_0x127987[_0x25a9('0x35')]=_['keys'](_0x10166b[_0x25a9('0x35')]);_0x127987[_0x25a9('0x36')]=_[_0x25a9('0x37')](_0x127987[_0x25a9('0x33')],_0x127987[_0x25a9('0x35')]);_0x9a02a2[_0x25a9('0x38')]=_['intersection'](_0x127987[_0x25a9('0x33')],qs[_0x25a9('0x39')](_0x10166b[_0x25a9('0x35')][_0x25a9('0x39')]));_0x9a02a2['attributes']=_0x9a02a2[_0x25a9('0x38')][_0x25a9('0x3a')]?_0x9a02a2[_0x25a9('0x38')]:_0x127987[_0x25a9('0x33')];if(!_0x10166b[_0x25a9('0x35')]['hasOwnProperty'](_0x25a9('0x3b'))){_0x9a02a2[_0x25a9('0x21')]=qs[_0x25a9('0x21')](_0x10166b[_0x25a9('0x35')][_0x25a9('0x21')]);_0x9a02a2[_0x25a9('0x1f')]=qs[_0x25a9('0x1f')](_0x10166b[_0x25a9('0x35')]['offset']);}_0x9a02a2['order']=qs[_0x25a9('0x3c')](_0x10166b[_0x25a9('0x35')][_0x25a9('0x3c')]);_0x9a02a2[_0x25a9('0x3d')]=qs[_0x25a9('0x36')](_[_0x25a9('0x3e')](_0x10166b[_0x25a9('0x35')],_0x127987[_0x25a9('0x36')]),_0x2e725d);if(_0x10166b[_0x25a9('0x35')][_0x25a9('0x3f')]){_0x9a02a2['where']=_['merge'](_0x9a02a2[_0x25a9('0x3d')],{'$or':_['map'](_0x2e725d,function(_0x56207b){if(_0x56207b[_0x25a9('0x31')]!==_0x25a9('0x40')){var _0x4ab1e2={};_0x4ab1e2[_0x56207b[_0x25a9('0x2b')]]={'$like':'%'+_0x10166b[_0x25a9('0x35')]['filter']+'%'};return _0x4ab1e2;}})});}_0x9a02a2=_[_0x25a9('0x41')]({},_0x9a02a2,_0x10166b[_0x25a9('0x42')]);var _0x455888={'where':_0x9a02a2[_0x25a9('0x3d')]};return db[_0x25a9('0x2e')][_0x25a9('0x22')](_0x455888)['then'](function(_0x316b49){_0x132f5a[_0x25a9('0x22')]=_0x316b49;if(_0x10166b[_0x25a9('0x35')][_0x25a9('0x43')]){_0x9a02a2[_0x25a9('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x9a02a2);})['then'](function(_0xd51a5){_0x132f5a['rows']=_0xd51a5;return _0x132f5a;})[_0x25a9('0x28')](respondWithFilteredResult(_0x308c5e,_0x9a02a2))[_0x25a9('0x45')](handleError(_0x308c5e,null));};exports[_0x25a9('0x46')]=function(_0x3f23cc,_0xca7971){var _0x4c9766={'raw':!![],'where':{'id':_0x3f23cc[_0x25a9('0x47')]['id']}},_0x225810={};_0x225810[_0x25a9('0x33')]=_['keys'](db[_0x25a9('0x2e')][_0x25a9('0x2f')]);_0x225810[_0x25a9('0x35')]=_[_0x25a9('0x48')](_0x3f23cc['query']);_0x225810[_0x25a9('0x36')]=_[_0x25a9('0x37')](_0x225810[_0x25a9('0x33')],_0x225810['query']);_0x4c9766[_0x25a9('0x38')]=_[_0x25a9('0x37')](_0x225810[_0x25a9('0x33')],qs[_0x25a9('0x39')](_0x3f23cc[_0x25a9('0x35')][_0x25a9('0x39')]));_0x4c9766['attributes']=_0x4c9766[_0x25a9('0x38')][_0x25a9('0x3a')]?_0x4c9766[_0x25a9('0x38')]:_0x225810[_0x25a9('0x33')];if(_0x3f23cc['query']['includeAll']){_0x4c9766['include']=[{'all':!![]}];}_0x4c9766=_['merge']({},_0x4c9766,_0x3f23cc[_0x25a9('0x42')]);return db[_0x25a9('0x2e')][_0x25a9('0x49')](_0x4c9766)['then'](handleEntityNotFound(_0xca7971,null))[_0x25a9('0x28')](respondWithResult(_0xca7971,null))[_0x25a9('0x45')](handleError(_0xca7971,null));};exports['create']=function(_0x19e121,_0x2d8501){return db[_0x25a9('0x2e')][_0x25a9('0x4a')](_0x19e121['body'],{})[_0x25a9('0x28')](respondWithResult(_0x2d8501,0xc9))[_0x25a9('0x45')](handleError(_0x2d8501,null));};exports['update']=function(_0x5a33ba,_0x24cc32){if(_0x5a33ba[_0x25a9('0x4b')]['id']){delete _0x5a33ba[_0x25a9('0x4b')]['id'];}return db[_0x25a9('0x2e')][_0x25a9('0x49')]({'where':{'id':_0x5a33ba[_0x25a9('0x47')]['id']}})[_0x25a9('0x28')](handleEntityNotFound(_0x24cc32,null))['then'](saveUpdates(_0x5a33ba[_0x25a9('0x4b')],null))[_0x25a9('0x28')](respondWithResult(_0x24cc32,null))[_0x25a9('0x45')](handleError(_0x24cc32,null));};exports['destroy']=function(_0x49f038,_0x1623f1){return db[_0x25a9('0x2e')][_0x25a9('0x49')]({'where':{'id':_0x49f038['params']['id']}})['then'](handleEntityNotFound(_0x1623f1,null))[_0x25a9('0x28')](removeEntity(_0x1623f1,null))['catch'](handleError(_0x1623f1,null));};exports[_0x25a9('0x4c')]=function(_0xeac259,_0x90fd58){return db[_0x25a9('0x2e')]['describe']()['then'](respondWithResult(_0x90fd58,null))[_0x25a9('0x45')](handleError(_0x90fd58,null));};function wrapUser(_0x56b634){return function(_0x3ccd9e){var _0x140efe=_0x56b634[_0x25a9('0x4d')]({'plain':!![]});_0x140efe[_0x25a9('0x4e')]=[];if(_0x3ccd9e){_0x140efe[_0x25a9('0x4f')]=_0x3ccd9e[_0x25a9('0x50')];_0x140efe[_0x25a9('0x51')]=_0x3ccd9e;}else{_0x140efe['lastMessageAt']=moment(0x0)[_0x25a9('0x52')](_0x25a9('0x53'));_0x140efe['lastMessage']={};}return _0x140efe;};}exports['getUsers']=function(_0x4488bb,_0x2e9cab,_0x1d15f7){var _0xd645c4=[];return db[_0x25a9('0x54')][_0x25a9('0x55')]({'where':{'role':[_0x25a9('0x56'),_0x25a9('0x57'),'user']},'attributes':['id',_0x25a9('0x58'),'name','role',_0x25a9('0x59'),_0x25a9('0x5a'),_0x25a9('0x5b'),_0x25a9('0x5c'),_0x25a9('0x5d'),_0x25a9('0x5e')],'order':qs[_0x25a9('0x3c')](_0x25a9('0x5f')),'include':[{'model':db[_0x25a9('0x60')],'as':_0x25a9('0x61'),'attributes':['id',_0x25a9('0x2b'),_0x25a9('0x31')],'through':{'attributes':[]}}]})[_0x25a9('0x28')](function(_0x224a10){if(_0x224a10){var _0xf9102d=_0x4488bb[_0x25a9('0x62')][_0x25a9('0x4d')]({'plain':!![]});if(!_0xf9102d)throw new Error(_0x25a9('0x63'));if(_0xf9102d[_0x25a9('0x64')]==='user'){return db[_0x25a9('0x65')][_0x25a9('0x49')]({'where':{'name':'Agents','userProfileId':_0xf9102d[_0x25a9('0x66')]},'raw':!![]})[_0x25a9('0x28')](function(_0x41626e){if(_0x41626e){if(_0x41626e['autoAssociation']===0x0){return db[_0x25a9('0x67')][_0x25a9('0x55')]({'where':{'sectionId':_0x41626e['id']},'raw':!![]})[_0x25a9('0x28')](function(_0x2276eb){var _0x51c11f=[];if(_['isEmpty'](_0x2276eb)){_0x51c11f=_['filter'](_0x224a10,function(_0x166e99){if(_0x166e99[_0x25a9('0x64')]!==_0x25a9('0x56')){return _0x166e99;}});return _0x51c11f;}else{for(var _0x3b48ce=0x0;_0x3b48ce<_0x224a10['length'];_0x3b48ce++){var _0x3f8d5f=_0x224a10[_0x3b48ce];if(_0x3f8d5f[_0x25a9('0x64')]==='agent'){var _0x513580=_[_0x25a9('0x49')](_0x2276eb,function(_0x394734){return _0x394734[_0x25a9('0x68')]===_0x3f8d5f['id'];});if(_0x513580)_0x51c11f[_0x25a9('0x69')](_0x3f8d5f);}else{_0x51c11f[_0x25a9('0x69')](_0x3f8d5f);}}return _0x51c11f;}});}else{return _0x224a10;}}else{var _0x448155=_[_0x25a9('0x3f')](_0x224a10,function(_0x3c57ae){if(_0x3c57ae['role']!==_0x25a9('0x56')){return _0x3c57ae;}});return _0x448155;}});}else{return _0x224a10;}}})[_0x25a9('0x28')](function(_0x4cdaef){var _0x27ec58=[];if(_0x4cdaef){_0xd645c4=_0x4cdaef;for(var _0x4b560e=0x0;_0x4b560e<_0x4cdaef[_0x25a9('0x3a')];_0x4b560e+=0x1){_0xd645c4[_0x4b560e]['messages']=[];_0x27ec58[_0x25a9('0x69')](db[_0x25a9('0x2e')][_0x25a9('0x49')]({'where':{'FromId':[_0x4488bb[_0x25a9('0x62')]['id'],_0x4cdaef[_0x4b560e]['id']],'ToId':[_0x4488bb[_0x25a9('0x62')]['id'],_0x4cdaef[_0x4b560e]['id']],'ChatGroupId':null},'attributes':['id',_0x25a9('0x50'),_0x25a9('0x6a'),_0x25a9('0x6b'),_0x25a9('0x6c'),_0x25a9('0x4b')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x25a9('0x28')](wrapUser(_0x4cdaef[_0x4b560e])));}return BPromise[_0x25a9('0x6d')](_0x27ec58);}return[];})[_0x25a9('0x28')](function(_0x3ad143){return{'rows':_0x3ad143,'count':_0x3ad143[_0x25a9('0x3a')]};})[_0x25a9('0x28')](respondWithResult(_0x2e9cab,null))[_0x25a9('0x45')](handleError(_0x2e9cab,null));};
\ No newline at end of file
+var _0x2de3=['FromId','ToId','read','-createdAt','all','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','ChatInternalMessage','include','findAll','show','params','includeAll','merge','create','body','catch','find','describe','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','role','userpic','internal','online','showWebBar','-online','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','isEmpty','resourceId','push'];(function(_0x493d61,_0x67f009){var _0x147baa=function(_0x2ed817){while(--_0x2ed817){_0x493d61['push'](_0x493d61['shift']());}};_0x147baa(++_0x67f009);}(_0x2de3,0x70));var _0x32de=function(_0x44d37f,_0x5d21ee){_0x44d37f=_0x44d37f-0x0;var _0x48f105=_0x2de3[_0x44d37f];return _0x48f105;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32de('0x0'));var zipdir=require(_0x32de('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32de('0x2'));var moment=require('moment');var BPromise=require(_0x32de('0x3'));var Mustache=require(_0x32de('0x4'));var util=require(_0x32de('0x5'));var path=require(_0x32de('0x6'));var sox=require(_0x32de('0x7'));var csv=require('to-csv');var ejs=require(_0x32de('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32de('0x9'));var squel=require(_0x32de('0xa'));var crypto=require(_0x32de('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x32de('0xc'));var toCsv=require(_0x32de('0xd'));var querystring=require(_0x32de('0xe'));var Papa=require(_0x32de('0xf'));var Redis=require('ioredis');var authService=require(_0x32de('0x10'));var qs=require(_0x32de('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32de('0x12'))(_0x32de('0x13'));var utils=require('../../config/utils');var config=require(_0x32de('0x14'));var licenseUtil=require(_0x32de('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x32de('0x16')](config[_0x32de('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x32de('0x18'))(new Redis(config[_0x32de('0x17')]));require(_0x32de('0x19'))[_0x32de('0x1a')](socket);function respondWithStatusCode(_0x232376,_0x3316a1){_0x3316a1=_0x3316a1||0xcc;return function(_0x4042eb){if(_0x4042eb){return _0x232376[_0x32de('0x1b')](_0x3316a1);}return _0x232376['status'](_0x3316a1)['end']();};}function respondWithResult(_0x23cedc,_0x3fe272){_0x3fe272=_0x3fe272||0xc8;return function(_0x4db7b7){if(_0x4db7b7){return _0x23cedc[_0x32de('0x1c')](_0x3fe272)[_0x32de('0x1d')](_0x4db7b7);}};}function respondWithFilteredResult(_0x553d7d,_0x5870e1){return function(_0x16d6c6){if(_0x16d6c6){var _0x1e3cea=typeof _0x5870e1['offset']==='undefined'&&typeof _0x5870e1[_0x32de('0x1e')]===_0x32de('0x1f');var _0x27dcfc=_0x16d6c6['count'];var _0x2b75e9=_0x1e3cea?0x0:_0x5870e1[_0x32de('0x20')];var _0x2fe59a=_0x1e3cea?_0x16d6c6[_0x32de('0x21')]:_0x5870e1[_0x32de('0x20')]+_0x5870e1[_0x32de('0x1e')];var _0x54ae9e;if(_0x2fe59a>=_0x27dcfc){_0x2fe59a=_0x27dcfc;_0x54ae9e=0xc8;}else{_0x54ae9e=0xce;}_0x553d7d[_0x32de('0x1c')](_0x54ae9e);return _0x553d7d[_0x32de('0x22')](_0x32de('0x23'),_0x2b75e9+'-'+_0x2fe59a+'/'+_0x27dcfc)[_0x32de('0x1d')](_0x16d6c6);}return null;};}function patchUpdates(_0x243385){return function(_0x38a526){try{jsonpatch[_0x32de('0x24')](_0x38a526,_0x243385,!![]);}catch(_0x1d5ee7){return BPromise[_0x32de('0x25')](_0x1d5ee7);}return _0x38a526[_0x32de('0x26')]();};}function saveUpdates(_0x4d16c9,_0x5cecb1){return function(_0x55b208){if(_0x55b208){return _0x55b208[_0x32de('0x27')](_0x4d16c9)['then'](function(_0x4244f7){return _0x4244f7;});}return null;};}function removeEntity(_0x36936f,_0x573bcf){return function(_0x4e1ca4){if(_0x4e1ca4){return _0x4e1ca4[_0x32de('0x28')]()[_0x32de('0x29')](function(){_0x36936f[_0x32de('0x1c')](0xcc)[_0x32de('0x2a')]();});}};}function handleEntityNotFound(_0x2b6fde,_0x4d6299){return function(_0x5598c7){if(!_0x5598c7){_0x2b6fde['sendStatus'](0x194);}return _0x5598c7;};}function handleError(_0x23a532,_0x4ca57c){_0x4ca57c=_0x4ca57c||0x1f4;return function(_0x592bfa){logger[_0x32de('0x2b')](_0x592bfa[_0x32de('0x2c')]);if(_0x592bfa['name']){delete _0x592bfa[_0x32de('0x2d')];}_0x23a532['status'](_0x4ca57c)['send'](_0x592bfa);};}exports[_0x32de('0x2e')]=function(_0x5e5a4c,_0x3a902a){var _0x3aa285={},_0x358d72={},_0x5d6e5c={'count':0x0,'rows':[]};var _0x588868=_[_0x32de('0x2f')](db['ChatInternalMessage'][_0x32de('0x30')],function(_0x3b2ffa){return{'name':_0x3b2ffa[_0x32de('0x31')],'type':_0x3b2ffa[_0x32de('0x32')][_0x32de('0x33')]};});_0x358d72['model']=_[_0x32de('0x2f')](_0x588868,_0x32de('0x2d'));_0x358d72[_0x32de('0x34')]=_[_0x32de('0x35')](_0x5e5a4c[_0x32de('0x34')]);_0x358d72['filters']=_['intersection'](_0x358d72['model'],_0x358d72[_0x32de('0x34')]);_0x3aa285[_0x32de('0x36')]=_[_0x32de('0x37')](_0x358d72[_0x32de('0x38')],qs[_0x32de('0x39')](_0x5e5a4c[_0x32de('0x34')][_0x32de('0x39')]));_0x3aa285[_0x32de('0x36')]=_0x3aa285['attributes'][_0x32de('0x3a')]?_0x3aa285[_0x32de('0x36')]:_0x358d72[_0x32de('0x38')];if(!_0x5e5a4c['query']['hasOwnProperty'](_0x32de('0x3b'))){_0x3aa285[_0x32de('0x1e')]=qs['limit'](_0x5e5a4c[_0x32de('0x34')][_0x32de('0x1e')]);_0x3aa285[_0x32de('0x20')]=qs[_0x32de('0x20')](_0x5e5a4c[_0x32de('0x34')][_0x32de('0x20')]);}_0x3aa285[_0x32de('0x3c')]=qs[_0x32de('0x3d')](_0x5e5a4c[_0x32de('0x34')][_0x32de('0x3d')]);_0x3aa285[_0x32de('0x3e')]=qs[_0x32de('0x3f')](_[_0x32de('0x40')](_0x5e5a4c[_0x32de('0x34')],_0x358d72[_0x32de('0x3f')]),_0x588868);if(_0x5e5a4c[_0x32de('0x34')][_0x32de('0x41')]){_0x3aa285['where']=_['merge'](_0x3aa285[_0x32de('0x3e')],{'$or':_[_0x32de('0x2f')](_0x588868,function(_0x24d58f){if(_0x24d58f[_0x32de('0x32')]!==_0x32de('0x42')){var _0x2a6b2a={};_0x2a6b2a[_0x24d58f[_0x32de('0x2d')]]={'$like':'%'+_0x5e5a4c[_0x32de('0x34')][_0x32de('0x41')]+'%'};return _0x2a6b2a;}})});}_0x3aa285=_['merge']({},_0x3aa285,_0x5e5a4c[_0x32de('0x43')]);var _0x43a26c={'where':_0x3aa285[_0x32de('0x3e')]};return db[_0x32de('0x44')][_0x32de('0x21')](_0x43a26c)[_0x32de('0x29')](function(_0x3b2807){_0x5d6e5c[_0x32de('0x21')]=_0x3b2807;if(_0x5e5a4c[_0x32de('0x34')]['includeAll']){_0x3aa285[_0x32de('0x45')]=[{'all':!![]}];}return db[_0x32de('0x44')][_0x32de('0x46')](_0x3aa285);})[_0x32de('0x29')](function(_0x3502d0){_0x5d6e5c['rows']=_0x3502d0;return _0x5d6e5c;})[_0x32de('0x29')](respondWithFilteredResult(_0x3a902a,_0x3aa285))['catch'](handleError(_0x3a902a,null));};exports[_0x32de('0x47')]=function(_0x490d87,_0x1b9465){var _0x6ff599={'raw':!![],'where':{'id':_0x490d87[_0x32de('0x48')]['id']}},_0x54591d={};_0x54591d[_0x32de('0x38')]=_[_0x32de('0x35')](db['ChatInternalMessage'][_0x32de('0x30')]);_0x54591d['query']=_[_0x32de('0x35')](_0x490d87[_0x32de('0x34')]);_0x54591d[_0x32de('0x3f')]=_[_0x32de('0x37')](_0x54591d[_0x32de('0x38')],_0x54591d[_0x32de('0x34')]);_0x6ff599[_0x32de('0x36')]=_[_0x32de('0x37')](_0x54591d[_0x32de('0x38')],qs['fields'](_0x490d87['query']['fields']));_0x6ff599[_0x32de('0x36')]=_0x6ff599[_0x32de('0x36')]['length']?_0x6ff599[_0x32de('0x36')]:_0x54591d[_0x32de('0x38')];if(_0x490d87[_0x32de('0x34')][_0x32de('0x49')]){_0x6ff599[_0x32de('0x45')]=[{'all':!![]}];}_0x6ff599=_[_0x32de('0x4a')]({},_0x6ff599,_0x490d87['options']);return db[_0x32de('0x44')]['find'](_0x6ff599)[_0x32de('0x29')](handleEntityNotFound(_0x1b9465,null))[_0x32de('0x29')](respondWithResult(_0x1b9465,null))['catch'](handleError(_0x1b9465,null));};exports[_0x32de('0x4b')]=function(_0x579fc2,_0x3bdd64){return db[_0x32de('0x44')][_0x32de('0x4b')](_0x579fc2[_0x32de('0x4c')],{})[_0x32de('0x29')](respondWithResult(_0x3bdd64,0xc9))['catch'](handleError(_0x3bdd64,null));};exports[_0x32de('0x27')]=function(_0x370af8,_0x504021){if(_0x370af8[_0x32de('0x4c')]['id']){delete _0x370af8[_0x32de('0x4c')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x370af8[_0x32de('0x48')]['id']}})[_0x32de('0x29')](handleEntityNotFound(_0x504021,null))['then'](saveUpdates(_0x370af8[_0x32de('0x4c')],null))['then'](respondWithResult(_0x504021,null))[_0x32de('0x4d')](handleError(_0x504021,null));};exports['destroy']=function(_0x41cd38,_0x187c61){return db['ChatInternalMessage'][_0x32de('0x4e')]({'where':{'id':_0x41cd38[_0x32de('0x48')]['id']}})[_0x32de('0x29')](handleEntityNotFound(_0x187c61,null))[_0x32de('0x29')](removeEntity(_0x187c61,null))[_0x32de('0x4d')](handleError(_0x187c61,null));};exports[_0x32de('0x4f')]=function(_0x4a40f6,_0x36fcbd){return db['ChatInternalMessage']['describe']()[_0x32de('0x29')](respondWithResult(_0x36fcbd,null))['catch'](handleError(_0x36fcbd,null));};function wrapUser(_0x54d93b){return function(_0xc72320){var _0x4c9e7a=_0x54d93b['get']({'plain':!![]});_0x4c9e7a[_0x32de('0x50')]=[];if(_0xc72320){_0x4c9e7a[_0x32de('0x51')]=_0xc72320[_0x32de('0x52')];_0x4c9e7a[_0x32de('0x53')]=_0xc72320;}else{_0x4c9e7a[_0x32de('0x51')]=moment(0x0)['format'](_0x32de('0x54'));_0x4c9e7a['lastMessage']={};}return _0x4c9e7a;};}exports['getUsers']=function(_0xb00e59,_0x55708f,_0x45cb9d){var _0x4fbf1c=[];return db['User'][_0x32de('0x46')]({'where':{'role':[_0x32de('0x55'),_0x32de('0x56'),_0x32de('0x57')]},'attributes':['id',_0x32de('0x58'),_0x32de('0x2d'),_0x32de('0x59'),_0x32de('0x5a'),_0x32de('0x5b'),_0x32de('0x5c'),'lastLoginAt','allowmessenger',_0x32de('0x5d')],'order':qs[_0x32de('0x3d')](_0x32de('0x5e')),'include':[{'model':db['VoiceQueue'],'as':_0x32de('0x5f'),'attributes':['id',_0x32de('0x2d'),_0x32de('0x32')],'through':{'attributes':[]}}]})[_0x32de('0x29')](function(_0x49429d){if(_0x49429d){var _0x17519b=_0xb00e59[_0x32de('0x57')]['get']({'plain':!![]});if(!_0x17519b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17519b['role']==='user'){return db[_0x32de('0x60')][_0x32de('0x4e')]({'where':{'name':'Agents','userProfileId':_0x17519b[_0x32de('0x61')]},'raw':!![]})['then'](function(_0x348ab4){if(_0x348ab4){if(_0x348ab4[_0x32de('0x62')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x348ab4['id']},'raw':!![]})['then'](function(_0xe6a8eb){var _0xd92e9a=[];if(_[_0x32de('0x63')](_0xe6a8eb)){_0xd92e9a=_[_0x32de('0x41')](_0x49429d,function(_0x2b030f){if(_0x2b030f['role']!==_0x32de('0x55')){return _0x2b030f;}});return _0xd92e9a;}else{for(var _0x4e2702=0x0;_0x4e2702<_0x49429d['length'];_0x4e2702++){var _0x406cb9=_0x49429d[_0x4e2702];if(_0x406cb9[_0x32de('0x59')]===_0x32de('0x55')){var _0x1acd15=_[_0x32de('0x4e')](_0xe6a8eb,function(_0x111e2c){return _0x111e2c[_0x32de('0x64')]===_0x406cb9['id'];});if(_0x1acd15)_0xd92e9a[_0x32de('0x65')](_0x406cb9);}else{_0xd92e9a[_0x32de('0x65')](_0x406cb9);}}return _0xd92e9a;}});}else{return _0x49429d;}}else{var _0x2f5f79=_[_0x32de('0x41')](_0x49429d,function(_0x5c25a3){if(_0x5c25a3[_0x32de('0x59')]!=='agent'){return _0x5c25a3;}});return _0x2f5f79;}});}else{return _0x49429d;}}})['then'](function(_0x3224c0){var _0x976982=[];if(_0x3224c0){_0x4fbf1c=_0x3224c0;for(var _0x1541bf=0x0;_0x1541bf<_0x3224c0['length'];_0x1541bf+=0x1){_0x4fbf1c[_0x1541bf][_0x32de('0x50')]=[];_0x976982[_0x32de('0x65')](db[_0x32de('0x44')][_0x32de('0x4e')]({'where':{'FromId':[_0xb00e59[_0x32de('0x57')]['id'],_0x3224c0[_0x1541bf]['id']],'ToId':[_0xb00e59[_0x32de('0x57')]['id'],_0x3224c0[_0x1541bf]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x32de('0x66'),_0x32de('0x67'),_0x32de('0x68'),_0x32de('0x4c')],'order':qs[_0x32de('0x3d')](_0x32de('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3224c0[_0x1541bf])));}return BPromise[_0x32de('0x6a')](_0x976982);}return[];})[_0x32de('0x29')](function(_0x38e323){return{'rows':_0x38e323,'count':_0x38e323[_0x32de('0x3a')]};})[_0x32de('0x29')](respondWithResult(_0x55708f,null))[_0x32de('0x4d')](handleError(_0x55708f,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index dadb59d..6a3cde9 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 _0x57e9=['update','remove','emit','events','../../mysqldb','ChatInternalMessage','save'];(function(_0x5ed413,_0x4f26c0){var _0x3cca33=function(_0x214afe){while(--_0x214afe){_0x5ed413['push'](_0x5ed413['shift']());}};_0x3cca33(++_0x4f26c0);}(_0x57e9,0xce));var _0x957e=function(_0x5b7a0a,_0x4d62d5){_0x5b7a0a=_0x5b7a0a-0x0;var _0x3418b6=_0x57e9[_0x5b7a0a];return _0x3418b6;};'use strict';var EventEmitter=require(_0x957e('0x0'));var ChatInternalMessage=require(_0x957e('0x1'))['db'][_0x957e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x957e('0x3'),'afterUpdate':_0x957e('0x4'),'afterDestroy':_0x957e('0x5')};function emitEvent(_0x44410f){return function(_0x3a44d5,_0xee6b30,_0x581cf6){ChatInternalMessageEvents[_0x957e('0x6')](_0x44410f+':'+_0x3a44d5['id'],_0x3a44d5);ChatInternalMessageEvents['emit'](_0x44410f,_0x3a44d5);_0x581cf6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x6e1d=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0xbc8e40,_0x281072){var _0x5c5bcc=function(_0x41fa81){while(--_0x41fa81){_0xbc8e40['push'](_0xbc8e40['shift']());}};_0x5c5bcc(++_0x281072);}(_0x6e1d,0xfa));var _0xd6e1=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x6e1d[_0x1d9aa0];return _0x226868;};'use strict';var EventEmitter=require(_0xd6e1('0x0'));var ChatInternalMessage=require(_0xd6e1('0x1'))['db'][_0xd6e1('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd6e1('0x3')](0x0);var events={'afterCreate':_0xd6e1('0x4'),'afterUpdate':_0xd6e1('0x5'),'afterDestroy':_0xd6e1('0x6')};function emitEvent(_0x313df4){return function(_0x51f6fd,_0x362040,_0x13d61e){ChatInternalMessageEvents[_0xd6e1('0x7')](_0x313df4+':'+_0x51f6fd['id'],_0x51f6fd);ChatInternalMessageEvents['emit'](_0x313df4,_0x51f6fd);_0x13d61e(null);};}for(var e in events){if(events[_0xd6e1('0x8')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xd6e1('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 25ba955..2430ea9 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 _0x84ca=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x33acc2,_0x198db3){var _0x29f09d=function(_0x3c527e){while(--_0x3c527e){_0x33acc2['push'](_0x33acc2['shift']());}};_0x29f09d(++_0x198db3);}(_0x84ca,0xca));var _0xa84c=function(_0x5ec57a,_0x4fb107){_0x5ec57a=_0x5ec57a-0x0;var _0x2b717b=_0x84ca[_0x5ec57a];return _0x2b717b;};'use strict';var _=require(_0xa84c('0x0'));var util=require(_0xa84c('0x1'));var logger=require('../../config/logger')(_0xa84c('0x2'));var moment=require(_0xa84c('0x3'));var BPromise=require(_0xa84c('0x4'));var rp=require(_0xa84c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa84c('0x6'));var config=require(_0xa84c('0x7'));var attributes=require(_0xa84c('0x8'));module[_0xa84c('0x9')]=function(_0x522894,_0x13b07c){return _0x522894[_0xa84c('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa84c('0xb'),'collate':_0xa84c('0xc')});};
\ No newline at end of file
+var _0xf8b2=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56d35f,_0x3508d1){var _0x56b755=function(_0x54c273){while(--_0x54c273){_0x56d35f['push'](_0x56d35f['shift']());}};_0x56b755(++_0x3508d1);}(_0xf8b2,0x150));var _0x2f8b=function(_0x21a44e,_0x203f07){_0x21a44e=_0x21a44e-0x0;var _0x5f1638=_0xf8b2[_0x21a44e];return _0x5f1638;};'use strict';var _=require(_0x2f8b('0x0'));var util=require('util');var logger=require(_0x2f8b('0x1'))(_0x2f8b('0x2'));var moment=require(_0x2f8b('0x3'));var BPromise=require(_0x2f8b('0x4'));var rp=require(_0x2f8b('0x5'));var fs=require('fs');var path=require(_0x2f8b('0x6'));var rimraf=require(_0x2f8b('0x7'));var config=require(_0x2f8b('0x8'));var attributes=require(_0x2f8b('0x9'));module[_0x2f8b('0xa')]=function(_0x3094f8,_0x4bc4f4){return _0x3094f8[_0x2f8b('0xb')](_0x2f8b('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f8b('0xd'),'collate':_0x2f8b('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 6bee3a7..8334110 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 _0xb6a9=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb6a9,0xc4));var _0x9b6a=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xb6a9[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x9b6a('0x0'));var util=require(_0x9b6a('0x1'));var moment=require('moment');var BPromise=require(_0x9b6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b6a('0x3'));var db=require(_0x9b6a('0x4'))['db'];var utils=require(_0x9b6a('0x5'));var logger=require(_0x9b6a('0x6'))(_0x9b6a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9b6a('0x8'));var client=jayson[_0x9b6a('0x9')][_0x9b6a('0xa')]({'port':0x232a});config[_0x9b6a('0xb')]=_[_0x9b6a('0xc')](config[_0x9b6a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9b6a('0xd'))(new Redis(config['redis']));require(_0x9b6a('0xe'))[_0x9b6a('0xf')](socket);function respondWithRpcPromise(_0x5efc13,_0x271ef4,_0x525480){return new BPromise(function(_0x55af0c,_0x222780){return client[_0x9b6a('0x10')](_0x5efc13,_0x525480)[_0x9b6a('0x11')](function(_0x2295f0){logger[_0x9b6a('0x12')](_0x9b6a('0x13'),_0x271ef4,_0x9b6a('0x14'));logger[_0x9b6a('0x15')](_0x9b6a('0x16'),_0x271ef4,_0x9b6a('0x14'),JSON[_0x9b6a('0x17')](_0x2295f0));if(_0x2295f0[_0x9b6a('0x18')]){if(_0x2295f0[_0x9b6a('0x18')]['code']===0x1f4){logger['error'](_0x9b6a('0x13'),_0x271ef4,_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);return _0x222780(_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);}logger[_0x9b6a('0x18')](_0x9b6a('0x13'),_0x271ef4,_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);return _0x55af0c(_0x2295f0[_0x9b6a('0x18')][_0x9b6a('0x19')]);}else{logger[_0x9b6a('0x12')](_0x9b6a('0x13'),_0x271ef4,_0x9b6a('0x14'));_0x55af0c(_0x2295f0[_0x9b6a('0x1a')][_0x9b6a('0x19')]);}})[_0x9b6a('0x1b')](function(_0xa8e9d6){logger[_0x9b6a('0x18')](_0x9b6a('0x13'),_0x271ef4,_0xa8e9d6);_0x222780(_0xa8e9d6);});});}
\ No newline at end of file
+var _0x7a55=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x22016b,_0x3ed930){var _0x3ed6f1=function(_0x1e7c48){while(--_0x1e7c48){_0x22016b['push'](_0x22016b['shift']());}};_0x3ed6f1(++_0x3ed930);}(_0x7a55,0x173));var _0x57a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7a55[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57a5('0x0'));var util=require(_0x57a5('0x1'));var moment=require('moment');var BPromise=require(_0x57a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57a5('0x3'));var db=require(_0x57a5('0x4'))['db'];var utils=require(_0x57a5('0x5'));var logger=require(_0x57a5('0x6'))(_0x57a5('0x7'));var config=require(_0x57a5('0x8'));var jayson=require(_0x57a5('0x9'));var client=jayson[_0x57a5('0xa')][_0x57a5('0xb')]({'port':0x232a});config[_0x57a5('0xc')]=_['defaults'](config[_0x57a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x57a5('0xd'))(new Redis(config[_0x57a5('0xc')]));require(_0x57a5('0xe'))[_0x57a5('0xf')](socket);function respondWithRpcPromise(_0x227632,_0x31c321,_0x2e86f1){return new BPromise(function(_0x4a14ab,_0x108c93){return client[_0x57a5('0x10')](_0x227632,_0x2e86f1)[_0x57a5('0x11')](function(_0x47f431){logger[_0x57a5('0x12')](_0x57a5('0x13'),_0x31c321,_0x57a5('0x14'));logger[_0x57a5('0x15')](_0x57a5('0x16'),_0x31c321,_0x57a5('0x14'),JSON[_0x57a5('0x17')](_0x47f431));if(_0x47f431[_0x57a5('0x18')]){if(_0x47f431[_0x57a5('0x18')][_0x57a5('0x19')]===0x1f4){logger['error'](_0x57a5('0x13'),_0x31c321,_0x47f431['error'][_0x57a5('0x1a')]);return _0x108c93(_0x47f431['error']['message']);}logger[_0x57a5('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x31c321,_0x47f431[_0x57a5('0x18')]['message']);return _0x4a14ab(_0x47f431[_0x57a5('0x18')]['message']);}else{logger[_0x57a5('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x31c321,_0x57a5('0x14'));_0x4a14ab(_0x47f431[_0x57a5('0x1b')]['message']);}})[_0x57a5('0x1c')](function(_0x23cfa1){logger['error'](_0x57a5('0x13'),_0x31c321,_0x23cfa1);_0x108c93(_0x23cfa1);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index bb0f84f..120189f 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 _0xd6ec=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x4ecb61,_0xf4fe26){var _0x25eec8=function(_0xa0aeb){while(--_0xa0aeb){_0x4ecb61['push'](_0x4ecb61['shift']());}};_0x25eec8(++_0xf4fe26);}(_0xd6ec,0x18d));var _0xcd6e=function(_0x11f586,_0x1a11da){_0x11f586=_0x11f586-0x0;var _0x46b786=_0xd6ec[_0x11f586];return _0x46b786;};'use strict';var ChatInternalMessageEvents=require(_0xcd6e('0x0'));var events=['save',_0xcd6e('0x1'),_0xcd6e('0x2')];function createListener(_0x2269b6,_0x35f8b1){return function(_0x15bcf2){_0x35f8b1[_0xcd6e('0x3')](_0x2269b6,_0x15bcf2);};}function removeListener(_0x1ce042,_0x4f29f2){return function(){ChatInternalMessageEvents['removeListener'](_0x1ce042,_0x4f29f2);};}exports[_0xcd6e('0x4')]=function(_0x371d76){for(var _0x1f8c89=0x0,_0x176612=events[_0xcd6e('0x5')];_0x1f8c89<_0x176612;_0x1f8c89++){var _0xde523e=events[_0x1f8c89];var _0x8d3396=createListener(_0xcd6e('0x6')+_0xde523e,_0x371d76);ChatInternalMessageEvents['on'](_0xde523e,_0x8d3396);}};
\ No newline at end of file
+var _0x0d5b=['removeListener','register','length','chatInternalMessage:','save','update'];(function(_0x24579a,_0x59612d){var _0x59dff7=function(_0x47c50f){while(--_0x47c50f){_0x24579a['push'](_0x24579a['shift']());}};_0x59dff7(++_0x59612d);}(_0x0d5b,0x1a2));var _0xb0d5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0d5b[_0xa464c9];return _0x3d73c4;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xb0d5('0x0'),'remove',_0xb0d5('0x1')];function createListener(_0x3bea57,_0x4d5595){return function(_0x19e1f8){_0x4d5595['emit'](_0x3bea57,_0x19e1f8);};}function removeListener(_0x400434,_0x3c7ca5){return function(){ChatInternalMessageEvents[_0xb0d5('0x2')](_0x400434,_0x3c7ca5);};}exports[_0xb0d5('0x3')]=function(_0x3acb99){for(var _0x3cfb99=0x0,_0x56ba72=events[_0xb0d5('0x4')];_0x3cfb99<_0x56ba72;_0x3cfb99++){var _0x4f85c8=events[_0x3cfb99];var _0x20b444=createListener(_0xb0d5('0x5')+_0x4f85c8,_0x3acb99);ChatInternalMessageEvents['on'](_0x4f85c8,_0x20b444);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 39c142c..6ef9afb 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 _0x2ff7=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id','show','create','put','update','delete','destroy','multer','util'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0x2ff7,0xbb));var _0x72ff=function(_0x5223de,_0xb0a127){_0x5223de=_0x5223de-0x0;var _0x4a52ee=_0x2ff7[_0x5223de];return _0x4a52ee;};'use strict';var multer=require(_0x72ff('0x0'));var util=require(_0x72ff('0x1'));var path=require('path');var timeout=require(_0x72ff('0x2'));var express=require(_0x72ff('0x3'));var router=express[_0x72ff('0x4')]();var fs_extra=require(_0x72ff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x72ff('0x6'));var config=require(_0x72ff('0x7'));var controller=require(_0x72ff('0x8'));router[_0x72ff('0x9')]('/',auth[_0x72ff('0xa')](),controller['index']);router[_0x72ff('0x9')](_0x72ff('0xb'),auth[_0x72ff('0xa')](),controller[_0x72ff('0xc')]);router[_0x72ff('0x9')]('/users',auth[_0x72ff('0xa')](),controller[_0x72ff('0xd')]);router[_0x72ff('0x9')](_0x72ff('0xe'),auth[_0x72ff('0xa')](),controller[_0x72ff('0xf')]);router['post']('/',auth[_0x72ff('0xa')](),controller[_0x72ff('0x10')]);router[_0x72ff('0x11')](_0x72ff('0xe'),controller[_0x72ff('0x12')]);router[_0x72ff('0x13')](_0x72ff('0xe'),auth[_0x72ff('0xa')](),controller[_0x72ff('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xed84=['connect-timeout','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id','post','put','update','delete','destroy','exports','util','path'];(function(_0x19c6a6,_0x36701d){var _0x29014=function(_0x4a61b3){while(--_0x4a61b3){_0x19c6a6['push'](_0x19c6a6['shift']());}};_0x29014(++_0x36701d);}(_0xed84,0x166));var _0x4ed8=function(_0x2ee365,_0x4340e6){_0x2ee365=_0x2ee365-0x0;var _0x4b5298=_0xed84[_0x2ee365];return _0x4b5298;};'use strict';var multer=require('multer');var util=require(_0x4ed8('0x0'));var path=require(_0x4ed8('0x1'));var timeout=require(_0x4ed8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4ed8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4ed8('0x4'));var config=require('../../config/environment');var controller=require(_0x4ed8('0x5'));router[_0x4ed8('0x6')]('/',auth[_0x4ed8('0x7')](),controller['index']);router['get'](_0x4ed8('0x8'),auth[_0x4ed8('0x7')](),controller[_0x4ed8('0x9')]);router['get']('/users',auth[_0x4ed8('0x7')](),controller[_0x4ed8('0xa')]);router[_0x4ed8('0x6')](_0x4ed8('0xb'),auth[_0x4ed8('0x7')](),controller['show']);router[_0x4ed8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ed8('0xd')]('/:id',controller[_0x4ed8('0xe')]);router[_0x4ed8('0xf')](_0x4ed8('0xb'),auth[_0x4ed8('0x7')](),controller[_0x4ed8('0x10')]);module[_0x4ed8('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index ebe9587..f02e840 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 _0x4849=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x52923d,_0x1c45a4){var _0x56ec0e=function(_0x27630c){while(--_0x27630c){_0x52923d['push'](_0x52923d['shift']());}};_0x56ec0e(++_0x1c45a4);}(_0x4849,0xf8));var _0x9484=function(_0x3db99c,_0xd75b6f){_0x3db99c=_0x3db99c-0x0;var _0xf5263b=_0x4849[_0x3db99c];return _0xf5263b;};'use strict';var Sequelize=require(_0x9484('0x0'));module[_0x9484('0x1')]={'body':{'type':Sequelize[_0x9484('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9484('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9484('0x4')]('in',_0x9484('0x5')),'defaultValue':_0x9484('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9484('0x6')]},'providerName':{'type':Sequelize[_0x9484('0x7')]},'providerResponse':{'type':Sequelize[_0x9484('0x2')]}};
\ No newline at end of file
+var _0x81a5=['sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x81a5,0x1c8));var _0x581a=function(_0x191fa4,_0x59286d){_0x191fa4=_0x191fa4-0x0;var _0x4b7dac=_0x81a5[_0x191fa4];return _0x4b7dac;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'body':{'type':Sequelize[_0x581a('0x2')](_0x581a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x581a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x581a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x581a('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 7905795..f5bfb3d 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 _0xf6c6=['find','create','update','body','destroy','describe','accept','acceptMessage','reject','chat','UserId','agent','get','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','format','SIP/%s','channel','event','EventManager','rejectmessage','interaction','formData','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','limit','undefined','count','Content-Range','then','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','keys'];(function(_0x4f6173,_0xe63497){var _0x2eb711=function(_0x2b0c38){while(--_0x2b0c38){_0x4f6173['push'](_0x4f6173['shift']());}};_0x2eb711(++_0xe63497);}(_0xf6c6,0x8d));var _0x6f6c=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xf6c6[_0x44946b];return _0x249bc4;};'use strict';var util=require(_0x6f6c('0x0'));var _=require(_0x6f6c('0x1'));var Redis=require(_0x6f6c('0x2'));var interactionService=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x6f6c('0x3'))(_0x6f6c('0x4'));var config=require(_0x6f6c('0x5'));var db=require(_0x6f6c('0x6'))['db'];config['redis']=_[_0x6f6c('0x7')](config[_0x6f6c('0x8')],{'host':_0x6f6c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6f6c('0xa'))[_0x6f6c('0xb')](socket);var jayson=require(_0x6f6c('0xc'));var client=jayson['client'][_0x6f6c('0xd')]({'port':0x232c});var client9002=jayson[_0x6f6c('0xe')][_0x6f6c('0xd')]({'port':0x232a});var interaction_log=require(_0x6f6c('0x3'))('chat-interactions');function respondWithRpcPromise(_0x32bd1a,_0x5ec938,_0x2f352d,_0xe0b67f){return new Promise(function(_0x2bbeb9,_0xf79d2d){var _0x452a02=_0xe0b67f||client;return _0x452a02[_0x6f6c('0xf')](_0x32bd1a,_0x2f352d)['then'](function(_0x2cb519){logger[_0x6f6c('0x10')](_0x6f6c('0x11'),_0x5ec938,_0x6f6c('0x12'));logger['debug'](_0x6f6c('0x13'),_0x5ec938,_0x6f6c('0x12'),JSON[_0x6f6c('0x14')](_0x2cb519));if(_0x2cb519[_0x6f6c('0x15')]){if(_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x16')]===0x1f4){logger['error'](_0x6f6c('0x11'),_0x5ec938,_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x17')]);return _0xf79d2d(_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x17')]);}logger[_0x6f6c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5ec938,_0x2cb519[_0x6f6c('0x15')][_0x6f6c('0x17')]);return _0x2bbeb9(_0x2cb519[_0x6f6c('0x15')]['message']);}else{logger['info'](_0x6f6c('0x11'),_0x5ec938,_0x6f6c('0x12'));_0x2bbeb9(_0x2cb519[_0x6f6c('0x18')][_0x6f6c('0x17')]);}})[_0x6f6c('0x19')](function(_0x3bd6c0){logger[_0x6f6c('0x15')](_0x6f6c('0x11'),_0x5ec938,_0x3bd6c0);_0xf79d2d(_0x3bd6c0);});});}function respondWithResult(_0x3184d7,_0x43d288){_0x43d288=_0x43d288||0xc8;return function(_0x2ecf8a){if(_0x2ecf8a){return _0x3184d7[_0x6f6c('0x1a')](_0x43d288)[_0x6f6c('0x1b')](_0x2ecf8a);}};}function respondWithFilteredResult(_0x56ea08,_0x5f17da){return function(_0x4842ee){if(_0x4842ee){var _0x14f811=typeof _0x5f17da[_0x6f6c('0x1c')]==='undefined'&&typeof _0x5f17da[_0x6f6c('0x1d')]===_0x6f6c('0x1e');var _0x58fdaa=_0x4842ee[_0x6f6c('0x1f')];var _0x42a7f3=_0x14f811?0x0:_0x5f17da[_0x6f6c('0x1c')];var _0x47673e=_0x14f811?_0x4842ee[_0x6f6c('0x1f')]:_0x5f17da['offset']+_0x5f17da[_0x6f6c('0x1d')];var _0x1fa26a;if(_0x47673e>=_0x58fdaa){_0x47673e=_0x58fdaa;_0x1fa26a=0xc8;}else{_0x1fa26a=0xce;}_0x56ea08[_0x6f6c('0x1a')](_0x1fa26a);return _0x56ea08['set'](_0x6f6c('0x20'),_0x42a7f3+'-'+_0x47673e+'/'+_0x58fdaa)[_0x6f6c('0x1b')](_0x4842ee);}return null;};}function saveUpdates(_0xf39934){return function(_0x3c03b2){if(_0x3c03b2){return _0x3c03b2['update'](_0xf39934)[_0x6f6c('0x21')](function(_0x295fea){return _0x295fea;});}return null;};}function removeEntity(_0x5031f7){return function(_0x13496e){if(_0x13496e){return _0x13496e['destroy']()[_0x6f6c('0x21')](function(){_0x5031f7[_0x6f6c('0x1a')](0xcc)[_0x6f6c('0x22')]();});}};}function handleEntityNotFound(_0x12aff5){return function(_0x172a7a){if(!_0x172a7a){_0x12aff5[_0x6f6c('0x23')](0x194);}return _0x172a7a;};}function handleError(_0x21d80f,_0xaf4f){_0xaf4f=_0xaf4f||0x1f4;return function(_0x15212e){logger[_0x6f6c('0x15')](_0x15212e[_0x6f6c('0x24')]);if(_0x15212e[_0x6f6c('0x25')]){delete _0x15212e['name'];}_0x21d80f['status'](_0xaf4f)[_0x6f6c('0x26')](_0x15212e);};}exports[_0x6f6c('0x27')]=function(_0x4f5590,_0x1f55e3){var _0xdfcd78={},_0xe6f2b0={},_0x5b4156={'count':0x0,'rows':[]};var _0x150545=_[_0x6f6c('0x28')](db['ChatMessage'][_0x6f6c('0x29')],function(_0x5121b8){return{'name':_0x5121b8[_0x6f6c('0x2a')],'type':_0x5121b8[_0x6f6c('0x2b')][_0x6f6c('0x2c')]};});_0xe6f2b0['model']=_[_0x6f6c('0x28')](_0x150545,_0x6f6c('0x25'));_0xe6f2b0[_0x6f6c('0x2d')]=_['keys'](_0x4f5590[_0x6f6c('0x2d')]);_0xe6f2b0[_0x6f6c('0x2e')]=_[_0x6f6c('0x2f')](_0xe6f2b0[_0x6f6c('0x30')],_0xe6f2b0['query']);_0xdfcd78[_0x6f6c('0x31')]=_['intersection'](_0xe6f2b0[_0x6f6c('0x30')],qs[_0x6f6c('0x32')](_0x4f5590[_0x6f6c('0x2d')]['fields']));_0xdfcd78[_0x6f6c('0x31')]=_0xdfcd78['attributes'][_0x6f6c('0x33')]?_0xdfcd78[_0x6f6c('0x31')]:_0xe6f2b0[_0x6f6c('0x30')];if(!_0x4f5590['query'][_0x6f6c('0x34')]('nolimit')){_0xdfcd78['limit']=qs['limit'](_0x4f5590[_0x6f6c('0x2d')]['limit']);_0xdfcd78[_0x6f6c('0x1c')]=qs[_0x6f6c('0x1c')](_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x1c')]);}_0xdfcd78[_0x6f6c('0x35')]=qs[_0x6f6c('0x36')](_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x36')]);_0xdfcd78['where']=qs[_0x6f6c('0x2e')](_[_0x6f6c('0x37')](_0x4f5590[_0x6f6c('0x2d')],_0xe6f2b0['filters']),_0x150545);if(_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x38')]){_0xdfcd78[_0x6f6c('0x39')]=_[_0x6f6c('0x3a')](_0xdfcd78['where'],{'$or':_[_0x6f6c('0x28')](_0x150545,function(_0x15a03a){if(_0x15a03a[_0x6f6c('0x2b')]!==_0x6f6c('0x3b')){var _0xf31723={};_0xf31723[_0x15a03a[_0x6f6c('0x25')]]={'$like':'%'+_0x4f5590['query'][_0x6f6c('0x38')]+'%'};return _0xf31723;}})});}_0xdfcd78=_[_0x6f6c('0x3a')]({},_0xdfcd78,_0x4f5590[_0x6f6c('0x3c')]);var _0x3327d4={'where':_0xdfcd78[_0x6f6c('0x39')]};return db[_0x6f6c('0x3d')][_0x6f6c('0x1f')](_0x3327d4)['then'](function(_0x502f7d){_0x5b4156['count']=_0x502f7d;if(_0x4f5590[_0x6f6c('0x2d')][_0x6f6c('0x3e')]){_0xdfcd78[_0x6f6c('0x3f')]=[{'all':!![]}];}return db['ChatMessage'][_0x6f6c('0x40')](_0xdfcd78);})[_0x6f6c('0x21')](function(_0x31eaea){_0x5b4156[_0x6f6c('0x41')]=_0x31eaea;return _0x5b4156;})[_0x6f6c('0x21')](respondWithFilteredResult(_0x1f55e3,_0xdfcd78))[_0x6f6c('0x19')](handleError(_0x1f55e3,null));};exports[_0x6f6c('0x42')]=function(_0x1ab6a3,_0x3e5b33){var _0xe8ee2c={'raw':!![],'where':{'id':_0x1ab6a3[_0x6f6c('0x43')]['id']}},_0x4f14d1={};_0x4f14d1['model']=_[_0x6f6c('0x44')](db[_0x6f6c('0x3d')][_0x6f6c('0x29')]);_0x4f14d1[_0x6f6c('0x2d')]=_[_0x6f6c('0x44')](_0x1ab6a3['query']);_0x4f14d1['filters']=_[_0x6f6c('0x2f')](_0x4f14d1[_0x6f6c('0x30')],_0x4f14d1[_0x6f6c('0x2d')]);_0xe8ee2c[_0x6f6c('0x31')]=_[_0x6f6c('0x2f')](_0x4f14d1[_0x6f6c('0x30')],qs['fields'](_0x1ab6a3[_0x6f6c('0x2d')]['fields']));_0xe8ee2c[_0x6f6c('0x31')]=_0xe8ee2c[_0x6f6c('0x31')]['length']?_0xe8ee2c['attributes']:_0x4f14d1['model'];if(_0x1ab6a3['query'][_0x6f6c('0x3e')]){_0xe8ee2c[_0x6f6c('0x3f')]=[{'all':!![]}];}_0xe8ee2c=_[_0x6f6c('0x3a')]({},_0xe8ee2c,_0x1ab6a3[_0x6f6c('0x3c')]);return db[_0x6f6c('0x3d')][_0x6f6c('0x45')](_0xe8ee2c)[_0x6f6c('0x21')](handleEntityNotFound(_0x3e5b33,null))[_0x6f6c('0x21')](respondWithResult(_0x3e5b33,null))[_0x6f6c('0x19')](handleError(_0x3e5b33,null));};exports[_0x6f6c('0x46')]=function(_0x163235,_0x37d181){return db[_0x6f6c('0x3d')]['create'](_0x163235['body'],{})['then'](respondWithResult(_0x37d181,0xc9))[_0x6f6c('0x19')](handleError(_0x37d181,null));};exports[_0x6f6c('0x47')]=function(_0x34f07e,_0x13ca9a){if(_0x34f07e[_0x6f6c('0x48')]['id']){delete _0x34f07e[_0x6f6c('0x48')]['id'];}return db[_0x6f6c('0x3d')][_0x6f6c('0x45')]({'where':{'id':_0x34f07e['params']['id']}})[_0x6f6c('0x21')](handleEntityNotFound(_0x13ca9a,null))[_0x6f6c('0x21')](saveUpdates(_0x34f07e[_0x6f6c('0x48')],null))['then'](respondWithResult(_0x13ca9a,null))[_0x6f6c('0x19')](handleError(_0x13ca9a,null));};exports[_0x6f6c('0x49')]=function(_0x141e54,_0x567356){return db[_0x6f6c('0x3d')][_0x6f6c('0x45')]({'where':{'id':_0x141e54[_0x6f6c('0x43')]['id']}})[_0x6f6c('0x21')](handleEntityNotFound(_0x567356,null))[_0x6f6c('0x21')](removeEntity(_0x567356,null))[_0x6f6c('0x19')](handleError(_0x567356,null));};exports[_0x6f6c('0x4a')]=function(_0x156061,_0x579672){return db[_0x6f6c('0x3d')]['describe']()[_0x6f6c('0x21')](respondWithResult(_0x579672,null))[_0x6f6c('0x19')](handleError(_0x579672,null));};exports[_0x6f6c('0x4b')]=function(_0x3f7c78,_0x241acc){var _0x5c18d3='chat';return interactionService[_0x6f6c('0x4c')](_0x3f7c78,_0x5c18d3)[_0x6f6c('0x21')](respondWithResult(_0x241acc,null))[_0x6f6c('0x19')](handleError(_0x241acc,null));};exports[_0x6f6c('0x4d')]=function(_0x49cb28,_0x310f6f){var _0x14efff={'agent':{},'channel':_0x6f6c('0x4e')};if(_0x49cb28[_0x6f6c('0x48')]['id']){delete _0x49cb28['body']['id'];}_0x49cb28['body']['UserId']=_0x49cb28[_0x6f6c('0x48')][_0x6f6c('0x4f')]||_0x49cb28['user']['id'];_0x14efff[_0x6f6c('0x50')]['id']=_0x49cb28['body'][_0x6f6c('0x4f')];return db[_0x6f6c('0x3d')][_0x6f6c('0x45')]({'where':{'id':_0x49cb28[_0x6f6c('0x43')]['id'],'UserId':null}})[_0x6f6c('0x21')](handleEntityNotFound(_0x310f6f,null))[_0x6f6c('0x21')](function(_0x1ef112){if(_0x1ef112){_0x14efff['message']=_0x1ef112[_0x6f6c('0x51')]({'plain':!![]});return db[_0x6f6c('0x52')][_0x6f6c('0x45')]({'where':{'id':_0x1ef112['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x310f6f,null))['then'](function(_0x44526f){if(_0x44526f){_0x14efff['interaction']=_0x44526f['get']({'plain':!![]});interaction_log[_0x6f6c('0x10')](_0x6f6c('0x53'),_0x49cb28[_0x6f6c('0x54')]['id'],_0x49cb28[_0x6f6c('0x54')][_0x6f6c('0x25')],_0x49cb28[_0x6f6c('0x54')][_0x6f6c('0x55')],_0x14efff['interaction']['id'],_0x49cb28[_0x6f6c('0x48')]?JSON['stringify'](_0x49cb28[_0x6f6c('0x48')]):_0x6f6c('0x56'));return respondWithRpcPromise(_0x6f6c('0x57'),_0x6f6c('0x58'),_0x14efff);}return null;})[_0x6f6c('0x21')](function(_0x23c02b){var _0x3e7aa0=_0x6f6c('0x59')+_0x23c02b['message'][_0x6f6c('0x5a')];return db[_0x6f6c('0x5b')][_0x6f6c('0x2d')](_0x3e7aa0,{'type':db['Sequelize'][_0x6f6c('0x5c')][_0x6f6c('0x5d')],'raw':!![]})['then'](function(_0x682fa){return _0x682fa;});})[_0x6f6c('0x21')](function(_0xcc6ced){if(_0xcc6ced){_0x14efff[_0x6f6c('0x17')]['contact']=_0xcc6ced[0x0];if(!_0x49cb28['body'][_0x6f6c('0x4f')])return;return db['User']['find']({'where':{'id':_0x49cb28[_0x6f6c('0x48')]['UserId'],'role':_0x6f6c('0x50')},'attributes':['id',_0x6f6c('0x25'),_0x6f6c('0x5e'),_0x6f6c('0x5f'),_0x6f6c('0x60')],'raw':!![]});}return null;})['then'](function(_0x29aa17){if(!_0x29aa17)return null;_0x14efff[_0x6f6c('0x17')][_0x6f6c('0x50')]=_0x29aa17;return _0x14efff;})[_0x6f6c('0x21')](function(_0x371760){if(_0x371760){_0x371760[_0x6f6c('0x17')]['interface']=util[_0x6f6c('0x61')](_0x6f6c('0x62'),_0x49cb28[_0x6f6c('0x54')]['name']);_0x371760[_0x6f6c('0x17')][_0x6f6c('0x63')]=_0x14efff[_0x6f6c('0x63')];_0x371760[_0x6f6c('0x17')]['motionChannel']=_0x14efff['channel'];_0x371760['message'][_0x6f6c('0x64')]=_0x6f6c('0x4d');respondWithRpcPromise(_0x6f6c('0x65'),_0x6f6c('0x65'),{'event':_0x6f6c('0x66'),'message':_[_0x6f6c('0x3a')](_0x14efff['message'],JSON['parse'](_0x14efff[_0x6f6c('0x67')][_0x6f6c('0x68')]))},client9002);return _0x14efff;}return null;})[_0x6f6c('0x21')](respondWithResult(_0x310f6f,null))[_0x6f6c('0x19')](handleError(_0x310f6f,null));};
\ No newline at end of file
+var _0x3e4f=['User','agent','email','interface','format','SIP/%s','channel','EventManager','rejectmessage','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','chat-interactions','request','then','debug','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','name','index','map','ChatMessage','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type','options','includeAll','include','findAll','catch','show','params','keys','length','merge','create','body','find','describe','accept','chat','acceptMessage','reject','UserId','user','ChatInteraction','ChatInteractionId','get','info','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x3e4f,0xd7));var _0xf3e4=function(_0x279275,_0x5eb9a7){_0x279275=_0x279275-0x0;var _0x651a96=_0x3e4f[_0x279275];return _0x651a96;};'use strict';var util=require(_0xf3e4('0x0'));var _=require(_0xf3e4('0x1'));var Redis=require(_0xf3e4('0x2'));var interactionService=require(_0xf3e4('0x3'));var qs=require(_0xf3e4('0x4'));var logger=require(_0xf3e4('0x5'))(_0xf3e4('0x6'));var config=require('../../config/environment');var db=require(_0xf3e4('0x7'))['db'];config[_0xf3e4('0x8')]=_[_0xf3e4('0x9')](config[_0xf3e4('0x8')],{'host':_0xf3e4('0xa'),'port':0x18eb});var socket=require(_0xf3e4('0xb'))(new Redis(config[_0xf3e4('0x8')]));require('./chatMessage.socket')[_0xf3e4('0xc')](socket);var jayson=require(_0xf3e4('0xd'));var client=jayson[_0xf3e4('0xe')][_0xf3e4('0xf')]({'port':0x232c});var client9002=jayson[_0xf3e4('0xe')][_0xf3e4('0xf')]({'port':0x232a});var interaction_log=require(_0xf3e4('0x5'))(_0xf3e4('0x10'));function respondWithRpcPromise(_0x16733d,_0x370623,_0x41978b,_0x2d1195){return new Promise(function(_0x2d991f,_0x5a6780){var _0x368d98=_0x2d1195||client;return _0x368d98[_0xf3e4('0x11')](_0x16733d,_0x41978b)[_0xf3e4('0x12')](function(_0xf6b7ac){logger['info']('ChatMessage,\x20%s,\x20%s',_0x370623,'request\x20sent');logger[_0xf3e4('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x370623,_0xf3e4('0x14'),JSON[_0xf3e4('0x15')](_0xf6b7ac));if(_0xf6b7ac[_0xf3e4('0x16')]){if(_0xf6b7ac['error']['code']===0x1f4){logger[_0xf3e4('0x16')](_0xf3e4('0x17'),_0x370623,_0xf6b7ac[_0xf3e4('0x16')]['message']);return _0x5a6780(_0xf6b7ac[_0xf3e4('0x16')]['message']);}logger[_0xf3e4('0x16')](_0xf3e4('0x17'),_0x370623,_0xf6b7ac['error'][_0xf3e4('0x18')]);return _0x2d991f(_0xf6b7ac['error'][_0xf3e4('0x18')]);}else{logger['info'](_0xf3e4('0x17'),_0x370623,_0xf3e4('0x14'));_0x2d991f(_0xf6b7ac[_0xf3e4('0x19')][_0xf3e4('0x18')]);}})['catch'](function(_0x3f14ca){logger['error'](_0xf3e4('0x17'),_0x370623,_0x3f14ca);_0x5a6780(_0x3f14ca);});});}function respondWithResult(_0x3032bc,_0x42264d){_0x42264d=_0x42264d||0xc8;return function(_0x23e034){if(_0x23e034){return _0x3032bc[_0xf3e4('0x1a')](_0x42264d)[_0xf3e4('0x1b')](_0x23e034);}};}function respondWithFilteredResult(_0x3f4a75,_0x98aeaf){return function(_0x4218eb){if(_0x4218eb){var _0x8486d1=typeof _0x98aeaf[_0xf3e4('0x1c')]===_0xf3e4('0x1d')&&typeof _0x98aeaf[_0xf3e4('0x1e')]===_0xf3e4('0x1d');var _0x3fcc9d=_0x4218eb[_0xf3e4('0x1f')];var _0x5f51c3=_0x8486d1?0x0:_0x98aeaf['offset'];var _0x377741=_0x8486d1?_0x4218eb[_0xf3e4('0x1f')]:_0x98aeaf[_0xf3e4('0x1c')]+_0x98aeaf[_0xf3e4('0x1e')];var _0x260ec3;if(_0x377741>=_0x3fcc9d){_0x377741=_0x3fcc9d;_0x260ec3=0xc8;}else{_0x260ec3=0xce;}_0x3f4a75[_0xf3e4('0x1a')](_0x260ec3);return _0x3f4a75[_0xf3e4('0x20')](_0xf3e4('0x21'),_0x5f51c3+'-'+_0x377741+'/'+_0x3fcc9d)[_0xf3e4('0x1b')](_0x4218eb);}return null;};}function saveUpdates(_0x4a2dee){return function(_0x459d62){if(_0x459d62){return _0x459d62[_0xf3e4('0x22')](_0x4a2dee)['then'](function(_0x7c302c){return _0x7c302c;});}return null;};}function removeEntity(_0x26cebe){return function(_0x4a4398){if(_0x4a4398){return _0x4a4398[_0xf3e4('0x23')]()['then'](function(){_0x26cebe[_0xf3e4('0x1a')](0xcc)[_0xf3e4('0x24')]();});}};}function handleEntityNotFound(_0x263383){return function(_0x14ae5f){if(!_0x14ae5f){_0x263383[_0xf3e4('0x25')](0x194);}return _0x14ae5f;};}function handleError(_0x467320,_0x3b7c76){_0x3b7c76=_0x3b7c76||0x1f4;return function(_0x59523e){logger[_0xf3e4('0x16')](_0x59523e['stack']);if(_0x59523e[_0xf3e4('0x26')]){delete _0x59523e['name'];}_0x467320[_0xf3e4('0x1a')](_0x3b7c76)['send'](_0x59523e);};}exports[_0xf3e4('0x27')]=function(_0x5769be,_0x2b5be3){var _0x5846be={},_0x234277={},_0x2e0ca2={'count':0x0,'rows':[]};var _0x1ca858=_[_0xf3e4('0x28')](db[_0xf3e4('0x29')][_0xf3e4('0x2a')],function(_0x8cce2f){return{'name':_0x8cce2f[_0xf3e4('0x2b')],'type':_0x8cce2f['type'][_0xf3e4('0x2c')]};});_0x234277[_0xf3e4('0x2d')]=_[_0xf3e4('0x28')](_0x1ca858,_0xf3e4('0x26'));_0x234277['query']=_['keys'](_0x5769be['query']);_0x234277[_0xf3e4('0x2e')]=_[_0xf3e4('0x2f')](_0x234277['model'],_0x234277[_0xf3e4('0x30')]);_0x5846be[_0xf3e4('0x31')]=_['intersection'](_0x234277[_0xf3e4('0x2d')],qs[_0xf3e4('0x32')](_0x5769be[_0xf3e4('0x30')][_0xf3e4('0x32')]));_0x5846be[_0xf3e4('0x31')]=_0x5846be[_0xf3e4('0x31')]['length']?_0x5846be[_0xf3e4('0x31')]:_0x234277[_0xf3e4('0x2d')];if(!_0x5769be['query'][_0xf3e4('0x33')](_0xf3e4('0x34'))){_0x5846be[_0xf3e4('0x1e')]=qs[_0xf3e4('0x1e')](_0x5769be[_0xf3e4('0x30')][_0xf3e4('0x1e')]);_0x5846be['offset']=qs['offset'](_0x5769be[_0xf3e4('0x30')]['offset']);}_0x5846be['order']=qs[_0xf3e4('0x35')](_0x5769be[_0xf3e4('0x30')][_0xf3e4('0x35')]);_0x5846be['where']=qs['filters'](_[_0xf3e4('0x36')](_0x5769be[_0xf3e4('0x30')],_0x234277['filters']),_0x1ca858);if(_0x5769be[_0xf3e4('0x30')][_0xf3e4('0x37')]){_0x5846be[_0xf3e4('0x38')]=_['merge'](_0x5846be['where'],{'$or':_[_0xf3e4('0x28')](_0x1ca858,function(_0x28afd3){if(_0x28afd3[_0xf3e4('0x39')]!=='VIRTUAL'){var _0x1facbf={};_0x1facbf[_0x28afd3[_0xf3e4('0x26')]]={'$like':'%'+_0x5769be['query'][_0xf3e4('0x37')]+'%'};return _0x1facbf;}})});}_0x5846be=_['merge']({},_0x5846be,_0x5769be[_0xf3e4('0x3a')]);var _0x51380c={'where':_0x5846be[_0xf3e4('0x38')]};return db['ChatMessage'][_0xf3e4('0x1f')](_0x51380c)['then'](function(_0x2a7207){_0x2e0ca2[_0xf3e4('0x1f')]=_0x2a7207;if(_0x5769be[_0xf3e4('0x30')][_0xf3e4('0x3b')]){_0x5846be[_0xf3e4('0x3c')]=[{'all':!![]}];}return db['ChatMessage'][_0xf3e4('0x3d')](_0x5846be);})[_0xf3e4('0x12')](function(_0x22c220){_0x2e0ca2['rows']=_0x22c220;return _0x2e0ca2;})[_0xf3e4('0x12')](respondWithFilteredResult(_0x2b5be3,_0x5846be))[_0xf3e4('0x3e')](handleError(_0x2b5be3,null));};exports[_0xf3e4('0x3f')]=function(_0x2415d0,_0x27e137){var _0x3d35b4={'raw':!![],'where':{'id':_0x2415d0[_0xf3e4('0x40')]['id']}},_0x2cd4fc={};_0x2cd4fc[_0xf3e4('0x2d')]=_[_0xf3e4('0x41')](db[_0xf3e4('0x29')]['rawAttributes']);_0x2cd4fc['query']=_['keys'](_0x2415d0['query']);_0x2cd4fc['filters']=_[_0xf3e4('0x2f')](_0x2cd4fc[_0xf3e4('0x2d')],_0x2cd4fc['query']);_0x3d35b4['attributes']=_[_0xf3e4('0x2f')](_0x2cd4fc[_0xf3e4('0x2d')],qs['fields'](_0x2415d0[_0xf3e4('0x30')]['fields']));_0x3d35b4[_0xf3e4('0x31')]=_0x3d35b4[_0xf3e4('0x31')][_0xf3e4('0x42')]?_0x3d35b4[_0xf3e4('0x31')]:_0x2cd4fc[_0xf3e4('0x2d')];if(_0x2415d0[_0xf3e4('0x30')][_0xf3e4('0x3b')]){_0x3d35b4[_0xf3e4('0x3c')]=[{'all':!![]}];}_0x3d35b4=_[_0xf3e4('0x43')]({},_0x3d35b4,_0x2415d0[_0xf3e4('0x3a')]);return db['ChatMessage']['find'](_0x3d35b4)[_0xf3e4('0x12')](handleEntityNotFound(_0x27e137,null))[_0xf3e4('0x12')](respondWithResult(_0x27e137,null))[_0xf3e4('0x3e')](handleError(_0x27e137,null));};exports[_0xf3e4('0x44')]=function(_0x5466f3,_0x3cc5f8){return db['ChatMessage'][_0xf3e4('0x44')](_0x5466f3[_0xf3e4('0x45')],{})[_0xf3e4('0x12')](respondWithResult(_0x3cc5f8,0xc9))['catch'](handleError(_0x3cc5f8,null));};exports[_0xf3e4('0x22')]=function(_0x3646b5,_0x19b53f){if(_0x3646b5[_0xf3e4('0x45')]['id']){delete _0x3646b5[_0xf3e4('0x45')]['id'];}return db[_0xf3e4('0x29')][_0xf3e4('0x46')]({'where':{'id':_0x3646b5[_0xf3e4('0x40')]['id']}})[_0xf3e4('0x12')](handleEntityNotFound(_0x19b53f,null))[_0xf3e4('0x12')](saveUpdates(_0x3646b5[_0xf3e4('0x45')],null))[_0xf3e4('0x12')](respondWithResult(_0x19b53f,null))[_0xf3e4('0x3e')](handleError(_0x19b53f,null));};exports[_0xf3e4('0x23')]=function(_0x28c2b5,_0x4cea9a){return db[_0xf3e4('0x29')][_0xf3e4('0x46')]({'where':{'id':_0x28c2b5[_0xf3e4('0x40')]['id']}})[_0xf3e4('0x12')](handleEntityNotFound(_0x4cea9a,null))[_0xf3e4('0x12')](removeEntity(_0x4cea9a,null))[_0xf3e4('0x3e')](handleError(_0x4cea9a,null));};exports[_0xf3e4('0x47')]=function(_0x13fc75,_0x3063bf){return db[_0xf3e4('0x29')][_0xf3e4('0x47')]()[_0xf3e4('0x12')](respondWithResult(_0x3063bf,null))[_0xf3e4('0x3e')](handleError(_0x3063bf,null));};exports[_0xf3e4('0x48')]=function(_0x53abbf,_0x488829){var _0x34d4dd=_0xf3e4('0x49');return interactionService[_0xf3e4('0x4a')](_0x53abbf,_0x34d4dd)[_0xf3e4('0x12')](respondWithResult(_0x488829,null))[_0xf3e4('0x3e')](handleError(_0x488829,null));};exports[_0xf3e4('0x4b')]=function(_0x413070,_0x5ed390){var _0x45cce0={'agent':{},'channel':_0xf3e4('0x49')};if(_0x413070[_0xf3e4('0x45')]['id']){delete _0x413070['body']['id'];}_0x413070['body'][_0xf3e4('0x4c')]=_0x413070['body'][_0xf3e4('0x4c')]||_0x413070[_0xf3e4('0x4d')]['id'];_0x45cce0['agent']['id']=_0x413070['body'][_0xf3e4('0x4c')];return db[_0xf3e4('0x29')]['find']({'where':{'id':_0x413070[_0xf3e4('0x40')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ed390,null))[_0xf3e4('0x12')](function(_0x5d7527){if(_0x5d7527){_0x45cce0['message']=_0x5d7527['get']({'plain':!![]});return db[_0xf3e4('0x4e')][_0xf3e4('0x46')]({'where':{'id':_0x5d7527[_0xf3e4('0x4f')]}});}return null;})[_0xf3e4('0x12')](handleEntityNotFound(_0x5ed390,null))[_0xf3e4('0x12')](function(_0x5400b1){if(_0x5400b1){_0x45cce0['interaction']=_0x5400b1[_0xf3e4('0x50')]({'plain':!![]});interaction_log[_0xf3e4('0x51')](_0xf3e4('0x52'),_0x413070[_0xf3e4('0x4d')]['id'],_0x413070['user']['name'],_0x413070[_0xf3e4('0x4d')][_0xf3e4('0x53')],_0x45cce0[_0xf3e4('0x54')]['id'],_0x413070['body']?JSON[_0xf3e4('0x15')](_0x413070[_0xf3e4('0x45')]):_0xf3e4('0x55'));return respondWithRpcPromise(_0xf3e4('0x56'),_0xf3e4('0x57'),_0x45cce0);}return null;})[_0xf3e4('0x12')](function(_0x3be4c1){var _0x2ecbef=_0xf3e4('0x58')+_0x3be4c1['message'][_0xf3e4('0x59')];return db[_0xf3e4('0x5a')][_0xf3e4('0x30')](_0x2ecbef,{'type':db['Sequelize'][_0xf3e4('0x5b')][_0xf3e4('0x5c')],'raw':!![]})[_0xf3e4('0x12')](function(_0x1dbe47){return _0x1dbe47;});})[_0xf3e4('0x12')](function(_0x5b1cdb){if(_0x5b1cdb){_0x45cce0[_0xf3e4('0x18')][_0xf3e4('0x5d')]=_0x5b1cdb[0x0];if(!_0x413070[_0xf3e4('0x45')][_0xf3e4('0x4c')])return;return db[_0xf3e4('0x5e')][_0xf3e4('0x46')]({'where':{'id':_0x413070[_0xf3e4('0x45')][_0xf3e4('0x4c')],'role':_0xf3e4('0x5f')},'attributes':['id',_0xf3e4('0x26'),'fullname',_0xf3e4('0x60'),'internal'],'raw':!![]});}return null;})[_0xf3e4('0x12')](function(_0x21c5b1){if(!_0x21c5b1)return null;_0x45cce0[_0xf3e4('0x18')][_0xf3e4('0x5f')]=_0x21c5b1;return _0x45cce0;})[_0xf3e4('0x12')](function(_0xc42701){if(_0xc42701){_0xc42701[_0xf3e4('0x18')][_0xf3e4('0x61')]=util[_0xf3e4('0x62')](_0xf3e4('0x63'),_0x413070[_0xf3e4('0x4d')][_0xf3e4('0x26')]);_0xc42701['message'][_0xf3e4('0x64')]=_0x45cce0[_0xf3e4('0x64')];_0xc42701[_0xf3e4('0x18')]['motionChannel']=_0x45cce0[_0xf3e4('0x64')];_0xc42701[_0xf3e4('0x18')]['event']=_0xf3e4('0x4b');respondWithRpcPromise(_0xf3e4('0x65'),'EventManager',{'event':_0xf3e4('0x66'),'message':_[_0xf3e4('0x43')](_0x45cce0[_0xf3e4('0x18')],JSON['parse'](_0x45cce0[_0xf3e4('0x54')]['formData']))},client9002);return _0x45cce0;}return null;})['then'](respondWithResult(_0x5ed390,null))[_0xf3e4('0x3e')](handleError(_0x5ed390,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index c26a15d..e8d89c5 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 _0x2a0a=['save','remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x5e7361,_0x31140d){var _0x248a05=function(_0x292e2c){while(--_0x292e2c){_0x5e7361['push'](_0x5e7361['shift']());}};_0x248a05(++_0x31140d);}(_0x2a0a,0x1e4));var _0xa2a0=function(_0x4a1b40,_0x3b0b46){_0x4a1b40=_0x4a1b40-0x0;var _0x268522=_0x2a0a[_0x4a1b40];return _0x268522;};'use strict';var EventEmitter=require(_0xa2a0('0x0'));var ChatMessage=require(_0xa2a0('0x1'))['db'][_0xa2a0('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa2a0('0x3')](0x0);var events={'afterCreate':_0xa2a0('0x4'),'afterUpdate':'update','afterDestroy':_0xa2a0('0x5')};function emitEvent(_0x22012d){return function(_0x371d2f,_0x2b000a,_0x94948){ChatMessageEvents[_0xa2a0('0x6')](_0x22012d+':'+_0x371d2f['id'],_0x371d2f);ChatMessageEvents[_0xa2a0('0x6')](_0x22012d,_0x371d2f);_0x94948(null);};}for(var e in events){if(events[_0xa2a0('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x1f25=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x30deef,_0x1590bc){var _0x398e43=function(_0x329367){while(--_0x329367){_0x30deef['push'](_0x30deef['shift']());}};_0x398e43(++_0x1590bc);}(_0x1f25,0x19d));var _0x51f2=function(_0x1248b6,_0x38035d){_0x1248b6=_0x1248b6-0x0;var _0x652c77=_0x1f25[_0x1248b6];return _0x652c77;};'use strict';var EventEmitter=require(_0x51f2('0x0'));var ChatMessage=require(_0x51f2('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x51f2('0x2'),'afterUpdate':_0x51f2('0x3'),'afterDestroy':_0x51f2('0x4')};function emitEvent(_0x38fc14){return function(_0x13ae99,_0x52a404,_0x49784f){ChatMessageEvents[_0x51f2('0x5')](_0x38fc14+':'+_0x13ae99['id'],_0x13ae99);ChatMessageEvents[_0x51f2('0x5')](_0x38fc14,_0x13ae99);_0x49784f(null);};}for(var e in events){if(events[_0x51f2('0x6')](e)){var event=events[e];ChatMessage[_0x51f2('0x7')](e,emitEvent(event));}}module[_0x51f2('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index f1674a7..b34af50 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 _0x418a=['./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','isNil','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x4ab756,_0x4b4496){var _0x309a02=function(_0x22646f){while(--_0x22646f){_0x4ab756['push'](_0x4ab756['shift']());}};_0x309a02(++_0x4b4496);}(_0x418a,0xb7));var _0xa418=function(_0x41fe6c,_0xe9f85f){_0x41fe6c=_0x41fe6c-0x0;var _0x51f106=_0x418a[_0x41fe6c];return _0x51f106;};'use strict';var _=require(_0xa418('0x0'));var util=require(_0xa418('0x1'));var logger=require(_0xa418('0x2'))('api');var moment=require(_0xa418('0x3'));var BPromise=require('bluebird');var rp=require(_0xa418('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa418('0x5'));var config=require('../../config/environment');var attributes=require(_0xa418('0x6'));module[_0xa418('0x7')]=function(_0x5b1306,_0x10a8c8){return _0x5b1306[_0xa418('0x8')](_0xa418('0x9'),attributes,{'tableName':_0xa418('0xa'),'paranoid':![],'indexes':[{'name':_0xa418('0xb'),'fields':[_0xa418('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fed75,_0x5d15cb,_0x4d799f){var _0x29cf55=_0x5b1306[_0xa418('0xd')];var _0x43a0bc=_0x1fed75[_0xa418('0xe')]({'plain':!![]});if(_0x43a0bc[_0xa418('0xf')][_0xa418('0x10')]()==='in'||_0x43a0bc['direction']['toLowerCase']()===_0xa418('0x11')&&!_0x43a0bc['secret']&&!_[_0xa418('0x12')](_0x43a0bc['UserId'])){_0x29cf55[_0xa418('0x13')][_0xa418('0x14')]({'where':{'id':_0x43a0bc['ChatInteractionId']}})[_0xa418('0x15')](function(_0x543d2c){if(_0x543d2c){_0x543d2c[_0xa418('0x16')]({'lastMsgAt':_0x43a0bc[_0xa418('0x17')],'lastMsgDirection':_0x43a0bc[_0xa418('0xf')][_0xa418('0x10')]()});}})[_0xa418('0x18')](function(_0x5c6da7){console['error'](_0x5c6da7);});}_0x4d799f();}},'charset':_0xa418('0x19'),'collate':_0xa418('0x1a')});};
\ No newline at end of file
+var _0xc081=['path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4fb6b6,_0x5eb1c7){var _0x3ea470=function(_0x26228c){while(--_0x26228c){_0x4fb6b6['push'](_0x4fb6b6['shift']());}};_0x3ea470(++_0x5eb1c7);}(_0xc081,0x14f));var _0x1c08=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0xc081[_0x431ff8];return _0x84ccd4;};'use strict';var _=require('lodash');var util=require(_0x1c08('0x0'));var logger=require(_0x1c08('0x1'))(_0x1c08('0x2'));var moment=require(_0x1c08('0x3'));var BPromise=require(_0x1c08('0x4'));var rp=require(_0x1c08('0x5'));var fs=require('fs');var path=require(_0x1c08('0x6'));var rimraf=require(_0x1c08('0x7'));var config=require('../../config/environment');var attributes=require(_0x1c08('0x8'));module[_0x1c08('0x9')]=function(_0x42283c,_0x4e6eec){return _0x42283c[_0x1c08('0xa')](_0x1c08('0xb'),attributes,{'tableName':_0x1c08('0xc'),'paranoid':![],'indexes':[{'name':_0x1c08('0xd'),'fields':[_0x1c08('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x645f58,_0x143e3f,_0x2183bc){var _0x2a050c=_0x42283c[_0x1c08('0xf')];var _0x274a4d=_0x645f58[_0x1c08('0x10')]({'plain':!![]});if(_0x274a4d[_0x1c08('0x11')][_0x1c08('0x12')]()==='in'||_0x274a4d[_0x1c08('0x11')][_0x1c08('0x12')]()==='out'&&!_0x274a4d[_0x1c08('0x13')]&&!_[_0x1c08('0x14')](_0x274a4d[_0x1c08('0x15')])){_0x2a050c[_0x1c08('0x16')][_0x1c08('0x17')]({'where':{'id':_0x274a4d[_0x1c08('0x18')]}})[_0x1c08('0x19')](function(_0x2e6a89){if(_0x2e6a89){_0x2e6a89[_0x1c08('0x1a')]({'lastMsgAt':_0x274a4d[_0x1c08('0x1b')],'lastMsgDirection':_0x274a4d[_0x1c08('0x11')][_0x1c08('0x12')]()});}})[_0x1c08('0x1c')](function(_0x4227db){console['error'](_0x4227db);});}_0x2183bc();}},'charset':_0x1c08('0x1d'),'collate':_0x1c08('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4ac97eb..671b673 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 _0x5aae=['stringify','error','message','request\x20sent','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','redis','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0xf78a1e,_0x19af07){var _0xc72a=function(_0xf84ce5){while(--_0xf84ce5){_0xf78a1e['push'](_0xf78a1e['shift']());}};_0xc72a(++_0x19af07);}(_0x5aae,0xe5));var _0xe5aa=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x5aae[_0x41e8c4];return _0x54ffbe;};'use strict';var _=require(_0xe5aa('0x0'));var util=require(_0xe5aa('0x1'));var moment=require(_0xe5aa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5aa('0x3'))['db'];var utils=require(_0xe5aa('0x4'));var logger=require(_0xe5aa('0x5'))('rpc');var config=require(_0xe5aa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe5aa('0x7')][_0xe5aa('0x8')]({'port':0x232a});config['redis']=_[_0xe5aa('0x9')](config['redis'],{'host':_0xe5aa('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5aa('0xb')]));require(_0xe5aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xfb2450,_0x42f6ff,_0x3197e2){return new BPromise(function(_0x232e1b,_0x5c3512){return client[_0xe5aa('0xd')](_0xfb2450,_0x3197e2)[_0xe5aa('0xe')](function(_0x498150){logger[_0xe5aa('0xf')](_0xe5aa('0x10'),_0x42f6ff,'request\x20sent');logger[_0xe5aa('0x11')](_0xe5aa('0x12'),_0x42f6ff,'request\x20sent',JSON[_0xe5aa('0x13')](_0x498150));if(_0x498150[_0xe5aa('0x14')]){if(_0x498150[_0xe5aa('0x14')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x42f6ff,_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);return _0x5c3512(_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);}logger[_0xe5aa('0x14')](_0xe5aa('0x10'),_0x42f6ff,_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);return _0x232e1b(_0x498150[_0xe5aa('0x14')][_0xe5aa('0x15')]);}else{logger[_0xe5aa('0xf')](_0xe5aa('0x10'),_0x42f6ff,_0xe5aa('0x16'));_0x232e1b(_0x498150[_0xe5aa('0x17')][_0xe5aa('0x15')]);}})[_0xe5aa('0x18')](function(_0x3e6021){logger[_0xe5aa('0x14')]('ChatMessage,\x20%s,\x20%s',_0x42f6ff,_0x3e6021);_0x5c3512(_0x3e6021);});});}exports['CreateChatMessage']=function(_0x18cca0){var _0x37b354=this;return new Promise(function(_0xdc3427,_0x3a3f11){return db[_0xe5aa('0x19')][_0xe5aa('0x1a')](_0x18cca0[_0xe5aa('0x1b')],{'raw':_0x18cca0[_0xe5aa('0x1c')]?_0x18cca0[_0xe5aa('0x1c')][_0xe5aa('0x1d')]===undefined?!![]:![]:!![]})[_0xe5aa('0xe')](function(_0x545376){logger[_0xe5aa('0xf')](_0xe5aa('0x1e'),_0x18cca0);logger[_0xe5aa('0x11')](_0xe5aa('0x1e'),_0x18cca0,JSON['stringify'](_0x545376));_0xdc3427(_0x545376);})[_0xe5aa('0x18')](function(_0x479537){logger[_0xe5aa('0x14')](_0xe5aa('0x1e'),_0x479537[_0xe5aa('0x15')],_0x18cca0);_0x3a3f11(_0x37b354[_0xe5aa('0x14')](0x1f4,_0x479537[_0xe5aa('0x15')]));});});};
\ No newline at end of file
+var _0xfc33=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfc33,0xf0));var _0x3fc3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfc33[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x3fc3('0x0'));var util=require(_0x3fc3('0x1'));var moment=require(_0x3fc3('0x2'));var BPromise=require(_0x3fc3('0x3'));var rs=require(_0x3fc3('0x4'));var fs=require('fs');var Redis=require(_0x3fc3('0x5'));var db=require(_0x3fc3('0x6'))['db'];var utils=require(_0x3fc3('0x7'));var logger=require('../../config/logger')(_0x3fc3('0x8'));var config=require(_0x3fc3('0x9'));var jayson=require(_0x3fc3('0xa'));var client=jayson[_0x3fc3('0xb')][_0x3fc3('0xc')]({'port':0x232a});config[_0x3fc3('0xd')]=_[_0x3fc3('0xe')](config[_0x3fc3('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3fc3('0xd')]));require(_0x3fc3('0xf'))['register'](socket);function respondWithRpcPromise(_0x471b0c,_0x200521,_0x1f0f72){return new BPromise(function(_0x3c188e,_0x2a8e1b){return client[_0x3fc3('0x10')](_0x471b0c,_0x1f0f72)[_0x3fc3('0x11')](function(_0x2822ed){logger[_0x3fc3('0x12')](_0x3fc3('0x13'),_0x200521,'request\x20sent');logger[_0x3fc3('0x14')](_0x3fc3('0x15'),_0x200521,_0x3fc3('0x16'),JSON['stringify'](_0x2822ed));if(_0x2822ed[_0x3fc3('0x17')]){if(_0x2822ed[_0x3fc3('0x17')][_0x3fc3('0x18')]===0x1f4){logger[_0x3fc3('0x17')]('ChatMessage,\x20%s,\x20%s',_0x200521,_0x2822ed['error']['message']);return _0x2a8e1b(_0x2822ed['error'][_0x3fc3('0x19')]);}logger[_0x3fc3('0x17')]('ChatMessage,\x20%s,\x20%s',_0x200521,_0x2822ed[_0x3fc3('0x17')][_0x3fc3('0x19')]);return _0x3c188e(_0x2822ed[_0x3fc3('0x17')][_0x3fc3('0x19')]);}else{logger[_0x3fc3('0x12')](_0x3fc3('0x13'),_0x200521,_0x3fc3('0x16'));_0x3c188e(_0x2822ed[_0x3fc3('0x1a')][_0x3fc3('0x19')]);}})[_0x3fc3('0x1b')](function(_0x53c435){logger[_0x3fc3('0x17')]('ChatMessage,\x20%s,\x20%s',_0x200521,_0x53c435);_0x2a8e1b(_0x53c435);});});}exports[_0x3fc3('0x1c')]=function(_0x5ea38e){var _0x4efe16=this;return new Promise(function(_0x49a58e,_0x20f84a){return db[_0x3fc3('0x1d')][_0x3fc3('0x1e')](_0x5ea38e[_0x3fc3('0x1f')],{'raw':_0x5ea38e[_0x3fc3('0x20')]?_0x5ea38e[_0x3fc3('0x20')][_0x3fc3('0x21')]===undefined?!![]:![]:!![]})[_0x3fc3('0x11')](function(_0x57534b){logger['info'](_0x3fc3('0x1c'),_0x5ea38e);logger[_0x3fc3('0x14')](_0x3fc3('0x1c'),_0x5ea38e,JSON['stringify'](_0x57534b));_0x49a58e(_0x57534b);})['catch'](function(_0x5ca044){logger[_0x3fc3('0x17')]('CreateChatMessage',_0x5ca044[_0x3fc3('0x19')],_0x5ea38e);_0x20f84a(_0x4efe16[_0x3fc3('0x17')](0x1f4,_0x5ca044[_0x3fc3('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ccad792..5585972 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 _0xcd59=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x31e16a,_0x210c6c){var _0x58e686=function(_0x2bb73c){while(--_0x2bb73c){_0x31e16a['push'](_0x31e16a['shift']());}};_0x58e686(++_0x210c6c);}(_0xcd59,0x14b));var _0x9cd5=function(_0x2df7c7,_0x5ec3eb){_0x2df7c7=_0x2df7c7-0x0;var _0x42995b=_0xcd59[_0x2df7c7];return _0x42995b;};'use strict';var ChatMessageEvents=require(_0x9cd5('0x0'));var events=[_0x9cd5('0x1'),_0x9cd5('0x2'),_0x9cd5('0x3')];function createListener(_0x271070,_0x302b21){return function(_0x4b93b9){_0x302b21[_0x9cd5('0x4')](_0x271070,_0x4b93b9);};}function removeListener(_0x191236,_0xf96efa){return function(){ChatMessageEvents[_0x9cd5('0x5')](_0x191236,_0xf96efa);};}exports[_0x9cd5('0x6')]=function(_0x2db192){for(var _0x46277c=0x0,_0x2cd19a=events[_0x9cd5('0x7')];_0x46277c<_0x2cd19a;_0x46277c++){var _0x3f888f=events[_0x46277c];var _0x545407=createListener(_0x9cd5('0x8')+_0x3f888f,_0x2db192);ChatMessageEvents['on'](_0x3f888f,_0x545407);}};
\ No newline at end of file
+var _0x2fed=['emit','removeListener','register','length','./chatMessage.events','save','remove','update'];(function(_0x575df6,_0x19aa77){var _0xa101a5=function(_0x279d85){while(--_0x279d85){_0x575df6['push'](_0x575df6['shift']());}};_0xa101a5(++_0x19aa77);}(_0x2fed,0x7c));var _0xd2fe=function(_0x138400,_0x16d644){_0x138400=_0x138400-0x0;var _0x1da107=_0x2fed[_0x138400];return _0x1da107;};'use strict';var ChatMessageEvents=require(_0xd2fe('0x0'));var events=[_0xd2fe('0x1'),_0xd2fe('0x2'),_0xd2fe('0x3')];function createListener(_0x15f95a,_0x4b70e7){return function(_0x3c9206){_0x4b70e7[_0xd2fe('0x4')](_0x15f95a,_0x3c9206);};}function removeListener(_0x48707a,_0x58f3f8){return function(){ChatMessageEvents[_0xd2fe('0x5')](_0x48707a,_0x58f3f8);};}exports[_0xd2fe('0x6')]=function(_0xd85f89){for(var _0x5be4d3=0x0,_0x2f7bf5=events[_0xd2fe('0x7')];_0x5be4d3<_0x2f7bf5;_0x5be4d3++){var _0x3b6591=events[_0x5be4d3];var _0x42a8fb=createListener('chatMessage:'+_0x3b6591,_0xd85f89);ChatMessageEvents['on'](_0x3b6591,_0x42a8fb);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index e59331e..8f0e65e 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 _0x6328=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','chat','create','put','update','/:id/accept','reject'];(function(_0xce8373,_0x2ad630){var _0xa5cd5f=function(_0x5e0be0){while(--_0x5e0be0){_0xce8373['push'](_0xce8373['shift']());}};_0xa5cd5f(++_0x2ad630);}(_0x6328,0x1d7));var _0x8632=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0x6328[_0xbf5e16];return _0x5975a5;};'use strict';var multer=require(_0x8632('0x0'));var util=require(_0x8632('0x1'));var path=require('path');var timeout=require(_0x8632('0x2'));var express=require(_0x8632('0x3'));var router=express[_0x8632('0x4')]();var fs_extra=require(_0x8632('0x5'));var auth=require(_0x8632('0x6'));var interaction=require(_0x8632('0x7'));var config=require(_0x8632('0x8'));var controller=require(_0x8632('0x9'));router[_0x8632('0xa')]('/',auth[_0x8632('0xb')](),controller['index']);router[_0x8632('0xa')](_0x8632('0xc'),auth['isAuthenticated'](),controller[_0x8632('0xd')]);router['get'](_0x8632('0xe'),auth['isAuthenticated'](),controller[_0x8632('0xf')]);router[_0x8632('0x10')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x8632('0x11'),'chatmessage:create'),controller[_0x8632('0x12')]);router[_0x8632('0x13')](_0x8632('0xe'),controller[_0x8632('0x14')]);router['put'](_0x8632('0x15'),auth[_0x8632('0xb')](),controller['accept']);router[_0x8632('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0x8632('0x16')]);router[_0x8632('0x17')](_0x8632('0xe'),auth[_0x8632('0xb')](),controller[_0x8632('0x18')]);module[_0x8632('0x19')]=router;
\ No newline at end of file
+var _0xf6a7=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','put','update','delete','destroy','exports'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0xf6a7,0xa1));var _0x7f6a=function(_0x2ab0b1,_0x4344be){_0x2ab0b1=_0x2ab0b1-0x0;var _0x30f3fc=_0xf6a7[_0x2ab0b1];return _0x30f3fc;};'use strict';var multer=require(_0x7f6a('0x0'));var util=require('util');var path=require(_0x7f6a('0x1'));var timeout=require(_0x7f6a('0x2'));var express=require(_0x7f6a('0x3'));var router=express[_0x7f6a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f6a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f6a('0x6'));var controller=require(_0x7f6a('0x7'));router[_0x7f6a('0x8')]('/',auth[_0x7f6a('0x9')](),controller['index']);router[_0x7f6a('0x8')](_0x7f6a('0xa'),auth[_0x7f6a('0x9')](),controller[_0x7f6a('0xb')]);router[_0x7f6a('0x8')](_0x7f6a('0xc'),auth[_0x7f6a('0x9')](),controller[_0x7f6a('0xd')]);router[_0x7f6a('0xe')]('/',auth[_0x7f6a('0x9')](),interaction[_0x7f6a('0xf')](_0x7f6a('0x10'),_0x7f6a('0x11')),controller['create']);router[_0x7f6a('0x12')]('/:id',controller[_0x7f6a('0x13')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x7f6a('0x14')](_0x7f6a('0xc'),auth[_0x7f6a('0x9')](),controller[_0x7f6a('0x15')]);module[_0x7f6a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index bbabce2..366dcfc 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['medium','exports','TEXT'];(function(_0x370b75,_0x1e8cf4){var _0x4605ed=function(_0x1de0c3){while(--_0x1de0c3){_0x370b75['push'](_0x370b75['shift']());}};_0x4605ed(++_0x1e8cf4);}(_0x2032,0xd9));var _0x2203=function(_0x3391e5,_0x76cc0d){_0x3391e5=_0x3391e5-0x0;var _0x24387b=_0x2032[_0x3391e5];return _0x24387b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x31eea3,_0x2d40f2){var _0x3e7fef=function(_0x443476){while(--_0x443476){_0x31eea3['push'](_0x31eea3['shift']());}};_0x3e7fef(++_0x2d40f2);}(_0xb10b,0x12a));var _0xbb10=function(_0x231a42,_0x39f4db){_0x231a42=_0x231a42-0x0;var _0x3c2a56=_0xb10b[_0x231a42];return _0x3c2a56;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index acf874e..c96e7f2 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(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x7a54,0x106));var _0x47a5=function(_0x48e390,_0x303e2c){_0x48e390=_0x48e390-0x0;var _0x326730=_0x7a54[_0x48e390];return _0x326730;};'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(_0x217890,_0x40f4ed){var _0x21398a=function(_0x4e9a30){while(--_0x4e9a30){_0x217890['push'](_0x217890['shift']());}};_0x21398a(++_0x40f4ed);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 186ddb1..ad23f53 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 _0x4984=['events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4a1f0a,_0x564fcb){var _0x274c22=function(_0x463e1a){while(--_0x463e1a){_0x4a1f0a['push'](_0x4a1f0a['shift']());}};_0x274c22(++_0x564fcb);}(_0x4984,0x154));var _0x4498=function(_0x2f4aa2,_0xb72e14){_0x2f4aa2=_0x2f4aa2-0x0;var _0x4fdb16=_0x4984[_0x2f4aa2];return _0x4fdb16;};'use strict';var EventEmitter=require(_0x4498('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x4498('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4498('0x2')](0x0);var events={'afterCreate':_0x4498('0x3'),'afterUpdate':_0x4498('0x4'),'afterDestroy':_0x4498('0x5')};function emitEvent(_0x549cd5){return function(_0x35a60e,_0x3133a2,_0x7f3761){ChatOfflineMessageEvents[_0x4498('0x6')](_0x549cd5+':'+_0x35a60e['id'],_0x35a60e);ChatOfflineMessageEvents[_0x4498('0x6')](_0x549cd5,_0x35a60e);_0x7f3761(null);};}for(var e in events){if(events[_0x4498('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x4498('0x8')](e,emitEvent(event));}}module[_0x4498('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x4071=['ChatOfflineMessage','setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5d3eeb,_0x1f6625){var _0x3e14d3=function(_0x87bcce){while(--_0x87bcce){_0x5d3eeb['push'](_0x5d3eeb['shift']());}};_0x3e14d3(++_0x1f6625);}(_0x4071,0x1e6));var _0x1407=function(_0x56904a,_0x1f845a){_0x56904a=_0x56904a-0x0;var _0x2825eb=_0x4071[_0x56904a];return _0x2825eb;};'use strict';var EventEmitter=require(_0x1407('0x0'));var ChatOfflineMessage=require(_0x1407('0x1'))['db'][_0x1407('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1407('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1407('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b752f){return function(_0x2ab190,_0x16809b,_0x565160){ChatOfflineMessageEvents[_0x1407('0x5')](_0x3b752f+':'+_0x2ab190['id'],_0x2ab190);ChatOfflineMessageEvents[_0x1407('0x5')](_0x3b752f,_0x2ab190);_0x565160(null);};}for(var e in events){if(events[_0x1407('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1407('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 5d44339..eea89fe 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 _0x798a=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage'];(function(_0x5e25d0,_0x15ece2){var _0x13fb23=function(_0xf27573){while(--_0xf27573){_0x5e25d0['push'](_0x5e25d0['shift']());}};_0x13fb23(++_0x15ece2);}(_0x798a,0x1a1));var _0xa798=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x798a[_0x7e2eb0];return _0xd92de4;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xa798('0x0')]=function(_0x20ee10){return _0x20ee10[_0xa798('0x1')](_0xa798('0x2'),attributes,{'tableName':_0xa798('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa798('0x4'),'collate':_0xa798('0x5')});};
\ No newline at end of file
+var _0xfdd0=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x26b94d,_0x168f2f){var _0x29519f=function(_0x4717c5){while(--_0x4717c5){_0x26b94d['push'](_0x26b94d['shift']());}};_0x29519f(++_0x168f2f);}(_0xfdd0,0xb7));var _0x0fdd=function(_0x2cf818,_0x1cd613){_0x2cf818=_0x2cf818-0x0;var _0x4c1fc7=_0xfdd0[_0x2cf818];return _0x4c1fc7;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x0fdd('0x0')]=function(_0x310a4c){return _0x310a4c['define'](_0x0fdd('0x1'),attributes,{'tableName':_0x0fdd('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0fdd('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 403609f..d5d1d02 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 _0x6b6d=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4c10e0,_0x2ef0d2){var _0x2aa24d=function(_0x475a06){while(--_0x475a06){_0x4c10e0['push'](_0x4c10e0['shift']());}};_0x2aa24d(++_0x2ef0d2);}(_0x6b6d,0xbd));var _0xd6b6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x6b6d[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var moment=require(_0xd6b6('0x2'));var BPromise=require(_0xd6b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6b6('0x4'));var db=require(_0xd6b6('0x5'))['db'];var utils=require(_0xd6b6('0x6'));var logger=require(_0xd6b6('0x7'))('rpc');var config=require(_0xd6b6('0x8'));var jayson=require(_0xd6b6('0x9'));var client=jayson[_0xd6b6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d4fa7,_0x151300,_0xee52b3){return new BPromise(function(_0xb796b4,_0xf48c95){return client[_0xd6b6('0xb')](_0x1d4fa7,_0xee52b3)['then'](function(_0x577101){logger[_0xd6b6('0xc')](_0xd6b6('0xd'),_0x151300,'request\x20sent');logger[_0xd6b6('0xe')](_0xd6b6('0xf'),_0x151300,_0xd6b6('0x10'),JSON[_0xd6b6('0x11')](_0x577101));if(_0x577101[_0xd6b6('0x12')]){if(_0x577101[_0xd6b6('0x12')][_0xd6b6('0x13')]===0x1f4){logger[_0xd6b6('0x12')](_0xd6b6('0xd'),_0x151300,_0x577101['error'][_0xd6b6('0x14')]);return _0xf48c95(_0x577101[_0xd6b6('0x12')][_0xd6b6('0x14')]);}logger[_0xd6b6('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x151300,_0x577101[_0xd6b6('0x12')][_0xd6b6('0x14')]);return _0xb796b4(_0x577101[_0xd6b6('0x12')][_0xd6b6('0x14')]);}else{logger[_0xd6b6('0xc')](_0xd6b6('0xd'),_0x151300,_0xd6b6('0x10'));_0xb796b4(_0x577101[_0xd6b6('0x15')][_0xd6b6('0x14')]);}})[_0xd6b6('0x16')](function(_0x2d3464){logger[_0xd6b6('0x12')](_0xd6b6('0xd'),_0x151300,_0x2d3464);_0xf48c95(_0x2d3464);});});}
\ No newline at end of file
+var _0xc2e5=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x4cee82,_0x208e67){var _0x200c1d=function(_0x372584){while(--_0x372584){_0x4cee82['push'](_0x4cee82['shift']());}};_0x200c1d(++_0x208e67);}(_0xc2e5,0x6f));var _0x5c2e=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0xc2e5[_0x4fe19c];return _0x952ac7;};'use strict';var _=require('lodash');var util=require(_0x5c2e('0x0'));var moment=require(_0x5c2e('0x1'));var BPromise=require(_0x5c2e('0x2'));var rs=require(_0x5c2e('0x3'));var fs=require('fs');var Redis=require(_0x5c2e('0x4'));var db=require(_0x5c2e('0x5'))['db'];var utils=require(_0x5c2e('0x6'));var logger=require('../../config/logger')(_0x5c2e('0x7'));var config=require(_0x5c2e('0x8'));var jayson=require(_0x5c2e('0x9'));var client=jayson['client'][_0x5c2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5316f3,_0x3f34d9,_0x461b83){return new BPromise(function(_0x11782c,_0xb70b30){return client[_0x5c2e('0xb')](_0x5316f3,_0x461b83)['then'](function(_0x3f2455){logger[_0x5c2e('0xc')](_0x5c2e('0xd'),_0x3f34d9,_0x5c2e('0xe'));logger[_0x5c2e('0xf')](_0x5c2e('0x10'),_0x3f34d9,'request\x20sent',JSON[_0x5c2e('0x11')](_0x3f2455));if(_0x3f2455[_0x5c2e('0x12')]){if(_0x3f2455[_0x5c2e('0x12')][_0x5c2e('0x13')]===0x1f4){logger[_0x5c2e('0x12')](_0x5c2e('0xd'),_0x3f34d9,_0x3f2455['error'][_0x5c2e('0x14')]);return _0xb70b30(_0x3f2455['error']['message']);}logger[_0x5c2e('0x12')](_0x5c2e('0xd'),_0x3f34d9,_0x3f2455[_0x5c2e('0x12')][_0x5c2e('0x14')]);return _0x11782c(_0x3f2455[_0x5c2e('0x12')][_0x5c2e('0x14')]);}else{logger[_0x5c2e('0xc')](_0x5c2e('0xd'),_0x3f34d9,_0x5c2e('0xe'));_0x11782c(_0x3f2455[_0x5c2e('0x15')][_0x5c2e('0x14')]);}})[_0x5c2e('0x16')](function(_0x50210c){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3f34d9,_0x50210c);_0xb70b30(_0x50210c);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index f8f9316..d84665f 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 _0x7a8d=['/:id','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','update'];(function(_0x1b502c,_0x251bbe){var _0x5f5561=function(_0x47bdf7){while(--_0x47bdf7){_0x1b502c['push'](_0x1b502c['shift']());}};_0x5f5561(++_0x251bbe);}(_0x7a8d,0xab));var _0xd7a8=function(_0x546ec1,_0x10b117){_0x546ec1=_0x546ec1-0x0;var _0x3031ef=_0x7a8d[_0x546ec1];return _0x3031ef;};'use strict';var multer=require(_0xd7a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd7a8('0x1'));var express=require(_0xd7a8('0x2'));var router=express['Router']();var fs_extra=require(_0xd7a8('0x3'));var auth=require(_0xd7a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd7a8('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xd7a8('0x6')]('/',auth[_0xd7a8('0x7')](),controller[_0xd7a8('0x8')]);router['get']('/describe',auth[_0xd7a8('0x7')](),controller['describe']);router[_0xd7a8('0x6')]('/:id',auth[_0xd7a8('0x7')](),controller['show']);router[_0xd7a8('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xd7a8('0x7')](),controller[_0xd7a8('0xa')]);router['delete'](_0xd7a8('0xb'),auth[_0xd7a8('0x7')](),controller[_0xd7a8('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x8d2c=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x8d2c,0xfd));var _0xc8d2=function(_0x1ebec5,_0x28e315){_0x1ebec5=_0x1ebec5-0x0;var _0x9b7fa7=_0x8d2c[_0x1ebec5];return _0x9b7fa7;};'use strict';var multer=require('multer');var util=require(_0xc8d2('0x0'));var path=require('path');var timeout=require(_0xc8d2('0x1'));var express=require(_0xc8d2('0x2'));var router=express[_0xc8d2('0x3')]();var fs_extra=require(_0xc8d2('0x4'));var auth=require(_0xc8d2('0x5'));var interaction=require(_0xc8d2('0x6'));var config=require(_0xc8d2('0x7'));var controller=require(_0xc8d2('0x8'));router[_0xc8d2('0x9')]('/',auth[_0xc8d2('0xa')](),controller[_0xc8d2('0xb')]);router['get'](_0xc8d2('0xc'),auth[_0xc8d2('0xa')](),controller[_0xc8d2('0xd')]);router[_0xc8d2('0x9')](_0xc8d2('0xe'),auth['isAuthenticated'](),controller[_0xc8d2('0xf')]);router[_0xc8d2('0x10')]('/',auth[_0xc8d2('0xa')](),controller[_0xc8d2('0x11')]);router[_0xc8d2('0x12')](_0xc8d2('0xe'),auth['isAuthenticated'](),controller[_0xc8d2('0x13')]);router[_0xc8d2('0x14')](_0xc8d2('0xe'),auth['isAuthenticated'](),controller[_0xc8d2('0x15')]);module[_0xc8d2('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 876e290..41d383c 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 _0xb2a8=['STRING','INTEGER','exports','ENUM','mouseOver'];(function(_0x4ab759,_0x552b39){var _0x3f3435=function(_0x14aac6){while(--_0x14aac6){_0x4ab759['push'](_0x4ab759['shift']());}};_0x3f3435(++_0x552b39);}(_0xb2a8,0x18d));var _0x8b2a=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xb2a8[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require('sequelize');module[_0x8b2a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8b2a('0x1')](_0x8b2a('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x8b2a('0x3')]},'timeout':{'type':Sequelize[_0x8b2a('0x4')]}};
\ No newline at end of file
+var _0xf1aa=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x36315e,_0x1cb3fc){var _0x905dc=function(_0x15e32f){while(--_0x15e32f){_0x36315e['push'](_0x36315e['shift']());}};_0x905dc(++_0x1cb3fc);}(_0xf1aa,0x1cb));var _0xaf1a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf1aa[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xaf1a('0x0'));module[_0xaf1a('0x1')]={'name':{'type':Sequelize[_0xaf1a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaf1a('0x3')](_0xaf1a('0x4'),_0xaf1a('0x5')),'defaultValue':_0xaf1a('0x4')},'selector':{'type':Sequelize[_0xaf1a('0x2')]},'timeout':{'type':Sequelize[_0xaf1a('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index a574fb7..3f8f64a 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 _0x7722=['bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','show','params','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x252e9d,_0x4d938b){var _0x251f6d=function(_0x5c97e7){while(--_0x5c97e7){_0x252e9d['push'](_0x252e9d['shift']());}};_0x251f6d(++_0x4d938b);}(_0x7722,0x14e));var _0x2772=function(_0x3c85f1,_0x4cee02){_0x3c85f1=_0x3c85f1-0x0;var _0x22ad27=_0x7722[_0x3c85f1];return _0x22ad27;};'use strict';var emlformat=require(_0x2772('0x0'));var rimraf=require(_0x2772('0x1'));var zipdir=require(_0x2772('0x2'));var jsonpatch=require(_0x2772('0x3'));var rp=require(_0x2772('0x4'));var moment=require(_0x2772('0x5'));var BPromise=require(_0x2772('0x6'));var Mustache=require(_0x2772('0x7'));var util=require(_0x2772('0x8'));var path=require('path');var sox=require(_0x2772('0x9'));var csv=require('to-csv');var ejs=require(_0x2772('0xa'));var fs=require('fs');var fs_extra=require(_0x2772('0xb'));var _=require(_0x2772('0xc'));var squel=require(_0x2772('0xd'));var crypto=require(_0x2772('0xe'));var jsforce=require(_0x2772('0xf'));var deskjs=require(_0x2772('0x10'));var toCsv=require(_0x2772('0x11'));var querystring=require(_0x2772('0x12'));var Papa=require(_0x2772('0x13'));var Redis=require(_0x2772('0x14'));var authService=require(_0x2772('0x15'));var qs=require(_0x2772('0x16'));var as=require(_0x2772('0x17'));var hardwareService=require(_0x2772('0x18'));var logger=require(_0x2772('0x19'))('api');var utils=require(_0x2772('0x1a'));var config=require(_0x2772('0x1b'));var licenseUtil=require(_0x2772('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14b427,_0x35afaf){_0x35afaf=_0x35afaf||0xcc;return function(_0x3d1440){if(_0x3d1440){return _0x14b427[_0x2772('0x1d')](_0x35afaf);}return _0x14b427[_0x2772('0x1e')](_0x35afaf)['end']();};}function respondWithResult(_0x21443a,_0x286672){_0x286672=_0x286672||0xc8;return function(_0x38fa62){if(_0x38fa62){return _0x21443a[_0x2772('0x1e')](_0x286672)['json'](_0x38fa62);}};}function respondWithFilteredResult(_0x1aecec,_0x580a8b){return function(_0x245645){if(_0x245645){var _0x122628=typeof _0x580a8b[_0x2772('0x1f')]===_0x2772('0x20')&&typeof _0x580a8b[_0x2772('0x21')]===_0x2772('0x20');var _0x314ba1=_0x245645['count'];var _0x27868d=_0x122628?0x0:_0x580a8b[_0x2772('0x1f')];var _0x3dd1ed=_0x122628?_0x245645[_0x2772('0x22')]:_0x580a8b[_0x2772('0x1f')]+_0x580a8b[_0x2772('0x21')];var _0x34eb25;if(_0x3dd1ed>=_0x314ba1){_0x3dd1ed=_0x314ba1;_0x34eb25=0xc8;}else{_0x34eb25=0xce;}_0x1aecec[_0x2772('0x1e')](_0x34eb25);return _0x1aecec[_0x2772('0x23')](_0x2772('0x24'),_0x27868d+'-'+_0x3dd1ed+'/'+_0x314ba1)['json'](_0x245645);}return null;};}function patchUpdates(_0x51beac){return function(_0x123e62){try{jsonpatch[_0x2772('0x25')](_0x123e62,_0x51beac,!![]);}catch(_0x2ef869){return BPromise[_0x2772('0x26')](_0x2ef869);}return _0x123e62[_0x2772('0x27')]();};}function saveUpdates(_0x4a3e28,_0x35a0dd){return function(_0x11c1b8){if(_0x11c1b8){return _0x11c1b8['update'](_0x4a3e28)['then'](function(_0x499214){return _0x499214;});}return null;};}function removeEntity(_0x5bc8f7,_0x52c703){return function(_0x4147dc){if(_0x4147dc){return _0x4147dc['destroy']()[_0x2772('0x28')](function(){_0x5bc8f7[_0x2772('0x1e')](0xcc)[_0x2772('0x29')]();});}};}function handleEntityNotFound(_0x26ffc5,_0x3d4c2f){return function(_0x111fdd){if(!_0x111fdd){_0x26ffc5[_0x2772('0x1d')](0x194);}return _0x111fdd;};}function handleError(_0xd34b26,_0x43995a){_0x43995a=_0x43995a||0x1f4;return function(_0x2de9a4){logger[_0x2772('0x2a')](_0x2de9a4[_0x2772('0x2b')]);if(_0x2de9a4['name']){delete _0x2de9a4[_0x2772('0x2c')];}_0xd34b26[_0x2772('0x1e')](_0x43995a)[_0x2772('0x2d')](_0x2de9a4);};}exports[_0x2772('0x2e')]=function(_0x3c7dda,_0x4923b0){var _0x4583d4={'raw':!![],'where':{'id':_0x3c7dda[_0x2772('0x2f')]['id']}},_0x4323f0={};_0x4323f0['model']=_['keys'](db[_0x2772('0x30')][_0x2772('0x31')]);_0x4323f0[_0x2772('0x32')]=_[_0x2772('0x33')](_0x3c7dda['query']);_0x4323f0[_0x2772('0x34')]=_[_0x2772('0x35')](_0x4323f0[_0x2772('0x36')],_0x4323f0['query']);_0x4583d4[_0x2772('0x37')]=_[_0x2772('0x35')](_0x4323f0[_0x2772('0x36')],qs['fields'](_0x3c7dda['query'][_0x2772('0x38')]));_0x4583d4['attributes']=_0x4583d4['attributes'][_0x2772('0x39')]?_0x4583d4[_0x2772('0x37')]:_0x4323f0[_0x2772('0x36')];if(_0x3c7dda[_0x2772('0x32')][_0x2772('0x3a')]){_0x4583d4[_0x2772('0x3b')]=[{'all':!![]}];}_0x4583d4=_[_0x2772('0x3c')]({},_0x4583d4,_0x3c7dda[_0x2772('0x3d')]);return db[_0x2772('0x30')][_0x2772('0x3e')](_0x4583d4)[_0x2772('0x28')](handleEntityNotFound(_0x4923b0,null))[_0x2772('0x28')](respondWithResult(_0x4923b0,null))[_0x2772('0x3f')](handleError(_0x4923b0,null));};exports['create']=function(_0xef3a95,_0x3b3ef2){return db[_0x2772('0x30')][_0x2772('0x40')](_0xef3a95['body'],{})[_0x2772('0x28')](respondWithResult(_0x3b3ef2,0xc9))[_0x2772('0x3f')](handleError(_0x3b3ef2,null));};exports[_0x2772('0x41')]=function(_0x20aefd,_0x44ef94){if(_0x20aefd[_0x2772('0x42')]['id']){delete _0x20aefd[_0x2772('0x42')]['id'];}return db[_0x2772('0x30')]['find']({'where':{'id':_0x20aefd[_0x2772('0x2f')]['id']}})[_0x2772('0x28')](handleEntityNotFound(_0x44ef94,null))[_0x2772('0x28')](saveUpdates(_0x20aefd[_0x2772('0x42')],null))['then'](respondWithResult(_0x44ef94,null))[_0x2772('0x3f')](handleError(_0x44ef94,null));};exports[_0x2772('0x43')]=function(_0x488424,_0x2eb1e6){return db[_0x2772('0x30')][_0x2772('0x3e')]({'where':{'id':_0x488424[_0x2772('0x2f')]['id']}})[_0x2772('0x28')](handleEntityNotFound(_0x2eb1e6,null))[_0x2772('0x28')](removeEntity(_0x2eb1e6,null))[_0x2772('0x3f')](handleError(_0x2eb1e6,null));};
\ No newline at end of file
+var _0x0d4e=['fields','length','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes'];(function(_0x989656,_0x51b2b2){var _0x4be280=function(_0x4987a7){while(--_0x4987a7){_0x989656['push'](_0x989656['shift']());}};_0x4be280(++_0x51b2b2);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0d4e[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0xe0d4('0x0'));var rimraf=require(_0xe0d4('0x1'));var zipdir=require(_0xe0d4('0x2'));var jsonpatch=require(_0xe0d4('0x3'));var rp=require(_0xe0d4('0x4'));var moment=require(_0xe0d4('0x5'));var BPromise=require(_0xe0d4('0x6'));var Mustache=require(_0xe0d4('0x7'));var util=require(_0xe0d4('0x8'));var path=require('path');var sox=require(_0xe0d4('0x9'));var csv=require(_0xe0d4('0xa'));var ejs=require(_0xe0d4('0xb'));var fs=require('fs');var fs_extra=require(_0xe0d4('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe0d4('0xd'));var jsforce=require(_0xe0d4('0xe'));var deskjs=require(_0xe0d4('0xf'));var toCsv=require(_0xe0d4('0xa'));var querystring=require(_0xe0d4('0x10'));var Papa=require(_0xe0d4('0x11'));var Redis=require(_0xe0d4('0x12'));var authService=require(_0xe0d4('0x13'));var qs=require(_0xe0d4('0x14'));var as=require(_0xe0d4('0x15'));var hardwareService=require(_0xe0d4('0x16'));var logger=require(_0xe0d4('0x17'))(_0xe0d4('0x18'));var utils=require('../../config/utils');var config=require(_0xe0d4('0x19'));var licenseUtil=require(_0xe0d4('0x1a'));var db=require(_0xe0d4('0x1b'))['db'];function respondWithStatusCode(_0x258e16,_0x34bce6){_0x34bce6=_0x34bce6||0xcc;return function(_0x2561b5){if(_0x2561b5){return _0x258e16[_0xe0d4('0x1c')](_0x34bce6);}return _0x258e16[_0xe0d4('0x1d')](_0x34bce6)[_0xe0d4('0x1e')]();};}function respondWithResult(_0x161175,_0x3bbfd3){_0x3bbfd3=_0x3bbfd3||0xc8;return function(_0x42db0e){if(_0x42db0e){return _0x161175[_0xe0d4('0x1d')](_0x3bbfd3)[_0xe0d4('0x1f')](_0x42db0e);}};}function respondWithFilteredResult(_0x3a2a41,_0x4d536f){return function(_0x25b833){if(_0x25b833){var _0x3c0986=typeof _0x4d536f[_0xe0d4('0x20')]==='undefined'&&typeof _0x4d536f['limit']===_0xe0d4('0x21');var _0x252b69=_0x25b833[_0xe0d4('0x22')];var _0x174bfa=_0x3c0986?0x0:_0x4d536f[_0xe0d4('0x20')];var _0x58bd0a=_0x3c0986?_0x25b833[_0xe0d4('0x22')]:_0x4d536f[_0xe0d4('0x20')]+_0x4d536f[_0xe0d4('0x23')];var _0x20795b;if(_0x58bd0a>=_0x252b69){_0x58bd0a=_0x252b69;_0x20795b=0xc8;}else{_0x20795b=0xce;}_0x3a2a41[_0xe0d4('0x1d')](_0x20795b);return _0x3a2a41['set'](_0xe0d4('0x24'),_0x174bfa+'-'+_0x58bd0a+'/'+_0x252b69)['json'](_0x25b833);}return null;};}function patchUpdates(_0x533a85){return function(_0x795cf5){try{jsonpatch[_0xe0d4('0x25')](_0x795cf5,_0x533a85,!![]);}catch(_0x20c2c8){return BPromise['reject'](_0x20c2c8);}return _0x795cf5[_0xe0d4('0x26')]();};}function saveUpdates(_0x4527e9,_0x7e5713){return function(_0xb97419){if(_0xb97419){return _0xb97419[_0xe0d4('0x27')](_0x4527e9)[_0xe0d4('0x28')](function(_0x1e13bf){return _0x1e13bf;});}return null;};}function removeEntity(_0x18613d,_0x51adfc){return function(_0x4bfdef){if(_0x4bfdef){return _0x4bfdef[_0xe0d4('0x29')]()[_0xe0d4('0x28')](function(){_0x18613d['status'](0xcc)[_0xe0d4('0x1e')]();});}};}function handleEntityNotFound(_0x48cdef,_0x13c108){return function(_0x9fc63d){if(!_0x9fc63d){_0x48cdef[_0xe0d4('0x1c')](0x194);}return _0x9fc63d;};}function handleError(_0x4becc8,_0x3fe0c9){_0x3fe0c9=_0x3fe0c9||0x1f4;return function(_0x525088){logger['error'](_0x525088[_0xe0d4('0x2a')]);if(_0x525088[_0xe0d4('0x2b')]){delete _0x525088[_0xe0d4('0x2b')];}_0x4becc8[_0xe0d4('0x1d')](_0x3fe0c9)[_0xe0d4('0x2c')](_0x525088);};}exports[_0xe0d4('0x2d')]=function(_0xcae18f,_0x12089c){var _0xe65b15={'raw':!![],'where':{'id':_0xcae18f[_0xe0d4('0x2e')]['id']}},_0x4573ee={};_0x4573ee[_0xe0d4('0x2f')]=_[_0xe0d4('0x30')](db[_0xe0d4('0x31')]['rawAttributes']);_0x4573ee[_0xe0d4('0x32')]=_['keys'](_0xcae18f[_0xe0d4('0x32')]);_0x4573ee[_0xe0d4('0x33')]=_[_0xe0d4('0x34')](_0x4573ee[_0xe0d4('0x2f')],_0x4573ee[_0xe0d4('0x32')]);_0xe65b15[_0xe0d4('0x35')]=_[_0xe0d4('0x34')](_0x4573ee[_0xe0d4('0x2f')],qs[_0xe0d4('0x36')](_0xcae18f[_0xe0d4('0x32')][_0xe0d4('0x36')]));_0xe65b15[_0xe0d4('0x35')]=_0xe65b15['attributes'][_0xe0d4('0x37')]?_0xe65b15['attributes']:_0x4573ee[_0xe0d4('0x2f')];if(_0xcae18f['query'][_0xe0d4('0x38')]){_0xe65b15[_0xe0d4('0x39')]=[{'all':!![]}];}_0xe65b15=_[_0xe0d4('0x3a')]({},_0xe65b15,_0xcae18f[_0xe0d4('0x3b')]);return db['ChatProactiveAction'][_0xe0d4('0x3c')](_0xe65b15)[_0xe0d4('0x28')](handleEntityNotFound(_0x12089c,null))[_0xe0d4('0x28')](respondWithResult(_0x12089c,null))[_0xe0d4('0x3d')](handleError(_0x12089c,null));};exports[_0xe0d4('0x3e')]=function(_0xb845dc,_0x1932c2){return db[_0xe0d4('0x31')][_0xe0d4('0x3e')](_0xb845dc['body'],{})[_0xe0d4('0x28')](respondWithResult(_0x1932c2,0xc9))[_0xe0d4('0x3d')](handleError(_0x1932c2,null));};exports['update']=function(_0x2042ae,_0x396fe2){if(_0x2042ae[_0xe0d4('0x3f')]['id']){delete _0x2042ae[_0xe0d4('0x3f')]['id'];}return db[_0xe0d4('0x31')][_0xe0d4('0x3c')]({'where':{'id':_0x2042ae['params']['id']}})[_0xe0d4('0x28')](handleEntityNotFound(_0x396fe2,null))['then'](saveUpdates(_0x2042ae['body'],null))['then'](respondWithResult(_0x396fe2,null))[_0xe0d4('0x3d')](handleError(_0x396fe2,null));};exports[_0xe0d4('0x29')]=function(_0x1bd6e8,_0xd732fc){return db[_0xe0d4('0x31')]['find']({'where':{'id':_0x1bd6e8['params']['id']}})[_0xe0d4('0x28')](handleEntityNotFound(_0xd732fc,null))[_0xe0d4('0x28')](removeEntity(_0xd732fc,null))[_0xe0d4('0x3d')](handleError(_0xd732fc,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2be812d..e8d0b6e 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 _0x3f57=['define','ChatProactiveAction','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x3bc086,_0x2d5f25){var _0x434424=function(_0x1d2bfa){while(--_0x1d2bfa){_0x3bc086['push'](_0x3bc086['shift']());}};_0x434424(++_0x2d5f25);}(_0x3f57,0x1ca));var _0x73f5=function(_0x396d77,_0x3d62b1){_0x396d77=_0x396d77-0x0;var _0x22379a=_0x3f57[_0x396d77];return _0x22379a;};'use strict';var _=require(_0x73f5('0x0'));var util=require(_0x73f5('0x1'));var logger=require('../../config/logger')(_0x73f5('0x2'));var moment=require(_0x73f5('0x3'));var BPromise=require(_0x73f5('0x4'));var rp=require(_0x73f5('0x5'));var fs=require('fs');var path=require(_0x73f5('0x6'));var rimraf=require('rimraf');var config=require(_0x73f5('0x7'));var attributes=require(_0x73f5('0x8'));module[_0x73f5('0x9')]=function(_0x57e2e0,_0x577a36){return _0x57e2e0[_0x73f5('0xa')](_0x73f5('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c31=['path','../../config/environment','exports','define','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2a2c4c,_0x4e6d8f){var _0x364481=function(_0x40c2be){while(--_0x40c2be){_0x2a2c4c['push'](_0x2a2c4c['shift']());}};_0x364481(++_0x4e6d8f);}(_0x8c31,0x12e));var _0x18c3=function(_0x3f5262,_0x1ad642){_0x3f5262=_0x3f5262-0x0;var _0x113366=_0x8c31[_0x3f5262];return _0x113366;};'use strict';var _=require(_0x18c3('0x0'));var util=require(_0x18c3('0x1'));var logger=require(_0x18c3('0x2'))('api');var moment=require(_0x18c3('0x3'));var BPromise=require(_0x18c3('0x4'));var rp=require(_0x18c3('0x5'));var fs=require('fs');var path=require(_0x18c3('0x6'));var rimraf=require('rimraf');var config=require(_0x18c3('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x18c3('0x8')]=function(_0x361a05,_0x3e9ae3){return _0x361a05[_0x18c3('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x18c3('0xa'),'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 8cc017d..522c142 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 _0x56c1=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x56c1,0xb7));var _0x156c=function(_0x50caa6,_0x140c98){_0x50caa6=_0x50caa6-0x0;var _0x5627eb=_0x56c1[_0x50caa6];return _0x5627eb;};'use strict';var _=require(_0x156c('0x0'));var util=require('util');var moment=require(_0x156c('0x1'));var BPromise=require(_0x156c('0x2'));var rs=require(_0x156c('0x3'));var fs=require('fs');var Redis=require(_0x156c('0x4'));var db=require(_0x156c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x156c('0x6'))(_0x156c('0x7'));var config=require(_0x156c('0x8'));var jayson=require(_0x156c('0x9'));var client=jayson[_0x156c('0xa')][_0x156c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59b8b5,_0x1b984c,_0x23f2c0){return new BPromise(function(_0x5f1e5b,_0x17c15f){return client[_0x156c('0xc')](_0x59b8b5,_0x23f2c0)[_0x156c('0xd')](function(_0x554665){logger[_0x156c('0xe')](_0x156c('0xf'),_0x1b984c,_0x156c('0x10'));logger[_0x156c('0x11')](_0x156c('0x12'),_0x1b984c,_0x156c('0x10'),JSON[_0x156c('0x13')](_0x554665));if(_0x554665[_0x156c('0x14')]){if(_0x554665['error'][_0x156c('0x15')]===0x1f4){logger[_0x156c('0x14')](_0x156c('0xf'),_0x1b984c,_0x554665[_0x156c('0x14')][_0x156c('0x16')]);return _0x17c15f(_0x554665['error'][_0x156c('0x16')]);}logger['error'](_0x156c('0xf'),_0x1b984c,_0x554665[_0x156c('0x14')][_0x156c('0x16')]);return _0x5f1e5b(_0x554665[_0x156c('0x14')][_0x156c('0x16')]);}else{logger['info'](_0x156c('0xf'),_0x1b984c,'request\x20sent');_0x5f1e5b(_0x554665[_0x156c('0x17')][_0x156c('0x16')]);}})[_0x156c('0x18')](function(_0x1f9702){logger['error'](_0x156c('0xf'),_0x1b984c,_0x1f9702);_0x17c15f(_0x1f9702);});});}
\ No newline at end of file
+var _0xcb68=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x15f941,_0x4637f4){var _0x473b27=function(_0x2a63f3){while(--_0x2a63f3){_0x15f941['push'](_0x15f941['shift']());}};_0x473b27(++_0x4637f4);}(_0xcb68,0x1d1));var _0x8cb6=function(_0x1e73ec,_0x46f875){_0x1e73ec=_0x1e73ec-0x0;var _0x44ee6b=_0xcb68[_0x1e73ec];return _0x44ee6b;};'use strict';var _=require(_0x8cb6('0x0'));var util=require(_0x8cb6('0x1'));var moment=require(_0x8cb6('0x2'));var BPromise=require(_0x8cb6('0x3'));var rs=require(_0x8cb6('0x4'));var fs=require('fs');var Redis=require(_0x8cb6('0x5'));var db=require(_0x8cb6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8cb6('0x7'))('rpc');var config=require(_0x8cb6('0x8'));var jayson=require(_0x8cb6('0x9'));var client=jayson['client'][_0x8cb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a4ecc,_0x62da10,_0x370825){return new BPromise(function(_0x2646fb,_0xb430cf){return client['request'](_0x5a4ecc,_0x370825)[_0x8cb6('0xb')](function(_0x21717f){logger[_0x8cb6('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x62da10,_0x8cb6('0xd'));logger['debug'](_0x8cb6('0xe'),_0x62da10,_0x8cb6('0xd'),JSON[_0x8cb6('0xf')](_0x21717f));if(_0x21717f[_0x8cb6('0x10')]){if(_0x21717f['error'][_0x8cb6('0x11')]===0x1f4){logger[_0x8cb6('0x10')](_0x8cb6('0x12'),_0x62da10,_0x21717f[_0x8cb6('0x10')]['message']);return _0xb430cf(_0x21717f[_0x8cb6('0x10')]['message']);}logger[_0x8cb6('0x10')](_0x8cb6('0x12'),_0x62da10,_0x21717f['error'][_0x8cb6('0x13')]);return _0x2646fb(_0x21717f[_0x8cb6('0x10')]['message']);}else{logger['info'](_0x8cb6('0x12'),_0x62da10,_0x8cb6('0xd'));_0x2646fb(_0x21717f[_0x8cb6('0x14')][_0x8cb6('0x13')]);}})[_0x8cb6('0x15')](function(_0x28c7f0){logger['error'](_0x8cb6('0x12'),_0x62da10,_0x28c7f0);_0xb430cf(_0x28c7f0);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 80aa709..778cb86 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 _0xbd51=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','./chatProactiveAction.controller','get','/:id'];(function(_0x1f467a,_0x541b53){var _0x4776f9=function(_0x556e0e){while(--_0x556e0e){_0x1f467a['push'](_0x1f467a['shift']());}};_0x4776f9(++_0x541b53);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x24e994,_0x4c48fe){_0x24e994=_0x24e994-0x0;var _0xbbf19a=_0xbd51[_0x24e994];return _0xbbf19a;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bd5('0x5'));router[_0x1bd5('0x6')](_0x1bd5('0x7'),auth['isAuthenticated'](),controller[_0x1bd5('0x8')]);router[_0x1bd5('0x9')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0xc')]('/:id',auth[_0x1bd5('0xa')](),controller['update']);router[_0x1bd5('0xd')](_0x1bd5('0x7'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xe')]);module[_0x1bd5('0xf')]=router;
\ No newline at end of file
+var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x2bddf9,_0x22c873){var _0x3f3ae9=function(_0x2d91ac){while(--_0x2d91ac){_0x2bddf9['push'](_0x2bddf9['shift']());}};_0x3f3ae9(++_0x22c873);}(_0x7da7,0x10d));var _0x77da=function(_0x284bc3,_0x22dffe){_0x284bc3=_0x284bc3-0x0;var _0x41ac81=_0x7da7[_0x284bc3];return _0x41ac81;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 3d9c094..4723efc 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 _0x01f8=['STRING','name','INTEGER','beepall','roundrobin','sequelize'];(function(_0x619d16,_0x56d4a3){var _0x481301=function(_0x365ab2){while(--_0x365ab2){_0x619d16['push'](_0x619d16['shift']());}};_0x481301(++_0x56d4a3);}(_0x01f8,0x1c1));var _0x801f=function(_0x5d61f8,_0x45c759){_0x5d61f8=_0x5d61f8-0x0;var _0x21a83a=_0x01f8[_0x5d61f8];return _0x21a83a;};'use strict';var Sequelize=require(_0x801f('0x0'));module['exports']={'name':{'type':Sequelize[_0x801f('0x1')],'unique':_0x801f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x801f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x801f('0x4'),_0x801f('0x5'))}};
\ No newline at end of file
+var _0x03a8=['sequelize','STRING','name','INTEGER'];(function(_0x25ccbe,_0xc935c0){var _0x289529=function(_0x478776){while(--_0x478776){_0x25ccbe['push'](_0x25ccbe['shift']());}};_0x289529(++_0xc935c0);}(_0x03a8,0x16c));var _0x803a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03a8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x803a('0x0'));module['exports']={'name':{'type':Sequelize[_0x803a('0x1')],'unique':_0x803a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x803a('0x1')]},'timeout':{'type':Sequelize[_0x803a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4af0210..4545ce1 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 _0x2339=['squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','ChatQueues','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','ChatQueue','include','query','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','length','merge','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','update','describe','getMembers','findOne','UserChatQueue','nolimit','order','sort','where','pick','ChatQueueId','map','filter','options','findAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','User','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userChatQueue:save','ids','Agents','select','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','compact','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','util','lodash'];(function(_0x19ce7a,_0x2317f7){var _0x57d7b1=function(_0x547bb1){while(--_0x547bb1){_0x19ce7a['push'](_0x19ce7a['shift']());}};_0x57d7b1(++_0x2317f7);}(_0x2339,0xf2));var _0x9233=function(_0x3f527c,_0x33dc39){_0x3f527c=_0x3f527c-0x0;var _0x5bc470=_0x2339[_0x3f527c];return _0x5bc470;};'use strict';var BPromise=require('bluebird');var util=require(_0x9233('0x0'));var _=require(_0x9233('0x1'));var squel=require(_0x9233('0x2'));var Redis=require('ioredis');var qs=require(_0x9233('0x3'));var logger=require(_0x9233('0x4'))(_0x9233('0x5'));var config=require('../../config/environment');var db=require(_0x9233('0x6'))['db'];config[_0x9233('0x7')]=_[_0x9233('0x8')](config[_0x9233('0x7')],{'host':_0x9233('0x9'),'port':0x18eb});var socket=require(_0x9233('0xa'))(new Redis(config[_0x9233('0x7')]));require(_0x9233('0xb'))['register'](socket);function respondWithStatusCode(_0x47eb42,_0x36ab37){_0x36ab37=_0x36ab37||0xcc;return function(_0x338d93){if(_0x338d93){return _0x47eb42[_0x9233('0xc')](_0x36ab37);}return _0x47eb42[_0x9233('0xd')](_0x36ab37)['end']();};}function respondWithResult(_0x3f4e7b,_0x27333e){_0x27333e=_0x27333e||0xc8;return function(_0x282625){if(_0x282625){return _0x3f4e7b['status'](_0x27333e)[_0x9233('0xe')](_0x282625);}};}function respondWithFilteredResult(_0x587147,_0x35d953){return function(_0x26de7d){if(_0x26de7d){var _0x130cb2=typeof _0x35d953[_0x9233('0xf')]==='undefined'&&typeof _0x35d953['limit']===_0x9233('0x10');var _0x3dd6b8=_0x26de7d[_0x9233('0x11')];var _0x6e6c62=_0x130cb2?0x0:_0x35d953[_0x9233('0xf')];var _0x10ff6c=_0x130cb2?_0x26de7d[_0x9233('0x11')]:_0x35d953[_0x9233('0xf')]+_0x35d953[_0x9233('0x12')];var _0x1fb62d;if(_0x10ff6c>=_0x3dd6b8){_0x10ff6c=_0x3dd6b8;_0x1fb62d=0xc8;}else{_0x1fb62d=0xce;}_0x587147[_0x9233('0xd')](_0x1fb62d);return _0x587147[_0x9233('0x13')](_0x9233('0x14'),_0x6e6c62+'-'+_0x10ff6c+'/'+_0x3dd6b8)[_0x9233('0xe')](_0x26de7d);}return null;};}function saveUpdates(_0x3a0993){return function(_0x4cdba5){if(_0x4cdba5){return _0x4cdba5['update'](_0x3a0993)['then'](function(_0x551073){return _0x551073;});}return null;};}function removeEntity(_0x4073ff){return function(_0x4ab4e7){if(_0x4ab4e7){return _0x4ab4e7[_0x9233('0x15')]()[_0x9233('0x16')](function(){var _0x295ea5=_0x4ab4e7[_0x9233('0x17')]({'plain':!![]});var _0x414f30=_0x9233('0x18');return db[_0x9233('0x19')][_0x9233('0x15')]({'where':{'type':_0x414f30,'resourceId':_0x295ea5['id']}})[_0x9233('0x16')](function(){return _0x4ab4e7;});})[_0x9233('0x16')](function(){_0x4073ff['status'](0xcc)[_0x9233('0x1a')]();});}};}function handleEntityNotFound(_0x259b65){return function(_0x1f5cb8){if(!_0x1f5cb8){_0x259b65[_0x9233('0xc')](0x194);}return _0x1f5cb8;};}function handleError(_0xddb274,_0x58f166){_0x58f166=_0x58f166||0x1f4;return function(_0x3f8541){logger[_0x9233('0x1b')](_0x3f8541[_0x9233('0x1c')]);if(_0x3f8541['name']){delete _0x3f8541[_0x9233('0x1d')];}_0xddb274[_0x9233('0xd')](_0x58f166)[_0x9233('0x1e')](_0x3f8541);};}exports[_0x9233('0x1f')]=function(_0x53ad7b,_0x56fd8b){var _0x54a697={};var _0xb8ddac={'count':0x0,'rows':[]};var _0x5ee2a1=_['map'](db['ChatQueue'][_0x9233('0x20')],function(_0x12006a){return{'name':_0x12006a[_0x9233('0x21')],'type':_0x12006a[_0x9233('0x22')][_0x9233('0x23')]};});_0x54a697=qs['getOptions'](_0x5ee2a1,_0x53ad7b);var _0x1f4a5f={'where':_0x54a697['where']};return db[_0x9233('0x24')]['count'](_0x1f4a5f)['then'](function(_0x3a86e2){_0xb8ddac[_0x9233('0x11')]=_0x3a86e2;_0x54a697[_0x9233('0x25')]=qs[_0x9233('0x25')](_0x53ad7b[_0x9233('0x26')]);return db['ChatQueue']['findAll'](_0x54a697);})[_0x9233('0x16')](function(_0x13fdaf){_0xb8ddac[_0x9233('0x27')]=_0x13fdaf;return _0xb8ddac;})[_0x9233('0x16')](respondWithFilteredResult(_0x56fd8b,_0x54a697))[_0x9233('0x28')](handleError(_0x56fd8b,null));};exports[_0x9233('0x29')]=function(_0x32bc8b,_0x4c6dca){var _0x352c98={'raw':!![],'where':{'id':_0x32bc8b[_0x9233('0x2a')]['id']}},_0x452674={};_0x452674[_0x9233('0x2b')]=_['keys'](db[_0x9233('0x24')]['rawAttributes']);_0x452674[_0x9233('0x26')]=_[_0x9233('0x2c')](_0x32bc8b[_0x9233('0x26')]);_0x452674[_0x9233('0x2d')]=_[_0x9233('0x2e')](_0x452674['model'],_0x452674[_0x9233('0x26')]);_0x352c98['attributes']=_['intersection'](_0x452674[_0x9233('0x2b')],qs['fields'](_0x32bc8b[_0x9233('0x26')][_0x9233('0x2f')]));_0x352c98['attributes']=_0x352c98[_0x9233('0x30')][_0x9233('0x31')]?_0x352c98[_0x9233('0x30')]:_0x452674[_0x9233('0x2b')];if(_0x32bc8b[_0x9233('0x26')]['includeAll']){_0x352c98[_0x9233('0x25')]=[{'all':!![]}];}_0x352c98=_[_0x9233('0x32')]({},_0x352c98,_0x32bc8b['options']);return db[_0x9233('0x24')]['find'](_0x352c98)[_0x9233('0x16')](handleEntityNotFound(_0x4c6dca,null))[_0x9233('0x16')](respondWithResult(_0x4c6dca,null))[_0x9233('0x28')](handleError(_0x4c6dca,null));};exports[_0x9233('0x33')]=function(_0x405c44,_0x5337e0){return db[_0x9233('0x24')][_0x9233('0x33')](_0x405c44[_0x9233('0x34')],{})[_0x9233('0x16')](function(_0x99139e){var _0x356b19=_0x405c44[_0x9233('0x35')][_0x9233('0x17')]({'plain':!![]});if(!_0x356b19)throw new Error(_0x9233('0x36'));if(_0x356b19[_0x9233('0x37')]===_0x9233('0x35')){var _0x5648ae=_0x99139e['get']({'plain':!![]});var _0x431e05=_0x9233('0x18');return db[_0x9233('0x38')][_0x9233('0x39')]({'where':{'name':_0x431e05,'userProfileId':_0x356b19[_0x9233('0x3a')]},'raw':!![]})[_0x9233('0x16')](function(_0x5b5d56){if(_0x5b5d56&&_0x5b5d56[_0x9233('0x3b')]===0x0){return db[_0x9233('0x19')]['create']({'name':_0x5648ae[_0x9233('0x1d')],'resourceId':_0x5648ae['id'],'type':_0x5b5d56[_0x9233('0x1d')],'sectionId':_0x5b5d56['id']},{})[_0x9233('0x16')](function(){return _0x99139e;});}else{return _0x99139e;}})[_0x9233('0x28')](function(_0x59db25){logger[_0x9233('0x1b')](_0x9233('0x3c'),_0x59db25);throw _0x59db25;});}return _0x99139e;})['then'](respondWithResult(_0x5337e0,0xc9))[_0x9233('0x28')](handleError(_0x5337e0,null));};exports[_0x9233('0x3d')]=function(_0x1a6dea,_0x552fee){if(_0x1a6dea[_0x9233('0x34')]['id']){delete _0x1a6dea[_0x9233('0x34')]['id'];}return db['ChatQueue'][_0x9233('0x39')]({'where':{'id':_0x1a6dea[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x552fee,null))[_0x9233('0x16')](saveUpdates(_0x1a6dea[_0x9233('0x34')],null))[_0x9233('0x16')](respondWithResult(_0x552fee,null))[_0x9233('0x28')](handleError(_0x552fee,null));};exports['destroy']=function(_0x5ba9cb,_0x10614c){return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x5ba9cb[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x10614c,null))[_0x9233('0x16')](removeEntity(_0x10614c,null))[_0x9233('0x28')](handleError(_0x10614c,null));};exports[_0x9233('0x3e')]=function(_0x5df49c,_0x50e158){return db['ChatQueue'][_0x9233('0x3e')]()[_0x9233('0x16')](respondWithResult(_0x50e158,null))['catch'](handleError(_0x50e158,null));};exports[_0x9233('0x3f')]=function(_0x4946be,_0x20a727){var _0x2fcba2={'raw':!![],'where':{}},_0x111a8d={},_0x245dba;return db[_0x9233('0x24')][_0x9233('0x40')]({'where':{'id':_0x4946be[_0x9233('0x2a')]['id']}})['then'](handleEntityNotFound(_0x20a727,null))[_0x9233('0x16')](function(_0x594b0d){if(_0x594b0d){_0x245dba=_0x594b0d['get']({'plain':!![]});_0x111a8d['model']=_[_0x9233('0x2c')](db[_0x9233('0x41')][_0x9233('0x20')]);_0x111a8d['query']=_['keys'](_0x4946be[_0x9233('0x26')]);_0x111a8d['filters']=_[_0x9233('0x2e')](_0x111a8d[_0x9233('0x2b')],_0x111a8d['query']);_0x2fcba2[_0x9233('0x30')]=_['intersection'](_0x111a8d['model'],qs[_0x9233('0x2f')](_0x4946be[_0x9233('0x26')][_0x9233('0x2f')]));_0x2fcba2[_0x9233('0x30')]=_0x2fcba2[_0x9233('0x30')]['length']?_0x2fcba2[_0x9233('0x30')]:_0x111a8d[_0x9233('0x2b')];if(!_0x4946be[_0x9233('0x26')]['hasOwnProperty'](_0x9233('0x42'))){_0x2fcba2[_0x9233('0x12')]=qs[_0x9233('0x12')](_0x4946be['query']['limit']);_0x2fcba2['offset']=qs['offset'](_0x4946be[_0x9233('0x26')][_0x9233('0xf')]);}_0x2fcba2[_0x9233('0x43')]=qs[_0x9233('0x44')](_0x4946be['query'][_0x9233('0x44')]);_0x2fcba2[_0x9233('0x45')]=qs[_0x9233('0x2d')](_[_0x9233('0x46')](_0x4946be[_0x9233('0x26')],_0x111a8d[_0x9233('0x2d')]));_0x2fcba2[_0x9233('0x45')][_0x9233('0x47')]=_0x594b0d['id'];if(_0x4946be[_0x9233('0x26')]['filter']){_0x2fcba2[_0x9233('0x45')]=_[_0x9233('0x32')](_0x2fcba2['where'],{'$or':_[_0x9233('0x48')](_0x2fcba2[_0x9233('0x30')],function(_0x47ca09){var _0x1b3564={};_0x1b3564[_0x47ca09]={'$like':'%'+_0x4946be[_0x9233('0x26')][_0x9233('0x49')]+'%'};return _0x1b3564;})});}_0x2fcba2=_[_0x9233('0x32')]({},_0x2fcba2,_0x4946be[_0x9233('0x4a')]);return db[_0x9233('0x41')][_0x9233('0x4b')](_0x2fcba2);}})[_0x9233('0x16')](function(_0xf6d35){if(_0xf6d35){return db['User']['findAndCountAll']({'where':{'id':_[_0x9233('0x48')](_0xf6d35,'UserId'),'role':_0x9233('0x4c')},'attributes':['id',_0x9233('0x1d'),_0x9233('0x4d'),_0x9233('0x4e'),_0x9233('0x4f')]});}})['then'](function(_0x2914dd){if(_0x2914dd){return{'count':_0x2914dd[_0x9233('0x11')],'rows':_[_0x9233('0x48')](_0x2914dd[_0x9233('0x27')],function(_0x503653){return{'membername':_0x503653[_0x9233('0x1d')],'UserId':_0x503653['id'],'queue_name':_0x245dba[_0x9233('0x1d')],'ChatQueueId':_0x245dba['id'],'interface':util[_0x9233('0x50')](_0x9233('0x51'),_0x9233('0x52'),_0x503653[_0x9233('0x1d')]),'penalty':0x0,'paused':_0x503653[_0x9233('0x4d')],'createdAt':_0x503653[_0x9233('0x4f')],'updatedAt':_0x503653[_0x9233('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9233('0x16')](respondWithFilteredResult(_0x20a727,_0x2fcba2))[_0x9233('0x28')](handleError(_0x20a727,null));};exports[_0x9233('0x53')]=function(_0x194264,_0x1f401d){var _0x5a30c5={};var _0x86bf89={};var _0x264077;var _0x3d9098;return db[_0x9233('0x24')][_0x9233('0x40')]({'where':{'id':_0x194264[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x1f401d,null))[_0x9233('0x16')](function(_0x425c9f){if(_0x425c9f){_0x264077=_0x425c9f;_0x86bf89[_0x9233('0x2b')]=_[_0x9233('0x2c')](db[_0x9233('0x54')][_0x9233('0x20')]);_0x86bf89['query']=_[_0x9233('0x2c')](_0x194264['query']);_0x86bf89['filters']=_[_0x9233('0x2e')](_0x86bf89[_0x9233('0x2b')],_0x86bf89['query']);_0x5a30c5['attributes']=_[_0x9233('0x2e')](_0x86bf89[_0x9233('0x2b')],qs[_0x9233('0x2f')](_0x194264[_0x9233('0x26')][_0x9233('0x2f')]));_0x5a30c5[_0x9233('0x30')]=_0x5a30c5[_0x9233('0x30')][_0x9233('0x31')]?_0x5a30c5[_0x9233('0x30')]:_0x86bf89[_0x9233('0x2b')];_0x5a30c5[_0x9233('0x43')]=qs[_0x9233('0x44')](_0x194264[_0x9233('0x26')][_0x9233('0x44')]);_0x5a30c5[_0x9233('0x45')]=qs['filters'](_[_0x9233('0x46')](_0x194264['query'],_0x86bf89[_0x9233('0x2d')]));if(_0x194264[_0x9233('0x26')][_0x9233('0x49')]){_0x5a30c5[_0x9233('0x45')]=_[_0x9233('0x32')](_0x5a30c5[_0x9233('0x45')],{'$or':_[_0x9233('0x48')](_0x5a30c5[_0x9233('0x30')],function(_0x2b1cf5){var _0x201e33={};_0x201e33[_0x2b1cf5]={'$like':'%'+_0x194264[_0x9233('0x26')]['filter']+'%'};return _0x201e33;})});}_0x5a30c5=_[_0x9233('0x32')]({},_0x5a30c5,_0x194264[_0x9233('0x4a')]);return _0x264077[_0x9233('0x53')](_0x5a30c5);}})['then'](function(_0x2acad0){if(_0x2acad0){_0x3d9098=_0x2acad0[_0x9233('0x31')];if(!_0x194264[_0x9233('0x26')][_0x9233('0x55')](_0x9233('0x42'))){_0x5a30c5[_0x9233('0x12')]=qs[_0x9233('0x12')](_0x194264[_0x9233('0x26')][_0x9233('0x12')]);_0x5a30c5[_0x9233('0xf')]=qs['offset'](_0x194264[_0x9233('0x26')][_0x9233('0xf')]);}return _0x264077['getTeams'](_0x5a30c5);}})[_0x9233('0x16')](function(_0x446e92){if(_0x446e92){return _0x446e92?{'count':_0x3d9098,'rows':_0x446e92}:null;}})[_0x9233('0x16')](respondWithResult(_0x1f401d,null))['catch'](handleError(_0x1f401d,null));};exports[_0x9233('0x56')]=function(_0x4558e3,_0x241705){var _0x2dcdb2=_0x4558e3[_0x9233('0x34')]['ids'];return db[_0x9233('0x54')][_0x9233('0x4b')]({'where':{'id':_0x2dcdb2},'attributes':['id'],'include':[{'model':db[_0x9233('0x57')],'as':'Agents','attributes':['id',_0x9233('0x1d'),'online','voicePause',_0x9233('0x58')],'raw':!![]}]})['then'](function(_0x2af982){if(_0x2af982){var _0x4ea715=_[_0x9233('0x59')](_0x2af982,function(_0x24b8f7){var _0x32a639=_0x24b8f7[_0x9233('0x17')]({'plain':!![]});return _0x32a639['Agents'];});return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x4558e3['params']['id']}})['then'](function(_0x2d2028){return db[_0x9233('0x5a')][_0x9233('0x5b')](function(_0x14faf6){return _0x2d2028[_0x9233('0x56')](_0x2dcdb2,{'transaction':_0x14faf6})[_0x9233('0x16')](function(){return BPromise[_0x9233('0x5c')](_0x4ea715,function(_0x1c8f80){return db[_0x9233('0x41')][_0x9233('0x5d')]({'where':{'UserId':_0x1c8f80['id'],'ChatQueueId':_0x4558e3['params']['id']},'transaction':_0x14faf6});});})['then'](function(){_0x4ea715[_0x9233('0x5e')](function(_0x5be4a4){socket['emit'](_0x9233('0x5f'),{'UserId':_0x5be4a4['id'],'ChatQueueId':_0x2d2028['id']});});});});});}})['then'](respondWithStatusCode(_0x241705,null))[_0x9233('0x28')](handleError(_0x241705,null));};exports['removeTeams']=function(_0x4467b2,_0x2f8b82){return db[_0x9233('0x54')][_0x9233('0x4b')]({'where':{'id':_0x4467b2['query'][_0x9233('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9233('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f8b82,null))[_0x9233('0x16')](function(_0x3d2243){var _0x678e2f=_[_0x9233('0x48')](_0x3d2243,'id');var _0x2c10b9=[];var _0x32564f=[];var _0x1f777a=squel[_0x9233('0x62')]();_0x1f777a[_0x9233('0x63')](_0x9233('0x64'))[_0x9233('0x65')](_0x9233('0x66'),'tq')[_0x9233('0x67')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9233('0x45')](_0x9233('0x68'),_0x4467b2['params']['id']);for(var _0x15d1ac=0x0;_0x15d1ac<_0x3d2243['length'];_0x15d1ac+=0x1){let _0x359843=_0x3d2243[_0x15d1ac];for(var _0x4b1d7d=0x0;_0x4b1d7d<_0x359843[_0x9233('0x61')]['length'];_0x4b1d7d+=0x1){let _0x28bc94=_0x359843[_0x9233('0x61')][_0x4b1d7d];var _0x383096=_0x1f777a[_0x9233('0x69')]();_0x383096['where'](_0x9233('0x6a'),_0x28bc94['id']);_0x32564f['push'](db[_0x9233('0x5a')][_0x9233('0x26')](_0x383096[_0x9233('0x6b')](),{'type':db['sequelize'][_0x9233('0x6c')]['SELECT']})[_0x9233('0x16')](function(_0x3151d4){if(_0x3151d4[_0x9233('0x31')]===0x1){return _0x28bc94['id'];}else{var _0x489dad=_[_0x9233('0x6d')](_[_0x9233('0x48')](_0x3151d4,_0x9233('0x6e')),function(_0x5e04be){return _['includes'](_0x678e2f,_0x5e04be);});if(_0x489dad){return _0x28bc94['id'];}}}));}}return BPromise['all'](_0x32564f)[_0x9233('0x16')](function(_0x3107a1){_0x2c10b9=_(_0x2c10b9)[_0x9233('0x6f')](_0x3107a1)[_0x9233('0x70')]()['value']();return db['ChatQueue'][_0x9233('0x39')]({'where':{'id':_0x4467b2[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](function(_0xb0a3ea){return db['sequelize'][_0x9233('0x5b')](function(_0x289434){return _0xb0a3ea[_0x9233('0x71')](_0x4467b2[_0x9233('0x26')]['ids'],{'transaction':_0x289434})['then'](function(){if(!_[_0x9233('0x72')](_0x2c10b9)){return _0xb0a3ea[_0x9233('0x73')](_0x2c10b9,{'transaction':_0x289434});}})[_0x9233('0x16')](function(){_0x2c10b9[_0x9233('0x5e')](function(_0x6f254a){socket[_0x9233('0x74')](_0x9233('0x75'),{'UserId':_0x6f254a,'ChatQueueId':_0xb0a3ea['id']});});});});});});})[_0x9233('0x16')](respondWithStatusCode(_0x2f8b82,null))[_0x9233('0x28')](handleError(_0x2f8b82,null));};exports['addAgents']=function(_0x249a44,_0x232855){return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x249a44[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x232855,null))[_0x9233('0x16')](function(_0x4c0230){if(_0x4c0230){return _0x4c0230[_0x9233('0x76')](_0x249a44[_0x9233('0x34')]['ids'],_['omit'](_0x249a44[_0x9233('0x34')],['ids','id'])||{})[_0x9233('0x77')](function(_0x28409e){for(var _0x5f3a33=0x0;_0x5f3a33<_0x249a44['body'][_0x9233('0x60')][_0x9233('0x31')];_0x5f3a33+=0x1){socket[_0x9233('0x74')](_0x9233('0x5f'),{'UserId':Number(_0x249a44[_0x9233('0x34')][_0x9233('0x60')][_0x5f3a33]),'ChatQueueId':Number(_0x249a44[_0x9233('0x2a')]['id'])});}return _0x28409e;});}})['then'](respondWithResult(_0x232855,null))[_0x9233('0x28')](handleError(_0x232855,null));};exports['removeAgents']=function(_0x471cc9,_0x522bf1){return db[_0x9233('0x24')][_0x9233('0x39')]({'where':{'id':_0x471cc9[_0x9233('0x2a')]['id']}})[_0x9233('0x16')](handleEntityNotFound(_0x522bf1,null))['then'](function(_0x21bbdf){if(_0x21bbdf){return _0x21bbdf[_0x9233('0x73')](_0x471cc9[_0x9233('0x26')]['ids'])['then'](function(){if(_[_0x9233('0x78')](_0x471cc9[_0x9233('0x26')][_0x9233('0x60')])){for(var _0x3a5c18=0x0;_0x3a5c18<_0x471cc9[_0x9233('0x26')]['ids'][_0x9233('0x31')];_0x3a5c18+=0x1){socket[_0x9233('0x74')](_0x9233('0x75'),{'UserId':Number(_0x471cc9[_0x9233('0x26')]['ids'][_0x3a5c18]),'ChatQueueId':Number(_0x471cc9[_0x9233('0x2a')]['id'])});}}else{socket['emit'](_0x9233('0x75'),{'UserId':Number(_0x471cc9[_0x9233('0x26')][_0x9233('0x60')]),'ChatQueueId':Number(_0x471cc9['params']['id'])});}});}})[_0x9233('0x16')](respondWithStatusCode(_0x522bf1,null))[_0x9233('0x28')](handleError(_0x522bf1,null));};exports[_0x9233('0x79')]=function(_0xd34a22,_0x48b4cd){var _0x44040b={};var _0x6dbf7a={};var _0x535506;var _0x16e97e;return db[_0x9233('0x24')]['findOne']({'where':{'id':_0xd34a22[_0x9233('0x2a')]['id']}})['then'](handleEntityNotFound(_0x48b4cd,null))[_0x9233('0x16')](function(_0x1ec6d6){if(_0x1ec6d6){_0x535506=_0x1ec6d6;_0x6dbf7a[_0x9233('0x2b')]=_['keys'](db[_0x9233('0x57')][_0x9233('0x20')]);_0x6dbf7a[_0x9233('0x26')]=_[_0x9233('0x2c')](_0xd34a22[_0x9233('0x26')]);_0x6dbf7a[_0x9233('0x2d')]=_[_0x9233('0x2e')](_0x6dbf7a[_0x9233('0x2b')],_0x6dbf7a[_0x9233('0x26')]);_0x44040b['attributes']=_[_0x9233('0x2e')](_0x6dbf7a[_0x9233('0x2b')],qs[_0x9233('0x2f')](_0xd34a22['query']['fields']));_0x44040b[_0x9233('0x30')]=_0x44040b[_0x9233('0x30')][_0x9233('0x31')]?_0x44040b[_0x9233('0x30')]:_0x6dbf7a[_0x9233('0x2b')];_0x44040b[_0x9233('0x43')]=qs[_0x9233('0x44')](_0xd34a22[_0x9233('0x26')]['sort']);_0x44040b[_0x9233('0x45')]=qs[_0x9233('0x2d')](_['pick'](_0xd34a22['query'],_0x6dbf7a[_0x9233('0x2d')]));if(_0xd34a22[_0x9233('0x26')][_0x9233('0x49')]){_0x44040b[_0x9233('0x45')]=_[_0x9233('0x32')](_0x44040b[_0x9233('0x45')],{'$or':_['map'](_0x44040b[_0x9233('0x30')],function(_0x2973a3){var _0x592a07={};_0x592a07[_0x2973a3]={'$like':'%'+_0xd34a22[_0x9233('0x26')][_0x9233('0x49')]+'%'};return _0x592a07;})});}_0x44040b=_[_0x9233('0x32')]({},_0x44040b,_0xd34a22[_0x9233('0x4a')]);return _0x535506[_0x9233('0x79')](_0x44040b);}})[_0x9233('0x16')](function(_0x57c43d){if(_0x57c43d){_0x16e97e=_0x57c43d[_0x9233('0x31')];if(!_0xd34a22['query']['hasOwnProperty'](_0x9233('0x42'))){_0x44040b[_0x9233('0x12')]=qs['limit'](_0xd34a22[_0x9233('0x26')]['limit']);_0x44040b[_0x9233('0xf')]=qs[_0x9233('0xf')](_0xd34a22[_0x9233('0x26')]['offset']);}return _0x535506[_0x9233('0x79')](_0x44040b);}})[_0x9233('0x16')](function(_0x41698b){if(_0x41698b){return _0x41698b?{'count':_0x16e97e,'rows':_0x41698b}:null;}})['then'](respondWithResult(_0x48b4cd,null))[_0x9233('0x28')](handleError(_0x48b4cd,null));};
\ No newline at end of file
+var _0x88bb=['from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','util','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','then','ChatQueues','UserProfileResource','destroy','error','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','getOptions','where','include','query','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','sort','ChatQueueId','filter','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','rows','format','SIP','getTeams','Team','order','pick','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select'];(function(_0x29e32c,_0x68fe8e){var _0x2ce2ae=function(_0x4e9190){while(--_0x4e9190){_0x29e32c['push'](_0x29e32c['shift']());}};_0x2ce2ae(++_0x68fe8e);}(_0x88bb,0x109));var _0xb88b=function(_0x55ec85,_0x3cc9ed){_0x55ec85=_0x55ec85-0x0;var _0xdf9b38=_0x88bb[_0x55ec85];return _0xdf9b38;};'use strict';var BPromise=require('bluebird');var util=require(_0xb88b('0x0'));var _=require('lodash');var squel=require(_0xb88b('0x1'));var Redis=require('ioredis');var qs=require(_0xb88b('0x2'));var logger=require(_0xb88b('0x3'))(_0xb88b('0x4'));var config=require(_0xb88b('0x5'));var db=require(_0xb88b('0x6'))['db'];config[_0xb88b('0x7')]=_[_0xb88b('0x8')](config['redis'],{'host':_0xb88b('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x482bb9,_0x22eb73){_0x22eb73=_0x22eb73||0xcc;return function(_0x1cf797){if(_0x1cf797){return _0x482bb9[_0xb88b('0xa')](_0x22eb73);}return _0x482bb9['status'](_0x22eb73)[_0xb88b('0xb')]();};}function respondWithResult(_0x298f3a,_0x2b4aa4){_0x2b4aa4=_0x2b4aa4||0xc8;return function(_0x3cc95b){if(_0x3cc95b){return _0x298f3a[_0xb88b('0xc')](_0x2b4aa4)[_0xb88b('0xd')](_0x3cc95b);}};}function respondWithFilteredResult(_0x57fb79,_0x4182aa){return function(_0x369a02){if(_0x369a02){var _0x1ea354=typeof _0x4182aa['offset']===_0xb88b('0xe')&&typeof _0x4182aa[_0xb88b('0xf')]===_0xb88b('0xe');var _0x158f85=_0x369a02[_0xb88b('0x10')];var _0x5dfa9e=_0x1ea354?0x0:_0x4182aa[_0xb88b('0x11')];var _0x4a0126=_0x1ea354?_0x369a02['count']:_0x4182aa[_0xb88b('0x11')]+_0x4182aa[_0xb88b('0xf')];var _0x4ff402;if(_0x4a0126>=_0x158f85){_0x4a0126=_0x158f85;_0x4ff402=0xc8;}else{_0x4ff402=0xce;}_0x57fb79[_0xb88b('0xc')](_0x4ff402);return _0x57fb79[_0xb88b('0x12')](_0xb88b('0x13'),_0x5dfa9e+'-'+_0x4a0126+'/'+_0x158f85)[_0xb88b('0xd')](_0x369a02);}return null;};}function saveUpdates(_0x37e8b7){return function(_0x316a7a){if(_0x316a7a){return _0x316a7a['update'](_0x37e8b7)[_0xb88b('0x14')](function(_0x32baa2){return _0x32baa2;});}return null;};}function removeEntity(_0xe214d2){return function(_0xb45be0){if(_0xb45be0){return _0xb45be0['destroy']()['then'](function(){var _0x8eb8e1=_0xb45be0['get']({'plain':!![]});var _0x3cfac1=_0xb88b('0x15');return db[_0xb88b('0x16')][_0xb88b('0x17')]({'where':{'type':_0x3cfac1,'resourceId':_0x8eb8e1['id']}})[_0xb88b('0x14')](function(){return _0xb45be0;});})[_0xb88b('0x14')](function(){_0xe214d2[_0xb88b('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea3a9){return function(_0xdf5afb){if(!_0xdf5afb){_0x3ea3a9[_0xb88b('0xa')](0x194);}return _0xdf5afb;};}function handleError(_0x2b6a84,_0x47b28b){_0x47b28b=_0x47b28b||0x1f4;return function(_0x59f77d){logger[_0xb88b('0x18')](_0x59f77d[_0xb88b('0x19')]);if(_0x59f77d['name']){delete _0x59f77d[_0xb88b('0x1a')];}_0x2b6a84[_0xb88b('0xc')](_0x47b28b)[_0xb88b('0x1b')](_0x59f77d);};}exports['index']=function(_0xbd503b,_0x2f9b8d){var _0x182450={};var _0x523252={'count':0x0,'rows':[]};var _0x16aff4=_[_0xb88b('0x1c')](db[_0xb88b('0x1d')][_0xb88b('0x1e')],function(_0x2e06f1){return{'name':_0x2e06f1[_0xb88b('0x1f')],'type':_0x2e06f1[_0xb88b('0x20')]['key']};});_0x182450=qs[_0xb88b('0x21')](_0x16aff4,_0xbd503b);var _0x2ffcd5={'where':_0x182450[_0xb88b('0x22')]};return db[_0xb88b('0x1d')][_0xb88b('0x10')](_0x2ffcd5)[_0xb88b('0x14')](function(_0x14f603){_0x523252[_0xb88b('0x10')]=_0x14f603;_0x182450[_0xb88b('0x23')]=qs['include'](_0xbd503b[_0xb88b('0x24')]);return db['ChatQueue']['findAll'](_0x182450);})[_0xb88b('0x14')](function(_0x505a12){_0x523252['rows']=_0x505a12;return _0x523252;})['then'](respondWithFilteredResult(_0x2f9b8d,_0x182450))[_0xb88b('0x25')](handleError(_0x2f9b8d,null));};exports['show']=function(_0x44e08d,_0x5e6141){var _0x27eb12={'raw':!![],'where':{'id':_0x44e08d[_0xb88b('0x26')]['id']}},_0x2fb1d5={};_0x2fb1d5[_0xb88b('0x27')]=_[_0xb88b('0x28')](db[_0xb88b('0x1d')]['rawAttributes']);_0x2fb1d5['query']=_[_0xb88b('0x28')](_0x44e08d['query']);_0x2fb1d5[_0xb88b('0x29')]=_[_0xb88b('0x2a')](_0x2fb1d5[_0xb88b('0x27')],_0x2fb1d5[_0xb88b('0x24')]);_0x27eb12[_0xb88b('0x2b')]=_['intersection'](_0x2fb1d5[_0xb88b('0x27')],qs[_0xb88b('0x2c')](_0x44e08d[_0xb88b('0x24')][_0xb88b('0x2c')]));_0x27eb12[_0xb88b('0x2b')]=_0x27eb12[_0xb88b('0x2b')][_0xb88b('0x2d')]?_0x27eb12[_0xb88b('0x2b')]:_0x2fb1d5[_0xb88b('0x27')];if(_0x44e08d[_0xb88b('0x24')][_0xb88b('0x2e')]){_0x27eb12[_0xb88b('0x23')]=[{'all':!![]}];}_0x27eb12=_[_0xb88b('0x2f')]({},_0x27eb12,_0x44e08d[_0xb88b('0x30')]);return db[_0xb88b('0x1d')]['find'](_0x27eb12)[_0xb88b('0x14')](handleEntityNotFound(_0x5e6141,null))[_0xb88b('0x14')](respondWithResult(_0x5e6141,null))[_0xb88b('0x25')](handleError(_0x5e6141,null));};exports[_0xb88b('0x31')]=function(_0x20df2a,_0x56d8a9){return db[_0xb88b('0x1d')]['create'](_0x20df2a[_0xb88b('0x32')],{})[_0xb88b('0x14')](function(_0x21c726){var _0x237163=_0x20df2a['user'][_0xb88b('0x33')]({'plain':!![]});if(!_0x237163)throw new Error(_0xb88b('0x34'));if(_0x237163[_0xb88b('0x35')]===_0xb88b('0x36')){var _0x4078ed=_0x21c726[_0xb88b('0x33')]({'plain':!![]});var _0x2833a=_0xb88b('0x15');return db[_0xb88b('0x37')][_0xb88b('0x38')]({'where':{'name':_0x2833a,'userProfileId':_0x237163[_0xb88b('0x39')]},'raw':!![]})[_0xb88b('0x14')](function(_0x502f63){if(_0x502f63&&_0x502f63[_0xb88b('0x3a')]===0x0){return db[_0xb88b('0x16')][_0xb88b('0x31')]({'name':_0x4078ed['name'],'resourceId':_0x4078ed['id'],'type':_0x502f63[_0xb88b('0x1a')],'sectionId':_0x502f63['id']},{})[_0xb88b('0x14')](function(){return _0x21c726;});}else{return _0x21c726;}})['catch'](function(_0x55b1ec){logger[_0xb88b('0x18')](_0xb88b('0x3b'),_0x55b1ec);throw _0x55b1ec;});}return _0x21c726;})['then'](respondWithResult(_0x56d8a9,0xc9))['catch'](handleError(_0x56d8a9,null));};exports[_0xb88b('0x3c')]=function(_0x24bed2,_0x4ce61a){if(_0x24bed2['body']['id']){delete _0x24bed2['body']['id'];}return db[_0xb88b('0x1d')][_0xb88b('0x38')]({'where':{'id':_0x24bed2[_0xb88b('0x26')]['id']}})[_0xb88b('0x14')](handleEntityNotFound(_0x4ce61a,null))['then'](saveUpdates(_0x24bed2[_0xb88b('0x32')],null))[_0xb88b('0x14')](respondWithResult(_0x4ce61a,null))[_0xb88b('0x25')](handleError(_0x4ce61a,null));};exports[_0xb88b('0x17')]=function(_0x39fbda,_0x3720cf){return db[_0xb88b('0x1d')][_0xb88b('0x38')]({'where':{'id':_0x39fbda[_0xb88b('0x26')]['id']}})['then'](handleEntityNotFound(_0x3720cf,null))[_0xb88b('0x14')](removeEntity(_0x3720cf,null))[_0xb88b('0x25')](handleError(_0x3720cf,null));};exports['describe']=function(_0x30ba0f,_0x35a44d){return db[_0xb88b('0x1d')][_0xb88b('0x3d')]()[_0xb88b('0x14')](respondWithResult(_0x35a44d,null))[_0xb88b('0x25')](handleError(_0x35a44d,null));};exports[_0xb88b('0x3e')]=function(_0x4b693a,_0x28a7ef){var _0x2e520b={'raw':!![],'where':{}},_0x185c30={},_0x58caaa;return db[_0xb88b('0x1d')][_0xb88b('0x3f')]({'where':{'id':_0x4b693a['params']['id']}})[_0xb88b('0x14')](handleEntityNotFound(_0x28a7ef,null))[_0xb88b('0x14')](function(_0x56651d){if(_0x56651d){_0x58caaa=_0x56651d[_0xb88b('0x33')]({'plain':!![]});_0x185c30[_0xb88b('0x27')]=_[_0xb88b('0x28')](db[_0xb88b('0x40')][_0xb88b('0x1e')]);_0x185c30['query']=_['keys'](_0x4b693a[_0xb88b('0x24')]);_0x185c30['filters']=_[_0xb88b('0x2a')](_0x185c30[_0xb88b('0x27')],_0x185c30[_0xb88b('0x24')]);_0x2e520b[_0xb88b('0x2b')]=_['intersection'](_0x185c30['model'],qs[_0xb88b('0x2c')](_0x4b693a[_0xb88b('0x24')][_0xb88b('0x2c')]));_0x2e520b['attributes']=_0x2e520b['attributes']['length']?_0x2e520b[_0xb88b('0x2b')]:_0x185c30[_0xb88b('0x27')];if(!_0x4b693a[_0xb88b('0x24')][_0xb88b('0x41')](_0xb88b('0x42'))){_0x2e520b['limit']=qs[_0xb88b('0xf')](_0x4b693a['query'][_0xb88b('0xf')]);_0x2e520b['offset']=qs[_0xb88b('0x11')](_0x4b693a['query']['offset']);}_0x2e520b['order']=qs[_0xb88b('0x43')](_0x4b693a['query'][_0xb88b('0x43')]);_0x2e520b[_0xb88b('0x22')]=qs[_0xb88b('0x29')](_['pick'](_0x4b693a[_0xb88b('0x24')],_0x185c30['filters']));_0x2e520b[_0xb88b('0x22')][_0xb88b('0x44')]=_0x56651d['id'];if(_0x4b693a[_0xb88b('0x24')][_0xb88b('0x45')]){_0x2e520b['where']=_['merge'](_0x2e520b[_0xb88b('0x22')],{'$or':_['map'](_0x2e520b[_0xb88b('0x2b')],function(_0x5e76ce){var _0x3c5efa={};_0x3c5efa[_0x5e76ce]={'$like':'%'+_0x4b693a[_0xb88b('0x24')][_0xb88b('0x45')]+'%'};return _0x3c5efa;})});}_0x2e520b=_['merge']({},_0x2e520b,_0x4b693a[_0xb88b('0x30')]);return db[_0xb88b('0x40')][_0xb88b('0x46')](_0x2e520b);}})[_0xb88b('0x14')](function(_0x452b6b){if(_0x452b6b){return db[_0xb88b('0x47')]['findAndCountAll']({'where':{'id':_[_0xb88b('0x1c')](_0x452b6b,_0xb88b('0x48')),'role':_0xb88b('0x49')},'attributes':['id','name',_0xb88b('0x4a'),_0xb88b('0x4b'),_0xb88b('0x4c')]});}})['then'](function(_0x381ec9){if(_0x381ec9){return{'count':_0x381ec9[_0xb88b('0x10')],'rows':_[_0xb88b('0x1c')](_0x381ec9[_0xb88b('0x4d')],function(_0x4c4401){return{'membername':_0x4c4401[_0xb88b('0x1a')],'UserId':_0x4c4401['id'],'queue_name':_0x58caaa[_0xb88b('0x1a')],'ChatQueueId':_0x58caaa['id'],'interface':util[_0xb88b('0x4e')]('%s/%s',_0xb88b('0x4f'),_0x4c4401[_0xb88b('0x1a')]),'penalty':0x0,'paused':_0x4c4401[_0xb88b('0x4a')],'createdAt':_0x4c4401['createdAt'],'updatedAt':_0x4c4401[_0xb88b('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb88b('0x14')](respondWithFilteredResult(_0x28a7ef,_0x2e520b))['catch'](handleError(_0x28a7ef,null));};exports[_0xb88b('0x50')]=function(_0x21e209,_0x17cea5){var _0x1a75f3={};var _0x11fc41={};var _0x2ec9f9;var _0x52ef4b;return db[_0xb88b('0x1d')]['findOne']({'where':{'id':_0x21e209[_0xb88b('0x26')]['id']}})['then'](handleEntityNotFound(_0x17cea5,null))[_0xb88b('0x14')](function(_0xa27099){if(_0xa27099){_0x2ec9f9=_0xa27099;_0x11fc41[_0xb88b('0x27')]=_[_0xb88b('0x28')](db[_0xb88b('0x51')]['rawAttributes']);_0x11fc41[_0xb88b('0x24')]=_[_0xb88b('0x28')](_0x21e209[_0xb88b('0x24')]);_0x11fc41[_0xb88b('0x29')]=_[_0xb88b('0x2a')](_0x11fc41[_0xb88b('0x27')],_0x11fc41[_0xb88b('0x24')]);_0x1a75f3['attributes']=_[_0xb88b('0x2a')](_0x11fc41['model'],qs[_0xb88b('0x2c')](_0x21e209['query'][_0xb88b('0x2c')]));_0x1a75f3[_0xb88b('0x2b')]=_0x1a75f3[_0xb88b('0x2b')]['length']?_0x1a75f3[_0xb88b('0x2b')]:_0x11fc41[_0xb88b('0x27')];_0x1a75f3[_0xb88b('0x52')]=qs[_0xb88b('0x43')](_0x21e209[_0xb88b('0x24')][_0xb88b('0x43')]);_0x1a75f3[_0xb88b('0x22')]=qs['filters'](_[_0xb88b('0x53')](_0x21e209[_0xb88b('0x24')],_0x11fc41[_0xb88b('0x29')]));if(_0x21e209['query']['filter']){_0x1a75f3[_0xb88b('0x22')]=_[_0xb88b('0x2f')](_0x1a75f3[_0xb88b('0x22')],{'$or':_[_0xb88b('0x1c')](_0x1a75f3[_0xb88b('0x2b')],function(_0x48f3ad){var _0x101798={};_0x101798[_0x48f3ad]={'$like':'%'+_0x21e209[_0xb88b('0x24')]['filter']+'%'};return _0x101798;})});}_0x1a75f3=_[_0xb88b('0x2f')]({},_0x1a75f3,_0x21e209[_0xb88b('0x30')]);return _0x2ec9f9[_0xb88b('0x50')](_0x1a75f3);}})[_0xb88b('0x14')](function(_0x7bff22){if(_0x7bff22){_0x52ef4b=_0x7bff22['length'];if(!_0x21e209['query'][_0xb88b('0x41')]('nolimit')){_0x1a75f3['limit']=qs[_0xb88b('0xf')](_0x21e209[_0xb88b('0x24')]['limit']);_0x1a75f3[_0xb88b('0x11')]=qs[_0xb88b('0x11')](_0x21e209[_0xb88b('0x24')][_0xb88b('0x11')]);}return _0x2ec9f9[_0xb88b('0x50')](_0x1a75f3);}})[_0xb88b('0x14')](function(_0x537ada){if(_0x537ada){return _0x537ada?{'count':_0x52ef4b,'rows':_0x537ada}:null;}})[_0xb88b('0x14')](respondWithResult(_0x17cea5,null))[_0xb88b('0x25')](handleError(_0x17cea5,null));};exports['addTeams']=function(_0x7dfbfe,_0x2b9e6b){var _0x1260c7=_0x7dfbfe[_0xb88b('0x32')][_0xb88b('0x54')];return db[_0xb88b('0x51')][_0xb88b('0x46')]({'where':{'id':_0x1260c7},'attributes':['id'],'include':[{'model':db[_0xb88b('0x47')],'as':_0xb88b('0x55'),'attributes':['id',_0xb88b('0x1a'),'online',_0xb88b('0x56'),_0xb88b('0x57')],'raw':!![]}]})[_0xb88b('0x14')](function(_0x373bb8){if(_0x373bb8){var _0x558e2d=_[_0xb88b('0x58')](_0x373bb8,function(_0xa04b2b){var _0x166cf5=_0xa04b2b[_0xb88b('0x33')]({'plain':!![]});return _0x166cf5[_0xb88b('0x55')];});return db[_0xb88b('0x1d')]['find']({'where':{'id':_0x7dfbfe[_0xb88b('0x26')]['id']}})['then'](function(_0x40899c){return db[_0xb88b('0x59')][_0xb88b('0x5a')](function(_0x2ba189){return _0x40899c[_0xb88b('0x5b')](_0x1260c7,{'transaction':_0x2ba189})[_0xb88b('0x14')](function(){return BPromise[_0xb88b('0x5c')](_0x558e2d,function(_0x20d826){return db[_0xb88b('0x40')][_0xb88b('0x5d')]({'where':{'UserId':_0x20d826['id'],'ChatQueueId':_0x7dfbfe[_0xb88b('0x26')]['id']},'transaction':_0x2ba189});});})[_0xb88b('0x14')](function(){_0x558e2d[_0xb88b('0x5e')](function(_0x10f3cc){socket[_0xb88b('0x5f')]('userChatQueue:save',{'UserId':_0x10f3cc['id'],'ChatQueueId':_0x40899c['id']});});});});});}})[_0xb88b('0x14')](respondWithStatusCode(_0x2b9e6b,null))[_0xb88b('0x25')](handleError(_0x2b9e6b,null));};exports[_0xb88b('0x60')]=function(_0x157d8c,_0x3751ce){return db['Team'][_0xb88b('0x46')]({'where':{'id':_0x157d8c[_0xb88b('0x24')][_0xb88b('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb88b('0x55'),'attributes':['id'],'raw':!![]}]})[_0xb88b('0x14')](handleEntityNotFound(_0x3751ce,null))[_0xb88b('0x14')](function(_0x1f75d9){var _0x12664a=_[_0xb88b('0x1c')](_0x1f75d9,'id');var _0x7c3782=[];var _0x5ec1db=[];var _0x1d4e51=squel[_0xb88b('0x61')]();_0x1d4e51['field']('tq.TeamId')[_0xb88b('0x62')]('team_has_chat_queues','tq')[_0xb88b('0x63')]('user_has_teams','ut',_0xb88b('0x64'))[_0xb88b('0x22')](_0xb88b('0x65'),_0x157d8c[_0xb88b('0x26')]['id']);for(var _0x5a8c9b=0x0;_0x5a8c9b<_0x1f75d9[_0xb88b('0x2d')];_0x5a8c9b+=0x1){let _0x54fab0=_0x1f75d9[_0x5a8c9b];for(var _0x90a1ab=0x0;_0x90a1ab<_0x54fab0[_0xb88b('0x55')]['length'];_0x90a1ab+=0x1){let _0x49d3a1=_0x54fab0['Agents'][_0x90a1ab];var _0x1a21fb=_0x1d4e51['clone']();_0x1a21fb['where'](_0xb88b('0x66'),_0x49d3a1['id']);_0x5ec1db[_0xb88b('0x67')](db['sequelize'][_0xb88b('0x24')](_0x1a21fb[_0xb88b('0x68')](),{'type':db[_0xb88b('0x59')][_0xb88b('0x69')]['SELECT']})['then'](function(_0x2d0046){if(_0x2d0046[_0xb88b('0x2d')]===0x1){return _0x49d3a1['id'];}else{var _0x557243=_[_0xb88b('0x6a')](_[_0xb88b('0x1c')](_0x2d0046,_0xb88b('0x6b')),function(_0x3f835a){return _[_0xb88b('0x6c')](_0x12664a,_0x3f835a);});if(_0x557243){return _0x49d3a1['id'];}}}));}}return BPromise[_0xb88b('0x6d')](_0x5ec1db)[_0xb88b('0x14')](function(_0x230745){_0x7c3782=_(_0x7c3782)[_0xb88b('0x6e')](_0x230745)['compact']()[_0xb88b('0x6f')]();return db[_0xb88b('0x1d')]['find']({'where':{'id':_0x157d8c[_0xb88b('0x26')]['id']}})[_0xb88b('0x14')](function(_0x4114eb){return db[_0xb88b('0x59')][_0xb88b('0x5a')](function(_0x2f8cc0){return _0x4114eb[_0xb88b('0x60')](_0x157d8c['query']['ids'],{'transaction':_0x2f8cc0})['then'](function(){if(!_[_0xb88b('0x70')](_0x7c3782)){return _0x4114eb[_0xb88b('0x71')](_0x7c3782,{'transaction':_0x2f8cc0});}})[_0xb88b('0x14')](function(){_0x7c3782[_0xb88b('0x5e')](function(_0x80b4b3){socket[_0xb88b('0x5f')](_0xb88b('0x72'),{'UserId':_0x80b4b3,'ChatQueueId':_0x4114eb['id']});});});});});});})[_0xb88b('0x14')](respondWithStatusCode(_0x3751ce,null))[_0xb88b('0x25')](handleError(_0x3751ce,null));};exports[_0xb88b('0x73')]=function(_0x22f5a3,_0x2cc510){return db['ChatQueue'][_0xb88b('0x38')]({'where':{'id':_0x22f5a3[_0xb88b('0x26')]['id']}})['then'](handleEntityNotFound(_0x2cc510,null))[_0xb88b('0x14')](function(_0x46e798){if(_0x46e798){return _0x46e798['addAgents'](_0x22f5a3['body'][_0xb88b('0x54')],_[_0xb88b('0x74')](_0x22f5a3[_0xb88b('0x32')],['ids','id'])||{})[_0xb88b('0x75')](function(_0x2dd4d4){for(var _0x3b5bac=0x0;_0x3b5bac<_0x22f5a3['body'][_0xb88b('0x54')][_0xb88b('0x2d')];_0x3b5bac+=0x1){socket[_0xb88b('0x5f')](_0xb88b('0x76'),{'UserId':Number(_0x22f5a3['body'][_0xb88b('0x54')][_0x3b5bac]),'ChatQueueId':Number(_0x22f5a3[_0xb88b('0x26')]['id'])});}return _0x2dd4d4;});}})[_0xb88b('0x14')](respondWithResult(_0x2cc510,null))['catch'](handleError(_0x2cc510,null));};exports[_0xb88b('0x71')]=function(_0x1d183f,_0xecaadc){return db[_0xb88b('0x1d')][_0xb88b('0x38')]({'where':{'id':_0x1d183f[_0xb88b('0x26')]['id']}})[_0xb88b('0x14')](handleEntityNotFound(_0xecaadc,null))[_0xb88b('0x14')](function(_0x3b97dd){if(_0x3b97dd){return _0x3b97dd[_0xb88b('0x71')](_0x1d183f[_0xb88b('0x24')][_0xb88b('0x54')])['then'](function(){if(_[_0xb88b('0x77')](_0x1d183f[_0xb88b('0x24')][_0xb88b('0x54')])){for(var _0x3af9f3=0x0;_0x3af9f3<_0x1d183f[_0xb88b('0x24')][_0xb88b('0x54')][_0xb88b('0x2d')];_0x3af9f3+=0x1){socket[_0xb88b('0x5f')](_0xb88b('0x72'),{'UserId':Number(_0x1d183f[_0xb88b('0x24')][_0xb88b('0x54')][_0x3af9f3]),'ChatQueueId':Number(_0x1d183f[_0xb88b('0x26')]['id'])});}}else{socket[_0xb88b('0x5f')](_0xb88b('0x72'),{'UserId':Number(_0x1d183f['query'][_0xb88b('0x54')]),'ChatQueueId':Number(_0x1d183f[_0xb88b('0x26')]['id'])});}});}})['then'](respondWithStatusCode(_0xecaadc,null))[_0xb88b('0x25')](handleError(_0xecaadc,null));};exports[_0xb88b('0x78')]=function(_0x58ecf0,_0x31df5f){var _0x386003={};var _0x40746f={};var _0x1ebe94;var _0x348be1;return db[_0xb88b('0x1d')][_0xb88b('0x3f')]({'where':{'id':_0x58ecf0['params']['id']}})[_0xb88b('0x14')](handleEntityNotFound(_0x31df5f,null))['then'](function(_0xd9cd9a){if(_0xd9cd9a){_0x1ebe94=_0xd9cd9a;_0x40746f[_0xb88b('0x27')]=_[_0xb88b('0x28')](db[_0xb88b('0x47')]['rawAttributes']);_0x40746f[_0xb88b('0x24')]=_[_0xb88b('0x28')](_0x58ecf0[_0xb88b('0x24')]);_0x40746f[_0xb88b('0x29')]=_[_0xb88b('0x2a')](_0x40746f[_0xb88b('0x27')],_0x40746f[_0xb88b('0x24')]);_0x386003[_0xb88b('0x2b')]=_[_0xb88b('0x2a')](_0x40746f['model'],qs['fields'](_0x58ecf0[_0xb88b('0x24')][_0xb88b('0x2c')]));_0x386003[_0xb88b('0x2b')]=_0x386003['attributes']['length']?_0x386003[_0xb88b('0x2b')]:_0x40746f[_0xb88b('0x27')];_0x386003[_0xb88b('0x52')]=qs[_0xb88b('0x43')](_0x58ecf0[_0xb88b('0x24')]['sort']);_0x386003['where']=qs[_0xb88b('0x29')](_['pick'](_0x58ecf0[_0xb88b('0x24')],_0x40746f[_0xb88b('0x29')]));if(_0x58ecf0[_0xb88b('0x24')][_0xb88b('0x45')]){_0x386003[_0xb88b('0x22')]=_[_0xb88b('0x2f')](_0x386003[_0xb88b('0x22')],{'$or':_[_0xb88b('0x1c')](_0x386003['attributes'],function(_0x4b1593){var _0x4f7255={};_0x4f7255[_0x4b1593]={'$like':'%'+_0x58ecf0[_0xb88b('0x24')][_0xb88b('0x45')]+'%'};return _0x4f7255;})});}_0x386003=_[_0xb88b('0x2f')]({},_0x386003,_0x58ecf0[_0xb88b('0x30')]);return _0x1ebe94['getAgents'](_0x386003);}})[_0xb88b('0x14')](function(_0x131765){if(_0x131765){_0x348be1=_0x131765[_0xb88b('0x2d')];if(!_0x58ecf0[_0xb88b('0x24')][_0xb88b('0x41')](_0xb88b('0x42'))){_0x386003['limit']=qs[_0xb88b('0xf')](_0x58ecf0[_0xb88b('0x24')]['limit']);_0x386003[_0xb88b('0x11')]=qs['offset'](_0x58ecf0['query']['offset']);}return _0x1ebe94[_0xb88b('0x78')](_0x386003);}})[_0xb88b('0x14')](function(_0x46fc49){if(_0x46fc49){return _0x46fc49?{'count':_0x348be1,'rows':_0x46fc49}:null;}})[_0xb88b('0x14')](respondWithResult(_0x31df5f,null))[_0xb88b('0x25')](handleError(_0x31df5f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index c90edaf..f417cb2 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 _0xa3e6=['hook','exports','events','ChatQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x3fc5e8,_0x5af2c0){var _0x280d80=function(_0x199afb){while(--_0x199afb){_0x3fc5e8['push'](_0x3fc5e8['shift']());}};_0x280d80(++_0x5af2c0);}(_0xa3e6,0x158));var _0x6a3e=function(_0xb881d2,_0x65f919){_0xb881d2=_0xb881d2-0x0;var _0x247b51=_0xa3e6[_0xb881d2];return _0x247b51;};'use strict';var EventEmitter=require(_0x6a3e('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x6a3e('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6a3e('0x2'),'afterUpdate':_0x6a3e('0x3'),'afterDestroy':_0x6a3e('0x4')};function emitEvent(_0x5d8e3d){return function(_0x2190fc,_0x35a2b6,_0x3da56a){ChatQueueEvents[_0x6a3e('0x5')](_0x5d8e3d+':'+_0x2190fc['id'],_0x2190fc);ChatQueueEvents[_0x6a3e('0x5')](_0x5d8e3d,_0x2190fc);_0x3da56a(null);};}for(var e in events){if(events[_0x6a3e('0x6')](e)){var event=events[e];ChatQueue[_0x6a3e('0x7')](e,emitEvent(event));}}module[_0x6a3e('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe35f=['events','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x512d4f,_0xb1b718){var _0x2dc3a0=function(_0xc1b01b){while(--_0xc1b01b){_0x512d4f['push'](_0x512d4f['shift']());}};_0x2dc3a0(++_0xb1b718);}(_0xe35f,0x140));var _0xfe35=function(_0x15b3a0,_0x38bbf0){_0x15b3a0=_0x15b3a0-0x0;var _0x4cfc99=_0xe35f[_0x15b3a0];return _0x4cfc99;};'use strict';var EventEmitter=require(_0xfe35('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xfe35('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xfe35('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe35('0x3'),'afterDestroy':_0xfe35('0x4')};function emitEvent(_0x288435){return function(_0x52b875,_0x566e85,_0x2f6401){ChatQueueEvents[_0xfe35('0x5')](_0x288435+':'+_0x52b875['id'],_0x52b875);ChatQueueEvents[_0xfe35('0x5')](_0x288435,_0x52b875);_0x2f6401(null);};}for(var e in events){if(events[_0xfe35('0x6')](e)){var event=events[e];ChatQueue[_0xfe35('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 7a1a208..6011096 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 _0x6ed5=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x3333de,_0x323c42){var _0x20da72=function(_0x151536){while(--_0x151536){_0x3333de['push'](_0x3333de['shift']());}};_0x20da72(++_0x323c42);}(_0x6ed5,0xb6));var _0x56ed=function(_0x4561f1,_0x171083){_0x4561f1=_0x4561f1-0x0;var _0x1ddfb4=_0x6ed5[_0x4561f1];return _0x1ddfb4;};'use strict';var _=require(_0x56ed('0x0'));var util=require(_0x56ed('0x1'));var logger=require(_0x56ed('0x2'))(_0x56ed('0x3'));var moment=require(_0x56ed('0x4'));var BPromise=require(_0x56ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x56ed('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x56ed('0x7')]=function(_0x442557,_0x2a763a){return _0x442557[_0x56ed('0x8')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x758f=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x758f,0x180));var _0xf758=function(_0x2f8000,_0x37c02b){_0x2f8000=_0x2f8000-0x0;var _0x25cfee=_0x758f[_0x2f8000];return _0x25cfee;};'use strict';var _=require(_0xf758('0x0'));var util=require(_0xf758('0x1'));var logger=require(_0xf758('0x2'))(_0xf758('0x3'));var moment=require(_0xf758('0x4'));var BPromise=require(_0xf758('0x5'));var rp=require(_0xf758('0x6'));var fs=require('fs');var path=require(_0xf758('0x7'));var rimraf=require(_0xf758('0x8'));var config=require(_0xf758('0x9'));var attributes=require(_0xf758('0xa'));module[_0xf758('0xb')]=function(_0x9ac051,_0x311ed0){return _0x9ac051[_0xf758('0xc')](_0xf758('0xd'),attributes,{'tableName':_0xf758('0xe'),'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 9d5d60a..852fb28 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 _0x332b=['options','where','attributes','include','map','model','then','debug','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetChatQueue','ChatQueue'];(function(_0x2969bc,_0x1d0a93){var _0x4790df=function(_0x4ec7ed){while(--_0x4ec7ed){_0x2969bc['push'](_0x2969bc['shift']());}};_0x4790df(++_0x1d0a93);}(_0x332b,0x1eb));var _0xb332=function(_0x37b003,_0x330b7a){_0x37b003=_0x37b003-0x0;var _0x1cb93a=_0x332b[_0x37b003];return _0x1cb93a;};'use strict';var _=require(_0xb332('0x0'));var util=require(_0xb332('0x1'));var moment=require(_0xb332('0x2'));var BPromise=require(_0xb332('0x3'));var rs=require(_0xb332('0x4'));var fs=require('fs');var Redis=require(_0xb332('0x5'));var db=require(_0xb332('0x6'))['db'];var utils=require(_0xb332('0x7'));var logger=require(_0xb332('0x8'))('rpc');var config=require(_0xb332('0x9'));var jayson=require(_0xb332('0xa'));var client=jayson[_0xb332('0xb')][_0xb332('0xc')]({'port':0x232a});config[_0xb332('0xd')]=_[_0xb332('0xe')](config[_0xb332('0xd')],{'host':_0xb332('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb332('0xd')]));require('./chatQueue.socket')[_0xb332('0x10')](socket);function respondWithRpcPromise(_0x3a8cc4,_0xf85dc6,_0x3c2721){return new BPromise(function(_0x596db2,_0x55d578){return client['request'](_0x3a8cc4,_0x3c2721)['then'](function(_0x4f9696){logger[_0xb332('0x11')](_0xb332('0x12'),_0xf85dc6,_0xb332('0x13'));logger['debug'](_0xb332('0x14'),_0xf85dc6,'request\x20sent',JSON[_0xb332('0x15')](_0x4f9696));if(_0x4f9696['error']){if(_0x4f9696['error'][_0xb332('0x16')]===0x1f4){logger[_0xb332('0x17')](_0xb332('0x12'),_0xf85dc6,_0x4f9696[_0xb332('0x17')][_0xb332('0x18')]);return _0x55d578(_0x4f9696[_0xb332('0x17')][_0xb332('0x18')]);}logger[_0xb332('0x17')](_0xb332('0x12'),_0xf85dc6,_0x4f9696[_0xb332('0x17')][_0xb332('0x18')]);return _0x596db2(_0x4f9696['error']['message']);}else{logger['info'](_0xb332('0x12'),_0xf85dc6,'request\x20sent');_0x596db2(_0x4f9696[_0xb332('0x19')]['message']);}})[_0xb332('0x1a')](function(_0x1b092d){logger[_0xb332('0x17')](_0xb332('0x12'),_0xf85dc6,_0x1b092d);_0x55d578(_0x1b092d);});});}exports[_0xb332('0x1b')]=function(_0x22312f){var _0x4a1ba0=this;return new Promise(function(_0x2b82db,_0x14dee6){return db[_0xb332('0x1c')]['findAll']({'raw':_0x22312f[_0xb332('0x1d')]?_0x22312f['options']['raw']===undefined?!![]:![]:!![],'where':_0x22312f[_0xb332('0x1d')]?_0x22312f[_0xb332('0x1d')][_0xb332('0x1e')]||null:null,'attributes':_0x22312f['options']?_0x22312f[_0xb332('0x1d')][_0xb332('0x1f')]||null:null,'limit':_0x22312f['options']?_0x22312f[_0xb332('0x1d')]['limit']||null:null,'include':_0x22312f[_0xb332('0x1d')]?_0x22312f[_0xb332('0x1d')][_0xb332('0x20')]?_[_0xb332('0x21')](_0x22312f['options'][_0xb332('0x20')],function(_0x49999a){return{'model':db[_0x49999a['model']],'as':_0x49999a['as'],'attributes':_0x49999a[_0xb332('0x1f')],'include':_0x49999a['include']?_[_0xb332('0x21')](_0x49999a[_0xb332('0x20')],function(_0x17fc02){return{'model':db[_0x17fc02['model']],'as':_0x17fc02['as'],'attributes':_0x17fc02[_0xb332('0x1f')],'include':_0x17fc02['include']?_[_0xb332('0x21')](_0x17fc02[_0xb332('0x20')],function(_0x3c8809){return{'model':db[_0x3c8809[_0xb332('0x22')]],'as':_0x3c8809['as'],'attributes':_0x3c8809[_0xb332('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb332('0x23')](function(_0x51ea26){logger[_0xb332('0x11')](_0xb332('0x1b'),_0x22312f);logger[_0xb332('0x24')](_0xb332('0x1b'),_0x22312f,JSON[_0xb332('0x15')](_0x51ea26));_0x2b82db(_0x51ea26);})[_0xb332('0x1a')](function(_0x197adf){logger[_0xb332('0x17')](_0xb332('0x1b'),_0x197adf['message'],_0x22312f);_0x14dee6(_0x4a1ba0[_0xb332('0x17')](0x1f4,_0x197adf[_0xb332('0x18')]));});});};exports[_0xb332('0x25')]=function(_0x4a7ddd){var _0x3845af=this;return new Promise(function(_0x4c55d3,_0x102df6){return db[_0xb332('0x1c')][_0xb332('0x26')]({'raw':_0x4a7ddd[_0xb332('0x1d')]?_0x4a7ddd[_0xb332('0x1d')][_0xb332('0x27')]===undefined?!![]:![]:!![],'where':_0x4a7ddd['options']?_0x4a7ddd['options'][_0xb332('0x1e')]||null:null,'attributes':_0x4a7ddd[_0xb332('0x1d')]?_0x4a7ddd[_0xb332('0x1d')]['attributes']||null:null,'include':_0x4a7ddd[_0xb332('0x1d')]?_0x4a7ddd[_0xb332('0x1d')][_0xb332('0x20')]?_[_0xb332('0x21')](_0x4a7ddd['options'][_0xb332('0x20')],function(_0x2e10fe){return{'model':db[_0x2e10fe[_0xb332('0x22')]],'as':_0x2e10fe['as'],'attributes':_0x2e10fe[_0xb332('0x1f')],'include':_0x2e10fe[_0xb332('0x20')]?_[_0xb332('0x21')](_0x2e10fe[_0xb332('0x20')],function(_0x46df74){return{'model':db[_0x46df74['model']],'as':_0x46df74['as'],'attributes':_0x46df74[_0xb332('0x1f')],'include':_0x46df74[_0xb332('0x20')]?_[_0xb332('0x21')](_0x46df74[_0xb332('0x20')],function(_0x440fd5){return{'model':db[_0x440fd5[_0xb332('0x22')]],'as':_0x440fd5['as'],'attributes':_0x440fd5[_0xb332('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb332('0x23')](function(_0x10247f){logger[_0xb332('0x11')](_0xb332('0x25'),_0x4a7ddd);logger[_0xb332('0x24')]('ShowChatQueue',_0x4a7ddd,JSON[_0xb332('0x15')](_0x10247f));_0x4c55d3(_0x10247f);})[_0xb332('0x1a')](function(_0x126c0){logger[_0xb332('0x17')](_0xb332('0x25'),_0x126c0['message'],_0x4a7ddd);_0x102df6(_0x3845af[_0xb332('0x17')](0x1f4,_0x126c0[_0xb332('0x18')]));});});};
\ No newline at end of file
+var _0x7497=['stringify','ShowChatQueue','find','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','debug'];(function(_0x1625d5,_0x2cb18b){var _0x5f0d99=function(_0x23cbb8){while(--_0x23cbb8){_0x1625d5['push'](_0x1625d5['shift']());}};_0x5f0d99(++_0x2cb18b);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var moment=require(_0x7749('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7749('0x3'))['db'];var utils=require(_0x7749('0x4'));var logger=require('../../config/logger')(_0x7749('0x5'));var config=require(_0x7749('0x6'));var jayson=require(_0x7749('0x7'));var client=jayson[_0x7749('0x8')][_0x7749('0x9')]({'port':0x232a});config[_0x7749('0xa')]=_[_0x7749('0xb')](config[_0x7749('0xa')],{'host':_0x7749('0xc'),'port':0x18eb});var socket=require(_0x7749('0xd'))(new Redis(config[_0x7749('0xa')]));require('./chatQueue.socket')[_0x7749('0xe')](socket);function respondWithRpcPromise(_0x581994,_0x781f3e,_0x837b9){return new BPromise(function(_0x32e711,_0x1e5c30){return client[_0x7749('0xf')](_0x581994,_0x837b9)[_0x7749('0x10')](function(_0x9fa376){logger[_0x7749('0x11')](_0x7749('0x12'),_0x781f3e,'request\x20sent');logger['debug'](_0x7749('0x13'),_0x781f3e,'request\x20sent',JSON['stringify'](_0x9fa376));if(_0x9fa376[_0x7749('0x14')]){if(_0x9fa376[_0x7749('0x14')][_0x7749('0x15')]===0x1f4){logger[_0x7749('0x14')](_0x7749('0x12'),_0x781f3e,_0x9fa376[_0x7749('0x14')]['message']);return _0x1e5c30(_0x9fa376['error'][_0x7749('0x16')]);}logger[_0x7749('0x14')]('ChatQueue,\x20%s,\x20%s',_0x781f3e,_0x9fa376[_0x7749('0x14')][_0x7749('0x16')]);return _0x32e711(_0x9fa376[_0x7749('0x14')][_0x7749('0x16')]);}else{logger[_0x7749('0x11')](_0x7749('0x12'),_0x781f3e,_0x7749('0x17'));_0x32e711(_0x9fa376[_0x7749('0x18')][_0x7749('0x16')]);}})[_0x7749('0x19')](function(_0x5c89d0){logger[_0x7749('0x14')](_0x7749('0x12'),_0x781f3e,_0x5c89d0);_0x1e5c30(_0x5c89d0);});});}exports['GetChatQueue']=function(_0x250a8c){var _0x544c8e=this;return new Promise(function(_0x753986,_0x11013a){return db[_0x7749('0x1a')][_0x7749('0x1b')]({'raw':_0x250a8c[_0x7749('0x1c')]?_0x250a8c[_0x7749('0x1c')][_0x7749('0x1d')]===undefined?!![]:![]:!![],'where':_0x250a8c[_0x7749('0x1c')]?_0x250a8c[_0x7749('0x1c')][_0x7749('0x1e')]||null:null,'attributes':_0x250a8c['options']?_0x250a8c[_0x7749('0x1c')][_0x7749('0x1f')]||null:null,'limit':_0x250a8c['options']?_0x250a8c['options'][_0x7749('0x20')]||null:null,'include':_0x250a8c['options']?_0x250a8c[_0x7749('0x1c')][_0x7749('0x21')]?_[_0x7749('0x22')](_0x250a8c[_0x7749('0x1c')]['include'],function(_0x21f09e){return{'model':db[_0x21f09e['model']],'as':_0x21f09e['as'],'attributes':_0x21f09e['attributes'],'include':_0x21f09e['include']?_['map'](_0x21f09e['include'],function(_0x5cd489){return{'model':db[_0x5cd489[_0x7749('0x23')]],'as':_0x5cd489['as'],'attributes':_0x5cd489[_0x7749('0x1f')],'include':_0x5cd489['include']?_[_0x7749('0x22')](_0x5cd489[_0x7749('0x21')],function(_0x8112c9){return{'model':db[_0x8112c9[_0x7749('0x23')]],'as':_0x8112c9['as'],'attributes':_0x8112c9[_0x7749('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7749('0x10')](function(_0x5cdc03){logger[_0x7749('0x11')](_0x7749('0x24'),_0x250a8c);logger[_0x7749('0x25')]('GetChatQueue',_0x250a8c,JSON[_0x7749('0x26')](_0x5cdc03));_0x753986(_0x5cdc03);})[_0x7749('0x19')](function(_0xdc2321){logger[_0x7749('0x14')](_0x7749('0x24'),_0xdc2321[_0x7749('0x16')],_0x250a8c);_0x11013a(_0x544c8e[_0x7749('0x14')](0x1f4,_0xdc2321[_0x7749('0x16')]));});});};exports[_0x7749('0x27')]=function(_0x1f17d4){var _0x2980bd=this;return new Promise(function(_0x8247f9,_0x408f22){return db[_0x7749('0x1a')][_0x7749('0x28')]({'raw':_0x1f17d4[_0x7749('0x1c')]?_0x1f17d4[_0x7749('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1f17d4[_0x7749('0x1c')]?_0x1f17d4[_0x7749('0x1c')][_0x7749('0x1e')]||null:null,'attributes':_0x1f17d4[_0x7749('0x1c')]?_0x1f17d4['options']['attributes']||null:null,'include':_0x1f17d4['options']?_0x1f17d4[_0x7749('0x1c')][_0x7749('0x21')]?_[_0x7749('0x22')](_0x1f17d4[_0x7749('0x1c')]['include'],function(_0x377025){return{'model':db[_0x377025[_0x7749('0x23')]],'as':_0x377025['as'],'attributes':_0x377025[_0x7749('0x1f')],'include':_0x377025['include']?_[_0x7749('0x22')](_0x377025[_0x7749('0x21')],function(_0x4a14ec){return{'model':db[_0x4a14ec[_0x7749('0x23')]],'as':_0x4a14ec['as'],'attributes':_0x4a14ec['attributes'],'include':_0x4a14ec[_0x7749('0x21')]?_[_0x7749('0x22')](_0x4a14ec[_0x7749('0x21')],function(_0x559970){return{'model':db[_0x559970[_0x7749('0x23')]],'as':_0x559970['as'],'attributes':_0x559970[_0x7749('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7749('0x10')](function(_0x1afb44){logger['info']('ShowChatQueue',_0x1f17d4);logger['debug'](_0x7749('0x27'),_0x1f17d4,JSON[_0x7749('0x26')](_0x1afb44));_0x8247f9(_0x1afb44);})[_0x7749('0x19')](function(_0x12086f){logger[_0x7749('0x14')](_0x7749('0x27'),_0x12086f[_0x7749('0x16')],_0x1f17d4);_0x408f22(_0x2980bd[_0x7749('0x14')](0x1f4,_0x12086f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 458909a..8f5049b 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 _0xc3b5=['length','remove','update','emit','register'];(function(_0x2915ed,_0x1407b8){var _0x1d4fd9=function(_0x357ebc){while(--_0x357ebc){_0x2915ed['push'](_0x2915ed['shift']());}};_0x1d4fd9(++_0x1407b8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x1e8332,_0x19907e){_0x1e8332=_0x1e8332-0x0;var _0x46d11f=_0xc3b5[_0x1e8332];return _0x46d11f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}};
\ No newline at end of file
+var _0xb332=['emit','register','./chatQueue.events','remove','update'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0xb332,0xd9));var _0x2b33=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0xb332[_0x58eec7];return _0x25c5d3;};'use strict';var ChatQueueEvents=require(_0x2b33('0x0'));var events=['save',_0x2b33('0x1'),_0x2b33('0x2')];function createListener(_0x5ee720,_0xf8c6a7){return function(_0x548a70){_0xf8c6a7[_0x2b33('0x3')](_0x5ee720,_0x548a70);};}function removeListener(_0x4c6634,_0x34b111){return function(){ChatQueueEvents['removeListener'](_0x4c6634,_0x34b111);};}exports[_0x2b33('0x4')]=function(_0x22d66){for(var _0x478214=0x0,_0x461d44=events['length'];_0x478214<_0x461d44;_0x478214++){var _0x5ccf2d=events[_0x478214];var _0x4302b7=createListener('chatQueue:'+_0x5ccf2d,_0x22d66);ChatQueueEvents['on'](_0x5ccf2d,_0x4302b7);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e3ee10b..040fe52 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(_0x5966de,_0x2a212e){var _0x287241=function(_0x4f8a91){while(--_0x4f8a91){_0x5966de['push'](_0x5966de['shift']());}};_0x287241(++_0x2a212e);}(_0xe14b,0x93));var _0xbe14=function(_0x20c299,_0x3d9bb3){_0x20c299=_0x20c299-0x0;var _0x2fd0c3=_0xe14b[_0x20c299];return _0x2fd0c3;};'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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x44d1a8,_0x34ebdd){var _0x3ae535=function(_0x316cee){while(--_0x316cee){_0x44d1a8['push'](_0x44d1a8['shift']());}};_0x3ae535(++_0x34ebdd);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b290287..cd6b6b1 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 _0xdf85=['sequelize','STRING','DATE'];(function(_0x368d1a,_0x552486){var _0x4834c6=function(_0x2ce26b){while(--_0x2ce26b){_0x368d1a['push'](_0x368d1a['shift']());}};_0x4834c6(++_0x552486);}(_0xdf85,0x12c));var _0x5df8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdf85[_0x57b54c];return _0x59cc19;};'use strict';var moment=require('moment');var Sequelize=require(_0x5df8('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5df8('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5df8('0x1')]},'joinAt':{'type':Sequelize[_0x5df8('0x2')]},'leaveAt':{'type':Sequelize[_0x5df8('0x2')]},'acceptAt':{'type':Sequelize[_0x5df8('0x2')]},'exitAt':{'type':Sequelize[_0x5df8('0x2')]},'reason':{'type':Sequelize[_0x5df8('0x1')]}};
\ No newline at end of file
+var _0xfbd1=['STRING','DATE','sequelize','exports'];(function(_0x503603,_0x4e5019){var _0x40986f=function(_0x34f6bc){while(--_0x34f6bc){_0x503603['push'](_0x503603['shift']());}};_0x40986f(++_0x4e5019);}(_0xfbd1,0x176));var _0x1fbd=function(_0x16c493,_0x504324){_0x16c493=_0x16c493-0x0;var _0x4d814b=_0xfbd1[_0x16c493];return _0x4d814b;};'use strict';var moment=require('moment');var Sequelize=require(_0x1fbd('0x0'));module[_0x1fbd('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1fbd('0x2')]},'joinAt':{'type':Sequelize[_0x1fbd('0x3')]},'leaveAt':{'type':Sequelize[_0x1fbd('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1fbd('0x3')]},'reason':{'type':Sequelize[_0x1fbd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2724b3e..a95fd97 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 _0xed20=['../../mysqldb','sendStatus','end','status','offset','limit','undefined','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','includeAll','include','rows','show','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x20f92e,_0x54358f){var _0x4779d5=function(_0x2fca65){while(--_0x2fca65){_0x20f92e['push'](_0x20f92e['shift']());}};_0x4779d5(++_0x54358f);}(_0xed20,0xce));var _0x0ed2=function(_0x591cc7,_0x4437cf){_0x591cc7=_0x591cc7-0x0;var _0x2cd866=_0xed20[_0x591cc7];return _0x2cd866;};'use strict';var emlformat=require(_0x0ed2('0x0'));var rimraf=require(_0x0ed2('0x1'));var zipdir=require(_0x0ed2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ed2('0x3'));var moment=require(_0x0ed2('0x4'));var BPromise=require(_0x0ed2('0x5'));var Mustache=require(_0x0ed2('0x6'));var util=require(_0x0ed2('0x7'));var path=require(_0x0ed2('0x8'));var sox=require('sox');var csv=require(_0x0ed2('0x9'));var ejs=require(_0x0ed2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ed2('0xb'));var squel=require(_0x0ed2('0xc'));var crypto=require(_0x0ed2('0xd'));var jsforce=require(_0x0ed2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0ed2('0x9'));var querystring=require(_0x0ed2('0xf'));var Papa=require(_0x0ed2('0x10'));var Redis=require(_0x0ed2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ed2('0x12'));var hardwareService=require(_0x0ed2('0x13'));var logger=require(_0x0ed2('0x14'))(_0x0ed2('0x15'));var utils=require(_0x0ed2('0x16'));var config=require(_0x0ed2('0x17'));var licenseUtil=require(_0x0ed2('0x18'));var db=require(_0x0ed2('0x19'))['db'];function respondWithStatusCode(_0x3cc6b4,_0x342768){_0x342768=_0x342768||0xcc;return function(_0x14355d){if(_0x14355d){return _0x3cc6b4[_0x0ed2('0x1a')](_0x342768);}return _0x3cc6b4['status'](_0x342768)[_0x0ed2('0x1b')]();};}function respondWithResult(_0x3b0f4b,_0x28c90f){_0x28c90f=_0x28c90f||0xc8;return function(_0x11b884){if(_0x11b884){return _0x3b0f4b[_0x0ed2('0x1c')](_0x28c90f)['json'](_0x11b884);}};}function respondWithFilteredResult(_0x30ccd2,_0x55ca){return function(_0x350995){if(_0x350995){var _0x5101f2=typeof _0x55ca[_0x0ed2('0x1d')]==='undefined'&&typeof _0x55ca[_0x0ed2('0x1e')]===_0x0ed2('0x1f');var _0xc0f621=_0x350995['count'];var _0x50c142=_0x5101f2?0x0:_0x55ca[_0x0ed2('0x1d')];var _0x6b3af1=_0x5101f2?_0x350995['count']:_0x55ca[_0x0ed2('0x1d')]+_0x55ca['limit'];var _0x25e4dc;if(_0x6b3af1>=_0xc0f621){_0x6b3af1=_0xc0f621;_0x25e4dc=0xc8;}else{_0x25e4dc=0xce;}_0x30ccd2[_0x0ed2('0x1c')](_0x25e4dc);return _0x30ccd2['set']('Content-Range',_0x50c142+'-'+_0x6b3af1+'/'+_0xc0f621)['json'](_0x350995);}return null;};}function patchUpdates(_0x13060b){return function(_0x270de4){try{jsonpatch[_0x0ed2('0x20')](_0x270de4,_0x13060b,!![]);}catch(_0x1206e3){return BPromise[_0x0ed2('0x21')](_0x1206e3);}return _0x270de4[_0x0ed2('0x22')]();};}function saveUpdates(_0x13d3b7,_0x56f511){return function(_0x4c1dbd){if(_0x4c1dbd){return _0x4c1dbd[_0x0ed2('0x23')](_0x13d3b7)[_0x0ed2('0x24')](function(_0x7a3157){return _0x7a3157;});}return null;};}function removeEntity(_0x505321,_0x42911c){return function(_0x306f97){if(_0x306f97){return _0x306f97[_0x0ed2('0x25')]()[_0x0ed2('0x24')](function(){_0x505321['status'](0xcc)[_0x0ed2('0x1b')]();});}};}function handleEntityNotFound(_0x24983e,_0x1abc6f){return function(_0x19ffde){if(!_0x19ffde){_0x24983e[_0x0ed2('0x1a')](0x194);}return _0x19ffde;};}function handleError(_0x5bb903,_0x14c0e6){_0x14c0e6=_0x14c0e6||0x1f4;return function(_0x23b304){logger[_0x0ed2('0x26')](_0x23b304[_0x0ed2('0x27')]);if(_0x23b304[_0x0ed2('0x28')]){delete _0x23b304[_0x0ed2('0x28')];}_0x5bb903[_0x0ed2('0x1c')](_0x14c0e6)[_0x0ed2('0x29')](_0x23b304);};}exports[_0x0ed2('0x2a')]=function(_0x1e6efe,_0x597c6e){var _0x3bc558={},_0x5e9d4d={},_0x49ff37={'count':0x0,'rows':[]};var _0x3c62e4=_[_0x0ed2('0x2b')](db[_0x0ed2('0x2c')][_0x0ed2('0x2d')],function(_0x2a9b01){return{'name':_0x2a9b01[_0x0ed2('0x2e')],'type':_0x2a9b01['type']['key']};});_0x5e9d4d['model']=_[_0x0ed2('0x2b')](_0x3c62e4,_0x0ed2('0x28'));_0x5e9d4d[_0x0ed2('0x2f')]=_[_0x0ed2('0x30')](_0x1e6efe['query']);_0x5e9d4d[_0x0ed2('0x31')]=_['intersection'](_0x5e9d4d[_0x0ed2('0x32')],_0x5e9d4d[_0x0ed2('0x2f')]);_0x3bc558['attributes']=_[_0x0ed2('0x33')](_0x5e9d4d['model'],qs[_0x0ed2('0x34')](_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x34')]));_0x3bc558[_0x0ed2('0x35')]=_0x3bc558['attributes'][_0x0ed2('0x36')]?_0x3bc558[_0x0ed2('0x35')]:_0x5e9d4d['model'];if(!_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x37')](_0x0ed2('0x38'))){_0x3bc558[_0x0ed2('0x1e')]=qs[_0x0ed2('0x1e')](_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x1e')]);_0x3bc558[_0x0ed2('0x1d')]=qs[_0x0ed2('0x1d')](_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x1d')]);}_0x3bc558[_0x0ed2('0x39')]=qs['sort'](_0x1e6efe['query'][_0x0ed2('0x3a')]);_0x3bc558['where']=qs[_0x0ed2('0x31')](_[_0x0ed2('0x3b')](_0x1e6efe[_0x0ed2('0x2f')],_0x5e9d4d[_0x0ed2('0x31')]),_0x3c62e4);if(_0x1e6efe[_0x0ed2('0x2f')]['filter']){_0x3bc558[_0x0ed2('0x3c')]=_[_0x0ed2('0x3d')](_0x3bc558[_0x0ed2('0x3c')],{'$or':_[_0x0ed2('0x2b')](_0x3c62e4,function(_0x1ec43b){if(_0x1ec43b[_0x0ed2('0x3e')]!==_0x0ed2('0x3f')){var _0x5b9c67={};_0x5b9c67[_0x1ec43b['name']]={'$like':'%'+_0x1e6efe['query'][_0x0ed2('0x40')]+'%'};return _0x5b9c67;}})});}_0x3bc558=_[_0x0ed2('0x3d')]({},_0x3bc558,_0x1e6efe[_0x0ed2('0x41')]);var _0x5606d7={'where':_0x3bc558[_0x0ed2('0x3c')]};return db['ChatQueueReport'][_0x0ed2('0x42')](_0x5606d7)[_0x0ed2('0x24')](function(_0x694ebb){_0x49ff37[_0x0ed2('0x42')]=_0x694ebb;if(_0x1e6efe[_0x0ed2('0x2f')][_0x0ed2('0x43')]){_0x3bc558[_0x0ed2('0x44')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3bc558);})[_0x0ed2('0x24')](function(_0x4ced59){_0x49ff37[_0x0ed2('0x45')]=_0x4ced59;return _0x49ff37;})[_0x0ed2('0x24')](respondWithFilteredResult(_0x597c6e,_0x3bc558))['catch'](handleError(_0x597c6e,null));};exports[_0x0ed2('0x46')]=function(_0x3f5fa3,_0x50f596){var _0x1b4103={'raw':!![],'where':{'id':_0x3f5fa3['params']['id']}},_0x11c59d={};_0x11c59d[_0x0ed2('0x32')]=_['keys'](db[_0x0ed2('0x2c')][_0x0ed2('0x2d')]);_0x11c59d[_0x0ed2('0x2f')]=_['keys'](_0x3f5fa3['query']);_0x11c59d[_0x0ed2('0x31')]=_[_0x0ed2('0x33')](_0x11c59d[_0x0ed2('0x32')],_0x11c59d[_0x0ed2('0x2f')]);_0x1b4103['attributes']=_['intersection'](_0x11c59d[_0x0ed2('0x32')],qs['fields'](_0x3f5fa3[_0x0ed2('0x2f')][_0x0ed2('0x34')]));_0x1b4103[_0x0ed2('0x35')]=_0x1b4103[_0x0ed2('0x35')][_0x0ed2('0x36')]?_0x1b4103['attributes']:_0x11c59d[_0x0ed2('0x32')];if(_0x3f5fa3[_0x0ed2('0x2f')]['includeAll']){_0x1b4103[_0x0ed2('0x44')]=[{'all':!![]}];}_0x1b4103=_['merge']({},_0x1b4103,_0x3f5fa3['options']);return db[_0x0ed2('0x2c')][_0x0ed2('0x47')](_0x1b4103)[_0x0ed2('0x24')](handleEntityNotFound(_0x50f596,null))[_0x0ed2('0x24')](respondWithResult(_0x50f596,null))[_0x0ed2('0x48')](handleError(_0x50f596,null));};exports['create']=function(_0x567d5e,_0xa5b266){return db[_0x0ed2('0x2c')][_0x0ed2('0x49')](_0x567d5e[_0x0ed2('0x4a')],{})[_0x0ed2('0x24')](respondWithResult(_0xa5b266,0xc9))[_0x0ed2('0x48')](handleError(_0xa5b266,null));};exports[_0x0ed2('0x23')]=function(_0x6b3269,_0x3387e1){if(_0x6b3269[_0x0ed2('0x4a')]['id']){delete _0x6b3269[_0x0ed2('0x4a')]['id'];}return db[_0x0ed2('0x2c')][_0x0ed2('0x47')]({'where':{'id':_0x6b3269[_0x0ed2('0x4b')]['id']}})[_0x0ed2('0x24')](handleEntityNotFound(_0x3387e1,null))[_0x0ed2('0x24')](saveUpdates(_0x6b3269[_0x0ed2('0x4a')],null))['then'](respondWithResult(_0x3387e1,null))[_0x0ed2('0x48')](handleError(_0x3387e1,null));};exports[_0x0ed2('0x25')]=function(_0x204460,_0x58e9ca){return db[_0x0ed2('0x2c')]['find']({'where':{'id':_0x204460[_0x0ed2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58e9ca,null))[_0x0ed2('0x24')](removeEntity(_0x58e9ca,null))[_0x0ed2('0x48')](handleError(_0x58e9ca,null));};exports[_0x0ed2('0x4c')]=function(_0x1c77e2,_0x4b690e){return db['ChatQueueReport'][_0x0ed2('0x4c')]()['then'](respondWithResult(_0x4b690e,null))[_0x0ed2('0x48')](handleError(_0x4b690e,null));};
\ No newline at end of file
+var _0x55c1=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset'];(function(_0xd8d758,_0x153ed5){var _0x55628d=function(_0x1f43dd){while(--_0x1f43dd){_0xd8d758['push'](_0xd8d758['shift']());}};_0x55628d(++_0x153ed5);}(_0x55c1,0x1e5));var _0x155c=function(_0x129d52,_0x1beadf){_0x129d52=_0x129d52-0x0;var _0x79ef89=_0x55c1[_0x129d52];return _0x79ef89;};'use strict';var emlformat=require(_0x155c('0x0'));var rimraf=require(_0x155c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x155c('0x2'));var BPromise=require(_0x155c('0x3'));var Mustache=require(_0x155c('0x4'));var util=require(_0x155c('0x5'));var path=require(_0x155c('0x6'));var sox=require('sox');var csv=require(_0x155c('0x7'));var ejs=require(_0x155c('0x8'));var fs=require('fs');var fs_extra=require(_0x155c('0x9'));var _=require('lodash');var squel=require(_0x155c('0xa'));var crypto=require(_0x155c('0xb'));var jsforce=require(_0x155c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x155c('0xd'));var Redis=require(_0x155c('0xe'));var authService=require(_0x155c('0xf'));var qs=require(_0x155c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x155c('0x11'));var logger=require(_0x155c('0x12'))('api');var utils=require(_0x155c('0x13'));var config=require(_0x155c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x155c('0x15'))['db'];function respondWithStatusCode(_0x278370,_0x5b6173){_0x5b6173=_0x5b6173||0xcc;return function(_0x1f1866){if(_0x1f1866){return _0x278370[_0x155c('0x16')](_0x5b6173);}return _0x278370[_0x155c('0x17')](_0x5b6173)['end']();};}function respondWithResult(_0x372ec3,_0x37903b){_0x37903b=_0x37903b||0xc8;return function(_0xfe906a){if(_0xfe906a){return _0x372ec3[_0x155c('0x17')](_0x37903b)[_0x155c('0x18')](_0xfe906a);}};}function respondWithFilteredResult(_0x4899a3,_0x2997af){return function(_0x49f59f){if(_0x49f59f){var _0x48fe51=typeof _0x2997af[_0x155c('0x19')]==='undefined'&&typeof _0x2997af[_0x155c('0x1a')]===_0x155c('0x1b');var _0x9e024e=_0x49f59f['count'];var _0xe800de=_0x48fe51?0x0:_0x2997af[_0x155c('0x19')];var _0x224a3d=_0x48fe51?_0x49f59f[_0x155c('0x1c')]:_0x2997af[_0x155c('0x19')]+_0x2997af[_0x155c('0x1a')];var _0xa4c0c;if(_0x224a3d>=_0x9e024e){_0x224a3d=_0x9e024e;_0xa4c0c=0xc8;}else{_0xa4c0c=0xce;}_0x4899a3[_0x155c('0x17')](_0xa4c0c);return _0x4899a3[_0x155c('0x1d')](_0x155c('0x1e'),_0xe800de+'-'+_0x224a3d+'/'+_0x9e024e)[_0x155c('0x18')](_0x49f59f);}return null;};}function patchUpdates(_0xe422f6){return function(_0x250399){try{jsonpatch[_0x155c('0x1f')](_0x250399,_0xe422f6,!![]);}catch(_0x43b032){return BPromise[_0x155c('0x20')](_0x43b032);}return _0x250399[_0x155c('0x21')]();};}function saveUpdates(_0x5935af,_0x1564bf){return function(_0x3cc458){if(_0x3cc458){return _0x3cc458[_0x155c('0x22')](_0x5935af)[_0x155c('0x23')](function(_0x1006b8){return _0x1006b8;});}return null;};}function removeEntity(_0x254557,_0x4b6d0d){return function(_0x4f242c){if(_0x4f242c){return _0x4f242c[_0x155c('0x24')]()[_0x155c('0x23')](function(){_0x254557[_0x155c('0x17')](0xcc)[_0x155c('0x25')]();});}};}function handleEntityNotFound(_0x41e24d,_0x930c00){return function(_0x452175){if(!_0x452175){_0x41e24d[_0x155c('0x16')](0x194);}return _0x452175;};}function handleError(_0x241b38,_0x155028){_0x155028=_0x155028||0x1f4;return function(_0x36be3d){logger[_0x155c('0x26')](_0x36be3d[_0x155c('0x27')]);if(_0x36be3d[_0x155c('0x28')]){delete _0x36be3d[_0x155c('0x28')];}_0x241b38[_0x155c('0x17')](_0x155028)['send'](_0x36be3d);};}exports[_0x155c('0x29')]=function(_0x5a2004,_0x4d9a38){var _0x5bb056={},_0x47c89d={},_0x43608a={'count':0x0,'rows':[]};var _0x3593a0=_[_0x155c('0x2a')](db['ChatQueueReport'][_0x155c('0x2b')],function(_0x18dd71){return{'name':_0x18dd71[_0x155c('0x2c')],'type':_0x18dd71['type']['key']};});_0x47c89d['model']=_[_0x155c('0x2a')](_0x3593a0,_0x155c('0x28'));_0x47c89d['query']=_[_0x155c('0x2d')](_0x5a2004[_0x155c('0x2e')]);_0x47c89d[_0x155c('0x2f')]=_['intersection'](_0x47c89d[_0x155c('0x30')],_0x47c89d['query']);_0x5bb056[_0x155c('0x31')]=_[_0x155c('0x32')](_0x47c89d['model'],qs[_0x155c('0x33')](_0x5a2004[_0x155c('0x2e')]['fields']));_0x5bb056[_0x155c('0x31')]=_0x5bb056[_0x155c('0x31')]['length']?_0x5bb056[_0x155c('0x31')]:_0x47c89d[_0x155c('0x30')];if(!_0x5a2004[_0x155c('0x2e')][_0x155c('0x34')](_0x155c('0x35'))){_0x5bb056[_0x155c('0x1a')]=qs[_0x155c('0x1a')](_0x5a2004[_0x155c('0x2e')][_0x155c('0x1a')]);_0x5bb056[_0x155c('0x19')]=qs[_0x155c('0x19')](_0x5a2004['query'][_0x155c('0x19')]);}_0x5bb056[_0x155c('0x36')]=qs[_0x155c('0x37')](_0x5a2004['query'][_0x155c('0x37')]);_0x5bb056[_0x155c('0x38')]=qs['filters'](_['pick'](_0x5a2004[_0x155c('0x2e')],_0x47c89d[_0x155c('0x2f')]),_0x3593a0);if(_0x5a2004[_0x155c('0x2e')]['filter']){_0x5bb056[_0x155c('0x38')]=_[_0x155c('0x39')](_0x5bb056[_0x155c('0x38')],{'$or':_['map'](_0x3593a0,function(_0x394973){if(_0x394973['type']!==_0x155c('0x3a')){var _0x45457f={};_0x45457f[_0x394973[_0x155c('0x28')]]={'$like':'%'+_0x5a2004['query']['filter']+'%'};return _0x45457f;}})});}_0x5bb056=_[_0x155c('0x39')]({},_0x5bb056,_0x5a2004[_0x155c('0x3b')]);var _0x22fe10={'where':_0x5bb056['where']};return db[_0x155c('0x3c')][_0x155c('0x1c')](_0x22fe10)[_0x155c('0x23')](function(_0x40ade9){_0x43608a[_0x155c('0x1c')]=_0x40ade9;if(_0x5a2004['query']['includeAll']){_0x5bb056[_0x155c('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x155c('0x3e')](_0x5bb056);})['then'](function(_0x59af92){_0x43608a[_0x155c('0x3f')]=_0x59af92;return _0x43608a;})[_0x155c('0x23')](respondWithFilteredResult(_0x4d9a38,_0x5bb056))[_0x155c('0x40')](handleError(_0x4d9a38,null));};exports[_0x155c('0x41')]=function(_0x12337d,_0x5418de){var _0x350147={'raw':!![],'where':{'id':_0x12337d[_0x155c('0x42')]['id']}},_0x34b588={};_0x34b588[_0x155c('0x30')]=_[_0x155c('0x2d')](db[_0x155c('0x3c')][_0x155c('0x2b')]);_0x34b588[_0x155c('0x2e')]=_[_0x155c('0x2d')](_0x12337d[_0x155c('0x2e')]);_0x34b588[_0x155c('0x2f')]=_['intersection'](_0x34b588[_0x155c('0x30')],_0x34b588[_0x155c('0x2e')]);_0x350147['attributes']=_[_0x155c('0x32')](_0x34b588[_0x155c('0x30')],qs[_0x155c('0x33')](_0x12337d[_0x155c('0x2e')][_0x155c('0x33')]));_0x350147[_0x155c('0x31')]=_0x350147[_0x155c('0x31')][_0x155c('0x43')]?_0x350147[_0x155c('0x31')]:_0x34b588[_0x155c('0x30')];if(_0x12337d[_0x155c('0x2e')][_0x155c('0x44')]){_0x350147[_0x155c('0x3d')]=[{'all':!![]}];}_0x350147=_[_0x155c('0x39')]({},_0x350147,_0x12337d['options']);return db['ChatQueueReport']['find'](_0x350147)['then'](handleEntityNotFound(_0x5418de,null))['then'](respondWithResult(_0x5418de,null))[_0x155c('0x40')](handleError(_0x5418de,null));};exports[_0x155c('0x45')]=function(_0x9e5f88,_0x49656e){return db['ChatQueueReport'][_0x155c('0x45')](_0x9e5f88[_0x155c('0x46')],{})['then'](respondWithResult(_0x49656e,0xc9))['catch'](handleError(_0x49656e,null));};exports[_0x155c('0x22')]=function(_0x5a93ec,_0x14e43a){if(_0x5a93ec['body']['id']){delete _0x5a93ec[_0x155c('0x46')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5a93ec[_0x155c('0x42')]['id']}})[_0x155c('0x23')](handleEntityNotFound(_0x14e43a,null))[_0x155c('0x23')](saveUpdates(_0x5a93ec['body'],null))[_0x155c('0x23')](respondWithResult(_0x14e43a,null))[_0x155c('0x40')](handleError(_0x14e43a,null));};exports[_0x155c('0x24')]=function(_0x3022f7,_0x3dfba3){return db[_0x155c('0x3c')][_0x155c('0x47')]({'where':{'id':_0x3022f7[_0x155c('0x42')]['id']}})[_0x155c('0x23')](handleEntityNotFound(_0x3dfba3,null))['then'](removeEntity(_0x3dfba3,null))[_0x155c('0x40')](handleError(_0x3dfba3,null));};exports[_0x155c('0x48')]=function(_0x263a1a,_0xf8d24e){return db[_0x155c('0x3c')]['describe']()[_0x155c('0x23')](respondWithResult(_0xf8d24e,null))[_0x155c('0x40')](handleError(_0xf8d24e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 00740b4..3aded76 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(_0x4d01e3,_0x44c37e){var _0x3b2491=function(_0x40b771){while(--_0x40b771){_0x4d01e3['push'](_0x4d01e3['shift']());}};_0x3b2491(++_0x44c37e);}(_0x757a,0xde));var _0xa757=function(_0x9fadbd,_0x29b939){_0x9fadbd=_0x9fadbd-0x0;var _0x437523=_0x757a[_0x9fadbd];return _0x437523;};'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(_0x26cab7,_0x1ccfca){var _0x31ba06=function(_0x1ed04a){while(--_0x1ed04a){_0x26cab7['push'](_0x26cab7['shift']());}};_0x31ba06(++_0x1ccfca);}(_0xb10b,0x12a));var _0xbb10=function(_0x1fc512,_0x1996db){_0x1fc512=_0x1fc512-0x0;var _0xae94b9=_0xb10b[_0x1fc512];return _0xae94b9;};'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 afd917a..c12ec06 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 _0xea36=['where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','then','UpdateChatQueueReport','update','body'];(function(_0x1e4612,_0xcfd7d6){var _0x40aaa3=function(_0x2aa6dd){while(--_0x2aa6dd){_0x1e4612['push'](_0x1e4612['shift']());}};_0x40aaa3(++_0xcfd7d6);}(_0xea36,0xfa));var _0x6ea3=function(_0x331bc7,_0x35ee48){_0x331bc7=_0x331bc7-0x0;var _0x286a84=_0xea36[_0x331bc7];return _0x286a84;};'use strict';var _=require(_0x6ea3('0x0'));var util=require(_0x6ea3('0x1'));var moment=require(_0x6ea3('0x2'));var BPromise=require(_0x6ea3('0x3'));var rs=require(_0x6ea3('0x4'));var fs=require('fs');var Redis=require(_0x6ea3('0x5'));var db=require(_0x6ea3('0x6'))['db'];var utils=require(_0x6ea3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ea3('0x8'));var jayson=require(_0x6ea3('0x9'));var client=jayson[_0x6ea3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1163b7,_0x7c406a,_0x33c269){return new BPromise(function(_0x5864e9,_0x340c8d){return client['request'](_0x1163b7,_0x33c269)['then'](function(_0x5ec474){logger['info'](_0x6ea3('0xb'),_0x7c406a,'request\x20sent');logger[_0x6ea3('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x7c406a,_0x6ea3('0xd'),JSON[_0x6ea3('0xe')](_0x5ec474));if(_0x5ec474[_0x6ea3('0xf')]){if(_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x10')]===0x1f4){logger[_0x6ea3('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x7c406a,_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x11')]);return _0x340c8d(_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x11')]);}logger[_0x6ea3('0xf')](_0x6ea3('0xb'),_0x7c406a,_0x5ec474[_0x6ea3('0xf')]['message']);return _0x5864e9(_0x5ec474[_0x6ea3('0xf')][_0x6ea3('0x11')]);}else{logger[_0x6ea3('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x7c406a,'request\x20sent');_0x5864e9(_0x5ec474['result'][_0x6ea3('0x11')]);}})[_0x6ea3('0x13')](function(_0x1ca246){logger[_0x6ea3('0xf')](_0x6ea3('0xb'),_0x7c406a,_0x1ca246);_0x340c8d(_0x1ca246);});});}exports[_0x6ea3('0x14')]=function(_0x198e09){var _0x5b3ae6=this;return new Promise(function(_0x13c6ab,_0x4ce7a1){return db[_0x6ea3('0x15')][_0x6ea3('0x16')](_0x198e09['body'],{'raw':_0x198e09[_0x6ea3('0x17')]?_0x198e09[_0x6ea3('0x17')][_0x6ea3('0x18')]===undefined?!![]:![]:!![]})[_0x6ea3('0x19')](function(_0x56210a){logger[_0x6ea3('0x12')](_0x6ea3('0x14'),_0x198e09);logger[_0x6ea3('0xc')](_0x6ea3('0x14'),_0x198e09,JSON[_0x6ea3('0xe')](_0x56210a));_0x13c6ab(_0x56210a);})['catch'](function(_0x2c6ec8){logger['error'](_0x6ea3('0x14'),_0x2c6ec8[_0x6ea3('0x11')],_0x198e09);_0x4ce7a1(_0x5b3ae6['error'](0x1f4,_0x2c6ec8['message']));});});};exports[_0x6ea3('0x1a')]=function(_0x199880){var _0x2207ec=this;return new Promise(function(_0x4c53bc,_0x3b091a){return db[_0x6ea3('0x15')][_0x6ea3('0x1b')](_0x199880[_0x6ea3('0x1c')],{'raw':_0x199880[_0x6ea3('0x17')]?_0x199880[_0x6ea3('0x17')][_0x6ea3('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x199880['options']?_0x199880['options'][_0x6ea3('0x1d')]||null:null,'attributes':_0x199880[_0x6ea3('0x17')]?_0x199880['options']['attributes']||null:null,'limit':_0x199880[_0x6ea3('0x17')]?_0x199880['options'][_0x6ea3('0x1e')]||null:null})['then'](function(_0x1619e6){logger[_0x6ea3('0x12')](_0x6ea3('0x1a'),_0x199880);logger[_0x6ea3('0xc')](_0x6ea3('0x1a'),_0x199880,JSON['stringify'](_0x1619e6));_0x4c53bc(_0x1619e6);})[_0x6ea3('0x13')](function(_0x124b34){logger[_0x6ea3('0xf')](_0x6ea3('0x1a'),_0x124b34[_0x6ea3('0x11')],_0x199880);_0x3b091a(_0x2207ec[_0x6ea3('0xf')](0x1f4,_0x124b34['message']));});});};
\ No newline at end of file
+var _0xaf60=['code','message','info','ChatQueueReport,\x20%s,\x20%s','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','update','where','limit','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error'];(function(_0xa43518,_0x2a4c6b){var _0x5e9b94=function(_0x3d3c7f){while(--_0x3d3c7f){_0xa43518['push'](_0xa43518['shift']());}};_0x5e9b94(++_0x2a4c6b);}(_0xaf60,0x82));var _0x0af6=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xaf60[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0af6('0x0'));var util=require(_0x0af6('0x1'));var moment=require(_0x0af6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0af6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0af6('0x4'))(_0x0af6('0x5'));var config=require(_0x0af6('0x6'));var jayson=require(_0x0af6('0x7'));var client=jayson[_0x0af6('0x8')][_0x0af6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eb218,_0x52c997,_0x376979){return new BPromise(function(_0x28d620,_0x525bcc){return client[_0x0af6('0xa')](_0x2eb218,_0x376979)[_0x0af6('0xb')](function(_0xe9d01a){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x52c997,'request\x20sent');logger[_0x0af6('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x52c997,_0x0af6('0xd'),JSON['stringify'](_0xe9d01a));if(_0xe9d01a['error']){if(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0xf')]===0x1f4){logger[_0x0af6('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);return _0x525bcc(_0xe9d01a[_0x0af6('0xe')]['message']);}logger[_0x0af6('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')]['message']);return _0x28d620(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);}else{logger[_0x0af6('0x11')](_0x0af6('0x12'),_0x52c997,'request\x20sent');_0x28d620(_0xe9d01a['result']['message']);}})['catch'](function(_0x4d5936){logger[_0x0af6('0xe')](_0x0af6('0x12'),_0x52c997,_0x4d5936);_0x525bcc(_0x4d5936);});});}exports[_0x0af6('0x13')]=function(_0x2bd5c0){var _0x5bf0d3=this;return new Promise(function(_0x57511e,_0x4bf9b8){return db[_0x0af6('0x14')]['create'](_0x2bd5c0[_0x0af6('0x15')],{'raw':_0x2bd5c0[_0x0af6('0x16')]?_0x2bd5c0['options'][_0x0af6('0x17')]===undefined?!![]:![]:!![]})[_0x0af6('0xb')](function(_0x2bac00){logger['info'](_0x0af6('0x13'),_0x2bd5c0);logger[_0x0af6('0xc')](_0x0af6('0x13'),_0x2bd5c0,JSON['stringify'](_0x2bac00));_0x57511e(_0x2bac00);})['catch'](function(_0x4adb2b){logger[_0x0af6('0xe')](_0x0af6('0x13'),_0x4adb2b[_0x0af6('0x10')],_0x2bd5c0);_0x4bf9b8(_0x5bf0d3[_0x0af6('0xe')](0x1f4,_0x4adb2b['message']));});});};exports[_0x0af6('0x18')]=function(_0x2083df){var _0x3fac44=this;return new Promise(function(_0x1aee87,_0x56df0b){return db[_0x0af6('0x14')][_0x0af6('0x19')](_0x2083df['body'],{'raw':_0x2083df[_0x0af6('0x16')]?_0x2083df['options'][_0x0af6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2083df[_0x0af6('0x16')]?_0x2083df[_0x0af6('0x16')][_0x0af6('0x1a')]||null:null,'attributes':_0x2083df[_0x0af6('0x16')]?_0x2083df['options']['attributes']||null:null,'limit':_0x2083df['options']?_0x2083df[_0x0af6('0x16')][_0x0af6('0x1b')]||null:null})[_0x0af6('0xb')](function(_0x4da5d0){logger[_0x0af6('0x11')](_0x0af6('0x18'),_0x2083df);logger['debug']('UpdateChatQueueReport',_0x2083df,JSON['stringify'](_0x4da5d0));_0x1aee87(_0x4da5d0);})[_0x0af6('0x1c')](function(_0x41bb88){logger['error'](_0x0af6('0x18'),_0x41bb88[_0x0af6('0x10')],_0x2083df);_0x56df0b(_0x3fac44[_0x0af6('0xe')](0x1f4,_0x41bb88[_0x0af6('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 2131b07..f0fcc5a 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 _0x2dd8=['./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x13c3bd,_0x11bcfb){var _0x4bbc90=function(_0x3958d2){while(--_0x3958d2){_0x13c3bd['push'](_0x13c3bd['shift']());}};_0x4bbc90(++_0x11bcfb);}(_0x2dd8,0x11b));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var path=require(_0x82dd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x82dd('0x3')]();var fs_extra=require(_0x82dd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82dd('0x5'));var config=require('../../config/environment');var controller=require(_0x82dd('0x6'));router[_0x82dd('0x7')]('/',auth[_0x82dd('0x8')](),controller[_0x82dd('0x9')]);router[_0x82dd('0x7')](_0x82dd('0xa'),auth[_0x82dd('0x8')](),controller['describe']);router[_0x82dd('0x7')](_0x82dd('0xb'),auth[_0x82dd('0x8')](),controller['show']);router['post']('/',auth[_0x82dd('0x8')](),controller[_0x82dd('0xc')]);router[_0x82dd('0xd')](_0x82dd('0xb'),auth[_0x82dd('0x8')](),controller['update']);router[_0x82dd('0xe')](_0x82dd('0xb'),auth[_0x82dd('0x8')](),controller[_0x82dd('0xf')]);module[_0x82dd('0x10')]=router;
\ No newline at end of file
+var _0x2ea7=['/describe','describe','get','show','post','create','/:id','delete','destroy','multer','util','path','express','fs-extra','../../config/environment','./chatQueueReport.controller','isAuthenticated'];(function(_0x2be892,_0x3cf508){var _0x7baad=function(_0x15c666){while(--_0x15c666){_0x2be892['push'](_0x2be892['shift']());}};_0x7baad(++_0x3cf508);}(_0x2ea7,0x1d4));var _0x72ea=function(_0x7d8e66,_0x599dbd){_0x7d8e66=_0x7d8e66-0x0;var _0x190e52=_0x2ea7[_0x7d8e66];return _0x190e52;};'use strict';var multer=require(_0x72ea('0x0'));var util=require(_0x72ea('0x1'));var path=require(_0x72ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x72ea('0x3'));var router=express['Router']();var fs_extra=require(_0x72ea('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x72ea('0x5'));var controller=require(_0x72ea('0x6'));router['get']('/',auth[_0x72ea('0x7')](),controller['index']);router['get'](_0x72ea('0x8'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x9')]);router[_0x72ea('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x72ea('0xb')]);router[_0x72ea('0xc')]('/',auth[_0x72ea('0x7')](),controller[_0x72ea('0xd')]);router['put'](_0x72ea('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x72ea('0xf')](_0x72ea('0xe'),auth[_0x72ea('0x7')](),controller[_0x72ea('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0f33388..09ae418 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0xeec444,_0x267a72){var _0x124b7b=function(_0x50712d){while(--_0x50712d){_0xeec444['push'](_0xeec444['shift']());}};_0x124b7b(++_0x267a72);}(_0x70e0,0x17b));var _0x070e=function(_0x5b0ad9,_0x346d66){_0x5b0ad9=_0x5b0ad9-0x0;var _0xc976c6=_0x70e0[_0x5b0ad9];return _0xc976c6;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x9bde,0xe1));var _0xe9bd=function(_0x366f0d,_0x5ecaba){_0x366f0d=_0x366f0d-0x0;var _0x3973ef=_0x9bde[_0x366f0d];return _0x3973ef;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 8a2fca2..006e03f 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 _0x9baf=['body','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','ChatTransferReport','includeAll','findAll','rows','catch','show','params','keys','include','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9baf,0x1dd));var _0xf9ba=function(_0xf8cafb,_0x3bb857){_0xf8cafb=_0xf8cafb-0x0;var _0x11d273=_0x9baf[_0xf8cafb];return _0x11d273;};'use strict';var emlformat=require(_0xf9ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf9ba('0x1'));var rp=require('request-promise');var moment=require(_0xf9ba('0x2'));var BPromise=require(_0xf9ba('0x3'));var Mustache=require(_0xf9ba('0x4'));var util=require(_0xf9ba('0x5'));var path=require(_0xf9ba('0x6'));var sox=require(_0xf9ba('0x7'));var csv=require(_0xf9ba('0x8'));var ejs=require(_0xf9ba('0x9'));var fs=require('fs');var fs_extra=require(_0xf9ba('0xa'));var _=require(_0xf9ba('0xb'));var squel=require(_0xf9ba('0xc'));var crypto=require(_0xf9ba('0xd'));var jsforce=require(_0xf9ba('0xe'));var deskjs=require(_0xf9ba('0xf'));var toCsv=require(_0xf9ba('0x8'));var querystring=require(_0xf9ba('0x10'));var Papa=require(_0xf9ba('0x11'));var Redis=require(_0xf9ba('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf9ba('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9ba('0x14'));var logger=require(_0xf9ba('0x15'))(_0xf9ba('0x16'));var utils=require(_0xf9ba('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf9ba('0x18'));var db=require(_0xf9ba('0x19'))['db'];function respondWithStatusCode(_0x5c14a9,_0x2213e3){_0x2213e3=_0x2213e3||0xcc;return function(_0x84f397){if(_0x84f397){return _0x5c14a9[_0xf9ba('0x1a')](_0x2213e3);}return _0x5c14a9['status'](_0x2213e3)['end']();};}function respondWithResult(_0x458474,_0x3beb82){_0x3beb82=_0x3beb82||0xc8;return function(_0x3ae1cf){if(_0x3ae1cf){return _0x458474[_0xf9ba('0x1b')](_0x3beb82)[_0xf9ba('0x1c')](_0x3ae1cf);}};}function respondWithFilteredResult(_0x47535a,_0x476a22){return function(_0x1ddb6d){if(_0x1ddb6d){var _0x5cfa1d=typeof _0x476a22['offset']==='undefined'&&typeof _0x476a22[_0xf9ba('0x1d')]===_0xf9ba('0x1e');var _0x898f0d=_0x1ddb6d[_0xf9ba('0x1f')];var _0xbbaa4c=_0x5cfa1d?0x0:_0x476a22[_0xf9ba('0x20')];var _0x461ce6=_0x5cfa1d?_0x1ddb6d[_0xf9ba('0x1f')]:_0x476a22['offset']+_0x476a22[_0xf9ba('0x1d')];var _0x9fa1e3;if(_0x461ce6>=_0x898f0d){_0x461ce6=_0x898f0d;_0x9fa1e3=0xc8;}else{_0x9fa1e3=0xce;}_0x47535a[_0xf9ba('0x1b')](_0x9fa1e3);return _0x47535a[_0xf9ba('0x21')]('Content-Range',_0xbbaa4c+'-'+_0x461ce6+'/'+_0x898f0d)[_0xf9ba('0x1c')](_0x1ddb6d);}return null;};}function patchUpdates(_0x1acb0e){return function(_0x45e2f0){try{jsonpatch[_0xf9ba('0x22')](_0x45e2f0,_0x1acb0e,!![]);}catch(_0x576318){return BPromise[_0xf9ba('0x23')](_0x576318);}return _0x45e2f0[_0xf9ba('0x24')]();};}function saveUpdates(_0x1d6d89,_0x18b495){return function(_0xe6ecf2){if(_0xe6ecf2){return _0xe6ecf2[_0xf9ba('0x25')](_0x1d6d89)[_0xf9ba('0x26')](function(_0x313f71){return _0x313f71;});}return null;};}function removeEntity(_0x1dbdb2,_0x288c72){return function(_0x194a0a){if(_0x194a0a){return _0x194a0a[_0xf9ba('0x27')]()[_0xf9ba('0x26')](function(){_0x1dbdb2[_0xf9ba('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45777f,_0xc6e83){return function(_0x4f56aa){if(!_0x4f56aa){_0x45777f[_0xf9ba('0x1a')](0x194);}return _0x4f56aa;};}function handleError(_0x4bd37d,_0x46a993){_0x46a993=_0x46a993||0x1f4;return function(_0x25eb5e){logger[_0xf9ba('0x28')](_0x25eb5e[_0xf9ba('0x29')]);if(_0x25eb5e[_0xf9ba('0x2a')]){delete _0x25eb5e[_0xf9ba('0x2a')];}_0x4bd37d['status'](_0x46a993)[_0xf9ba('0x2b')](_0x25eb5e);};}exports['index']=function(_0x1ff183,_0x19c57e){var _0x55829d={},_0x2494d9={},_0x21bb75={'count':0x0,'rows':[]};var _0x1ec9e1=_[_0xf9ba('0x2c')](db['ChatTransferReport'][_0xf9ba('0x2d')],function(_0x3aae87){return{'name':_0x3aae87[_0xf9ba('0x2e')],'type':_0x3aae87[_0xf9ba('0x2f')][_0xf9ba('0x30')]};});_0x2494d9[_0xf9ba('0x31')]=_[_0xf9ba('0x2c')](_0x1ec9e1,'name');_0x2494d9[_0xf9ba('0x32')]=_['keys'](_0x1ff183[_0xf9ba('0x32')]);_0x2494d9['filters']=_[_0xf9ba('0x33')](_0x2494d9[_0xf9ba('0x31')],_0x2494d9[_0xf9ba('0x32')]);_0x55829d[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x2494d9[_0xf9ba('0x31')],qs[_0xf9ba('0x35')](_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x35')]));_0x55829d[_0xf9ba('0x34')]=_0x55829d['attributes'][_0xf9ba('0x36')]?_0x55829d[_0xf9ba('0x34')]:_0x2494d9[_0xf9ba('0x31')];if(!_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x37')](_0xf9ba('0x38'))){_0x55829d['limit']=qs[_0xf9ba('0x1d')](_0x1ff183[_0xf9ba('0x32')]['limit']);_0x55829d[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x1ff183['query'][_0xf9ba('0x20')]);}_0x55829d[_0xf9ba('0x39')]=qs[_0xf9ba('0x3a')](_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x3a')]);_0x55829d['where']=qs['filters'](_[_0xf9ba('0x3b')](_0x1ff183['query'],_0x2494d9[_0xf9ba('0x3c')]),_0x1ec9e1);if(_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x3d')]){_0x55829d[_0xf9ba('0x3e')]=_[_0xf9ba('0x3f')](_0x55829d[_0xf9ba('0x3e')],{'$or':_[_0xf9ba('0x2c')](_0x1ec9e1,function(_0x1aa33e){if(_0x1aa33e[_0xf9ba('0x2f')]!==_0xf9ba('0x40')){var _0x219067={};_0x219067[_0x1aa33e[_0xf9ba('0x2a')]]={'$like':'%'+_0x1ff183['query'][_0xf9ba('0x3d')]+'%'};return _0x219067;}})});}_0x55829d=_[_0xf9ba('0x3f')]({},_0x55829d,_0x1ff183[_0xf9ba('0x41')]);var _0x2d7b13={'where':_0x55829d[_0xf9ba('0x3e')]};return db[_0xf9ba('0x42')][_0xf9ba('0x1f')](_0x2d7b13)[_0xf9ba('0x26')](function(_0x20c711){_0x21bb75['count']=_0x20c711;if(_0x1ff183[_0xf9ba('0x32')][_0xf9ba('0x43')]){_0x55829d['include']=[{'all':!![]}];}return db[_0xf9ba('0x42')][_0xf9ba('0x44')](_0x55829d);})[_0xf9ba('0x26')](function(_0x47dd69){_0x21bb75[_0xf9ba('0x45')]=_0x47dd69;return _0x21bb75;})[_0xf9ba('0x26')](respondWithFilteredResult(_0x19c57e,_0x55829d))[_0xf9ba('0x46')](handleError(_0x19c57e,null));};exports[_0xf9ba('0x47')]=function(_0x242e06,_0x57e8c6){var _0x30c4d7={'raw':!![],'where':{'id':_0x242e06[_0xf9ba('0x48')]['id']}},_0x3fbf21={};_0x3fbf21[_0xf9ba('0x31')]=_[_0xf9ba('0x49')](db[_0xf9ba('0x42')][_0xf9ba('0x2d')]);_0x3fbf21[_0xf9ba('0x32')]=_[_0xf9ba('0x49')](_0x242e06[_0xf9ba('0x32')]);_0x3fbf21[_0xf9ba('0x3c')]=_[_0xf9ba('0x33')](_0x3fbf21[_0xf9ba('0x31')],_0x3fbf21['query']);_0x30c4d7[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3fbf21['model'],qs[_0xf9ba('0x35')](_0x242e06['query'][_0xf9ba('0x35')]));_0x30c4d7[_0xf9ba('0x34')]=_0x30c4d7[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x30c4d7['attributes']:_0x3fbf21[_0xf9ba('0x31')];if(_0x242e06[_0xf9ba('0x32')][_0xf9ba('0x43')]){_0x30c4d7[_0xf9ba('0x4a')]=[{'all':!![]}];}_0x30c4d7=_['merge']({},_0x30c4d7,_0x242e06[_0xf9ba('0x41')]);return db[_0xf9ba('0x42')]['find'](_0x30c4d7)[_0xf9ba('0x26')](handleEntityNotFound(_0x57e8c6,null))[_0xf9ba('0x26')](respondWithResult(_0x57e8c6,null))[_0xf9ba('0x46')](handleError(_0x57e8c6,null));};exports['create']=function(_0x577151,_0x47547d){return db['ChatTransferReport'][_0xf9ba('0x4b')](_0x577151[_0xf9ba('0x4c')],{})['then'](respondWithResult(_0x47547d,0xc9))['catch'](handleError(_0x47547d,null));};exports['update']=function(_0x28fc45,_0x4ffc4b){if(_0x28fc45['body']['id']){delete _0x28fc45[_0xf9ba('0x4c')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x28fc45[_0xf9ba('0x48')]['id']}})[_0xf9ba('0x26')](handleEntityNotFound(_0x4ffc4b,null))[_0xf9ba('0x26')](saveUpdates(_0x28fc45[_0xf9ba('0x4c')],null))['then'](respondWithResult(_0x4ffc4b,null))[_0xf9ba('0x46')](handleError(_0x4ffc4b,null));};exports[_0xf9ba('0x27')]=function(_0x277ef0,_0xd9a2b6){return db['ChatTransferReport'][_0xf9ba('0x4d')]({'where':{'id':_0x277ef0['params']['id']}})[_0xf9ba('0x26')](handleEntityNotFound(_0xd9a2b6,null))[_0xf9ba('0x26')](removeEntity(_0xd9a2b6,null))[_0xf9ba('0x46')](handleError(_0xd9a2b6,null));};exports['describe']=function(_0x51b407,_0x17c061){return db[_0xf9ba('0x42')][_0xf9ba('0x4e')]()[_0xf9ba('0x26')](respondWithResult(_0x17c061,null))[_0xf9ba('0x46')](handleError(_0x17c061,null));};
\ No newline at end of file
+var _0x694a=['hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','length','includeAll','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x2f1cdd,_0x1ffdd7){var _0x5d0956=function(_0x137108){while(--_0x137108){_0x2f1cdd['push'](_0x2f1cdd['shift']());}};_0x5d0956(++_0x1ffdd7);}(_0x694a,0x13f));var _0xa694=function(_0x105702,_0x3d4a6c){_0x105702=_0x105702-0x0;var _0x10ff6b=_0x694a[_0x105702];return _0x10ff6b;};'use strict';var emlformat=require(_0xa694('0x0'));var rimraf=require(_0xa694('0x1'));var zipdir=require(_0xa694('0x2'));var jsonpatch=require(_0xa694('0x3'));var rp=require(_0xa694('0x4'));var moment=require(_0xa694('0x5'));var BPromise=require(_0xa694('0x6'));var Mustache=require(_0xa694('0x7'));var util=require('util');var path=require(_0xa694('0x8'));var sox=require('sox');var csv=require(_0xa694('0x9'));var ejs=require(_0xa694('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa694('0xb'));var squel=require(_0xa694('0xc'));var crypto=require('crypto');var jsforce=require(_0xa694('0xd'));var deskjs=require(_0xa694('0xe'));var toCsv=require(_0xa694('0x9'));var querystring=require(_0xa694('0xf'));var Papa=require(_0xa694('0x10'));var Redis=require('ioredis');var authService=require(_0xa694('0x11'));var qs=require(_0xa694('0x12'));var as=require(_0xa694('0x13'));var hardwareService=require(_0xa694('0x14'));var logger=require(_0xa694('0x15'))(_0xa694('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa694('0x17'));var db=require(_0xa694('0x18'))['db'];function respondWithStatusCode(_0xd34c8d,_0x521a91){_0x521a91=_0x521a91||0xcc;return function(_0x53bf9a){if(_0x53bf9a){return _0xd34c8d[_0xa694('0x19')](_0x521a91);}return _0xd34c8d['status'](_0x521a91)[_0xa694('0x1a')]();};}function respondWithResult(_0xbbe9c9,_0x11746b){_0x11746b=_0x11746b||0xc8;return function(_0x3aa6a6){if(_0x3aa6a6){return _0xbbe9c9[_0xa694('0x1b')](_0x11746b)['json'](_0x3aa6a6);}};}function respondWithFilteredResult(_0x1f3e37,_0x4a9763){return function(_0x573cea){if(_0x573cea){var _0x5091da=typeof _0x4a9763[_0xa694('0x1c')]==='undefined'&&typeof _0x4a9763[_0xa694('0x1d')]===_0xa694('0x1e');var _0x4cf929=_0x573cea[_0xa694('0x1f')];var _0x429524=_0x5091da?0x0:_0x4a9763[_0xa694('0x1c')];var _0x54f93d=_0x5091da?_0x573cea['count']:_0x4a9763[_0xa694('0x1c')]+_0x4a9763[_0xa694('0x1d')];var _0x4b1e26;if(_0x54f93d>=_0x4cf929){_0x54f93d=_0x4cf929;_0x4b1e26=0xc8;}else{_0x4b1e26=0xce;}_0x1f3e37['status'](_0x4b1e26);return _0x1f3e37[_0xa694('0x20')](_0xa694('0x21'),_0x429524+'-'+_0x54f93d+'/'+_0x4cf929)[_0xa694('0x22')](_0x573cea);}return null;};}function patchUpdates(_0x1f863e){return function(_0x4a9f4c){try{jsonpatch[_0xa694('0x23')](_0x4a9f4c,_0x1f863e,!![]);}catch(_0xfd05a3){return BPromise[_0xa694('0x24')](_0xfd05a3);}return _0x4a9f4c['save']();};}function saveUpdates(_0x4c8060,_0x321d72){return function(_0x22792c){if(_0x22792c){return _0x22792c[_0xa694('0x25')](_0x4c8060)[_0xa694('0x26')](function(_0x4150d9){return _0x4150d9;});}return null;};}function removeEntity(_0x27d51f,_0x21f538){return function(_0x4f401e){if(_0x4f401e){return _0x4f401e[_0xa694('0x27')]()[_0xa694('0x26')](function(){_0x27d51f['status'](0xcc)[_0xa694('0x1a')]();});}};}function handleEntityNotFound(_0x1ee200,_0x51efc2){return function(_0x337454){if(!_0x337454){_0x1ee200[_0xa694('0x19')](0x194);}return _0x337454;};}function handleError(_0x5332a0,_0x1f1c44){_0x1f1c44=_0x1f1c44||0x1f4;return function(_0x3721b7){logger[_0xa694('0x28')](_0x3721b7[_0xa694('0x29')]);if(_0x3721b7['name']){delete _0x3721b7[_0xa694('0x2a')];}_0x5332a0[_0xa694('0x1b')](_0x1f1c44)['send'](_0x3721b7);};}exports[_0xa694('0x2b')]=function(_0x3cc967,_0x2f3331){var _0x347391={},_0x27ace6={},_0x2fa8f3={'count':0x0,'rows':[]};var _0x408f93=_[_0xa694('0x2c')](db[_0xa694('0x2d')][_0xa694('0x2e')],function(_0x2180b9){return{'name':_0x2180b9['fieldName'],'type':_0x2180b9[_0xa694('0x2f')][_0xa694('0x30')]};});_0x27ace6[_0xa694('0x31')]=_[_0xa694('0x2c')](_0x408f93,_0xa694('0x2a'));_0x27ace6['query']=_[_0xa694('0x32')](_0x3cc967[_0xa694('0x33')]);_0x27ace6[_0xa694('0x34')]=_[_0xa694('0x35')](_0x27ace6[_0xa694('0x31')],_0x27ace6[_0xa694('0x33')]);_0x347391[_0xa694('0x36')]=_[_0xa694('0x35')](_0x27ace6['model'],qs['fields'](_0x3cc967[_0xa694('0x33')][_0xa694('0x37')]));_0x347391['attributes']=_0x347391['attributes']['length']?_0x347391[_0xa694('0x36')]:_0x27ace6[_0xa694('0x31')];if(!_0x3cc967[_0xa694('0x33')][_0xa694('0x38')]('nolimit')){_0x347391[_0xa694('0x1d')]=qs[_0xa694('0x1d')](_0x3cc967[_0xa694('0x33')][_0xa694('0x1d')]);_0x347391['offset']=qs['offset'](_0x3cc967[_0xa694('0x33')]['offset']);}_0x347391['order']=qs[_0xa694('0x39')](_0x3cc967[_0xa694('0x33')][_0xa694('0x39')]);_0x347391['where']=qs[_0xa694('0x34')](_[_0xa694('0x3a')](_0x3cc967[_0xa694('0x33')],_0x27ace6[_0xa694('0x34')]),_0x408f93);if(_0x3cc967[_0xa694('0x33')][_0xa694('0x3b')]){_0x347391[_0xa694('0x3c')]=_[_0xa694('0x3d')](_0x347391[_0xa694('0x3c')],{'$or':_[_0xa694('0x2c')](_0x408f93,function(_0x347588){if(_0x347588[_0xa694('0x2f')]!==_0xa694('0x3e')){var _0x497b65={};_0x497b65[_0x347588['name']]={'$like':'%'+_0x3cc967[_0xa694('0x33')]['filter']+'%'};return _0x497b65;}})});}_0x347391=_[_0xa694('0x3d')]({},_0x347391,_0x3cc967['options']);var _0x36f13b={'where':_0x347391[_0xa694('0x3c')]};return db[_0xa694('0x2d')][_0xa694('0x1f')](_0x36f13b)[_0xa694('0x26')](function(_0x5ec545){_0x2fa8f3['count']=_0x5ec545;if(_0x3cc967[_0xa694('0x33')]['includeAll']){_0x347391[_0xa694('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xa694('0x40')](_0x347391);})[_0xa694('0x26')](function(_0x3f4176){_0x2fa8f3['rows']=_0x3f4176;return _0x2fa8f3;})[_0xa694('0x26')](respondWithFilteredResult(_0x2f3331,_0x347391))[_0xa694('0x41')](handleError(_0x2f3331,null));};exports[_0xa694('0x42')]=function(_0x29e820,_0x3e956e){var _0x25400c={'raw':!![],'where':{'id':_0x29e820[_0xa694('0x43')]['id']}},_0x32d791={};_0x32d791['model']=_[_0xa694('0x32')](db[_0xa694('0x2d')]['rawAttributes']);_0x32d791[_0xa694('0x33')]=_['keys'](_0x29e820[_0xa694('0x33')]);_0x32d791[_0xa694('0x34')]=_[_0xa694('0x35')](_0x32d791[_0xa694('0x31')],_0x32d791['query']);_0x25400c[_0xa694('0x36')]=_[_0xa694('0x35')](_0x32d791[_0xa694('0x31')],qs[_0xa694('0x37')](_0x29e820[_0xa694('0x33')][_0xa694('0x37')]));_0x25400c['attributes']=_0x25400c[_0xa694('0x36')][_0xa694('0x44')]?_0x25400c[_0xa694('0x36')]:_0x32d791[_0xa694('0x31')];if(_0x29e820[_0xa694('0x33')][_0xa694('0x45')]){_0x25400c[_0xa694('0x3f')]=[{'all':!![]}];}_0x25400c=_[_0xa694('0x3d')]({},_0x25400c,_0x29e820[_0xa694('0x46')]);return db[_0xa694('0x2d')]['find'](_0x25400c)['then'](handleEntityNotFound(_0x3e956e,null))[_0xa694('0x26')](respondWithResult(_0x3e956e,null))[_0xa694('0x41')](handleError(_0x3e956e,null));};exports[_0xa694('0x47')]=function(_0x47270f,_0x592d33){return db[_0xa694('0x2d')][_0xa694('0x47')](_0x47270f[_0xa694('0x48')],{})[_0xa694('0x26')](respondWithResult(_0x592d33,0xc9))[_0xa694('0x41')](handleError(_0x592d33,null));};exports[_0xa694('0x25')]=function(_0x42079e,_0x18b272){if(_0x42079e[_0xa694('0x48')]['id']){delete _0x42079e[_0xa694('0x48')]['id'];}return db[_0xa694('0x2d')][_0xa694('0x49')]({'where':{'id':_0x42079e[_0xa694('0x43')]['id']}})[_0xa694('0x26')](handleEntityNotFound(_0x18b272,null))[_0xa694('0x26')](saveUpdates(_0x42079e[_0xa694('0x48')],null))[_0xa694('0x26')](respondWithResult(_0x18b272,null))[_0xa694('0x41')](handleError(_0x18b272,null));};exports['destroy']=function(_0xee0725,_0x5d2e26){return db['ChatTransferReport']['find']({'where':{'id':_0xee0725[_0xa694('0x43')]['id']}})[_0xa694('0x26')](handleEntityNotFound(_0x5d2e26,null))['then'](removeEntity(_0x5d2e26,null))['catch'](handleError(_0x5d2e26,null));};exports['describe']=function(_0x53a5ad,_0x596735){return db['ChatTransferReport'][_0xa694('0x4a')]()[_0xa694('0x26')](respondWithResult(_0x596735,null))['catch'](handleError(_0x596735,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3c92e6d..8d9dfa8 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 _0xfa34=['path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1213eb,_0x254d44){var _0x1cb4bb=function(_0x37c984){while(--_0x37c984){_0x1213eb['push'](_0x1213eb['shift']());}};_0x1cb4bb(++_0x254d44);}(_0xfa34,0xbe));var _0x4fa3=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xfa34[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x4fa3('0x0'));var util=require(_0x4fa3('0x1'));var logger=require(_0x4fa3('0x2'))(_0x4fa3('0x3'));var moment=require(_0x4fa3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fa3('0x5'));var rimraf=require(_0x4fa3('0x6'));var config=require(_0x4fa3('0x7'));var attributes=require(_0x4fa3('0x8'));module['exports']=function(_0x3f3c08,_0x91010e){return _0x3f3c08[_0x4fa3('0x9')](_0x4fa3('0xa'),attributes,{'tableName':_0x4fa3('0xb'),'paranoid':![],'indexes':[{'name':_0x4fa3('0xc'),'fields':[_0x4fa3('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x38bf=['rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x211c04,_0x4f8d4f){var _0x3e9615=function(_0x2f89c1){while(--_0x2f89c1){_0x211c04['push'](_0x211c04['shift']());}};_0x3e9615(++_0x4f8d4f);}(_0x38bf,0x16e));var _0xf38b=function(_0x39ac58,_0x16eb99){_0x39ac58=_0x39ac58-0x0;var _0x359332=_0x38bf[_0x39ac58];return _0x359332;};'use strict';var _=require('lodash');var util=require(_0xf38b('0x0'));var logger=require(_0xf38b('0x1'))('api');var moment=require(_0xf38b('0x2'));var BPromise=require(_0xf38b('0x3'));var rp=require(_0xf38b('0x4'));var fs=require('fs');var path=require(_0xf38b('0x5'));var rimraf=require(_0xf38b('0x6'));var config=require('../../config/environment');var attributes=require(_0xf38b('0x7'));module[_0xf38b('0x8')]=function(_0x5afe81,_0xfff9be){return _0x5afe81['define'](_0xf38b('0x9'),attributes,{'tableName':_0xf38b('0xa'),'paranoid':![],'indexes':[{'name':_0xf38b('0xb'),'fields':[_0xf38b('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 b599ded..1a9bd75 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 _0xb1fb=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','randomstring'];(function(_0x3bea28,_0x42a177){var _0xfcc523=function(_0x20bea0){while(--_0x20bea0){_0x3bea28['push'](_0x3bea28['shift']());}};_0xfcc523(++_0x42a177);}(_0xb1fb,0xec));var _0xbb1f=function(_0x4d18c8,_0x43a0d1){_0x4d18c8=_0x4d18c8-0x0;var _0x4314c9=_0xb1fb[_0x4d18c8];return _0x4314c9;};'use strict';var _=require('lodash');var util=require(_0xbb1f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbb1f('0x1'));var fs=require('fs');var Redis=require(_0xbb1f('0x2'));var db=require(_0xbb1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb1f('0x4'))('rpc');var config=require(_0xbb1f('0x5'));var jayson=require(_0xbb1f('0x6'));var client=jayson[_0xbb1f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33cad5,_0x4022,_0x2cb5e8){return new BPromise(function(_0x190189,_0x4ffd16){return client['request'](_0x33cad5,_0x2cb5e8)[_0xbb1f('0x8')](function(_0x169479){logger['info'](_0xbb1f('0x9'),_0x4022,_0xbb1f('0xa'));logger['debug'](_0xbb1f('0xb'),_0x4022,_0xbb1f('0xa'),JSON[_0xbb1f('0xc')](_0x169479));if(_0x169479[_0xbb1f('0xd')]){if(_0x169479[_0xbb1f('0xd')][_0xbb1f('0xe')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4022,_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);return _0x4ffd16(_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);}logger[_0xbb1f('0xd')](_0xbb1f('0x9'),_0x4022,_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);return _0x190189(_0x169479[_0xbb1f('0xd')][_0xbb1f('0xf')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4022,_0xbb1f('0xa'));_0x190189(_0x169479['result'][_0xbb1f('0xf')]);}})[_0xbb1f('0x10')](function(_0x1caa45){logger[_0xbb1f('0xd')](_0xbb1f('0x9'),_0x4022,_0x1caa45);_0x4ffd16(_0x1caa45);});});}
\ No newline at end of file
+var _0x7443=['request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x12d287,_0x1953e6){var _0xf8e217=function(_0x48d64d){while(--_0x48d64d){_0x12d287['push'](_0x12d287['shift']());}};_0xf8e217(++_0x1953e6);}(_0x7443,0x1aa));var _0x3744=function(_0x32f9ce,_0x3937be){_0x32f9ce=_0x32f9ce-0x0;var _0x3de330=_0x7443[_0x32f9ce];return _0x3de330;};'use strict';var _=require('lodash');var util=require(_0x3744('0x0'));var moment=require(_0x3744('0x1'));var BPromise=require(_0x3744('0x2'));var rs=require(_0x3744('0x3'));var fs=require('fs');var Redis=require(_0x3744('0x4'));var db=require(_0x3744('0x5'))['db'];var utils=require(_0x3744('0x6'));var logger=require(_0x3744('0x7'))(_0x3744('0x8'));var config=require(_0x3744('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3744('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a0c77,_0x4d553a,_0x30739e){return new BPromise(function(_0x28ab15,_0x2fe67f){return client[_0x3744('0xb')](_0x2a0c77,_0x30739e)[_0x3744('0xc')](function(_0x3cc9c7){logger['info'](_0x3744('0xd'),_0x4d553a,'request\x20sent');logger[_0x3744('0xe')](_0x3744('0xf'),_0x4d553a,_0x3744('0x10'),JSON[_0x3744('0x11')](_0x3cc9c7));if(_0x3cc9c7[_0x3744('0x12')]){if(_0x3cc9c7[_0x3744('0x12')]['code']===0x1f4){logger[_0x3744('0x12')](_0x3744('0xd'),_0x4d553a,_0x3cc9c7[_0x3744('0x12')][_0x3744('0x13')]);return _0x2fe67f(_0x3cc9c7[_0x3744('0x12')]['message']);}logger[_0x3744('0x12')](_0x3744('0xd'),_0x4d553a,_0x3cc9c7[_0x3744('0x12')]['message']);return _0x28ab15(_0x3cc9c7[_0x3744('0x12')][_0x3744('0x13')]);}else{logger[_0x3744('0x14')](_0x3744('0xd'),_0x4d553a,'request\x20sent');_0x28ab15(_0x3cc9c7[_0x3744('0x15')][_0x3744('0x13')]);}})[_0x3744('0x16')](function(_0x55d05b){logger[_0x3744('0x12')](_0x3744('0xd'),_0x4d553a,_0x55d05b);_0x2fe67f(_0x55d05b);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 1c4c127..dafe12a 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 _0x9d64=['./chatTransferReport.controller','isAuthenticated','get','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d64,0x122));var _0x49d6=function(_0x4a3d63,_0x5cbed5){_0x4a3d63=_0x4a3d63-0x0;var _0x8cbc66=_0x9d64[_0x4a3d63];return _0x8cbc66;};'use strict';var multer=require(_0x49d6('0x0'));var util=require(_0x49d6('0x1'));var path=require(_0x49d6('0x2'));var timeout=require(_0x49d6('0x3'));var express=require(_0x49d6('0x4'));var router=express[_0x49d6('0x5')]();var fs_extra=require(_0x49d6('0x6'));var auth=require(_0x49d6('0x7'));var interaction=require(_0x49d6('0x8'));var config=require(_0x49d6('0x9'));var controller=require(_0x49d6('0xa'));router['get']('/',auth[_0x49d6('0xb')](),controller['index']);router[_0x49d6('0xc')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x49d6('0xc')](_0x49d6('0xd'),auth['isAuthenticated'](),controller[_0x49d6('0xe')]);router[_0x49d6('0xf')]('/',auth['isAuthenticated'](),controller[_0x49d6('0x10')]);router['put'](_0x49d6('0xd'),auth[_0x49d6('0xb')](),controller['update']);router[_0x49d6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x49d6('0x12')]);module[_0x49d6('0x13')]=router;
\ No newline at end of file
+var _0xa412=['isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x42b1ee,_0x443833){var _0x10c32e=function(_0x16f173){while(--_0x16f173){_0x42b1ee['push'](_0x42b1ee['shift']());}};_0x10c32e(++_0x443833);}(_0xa412,0x127));var _0x2a41=function(_0x2b6196,_0x15cc27){_0x2b6196=_0x2b6196-0x0;var _0x403e56=_0xa412[_0x2b6196];return _0x403e56;};'use strict';var multer=require(_0x2a41('0x0'));var util=require(_0x2a41('0x1'));var path=require(_0x2a41('0x2'));var timeout=require(_0x2a41('0x3'));var express=require(_0x2a41('0x4'));var router=express['Router']();var fs_extra=require(_0x2a41('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a41('0x6'));var config=require(_0x2a41('0x7'));var controller=require('./chatTransferReport.controller');router[_0x2a41('0x8')]('/',auth[_0x2a41('0x9')](),controller['index']);router[_0x2a41('0x8')](_0x2a41('0xa'),auth[_0x2a41('0x9')](),controller['describe']);router[_0x2a41('0x8')](_0x2a41('0xb'),auth[_0x2a41('0x9')](),controller[_0x2a41('0xc')]);router[_0x2a41('0xd')]('/',auth[_0x2a41('0x9')](),controller[_0x2a41('0xe')]);router[_0x2a41('0xf')](_0x2a41('0xb'),auth[_0x2a41('0x9')](),controller['update']);router[_0x2a41('0x10')](_0x2a41('0xb'),auth[_0x2a41('0x9')](),controller[_0x2a41('0x11')]);module[_0x2a41('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index b34e31c..b7b43ea 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 _0x8032=['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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#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}}','randomstring','exports','STRING','address','Agent','#011F6A','#ffffff','INTEGER','squared','rounded','We\x20are\x20here!','Chat','Send','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','input','name','text','email','parse','getDataValue','setDataValue','onlineForm','stringify','textarea'];(function(_0x516387,_0x133120){var _0x181646=function(_0x2e4297){while(--_0x2e4297){_0x516387['push'](_0x516387['shift']());}};_0x181646(++_0x133120);}(_0x8032,0x163));var _0x2803=function(_0x26dd96,_0x1e70a6){_0x26dd96=_0x26dd96-0x0;var _0x1aa18f=_0x8032[_0x26dd96];return _0x1aa18f;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2803('0x0'));module[_0x2803('0x1')]={'name':{'type':Sequelize[_0x2803('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'unique':_0x2803('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x2803('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x4')},'customerAlias':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2803('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'defaultValue':_0x2803('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'defaultValue':_0x2803('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2803('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x2803('0x8')),'defaultValue':_0x2803('0x9')},'header_online':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xa')},'start_chat_button':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xb')},'offline_chat_button':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xc')},'header_offline':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x2803('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2803('0xf')]},'closingQuestion':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x12')},'noteTitle':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x13')},'placeholderMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x14')},'closingMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x15')},'closingMessageButton':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xc')},'skipMessageButton':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x16')},'conditionAgreement':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x17')},'ratingType':{'type':Sequelize[_0x2803('0x18')](_0x2803('0x19'),_0x2803('0x1a')),'defaultValue':_0x2803('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2803('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2803('0x1b'),'variable':null,'config':{'placeholder':_0x2803('0x1c'),'type':_0x2803('0x1d'),'required':!![]},'props':{'title':_0x2803('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2803('0x1e')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x2803('0x1f')](this[_0x2803('0x20')]('onlineForm')):{};},'set':function(_0x507363){return this[_0x2803('0x21')](_0x2803('0x22'),JSON[_0x2803('0x23')](_0x507363));}},'offlineForm':{'type':Sequelize[_0x2803('0xf')],'defaultValue':function(){return JSON[_0x2803('0x23')]({'items':[{'type':'input','props':{'title':_0x2803('0x1e'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2803('0x1e')},'variable':null},{'type':_0x2803('0x24'),'config':{'placeholder':_0x2803('0x25')},'props':{'title':_0x2803('0x25'),'helpText':_0x2803('0x26')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x2803('0x27'))?JSON[_0x2803('0x1f')](this[_0x2803('0x20')](_0x2803('0x27'))):{};},'set':function(_0x563db1){return this[_0x2803('0x21')](_0x2803('0x27'),JSON[_0x2803('0x23')](_0x563db1));}},'token':{'type':Sequelize[_0x2803('0x2')],'defaultValue':function(){return rs[_0x2803('0x28')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2803('0x2')]},'forwardOffline':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2803('0x2')]},'waitingTitle':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x29')},'waitingMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x2a')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x2803('0x2b')},'offlineMessageBody':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x2c')},'enableUnmanagedNote':{'type':Sequelize[_0x2803('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2803('0xf')],'defaultValue':function(){return _0x2803('0x2d');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2803('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2803('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x2803('0x2f')},'verticalAlignment':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x2803('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x2803('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2803('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2803('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2803('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2803('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2803('0x2')],'defaultValue':_0x2803('0x31')},'systemAvatar':{'type':Sequelize[_0x2803('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2803('0x7')],'comment':_0x2803('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![],'comment':_0x2803('0x33'),'set':function(_0x239011){if(!_0x239011)this[_0x2803('0x21')](_0x2803('0x34'),null);this[_0x2803('0x21')](_0x2803('0x35'),_0x239011);}},'vidaooEscalation':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2803('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2803('0x2')],'allowNull':![],'defaultValue':_0x2803('0x36')},'vidaooNote':{'type':Sequelize[_0x2803('0x2')],'defaultValue':function(){return _0x2803('0x37');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2803('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2803('0xf')]}};
\ No newline at end of file
+var _0xca3e=['#011F6A','#ffffff','INTEGER','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xca3e,0x1a0));var _0xeca3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xca3e[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xeca3('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xeca3('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xeca3('0x2')},'description':{'type':Sequelize[_0xeca3('0x1')]},'mapKey':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x3')},'key':{'type':Sequelize[_0xeca3('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeca3('0x1')],'allowNull':![],'defaultValue':_0xeca3('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeca3('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xeca3('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xeca3('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeca3('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':_0xeca3('0x7')},'header_online':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x8')},'header_offline':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x9')},'download_transcript':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0xb')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xeca3('0xc')]},'closingQuestion':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0xd')},'noteTitle':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeca3('0xe')},'closingMessage':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0xf')},'closingMessageButton':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x8')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xeca3('0x10')},'conditionAgreement':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xeca3('0x11')](_0xeca3('0x12'),_0xeca3('0x13')),'defaultValue':_0xeca3('0x12')},'ratingStarsNumber':{'type':Sequelize[_0xeca3('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeca3('0xc')],'defaultValue':function(){return JSON[_0xeca3('0x14')]({'items':[{'type':_0xeca3('0x15'),'variable':null,'config':{'placeholder':_0xeca3('0x16'),'type':_0xeca3('0x17'),'required':!![]},'props':{'title':_0xeca3('0x16'),'helpText':''}},{'type':'input','props':{'title':_0xeca3('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeca3('0x18')](_0xeca3('0x19'))?JSON[_0xeca3('0x1a')](this[_0xeca3('0x18')](_0xeca3('0x19'))):{};},'set':function(_0x37b42b){return this['setDataValue']('onlineForm',JSON['stringify'](_0x37b42b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xeca3('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xeca3('0x3')},'variable':null},{'type':_0xeca3('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':_0xeca3('0x1c'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xeca3('0x18')](_0xeca3('0x1d'))?JSON['parse'](this['getDataValue']('offlineForm')):{};},'set':function(_0x218bea){return this['setDataValue'](_0xeca3('0x1d'),JSON[_0xeca3('0x14')](_0x218bea));}},'token':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':function(){return rs[_0xeca3('0x1e')]();}},'autoclose':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeca3('0x1')]},'forwardOffline':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeca3('0x1')]},'waitingTitle':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x1f')},'waitingMessage':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x21')},'offlineMessageBody':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x22')},'skipUnmanaged':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x10')},'sendUnmanaged':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x8')},'enableCustomerAttachment':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xeca3('0xc')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xeca3('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xeca3('0x23');}},'notificationSound':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xeca3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xeca3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x24')},'verticalAlignment':{'type':Sequelize[_0xeca3('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':_0xeca3('0x25')},'defaultTitle':{'type':Sequelize[_0xeca3('0x1')]},'customerAvatar':{'type':Sequelize[_0xeca3('0xc')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeca3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeca3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xeca3('0x26')},'systemAvatar':{'type':Sequelize[_0xeca3('0xc')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeca3('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![],'comment':_0xeca3('0x27'),'set':function(_0x53077e){if(!_0x53077e)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xeca3('0x28')]('mandatoryDisposition',_0x53077e);}},'vidaooEscalation':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeca3('0x1')]},'vidaooTopic':{'type':Sequelize[_0xeca3('0x1')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xeca3('0x1')],'defaultValue':function(){return _0xeca3('0x29');}},'vidaooMetadata':{'type':Sequelize[_0xeca3('0xc')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeca3('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeca3('0xc')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ce07d77..40961e5 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 _0xb138=['getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','chat','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','notify','offline','Sequelize','no\x20available\x20attributes','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','ValidationError','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','fromString','originalname','server','files','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','user','MailAccountId','mimetype','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','interval','getProactiveActions','virtual','License','ifTime','readFileSync','server/files/chat/iframe.ejs','3.13.0','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','labelText','textButtonColor','color_button','READ_COMMITTED','findAndCountAll','stack','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','APIBadRequestError','../../errors/api','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','send','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','model','vendor','%s\x20%s\x20%s','type','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Pause','find','create','address','split','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','root','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar'];(function(_0x64b2e1,_0x4b12fe){var _0x1ca8cd=function(_0x38992b){while(--_0x38992b){_0x64b2e1['push'](_0x64b2e1['shift']());}};_0x1ca8cd(++_0x4b12fe);}(_0xb138,0x1dd));var _0x8b13=function(_0x3df38b,_0x46223e){_0x3df38b=_0x3df38b-0x0;var _0x5e5e22=_0xb138[_0x3df38b];return _0x5e5e22;};'use strict';var Mustache=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var ejs=require(_0x8b13('0x3'));var fs=require('fs');var fs_extra=require(_0x8b13('0x4'));var _=require(_0x8b13('0x5'));var querystring=require(_0x8b13('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0x8b13('0x7'));var jayson=require(_0x8b13('0x8'));var qs=require(_0x8b13('0x9'));var logger=require('../../config/logger')(_0x8b13('0xa'));var config=require(_0x8b13('0xb'));var APIBadRequestError=require('../../errors/api')[_0x8b13('0xc')];var APINotFoundError=require(_0x8b13('0xd'))[_0x8b13('0xe')];var APIOutOfIntervalError=require('../../errors/api')[_0x8b13('0xf')];var APIHandleError=require(_0x8b13('0xd'))['handleError'];var APIConflictError=require('../../errors/api')[_0x8b13('0x10')];var wildcardUtils=require(_0x8b13('0x11'));var URL=require(_0x8b13('0x12'))[_0x8b13('0x13')];var db=require(_0x8b13('0x14'))['db'];config['redis']=_[_0x8b13('0x15')](config[_0x8b13('0x16')],{'host':_0x8b13('0x17'),'port':0x18eb});var socket=require(_0x8b13('0x18'))(new Redis(config[_0x8b13('0x16')]));require(_0x8b13('0x19'))['register'](socket);var client=jayson['client'][_0x8b13('0x1a')]({'port':0x232c});var client9002=jayson[_0x8b13('0x1b')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x8b13('0x1b')][_0x8b13('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0xf29086,_0x2c615a,_0x13f956,_0x542357){return new Promise(function(_0x1c6c99,_0xea7881){var _0x393bc1=_0x542357||client;return _0x393bc1[_0x8b13('0x1c')](_0xf29086,_0x13f956)[_0x8b13('0x1d')](function(_0x1fcfe6){logger[_0x8b13('0x1e')](_0x8b13('0x1f'),_0x2c615a,'request\x20sent');logger['debug'](_0x8b13('0x20'),_0x2c615a,_0x8b13('0x21'),JSON[_0x8b13('0x22')](_0x1fcfe6));if(_0x1fcfe6[_0x8b13('0x23')]){if(_0x1fcfe6[_0x8b13('0x23')][_0x8b13('0x24')]===0x1f4){logger['error'](_0x8b13('0x1f'),_0x2c615a,_0x1fcfe6[_0x8b13('0x23')][_0x8b13('0x25')]);return _0xea7881(_0x1fcfe6['error']['message']);}logger[_0x8b13('0x23')](_0x8b13('0x1f'),_0x2c615a,_0x1fcfe6['error'][_0x8b13('0x25')]);return _0x1c6c99(_0x1fcfe6[_0x8b13('0x23')][_0x8b13('0x25')]);}else{logger[_0x8b13('0x1e')](_0x8b13('0x1f'),_0x2c615a,'request\x20sent');_0x1c6c99(_0x1fcfe6[_0x8b13('0x26')][_0x8b13('0x25')]);}})['catch'](function(_0x33422f){logger['error'](_0x8b13('0x1f'),_0x2c615a,_0x33422f);_0xea7881(_0x33422f);});});}function respondWithStatusCode(_0x325d68,_0x54786a){_0x54786a=_0x54786a||0xcc;return function(_0x3f1756){if(_0x3f1756){return _0x325d68[_0x8b13('0x27')](_0x54786a);}return _0x325d68['status'](_0x54786a)[_0x8b13('0x28')]();};}function respondWithResult(_0x14a739,_0x410122){_0x410122=_0x410122||0xc8;return function(_0x4048e4){if(_0x4048e4){return _0x14a739[_0x8b13('0x29')](_0x410122)['json'](_0x4048e4);}};}function respondWithFilteredResult(_0x6023f5,_0x1b09e2){return function(_0x3475d8){if(_0x3475d8){var _0x1511bf=typeof _0x1b09e2[_0x8b13('0x2a')]===_0x8b13('0x2b')&&typeof _0x1b09e2['limit']===_0x8b13('0x2b');var _0xfec033=_0x3475d8[_0x8b13('0x2c')];var _0x9d2377=_0x1511bf?0x0:_0x1b09e2[_0x8b13('0x2a')];var _0x29946e=_0x1511bf?_0x3475d8[_0x8b13('0x2c')]:_0x1b09e2[_0x8b13('0x2a')]+_0x1b09e2[_0x8b13('0x2d')];var _0x5751db;if(_0x29946e>=_0xfec033){_0x29946e=_0xfec033;_0x5751db=0xc8;}else{_0x5751db=0xce;}_0x6023f5[_0x8b13('0x29')](_0x5751db);return _0x6023f5[_0x8b13('0x2e')](_0x8b13('0x2f'),_0x9d2377+'-'+_0x29946e+'/'+_0xfec033)[_0x8b13('0x30')](_0x3475d8);}return null;};}function saveUpdates(_0x51a334){return function(_0x4f7d91){if(_0x4f7d91){return _0x4f7d91[_0x8b13('0x31')](_0x51a334)['then'](function(_0x5663fa){return _0x5663fa;});}return null;};}function removeEntity(_0x3b1dfa){return function(_0x535521){if(_0x535521){return _0x535521[_0x8b13('0x32')]()[_0x8b13('0x1d')](function(){var _0x40fc29=_0x535521[_0x8b13('0x33')]({'plain':!![]});var _0x11657e=_0x8b13('0x34');return db[_0x8b13('0x35')][_0x8b13('0x32')]({'where':{'type':_0x11657e,'resourceId':_0x40fc29['id']}})[_0x8b13('0x1d')](function(){return _0x535521;});})[_0x8b13('0x1d')](function(){_0x3b1dfa['status'](0xcc)[_0x8b13('0x28')]();});}};}function handleEntityNotFound(_0x31f5bd){return function(_0x19b21c){if(!_0x19b21c){_0x31f5bd[_0x8b13('0x27')](0x194);}return _0x19b21c;};}function handleError(_0x1ff25c,_0x24179a){_0x24179a=_0x24179a||0x1f4;return function(_0x6b4645){logger[_0x8b13('0x23')](_0x6b4645['stack']);if(_0x6b4645[_0x8b13('0x36')]){delete _0x6b4645['name'];}_0x1ff25c[_0x8b13('0x29')](_0x24179a)[_0x8b13('0x37')](_0x6b4645);};}function createInteractionObject(_0x2a8f6b,_0x5e63f6,_0x2bf1b0,_0x327eb1){var _0x4ec1a5=require('user-agent-parser');var _0xe6963d=new _0x4ec1a5();var _0x5daee9=_0xe6963d[_0x8b13('0x38')](_0x2bf1b0['user-agent'])[_0x8b13('0x39')]();var _0x3a8e06=_0x5e63f6[_0x8b13('0x3a')];if(_0x2bf1b0[_0x8b13('0x3b')]){_0x3a8e06=_0x2bf1b0[_0x8b13('0x3b')];}else if(_0x2bf1b0['x-forwarded-for']){_0x3a8e06=_['first'](_0x2bf1b0[_0x8b13('0x3c')]['split'](','));}return{'ContactId':_0x327eb1['id'],'ChatWebsiteId':_0x2a8f6b,'from':(_0x327eb1[_0x8b13('0x3d')]||'')+'\x20'+(_0x327eb1[_0x8b13('0x3e')]||''),'customerIp':_0x3a8e06,'customerPort':_0x2bf1b0['x-real-port']?_0x2bf1b0[_0x8b13('0x3f')]:null,'referer':_0x5e63f6[_0x8b13('0x40')],'browserName':_0x5daee9[_0x8b13('0x41')][_0x8b13('0x36')]&&_0x5daee9[_0x8b13('0x41')][_0x8b13('0x42')]?util[_0x8b13('0x43')]('%s\x20%s',_0x5daee9['browser']['name'],_0x5daee9[_0x8b13('0x41')][_0x8b13('0x42')]):_0x8b13('0x44'),'browserVersion':_0x5daee9[_0x8b13('0x41')][_0x8b13('0x42')]||_0x8b13('0x44'),'osName':util['format'](_0x8b13('0x45'),_0x5daee9['os']['name'],_0x5daee9['os'][_0x8b13('0x42')]),'osVersion':_0x5daee9['os']['version'],'deviceModel':_0x5daee9[_0x8b13('0x46')][_0x8b13('0x47')]&&_0x5daee9[_0x8b13('0x46')][_0x8b13('0x48')]?util[_0x8b13('0x43')](_0x8b13('0x49'),_0x5daee9[_0x8b13('0x46')]['model'],_0x5daee9['device']['vendor'],_0x5daee9[_0x8b13('0x46')][_0x8b13('0x4a')]):null,'deviceVendor':_0x5daee9[_0x8b13('0x46')][_0x8b13('0x48')],'deviceType':_0x5daee9['device']['type'],'formData':JSON[_0x8b13('0x22')](_0x5e63f6)};}exports['index']=function(_0x24262a,_0x10928d){var _0x20c363={'include':[{'model':db['Pause'],'as':_0x8b13('0x4b')}]},_0x28ae75={},_0x46556f={'count':0x0,'rows':[]};var _0x2044fc=_[_0x8b13('0x4c')](db[_0x8b13('0x4d')][_0x8b13('0x4e')],function(_0x2619df){return{'name':_0x2619df[_0x8b13('0x4f')],'type':_0x2619df[_0x8b13('0x4a')][_0x8b13('0x50')]};});_0x28ae75['model']=_[_0x8b13('0x4c')](_0x2044fc,'name');_0x28ae75[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0x24262a[_0x8b13('0x51')]);_0x28ae75['filters']=_[_0x8b13('0x53')](_0x28ae75[_0x8b13('0x47')],_0x28ae75[_0x8b13('0x51')]);_0x20c363[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x28ae75[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x24262a['query'][_0x8b13('0x55')]));_0x20c363['attributes']=_0x20c363[_0x8b13('0x54')][_0x8b13('0x56')]?_0x20c363[_0x8b13('0x54')]:_0x28ae75[_0x8b13('0x47')];if(!_0x24262a[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0x20c363[_0x8b13('0x2d')]=qs[_0x8b13('0x2d')](_0x24262a[_0x8b13('0x51')][_0x8b13('0x2d')]);_0x20c363[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0x24262a[_0x8b13('0x51')][_0x8b13('0x2a')]);}_0x20c363[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x24262a['query'][_0x8b13('0x5a')]);_0x20c363[_0x8b13('0x5b')]=qs['filters'](_[_0x8b13('0x5c')](_0x24262a[_0x8b13('0x51')],_0x28ae75[_0x8b13('0x5d')]),_0x2044fc);if(_0x24262a[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x20c363[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0x20c363[_0x8b13('0x5b')],{'$or':_[_0x8b13('0x4c')](_0x2044fc,function(_0x1ff311){if(_0x1ff311[_0x8b13('0x4a')]!==_0x8b13('0x60')){var _0x137e8c={};_0x137e8c[_0x1ff311[_0x8b13('0x36')]]={'$like':'%'+_0x24262a[_0x8b13('0x51')]['filter']+'%'};return _0x137e8c;}})});}_0x20c363=_[_0x8b13('0x5f')]({},_0x20c363,_0x24262a[_0x8b13('0x61')]);var _0x47a3fa={'where':_0x20c363[_0x8b13('0x5b')]};return db[_0x8b13('0x4d')][_0x8b13('0x2c')](_0x47a3fa)[_0x8b13('0x1d')](function(_0x1263f4){_0x46556f['count']=_0x1263f4;if(_0x24262a[_0x8b13('0x51')][_0x8b13('0x62')]){_0x20c363[_0x8b13('0x63')]=[{'all':!![]}];}return db['ChatWebsite'][_0x8b13('0x64')](_0x20c363);})[_0x8b13('0x1d')](function(_0x585392){_0x46556f[_0x8b13('0x65')]=_0x585392;return _0x46556f;})[_0x8b13('0x1d')](respondWithFilteredResult(_0x10928d,_0x20c363))[_0x8b13('0x66')](handleError(_0x10928d,null));};exports[_0x8b13('0x67')]=function(_0x49e5cd,_0x13c8bd){var _0x28d568={'raw':![],'where':{'id':_0x49e5cd[_0x8b13('0x68')]['id']},'include':[{'model':db[_0x8b13('0x69')],'as':_0x8b13('0x4b')}]},_0x52e705={};_0x52e705[_0x8b13('0x47')]=_['keys'](db[_0x8b13('0x4d')][_0x8b13('0x4e')]);_0x52e705[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0x49e5cd[_0x8b13('0x51')]);_0x52e705[_0x8b13('0x5d')]=_['intersection'](_0x52e705[_0x8b13('0x47')],_0x52e705[_0x8b13('0x51')]);_0x28d568[_0x8b13('0x54')]=_['intersection'](_0x52e705[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x49e5cd[_0x8b13('0x51')][_0x8b13('0x55')]));_0x28d568['attributes']=_0x28d568['attributes']['length']?_0x28d568['attributes']:_0x52e705['model'];if(_0x49e5cd[_0x8b13('0x51')][_0x8b13('0x62')]){_0x28d568['include']=[{'all':!![]}];}_0x28d568=_[_0x8b13('0x5f')]({},_0x28d568,_0x49e5cd['options']);return db[_0x8b13('0x4d')][_0x8b13('0x6a')](_0x28d568)[_0x8b13('0x1d')](handleEntityNotFound(_0x13c8bd,null))[_0x8b13('0x1d')](respondWithResult(_0x13c8bd,null))[_0x8b13('0x66')](handleError(_0x13c8bd,null));};exports[_0x8b13('0x6b')]=function(_0xa7c7d5,_0x4c433c){var _0xe7e8eb=null;_0xa7c7d5['body'][_0x8b13('0x6c')][_0x8b13('0x6d')](',')[_0x8b13('0x6e')](_0x11a4ba=>{if(_0x11a4ba[_0x8b13('0x6f')]()!==''&&!wildcardUtils[_0x8b13('0x70')](_0x11a4ba[_0x8b13('0x6f')]())){_0xe7e8eb=new APIBadRequestError('\x22'+_0x11a4ba['trim']()+_0x8b13('0x71'));}});if(_0xe7e8eb){return handleError(_0x4c433c,null)(_0xe7e8eb);}return db['ChatWebsite'][_0x8b13('0x6b')](_0xa7c7d5[_0x8b13('0x72')],{})[_0x8b13('0x1d')](function(_0x177f73){var _0x177a64=_0xa7c7d5['user']['get']({'plain':!![]});if(!_0x177a64)throw new Error(_0x8b13('0x73'));if(_0x177a64[_0x8b13('0x74')]==='user'){var _0x180866=_0x177f73[_0x8b13('0x33')]({'plain':!![]});var _0x670b3e='ChatWebsites';return db[_0x8b13('0x75')][_0x8b13('0x6a')]({'where':{'name':_0x670b3e,'userProfileId':_0x177a64[_0x8b13('0x76')]},'raw':!![]})[_0x8b13('0x1d')](function(_0x52850c){if(_0x52850c&&_0x52850c[_0x8b13('0x77')]===0x0){return db[_0x8b13('0x35')]['create']({'name':_0x180866[_0x8b13('0x36')],'resourceId':_0x180866['id'],'type':_0x52850c[_0x8b13('0x36')],'sectionId':_0x52850c['id']},{})[_0x8b13('0x1d')](function(){return _0x177f73;});}else{return _0x177f73;}})[_0x8b13('0x66')](function(_0x45fe23){logger[_0x8b13('0x23')](_0x8b13('0x78'),_0x45fe23);throw _0x45fe23;});}return _0x177f73;})[_0x8b13('0x1d')](respondWithResult(_0x4c433c,0xc9))[_0x8b13('0x66')](handleError(_0x4c433c,null));};exports[_0x8b13('0x31')]=function(_0x2f2bc5,_0x46c25c){var _0x26b888=null;_0x2f2bc5[_0x8b13('0x72')]['address'][_0x8b13('0x6d')](',')['forEach'](_0x14dee4=>{if(_0x14dee4[_0x8b13('0x6f')]()!==''&&!wildcardUtils[_0x8b13('0x70')](_0x14dee4[_0x8b13('0x6f')]())){_0x26b888=new APIBadRequestError('\x22'+_0x14dee4['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x26b888){return handleError(_0x46c25c,null)(_0x26b888);}if(_0x2f2bc5[_0x8b13('0x72')]['id']){delete _0x2f2bc5[_0x8b13('0x72')]['id'];}return db['ChatWebsite'][_0x8b13('0x6a')]({'where':{'id':_0x2f2bc5[_0x8b13('0x68')]['id']},'include':[{'model':db[_0x8b13('0x69')],'as':_0x8b13('0x4b')}]})[_0x8b13('0x1d')](handleEntityNotFound(_0x46c25c,null))[_0x8b13('0x1d')](saveUpdates(_0x2f2bc5[_0x8b13('0x72')],null))[_0x8b13('0x1d')](respondWithResult(_0x46c25c,null))[_0x8b13('0x66')](handleError(_0x46c25c,null));};exports[_0x8b13('0x32')]=function(_0x48fd36,_0x2a1fd3){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x48fd36[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x2a1fd3,null))['then'](removeEntity(_0x2a1fd3,null))[_0x8b13('0x66')](handleError(_0x2a1fd3,null));};exports[_0x8b13('0x79')]=function(_0x1f77b1,_0x1dce78){return db[_0x8b13('0x4d')][_0x8b13('0x79')]()[_0x8b13('0x1d')](respondWithResult(_0x1dce78,null))[_0x8b13('0x66')](handleError(_0x1dce78,null));};exports['addDisposition']=function(_0x2642b1,_0x213b43){if(_0x2642b1[_0x8b13('0x72')]['id']){delete _0x2642b1['body']['id'];}return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x2642b1[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x213b43,null))[_0x8b13('0x1d')](function(_0x40fefa){if(_0x40fefa){_0x2642b1[_0x8b13('0x72')][_0x8b13('0x7a')]=_0x40fefa['id'];return db[_0x8b13('0x7b')][_0x8b13('0x6b')](_0x2642b1[_0x8b13('0x72')]);}})[_0x8b13('0x1d')](respondWithResult(_0x213b43,null))['catch'](handleError(_0x213b43,null));};exports[_0x8b13('0x7c')]=function(_0x111a4f,_0x235b61){var _0xc76c8b={'raw':![],'where':{}};var _0x15f169={};var _0x120a71={'count':0x0,'rows':[]};return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x111a4f[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x235b61,null))[_0x8b13('0x1d')](function(_0x1819fb){if(_0x1819fb){_0x15f169[_0x8b13('0x47')]=_['keys'](db['Disposition'][_0x8b13('0x4e')]);_0x15f169['query']=_[_0x8b13('0x52')](_0x111a4f[_0x8b13('0x51')]);_0x15f169['filters']=_['intersection'](_0x15f169[_0x8b13('0x47')],_0x15f169[_0x8b13('0x51')]);_0xc76c8b[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x15f169[_0x8b13('0x47')],qs['fields'](_0x111a4f[_0x8b13('0x51')]['fields']));_0xc76c8b[_0x8b13('0x54')]=_0xc76c8b[_0x8b13('0x54')]['length']?_0xc76c8b[_0x8b13('0x54')]:_0x15f169[_0x8b13('0x47')];if(!_0x111a4f[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0xc76c8b['limit']=qs[_0x8b13('0x2d')](_0x111a4f[_0x8b13('0x51')][_0x8b13('0x2d')]);_0xc76c8b['offset']=qs[_0x8b13('0x2a')](_0x111a4f['query'][_0x8b13('0x2a')]);}_0xc76c8b[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x111a4f[_0x8b13('0x51')][_0x8b13('0x5a')]);_0xc76c8b[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x111a4f[_0x8b13('0x51')],_0x15f169[_0x8b13('0x5d')]));_0xc76c8b['where'][_0x8b13('0x7a')]=_0x1819fb['id'];if(_0x111a4f[_0x8b13('0x51')][_0x8b13('0x5e')]){_0xc76c8b[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0xc76c8b['where'],{'$or':_[_0x8b13('0x4c')](_0xc76c8b[_0x8b13('0x54')],function(_0x350441){var _0x10bf1a={};_0x10bf1a[_0x350441]={'$like':'%'+_0x111a4f[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x10bf1a;})});}_0xc76c8b=_['merge']({},_0xc76c8b,_0x111a4f[_0x8b13('0x61')]);return db[_0x8b13('0x7b')]['count']({'where':_0xc76c8b[_0x8b13('0x5b')]})['then'](function(_0x1e85eb){_0x120a71['count']=_0x1e85eb;if(_0x111a4f[_0x8b13('0x51')][_0x8b13('0x62')]){_0xc76c8b[_0x8b13('0x63')]=[{'all':!![]}];}return db[_0x8b13('0x7b')][_0x8b13('0x64')](_0xc76c8b);})[_0x8b13('0x1d')](function(_0x165813){_0x120a71[_0x8b13('0x65')]=_0x165813;return _0x120a71;});}})['then'](respondWithFilteredResult(_0x235b61,_0xc76c8b))[_0x8b13('0x66')](handleError(_0x235b61,null));};exports[_0x8b13('0x7e')]=function(_0x5f190a,_0x35c94d){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x5f190a[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x35c94d,null))[_0x8b13('0x1d')](function(_0x42de53){if(_0x42de53){return _0x42de53[_0x8b13('0x7e')](_0x5f190a['query']['ids']);}})[_0x8b13('0x1d')](respondWithStatusCode(_0x35c94d,null))[_0x8b13('0x66')](handleError(_0x35c94d,null));};exports[_0x8b13('0x7f')]=function(_0x36f3af,_0xcafeff){if(_0x36f3af[_0x8b13('0x72')]['id']){delete _0x36f3af[_0x8b13('0x72')]['id'];}return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x36f3af[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0xcafeff,null))[_0x8b13('0x1d')](function(_0xf19be7){if(_0xf19be7){_0x36f3af[_0x8b13('0x72')][_0x8b13('0x7a')]=_0xf19be7['id'];return db[_0x8b13('0x80')]['create'](_0x36f3af[_0x8b13('0x72')]);}})['then'](respondWithResult(_0xcafeff,null))[_0x8b13('0x66')](handleError(_0xcafeff,null));};exports[_0x8b13('0x81')]=function(_0xeb3c0f,_0x394932){var _0x148dde={'raw':![],'where':{}};var _0x402c92={};var _0x7e200e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8b13('0x7d')]({'where':{'id':_0xeb3c0f['params']['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x394932,null))[_0x8b13('0x1d')](function(_0x4db508){if(_0x4db508){_0x402c92['model']=_[_0x8b13('0x52')](db[_0x8b13('0x80')][_0x8b13('0x4e')]);_0x402c92[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0xeb3c0f[_0x8b13('0x51')]);_0x402c92['filters']=_[_0x8b13('0x53')](_0x402c92[_0x8b13('0x47')],_0x402c92['query']);_0x148dde['attributes']=_['intersection'](_0x402c92[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x55')]));_0x148dde[_0x8b13('0x54')]=_0x148dde[_0x8b13('0x54')][_0x8b13('0x56')]?_0x148dde[_0x8b13('0x54')]:_0x402c92['model'];if(!_0xeb3c0f[_0x8b13('0x51')]['hasOwnProperty'](_0x8b13('0x58'))){_0x148dde['limit']=qs[_0x8b13('0x2d')](_0xeb3c0f[_0x8b13('0x51')]['limit']);_0x148dde[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x2a')]);}_0x148dde[_0x8b13('0x59')]=qs['sort'](_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x5a')]);_0x148dde[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_['pick'](_0xeb3c0f[_0x8b13('0x51')],_0x402c92['filters']));_0x148dde[_0x8b13('0x5b')][_0x8b13('0x7a')]=_0x4db508['id'];if(_0xeb3c0f[_0x8b13('0x51')]['filter']){_0x148dde['where']=_['merge'](_0x148dde['where'],{'$or':_[_0x8b13('0x4c')](_0x148dde['attributes'],function(_0x390acb){var _0x4a32ea={};_0x4a32ea[_0x390acb]={'$like':'%'+_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x4a32ea;})});}_0x148dde=_[_0x8b13('0x5f')]({},_0x148dde,_0xeb3c0f[_0x8b13('0x61')]);return db[_0x8b13('0x80')][_0x8b13('0x2c')]({'where':_0x148dde[_0x8b13('0x5b')]})[_0x8b13('0x1d')](function(_0x2a5ed3){_0x7e200e[_0x8b13('0x2c')]=_0x2a5ed3;if(_0xeb3c0f[_0x8b13('0x51')][_0x8b13('0x62')]){_0x148dde[_0x8b13('0x63')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8b13('0x64')](_0x148dde);})['then'](function(_0x592d90){_0x7e200e['rows']=_0x592d90;return _0x7e200e;});}})[_0x8b13('0x1d')](respondWithFilteredResult(_0x394932,_0x148dde))[_0x8b13('0x66')](handleError(_0x394932,null));};exports[_0x8b13('0x82')]=function(_0x9f7c7c,_0x58545c){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x9f7c7c[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x58545c,null))['then'](function(_0x218f95){if(_0x218f95){return _0x218f95[_0x8b13('0x82')](_0x9f7c7c[_0x8b13('0x51')]['ids']);}})[_0x8b13('0x1d')](respondWithStatusCode(_0x58545c,null))[_0x8b13('0x66')](handleError(_0x58545c,null));};exports[_0x8b13('0x83')]=function(_0xf629c6,_0x3f2ac6){_0xf629c6[_0x8b13('0x72')][_0x8b13('0x84')]=_0xf629c6[_0x8b13('0x85')][_0x8b13('0x86')];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0xf629c6[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x3f2ac6,null))[_0x8b13('0x1d')](saveUpdates(_0xf629c6[_0x8b13('0x72')],null))[_0x8b13('0x1d')](respondWithResult(_0x3f2ac6,null))['catch'](handleError(_0x3f2ac6,null));};exports[_0x8b13('0x87')]=function(_0x386b00,_0x350c62){_0x386b00['body'][_0x8b13('0x88')]=_0x386b00['file'][_0x8b13('0x86')];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x386b00['params']['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x350c62,null))[_0x8b13('0x1d')](saveUpdates(_0x386b00[_0x8b13('0x72')],null))['then'](respondWithResult(_0x350c62,null))[_0x8b13('0x66')](handleError(_0x350c62,null));};exports[_0x8b13('0x89')]=function(_0x56d3e5,_0x1d8a81){_0x56d3e5[_0x8b13('0x72')][_0x8b13('0x8a')]=_0x56d3e5[_0x8b13('0x85')]['filename'];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x56d3e5[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x1d8a81,null))[_0x8b13('0x1d')](saveUpdates(_0x56d3e5[_0x8b13('0x72')],null))['then'](respondWithResult(_0x1d8a81,null))[_0x8b13('0x66')](handleError(_0x1d8a81,null));};exports['addSystemAvatar']=function(_0x2e3023,_0x178d6b){_0x2e3023['body']['systemAvatar']=_0x2e3023[_0x8b13('0x85')][_0x8b13('0x86')];return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x2e3023[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x178d6b,null))[_0x8b13('0x1d')](saveUpdates(_0x2e3023[_0x8b13('0x72')],null))[_0x8b13('0x1d')](respondWithResult(_0x178d6b,null))[_0x8b13('0x66')](handleError(_0x178d6b,null));};exports[_0x8b13('0x8b')]=function(_0x49f5f7,_0x305103){var _0x2c2f68=path['join'](config[_0x8b13('0x8c')],'server/files/images/logos/default_logo.svg');var _0x1a9b61={'where':{'id':_0x49f5f7[_0x8b13('0x68')]['id']},'attributes':['id',_0x8b13('0x84')],'raw':!![]};var _0x59ed6e=![];return require(_0x8b13('0x8d'))[_0x8b13('0x8e')]()[_0x8b13('0x1d')](function(_0x3e0cf8){if(_0x3e0cf8){_0x59ed6e=_0x3e0cf8[_0x8b13('0x8f')];}})['then'](function(){return db[_0x8b13('0x4d')][_0x8b13('0x6a')](_0x1a9b61);})[_0x8b13('0x1d')](handleEntityNotFound(_0x305103,null))[_0x8b13('0x1d')](function(_0xfe9601){if(_0xfe9601){if(!_[_0x8b13('0x90')](_0xfe9601['sitepic'])){if(fs[_0x8b13('0x91')](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x93'),_0xfe9601['sitepic']))&&_0x59ed6e){_0x2c2f68=path[_0x8b13('0x92')](config['root'],'server/files/images/logos/',_0xfe9601[_0x8b13('0x84')]);}}return _0x305103[_0x8b13('0x94')](_0x2c2f68);}})['catch'](handleError(_0x305103,null));};exports[_0x8b13('0x95')]=function(_0x4bb94f,_0x38cbc5){var _0x5ac718=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x96'));var _0x4049ae={'where':{'id':_0x4bb94f[_0x8b13('0x68')]['id']},'attributes':['id',_0x8b13('0x88')],'raw':!![]};return db[_0x8b13('0x4d')][_0x8b13('0x6a')](_0x4049ae)[_0x8b13('0x1d')](handleEntityNotFound(_0x38cbc5,null))['then'](function(_0x146e07){if(_0x146e07){if(!_[_0x8b13('0x90')](_0x146e07['agentAvatar'])){if(fs[_0x8b13('0x91')](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],'server/files/images/avatars/',_0x146e07[_0x8b13('0x88')]))){_0x5ac718=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x146e07['agentAvatar']);}}return _0x38cbc5[_0x8b13('0x94')](_0x5ac718);}})[_0x8b13('0x66')](handleError(_0x38cbc5,null));};exports[_0x8b13('0x98')]=function(_0x2ad402,_0x2a44a7){var _0x46d487=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x99'));var _0x3c2bf8={'where':{'id':_0x2ad402[_0x8b13('0x68')]['id']},'attributes':['id','customerAvatar',_0x8b13('0x9a')],'raw':!![]};return db[_0x8b13('0x4d')]['find'](_0x3c2bf8)[_0x8b13('0x1d')](handleEntityNotFound(_0x2a44a7,null))['then'](function(_0x254c92){if(_0x254c92){if(!_[_0x8b13('0x90')](_0x254c92[_0x8b13('0x8a')])){if(fs[_0x8b13('0x91')](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x254c92[_0x8b13('0x8a')]))&&_0x254c92[_0x8b13('0x9a')]){_0x46d487=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x254c92[_0x8b13('0x8a')]);}}return _0x2a44a7[_0x8b13('0x94')](_0x46d487);}})[_0x8b13('0x66')](handleError(_0x2a44a7,null));};exports[_0x8b13('0x9b')]=function(_0x11e8df,_0x406603){var _0x2a31c5=path[_0x8b13('0x92')](config['root'],_0x8b13('0x9c'));var _0x4d8e3c={'where':{'id':_0x11e8df[_0x8b13('0x68')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8b13('0x4d')]['find'](_0x4d8e3c)[_0x8b13('0x1d')](handleEntityNotFound(_0x406603,null))['then'](function(_0x2de36d){if(_0x2de36d){if(!_[_0x8b13('0x90')](_0x2de36d[_0x8b13('0x9d')])){if(fs['existsSync'](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x2de36d[_0x8b13('0x9d')]))){_0x2a31c5=path['join'](config[_0x8b13('0x8c')],_0x8b13('0x97'),_0x2de36d[_0x8b13('0x9d')]);}}return _0x406603[_0x8b13('0x94')](_0x2a31c5);}})[_0x8b13('0x66')](handleError(_0x406603,null));};function checkWebsiteInterval(_0x5f1130){var _0x3a7034=_0x5f1130[_0x8b13('0x9e')];if(!_0x3a7034){return Promise[_0x8b13('0x9f')](_0x5f1130);}var _0x440ba0=_0x5f1130[_0x8b13('0xa0')]||undefined;return _0x3a7034['ifTime'](_0x440ba0)['then'](function(_0x408300){if(!_0x408300){throw new APIOutOfIntervalError();}return _0x5f1130;});}exports['notify']=function(_0x35d90b,_0x3ce2f6){var _0x467779={'body':_0x35d90b[_0x8b13('0x72')],'channel':_0x8b13('0xa1')};var _0x28905c=[];var _0x360e01=[];var _0x146486={};var _0xf31db9=![];if(_0x35d90b[_0x8b13('0x72')]['id']){delete _0x35d90b[_0x8b13('0x72')]['id'];}if(_[_0x8b13('0x90')](_0x35d90b['body']['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_['isNil'](_0x35d90b['body'][_0x8b13('0xa2')])){throw new APIBadRequestError(_0x8b13('0xa3'));}if(_[_0x8b13('0xa4')](_0x35d90b[_0x8b13('0x72')][_0x8b13('0x72')])){throw new APIBadRequestError(_0x8b13('0xa5'));}var _0x33ab8d=_0x35d90b[_0x8b13('0x72')][_0x8b13('0x3a')]&&_0x35d90b[_0x8b13('0x72')]['referer'];return db[_0x8b13('0xa6')][_0x8b13('0x79')]()[_0x8b13('0x1d')](function(_0x5ce5e8){if(!_0x5ce5e8){throw new Error('No\x20available\x20attributes');}_0x28905c=Object[_0x8b13('0x52')](_0x5ce5e8)[_0x8b13('0x5e')](function(_0x5188d5){return![_0x8b13('0xa7'),_0x8b13('0xa8')]['includes'](_0x5188d5);});_0x360e01=Object[_0x8b13('0x52')](_0x5ce5e8)[_0x8b13('0x5e')](function(_0x1ed1d5){return![_0x8b13('0xa7'),_0x8b13('0xa8'),'CompanyId','ListId'][_0x8b13('0xa9')](_0x1ed1d5);});if(!_['includes'](_0x360e01,_0x35d90b[_0x8b13('0x72')][_0x8b13('0xa2')])){throw new APIBadRequestError(_0x8b13('0xaa')+_0x360e01['join'](',\x20'));}_0x146486[_0x35d90b[_0x8b13('0x72')][_0x8b13('0xa2')]]=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xab')];})['then'](function(){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0x35d90b[_0x8b13('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0x8b13('0xac'),'include':[{'model':db[_0x8b13('0xa6')],'as':_0x8b13('0xad'),'where':_0x146486,'limit':0x1,'order':[[_0x8b13('0xa8'),_0x8b13('0xae')]]}]},{'model':db[_0x8b13('0xaf')],'as':_0x8b13('0xb0')},{'model':db[_0x8b13('0x9e')],'as':_0x8b13('0x9e'),'include':[{'model':db[_0x8b13('0x9e')],'as':_0x8b13('0xb1'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x8b13('0x1d')](function(_0xc42df9){if(!_0xc42df9){throw new APINotFoundError(util['format'](_0x8b13('0xb2'),_0x35d90b[_0x8b13('0x68')]['id']));}if(_0x33ab8d){return checkWebsiteInterval(_0xc42df9);}return _0xc42df9;})[_0x8b13('0x1d')](function(_0x2d605e){_0x467779[_0x8b13('0xb3')]=_0x2d605e;_0x467779[_0x8b13('0xb4')]=_[_0x8b13('0xb5')](_0x2d605e[_0x8b13('0xb0')],[_0x8b13('0xb6')],[_0x8b13('0xb7')]);if(_0x467779['account'][_0x8b13('0xb0')]){delete _0x467779['account'][_0x8b13('0xb0')];}_0x467779['list']=_0x2d605e[_0x8b13('0xac')]||{'id':_0x2d605e['ListId']};if(_0x467779[_0x8b13('0xb8')]&&_0x467779['list'][_0x8b13('0xad')][_0x8b13('0x56')]){return _0x467779[_0x8b13('0xb8')][_0x8b13('0xad')][0x0];}var _0x43d524=_[_0x8b13('0x15')](_0x35d90b[_0x8b13('0x72')],{'firstName':_0x35d90b[_0x8b13('0x72')][_0x8b13('0xab')],'ListId':_0x2d605e[_0x8b13('0xb9')]});_0x43d524[_0x35d90b[_0x8b13('0x72')]['mapKey']]=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xab')];return db[_0x8b13('0xa6')][_0x8b13('0x6b')](_0x43d524,{'fields':_0x28905c,'raw':!![]});})['then'](function(_0x50ba6e){_0x467779[_0x8b13('0xba')]=_0x50ba6e;var _0x15c9d8=createInteractionObject(_0x35d90b[_0x8b13('0x68')]['id'],_0x35d90b[_0x8b13('0x72')],_0x35d90b[_0x8b13('0xbb')],_0x50ba6e);var _0x55827a={'ChatWebsiteId':_0x35d90b[_0x8b13('0x68')]['id']};if(_0x35d90b[_0x8b13('0x72')][_0x8b13('0xbc')]){_0x55827a[_0x8b13('0xbc')]=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xbc')];_0x55827a[_0x8b13('0xbd')]=![];return db[_0x8b13('0xbe')][_0x8b13('0x6a')]({'where':_0x55827a})[_0x8b13('0x1d')](function(_0x5cbbe3){var _0x478185=_0x35d90b[_0x8b13('0x72')]['customerIp']&&_0x35d90b[_0x8b13('0x72')]['referer'];if(_0x5cbbe3){_0xf31db9=!![];return _0x5cbbe3;}else if(!_0x478185&&_0x5cbbe3&&_0x5cbbe3[_0x8b13('0xbd')]){throw new APIConflictError(_0x8b13('0xbf'));}_0x15c9d8[_0x8b13('0xbc')]=_0x35d90b[_0x8b13('0x72')]['threadId'];_0x15c9d8[_0x8b13('0xc0')]=_0x35d90b[_0x8b13('0x72')]['externalUrl'];return db[_0x8b13('0xbe')]['create'](_0x15c9d8);});}_0x55827a[_0x8b13('0xc1')]=_0x50ba6e['id'];if(_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc2')]&&_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc2')]['id']){_0x55827a['id']=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc2')]['id'];return db['ChatInteraction'][_0x8b13('0x6a')]({'where':_0x55827a})[_0x8b13('0x1d')](function(_0x1a4d35){var _0x1fc092=_0x35d90b['body']['customerIp']&&_0x35d90b['body'][_0x8b13('0x40')];if(!_0x1fc092&&_0x1a4d35&&_0x1a4d35['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x1a4d35){_0xf31db9=!![];return _0x1a4d35;}else{return db[_0x8b13('0xbe')][_0x8b13('0x6b')](_0x15c9d8);}});}return db[_0x8b13('0xbe')][_0x8b13('0x6b')](_0x15c9d8);})[_0x8b13('0x1d')](function(_0x2a90ae){if(!_0xf31db9){return _0x2a90ae;}var _0x2e865f={'from':(_0x467779['contact']['firstName']||'')+'\x20'+(_0x467779[_0x8b13('0xba')]['lastName']||'')};if(_0x35d90b[_0x8b13('0x72')][_0x8b13('0xbc')]&&_0x35d90b[_0x8b13('0x72')]['messageId']&&_0x35d90b[_0x8b13('0x72')]['threadId']!=_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc3')]){_0x2e865f[_0x8b13('0xbc')]=_0x35d90b['body'][_0x8b13('0xc3')];}return _0x2a90ae[_0x8b13('0x31')](_0x2e865f);})[_0x8b13('0x1d')](function(_0x3cc463){_0x467779[_0x8b13('0xc2')]=_0x3cc463[_0x8b13('0x33')]({'plain':!![]});_0x467779[_0x8b13('0xc2')]['created']=!_0xf31db9;if(_0x467779['interaction']['created']){if(_0x467779[_0x8b13('0xb3')][_0x8b13('0xc4')]){_0x467779['applications'][_0x8b13('0xc5')]({'id':0x0,'priority':_0x467779['applications'][_0x8b13('0x56')]+0x1,'app':_0x8b13('0xc6'),'appdata':'unmanaged','interval':_0x8b13('0xc7')});}}return db[_0x8b13('0xc8')][_0x8b13('0x6b')]({'body':_0x35d90b[_0x8b13('0x72')][_0x8b13('0x72')],'ChatWebsiteId':_0x35d90b['params']['id'],'ChatInteractionId':_0x3cc463['id'],'direction':'in','ContactId':_0x467779['contact']['id'],'AttachmentId':_0x35d90b[_0x8b13('0x72')][_0x8b13('0xc9')]});})[_0x8b13('0x1d')](function(_0x1e3cc8){_0x467779[_0x8b13('0x25')]=_0x1e3cc8;if(!_0x467779[_0x8b13('0xc2')][_0x8b13('0xca')]){return;}return db[_0x8b13('0xcb')]['find']({'attributes':['id',_0x8b13('0x36')],'where':{'id':_0x467779['interaction'][_0x8b13('0xca')]}});})[_0x8b13('0x1d')](function(_0x1883b0){if(_0x1883b0){_0x467779[_0x8b13('0xb4')][_0x8b13('0xcc')]({'id':0x0,'priority':0x0,'app':_0x8b13('0xcd'),'appdata':_0x1883b0[_0x8b13('0x36')]+','+(_0x467779[_0x8b13('0xb3')][_0x8b13('0xce')]||0xa),'interval':_0x8b13('0xc7')});_0x467779[_0x8b13('0xcf')]=!![];}if(!_0x467779[_0x8b13('0xc2')][_0x8b13('0xd0')]){return;}return db[_0x8b13('0xd1')]['find']({'attributes':['id',_0x8b13('0x36')],'where':{'id':_0x467779[_0x8b13('0xc2')][_0x8b13('0xd0')]}});})[_0x8b13('0x1d')](function(_0x2d43e0){if(_0x2d43e0){_0x467779[_0x8b13('0xb4')][_0x8b13('0xcc')]({'id':0x0,'priority':0x1,'app':_0x8b13('0xd2'),'appdata':_0x2d43e0[_0x8b13('0x36')]+','+(_0x467779[_0x8b13('0xb3')][_0x8b13('0xd3')]||0x12c),'interval':_0x8b13('0xc7')});}return respondWithRpcPromise(_0x8b13('0xd4'),'startRouting',_0x467779);})['then'](function(_0x347e78){respondWithRpcPromise(_0x8b13('0xd5'),'EventManager',{'event':_0x8b13('0xd6'),'message':_0x347e78},client9002);return _0x347e78;})[_0x8b13('0x1d')](respondWithResult(_0x3ce2f6,null))[_0x8b13('0x66')](APIHandleError(_0x3ce2f6));};exports[_0x8b13('0xd7')]=function(_0x59babb,_0x5f4be9){var _0x12a4f8,_0xed9630,_0x350a80;var _0x35f557=[];var _0x1e84f3={};var _0x446fab=_0x59babb['files']||[];var _0x32c2d9=[];var _0x8c1dc0;return db['CmContact']['describe']()[_0x8b13('0x1d')](function(_0x2350d3){if(!_0x2350d3){throw new db[(_0x8b13('0xd8'))]['ValidationError'](_0x8b13('0xd9'));}_0x35f557=_['difference'](_['keys'](_0x2350d3),[_0x8b13('0xa7'),_0x8b13('0xa8'),'CompanyId','ListId']);if(_0x59babb[_0x8b13('0x72')]['id']){delete _0x59babb['body']['id'];}if(_[_0x8b13('0x90')](_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')])){throw _0x5f4be9[_0x8b13('0x29')](0x1f4)[_0x8b13('0x37')](new db['Sequelize']['ValidationError'](_0x8b13('0xda')));}if(_['isNil'](_0x59babb['body'][_0x8b13('0x72')])||_0x59babb[_0x8b13('0x72')][_0x8b13('0x72')]===''){throw _0x5f4be9[_0x8b13('0x29')](0x1f4)[_0x8b13('0x37')](new db[(_0x8b13('0xd8'))]['ValidationError'](_0x8b13('0xdb')));}if(_[_0x8b13('0x90')](_0x59babb[_0x8b13('0x72')][_0x8b13('0xdc')])){throw _0x5f4be9['status'](0x1f4)['send'](new db[(_0x8b13('0xd8'))][(_0x8b13('0xdd'))](_0x8b13('0xde')+_0x35f557));}if(!_[_0x8b13('0xa9')](_0x35f557,_0x59babb[_0x8b13('0x72')]['mapKeyOffline'])){throw _0x5f4be9[_0x8b13('0x29')](0x1f4)['send'](new db[(_0x8b13('0xd8'))][(_0x8b13('0xdd'))](_0x8b13('0xdf')+_0x35f557));}_0x1e84f3[_0x59babb['body'][_0x8b13('0xdc')]]=_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')];})['then'](function(){return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x59babb[_0x8b13('0x68')]['id']},'include':[{'model':db[_0x8b13('0xe0')],'as':_0x8b13('0xac')},{'model':db[_0x8b13('0xe1')],'as':'MailAccount'}]});})[_0x8b13('0x1d')](handleEntityNotFound(_0x5f4be9,null))[_0x8b13('0x1d')](function(_0x4c9273){if(_0x4c9273&&_0x4c9273['List']){_0xed9630=_0x4c9273;var _0x4935f0=_[_0x8b13('0x15')](_0x59babb['body'],{'firstName':_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')],'phone':_0x59babb[_0x8b13('0x72')]['from'],'ListId':_0x4c9273['ListId']});_0x4935f0[_0x59babb['body'][_0x8b13('0xdc')]]=_0x59babb[_0x8b13('0x72')][_0x8b13('0xab')];return db['CmContact'][_0x8b13('0xe2')]({'where':_0x1e84f3,'defaults':_0x4935f0});}})['spread'](function(_0x28090c){if(_0x28090c){_0x350a80=_0x28090c;var _0x5011be=fs['readFileSync'](path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0xe3')),_0x8b13('0xe4'));var _0x5b033b=ejs['render'](_0x5011be,{'body':_[_0x8b13('0xe5')](_0x59babb[_0x8b13('0x72')]['body']),'bodyTitle':_0xed9630['offlineMessageBody']});return db[_0x8b13('0xe6')][_0x8b13('0x6b')]({'body':_0x5b033b,'plainBody':htmlToText[_0x8b13('0xe7')](_0x5b033b),'ContactId':_0x28090c['id'],'ChatWebsiteId':_0xed9630['id']});}})[_0x8b13('0x1d')](function(_0x2de61d){_0x8c1dc0=_0x2de61d;if(_0x446fab[_0x8b13('0x56')]){var _0x5a195d=_0x446fab[_0x8b13('0x4c')](function(_0xecc8ea){return{'name':_0xecc8ea[_0x8b13('0xe8')],'basename':_0xecc8ea[_0x8b13('0x86')],'type':_0xecc8ea['mimetype'],'ChatOfflineMessageId':_0x2de61d['id']};});_0x32c2d9=_0x5a195d['map'](_0x2e24f2=>{var _0x1e2036={'filename':_0x2e24f2[_0x8b13('0x36')],'path':path[_0x8b13('0x92')](config['root'],_0x8b13('0xe9'),_0x8b13('0xea'),'attachments',_0x8b13('0xeb'),_0x2e24f2['basename'])};return _0x1e2036;});if(!_0xed9630[_0x8b13('0xec')]){return db[_0x8b13('0xed')][_0x8b13('0xee')](function(_0x24b945){return db[_0x8b13('0xef')][_0x8b13('0xf0')](_0x5a195d,{'transaction':_0x24b945});});}}})[_0x8b13('0x1d')](function(){if(_0x8c1dc0){_0x12a4f8=_0x8c1dc0;return db['MailAccount'][_0x8b13('0x7d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8b13('0xf1')],'as':_0x8b13('0xf1'),'raw':!![]}]}]});}})[_0x8b13('0x1d')](function(_0x38a88d){if(_0x38a88d&&_0x38a88d['Smtp']&&_0xed9630[_0x8b13('0xf2')]&&_0xed9630[_0x8b13('0xf3')]){var _0x1f9f15=_0x38a88d['getSmtpOptions']();return respondWithRpcPromise(_0x8b13('0xf4'),_0x8b13('0xf5'),{'account':_0x1f9f15,'message':{'from':util[_0x8b13('0x43')](_0x8b13('0xf6'),_0x38a88d[_0x8b13('0x36')],_0x38a88d[_0x8b13('0xf7')]||_0x38a88d[_0x8b13('0xf8')][_0x8b13('0xf9')]),'to':_0xed9630[_0x8b13('0xf3')],'subject':_0xed9630['offlineMessageSubject'],'html':_0x12a4f8[_0x8b13('0x72')],'attachments':_0x32c2d9}},client9003)[_0x8b13('0x1d')](function(){return _0x12a4f8;})[_0x8b13('0x66')](function(_0x104e89){logger['error'](_0x104e89);});}})['then'](function(){if(_0xed9630&&_0xed9630[_0x8b13('0xec')]&&_0xed9630[_0x8b13('0xfa')]){var _0x331434=[];if(_0x446fab[_0x8b13('0x56')]){_0x331434=_0x446fab[_0x8b13('0x4c')](function(_0x4a19ef){return{'name':_0x4a19ef[_0x8b13('0xe8')],'basename':_0x4a19ef[_0x8b13('0x86')],'type':_0x4a19ef[_0x8b13('0xfb')],'ChatOfflineMessageId':_0x8c1dc0['id']};});}var _0x49a92f;if(!_['isNil'](_0xed9630['subjectOffline'])){var _0x542e1b=_[_0x8b13('0x4c')](_0x59babb[_0x8b13('0x72')],function(_0x59615c){return _0x59615c;});var _0x132e63=_[_0x8b13('0xfc')](_0x542e1b)[0x0];var _0x27c8d9=_[_0x8b13('0xfd')](_0x132e63,function(_0x3eda97){return _0x3eda97;});_0x49a92f=_0x27c8d9[0x1][_0xed9630['subjectOffline']];}var _0x1f544c={'from':_0x350a80['email'],'firstName':_0x350a80['firstName'],'lastName':_0x350a80[_0x8b13('0x3e')],'mapKey':_0x8b13('0xf7'),'message':{'from':_0x350a80[_0x8b13('0xf7')],'to':_0xed9630[_0x8b13('0xe1')]['email'],'cc':'','subject':_[_0x8b13('0x90')](_0x49a92f)?_0xed9630[_0x8b13('0xfe')]:_0x49a92f,'messageId':'','sentAt':new Date(),'attach':_0x331434['length'],'attachments':_0x331434,'originChannel':_0x8b13('0xff'),'ChatWebsiteId':_0xed9630['id'],'ChatOfflineMessageId':_0x12a4f8['id'],'originTo':_0xed9630[_0x8b13('0xe1')]['email']},'body':_0x12a4f8[_0x8b13('0x72')]};var _0x1d47ff={'account':{'id':_0xed9630['MailAccountId']},'body':_0x1f544c,'log':_0x8b13('0x100')};return respondWithRpcPromise(_0x8b13('0x100'),_0x8b13('0x101'),_0x1d47ff,client9001)[_0x8b13('0x1d')](function(){return _0x12a4f8;})['catch'](function(_0xfb0a65){logger['error'](_0xfb0a65);});}return;})[_0x8b13('0x1d')](function(){if(_0x12a4f8){return _0x12a4f8;}})[_0x8b13('0x1d')](respondWithResult(_0x5f4be9,null))[_0x8b13('0x66')](function(){for(var _0x3c12ea of _0x446fab){var _0x8cd0e=path[_0x8b13('0x92')](config[_0x8b13('0x8c')],_0x8b13('0xe9'),_0x8b13('0xea'),_0x8b13('0x102'),_0x8b13('0xeb'),_0x3c12ea[_0x8b13('0x86')]);fs_extra[_0x8b13('0x103')](_0x8cd0e)['catch'](function(_0x188f6e){logger[_0x8b13('0x23')](_0x8b13('0x104'),_0x8cd0e,_0x188f6e);});}});};exports[_0x8b13('0x105')]=function(_0x2db1b7,_0x433862){return db[_0x8b13('0xbe')]['find']({'where':{'id':_0x2db1b7['params']['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x433862,null))[_0x8b13('0x1d')](function(_0x2defbf){if(_0x2defbf){return _0x2defbf[_0x8b13('0x105')](_0x2db1b7[_0x8b13('0x72')][_0x8b13('0x106')],_[_0x8b13('0x107')](_0x2db1b7[_0x8b13('0x72')],['ids','id'])||{});}})['then'](respondWithResult(_0x433862,null))['catch'](handleError(_0x433862,null));};exports[_0x8b13('0x108')]=function(_0x392239,_0x360153){var _0x33e47b={'raw':![],'where':{}};var _0x1be7a8={};var _0x5369e2={'count':0x0,'rows':[]};return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x392239[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x360153,null))[_0x8b13('0x1d')](function(_0x1f771c){if(_0x1f771c){_0x1be7a8[_0x8b13('0x47')]=_[_0x8b13('0x52')](db[_0x8b13('0xbe')]['rawAttributes']);_0x1be7a8['query']=_['keys'](_0x392239[_0x8b13('0x51')]);_0x1be7a8[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x1be7a8[_0x8b13('0x47')],_0x1be7a8[_0x8b13('0x51')]);_0x33e47b[_0x8b13('0x54')]=_['intersection'](_0x1be7a8[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x392239['query']['fields']));_0x33e47b['attributes']=_0x33e47b[_0x8b13('0x54')]['length']?_0x33e47b['attributes']:_0x1be7a8[_0x8b13('0x47')];if(!_0x392239['query'][_0x8b13('0x57')](_0x8b13('0x58'))){_0x33e47b[_0x8b13('0x2d')]=qs['limit'](_0x392239['query'][_0x8b13('0x2d')]);_0x33e47b[_0x8b13('0x2a')]=qs['offset'](_0x392239[_0x8b13('0x51')]['offset']);}_0x33e47b[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x392239['query'][_0x8b13('0x5a')]);_0x33e47b['where']=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x392239[_0x8b13('0x51')],_0x1be7a8['filters']));_0x33e47b[_0x8b13('0x5b')][_0x8b13('0x7a')]=_0x1f771c['id'];if(_0x392239[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x33e47b[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0x33e47b[_0x8b13('0x5b')],{'$or':_['map'](_0x33e47b[_0x8b13('0x54')],function(_0x476cce){var _0x378484={};_0x378484[_0x476cce]={'$like':'%'+_0x392239[_0x8b13('0x51')]['filter']+'%'};return _0x378484;})});}_0x33e47b=_[_0x8b13('0x5f')]({},_0x33e47b,_0x392239['options']);return db[_0x8b13('0xbe')][_0x8b13('0x2c')]({'where':_0x33e47b['where']})[_0x8b13('0x1d')](function(_0x110259){_0x5369e2['count']=_0x110259;if(_0x392239[_0x8b13('0x51')][_0x8b13('0x62')]){_0x33e47b['include']=[{'model':db['CmContact'],'as':_0x8b13('0x109'),'required':![]},{'model':db[_0x8b13('0xcb')],'as':_0x8b13('0x10a'),'attributes':[_0x8b13('0x36'),_0x8b13('0x10b'),'internal'],'required':![]},{'model':db[_0x8b13('0x10c')],'as':_0x8b13('0x10d'),'attributes':['id',_0x8b13('0x36'),_0x8b13('0x10e')],'where':_0x392239['query'][_0x8b13('0x10f')]?{'id':_0x392239['query']['tag']}:undefined,'required':_0x392239[_0x8b13('0x51')][_0x8b13('0x10f')]?!![]:![]}];}return db[_0x8b13('0xbe')]['findAll'](_0x33e47b);})['then'](function(_0xf3a99b){_0x5369e2[_0x8b13('0x65')]=_0xf3a99b;return _0x5369e2;});}})[_0x8b13('0x1d')](respondWithFilteredResult(_0x360153,_0x33e47b))[_0x8b13('0x66')](handleError(_0x360153,null));};exports['getSnippet']=function(_0x4d1e8f,_0xce789c){var _0x29db49=0x0;var _0x20a25a=0x0;var _0x2be3a5=![];var _0x1c1513;var _0x2dc404;return db['ChatWebsite'][_0x8b13('0x6a')]({'where':{'id':_0x4d1e8f[_0x8b13('0x68')]['id']},'include':[{'model':db['Interval'],'as':_0x8b13('0x9e'),'include':[{'model':db[_0x8b13('0x9e')],'as':_0x8b13('0xb1'),'attributes':['id',_0x8b13('0x110')]}]}]})[_0x8b13('0x1d')](handleEntityNotFound(_0xce789c,null))['then'](function(_0x43f7ff){if(_0x43f7ff){_0x1c1513=_0x43f7ff;return _0x43f7ff[_0x8b13('0x111')]({'raw':!![]});}})[_0x8b13('0x1d')](function(_0x48d167){if(_0x1c1513){if(_0x48d167){_0x2dc404=_0x48d167;}}return require(_0x8b13('0x8d'))[_0x8b13('0x8e')]();})['then'](function(_0x19f701){if(_0x19f701){_0x20a25a=_0x19f701[_0x8b13('0x112')];_0x2be3a5=_0x19f701[_0x8b13('0x8f')];}})['then'](function(){return db['ChatInteraction'][_0x8b13('0x2c')]({'where':{'closed':![]}});})['then'](function(_0x2dc339){_0x29db49=_0x2dc339;if(_0x20a25a&&_0x2dc339>_0x20a25a){return db[_0x8b13('0x113')][_0x8b13('0x7d')]({'where':{'id':0x1}})['then'](function(_0x18aa8f){if(_0x18aa8f){_0x18aa8f['increment']('chatLicenseExceeded');}});}})[_0x8b13('0x1d')](function(){var _0x12408a=_0x1c1513[_0x8b13('0x9e')];var _0x1c87fa=_0x1c1513[_0x8b13('0xa0')]||undefined;return _0x12408a?_0x12408a[_0x8b13('0x114')](_0x1c87fa):!![];})['then'](function(_0x273dec){var _0x3680b8=fs[_0x8b13('0x115')](path[_0x8b13('0x92')](config['root'],_0x8b13('0x116')),_0x8b13('0xe4'));var _0x41d888=_0x8b13('0x117');var _0x1a3b50=![];var _0x3af827,_0xc62a7c;if(_0x4d1e8f['headers'][_0x8b13('0x40')]){_0x3af827=new URL(_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x40')])[_0x8b13('0x118')];}else if(_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x118')]){_0x3af827=new URL(_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x118')])['origin'];}else{_0x3af827=_0x8b13('0x119');}_0xc62a7c=typeof _0x1c1513['address'][_0x8b13('0x6d')](',')[_0x8b13('0x6a')](function(_0x1f0508){return wildcardUtils[_0x8b13('0x11a')](_0x1f0508,_0x3af827);})!==_0x8b13('0x2b');var _0x132264={'chatVersion':_0x41d888,'chatWebsiteAddressOrigin':_0xc62a7c?_0x3af827:_0x1c1513['address'],'remote':_0x1c1513[_0x8b13('0x11b')],'query':querystring[_0x8b13('0x22')](_['merge'](_0x1c1513['get']({'plain':!![]}),{'customerIp':_0x4d1e8f['headers']['x-forwarded-for']||_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x11c')]||_0x4d1e8f[_0x8b13('0x11d')][_0x8b13('0x11e')]||_0x4d1e8f['ip'],'referer':_0x4d1e8f[_0x8b13('0xbb')][_0x8b13('0x40')],'openedInteractions':_0x29db49,'maxInteractions':_0x20a25a,'virtual':_0x2be3a5['virtual'],'online':_0x273dec,'custom':_0x2be3a5,'address':_0xc62a7c?_0x3af827:null}))['replace'](/'/g,'\x5c\x27')};_0xce789c[_0x8b13('0x37')](ejs[_0x8b13('0x11f')](Mustache[_0x8b13('0x11f')](_0x3680b8,_0x132264),{'proactiveActions':_0x2dc404,'alignment':_0x1c1513[_0x8b13('0x120')],'verticalAlignment':_0x1c1513[_0x8b13('0x121')],'div_color':_0x1c1513[_0x8b13('0x10e')],'labelText':_0x1c1513[_0x8b13('0x122')],'text_color':_0x1c1513['textColor'],'text_button_color':_0x1c1513[_0x8b13('0x123')],'button_color':_0x1c1513[_0x8b13('0x124')],'background_color':_0x1c1513['backgroundColor'],'hideWhenOffline':_0x1c1513['hideWhenOffline'],'intervalId':_0x1c1513['IntervalId'],'isDevelopment':_0x1a3b50,'chatVersion':_0x41d888}));})[_0x8b13('0x66')](handleError(_0xce789c,null));};exports['addApplications']=function(_0x458c8f,_0xdda7e0){var _0xd5a593=_0x458c8f[_0x8b13('0x68')]['id'];var _0x17df3f=_0x458c8f[_0x8b13('0x72')];var _0x68adf4=0xc8;var _0x429040=null;return db[_0x8b13('0xed')]['transaction']({'isolationLevel':db[_0x8b13('0xed')]['Transaction']['ISOLATION_LEVELS'][_0x8b13('0x125')]},function(_0x259a1f){return db['ChatWebsite'][_0x8b13('0x7d')]({'where':{'id':_0xd5a593},'transaction':_0x259a1f})[_0x8b13('0x1d')](function(_0x457dd1){if(_0x457dd1){return db[_0x8b13('0xaf')][_0x8b13('0x32')]({'where':{'ChatWebsiteId':_0xd5a593},'transaction':_0x259a1f})[_0x8b13('0x1d')](function(){var _0x2c8a6d=_[_0x8b13('0x4c')](_0x17df3f,function(_0x3f35c1){_0x3f35c1[_0x8b13('0x7a')]=_0xd5a593;return _0x3f35c1;});return db[_0x8b13('0xaf')][_0x8b13('0xf0')](_0x2c8a6d,{'transaction':_0x259a1f});});}else{_0x68adf4=0x194;_0x429040=[];}});})[_0x8b13('0x1d')](function(){if(_0x68adf4!==0x194){return db[_0x8b13('0xaf')][_0x8b13('0x126')]({'where':{'ChatWebsiteId':_0xd5a593},'order':_0x8b13('0xb6')})[_0x8b13('0x1d')](function(_0x1ea799){_0x429040=_0x1ea799;});}})[_0x8b13('0x66')](function(_0x50032d){_0x68adf4=0x1f4;logger[_0x8b13('0x23')](_0x50032d[_0x8b13('0x127')]);if(_0x50032d['name']){delete _0x50032d[_0x8b13('0x36')];}_0x429040=_0x50032d;})['finally'](function(){if(_0x429040===null){_0xdda7e0[_0x8b13('0x27')](_0x68adf4);}else{if(_0x68adf4===0x1f4){_0xdda7e0[_0x8b13('0x29')](_0x68adf4)[_0x8b13('0x37')](_0x429040);}else{_0xdda7e0[_0x8b13('0x29')](_0x68adf4)[_0x8b13('0x30')](_0x429040);}}});};exports[_0x8b13('0x128')]=function(_0xdf5ae6,_0x286254){var _0x18abba={};var _0x2a1b92={};var _0x95e9fb;var _0x2dcef4;return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0xdf5ae6[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x286254,null))[_0x8b13('0x1d')](function(_0x3349ac){if(_0x3349ac){_0x95e9fb=_0x3349ac;_0x2a1b92['model']=_[_0x8b13('0x52')](db[_0x8b13('0xaf')][_0x8b13('0x4e')]);_0x2a1b92[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0xdf5ae6['query']);_0x2a1b92[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x2a1b92[_0x8b13('0x47')],_0x2a1b92[_0x8b13('0x51')]);_0x18abba[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x2a1b92['model'],qs[_0x8b13('0x55')](_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x55')]));_0x18abba[_0x8b13('0x54')]=_0x18abba[_0x8b13('0x54')]['length']?_0x18abba[_0x8b13('0x54')]:_0x2a1b92['model'];_0x18abba[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0xdf5ae6['query'][_0x8b13('0x5a')]);_0x18abba[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0xdf5ae6[_0x8b13('0x51')],_0x2a1b92[_0x8b13('0x5d')]));if(_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x18abba[_0x8b13('0x5b')]=_['merge'](_0x18abba[_0x8b13('0x5b')],{'$or':_[_0x8b13('0x4c')](_0x18abba[_0x8b13('0x54')],function(_0x29503b){var _0x246e17={};_0x246e17[_0x29503b]={'$like':'%'+_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x246e17;})});}_0x18abba=_[_0x8b13('0x5f')]({},_0x18abba,_0xdf5ae6[_0x8b13('0x61')]);return _0x95e9fb['getApplications'](_0x18abba);}})['then'](function(_0x405fa3){if(_0x405fa3){_0x2dcef4=_0x405fa3[_0x8b13('0x56')];if(!_0xdf5ae6['query'][_0x8b13('0x57')]('nolimit')){_0x18abba['limit']=qs[_0x8b13('0x2d')](_0xdf5ae6[_0x8b13('0x51')]['limit']);_0x18abba['offset']=qs[_0x8b13('0x2a')](_0xdf5ae6[_0x8b13('0x51')][_0x8b13('0x2a')]);}return _0x95e9fb[_0x8b13('0x128')](_0x18abba);}})[_0x8b13('0x1d')](function(_0x359014){if(_0x359014){return _0x359014?{'count':_0x2dcef4,'rows':_0x359014}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x286254,null))[_0x8b13('0x66')](handleError(_0x286254,null));};exports[_0x8b13('0x129')]=function(_0x7c338d,_0x50bf52){return db[_0x8b13('0x12a')][_0x8b13('0x6a')]({'where':{'id':_0x7c338d[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x50bf52,null))['then'](function(_0x54c415){if(_0x54c415){return _0x54c415[_0x8b13('0x129')](_0x7c338d[_0x8b13('0x72')][_0x8b13('0x106')],_[_0x8b13('0x107')](_0x7c338d[_0x8b13('0x72')],['ids','id'])||{});}})['then'](respondWithResult(_0x50bf52,null))[_0x8b13('0x66')](handleError(_0x50bf52,null));};exports[_0x8b13('0x111')]=function(_0x2d15be,_0x393e7e){var _0x3a0822={};var _0x5e49c9={};var _0x18a6ad;var _0x9c9c4;return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x2d15be[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x393e7e,null))[_0x8b13('0x1d')](function(_0x3e4da0){if(_0x3e4da0){_0x18a6ad=_0x3e4da0;_0x5e49c9[_0x8b13('0x47')]=_[_0x8b13('0x52')](db[_0x8b13('0x12b')][_0x8b13('0x4e')]);_0x5e49c9[_0x8b13('0x51')]=_['keys'](_0x2d15be['query']);_0x5e49c9['filters']=_['intersection'](_0x5e49c9['model'],_0x5e49c9[_0x8b13('0x51')]);_0x3a0822['attributes']=_[_0x8b13('0x53')](_0x5e49c9[_0x8b13('0x47')],qs['fields'](_0x2d15be['query']['fields']));_0x3a0822[_0x8b13('0x54')]=_0x3a0822[_0x8b13('0x54')]['length']?_0x3a0822['attributes']:_0x5e49c9['model'];_0x3a0822[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x2d15be[_0x8b13('0x51')]['sort']);_0x3a0822['where']=qs['filters'](_[_0x8b13('0x5c')](_0x2d15be[_0x8b13('0x51')],_0x5e49c9[_0x8b13('0x5d')]));if(_0x2d15be[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x3a0822[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0x3a0822[_0x8b13('0x5b')],{'$or':_[_0x8b13('0x4c')](_0x3a0822[_0x8b13('0x54')],function(_0x4f5f8d){var _0x438b94={};_0x438b94[_0x4f5f8d]={'$like':'%'+_0x2d15be[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x438b94;})});}_0x3a0822=_[_0x8b13('0x5f')]({},_0x3a0822,_0x2d15be[_0x8b13('0x61')]);return _0x18a6ad[_0x8b13('0x111')](_0x3a0822);}})['then'](function(_0x220af3){if(_0x220af3){_0x9c9c4=_0x220af3[_0x8b13('0x56')];if(!_0x2d15be[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0x3a0822['limit']=qs[_0x8b13('0x2d')](_0x2d15be[_0x8b13('0x51')][_0x8b13('0x2d')]);_0x3a0822[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0x2d15be['query'][_0x8b13('0x2a')]);}return _0x18a6ad[_0x8b13('0x111')](_0x3a0822);}})[_0x8b13('0x1d')](function(_0x29b91b){if(_0x29b91b){return _0x29b91b?{'count':_0x9c9c4,'rows':_0x29b91b}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x393e7e,null))['catch'](handleError(_0x393e7e,null));};exports[_0x8b13('0x12c')]=function(_0x5d1b47,_0x545e66){var _0x531a35=_0x5d1b47[_0x8b13('0x51')][_0x8b13('0x12d')]===_0x8b13('0x12e')?_0x8b13('0x12f'):_0x8b13('0x130');return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'attributes':['id',_0x531a35],'where':{'id':_0x5d1b47[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x545e66,null))[_0x8b13('0x1d')](function(_0x118f07){if(_0x118f07){var _0x3cc93f=_0x118f07[_0x531a35];var _0x436d82=_0x3cc93f&&_0x3cc93f[_0x8b13('0x131')]?_0x3cc93f['items']:[];_0x545e66[_0x8b13('0x37')]({'fromKey':_[_0x8b13('0x90')](_0x3cc93f[_0x8b13('0x132')])?undefined:_0x3cc93f['fromKey'],'count':_0x436d82['length'],'rows':_0x436d82});}})[_0x8b13('0x66')](handleError(_0x545e66,null));};exports[_0x8b13('0x133')]=function(_0x5e0767,_0x3dc6f2){var _0xd2411f={'raw':![],'where':{}};var _0x34f260={};var _0x22e6bd={'count':0x0,'rows':[]};return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x5e0767[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x3dc6f2,null))['then'](function(_0x411ee5){if(_0x411ee5){_0x34f260[_0x8b13('0x47')]=_[_0x8b13('0x52')](db[_0x8b13('0xe6')][_0x8b13('0x4e')]);_0x34f260[_0x8b13('0x51')]=_[_0x8b13('0x52')](_0x5e0767[_0x8b13('0x51')]);_0x34f260[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x34f260[_0x8b13('0x47')],_0x34f260[_0x8b13('0x51')]);_0xd2411f[_0x8b13('0x54')]=_['intersection'](_0x34f260['model'],qs[_0x8b13('0x55')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x55')]));_0xd2411f[_0x8b13('0x54')]=_0xd2411f[_0x8b13('0x54')][_0x8b13('0x56')]?_0xd2411f['attributes']:_0x34f260[_0x8b13('0x47')];if(!_0x5e0767[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0xd2411f['limit']=qs[_0x8b13('0x2d')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x2d')]);_0xd2411f[_0x8b13('0x2a')]=qs[_0x8b13('0x2a')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x2a')]);}_0xd2411f[_0x8b13('0x59')]=qs[_0x8b13('0x5a')](_0x5e0767[_0x8b13('0x51')][_0x8b13('0x5a')]);_0xd2411f['where']=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x5e0767[_0x8b13('0x51')],_0x34f260[_0x8b13('0x5d')]));_0xd2411f[_0x8b13('0x5b')][_0x8b13('0x7a')]=_0x411ee5['id'];if(_0x5e0767[_0x8b13('0x51')][_0x8b13('0x5e')]){_0xd2411f[_0x8b13('0x5b')]=_[_0x8b13('0x5f')](_0xd2411f['where'],{'$or':_[_0x8b13('0x4c')](_0xd2411f[_0x8b13('0x54')],function(_0x419f85){var _0x3b62e4={};_0x3b62e4[_0x419f85]={'$like':'%'+_0x5e0767[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x3b62e4;})});}_0xd2411f=_[_0x8b13('0x5f')]({},_0xd2411f,_0x5e0767[_0x8b13('0x61')]);return db[_0x8b13('0xe6')]['count']({'where':_0xd2411f[_0x8b13('0x5b')]})['then'](function(_0xc5960e){_0x22e6bd[_0x8b13('0x2c')]=_0xc5960e;if(_0x5e0767[_0x8b13('0x51')]['includeAll']){_0xd2411f[_0x8b13('0x63')]=[{'all':!![]}];}else{_0xd2411f[_0x8b13('0x63')]=[{'model':db['CmContact'],'as':_0x8b13('0x109'),'required':![]},{'model':db[_0x8b13('0xef')],'as':'Attachments','required':![]}];}return db[_0x8b13('0xe6')]['findAll'](_0xd2411f);})['then'](function(_0x25d83b){_0x22e6bd[_0x8b13('0x65')]=_0x25d83b;return _0x22e6bd;});}})[_0x8b13('0x1d')](respondWithFilteredResult(_0x3dc6f2,_0xd2411f))[_0x8b13('0x66')](handleError(_0x3dc6f2,null));};exports[_0x8b13('0x134')]=function(_0xc43aba,_0x1c68da){return db[_0x8b13('0x4d')]['find']({'where':{'id':_0xc43aba[_0x8b13('0x68')]['id']}})['then'](handleEntityNotFound(_0x1c68da,null))[_0x8b13('0x1d')](function(_0xf3e201){if(_0xf3e201){return _0xf3e201[_0x8b13('0x134')](_0xc43aba['body'][_0x8b13('0x106')],_['omit'](_0xc43aba['body'],[_0x8b13('0x106'),'id'])||{})[_0x8b13('0x135')](function(_0x559cdf){for(var _0x1f2a30=0x0;_0x1f2a30<_0xc43aba[_0x8b13('0x72')][_0x8b13('0x106')][_0x8b13('0x56')];_0x1f2a30+=0x1){socket[_0x8b13('0x136')](_0x8b13('0x137'),{'UserId':Number(_0xc43aba[_0x8b13('0x72')]['ids'][_0x1f2a30]),'ChatWebsiteId':Number(_0xc43aba[_0x8b13('0x68')]['id'])});}return _0x559cdf;});}})['then'](respondWithResult(_0x1c68da,null))[_0x8b13('0x66')](handleError(_0x1c68da,null));};exports[_0x8b13('0x138')]=function(_0x5d245e,_0x2b4de7){return db[_0x8b13('0x4d')][_0x8b13('0x6a')]({'where':{'id':_0x5d245e[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x2b4de7,null))[_0x8b13('0x1d')](function(_0x51e2da){if(_0x51e2da){return _0x51e2da['removeAgents'](_0x5d245e[_0x8b13('0x51')][_0x8b13('0x106')])['then'](function(){if(_[_0x8b13('0x139')](_0x5d245e['query']['ids'])){for(var _0x5827ee=0x0;_0x5827ee<_0x5d245e[_0x8b13('0x51')]['ids'][_0x8b13('0x56')];_0x5827ee+=0x1){socket[_0x8b13('0x136')](_0x8b13('0x13a'),{'UserId':Number(_0x5d245e[_0x8b13('0x51')][_0x8b13('0x106')][_0x5827ee]),'ChatWebsiteId':Number(_0x5d245e[_0x8b13('0x68')]['id'])});}}else{socket['emit'](_0x8b13('0x13a'),{'UserId':Number(_0x5d245e[_0x8b13('0x51')][_0x8b13('0x106')]),'ChatWebsiteId':Number(_0x5d245e[_0x8b13('0x68')]['id'])});}});}})['then'](respondWithStatusCode(_0x2b4de7,null))[_0x8b13('0x66')](handleError(_0x2b4de7,null));};exports['getAgents']=function(_0x703e,_0x326163){var _0x503451={};var _0x21dedb={};var _0x50e0b8;var _0x555589;return db[_0x8b13('0x4d')][_0x8b13('0x7d')]({'where':{'id':_0x703e[_0x8b13('0x68')]['id']}})[_0x8b13('0x1d')](handleEntityNotFound(_0x326163,null))[_0x8b13('0x1d')](function(_0x36cbd3){if(_0x36cbd3){_0x50e0b8=_0x36cbd3;_0x21dedb[_0x8b13('0x47')]=_[_0x8b13('0x52')](db['User'][_0x8b13('0x4e')]);_0x21dedb['query']=_[_0x8b13('0x52')](_0x703e[_0x8b13('0x51')]);_0x21dedb[_0x8b13('0x5d')]=_[_0x8b13('0x53')](_0x21dedb[_0x8b13('0x47')],_0x21dedb['query']);_0x503451[_0x8b13('0x54')]=_[_0x8b13('0x53')](_0x21dedb[_0x8b13('0x47')],qs[_0x8b13('0x55')](_0x703e['query'][_0x8b13('0x55')]));_0x503451[_0x8b13('0x54')]=_0x503451['attributes']['length']?_0x503451[_0x8b13('0x54')]:_0x21dedb[_0x8b13('0x47')];_0x503451['order']=qs[_0x8b13('0x5a')](_0x703e[_0x8b13('0x51')][_0x8b13('0x5a')]);_0x503451[_0x8b13('0x5b')]=qs[_0x8b13('0x5d')](_[_0x8b13('0x5c')](_0x703e[_0x8b13('0x51')],_0x21dedb['filters']));if(_0x703e[_0x8b13('0x51')][_0x8b13('0x5e')]){_0x503451['where']=_[_0x8b13('0x5f')](_0x503451[_0x8b13('0x5b')],{'$or':_['map'](_0x503451['attributes'],function(_0x5e3ec8){var _0x24c28c={};_0x24c28c[_0x5e3ec8]={'$like':'%'+_0x703e[_0x8b13('0x51')][_0x8b13('0x5e')]+'%'};return _0x24c28c;})});}_0x503451=_[_0x8b13('0x5f')]({},_0x503451,_0x703e[_0x8b13('0x61')]);return _0x50e0b8[_0x8b13('0x13b')](_0x503451);}})[_0x8b13('0x1d')](function(_0xe679a3){if(_0xe679a3){_0x555589=_0xe679a3['length'];if(!_0x703e[_0x8b13('0x51')][_0x8b13('0x57')](_0x8b13('0x58'))){_0x503451[_0x8b13('0x2d')]=qs[_0x8b13('0x2d')](_0x703e[_0x8b13('0x51')][_0x8b13('0x2d')]);_0x503451[_0x8b13('0x2a')]=qs['offset'](_0x703e[_0x8b13('0x51')][_0x8b13('0x2a')]);}return _0x50e0b8[_0x8b13('0x13b')](_0x503451);}})[_0x8b13('0x1d')](function(_0x5816cd){if(_0x5816cd){return _0x5816cd?{'count':_0x555589,'rows':_0x5816cd}:null;}})[_0x8b13('0x1d')](respondWithResult(_0x326163,null))[_0x8b13('0x66')](handleError(_0x326163,null));};
\ No newline at end of file
+var _0xe5b3=['path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','setUA','user-agent','getResult','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','model','type','index','Pause','map','ChatWebsite','rawAttributes','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','show','params','mandatoryDispositionPause','merge','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','ifTime','notify','chat','from','From\x20is\x20mandatory','isEmpty','CmContact','No\x20available\x20attributes','createdAt','updatedAt','ListId','includes','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','list','defaults','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','customerIp','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','Start','startRouting','EventManager','offline','files','Sequelize','difference','CompanyId','from\x20is\x20mandatory','ValidationError','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','fromString','originalname','mimetype','offline-chat','openNewInteraction','sequelize','transaction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','order','Contact','Owner','fullname','internal','Tags','tag','getSnippet','interval','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','timezone','server/files/chat/iframe.ejs','3.13.0','origin','testWebsiteWithWildcard','remote','x-forwarded-for','connection','replace','verticalAlignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','ChatOfflineMessage','Attachment','rows','addAgents','spread','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','util'];(function(_0x3f46e6,_0x1870d2){var _0x291241=function(_0x4f5e8d){while(--_0x4f5e8d){_0x3f46e6['push'](_0x3f46e6['shift']());}};_0x291241(++_0x1870d2);}(_0xe5b3,0x133));var _0x3e5b=function(_0x66a2aa,_0x43001c){_0x66a2aa=_0x66a2aa-0x0;var _0x3933e7=_0xe5b3[_0x66a2aa];return _0x3933e7;};'use strict';var Mustache=require('mustache');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var ejs=require(_0x3e5b('0x2'));var fs=require('fs');var fs_extra=require(_0x3e5b('0x3'));var _=require(_0x3e5b('0x4'));var querystring=require(_0x3e5b('0x5'));var htmlToText=require(_0x3e5b('0x6'));var Redis=require(_0x3e5b('0x7'));var jayson=require(_0x3e5b('0x8'));var qs=require(_0x3e5b('0x9'));var logger=require(_0x3e5b('0xa'))('api');var config=require(_0x3e5b('0xb'));var APIBadRequestError=require(_0x3e5b('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0x3e5b('0xc'))[_0x3e5b('0xd')];var APIOutOfIntervalError=require(_0x3e5b('0xc'))[_0x3e5b('0xe')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0x3e5b('0xc'))[_0x3e5b('0xf')];var wildcardUtils=require(_0x3e5b('0x10'));var URL=require(_0x3e5b('0x11'))[_0x3e5b('0x12')];var db=require('../../mysqldb')['db'];config[_0x3e5b('0x13')]=_['defaults'](config[_0x3e5b('0x13')],{'host':_0x3e5b('0x14'),'port':0x18eb});var socket=require(_0x3e5b('0x15'))(new Redis(config[_0x3e5b('0x13')]));require(_0x3e5b('0x16'))[_0x3e5b('0x17')](socket);var client=jayson[_0x3e5b('0x18')]['http']({'port':0x232c});var client9002=jayson[_0x3e5b('0x18')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x3e5b('0x18')][_0x3e5b('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x17aaa3,_0x4fb471,_0x1f81a7,_0x59ddc0){return new Promise(function(_0x56a453,_0x258d6a){var _0x11b41b=_0x59ddc0||client;return _0x11b41b['request'](_0x17aaa3,_0x1f81a7)[_0x3e5b('0x1a')](function(_0x143040){logger['info'](_0x3e5b('0x1b'),_0x4fb471,_0x3e5b('0x1c'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4fb471,_0x3e5b('0x1c'),JSON[_0x3e5b('0x1d')](_0x143040));if(_0x143040[_0x3e5b('0x1e')]){if(_0x143040[_0x3e5b('0x1e')][_0x3e5b('0x1f')]===0x1f4){logger[_0x3e5b('0x1e')](_0x3e5b('0x1b'),_0x4fb471,_0x143040[_0x3e5b('0x1e')][_0x3e5b('0x20')]);return _0x258d6a(_0x143040[_0x3e5b('0x1e')][_0x3e5b('0x20')]);}logger[_0x3e5b('0x1e')](_0x3e5b('0x1b'),_0x4fb471,_0x143040[_0x3e5b('0x1e')]['message']);return _0x56a453(_0x143040[_0x3e5b('0x1e')][_0x3e5b('0x20')]);}else{logger[_0x3e5b('0x21')](_0x3e5b('0x1b'),_0x4fb471,'request\x20sent');_0x56a453(_0x143040[_0x3e5b('0x22')]['message']);}})[_0x3e5b('0x23')](function(_0x36d960){logger['error'](_0x3e5b('0x1b'),_0x4fb471,_0x36d960);_0x258d6a(_0x36d960);});});}function respondWithStatusCode(_0x2f6368,_0x42d7e9){_0x42d7e9=_0x42d7e9||0xcc;return function(_0x3c8965){if(_0x3c8965){return _0x2f6368[_0x3e5b('0x24')](_0x42d7e9);}return _0x2f6368[_0x3e5b('0x25')](_0x42d7e9)[_0x3e5b('0x26')]();};}function respondWithResult(_0x2ddf57,_0x4c4b89){_0x4c4b89=_0x4c4b89||0xc8;return function(_0x1c7278){if(_0x1c7278){return _0x2ddf57['status'](_0x4c4b89)[_0x3e5b('0x27')](_0x1c7278);}};}function respondWithFilteredResult(_0x4fd64b,_0x101653){return function(_0x1f6473){if(_0x1f6473){var _0x1296ec=typeof _0x101653[_0x3e5b('0x28')]===_0x3e5b('0x29')&&typeof _0x101653[_0x3e5b('0x2a')]===_0x3e5b('0x29');var _0x9c2123=_0x1f6473[_0x3e5b('0x2b')];var _0x112dc0=_0x1296ec?0x0:_0x101653[_0x3e5b('0x28')];var _0x489221=_0x1296ec?_0x1f6473[_0x3e5b('0x2b')]:_0x101653[_0x3e5b('0x28')]+_0x101653[_0x3e5b('0x2a')];var _0x2a14eb;if(_0x489221>=_0x9c2123){_0x489221=_0x9c2123;_0x2a14eb=0xc8;}else{_0x2a14eb=0xce;}_0x4fd64b[_0x3e5b('0x25')](_0x2a14eb);return _0x4fd64b[_0x3e5b('0x2c')](_0x3e5b('0x2d'),_0x112dc0+'-'+_0x489221+'/'+_0x9c2123)['json'](_0x1f6473);}return null;};}function saveUpdates(_0x33f089){return function(_0x56a527){if(_0x56a527){return _0x56a527['update'](_0x33f089)[_0x3e5b('0x1a')](function(_0x78d68a){return _0x78d68a;});}return null;};}function removeEntity(_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x2e')]()[_0x3e5b('0x1a')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x2f')]({'plain':!![]});var _0x26f842=_0x3e5b('0x30');return db[_0x3e5b('0x31')][_0x3e5b('0x2e')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1a')](function(){return _0x40e37d;});})[_0x3e5b('0x1a')](function(){_0x51ea0d[_0x3e5b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e){return function(_0xec45c5){if(!_0xec45c5){_0x141b7e['sendStatus'](0x194);}return _0xec45c5;};}function handleError(_0x4edf59,_0x471196){_0x471196=_0x471196||0x1f4;return function(_0x56d7ef){logger[_0x3e5b('0x1e')](_0x56d7ef[_0x3e5b('0x32')]);if(_0x56d7ef[_0x3e5b('0x33')]){delete _0x56d7ef[_0x3e5b('0x33')];}_0x4edf59['status'](_0x471196)[_0x3e5b('0x34')](_0x56d7ef);};}function createInteractionObject(_0x4cdcb1,_0x42b970,_0x5ec841,_0x47f7c8){var _0x48f414=require(_0x3e5b('0x35'));var _0x174ebf=new _0x48f414();var _0x2eaa30=_0x174ebf[_0x3e5b('0x36')](_0x5ec841[_0x3e5b('0x37')])[_0x3e5b('0x38')]();var _0x5466ac=_0x42b970['customerIp'];if(_0x5ec841['cf-connecting-ip']){_0x5466ac=_0x5ec841['cf-connecting-ip'];}else if(_0x5ec841['x-forwarded-for']){_0x5466ac=_['first'](_0x5ec841['x-forwarded-for'][_0x3e5b('0x39')](','));}return{'ContactId':_0x47f7c8['id'],'ChatWebsiteId':_0x4cdcb1,'from':(_0x47f7c8[_0x3e5b('0x3a')]||'')+'\x20'+(_0x47f7c8[_0x3e5b('0x3b')]||''),'customerIp':_0x5466ac,'customerPort':_0x5ec841[_0x3e5b('0x3c')]?_0x5ec841[_0x3e5b('0x3c')]:null,'referer':_0x42b970[_0x3e5b('0x3d')],'browserName':_0x2eaa30[_0x3e5b('0x3e')][_0x3e5b('0x33')]&&_0x2eaa30[_0x3e5b('0x3e')][_0x3e5b('0x3f')]?util[_0x3e5b('0x40')]('%s\x20%s',_0x2eaa30[_0x3e5b('0x3e')][_0x3e5b('0x33')],_0x2eaa30[_0x3e5b('0x3e')][_0x3e5b('0x3f')]):_0x3e5b('0x41'),'browserVersion':_0x2eaa30[_0x3e5b('0x3e')][_0x3e5b('0x3f')]||_0x3e5b('0x41'),'osName':util[_0x3e5b('0x40')](_0x3e5b('0x42'),_0x2eaa30['os'][_0x3e5b('0x33')],_0x2eaa30['os']['version']),'osVersion':_0x2eaa30['os']['version'],'deviceModel':_0x2eaa30['device']['model']&&_0x2eaa30[_0x3e5b('0x43')][_0x3e5b('0x44')]?util[_0x3e5b('0x40')](_0x3e5b('0x45'),_0x2eaa30[_0x3e5b('0x43')][_0x3e5b('0x46')],_0x2eaa30[_0x3e5b('0x43')][_0x3e5b('0x44')],_0x2eaa30[_0x3e5b('0x43')][_0x3e5b('0x47')]):null,'deviceVendor':_0x2eaa30['device'][_0x3e5b('0x44')],'deviceType':_0x2eaa30[_0x3e5b('0x43')][_0x3e5b('0x47')],'formData':JSON[_0x3e5b('0x1d')](_0x42b970)};}exports[_0x3e5b('0x48')]=function(_0x4f0c2c,_0x588ee7){var _0x495217={'include':[{'model':db[_0x3e5b('0x49')],'as':'mandatoryDispositionPause'}]},_0x1fbd87={},_0x20af6a={'count':0x0,'rows':[]};var _0x4b604d=_[_0x3e5b('0x4a')](db[_0x3e5b('0x4b')][_0x3e5b('0x4c')],function(_0x5acf51){return{'name':_0x5acf51['fieldName'],'type':_0x5acf51[_0x3e5b('0x47')]['key']};});_0x1fbd87[_0x3e5b('0x46')]=_[_0x3e5b('0x4a')](_0x4b604d,_0x3e5b('0x33'));_0x1fbd87[_0x3e5b('0x4d')]=_[_0x3e5b('0x4e')](_0x4f0c2c[_0x3e5b('0x4d')]);_0x1fbd87[_0x3e5b('0x4f')]=_[_0x3e5b('0x50')](_0x1fbd87[_0x3e5b('0x46')],_0x1fbd87['query']);_0x495217[_0x3e5b('0x51')]=_['intersection'](_0x1fbd87[_0x3e5b('0x46')],qs[_0x3e5b('0x52')](_0x4f0c2c[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x495217[_0x3e5b('0x51')]=_0x495217[_0x3e5b('0x51')][_0x3e5b('0x53')]?_0x495217[_0x3e5b('0x51')]:_0x1fbd87[_0x3e5b('0x46')];if(!_0x4f0c2c[_0x3e5b('0x4d')][_0x3e5b('0x54')](_0x3e5b('0x55'))){_0x495217[_0x3e5b('0x2a')]=qs['limit'](_0x4f0c2c[_0x3e5b('0x4d')][_0x3e5b('0x2a')]);_0x495217[_0x3e5b('0x28')]=qs[_0x3e5b('0x28')](_0x4f0c2c[_0x3e5b('0x4d')][_0x3e5b('0x28')]);}_0x495217['order']=qs[_0x3e5b('0x56')](_0x4f0c2c[_0x3e5b('0x4d')][_0x3e5b('0x56')]);_0x495217[_0x3e5b('0x57')]=qs[_0x3e5b('0x4f')](_[_0x3e5b('0x58')](_0x4f0c2c[_0x3e5b('0x4d')],_0x1fbd87[_0x3e5b('0x4f')]),_0x4b604d);if(_0x4f0c2c['query'][_0x3e5b('0x59')]){_0x495217['where']=_['merge'](_0x495217[_0x3e5b('0x57')],{'$or':_['map'](_0x4b604d,function(_0x4a0c86){if(_0x4a0c86[_0x3e5b('0x47')]!==_0x3e5b('0x5a')){var _0x1f7959={};_0x1f7959[_0x4a0c86['name']]={'$like':'%'+_0x4f0c2c['query']['filter']+'%'};return _0x1f7959;}})});}_0x495217=_['merge']({},_0x495217,_0x4f0c2c[_0x3e5b('0x5b')]);var _0x999518={'where':_0x495217[_0x3e5b('0x57')]};return db[_0x3e5b('0x4b')][_0x3e5b('0x2b')](_0x999518)['then'](function(_0x5ac379){_0x20af6a[_0x3e5b('0x2b')]=_0x5ac379;if(_0x4f0c2c[_0x3e5b('0x4d')][_0x3e5b('0x5c')]){_0x495217[_0x3e5b('0x5d')]=[{'all':!![]}];}return db[_0x3e5b('0x4b')]['findAll'](_0x495217);})['then'](function(_0x4abd65){_0x20af6a['rows']=_0x4abd65;return _0x20af6a;})[_0x3e5b('0x1a')](respondWithFilteredResult(_0x588ee7,_0x495217))[_0x3e5b('0x23')](handleError(_0x588ee7,null));};exports[_0x3e5b('0x5e')]=function(_0x80b4,_0x424a3d){var _0x24087b={'raw':![],'where':{'id':_0x80b4[_0x3e5b('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0x3e5b('0x60')}]},_0x1915bc={};_0x1915bc[_0x3e5b('0x46')]=_[_0x3e5b('0x4e')](db[_0x3e5b('0x4b')][_0x3e5b('0x4c')]);_0x1915bc['query']=_[_0x3e5b('0x4e')](_0x80b4['query']);_0x1915bc[_0x3e5b('0x4f')]=_[_0x3e5b('0x50')](_0x1915bc['model'],_0x1915bc['query']);_0x24087b['attributes']=_[_0x3e5b('0x50')](_0x1915bc['model'],qs[_0x3e5b('0x52')](_0x80b4[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x24087b[_0x3e5b('0x51')]=_0x24087b[_0x3e5b('0x51')]['length']?_0x24087b['attributes']:_0x1915bc[_0x3e5b('0x46')];if(_0x80b4[_0x3e5b('0x4d')][_0x3e5b('0x5c')]){_0x24087b['include']=[{'all':!![]}];}_0x24087b=_[_0x3e5b('0x61')]({},_0x24087b,_0x80b4[_0x3e5b('0x5b')]);return db[_0x3e5b('0x4b')][_0x3e5b('0x62')](_0x24087b)[_0x3e5b('0x1a')](handleEntityNotFound(_0x424a3d,null))[_0x3e5b('0x1a')](respondWithResult(_0x424a3d,null))[_0x3e5b('0x23')](handleError(_0x424a3d,null));};exports[_0x3e5b('0x63')]=function(_0x3a11a8,_0x52e98f){var _0x4eb336=null;_0x3a11a8[_0x3e5b('0x64')][_0x3e5b('0x65')][_0x3e5b('0x39')](',')[_0x3e5b('0x66')](_0x2411c3=>{if(_0x2411c3[_0x3e5b('0x67')]()!==''&&!wildcardUtils[_0x3e5b('0x68')](_0x2411c3['trim']())){_0x4eb336=new APIBadRequestError('\x22'+_0x2411c3[_0x3e5b('0x67')]()+_0x3e5b('0x69'));}});if(_0x4eb336){return handleError(_0x52e98f,null)(_0x4eb336);}return db['ChatWebsite'][_0x3e5b('0x63')](_0x3a11a8[_0x3e5b('0x64')],{})['then'](function(_0x52d89e){var _0x4f67d1=_0x3a11a8[_0x3e5b('0x6a')][_0x3e5b('0x2f')]({'plain':!![]});if(!_0x4f67d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f67d1[_0x3e5b('0x6b')]===_0x3e5b('0x6a')){var _0x47b810=_0x52d89e[_0x3e5b('0x2f')]({'plain':!![]});var _0x17f60f=_0x3e5b('0x30');return db[_0x3e5b('0x6c')][_0x3e5b('0x62')]({'where':{'name':_0x17f60f,'userProfileId':_0x4f67d1[_0x3e5b('0x6d')]},'raw':!![]})[_0x3e5b('0x1a')](function(_0x410c7a){if(_0x410c7a&&_0x410c7a[_0x3e5b('0x6e')]===0x0){return db['UserProfileResource'][_0x3e5b('0x63')]({'name':_0x47b810[_0x3e5b('0x33')],'resourceId':_0x47b810['id'],'type':_0x410c7a[_0x3e5b('0x33')],'sectionId':_0x410c7a['id']},{})[_0x3e5b('0x1a')](function(){return _0x52d89e;});}else{return _0x52d89e;}})[_0x3e5b('0x23')](function(_0x1ec1f6){logger[_0x3e5b('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ec1f6);throw _0x1ec1f6;});}return _0x52d89e;})['then'](respondWithResult(_0x52e98f,0xc9))[_0x3e5b('0x23')](handleError(_0x52e98f,null));};exports[_0x3e5b('0x6f')]=function(_0x4dd417,_0x404621){var _0x6e1c5=null;_0x4dd417[_0x3e5b('0x64')][_0x3e5b('0x65')][_0x3e5b('0x39')](',')[_0x3e5b('0x66')](_0x1bbcf5=>{if(_0x1bbcf5['trim']()!==''&&!wildcardUtils[_0x3e5b('0x68')](_0x1bbcf5[_0x3e5b('0x67')]())){_0x6e1c5=new APIBadRequestError('\x22'+_0x1bbcf5['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x6e1c5){return handleError(_0x404621,null)(_0x6e1c5);}if(_0x4dd417['body']['id']){delete _0x4dd417[_0x3e5b('0x64')]['id'];}return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x4dd417[_0x3e5b('0x5f')]['id']},'include':[{'model':db[_0x3e5b('0x49')],'as':_0x3e5b('0x60')}]})['then'](handleEntityNotFound(_0x404621,null))[_0x3e5b('0x1a')](saveUpdates(_0x4dd417[_0x3e5b('0x64')],null))['then'](respondWithResult(_0x404621,null))[_0x3e5b('0x23')](handleError(_0x404621,null));};exports['destroy']=function(_0x4f62fb,_0x211e73){return db[_0x3e5b('0x4b')]['find']({'where':{'id':_0x4f62fb[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x211e73,null))['then'](removeEntity(_0x211e73,null))[_0x3e5b('0x23')](handleError(_0x211e73,null));};exports[_0x3e5b('0x70')]=function(_0x14baa9,_0x1425eb){return db[_0x3e5b('0x4b')][_0x3e5b('0x70')]()['then'](respondWithResult(_0x1425eb,null))['catch'](handleError(_0x1425eb,null));};exports[_0x3e5b('0x71')]=function(_0x5c63d0,_0x568890){if(_0x5c63d0[_0x3e5b('0x64')]['id']){delete _0x5c63d0[_0x3e5b('0x64')]['id'];}return db[_0x3e5b('0x4b')]['find']({'where':{'id':_0x5c63d0[_0x3e5b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x568890,null))[_0x3e5b('0x1a')](function(_0x4dbea3){if(_0x4dbea3){_0x5c63d0[_0x3e5b('0x64')][_0x3e5b('0x72')]=_0x4dbea3['id'];return db[_0x3e5b('0x73')][_0x3e5b('0x63')](_0x5c63d0['body']);}})[_0x3e5b('0x1a')](respondWithResult(_0x568890,null))['catch'](handleError(_0x568890,null));};exports[_0x3e5b('0x74')]=function(_0x8f992f,_0x58ccf3){var _0x272ef1={'raw':![],'where':{}};var _0x3279cc={};var _0x43e8ad={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3e5b('0x75')]({'where':{'id':_0x8f992f[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x58ccf3,null))['then'](function(_0x1797da){if(_0x1797da){_0x3279cc[_0x3e5b('0x46')]=_['keys'](db[_0x3e5b('0x73')][_0x3e5b('0x4c')]);_0x3279cc[_0x3e5b('0x4d')]=_['keys'](_0x8f992f[_0x3e5b('0x4d')]);_0x3279cc[_0x3e5b('0x4f')]=_[_0x3e5b('0x50')](_0x3279cc[_0x3e5b('0x46')],_0x3279cc['query']);_0x272ef1[_0x3e5b('0x51')]=_['intersection'](_0x3279cc[_0x3e5b('0x46')],qs['fields'](_0x8f992f[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x272ef1['attributes']=_0x272ef1[_0x3e5b('0x51')][_0x3e5b('0x53')]?_0x272ef1['attributes']:_0x3279cc[_0x3e5b('0x46')];if(!_0x8f992f[_0x3e5b('0x4d')][_0x3e5b('0x54')](_0x3e5b('0x55'))){_0x272ef1['limit']=qs['limit'](_0x8f992f[_0x3e5b('0x4d')][_0x3e5b('0x2a')]);_0x272ef1[_0x3e5b('0x28')]=qs[_0x3e5b('0x28')](_0x8f992f[_0x3e5b('0x4d')][_0x3e5b('0x28')]);}_0x272ef1['order']=qs['sort'](_0x8f992f[_0x3e5b('0x4d')][_0x3e5b('0x56')]);_0x272ef1[_0x3e5b('0x57')]=qs[_0x3e5b('0x4f')](_[_0x3e5b('0x58')](_0x8f992f[_0x3e5b('0x4d')],_0x3279cc[_0x3e5b('0x4f')]));_0x272ef1[_0x3e5b('0x57')]['ChatWebsiteId']=_0x1797da['id'];if(_0x8f992f['query'][_0x3e5b('0x59')]){_0x272ef1['where']=_[_0x3e5b('0x61')](_0x272ef1[_0x3e5b('0x57')],{'$or':_[_0x3e5b('0x4a')](_0x272ef1[_0x3e5b('0x51')],function(_0x3d4e20){var _0x269c0a={};_0x269c0a[_0x3d4e20]={'$like':'%'+_0x8f992f[_0x3e5b('0x4d')][_0x3e5b('0x59')]+'%'};return _0x269c0a;})});}_0x272ef1=_[_0x3e5b('0x61')]({},_0x272ef1,_0x8f992f[_0x3e5b('0x5b')]);return db[_0x3e5b('0x73')][_0x3e5b('0x2b')]({'where':_0x272ef1[_0x3e5b('0x57')]})['then'](function(_0x59909d){_0x43e8ad[_0x3e5b('0x2b')]=_0x59909d;if(_0x8f992f[_0x3e5b('0x4d')][_0x3e5b('0x5c')]){_0x272ef1[_0x3e5b('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0x3e5b('0x76')](_0x272ef1);})['then'](function(_0x215c43){_0x43e8ad['rows']=_0x215c43;return _0x43e8ad;});}})[_0x3e5b('0x1a')](respondWithFilteredResult(_0x58ccf3,_0x272ef1))[_0x3e5b('0x23')](handleError(_0x58ccf3,null));};exports[_0x3e5b('0x77')]=function(_0x5bc994,_0x121c8f){return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x5bc994[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x121c8f,null))['then'](function(_0x57819a){if(_0x57819a){return _0x57819a[_0x3e5b('0x77')](_0x5bc994['query'][_0x3e5b('0x78')]);}})[_0x3e5b('0x1a')](respondWithStatusCode(_0x121c8f,null))[_0x3e5b('0x23')](handleError(_0x121c8f,null));};exports[_0x3e5b('0x79')]=function(_0x41de83,_0x2df067){if(_0x41de83[_0x3e5b('0x64')]['id']){delete _0x41de83[_0x3e5b('0x64')]['id'];}return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x41de83[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x2df067,null))['then'](function(_0x9aecab){if(_0x9aecab){_0x41de83[_0x3e5b('0x64')]['ChatWebsiteId']=_0x9aecab['id'];return db['CannedAnswer'][_0x3e5b('0x63')](_0x41de83[_0x3e5b('0x64')]);}})[_0x3e5b('0x1a')](respondWithResult(_0x2df067,null))[_0x3e5b('0x23')](handleError(_0x2df067,null));};exports[_0x3e5b('0x7a')]=function(_0x4c66b7,_0xc78d12){var _0x41f7c8={'raw':![],'where':{}};var _0x506a2d={};var _0x53913d={'count':0x0,'rows':[]};return db[_0x3e5b('0x4b')][_0x3e5b('0x75')]({'where':{'id':_0x4c66b7['params']['id']}})['then'](handleEntityNotFound(_0xc78d12,null))[_0x3e5b('0x1a')](function(_0x12fcdf){if(_0x12fcdf){_0x506a2d['model']=_[_0x3e5b('0x4e')](db[_0x3e5b('0x7b')][_0x3e5b('0x4c')]);_0x506a2d[_0x3e5b('0x4d')]=_[_0x3e5b('0x4e')](_0x4c66b7['query']);_0x506a2d['filters']=_[_0x3e5b('0x50')](_0x506a2d[_0x3e5b('0x46')],_0x506a2d[_0x3e5b('0x4d')]);_0x41f7c8[_0x3e5b('0x51')]=_[_0x3e5b('0x50')](_0x506a2d[_0x3e5b('0x46')],qs[_0x3e5b('0x52')](_0x4c66b7[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x41f7c8[_0x3e5b('0x51')]=_0x41f7c8[_0x3e5b('0x51')][_0x3e5b('0x53')]?_0x41f7c8[_0x3e5b('0x51')]:_0x506a2d[_0x3e5b('0x46')];if(!_0x4c66b7[_0x3e5b('0x4d')][_0x3e5b('0x54')](_0x3e5b('0x55'))){_0x41f7c8[_0x3e5b('0x2a')]=qs[_0x3e5b('0x2a')](_0x4c66b7[_0x3e5b('0x4d')][_0x3e5b('0x2a')]);_0x41f7c8[_0x3e5b('0x28')]=qs[_0x3e5b('0x28')](_0x4c66b7[_0x3e5b('0x4d')][_0x3e5b('0x28')]);}_0x41f7c8['order']=qs['sort'](_0x4c66b7[_0x3e5b('0x4d')][_0x3e5b('0x56')]);_0x41f7c8[_0x3e5b('0x57')]=qs[_0x3e5b('0x4f')](_['pick'](_0x4c66b7[_0x3e5b('0x4d')],_0x506a2d['filters']));_0x41f7c8[_0x3e5b('0x57')][_0x3e5b('0x72')]=_0x12fcdf['id'];if(_0x4c66b7[_0x3e5b('0x4d')][_0x3e5b('0x59')]){_0x41f7c8[_0x3e5b('0x57')]=_['merge'](_0x41f7c8[_0x3e5b('0x57')],{'$or':_[_0x3e5b('0x4a')](_0x41f7c8[_0x3e5b('0x51')],function(_0x2cedeb){var _0xf51840={};_0xf51840[_0x2cedeb]={'$like':'%'+_0x4c66b7[_0x3e5b('0x4d')]['filter']+'%'};return _0xf51840;})});}_0x41f7c8=_['merge']({},_0x41f7c8,_0x4c66b7[_0x3e5b('0x5b')]);return db['CannedAnswer'][_0x3e5b('0x2b')]({'where':_0x41f7c8[_0x3e5b('0x57')]})[_0x3e5b('0x1a')](function(_0x28d461){_0x53913d['count']=_0x28d461;if(_0x4c66b7['query'][_0x3e5b('0x5c')]){_0x41f7c8[_0x3e5b('0x5d')]=[{'all':!![]}];}return db[_0x3e5b('0x7b')][_0x3e5b('0x76')](_0x41f7c8);})[_0x3e5b('0x1a')](function(_0x1bbe3e){_0x53913d['rows']=_0x1bbe3e;return _0x53913d;});}})['then'](respondWithFilteredResult(_0xc78d12,_0x41f7c8))[_0x3e5b('0x23')](handleError(_0xc78d12,null));};exports[_0x3e5b('0x7c')]=function(_0x38db0c,_0x1ac1ad){return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x38db0c[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x1ac1ad,null))[_0x3e5b('0x1a')](function(_0x3df23e){if(_0x3df23e){return _0x3df23e[_0x3e5b('0x7c')](_0x38db0c[_0x3e5b('0x4d')][_0x3e5b('0x78')]);}})[_0x3e5b('0x1a')](respondWithStatusCode(_0x1ac1ad,null))[_0x3e5b('0x23')](handleError(_0x1ac1ad,null));};exports['addLogo']=function(_0x3d381b,_0x3e4458){_0x3d381b[_0x3e5b('0x64')][_0x3e5b('0x7d')]=_0x3d381b[_0x3e5b('0x7e')][_0x3e5b('0x7f')];return db[_0x3e5b('0x4b')]['find']({'where':{'id':_0x3d381b[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x3e4458,null))[_0x3e5b('0x1a')](saveUpdates(_0x3d381b[_0x3e5b('0x64')],null))['then'](respondWithResult(_0x3e4458,null))[_0x3e5b('0x23')](handleError(_0x3e4458,null));};exports[_0x3e5b('0x80')]=function(_0x253b17,_0x111f23){_0x253b17[_0x3e5b('0x64')][_0x3e5b('0x81')]=_0x253b17[_0x3e5b('0x7e')][_0x3e5b('0x7f')];return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x253b17[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x111f23,null))['then'](saveUpdates(_0x253b17[_0x3e5b('0x64')],null))[_0x3e5b('0x1a')](respondWithResult(_0x111f23,null))[_0x3e5b('0x23')](handleError(_0x111f23,null));};exports[_0x3e5b('0x82')]=function(_0x1f12d8,_0x1ab144){_0x1f12d8[_0x3e5b('0x64')][_0x3e5b('0x83')]=_0x1f12d8[_0x3e5b('0x7e')]['filename'];return db['ChatWebsite'][_0x3e5b('0x62')]({'where':{'id':_0x1f12d8[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x1ab144,null))['then'](saveUpdates(_0x1f12d8[_0x3e5b('0x64')],null))[_0x3e5b('0x1a')](respondWithResult(_0x1ab144,null))['catch'](handleError(_0x1ab144,null));};exports[_0x3e5b('0x84')]=function(_0x36c589,_0x3e6f62){_0x36c589[_0x3e5b('0x64')][_0x3e5b('0x85')]=_0x36c589[_0x3e5b('0x7e')][_0x3e5b('0x7f')];return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x36c589[_0x3e5b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e6f62,null))[_0x3e5b('0x1a')](saveUpdates(_0x36c589['body'],null))[_0x3e5b('0x1a')](respondWithResult(_0x3e6f62,null))[_0x3e5b('0x23')](handleError(_0x3e6f62,null));};exports[_0x3e5b('0x86')]=function(_0x45b212,_0x272aab){var _0x5c8cf2=path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0x89'));var _0xe07809={'where':{'id':_0x45b212[_0x3e5b('0x5f')]['id']},'attributes':['id',_0x3e5b('0x7d')],'raw':!![]};var _0x61d17a=![];return require('../../config/license/util')[_0x3e5b('0x8a')]()[_0x3e5b('0x1a')](function(_0x5027ef){if(_0x5027ef){_0x61d17a=_0x5027ef[_0x3e5b('0x8b')];}})[_0x3e5b('0x1a')](function(){return db['ChatWebsite']['find'](_0xe07809);})['then'](handleEntityNotFound(_0x272aab,null))[_0x3e5b('0x1a')](function(_0x39dafa){if(_0x39dafa){if(!_[_0x3e5b('0x8c')](_0x39dafa['sitepic'])){if(fs['existsSync'](path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],'server/files/images/logos/',_0x39dafa['sitepic']))&&_0x61d17a){_0x5c8cf2=path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0x8d'),_0x39dafa[_0x3e5b('0x7d')]);}}return _0x272aab[_0x3e5b('0x8e')](_0x5c8cf2);}})['catch'](handleError(_0x272aab,null));};exports[_0x3e5b('0x8f')]=function(_0x23c2e1,_0x6dc9ea){var _0x5c7523=path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0x90'));var _0x48d60d={'where':{'id':_0x23c2e1['params']['id']},'attributes':['id',_0x3e5b('0x81')],'raw':!![]};return db[_0x3e5b('0x4b')][_0x3e5b('0x62')](_0x48d60d)[_0x3e5b('0x1a')](handleEntityNotFound(_0x6dc9ea,null))[_0x3e5b('0x1a')](function(_0x55afb6){if(_0x55afb6){if(!_[_0x3e5b('0x8c')](_0x55afb6[_0x3e5b('0x81')])){if(fs[_0x3e5b('0x91')](path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0x92'),_0x55afb6['agentAvatar']))){_0x5c7523=path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0x92'),_0x55afb6['agentAvatar']);}}return _0x6dc9ea[_0x3e5b('0x8e')](_0x5c7523);}})[_0x3e5b('0x23')](handleError(_0x6dc9ea,null));};exports[_0x3e5b('0x93')]=function(_0x334086,_0x44b54b){var _0x4c1c66=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x5f2b13={'where':{'id':_0x334086[_0x3e5b('0x5f')]['id']},'attributes':['id',_0x3e5b('0x83'),_0x3e5b('0x94')],'raw':!![]};return db['ChatWebsite'][_0x3e5b('0x62')](_0x5f2b13)['then'](handleEntityNotFound(_0x44b54b,null))['then'](function(_0x376d11){if(_0x376d11){if(!_[_0x3e5b('0x8c')](_0x376d11['customerAvatar'])){if(fs[_0x3e5b('0x91')](path['join'](config[_0x3e5b('0x88')],'server/files/images/avatars/',_0x376d11[_0x3e5b('0x83')]))&&_0x376d11[_0x3e5b('0x94')]){_0x4c1c66=path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],'server/files/images/avatars/',_0x376d11[_0x3e5b('0x83')]);}}return _0x44b54b[_0x3e5b('0x8e')](_0x4c1c66);}})[_0x3e5b('0x23')](handleError(_0x44b54b,null));};exports[_0x3e5b('0x95')]=function(_0x9a8a57,_0x59762c){var _0x2ad1dc=path[_0x3e5b('0x87')](config['root'],_0x3e5b('0x96'));var _0x5cf336={'where':{'id':_0x9a8a57[_0x3e5b('0x5f')]['id']},'attributes':['id',_0x3e5b('0x85')],'raw':!![]};return db[_0x3e5b('0x4b')]['find'](_0x5cf336)['then'](handleEntityNotFound(_0x59762c,null))['then'](function(_0x571557){if(_0x571557){if(!_[_0x3e5b('0x8c')](_0x571557[_0x3e5b('0x85')])){if(fs[_0x3e5b('0x91')](path[_0x3e5b('0x87')](config['root'],'server/files/images/avatars/',_0x571557['systemAvatar']))){_0x2ad1dc=path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0x92'),_0x571557['systemAvatar']);}}return _0x59762c[_0x3e5b('0x8e')](_0x2ad1dc);}})[_0x3e5b('0x23')](handleError(_0x59762c,null));};function checkWebsiteInterval(_0x25a910){var _0x59be8d=_0x25a910[_0x3e5b('0x97')];if(!_0x59be8d){return Promise['resolve'](_0x25a910);}var _0x13a7c1=_0x25a910['timezone']||undefined;return _0x59be8d[_0x3e5b('0x98')](_0x13a7c1)[_0x3e5b('0x1a')](function(_0x408741){if(!_0x408741){throw new APIOutOfIntervalError();}return _0x25a910;});}exports[_0x3e5b('0x99')]=function(_0x10fc88,_0x127d75){var _0x370c16={'body':_0x10fc88['body'],'channel':_0x3e5b('0x9a')};var _0x49ea7b=[];var _0x259c6d=[];var _0x51b6ae={};var _0x1a2f6e=![];if(_0x10fc88['body']['id']){delete _0x10fc88[_0x3e5b('0x64')]['id'];}if(_[_0x3e5b('0x8c')](_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0x9b')])){throw new APIBadRequestError(_0x3e5b('0x9c'));}if(_[_0x3e5b('0x8c')](_0x10fc88[_0x3e5b('0x64')]['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x3e5b('0x9d')](_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0x64')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x4a1cba=_0x10fc88[_0x3e5b('0x64')]['customerIp']&&_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0x3d')];return db[_0x3e5b('0x9e')][_0x3e5b('0x70')]()[_0x3e5b('0x1a')](function(_0x4531d9){if(!_0x4531d9){throw new Error(_0x3e5b('0x9f'));}_0x49ea7b=Object[_0x3e5b('0x4e')](_0x4531d9)[_0x3e5b('0x59')](function(_0x5cb09d){return![_0x3e5b('0xa0'),_0x3e5b('0xa1')]['includes'](_0x5cb09d);});_0x259c6d=Object[_0x3e5b('0x4e')](_0x4531d9)[_0x3e5b('0x59')](function(_0x4bf241){return![_0x3e5b('0xa0'),_0x3e5b('0xa1'),'CompanyId',_0x3e5b('0xa2')]['includes'](_0x4bf241);});if(!_[_0x3e5b('0xa3')](_0x259c6d,_0x10fc88['body'][_0x3e5b('0xa4')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x259c6d[_0x3e5b('0x87')](',\x20'));}_0x51b6ae[_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xa4')]]=_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0x9b')];})[_0x3e5b('0x1a')](function(){return db[_0x3e5b('0x4b')]['find']({'where':{'id':_0x10fc88[_0x3e5b('0x5f')]['id']},'include':[{'model':db[_0x3e5b('0xa5')],'as':_0x3e5b('0xa6'),'include':[{'model':db[_0x3e5b('0x9e')],'as':_0x3e5b('0xa7'),'where':_0x51b6ae,'limit':0x1,'order':[[_0x3e5b('0xa1'),_0x3e5b('0xa8')]]}]},{'model':db[_0x3e5b('0xa9')],'as':_0x3e5b('0xaa')},{'model':db[_0x3e5b('0x97')],'as':_0x3e5b('0x97'),'include':[{'model':db[_0x3e5b('0x97')],'as':_0x3e5b('0xab'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x3e5b('0x1a')](function(_0x240456){if(!_0x240456){throw new APINotFoundError(util[_0x3e5b('0x40')](_0x3e5b('0xac'),_0x10fc88[_0x3e5b('0x5f')]['id']));}if(_0x4a1cba){return checkWebsiteInterval(_0x240456);}return _0x240456;})[_0x3e5b('0x1a')](function(_0x40a017){_0x370c16[_0x3e5b('0xad')]=_0x40a017;_0x370c16[_0x3e5b('0xae')]=_[_0x3e5b('0xaf')](_0x40a017[_0x3e5b('0xaa')],['priority'],['asc']);if(_0x370c16['account'][_0x3e5b('0xaa')]){delete _0x370c16[_0x3e5b('0xad')][_0x3e5b('0xaa')];}_0x370c16[_0x3e5b('0xb0')]=_0x40a017[_0x3e5b('0xa6')]||{'id':_0x40a017[_0x3e5b('0xa2')]};if(_0x370c16[_0x3e5b('0xb0')]&&_0x370c16[_0x3e5b('0xb0')]['Contacts'][_0x3e5b('0x53')]){return _0x370c16[_0x3e5b('0xb0')][_0x3e5b('0xa7')][0x0];}var _0x27281e=_[_0x3e5b('0xb1')](_0x10fc88[_0x3e5b('0x64')],{'firstName':_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0x9b')],'ListId':_0x40a017[_0x3e5b('0xa2')]});_0x27281e[_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xa4')]]=_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0x9b')];return db[_0x3e5b('0x9e')]['create'](_0x27281e,{'fields':_0x49ea7b,'raw':!![]});})[_0x3e5b('0x1a')](function(_0x42b8dc){_0x370c16[_0x3e5b('0xb2')]=_0x42b8dc;var _0x1b9c17=createInteractionObject(_0x10fc88[_0x3e5b('0x5f')]['id'],_0x10fc88[_0x3e5b('0x64')],_0x10fc88[_0x3e5b('0xb3')],_0x42b8dc);var _0x5b6312={'ChatWebsiteId':_0x10fc88[_0x3e5b('0x5f')]['id']};if(_0x10fc88[_0x3e5b('0x64')]['threadId']){_0x5b6312['threadId']=_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xb4')];_0x5b6312[_0x3e5b('0xb5')]=![];return db[_0x3e5b('0xb6')][_0x3e5b('0x62')]({'where':_0x5b6312})['then'](function(_0x18bc27){var _0x34cec1=_0x10fc88[_0x3e5b('0x64')]['customerIp']&&_0x10fc88['body'][_0x3e5b('0x3d')];if(_0x18bc27){_0x1a2f6e=!![];return _0x18bc27;}else if(!_0x34cec1&&_0x18bc27&&_0x18bc27[_0x3e5b('0xb5')]){throw new APIConflictError(_0x3e5b('0xb7'));}_0x1b9c17['threadId']=_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xb4')];_0x1b9c17['externalUrl']=_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xb8')];return db[_0x3e5b('0xb6')][_0x3e5b('0x63')](_0x1b9c17);});}_0x5b6312[_0x3e5b('0xb9')]=_0x42b8dc['id'];if(_0x10fc88['body'][_0x3e5b('0xba')]&&_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xba')]['id']){_0x5b6312['id']=_0x10fc88['body'][_0x3e5b('0xba')]['id'];return db[_0x3e5b('0xb6')]['find']({'where':_0x5b6312})['then'](function(_0x2f56d7){var _0x329531=_0x10fc88['body'][_0x3e5b('0xbb')]&&_0x10fc88['body']['referer'];if(!_0x329531&&_0x2f56d7&&_0x2f56d7['closed']){throw new APIConflictError(_0x3e5b('0xb7'));}else if(_0x2f56d7){_0x1a2f6e=!![];return _0x2f56d7;}else{return db[_0x3e5b('0xb6')][_0x3e5b('0x63')](_0x1b9c17);}});}return db[_0x3e5b('0xb6')]['create'](_0x1b9c17);})['then'](function(_0x31dd7a){if(!_0x1a2f6e){return _0x31dd7a;}var _0x2af831={'from':(_0x370c16[_0x3e5b('0xb2')][_0x3e5b('0x3a')]||'')+'\x20'+(_0x370c16['contact'][_0x3e5b('0x3b')]||'')};if(_0x10fc88['body'][_0x3e5b('0xb4')]&&_0x10fc88['body']['messageId']&&_0x10fc88[_0x3e5b('0x64')]['threadId']!=_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xbc')]){_0x2af831[_0x3e5b('0xb4')]=_0x10fc88['body']['messageId'];}return _0x31dd7a['update'](_0x2af831);})['then'](function(_0x5d655f){_0x370c16[_0x3e5b('0xba')]=_0x5d655f[_0x3e5b('0x2f')]({'plain':!![]});_0x370c16[_0x3e5b('0xba')][_0x3e5b('0xbd')]=!_0x1a2f6e;if(_0x370c16['interaction'][_0x3e5b('0xbd')]){if(_0x370c16[_0x3e5b('0xad')][_0x3e5b('0xbe')]){_0x370c16[_0x3e5b('0xae')][_0x3e5b('0xbf')]({'id':0x0,'priority':_0x370c16[_0x3e5b('0xae')]['length']+0x1,'app':_0x3e5b('0xc0'),'appdata':_0x3e5b('0xc1'),'interval':_0x3e5b('0xc2')});}}return db[_0x3e5b('0xc3')][_0x3e5b('0x63')]({'body':_0x10fc88['body'][_0x3e5b('0x64')],'ChatWebsiteId':_0x10fc88[_0x3e5b('0x5f')]['id'],'ChatInteractionId':_0x5d655f['id'],'direction':'in','ContactId':_0x370c16['contact']['id'],'AttachmentId':_0x10fc88[_0x3e5b('0x64')][_0x3e5b('0xc4')]});})[_0x3e5b('0x1a')](function(_0x34c414){_0x370c16['message']=_0x34c414;if(!_0x370c16['interaction'][_0x3e5b('0xc5')]){return;}return db[_0x3e5b('0xc6')][_0x3e5b('0x62')]({'attributes':['id','name'],'where':{'id':_0x370c16['interaction']['UserId']}});})[_0x3e5b('0x1a')](function(_0x2be7d4){if(_0x2be7d4){_0x370c16['applications'][_0x3e5b('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2be7d4[_0x3e5b('0x33')]+','+(_0x370c16[_0x3e5b('0xad')][_0x3e5b('0xc8')]||0xa),'interval':_0x3e5b('0xc2')});_0x370c16[_0x3e5b('0xc9')]=!![];}if(!_0x370c16['interaction']['queueId']){return;}return db[_0x3e5b('0xca')]['find']({'attributes':['id',_0x3e5b('0x33')],'where':{'id':_0x370c16[_0x3e5b('0xba')][_0x3e5b('0xcb')]}});})['then'](function(_0x18621c){if(_0x18621c){_0x370c16[_0x3e5b('0xae')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x18621c[_0x3e5b('0x33')]+','+(_0x370c16['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x3e5b('0xc2')});}return respondWithRpcPromise(_0x3e5b('0xcc'),_0x3e5b('0xcd'),_0x370c16);})[_0x3e5b('0x1a')](function(_0x37943a){respondWithRpcPromise(_0x3e5b('0xce'),_0x3e5b('0xce'),{'event':_0x3e5b('0x99'),'message':_0x37943a},client9002);return _0x37943a;})['then'](respondWithResult(_0x127d75,null))['catch'](APIHandleError(_0x127d75));};exports[_0x3e5b('0xcf')]=function(_0x5750df,_0x5a26d9){var _0x2d8ef1,_0x556e15,_0x1fe234;var _0x1f0764=[];var _0x1eae47={};var _0x24f71b=_0x5750df[_0x3e5b('0xd0')]||[];var _0x242093=[];var _0x1b1564;return db[_0x3e5b('0x9e')][_0x3e5b('0x70')]()[_0x3e5b('0x1a')](function(_0x4ba35e){if(!_0x4ba35e){throw new db[(_0x3e5b('0xd1'))]['ValidationError']('no\x20available\x20attributes');}_0x1f0764=_[_0x3e5b('0xd2')](_[_0x3e5b('0x4e')](_0x4ba35e),['createdAt',_0x3e5b('0xa1'),_0x3e5b('0xd3'),_0x3e5b('0xa2')]);if(_0x5750df[_0x3e5b('0x64')]['id']){delete _0x5750df['body']['id'];}if(_[_0x3e5b('0x8c')](_0x5750df['body'][_0x3e5b('0x9b')])){throw _0x5a26d9[_0x3e5b('0x25')](0x1f4)[_0x3e5b('0x34')](new db[(_0x3e5b('0xd1'))]['ValidationError'](_0x3e5b('0xd4')));}if(_[_0x3e5b('0x8c')](_0x5750df[_0x3e5b('0x64')][_0x3e5b('0x64')])||_0x5750df[_0x3e5b('0x64')]['body']===''){throw _0x5a26d9[_0x3e5b('0x25')](0x1f4)[_0x3e5b('0x34')](new db[(_0x3e5b('0xd1'))][(_0x3e5b('0xd5'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x5750df[_0x3e5b('0x64')][_0x3e5b('0xd6')])){throw _0x5a26d9[_0x3e5b('0x25')](0x1f4)[_0x3e5b('0x34')](new db['Sequelize'][(_0x3e5b('0xd5'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f0764));}if(!_[_0x3e5b('0xa3')](_0x1f0764,_0x5750df['body'][_0x3e5b('0xd6')])){throw _0x5a26d9[_0x3e5b('0x25')](0x1f4)[_0x3e5b('0x34')](new db[(_0x3e5b('0xd1'))][(_0x3e5b('0xd5'))](_0x3e5b('0xd7')+_0x1f0764));}_0x1eae47[_0x5750df[_0x3e5b('0x64')][_0x3e5b('0xd6')]]=_0x5750df[_0x3e5b('0x64')][_0x3e5b('0x9b')];})[_0x3e5b('0x1a')](function(){return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x5750df[_0x3e5b('0x5f')]['id']},'include':[{'model':db[_0x3e5b('0xa5')],'as':_0x3e5b('0xa6')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x5a26d9,null))[_0x3e5b('0x1a')](function(_0x38295b){if(_0x38295b&&_0x38295b[_0x3e5b('0xa6')]){_0x556e15=_0x38295b;var _0x533bbb=_[_0x3e5b('0xb1')](_0x5750df[_0x3e5b('0x64')],{'firstName':_0x5750df[_0x3e5b('0x64')][_0x3e5b('0x9b')],'phone':_0x5750df[_0x3e5b('0x64')][_0x3e5b('0x9b')],'ListId':_0x38295b[_0x3e5b('0xa2')]});_0x533bbb[_0x5750df[_0x3e5b('0x64')][_0x3e5b('0xd6')]]=_0x5750df[_0x3e5b('0x64')]['from'];return db[_0x3e5b('0x9e')][_0x3e5b('0xd8')]({'where':_0x1eae47,'defaults':_0x533bbb});}})['spread'](function(_0x1fe8af){if(_0x1fe8af){_0x1fe234=_0x1fe8af;var _0x104a3f=fs[_0x3e5b('0xd9')](path[_0x3e5b('0x87')](config['root'],_0x3e5b('0xda')),'utf8');var _0x3e907b=ejs[_0x3e5b('0xdb')](_0x104a3f,{'body':_['toPairs'](_0x5750df[_0x3e5b('0x64')][_0x3e5b('0x64')]),'bodyTitle':_0x556e15['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x3e907b,'plainBody':htmlToText[_0x3e5b('0xdc')](_0x3e907b),'ContactId':_0x1fe8af['id'],'ChatWebsiteId':_0x556e15['id']});}})[_0x3e5b('0x1a')](function(_0x346598){_0x1b1564=_0x346598;if(_0x24f71b[_0x3e5b('0x53')]){var _0x1e8990=_0x24f71b[_0x3e5b('0x4a')](function(_0x38cfb0){return{'name':_0x38cfb0[_0x3e5b('0xdd')],'basename':_0x38cfb0[_0x3e5b('0x7f')],'type':_0x38cfb0[_0x3e5b('0xde')],'ChatOfflineMessageId':_0x346598['id']};});_0x242093=_0x1e8990[_0x3e5b('0x4a')](_0x34d441=>{var _0x13b073={'filename':_0x34d441['name'],'path':path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],'server','files','attachments',_0x3e5b('0xdf'),_0x34d441['basename'])};return _0x13b073;});if(!_0x556e15[_0x3e5b('0xe0')]){return db[_0x3e5b('0xe1')][_0x3e5b('0xe2')](function(_0x7a013d){return db['Attachment']['bulkCreate'](_0x1e8990,{'transaction':_0x7a013d});});}}})[_0x3e5b('0x1a')](function(){if(_0x1b1564){_0x2d8ef1=_0x1b1564;return db[_0x3e5b('0xe3')][_0x3e5b('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0x3e5b('0xe4')],'as':_0x3e5b('0xe5'),'raw':!![],'include':[{'model':db[_0x3e5b('0xe6')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x110efe){if(_0x110efe&&_0x110efe[_0x3e5b('0xe5')]&&_0x556e15['forwardOffline']&&_0x556e15['forwardOfflineAddress']){var _0x11311d=_0x110efe[_0x3e5b('0xe7')]();return respondWithRpcPromise(_0x3e5b('0xe8'),_0x3e5b('0xe9'),{'account':_0x11311d,'message':{'from':util['format'](_0x3e5b('0xea'),_0x110efe[_0x3e5b('0x33')],_0x110efe[_0x3e5b('0xeb')]||_0x110efe[_0x3e5b('0xe5')][_0x3e5b('0x6a')]),'to':_0x556e15[_0x3e5b('0xec')],'subject':_0x556e15[_0x3e5b('0xed')],'html':_0x2d8ef1[_0x3e5b('0x64')],'attachments':_0x242093}},client9003)[_0x3e5b('0x1a')](function(){return _0x2d8ef1;})['catch'](function(_0x5756f9){logger['error'](_0x5756f9);});}})[_0x3e5b('0x1a')](function(){if(_0x556e15&&_0x556e15[_0x3e5b('0xe0')]&&_0x556e15[_0x3e5b('0xee')]){var _0x43d8ed=[];if(_0x24f71b[_0x3e5b('0x53')]){_0x43d8ed=_0x24f71b[_0x3e5b('0x4a')](function(_0x4da8aa){return{'name':_0x4da8aa['originalname'],'basename':_0x4da8aa[_0x3e5b('0x7f')],'type':_0x4da8aa[_0x3e5b('0xde')],'ChatOfflineMessageId':_0x1b1564['id']};});}var _0x180906;if(!_[_0x3e5b('0x8c')](_0x556e15[_0x3e5b('0xef')])){var _0x1f0412=_[_0x3e5b('0x4a')](_0x5750df['body'],function(_0x45114e){return _0x45114e;});var _0x35430b=_[_0x3e5b('0xf0')](_0x1f0412)[0x0];var _0x386a66=_[_0x3e5b('0xf1')](_0x35430b,function(_0x434e78){return _0x434e78;});_0x180906=_0x386a66[0x1][_0x556e15[_0x3e5b('0xef')]];}var _0x1583d7={'from':_0x1fe234[_0x3e5b('0xeb')],'firstName':_0x1fe234[_0x3e5b('0x3a')],'lastName':_0x1fe234[_0x3e5b('0x3b')],'mapKey':'email','message':{'from':_0x1fe234[_0x3e5b('0xeb')],'to':_0x556e15['MailAccount']['email'],'cc':'','subject':_[_0x3e5b('0x8c')](_0x180906)?_0x556e15[_0x3e5b('0xed')]:_0x180906,'messageId':'','sentAt':new Date(),'attach':_0x43d8ed[_0x3e5b('0x53')],'attachments':_0x43d8ed,'originChannel':_0x3e5b('0xf2'),'ChatWebsiteId':_0x556e15['id'],'ChatOfflineMessageId':_0x2d8ef1['id'],'originTo':_0x556e15[_0x3e5b('0xe3')]['email']},'body':_0x2d8ef1['body']};var _0x3a3e20={'account':{'id':_0x556e15[_0x3e5b('0xee')]},'body':_0x1583d7,'log':_0x3e5b('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0x3e5b('0xf4'),_0x3a3e20,client9001)[_0x3e5b('0x1a')](function(){return _0x2d8ef1;})[_0x3e5b('0x23')](function(_0x5e42d4){logger[_0x3e5b('0x1e')](_0x5e42d4);});}return;})[_0x3e5b('0x1a')](function(){if(_0x2d8ef1){return _0x2d8ef1;}})[_0x3e5b('0x1a')](respondWithResult(_0x5a26d9,null))[_0x3e5b('0x23')](function(){for(var _0x1a5048 of _0x24f71b){var _0x3dc35c=path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0xf5'),_0x3e5b('0xd0'),_0x3e5b('0xf6'),_0x3e5b('0xdf'),_0x1a5048[_0x3e5b('0x7f')]);fs_extra['remove'](_0x3dc35c)[_0x3e5b('0x23')](function(_0x555225){logger[_0x3e5b('0x1e')](_0x3e5b('0xf7'),_0x3dc35c,_0x555225);});}});};exports[_0x3e5b('0xf8')]=function(_0x42db1f,_0x4c8745){return db[_0x3e5b('0xb6')][_0x3e5b('0x62')]({'where':{'id':_0x42db1f[_0x3e5b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4c8745,null))[_0x3e5b('0x1a')](function(_0x332a9e){if(_0x332a9e){return _0x332a9e['addInteraction'](_0x42db1f[_0x3e5b('0x64')]['ids'],_[_0x3e5b('0xf9')](_0x42db1f[_0x3e5b('0x64')],[_0x3e5b('0x78'),'id'])||{});}})[_0x3e5b('0x1a')](respondWithResult(_0x4c8745,null))[_0x3e5b('0x23')](handleError(_0x4c8745,null));};exports[_0x3e5b('0xfa')]=function(_0x362b4a,_0x64d132){var _0x3fd595={'raw':![],'where':{}};var _0x5382e6={};var _0x50e28d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3e5b('0x75')]({'where':{'id':_0x362b4a['params']['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x64d132,null))['then'](function(_0x2aef9e){if(_0x2aef9e){_0x5382e6[_0x3e5b('0x46')]=_[_0x3e5b('0x4e')](db[_0x3e5b('0xb6')][_0x3e5b('0x4c')]);_0x5382e6['query']=_[_0x3e5b('0x4e')](_0x362b4a['query']);_0x5382e6['filters']=_[_0x3e5b('0x50')](_0x5382e6['model'],_0x5382e6[_0x3e5b('0x4d')]);_0x3fd595['attributes']=_[_0x3e5b('0x50')](_0x5382e6[_0x3e5b('0x46')],qs['fields'](_0x362b4a[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x3fd595[_0x3e5b('0x51')]=_0x3fd595[_0x3e5b('0x51')][_0x3e5b('0x53')]?_0x3fd595['attributes']:_0x5382e6['model'];if(!_0x362b4a[_0x3e5b('0x4d')][_0x3e5b('0x54')](_0x3e5b('0x55'))){_0x3fd595[_0x3e5b('0x2a')]=qs['limit'](_0x362b4a['query']['limit']);_0x3fd595[_0x3e5b('0x28')]=qs[_0x3e5b('0x28')](_0x362b4a[_0x3e5b('0x4d')][_0x3e5b('0x28')]);}_0x3fd595[_0x3e5b('0xfb')]=qs[_0x3e5b('0x56')](_0x362b4a[_0x3e5b('0x4d')][_0x3e5b('0x56')]);_0x3fd595[_0x3e5b('0x57')]=qs[_0x3e5b('0x4f')](_[_0x3e5b('0x58')](_0x362b4a[_0x3e5b('0x4d')],_0x5382e6['filters']));_0x3fd595[_0x3e5b('0x57')][_0x3e5b('0x72')]=_0x2aef9e['id'];if(_0x362b4a['query'][_0x3e5b('0x59')]){_0x3fd595[_0x3e5b('0x57')]=_['merge'](_0x3fd595[_0x3e5b('0x57')],{'$or':_['map'](_0x3fd595[_0x3e5b('0x51')],function(_0x5a2747){var _0x292214={};_0x292214[_0x5a2747]={'$like':'%'+_0x362b4a[_0x3e5b('0x4d')][_0x3e5b('0x59')]+'%'};return _0x292214;})});}_0x3fd595=_[_0x3e5b('0x61')]({},_0x3fd595,_0x362b4a[_0x3e5b('0x5b')]);return db[_0x3e5b('0xb6')][_0x3e5b('0x2b')]({'where':_0x3fd595[_0x3e5b('0x57')]})[_0x3e5b('0x1a')](function(_0x5f0004){_0x50e28d[_0x3e5b('0x2b')]=_0x5f0004;if(_0x362b4a[_0x3e5b('0x4d')]['includeAll']){_0x3fd595[_0x3e5b('0x5d')]=[{'model':db[_0x3e5b('0x9e')],'as':_0x3e5b('0xfc'),'required':![]},{'model':db['User'],'as':_0x3e5b('0xfd'),'attributes':[_0x3e5b('0x33'),_0x3e5b('0xfe'),_0x3e5b('0xff')],'required':![]},{'model':db['Tag'],'as':_0x3e5b('0x100'),'attributes':['id',_0x3e5b('0x33'),'color'],'where':_0x362b4a[_0x3e5b('0x4d')][_0x3e5b('0x101')]?{'id':_0x362b4a['query']['tag']}:undefined,'required':_0x362b4a[_0x3e5b('0x4d')][_0x3e5b('0x101')]?!![]:![]}];}return db[_0x3e5b('0xb6')][_0x3e5b('0x76')](_0x3fd595);})[_0x3e5b('0x1a')](function(_0x3fb849){_0x50e28d['rows']=_0x3fb849;return _0x50e28d;});}})['then'](respondWithFilteredResult(_0x64d132,_0x3fd595))['catch'](handleError(_0x64d132,null));};exports[_0x3e5b('0x102')]=function(_0x2ba7c8,_0x5a0553){var _0x3c619a=0x0;var _0x927b25=0x0;var _0x4377be=![];var _0x41269e;var _0x1384a7;return db['ChatWebsite'][_0x3e5b('0x62')]({'where':{'id':_0x2ba7c8['params']['id']},'include':[{'model':db[_0x3e5b('0x97')],'as':_0x3e5b('0x97'),'include':[{'model':db[_0x3e5b('0x97')],'as':_0x3e5b('0xab'),'attributes':['id',_0x3e5b('0x103')]}]}]})['then'](handleEntityNotFound(_0x5a0553,null))[_0x3e5b('0x1a')](function(_0x145d81){if(_0x145d81){_0x41269e=_0x145d81;return _0x145d81[_0x3e5b('0x104')]({'raw':!![]});}})['then'](function(_0xe4197d){if(_0x41269e){if(_0xe4197d){_0x1384a7=_0xe4197d;}}return require(_0x3e5b('0x105'))[_0x3e5b('0x8a')]();})[_0x3e5b('0x1a')](function(_0x101f78){if(_0x101f78){_0x927b25=_0x101f78[_0x3e5b('0x106')];_0x4377be=_0x101f78[_0x3e5b('0x8b')];}})[_0x3e5b('0x1a')](function(){return db[_0x3e5b('0xb6')][_0x3e5b('0x2b')]({'where':{'closed':![]}});})[_0x3e5b('0x1a')](function(_0x2cfbdb){_0x3c619a=_0x2cfbdb;if(_0x927b25&&_0x2cfbdb>_0x927b25){return db[_0x3e5b('0x107')][_0x3e5b('0x75')]({'where':{'id':0x1}})[_0x3e5b('0x1a')](function(_0x315efe){if(_0x315efe){_0x315efe[_0x3e5b('0x108')](_0x3e5b('0x109'));}});}})[_0x3e5b('0x1a')](function(){var _0x4d20ac=_0x41269e[_0x3e5b('0x97')];var _0x385726=_0x41269e[_0x3e5b('0x10a')]||undefined;return _0x4d20ac?_0x4d20ac[_0x3e5b('0x98')](_0x385726):!![];})[_0x3e5b('0x1a')](function(_0x2a5704){var _0x2279fe=fs[_0x3e5b('0xd9')](path[_0x3e5b('0x87')](config[_0x3e5b('0x88')],_0x3e5b('0x10b')),'utf8');var _0x57712=_0x3e5b('0x10c');var _0x5a6b89=![];var _0x3a0d03,_0x174147;if(_0x2ba7c8['headers'][_0x3e5b('0x3d')]){_0x3a0d03=new URL(_0x2ba7c8[_0x3e5b('0xb3')][_0x3e5b('0x3d')])['origin'];}else if(_0x2ba7c8[_0x3e5b('0xb3')][_0x3e5b('0x10d')]){_0x3a0d03=new URL(_0x2ba7c8[_0x3e5b('0xb3')][_0x3e5b('0x10d')])[_0x3e5b('0x10d')];}else{_0x3a0d03='http://localhost:9000';}_0x174147=typeof _0x41269e[_0x3e5b('0x65')][_0x3e5b('0x39')](',')[_0x3e5b('0x62')](function(_0x279916){return wildcardUtils[_0x3e5b('0x10e')](_0x279916,_0x3a0d03);})!==_0x3e5b('0x29');var _0x1064b7={'chatVersion':_0x57712,'chatWebsiteAddressOrigin':_0x174147?_0x3a0d03:_0x41269e[_0x3e5b('0x65')],'remote':_0x41269e[_0x3e5b('0x10f')],'query':querystring[_0x3e5b('0x1d')](_[_0x3e5b('0x61')](_0x41269e[_0x3e5b('0x2f')]({'plain':!![]}),{'customerIp':_0x2ba7c8['headers'][_0x3e5b('0x110')]||_0x2ba7c8['headers']['x-real-ip']||_0x2ba7c8[_0x3e5b('0x111')]['remoteAddress']||_0x2ba7c8['ip'],'referer':_0x2ba7c8[_0x3e5b('0xb3')][_0x3e5b('0x3d')],'openedInteractions':_0x3c619a,'maxInteractions':_0x927b25,'virtual':_0x4377be['virtual'],'online':_0x2a5704,'custom':_0x4377be,'address':_0x174147?_0x3a0d03:null}))[_0x3e5b('0x112')](/'/g,'\x5c\x27')};_0x5a0553[_0x3e5b('0x34')](ejs[_0x3e5b('0xdb')](Mustache[_0x3e5b('0xdb')](_0x2279fe,_0x1064b7),{'proactiveActions':_0x1384a7,'alignment':_0x41269e['alignment'],'verticalAlignment':_0x41269e[_0x3e5b('0x113')],'div_color':_0x41269e[_0x3e5b('0x114')],'labelText':_0x41269e[_0x3e5b('0x115')],'text_color':_0x41269e[_0x3e5b('0x116')],'text_button_color':_0x41269e[_0x3e5b('0x117')],'button_color':_0x41269e[_0x3e5b('0x118')],'background_color':_0x41269e[_0x3e5b('0x119')],'hideWhenOffline':_0x41269e[_0x3e5b('0x11a')],'intervalId':_0x41269e[_0x3e5b('0x11b')],'isDevelopment':_0x5a6b89,'chatVersion':_0x57712}));})[_0x3e5b('0x23')](handleError(_0x5a0553,null));};exports['addApplications']=function(_0x44bebe,_0x42320e){var _0x20d4a2=_0x44bebe[_0x3e5b('0x5f')]['id'];var _0x53e2d0=_0x44bebe[_0x3e5b('0x64')];var _0x33c246=0xc8;var _0x179eb4=null;return db[_0x3e5b('0xe1')][_0x3e5b('0xe2')]({'isolationLevel':db[_0x3e5b('0xe1')][_0x3e5b('0x11c')][_0x3e5b('0x11d')][_0x3e5b('0x11e')]},function(_0x4fecda){return db[_0x3e5b('0x4b')][_0x3e5b('0x75')]({'where':{'id':_0x20d4a2},'transaction':_0x4fecda})[_0x3e5b('0x1a')](function(_0xc33124){if(_0xc33124){return db[_0x3e5b('0xa9')][_0x3e5b('0x2e')]({'where':{'ChatWebsiteId':_0x20d4a2},'transaction':_0x4fecda})[_0x3e5b('0x1a')](function(){var _0x4fcaf4=_[_0x3e5b('0x4a')](_0x53e2d0,function(_0x2fd7f8){_0x2fd7f8[_0x3e5b('0x72')]=_0x20d4a2;return _0x2fd7f8;});return db[_0x3e5b('0xa9')]['bulkCreate'](_0x4fcaf4,{'transaction':_0x4fecda});});}else{_0x33c246=0x194;_0x179eb4=[];}});})[_0x3e5b('0x1a')](function(){if(_0x33c246!==0x194){return db['ChatApplication'][_0x3e5b('0x11f')]({'where':{'ChatWebsiteId':_0x20d4a2},'order':'priority'})[_0x3e5b('0x1a')](function(_0x24361e){_0x179eb4=_0x24361e;});}})[_0x3e5b('0x23')](function(_0x4e95be){_0x33c246=0x1f4;logger['error'](_0x4e95be[_0x3e5b('0x32')]);if(_0x4e95be['name']){delete _0x4e95be[_0x3e5b('0x33')];}_0x179eb4=_0x4e95be;})[_0x3e5b('0x120')](function(){if(_0x179eb4===null){_0x42320e[_0x3e5b('0x24')](_0x33c246);}else{if(_0x33c246===0x1f4){_0x42320e[_0x3e5b('0x25')](_0x33c246)[_0x3e5b('0x34')](_0x179eb4);}else{_0x42320e['status'](_0x33c246)[_0x3e5b('0x27')](_0x179eb4);}}});};exports[_0x3e5b('0x121')]=function(_0x4ea05f,_0x3674dd){var _0x39e7bf={};var _0x31896f={};var _0x1be5f8;var _0x372e8b;return db[_0x3e5b('0x4b')][_0x3e5b('0x75')]({'where':{'id':_0x4ea05f['params']['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x3674dd,null))['then'](function(_0x4321c4){if(_0x4321c4){_0x1be5f8=_0x4321c4;_0x31896f[_0x3e5b('0x46')]=_['keys'](db[_0x3e5b('0xa9')][_0x3e5b('0x4c')]);_0x31896f[_0x3e5b('0x4d')]=_[_0x3e5b('0x4e')](_0x4ea05f[_0x3e5b('0x4d')]);_0x31896f[_0x3e5b('0x4f')]=_['intersection'](_0x31896f[_0x3e5b('0x46')],_0x31896f['query']);_0x39e7bf[_0x3e5b('0x51')]=_[_0x3e5b('0x50')](_0x31896f[_0x3e5b('0x46')],qs[_0x3e5b('0x52')](_0x4ea05f[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x39e7bf[_0x3e5b('0x51')]=_0x39e7bf[_0x3e5b('0x51')][_0x3e5b('0x53')]?_0x39e7bf['attributes']:_0x31896f[_0x3e5b('0x46')];_0x39e7bf[_0x3e5b('0xfb')]=qs[_0x3e5b('0x56')](_0x4ea05f[_0x3e5b('0x4d')][_0x3e5b('0x56')]);_0x39e7bf[_0x3e5b('0x57')]=qs[_0x3e5b('0x4f')](_[_0x3e5b('0x58')](_0x4ea05f[_0x3e5b('0x4d')],_0x31896f[_0x3e5b('0x4f')]));if(_0x4ea05f[_0x3e5b('0x4d')]['filter']){_0x39e7bf[_0x3e5b('0x57')]=_[_0x3e5b('0x61')](_0x39e7bf[_0x3e5b('0x57')],{'$or':_[_0x3e5b('0x4a')](_0x39e7bf[_0x3e5b('0x51')],function(_0x4c94ea){var _0x853439={};_0x853439[_0x4c94ea]={'$like':'%'+_0x4ea05f[_0x3e5b('0x4d')]['filter']+'%'};return _0x853439;})});}_0x39e7bf=_[_0x3e5b('0x61')]({},_0x39e7bf,_0x4ea05f[_0x3e5b('0x5b')]);return _0x1be5f8['getApplications'](_0x39e7bf);}})[_0x3e5b('0x1a')](function(_0x3dec64){if(_0x3dec64){_0x372e8b=_0x3dec64[_0x3e5b('0x53')];if(!_0x4ea05f[_0x3e5b('0x4d')][_0x3e5b('0x54')](_0x3e5b('0x55'))){_0x39e7bf[_0x3e5b('0x2a')]=qs[_0x3e5b('0x2a')](_0x4ea05f[_0x3e5b('0x4d')][_0x3e5b('0x2a')]);_0x39e7bf[_0x3e5b('0x28')]=qs[_0x3e5b('0x28')](_0x4ea05f['query'][_0x3e5b('0x28')]);}return _0x1be5f8[_0x3e5b('0x121')](_0x39e7bf);}})[_0x3e5b('0x1a')](function(_0x2149df){if(_0x2149df){return _0x2149df?{'count':_0x372e8b,'rows':_0x2149df}:null;}})[_0x3e5b('0x1a')](respondWithResult(_0x3674dd,null))[_0x3e5b('0x23')](handleError(_0x3674dd,null));};exports['addProactiveActions']=function(_0xf3179,_0x7efc5a){return db[_0x3e5b('0x122')]['find']({'where':{'id':_0xf3179[_0x3e5b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x7efc5a,null))[_0x3e5b('0x1a')](function(_0xcbca5a){if(_0xcbca5a){return _0xcbca5a['addProactiveActions'](_0xf3179[_0x3e5b('0x64')][_0x3e5b('0x78')],_[_0x3e5b('0xf9')](_0xf3179[_0x3e5b('0x64')],[_0x3e5b('0x78'),'id'])||{});}})[_0x3e5b('0x1a')](respondWithResult(_0x7efc5a,null))[_0x3e5b('0x23')](handleError(_0x7efc5a,null));};exports['getProactiveActions']=function(_0x52afba,_0x2d5599){var _0x4f4773={};var _0x24c8be={};var _0x5c8f64;var _0x58f4dc;return db[_0x3e5b('0x4b')]['findOne']({'where':{'id':_0x52afba['params']['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x2d5599,null))[_0x3e5b('0x1a')](function(_0x25eda6){if(_0x25eda6){_0x5c8f64=_0x25eda6;_0x24c8be[_0x3e5b('0x46')]=_[_0x3e5b('0x4e')](db[_0x3e5b('0x123')][_0x3e5b('0x4c')]);_0x24c8be[_0x3e5b('0x4d')]=_['keys'](_0x52afba['query']);_0x24c8be[_0x3e5b('0x4f')]=_[_0x3e5b('0x50')](_0x24c8be['model'],_0x24c8be[_0x3e5b('0x4d')]);_0x4f4773[_0x3e5b('0x51')]=_[_0x3e5b('0x50')](_0x24c8be['model'],qs[_0x3e5b('0x52')](_0x52afba[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x4f4773[_0x3e5b('0x51')]=_0x4f4773[_0x3e5b('0x51')][_0x3e5b('0x53')]?_0x4f4773['attributes']:_0x24c8be[_0x3e5b('0x46')];_0x4f4773[_0x3e5b('0xfb')]=qs[_0x3e5b('0x56')](_0x52afba[_0x3e5b('0x4d')][_0x3e5b('0x56')]);_0x4f4773[_0x3e5b('0x57')]=qs['filters'](_['pick'](_0x52afba[_0x3e5b('0x4d')],_0x24c8be['filters']));if(_0x52afba[_0x3e5b('0x4d')]['filter']){_0x4f4773['where']=_['merge'](_0x4f4773['where'],{'$or':_['map'](_0x4f4773['attributes'],function(_0x44c05a){var _0x4605e7={};_0x4605e7[_0x44c05a]={'$like':'%'+_0x52afba[_0x3e5b('0x4d')]['filter']+'%'};return _0x4605e7;})});}_0x4f4773=_[_0x3e5b('0x61')]({},_0x4f4773,_0x52afba[_0x3e5b('0x5b')]);return _0x5c8f64[_0x3e5b('0x104')](_0x4f4773);}})[_0x3e5b('0x1a')](function(_0x2c71b7){if(_0x2c71b7){_0x58f4dc=_0x2c71b7['length'];if(!_0x52afba[_0x3e5b('0x4d')][_0x3e5b('0x54')](_0x3e5b('0x55'))){_0x4f4773[_0x3e5b('0x2a')]=qs[_0x3e5b('0x2a')](_0x52afba[_0x3e5b('0x4d')]['limit']);_0x4f4773[_0x3e5b('0x28')]=qs['offset'](_0x52afba[_0x3e5b('0x4d')][_0x3e5b('0x28')]);}return _0x5c8f64[_0x3e5b('0x104')](_0x4f4773);}})[_0x3e5b('0x1a')](function(_0x19e743){if(_0x19e743){return _0x19e743?{'count':_0x58f4dc,'rows':_0x19e743}:null;}})[_0x3e5b('0x1a')](respondWithResult(_0x2d5599,null))[_0x3e5b('0x23')](handleError(_0x2d5599,null));};exports[_0x3e5b('0x124')]=function(_0x2f56f7,_0x4f4124){var _0x5b3865=_0x2f56f7[_0x3e5b('0x4d')][_0x3e5b('0x125')]===_0x3e5b('0x126')?'offlineForm':_0x3e5b('0x127');return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'attributes':['id',_0x5b3865],'where':{'id':_0x2f56f7[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x4f4124,null))[_0x3e5b('0x1a')](function(_0x237cd0){if(_0x237cd0){var _0x4dfcc3=_0x237cd0[_0x5b3865];var _0x26c52b=_0x4dfcc3&&_0x4dfcc3[_0x3e5b('0x128')]?_0x4dfcc3['items']:[];_0x4f4124[_0x3e5b('0x34')]({'fromKey':_[_0x3e5b('0x8c')](_0x4dfcc3[_0x3e5b('0x129')])?undefined:_0x4dfcc3[_0x3e5b('0x129')],'count':_0x26c52b['length'],'rows':_0x26c52b});}})[_0x3e5b('0x23')](handleError(_0x4f4124,null));};exports['getOfflineMessages']=function(_0x1fe8da,_0x5df772){var _0x1b5c74={'raw':![],'where':{}};var _0x37dc9e={};var _0x5c7a01={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3e5b('0x75')]({'where':{'id':_0x1fe8da[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x5df772,null))[_0x3e5b('0x1a')](function(_0x35fb01){if(_0x35fb01){_0x37dc9e[_0x3e5b('0x46')]=_[_0x3e5b('0x4e')](db[_0x3e5b('0x12a')][_0x3e5b('0x4c')]);_0x37dc9e[_0x3e5b('0x4d')]=_[_0x3e5b('0x4e')](_0x1fe8da[_0x3e5b('0x4d')]);_0x37dc9e['filters']=_[_0x3e5b('0x50')](_0x37dc9e['model'],_0x37dc9e[_0x3e5b('0x4d')]);_0x1b5c74[_0x3e5b('0x51')]=_['intersection'](_0x37dc9e['model'],qs[_0x3e5b('0x52')](_0x1fe8da[_0x3e5b('0x4d')][_0x3e5b('0x52')]));_0x1b5c74[_0x3e5b('0x51')]=_0x1b5c74[_0x3e5b('0x51')][_0x3e5b('0x53')]?_0x1b5c74['attributes']:_0x37dc9e['model'];if(!_0x1fe8da[_0x3e5b('0x4d')]['hasOwnProperty'](_0x3e5b('0x55'))){_0x1b5c74[_0x3e5b('0x2a')]=qs[_0x3e5b('0x2a')](_0x1fe8da[_0x3e5b('0x4d')]['limit']);_0x1b5c74[_0x3e5b('0x28')]=qs[_0x3e5b('0x28')](_0x1fe8da[_0x3e5b('0x4d')][_0x3e5b('0x28')]);}_0x1b5c74[_0x3e5b('0xfb')]=qs[_0x3e5b('0x56')](_0x1fe8da[_0x3e5b('0x4d')]['sort']);_0x1b5c74[_0x3e5b('0x57')]=qs[_0x3e5b('0x4f')](_[_0x3e5b('0x58')](_0x1fe8da[_0x3e5b('0x4d')],_0x37dc9e[_0x3e5b('0x4f')]));_0x1b5c74['where'][_0x3e5b('0x72')]=_0x35fb01['id'];if(_0x1fe8da[_0x3e5b('0x4d')][_0x3e5b('0x59')]){_0x1b5c74[_0x3e5b('0x57')]=_[_0x3e5b('0x61')](_0x1b5c74[_0x3e5b('0x57')],{'$or':_[_0x3e5b('0x4a')](_0x1b5c74[_0x3e5b('0x51')],function(_0xe37b2d){var _0x3f7969={};_0x3f7969[_0xe37b2d]={'$like':'%'+_0x1fe8da[_0x3e5b('0x4d')][_0x3e5b('0x59')]+'%'};return _0x3f7969;})});}_0x1b5c74=_['merge']({},_0x1b5c74,_0x1fe8da[_0x3e5b('0x5b')]);return db[_0x3e5b('0x12a')]['count']({'where':_0x1b5c74['where']})[_0x3e5b('0x1a')](function(_0x305242){_0x5c7a01[_0x3e5b('0x2b')]=_0x305242;if(_0x1fe8da['query'][_0x3e5b('0x5c')]){_0x1b5c74[_0x3e5b('0x5d')]=[{'all':!![]}];}else{_0x1b5c74[_0x3e5b('0x5d')]=[{'model':db[_0x3e5b('0x9e')],'as':'Contact','required':![]},{'model':db[_0x3e5b('0x12b')],'as':'Attachments','required':![]}];}return db[_0x3e5b('0x12a')]['findAll'](_0x1b5c74);})[_0x3e5b('0x1a')](function(_0x1ad093){_0x5c7a01[_0x3e5b('0x12c')]=_0x1ad093;return _0x5c7a01;});}})['then'](respondWithFilteredResult(_0x5df772,_0x1b5c74))[_0x3e5b('0x23')](handleError(_0x5df772,null));};exports[_0x3e5b('0x12d')]=function(_0x1e909b,_0x422e9f){return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x1e909b[_0x3e5b('0x5f')]['id']}})[_0x3e5b('0x1a')](handleEntityNotFound(_0x422e9f,null))[_0x3e5b('0x1a')](function(_0x318838){if(_0x318838){return _0x318838[_0x3e5b('0x12d')](_0x1e909b[_0x3e5b('0x64')][_0x3e5b('0x78')],_[_0x3e5b('0xf9')](_0x1e909b[_0x3e5b('0x64')],[_0x3e5b('0x78'),'id'])||{})[_0x3e5b('0x12e')](function(_0x329c7e){for(var _0x4a2afa=0x0;_0x4a2afa<_0x1e909b[_0x3e5b('0x64')][_0x3e5b('0x78')][_0x3e5b('0x53')];_0x4a2afa+=0x1){socket[_0x3e5b('0x12f')](_0x3e5b('0x130'),{'UserId':Number(_0x1e909b['body'][_0x3e5b('0x78')][_0x4a2afa]),'ChatWebsiteId':Number(_0x1e909b[_0x3e5b('0x5f')]['id'])});}return _0x329c7e;});}})[_0x3e5b('0x1a')](respondWithResult(_0x422e9f,null))[_0x3e5b('0x23')](handleError(_0x422e9f,null));};exports['removeAgents']=function(_0x32a075,_0x33cc14){return db[_0x3e5b('0x4b')][_0x3e5b('0x62')]({'where':{'id':_0x32a075['params']['id']}})['then'](handleEntityNotFound(_0x33cc14,null))['then'](function(_0x5cb446){if(_0x5cb446){return _0x5cb446[_0x3e5b('0x131')](_0x32a075['query'][_0x3e5b('0x78')])[_0x3e5b('0x1a')](function(){if(_['isArray'](_0x32a075[_0x3e5b('0x4d')][_0x3e5b('0x78')])){for(var _0x2c4edd=0x0;_0x2c4edd<_0x32a075[_0x3e5b('0x4d')][_0x3e5b('0x78')][_0x3e5b('0x53')];_0x2c4edd+=0x1){socket[_0x3e5b('0x12f')](_0x3e5b('0x132'),{'UserId':Number(_0x32a075[_0x3e5b('0x4d')][_0x3e5b('0x78')][_0x2c4edd]),'ChatWebsiteId':Number(_0x32a075['params']['id'])});}}else{socket[_0x3e5b('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x32a075[_0x3e5b('0x4d')]['ids']),'ChatWebsiteId':Number(_0x32a075[_0x3e5b('0x5f')]['id'])});}});}})[_0x3e5b('0x1a')](respondWithStatusCode(_0x33cc14,null))['catch'](handleError(_0x33cc14,null));};exports[_0x3e5b('0x133')]=function(_0x381f5c,_0x586800){var _0x1373cc={};var _0x6ca7ba={};var _0x5d596f;var _0x5a52a3;return db[_0x3e5b('0x4b')][_0x3e5b('0x75')]({'where':{'id':_0x381f5c[_0x3e5b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x586800,null))[_0x3e5b('0x1a')](function(_0x207b1a){if(_0x207b1a){_0x5d596f=_0x207b1a;_0x6ca7ba[_0x3e5b('0x46')]=_['keys'](db[_0x3e5b('0xc6')][_0x3e5b('0x4c')]);_0x6ca7ba[_0x3e5b('0x4d')]=_['keys'](_0x381f5c[_0x3e5b('0x4d')]);_0x6ca7ba[_0x3e5b('0x4f')]=_[_0x3e5b('0x50')](_0x6ca7ba[_0x3e5b('0x46')],_0x6ca7ba[_0x3e5b('0x4d')]);_0x1373cc[_0x3e5b('0x51')]=_[_0x3e5b('0x50')](_0x6ca7ba[_0x3e5b('0x46')],qs[_0x3e5b('0x52')](_0x381f5c[_0x3e5b('0x4d')]['fields']));_0x1373cc[_0x3e5b('0x51')]=_0x1373cc[_0x3e5b('0x51')]['length']?_0x1373cc[_0x3e5b('0x51')]:_0x6ca7ba[_0x3e5b('0x46')];_0x1373cc[_0x3e5b('0xfb')]=qs[_0x3e5b('0x56')](_0x381f5c[_0x3e5b('0x4d')]['sort']);_0x1373cc['where']=qs[_0x3e5b('0x4f')](_[_0x3e5b('0x58')](_0x381f5c[_0x3e5b('0x4d')],_0x6ca7ba[_0x3e5b('0x4f')]));if(_0x381f5c['query']['filter']){_0x1373cc[_0x3e5b('0x57')]=_[_0x3e5b('0x61')](_0x1373cc['where'],{'$or':_[_0x3e5b('0x4a')](_0x1373cc[_0x3e5b('0x51')],function(_0x1ebd4c){var _0x1db91a={};_0x1db91a[_0x1ebd4c]={'$like':'%'+_0x381f5c['query'][_0x3e5b('0x59')]+'%'};return _0x1db91a;})});}_0x1373cc=_['merge']({},_0x1373cc,_0x381f5c['options']);return _0x5d596f[_0x3e5b('0x133')](_0x1373cc);}})[_0x3e5b('0x1a')](function(_0x4a966d){if(_0x4a966d){_0x5a52a3=_0x4a966d[_0x3e5b('0x53')];if(!_0x381f5c['query'][_0x3e5b('0x54')](_0x3e5b('0x55'))){_0x1373cc['limit']=qs[_0x3e5b('0x2a')](_0x381f5c[_0x3e5b('0x4d')][_0x3e5b('0x2a')]);_0x1373cc[_0x3e5b('0x28')]=qs[_0x3e5b('0x28')](_0x381f5c[_0x3e5b('0x4d')][_0x3e5b('0x28')]);}return _0x5d596f[_0x3e5b('0x133')](_0x1373cc);}})['then'](function(_0x3ff5c4){if(_0x3ff5c4){return _0x3ff5c4?{'count':_0x5a52a3,'rows':_0x3ff5c4}:null;}})['then'](respondWithResult(_0x586800,null))[_0x3e5b('0x23')](handleError(_0x586800,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 3dfa82c..22c737c 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 _0x6a88=['ChatWebsite','setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6a88,0xa9));var _0x86a8=function(_0x187d80,_0x5b793f){_0x187d80=_0x187d80-0x0;var _0x498a77=_0x6a88[_0x187d80];return _0x498a77;};'use strict';var EventEmitter=require(_0x86a8('0x0'));var ChatWebsite=require(_0x86a8('0x1'))['db'][_0x86a8('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x86a8('0x3')](0x0);var events={'afterCreate':_0x86a8('0x4'),'afterUpdate':_0x86a8('0x5'),'afterDestroy':_0x86a8('0x6')};function emitEvent(_0x510057){return function(_0x21afeb,_0x5aa681,_0x59313b){ChatWebsiteEvents[_0x86a8('0x7')](_0x510057+':'+_0x21afeb['id'],_0x21afeb);ChatWebsiteEvents[_0x86a8('0x7')](_0x510057,_0x21afeb);_0x59313b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x86a8('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x0f3c=['exports','events','../../mysqldb','update','remove','emit','hook'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x0f3c,0x189));var _0xc0f3=function(_0x22f86d,_0x3ad632){_0x22f86d=_0x22f86d-0x0;var _0x137d5d=_0x0f3c[_0x22f86d];return _0x137d5d;};'use strict';var EventEmitter=require(_0xc0f3('0x0'));var ChatWebsite=require(_0xc0f3('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0f3('0x2'),'afterDestroy':_0xc0f3('0x3')};function emitEvent(_0xa6a874){return function(_0x2d1f5d,_0x1be43d,_0x279717){ChatWebsiteEvents[_0xc0f3('0x4')](_0xa6a874+':'+_0x2d1f5d['id'],_0x2d1f5d);ChatWebsiteEvents[_0xc0f3('0x4')](_0xa6a874,_0x2d1f5d);_0x279717(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xc0f3('0x5')](e,emitEvent(event));}}module[_0xc0f3('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 130377b..6d8b960 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 _0x4bb6=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x1be72f,_0x50ca93){var _0xbfdb40=function(_0x572568){while(--_0x572568){_0x1be72f['push'](_0x1be72f['shift']());}};_0xbfdb40(++_0x50ca93);}(_0x4bb6,0x1e5));var _0x64bb=function(_0xe069b2,_0x1259a5){_0xe069b2=_0xe069b2-0x0;var _0x4a9d61=_0x4bb6[_0xe069b2];return _0x4a9d61;};'use strict';var _=require(_0x64bb('0x0'));var util=require(_0x64bb('0x1'));var logger=require('../../config/logger')(_0x64bb('0x2'));var moment=require('moment');var BPromise=require(_0x64bb('0x3'));var rp=require(_0x64bb('0x4'));var fs=require('fs');var path=require(_0x64bb('0x5'));var rimraf=require(_0x64bb('0x6'));var config=require(_0x64bb('0x7'));var attributes=require(_0x64bb('0x8'));module[_0x64bb('0x9')]=function(_0x1422eb,_0x5cdff5){return _0x1422eb[_0x64bb('0xa')](_0x64bb('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ef6=['ChatWebsite','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','define'];(function(_0x44066b,_0x126423){var _0x4db055=function(_0x321cd1){while(--_0x321cd1){_0x44066b['push'](_0x44066b['shift']());}};_0x4db055(++_0x126423);}(_0x2ef6,0xe8));var _0x62ef=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0x2ef6[_0x3f1861];return _0x7ca70a;};'use strict';var _=require(_0x62ef('0x0'));var util=require(_0x62ef('0x1'));var logger=require('../../config/logger')(_0x62ef('0x2'));var moment=require(_0x62ef('0x3'));var BPromise=require(_0x62ef('0x4'));var rp=require(_0x62ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x62ef('0x6'));var config=require(_0x62ef('0x7'));var attributes=require(_0x62ef('0x8'));module['exports']=function(_0x443e70,_0x1479a9){return _0x443e70[_0x62ef('0x9')](_0x62ef('0xa'),attributes,{'tableName':'chat_websites','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 f38c4d3..71b536b 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 _0x36bc=['register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x2dc2f9,_0x3f3394){var _0x7f9396=function(_0x38d080){while(--_0x38d080){_0x2dc2f9['push'](_0x2dc2f9['shift']());}};_0x7f9396(++_0x3f3394);}(_0x36bc,0xd1));var _0xc36b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x36bc[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xc36b('0x0'));var util=require(_0xc36b('0x1'));var moment=require(_0xc36b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc36b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc36b('0x4'));var config=require(_0xc36b('0x5'));var jayson=require(_0xc36b('0x6'));var client=jayson[_0xc36b('0x7')][_0xc36b('0x8')]({'port':0x232a});config[_0xc36b('0x9')]=_['defaults'](config['redis'],{'host':_0xc36b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc36b('0x9')]));require('./chatWebsite.socket')[_0xc36b('0xb')](socket);function respondWithRpcPromise(_0xe1f33c,_0x406b10,_0x4e4336){return new BPromise(function(_0x1a2df1,_0x3e8083){return client[_0xc36b('0xc')](_0xe1f33c,_0x4e4336)[_0xc36b('0xd')](function(_0xbfaa78){logger['info'](_0xc36b('0xe'),_0x406b10,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x406b10,_0xc36b('0xf'),JSON[_0xc36b('0x10')](_0xbfaa78));if(_0xbfaa78[_0xc36b('0x11')]){if(_0xbfaa78['error'][_0xc36b('0x12')]===0x1f4){logger[_0xc36b('0x11')](_0xc36b('0xe'),_0x406b10,_0xbfaa78[_0xc36b('0x11')][_0xc36b('0x13')]);return _0x3e8083(_0xbfaa78['error'][_0xc36b('0x13')]);}logger[_0xc36b('0x11')](_0xc36b('0xe'),_0x406b10,_0xbfaa78[_0xc36b('0x11')]['message']);return _0x1a2df1(_0xbfaa78[_0xc36b('0x11')]['message']);}else{logger[_0xc36b('0x14')](_0xc36b('0xe'),_0x406b10,_0xc36b('0xf'));_0x1a2df1(_0xbfaa78[_0xc36b('0x15')]['message']);}})['catch'](function(_0x18a54d){logger[_0xc36b('0x11')](_0xc36b('0xe'),_0x406b10,_0x18a54d);_0x3e8083(_0x18a54d);});});}
\ No newline at end of file
+var _0x9933=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9933,0xfd));var _0x3993=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9933[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3993('0x0'));var util=require('util');var moment=require(_0x3993('0x1'));var BPromise=require(_0x3993('0x2'));var rs=require(_0x3993('0x3'));var fs=require('fs');var Redis=require(_0x3993('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3993('0x5'));var logger=require(_0x3993('0x6'))('rpc');var config=require(_0x3993('0x7'));var jayson=require(_0x3993('0x8'));var client=jayson[_0x3993('0x9')][_0x3993('0xa')]({'port':0x232a});config[_0x3993('0xb')]=_[_0x3993('0xc')](config[_0x3993('0xb')],{'host':_0x3993('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x3993('0xe')](socket);function respondWithRpcPromise(_0x9c9dde,_0x19666a,_0x1947d7){return new BPromise(function(_0x101469,_0x310087){return client[_0x3993('0xf')](_0x9c9dde,_0x1947d7)[_0x3993('0x10')](function(_0x5e776d){logger[_0x3993('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x19666a,_0x3993('0x12'));logger[_0x3993('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x19666a,_0x3993('0x12'),JSON['stringify'](_0x5e776d));if(_0x5e776d[_0x3993('0x14')]){if(_0x5e776d['error'][_0x3993('0x15')]===0x1f4){logger['error'](_0x3993('0x16'),_0x19666a,_0x5e776d[_0x3993('0x14')][_0x3993('0x17')]);return _0x310087(_0x5e776d[_0x3993('0x14')][_0x3993('0x17')]);}logger[_0x3993('0x14')](_0x3993('0x16'),_0x19666a,_0x5e776d[_0x3993('0x14')]['message']);return _0x101469(_0x5e776d[_0x3993('0x14')]['message']);}else{logger[_0x3993('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x19666a,_0x3993('0x12'));_0x101469(_0x5e776d[_0x3993('0x18')][_0x3993('0x17')]);}})[_0x3993('0x19')](function(_0x25f0ca){logger[_0x3993('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x19666a,_0x25f0ca);_0x310087(_0x25f0ca);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 85c0951..4f85e34 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 _0x2016=['register','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x1a9cd8,_0x2d4348){var _0x4fcb0b=function(_0x356822){while(--_0x356822){_0x1a9cd8['push'](_0x1a9cd8['shift']());}};_0x4fcb0b(++_0x2d4348);}(_0x2016,0xb2));var _0x6201=function(_0x592db3,_0x4ad1f9){_0x592db3=_0x592db3-0x0;var _0x2320e7=_0x2016[_0x592db3];return _0x2320e7;};'use strict';var ChatWebsiteEvents=require(_0x6201('0x0'));var events=[_0x6201('0x1'),_0x6201('0x2'),_0x6201('0x3')];function createListener(_0x2d28e7,_0x32e72d){return function(_0x2abacd){_0x32e72d[_0x6201('0x4')](_0x2d28e7,_0x2abacd);};}function removeListener(_0x271273,_0x2e896f){return function(){ChatWebsiteEvents[_0x6201('0x5')](_0x271273,_0x2e896f);};}exports[_0x6201('0x6')]=function(_0xe0cf3d){for(var _0xcc2881=0x0,_0x3302c0=events['length'];_0xcc2881<_0x3302c0;_0xcc2881++){var _0x4e4540=events[_0xcc2881];var _0xa1b91c=createListener(_0x6201('0x7')+_0x4e4540,_0xe0cf3d);ChatWebsiteEvents['on'](_0x4e4540,_0xa1b91c);}};
\ No newline at end of file
+var _0xb9dd=['removeListener','register','length','chatWebsite:','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9dd,0xd6));var _0xdb9d=function(_0x372eff,_0x37d36c){_0x372eff=_0x372eff-0x0;var _0x25f618=_0xb9dd[_0x372eff];return _0x25f618;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xdb9d('0x0'),_0xdb9d('0x1'),_0xdb9d('0x2')];function createListener(_0x3565f3,_0x1ae172){return function(_0x34cd86){_0x1ae172['emit'](_0x3565f3,_0x34cd86);};}function removeListener(_0x24980c,_0x2de9b8){return function(){ChatWebsiteEvents[_0xdb9d('0x3')](_0x24980c,_0x2de9b8);};}exports[_0xdb9d('0x4')]=function(_0x177a05){for(var _0x7ed8d6=0x0,_0x35a62c=events[_0xdb9d('0x5')];_0x7ed8d6<_0x35a62c;_0x7ed8d6++){var _0x13f736=events[_0x7ed8d6];var _0x101184=createListener(_0xdb9d('0x6')+_0x13f736,_0x177a05);ChatWebsiteEvents['on'](_0x13f736,_0x101184);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index dcc5042..99ed0f6 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1ab1=['URL','localhost','test','trim','replace','([\x5cw]+)','../../../utils/misc'];(function(_0x4faa2c,_0x2d8ecd){var _0x32514d=function(_0x418f7b){while(--_0x418f7b){_0x4faa2c['push'](_0x4faa2c['shift']());}};_0x32514d(++_0x2d8ecd);}(_0x1ab1,0x12c));var _0x11ab=function(_0x394729,_0x3c0b55){_0x394729=_0x394729-0x0;var _0x1b4e61=_0x1ab1[_0x394729];return _0x1b4e61;};var escapeRegExp=require(_0x11ab('0x0'))['escapeRegExp'];var URL=require('url')[_0x11ab('0x1')];function testWildcardValidity(_0x49ed3f){var _0x593928=!![];try{new URL(_0x49ed3f['replace']('*',_0x11ab('0x2')));}catch(_0x4a6492){_0x593928=![];}return _0x593928&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x11ab('0x3')](_0x49ed3f);}function testWebsiteWithWildcard(_0x363103,_0x1edb9b){var _0x1399f4;var _0x5758c5=escapeRegExp(_0x363103[_0x11ab('0x4')]()[_0x11ab('0x5')](/\/$/,''))[_0x11ab('0x5')]('\x5c*',_0x11ab('0x6'));try{new URL(_0x363103[_0x11ab('0x5')]('\x5c*',_0x11ab('0x2')));_0x1399f4=new RegExp(_0x5758c5)['test'](_0x1edb9b);}catch(_0x1abc4e){_0x1399f4=![];}return _0x1399f4;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0xaac4=['../../../utils/misc','escapeRegExp','URL','localhost','test','trim','replace','([\x5cw]+)','exports'];(function(_0x4c968c,_0x10f37b){var _0x565d7f=function(_0x3d86a9){while(--_0x3d86a9){_0x4c968c['push'](_0x4c968c['shift']());}};_0x565d7f(++_0x10f37b);}(_0xaac4,0x6c));var _0x4aac=function(_0x30aa48,_0x5cf0c9){_0x30aa48=_0x30aa48-0x0;var _0x35fc1f=_0xaac4[_0x30aa48];return _0x35fc1f;};var escapeRegExp=require(_0x4aac('0x0'))[_0x4aac('0x1')];var URL=require('url')[_0x4aac('0x2')];function testWildcardValidity(_0x3e93f9){var _0x158ac2=!![];try{new URL(_0x3e93f9['replace']('*',_0x4aac('0x3')));}catch(_0x2e630e){_0x158ac2=![];}return _0x158ac2&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x4aac('0x4')](_0x3e93f9);}function testWebsiteWithWildcard(_0x63c769,_0x40cf08){var _0x4c94f2;var _0x2d795c=escapeRegExp(_0x63c769[_0x4aac('0x5')]()[_0x4aac('0x6')](/\/$/,''))['replace']('\x5c*',_0x4aac('0x7'));try{new URL(_0x63c769['replace']('\x5c*',_0x4aac('0x3')));_0x4c94f2=new RegExp(_0x2d795c)[_0x4aac('0x4')](_0x40cf08);}catch(_0x239771){_0x4c94f2=![];}return _0x4c94f2;}module[_0x4aac('0x8')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 47a65c7..c873a76 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 _0x405b=['/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','format','%s-%s','now','originalname','single','file','diskStorage','join','root','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','offline','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x5af39d,_0x3944b5){var _0x4a8b97=function(_0x22936e){while(--_0x22936e){_0x5af39d['push'](_0x5af39d['shift']());}};_0x4a8b97(++_0x3944b5);}(_0x405b,0x80));var _0xb405=function(_0x27eab3,_0x751481){_0x27eab3=_0x27eab3-0x0;var _0x25802f=_0x405b[_0x27eab3];return _0x25802f;};'use strict';var multer=require('multer');var util=require(_0xb405('0x0'));var path=require(_0xb405('0x1'));var timeout=require(_0xb405('0x2'));var express=require('express');var router=express[_0xb405('0x3')]();var fs_extra=require(_0xb405('0x4'));var auth=require(_0xb405('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb405('0x6'));var controller=require('./chatWebsite.controller');router[_0xb405('0x7')]('/',auth[_0xb405('0x8')](),controller[_0xb405('0x9')]);router[_0xb405('0x7')](_0xb405('0xa'),auth[_0xb405('0x8')](),controller['describe']);router[_0xb405('0x7')]('/:id',auth[_0xb405('0x8')](),controller[_0xb405('0xb')]);router[_0xb405('0x7')](_0xb405('0xc'),auth[_0xb405('0x8')](),controller[_0xb405('0xd')]);router[_0xb405('0x7')](_0xb405('0xe'),auth[_0xb405('0x8')](),controller[_0xb405('0xf')]);router[_0xb405('0x7')](_0xb405('0x10'),controller[_0xb405('0x11')]);router[_0xb405('0x7')](_0xb405('0x12'),controller[_0xb405('0x13')]);router[_0xb405('0x7')](_0xb405('0x14'),controller['getCustomerAvatar']);router[_0xb405('0x7')](_0xb405('0x15'),controller[_0xb405('0x16')]);router[_0xb405('0x7')](_0xb405('0x17'),auth[_0xb405('0x8')](),controller[_0xb405('0x18')]);router[_0xb405('0x7')](_0xb405('0x19'),controller[_0xb405('0x1a')]);router[_0xb405('0x7')](_0xb405('0x1b'),auth[_0xb405('0x8')](),controller['getApplications']);router[_0xb405('0x7')](_0xb405('0x1c'),auth[_0xb405('0x8')](),controller[_0xb405('0x1d')]);router['get'](_0xb405('0x1e'),controller['getFields']);router[_0xb405('0x7')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xb405('0x1f')]);router[_0xb405('0x7')](_0xb405('0x20'),auth[_0xb405('0x8')](),controller['getAgents']);router[_0xb405('0x21')]('/',auth[_0xb405('0x8')](),controller[_0xb405('0x22')]);router['post'](_0xb405('0xc'),auth['isAuthenticated'](),controller[_0xb405('0x23')]);router[_0xb405('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb405('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d4ce4,_0x1e36f5,_0x20eb1a){_0x20eb1a(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0xe764,_0xafaf79,_0x26d092){_0x26d092(null,util[_0xb405('0x25')](_0xb405('0x26'),Date[_0xb405('0x27')](),_0xafaf79[_0xb405('0x28')]));}})});router[_0xb405('0x21')](_0xb405('0x10'),upload[_0xb405('0x29')](_0xb405('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0xc99531,_0x503c4e,_0x31101d){_0x31101d(null,path[_0xb405('0x2c')](config[_0xb405('0x2d')],_0xb405('0x2e')));},'filename':function(_0x1d192e,_0x322fec,_0x4ff3f5){_0x4ff3f5(null,util[_0xb405('0x25')]('%s-%s',Date[_0xb405('0x27')](),_0x322fec[_0xb405('0x28')]));}})});router[_0xb405('0x21')](_0xb405('0x12'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0x4c1b16,_0x511a09,_0x57ec9b){_0x57ec9b(null,path[_0xb405('0x2c')](config[_0xb405('0x2d')],_0xb405('0x2e')));},'filename':function(_0x59b499,_0x343604,_0x29f4c9){_0x29f4c9(null,util[_0xb405('0x25')](_0xb405('0x26'),Date[_0xb405('0x27')](),_0x343604[_0xb405('0x28')]));}})});router['post'](_0xb405('0x14'),upload['single'](_0xb405('0x2a')),controller[_0xb405('0x2f')]);var upload=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0x2e2189,_0x5329d0,_0x2e5f02){_0x2e5f02(null,path[_0xb405('0x2c')](config[_0xb405('0x2d')],_0xb405('0x2e')));},'filename':function(_0x5630c0,_0x639e64,_0x258808){_0x258808(null,util[_0xb405('0x25')](_0xb405('0x26'),Date[_0xb405('0x27')](),_0x639e64['originalname']));}})});router['post']('/:id/system_avatar',upload['single']('file'),controller[_0xb405('0x30')]);router[_0xb405('0x21')](_0xb405('0x31'),controller[_0xb405('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0xb405('0x2b')]({'destination':function(_0x1beb74,_0x282f11,_0x85be36){const _0x5202d1=path['join'](config[_0xb405('0x2d')],_0xb405('0x33'),_0xb405('0x34'),_0xb405('0x35'));fs_extra[_0xb405('0x36')](_0x5202d1,function(){_0x85be36(null,_0x5202d1);});},'filename':function(_0x5232e4,_0xb96436,_0x2915df){const _0x5ca3ef=_0xb96436[_0xb405('0x28')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x150368=path[_0xb405('0x37')](_0x5ca3ef);const _0x410c9d=Date[_0xb405('0x27')]()+'-'+_0x5ca3ef[_0xb405('0x38')](_0x150368,'')+_0x150368;_0x2915df(null,_0x410c9d);}})});router[_0xb405('0x21')]('/:id/offline',offlineUploadMulter[_0xb405('0x39')](),controller[_0xb405('0x3a')]);router[_0xb405('0x21')]('/:id/interactions',auth[_0xb405('0x8')](),controller['addInteraction']);router['post']('/:id/applications',auth[_0xb405('0x8')](),controller[_0xb405('0x3b')]);router[_0xb405('0x21')]('/:id/proactive_actions',auth[_0xb405('0x8')](),controller[_0xb405('0x3c')]);router['post'](_0xb405('0x20'),auth[_0xb405('0x8')](),controller['addAgents']);router[_0xb405('0x3d')](_0xb405('0x3e'),auth[_0xb405('0x8')](),controller[_0xb405('0x3f')]);router[_0xb405('0x40')]('/:id',auth[_0xb405('0x8')](),controller[_0xb405('0x41')]);router['delete'](_0xb405('0xc'),auth[_0xb405('0x8')](),controller['removeDispositions']);router[_0xb405('0x40')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb405('0x42')]);router['delete'](_0xb405('0x20'),auth[_0xb405('0x8')](),controller[_0xb405('0x43')]);module[_0xb405('0x44')]=router;
\ No newline at end of file
+var _0x8f14=['addLogo','join','server/files/images/avatars/','addCustomerAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addProactiveActions','addAgents','put','/:id','delete','destroy','removeAnswers','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x8f14,0x12a));var _0x48f1=function(_0x596819,_0x67618e){_0x596819=_0x596819-0x0;var _0x5a27a8=_0x8f14[_0x596819];return _0x5a27a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x48f1('0x0'));var express=require(_0x48f1('0x1'));var router=express[_0x48f1('0x2')]();var fs_extra=require(_0x48f1('0x3'));var auth=require(_0x48f1('0x4'));var interaction=require(_0x48f1('0x5'));var config=require(_0x48f1('0x6'));var controller=require(_0x48f1('0x7'));router[_0x48f1('0x8')]('/',auth['isAuthenticated'](),controller[_0x48f1('0x9')]);router['get'](_0x48f1('0xa'),auth[_0x48f1('0xb')](),controller['describe']);router[_0x48f1('0x8')]('/:id',auth[_0x48f1('0xb')](),controller[_0x48f1('0xc')]);router[_0x48f1('0x8')](_0x48f1('0xd'),auth['isAuthenticated'](),controller[_0x48f1('0xe')]);router[_0x48f1('0x8')](_0x48f1('0xf'),auth[_0x48f1('0xb')](),controller['getAnswers']);router[_0x48f1('0x8')](_0x48f1('0x10'),controller[_0x48f1('0x11')]);router[_0x48f1('0x8')](_0x48f1('0x12'),controller[_0x48f1('0x13')]);router[_0x48f1('0x8')](_0x48f1('0x14'),controller[_0x48f1('0x15')]);router[_0x48f1('0x8')](_0x48f1('0x16'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x48f1('0xb')](),controller[_0x48f1('0x17')]);router['get'](_0x48f1('0x18'),controller[_0x48f1('0x19')]);router[_0x48f1('0x8')](_0x48f1('0x1a'),auth[_0x48f1('0xb')](),controller['getApplications']);router[_0x48f1('0x8')](_0x48f1('0x1b'),auth[_0x48f1('0xb')](),controller[_0x48f1('0x1c')]);router['get'](_0x48f1('0x1d'),controller[_0x48f1('0x1e')]);router[_0x48f1('0x8')](_0x48f1('0x1f'),auth['isAuthenticated'](),controller[_0x48f1('0x20')]);router[_0x48f1('0x8')](_0x48f1('0x21'),auth[_0x48f1('0xb')](),controller[_0x48f1('0x22')]);router[_0x48f1('0x23')]('/',auth[_0x48f1('0xb')](),controller[_0x48f1('0x24')]);router[_0x48f1('0x23')](_0x48f1('0xd'),auth[_0x48f1('0xb')](),controller['addDisposition']);router[_0x48f1('0x23')](_0x48f1('0xf'),auth['isAuthenticated'](),controller[_0x48f1('0x25')]);var upload=multer({'storage':multer[_0x48f1('0x26')]({'destination':function(_0x407c9a,_0x18cde7,_0x315b79){_0x315b79(null,path['join'](config[_0x48f1('0x27')],_0x48f1('0x28')));},'filename':function(_0x355421,_0x32a28d,_0x15ad72){_0x15ad72(null,util[_0x48f1('0x29')](_0x48f1('0x2a'),Date[_0x48f1('0x2b')](),_0x32a28d[_0x48f1('0x2c')]));}})});router[_0x48f1('0x23')](_0x48f1('0x10'),upload[_0x48f1('0x2d')](_0x48f1('0x2e')),controller[_0x48f1('0x2f')]);var upload=multer({'storage':multer[_0x48f1('0x26')]({'destination':function(_0x343dfe,_0x4e95b1,_0x4bc0be){_0x4bc0be(null,path[_0x48f1('0x30')](config[_0x48f1('0x27')],'server/files/images/avatars/'));},'filename':function(_0xc70433,_0x4c12da,_0x37d1b3){_0x37d1b3(null,util['format'](_0x48f1('0x2a'),Date[_0x48f1('0x2b')](),_0x4c12da[_0x48f1('0x2c')]));}})});router['post'](_0x48f1('0x12'),upload[_0x48f1('0x2d')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5d9d6f,_0x3fa565,_0x2da98b){_0x2da98b(null,path['join'](config[_0x48f1('0x27')],_0x48f1('0x31')));},'filename':function(_0x1e7a4c,_0x12adf4,_0x1a3e79){_0x1a3e79(null,util[_0x48f1('0x29')](_0x48f1('0x2a'),Date['now'](),_0x12adf4[_0x48f1('0x2c')]));}})});router['post']('/:id/customer_avatar',upload[_0x48f1('0x2d')](_0x48f1('0x2e')),controller[_0x48f1('0x32')]);var upload=multer({'storage':multer[_0x48f1('0x26')]({'destination':function(_0x58f479,_0x4505a2,_0xfd0984){_0xfd0984(null,path['join'](config[_0x48f1('0x27')],_0x48f1('0x31')));},'filename':function(_0x5c229d,_0x45d4cd,_0x5b8eb9){_0x5b8eb9(null,util[_0x48f1('0x29')](_0x48f1('0x2a'),Date['now'](),_0x45d4cd['originalname']));}})});router['post'](_0x48f1('0x16'),upload['single'](_0x48f1('0x2e')),controller['addSystemAvatar']);router[_0x48f1('0x23')](_0x48f1('0x33'),controller[_0x48f1('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x48f1('0x26')]({'destination':function(_0xb1d306,_0x44e017,_0x594aa3){const _0x22357d=path[_0x48f1('0x30')](config[_0x48f1('0x27')],'server/files','attachments',_0x48f1('0x35'));fs_extra[_0x48f1('0x36')](_0x22357d,function(){_0x594aa3(null,_0x22357d);});},'filename':function(_0x1c10c2,_0x2060ec,_0xff8426){const _0x25603f=_0x2060ec[_0x48f1('0x2c')][_0x48f1('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x30be9f=path[_0x48f1('0x38')](_0x25603f);const _0x546d03=Date[_0x48f1('0x2b')]()+'-'+_0x25603f[_0x48f1('0x37')](_0x30be9f,'')+_0x30be9f;_0xff8426(null,_0x546d03);}})});router[_0x48f1('0x23')](_0x48f1('0x39'),offlineUploadMulter['any'](),controller[_0x48f1('0x3a')]);router[_0x48f1('0x23')]('/:id/interactions',auth[_0x48f1('0xb')](),controller[_0x48f1('0x3b')]);router['post'](_0x48f1('0x1a'),auth[_0x48f1('0xb')](),controller['addApplications']);router[_0x48f1('0x23')](_0x48f1('0x1b'),auth[_0x48f1('0xb')](),controller[_0x48f1('0x3c')]);router['post'](_0x48f1('0x21'),auth[_0x48f1('0xb')](),controller[_0x48f1('0x3d')]);router[_0x48f1('0x3e')](_0x48f1('0x3f'),auth[_0x48f1('0xb')](),controller['update']);router[_0x48f1('0x40')](_0x48f1('0x3f'),auth[_0x48f1('0xb')](),controller[_0x48f1('0x41')]);router['delete'](_0x48f1('0xd'),auth[_0x48f1('0xb')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x48f1('0xb')](),controller[_0x48f1('0x42')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x48f1('0x43')]);module[_0x48f1('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index de9a884..475af03 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 _0x8d85=['../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x4626c2,_0x69aced){var _0x4dec86=function(_0x1a92a9){while(--_0x1a92a9){_0x4626c2['push'](_0x4626c2['shift']());}};_0x4dec86(++_0x69aced);}(_0x8d85,0x16a));var _0x58d8=function(_0x30308a,_0x178f66){_0x30308a=_0x30308a-0x0;var _0x13771c=_0x8d85[_0x30308a];return _0x13771c;};var beaverLogger=require(_0x58d8('0x0'));var express=require(_0x58d8('0x1'));var auth=require('../components/auth/service');var config=require(_0x58d8('0x2'));var router=express[_0x58d8('0x3')]();var isProduction=config[_0x58d8('0x4')]===_0x58d8('0x5')||![];function clientSideLogs(_0x45d62b,_0x3b1476,_0x216962){var _0x3308d0=_0x45d62b[_0x58d8('0x6')][_0x58d8('0x7')](_0x58d8('0x8'));if(!_0x3308d0){throw new Error(_0x58d8('0x9'));}return beaverLogger[_0x58d8('0xa')]({'uri':'/client-logs','logger':_0x3308d0,'enableCors':!isProduction})(_0x45d62b,_0x3b1476,_0x216962);}router['use'](auth[_0x58d8('0xb')](),clientSideLogs);module[_0x58d8('0xc')]=router;
\ No newline at end of file
+var _0xf2ec=['client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','production','app','get'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xf2ec,0xa2));var _0xcf2e=function(_0x368328,_0x16dd60){_0x368328=_0x368328-0x0;var _0x3b66d6=_0xf2ec[_0x368328];return _0x3b66d6;};var beaverLogger=require('beaver-logger/server');var express=require(_0xcf2e('0x0'));var auth=require(_0xcf2e('0x1'));var config=require(_0xcf2e('0x2'));var router=express[_0xcf2e('0x3')]();var isProduction=config['env']===_0xcf2e('0x4')||![];function clientSideLogs(_0x5ebffa,_0x47483b,_0x5c1990){var _0x4e5a2b=_0x5ebffa[_0xcf2e('0x5')][_0xcf2e('0x6')](_0xcf2e('0x7'));if(!_0x4e5a2b){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xcf2e('0x8')]({'uri':_0xcf2e('0x9'),'logger':_0x4e5a2b,'enableCors':!isProduction})(_0x5ebffa,_0x47483b,_0x5c1990);}router[_0xcf2e('0xa')](auth[_0xcf2e('0xb')](),clientSideLogs);module[_0xcf2e('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 05017ae..0dc2b0b 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 _0xcf36=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Dynamics365'];(function(_0x2c0acf,_0x310413){var _0x513851=function(_0x4105b0){while(--_0x4105b0){_0x2c0acf['push'](_0x2c0acf['shift']());}};_0x513851(++_0x310413);}(_0xcf36,0x1b9));var _0x6cf3=function(_0x288522,_0x18a6d8){_0x288522=_0x288522-0x0;var _0x37851f=_0xcf36[_0x288522];return _0x37851f;};'use strict';var Sequelize=require(_0x6cf3('0x0'));module[_0x6cf3('0x1')]={'name':{'type':Sequelize[_0x6cf3('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6cf3('0x3')](_0x6cf3('0x4'),_0x6cf3('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6cf3('0x3')]('Outlook365',_0x6cf3('0x6'))},'data1':{'type':Sequelize[_0x6cf3('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x6cf3('0x7')},'data3':{'type':Sequelize[_0x6cf3('0x2')],'comment':_0x6cf3('0x8')},'data4':{'type':Sequelize[_0x6cf3('0x2')],'comment':_0x6cf3('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x6cf3('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':_0x6cf3('0xb')},'data7':{'type':Sequelize[_0x6cf3('0xc')],'comment':_0x6cf3('0xd')}};
\ No newline at end of file
+var _0xb87d=['TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x353f2d,_0x2627b7){var _0x929909=function(_0x41ba60){while(--_0x41ba60){_0x353f2d['push'](_0x353f2d['shift']());}};_0x929909(++_0x2627b7);}(_0xb87d,0x120));var _0xdb87=function(_0x3e5af9,_0x38d86f){_0x3e5af9=_0x3e5af9-0x0;var _0x44fb99=_0xb87d[_0x3e5af9];return _0x44fb99;};'use strict';var Sequelize=require(_0xdb87('0x0'));module[_0xdb87('0x1')]={'name':{'type':Sequelize[_0xdb87('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xdb87('0x3'),_0xdb87('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdb87('0x5'),_0xdb87('0x6'))},'data1':{'type':Sequelize[_0xdb87('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdb87('0x2')],'comment':_0xdb87('0x7')},'data3':{'type':Sequelize[_0xdb87('0x2')],'comment':_0xdb87('0x8')},'data4':{'type':Sequelize[_0xdb87('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xdb87('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xdb87('0x9')],'comment':_0xdb87('0xa')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 6118190..eadc71c 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 _0xaa45=['generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','end','error','name','slice','index','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','service','MicrosoftAzure','show','options','find','decryptString','data3','create','body','Name\x20parameter\x20not\x20specified','includes','join','encryptString','update','params','catch','destroy','oauth2MicrosoftAuthorize'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0xaa45,0x130));var _0x5aa4=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xaa45[_0x421725];return _0x51b322;};'use strict';var _=require('lodash');var Redis=require(_0x5aa4('0x0'));var qs=require(_0x5aa4('0x1'));var encryptor=require(_0x5aa4('0x2'));var config=require(_0x5aa4('0x3'));var logger=require(_0x5aa4('0x4'))('api');var db=require(_0x5aa4('0x5'))['db'];var oauth=require(_0x5aa4('0x6'));config[_0x5aa4('0x7')]=_[_0x5aa4('0x8')](config[_0x5aa4('0x7')],{'host':_0x5aa4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5aa4('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x45b863,_0x4c819d){_0x4c819d=_0x4c819d||0xcc;return function(_0x3b8194){if(_0x3b8194){return _0x45b863[_0x5aa4('0xa')](_0x4c819d);}return _0x45b863['status'](_0x4c819d)['end']();};}function respondWithResult(_0x16c984,_0x2dcedf){_0x2dcedf=_0x2dcedf||0xc8;return function(_0x52d7f7){if(_0x52d7f7){return _0x16c984[_0x5aa4('0xb')](_0x2dcedf)[_0x5aa4('0xc')](_0x52d7f7);}};}function respondWithFilteredResult(_0x22b797,_0x3a4443){return function(_0x51811f){if(_0x51811f){var _0x5cd221=typeof _0x3a4443[_0x5aa4('0xd')]===_0x5aa4('0xe')&&typeof _0x3a4443[_0x5aa4('0xf')]===_0x5aa4('0xe');var _0x2a61fc=_0x51811f[_0x5aa4('0x10')];var _0x28df28=_0x5cd221?0x0:_0x3a4443['offset'];var _0x263a28=_0x5cd221?_0x51811f[_0x5aa4('0x10')]:_0x3a4443[_0x5aa4('0xd')]+_0x3a4443[_0x5aa4('0xf')];var _0x7f576;if(_0x263a28>=_0x2a61fc){_0x263a28=_0x2a61fc;_0x7f576=0xc8;}else{_0x7f576=0xce;}_0x22b797[_0x5aa4('0xb')](_0x7f576);return _0x22b797[_0x5aa4('0x11')](_0x5aa4('0x12'),_0x28df28+'-'+_0x263a28+'/'+_0x2a61fc)[_0x5aa4('0xc')](_0x51811f);}return null;};}function saveUpdates(_0x5972f5){return function(_0x503957){if(_0x503957){return _0x503957['update'](_0x5972f5)[_0x5aa4('0x13')](function(_0x3b6a03){return _0x3b6a03;});}return null;};}function removeEntity(_0x1e0eb7){return function(_0x167e0f){if(_0x167e0f){return _0x167e0f['destroy']()[_0x5aa4('0x13')](function(){_0x1e0eb7[_0x5aa4('0xb')](0xcc)[_0x5aa4('0x14')]();});}};}function handleEntityNotFound(_0x58bcf5){return function(_0x53b970){if(!_0x53b970){_0x58bcf5[_0x5aa4('0xa')](0x194);}return _0x53b970;};}function handleError(_0x513da0,_0x9353b3){_0x9353b3=_0x9353b3||0x1f4;return function(_0x94010c){logger[_0x5aa4('0x15')](_0x94010c['stack']);if(_0x94010c[_0x5aa4('0x16')]){delete _0x94010c[_0x5aa4('0x16')];}_0x513da0[_0x5aa4('0xb')](_0x9353b3)['send'](_0x94010c);};}function maskClientSecret(_0x528ea3){return _['padEnd'](_0x528ea3[_0x5aa4('0x17')](0x0,0x3),0x14,'*');}exports[_0x5aa4('0x18')]=function(_0x1efd00,_0x128395){var _0x11ed4c={},_0x5d32a3={},_0x35b197={'count':0x0,'rows':[]};var _0xca403b=_['map'](db[_0x5aa4('0x19')][_0x5aa4('0x1a')],function(_0x42b26d){return{'name':_0x42b26d[_0x5aa4('0x1b')],'type':_0x42b26d[_0x5aa4('0x1c')][_0x5aa4('0x1d')]};});_0x5d32a3[_0x5aa4('0x1e')]=_['map'](_0xca403b,'name');_0x5d32a3[_0x5aa4('0x1f')]=_[_0x5aa4('0x20')](_0x1efd00[_0x5aa4('0x1f')]);_0x5d32a3[_0x5aa4('0x21')]=_[_0x5aa4('0x22')](_0x5d32a3[_0x5aa4('0x1e')],_0x5d32a3[_0x5aa4('0x1f')]);_0x11ed4c[_0x5aa4('0x23')]=_[_0x5aa4('0x22')](_0x5d32a3[_0x5aa4('0x1e')],qs['fields'](_0x1efd00['query'][_0x5aa4('0x24')]));_0x11ed4c[_0x5aa4('0x23')]=_0x11ed4c[_0x5aa4('0x23')][_0x5aa4('0x25')]?_0x11ed4c[_0x5aa4('0x23')]:_0x5d32a3['model'];if(!_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x26')]('nolimit')){_0x11ed4c['limit']=qs[_0x5aa4('0xf')](_0x1efd00[_0x5aa4('0x1f')]['limit']);_0x11ed4c['offset']=qs['offset'](_0x1efd00['query'][_0x5aa4('0xd')]);}_0x11ed4c[_0x5aa4('0x27')]=qs[_0x5aa4('0x28')](_0x1efd00[_0x5aa4('0x1f')]['sort']);_0x11ed4c[_0x5aa4('0x29')]=qs[_0x5aa4('0x21')](_[_0x5aa4('0x2a')](_0x1efd00[_0x5aa4('0x1f')],_0x5d32a3[_0x5aa4('0x21')]),_0xca403b);if(_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x2b')]){_0x11ed4c['where']=_[_0x5aa4('0x2c')](_0x11ed4c[_0x5aa4('0x29')],{'$or':_[_0x5aa4('0x2d')](_0xca403b,function(_0x1e96cc){if(_0x1e96cc[_0x5aa4('0x1c')]!==_0x5aa4('0x2e')){var _0x4d0af4={};_0x4d0af4[_0x1e96cc[_0x5aa4('0x16')]]={'$like':'%'+_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x2b')]+'%'};return _0x4d0af4;}})});}_0x11ed4c=_[_0x5aa4('0x2c')]({},_0x11ed4c,_0x1efd00['options']);var _0x115c2c={'where':_0x11ed4c['where']};return db[_0x5aa4('0x19')][_0x5aa4('0x10')](_0x115c2c)[_0x5aa4('0x13')](function(_0x1c3de9){_0x35b197[_0x5aa4('0x10')]=_0x1c3de9;if(_0x1efd00[_0x5aa4('0x1f')][_0x5aa4('0x2f')]){_0x11ed4c['include']=[{'all':!![]}];}return db[_0x5aa4('0x19')][_0x5aa4('0x30')](_0x11ed4c);})[_0x5aa4('0x13')](function(_0x594b95){_0x35b197[_0x5aa4('0x31')]=_[_0x5aa4('0x2d')](_0x594b95,function(_0x1aaaf1){if(_0x1aaaf1[_0x5aa4('0x32')]===_0x5aa4('0x33')){var _0x5ddb60=encryptor['decryptString'](_0x1aaaf1['data3']);_0x1aaaf1['data3']=maskClientSecret(_0x5ddb60);}return _0x1aaaf1;});return _0x35b197;})['then'](respondWithFilteredResult(_0x128395,_0x11ed4c))['catch'](handleError(_0x128395,null));};exports[_0x5aa4('0x34')]=function(_0x288e99,_0x58cd00){var _0x5b841b={'raw':!![],'where':{'id':_0x288e99['params']['id']}},_0x16d0f4={};_0x16d0f4[_0x5aa4('0x1e')]=_[_0x5aa4('0x20')](db[_0x5aa4('0x19')]['rawAttributes']);_0x16d0f4['query']=_[_0x5aa4('0x20')](_0x288e99[_0x5aa4('0x1f')]);_0x16d0f4[_0x5aa4('0x21')]=_[_0x5aa4('0x22')](_0x16d0f4[_0x5aa4('0x1e')],_0x16d0f4[_0x5aa4('0x1f')]);_0x5b841b[_0x5aa4('0x23')]=_[_0x5aa4('0x22')](_0x16d0f4[_0x5aa4('0x1e')],qs[_0x5aa4('0x24')](_0x288e99[_0x5aa4('0x1f')][_0x5aa4('0x24')]));_0x5b841b[_0x5aa4('0x23')]=_0x5b841b[_0x5aa4('0x23')][_0x5aa4('0x25')]?_0x5b841b['attributes']:_0x16d0f4['model'];if(_0x288e99['query'][_0x5aa4('0x2f')]){_0x5b841b['include']=[{'all':!![]}];}_0x5b841b=_['merge']({},_0x5b841b,_0x288e99[_0x5aa4('0x35')]);return db[_0x5aa4('0x19')][_0x5aa4('0x36')](_0x5b841b)['then'](handleEntityNotFound(_0x58cd00,null))[_0x5aa4('0x13')](function(_0x1c63ee){if(_0x1c63ee[_0x5aa4('0x32')]===_0x5aa4('0x33')){var _0x569e78=encryptor[_0x5aa4('0x37')](_0x1c63ee[_0x5aa4('0x38')]);_0x1c63ee[_0x5aa4('0x38')]=maskClientSecret(_0x569e78);}return _0x1c63ee;})[_0x5aa4('0x13')](respondWithResult(_0x58cd00,null))['catch'](handleError(_0x58cd00,null));};exports[_0x5aa4('0x39')]=function(_0x31cba4,_0x2fa1cf){if(!_0x31cba4[_0x5aa4('0x3a')][_0x5aa4('0x16')])throw new Error(_0x5aa4('0x3b'));if(!_0x31cba4[_0x5aa4('0x3a')][_0x5aa4('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4b9691=db[_0x5aa4('0x19')][_0x5aa4('0x1a')][_0x5aa4('0x32')]['values'];if(!_0x4b9691[_0x5aa4('0x3c')](_0x31cba4[_0x5aa4('0x3a')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x4b9691[_0x5aa4('0x3d')](',\x20'));if(_0x31cba4[_0x5aa4('0x3a')]['service']==='MicrosoftAzure'&&_0x31cba4[_0x5aa4('0x3a')][_0x5aa4('0x38')]){_0x31cba4['body'][_0x5aa4('0x38')]=encryptor[_0x5aa4('0x3e')](_0x31cba4[_0x5aa4('0x3a')]['data3']);}return db['CloudProvider'][_0x5aa4('0x39')](_0x31cba4['body'],{})[_0x5aa4('0x13')](respondWithResult(_0x2fa1cf,0xc9))['catch'](handleError(_0x2fa1cf,null));};exports[_0x5aa4('0x3f')]=function(_0x4cf064,_0x5423a4){if(_0x4cf064['body']['id']){delete _0x4cf064[_0x5aa4('0x3a')]['id'];}return db[_0x5aa4('0x19')]['find']({'where':{'id':_0x4cf064[_0x5aa4('0x40')]['id']}})[_0x5aa4('0x13')](handleEntityNotFound(_0x5423a4,null))[_0x5aa4('0x13')](function(_0x37c74f){if(_0x37c74f[_0x5aa4('0x32')]===_0x5aa4('0x33')&&_0x4cf064[_0x5aa4('0x3a')]['data3']){_0x4cf064['body'][_0x5aa4('0x38')]=encryptor[_0x5aa4('0x3e')](_0x4cf064[_0x5aa4('0x3a')][_0x5aa4('0x38')]);}return _0x37c74f;})[_0x5aa4('0x13')](saveUpdates(_0x4cf064[_0x5aa4('0x3a')],null))[_0x5aa4('0x13')](respondWithResult(_0x5423a4,null))[_0x5aa4('0x41')](handleError(_0x5423a4,null));};exports[_0x5aa4('0x42')]=function(_0x45943d,_0x4d0685){return db[_0x5aa4('0x19')][_0x5aa4('0x36')]({'where':{'id':_0x45943d['params']['id']}})[_0x5aa4('0x13')](handleEntityNotFound(_0x4d0685,null))[_0x5aa4('0x13')](removeEntity(_0x4d0685,null))[_0x5aa4('0x41')](handleError(_0x4d0685,null));};exports[_0x5aa4('0x43')]=function(_0x4e2c8c,_0x4fa874){return db[_0x5aa4('0x19')]['findOne']({'where':{'id':_0x4e2c8c[_0x5aa4('0x40')]['id']},'raw':!![]})[_0x5aa4('0x13')](function(_0xc9248d){if(!_0xc9248d)return _0x4fa874['sendStatus'](0x194);return{'url':oauth[_0x5aa4('0x44')](_0xc9248d,_0x4e2c8c[_0x5aa4('0x45')]['id'])};})[_0x5aa4('0x13')](respondWithResult(_0x4fa874,null))['catch'](handleError(_0x4fa874,null));};exports[_0x5aa4('0x46')]=function(_0x246981,_0x38adf2){var _0x433f2a=_0x246981[_0x5aa4('0x3a')];var _0x1b0320;var _0x134493;if(_0x433f2a['error'])throw _0x433f2a;redis[_0x5aa4('0x47')](_0x433f2a['state'])['then'](function(_0x551651){if(!_0x551651)throw new Error(_0x5aa4('0x48'));_0x1b0320=JSON[_0x5aa4('0x49')](_0x551651);var _0x33abf5=Buffer[_0x5aa4('0x4a')](_0x433f2a[_0x5aa4('0x4b')],_0x5aa4('0x4c'))[_0x5aa4('0x4d')](_0x5aa4('0x4e'));_0x134493=JSON[_0x5aa4('0x49')](_0x33abf5);if(!oauth[_0x5aa4('0x4f')](_0x433f2a[_0x5aa4('0x50')],_0x1b0320[_0x5aa4('0x51')]))throw new Error(_0x5aa4('0x52'));redis[_0x5aa4('0x53')](_0x433f2a[_0x5aa4('0x4b')]);return oauth['getOauth2MicrosoftAccessToken'](_0x433f2a['code'],_0x1b0320);})['then'](function(_0x52126e){_0x1b0320[_0x5aa4('0x54')]=_0x52126e['access_token'];_0x1b0320[_0x5aa4('0x55')]=_0x52126e['refresh_token'];return db[_0x5aa4('0x19')][_0x5aa4('0x3f')]({'data5':_0x1b0320['data5'],'data6':_0x1b0320['data6']},{'where':{'id':_0x1b0320['id']}});})['then'](function(){oauth[_0x5aa4('0x56')](_0x1b0320);socket[_0x5aa4('0x57')](_0x5aa4('0x58'),{'id':_0x134493['id']});return;})[_0x5aa4('0x13')](respondWithStatusCode(_0x38adf2,null))[_0x5aa4('0x41')](function(_0x44fcac){if(_0x134493){socket[_0x5aa4('0x57')]('microsoftAuthorization:error',{'id':_0x134493['id']});}if(!_0x1b0320){logger[_0x5aa4('0x15')]('Invalid\x20authentication\x20state\x20parameter',_0x44fcac);return _0x38adf2[_0x5aa4('0xb')](0x1f4)[_0x5aa4('0x59')](_0x44fcac[_0x5aa4('0x5a')]);}logger[_0x5aa4('0x15')](_0x5aa4('0x5b'),_0x1b0320['id'],JSON[_0x5aa4('0x5c')](_0x44fcac));});};
\ No newline at end of file
+var _0x0806=['find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','MicrosoftAzure','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','stack','name','send','padEnd','index','map','CloudProvider','fieldName','type','key','query','keys','intersection','attributes','fields','length','model','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','service','decryptString','data3','catch','show','params','includeAll'];(function(_0x85cbff,_0x3ad65f){var _0x167640=function(_0x20b744){while(--_0x20b744){_0x85cbff['push'](_0x85cbff['shift']());}};_0x167640(++_0x3ad65f);}(_0x0806,0x83));var _0x6080=function(_0xd71d33,_0x3bc6a1){_0xd71d33=_0xd71d33-0x0;var _0x5dffe4=_0x0806[_0xd71d33];return _0x5dffe4;};'use strict';var _=require('lodash');var Redis=require(_0x6080('0x0'));var qs=require(_0x6080('0x1'));var encryptor=require(_0x6080('0x2'));var config=require(_0x6080('0x3'));var logger=require(_0x6080('0x4'))(_0x6080('0x5'));var db=require(_0x6080('0x6'))['db'];var oauth=require(_0x6080('0x7'));config[_0x6080('0x8')]=_[_0x6080('0x9')](config[_0x6080('0x8')],{'host':_0x6080('0xa'),'port':0x18eb});var socket=require(_0x6080('0xb'))(new Redis(config[_0x6080('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x3e6ff6,_0x1efbe7){_0x1efbe7=_0x1efbe7||0xcc;return function(_0x36fa15){if(_0x36fa15){return _0x3e6ff6[_0x6080('0xc')](_0x1efbe7);}return _0x3e6ff6[_0x6080('0xd')](_0x1efbe7)['end']();};}function respondWithResult(_0x17c1ec,_0xc1fdbd){_0xc1fdbd=_0xc1fdbd||0xc8;return function(_0xf7e24e){if(_0xf7e24e){return _0x17c1ec[_0x6080('0xd')](_0xc1fdbd)[_0x6080('0xe')](_0xf7e24e);}};}function respondWithFilteredResult(_0x18f807,_0x346bc8){return function(_0xa90968){if(_0xa90968){var _0x1c9d04=typeof _0x346bc8[_0x6080('0xf')]===_0x6080('0x10')&&typeof _0x346bc8[_0x6080('0x11')]==='undefined';var _0x33a0e8=_0xa90968['count'];var _0x308ecd=_0x1c9d04?0x0:_0x346bc8[_0x6080('0xf')];var _0x1cc349=_0x1c9d04?_0xa90968[_0x6080('0x12')]:_0x346bc8[_0x6080('0xf')]+_0x346bc8[_0x6080('0x11')];var _0x5a6661;if(_0x1cc349>=_0x33a0e8){_0x1cc349=_0x33a0e8;_0x5a6661=0xc8;}else{_0x5a6661=0xce;}_0x18f807[_0x6080('0xd')](_0x5a6661);return _0x18f807[_0x6080('0x13')](_0x6080('0x14'),_0x308ecd+'-'+_0x1cc349+'/'+_0x33a0e8)['json'](_0xa90968);}return null;};}function saveUpdates(_0x5e1e01){return function(_0x3439fa){if(_0x3439fa){return _0x3439fa[_0x6080('0x15')](_0x5e1e01)[_0x6080('0x16')](function(_0x3e2db5){return _0x3e2db5;});}return null;};}function removeEntity(_0x2a0377){return function(_0x3ffdfe){if(_0x3ffdfe){return _0x3ffdfe['destroy']()['then'](function(){_0x2a0377['status'](0xcc)[_0x6080('0x17')]();});}};}function handleEntityNotFound(_0x3136fe){return function(_0x2fb840){if(!_0x2fb840){_0x3136fe[_0x6080('0xc')](0x194);}return _0x2fb840;};}function handleError(_0x54b6d6,_0x3d16ea){_0x3d16ea=_0x3d16ea||0x1f4;return function(_0x25ac17){logger['error'](_0x25ac17[_0x6080('0x18')]);if(_0x25ac17[_0x6080('0x19')]){delete _0x25ac17[_0x6080('0x19')];}_0x54b6d6[_0x6080('0xd')](_0x3d16ea)[_0x6080('0x1a')](_0x25ac17);};}function maskClientSecret(_0x3d7f85){return _[_0x6080('0x1b')](_0x3d7f85['slice'](0x0,0x3),0x14,'*');}exports[_0x6080('0x1c')]=function(_0x4ab999,_0xa02301){var _0x302f03={},_0x13d306={},_0x358ee1={'count':0x0,'rows':[]};var _0x2b9327=_[_0x6080('0x1d')](db[_0x6080('0x1e')]['rawAttributes'],function(_0x552c94){return{'name':_0x552c94[_0x6080('0x1f')],'type':_0x552c94[_0x6080('0x20')][_0x6080('0x21')]};});_0x13d306['model']=_[_0x6080('0x1d')](_0x2b9327,_0x6080('0x19'));_0x13d306[_0x6080('0x22')]=_[_0x6080('0x23')](_0x4ab999['query']);_0x13d306['filters']=_[_0x6080('0x24')](_0x13d306['model'],_0x13d306[_0x6080('0x22')]);_0x302f03[_0x6080('0x25')]=_['intersection'](_0x13d306['model'],qs[_0x6080('0x26')](_0x4ab999[_0x6080('0x22')][_0x6080('0x26')]));_0x302f03[_0x6080('0x25')]=_0x302f03['attributes'][_0x6080('0x27')]?_0x302f03[_0x6080('0x25')]:_0x13d306[_0x6080('0x28')];if(!_0x4ab999[_0x6080('0x22')]['hasOwnProperty'](_0x6080('0x29'))){_0x302f03[_0x6080('0x11')]=qs[_0x6080('0x11')](_0x4ab999[_0x6080('0x22')][_0x6080('0x11')]);_0x302f03['offset']=qs[_0x6080('0xf')](_0x4ab999[_0x6080('0x22')]['offset']);}_0x302f03['order']=qs[_0x6080('0x2a')](_0x4ab999['query']['sort']);_0x302f03[_0x6080('0x2b')]=qs[_0x6080('0x2c')](_['pick'](_0x4ab999[_0x6080('0x22')],_0x13d306[_0x6080('0x2c')]),_0x2b9327);if(_0x4ab999[_0x6080('0x22')][_0x6080('0x2d')]){_0x302f03[_0x6080('0x2b')]=_[_0x6080('0x2e')](_0x302f03[_0x6080('0x2b')],{'$or':_[_0x6080('0x1d')](_0x2b9327,function(_0x3502f9){if(_0x3502f9[_0x6080('0x20')]!==_0x6080('0x2f')){var _0x9bf22f={};_0x9bf22f[_0x3502f9[_0x6080('0x19')]]={'$like':'%'+_0x4ab999[_0x6080('0x22')][_0x6080('0x2d')]+'%'};return _0x9bf22f;}})});}_0x302f03=_['merge']({},_0x302f03,_0x4ab999[_0x6080('0x30')]);var _0x506b3b={'where':_0x302f03[_0x6080('0x2b')]};return db['CloudProvider'][_0x6080('0x12')](_0x506b3b)[_0x6080('0x16')](function(_0x41be3b){_0x358ee1[_0x6080('0x12')]=_0x41be3b;if(_0x4ab999[_0x6080('0x22')]['includeAll']){_0x302f03[_0x6080('0x31')]=[{'all':!![]}];}return db[_0x6080('0x1e')][_0x6080('0x32')](_0x302f03);})[_0x6080('0x16')](function(_0x2d96f4){_0x358ee1[_0x6080('0x33')]=_[_0x6080('0x1d')](_0x2d96f4,function(_0x25005a){if(_0x25005a[_0x6080('0x34')]==='MicrosoftAzure'){var _0x9ba907=encryptor[_0x6080('0x35')](_0x25005a[_0x6080('0x36')]);_0x25005a['data3']=maskClientSecret(_0x9ba907);}return _0x25005a;});return _0x358ee1;})[_0x6080('0x16')](respondWithFilteredResult(_0xa02301,_0x302f03))[_0x6080('0x37')](handleError(_0xa02301,null));};exports[_0x6080('0x38')]=function(_0x1ff727,_0x27572e){var _0x55cc12={'raw':!![],'where':{'id':_0x1ff727[_0x6080('0x39')]['id']}},_0x5c7ed4={};_0x5c7ed4[_0x6080('0x28')]=_[_0x6080('0x23')](db[_0x6080('0x1e')]['rawAttributes']);_0x5c7ed4['query']=_[_0x6080('0x23')](_0x1ff727[_0x6080('0x22')]);_0x5c7ed4[_0x6080('0x2c')]=_[_0x6080('0x24')](_0x5c7ed4[_0x6080('0x28')],_0x5c7ed4[_0x6080('0x22')]);_0x55cc12[_0x6080('0x25')]=_[_0x6080('0x24')](_0x5c7ed4['model'],qs[_0x6080('0x26')](_0x1ff727['query'][_0x6080('0x26')]));_0x55cc12['attributes']=_0x55cc12[_0x6080('0x25')][_0x6080('0x27')]?_0x55cc12['attributes']:_0x5c7ed4['model'];if(_0x1ff727[_0x6080('0x22')][_0x6080('0x3a')]){_0x55cc12[_0x6080('0x31')]=[{'all':!![]}];}_0x55cc12=_[_0x6080('0x2e')]({},_0x55cc12,_0x1ff727[_0x6080('0x30')]);return db[_0x6080('0x1e')][_0x6080('0x3b')](_0x55cc12)[_0x6080('0x16')](handleEntityNotFound(_0x27572e,null))['then'](function(_0xf78349){if(_0xf78349['service']==='MicrosoftAzure'){var _0x5efe77=encryptor[_0x6080('0x35')](_0xf78349[_0x6080('0x36')]);_0xf78349[_0x6080('0x36')]=maskClientSecret(_0x5efe77);}return _0xf78349;})[_0x6080('0x16')](respondWithResult(_0x27572e,null))[_0x6080('0x37')](handleError(_0x27572e,null));};exports[_0x6080('0x3c')]=function(_0x4d288f,_0x2d539d){if(!_0x4d288f['body'][_0x6080('0x19')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4d288f[_0x6080('0x3d')][_0x6080('0x34')])throw new Error(_0x6080('0x3e'));var _0x42c856=db[_0x6080('0x1e')]['rawAttributes']['service'][_0x6080('0x3f')];if(!_0x42c856[_0x6080('0x40')](_0x4d288f[_0x6080('0x3d')][_0x6080('0x34')]))throw new Error(_0x6080('0x41')+_0x42c856[_0x6080('0x42')](',\x20'));if(_0x4d288f[_0x6080('0x3d')][_0x6080('0x34')]==='MicrosoftAzure'&&_0x4d288f[_0x6080('0x3d')][_0x6080('0x36')]){_0x4d288f[_0x6080('0x3d')]['data3']=encryptor[_0x6080('0x43')](_0x4d288f[_0x6080('0x3d')][_0x6080('0x36')]);}return db[_0x6080('0x1e')]['create'](_0x4d288f[_0x6080('0x3d')],{})[_0x6080('0x16')](respondWithResult(_0x2d539d,0xc9))[_0x6080('0x37')](handleError(_0x2d539d,null));};exports['update']=function(_0x30b4f1,_0x5a7a04){if(_0x30b4f1['body']['id']){delete _0x30b4f1[_0x6080('0x3d')]['id'];}return db['CloudProvider'][_0x6080('0x3b')]({'where':{'id':_0x30b4f1[_0x6080('0x39')]['id']}})[_0x6080('0x16')](handleEntityNotFound(_0x5a7a04,null))['then'](function(_0x4b3741){if(_0x4b3741['service']===_0x6080('0x44')&&_0x30b4f1[_0x6080('0x3d')][_0x6080('0x36')]){_0x30b4f1['body'][_0x6080('0x36')]=encryptor[_0x6080('0x43')](_0x30b4f1[_0x6080('0x3d')][_0x6080('0x36')]);}return _0x4b3741;})[_0x6080('0x16')](saveUpdates(_0x30b4f1[_0x6080('0x3d')],null))[_0x6080('0x16')](respondWithResult(_0x5a7a04,null))[_0x6080('0x37')](handleError(_0x5a7a04,null));};exports['destroy']=function(_0x4e7f13,_0x53ca59){return db[_0x6080('0x1e')][_0x6080('0x3b')]({'where':{'id':_0x4e7f13['params']['id']}})['then'](handleEntityNotFound(_0x53ca59,null))['then'](removeEntity(_0x53ca59,null))[_0x6080('0x37')](handleError(_0x53ca59,null));};exports[_0x6080('0x45')]=function(_0x2bb40a,_0x2638ac){return db[_0x6080('0x1e')]['findOne']({'where':{'id':_0x2bb40a[_0x6080('0x39')]['id']},'raw':!![]})['then'](function(_0x340775){if(!_0x340775)return _0x2638ac[_0x6080('0xc')](0x194);return{'url':oauth[_0x6080('0x46')](_0x340775,_0x2bb40a[_0x6080('0x47')]['id'])};})[_0x6080('0x16')](respondWithResult(_0x2638ac,null))['catch'](handleError(_0x2638ac,null));};exports[_0x6080('0x48')]=function(_0x4d010f,_0x4b76b3){var _0x21a0fc=_0x4d010f[_0x6080('0x3d')];var _0x23f9b9;var _0x245ac5;if(_0x21a0fc[_0x6080('0x49')])throw _0x21a0fc;redis[_0x6080('0x4a')](_0x21a0fc[_0x6080('0x4b')])[_0x6080('0x16')](function(_0x5a3d53){if(!_0x5a3d53)throw new Error(_0x6080('0x4c'));_0x23f9b9=JSON[_0x6080('0x4d')](_0x5a3d53);var _0x27359b=Buffer['from'](_0x21a0fc[_0x6080('0x4b')],'base64')[_0x6080('0x4e')]('ascii');_0x245ac5=JSON[_0x6080('0x4d')](_0x27359b);if(!oauth[_0x6080('0x4f')](_0x21a0fc[_0x6080('0x50')],_0x23f9b9[_0x6080('0x51')]))throw new Error(_0x6080('0x52'));redis[_0x6080('0x53')](_0x21a0fc['state']);return oauth[_0x6080('0x54')](_0x21a0fc[_0x6080('0x55')],_0x23f9b9);})[_0x6080('0x16')](function(_0x6306c6){_0x23f9b9[_0x6080('0x56')]=_0x6306c6['access_token'];_0x23f9b9[_0x6080('0x57')]=_0x6306c6[_0x6080('0x58')];return db[_0x6080('0x1e')][_0x6080('0x15')]({'data5':_0x23f9b9[_0x6080('0x56')],'data6':_0x23f9b9[_0x6080('0x57')]},{'where':{'id':_0x23f9b9['id']}});})[_0x6080('0x16')](function(){oauth['startRefreshInterval'](_0x23f9b9);socket[_0x6080('0x59')](_0x6080('0x5a'),{'id':_0x245ac5['id']});return;})['then'](respondWithStatusCode(_0x4b76b3,null))[_0x6080('0x37')](function(_0x103b30){if(_0x245ac5){socket[_0x6080('0x59')](_0x6080('0x5b'),{'id':_0x245ac5['id']});}if(!_0x23f9b9){logger['error'](_0x6080('0x5c'),_0x103b30);return _0x4b76b3[_0x6080('0xd')](0x1f4)[_0x6080('0x1a')](_0x103b30['message']);}logger['error'](_0x6080('0x5d'),_0x23f9b9['id'],JSON[_0x6080('0x5e')](_0x103b30));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index c3f4c05..0859593 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 _0x2214=['../../config/logger','api','bluebird','rimraf','./cloudProvider.attributes','define','util'];(function(_0x5d4c9e,_0x208e78){var _0x4ae946=function(_0x1375a6){while(--_0x1375a6){_0x5d4c9e['push'](_0x5d4c9e['shift']());}};_0x4ae946(++_0x208e78);}(_0x2214,0x1a3));var _0x4221=function(_0x33f7f6,_0x44bcb8){_0x33f7f6=_0x33f7f6-0x0;var _0x4a5c30=_0x2214[_0x33f7f6];return _0x4a5c30;};'use strict';var _=require('lodash');var util=require(_0x4221('0x0'));var logger=require(_0x4221('0x1'))(_0x4221('0x2'));var moment=require('moment');var BPromise=require(_0x4221('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4221('0x4'));var config=require('../../config/environment');var attributes=require(_0x4221('0x5'));module['exports']=function(_0x2488b1,_0x2f59f6){return _0x2488b1[_0x4221('0x6')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d34=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x4dca91,_0x265b6c){var _0x5295a2=function(_0x3bee91){while(--_0x3bee91){_0x4dca91['push'](_0x4dca91['shift']());}};_0x5295a2(++_0x265b6c);}(_0x0d34,0x18b));var _0x40d3=function(_0x2c7a93,_0x32a9e0){_0x2c7a93=_0x2c7a93-0x0;var _0x513d22=_0x0d34[_0x2c7a93];return _0x513d22;};'use strict';var _=require(_0x40d3('0x0'));var util=require(_0x40d3('0x1'));var logger=require(_0x40d3('0x2'))(_0x40d3('0x3'));var moment=require(_0x40d3('0x4'));var BPromise=require(_0x40d3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40d3('0x6'));var rimraf=require(_0x40d3('0x7'));var config=require(_0x40d3('0x8'));var attributes=require(_0x40d3('0x9'));module[_0x40d3('0xa')]=function(_0xaec73e,_0x257358){return _0xaec73e[_0x40d3('0xb')](_0x40d3('0xc'),attributes,{'tableName':_0x40d3('0xd'),'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 500f3be..8ae1684 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 _0x226d=['oauth2Claims','oauth2/','set','payload','iss','issuer','exp','resolve','data3','CloudProvider','findOne','then','data6','decryptString','POST','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','{TENANT_ID}','data2','code','stringify','base64','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','nonce','prompt','value'];(function(_0x4993a3,_0x492845){var _0x5723ec=function(_0x2b9d18){while(--_0x2b9d18){_0x4993a3['push'](_0x4993a3['shift']());}};_0x5723ec(++_0x492845);}(_0x226d,0x13c));var _0xd226=function(_0x502372,_0x304dd9){_0x502372=_0x502372-0x0;var _0xf99629=_0x226d[_0x502372];return _0xf99629;};'use strict';var _=require(_0xd226('0x0'));var crypto=require(_0xd226('0x1'));var jwt=require(_0xd226('0x2'));var moment=require('moment');var Redis=require(_0xd226('0x3'));var rp=require(_0xd226('0x4'));var util=require('util');var encryptor=require(_0xd226('0x5'));var config=require(_0xd226('0x6'));var logger=require(_0xd226('0x7'))(_0xd226('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xd226('0x9'))['db'];config[_0xd226('0xa')]=_['defaults'](config['redis'],{'host':_0xd226('0xb'),'port':0x18eb});var redis=new Redis(config[_0xd226('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xd226('0xc'),_0xd226('0xd'),_0xd226('0xe'),_0xd226('0xf'),_0xd226('0x10'),_0xd226('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xd226('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xd226('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2f06de){var _0x59291e=_[_0xd226('0x13')](AZURE_AUTH_SCOPES[_0x2f06de[_0xd226('0x14')]]);if(_0x2f06de[_0xd226('0x14')]===_0xd226('0x15'))_0x59291e[_0xd226('0x16')](_0x2f06de['data7']+_0xd226('0x17'));return _0x59291e[_0xd226('0x18')]('\x20');}function getAccessTokenScope(_0x431ada){if(_0x431ada[_0xd226('0x14')]===_0xd226('0x19'))return _0xd226('0x10');if(_0x431ada['type']===_0xd226('0x15'))return _0x431ada[_0xd226('0x1a')]+_0xd226('0x17');}function generateMicrosoftAuthorizationUrl(_0x448a19,_0x2dd0e5){var _0x2bb8cc=MICROSOFT_AUTH_URL[_0xd226('0x1b')](_0xd226('0x1c'),_0x448a19[_0xd226('0x1d')]);var _0x535417=[_0xd226('0x1e'),'id_token'];var _0x59f418=Buffer['from'](JSON[_0xd226('0x1f')]({'id':_0x2dd0e5}))['toString'](_0xd226('0x20'));var _0xd9d6a8=crypto['randomBytes'](0x10)['toString'](_0xd226('0x21'));var _0x18aa59=getAuthorizationScopes(_0x448a19);var _0x18b6bd=[{'key':_0xd226('0x22'),'value':_0x448a19[_0xd226('0x23')]},{'key':_0xd226('0x24'),'value':encodeURIComponent(_0x535417['join']('\x20'))},{'key':_0xd226('0x25'),'value':_0x448a19[_0xd226('0x26')]},{'key':_0xd226('0x27'),'value':_0xd226('0x28')},{'key':'scope','value':encodeURIComponent(_0x18aa59)},{'key':'state','value':_0x59f418},{'key':_0xd226('0x29'),'value':_0xd9d6a8},{'key':_0xd226('0x2a'),'value':'login'}];var _0x263e22=_0x2bb8cc+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x18b6bd,function(_0x33692d){return _0x33692d['key']+'='+_0x33692d[_0xd226('0x2b')];})[_0xd226('0x18')]('&');_0x448a19[_0xd226('0x2c')]={'issuer':_0x2bb8cc[_0xd226('0x1b')](_0xd226('0x2d'),''),'audience':_0x448a19[_0xd226('0x23')],'state':_0x59f418,'nonce':_0xd9d6a8};redis[_0xd226('0x2e')](_0x59f418,JSON[_0xd226('0x1f')](_0x448a19));return _0x263e22;}function isValidIdToken(_0x74d1b1,_0x4f954a){try{var _0x5698b2=jwt['decode'](_0x74d1b1,{'complete':!![]});var _0x5ba309=_0x5698b2[_0xd226('0x2f')];if(_0x5ba309[_0xd226('0x30')]!==_0x4f954a[_0xd226('0x31')])return![];if(_0x5ba309['aud']!==_0x4f954a['audience'])return![];if(_0x5ba309['nonce']!==_0x4f954a[_0xd226('0x29')])return![];if(moment()['isAfter'](moment['unix'](_0x5ba309[_0xd226('0x32')])))return![];return!![];}catch(_0x4a6f2c){throw _0x4a6f2c;}}function refreshOauth2MicrosoftAccessToken(_0x540e59){return Promise[_0xd226('0x33')]()['then'](function(){if(_0x540e59[_0xd226('0x34')])return _0x540e59;return db[_0xd226('0x35')][_0xd226('0x36')]({'where':{'id':_0x540e59['id']},'raw':!![]});})[_0xd226('0x37')](function(_0x4faa60){var _0x400a93={'grant_type':'refresh_token','refresh_token':_0x4faa60[_0xd226('0x38')],'scope':getAccessTokenScope(_0x4faa60),'redirect_uri':_0x4faa60['data4'],'client_id':_0x4faa60[_0xd226('0x23')],'client_secret':encryptor[_0xd226('0x39')](_0x4faa60[_0xd226('0x34')])};var _0x2d8a44={'method':_0xd226('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xd226('0x1b')]('{TENANT_ID}',_0x4faa60['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x400a93,'json':!![]};return rp(_0x2d8a44);})[_0xd226('0x37')](function(_0x268e58){_0x540e59['data5']=_0x268e58[_0xd226('0x3b')];_0x540e59['data6']=_0x268e58['refresh_token'];return db[_0xd226('0x35')][_0xd226('0x3c')]({'data5':_0x540e59[_0xd226('0x3d')],'data6':_0x540e59[_0xd226('0x38')]},{'where':{'id':_0x540e59['id']}});})['then'](function(){return _0x540e59;})[_0xd226('0x3e')](function(_0x3f5cbc){logger[_0xd226('0x3f')](_0xd226('0x40'),_0x540e59['id'],_0x3f5cbc);});}function getOauth2MicrosoftAccessToken(_0x13b66d,_0x42f93a){var _0x16bcbe={'grant_type':_0xd226('0x41'),'code':_0x13b66d,'scope':getAccessTokenScope(_0x42f93a),'redirect_uri':_0x42f93a[_0xd226('0x26')],'client_id':_0x42f93a['data1'],'client_secret':encryptor[_0xd226('0x39')](_0x42f93a[_0xd226('0x34')])};var _0x1a2861={'method':_0xd226('0x3a'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd226('0x1c'),_0x42f93a[_0xd226('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x16bcbe,'json':!![]};return rp(_0x1a2861);}function startRefreshInterval(_0xa56c31){var _0x4ec8b9=schedule[_0xd226('0x42')];if(_0x4ec8b9[_0xa56c31['id']])clearInterval(_0x4ec8b9[_0xa56c31['id']]);_0x4ec8b9[_0xa56c31['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0xa56c31['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xd226('0x42')]=_0x4ec8b9;}function startAllRefreshIntervals(){return db[_0xd226('0x35')][_0xd226('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd226('0x37')](function(_0x1c6b10){var _0x26ced=_0x1c6b10[_0xd226('0x13')](function(_0x1ba123){return refreshOauth2MicrosoftAccessToken(_0x1ba123)[_0xd226('0x37')](function(_0x1157a1){startRefreshInterval(_0x1157a1);});});return Promise[_0xd226('0x44')](_0x26ced);})[_0xd226('0x3e')](function(_0x14993c){var _0x2597a7=_0x14993c?util[_0xd226('0x45')](_0x14993c,{'showHidden':![],'depth':null}):'';logger[_0xd226('0x3f')](_0xd226('0x46'),_0x2597a7);});}module[_0xd226('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xfdb7=['update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','{TENANT_ID}','data2','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','response_mode','scope','nonce','prompt','login','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','issuer','audience','isAfter','unix','exp','then','CloudProvider','findOne','data6','data3','POST','data5','access_token','refresh_token'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xfdb7,0x1bb));var _0x7fdb=function(_0x45aadc,_0x5187c0){_0x45aadc=_0x45aadc-0x0;var _0x4c84a1=_0xfdb7[_0x45aadc];return _0x4c84a1;};'use strict';var _=require(_0x7fdb('0x0'));var crypto=require(_0x7fdb('0x1'));var jwt=require(_0x7fdb('0x2'));var moment=require(_0x7fdb('0x3'));var Redis=require(_0x7fdb('0x4'));var rp=require(_0x7fdb('0x5'));var util=require(_0x7fdb('0x6'));var encryptor=require('../../components/encryptor');var config=require(_0x7fdb('0x7'));var logger=require(_0x7fdb('0x8'))(_0x7fdb('0x9'));var schedule=require(_0x7fdb('0xa'));var db=require(_0x7fdb('0xb'))['db'];config[_0x7fdb('0xc')]=_[_0x7fdb('0xd')](config[_0x7fdb('0xc')],{'host':_0x7fdb('0xe'),'port':0x18eb});var redis=new Redis(config[_0x7fdb('0xc')]);var MICROSOFT_AUTH_URL=_0x7fdb('0xf');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x7fdb('0x10'),_0x7fdb('0x11'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x7fdb('0x12'),_0x7fdb('0x13')],'Dynamics365':[_0x7fdb('0x14'),_0x7fdb('0x15')]};var MICROSOFT_AUTH_ENDPOINT=_0x7fdb('0x16');var MICROSOFT_TOKEN_ENDPOINT=_0x7fdb('0x17');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4ccae7){var _0x4e0930=_[_0x7fdb('0x18')](AZURE_AUTH_SCOPES[_0x4ccae7[_0x7fdb('0x19')]]);if(_0x4ccae7[_0x7fdb('0x19')]===_0x7fdb('0x1a'))_0x4e0930[_0x7fdb('0x1b')](_0x4ccae7[_0x7fdb('0x1c')]+'/.default');return _0x4e0930[_0x7fdb('0x1d')]('\x20');}function getAccessTokenScope(_0x3c0416){if(_0x3c0416['type']===_0x7fdb('0x1e'))return _0x7fdb('0x1f');if(_0x3c0416[_0x7fdb('0x19')]===_0x7fdb('0x1a'))return _0x3c0416[_0x7fdb('0x1c')]+_0x7fdb('0x20');}function generateMicrosoftAuthorizationUrl(_0x1f7c2b,_0x134fb4){var _0x3763f9=MICROSOFT_AUTH_URL['replace'](_0x7fdb('0x21'),_0x1f7c2b[_0x7fdb('0x22')]);var _0x5313f1=['code',_0x7fdb('0x23')];var _0x2b6c7f=Buffer[_0x7fdb('0x24')](JSON[_0x7fdb('0x25')]({'id':_0x134fb4}))[_0x7fdb('0x26')](_0x7fdb('0x27'));var _0x4e8076=crypto[_0x7fdb('0x28')](0x10)['toString'](_0x7fdb('0x29'));var _0x179a00=getAuthorizationScopes(_0x1f7c2b);var _0x4001a5=[{'key':_0x7fdb('0x2a'),'value':_0x1f7c2b[_0x7fdb('0x2b')]},{'key':'response_type','value':encodeURIComponent(_0x5313f1[_0x7fdb('0x1d')]('\x20'))},{'key':_0x7fdb('0x2c'),'value':_0x1f7c2b[_0x7fdb('0x2d')]},{'key':_0x7fdb('0x2e'),'value':'form_post'},{'key':_0x7fdb('0x2f'),'value':encodeURIComponent(_0x179a00)},{'key':'state','value':_0x2b6c7f},{'key':_0x7fdb('0x30'),'value':_0x4e8076},{'key':_0x7fdb('0x31'),'value':_0x7fdb('0x32')}];var _0x3f3b42=_0x3763f9+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4001a5,function(_0x1d9a4f){return _0x1d9a4f[_0x7fdb('0x33')]+'='+_0x1d9a4f[_0x7fdb('0x34')];})['join']('&');_0x1f7c2b[_0x7fdb('0x35')]={'issuer':_0x3763f9[_0x7fdb('0x36')](_0x7fdb('0x37'),''),'audience':_0x1f7c2b[_0x7fdb('0x2b')],'state':_0x2b6c7f,'nonce':_0x4e8076};redis[_0x7fdb('0x38')](_0x2b6c7f,JSON[_0x7fdb('0x25')](_0x1f7c2b));return _0x3f3b42;}function isValidIdToken(_0x48bcef,_0x18c314){try{var _0x20757f=jwt[_0x7fdb('0x39')](_0x48bcef,{'complete':!![]});var _0x376fe2=_0x20757f[_0x7fdb('0x3a')];if(_0x376fe2['iss']!==_0x18c314[_0x7fdb('0x3b')])return![];if(_0x376fe2['aud']!==_0x18c314[_0x7fdb('0x3c')])return![];if(_0x376fe2[_0x7fdb('0x30')]!==_0x18c314[_0x7fdb('0x30')])return![];if(moment()[_0x7fdb('0x3d')](moment[_0x7fdb('0x3e')](_0x376fe2[_0x7fdb('0x3f')])))return![];return!![];}catch(_0x2bd9a5){throw _0x2bd9a5;}}function refreshOauth2MicrosoftAccessToken(_0x51dd68){return Promise['resolve']()[_0x7fdb('0x40')](function(){if(_0x51dd68['data3'])return _0x51dd68;return db[_0x7fdb('0x41')][_0x7fdb('0x42')]({'where':{'id':_0x51dd68['id']},'raw':!![]});})[_0x7fdb('0x40')](function(_0x2c5a75){var _0x19d819={'grant_type':'refresh_token','refresh_token':_0x2c5a75[_0x7fdb('0x43')],'scope':getAccessTokenScope(_0x2c5a75),'redirect_uri':_0x2c5a75['data4'],'client_id':_0x2c5a75[_0x7fdb('0x2b')],'client_secret':encryptor['decryptString'](_0x2c5a75[_0x7fdb('0x44')])};var _0x450c98={'method':_0x7fdb('0x45'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7fdb('0x21'),_0x2c5a75[_0x7fdb('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x19d819,'json':!![]};return rp(_0x450c98);})[_0x7fdb('0x40')](function(_0x41b540){_0x51dd68[_0x7fdb('0x46')]=_0x41b540[_0x7fdb('0x47')];_0x51dd68[_0x7fdb('0x43')]=_0x41b540[_0x7fdb('0x48')];return db['CloudProvider'][_0x7fdb('0x49')]({'data5':_0x51dd68[_0x7fdb('0x46')],'data6':_0x51dd68[_0x7fdb('0x43')]},{'where':{'id':_0x51dd68['id']}});})['then'](function(){return _0x51dd68;})[_0x7fdb('0x4a')](function(_0x4398ee){logger[_0x7fdb('0x4b')](_0x7fdb('0x4c'),_0x51dd68['id'],_0x4398ee);});}function getOauth2MicrosoftAccessToken(_0x30cb44,_0x3cf199){var _0x1a3686={'grant_type':_0x7fdb('0x4d'),'code':_0x30cb44,'scope':getAccessTokenScope(_0x3cf199),'redirect_uri':_0x3cf199[_0x7fdb('0x2d')],'client_id':_0x3cf199[_0x7fdb('0x2b')],'client_secret':encryptor[_0x7fdb('0x4e')](_0x3cf199['data3'])};var _0x7c0cd5={'method':_0x7fdb('0x45'),'uri':MICROSOFT_AUTH_URL[_0x7fdb('0x36')](_0x7fdb('0x21'),_0x3cf199[_0x7fdb('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1a3686,'json':!![]};return rp(_0x7c0cd5);}function startRefreshInterval(_0x3253d5){var _0x15c459=schedule[_0x7fdb('0x4f')];if(_0x15c459[_0x3253d5['id']])clearInterval(_0x15c459[_0x3253d5['id']]);_0x15c459[_0x3253d5['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7fdb('0x50')](this,{'id':_0x3253d5['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7fdb('0x4f')]=_0x15c459;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x7fdb('0x51')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7fdb('0x40')](function(_0x16c058){var _0x5339fa=_0x16c058['map'](function(_0x359c0d){return refreshOauth2MicrosoftAccessToken(_0x359c0d)[_0x7fdb('0x40')](function(_0x520eff){startRefreshInterval(_0x520eff);});});return Promise[_0x7fdb('0x52')](_0x5339fa);})[_0x7fdb('0x4a')](function(_0x514ecc){var _0x114508=_0x514ecc?util[_0x7fdb('0x53')](_0x514ecc,{'showHidden':![],'depth':null}):'';logger[_0x7fdb('0x4b')](_0x7fdb('0x54'),_0x114508);});}module[_0x7fdb('0x55')]={'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 9acb437..b6328fe 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 _0xedf1=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x45a1c4,_0x78263e){var _0x1947bf=function(_0x4c40ba){while(--_0x4c40ba){_0x45a1c4['push'](_0x45a1c4['shift']());}};_0x1947bf(++_0x78263e);}(_0xedf1,0xb2));var _0x1edf=function(_0x25b80e,_0x503088){_0x25b80e=_0x25b80e-0x0;var _0xd2c680=_0xedf1[_0x25b80e];return _0xd2c680;};'use strict';var _=require(_0x1edf('0x0'));var util=require(_0x1edf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1edf('0x2'));var fs=require('fs');var Redis=require(_0x1edf('0x3'));var db=require(_0x1edf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1edf('0x5'))(_0x1edf('0x6'));var config=require(_0x1edf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1edf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1615b2,_0x1029fe,_0x20b629){return new BPromise(function(_0x12293b,_0x206f63){return client[_0x1edf('0x9')](_0x1615b2,_0x20b629)[_0x1edf('0xa')](function(_0x30a13f){logger['info'](_0x1edf('0xb'),_0x1029fe,_0x1edf('0xc'));logger[_0x1edf('0xd')](_0x1edf('0xe'),_0x1029fe,'request\x20sent',JSON[_0x1edf('0xf')](_0x30a13f));if(_0x30a13f['error']){if(_0x30a13f[_0x1edf('0x10')][_0x1edf('0x11')]===0x1f4){logger[_0x1edf('0x10')](_0x1edf('0xb'),_0x1029fe,_0x30a13f[_0x1edf('0x10')][_0x1edf('0x12')]);return _0x206f63(_0x30a13f[_0x1edf('0x10')][_0x1edf('0x12')]);}logger[_0x1edf('0x10')]('CloudProvider,\x20%s,\x20%s',_0x1029fe,_0x30a13f[_0x1edf('0x10')][_0x1edf('0x12')]);return _0x12293b(_0x30a13f['error'][_0x1edf('0x12')]);}else{logger[_0x1edf('0x13')](_0x1edf('0xb'),_0x1029fe,_0x1edf('0xc'));_0x12293b(_0x30a13f[_0x1edf('0x14')][_0x1edf('0x12')]);}})['catch'](function(_0x4f2584){logger[_0x1edf('0x10')](_0x1edf('0xb'),_0x1029fe,_0x4f2584);_0x206f63(_0x4f2584);});});}
\ No newline at end of file
+var _0xb5fb=['request','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x15c530,_0x489b22){var _0x3bd24f=function(_0x164499){while(--_0x164499){_0x15c530['push'](_0x15c530['shift']());}};_0x3bd24f(++_0x489b22);}(_0xb5fb,0x172));var _0xbb5f=function(_0x5905f7,_0x2261f6){_0x5905f7=_0x5905f7-0x0;var _0x18724f=_0xb5fb[_0x5905f7];return _0x18724f;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require(_0xbb5f('0xa'));var jayson=require(_0xbb5f('0xb'));var client=jayson[_0xbb5f('0xc')][_0xbb5f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487a1a,_0x597050,_0x317cd9){return new BPromise(function(_0x5e7943,_0x5b91){return client[_0xbb5f('0xe')](_0x487a1a,_0x317cd9)['then'](function(_0x4f13a9){logger[_0xbb5f('0xf')]('CloudProvider,\x20%s,\x20%s',_0x597050,_0xbb5f('0x10'));logger[_0xbb5f('0x11')](_0xbb5f('0x12'),_0x597050,_0xbb5f('0x10'),JSON[_0xbb5f('0x13')](_0x4f13a9));if(_0x4f13a9[_0xbb5f('0x14')]){if(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x15')]===0x1f4){logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9['error'][_0xbb5f('0x17')]);return _0x5b91(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}logger['error'](_0xbb5f('0x16'),_0x597050,_0x4f13a9[_0xbb5f('0x14')]['message']);return _0x5e7943(_0x4f13a9[_0xbb5f('0x14')][_0xbb5f('0x17')]);}else{logger[_0xbb5f('0xf')](_0xbb5f('0x16'),_0x597050,'request\x20sent');_0x5e7943(_0x4f13a9['result'][_0xbb5f('0x17')]);}})['catch'](function(_0xdf4ec8){logger[_0xbb5f('0x14')]('CloudProvider,\x20%s,\x20%s',_0x597050,_0xdf4ec8);_0x5b91(_0xdf4ec8);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8a3dbb5..5a6e725 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x1261,0x144));var _0x1126=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x1261[_0x1e393b];return _0x3d0bfe;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x362743,_0x4f4b49){var _0x27047f=function(_0x54ef8e){while(--_0x54ef8e){_0x362743['push'](_0x362743['shift']());}};_0x27047f(++_0x4f4b49);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index d5b4016..135e64e 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 _0xf350=['STRING','sequelize','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf350,0x1e9));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0f35('0x0'));module[_0x0f35('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0f35('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0f35('0x3')]},'companyId':{'type':Sequelize[_0x0f35('0x3')]},'website':{'type':Sequelize[_0x0f35('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0f35('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0f35('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0f35('0x3')]},'email':{'type':Sequelize[_0x0f35('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0f35('0x3')]},'sStreet':{'type':Sequelize[_0x0f35('0x3')]},'sPostalCode':{'type':Sequelize[_0x0f35('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0f35('0x3')]}};
\ No newline at end of file
+var _0x1948=['sequelize','STRING'];(function(_0x45875a,_0x2645c9){var _0x16da59=function(_0x29fa56){while(--_0x29fa56){_0x45875a['push'](_0x45875a['shift']());}};_0x16da59(++_0x2645c9);}(_0x1948,0x1b4));var _0x8194=function(_0x130308,_0x4d4478){_0x130308=_0x130308-0x0;var _0x1a728d=_0x1948[_0x130308];return _0x1a728d;};'use strict';var Sequelize=require(_0x8194('0x0'));module['exports']={'name':{'type':Sequelize[_0x8194('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8194('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x8194('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8194('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8194('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8194('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8194('0x1')]},'sStreet':{'type':Sequelize[_0x8194('0x1')]},'sPostalCode':{'type':Sequelize[_0x8194('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8194('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 7a7cf94..a0777a4 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 _0x5323=['Companies','UserProfileResource','error','name','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','CmContact','addContacts','ids','omit','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5323,0x1e8));var _0x3532=function(_0x4495f4,_0x1df31f){_0x4495f4=_0x4495f4-0x0;var _0xc2651c=_0x5323[_0x4495f4];return _0xc2651c;};'use strict';var emlformat=require(_0x3532('0x0'));var rimraf=require(_0x3532('0x1'));var zipdir=require(_0x3532('0x2'));var jsonpatch=require(_0x3532('0x3'));var rp=require(_0x3532('0x4'));var moment=require('moment');var BPromise=require(_0x3532('0x5'));var Mustache=require(_0x3532('0x6'));var util=require(_0x3532('0x7'));var path=require('path');var sox=require(_0x3532('0x8'));var csv=require(_0x3532('0x9'));var ejs=require(_0x3532('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3532('0xb'));var squel=require(_0x3532('0xc'));var crypto=require(_0x3532('0xd'));var jsforce=require(_0x3532('0xe'));var deskjs=require(_0x3532('0xf'));var toCsv=require(_0x3532('0x9'));var querystring=require('querystring');var Papa=require(_0x3532('0x10'));var Redis=require(_0x3532('0x11'));var authService=require(_0x3532('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3532('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3532('0x14'));var utils=require(_0x3532('0x15'));var config=require(_0x3532('0x16'));var licenseUtil=require(_0x3532('0x17'));var db=require(_0x3532('0x18'))['db'];function respondWithStatusCode(_0x379f29,_0x212786){_0x212786=_0x212786||0xcc;return function(_0x4a56c2){if(_0x4a56c2){return _0x379f29[_0x3532('0x19')](_0x212786);}return _0x379f29[_0x3532('0x1a')](_0x212786)[_0x3532('0x1b')]();};}function respondWithResult(_0x80089b,_0x465846){_0x465846=_0x465846||0xc8;return function(_0x706a49){if(_0x706a49){return _0x80089b['status'](_0x465846)[_0x3532('0x1c')](_0x706a49);}};}function respondWithFilteredResult(_0x4e3ffd,_0x3d619b){return function(_0x580693){if(_0x580693){var _0x19ed61=typeof _0x3d619b[_0x3532('0x1d')]==='undefined'&&typeof _0x3d619b[_0x3532('0x1e')]===_0x3532('0x1f');var _0x48eb5d=_0x580693[_0x3532('0x20')];var _0x19b3c5=_0x19ed61?0x0:_0x3d619b[_0x3532('0x1d')];var _0x3be0ec=_0x19ed61?_0x580693['count']:_0x3d619b[_0x3532('0x1d')]+_0x3d619b[_0x3532('0x1e')];var _0x1e961c;if(_0x3be0ec>=_0x48eb5d){_0x3be0ec=_0x48eb5d;_0x1e961c=0xc8;}else{_0x1e961c=0xce;}_0x4e3ffd[_0x3532('0x1a')](_0x1e961c);return _0x4e3ffd[_0x3532('0x21')](_0x3532('0x22'),_0x19b3c5+'-'+_0x3be0ec+'/'+_0x48eb5d)[_0x3532('0x1c')](_0x580693);}return null;};}function patchUpdates(_0x5eea7e){return function(_0x56f35f){try{jsonpatch['apply'](_0x56f35f,_0x5eea7e,!![]);}catch(_0x5ca2ca){return BPromise[_0x3532('0x23')](_0x5ca2ca);}return _0x56f35f[_0x3532('0x24')]();};}function saveUpdates(_0x82cde4,_0x450a32){return function(_0x2b1e03){if(_0x2b1e03){return _0x2b1e03[_0x3532('0x25')](_0x82cde4)['then'](function(_0x54be45){return _0x54be45;});}return null;};}function removeEntity(_0x1836a7,_0x5e97b8){return function(_0xbe99eb){if(_0xbe99eb){return _0xbe99eb[_0x3532('0x26')]()[_0x3532('0x27')](function(){var _0x3751d8=_0xbe99eb['get']({'plain':!![]});var _0x146c4d=_0x3532('0x28');return db[_0x3532('0x29')]['destroy']({'where':{'type':_0x146c4d,'resourceId':_0x3751d8['id']}})[_0x3532('0x27')](function(){return _0xbe99eb;});})[_0x3532('0x27')](function(){_0x1836a7['status'](0xcc)[_0x3532('0x1b')]();});}};}function handleEntityNotFound(_0x206cd6,_0x3cacae){return function(_0x47fe58){if(!_0x47fe58){_0x206cd6[_0x3532('0x19')](0x194);}return _0x47fe58;};}function handleError(_0x28dc84,_0x23d003){_0x23d003=_0x23d003||0x1f4;return function(_0x2c38b7){logger[_0x3532('0x2a')](_0x2c38b7['stack']);if(_0x2c38b7[_0x3532('0x2b')]){delete _0x2c38b7[_0x3532('0x2b')];}_0x28dc84[_0x3532('0x1a')](_0x23d003)['send'](_0x2c38b7);};}exports['index']=function(_0x495a03,_0x56d634){var _0x5260c5={},_0x144ad9={},_0x409fd3={'count':0x0,'rows':[]};return db[_0x3532('0x2c')]['describe']()[_0x3532('0x27')](function(_0x5b6f19){_0x144ad9[_0x3532('0x2d')]=_[_0x3532('0x2e')](_0x5b6f19);_0x144ad9[_0x3532('0x2f')]=_[_0x3532('0x2e')](_0x495a03[_0x3532('0x2f')]);_0x144ad9[_0x3532('0x30')]=_[_0x3532('0x31')](_0x144ad9[_0x3532('0x2d')],_0x144ad9[_0x3532('0x2f')]);_0x5260c5[_0x3532('0x32')]=_[_0x3532('0x31')](_0x144ad9[_0x3532('0x2d')],qs[_0x3532('0x33')](_0x495a03[_0x3532('0x2f')][_0x3532('0x33')]));_0x5260c5[_0x3532('0x32')]=_0x5260c5[_0x3532('0x32')][_0x3532('0x34')]?_0x5260c5['attributes']:_0x144ad9[_0x3532('0x2d')];if(!_0x495a03[_0x3532('0x2f')]['hasOwnProperty'](_0x3532('0x35'))){_0x5260c5[_0x3532('0x1e')]=qs[_0x3532('0x1e')](_0x495a03[_0x3532('0x2f')][_0x3532('0x1e')]);_0x5260c5[_0x3532('0x1d')]=qs[_0x3532('0x1d')](_0x495a03[_0x3532('0x2f')][_0x3532('0x1d')]);}_0x5260c5[_0x3532('0x36')]=qs[_0x3532('0x37')](_0x495a03[_0x3532('0x2f')]['sort']);_0x5260c5[_0x3532('0x38')]=qs[_0x3532('0x30')](_[_0x3532('0x39')](_0x495a03[_0x3532('0x2f')],_0x144ad9[_0x3532('0x30')]),_0x5b6f19);if(_0x495a03[_0x3532('0x2f')][_0x3532('0x3a')]){_0x5260c5[_0x3532('0x38')]=_['merge'](_0x5260c5['where'],{'$or':_[_0x3532('0x3b')](_0x5260c5[_0x3532('0x32')],function(_0x4de40d){var _0x3dbcbc={};_0x3dbcbc[_0x4de40d]={'$like':'%'+_0x495a03['query'][_0x3532('0x3a')]+'%'};return _0x3dbcbc;})});}_0x5260c5=_[_0x3532('0x3c')]({},_0x5260c5,_0x495a03[_0x3532('0x3d')]);var _0x476f54={'where':_0x5260c5[_0x3532('0x38')]};return db[_0x3532('0x2c')]['count'](_0x476f54)[_0x3532('0x27')](function(_0x149201){_0x409fd3[_0x3532('0x20')]=_0x149201;if(_0x495a03[_0x3532('0x2f')][_0x3532('0x3e')]){_0x5260c5[_0x3532('0x3f')]=[{'all':!![]}];}return db[_0x3532('0x2c')][_0x3532('0x40')](_0x5260c5);})[_0x3532('0x27')](function(_0x443a61){_0x409fd3[_0x3532('0x41')]=_0x443a61;return _0x409fd3;})['then'](respondWithFilteredResult(_0x56d634,_0x5260c5))[_0x3532('0x42')](handleError(_0x56d634,null));})[_0x3532('0x42')](handleError(_0x56d634,null));};exports[_0x3532('0x43')]=function(_0x221e7f,_0x1c98b7){var _0x2acf54={'raw':![],'where':{'id':_0x221e7f['params']['id']}},_0x3c7e19={};_0x3c7e19[_0x3532('0x2d')]=_['keys'](db[_0x3532('0x2c')][_0x3532('0x44')]);_0x3c7e19[_0x3532('0x2f')]=_[_0x3532('0x2e')](_0x221e7f[_0x3532('0x2f')]);_0x3c7e19[_0x3532('0x30')]=_['intersection'](_0x3c7e19[_0x3532('0x2d')],_0x3c7e19['query']);_0x2acf54[_0x3532('0x32')]=_[_0x3532('0x31')](_0x3c7e19[_0x3532('0x2d')],qs[_0x3532('0x33')](_0x221e7f[_0x3532('0x2f')][_0x3532('0x33')]));_0x2acf54[_0x3532('0x32')]=_0x2acf54[_0x3532('0x32')][_0x3532('0x34')]?_0x2acf54['attributes']:_0x3c7e19[_0x3532('0x2d')];if(_0x221e7f['query']['includeAll']){_0x2acf54[_0x3532('0x3f')]=[{'all':!![]}];}_0x2acf54=_['merge']({},_0x2acf54,_0x221e7f[_0x3532('0x3d')]);return db['CmCompany'][_0x3532('0x45')](_0x2acf54)['then'](handleEntityNotFound(_0x1c98b7,null))[_0x3532('0x27')](respondWithResult(_0x1c98b7,null))[_0x3532('0x42')](handleError(_0x1c98b7,null));};exports[_0x3532('0x46')]=function(_0x70a162,_0x1f12e0){return db['CmCompany'][_0x3532('0x46')](_0x70a162[_0x3532('0x47')],{})[_0x3532('0x27')](function(_0x5883e6){var _0x200588=_0x70a162[_0x3532('0x48')][_0x3532('0x49')]({'plain':!![]});if(!_0x200588)throw new Error(_0x3532('0x4a'));if(_0x200588[_0x3532('0x4b')]==='user'){var _0x5a3605=_0x5883e6[_0x3532('0x49')]({'plain':!![]});var _0x493e6c=_0x3532('0x28');return db[_0x3532('0x4c')][_0x3532('0x45')]({'where':{'name':_0x493e6c,'userProfileId':_0x200588[_0x3532('0x4d')]},'raw':!![]})[_0x3532('0x27')](function(_0xd347ad){if(_0xd347ad&&_0xd347ad[_0x3532('0x4e')]===0x0){return db[_0x3532('0x29')][_0x3532('0x46')]({'name':_0x5a3605[_0x3532('0x2b')],'resourceId':_0x5a3605['id'],'type':_0xd347ad[_0x3532('0x2b')],'sectionId':_0xd347ad['id']},{})[_0x3532('0x27')](function(){return _0x5883e6;});}else{return _0x5883e6;}})['catch'](function(_0x253a40){logger['error'](_0x3532('0x4f'),_0x253a40);throw _0x253a40;});}return _0x5883e6;})[_0x3532('0x27')](respondWithResult(_0x1f12e0,0xc9))[_0x3532('0x42')](handleError(_0x1f12e0,null));};exports['update']=function(_0x550585,_0x19b9af){if(_0x550585[_0x3532('0x47')]['id']){delete _0x550585['body']['id'];}return db[_0x3532('0x2c')][_0x3532('0x45')]({'where':{'id':_0x550585[_0x3532('0x50')]['id']}})['then'](handleEntityNotFound(_0x19b9af,null))[_0x3532('0x27')](saveUpdates(_0x550585[_0x3532('0x47')],null))['then'](respondWithResult(_0x19b9af,null))[_0x3532('0x42')](handleError(_0x19b9af,null));};exports['destroy']=function(_0x6c93a1,_0x593938){return db[_0x3532('0x2c')][_0x3532('0x45')]({'where':{'id':_0x6c93a1[_0x3532('0x50')]['id']}})[_0x3532('0x27')](handleEntityNotFound(_0x593938,null))['then'](removeEntity(_0x593938,null))[_0x3532('0x42')](handleError(_0x593938,null));};exports['describe']=function(_0x1282bb,_0x44b6a7){return db[_0x3532('0x2c')][_0x3532('0x51')]()[_0x3532('0x27')](respondWithResult(_0x44b6a7,null))['catch'](handleError(_0x44b6a7,null));};exports['addContacts']=function(_0x15e7fb,_0x100d84,_0x1a7cec){return db[_0x3532('0x52')][_0x3532('0x45')]({'where':{'id':_0x15e7fb[_0x3532('0x50')]['id']}})['then'](handleEntityNotFound(_0x100d84,null))['then'](function(_0x5bce3d){if(_0x5bce3d){return _0x5bce3d[_0x3532('0x53')](_0x15e7fb[_0x3532('0x47')][_0x3532('0x54')],_[_0x3532('0x55')](_0x15e7fb[_0x3532('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x100d84,null))[_0x3532('0x42')](handleError(_0x100d84,null));};exports[_0x3532('0x56')]=function(_0x380a30,_0x480359,_0x197b20){var _0x23674b={};var _0x11d3da={};var _0x1fab4f;var _0x5b288b;return db[_0x3532('0x2c')]['findOne']({'where':{'id':_0x380a30[_0x3532('0x50')]['id']}})[_0x3532('0x27')](handleEntityNotFound(_0x480359,null))[_0x3532('0x27')](function(_0x2120b0){if(_0x2120b0){_0x1fab4f=_0x2120b0;_0x11d3da[_0x3532('0x2d')]=_[_0x3532('0x2e')](db['CmContact'][_0x3532('0x44')]);_0x11d3da['query']=_[_0x3532('0x2e')](_0x380a30[_0x3532('0x2f')]);_0x11d3da[_0x3532('0x30')]=_[_0x3532('0x31')](_0x11d3da['model'],_0x11d3da[_0x3532('0x2f')]);_0x23674b[_0x3532('0x32')]=_[_0x3532('0x31')](_0x11d3da[_0x3532('0x2d')],qs[_0x3532('0x33')](_0x380a30[_0x3532('0x2f')]['fields']));_0x23674b[_0x3532('0x32')]=_0x23674b[_0x3532('0x32')][_0x3532('0x34')]?_0x23674b[_0x3532('0x32')]:_0x11d3da['model'];_0x23674b[_0x3532('0x36')]=qs[_0x3532('0x37')](_0x380a30['query'][_0x3532('0x37')]);_0x23674b[_0x3532('0x38')]=qs[_0x3532('0x30')](_[_0x3532('0x39')](_0x380a30[_0x3532('0x2f')],_0x11d3da[_0x3532('0x30')]));if(_0x380a30['query'][_0x3532('0x3a')]){_0x23674b['where']=_['merge'](_0x23674b[_0x3532('0x38')],{'$or':_[_0x3532('0x3b')](_0x23674b[_0x3532('0x32')],function(_0x6d4e7){var _0x52a89a={};_0x52a89a[_0x6d4e7]={'$like':'%'+_0x380a30[_0x3532('0x2f')][_0x3532('0x3a')]+'%'};return _0x52a89a;})});}_0x23674b=_['merge']({},_0x23674b,_0x380a30['options']);return _0x1fab4f[_0x3532('0x56')](_0x23674b);}})[_0x3532('0x27')](function(_0x1e406e){if(_0x1e406e){_0x5b288b=_0x1e406e[_0x3532('0x34')];if(!_0x380a30['query'][_0x3532('0x57')](_0x3532('0x35'))){_0x23674b['limit']=qs['limit'](_0x380a30[_0x3532('0x2f')]['limit']);_0x23674b[_0x3532('0x1d')]=qs[_0x3532('0x1d')](_0x380a30['query'][_0x3532('0x1d')]);}return _0x1fab4f[_0x3532('0x56')](_0x23674b);}})[_0x3532('0x27')](function(_0x3dd9d7){if(_0x3dd9d7){return _0x3dd9d7?{'count':_0x5b288b,'rows':_0x3dd9d7}:null;}})['then'](respondWithResult(_0x480359,null))['catch'](handleError(_0x480359,null));};
\ No newline at end of file
+var _0x9f57=['query','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','CmCompany','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','CmContact','map','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../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','save','update','then','destroy','Companies','error','stack','name','index','describe','keys','filters','intersection','model'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9f57,0x7b));var _0x79f5=function(_0x3e6058,_0xc27036){_0x3e6058=_0x3e6058-0x0;var _0x3b21ad=_0x9f57[_0x3e6058];return _0x3b21ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79f5('0x0'));var zipdir=require(_0x79f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79f5('0x2'));var moment=require('moment');var BPromise=require(_0x79f5('0x3'));var Mustache=require(_0x79f5('0x4'));var util=require('util');var path=require(_0x79f5('0x5'));var sox=require(_0x79f5('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79f5('0x7'));var squel=require(_0x79f5('0x8'));var crypto=require(_0x79f5('0x9'));var jsforce=require(_0x79f5('0xa'));var deskjs=require(_0x79f5('0xb'));var toCsv=require(_0x79f5('0xc'));var querystring=require(_0x79f5('0xd'));var Papa=require(_0x79f5('0xe'));var Redis=require(_0x79f5('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x79f5('0x10'));var hardwareService=require(_0x79f5('0x11'));var logger=require(_0x79f5('0x12'))(_0x79f5('0x13'));var utils=require('../../config/utils');var config=require(_0x79f5('0x14'));var licenseUtil=require(_0x79f5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ac636,_0x24686b){_0x24686b=_0x24686b||0xcc;return function(_0x3a86c6){if(_0x3a86c6){return _0x3ac636[_0x79f5('0x16')](_0x24686b);}return _0x3ac636[_0x79f5('0x17')](_0x24686b)[_0x79f5('0x18')]();};}function respondWithResult(_0x28eb6b,_0x3c1645){_0x3c1645=_0x3c1645||0xc8;return function(_0x1ce988){if(_0x1ce988){return _0x28eb6b[_0x79f5('0x17')](_0x3c1645)[_0x79f5('0x19')](_0x1ce988);}};}function respondWithFilteredResult(_0xe71172,_0x190561){return function(_0x145f83){if(_0x145f83){var _0x3b55d9=typeof _0x190561[_0x79f5('0x1a')]===_0x79f5('0x1b')&&typeof _0x190561[_0x79f5('0x1c')]===_0x79f5('0x1b');var _0x447a05=_0x145f83[_0x79f5('0x1d')];var _0x2fbcbf=_0x3b55d9?0x0:_0x190561[_0x79f5('0x1a')];var _0x3b0ed6=_0x3b55d9?_0x145f83[_0x79f5('0x1d')]:_0x190561['offset']+_0x190561[_0x79f5('0x1c')];var _0x1b73e3;if(_0x3b0ed6>=_0x447a05){_0x3b0ed6=_0x447a05;_0x1b73e3=0xc8;}else{_0x1b73e3=0xce;}_0xe71172[_0x79f5('0x17')](_0x1b73e3);return _0xe71172[_0x79f5('0x1e')](_0x79f5('0x1f'),_0x2fbcbf+'-'+_0x3b0ed6+'/'+_0x447a05)['json'](_0x145f83);}return null;};}function patchUpdates(_0x359ef4){return function(_0xd81731){try{jsonpatch[_0x79f5('0x20')](_0xd81731,_0x359ef4,!![]);}catch(_0x2ee8bd){return BPromise['reject'](_0x2ee8bd);}return _0xd81731[_0x79f5('0x21')]();};}function saveUpdates(_0x292d40,_0x38fef5){return function(_0x945d1a){if(_0x945d1a){return _0x945d1a[_0x79f5('0x22')](_0x292d40)[_0x79f5('0x23')](function(_0x69b8f9){return _0x69b8f9;});}return null;};}function removeEntity(_0x36cd42,_0x392203){return function(_0x333e69){if(_0x333e69){return _0x333e69[_0x79f5('0x24')]()[_0x79f5('0x23')](function(){var _0x42a0b5=_0x333e69['get']({'plain':!![]});var _0x348622=_0x79f5('0x25');return db['UserProfileResource'][_0x79f5('0x24')]({'where':{'type':_0x348622,'resourceId':_0x42a0b5['id']}})['then'](function(){return _0x333e69;});})['then'](function(){_0x36cd42[_0x79f5('0x17')](0xcc)[_0x79f5('0x18')]();});}};}function handleEntityNotFound(_0x4c32b0,_0x21b878){return function(_0x295fd6){if(!_0x295fd6){_0x4c32b0[_0x79f5('0x16')](0x194);}return _0x295fd6;};}function handleError(_0x3a7b54,_0x372f48){_0x372f48=_0x372f48||0x1f4;return function(_0x5d7479){logger[_0x79f5('0x26')](_0x5d7479[_0x79f5('0x27')]);if(_0x5d7479[_0x79f5('0x28')]){delete _0x5d7479[_0x79f5('0x28')];}_0x3a7b54[_0x79f5('0x17')](_0x372f48)['send'](_0x5d7479);};}exports[_0x79f5('0x29')]=function(_0x112e29,_0x100bfe){var _0x28cca4={},_0x4d7f45={},_0x10df3b={'count':0x0,'rows':[]};return db['CmCompany'][_0x79f5('0x2a')]()[_0x79f5('0x23')](function(_0x1e929b){_0x4d7f45['model']=_[_0x79f5('0x2b')](_0x1e929b);_0x4d7f45['query']=_[_0x79f5('0x2b')](_0x112e29['query']);_0x4d7f45[_0x79f5('0x2c')]=_[_0x79f5('0x2d')](_0x4d7f45[_0x79f5('0x2e')],_0x4d7f45[_0x79f5('0x2f')]);_0x28cca4[_0x79f5('0x30')]=_[_0x79f5('0x2d')](_0x4d7f45[_0x79f5('0x2e')],qs[_0x79f5('0x31')](_0x112e29[_0x79f5('0x2f')][_0x79f5('0x31')]));_0x28cca4[_0x79f5('0x30')]=_0x28cca4['attributes'][_0x79f5('0x32')]?_0x28cca4[_0x79f5('0x30')]:_0x4d7f45[_0x79f5('0x2e')];if(!_0x112e29['query']['hasOwnProperty'](_0x79f5('0x33'))){_0x28cca4[_0x79f5('0x1c')]=qs['limit'](_0x112e29[_0x79f5('0x2f')][_0x79f5('0x1c')]);_0x28cca4['offset']=qs[_0x79f5('0x1a')](_0x112e29[_0x79f5('0x2f')][_0x79f5('0x1a')]);}_0x28cca4[_0x79f5('0x34')]=qs[_0x79f5('0x35')](_0x112e29[_0x79f5('0x2f')][_0x79f5('0x35')]);_0x28cca4[_0x79f5('0x36')]=qs[_0x79f5('0x2c')](_[_0x79f5('0x37')](_0x112e29['query'],_0x4d7f45[_0x79f5('0x2c')]),_0x1e929b);if(_0x112e29['query']['filter']){_0x28cca4['where']=_[_0x79f5('0x38')](_0x28cca4[_0x79f5('0x36')],{'$or':_['map'](_0x28cca4[_0x79f5('0x30')],function(_0x5d9053){var _0x3f76b8={};_0x3f76b8[_0x5d9053]={'$like':'%'+_0x112e29['query'][_0x79f5('0x39')]+'%'};return _0x3f76b8;})});}_0x28cca4=_[_0x79f5('0x38')]({},_0x28cca4,_0x112e29[_0x79f5('0x3a')]);var _0x3727b0={'where':_0x28cca4[_0x79f5('0x36')]};return db[_0x79f5('0x3b')]['count'](_0x3727b0)[_0x79f5('0x23')](function(_0x4ffe14){_0x10df3b[_0x79f5('0x1d')]=_0x4ffe14;if(_0x112e29[_0x79f5('0x2f')]['includeAll']){_0x28cca4[_0x79f5('0x3c')]=[{'all':!![]}];}return db[_0x79f5('0x3b')][_0x79f5('0x3d')](_0x28cca4);})[_0x79f5('0x23')](function(_0x292250){_0x10df3b[_0x79f5('0x3e')]=_0x292250;return _0x10df3b;})[_0x79f5('0x23')](respondWithFilteredResult(_0x100bfe,_0x28cca4))[_0x79f5('0x3f')](handleError(_0x100bfe,null));})['catch'](handleError(_0x100bfe,null));};exports[_0x79f5('0x40')]=function(_0x205eba,_0x519cac){var _0x60556={'raw':![],'where':{'id':_0x205eba[_0x79f5('0x41')]['id']}},_0x13ac09={};_0x13ac09[_0x79f5('0x2e')]=_[_0x79f5('0x2b')](db[_0x79f5('0x3b')][_0x79f5('0x42')]);_0x13ac09['query']=_['keys'](_0x205eba[_0x79f5('0x2f')]);_0x13ac09[_0x79f5('0x2c')]=_[_0x79f5('0x2d')](_0x13ac09[_0x79f5('0x2e')],_0x13ac09[_0x79f5('0x2f')]);_0x60556[_0x79f5('0x30')]=_[_0x79f5('0x2d')](_0x13ac09['model'],qs[_0x79f5('0x31')](_0x205eba[_0x79f5('0x2f')][_0x79f5('0x31')]));_0x60556[_0x79f5('0x30')]=_0x60556['attributes']['length']?_0x60556['attributes']:_0x13ac09['model'];if(_0x205eba[_0x79f5('0x2f')][_0x79f5('0x43')]){_0x60556[_0x79f5('0x3c')]=[{'all':!![]}];}_0x60556=_[_0x79f5('0x38')]({},_0x60556,_0x205eba[_0x79f5('0x3a')]);return db[_0x79f5('0x3b')][_0x79f5('0x44')](_0x60556)['then'](handleEntityNotFound(_0x519cac,null))[_0x79f5('0x23')](respondWithResult(_0x519cac,null))[_0x79f5('0x3f')](handleError(_0x519cac,null));};exports[_0x79f5('0x45')]=function(_0xc07226,_0x445516){return db[_0x79f5('0x3b')][_0x79f5('0x45')](_0xc07226[_0x79f5('0x46')],{})[_0x79f5('0x23')](function(_0x442511){var _0x3c74bb=_0xc07226[_0x79f5('0x47')][_0x79f5('0x48')]({'plain':!![]});if(!_0x3c74bb)throw new Error(_0x79f5('0x49'));if(_0x3c74bb['role']===_0x79f5('0x47')){var _0x226dc0=_0x442511['get']({'plain':!![]});var _0x5251b1=_0x79f5('0x25');return db[_0x79f5('0x4a')][_0x79f5('0x44')]({'where':{'name':_0x5251b1,'userProfileId':_0x3c74bb[_0x79f5('0x4b')]},'raw':!![]})[_0x79f5('0x23')](function(_0x33b5b3){if(_0x33b5b3&&_0x33b5b3[_0x79f5('0x4c')]===0x0){return db[_0x79f5('0x4d')]['create']({'name':_0x226dc0[_0x79f5('0x28')],'resourceId':_0x226dc0['id'],'type':_0x33b5b3[_0x79f5('0x28')],'sectionId':_0x33b5b3['id']},{})[_0x79f5('0x23')](function(){return _0x442511;});}else{return _0x442511;}})[_0x79f5('0x3f')](function(_0x41c30e){logger['error'](_0x79f5('0x4e'),_0x41c30e);throw _0x41c30e;});}return _0x442511;})[_0x79f5('0x23')](respondWithResult(_0x445516,0xc9))['catch'](handleError(_0x445516,null));};exports['update']=function(_0x3a4825,_0x3bf655){if(_0x3a4825['body']['id']){delete _0x3a4825[_0x79f5('0x46')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x3a4825['params']['id']}})[_0x79f5('0x23')](handleEntityNotFound(_0x3bf655,null))[_0x79f5('0x23')](saveUpdates(_0x3a4825[_0x79f5('0x46')],null))[_0x79f5('0x23')](respondWithResult(_0x3bf655,null))[_0x79f5('0x3f')](handleError(_0x3bf655,null));};exports[_0x79f5('0x24')]=function(_0x1455b3,_0x31c3cf){return db[_0x79f5('0x3b')][_0x79f5('0x44')]({'where':{'id':_0x1455b3['params']['id']}})[_0x79f5('0x23')](handleEntityNotFound(_0x31c3cf,null))[_0x79f5('0x23')](removeEntity(_0x31c3cf,null))['catch'](handleError(_0x31c3cf,null));};exports[_0x79f5('0x2a')]=function(_0x1306fd,_0x35e8ce){return db[_0x79f5('0x3b')][_0x79f5('0x2a')]()[_0x79f5('0x23')](respondWithResult(_0x35e8ce,null))[_0x79f5('0x3f')](handleError(_0x35e8ce,null));};exports[_0x79f5('0x4f')]=function(_0x23cff5,_0x3c858c,_0x6b915f){return db['CmContact'][_0x79f5('0x44')]({'where':{'id':_0x23cff5['params']['id']}})['then'](handleEntityNotFound(_0x3c858c,null))[_0x79f5('0x23')](function(_0x5f4c53){if(_0x5f4c53){return _0x5f4c53[_0x79f5('0x4f')](_0x23cff5['body'][_0x79f5('0x50')],_[_0x79f5('0x51')](_0x23cff5[_0x79f5('0x46')],['ids','id'])||{});}})[_0x79f5('0x23')](respondWithResult(_0x3c858c,null))['catch'](handleError(_0x3c858c,null));};exports[_0x79f5('0x52')]=function(_0x290c21,_0x30c1dd,_0x3b77fd){var _0x1d97bc={};var _0x3b36fe={};var _0x1785fe;var _0x333db7;return db[_0x79f5('0x3b')]['findOne']({'where':{'id':_0x290c21['params']['id']}})[_0x79f5('0x23')](handleEntityNotFound(_0x30c1dd,null))[_0x79f5('0x23')](function(_0x400570){if(_0x400570){_0x1785fe=_0x400570;_0x3b36fe['model']=_['keys'](db[_0x79f5('0x53')][_0x79f5('0x42')]);_0x3b36fe['query']=_[_0x79f5('0x2b')](_0x290c21[_0x79f5('0x2f')]);_0x3b36fe[_0x79f5('0x2c')]=_[_0x79f5('0x2d')](_0x3b36fe[_0x79f5('0x2e')],_0x3b36fe['query']);_0x1d97bc[_0x79f5('0x30')]=_[_0x79f5('0x2d')](_0x3b36fe['model'],qs['fields'](_0x290c21[_0x79f5('0x2f')][_0x79f5('0x31')]));_0x1d97bc[_0x79f5('0x30')]=_0x1d97bc[_0x79f5('0x30')][_0x79f5('0x32')]?_0x1d97bc[_0x79f5('0x30')]:_0x3b36fe['model'];_0x1d97bc[_0x79f5('0x34')]=qs[_0x79f5('0x35')](_0x290c21['query'][_0x79f5('0x35')]);_0x1d97bc[_0x79f5('0x36')]=qs['filters'](_[_0x79f5('0x37')](_0x290c21[_0x79f5('0x2f')],_0x3b36fe[_0x79f5('0x2c')]));if(_0x290c21[_0x79f5('0x2f')]['filter']){_0x1d97bc['where']=_['merge'](_0x1d97bc[_0x79f5('0x36')],{'$or':_[_0x79f5('0x54')](_0x1d97bc[_0x79f5('0x30')],function(_0x501c3a){var _0x546bc1={};_0x546bc1[_0x501c3a]={'$like':'%'+_0x290c21['query'][_0x79f5('0x39')]+'%'};return _0x546bc1;})});}_0x1d97bc=_[_0x79f5('0x38')]({},_0x1d97bc,_0x290c21['options']);return _0x1785fe[_0x79f5('0x52')](_0x1d97bc);}})[_0x79f5('0x23')](function(_0x5aaaa2){if(_0x5aaaa2){_0x333db7=_0x5aaaa2[_0x79f5('0x32')];if(!_0x290c21['query']['hasOwnProperty'](_0x79f5('0x33'))){_0x1d97bc['limit']=qs[_0x79f5('0x1c')](_0x290c21['query'][_0x79f5('0x1c')]);_0x1d97bc[_0x79f5('0x1a')]=qs['offset'](_0x290c21[_0x79f5('0x2f')][_0x79f5('0x1a')]);}return _0x1785fe[_0x79f5('0x52')](_0x1d97bc);}})[_0x79f5('0x23')](function(_0x5ad320){if(_0x5ad320){return _0x5ad320?{'count':_0x333db7,'rows':_0x5ad320}:null;}})['then'](respondWithResult(_0x30c1dd,null))[_0x79f5('0x3f')](handleError(_0x30c1dd,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 77b2709..40445d5 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 _0xadcd=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','moment'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xadcd,0x141));var _0xdadc=function(_0x17e3d6,_0x40ec46){_0x17e3d6=_0x17e3d6-0x0;var _0x987bbe=_0xadcd[_0x17e3d6];return _0x987bbe;};'use strict';var _=require(_0xdadc('0x0'));var util=require(_0xdadc('0x1'));var logger=require('../../config/logger')(_0xdadc('0x2'));var moment=require(_0xdadc('0x3'));var BPromise=require('bluebird');var rp=require(_0xdadc('0x4'));var fs=require('fs');var path=require(_0xdadc('0x5'));var rimraf=require(_0xdadc('0x6'));var config=require(_0xdadc('0x7'));var attributes=require(_0xdadc('0x8'));module[_0xdadc('0x9')]=function(_0x516874,_0x17614c){return _0x516874[_0xdadc('0xa')](_0xdadc('0xb'),attributes,{'tableName':_0xdadc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb215=['./cmCompany.attributes','exports','define','CmCompany','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1fe81b,_0x3cf73b){var _0xddc709=function(_0x36e5cd){while(--_0x36e5cd){_0x1fe81b['push'](_0x1fe81b['shift']());}};_0xddc709(++_0x3cf73b);}(_0xb215,0x159));var _0x5b21=function(_0x334be1,_0x567a25){_0x334be1=_0x334be1-0x0;var _0x3bc278=_0xb215[_0x334be1];return _0x3bc278;};'use strict';var _=require('lodash');var util=require(_0x5b21('0x0'));var logger=require(_0x5b21('0x1'))(_0x5b21('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5b21('0x3'));var fs=require('fs');var path=require(_0x5b21('0x4'));var rimraf=require(_0x5b21('0x5'));var config=require(_0x5b21('0x6'));var attributes=require(_0x5b21('0x7'));module[_0x5b21('0x8')]=function(_0x5c5cb5,_0x32ce2e){return _0x5c5cb5[_0x5b21('0x9')](_0x5b21('0xa'),attributes,{'tableName':'cm_companies','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 8d416e0..0a61bd5 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 _0x2b01=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','CmCompany,\x20%s,\x20%s','result','catch','util','moment','bluebird'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0x2b01,0xed));var _0x12b0=function(_0xff4115,_0x4ee874){_0xff4115=_0xff4115-0x0;var _0x271f95=_0x2b01[_0xff4115];return _0x271f95;};'use strict';var _=require('lodash');var util=require(_0x12b0('0x0'));var moment=require(_0x12b0('0x1'));var BPromise=require(_0x12b0('0x2'));var rs=require(_0x12b0('0x3'));var fs=require('fs');var Redis=require(_0x12b0('0x4'));var db=require(_0x12b0('0x5'))['db'];var utils=require(_0x12b0('0x6'));var logger=require('../../config/logger')(_0x12b0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x128afc,_0x54ea84,_0x1b29da){return new BPromise(function(_0x449c6c,_0x491a3d){return client[_0x12b0('0x8')](_0x128afc,_0x1b29da)[_0x12b0('0x9')](function(_0x5b9d06){logger[_0x12b0('0xa')]('CmCompany,\x20%s,\x20%s',_0x54ea84,_0x12b0('0xb'));logger[_0x12b0('0xc')](_0x12b0('0xd'),_0x54ea84,'request\x20sent',JSON[_0x12b0('0xe')](_0x5b9d06));if(_0x5b9d06['error']){if(_0x5b9d06[_0x12b0('0xf')]['code']===0x1f4){logger[_0x12b0('0xf')]('CmCompany,\x20%s,\x20%s',_0x54ea84,_0x5b9d06[_0x12b0('0xf')][_0x12b0('0x10')]);return _0x491a3d(_0x5b9d06[_0x12b0('0xf')][_0x12b0('0x10')]);}logger['error'](_0x12b0('0x11'),_0x54ea84,_0x5b9d06[_0x12b0('0xf')][_0x12b0('0x10')]);return _0x449c6c(_0x5b9d06['error']['message']);}else{logger[_0x12b0('0xa')](_0x12b0('0x11'),_0x54ea84,_0x12b0('0xb'));_0x449c6c(_0x5b9d06[_0x12b0('0x12')][_0x12b0('0x10')]);}})[_0x12b0('0x13')](function(_0x3ae4cd){logger['error'](_0x12b0('0x11'),_0x54ea84,_0x3ae4cd);_0x491a3d(_0x3ae4cd);});});}
\ No newline at end of file
+var _0x0e5a=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s','debug'];(function(_0x201fe8,_0x5f3725){var _0x247260=function(_0x131362){while(--_0x131362){_0x201fe8['push'](_0x201fe8['shift']());}};_0x247260(++_0x5f3725);}(_0x0e5a,0x70));var _0xa0e5=function(_0x1eb2c3,_0x2dd707){_0x1eb2c3=_0x1eb2c3-0x0;var _0x4e749d=_0x0e5a[_0x1eb2c3];return _0x4e749d;};'use strict';var _=require(_0xa0e5('0x0'));var util=require(_0xa0e5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0e5('0x2'));var fs=require('fs');var Redis=require(_0xa0e5('0x3'));var db=require(_0xa0e5('0x4'))['db'];var utils=require(_0xa0e5('0x5'));var logger=require('../../config/logger')(_0xa0e5('0x6'));var config=require(_0xa0e5('0x7'));var jayson=require(_0xa0e5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x282ff4,_0x43d41d,_0x1545c3){return new BPromise(function(_0x404c4f,_0x1b2e57){return client[_0xa0e5('0x9')](_0x282ff4,_0x1545c3)[_0xa0e5('0xa')](function(_0x39fe38){logger[_0xa0e5('0xb')](_0xa0e5('0xc'),_0x43d41d,'request\x20sent');logger[_0xa0e5('0xd')](_0xa0e5('0xe'),_0x43d41d,_0xa0e5('0xf'),JSON['stringify'](_0x39fe38));if(_0x39fe38['error']){if(_0x39fe38['error'][_0xa0e5('0x10')]===0x1f4){logger[_0xa0e5('0x11')](_0xa0e5('0xc'),_0x43d41d,_0x39fe38[_0xa0e5('0x11')]['message']);return _0x1b2e57(_0x39fe38[_0xa0e5('0x11')]['message']);}logger[_0xa0e5('0x11')](_0xa0e5('0xc'),_0x43d41d,_0x39fe38[_0xa0e5('0x11')][_0xa0e5('0x12')]);return _0x404c4f(_0x39fe38['error'][_0xa0e5('0x12')]);}else{logger[_0xa0e5('0xb')](_0xa0e5('0xc'),_0x43d41d,'request\x20sent');_0x404c4f(_0x39fe38[_0xa0e5('0x13')]['message']);}})[_0xa0e5('0x14')](function(_0x922444){logger['error'](_0xa0e5('0xc'),_0x43d41d,_0x922444);_0x1b2e57(_0x922444);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 48ad87b..bbc54d9 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 _0x39ff=['../../config/environment','./cmCompany.controller','isAuthenticated','get','/describe','show','/:id/contacts','getContacts','create','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x55febe,_0x459f86){var _0x35e354=function(_0x5c90b6){while(--_0x5c90b6){_0x55febe['push'](_0x55febe['shift']());}};_0x35e354(++_0x459f86);}(_0x39ff,0xd5));var _0xf39f=function(_0x24d2fc,_0x29f500){_0x24d2fc=_0x24d2fc-0x0;var _0x3cd97f=_0x39ff[_0x24d2fc];return _0x3cd97f;};'use strict';var multer=require(_0xf39f('0x0'));var util=require(_0xf39f('0x1'));var path=require(_0xf39f('0x2'));var timeout=require(_0xf39f('0x3'));var express=require(_0xf39f('0x4'));var router=express[_0xf39f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf39f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf39f('0x7'));var controller=require(_0xf39f('0x8'));router['get']('/',auth[_0xf39f('0x9')](),controller['index']);router[_0xf39f('0xa')](_0xf39f('0xb'),auth[_0xf39f('0x9')](),controller['describe']);router[_0xf39f('0xa')]('/:id',auth[_0xf39f('0x9')](),controller[_0xf39f('0xc')]);router[_0xf39f('0xa')](_0xf39f('0xd'),auth[_0xf39f('0x9')](),controller[_0xf39f('0xe')]);router['post']('/',auth[_0xf39f('0x9')](),controller[_0xf39f('0xf')]);router[_0xf39f('0x10')](_0xf39f('0xd'),auth[_0xf39f('0x9')](),controller['addContacts']);router['put'](_0xf39f('0x11'),auth[_0xf39f('0x9')](),controller[_0xf39f('0x12')]);router[_0xf39f('0x13')](_0xf39f('0x11'),auth[_0xf39f('0x9')](),controller[_0xf39f('0x14')]);module[_0xf39f('0x15')]=router;
\ No newline at end of file
+var _0x37a5=['show','/:id/contacts','getContacts','post','create','put','update','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0x37a5,0x107));var _0x537a=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x37a5[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x537a('0x0'));var util=require(_0x537a('0x1'));var path=require('path');var timeout=require(_0x537a('0x2'));var express=require(_0x537a('0x3'));var router=express[_0x537a('0x4')]();var fs_extra=require(_0x537a('0x5'));var auth=require(_0x537a('0x6'));var interaction=require(_0x537a('0x7'));var config=require(_0x537a('0x8'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x537a('0x9')](),controller[_0x537a('0xa')]);router[_0x537a('0xb')](_0x537a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x537a('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x537a('0xd')]);router[_0x537a('0xb')](_0x537a('0xe'),auth['isAuthenticated'](),controller[_0x537a('0xf')]);router[_0x537a('0x10')]('/',auth[_0x537a('0x9')](),controller[_0x537a('0x11')]);router[_0x537a('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x537a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x537a('0x13')]);router['delete'](_0x537a('0x14'),auth[_0x537a('0x9')](),controller[_0x537a('0x15')]);module[_0x537a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index c630206..6c8c8a9 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 _0x2193=['INTEGER','UNSIGNED','DATE','NOW','sequelize','STRING'];(function(_0x5cafe1,_0x3ab7cb){var _0x3acc70=function(_0x60081f){while(--_0x60081f){_0x5cafe1['push'](_0x5cafe1['shift']());}};_0x3acc70(++_0x3ab7cb);}(_0x2193,0x1f0));var _0x3219=function(_0x4d75af,_0x39c35a){_0x4d75af=_0x4d75af-0x0;var _0x2abbea=_0x2193[_0x4d75af];return _0x2abbea;};'use strict';var _=require('lodash');var Sequelize=require(_0x3219('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x3219('0x1')]},'street':{'type':Sequelize[_0x3219('0x1')]},'postalCode':{'type':Sequelize[_0x3219('0x1')]},'city':{'type':Sequelize[_0x3219('0x1')]},'country':{'type':Sequelize[_0x3219('0x1')]},'dateOfBirth':{'type':Sequelize[_0x3219('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3219('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3219('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x3219('0x1')]},'fb_data':{'type':Sequelize[_0x3219('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x3219('0x1')]},'viber':{'type':Sequelize[_0x3219('0x1')]},'line':{'type':Sequelize[_0x3219('0x1')]},'wechat':{'type':Sequelize[_0x3219('0x1')]},'telegram':{'type':Sequelize[_0x3219('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3219('0x2')](0x2)[_0x3219('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3219('0x4')],'defaultValue':Sequelize[_0x3219('0x5')]},'dialTimezone':{'type':Sequelize[_0x3219('0x1')]},'utcOffset':{'type':Sequelize[_0x3219('0x2')]}};
\ No newline at end of file
+var _0x6681=['UNSIGNED','DATE','NOW','exports','STRING','TEXT','INTEGER'];(function(_0x134150,_0x3bd9a8){var _0x554990=function(_0x1498c2){while(--_0x1498c2){_0x134150['push'](_0x134150['shift']());}};_0x554990(++_0x3bd9a8);}(_0x6681,0x17d));var _0x1668=function(_0x4cd69a,_0x3b6881){_0x4cd69a=_0x4cd69a-0x0;var _0x38f36c=_0x6681[_0x4cd69a];return _0x38f36c;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x1668('0x0')]={'firstName':{'type':Sequelize[_0x1668('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1668('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1668('0x1')]},'city':{'type':Sequelize[_0x1668('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1668('0x2')]},'phone':{'type':Sequelize[_0x1668('0x1')]},'mobile':{'type':Sequelize[_0x1668('0x1')]},'fax':{'type':Sequelize[_0x1668('0x1')]},'email':{'type':Sequelize[_0x1668('0x1')]},'url':{'type':Sequelize[_0x1668('0x1')]},'facebook':{'type':Sequelize[_0x1668('0x1')]},'fb_data':{'type':Sequelize[_0x1668('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x1668('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1668('0x1')]},'line':{'type':Sequelize[_0x1668('0x1')]},'wechat':{'type':Sequelize[_0x1668('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1668('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x1668('0x1')]},'priority':{'type':Sequelize[_0x1668('0x3')](0x2)[_0x1668('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1668('0x5')],'defaultValue':Sequelize[_0x1668('0x6')]},'dialTimezone':{'type':Sequelize[_0x1668('0x1')]},'utcOffset':{'type':Sequelize[_0x1668('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 3288a99..88879d6 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 _0x8d77=['OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','isNil','dialTimezone','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','ListId','findOrCreate','spread','push','contact','show','Tag','Tags','color','tag','ContactItemType','ItemType','sequelize','Phones.OrderBy','get','CmCustomField','omit','format','timezones','$and','pickBy','startsWith','map','cf_%d','isEmpty','table','cm_contacts','id\x20=\x20?','CmHopper','phone','findOne','model','rawAttributes','intersection','attributes','order','sort','filters','filter','options','getTags','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','fields','nolimit','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','rows','getHopperFinals','pick','uploadCsv','No\x20ListId\x20specified','binding_keys','socket_timestamp','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','parse','meta','import','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','error\x20child\x20process','importUpdates','message','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','starttime','endtime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','startCase','Account','closed','disposition','secondDisposition','thirdDisposition','Owner','customerIp','customerPort','deviceModel','osName','ratingType','referer','subject','substatus','openchannel','externalUrl','threadId','flatten','reverse','value','slice','moment','util','path','lodash','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./cmContact.socket','register','status','json','undefined','limit','count','offset','Content-Range','update','then','end','error','name','send','index','describe','getOptions','findAll','query','user','catch','CmContact','find','params','keys','length','cf_','columnName','displayName','analytics','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d77,0x1ae));var _0x78d7=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x8d77[_0x433a86];return _0x23000c;};'use strict';var moment=require(_0x78d7('0x0'));var BPromise=require('bluebird');var util=require(_0x78d7('0x1'));var path=require(_0x78d7('0x2'));var fs=require('fs');var _=require(_0x78d7('0x3'));var squel=require('squel');var Papa=require(_0x78d7('0x4'));var Redis=require(_0x78d7('0x5'));var contacts=require('../../components/contacts');var qs=require(_0x78d7('0x6'));var logger=require(_0x78d7('0x7'))(_0x78d7('0x8'));var config=require(_0x78d7('0x9'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x78d7('0xa')]=_[_0x78d7('0xb')](config[_0x78d7('0xa')],{'host':_0x78d7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78d7('0xa')]));require(_0x78d7('0xd'))[_0x78d7('0xe')](socket);function respondWithResult(_0x5c99f9,_0x3bd607){_0x3bd607=_0x3bd607||0xc8;return function(_0x20e34f){if(_0x20e34f){return _0x5c99f9[_0x78d7('0xf')](_0x3bd607)[_0x78d7('0x10')](_0x20e34f);}};}function respondWithFilteredResult(_0x493d57,_0xa26860){return function(_0x76b6b){if(_0x76b6b){var _0x5e0fed=typeof _0xa26860['offset']===_0x78d7('0x11')&&typeof _0xa26860[_0x78d7('0x12')]===_0x78d7('0x11');var _0x31d29c=_0x76b6b[_0x78d7('0x13')];var _0x5866b7=_0x5e0fed?0x0:_0xa26860[_0x78d7('0x14')];var _0x380f3a=_0x5e0fed?_0x76b6b['count']:_0xa26860['offset']+_0xa26860[_0x78d7('0x12')];var _0x3838db;if(_0x380f3a>=_0x31d29c){_0x380f3a=_0x31d29c;_0x3838db=0xc8;}else{_0x3838db=0xce;}_0x493d57[_0x78d7('0xf')](_0x3838db);return _0x493d57['set'](_0x78d7('0x15'),_0x5866b7+'-'+_0x380f3a+'/'+_0x31d29c)['json'](_0x76b6b);}return null;};}function saveUpdates(_0x1eba9f){return function(_0x5e0ec4){if(_0x5e0ec4){return _0x5e0ec4[_0x78d7('0x16')](_0x1eba9f)[_0x78d7('0x17')](function(_0x4d3029){return _0x4d3029;});}return null;};}function removeEntity(_0x30ab62){return function(_0xbe014e){if(_0xbe014e){return _0xbe014e['destroy']()[_0x78d7('0x17')](function(){_0x30ab62[_0x78d7('0xf')](0xcc)[_0x78d7('0x18')]();});}};}function handleEntityNotFound(_0x59caf6){return function(_0x182c20){if(!_0x182c20){_0x59caf6['sendStatus'](0x194);}return _0x182c20;};}function handleError(_0xc79c99,_0x2540f8){_0x2540f8=_0x2540f8||0x1f4;return function(_0xe88049){logger[_0x78d7('0x19')](_0xe88049['stack']);if(_0xe88049[_0x78d7('0x1a')]){delete _0xe88049[_0x78d7('0x1a')];}_0xc79c99[_0x78d7('0xf')](_0x2540f8)[_0x78d7('0x1b')](_0xe88049);};}exports[_0x78d7('0x1c')]=function(_0x83a444,_0x1ee336){var _0x57f43c={};return contacts[_0x78d7('0x1d')]()[_0x78d7('0x17')](function(_0x24055d){_0x57f43c=qs[_0x78d7('0x1e')](_0x24055d,_0x83a444);return contacts[_0x78d7('0x1f')](_0x83a444[_0x78d7('0x20')],_0x83a444[_0x78d7('0x21')],_0x57f43c,_0x24055d);})['then'](respondWithFilteredResult(_0x1ee336,_0x57f43c))[_0x78d7('0x22')](handleError(_0x1ee336,null));};exports['destroy']=function(_0x14a9ac,_0x2e2b63){return db[_0x78d7('0x23')][_0x78d7('0x24')]({'where':{'id':_0x14a9ac[_0x78d7('0x25')]['id']}})[_0x78d7('0x17')](handleEntityNotFound(_0x2e2b63,null))[_0x78d7('0x17')](removeEntity(_0x2e2b63,null))[_0x78d7('0x22')](handleError(_0x2e2b63,null));};exports[_0x78d7('0x1d')]=function(_0x55ca31,_0x1279bf){return db[_0x78d7('0x23')]['describe']()['then'](function(_0x3e0946){delete _0x3e0946['tags'];for(var _0x479d4b=0x0;_0x479d4b
','Attachments','Title','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','indexOf','split','slice','join','length','isEmpty','anonymous','html','replace'];(function(_0x3f8139,_0x4fee1f){var _0x59b49c=function(_0x1fa99b){while(--_0x1fa99b){_0x3f8139['push'](_0x3f8139['shift']());}};_0x59b49c(++_0x4fee1f);}(_0x9925,0xc3));var _0x5992=function(_0x5b4dac,_0x394fdd){_0x5b4dac=_0x5b4dac-0x0;var _0x35b20d=_0x9925[_0x5b4dac];return _0x35b20d;};'use strict';var _=require(_0x5992('0x0'));var moment=require(_0x5992('0x1'));var random=require(_0x5992('0x2'));var fs=require('fs');var path=require(_0x5992('0x3'));var util=require(_0x5992('0x4'));var tnef=require(_0x5992('0x5'));var logger=require(_0x5992('0x6'))(_0x5992('0x7'));var config=require(_0x5992('0x8'));function getAddress(_0x3158ca){var _0x354629=_[_0x5992('0x9')](_0x3158ca[_0x5992('0xa')]);return _0x354629&&_0x354629[_0x5992('0xb')]?_0x354629[_0x5992('0xb')]:'anonymous'+random[_0x5992('0xc')](0x6)+_0x5992('0xd');}function getFirstName(_0x3407ab){var _0x1d0e15=_[_0x5992('0x9')](_0x3407ab['value']);if(_0x1d0e15&&_0x1d0e15['name']){if(_0x1d0e15['name']==_0x1d0e15['address']){return _0x1d0e15[_0x5992('0xe')]['substring'](0x0,_0x1d0e15[_0x5992('0xe')][_0x5992('0xf')]('@'));}var _0xd138a8=_0x1d0e15[_0x5992('0xe')][_0x5992('0x10')](/\s+/);return _0xd138a8['length']>0x1?_0xd138a8[_0x5992('0x11')](0x0,-0x1)[_0x5992('0x12')]('\x20'):_0x1d0e15[_0x5992('0xe')];}return'Anonymous';}function getLastName(_0x4fe432){var _0x15df60=_[_0x5992('0x9')](_0x4fe432[_0x5992('0xa')]);if(_0x15df60&&_0x15df60[_0x5992('0xe')]){var _0x312927=_0x15df60[_0x5992('0xe')][_0x5992('0x10')](/\s+/);return _0x312927[_0x5992('0x13')]>0x1?_0x312927['pop']():'';}return'';}function getMails(_0x57cdae,_0x5cb248){var _0x2d5651='';for(var _0x3a4824=0x0;_0x3a4824<_0x5cb248[_0x5992('0xa')][_0x5992('0x13')];_0x3a4824+=0x1){if(_0x5cb248['value'][_0x3a4824]['address']!==_0x57cdae){if(!_[_0x5992('0x14')](_0x2d5651)){_0x2d5651+=',';}_0x2d5651+=_0x5cb248[_0x5992('0xa')][_0x3a4824]['name']||_0x5cb248[_0x5992('0xa')][_0x3a4824]['address']||'';_0x2d5651+='\x20<';_0x2d5651+=_0x5cb248[_0x5992('0xa')][_0x3a4824][_0x5992('0xb')]?_0x5cb248[_0x5992('0xa')][_0x3a4824]['address']:_0x5992('0x15')+random['generate'](0x6)+_0x5992('0xd');_0x2d5651+='>';}}return _0x2d5651;}function parseEmail(_0x342e02,_0x328cc7,_0x439b6c){if(_0x328cc7[_0x5992('0x16')]){var _0x36fd40=/