From 5433310608f7744f295a11cd25b806cc09e186f4 Mon Sep 17 00:00:00 2001
From: Fabio Lodato
Date: Tue, 24 Mar 2020 20:30:00 +0100
Subject: [PATCH] Built motion from commit (unavailable).|2.4.12
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
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 +-
.../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 +-
.../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 +-
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/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/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/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/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/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/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 +-
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/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/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 +-
.../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 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
1052 files changed, 1052 insertions(+), 1052 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f09ea42..6e7b4d5 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2020-03-24T15:29:28.522Z",
+ "time": "2020-03-24T19:18:26.798Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 05e0aa3..0a3358c 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2020-03-24T15:29:28.522Z",
+ "time": "2020-03-24T19:18:26.798Z",
"url": "http://apidocjs.com",
"version": "0.17.7"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 033175d..e367a86 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 _0x0325=['contactManager','integration','motionbar','jscripty','browser','script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','STRING'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0x0325,0x15b));var _0x5032=function(_0x20d1c0,_0x405aa6){_0x20d1c0=_0x20d1c0-0x0;var _0x5b00f2=_0x0325[_0x20d1c0];return _0x5b00f2;};'use strict';var Sequelize=require(_0x5032('0x0'));module[_0x5032('0x1')]={'name':{'type':Sequelize[_0x5032('0x2')],'get':function(_0x20f81a){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x5032('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5032('0x4'),_0x5032('0x5'),_0x5032('0x6'),_0x5032('0x7'),'urlForward',_0x5032('0x8'),'bot',_0x5032('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x5032('0x3')](0x1000),'comment':_0x5032('0xa')},'data3':{'type':Sequelize[_0x5032('0x3')](0x1000),'comment':_0x5032('0xb')},'data4':{'type':Sequelize[_0x5032('0x3')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x5032('0x3')]},'data7':{'type':Sequelize[_0x5032('0xc')]}};
\ No newline at end of file
+var _0x332e=['getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports'];(function(_0xfbf4c3,_0x30f4ea){var _0x54bf37=function(_0x52aad0){while(--_0x52aad0){_0xfbf4c3['push'](_0xfbf4c3['shift']());}};_0x54bf37(++_0x30f4ea);}(_0x332e,0x1cd));var _0xe332=function(_0x3f9f39,_0x39d8c2){_0x3f9f39=_0x3f9f39-0x0;var _0x3de0b8=_0x332e[_0x3f9f39];return _0x3de0b8;};'use strict';var Sequelize=require('sequelize');module[_0xe332('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x120a3c){return this[_0xe332('0x1')]('action');}},'action':{'type':Sequelize[_0xe332('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe332('0x3'),_0xe332('0x4'),_0xe332('0x5'),_0xe332('0x6'),_0xe332('0x7'),_0xe332('0x8'),'bot',_0xe332('0x9')]],'msg':_0xe332('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xe332('0x2')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xe332('0x2')](0x1000),'comment':_0xe332('0xb')},'data3':{'type':Sequelize[_0xe332('0x2')](0x1000),'comment':_0xe332('0xc')},'data4':{'type':Sequelize[_0xe332('0x2')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xe332('0x2')]},'data7':{'type':Sequelize[_0xe332('0xd')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index c809c17..5fd2ba1 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 _0xda3f=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','body','Action','find','catch','eml-format','rimraf','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xda3f,0xec));var _0xfda3=function(_0x19a5cc,_0x3f9bf7){_0x19a5cc=_0x19a5cc-0x0;var _0x29246c=_0xda3f[_0x19a5cc];return _0x29246c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfda3('0x0'));var rimraf=require(_0xfda3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfda3('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfda3('0x3'));var util=require(_0xfda3('0x4'));var path=require('path');var sox=require(_0xfda3('0x5'));var csv=require(_0xfda3('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x6'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var db=require(_0xfda3('0x15'))['db'];function respondWithStatusCode(_0x1443f4,_0x4b77ea){_0x4b77ea=_0x4b77ea||0xcc;return function(_0x583125){if(_0x583125){return _0x1443f4['sendStatus'](_0x4b77ea);}return _0x1443f4[_0xfda3('0x16')](_0x4b77ea)[_0xfda3('0x17')]();};}function respondWithResult(_0x4929fa,_0x501588){_0x501588=_0x501588||0xc8;return function(_0x587e9b){if(_0x587e9b){return _0x4929fa[_0xfda3('0x16')](_0x501588)[_0xfda3('0x18')](_0x587e9b);}};}function respondWithFilteredResult(_0x5ea793,_0x57a229){return function(_0x533365){if(_0x533365){var _0x80ea80=_0x533365[_0xfda3('0x19')],_0x474707=_0x57a229[_0xfda3('0x1a')],_0x249dc6=_0x57a229[_0xfda3('0x1a')]+_0x57a229[_0xfda3('0x1b')],_0x3d8bcd;if(_0x249dc6>=_0x80ea80){_0x249dc6=_0x80ea80;_0x3d8bcd=0xc8;}else{_0x3d8bcd=0xce;}_0x5ea793[_0xfda3('0x16')](_0x3d8bcd);return _0x5ea793[_0xfda3('0x1c')]('Content-Range',_0x474707+'-'+_0x249dc6+'/'+_0x80ea80)[_0xfda3('0x18')](_0x533365);}return null;};}function patchUpdates(_0x1bbdda){return function(_0x12d568){try{jsonpatch[_0xfda3('0x1d')](_0x12d568,_0x1bbdda,!![]);}catch(_0x59a887){return BPromise[_0xfda3('0x1e')](_0x59a887);}return _0x12d568[_0xfda3('0x1f')]();};}function saveUpdates(_0x2ee74c,_0x51e731){return function(_0x5ad52a){if(_0x5ad52a){return _0x5ad52a[_0xfda3('0x20')](_0x2ee74c)[_0xfda3('0x21')](function(_0x4ea9f5){return _0x4ea9f5;});}return null;};}function removeEntity(_0x545320,_0x3cf5a9){return function(_0xef2535){if(_0xef2535){return _0xef2535[_0xfda3('0x22')]()[_0xfda3('0x21')](function(){_0x545320[_0xfda3('0x16')](0xcc)[_0xfda3('0x17')]();});}};}function handleEntityNotFound(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(!_0x16eaa6){_0x2677f6['sendStatus'](0x194);}return _0x16eaa6;};}function handleError(_0x82341b,_0x2d5b44){_0x2d5b44=_0x2d5b44||0x1f4;return function(_0x2e8bf8){logger['error'](_0x2e8bf8[_0xfda3('0x23')]);if(_0x2e8bf8[_0xfda3('0x24')]){delete _0x2e8bf8[_0xfda3('0x24')];}_0x82341b[_0xfda3('0x16')](_0x2d5b44)[_0xfda3('0x25')](_0x2e8bf8);};}exports[_0xfda3('0x20')]=function(_0x514d2a,_0x3c6d7d){if(_0x514d2a[_0xfda3('0x26')]['id']){delete _0x514d2a[_0xfda3('0x26')]['id'];}return db[_0xfda3('0x27')][_0xfda3('0x28')]({'where':{'id':_0x514d2a['params']['id']}})[_0xfda3('0x21')](handleEntityNotFound(_0x3c6d7d,null))[_0xfda3('0x21')](saveUpdates(_0x514d2a[_0xfda3('0x26')],null))[_0xfda3('0x21')](respondWithResult(_0x3c6d7d,null))[_0xfda3('0x29')](handleError(_0x3c6d7d,null));};exports[_0xfda3('0x22')]=function(_0x26e544,_0x538902){return db['Action'][_0xfda3('0x28')]({'where':{'id':_0x26e544['params']['id']}})['then'](handleEntityNotFound(_0x538902,null))[_0xfda3('0x21')](removeEntity(_0x538902,null))[_0xfda3('0x29')](handleError(_0x538902,null));};
\ No newline at end of file
+var _0xe706=['set','Content-Range','apply','reject','save','update','then','stack','name','send','body','Action','find','params','catch','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe706,0xa3));var _0x6e70=function(_0x580cea,_0x41fab5){_0x580cea=_0x580cea-0x0;var _0x5311c8=_0xe706[_0x580cea];return _0x5311c8;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x26')]=function(_0x4a67ac,_0x54a5fe){if(_0x4a67ac[_0x6e70('0x2b')]['id']){delete _0x4a67ac[_0x6e70('0x2b')]['id'];}return db[_0x6e70('0x2c')][_0x6e70('0x2d')]({'where':{'id':_0x4a67ac[_0x6e70('0x2e')]['id']}})['then'](handleEntityNotFound(_0x54a5fe,null))[_0x6e70('0x27')](saveUpdates(_0x4a67ac[_0x6e70('0x2b')],null))[_0x6e70('0x27')](respondWithResult(_0x54a5fe,null))[_0x6e70('0x2f')](handleError(_0x54a5fe,null));};exports[_0x6e70('0x30')]=function(_0x20a225,_0x3f78d2){return db[_0x6e70('0x2c')][_0x6e70('0x2d')]({'where':{'id':_0x20a225[_0x6e70('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3f78d2,null))[_0x6e70('0x27')](removeEntity(_0x3f78d2,null))['catch'](handleError(_0x3f78d2,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 32343fe..f1ff987 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 _0x250b=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x250b,0x166));var _0xb250=function(_0x5628b2,_0x223018){_0x5628b2=_0x5628b2-0x0;var _0x2174a7=_0x250b[_0x5628b2];return _0x2174a7;};'use strict';var _=require('lodash');var util=require(_0xb250('0x0'));var logger=require(_0xb250('0x1'))('api');var moment=require(_0xb250('0x2'));var BPromise=require(_0xb250('0x3'));var rp=require(_0xb250('0x4'));var fs=require('fs');var path=require(_0xb250('0x5'));var rimraf=require(_0xb250('0x6'));var config=require(_0xb250('0x7'));var attributes=require(_0xb250('0x8'));module[_0xb250('0x9')]=function(_0x3fbe41,_0x33a317){return _0x3fbe41[_0xb250('0xa')](_0xb250('0xb'),attributes,{'tableName':_0xb250('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda85=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','tools_actions','lodash'];(function(_0x301b7a,_0x55fdd0){var _0x1e2fab=function(_0x1d87d1){while(--_0x1d87d1){_0x301b7a['push'](_0x301b7a['shift']());}};_0x1e2fab(++_0x55fdd0);}(_0xda85,0x144));var _0x5da8=function(_0x11efe8,_0xe6ad7e){_0x11efe8=_0x11efe8-0x0;var _0x5954b8=_0xda85[_0x11efe8];return _0x5954b8;};'use strict';var _=require(_0x5da8('0x0'));var util=require(_0x5da8('0x1'));var logger=require(_0x5da8('0x2'))(_0x5da8('0x3'));var moment=require(_0x5da8('0x4'));var BPromise=require(_0x5da8('0x5'));var rp=require(_0x5da8('0x6'));var fs=require('fs');var path=require(_0x5da8('0x7'));var rimraf=require(_0x5da8('0x8'));var config=require(_0x5da8('0x9'));var attributes=require('./action.attributes');module[_0x5da8('0xa')]=function(_0x3ba8d4,_0x35b59f){return _0x3ba8d4['define'](_0x5da8('0xb'),attributes,{'tableName':_0x5da8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 0d3a498..b54d3a5 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x194cb5,_0x479e8a){var _0x55db4b=function(_0x2c8192){while(--_0x2c8192){_0x194cb5['push'](_0x194cb5['shift']());}};_0x55db4b(++_0x479e8a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
+var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index c72b6bd..bbaf06b 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 _0x52a7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','destroy','exports','util','connect-timeout','express','Router'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x52a7,0x127));var _0x752a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x52a7[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x752a('0x0'));var path=require('path');var timeout=require(_0x752a('0x1'));var express=require(_0x752a('0x2'));var router=express[_0x752a('0x3')]();var auth=require(_0x752a('0x4'));var interaction=require(_0x752a('0x5'));var config=require(_0x752a('0x6'));var controller=require(_0x752a('0x7'));router[_0x752a('0x8')]('/:id',auth[_0x752a('0x9')](),controller[_0x752a('0xa')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x752a('0xb')]);module[_0x752a('0xc')]=router;
\ No newline at end of file
+var _0x8d06=['isAuthenticated','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./action.controller','update','delete','/:id'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x8d06,0x1b5));var _0x68d0=function(_0x2d9fd5,_0x38ba6e){_0x2d9fd5=_0x2d9fd5-0x0;var _0x451089=_0x8d06[_0x2d9fd5];return _0x451089;};'use strict';var multer=require(_0x68d0('0x0'));var util=require(_0x68d0('0x1'));var path=require(_0x68d0('0x2'));var timeout=require('connect-timeout');var express=require(_0x68d0('0x3'));var router=express[_0x68d0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x68d0('0x5'));var config=require(_0x68d0('0x6'));var controller=require(_0x68d0('0x7'));router['put']('/:id',auth['isAuthenticated'](),controller[_0x68d0('0x8')]);router[_0x68d0('0x9')](_0x68d0('0xa'),auth[_0x68d0('0xb')](),controller[_0x68d0('0xc')]);module[_0x68d0('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 0d7e314..644435f 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 _0x73af=['sequelize','STRING','TEXT'];(function(_0x5a0ef5,_0x565082){var _0x2b2487=function(_0x3198ef){while(--_0x3198ef){_0x5a0ef5['push'](_0x5a0ef5['shift']());}};_0x2b2487(++_0x565082);}(_0x73af,0x153));var _0xf73a=function(_0x18f784,_0x2a538f){_0x18f784=_0x18f784-0x0;var _0x4cd072=_0x73af[_0x18f784];return _0x4cd072;};'use strict';var Sequelize=require(_0xf73a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xf73a('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xf73a('0x2')]}};
\ No newline at end of file
+var _0x6668=['sequelize','exports','STRING','TEXT'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x6668,0x1ac));var _0x8666=function(_0x38f737,_0x54f685){_0x38f737=_0x38f737-0x0;var _0x7afda3=_0x6668[_0x38f737];return _0x7afda3;};'use strict';var Sequelize=require(_0x8666('0x0'));module[_0x8666('0x1')]={'name':{'type':Sequelize[_0x8666('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8666('0x2')]},'parent':{'type':Sequelize[_0x8666('0x2')]},'table':{'type':Sequelize[_0x8666('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8666('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index a6f3be5..3e63142 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 _0x6aa7=['group','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','AVG(%s)','HOUR(%s)','Sequelize','from','SELECT','No\x20available\x20data','output','%s-%s.%s','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','getFields','DESC','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','index','AnalyticCustomReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','role','user','Reports','userProfileId','autoAssociation','params','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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','operator'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0x6aa7,0x178));var _0x76aa=function(_0x2ac959,_0x2d5bba){_0x2ac959=_0x2ac959-0x0;var _0x5acb43=_0x6aa7[_0x2ac959];return _0x5acb43;};'use strict';var pdf=require(_0x76aa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x76aa('0x1'));var zipdir=require(_0x76aa('0x2'));var jsonpatch=require(_0x76aa('0x3'));var rp=require(_0x76aa('0x4'));var moment=require('moment');var BPromise=require(_0x76aa('0x5'));var Mustache=require(_0x76aa('0x6'));var util=require(_0x76aa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x76aa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0x8'));var querystring=require(_0x76aa('0xd'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xe'));var authService=require(_0x76aa('0xf'));var qs=require(_0x76aa('0x10'));var as=require(_0x76aa('0x11'));var hardwareService=require(_0x76aa('0x12'));var logger=require(_0x76aa('0x13'))(_0x76aa('0x14'));var utils=require(_0x76aa('0x15'));var config=require(_0x76aa('0x16'));var db=require(_0x76aa('0x17'))['db'];function respondWithStatusCode(_0x5e5f47,_0x112c39){_0x112c39=_0x112c39||0xcc;return function(_0x5df49c){if(_0x5df49c){return _0x5e5f47[_0x76aa('0x18')](_0x112c39);}return _0x5e5f47[_0x76aa('0x19')](_0x112c39)[_0x76aa('0x1a')]();};}function respondWithResult(_0x8e44ed,_0x10432c){_0x10432c=_0x10432c||0xc8;return function(_0x4e309f){if(_0x4e309f){return _0x8e44ed['status'](_0x10432c)[_0x76aa('0x1b')](_0x4e309f);}};}function respondWithFilteredResult(_0x4cfc34,_0x180d92){return function(_0x319bf1){if(_0x319bf1){var _0x5cf594=_0x319bf1['count'],_0x2111c7=_0x180d92[_0x76aa('0x1c')],_0x550d9a=_0x180d92[_0x76aa('0x1c')]+_0x180d92[_0x76aa('0x1d')],_0x328381;if(_0x550d9a>=_0x5cf594){_0x550d9a=_0x5cf594;_0x328381=0xc8;}else{_0x328381=0xce;}_0x4cfc34[_0x76aa('0x19')](_0x328381);return _0x4cfc34[_0x76aa('0x1e')](_0x76aa('0x1f'),_0x2111c7+'-'+_0x550d9a+'/'+_0x5cf594)['json'](_0x319bf1);}return null;};}function patchUpdates(_0x5d6202){return function(_0x256636){try{jsonpatch[_0x76aa('0x20')](_0x256636,_0x5d6202,!![]);}catch(_0xf0711){return BPromise[_0x76aa('0x21')](_0xf0711);}return _0x256636[_0x76aa('0x22')]();};}function saveUpdates(_0x191560,_0x19af92){return function(_0x2eaf48){if(_0x2eaf48){return _0x2eaf48[_0x76aa('0x23')](_0x191560)['then'](function(_0x39ac5a){return _0x39ac5a;});}return null;};}function removeEntity(_0x21064c,_0x338a6b){return function(_0x5b3f55){if(_0x5b3f55){return _0x5b3f55[_0x76aa('0x24')]()[_0x76aa('0x25')](function(){var _0x31252f=_0x5b3f55[_0x76aa('0x26')]({'plain':!![]});var _0x29c50c=_0x76aa('0x27');return db[_0x76aa('0x28')][_0x76aa('0x24')]({'where':{'type':_0x29c50c,'resourceId':_0x31252f['id']}})[_0x76aa('0x25')](function(){return _0x5b3f55;});})[_0x76aa('0x25')](function(){_0x21064c[_0x76aa('0x19')](0xcc)[_0x76aa('0x1a')]();});}};}function handleEntityNotFound(_0x3599a9,_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x3599a9[_0x76aa('0x18')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x29')](_0xa1e6[_0x76aa('0x2a')]);if(_0xa1e6[_0x76aa('0x2b')]){delete _0xa1e6[_0x76aa('0x2b')];}_0x25c614[_0x76aa('0x19')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x2c')]=function(_0x5a8030,_0x994550){var _0x365ff8={},_0x2dec94={},_0x1e90b9={'count':0x0,'rows':[]};var _0x1eecd9=db[_0x76aa('0x2d')][_0x76aa('0x2e')];_0x2dec94[_0x76aa('0x2f')]=_[_0x76aa('0x30')](_0x1eecd9);_0x2dec94[_0x76aa('0x31')]=_['keys'](_0x5a8030[_0x76aa('0x31')]);_0x2dec94[_0x76aa('0x32')]=_[_0x76aa('0x33')](_0x2dec94[_0x76aa('0x2f')],_0x2dec94[_0x76aa('0x31')]);_0x365ff8[_0x76aa('0x34')]=_[_0x76aa('0x33')](_0x2dec94['model'],qs[_0x76aa('0x35')](_0x5a8030[_0x76aa('0x31')]['fields']));_0x365ff8[_0x76aa('0x34')]=_0x365ff8['attributes'][_0x76aa('0x36')]?_0x365ff8['attributes']:_0x2dec94[_0x76aa('0x2f')];if(!_0x5a8030['query']['hasOwnProperty'](_0x76aa('0x37'))){_0x365ff8[_0x76aa('0x1d')]=qs[_0x76aa('0x1d')](_0x5a8030[_0x76aa('0x31')]['limit']);_0x365ff8['offset']=qs[_0x76aa('0x1c')](_0x5a8030[_0x76aa('0x31')][_0x76aa('0x1c')]);}_0x365ff8[_0x76aa('0x38')]=qs[_0x76aa('0x39')](_0x5a8030['query'][_0x76aa('0x39')]);_0x365ff8['where']=qs['filters'](_[_0x76aa('0x3a')](_0x5a8030[_0x76aa('0x31')],_0x2dec94[_0x76aa('0x32')]));if(_0x5a8030[_0x76aa('0x31')]['filter']){_0x365ff8[_0x76aa('0x3b')]=_[_0x76aa('0x3c')](_0x365ff8[_0x76aa('0x3b')],{'$or':_['map'](_0x1eecd9,function(_0x113770){if(_0x113770[_0x76aa('0x3d')][_0x76aa('0x3e')]!==_0x76aa('0x3f')){var _0x45d7b3={};_0x45d7b3[_0x113770[_0x76aa('0x40')]]={'$like':'%'+_0x5a8030[_0x76aa('0x31')][_0x76aa('0x41')]+'%'};return _0x45d7b3;}})});}_0x365ff8=_[_0x76aa('0x3c')]({},_0x365ff8,_0x5a8030['options']);var _0x1525cb={'where':_0x365ff8[_0x76aa('0x3b')]};return db[_0x76aa('0x2d')][_0x76aa('0x42')](_0x1525cb)[_0x76aa('0x25')](function(_0x2957aa){_0x1e90b9['count']=_0x2957aa;if(_0x5a8030['query'][_0x76aa('0x43')]){_0x365ff8[_0x76aa('0x44')]=[{'all':!![]}];}return db[_0x76aa('0x2d')][_0x76aa('0x45')](_0x365ff8);})['then'](function(_0x174a14){_0x1e90b9[_0x76aa('0x46')]=_0x174a14;return _0x1e90b9;})[_0x76aa('0x25')](respondWithFilteredResult(_0x994550,_0x365ff8))[_0x76aa('0x47')](handleError(_0x994550,null));};exports[_0x76aa('0x48')]=function(_0x4aa2f3,_0x13dafe){var _0x556f59={'raw':![],'where':{'id':_0x4aa2f3['params']['id']}},_0xbb3136={};_0xbb3136['model']=_['keys'](db[_0x76aa('0x2d')]['rawAttributes']);_0xbb3136['query']=_['keys'](_0x4aa2f3[_0x76aa('0x31')]);_0xbb3136[_0x76aa('0x32')]=_[_0x76aa('0x33')](_0xbb3136[_0x76aa('0x2f')],_0xbb3136[_0x76aa('0x31')]);_0x556f59['attributes']=_[_0x76aa('0x33')](_0xbb3136[_0x76aa('0x2f')],qs[_0x76aa('0x35')](_0x4aa2f3[_0x76aa('0x31')][_0x76aa('0x35')]));_0x556f59['attributes']=_0x556f59[_0x76aa('0x34')][_0x76aa('0x36')]?_0x556f59['attributes']:_0xbb3136[_0x76aa('0x2f')];if(_0x4aa2f3['query'][_0x76aa('0x43')]){_0x556f59[_0x76aa('0x44')]=[{'all':!![]}];}_0x556f59=_[_0x76aa('0x3c')]({},_0x556f59,_0x4aa2f3[_0x76aa('0x49')]);return db[_0x76aa('0x2d')][_0x76aa('0x4a')](_0x556f59)[_0x76aa('0x25')](handleEntityNotFound(_0x13dafe,null))[_0x76aa('0x25')](respondWithResult(_0x13dafe,null))[_0x76aa('0x47')](handleError(_0x13dafe,null));};exports[_0x76aa('0x4b')]=function(_0x5e4967,_0xbbd734){return db['AnalyticCustomReport'][_0x76aa('0x4b')](_0x5e4967[_0x76aa('0x4c')],{})[_0x76aa('0x25')](function(_0x156d4e){var _0x5ca721=_0x5e4967['user'][_0x76aa('0x26')]({'plain':!![]});if(!_0x5ca721)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ca721[_0x76aa('0x4d')]===_0x76aa('0x4e')){var _0x4315b3=_0x156d4e[_0x76aa('0x26')]({'plain':!![]});var _0x30c577=_0x76aa('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x30c577,'userProfileId':_0x5ca721[_0x76aa('0x50')]},'raw':!![]})[_0x76aa('0x25')](function(_0x1708d4){if(_0x1708d4&&_0x1708d4[_0x76aa('0x51')]===0x0){return db[_0x76aa('0x28')][_0x76aa('0x4b')]({'name':_0x4315b3['name'],'resourceId':_0x4315b3['id'],'type':_0x76aa('0x27'),'sectionId':_0x1708d4['id']},{})[_0x76aa('0x25')](function(){return _0x156d4e;});}else{return _0x156d4e;}})[_0x76aa('0x47')](function(_0x4b3d2a){logger[_0x76aa('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b3d2a);throw _0x4b3d2a;});}return _0x156d4e;})[_0x76aa('0x25')](respondWithResult(_0xbbd734,0xc9))['catch'](handleError(_0xbbd734,null));};exports[_0x76aa('0x23')]=function(_0x4449c1,_0x3c63e5){if(_0x4449c1[_0x76aa('0x4c')]['id']){delete _0x4449c1[_0x76aa('0x4c')]['id'];}return db[_0x76aa('0x2d')][_0x76aa('0x4a')]({'where':{'id':_0x4449c1['params']['id']}})[_0x76aa('0x25')](handleEntityNotFound(_0x3c63e5,null))['then'](saveUpdates(_0x4449c1[_0x76aa('0x4c')],null))[_0x76aa('0x25')](respondWithResult(_0x3c63e5,null))[_0x76aa('0x47')](handleError(_0x3c63e5,null));};exports[_0x76aa('0x24')]=function(_0x3fa7ec,_0x28f8aa){return db[_0x76aa('0x2d')]['find']({'where':{'id':_0x3fa7ec[_0x76aa('0x52')]['id']}})[_0x76aa('0x25')](handleEntityNotFound(_0x28f8aa,null))[_0x76aa('0x25')](removeEntity(_0x28f8aa,null))[_0x76aa('0x47')](handleError(_0x28f8aa,null));};exports['preview']=function(_0xb9401b,_0x163440){var _0x8dc601=0xa;var _0x410933=[_0x76aa('0x53'),_0x76aa('0x54'),'right_join',_0x76aa('0x55')];var _0xbf78c7={'SUM':_0x76aa('0x56'),'COUNT':_0x76aa('0x57'),'COUNT DISTINCT':_0x76aa('0x58'),'MAX':_0x76aa('0x59'),'MIN':_0x76aa('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x76aa('0x5b'),'GROUP_CONCAT DESC':_0x76aa('0x5c')};var _0x5713e7={'SEC_TO_TIME':_0x76aa('0x5d'),'DATE':_0x76aa('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x76aa('0x5f'),'UNIX_TIMESTAMP':_0x76aa('0x60')};var _0x1928c2=function(_0x22de7c){return!_[_0x76aa('0x61')]([_0x76aa('0x62'),_0x76aa('0x63'),_0x76aa('0x64'),_0x76aa('0x65')],_0x22de7c);};var _0x57d778=function(_0xd337f0){if(!_0xd337f0||!_0xd337f0['rules'][_0x76aa('0x36')]){return'';}for(var _0x46dbac='(',_0x2fef92=0x0;_0x2fef92<_0xd337f0[_0x76aa('0x66')][_0x76aa('0x36')];_0x2fef92+=0x1){_0x2fef92>0x0&&(_0x46dbac+='\x20'+_0xd337f0[_0x76aa('0x67')]+'\x20');_0x46dbac+=_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x68')]?_0x57d778(_0xd337f0[_0x76aa('0x66')][_0x2fef92]['group']):_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x40')]+'\x20'+_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x69')]+(_0x1928c2(_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x69')])?'\x20'+_0xd337f0[_0x76aa('0x66')][_0x2fef92][_0x76aa('0x6a')]:'');}return _0x46dbac+')';};var _0x5546b6={'where':{'id':_0xb9401b[_0x76aa('0x52')]['id']}},_0x364d05,_0x4d3ad0,_0x35bd2b,_0x35881c,_0x3e97f8;_0x5546b6=_[_0x76aa('0x3c')]({},_0x5546b6,_0xb9401b[_0x76aa('0x49')]);return db[_0x76aa('0x2d')]['find'](_0x5546b6)[_0x76aa('0x25')](function(_0x23e616){if(_0x23e616){_0x364d05=_0x23e616;return _0x23e616['getFields']();}return null;})['then'](function(_0x40429c){if(_0x40429c){if(!_0x40429c[_0x76aa('0x36')]){throw new db['Sequelize'][(_0x76aa('0x6b'))](_0x76aa('0x6c'),0x193);}_0x4d3ad0=_0x40429c;return db[_0x76aa('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x76aa('0x25')](function(_0x47f733){if(_0x47f733){_0x35bd2b=_[_0x76aa('0x6e')](_0x47f733,'id');var _0x1178e5;var _0x2315cf=squel[_0x76aa('0x6f')]();_0x2315cf['from'](_0x364d05['table']);for(var _0x40b8f4=0x0;_0x40b8f4<_0x4d3ad0['length'];_0x40b8f4+=0x1){_0x1178e5=_0x4d3ad0[_0x40b8f4][_0x76aa('0x70')]?_0x35bd2b[_0x4d3ad0[_0x40b8f4][_0x76aa('0x70')]][_0x76aa('0x71')]:_0x4d3ad0[_0x40b8f4][_0x76aa('0x40')];_0x1178e5=_0x4d3ad0[_0x40b8f4][_0x76aa('0x72')]?_[_0x76aa('0x73')](_0xbf78c7[_0x4d3ad0[_0x40b8f4][_0x76aa('0x72')]],'%s',_0x1178e5):_0x1178e5;_0x1178e5=_0x4d3ad0[_0x40b8f4][_0x76aa('0x74')]?_[_0x76aa('0x73')](_0x5713e7[_0x4d3ad0[_0x40b8f4]['format']],'%s',_0x1178e5):_0x1178e5;if(_0x4d3ad0[_0x40b8f4][_0x76aa('0x75')]){_0x2315cf[_0x76aa('0x68')](_0x1178e5);}_0x4d3ad0[_0x40b8f4][_0x76aa('0x76')]&&_0x2315cf[_0x76aa('0x38')](_0x1178e5,_0x4d3ad0[_0x40b8f4]['orderBy']==='DESC'?![]:!![]);_0x2315cf['field'](_0x1178e5,_0x4d3ad0[_0x40b8f4][_0x76aa('0x77')]||_0x1178e5);}if(_0x364d05['joins']){_0x364d05[_0x76aa('0x78')]=JSON[_0x76aa('0x79')](_0x364d05[_0x76aa('0x78')]);for(var _0x3e62b4=0x0;_0x3e62b4<_0x364d05['joins'][_0x76aa('0x36')];_0x3e62b4+=0x1){if(_0x364d05['joins'][_0x3e62b4][_0x76aa('0x3d')]&&_[_0x76aa('0x61')](_0x410933,_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x3d')])&&_0x364d05[_0x76aa('0x78')][_0x3e62b4]['parentKey']&&_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7a')]&&_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7b')]){_0x2315cf[_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x3d')]](_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7a')],null,util['format'](_0x76aa('0x7c'),_0x364d05[_0x76aa('0x7d')],_0x364d05['joins'][_0x3e62b4][_0x76aa('0x7e')],_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7a')],_0x364d05[_0x76aa('0x78')][_0x3e62b4][_0x76aa('0x7b')]));}}}if(_0x364d05[_0x76aa('0x7f')]){_0x364d05[_0x76aa('0x7f')]=JSON['parse'](_0x364d05[_0x76aa('0x7f')]);_0x2315cf['where'](_0x57d778(_0x364d05['conditions'][_0x76aa('0x68')]));}_0x3e97f8=_0x2315cf[_0x76aa('0x80')]();_0x2315cf['limit'](_0x8dc601);_0x2315cf['offset'](0x0);logger[_0x76aa('0x81')](_0x76aa('0x82'),_0x2315cf[_0x76aa('0x83')]());return db['sequelize']['query'](_0x2315cf[_0x76aa('0x83')](),{'type':db[_0x76aa('0x84')][_0x76aa('0x85')]['SELECT']});}})[_0x76aa('0x25')](respondWithResult(_0x163440,null))['catch'](handleError(_0x163440,null));};function runReport(_0x521bae,_0x306cc6,_0x383290){var _0x325ffa=_0x306cc6[_0x76aa('0x2b')];var _0x486d86=0xa;var _0x5a79ba=[_0x76aa('0x53'),_0x76aa('0x54'),_0x76aa('0x86'),'cross_join'];var _0x424638={'SUM':_0x76aa('0x56'),'COUNT':_0x76aa('0x57'),'COUNT DISTINCT':_0x76aa('0x58'),'MAX':_0x76aa('0x59'),'MIN':'MIN(%s)','AVG':_0x76aa('0x87'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x76aa('0x5b'),'GROUP_CONCAT DESC':_0x76aa('0x5c')};var _0x2785e4={'SEC_TO_TIME':_0x76aa('0x5d'),'DATE':_0x76aa('0x5e'),'HOUR':_0x76aa('0x88'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x547411=function(_0x47dd29){return!_['includes']([_0x76aa('0x62'),_0x76aa('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x47dd29);};var _0x4f01e9=function(_0x3a6326){if(!_0x3a6326||!_0x3a6326[_0x76aa('0x66')][_0x76aa('0x36')]){return'';}for(var _0x506a41='(',_0x48671a=0x0;_0x48671a<_0x3a6326[_0x76aa('0x66')][_0x76aa('0x36')];_0x48671a+=0x1){_0x48671a>0x0&&(_0x506a41+='\x20'+_0x3a6326[_0x76aa('0x67')]+'\x20');_0x506a41+=_0x3a6326[_0x76aa('0x66')][_0x48671a][_0x76aa('0x68')]?_0x4f01e9(_0x3a6326['rules'][_0x48671a]['group']):_0x3a6326[_0x76aa('0x66')][_0x48671a]['field']+'\x20'+_0x3a6326['rules'][_0x48671a]['condition']+(_0x547411(_0x3a6326[_0x76aa('0x66')][_0x48671a][_0x76aa('0x69')])?'\x20'+_0x3a6326['rules'][_0x48671a][_0x76aa('0x6a')]:'');}return _0x506a41+')';};var _0x2da63b={'where':{'id':_0x521bae['id']}},_0x59f9d7,_0x22063f,_0x24331a,_0x11d91f,_0x258e5a;_0x2da63b=_[_0x76aa('0x3c')]({},_0x2da63b,_0x383290);return db[_0x76aa('0x2d')][_0x76aa('0x4a')](_0x2da63b)[_0x76aa('0x25')](function(_0x2243be){if(_0x2243be){_0x59f9d7=_0x2243be;return _0x2243be['getFields']();}return null;})[_0x76aa('0x25')](function(_0xc877b1){if(_0xc877b1){if(!_0xc877b1['length']){throw new db[(_0x76aa('0x89'))][(_0x76aa('0x6b'))](_0x76aa('0x6c'),0x193);}_0x22063f=_0xc877b1;return db['AnalyticMetric'][_0x76aa('0x45')]({'raw':!![]});}return null;})[_0x76aa('0x25')](function(_0x4df4e0){if(_0x4df4e0){_0x24331a=_[_0x76aa('0x6e')](_0x4df4e0,'id');var _0x3320a2;var _0x203b1f=squel['select']();_0x203b1f[_0x76aa('0x8a')](_0x59f9d7[_0x76aa('0x7d')]);for(var _0x50a51f=0x0;_0x50a51f<_0x22063f['length'];_0x50a51f+=0x1){_0x3320a2=_0x22063f[_0x50a51f]['MetricId']?_0x24331a[_0x22063f[_0x50a51f][_0x76aa('0x70')]][_0x76aa('0x71')]:_0x22063f[_0x50a51f][_0x76aa('0x40')];_0x3320a2=_0x22063f[_0x50a51f][_0x76aa('0x72')]?_['replace'](_0x424638[_0x22063f[_0x50a51f]['function']],'%s',_0x3320a2):_0x3320a2;_0x3320a2=_0x22063f[_0x50a51f]['format']?_[_0x76aa('0x73')](_0x2785e4[_0x22063f[_0x50a51f]['format']],'%s',_0x3320a2):_0x3320a2;if(_0x22063f[_0x50a51f][_0x76aa('0x75')]){_0x203b1f[_0x76aa('0x68')](_0x3320a2);}_0x22063f[_0x50a51f]['orderBy']&&_0x203b1f[_0x76aa('0x38')](_0x3320a2,_0x22063f[_0x50a51f][_0x76aa('0x76')]==='DESC'?![]:!![]);_0x203b1f[_0x76aa('0x40')](_0x3320a2,_0x22063f[_0x50a51f][_0x76aa('0x77')]||_0x3320a2);}if(_0x59f9d7[_0x76aa('0x78')]){_0x59f9d7[_0x76aa('0x78')]=JSON[_0x76aa('0x79')](_0x59f9d7[_0x76aa('0x78')]);for(var _0x4aee18=0x0;_0x4aee18<_0x59f9d7[_0x76aa('0x78')]['length'];_0x4aee18+=0x1){if(_0x59f9d7['joins'][_0x4aee18]['type']&&_['includes'](_0x5a79ba,_0x59f9d7['joins'][_0x4aee18][_0x76aa('0x3d')])&&_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7e')]&&_0x59f9d7[_0x76aa('0x78')][_0x4aee18]['foreignTable']&&_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7b')]){_0x203b1f[_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x3d')]](_0x59f9d7[_0x76aa('0x78')][_0x4aee18]['foreignTable'],null,util[_0x76aa('0x74')](_0x76aa('0x7c'),_0x59f9d7[_0x76aa('0x7d')],_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7e')],_0x59f9d7[_0x76aa('0x78')][_0x4aee18][_0x76aa('0x7a')],_0x59f9d7['joins'][_0x4aee18][_0x76aa('0x7b')]));}}}if(_0x59f9d7[_0x76aa('0x7f')]){_0x59f9d7['conditions']=JSON['parse'](_0x59f9d7[_0x76aa('0x7f')]);_0x203b1f[_0x76aa('0x3b')](_0x4f01e9(_0x59f9d7['conditions'][_0x76aa('0x68')]));}_0x258e5a=_0x203b1f['clone']();_0x203b1f[_0x76aa('0x1d')](_0x486d86);_0x203b1f['offset'](0x0);logger[_0x76aa('0x81')](_0x76aa('0x82'),_0x203b1f[_0x76aa('0x83')]());return db[_0x76aa('0x84')][_0x76aa('0x31')](_0x203b1f['toString'](),{'type':db[_0x76aa('0x84')]['QueryTypes'][_0x76aa('0x8b')]});}})[_0x76aa('0x25')](function(_0x53ea01){if(!_0x53ea01['length']){throw new db[(_0x76aa('0x89'))][(_0x76aa('0x6b'))](_0x76aa('0x8c'),0xcc);}if(_0x306cc6[_0x76aa('0x8d')]==='web'){return null;}var _0x5a1577=_[_0x76aa('0x3c')](_0x306cc6,{'name':_0x306cc6['fullPath']||_0x306cc6[_0x76aa('0x2b')]||_0x59f9d7['name'],'basename':_0x325ffa,'savename':util[_0x76aa('0x74')](_0x76aa('0x8e'),_0x306cc6['name']||_0x59f9d7[_0x76aa('0x2b')],require('randomstring')['generate'](0x4),_0x306cc6[_0x76aa('0x8d')]||_0x76aa('0x8f')),'reportId':_0x59f9d7['id'],'reportType':'custom'});return db[_0x76aa('0x90')][_0x76aa('0x4b')](_0x5a1577,{'raw':!![]});})[_0x76aa('0x25')](function(_0x52762c){if(_0x59f9d7[_0x76aa('0x7d')]===_0x76aa('0x91')){_0x258e5a[_0x76aa('0x3b')](_0x59f9d7[_0x76aa('0x7d')]+_0x76aa('0x92'),_0x306cc6[_0x76aa('0x93')],_0x306cc6[_0x76aa('0x94')]);}else{_0x258e5a[_0x76aa('0x3b')](_0x59f9d7[_0x76aa('0x7d')]+_0x76aa('0x95'),_0x306cc6[_0x76aa('0x93')],_0x306cc6[_0x76aa('0x94')]);}if(_0x52762c){logger['info'](_0x76aa('0x96'),_0x258e5a[_0x76aa('0x83')]());require('child_process')[_0x76aa('0x97')](path[_0x76aa('0x53')](__dirname,'../../components/export/',_0x52762c['output']),[_0x52762c['id'],_0x258e5a[_0x76aa('0x83')](),path[_0x76aa('0x53')](__dirname,'../../files/reports',_0x52762c[_0x76aa('0x98')]),_0x325ffa]);return _0x52762c;}else{var _0x429500=squel[_0x76aa('0x6f')]();_0x429500['from']('('+_0x258e5a[_0x76aa('0x83')]()+')',_0x76aa('0x99'));_0x429500['field'](_0x76aa('0x9a'),_0x76aa('0x42'));_0x258e5a[_0x76aa('0x1d')](_0x306cc6[_0x76aa('0x1d')]||_0x486d86);_0x258e5a[_0x76aa('0x1c')](_0x306cc6[_0x76aa('0x1c')]||0x0);return db['sequelize'][_0x76aa('0x31')](_0x429500['toString'](),{'type':db[_0x76aa('0x84')][_0x76aa('0x85')][_0x76aa('0x8b')]})['then'](function(_0x4c5f54){if(!_0x4c5f54[_0x76aa('0x36')]){_0x11d91f=0x0;}else{_0x11d91f=_0x4c5f54[0x0][_0x76aa('0x42')]||0x0;}return db[_0x76aa('0x84')][_0x76aa('0x31')](_0x258e5a[_0x76aa('0x83')](),{'type':db[_0x76aa('0x84')]['QueryTypes']['SELECT']});})[_0x76aa('0x25')](function(_0x109bd3){return{'rows':_0x109bd3||[],'count':_0x11d91f};});}});}exports[_0x76aa('0x9b')]=function(_0x46614f,_0x507d7f){return runReport(_0x46614f[_0x76aa('0x52')],_0x46614f['query'],_0x46614f['options'])[_0x76aa('0x25')](respondWithResult(_0x507d7f,null))[_0x76aa('0x47')](handleError(_0x507d7f,null));};exports[_0x76aa('0x9c')]=runReport;exports['query']=function(_0x7aac18,_0x3839aa){var _0x2abcef=0xa;var _0x26a2a7=[_0x76aa('0x53'),_0x76aa('0x54'),_0x76aa('0x86'),'cross_join'];var _0x344ea4={'SUM':_0x76aa('0x56'),'COUNT':_0x76aa('0x57'),'COUNT DISTINCT':_0x76aa('0x58'),'MAX':_0x76aa('0x59'),'MIN':_0x76aa('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x76aa('0x9d'),'GROUP_CONCAT ASC':_0x76aa('0x5b'),'GROUP_CONCAT DESC':_0x76aa('0x5c')};var _0x34169e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x76aa('0x5e'),'HOUR':_0x76aa('0x88'),'ROUND':_0x76aa('0x5f'),'UNIX_TIMESTAMP':_0x76aa('0x60')};var _0x4126c8=function(_0x535cc9){return!_[_0x76aa('0x61')]([_0x76aa('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x76aa('0x65')],_0x535cc9);};var _0x1a8874=function(_0x3faafe){if(!_0x3faafe||!_0x3faafe[_0x76aa('0x66')][_0x76aa('0x36')]){return'';}for(var _0x293221='(',_0x482665=0x0;_0x482665<_0x3faafe[_0x76aa('0x66')][_0x76aa('0x36')];_0x482665+=0x1){_0x482665>0x0&&(_0x293221+='\x20'+_0x3faafe[_0x76aa('0x67')]+'\x20');_0x293221+=_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x68')]?_0x1a8874(_0x3faafe[_0x76aa('0x66')][_0x482665]['group']):_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x40')]+'\x20'+_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x69')]+(_0x4126c8(_0x3faafe[_0x76aa('0x66')][_0x482665][_0x76aa('0x69')])?'\x20'+_0x3faafe['rules'][_0x482665][_0x76aa('0x6a')]:'');}return _0x293221+')';};var _0x4d0d76={'where':{'id':_0x7aac18[_0x76aa('0x52')]['id']}},_0x1482e5,_0x4e136f,_0x37edb8,_0x2f879e,_0x56d6af;_0x4d0d76=_[_0x76aa('0x3c')]({},_0x4d0d76,_0x7aac18[_0x76aa('0x49')]);return db['AnalyticCustomReport'][_0x76aa('0x4a')](_0x4d0d76)[_0x76aa('0x25')](function(_0x5069d8){if(_0x5069d8){_0x1482e5=_0x5069d8;return _0x5069d8[_0x76aa('0x9e')]();}return null;})[_0x76aa('0x25')](function(_0x343adf){if(_0x343adf){if(!_0x343adf[_0x76aa('0x36')]){throw new db[(_0x76aa('0x89'))][(_0x76aa('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4e136f=_0x343adf;return db[_0x76aa('0x6d')][_0x76aa('0x45')]({'raw':!![]});}return null;})[_0x76aa('0x25')](function(_0x840136){if(_0x840136){_0x37edb8=_[_0x76aa('0x6e')](_0x840136,'id');var _0x28e1a4;var _0x8bb516=squel[_0x76aa('0x6f')]();_0x8bb516[_0x76aa('0x8a')](_0x1482e5[_0x76aa('0x7d')]);for(var _0x2a74cf=0x0;_0x2a74cf<_0x4e136f['length'];_0x2a74cf+=0x1){_0x28e1a4=_0x4e136f[_0x2a74cf][_0x76aa('0x70')]?_0x37edb8[_0x4e136f[_0x2a74cf][_0x76aa('0x70')]][_0x76aa('0x71')]:_0x4e136f[_0x2a74cf][_0x76aa('0x40')];_0x28e1a4=_0x4e136f[_0x2a74cf][_0x76aa('0x72')]?_[_0x76aa('0x73')](_0x344ea4[_0x4e136f[_0x2a74cf][_0x76aa('0x72')]],'%s',_0x28e1a4):_0x28e1a4;_0x28e1a4=_0x4e136f[_0x2a74cf][_0x76aa('0x74')]?_['replace'](_0x34169e[_0x4e136f[_0x2a74cf][_0x76aa('0x74')]],'%s',_0x28e1a4):_0x28e1a4;if(_0x4e136f[_0x2a74cf]['groupBy']){_0x8bb516[_0x76aa('0x68')](_0x28e1a4);}_0x4e136f[_0x2a74cf][_0x76aa('0x76')]&&_0x8bb516[_0x76aa('0x38')](_0x28e1a4,_0x4e136f[_0x2a74cf]['orderBy']===_0x76aa('0x9f')?![]:!![]);_0x8bb516[_0x76aa('0x40')](_0x28e1a4,_0x4e136f[_0x2a74cf][_0x76aa('0x77')]||_0x28e1a4);}if(_0x1482e5[_0x76aa('0x78')]){_0x1482e5[_0x76aa('0x78')]=JSON['parse'](_0x1482e5[_0x76aa('0x78')]);for(var _0x4d8c38=0x0;_0x4d8c38<_0x1482e5[_0x76aa('0x78')][_0x76aa('0x36')];_0x4d8c38+=0x1){if(_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x3d')]&&_[_0x76aa('0x61')](_0x26a2a7,_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x3d')])&&_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7e')]&&_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7a')]&&_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x7b')]){_0x8bb516[_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x3d')]](_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7a')],null,util[_0x76aa('0x74')](_0x76aa('0x7c'),_0x1482e5[_0x76aa('0x7d')],_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x7e')],_0x1482e5[_0x76aa('0x78')][_0x4d8c38][_0x76aa('0x7a')],_0x1482e5['joins'][_0x4d8c38][_0x76aa('0x7b')]));}}}if(_0x1482e5[_0x76aa('0x7f')]){_0x1482e5[_0x76aa('0x7f')]=JSON[_0x76aa('0x79')](_0x1482e5[_0x76aa('0x7f')]);_0x8bb516['where'](_0x1a8874(_0x1482e5[_0x76aa('0x7f')]['group']));}_0x56d6af=_0x8bb516[_0x76aa('0x80')]();_0x8bb516[_0x76aa('0x1d')](_0x2abcef);_0x8bb516[_0x76aa('0x1c')](0x0);logger[_0x76aa('0x81')](_0x76aa('0x82'),_0x8bb516['toString']());return db[_0x76aa('0x84')]['query'](_0x8bb516[_0x76aa('0x83')](),{'type':db[_0x76aa('0x84')][_0x76aa('0x85')]['SELECT']});}})[_0x76aa('0x25')](function(){return{'sql':_0x56d6af['toString']()};})[_0x76aa('0x25')](respondWithResult(_0x3839aa,null))[_0x76aa('0x47')](handleError(_0x3839aa,null));};
\ No newline at end of file
+var _0x54ef=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','field','options','AnalyticCustomReport','includeAll','include','findAll','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','body','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','select','QueryTypes','No\x20available\x20data','web','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','countTable','COUNT(*)','run','runReport','MIN(%s)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','stack','name','send','index','rawAttributes','model','keys'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x54ef,0x112));var _0xf54e=function(_0x45cc77,_0x2b6c30){_0x45cc77=_0x45cc77-0x0;var _0x28402f=_0x54ef[_0x45cc77];return _0x28402f;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358c88,_0x4b0ee1){_0x4b0ee1=_0x4b0ee1||0xcc;return function(_0x4bd828){if(_0x4bd828){return _0x358c88[_0xf54e('0x18')](_0x4b0ee1);}return _0x358c88[_0xf54e('0x19')](_0x4b0ee1)[_0xf54e('0x1a')]();};}function respondWithResult(_0x380f26,_0x5644aa){_0x5644aa=_0x5644aa||0xc8;return function(_0x331732){if(_0x331732){return _0x380f26[_0xf54e('0x19')](_0x5644aa)[_0xf54e('0x1b')](_0x331732);}};}function respondWithFilteredResult(_0x15f639,_0x56828e){return function(_0x2366ee){if(_0x2366ee){var _0x389abc=_0x2366ee[_0xf54e('0x1c')],_0x3eb415=_0x56828e[_0xf54e('0x1d')],_0x5c5d00=_0x56828e[_0xf54e('0x1d')]+_0x56828e[_0xf54e('0x1e')],_0x4af633;if(_0x5c5d00>=_0x389abc){_0x5c5d00=_0x389abc;_0x4af633=0xc8;}else{_0x4af633=0xce;}_0x15f639[_0xf54e('0x19')](_0x4af633);return _0x15f639[_0xf54e('0x1f')](_0xf54e('0x20'),_0x3eb415+'-'+_0x5c5d00+'/'+_0x389abc)[_0xf54e('0x1b')](_0x2366ee);}return null;};}function patchUpdates(_0x1dcc04){return function(_0x4689fe){try{jsonpatch[_0xf54e('0x21')](_0x4689fe,_0x1dcc04,!![]);}catch(_0x50fc66){return BPromise['reject'](_0x50fc66);}return _0x4689fe[_0xf54e('0x22')]();};}function saveUpdates(_0x59f338,_0x3e1556){return function(_0x1bfe99){if(_0x1bfe99){return _0x1bfe99[_0xf54e('0x23')](_0x59f338)[_0xf54e('0x24')](function(_0xf64f12){return _0xf64f12;});}return null;};}function removeEntity(_0x3887b0,_0x388aa0){return function(_0x11985e){if(_0x11985e){return _0x11985e[_0xf54e('0x25')]()[_0xf54e('0x24')](function(){var _0x1c58bd=_0x11985e['get']({'plain':!![]});var _0x6f6d29='CustomReports';return db[_0xf54e('0x26')][_0xf54e('0x25')]({'where':{'type':_0x6f6d29,'resourceId':_0x1c58bd['id']}})[_0xf54e('0x24')](function(){return _0x11985e;});})[_0xf54e('0x24')](function(){_0x3887b0[_0xf54e('0x19')](0xcc)[_0xf54e('0x1a')]();});}};}function handleEntityNotFound(_0x1e08d1,_0x43488d){return function(_0x2342a9){if(!_0x2342a9){_0x1e08d1[_0xf54e('0x18')](0x194);}return _0x2342a9;};}function handleError(_0xf6cdd7,_0x39c0ae){_0x39c0ae=_0x39c0ae||0x1f4;return function(_0x2ea001){logger['error'](_0x2ea001[_0xf54e('0x27')]);if(_0x2ea001['name']){delete _0x2ea001[_0xf54e('0x28')];}_0xf6cdd7['status'](_0x39c0ae)[_0xf54e('0x29')](_0x2ea001);};}exports[_0xf54e('0x2a')]=function(_0x21ba00,_0xa13cd0){var _0x25b643={},_0x3993e4={},_0x36f985={'count':0x0,'rows':[]};var _0x54bd8f=db['AnalyticCustomReport'][_0xf54e('0x2b')];_0x3993e4[_0xf54e('0x2c')]=_[_0xf54e('0x2d')](_0x54bd8f);_0x3993e4[_0xf54e('0x2e')]=_[_0xf54e('0x2d')](_0x21ba00[_0xf54e('0x2e')]);_0x3993e4[_0xf54e('0x2f')]=_[_0xf54e('0x30')](_0x3993e4[_0xf54e('0x2c')],_0x3993e4[_0xf54e('0x2e')]);_0x25b643['attributes']=_['intersection'](_0x3993e4[_0xf54e('0x2c')],qs[_0xf54e('0x31')](_0x21ba00['query'][_0xf54e('0x31')]));_0x25b643[_0xf54e('0x32')]=_0x25b643[_0xf54e('0x32')][_0xf54e('0x33')]?_0x25b643['attributes']:_0x3993e4['model'];if(!_0x21ba00['query'][_0xf54e('0x34')](_0xf54e('0x35'))){_0x25b643[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x21ba00[_0xf54e('0x2e')][_0xf54e('0x1e')]);_0x25b643['offset']=qs['offset'](_0x21ba00['query'][_0xf54e('0x1d')]);}_0x25b643[_0xf54e('0x36')]=qs['sort'](_0x21ba00['query'][_0xf54e('0x37')]);_0x25b643[_0xf54e('0x38')]=qs[_0xf54e('0x2f')](_['pick'](_0x21ba00[_0xf54e('0x2e')],_0x3993e4[_0xf54e('0x2f')]));if(_0x21ba00['query'][_0xf54e('0x39')]){_0x25b643[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x25b643[_0xf54e('0x38')],{'$or':_[_0xf54e('0x3b')](_0x54bd8f,function(_0x199056){if(_0x199056['type']['key']!==_0xf54e('0x3c')){var _0x3c66b3={};_0x3c66b3[_0x199056[_0xf54e('0x3d')]]={'$like':'%'+_0x21ba00['query'][_0xf54e('0x39')]+'%'};return _0x3c66b3;}})});}_0x25b643=_[_0xf54e('0x3a')]({},_0x25b643,_0x21ba00[_0xf54e('0x3e')]);var _0x1ee884={'where':_0x25b643[_0xf54e('0x38')]};return db[_0xf54e('0x3f')][_0xf54e('0x1c')](_0x1ee884)[_0xf54e('0x24')](function(_0x8b4c){_0x36f985[_0xf54e('0x1c')]=_0x8b4c;if(_0x21ba00[_0xf54e('0x2e')][_0xf54e('0x40')]){_0x25b643[_0xf54e('0x41')]=[{'all':!![]}];}return db[_0xf54e('0x3f')][_0xf54e('0x42')](_0x25b643);})['then'](function(_0x4f311f){_0x36f985['rows']=_0x4f311f;return _0x36f985;})[_0xf54e('0x24')](respondWithFilteredResult(_0xa13cd0,_0x25b643))[_0xf54e('0x43')](handleError(_0xa13cd0,null));};exports['show']=function(_0x3dae9b,_0x311ce1){var _0x381c03={'raw':![],'where':{'id':_0x3dae9b[_0xf54e('0x44')]['id']}},_0x4f61d7={};_0x4f61d7[_0xf54e('0x2c')]=_[_0xf54e('0x2d')](db[_0xf54e('0x3f')][_0xf54e('0x2b')]);_0x4f61d7[_0xf54e('0x2e')]=_[_0xf54e('0x2d')](_0x3dae9b[_0xf54e('0x2e')]);_0x4f61d7[_0xf54e('0x2f')]=_['intersection'](_0x4f61d7[_0xf54e('0x2c')],_0x4f61d7[_0xf54e('0x2e')]);_0x381c03[_0xf54e('0x32')]=_[_0xf54e('0x30')](_0x4f61d7[_0xf54e('0x2c')],qs[_0xf54e('0x31')](_0x3dae9b['query'][_0xf54e('0x31')]));_0x381c03['attributes']=_0x381c03[_0xf54e('0x32')]['length']?_0x381c03[_0xf54e('0x32')]:_0x4f61d7[_0xf54e('0x2c')];if(_0x3dae9b[_0xf54e('0x2e')]['includeAll']){_0x381c03[_0xf54e('0x41')]=[{'all':!![]}];}_0x381c03=_[_0xf54e('0x3a')]({},_0x381c03,_0x3dae9b[_0xf54e('0x3e')]);return db[_0xf54e('0x3f')][_0xf54e('0x45')](_0x381c03)['then'](handleEntityNotFound(_0x311ce1,null))[_0xf54e('0x24')](respondWithResult(_0x311ce1,null))[_0xf54e('0x43')](handleError(_0x311ce1,null));};exports[_0xf54e('0x46')]=function(_0x45592b,_0x5f3438){return db[_0xf54e('0x3f')][_0xf54e('0x46')](_0x45592b['body'],{})[_0xf54e('0x24')](function(_0xd4d956){var _0x3d24c7=_0x45592b[_0xf54e('0x47')]['get']({'plain':!![]});if(!_0x3d24c7)throw new Error(_0xf54e('0x48'));if(_0x3d24c7[_0xf54e('0x49')]===_0xf54e('0x47')){var _0xb4654f=_0xd4d956[_0xf54e('0x4a')]({'plain':!![]});var _0x3237ef=_0xf54e('0x4b');return db[_0xf54e('0x4c')][_0xf54e('0x45')]({'where':{'name':_0x3237ef,'userProfileId':_0x3d24c7[_0xf54e('0x4d')]},'raw':!![]})[_0xf54e('0x24')](function(_0x1f4cf8){if(_0x1f4cf8&&_0x1f4cf8[_0xf54e('0x4e')]===0x0){return db[_0xf54e('0x26')][_0xf54e('0x46')]({'name':_0xb4654f[_0xf54e('0x28')],'resourceId':_0xb4654f['id'],'type':_0xf54e('0x4f'),'sectionId':_0x1f4cf8['id']},{})[_0xf54e('0x24')](function(){return _0xd4d956;});}else{return _0xd4d956;}})[_0xf54e('0x43')](function(_0x480c44){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x480c44);throw _0x480c44;});}return _0xd4d956;})[_0xf54e('0x24')](respondWithResult(_0x5f3438,0xc9))[_0xf54e('0x43')](handleError(_0x5f3438,null));};exports[_0xf54e('0x23')]=function(_0x40557d,_0xba297c){if(_0x40557d[_0xf54e('0x50')]['id']){delete _0x40557d[_0xf54e('0x50')]['id'];}return db[_0xf54e('0x3f')][_0xf54e('0x45')]({'where':{'id':_0x40557d[_0xf54e('0x44')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0xba297c,null))['then'](saveUpdates(_0x40557d[_0xf54e('0x50')],null))[_0xf54e('0x24')](respondWithResult(_0xba297c,null))[_0xf54e('0x43')](handleError(_0xba297c,null));};exports[_0xf54e('0x25')]=function(_0x1b8f16,_0x30f53b){return db[_0xf54e('0x3f')]['find']({'where':{'id':_0x1b8f16[_0xf54e('0x44')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x30f53b,null))[_0xf54e('0x24')](removeEntity(_0x30f53b,null))['catch'](handleError(_0x30f53b,null));};exports[_0xf54e('0x51')]=function(_0x54ac1a,_0x465a0f){var _0x400ee0=0xa;var _0x3e2fd1=['join',_0xf54e('0x52'),_0xf54e('0x53'),_0xf54e('0x54')];var _0x4e5059={'SUM':_0xf54e('0x55'),'COUNT':_0xf54e('0x56'),'COUNT DISTINCT':_0xf54e('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xf54e('0x58'),'GROUP_CONCAT':_0xf54e('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf54e('0x5a')};var _0x49fd97={'SEC_TO_TIME':_0xf54e('0x5b'),'DATE':'DATE(%s)','HOUR':_0xf54e('0x5c'),'ROUND':_0xf54e('0x5d'),'UNIX_TIMESTAMP':_0xf54e('0x5e')};var _0x241198=function(_0x44f1de){return!_[_0xf54e('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xf54e('0x60'),_0xf54e('0x61')],_0x44f1de);};var _0x493011=function(_0x57a48e){if(!_0x57a48e||!_0x57a48e[_0xf54e('0x62')]['length']){return'';}for(var _0x2b616a='(',_0x43f9bf=0x0;_0x43f9bf<_0x57a48e[_0xf54e('0x62')][_0xf54e('0x33')];_0x43f9bf+=0x1){_0x43f9bf>0x0&&(_0x2b616a+='\x20'+_0x57a48e[_0xf54e('0x63')]+'\x20');_0x2b616a+=_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x64')]?_0x493011(_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x64')]):_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x3d')]+'\x20'+_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x65')]+(_0x241198(_0x57a48e[_0xf54e('0x62')][_0x43f9bf]['condition'])?'\x20'+_0x57a48e[_0xf54e('0x62')][_0x43f9bf][_0xf54e('0x66')]:'');}return _0x2b616a+')';};var _0xb7ff4d={'where':{'id':_0x54ac1a['params']['id']}},_0x11908b,_0x1e4c0d,_0x494629,_0xf50b1b,_0x1ede85;_0xb7ff4d=_['merge']({},_0xb7ff4d,_0x54ac1a[_0xf54e('0x3e')]);return db['AnalyticCustomReport'][_0xf54e('0x45')](_0xb7ff4d)[_0xf54e('0x24')](function(_0x105cf4){if(_0x105cf4){_0x11908b=_0x105cf4;return _0x105cf4[_0xf54e('0x67')]();}return null;})['then'](function(_0x2ecda1){if(_0x2ecda1){if(!_0x2ecda1['length']){throw new db[(_0xf54e('0x68'))][(_0xf54e('0x69'))](_0xf54e('0x6a'),0x193);}_0x1e4c0d=_0x2ecda1;return db['AnalyticMetric'][_0xf54e('0x42')]({'raw':!![]});}return null;})['then'](function(_0x3f7224){if(_0x3f7224){_0x494629=_[_0xf54e('0x6b')](_0x3f7224,'id');var _0x5500d7;var _0x380b4f=squel['select']();_0x380b4f[_0xf54e('0x6c')](_0x11908b[_0xf54e('0x6d')]);for(var _0x33acd3=0x0;_0x33acd3<_0x1e4c0d[_0xf54e('0x33')];_0x33acd3+=0x1){_0x5500d7=_0x1e4c0d[_0x33acd3][_0xf54e('0x6e')]?_0x494629[_0x1e4c0d[_0x33acd3]['MetricId']][_0xf54e('0x6f')]:_0x1e4c0d[_0x33acd3][_0xf54e('0x3d')];_0x5500d7=_0x1e4c0d[_0x33acd3]['function']?_[_0xf54e('0x70')](_0x4e5059[_0x1e4c0d[_0x33acd3][_0xf54e('0x71')]],'%s',_0x5500d7):_0x5500d7;_0x5500d7=_0x1e4c0d[_0x33acd3]['format']?_[_0xf54e('0x70')](_0x49fd97[_0x1e4c0d[_0x33acd3][_0xf54e('0x72')]],'%s',_0x5500d7):_0x5500d7;if(_0x1e4c0d[_0x33acd3][_0xf54e('0x73')]){_0x380b4f['group'](_0x5500d7);}_0x1e4c0d[_0x33acd3][_0xf54e('0x74')]&&_0x380b4f['order'](_0x5500d7,_0x1e4c0d[_0x33acd3][_0xf54e('0x74')]===_0xf54e('0x75')?![]:!![]);_0x380b4f['field'](_0x5500d7,_0x1e4c0d[_0x33acd3][_0xf54e('0x76')]||_0x5500d7);}if(_0x11908b[_0xf54e('0x77')]){_0x11908b[_0xf54e('0x77')]=JSON[_0xf54e('0x78')](_0x11908b[_0xf54e('0x77')]);for(var _0xfc1e=0x0;_0xfc1e<_0x11908b[_0xf54e('0x77')][_0xf54e('0x33')];_0xfc1e+=0x1){if(_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x79')]&&_[_0xf54e('0x5f')](_0x3e2fd1,_0x11908b['joins'][_0xfc1e][_0xf54e('0x79')])&&_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7a')]&&_0x11908b['joins'][_0xfc1e][_0xf54e('0x7b')]&&_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7c')]){_0x380b4f[_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x79')]](_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7b')],null,util['format'](_0xf54e('0x7d'),_0x11908b[_0xf54e('0x6d')],_0x11908b[_0xf54e('0x77')][_0xfc1e]['parentKey'],_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7b')],_0x11908b[_0xf54e('0x77')][_0xfc1e][_0xf54e('0x7c')]));}}}if(_0x11908b['conditions']){_0x11908b['conditions']=JSON[_0xf54e('0x78')](_0x11908b[_0xf54e('0x7e')]);_0x380b4f[_0xf54e('0x38')](_0x493011(_0x11908b[_0xf54e('0x7e')][_0xf54e('0x64')]));}_0x1ede85=_0x380b4f[_0xf54e('0x7f')]();_0x380b4f[_0xf54e('0x1e')](_0x400ee0);_0x380b4f[_0xf54e('0x1d')](0x0);logger[_0xf54e('0x80')](_0xf54e('0x81'),_0x380b4f['toString']());return db[_0xf54e('0x82')][_0xf54e('0x2e')](_0x380b4f[_0xf54e('0x83')](),{'type':db[_0xf54e('0x82')]['QueryTypes'][_0xf54e('0x84')]});}})[_0xf54e('0x24')](respondWithResult(_0x465a0f,null))[_0xf54e('0x43')](handleError(_0x465a0f,null));};function runReport(_0x213206,_0x5dd28e,_0x394862){var _0x4876b5=_0x5dd28e[_0xf54e('0x28')];var _0x506375=0xa;var _0x4a6a8d=[_0xf54e('0x85'),_0xf54e('0x52'),_0xf54e('0x53'),_0xf54e('0x54')];var _0x21e9c1={'SUM':_0xf54e('0x55'),'COUNT':_0xf54e('0x56'),'COUNT DISTINCT':_0xf54e('0x57'),'MAX':_0xf54e('0x86'),'MIN':'MIN(%s)','AVG':_0xf54e('0x58'),'GROUP_CONCAT':_0xf54e('0x59'),'GROUP_CONCAT ASC':_0xf54e('0x87'),'GROUP_CONCAT DESC':_0xf54e('0x5a')};var _0x395513={'SEC_TO_TIME':_0xf54e('0x5b'),'DATE':_0xf54e('0x88'),'HOUR':_0xf54e('0x5c'),'ROUND':_0xf54e('0x5d'),'UNIX_TIMESTAMP':_0xf54e('0x5e')};var _0x11dec2=function(_0x418ecc){return!_['includes']([_0xf54e('0x89'),_0xf54e('0x8a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x418ecc);};var _0x85b108=function(_0x250196){if(!_0x250196||!_0x250196[_0xf54e('0x62')][_0xf54e('0x33')]){return'';}for(var _0x15aec1='(',_0x3c3a97=0x0;_0x3c3a97<_0x250196[_0xf54e('0x62')][_0xf54e('0x33')];_0x3c3a97+=0x1){_0x3c3a97>0x0&&(_0x15aec1+='\x20'+_0x250196[_0xf54e('0x63')]+'\x20');_0x15aec1+=_0x250196['rules'][_0x3c3a97][_0xf54e('0x64')]?_0x85b108(_0x250196[_0xf54e('0x62')][_0x3c3a97][_0xf54e('0x64')]):_0x250196['rules'][_0x3c3a97][_0xf54e('0x3d')]+'\x20'+_0x250196['rules'][_0x3c3a97][_0xf54e('0x65')]+(_0x11dec2(_0x250196['rules'][_0x3c3a97][_0xf54e('0x65')])?'\x20'+_0x250196[_0xf54e('0x62')][_0x3c3a97]['value']:'');}return _0x15aec1+')';};var _0x5b3e27={'where':{'id':_0x213206['id']}},_0x23533b,_0x632240,_0x16672b,_0x406261,_0x389f16;_0x5b3e27=_['merge']({},_0x5b3e27,_0x394862);return db['AnalyticCustomReport'][_0xf54e('0x45')](_0x5b3e27)[_0xf54e('0x24')](function(_0x456159){if(_0x456159){_0x23533b=_0x456159;return _0x456159[_0xf54e('0x67')]();}return null;})[_0xf54e('0x24')](function(_0xe1205){if(_0xe1205){if(!_0xe1205[_0xf54e('0x33')]){throw new db[(_0xf54e('0x68'))][(_0xf54e('0x69'))](_0xf54e('0x6a'),0x193);}_0x632240=_0xe1205;return db['AnalyticMetric'][_0xf54e('0x42')]({'raw':!![]});}return null;})[_0xf54e('0x24')](function(_0x4d4667){if(_0x4d4667){_0x16672b=_['keyBy'](_0x4d4667,'id');var _0x20345b;var _0x42c049=squel[_0xf54e('0x8b')]();_0x42c049[_0xf54e('0x6c')](_0x23533b[_0xf54e('0x6d')]);for(var _0x5e6713=0x0;_0x5e6713<_0x632240[_0xf54e('0x33')];_0x5e6713+=0x1){_0x20345b=_0x632240[_0x5e6713][_0xf54e('0x6e')]?_0x16672b[_0x632240[_0x5e6713][_0xf54e('0x6e')]][_0xf54e('0x6f')]:_0x632240[_0x5e6713]['field'];_0x20345b=_0x632240[_0x5e6713][_0xf54e('0x71')]?_[_0xf54e('0x70')](_0x21e9c1[_0x632240[_0x5e6713][_0xf54e('0x71')]],'%s',_0x20345b):_0x20345b;_0x20345b=_0x632240[_0x5e6713][_0xf54e('0x72')]?_['replace'](_0x395513[_0x632240[_0x5e6713][_0xf54e('0x72')]],'%s',_0x20345b):_0x20345b;if(_0x632240[_0x5e6713][_0xf54e('0x73')]){_0x42c049[_0xf54e('0x64')](_0x20345b);}_0x632240[_0x5e6713][_0xf54e('0x74')]&&_0x42c049[_0xf54e('0x36')](_0x20345b,_0x632240[_0x5e6713]['orderBy']===_0xf54e('0x75')?![]:!![]);_0x42c049['field'](_0x20345b,_0x632240[_0x5e6713]['alias']||_0x20345b);}if(_0x23533b[_0xf54e('0x77')]){_0x23533b[_0xf54e('0x77')]=JSON[_0xf54e('0x78')](_0x23533b[_0xf54e('0x77')]);for(var _0x300cbe=0x0;_0x300cbe<_0x23533b[_0xf54e('0x77')][_0xf54e('0x33')];_0x300cbe+=0x1){if(_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x79')]&&_['includes'](_0x4a6a8d,_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x79')])&&_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7a')]&&_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7b')]&&_0x23533b['joins'][_0x300cbe][_0xf54e('0x7c')]){_0x42c049[_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x79')]](_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7b')],null,util[_0xf54e('0x72')]('%s.%s\x20=\x20%s.%s',_0x23533b[_0xf54e('0x6d')],_0x23533b[_0xf54e('0x77')][_0x300cbe][_0xf54e('0x7a')],_0x23533b[_0xf54e('0x77')][_0x300cbe]['foreignTable'],_0x23533b['joins'][_0x300cbe][_0xf54e('0x7c')]));}}}if(_0x23533b[_0xf54e('0x7e')]){_0x23533b[_0xf54e('0x7e')]=JSON[_0xf54e('0x78')](_0x23533b[_0xf54e('0x7e')]);_0x42c049[_0xf54e('0x38')](_0x85b108(_0x23533b['conditions'][_0xf54e('0x64')]));}_0x389f16=_0x42c049[_0xf54e('0x7f')]();_0x42c049[_0xf54e('0x1e')](_0x506375);_0x42c049[_0xf54e('0x1d')](0x0);logger[_0xf54e('0x80')](_0xf54e('0x81'),_0x42c049['toString']());return db[_0xf54e('0x82')]['query'](_0x42c049[_0xf54e('0x83')](),{'type':db['sequelize'][_0xf54e('0x8c')][_0xf54e('0x84')]});}})[_0xf54e('0x24')](function(_0x2af141){if(!_0x2af141[_0xf54e('0x33')]){throw new db['Sequelize'][(_0xf54e('0x69'))](_0xf54e('0x8d'),0xcc);}if(_0x5dd28e['output']===_0xf54e('0x8e')){return null;}var _0x1b3ca4=_[_0xf54e('0x3a')](_0x5dd28e,{'name':_0x5dd28e[_0xf54e('0x8f')]||_0x5dd28e['name']||_0x23533b[_0xf54e('0x28')],'basename':_0x4876b5,'savename':util[_0xf54e('0x72')]('%s-%s.%s',_0x5dd28e[_0xf54e('0x28')]||_0x23533b['name'],require('randomstring')[_0xf54e('0x90')](0x4),_0x5dd28e['output']||_0xf54e('0x91')),'reportId':_0x23533b['id'],'reportType':_0xf54e('0x92')});return db[_0xf54e('0x93')][_0xf54e('0x46')](_0x1b3ca4,{'raw':!![]});})[_0xf54e('0x24')](function(_0x56f125){if(_0x23533b[_0xf54e('0x6d')]===_0xf54e('0x94')){_0x389f16[_0xf54e('0x38')](_0x23533b[_0xf54e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5dd28e[_0xf54e('0x95')],_0x5dd28e['endDate']);}else{_0x389f16[_0xf54e('0x38')](_0x23533b[_0xf54e('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5dd28e[_0xf54e('0x95')],_0x5dd28e[_0xf54e('0x96')]);}if(_0x56f125){logger[_0xf54e('0x97')](_0xf54e('0x98'),_0x389f16['toString']());require(_0xf54e('0x99'))[_0xf54e('0x9a')](path[_0xf54e('0x85')](__dirname,'../../components/export/',_0x56f125['output']),[_0x56f125['id'],_0x389f16[_0xf54e('0x83')](),path['join'](__dirname,'../../files/reports',_0x56f125['savename']),_0x4876b5]);return _0x56f125;}else{var _0x3d908b=squel[_0xf54e('0x8b')]();_0x3d908b[_0xf54e('0x6c')]('('+_0x389f16[_0xf54e('0x83')]()+')',_0xf54e('0x9b'));_0x3d908b[_0xf54e('0x3d')](_0xf54e('0x9c'),_0xf54e('0x1c'));_0x389f16[_0xf54e('0x1e')](_0x5dd28e['limit']||_0x506375);_0x389f16[_0xf54e('0x1d')](_0x5dd28e['offset']||0x0);return db[_0xf54e('0x82')][_0xf54e('0x2e')](_0x3d908b['toString'](),{'type':db[_0xf54e('0x82')]['QueryTypes'][_0xf54e('0x84')]})[_0xf54e('0x24')](function(_0x5d8756){if(!_0x5d8756[_0xf54e('0x33')]){_0x406261=0x0;}else{_0x406261=_0x5d8756[0x0][_0xf54e('0x1c')]||0x0;}return db[_0xf54e('0x82')]['query'](_0x389f16['toString'](),{'type':db['sequelize'][_0xf54e('0x8c')]['SELECT']});})[_0xf54e('0x24')](function(_0x3e3bc1){return{'rows':_0x3e3bc1||[],'count':_0x406261};});}});}exports[_0xf54e('0x9d')]=function(_0xf24a7c,_0xf92db2){return runReport(_0xf24a7c['params'],_0xf24a7c[_0xf54e('0x2e')],_0xf24a7c[_0xf54e('0x3e')])[_0xf54e('0x24')](respondWithResult(_0xf92db2,null))[_0xf54e('0x43')](handleError(_0xf92db2,null));};exports[_0xf54e('0x9e')]=runReport;exports[_0xf54e('0x2e')]=function(_0x518dad,_0x996df5){var _0x811fa7=0xa;var _0x1b51a5=[_0xf54e('0x85'),_0xf54e('0x52'),'right_join',_0xf54e('0x54')];var _0x101508={'SUM':_0xf54e('0x55'),'COUNT':_0xf54e('0x56'),'COUNT DISTINCT':_0xf54e('0x57'),'MAX':_0xf54e('0x86'),'MIN':_0xf54e('0x9f'),'AVG':_0xf54e('0x58'),'GROUP_CONCAT':_0xf54e('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf54e('0x5a')};var _0x26a293={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xf54e('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf54e('0x5e')};var _0xd4db77=function(_0x41cd85){return!_[_0xf54e('0x5f')](['IS\x20NULL',_0xf54e('0x8a'),_0xf54e('0x60'),'IS\x20NOT\x20EMPTY'],_0x41cd85);};var _0x90ad88=function(_0x3797bf){if(!_0x3797bf||!_0x3797bf[_0xf54e('0x62')][_0xf54e('0x33')]){return'';}for(var _0x627e9a='(',_0x413b9a=0x0;_0x413b9a<_0x3797bf[_0xf54e('0x62')][_0xf54e('0x33')];_0x413b9a+=0x1){_0x413b9a>0x0&&(_0x627e9a+='\x20'+_0x3797bf[_0xf54e('0x63')]+'\x20');_0x627e9a+=_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x64')]?_0x90ad88(_0x3797bf['rules'][_0x413b9a]['group']):_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x3d')]+'\x20'+_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x65')]+(_0xd4db77(_0x3797bf[_0xf54e('0x62')][_0x413b9a]['condition'])?'\x20'+_0x3797bf[_0xf54e('0x62')][_0x413b9a][_0xf54e('0x66')]:'');}return _0x627e9a+')';};var _0x3a9def={'where':{'id':_0x518dad[_0xf54e('0x44')]['id']}},_0x213dc5,_0x5722a8,_0xccf31d,_0x37f1d6,_0x380efc;_0x3a9def=_[_0xf54e('0x3a')]({},_0x3a9def,_0x518dad[_0xf54e('0x3e')]);return db[_0xf54e('0x3f')][_0xf54e('0x45')](_0x3a9def)[_0xf54e('0x24')](function(_0x3c098a){if(_0x3c098a){_0x213dc5=_0x3c098a;return _0x3c098a[_0xf54e('0x67')]();}return null;})[_0xf54e('0x24')](function(_0xf94c4e){if(_0xf94c4e){if(!_0xf94c4e[_0xf54e('0x33')]){throw new db['Sequelize'][(_0xf54e('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5722a8=_0xf94c4e;return db['AnalyticMetric'][_0xf54e('0x42')]({'raw':!![]});}return null;})[_0xf54e('0x24')](function(_0x304cd1){if(_0x304cd1){_0xccf31d=_[_0xf54e('0x6b')](_0x304cd1,'id');var _0x22d3c1;var _0x2609ef=squel[_0xf54e('0x8b')]();_0x2609ef[_0xf54e('0x6c')](_0x213dc5[_0xf54e('0x6d')]);for(var _0x1efe6a=0x0;_0x1efe6a<_0x5722a8[_0xf54e('0x33')];_0x1efe6a+=0x1){_0x22d3c1=_0x5722a8[_0x1efe6a][_0xf54e('0x6e')]?_0xccf31d[_0x5722a8[_0x1efe6a][_0xf54e('0x6e')]]['metric']:_0x5722a8[_0x1efe6a][_0xf54e('0x3d')];_0x22d3c1=_0x5722a8[_0x1efe6a][_0xf54e('0x71')]?_[_0xf54e('0x70')](_0x101508[_0x5722a8[_0x1efe6a][_0xf54e('0x71')]],'%s',_0x22d3c1):_0x22d3c1;_0x22d3c1=_0x5722a8[_0x1efe6a][_0xf54e('0x72')]?_['replace'](_0x26a293[_0x5722a8[_0x1efe6a]['format']],'%s',_0x22d3c1):_0x22d3c1;if(_0x5722a8[_0x1efe6a][_0xf54e('0x73')]){_0x2609ef[_0xf54e('0x64')](_0x22d3c1);}_0x5722a8[_0x1efe6a]['orderBy']&&_0x2609ef['order'](_0x22d3c1,_0x5722a8[_0x1efe6a][_0xf54e('0x74')]==='DESC'?![]:!![]);_0x2609ef[_0xf54e('0x3d')](_0x22d3c1,_0x5722a8[_0x1efe6a][_0xf54e('0x76')]||_0x22d3c1);}if(_0x213dc5[_0xf54e('0x77')]){_0x213dc5[_0xf54e('0x77')]=JSON[_0xf54e('0x78')](_0x213dc5[_0xf54e('0x77')]);for(var _0x50bff9=0x0;_0x50bff9<_0x213dc5[_0xf54e('0x77')][_0xf54e('0x33')];_0x50bff9+=0x1){if(_0x213dc5['joins'][_0x50bff9][_0xf54e('0x79')]&&_[_0xf54e('0x5f')](_0x1b51a5,_0x213dc5['joins'][_0x50bff9][_0xf54e('0x79')])&&_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7a')]&&_0x213dc5['joins'][_0x50bff9]['foreignTable']&&_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7c')]){_0x2609ef[_0x213dc5['joins'][_0x50bff9]['type']](_0x213dc5['joins'][_0x50bff9][_0xf54e('0x7b')],null,util[_0xf54e('0x72')](_0xf54e('0x7d'),_0x213dc5['table'],_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7a')],_0x213dc5[_0xf54e('0x77')][_0x50bff9][_0xf54e('0x7b')],_0x213dc5[_0xf54e('0x77')][_0x50bff9]['foreignKey']));}}}if(_0x213dc5['conditions']){_0x213dc5['conditions']=JSON['parse'](_0x213dc5['conditions']);_0x2609ef[_0xf54e('0x38')](_0x90ad88(_0x213dc5['conditions'][_0xf54e('0x64')]));}_0x380efc=_0x2609ef[_0xf54e('0x7f')]();_0x2609ef['limit'](_0x811fa7);_0x2609ef[_0xf54e('0x1d')](0x0);logger['debug'](_0xf54e('0x81'),_0x2609ef[_0xf54e('0x83')]());return db[_0xf54e('0x82')][_0xf54e('0x2e')](_0x2609ef[_0xf54e('0x83')](),{'type':db[_0xf54e('0x82')][_0xf54e('0x8c')]['SELECT']});}})[_0xf54e('0x24')](function(){return{'sql':_0x380efc[_0xf54e('0x83')]()};})[_0xf54e('0x24')](respondWithResult(_0x996df5,null))[_0xf54e('0x43')](handleError(_0x996df5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 6f6a42d..37cb0ed 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 _0xd104=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xd104,0xfa));var _0x4d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd104[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d10('0x0'));var util=require(_0x4d10('0x1'));var logger=require(_0x4d10('0x2'))(_0x4d10('0x3'));var moment=require(_0x4d10('0x4'));var BPromise=require(_0x4d10('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d10('0x6'));var rimraf=require(_0x4d10('0x7'));var config=require(_0x4d10('0x8'));var attributes=require(_0x4d10('0x9'));module[_0x4d10('0xa')]=function(_0x52c3bc,_0x16e682){return _0x52c3bc[_0x4d10('0xb')](_0x4d10('0xc'),attributes,{'tableName':_0x4d10('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d53=['./analyticCustomReport.attributes','AnalyticCustomReport','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d53,0x18e));var _0x38d5=function(_0x57d5e9,_0x240580){_0x57d5e9=_0x57d5e9-0x0;var _0x5976c5=_0x8d53[_0x57d5e9];return _0x5976c5;};'use strict';var _=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x38d5('0x2'));var BPromise=require(_0x38d5('0x3'));var rp=require(_0x38d5('0x4'));var fs=require('fs');var path=require(_0x38d5('0x5'));var rimraf=require(_0x38d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x38d5('0x7'));module['exports']=function(_0x13ed95,_0x13996f){return _0x13ed95['define'](_0x38d5('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index d0ab0f7..2536f98 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 _0xdbd9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x33fe40,_0x10d996){var _0x371f9f=function(_0x5bd3b4){while(--_0x5bd3b4){_0x33fe40['push'](_0x33fe40['shift']());}};_0x371f9f(++_0x10d996);}(_0xdbd9,0x1e0));var _0x9dbd=function(_0x44619d,_0x174282){_0x44619d=_0x44619d-0x0;var _0x14104b=_0xdbd9[_0x44619d];return _0x14104b;};'use strict';var _=require(_0x9dbd('0x0'));var util=require(_0x9dbd('0x1'));var moment=require(_0x9dbd('0x2'));var BPromise=require(_0x9dbd('0x3'));var rs=require(_0x9dbd('0x4'));var fs=require('fs');var Redis=require(_0x9dbd('0x5'));var db=require(_0x9dbd('0x6'))['db'];var utils=require(_0x9dbd('0x7'));var logger=require(_0x9dbd('0x8'))(_0x9dbd('0x9'));var config=require('../../config/environment');var jayson=require(_0x9dbd('0xa'));var client=jayson[_0x9dbd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x125644,_0xc8213b,_0x9a835a){return new BPromise(function(_0x1c67a1,_0x1712af){return client[_0x9dbd('0xc')](_0x125644,_0x9a835a)[_0x9dbd('0xd')](function(_0x2431dc){logger[_0x9dbd('0xe')](_0x9dbd('0xf'),_0xc8213b,_0x9dbd('0x10'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xc8213b,_0x9dbd('0x10'),JSON[_0x9dbd('0x11')](_0x2431dc));if(_0x2431dc[_0x9dbd('0x12')]){if(_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x13')]===0x1f4){logger['error'](_0x9dbd('0xf'),_0xc8213b,_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x14')]);return _0x1712af(_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x14')]);}logger[_0x9dbd('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc8213b,_0x2431dc[_0x9dbd('0x12')]['message']);return _0x1c67a1(_0x2431dc[_0x9dbd('0x12')][_0x9dbd('0x14')]);}else{logger['info'](_0x9dbd('0xf'),_0xc8213b,_0x9dbd('0x10'));_0x1c67a1(_0x2431dc[_0x9dbd('0x15')][_0x9dbd('0x14')]);}})[_0x9dbd('0x16')](function(_0x5b1fc6){logger[_0x9dbd('0x12')](_0x9dbd('0xf'),_0xc8213b,_0x5b1fc6);_0x1712af(_0x5b1fc6);});});}
\ No newline at end of file
+var _0x675a=['../../config/environment','client','http','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1caa90,_0x58970d){var _0x48e130=function(_0x2e587d){while(--_0x2e587d){_0x1caa90['push'](_0x1caa90['shift']());}};_0x48e130(++_0x58970d);}(_0x675a,0x75));var _0xa675=function(_0xd04611,_0x6f7365){_0xd04611=_0xd04611-0x0;var _0x72e2db=_0x675a[_0xd04611];return _0x72e2db;};'use strict';var _=require(_0xa675('0x0'));var util=require(_0xa675('0x1'));var moment=require(_0xa675('0x2'));var BPromise=require(_0xa675('0x3'));var rs=require(_0xa675('0x4'));var fs=require('fs');var Redis=require(_0xa675('0x5'));var db=require(_0xa675('0x6'))['db'];var utils=require(_0xa675('0x7'));var logger=require('../../config/logger')(_0xa675('0x8'));var config=require(_0xa675('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa675('0xa')][_0xa675('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdf3d76,_0x230f43,_0x4c851a){return new BPromise(function(_0x4d7e49,_0x43f2bc){return client['request'](_0xdf3d76,_0x4c851a)['then'](function(_0x414c8b){logger['info'](_0xa675('0xc'),_0x230f43,'request\x20sent');logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x230f43,_0xa675('0xd'),JSON[_0xa675('0xe')](_0x414c8b));if(_0x414c8b[_0xa675('0xf')]){if(_0x414c8b[_0xa675('0xf')][_0xa675('0x10')]===0x1f4){logger[_0xa675('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x230f43,_0x414c8b[_0xa675('0xf')]['message']);return _0x43f2bc(_0x414c8b[_0xa675('0xf')][_0xa675('0x11')]);}logger[_0xa675('0xf')](_0xa675('0xc'),_0x230f43,_0x414c8b[_0xa675('0xf')][_0xa675('0x11')]);return _0x4d7e49(_0x414c8b[_0xa675('0xf')][_0xa675('0x11')]);}else{logger[_0xa675('0x12')](_0xa675('0xc'),_0x230f43,_0xa675('0xd'));_0x4d7e49(_0x414c8b[_0xa675('0x13')][_0xa675('0x11')]);}})[_0xa675('0x14')](function(_0x4f76e1){logger[_0xa675('0xf')](_0xa675('0xc'),_0x230f43,_0x4f76e1);_0x43f2bc(_0x4f76e1);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 733992d..6a8cdd4 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 _0x7e85=['/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x13e363,_0x56bb86){var _0x572adc=function(_0x261211){while(--_0x261211){_0x13e363['push'](_0x13e363['shift']());}};_0x572adc(++_0x56bb86);}(_0x7e85,0x137));var _0x57e8=function(_0x34c0bf,_0x3b8460){_0x34c0bf=_0x34c0bf-0x0;var _0x315559=_0x7e85[_0x34c0bf];return _0x315559;};'use strict';var multer=require(_0x57e8('0x0'));var util=require('util');var path=require(_0x57e8('0x1'));var timeout=require(_0x57e8('0x2'));var express=require(_0x57e8('0x3'));var router=express[_0x57e8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x57e8('0x5'));var config=require(_0x57e8('0x6'));var controller=require(_0x57e8('0x7'));router[_0x57e8('0x8')]('/',auth[_0x57e8('0x9')](),controller[_0x57e8('0xa')]);router['get'](_0x57e8('0xb'),auth[_0x57e8('0x9')](),controller[_0x57e8('0xc')]);router[_0x57e8('0x8')](_0x57e8('0xd'),auth[_0x57e8('0x9')](),controller[_0x57e8('0xe')]);router[_0x57e8('0x8')](_0x57e8('0xf'),auth[_0x57e8('0x9')](),controller['run']);router[_0x57e8('0x8')](_0x57e8('0x10'),auth[_0x57e8('0x9')](),controller[_0x57e8('0x11')]);router[_0x57e8('0x12')]('/',auth[_0x57e8('0x9')](),controller[_0x57e8('0x13')]);router['put']('/:id',auth[_0x57e8('0x9')](),controller['update']);router[_0x57e8('0x14')]('/:id',auth[_0x57e8('0x9')](),controller[_0x57e8('0x15')]);module[_0x57e8('0x16')]=router;
\ No newline at end of file
+var _0x6fb6=['express','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','/:id/preview','preview','/:id/run','query','create','put','delete','util','path'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x6fb6,0x185));var _0x66fb=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x6fb6[_0x28d18d];return _0x470640;};'use strict';var multer=require('multer');var util=require(_0x66fb('0x0'));var path=require(_0x66fb('0x1'));var timeout=require('connect-timeout');var express=require(_0x66fb('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x66fb('0x3'));var config=require(_0x66fb('0x4'));var controller=require(_0x66fb('0x5'));router['get']('/',auth[_0x66fb('0x6')](),controller[_0x66fb('0x7')]);router[_0x66fb('0x8')](_0x66fb('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x66fb('0x8')](_0x66fb('0xa'),auth[_0x66fb('0x6')](),controller[_0x66fb('0xb')]);router['get'](_0x66fb('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x66fb('0x8')]('/:id/query',auth[_0x66fb('0x6')](),controller[_0x66fb('0xd')]);router['post']('/',auth[_0x66fb('0x6')](),controller[_0x66fb('0xe')]);router[_0x66fb('0xf')](_0x66fb('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x66fb('0x10')]('/:id',auth[_0x66fb('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 4e3585f..9d3790f 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 _0x8b7b=['exports','STRING','TEXT'];(function(_0x15add4,_0x4429c4){var _0x5f037c=function(_0x5dd37b){while(--_0x5dd37b){_0x15add4['push'](_0x15add4['shift']());}};_0x5f037c(++_0x4429c4);}(_0x8b7b,0xab));var _0xb8b7=function(_0x1580a3,_0x954f27){_0x1580a3=_0x1580a3-0x0;var _0x900bd5=_0x8b7b[_0x1580a3];return _0x900bd5;};'use strict';var Sequelize=require('sequelize');module[_0xb8b7('0x0')]={'name':{'type':Sequelize[_0xb8b7('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xb8b7('0x1')]},'table':{'type':Sequelize[_0xb8b7('0x1')]},'conditions':{'type':Sequelize[_0xb8b7('0x2')]},'joins':{'type':Sequelize[_0xb8b7('0x2')]}};
\ No newline at end of file
+var _0x234d=['sequelize','exports','STRING','TEXT'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x234d,0xac));var _0xd234=function(_0x588b77,_0x28fca2){_0x588b77=_0x588b77-0x0;var _0x561797=_0x234d[_0x588b77];return _0x561797;};'use strict';var Sequelize=require(_0xd234('0x0'));module[_0xd234('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd234('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xd234('0x2')]},'conditions':{'type':Sequelize[_0xd234('0x3')]},'joins':{'type':Sequelize[_0xd234('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index f7682bd..61579cd 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 _0xb046=['options','includeAll','include','rows','params','length','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','join','left_join','right_join','SUM(%s)','MIN(%s)','AVG(%s)','condition','getFields','Sequelize','clone','QueryTypes','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DESC','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','DefaultReports','error','stack','name','send','index','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter'];(function(_0x27e724,_0x11d0ea){var _0x2942cf=function(_0xb14f40){while(--_0xb14f40){_0x27e724['push'](_0x27e724['shift']());}};_0x2942cf(++_0x11d0ea);}(_0xb046,0x1a1));var _0x6b04=function(_0x1e9e56,_0x34a74a){_0x1e9e56=_0x1e9e56-0x0;var _0x5d5e2e=_0xb046[_0x1e9e56];return _0x5d5e2e;};'use strict';var pdf=require(_0x6b04('0x0'));var emlformat=require(_0x6b04('0x1'));var rimraf=require(_0x6b04('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b04('0x3'));var rp=require(_0x6b04('0x4'));var moment=require(_0x6b04('0x5'));var BPromise=require(_0x6b04('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6b04('0x7'));var csv=require('to-csv');var ejs=require(_0x6b04('0x8'));var fs=require('fs');var _=require(_0x6b04('0x9'));var squel=require(_0x6b04('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b04('0xb'));var deskjs=require(_0x6b04('0xc'));var toCsv=require(_0x6b04('0xd'));var querystring=require(_0x6b04('0xe'));var Papa=require(_0x6b04('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6b04('0x10'));var hardwareService=require(_0x6b04('0x11'));var logger=require('../../config/logger')(_0x6b04('0x12'));var utils=require(_0x6b04('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405e2c,_0x1e8d8b){_0x1e8d8b=_0x1e8d8b||0xcc;return function(_0x2ca385){if(_0x2ca385){return _0x405e2c[_0x6b04('0x14')](_0x1e8d8b);}return _0x405e2c['status'](_0x1e8d8b)[_0x6b04('0x15')]();};}function respondWithResult(_0x1b7ae4,_0x2079e7){_0x2079e7=_0x2079e7||0xc8;return function(_0x59c27d){if(_0x59c27d){return _0x1b7ae4['status'](_0x2079e7)['json'](_0x59c27d);}};}function respondWithFilteredResult(_0x9f7aed,_0x4c3a03){return function(_0x4eaf1d){if(_0x4eaf1d){var _0x334e4e=_0x4eaf1d[_0x6b04('0x16')],_0x472752=_0x4c3a03[_0x6b04('0x17')],_0x1f71c0=_0x4c3a03[_0x6b04('0x17')]+_0x4c3a03[_0x6b04('0x18')],_0x3444cd;if(_0x1f71c0>=_0x334e4e){_0x1f71c0=_0x334e4e;_0x3444cd=0xc8;}else{_0x3444cd=0xce;}_0x9f7aed[_0x6b04('0x19')](_0x3444cd);return _0x9f7aed[_0x6b04('0x1a')](_0x6b04('0x1b'),_0x472752+'-'+_0x1f71c0+'/'+_0x334e4e)[_0x6b04('0x1c')](_0x4eaf1d);}return null;};}function patchUpdates(_0x2b07ff){return function(_0x21b184){try{jsonpatch[_0x6b04('0x1d')](_0x21b184,_0x2b07ff,!![]);}catch(_0xc308b0){return BPromise[_0x6b04('0x1e')](_0xc308b0);}return _0x21b184[_0x6b04('0x1f')]();};}function saveUpdates(_0xc43afa,_0x5000de){return function(_0x2ee5d3){if(_0x2ee5d3){return _0x2ee5d3[_0x6b04('0x20')](_0xc43afa)[_0x6b04('0x21')](function(_0x1705d0){return _0x1705d0;});}return null;};}function removeEntity(_0x436522,_0x5b244d){return function(_0x1958c1){if(_0x1958c1){return _0x1958c1[_0x6b04('0x22')]()['then'](function(){var _0x1ec30a=_0x1958c1[_0x6b04('0x23')]({'plain':!![]});var _0x5c8139=_0x6b04('0x24');return db['UserProfileResource'][_0x6b04('0x22')]({'where':{'type':_0x5c8139,'resourceId':_0x1ec30a['id']}})[_0x6b04('0x21')](function(){return _0x1958c1;});})[_0x6b04('0x21')](function(){_0x436522[_0x6b04('0x19')](0xcc)[_0x6b04('0x15')]();});}};}function handleEntityNotFound(_0x519bd2,_0x552deb){return function(_0x6255fe){if(!_0x6255fe){_0x519bd2[_0x6b04('0x14')](0x194);}return _0x6255fe;};}function handleError(_0x4c40fd,_0x1f0307){_0x1f0307=_0x1f0307||0x1f4;return function(_0x5318d4){logger[_0x6b04('0x25')](_0x5318d4[_0x6b04('0x26')]);if(_0x5318d4['name']){delete _0x5318d4[_0x6b04('0x27')];}_0x4c40fd['status'](_0x1f0307)[_0x6b04('0x28')](_0x5318d4);};}exports[_0x6b04('0x29')]=function(_0x25b722,_0x3eff08){var _0x1e9aa5={},_0x2c1fb8={},_0x13543d={'count':0x0,'rows':[]};var _0xe31b6a=db[_0x6b04('0x2a')][_0x6b04('0x2b')];_0x2c1fb8[_0x6b04('0x2c')]=_[_0x6b04('0x2d')](_0xe31b6a);_0x2c1fb8['query']=_['keys'](_0x25b722[_0x6b04('0x2e')]);_0x2c1fb8[_0x6b04('0x2f')]=_[_0x6b04('0x30')](_0x2c1fb8[_0x6b04('0x2c')],_0x2c1fb8[_0x6b04('0x2e')]);_0x1e9aa5[_0x6b04('0x31')]=_[_0x6b04('0x30')](_0x2c1fb8['model'],qs[_0x6b04('0x32')](_0x25b722['query'][_0x6b04('0x32')]));_0x1e9aa5[_0x6b04('0x31')]=_0x1e9aa5[_0x6b04('0x31')]['length']?_0x1e9aa5['attributes']:_0x2c1fb8[_0x6b04('0x2c')];if(!_0x25b722[_0x6b04('0x2e')][_0x6b04('0x33')]('nolimit')){_0x1e9aa5[_0x6b04('0x18')]=qs[_0x6b04('0x18')](_0x25b722['query'][_0x6b04('0x18')]);_0x1e9aa5[_0x6b04('0x17')]=qs[_0x6b04('0x17')](_0x25b722[_0x6b04('0x2e')]['offset']);}_0x1e9aa5[_0x6b04('0x34')]=qs['sort'](_0x25b722[_0x6b04('0x2e')][_0x6b04('0x35')]);_0x1e9aa5[_0x6b04('0x36')]=qs[_0x6b04('0x2f')](_[_0x6b04('0x37')](_0x25b722['query'],_0x2c1fb8['filters']));if(_0x25b722[_0x6b04('0x2e')]['filter']){_0x1e9aa5[_0x6b04('0x36')]=_[_0x6b04('0x38')](_0x1e9aa5[_0x6b04('0x36')],{'$or':_[_0x6b04('0x39')](_0xe31b6a,function(_0x22d5fe){if(_0x22d5fe[_0x6b04('0x3a')][_0x6b04('0x3b')]!==_0x6b04('0x3c')){var _0x57ecb3={};_0x57ecb3[_0x22d5fe[_0x6b04('0x3d')]]={'$like':'%'+_0x25b722[_0x6b04('0x2e')][_0x6b04('0x3e')]+'%'};return _0x57ecb3;}})});}_0x1e9aa5=_['merge']({},_0x1e9aa5,_0x25b722[_0x6b04('0x3f')]);var _0x5e010d={'where':_0x1e9aa5[_0x6b04('0x36')]};return db[_0x6b04('0x2a')][_0x6b04('0x16')](_0x5e010d)[_0x6b04('0x21')](function(_0x3bd745){_0x13543d[_0x6b04('0x16')]=_0x3bd745;if(_0x25b722[_0x6b04('0x2e')][_0x6b04('0x40')]){_0x1e9aa5[_0x6b04('0x41')]=[{'all':!![]}];}return db[_0x6b04('0x2a')]['findAll'](_0x1e9aa5);})[_0x6b04('0x21')](function(_0x3ba52c){_0x13543d[_0x6b04('0x42')]=_0x3ba52c;return _0x13543d;})[_0x6b04('0x21')](respondWithFilteredResult(_0x3eff08,_0x1e9aa5))['catch'](handleError(_0x3eff08,null));};exports['show']=function(_0x4143d0,_0x132278){var _0x505577={'raw':!![],'where':{'id':_0x4143d0[_0x6b04('0x43')]['id']}},_0x253c08={};_0x253c08[_0x6b04('0x2c')]=_[_0x6b04('0x2d')](db[_0x6b04('0x2a')][_0x6b04('0x2b')]);_0x253c08[_0x6b04('0x2e')]=_[_0x6b04('0x2d')](_0x4143d0[_0x6b04('0x2e')]);_0x253c08[_0x6b04('0x2f')]=_[_0x6b04('0x30')](_0x253c08[_0x6b04('0x2c')],_0x253c08['query']);_0x505577[_0x6b04('0x31')]=_[_0x6b04('0x30')](_0x253c08[_0x6b04('0x2c')],qs[_0x6b04('0x32')](_0x4143d0['query'][_0x6b04('0x32')]));_0x505577[_0x6b04('0x31')]=_0x505577['attributes'][_0x6b04('0x44')]?_0x505577['attributes']:_0x253c08[_0x6b04('0x2c')];if(_0x4143d0[_0x6b04('0x2e')][_0x6b04('0x40')]){_0x505577[_0x6b04('0x41')]=[{'all':!![]}];}_0x505577=_[_0x6b04('0x38')]({},_0x505577,_0x4143d0['options']);return db[_0x6b04('0x2a')]['find'](_0x505577)[_0x6b04('0x21')](handleEntityNotFound(_0x132278,null))['then'](respondWithResult(_0x132278,null))[_0x6b04('0x45')](handleError(_0x132278,null));};exports[_0x6b04('0x46')]=function(_0x4da355,_0x5e5426){return db[_0x6b04('0x2a')][_0x6b04('0x46')](_0x4da355[_0x6b04('0x47')],{})['then'](function(_0x568df1){var _0x4547bd=_0x4da355['user'][_0x6b04('0x23')]({'plain':!![]});if(!_0x4547bd)throw new Error(_0x6b04('0x48'));if(_0x4547bd[_0x6b04('0x49')]===_0x6b04('0x4a')){var _0x13d0b6=_0x568df1['get']({'plain':!![]});var _0xaa4e97='Reports';return db['UserProfileSection'][_0x6b04('0x4b')]({'where':{'name':_0xaa4e97,'userProfileId':_0x4547bd['userProfileId']},'raw':!![]})[_0x6b04('0x21')](function(_0x31d85d){if(_0x31d85d&&_0x31d85d[_0x6b04('0x4c')]===0x0){return db[_0x6b04('0x4d')][_0x6b04('0x46')]({'name':_0x13d0b6[_0x6b04('0x27')],'resourceId':_0x13d0b6['id'],'type':_0x6b04('0x24'),'sectionId':_0x31d85d['id']},{})[_0x6b04('0x21')](function(){return _0x568df1;});}else{return _0x568df1;}})[_0x6b04('0x45')](function(_0x4e8b71){logger[_0x6b04('0x25')](_0x6b04('0x4e'),_0x4e8b71);throw _0x4e8b71;});}return _0x568df1;})[_0x6b04('0x21')](respondWithResult(_0x5e5426,0xc9))[_0x6b04('0x45')](handleError(_0x5e5426,null));};exports[_0x6b04('0x20')]=function(_0x3fbcf2,_0x372cba){if(_0x3fbcf2[_0x6b04('0x47')]['id']){delete _0x3fbcf2[_0x6b04('0x47')]['id'];}return db[_0x6b04('0x2a')][_0x6b04('0x4b')]({'where':{'id':_0x3fbcf2[_0x6b04('0x43')]['id']}})['then'](handleEntityNotFound(_0x372cba,null))[_0x6b04('0x21')](saveUpdates(_0x3fbcf2[_0x6b04('0x47')],null))[_0x6b04('0x21')](respondWithResult(_0x372cba,null))['catch'](handleError(_0x372cba,null));};exports[_0x6b04('0x22')]=function(_0x421e92,_0x4adc9c){return db[_0x6b04('0x2a')][_0x6b04('0x4b')]({'where':{'id':_0x421e92[_0x6b04('0x43')]['id']}})[_0x6b04('0x21')](handleEntityNotFound(_0x4adc9c,null))[_0x6b04('0x21')](removeEntity(_0x4adc9c,null))[_0x6b04('0x45')](handleError(_0x4adc9c,null));};exports['preview']=function(_0x1fd23c,_0x48e163){var _0x143026=0xa;var _0x5b1d9d=['join','left_join','right_join',_0x6b04('0x4f')];var _0x3c962e={'SUM':'SUM(%s)','COUNT':_0x6b04('0x50'),'COUNT DISTINCT':_0x6b04('0x51'),'MAX':_0x6b04('0x52'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x6b04('0x53'),'GROUP_CONCAT ASC':_0x6b04('0x54'),'GROUP_CONCAT DESC':_0x6b04('0x55')};var _0x4078f4={'SEC_TO_TIME':_0x6b04('0x56'),'DATE':_0x6b04('0x57'),'HOUR':_0x6b04('0x58'),'ROUND':_0x6b04('0x59'),'UNIX_TIMESTAMP':_0x6b04('0x5a')};var _0x298e92=function(_0x110cf1){return!_[_0x6b04('0x5b')]([_0x6b04('0x5c'),_0x6b04('0x5d'),_0x6b04('0x5e'),_0x6b04('0x5f')],_0x110cf1);};var _0x4f7eff=function(_0x2c3847){if(!_0x2c3847||!_0x2c3847['rules'][_0x6b04('0x44')]){return'';}for(var _0x4c70e8='(',_0x350e91=0x0;_0x350e91<_0x2c3847[_0x6b04('0x60')][_0x6b04('0x44')];_0x350e91+=0x1){_0x350e91>0x0&&(_0x4c70e8+='\x20'+_0x2c3847[_0x6b04('0x61')]+'\x20');_0x4c70e8+=_0x2c3847[_0x6b04('0x60')][_0x350e91][_0x6b04('0x62')]?_0x4f7eff(_0x2c3847[_0x6b04('0x60')][_0x350e91]['group']):_0x2c3847[_0x6b04('0x60')][_0x350e91][_0x6b04('0x3d')]+'\x20'+_0x2c3847[_0x6b04('0x60')][_0x350e91]['condition']+(_0x298e92(_0x2c3847[_0x6b04('0x60')][_0x350e91]['condition'])?'\x20'+_0x2c3847[_0x6b04('0x60')][_0x350e91][_0x6b04('0x63')]:'');}return _0x4c70e8+')';};var _0x17b9c2={'where':{'id':_0x1fd23c['params']['id']}},_0x495426,_0x122ce5,_0x4e449d,_0x187711,_0x47a091;_0x17b9c2=_[_0x6b04('0x38')]({},_0x17b9c2,_0x1fd23c['options']);return db[_0x6b04('0x2a')][_0x6b04('0x4b')](_0x17b9c2)[_0x6b04('0x21')](function(_0x10e1ad){if(_0x10e1ad){_0x495426=_0x10e1ad;return _0x10e1ad['getFields']();}return null;})['then'](function(_0x182044){if(_0x182044){if(!_0x182044[_0x6b04('0x44')]){throw new db['Sequelize'][(_0x6b04('0x64'))](_0x6b04('0x65'),0x193);}_0x122ce5=_0x182044;return db[_0x6b04('0x66')][_0x6b04('0x67')]({'raw':!![]});}return null;})[_0x6b04('0x21')](function(_0x32e7a3){if(_0x32e7a3){_0x4e449d=_[_0x6b04('0x68')](_0x32e7a3,'id');var _0x1ad119;var _0x5c9cfc=squel[_0x6b04('0x69')]();_0x5c9cfc[_0x6b04('0x6a')](_0x495426[_0x6b04('0x6b')]);for(var _0x376272=0x0;_0x376272<_0x122ce5[_0x6b04('0x44')];_0x376272+=0x1){_0x1ad119=_0x122ce5[_0x376272][_0x6b04('0x6c')]?_0x4e449d[_0x122ce5[_0x376272][_0x6b04('0x6c')]][_0x6b04('0x6d')]:_0x122ce5[_0x376272]['field'];_0x1ad119=_0x122ce5[_0x376272][_0x6b04('0x6e')]?_['replace'](_0x3c962e[_0x122ce5[_0x376272][_0x6b04('0x6e')]],'%s',_0x1ad119):_0x1ad119;_0x1ad119=_0x122ce5[_0x376272][_0x6b04('0x6f')]?_[_0x6b04('0x70')](_0x4078f4[_0x122ce5[_0x376272]['format']],'%s',_0x1ad119):_0x1ad119;if(_0x122ce5[_0x376272][_0x6b04('0x71')]){_0x5c9cfc[_0x6b04('0x62')](_0x1ad119);}_0x122ce5[_0x376272][_0x6b04('0x72')]&&_0x5c9cfc['order'](_0x1ad119,_0x122ce5[_0x376272][_0x6b04('0x72')]==='DESC'?![]:!![]);_0x5c9cfc[_0x6b04('0x3d')](_0x1ad119,_0x122ce5[_0x376272][_0x6b04('0x73')]||_0x1ad119);}if(_0x495426[_0x6b04('0x74')]){_0x495426[_0x6b04('0x74')]=JSON[_0x6b04('0x75')](_0x495426[_0x6b04('0x74')]);for(var _0x54dad6=0x0;_0x54dad6<_0x495426[_0x6b04('0x74')][_0x6b04('0x44')];_0x54dad6+=0x1){if(_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x3a')]&&_[_0x6b04('0x5b')](_0x5b1d9d,_0x495426[_0x6b04('0x74')][_0x54dad6]['type'])&&_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x76')]&&_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x77')]&&_0x495426['joins'][_0x54dad6][_0x6b04('0x78')]){_0x5c9cfc[_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x3a')]](_0x495426['joins'][_0x54dad6][_0x6b04('0x77')],null,util['format'](_0x6b04('0x79'),_0x495426[_0x6b04('0x6b')],_0x495426['joins'][_0x54dad6]['parentKey'],_0x495426[_0x6b04('0x74')][_0x54dad6][_0x6b04('0x77')],_0x495426['joins'][_0x54dad6][_0x6b04('0x78')]));}}}if(_0x495426[_0x6b04('0x7a')]){_0x495426[_0x6b04('0x7a')]=JSON[_0x6b04('0x75')](_0x495426[_0x6b04('0x7a')]);_0x5c9cfc[_0x6b04('0x36')](_0x4f7eff(_0x495426[_0x6b04('0x7a')][_0x6b04('0x62')]));}_0x47a091=_0x5c9cfc['clone']();_0x5c9cfc['limit'](_0x143026);_0x5c9cfc[_0x6b04('0x17')](0x0);logger[_0x6b04('0x7b')](_0x6b04('0x7c'),_0x5c9cfc[_0x6b04('0x7d')]());return db['sequelize']['query'](_0x5c9cfc[_0x6b04('0x7d')](),{'type':db[_0x6b04('0x7e')]['QueryTypes'][_0x6b04('0x7f')]});}})[_0x6b04('0x21')](respondWithResult(_0x48e163,null))[_0x6b04('0x45')](handleError(_0x48e163,null));};function runReport(_0x3d9117,_0x1801a7,_0x1dec03){var _0x2c2dc2=_0x1801a7['name'];var _0x567ebd=0xa;var _0x18ac9e=[_0x6b04('0x80'),_0x6b04('0x81'),_0x6b04('0x82'),'cross_join'];var _0x3e985b={'SUM':_0x6b04('0x83'),'COUNT':_0x6b04('0x50'),'COUNT DISTINCT':_0x6b04('0x51'),'MAX':_0x6b04('0x52'),'MIN':_0x6b04('0x84'),'AVG':_0x6b04('0x85'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6b04('0x54'),'GROUP_CONCAT DESC':_0x6b04('0x55')};var _0x4be71b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x6b04('0x59'),'UNIX_TIMESTAMP':_0x6b04('0x5a')};var _0x5118ef=function(_0x5e506a){return!_[_0x6b04('0x5b')]([_0x6b04('0x5c'),'IS\x20NOT\x20NULL',_0x6b04('0x5e'),_0x6b04('0x5f')],_0x5e506a);};var _0x3c9b8b=function(_0x327c49){if(!_0x327c49||!_0x327c49[_0x6b04('0x60')][_0x6b04('0x44')]){return'';}for(var _0x1f4426='(',_0x50b8d7=0x0;_0x50b8d7<_0x327c49[_0x6b04('0x60')][_0x6b04('0x44')];_0x50b8d7+=0x1){_0x50b8d7>0x0&&(_0x1f4426+='\x20'+_0x327c49[_0x6b04('0x61')]+'\x20');_0x1f4426+=_0x327c49['rules'][_0x50b8d7][_0x6b04('0x62')]?_0x3c9b8b(_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x62')]):_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x3d')]+'\x20'+_0x327c49[_0x6b04('0x60')][_0x50b8d7]['condition']+(_0x5118ef(_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x86')])?'\x20'+_0x327c49[_0x6b04('0x60')][_0x50b8d7][_0x6b04('0x63')]:'');}return _0x1f4426+')';};var _0x4f3701={'where':{'id':_0x3d9117['id']}},_0x89653e,_0x172354,_0x145ac6,_0x10057a,_0x4e4920;_0x4f3701=_[_0x6b04('0x38')]({},_0x4f3701,_0x1dec03);return db[_0x6b04('0x2a')][_0x6b04('0x4b')](_0x4f3701)[_0x6b04('0x21')](function(_0x415828){if(_0x415828){_0x89653e=_0x415828;return _0x415828[_0x6b04('0x87')]();}return null;})[_0x6b04('0x21')](function(_0x3b36aa){if(_0x3b36aa){if(!_0x3b36aa[_0x6b04('0x44')]){throw new db[(_0x6b04('0x88'))][(_0x6b04('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x172354=_0x3b36aa;return db['AnalyticMetric'][_0x6b04('0x67')]({'raw':!![]});}return null;})[_0x6b04('0x21')](function(_0x23c416){if(_0x23c416){_0x145ac6=_['keyBy'](_0x23c416,'id');var _0x3b6597;var _0x2c6bcd=squel[_0x6b04('0x69')]();_0x2c6bcd[_0x6b04('0x6a')](_0x89653e['table']);for(var _0x5913d8=0x0;_0x5913d8<_0x172354[_0x6b04('0x44')];_0x5913d8+=0x1){_0x3b6597=_0x172354[_0x5913d8]['MetricId']?_0x145ac6[_0x172354[_0x5913d8][_0x6b04('0x6c')]][_0x6b04('0x6d')]:_0x172354[_0x5913d8][_0x6b04('0x3d')];_0x3b6597=_0x172354[_0x5913d8][_0x6b04('0x6e')]?_['replace'](_0x3e985b[_0x172354[_0x5913d8][_0x6b04('0x6e')]],'%s',_0x3b6597):_0x3b6597;_0x3b6597=_0x172354[_0x5913d8][_0x6b04('0x6f')]?_[_0x6b04('0x70')](_0x4be71b[_0x172354[_0x5913d8]['format']],'%s',_0x3b6597):_0x3b6597;if(_0x172354[_0x5913d8]['groupBy']){_0x2c6bcd[_0x6b04('0x62')](_0x3b6597);}_0x172354[_0x5913d8][_0x6b04('0x72')]&&_0x2c6bcd[_0x6b04('0x34')](_0x3b6597,_0x172354[_0x5913d8][_0x6b04('0x72')]==='DESC'?![]:!![]);_0x2c6bcd[_0x6b04('0x3d')](_0x3b6597,_0x172354[_0x5913d8][_0x6b04('0x73')]||_0x3b6597);}if(_0x89653e[_0x6b04('0x74')]){_0x89653e[_0x6b04('0x74')]=JSON[_0x6b04('0x75')](_0x89653e[_0x6b04('0x74')]);for(var _0x54bad6=0x0;_0x54bad6<_0x89653e[_0x6b04('0x74')]['length'];_0x54bad6+=0x1){if(_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x3a')]&&_[_0x6b04('0x5b')](_0x18ac9e,_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x3a')])&&_0x89653e[_0x6b04('0x74')][_0x54bad6]['parentKey']&&_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x77')]&&_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x78')]){_0x2c6bcd[_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x3a')]](_0x89653e['joins'][_0x54bad6][_0x6b04('0x77')],null,util[_0x6b04('0x6f')](_0x6b04('0x79'),_0x89653e[_0x6b04('0x6b')],_0x89653e[_0x6b04('0x74')][_0x54bad6][_0x6b04('0x76')],_0x89653e['joins'][_0x54bad6]['foreignTable'],_0x89653e[_0x6b04('0x74')][_0x54bad6]['foreignKey']));}}}if(_0x89653e[_0x6b04('0x7a')]){_0x89653e['conditions']=JSON['parse'](_0x89653e[_0x6b04('0x7a')]);_0x2c6bcd[_0x6b04('0x36')](_0x3c9b8b(_0x89653e[_0x6b04('0x7a')][_0x6b04('0x62')]));}_0x4e4920=_0x2c6bcd[_0x6b04('0x89')]();_0x2c6bcd[_0x6b04('0x18')](_0x567ebd);_0x2c6bcd['offset'](0x0);logger[_0x6b04('0x7b')]('Limited\x20Query:',_0x2c6bcd[_0x6b04('0x7d')]());return db[_0x6b04('0x7e')]['query'](_0x2c6bcd['toString'](),{'type':db[_0x6b04('0x7e')][_0x6b04('0x8a')][_0x6b04('0x7f')]});}})['then'](function(_0x2b2283){if(!_0x2b2283[_0x6b04('0x44')]){throw new db[(_0x6b04('0x88'))][(_0x6b04('0x64'))](_0x6b04('0x8b'),0xcc);}if(_0x1801a7[_0x6b04('0x8c')]===_0x6b04('0x8d')){return null;}var _0x5c6047=_[_0x6b04('0x38')](_0x1801a7,{'name':_0x1801a7[_0x6b04('0x8e')]||_0x1801a7[_0x6b04('0x27')]||_0x89653e[_0x6b04('0x27')],'basename':_0x2c2dc2,'savename':util[_0x6b04('0x6f')](_0x6b04('0x8f'),_0x1801a7['name']||_0x89653e[_0x6b04('0x27')],require(_0x6b04('0x90'))['generate'](0x4),_0x1801a7['output']||_0x6b04('0x91')),'reportId':_0x89653e['id'],'reportType':_0x6b04('0x92')});return db[_0x6b04('0x93')]['create'](_0x5c6047,{'raw':!![]});})['then'](function(_0x555266){if(_0x89653e[_0x6b04('0x6b')]===_0x6b04('0x94')){_0x4e4920[_0x6b04('0x36')](_0x89653e[_0x6b04('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1801a7[_0x6b04('0x95')],_0x1801a7['endDate']);}else{_0x4e4920[_0x6b04('0x36')](_0x89653e[_0x6b04('0x6b')]+_0x6b04('0x96'),_0x1801a7['startDate'],_0x1801a7[_0x6b04('0x97')]);}if(_0x555266){logger['info'](_0x6b04('0x98'),_0x4e4920['toString']());require('child_process')['fork'](path[_0x6b04('0x80')](__dirname,_0x6b04('0x99'),_0x555266[_0x6b04('0x8c')]),[_0x555266['id'],_0x4e4920['toString'](),path[_0x6b04('0x80')](__dirname,_0x6b04('0x9a'),_0x555266['savename']),_0x2c2dc2]);return _0x555266;}else{var _0x37cf2f=squel[_0x6b04('0x69')]();_0x37cf2f['from']('('+_0x4e4920['toString']()+')',_0x6b04('0x9b'));_0x37cf2f[_0x6b04('0x3d')](_0x6b04('0x9c'),_0x6b04('0x16'));_0x4e4920[_0x6b04('0x18')](_0x1801a7[_0x6b04('0x18')]||_0x567ebd);_0x4e4920[_0x6b04('0x17')](_0x1801a7[_0x6b04('0x17')]||0x0);return db[_0x6b04('0x7e')]['query'](_0x37cf2f[_0x6b04('0x7d')](),{'type':db[_0x6b04('0x7e')][_0x6b04('0x8a')][_0x6b04('0x7f')]})[_0x6b04('0x21')](function(_0x1eb307){if(!_0x1eb307['length']){_0x10057a=0x0;}else{_0x10057a=_0x1eb307[0x0][_0x6b04('0x16')]||0x0;}return db['sequelize']['query'](_0x4e4920[_0x6b04('0x7d')](),{'type':db['sequelize'][_0x6b04('0x8a')][_0x6b04('0x7f')]});})[_0x6b04('0x21')](function(_0x51277b){return{'rows':_0x51277b||[],'count':_0x10057a};});}});}exports[_0x6b04('0x9d')]=function(_0x3b6249,_0xfe73e7){return runReport(_0x3b6249[_0x6b04('0x43')],_0x3b6249[_0x6b04('0x2e')],_0x3b6249[_0x6b04('0x3f')])[_0x6b04('0x21')](respondWithResult(_0xfe73e7,null))[_0x6b04('0x45')](handleError(_0xfe73e7,null));};exports[_0x6b04('0x9e')]=runReport;exports[_0x6b04('0x2e')]=function(_0x2e9940,_0x2719e9){var _0x3a7b43=0xa;var _0x482b70=[_0x6b04('0x80'),'left_join',_0x6b04('0x82'),_0x6b04('0x4f')];var _0x177a25={'SUM':'SUM(%s)','COUNT':_0x6b04('0x50'),'COUNT DISTINCT':_0x6b04('0x51'),'MAX':_0x6b04('0x52'),'MIN':_0x6b04('0x84'),'AVG':_0x6b04('0x85'),'GROUP_CONCAT':_0x6b04('0x53'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6b04('0x55')};var _0x492df9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6b04('0x57'),'HOUR':_0x6b04('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x6b04('0x5a')};var _0x307b76=function(_0x43d314){return!_[_0x6b04('0x5b')]([_0x6b04('0x5c'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x43d314);};var _0x455667=function(_0x3a4d40){if(!_0x3a4d40||!_0x3a4d40['rules'][_0x6b04('0x44')]){return'';}for(var _0xac857f='(',_0x2afe12=0x0;_0x2afe12<_0x3a4d40['rules'][_0x6b04('0x44')];_0x2afe12+=0x1){_0x2afe12>0x0&&(_0xac857f+='\x20'+_0x3a4d40['operator']+'\x20');_0xac857f+=_0x3a4d40[_0x6b04('0x60')][_0x2afe12][_0x6b04('0x62')]?_0x455667(_0x3a4d40['rules'][_0x2afe12]['group']):_0x3a4d40[_0x6b04('0x60')][_0x2afe12][_0x6b04('0x3d')]+'\x20'+_0x3a4d40[_0x6b04('0x60')][_0x2afe12][_0x6b04('0x86')]+(_0x307b76(_0x3a4d40['rules'][_0x2afe12]['condition'])?'\x20'+_0x3a4d40['rules'][_0x2afe12][_0x6b04('0x63')]:'');}return _0xac857f+')';};var _0x1ee27e={'where':{'id':_0x2e9940[_0x6b04('0x43')]['id']}},_0x40f6f8,_0x20b955,_0x13c6c9,_0x136293,_0x18bfda;_0x1ee27e=_[_0x6b04('0x38')]({},_0x1ee27e,_0x2e9940['options']);return db['AnalyticDefaultReport'][_0x6b04('0x4b')](_0x1ee27e)[_0x6b04('0x21')](function(_0x11d3e5){if(_0x11d3e5){_0x40f6f8=_0x11d3e5;return _0x11d3e5[_0x6b04('0x87')]();}return null;})['then'](function(_0x7d223e){if(_0x7d223e){if(!_0x7d223e[_0x6b04('0x44')]){throw new db[(_0x6b04('0x88'))]['ValidationErrorItem'](_0x6b04('0x65'),0x193);}_0x20b955=_0x7d223e;return db[_0x6b04('0x66')][_0x6b04('0x67')]({'raw':!![]});}return null;})['then'](function(_0x173198){if(_0x173198){_0x13c6c9=_[_0x6b04('0x68')](_0x173198,'id');var _0x376b55;var _0x18490b=squel[_0x6b04('0x69')]();_0x18490b[_0x6b04('0x6a')](_0x40f6f8[_0x6b04('0x6b')]);for(var _0xa9ef27=0x0;_0xa9ef27<_0x20b955['length'];_0xa9ef27+=0x1){_0x376b55=_0x20b955[_0xa9ef27]['MetricId']?_0x13c6c9[_0x20b955[_0xa9ef27][_0x6b04('0x6c')]][_0x6b04('0x6d')]:_0x20b955[_0xa9ef27][_0x6b04('0x3d')];_0x376b55=_0x20b955[_0xa9ef27][_0x6b04('0x6e')]?_[_0x6b04('0x70')](_0x177a25[_0x20b955[_0xa9ef27]['function']],'%s',_0x376b55):_0x376b55;_0x376b55=_0x20b955[_0xa9ef27][_0x6b04('0x6f')]?_['replace'](_0x492df9[_0x20b955[_0xa9ef27]['format']],'%s',_0x376b55):_0x376b55;if(_0x20b955[_0xa9ef27][_0x6b04('0x71')]){_0x18490b[_0x6b04('0x62')](_0x376b55);}_0x20b955[_0xa9ef27][_0x6b04('0x72')]&&_0x18490b[_0x6b04('0x34')](_0x376b55,_0x20b955[_0xa9ef27][_0x6b04('0x72')]===_0x6b04('0x9f')?![]:!![]);_0x18490b[_0x6b04('0x3d')](_0x376b55,_0x20b955[_0xa9ef27][_0x6b04('0x73')]||_0x376b55);}if(_0x40f6f8['joins']){_0x40f6f8[_0x6b04('0x74')]=JSON['parse'](_0x40f6f8[_0x6b04('0x74')]);for(var _0x46226d=0x0;_0x46226d<_0x40f6f8[_0x6b04('0x74')][_0x6b04('0x44')];_0x46226d+=0x1){if(_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x3a')]&&_[_0x6b04('0x5b')](_0x482b70,_0x40f6f8[_0x6b04('0x74')][_0x46226d]['type'])&&_0x40f6f8['joins'][_0x46226d]['parentKey']&&_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x77')]&&_0x40f6f8[_0x6b04('0x74')][_0x46226d]['foreignKey']){_0x18490b[_0x40f6f8['joins'][_0x46226d]['type']](_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x77')],null,util[_0x6b04('0x6f')](_0x6b04('0x79'),_0x40f6f8['table'],_0x40f6f8['joins'][_0x46226d][_0x6b04('0x76')],_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x77')],_0x40f6f8[_0x6b04('0x74')][_0x46226d][_0x6b04('0x78')]));}}}if(_0x40f6f8['conditions']){_0x40f6f8[_0x6b04('0x7a')]=JSON['parse'](_0x40f6f8[_0x6b04('0x7a')]);_0x18490b[_0x6b04('0x36')](_0x455667(_0x40f6f8['conditions'][_0x6b04('0x62')]));}_0x18bfda=_0x18490b[_0x6b04('0x89')]();_0x18490b[_0x6b04('0x18')](_0x3a7b43);_0x18490b[_0x6b04('0x17')](0x0);logger[_0x6b04('0x7b')]('Limited\x20Query:',_0x18490b[_0x6b04('0x7d')]());return db[_0x6b04('0x7e')][_0x6b04('0x2e')](_0x18490b[_0x6b04('0x7d')](),{'type':db['sequelize'][_0x6b04('0x8a')][_0x6b04('0x7f')]});}})[_0x6b04('0x21')](function(){return{'sql':_0x18bfda[_0x6b04('0x7d')]()};})['then'](respondWithResult(_0x2719e9,null))[_0x6b04('0x45')](handleError(_0x2719e9,null));};
\ No newline at end of file
+var _0x481a=['autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','table','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','IS\x20NOT\x20NULL','ValidationErrorItem','select','from','MetricId','order','clone','No\x20available\x20data','output','web','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','AVG(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','destroy','then','get','DefaultReports','stack','name','send','index','AnalyticDefaultReport','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','sort','filters','filter','where','type','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','role','Reports','UserProfileSection'];(function(_0x55c555,_0x449d7e){var _0x5d51d6=function(_0x5e8dc8){while(--_0x5e8dc8){_0x55c555['push'](_0x55c555['shift']());}};_0x5d51d6(++_0x449d7e);}(_0x481a,0x1a0));var _0xa481=function(_0x5353a7,_0x35c20f){_0x5353a7=_0x5353a7-0x0;var _0x2c86ac=_0x481a[_0x5353a7];return _0x2c86ac;};'use strict';var pdf=require(_0xa481('0x0'));var emlformat=require(_0xa481('0x1'));var rimraf=require(_0xa481('0x2'));var zipdir=require(_0xa481('0x3'));var jsonpatch=require(_0xa481('0x4'));var rp=require(_0xa481('0x5'));var moment=require(_0xa481('0x6'));var BPromise=require(_0xa481('0x7'));var Mustache=require(_0xa481('0x8'));var util=require(_0xa481('0x9'));var path=require(_0xa481('0xa'));var sox=require(_0xa481('0xb'));var csv=require(_0xa481('0xc'));var ejs=require(_0xa481('0xd'));var fs=require('fs');var _=require(_0xa481('0xe'));var squel=require(_0xa481('0xf'));var crypto=require('crypto');var jsforce=require(_0xa481('0x10'));var deskjs=require(_0xa481('0x11'));var toCsv=require(_0xa481('0xc'));var querystring=require(_0xa481('0x12'));var Papa=require(_0xa481('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa481('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa481('0x15'))(_0xa481('0x16'));var utils=require(_0xa481('0x17'));var config=require(_0xa481('0x18'));var db=require(_0xa481('0x19'))['db'];function respondWithStatusCode(_0x52937d,_0x161f80){_0x161f80=_0x161f80||0xcc;return function(_0x3f8969){if(_0x3f8969){return _0x52937d[_0xa481('0x1a')](_0x161f80);}return _0x52937d[_0xa481('0x1b')](_0x161f80)[_0xa481('0x1c')]();};}function respondWithResult(_0x1aabd0,_0x470fe6){_0x470fe6=_0x470fe6||0xc8;return function(_0x57ce28){if(_0x57ce28){return _0x1aabd0[_0xa481('0x1b')](_0x470fe6)[_0xa481('0x1d')](_0x57ce28);}};}function respondWithFilteredResult(_0x105bb7,_0xbc785e){return function(_0x1ff2a1){if(_0x1ff2a1){var _0x2271f0=_0x1ff2a1[_0xa481('0x1e')],_0x5ae1b9=_0xbc785e['offset'],_0x5cd5ae=_0xbc785e[_0xa481('0x1f')]+_0xbc785e[_0xa481('0x20')],_0x431109;if(_0x5cd5ae>=_0x2271f0){_0x5cd5ae=_0x2271f0;_0x431109=0xc8;}else{_0x431109=0xce;}_0x105bb7[_0xa481('0x1b')](_0x431109);return _0x105bb7[_0xa481('0x21')]('Content-Range',_0x5ae1b9+'-'+_0x5cd5ae+'/'+_0x2271f0)[_0xa481('0x1d')](_0x1ff2a1);}return null;};}function patchUpdates(_0x535af3){return function(_0x2c2d6c){try{jsonpatch[_0xa481('0x22')](_0x2c2d6c,_0x535af3,!![]);}catch(_0x1c0316){return BPromise['reject'](_0x1c0316);}return _0x2c2d6c[_0xa481('0x23')]();};}function saveUpdates(_0x12eeb1,_0x1fb155){return function(_0x4609f4){if(_0x4609f4){return _0x4609f4['update'](_0x12eeb1)['then'](function(_0x452647){return _0x452647;});}return null;};}function removeEntity(_0x37e3b9,_0x494450){return function(_0x49ade0){if(_0x49ade0){return _0x49ade0[_0xa481('0x24')]()[_0xa481('0x25')](function(){var _0x462cd4=_0x49ade0[_0xa481('0x26')]({'plain':!![]});var _0x55c2b2=_0xa481('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x55c2b2,'resourceId':_0x462cd4['id']}})[_0xa481('0x25')](function(){return _0x49ade0;});})['then'](function(){_0x37e3b9[_0xa481('0x1b')](0xcc)[_0xa481('0x1c')]();});}};}function handleEntityNotFound(_0xd0e4ec,_0x351f5e){return function(_0x26d2a4){if(!_0x26d2a4){_0xd0e4ec[_0xa481('0x1a')](0x194);}return _0x26d2a4;};}function handleError(_0x5790eb,_0x216fff){_0x216fff=_0x216fff||0x1f4;return function(_0x177484){logger['error'](_0x177484[_0xa481('0x28')]);if(_0x177484[_0xa481('0x29')]){delete _0x177484[_0xa481('0x29')];}_0x5790eb[_0xa481('0x1b')](_0x216fff)[_0xa481('0x2a')](_0x177484);};}exports[_0xa481('0x2b')]=function(_0xa4dbfa,_0x4dbb71){var _0x413be4={},_0x20ac70={},_0x5a7033={'count':0x0,'rows':[]};var _0x4c3f0a=db[_0xa481('0x2c')][_0xa481('0x2d')];_0x20ac70[_0xa481('0x2e')]=_['keys'](_0x4c3f0a);_0x20ac70['query']=_[_0xa481('0x2f')](_0xa4dbfa[_0xa481('0x30')]);_0x20ac70['filters']=_[_0xa481('0x31')](_0x20ac70[_0xa481('0x2e')],_0x20ac70['query']);_0x413be4['attributes']=_[_0xa481('0x31')](_0x20ac70[_0xa481('0x2e')],qs[_0xa481('0x32')](_0xa4dbfa[_0xa481('0x30')]['fields']));_0x413be4[_0xa481('0x33')]=_0x413be4[_0xa481('0x33')][_0xa481('0x34')]?_0x413be4[_0xa481('0x33')]:_0x20ac70[_0xa481('0x2e')];if(!_0xa4dbfa[_0xa481('0x30')]['hasOwnProperty'](_0xa481('0x35'))){_0x413be4[_0xa481('0x20')]=qs['limit'](_0xa4dbfa[_0xa481('0x30')][_0xa481('0x20')]);_0x413be4[_0xa481('0x1f')]=qs[_0xa481('0x1f')](_0xa4dbfa[_0xa481('0x30')]['offset']);}_0x413be4['order']=qs[_0xa481('0x36')](_0xa4dbfa['query'][_0xa481('0x36')]);_0x413be4['where']=qs[_0xa481('0x37')](_['pick'](_0xa4dbfa[_0xa481('0x30')],_0x20ac70[_0xa481('0x37')]));if(_0xa4dbfa[_0xa481('0x30')][_0xa481('0x38')]){_0x413be4[_0xa481('0x39')]=_['merge'](_0x413be4[_0xa481('0x39')],{'$or':_['map'](_0x4c3f0a,function(_0x312993){if(_0x312993[_0xa481('0x3a')]['key']!==_0xa481('0x3b')){var _0x1b3eb6={};_0x1b3eb6[_0x312993[_0xa481('0x3c')]]={'$like':'%'+_0xa4dbfa[_0xa481('0x30')][_0xa481('0x38')]+'%'};return _0x1b3eb6;}})});}_0x413be4=_[_0xa481('0x3d')]({},_0x413be4,_0xa4dbfa[_0xa481('0x3e')]);var _0x21e528={'where':_0x413be4[_0xa481('0x39')]};return db[_0xa481('0x2c')][_0xa481('0x1e')](_0x21e528)[_0xa481('0x25')](function(_0x3690ef){_0x5a7033[_0xa481('0x1e')]=_0x3690ef;if(_0xa4dbfa[_0xa481('0x30')][_0xa481('0x3f')]){_0x413be4[_0xa481('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport']['findAll'](_0x413be4);})[_0xa481('0x25')](function(_0x1c290a){_0x5a7033[_0xa481('0x41')]=_0x1c290a;return _0x5a7033;})[_0xa481('0x25')](respondWithFilteredResult(_0x4dbb71,_0x413be4))[_0xa481('0x42')](handleError(_0x4dbb71,null));};exports[_0xa481('0x43')]=function(_0x5ec6da,_0x1cf931){var _0x4ca0e5={'raw':!![],'where':{'id':_0x5ec6da[_0xa481('0x44')]['id']}},_0x11a34c={};_0x11a34c[_0xa481('0x2e')]=_[_0xa481('0x2f')](db['AnalyticDefaultReport'][_0xa481('0x2d')]);_0x11a34c['query']=_[_0xa481('0x2f')](_0x5ec6da[_0xa481('0x30')]);_0x11a34c[_0xa481('0x37')]=_['intersection'](_0x11a34c[_0xa481('0x2e')],_0x11a34c[_0xa481('0x30')]);_0x4ca0e5[_0xa481('0x33')]=_[_0xa481('0x31')](_0x11a34c['model'],qs[_0xa481('0x32')](_0x5ec6da['query'][_0xa481('0x32')]));_0x4ca0e5[_0xa481('0x33')]=_0x4ca0e5[_0xa481('0x33')][_0xa481('0x34')]?_0x4ca0e5[_0xa481('0x33')]:_0x11a34c['model'];if(_0x5ec6da[_0xa481('0x30')]['includeAll']){_0x4ca0e5[_0xa481('0x40')]=[{'all':!![]}];}_0x4ca0e5=_[_0xa481('0x3d')]({},_0x4ca0e5,_0x5ec6da['options']);return db['AnalyticDefaultReport'][_0xa481('0x45')](_0x4ca0e5)['then'](handleEntityNotFound(_0x1cf931,null))['then'](respondWithResult(_0x1cf931,null))[_0xa481('0x42')](handleError(_0x1cf931,null));};exports['create']=function(_0x211be0,_0x3bc48f){return db[_0xa481('0x2c')][_0xa481('0x46')](_0x211be0[_0xa481('0x47')],{})[_0xa481('0x25')](function(_0x4f791f){var _0xc4558a=_0x211be0[_0xa481('0x48')][_0xa481('0x26')]({'plain':!![]});if(!_0xc4558a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc4558a[_0xa481('0x49')]==='user'){var _0x2129bf=_0x4f791f['get']({'plain':!![]});var _0x204727=_0xa481('0x4a');return db[_0xa481('0x4b')][_0xa481('0x45')]({'where':{'name':_0x204727,'userProfileId':_0xc4558a['userProfileId']},'raw':!![]})[_0xa481('0x25')](function(_0x531081){if(_0x531081&&_0x531081[_0xa481('0x4c')]===0x0){return db[_0xa481('0x4d')][_0xa481('0x46')]({'name':_0x2129bf['name'],'resourceId':_0x2129bf['id'],'type':'DefaultReports','sectionId':_0x531081['id']},{})['then'](function(){return _0x4f791f;});}else{return _0x4f791f;}})[_0xa481('0x42')](function(_0x76a2a0){logger[_0xa481('0x4e')](_0xa481('0x4f'),_0x76a2a0);throw _0x76a2a0;});}return _0x4f791f;})[_0xa481('0x25')](respondWithResult(_0x3bc48f,0xc9))['catch'](handleError(_0x3bc48f,null));};exports[_0xa481('0x50')]=function(_0x429da2,_0x23c9a0){if(_0x429da2[_0xa481('0x47')]['id']){delete _0x429da2['body']['id'];}return db['AnalyticDefaultReport'][_0xa481('0x45')]({'where':{'id':_0x429da2[_0xa481('0x44')]['id']}})[_0xa481('0x25')](handleEntityNotFound(_0x23c9a0,null))[_0xa481('0x25')](saveUpdates(_0x429da2['body'],null))[_0xa481('0x25')](respondWithResult(_0x23c9a0,null))[_0xa481('0x42')](handleError(_0x23c9a0,null));};exports['destroy']=function(_0x5880c4,_0x2d27f4){return db[_0xa481('0x2c')][_0xa481('0x45')]({'where':{'id':_0x5880c4[_0xa481('0x44')]['id']}})[_0xa481('0x25')](handleEntityNotFound(_0x2d27f4,null))[_0xa481('0x25')](removeEntity(_0x2d27f4,null))[_0xa481('0x42')](handleError(_0x2d27f4,null));};exports[_0xa481('0x51')]=function(_0x1b337d,_0x5aa45b){var _0x4698a3=0xa;var _0x2c984f=[_0xa481('0x52'),'left_join',_0xa481('0x53'),_0xa481('0x54')];var _0x1ecd36={'SUM':_0xa481('0x55'),'COUNT':_0xa481('0x56'),'COUNT DISTINCT':_0xa481('0x57'),'MAX':_0xa481('0x58'),'MIN':_0xa481('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa481('0x5a'),'GROUP_CONCAT ASC':_0xa481('0x5b'),'GROUP_CONCAT DESC':_0xa481('0x5c')};var _0x39c6a0={'SEC_TO_TIME':_0xa481('0x5d'),'DATE':_0xa481('0x5e'),'HOUR':_0xa481('0x5f'),'ROUND':_0xa481('0x60'),'UNIX_TIMESTAMP':_0xa481('0x61')};var _0x7a5d6c=function(_0x290675){return!_[_0xa481('0x62')]([_0xa481('0x63'),'IS\x20NOT\x20NULL',_0xa481('0x64'),_0xa481('0x65')],_0x290675);};var _0x532134=function(_0x1c7e7c){if(!_0x1c7e7c||!_0x1c7e7c[_0xa481('0x66')][_0xa481('0x34')]){return'';}for(var _0x4b45e2='(',_0x374a49=0x0;_0x374a49<_0x1c7e7c[_0xa481('0x66')][_0xa481('0x34')];_0x374a49+=0x1){_0x374a49>0x0&&(_0x4b45e2+='\x20'+_0x1c7e7c[_0xa481('0x67')]+'\x20');_0x4b45e2+=_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x68')]?_0x532134(_0x1c7e7c[_0xa481('0x66')][_0x374a49]['group']):_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x3c')]+'\x20'+_0x1c7e7c[_0xa481('0x66')][_0x374a49]['condition']+(_0x7a5d6c(_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x69')])?'\x20'+_0x1c7e7c[_0xa481('0x66')][_0x374a49][_0xa481('0x6a')]:'');}return _0x4b45e2+')';};var _0x2b3220={'where':{'id':_0x1b337d[_0xa481('0x44')]['id']}},_0x2e21c4,_0x1bbffb,_0x53621c,_0x48c711,_0x5cd839;_0x2b3220=_[_0xa481('0x3d')]({},_0x2b3220,_0x1b337d[_0xa481('0x3e')]);return db['AnalyticDefaultReport'][_0xa481('0x45')](_0x2b3220)['then'](function(_0x58f63a){if(_0x58f63a){_0x2e21c4=_0x58f63a;return _0x58f63a[_0xa481('0x6b')]();}return null;})['then'](function(_0x5d86d9){if(_0x5d86d9){if(!_0x5d86d9[_0xa481('0x34')]){throw new db[(_0xa481('0x6c'))]['ValidationErrorItem'](_0xa481('0x6d'),0x193);}_0x1bbffb=_0x5d86d9;return db[_0xa481('0x6e')][_0xa481('0x6f')]({'raw':!![]});}return null;})[_0xa481('0x25')](function(_0x2fa469){if(_0x2fa469){_0x53621c=_[_0xa481('0x70')](_0x2fa469,'id');var _0x5b7ffb;var _0x1daaee=squel['select']();_0x1daaee['from'](_0x2e21c4[_0xa481('0x71')]);for(var _0x4ebbef=0x0;_0x4ebbef<_0x1bbffb[_0xa481('0x34')];_0x4ebbef+=0x1){_0x5b7ffb=_0x1bbffb[_0x4ebbef]['MetricId']?_0x53621c[_0x1bbffb[_0x4ebbef]['MetricId']][_0xa481('0x72')]:_0x1bbffb[_0x4ebbef][_0xa481('0x3c')];_0x5b7ffb=_0x1bbffb[_0x4ebbef]['function']?_[_0xa481('0x73')](_0x1ecd36[_0x1bbffb[_0x4ebbef][_0xa481('0x74')]],'%s',_0x5b7ffb):_0x5b7ffb;_0x5b7ffb=_0x1bbffb[_0x4ebbef]['format']?_[_0xa481('0x73')](_0x39c6a0[_0x1bbffb[_0x4ebbef][_0xa481('0x75')]],'%s',_0x5b7ffb):_0x5b7ffb;if(_0x1bbffb[_0x4ebbef]['groupBy']){_0x1daaee[_0xa481('0x68')](_0x5b7ffb);}_0x1bbffb[_0x4ebbef][_0xa481('0x76')]&&_0x1daaee['order'](_0x5b7ffb,_0x1bbffb[_0x4ebbef][_0xa481('0x76')]===_0xa481('0x77')?![]:!![]);_0x1daaee['field'](_0x5b7ffb,_0x1bbffb[_0x4ebbef][_0xa481('0x78')]||_0x5b7ffb);}if(_0x2e21c4[_0xa481('0x79')]){_0x2e21c4[_0xa481('0x79')]=JSON[_0xa481('0x7a')](_0x2e21c4['joins']);for(var _0x561a82=0x0;_0x561a82<_0x2e21c4['joins']['length'];_0x561a82+=0x1){if(_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x3a')]&&_[_0xa481('0x62')](_0x2c984f,_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x3a')])&&_0x2e21c4['joins'][_0x561a82][_0xa481('0x7b')]&&_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7c')]&&_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7d')]){_0x1daaee[_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x3a')]](_0x2e21c4[_0xa481('0x79')][_0x561a82]['foreignTable'],null,util[_0xa481('0x75')](_0xa481('0x7e'),_0x2e21c4['table'],_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7b')],_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7c')],_0x2e21c4[_0xa481('0x79')][_0x561a82][_0xa481('0x7d')]));}}}if(_0x2e21c4[_0xa481('0x7f')]){_0x2e21c4[_0xa481('0x7f')]=JSON[_0xa481('0x7a')](_0x2e21c4['conditions']);_0x1daaee[_0xa481('0x39')](_0x532134(_0x2e21c4[_0xa481('0x7f')][_0xa481('0x68')]));}_0x5cd839=_0x1daaee['clone']();_0x1daaee[_0xa481('0x20')](_0x4698a3);_0x1daaee[_0xa481('0x1f')](0x0);logger[_0xa481('0x80')](_0xa481('0x81'),_0x1daaee[_0xa481('0x82')]());return db[_0xa481('0x83')]['query'](_0x1daaee[_0xa481('0x82')](),{'type':db['sequelize'][_0xa481('0x84')][_0xa481('0x85')]});}})[_0xa481('0x25')](respondWithResult(_0x5aa45b,null))[_0xa481('0x42')](handleError(_0x5aa45b,null));};function runReport(_0x5dc654,_0x4687f3,_0x59a732){var _0x4c8538=_0x4687f3['name'];var _0x2404dd=0xa;var _0x38a79a=[_0xa481('0x52'),_0xa481('0x86'),'right_join',_0xa481('0x54')];var _0x872006={'SUM':_0xa481('0x55'),'COUNT':_0xa481('0x56'),'COUNT DISTINCT':_0xa481('0x57'),'MAX':_0xa481('0x58'),'MIN':_0xa481('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa481('0x5a'),'GROUP_CONCAT ASC':_0xa481('0x5b'),'GROUP_CONCAT DESC':_0xa481('0x5c')};var _0x56be0e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa481('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xa481('0x60'),'UNIX_TIMESTAMP':_0xa481('0x61')};var _0x9235a4=function(_0x1d3488){return!_[_0xa481('0x62')]([_0xa481('0x63'),_0xa481('0x87'),_0xa481('0x64'),_0xa481('0x65')],_0x1d3488);};var _0x486e8e=function(_0x3b6b09){if(!_0x3b6b09||!_0x3b6b09[_0xa481('0x66')][_0xa481('0x34')]){return'';}for(var _0x3f2ad0='(',_0x2bdd8c=0x0;_0x2bdd8c<_0x3b6b09[_0xa481('0x66')][_0xa481('0x34')];_0x2bdd8c+=0x1){_0x2bdd8c>0x0&&(_0x3f2ad0+='\x20'+_0x3b6b09[_0xa481('0x67')]+'\x20');_0x3f2ad0+=_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x68')]?_0x486e8e(_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x68')]):_0x3b6b09['rules'][_0x2bdd8c]['field']+'\x20'+_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x69')]+(_0x9235a4(_0x3b6b09[_0xa481('0x66')][_0x2bdd8c][_0xa481('0x69')])?'\x20'+_0x3b6b09['rules'][_0x2bdd8c][_0xa481('0x6a')]:'');}return _0x3f2ad0+')';};var _0x1c4538={'where':{'id':_0x5dc654['id']}},_0x13e8ec,_0x2d2046,_0x2a079a,_0x26bea0,_0x115b00;_0x1c4538=_['merge']({},_0x1c4538,_0x59a732);return db['AnalyticDefaultReport'][_0xa481('0x45')](_0x1c4538)[_0xa481('0x25')](function(_0xf47761){if(_0xf47761){_0x13e8ec=_0xf47761;return _0xf47761[_0xa481('0x6b')]();}return null;})[_0xa481('0x25')](function(_0x3c7586){if(_0x3c7586){if(!_0x3c7586[_0xa481('0x34')]){throw new db[(_0xa481('0x6c'))][(_0xa481('0x88'))](_0xa481('0x6d'),0x193);}_0x2d2046=_0x3c7586;return db[_0xa481('0x6e')][_0xa481('0x6f')]({'raw':!![]});}return null;})['then'](function(_0x1132e4){if(_0x1132e4){_0x2a079a=_[_0xa481('0x70')](_0x1132e4,'id');var _0x269b01;var _0x41078d=squel[_0xa481('0x89')]();_0x41078d[_0xa481('0x8a')](_0x13e8ec[_0xa481('0x71')]);for(var _0x1a0080=0x0;_0x1a0080<_0x2d2046[_0xa481('0x34')];_0x1a0080+=0x1){_0x269b01=_0x2d2046[_0x1a0080][_0xa481('0x8b')]?_0x2a079a[_0x2d2046[_0x1a0080][_0xa481('0x8b')]][_0xa481('0x72')]:_0x2d2046[_0x1a0080][_0xa481('0x3c')];_0x269b01=_0x2d2046[_0x1a0080][_0xa481('0x74')]?_[_0xa481('0x73')](_0x872006[_0x2d2046[_0x1a0080][_0xa481('0x74')]],'%s',_0x269b01):_0x269b01;_0x269b01=_0x2d2046[_0x1a0080][_0xa481('0x75')]?_[_0xa481('0x73')](_0x56be0e[_0x2d2046[_0x1a0080]['format']],'%s',_0x269b01):_0x269b01;if(_0x2d2046[_0x1a0080]['groupBy']){_0x41078d[_0xa481('0x68')](_0x269b01);}_0x2d2046[_0x1a0080][_0xa481('0x76')]&&_0x41078d[_0xa481('0x8c')](_0x269b01,_0x2d2046[_0x1a0080]['orderBy']==='DESC'?![]:!![]);_0x41078d['field'](_0x269b01,_0x2d2046[_0x1a0080][_0xa481('0x78')]||_0x269b01);}if(_0x13e8ec[_0xa481('0x79')]){_0x13e8ec['joins']=JSON['parse'](_0x13e8ec[_0xa481('0x79')]);for(var _0x11278d=0x0;_0x11278d<_0x13e8ec[_0xa481('0x79')][_0xa481('0x34')];_0x11278d+=0x1){if(_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x3a')]&&_[_0xa481('0x62')](_0x38a79a,_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x3a')])&&_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7b')]&&_0x13e8ec['joins'][_0x11278d][_0xa481('0x7c')]&&_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7d')]){_0x41078d[_0x13e8ec['joins'][_0x11278d]['type']](_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7c')],null,util[_0xa481('0x75')](_0xa481('0x7e'),_0x13e8ec['table'],_0x13e8ec['joins'][_0x11278d][_0xa481('0x7b')],_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7c')],_0x13e8ec[_0xa481('0x79')][_0x11278d][_0xa481('0x7d')]));}}}if(_0x13e8ec['conditions']){_0x13e8ec[_0xa481('0x7f')]=JSON['parse'](_0x13e8ec[_0xa481('0x7f')]);_0x41078d['where'](_0x486e8e(_0x13e8ec[_0xa481('0x7f')][_0xa481('0x68')]));}_0x115b00=_0x41078d[_0xa481('0x8d')]();_0x41078d[_0xa481('0x20')](_0x2404dd);_0x41078d['offset'](0x0);logger['debug'](_0xa481('0x81'),_0x41078d[_0xa481('0x82')]());return db[_0xa481('0x83')][_0xa481('0x30')](_0x41078d[_0xa481('0x82')](),{'type':db['sequelize'][_0xa481('0x84')]['SELECT']});}})[_0xa481('0x25')](function(_0x52c30f){if(!_0x52c30f[_0xa481('0x34')]){throw new db['Sequelize'][(_0xa481('0x88'))](_0xa481('0x8e'),0xcc);}if(_0x4687f3[_0xa481('0x8f')]===_0xa481('0x90')){return null;}var _0x1c874a=_[_0xa481('0x3d')](_0x4687f3,{'name':_0x4687f3['fullPath']||_0x4687f3[_0xa481('0x29')]||_0x13e8ec[_0xa481('0x29')],'basename':_0x4c8538,'savename':util[_0xa481('0x75')]('%s-%s.%s',_0x4687f3[_0xa481('0x29')]||_0x13e8ec['name'],require(_0xa481('0x91'))[_0xa481('0x92')](0x4),_0x4687f3[_0xa481('0x8f')]||_0xa481('0x93')),'reportId':_0x13e8ec['id'],'reportType':'default'});return db[_0xa481('0x94')][_0xa481('0x46')](_0x1c874a,{'raw':!![]});})[_0xa481('0x25')](function(_0x530131){if(_0x13e8ec[_0xa481('0x71')]===_0xa481('0x95')){_0x115b00[_0xa481('0x39')](_0x13e8ec[_0xa481('0x71')]+_0xa481('0x96'),_0x4687f3[_0xa481('0x97')],_0x4687f3['endDate']);}else{_0x115b00[_0xa481('0x39')](_0x13e8ec[_0xa481('0x71')]+_0xa481('0x98'),_0x4687f3[_0xa481('0x97')],_0x4687f3['endDate']);}if(_0x530131){logger['info'](_0xa481('0x99'),_0x115b00[_0xa481('0x82')]());require(_0xa481('0x9a'))[_0xa481('0x9b')](path[_0xa481('0x52')](__dirname,_0xa481('0x9c'),_0x530131[_0xa481('0x8f')]),[_0x530131['id'],_0x115b00[_0xa481('0x82')](),path[_0xa481('0x52')](__dirname,_0xa481('0x9d'),_0x530131[_0xa481('0x9e')]),_0x4c8538]);return _0x530131;}else{var _0x3ea440=squel['select']();_0x3ea440['from']('('+_0x115b00['toString']()+')',_0xa481('0x9f'));_0x3ea440[_0xa481('0x3c')](_0xa481('0xa0'),'count');_0x115b00[_0xa481('0x20')](_0x4687f3[_0xa481('0x20')]||_0x2404dd);_0x115b00[_0xa481('0x1f')](_0x4687f3[_0xa481('0x1f')]||0x0);return db[_0xa481('0x83')][_0xa481('0x30')](_0x3ea440[_0xa481('0x82')](),{'type':db['sequelize'][_0xa481('0x84')][_0xa481('0x85')]})[_0xa481('0x25')](function(_0x2d35f0){if(!_0x2d35f0[_0xa481('0x34')]){_0x26bea0=0x0;}else{_0x26bea0=_0x2d35f0[0x0][_0xa481('0x1e')]||0x0;}return db[_0xa481('0x83')][_0xa481('0x30')](_0x115b00[_0xa481('0x82')](),{'type':db[_0xa481('0x83')][_0xa481('0x84')][_0xa481('0x85')]});})['then'](function(_0x2c25a9){return{'rows':_0x2c25a9||[],'count':_0x26bea0};});}});}exports[_0xa481('0xa1')]=function(_0x427c65,_0x2832a8){return runReport(_0x427c65[_0xa481('0x44')],_0x427c65[_0xa481('0x30')],_0x427c65[_0xa481('0x3e')])[_0xa481('0x25')](respondWithResult(_0x2832a8,null))[_0xa481('0x42')](handleError(_0x2832a8,null));};exports[_0xa481('0xa2')]=runReport;exports['query']=function(_0x598ccf,_0x213249){var _0x17cba9=0xa;var _0x38f586=[_0xa481('0x52'),_0xa481('0x86'),_0xa481('0x53'),_0xa481('0x54')];var _0x143149={'SUM':'SUM(%s)','COUNT':_0xa481('0x56'),'COUNT DISTINCT':_0xa481('0x57'),'MAX':'MAX(%s)','MIN':_0xa481('0x59'),'AVG':_0xa481('0xa3'),'GROUP_CONCAT':_0xa481('0x5a'),'GROUP_CONCAT ASC':_0xa481('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x49d6b1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa481('0x5e'),'HOUR':_0xa481('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa481('0x61')};var _0x1eb238=function(_0x110f3c){return!_['includes']([_0xa481('0x63'),_0xa481('0x87'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x110f3c);};var _0x41884b=function(_0x239453){if(!_0x239453||!_0x239453[_0xa481('0x66')]['length']){return'';}for(var _0x1b125b='(',_0x54b6ee=0x0;_0x54b6ee<_0x239453[_0xa481('0x66')][_0xa481('0x34')];_0x54b6ee+=0x1){_0x54b6ee>0x0&&(_0x1b125b+='\x20'+_0x239453['operator']+'\x20');_0x1b125b+=_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x68')]?_0x41884b(_0x239453['rules'][_0x54b6ee][_0xa481('0x68')]):_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x3c')]+'\x20'+_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x69')]+(_0x1eb238(_0x239453[_0xa481('0x66')][_0x54b6ee][_0xa481('0x69')])?'\x20'+_0x239453[_0xa481('0x66')][_0x54b6ee]['value']:'');}return _0x1b125b+')';};var _0x32d9bc={'where':{'id':_0x598ccf['params']['id']}},_0x2729e0,_0x4a5718,_0x220c49,_0x491d55,_0x3cc056;_0x32d9bc=_[_0xa481('0x3d')]({},_0x32d9bc,_0x598ccf[_0xa481('0x3e')]);return db[_0xa481('0x2c')][_0xa481('0x45')](_0x32d9bc)[_0xa481('0x25')](function(_0x371911){if(_0x371911){_0x2729e0=_0x371911;return _0x371911[_0xa481('0x6b')]();}return null;})[_0xa481('0x25')](function(_0x1d4c86){if(_0x1d4c86){if(!_0x1d4c86[_0xa481('0x34')]){throw new db['Sequelize'][(_0xa481('0x88'))](_0xa481('0x6d'),0x193);}_0x4a5718=_0x1d4c86;return db[_0xa481('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xa481('0x25')](function(_0x5615ee){if(_0x5615ee){_0x220c49=_[_0xa481('0x70')](_0x5615ee,'id');var _0x3a90f1;var _0x4551c0=squel['select']();_0x4551c0[_0xa481('0x8a')](_0x2729e0[_0xa481('0x71')]);for(var _0x33cac2=0x0;_0x33cac2<_0x4a5718[_0xa481('0x34')];_0x33cac2+=0x1){_0x3a90f1=_0x4a5718[_0x33cac2][_0xa481('0x8b')]?_0x220c49[_0x4a5718[_0x33cac2][_0xa481('0x8b')]][_0xa481('0x72')]:_0x4a5718[_0x33cac2][_0xa481('0x3c')];_0x3a90f1=_0x4a5718[_0x33cac2][_0xa481('0x74')]?_['replace'](_0x143149[_0x4a5718[_0x33cac2][_0xa481('0x74')]],'%s',_0x3a90f1):_0x3a90f1;_0x3a90f1=_0x4a5718[_0x33cac2][_0xa481('0x75')]?_[_0xa481('0x73')](_0x49d6b1[_0x4a5718[_0x33cac2]['format']],'%s',_0x3a90f1):_0x3a90f1;if(_0x4a5718[_0x33cac2]['groupBy']){_0x4551c0[_0xa481('0x68')](_0x3a90f1);}_0x4a5718[_0x33cac2]['orderBy']&&_0x4551c0['order'](_0x3a90f1,_0x4a5718[_0x33cac2][_0xa481('0x76')]===_0xa481('0x77')?![]:!![]);_0x4551c0[_0xa481('0x3c')](_0x3a90f1,_0x4a5718[_0x33cac2][_0xa481('0x78')]||_0x3a90f1);}if(_0x2729e0['joins']){_0x2729e0[_0xa481('0x79')]=JSON[_0xa481('0x7a')](_0x2729e0[_0xa481('0x79')]);for(var _0x303d06=0x0;_0x303d06<_0x2729e0[_0xa481('0x79')][_0xa481('0x34')];_0x303d06+=0x1){if(_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x3a')]&&_[_0xa481('0x62')](_0x38f586,_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x3a')])&&_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7b')]&&_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7c')]&&_0x2729e0['joins'][_0x303d06][_0xa481('0x7d')]){_0x4551c0[_0x2729e0['joins'][_0x303d06]['type']](_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7c')],null,util['format'](_0xa481('0x7e'),_0x2729e0[_0xa481('0x71')],_0x2729e0[_0xa481('0x79')][_0x303d06]['parentKey'],_0x2729e0['joins'][_0x303d06][_0xa481('0x7c')],_0x2729e0[_0xa481('0x79')][_0x303d06][_0xa481('0x7d')]));}}}if(_0x2729e0[_0xa481('0x7f')]){_0x2729e0[_0xa481('0x7f')]=JSON[_0xa481('0x7a')](_0x2729e0['conditions']);_0x4551c0[_0xa481('0x39')](_0x41884b(_0x2729e0['conditions'][_0xa481('0x68')]));}_0x3cc056=_0x4551c0[_0xa481('0x8d')]();_0x4551c0['limit'](_0x17cba9);_0x4551c0[_0xa481('0x1f')](0x0);logger[_0xa481('0x80')](_0xa481('0x81'),_0x4551c0[_0xa481('0x82')]());return db[_0xa481('0x83')][_0xa481('0x30')](_0x4551c0[_0xa481('0x82')](),{'type':db[_0xa481('0x83')]['QueryTypes']['SELECT']});}})[_0xa481('0x25')](function(){return{'sql':_0x3cc056['toString']()};})[_0xa481('0x25')](respondWithResult(_0x213249,null))[_0xa481('0x42')](handleError(_0x213249,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 338d006..29208a1 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 _0xf2bc=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0xa200af,_0x180ca4){var _0x3d485a=function(_0x56ba33){while(--_0x56ba33){_0xa200af['push'](_0xa200af['shift']());}};_0x3d485a(++_0x180ca4);}(_0xf2bc,0x134));var _0xcf2b=function(_0x5d7299,_0x544bc0){_0x5d7299=_0x5d7299-0x0;var _0x3125ea=_0xf2bc[_0x5d7299];return _0x3125ea;};'use strict';var _=require('lodash');var util=require(_0xcf2b('0x0'));var logger=require(_0xcf2b('0x1'))('api');var moment=require(_0xcf2b('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf2b('0x3'));var fs=require('fs');var path=require(_0xcf2b('0x4'));var rimraf=require(_0xcf2b('0x5'));var config=require(_0xcf2b('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0xcf2b('0x7')]=function(_0x34615a,_0x5ed704){return _0x34615a[_0xcf2b('0x8')](_0xcf2b('0x9'),attributes,{'tableName':_0xcf2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x67b3=['rimraf','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','request-promise'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0x67b3,0x98));var _0x367b=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x67b3[_0x23b655];return _0x364b32;};'use strict';var _=require(_0x367b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x367b('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x367b('0x2'));var config=require('../../config/environment');var attributes=require(_0x367b('0x3'));module[_0x367b('0x4')]=function(_0x4ab23f,_0x13b65f){return _0x4ab23f[_0x367b('0x5')]('AnalyticDefaultReport',attributes,{'tableName':_0x367b('0x6'),'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 b57dfab..dc960b6 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 _0x61a5=['rpc','../../config/environment','jayson/promise','client','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x332de3,_0x38077f){var _0x5ce62d=function(_0x4cabdc){while(--_0x4cabdc){_0x332de3['push'](_0x332de3['shift']());}};_0x5ce62d(++_0x38077f);}(_0x61a5,0x19e));var _0x561a=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0x61a5[_0x335a62];return _0x249a9a;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x561a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x561a('0x4'));var logger=require(_0x561a('0x5'))(_0x561a('0x6'));var config=require(_0x561a('0x7'));var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a763a,_0x4c2853,_0x3d020c){return new BPromise(function(_0x27e026,_0xe056b2){return client['request'](_0x2a763a,_0x3d020c)[_0x561a('0xb')](function(_0x2a0fdb){logger['info'](_0x561a('0xc'),_0x4c2853,_0x561a('0xd'));logger[_0x561a('0xe')](_0x561a('0xf'),_0x4c2853,'request\x20sent',JSON['stringify'](_0x2a0fdb));if(_0x2a0fdb[_0x561a('0x10')]){if(_0x2a0fdb[_0x561a('0x10')][_0x561a('0x11')]===0x1f4){logger[_0x561a('0x10')](_0x561a('0xc'),_0x4c2853,_0x2a0fdb[_0x561a('0x10')][_0x561a('0x12')]);return _0xe056b2(_0x2a0fdb[_0x561a('0x10')]['message']);}logger[_0x561a('0x10')](_0x561a('0xc'),_0x4c2853,_0x2a0fdb[_0x561a('0x10')][_0x561a('0x12')]);return _0x27e026(_0x2a0fdb['error'][_0x561a('0x12')]);}else{logger['info'](_0x561a('0xc'),_0x4c2853,_0x561a('0xd'));_0x27e026(_0x2a0fdb[_0x561a('0x13')][_0x561a('0x12')]);}})[_0x561a('0x14')](function(_0xb777ee){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4c2853,_0xb777ee);_0xe056b2(_0xb777ee);});});}
\ No newline at end of file
+var _0x3611=['debug','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x18011b,_0x5e6516){var _0x14722e=function(_0x5d22c7){while(--_0x5d22c7){_0x18011b['push'](_0x18011b['shift']());}};_0x14722e(++_0x5e6516);}(_0x3611,0x136));var _0x1361=function(_0x4ac3da,_0x5e1c98){_0x4ac3da=_0x4ac3da-0x0;var _0x32055d=_0x3611[_0x4ac3da];return _0x32055d;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1361('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1361('0x2'))['db'];var utils=require(_0x1361('0x3'));var logger=require(_0x1361('0x4'))(_0x1361('0x5'));var config=require('../../config/environment');var jayson=require(_0x1361('0x6'));var client=jayson[_0x1361('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x216d22,_0x4da71d,_0x2af7c4){return new BPromise(function(_0x49cfad,_0x5cc29f){return client[_0x1361('0x8')](_0x216d22,_0x2af7c4)[_0x1361('0x9')](function(_0x146242){logger[_0x1361('0xa')](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));logger[_0x1361('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4da71d,_0x1361('0xc'),JSON['stringify'](_0x146242));if(_0x146242['error']){if(_0x146242[_0x1361('0xe')]['code']===0x1f4){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242[_0x1361('0xe')][_0x1361('0xf')]);return _0x5cc29f(_0x146242[_0x1361('0xe')][_0x1361('0xf')]);}logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x146242['error']['message']);return _0x49cfad(_0x146242[_0x1361('0xe')]['message']);}else{logger['info'](_0x1361('0xb'),_0x4da71d,_0x1361('0xc'));_0x49cfad(_0x146242[_0x1361('0x10')][_0x1361('0xf')]);}})['catch'](function(_0x1bb588){logger[_0x1361('0xe')](_0x1361('0xb'),_0x4da71d,_0x1bb588);_0x5cc29f(_0x1bb588);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index fc5fbbc..7f963b5 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 _0xab25=['../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x125425,_0x4b6bab){var _0xd04dc4=function(_0x37fc01){while(--_0x37fc01){_0x125425['push'](_0x125425['shift']());}};_0xd04dc4(++_0x4b6bab);}(_0xab25,0x1f3));var _0x5ab2=function(_0x562030,_0x535185){_0x562030=_0x562030-0x0;var _0x386332=_0xab25[_0x562030];return _0x386332;};'use strict';var multer=require(_0x5ab2('0x0'));var util=require(_0x5ab2('0x1'));var path=require(_0x5ab2('0x2'));var timeout=require(_0x5ab2('0x3'));var express=require(_0x5ab2('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5ab2('0x5'));var config=require(_0x5ab2('0x6'));var controller=require(_0x5ab2('0x7'));router[_0x5ab2('0x8')]('/',auth[_0x5ab2('0x9')](),controller[_0x5ab2('0xa')]);router[_0x5ab2('0x8')]('/:id',auth[_0x5ab2('0x9')](),controller[_0x5ab2('0xb')]);router[_0x5ab2('0x8')](_0x5ab2('0xc'),auth[_0x5ab2('0x9')](),controller[_0x5ab2('0xd')]);router['get'](_0x5ab2('0xe'),auth['isAuthenticated'](),controller[_0x5ab2('0xf')]);router[_0x5ab2('0x8')](_0x5ab2('0x10'),auth[_0x5ab2('0x9')](),controller[_0x5ab2('0x11')]);router[_0x5ab2('0x12')]('/',auth[_0x5ab2('0x9')](),controller['create']);router[_0x5ab2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5ab2('0x14')]);router[_0x5ab2('0x15')]('/:id',auth[_0x5ab2('0x9')](),controller[_0x5ab2('0x16')]);module[_0x5ab2('0x17')]=router;
\ No newline at end of file
+var _0x0465=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0465,0xbb));var _0x5046=function(_0x36b493,_0x47f91d){_0x36b493=_0x36b493-0x0;var _0x147c9e=_0x0465[_0x36b493];return _0x147c9e;};'use strict';var multer=require(_0x5046('0x0'));var util=require(_0x5046('0x1'));var path=require(_0x5046('0x2'));var timeout=require(_0x5046('0x3'));var express=require(_0x5046('0x4'));var router=express['Router']();var auth=require(_0x5046('0x5'));var interaction=require(_0x5046('0x6'));var config=require(_0x5046('0x7'));var controller=require(_0x5046('0x8'));router['get']('/',auth[_0x5046('0x9')](),controller[_0x5046('0xa')]);router['get'](_0x5046('0xb'),auth[_0x5046('0x9')](),controller[_0x5046('0xc')]);router[_0x5046('0xd')](_0x5046('0xe'),auth[_0x5046('0x9')](),controller[_0x5046('0xf')]);router[_0x5046('0xd')](_0x5046('0x10'),auth['isAuthenticated'](),controller[_0x5046('0x11')]);router[_0x5046('0xd')](_0x5046('0x12'),auth[_0x5046('0x9')](),controller[_0x5046('0x13')]);router[_0x5046('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5046('0x15')](_0x5046('0xb'),auth[_0x5046('0x9')](),controller[_0x5046('0x16')]);router[_0x5046('0x17')](_0x5046('0xb'),auth[_0x5046('0x9')](),controller[_0x5046('0x18')]);module[_0x5046('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 557863c..ce5272b 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 _0x4031=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4031,0x11f));var _0x1403=function(_0x47c70e,_0x3286c5){_0x47c70e=_0x47c70e-0x0;var _0x32d390=_0x4031[_0x47c70e];return _0x32d390;};'use strict';var Sequelize=require(_0x1403('0x0'));var moment=require(_0x1403('0x1'));module[_0x1403('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x1403('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x1403('0x4')](_0x1403('0x5'),_0x1403('0x6'),_0x1403('0x7')),'allowNull':![],'defaultValue':_0x1403('0x5')},'savename':{'type':Sequelize[_0x1403('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1403('0x8')]},'endDate':{'type':Sequelize[_0x1403('0x8')]},'status':{'type':Sequelize[_0x1403('0x3')],'defaultValue':_0x1403('0x9')},'type':{'type':Sequelize[_0x1403('0x4')](_0x1403('0xa'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x1403('0xb')](0xb)[_0x1403('0xc')]},'reportType':{'type':Sequelize[_0x1403('0x3')]}};
\ No newline at end of file
+var _0xde38=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf','xlsx','csv'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xde38,0x13a));var _0x8de3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde38[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8de3('0x0'));var moment=require(_0x8de3('0x1'));module[_0x8de3('0x2')]={'name':{'type':Sequelize[_0x8de3('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8de3('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8de3('0x4')]('csv',_0x8de3('0x5'),_0x8de3('0x6')),'allowNull':![],'defaultValue':_0x8de3('0x7')},'savename':{'type':Sequelize[_0x8de3('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8de3('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8de3('0x3')],'defaultValue':_0x8de3('0x9')},'type':{'type':Sequelize[_0x8de3('0x4')](_0x8de3('0xa'),_0x8de3('0xb')),'allowNull':![],'defaultValue':_0x8de3('0xa')},'reportId':{'type':Sequelize[_0x8de3('0xc')](0xb)[_0x8de3('0xd')]},'reportType':{'type':Sequelize[_0x8de3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 526a6ea..c973739 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 _0xf74d=['offset','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','AnalyticExtractedReport','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','map','type','field','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x56aa10,_0x4ed9ad){var _0x55c260=function(_0x4e9266){while(--_0x4e9266){_0x56aa10['push'](_0x56aa10['shift']());}};_0x55c260(++_0x4ed9ad);}(_0xf74d,0x168));var _0xdf74=function(_0x39aea9,_0x4abe65){_0x39aea9=_0x39aea9-0x0;var _0x28e90e=_0xf74d[_0x39aea9];return _0x28e90e;};'use strict';var pdf=require(_0xdf74('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf74('0x1'));var jsonpatch=require(_0xdf74('0x2'));var rp=require(_0xdf74('0x3'));var moment=require(_0xdf74('0x4'));var BPromise=require(_0xdf74('0x5'));var Mustache=require(_0xdf74('0x6'));var util=require('util');var path=require(_0xdf74('0x7'));var sox=require(_0xdf74('0x8'));var csv=require(_0xdf74('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdf74('0xa'));var crypto=require(_0xdf74('0xb'));var jsforce=require(_0xdf74('0xc'));var deskjs=require(_0xdf74('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdf74('0xe'));var Papa=require(_0xdf74('0xf'));var Redis=require(_0xdf74('0x10'));var authService=require(_0xdf74('0x11'));var qs=require(_0xdf74('0x12'));var as=require(_0xdf74('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf74('0x14'))(_0xdf74('0x15'));var utils=require('../../config/utils');var config=require(_0xdf74('0x16'));var db=require(_0xdf74('0x17'))['db'];function respondWithStatusCode(_0x4bd947,_0x556cbc){_0x556cbc=_0x556cbc||0xcc;return function(_0x4880ff){if(_0x4880ff){return _0x4bd947[_0xdf74('0x18')](_0x556cbc);}return _0x4bd947[_0xdf74('0x19')](_0x556cbc)[_0xdf74('0x1a')]();};}function respondWithResult(_0x4813a8,_0x184da5){_0x184da5=_0x184da5||0xc8;return function(_0x560fa7){if(_0x560fa7){return _0x4813a8[_0xdf74('0x19')](_0x184da5)[_0xdf74('0x1b')](_0x560fa7);}};}function respondWithFilteredResult(_0x405153,_0x240fef){return function(_0x33f826){if(_0x33f826){var _0x5bddf2=_0x33f826['count'],_0x2a31cf=_0x240fef[_0xdf74('0x1c')],_0x511dcf=_0x240fef[_0xdf74('0x1c')]+_0x240fef['limit'],_0xd37575;if(_0x511dcf>=_0x5bddf2){_0x511dcf=_0x5bddf2;_0xd37575=0xc8;}else{_0xd37575=0xce;}_0x405153[_0xdf74('0x19')](_0xd37575);return _0x405153['set'](_0xdf74('0x1d'),_0x2a31cf+'-'+_0x511dcf+'/'+_0x5bddf2)[_0xdf74('0x1b')](_0x33f826);}return null;};}function patchUpdates(_0x27c376){return function(_0x375252){try{jsonpatch[_0xdf74('0x1e')](_0x375252,_0x27c376,!![]);}catch(_0x30f2f4){return BPromise[_0xdf74('0x1f')](_0x30f2f4);}return _0x375252[_0xdf74('0x20')]();};}function saveUpdates(_0x5734f1,_0xe5783c){return function(_0x5a3d68){if(_0x5a3d68){return _0x5a3d68[_0xdf74('0x21')](_0x5734f1)[_0xdf74('0x22')](function(_0x45fde0){return _0x45fde0;});}return null;};}function removeEntity(_0x361d08,_0x5b10dd){return function(_0x13db6c){if(_0x13db6c){return _0x13db6c['destroy']()['then'](function(){var _0x4a1321=_0x13db6c[_0xdf74('0x23')]({'plain':!![]});var _0x4fe153=_0xdf74('0x24');return db[_0xdf74('0x25')][_0xdf74('0x26')]({'where':{'type':_0x4fe153,'resourceId':_0x4a1321['id']}})[_0xdf74('0x22')](function(){return _0x13db6c;});})['then'](function(){_0x361d08['status'](0xcc)[_0xdf74('0x1a')]();});}};}function handleEntityNotFound(_0x17cfab,_0x1fe550){return function(_0x30afd4){if(!_0x30afd4){_0x17cfab[_0xdf74('0x18')](0x194);}return _0x30afd4;};}function handleError(_0x41adc6,_0x5b90ed){_0x5b90ed=_0x5b90ed||0x1f4;return function(_0xc56d41){logger[_0xdf74('0x27')](_0xc56d41[_0xdf74('0x28')]);if(_0xc56d41[_0xdf74('0x29')]){delete _0xc56d41[_0xdf74('0x29')];}_0x41adc6[_0xdf74('0x19')](_0x5b90ed)[_0xdf74('0x2a')](_0xc56d41);};}exports[_0xdf74('0x2b')]=function(_0x50d1c7,_0x3a9cbe){var _0x697a8d={},_0x4deec7={},_0x167e5b={'count':0x0,'rows':[]};var _0x43fe02=db[_0xdf74('0x2c')]['rawAttributes'];_0x4deec7[_0xdf74('0x2d')]=_['keys'](_0x43fe02);_0x4deec7[_0xdf74('0x2e')]=_[_0xdf74('0x2f')](_0x50d1c7[_0xdf74('0x2e')]);_0x4deec7['filters']=_['intersection'](_0x4deec7['model'],_0x4deec7[_0xdf74('0x2e')]);_0x697a8d['attributes']=_[_0xdf74('0x30')](_0x4deec7['model'],qs[_0xdf74('0x31')](_0x50d1c7[_0xdf74('0x2e')]['fields']));_0x697a8d[_0xdf74('0x32')]=_0x697a8d[_0xdf74('0x32')][_0xdf74('0x33')]?_0x697a8d[_0xdf74('0x32')]:_0x4deec7['model'];if(!_0x50d1c7['query'][_0xdf74('0x34')](_0xdf74('0x35'))){_0x697a8d[_0xdf74('0x36')]=qs[_0xdf74('0x36')](_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x36')]);_0x697a8d[_0xdf74('0x1c')]=qs[_0xdf74('0x1c')](_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x1c')]);}_0x697a8d[_0xdf74('0x37')]=qs[_0xdf74('0x38')](_0x50d1c7[_0xdf74('0x2e')]['sort']);_0x697a8d[_0xdf74('0x39')]=qs[_0xdf74('0x3a')](_['pick'](_0x50d1c7['query'],_0x4deec7['filters']));if(_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x3b')]){_0x697a8d['where']=_[_0xdf74('0x3c')](_0x697a8d[_0xdf74('0x39')],{'$or':_[_0xdf74('0x3d')](_0x43fe02,function(_0x14abc7){if(_0x14abc7[_0xdf74('0x3e')]['key']!=='VIRTUAL'){var _0xea808e={};_0xea808e[_0x14abc7[_0xdf74('0x3f')]]={'$like':'%'+_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x3b')]+'%'};return _0xea808e;}})});}_0x697a8d=_[_0xdf74('0x3c')]({},_0x697a8d,_0x50d1c7[_0xdf74('0x40')]);var _0x28b6a1={'where':_0x697a8d[_0xdf74('0x39')]};return db['AnalyticExtractedReport'][_0xdf74('0x41')](_0x28b6a1)[_0xdf74('0x22')](function(_0x45c787){_0x167e5b['count']=_0x45c787;if(_0x50d1c7[_0xdf74('0x2e')][_0xdf74('0x42')]){_0x697a8d[_0xdf74('0x43')]=[{'all':!![]}];}return db[_0xdf74('0x2c')][_0xdf74('0x44')](_0x697a8d);})['then'](function(_0xcb290b){_0x167e5b[_0xdf74('0x45')]=_0xcb290b;return _0x167e5b;})[_0xdf74('0x22')](respondWithFilteredResult(_0x3a9cbe,_0x697a8d))['catch'](handleError(_0x3a9cbe,null));};exports[_0xdf74('0x46')]=function(_0x11bcdc,_0x4b898a){var _0x54f799={'raw':!![],'where':{'id':_0x11bcdc[_0xdf74('0x47')]['id']}},_0x1205a1={};_0x1205a1[_0xdf74('0x2d')]=_[_0xdf74('0x2f')](db['AnalyticExtractedReport']['rawAttributes']);_0x1205a1[_0xdf74('0x2e')]=_[_0xdf74('0x2f')](_0x11bcdc[_0xdf74('0x2e')]);_0x1205a1[_0xdf74('0x3a')]=_[_0xdf74('0x30')](_0x1205a1['model'],_0x1205a1[_0xdf74('0x2e')]);_0x54f799[_0xdf74('0x32')]=_['intersection'](_0x1205a1['model'],qs['fields'](_0x11bcdc[_0xdf74('0x2e')][_0xdf74('0x31')]));_0x54f799['attributes']=_0x54f799[_0xdf74('0x32')][_0xdf74('0x33')]?_0x54f799[_0xdf74('0x32')]:_0x1205a1[_0xdf74('0x2d')];if(_0x11bcdc['query'][_0xdf74('0x42')]){_0x54f799[_0xdf74('0x43')]=[{'all':!![]}];}_0x54f799=_['merge']({},_0x54f799,_0x11bcdc[_0xdf74('0x40')]);return db[_0xdf74('0x2c')][_0xdf74('0x48')](_0x54f799)[_0xdf74('0x22')](handleEntityNotFound(_0x4b898a,null))[_0xdf74('0x22')](respondWithResult(_0x4b898a,null))[_0xdf74('0x49')](handleError(_0x4b898a,null));};exports['create']=function(_0x44b137,_0x3e90d4){return db[_0xdf74('0x2c')][_0xdf74('0x4a')](_0x44b137['body'],{})['then'](function(_0x2d7f58){var _0x2d2074=_0x44b137[_0xdf74('0x4b')]['get']({'plain':!![]});if(!_0x2d2074)throw new Error(_0xdf74('0x4c'));if(_0x2d2074[_0xdf74('0x4d')]===_0xdf74('0x4b')){var _0x31f67d=_0x2d7f58[_0xdf74('0x23')]({'plain':!![]});var _0x241c11=_0xdf74('0x24');return db[_0xdf74('0x4e')]['find']({'where':{'name':_0x241c11,'userProfileId':_0x2d2074[_0xdf74('0x4f')]},'raw':!![]})[_0xdf74('0x22')](function(_0x30edd9){if(_0x30edd9&&_0x30edd9[_0xdf74('0x50')]===0x0){return db['UserProfileResource'][_0xdf74('0x4a')]({'name':_0x31f67d[_0xdf74('0x29')],'resourceId':_0x31f67d['id'],'type':_0x30edd9[_0xdf74('0x29')],'sectionId':_0x30edd9['id']},{})[_0xdf74('0x22')](function(){return _0x2d7f58;});}else{return _0x2d7f58;}})[_0xdf74('0x49')](function(_0x367ead){logger[_0xdf74('0x27')](_0xdf74('0x51'),_0x367ead);throw _0x367ead;});}return _0x2d7f58;})['then'](respondWithResult(_0x3e90d4,0xc9))[_0xdf74('0x49')](handleError(_0x3e90d4,null));};exports['update']=function(_0x1c7746,_0x14f798){if(_0x1c7746[_0xdf74('0x52')]['id']){delete _0x1c7746[_0xdf74('0x52')]['id'];}return db[_0xdf74('0x2c')][_0xdf74('0x48')]({'where':{'id':_0x1c7746[_0xdf74('0x47')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x14f798,null))[_0xdf74('0x22')](saveUpdates(_0x1c7746['body'],null))[_0xdf74('0x22')](respondWithResult(_0x14f798,null))[_0xdf74('0x49')](handleError(_0x14f798,null));};exports['destroy']=function(_0x5a94a8,_0x34a044){return db[_0xdf74('0x2c')][_0xdf74('0x48')]({'where':{'id':_0x5a94a8[_0xdf74('0x47')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x34a044,null))[_0xdf74('0x22')](removeEntity(_0x34a044,null))['catch'](handleError(_0x34a044,null));};exports[_0xdf74('0x53')]=function(_0x2dd34c,_0x5ac332,_0x528d06){return db[_0xdf74('0x2c')]['find']({'where':{'id':_0x2dd34c[_0xdf74('0x47')]['id']},'attributes':[_0xdf74('0x29'),_0xdf74('0x54'),_0xdf74('0x55'),_0xdf74('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x5ac332,null))[_0xdf74('0x22')](function(_0x1e3e42){if(_0x1e3e42){if(!fs[_0xdf74('0x57')](path[_0xdf74('0x58')](config[_0xdf74('0x59')],'server/files/reports',_0x1e3e42[_0xdf74('0x55')]))){throw new db[(_0xdf74('0x5a'))]['ValidationError'](_0xdf74('0x5b'));}if(_0x2dd34c[_0xdf74('0x2e')][_0xdf74('0x5c')]){return _0x5ac332['sendStatus'](0xc8);}return _0x5ac332['download'](path['join'](config[_0xdf74('0x59')],_0xdf74('0x5d'),_0x1e3e42['savename']),util[_0xdf74('0x5e')](_0xdf74('0x5f'),_0x1e3e42[_0xdf74('0x54')]||_0x1e3e42['name'],_0x1e3e42[_0xdf74('0x56')][_0xdf74('0x60')]()));}})[_0xdf74('0x49')](handleError(_0x5ac332,null));};
\ No newline at end of file
+var _0x8cfc=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','map','type','VIRTUAL','field','include','findAll','catch','show','includeAll','find','create'];(function(_0x3b5d58,_0xe4b936){var _0x1613a4=function(_0x5b8d78){while(--_0x5b8d78){_0x3b5d58['push'](_0x3b5d58['shift']());}};_0x1613a4(++_0xe4b936);}(_0x8cfc,0x6f));var _0xc8cf=function(_0x925c71,_0x1023b3){_0x925c71=_0x925c71-0x0;var _0x103e9b=_0x8cfc[_0x925c71];return _0x103e9b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc8cf('0x0'));var rimraf=require(_0xc8cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8cf('0x2'));var rp=require(_0xc8cf('0x3'));var moment=require('moment');var BPromise=require(_0xc8cf('0x4'));var Mustache=require(_0xc8cf('0x5'));var util=require(_0xc8cf('0x6'));var path=require('path');var sox=require(_0xc8cf('0x7'));var csv=require(_0xc8cf('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc8cf('0x9'));var squel=require(_0xc8cf('0xa'));var crypto=require(_0xc8cf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc8cf('0x8'));var querystring=require(_0xc8cf('0xc'));var Papa=require(_0xc8cf('0xd'));var Redis=require(_0xc8cf('0xe'));var authService=require(_0xc8cf('0xf'));var qs=require(_0xc8cf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8cf('0x11'));var logger=require(_0xc8cf('0x12'))(_0xc8cf('0x13'));var utils=require(_0xc8cf('0x14'));var config=require('../../config/environment');var db=require(_0xc8cf('0x15'))['db'];function respondWithStatusCode(_0x3bc437,_0x1ef4be){_0x1ef4be=_0x1ef4be||0xcc;return function(_0x4e3b8f){if(_0x4e3b8f){return _0x3bc437[_0xc8cf('0x16')](_0x1ef4be);}return _0x3bc437[_0xc8cf('0x17')](_0x1ef4be)[_0xc8cf('0x18')]();};}function respondWithResult(_0x32fa25,_0x51cb10){_0x51cb10=_0x51cb10||0xc8;return function(_0x26eddf){if(_0x26eddf){return _0x32fa25['status'](_0x51cb10)[_0xc8cf('0x19')](_0x26eddf);}};}function respondWithFilteredResult(_0xa11256,_0x331c09){return function(_0x5c2c17){if(_0x5c2c17){var _0x3b61db=_0x5c2c17[_0xc8cf('0x1a')],_0x554c74=_0x331c09[_0xc8cf('0x1b')],_0x1585e9=_0x331c09[_0xc8cf('0x1b')]+_0x331c09[_0xc8cf('0x1c')],_0x3db77a;if(_0x1585e9>=_0x3b61db){_0x1585e9=_0x3b61db;_0x3db77a=0xc8;}else{_0x3db77a=0xce;}_0xa11256[_0xc8cf('0x17')](_0x3db77a);return _0xa11256[_0xc8cf('0x1d')](_0xc8cf('0x1e'),_0x554c74+'-'+_0x1585e9+'/'+_0x3b61db)[_0xc8cf('0x19')](_0x5c2c17);}return null;};}function patchUpdates(_0x335a88){return function(_0x27fab9){try{jsonpatch['apply'](_0x27fab9,_0x335a88,!![]);}catch(_0x555903){return BPromise[_0xc8cf('0x1f')](_0x555903);}return _0x27fab9['save']();};}function saveUpdates(_0x58296a,_0x3b8c2e){return function(_0x5916d2){if(_0x5916d2){return _0x5916d2[_0xc8cf('0x20')](_0x58296a)[_0xc8cf('0x21')](function(_0x24853f){return _0x24853f;});}return null;};}function removeEntity(_0x4bd3c4,_0x3b8bb0){return function(_0xad7d92){if(_0xad7d92){return _0xad7d92[_0xc8cf('0x22')]()[_0xc8cf('0x21')](function(){var _0xa9c5c3=_0xad7d92['get']({'plain':!![]});var _0xf4fc32=_0xc8cf('0x23');return db[_0xc8cf('0x24')][_0xc8cf('0x22')]({'where':{'type':_0xf4fc32,'resourceId':_0xa9c5c3['id']}})[_0xc8cf('0x21')](function(){return _0xad7d92;});})[_0xc8cf('0x21')](function(){_0x4bd3c4[_0xc8cf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2643ab,_0x4b7613){return function(_0x746ee7){if(!_0x746ee7){_0x2643ab[_0xc8cf('0x16')](0x194);}return _0x746ee7;};}function handleError(_0x6977dd,_0x4cfc31){_0x4cfc31=_0x4cfc31||0x1f4;return function(_0xacc5f){logger[_0xc8cf('0x25')](_0xacc5f[_0xc8cf('0x26')]);if(_0xacc5f[_0xc8cf('0x27')]){delete _0xacc5f[_0xc8cf('0x27')];}_0x6977dd[_0xc8cf('0x17')](_0x4cfc31)[_0xc8cf('0x28')](_0xacc5f);};}exports[_0xc8cf('0x29')]=function(_0x1a6686,_0x5d12eb){var _0x3f04f8={},_0x26dc65={},_0x2e5599={'count':0x0,'rows':[]};var _0x341bde=db[_0xc8cf('0x2a')][_0xc8cf('0x2b')];_0x26dc65['model']=_[_0xc8cf('0x2c')](_0x341bde);_0x26dc65['query']=_[_0xc8cf('0x2c')](_0x1a6686[_0xc8cf('0x2d')]);_0x26dc65['filters']=_['intersection'](_0x26dc65['model'],_0x26dc65[_0xc8cf('0x2d')]);_0x3f04f8[_0xc8cf('0x2e')]=_[_0xc8cf('0x2f')](_0x26dc65[_0xc8cf('0x30')],qs[_0xc8cf('0x31')](_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x31')]));_0x3f04f8['attributes']=_0x3f04f8[_0xc8cf('0x2e')][_0xc8cf('0x32')]?_0x3f04f8['attributes']:_0x26dc65[_0xc8cf('0x30')];if(!_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x33')](_0xc8cf('0x34'))){_0x3f04f8[_0xc8cf('0x1c')]=qs[_0xc8cf('0x1c')](_0x1a6686[_0xc8cf('0x2d')]['limit']);_0x3f04f8[_0xc8cf('0x1b')]=qs['offset'](_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x1b')]);}_0x3f04f8['order']=qs['sort'](_0x1a6686[_0xc8cf('0x2d')]['sort']);_0x3f04f8[_0xc8cf('0x35')]=qs['filters'](_[_0xc8cf('0x36')](_0x1a6686['query'],_0x26dc65[_0xc8cf('0x37')]));if(_0x1a6686[_0xc8cf('0x2d')][_0xc8cf('0x38')]){_0x3f04f8['where']=_[_0xc8cf('0x39')](_0x3f04f8[_0xc8cf('0x35')],{'$or':_[_0xc8cf('0x3a')](_0x341bde,function(_0x3fe6ff){if(_0x3fe6ff[_0xc8cf('0x3b')]['key']!==_0xc8cf('0x3c')){var _0x36c6d4={};_0x36c6d4[_0x3fe6ff[_0xc8cf('0x3d')]]={'$like':'%'+_0x1a6686['query']['filter']+'%'};return _0x36c6d4;}})});}_0x3f04f8=_['merge']({},_0x3f04f8,_0x1a6686['options']);var _0x13d3cf={'where':_0x3f04f8[_0xc8cf('0x35')]};return db[_0xc8cf('0x2a')][_0xc8cf('0x1a')](_0x13d3cf)[_0xc8cf('0x21')](function(_0x3c48c1){_0x2e5599['count']=_0x3c48c1;if(_0x1a6686['query']['includeAll']){_0x3f04f8[_0xc8cf('0x3e')]=[{'all':!![]}];}return db[_0xc8cf('0x2a')][_0xc8cf('0x3f')](_0x3f04f8);})['then'](function(_0x2791fc){_0x2e5599['rows']=_0x2791fc;return _0x2e5599;})['then'](respondWithFilteredResult(_0x5d12eb,_0x3f04f8))[_0xc8cf('0x40')](handleError(_0x5d12eb,null));};exports[_0xc8cf('0x41')]=function(_0x1665fd,_0x5a9eb8){var _0x1ad4f5={'raw':!![],'where':{'id':_0x1665fd['params']['id']}},_0x2acec7={};_0x2acec7[_0xc8cf('0x30')]=_[_0xc8cf('0x2c')](db[_0xc8cf('0x2a')][_0xc8cf('0x2b')]);_0x2acec7[_0xc8cf('0x2d')]=_['keys'](_0x1665fd[_0xc8cf('0x2d')]);_0x2acec7[_0xc8cf('0x37')]=_[_0xc8cf('0x2f')](_0x2acec7[_0xc8cf('0x30')],_0x2acec7['query']);_0x1ad4f5['attributes']=_[_0xc8cf('0x2f')](_0x2acec7[_0xc8cf('0x30')],qs[_0xc8cf('0x31')](_0x1665fd[_0xc8cf('0x2d')]['fields']));_0x1ad4f5[_0xc8cf('0x2e')]=_0x1ad4f5[_0xc8cf('0x2e')][_0xc8cf('0x32')]?_0x1ad4f5[_0xc8cf('0x2e')]:_0x2acec7[_0xc8cf('0x30')];if(_0x1665fd[_0xc8cf('0x2d')][_0xc8cf('0x42')]){_0x1ad4f5[_0xc8cf('0x3e')]=[{'all':!![]}];}_0x1ad4f5=_['merge']({},_0x1ad4f5,_0x1665fd['options']);return db[_0xc8cf('0x2a')][_0xc8cf('0x43')](_0x1ad4f5)[_0xc8cf('0x21')](handleEntityNotFound(_0x5a9eb8,null))[_0xc8cf('0x21')](respondWithResult(_0x5a9eb8,null))[_0xc8cf('0x40')](handleError(_0x5a9eb8,null));};exports[_0xc8cf('0x44')]=function(_0x2b9172,_0x528379){return db['AnalyticExtractedReport']['create'](_0x2b9172[_0xc8cf('0x45')],{})[_0xc8cf('0x21')](function(_0x11ef83){var _0x4c8475=_0x2b9172[_0xc8cf('0x46')][_0xc8cf('0x47')]({'plain':!![]});if(!_0x4c8475)throw new Error(_0xc8cf('0x48'));if(_0x4c8475['role']===_0xc8cf('0x46')){var _0x54dae8=_0x11ef83[_0xc8cf('0x47')]({'plain':!![]});var _0x79b953=_0xc8cf('0x23');return db[_0xc8cf('0x49')][_0xc8cf('0x43')]({'where':{'name':_0x79b953,'userProfileId':_0x4c8475[_0xc8cf('0x4a')]},'raw':!![]})[_0xc8cf('0x21')](function(_0x2228a3){if(_0x2228a3&&_0x2228a3[_0xc8cf('0x4b')]===0x0){return db[_0xc8cf('0x24')][_0xc8cf('0x44')]({'name':_0x54dae8['name'],'resourceId':_0x54dae8['id'],'type':_0x2228a3[_0xc8cf('0x27')],'sectionId':_0x2228a3['id']},{})[_0xc8cf('0x21')](function(){return _0x11ef83;});}else{return _0x11ef83;}})[_0xc8cf('0x40')](function(_0x33c7e2){logger[_0xc8cf('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33c7e2);throw _0x33c7e2;});}return _0x11ef83;})[_0xc8cf('0x21')](respondWithResult(_0x528379,0xc9))[_0xc8cf('0x40')](handleError(_0x528379,null));};exports[_0xc8cf('0x20')]=function(_0x26fe22,_0x110f23){if(_0x26fe22[_0xc8cf('0x45')]['id']){delete _0x26fe22['body']['id'];}return db[_0xc8cf('0x2a')][_0xc8cf('0x43')]({'where':{'id':_0x26fe22[_0xc8cf('0x4c')]['id']}})[_0xc8cf('0x21')](handleEntityNotFound(_0x110f23,null))[_0xc8cf('0x21')](saveUpdates(_0x26fe22['body'],null))[_0xc8cf('0x21')](respondWithResult(_0x110f23,null))['catch'](handleError(_0x110f23,null));};exports[_0xc8cf('0x22')]=function(_0x1ba443,_0x2e391b){return db[_0xc8cf('0x2a')][_0xc8cf('0x43')]({'where':{'id':_0x1ba443[_0xc8cf('0x4c')]['id']}})[_0xc8cf('0x21')](handleEntityNotFound(_0x2e391b,null))[_0xc8cf('0x21')](removeEntity(_0x2e391b,null))[_0xc8cf('0x40')](handleError(_0x2e391b,null));};exports['download']=function(_0x1ac9f2,_0x3bc4d7,_0x105577){return db[_0xc8cf('0x2a')][_0xc8cf('0x43')]({'where':{'id':_0x1ac9f2['params']['id']},'attributes':[_0xc8cf('0x27'),_0xc8cf('0x4d'),'savename',_0xc8cf('0x4e')],'raw':!![]})[_0xc8cf('0x21')](handleEntityNotFound(_0x3bc4d7,null))[_0xc8cf('0x21')](function(_0x33859f){if(_0x33859f){if(!fs[_0xc8cf('0x4f')](path[_0xc8cf('0x50')](config['root'],_0xc8cf('0x51'),_0x33859f[_0xc8cf('0x52')]))){throw new db[(_0xc8cf('0x53'))][(_0xc8cf('0x54'))](_0xc8cf('0x55'));}if(_0x1ac9f2[_0xc8cf('0x2d')][_0xc8cf('0x56')]){return _0x3bc4d7[_0xc8cf('0x16')](0xc8);}return _0x3bc4d7[_0xc8cf('0x57')](path[_0xc8cf('0x50')](config[_0xc8cf('0x58')],_0xc8cf('0x51'),_0x33859f[_0xc8cf('0x52')]),util[_0xc8cf('0x59')]('%s.%s',_0x33859f['basename']||_0x33859f['name'],_0x33859f[_0xc8cf('0x4e')]['toLowerCase']()));}})[_0xc8cf('0x40')](handleError(_0x3bc4d7,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index b0cb36b..6c09a80 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 _0xacea=['bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x455a49,_0x441ef7){var _0x2c1e7a=function(_0x3e4d77){while(--_0x3e4d77){_0x455a49['push'](_0x455a49['shift']());}};_0x2c1e7a(++_0x441ef7);}(_0xacea,0x1aa));var _0xaace=function(_0x111b3a,_0x3da8ca){_0x111b3a=_0x111b3a-0x0;var _0x84738=_0xacea[_0x111b3a];return _0x84738;};'use strict';var _=require('lodash');var util=require(_0xaace('0x0'));var logger=require(_0xaace('0x1'))(_0xaace('0x2'));var moment=require('moment');var BPromise=require(_0xaace('0x3'));var rp=require(_0xaace('0x4'));var fs=require('fs');var path=require(_0xaace('0x5'));var rimraf=require(_0xaace('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xaace('0x7')]=function(_0x4fc429,_0x376e41){return _0x4fc429[_0xaace('0x8')](_0xaace('0x9'),attributes,{'tableName':_0xaace('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9bb=['moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0xe92ee7,_0x4673be){var _0x391438=function(_0x8e6352){while(--_0x8e6352){_0xe92ee7['push'](_0xe92ee7['shift']());}};_0x391438(++_0x4673be);}(_0xe9bb,0xe0));var _0xbe9b=function(_0x50352a,_0x3cf37e){_0x50352a=_0x50352a-0x0;var _0x4e1204=_0xe9bb[_0x50352a];return _0x4e1204;};'use strict';var _=require(_0xbe9b('0x0'));var util=require(_0xbe9b('0x1'));var logger=require(_0xbe9b('0x2'))(_0xbe9b('0x3'));var moment=require(_0xbe9b('0x4'));var BPromise=require(_0xbe9b('0x5'));var rp=require(_0xbe9b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe9b('0x7'));var attributes=require(_0xbe9b('0x8'));module[_0xbe9b('0x9')]=function(_0x4b6166,_0x3c1caa){return _0x4b6166['define'](_0xbe9b('0xa'),attributes,{'tableName':_0xbe9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 53db8a3..daa24d1 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 _0x614f=['error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x439585,_0x2c35f9){var _0x58a8b4=function(_0x1b9b1c){while(--_0x1b9b1c){_0x439585['push'](_0x439585['shift']());}};_0x58a8b4(++_0x2c35f9);}(_0x614f,0xe1));var _0xf614=function(_0x551d78,_0x268406){_0x551d78=_0x551d78-0x0;var _0xeff191=_0x614f[_0x551d78];return _0xeff191;};'use strict';var _=require(_0xf614('0x0'));var util=require(_0xf614('0x1'));var moment=require(_0xf614('0x2'));var BPromise=require('bluebird');var rs=require(_0xf614('0x3'));var fs=require('fs');var Redis=require(_0xf614('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf614('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf614('0x6'));var client=jayson[_0xf614('0x7')][_0xf614('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x163439,_0x327ff4,_0x5ef85f){return new BPromise(function(_0xc64bbd,_0x16484c){return client[_0xf614('0x9')](_0x163439,_0x5ef85f)[_0xf614('0xa')](function(_0x30592a){logger[_0xf614('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x327ff4,_0xf614('0xc'));logger[_0xf614('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x327ff4,_0xf614('0xc'),JSON[_0xf614('0xe')](_0x30592a));if(_0x30592a[_0xf614('0xf')]){if(_0x30592a[_0xf614('0xf')][_0xf614('0x10')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x327ff4,_0x30592a['error'][_0xf614('0x11')]);return _0x16484c(_0x30592a[_0xf614('0xf')]['message']);}logger[_0xf614('0xf')](_0xf614('0x12'),_0x327ff4,_0x30592a[_0xf614('0xf')][_0xf614('0x11')]);return _0xc64bbd(_0x30592a[_0xf614('0xf')]['message']);}else{logger[_0xf614('0xb')](_0xf614('0x12'),_0x327ff4,'request\x20sent');_0xc64bbd(_0x30592a[_0xf614('0x13')][_0xf614('0x11')]);}})['catch'](function(_0x4eb990){logger[_0xf614('0xf')](_0xf614('0x12'),_0x327ff4,_0x4eb990);_0x16484c(_0x4eb990);});});}
\ No newline at end of file
+var _0x7801=['catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x7801,0x8d));var _0x1780=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x7801[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x1780('0x0'));var util=require(_0x1780('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1780('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1780('0x3'))['db'];var utils=require(_0x1780('0x4'));var logger=require(_0x1780('0x5'))(_0x1780('0x6'));var config=require('../../config/environment');var jayson=require(_0x1780('0x7'));var client=jayson[_0x1780('0x8')][_0x1780('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40409f,_0x47fab3,_0x33cc2a){return new BPromise(function(_0x1d236c,_0x8753c6){return client[_0x1780('0xa')](_0x40409f,_0x33cc2a)[_0x1780('0xb')](function(_0x27db22){logger['info'](_0x1780('0xc'),_0x47fab3,_0x1780('0xd'));logger[_0x1780('0xe')](_0x1780('0xf'),_0x47fab3,_0x1780('0xd'),JSON['stringify'](_0x27db22));if(_0x27db22['error']){if(_0x27db22[_0x1780('0x10')][_0x1780('0x11')]===0x1f4){logger['error'](_0x1780('0xc'),_0x47fab3,_0x27db22['error']['message']);return _0x8753c6(_0x27db22[_0x1780('0x10')][_0x1780('0x12')]);}logger[_0x1780('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47fab3,_0x27db22[_0x1780('0x10')]['message']);return _0x1d236c(_0x27db22[_0x1780('0x10')][_0x1780('0x12')]);}else{logger['info'](_0x1780('0xc'),_0x47fab3,_0x1780('0xd'));_0x1d236c(_0x27db22['result']['message']);}})[_0x1780('0x13')](function(_0x59bf93){logger['error'](_0x1780('0xc'),_0x47fab3,_0x59bf93);_0x8753c6(_0x59bf93);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 21a8a76..1a0e8d2 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 _0xe3f3=['isAuthenticated','show','/:id/download','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0xe3f3,0xed));var _0x3e3f=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xe3f3[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var path=require(_0x3e3f('0x2'));var timeout=require(_0x3e3f('0x3'));var express=require(_0x3e3f('0x4'));var router=express['Router']();var auth=require(_0x3e3f('0x5'));var interaction=require(_0x3e3f('0x6'));var config=require(_0x3e3f('0x7'));var controller=require(_0x3e3f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3e3f('0x9')]('/:id',auth[_0x3e3f('0xa')](),controller[_0x3e3f('0xb')]);router[_0x3e3f('0x9')](_0x3e3f('0xc'),auth[_0x3e3f('0xa')](),controller['download']);router[_0x3e3f('0xd')]('/',auth[_0x3e3f('0xa')](),controller[_0x3e3f('0xe')]);router[_0x3e3f('0xf')](_0x3e3f('0x10'),auth[_0x3e3f('0xa')](),controller['update']);router[_0x3e3f('0x11')](_0x3e3f('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3e3f('0x12')]=router;
\ No newline at end of file
+var _0x0897=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','update','delete','destroy','exports','multer'];(function(_0x88bd2,_0xfc6f02){var _0x3d9d26=function(_0x3349f1){while(--_0x3349f1){_0x88bd2['push'](_0x88bd2['shift']());}};_0x3d9d26(++_0xfc6f02);}(_0x0897,0x167));var _0x7089=function(_0x5bde3b,_0x4544c8){_0x5bde3b=_0x5bde3b-0x0;var _0x488dd6=_0x0897[_0x5bde3b];return _0x488dd6;};'use strict';var multer=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var path=require(_0x7089('0x2'));var timeout=require(_0x7089('0x3'));var express=require('express');var router=express[_0x7089('0x4')]();var auth=require(_0x7089('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7089('0x6'));var controller=require(_0x7089('0x7'));router[_0x7089('0x8')]('/',auth[_0x7089('0x9')](),controller[_0x7089('0xa')]);router[_0x7089('0x8')](_0x7089('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7089('0x8')](_0x7089('0xc'),auth[_0x7089('0x9')](),controller[_0x7089('0xd')]);router[_0x7089('0xe')]('/',auth[_0x7089('0x9')](),controller[_0x7089('0xf')]);router['put'](_0x7089('0xb'),auth[_0x7089('0x9')](),controller[_0x7089('0x10')]);router[_0x7089('0x11')](_0x7089('0xb'),auth['isAuthenticated'](),controller[_0x7089('0x12')]);module[_0x7089('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 84023dc..6ac41fb 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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x51a58c,_0x5b0474){var _0x513149=function(_0x5e374f){while(--_0x5e374f){_0x51a58c['push'](_0x51a58c['shift']());}};_0x513149(++_0x5b0474);}(_0x814b,0x1a2));var _0xb814=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0x814b[_0x3213b7];return _0xb960bf;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x503481,_0x2c0dfc){var _0x4b8897=function(_0x3704ec){while(--_0x3704ec){_0x503481['push'](_0x503481['shift']());}};_0x4b8897(++_0x2c0dfc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'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 89fef2e..f1cdecd 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 _0xa9e0=['ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','AnalyticFieldReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','findOne','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox'];(function(_0x2e1683,_0x10801c){var _0x3600e0=function(_0x55a63c){while(--_0x55a63c){_0x2e1683['push'](_0x2e1683['shift']());}};_0x3600e0(++_0x10801c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=db[_0x0a9e('0x26')][_0x0a9e('0x27')];_0x45a1e7[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x1dc186);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7['filters']=_[_0x0a9e('0x2b')](_0x45a1e7[_0x0a9e('0x28')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_['intersection'](_0x45a1e7[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2e')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x28')];if(!_0x526cf3['query'][_0x0a9e('0x2f')]('nolimit')){_0x479bc4[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x30')]);_0x479bc4[_0x0a9e('0x18')]=qs['offset'](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x479bc4[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x479bc4[_0x0a9e('0x33')]=qs[_0x0a9e('0x34')](_['pick'](_0x526cf3[_0x0a9e('0x2a')],_0x45a1e7['filters']));if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x36')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x37')](_0x1dc186,function(_0xd1836d){if(_0xd1836d[_0x0a9e('0x38')][_0x0a9e('0x39')]!=='VIRTUAL'){var _0x54135e={};_0x54135e[_0xd1836d[_0x0a9e('0x3a')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x35')]+'%'};return _0x54135e;}})});}_0x479bc4=_[_0x0a9e('0x36')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3b')]);var _0x1ef87a={'where':_0x479bc4['where']};return db[_0x0a9e('0x26')][_0x0a9e('0x17')](_0x1ef87a)[_0x0a9e('0x1f')](function(_0x533942){_0x5bfb33[_0x0a9e('0x17')]=_0x533942;if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x479bc4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3d')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x3e')]=_0x5adda1;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x4b38d9,_0x5a594b){var _0x15e37d={'raw':![],'where':{'id':_0x4b38d9['params']['id']}},_0x45b3d0={};_0x45b3d0[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x26')]['rawAttributes']);_0x45b3d0[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x4b38d9[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],_0x45b3d0[_0x0a9e('0x2a')]);_0x15e37d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x15e37d[_0x0a9e('0x2c')]=_0x15e37d[_0x0a9e('0x2c')]['length']?_0x15e37d['attributes']:_0x45b3d0[_0x0a9e('0x28')];if(_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x15e37d[_0x0a9e('0x41')]=[{'all':!![]}];}_0x15e37d=_[_0x0a9e('0x36')]({},_0x15e37d,_0x4b38d9[_0x0a9e('0x3b')]);return db[_0x0a9e('0x26')][_0x0a9e('0x42')](_0x15e37d)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5a594b,null))[_0x0a9e('0x1f')](respondWithResult(_0x5a594b,null))[_0x0a9e('0x3f')](handleError(_0x5a594b,null));};exports[_0x0a9e('0x43')]=function(_0x5026aa,_0x117c99){return db[_0x0a9e('0x26')][_0x0a9e('0x43')](_0x5026aa[_0x0a9e('0x44')],{})[_0x0a9e('0x1f')](respondWithResult(_0x117c99,0xc9))[_0x0a9e('0x3f')](handleError(_0x117c99,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x26')]['bulkCreate'](_0x44dd99[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x44')]['id']){delete _0x14bec2[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x14bec2[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x1f')](saveUpdates(_0x14bec2[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x3f')](handleError(_0x7f6eb1,null));};exports[_0x0a9e('0x20')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x992c77['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x1f')](removeEntity(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports['bulkDestroy']=function(_0x5ddf84,_0x1adfee){return db[_0x0a9e('0x26')][_0x0a9e('0x20')]({'where':{'id':_0x5ddf84[_0x0a9e('0x2a')][_0x0a9e('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x1adfee,0xcc))[_0x0a9e('0x3f')](handleError(_0x1adfee,null));};exports[_0x0a9e('0x48')]=function(_0x5d38ae,_0x4b1b9f,_0x53975a){return db[_0x0a9e('0x49')][_0x0a9e('0x4a')]({'where':{'id':_0x5d38ae[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b1b9f,null))[_0x0a9e('0x1f')](function(_0x161aa7){if(_0x161aa7){return db['sequelize']['transaction'](function(_0x2ef381){return db['AnalyticFieldReport'][_0x0a9e('0x20')]({'where':{'CustomReportId':_0x5d38ae['params']['id']},'transaction':_0x2ef381})[_0x0a9e('0x1f')](function(_0x3c20b2){var _0x439340=_['map'](_0x5d38ae[_0x0a9e('0x44')],function(_0x1bf38a){delete _0x1bf38a['id'];_0x1bf38a['CustomReportId']=_0x5d38ae['params']['id'];return _0x1bf38a;});return db[_0x0a9e('0x26')][_0x0a9e('0x45')](_0x439340,{'transaction':_0x2ef381});});})['then'](function(){return db[_0x0a9e('0x26')]['findAll']({'where':{'CustomReportId':_0x5d38ae[_0x0a9e('0x46')]['id']}});});}})['then'](respondWithResult(_0x4b1b9f,null))[_0x0a9e('0x3f')](handleError(_0x4b1b9f,null));};
\ No newline at end of file
+var _0xa9e0=['ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','AnalyticFieldReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','type','key','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','findOne','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox'];(function(_0xba0407,_0x709097){var _0x503743=function(_0x1e8ac8){while(--_0x1e8ac8){_0xba0407['push'](_0xba0407['shift']());}};_0x503743(++_0x709097);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=db[_0x0a9e('0x26')][_0x0a9e('0x27')];_0x45a1e7[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x1dc186);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7['filters']=_[_0x0a9e('0x2b')](_0x45a1e7[_0x0a9e('0x28')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_['intersection'](_0x45a1e7[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2e')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x28')];if(!_0x526cf3['query'][_0x0a9e('0x2f')]('nolimit')){_0x479bc4[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x30')]);_0x479bc4[_0x0a9e('0x18')]=qs['offset'](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}_0x479bc4[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x479bc4[_0x0a9e('0x33')]=qs[_0x0a9e('0x34')](_['pick'](_0x526cf3[_0x0a9e('0x2a')],_0x45a1e7['filters']));if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x35')]){_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x36')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x37')](_0x1dc186,function(_0xd1836d){if(_0xd1836d[_0x0a9e('0x38')][_0x0a9e('0x39')]!=='VIRTUAL'){var _0x54135e={};_0x54135e[_0xd1836d[_0x0a9e('0x3a')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x35')]+'%'};return _0x54135e;}})});}_0x479bc4=_[_0x0a9e('0x36')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3b')]);var _0x1ef87a={'where':_0x479bc4['where']};return db[_0x0a9e('0x26')][_0x0a9e('0x17')](_0x1ef87a)[_0x0a9e('0x1f')](function(_0x533942){_0x5bfb33[_0x0a9e('0x17')]=_0x533942;if(_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x479bc4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0a9e('0x3d')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x3e')]=_0x5adda1;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x4b38d9,_0x5a594b){var _0x15e37d={'raw':![],'where':{'id':_0x4b38d9['params']['id']}},_0x45b3d0={};_0x45b3d0[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x26')]['rawAttributes']);_0x45b3d0[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x4b38d9[_0x0a9e('0x2a')]);_0x45b3d0[_0x0a9e('0x34')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],_0x45b3d0[_0x0a9e('0x2a')]);_0x15e37d[_0x0a9e('0x2c')]=_[_0x0a9e('0x2b')](_0x45b3d0[_0x0a9e('0x28')],qs[_0x0a9e('0x2d')](_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x2d')]));_0x15e37d[_0x0a9e('0x2c')]=_0x15e37d[_0x0a9e('0x2c')]['length']?_0x15e37d['attributes']:_0x45b3d0[_0x0a9e('0x28')];if(_0x4b38d9[_0x0a9e('0x2a')][_0x0a9e('0x3c')]){_0x15e37d[_0x0a9e('0x41')]=[{'all':!![]}];}_0x15e37d=_[_0x0a9e('0x36')]({},_0x15e37d,_0x4b38d9[_0x0a9e('0x3b')]);return db[_0x0a9e('0x26')][_0x0a9e('0x42')](_0x15e37d)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5a594b,null))[_0x0a9e('0x1f')](respondWithResult(_0x5a594b,null))[_0x0a9e('0x3f')](handleError(_0x5a594b,null));};exports[_0x0a9e('0x43')]=function(_0x5026aa,_0x117c99){return db[_0x0a9e('0x26')][_0x0a9e('0x43')](_0x5026aa[_0x0a9e('0x44')],{})[_0x0a9e('0x1f')](respondWithResult(_0x117c99,0xc9))[_0x0a9e('0x3f')](handleError(_0x117c99,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x26')]['bulkCreate'](_0x44dd99[_0x0a9e('0x44')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x44')]['id']){delete _0x14bec2[_0x0a9e('0x44')]['id'];}return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x14bec2[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x1f')](saveUpdates(_0x14bec2[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x3f')](handleError(_0x7f6eb1,null));};exports[_0x0a9e('0x20')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x26')][_0x0a9e('0x42')]({'where':{'id':_0x992c77['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x1f')](removeEntity(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports['bulkDestroy']=function(_0x5ddf84,_0x1adfee){return db[_0x0a9e('0x26')][_0x0a9e('0x20')]({'where':{'id':_0x5ddf84[_0x0a9e('0x2a')][_0x0a9e('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x1adfee,0xcc))[_0x0a9e('0x3f')](handleError(_0x1adfee,null));};exports[_0x0a9e('0x48')]=function(_0x5d38ae,_0x4b1b9f,_0x53975a){return db[_0x0a9e('0x49')][_0x0a9e('0x4a')]({'where':{'id':_0x5d38ae[_0x0a9e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b1b9f,null))[_0x0a9e('0x1f')](function(_0x161aa7){if(_0x161aa7){return db['sequelize']['transaction'](function(_0x2ef381){return db['AnalyticFieldReport'][_0x0a9e('0x20')]({'where':{'CustomReportId':_0x5d38ae['params']['id']},'transaction':_0x2ef381})[_0x0a9e('0x1f')](function(_0x3c20b2){var _0x439340=_['map'](_0x5d38ae[_0x0a9e('0x44')],function(_0x1bf38a){delete _0x1bf38a['id'];_0x1bf38a['CustomReportId']=_0x5d38ae['params']['id'];return _0x1bf38a;});return db[_0x0a9e('0x26')][_0x0a9e('0x45')](_0x439340,{'transaction':_0x2ef381});});})['then'](function(){return db[_0x0a9e('0x26')]['findAll']({'where':{'CustomReportId':_0x5d38ae[_0x0a9e('0x46')]['id']}});});}})['then'](respondWithResult(_0x4b1b9f,null))[_0x0a9e('0x3f')](handleError(_0x4b1b9f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 0692e09..ee872a8 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 _0x59cc=['request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api','moment','bluebird'];(function(_0x4a9fb8,_0x24b455){var _0x53659b=function(_0x5e1bfc){while(--_0x5e1bfc){_0x4a9fb8['push'](_0x4a9fb8['shift']());}};_0x53659b(++_0x24b455);}(_0x59cc,0x8c));var _0xc59c=function(_0x560e64,_0x3b0905){_0x560e64=_0x560e64-0x0;var _0x5a9701=_0x59cc[_0x560e64];return _0x5a9701;};'use strict';var _=require('lodash');var util=require(_0xc59c('0x0'));var logger=require('../../config/logger')(_0xc59c('0x1'));var moment=require(_0xc59c('0x2'));var BPromise=require(_0xc59c('0x3'));var rp=require(_0xc59c('0x4'));var fs=require('fs');var path=require(_0xc59c('0x5'));var rimraf=require(_0xc59c('0x6'));var config=require('../../config/environment');var attributes=require(_0xc59c('0x7'));module[_0xc59c('0x8')]=function(_0x4ef97e,_0xe57bcc){return _0x4ef97e[_0xc59c('0x9')](_0xc59c('0xa'),attributes,{'tableName':_0xc59c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe347=['analytics_report_fields','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x59366b,_0x4321b1){var _0x3e9f47=function(_0x1849d1){while(--_0x1849d1){_0x59366b['push'](_0x59366b['shift']());}};_0x3e9f47(++_0x4321b1);}(_0xe347,0x187));var _0x7e34=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xe347[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7e34('0x0'))(_0x7e34('0x1'));var moment=require(_0x7e34('0x2'));var BPromise=require(_0x7e34('0x3'));var rp=require(_0x7e34('0x4'));var fs=require('fs');var path=require(_0x7e34('0x5'));var rimraf=require(_0x7e34('0x6'));var config=require(_0x7e34('0x7'));var attributes=require(_0x7e34('0x8'));module[_0x7e34('0x9')]=function(_0x172148,_0x7c8905){return _0x172148[_0x7e34('0xa')](_0x7e34('0xb'),attributes,{'tableName':_0x7e34('0xc'),'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 7e23978..9835c4d 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 _0xb07c=['message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ed508,_0x5db946){var _0x20d2ee=function(_0x3c6742){while(--_0x3c6742){_0x3ed508['push'](_0x3ed508['shift']());}};_0x20d2ee(++_0x5db946);}(_0xb07c,0x96));var _0xcb07=function(_0x5263a8,_0x32bfa8){_0x5263a8=_0x5263a8-0x0;var _0x57c678=_0xb07c[_0x5263a8];return _0x57c678;};'use strict';var _=require('lodash');var util=require(_0xcb07('0x0'));var moment=require(_0xcb07('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb07('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb07('0x3'))['db'];var utils=require(_0xcb07('0x4'));var logger=require(_0xcb07('0x5'))(_0xcb07('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcb07('0x7')][_0xcb07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x560318,_0x3e22bf,_0x521187){return new BPromise(function(_0x12dae9,_0x49813b){return client[_0xcb07('0x9')](_0x560318,_0x521187)[_0xcb07('0xa')](function(_0x3b89cb){logger[_0xcb07('0xb')](_0xcb07('0xc'),_0x3e22bf,_0xcb07('0xd'));logger['debug'](_0xcb07('0xe'),_0x3e22bf,'request\x20sent',JSON[_0xcb07('0xf')](_0x3b89cb));if(_0x3b89cb[_0xcb07('0x10')]){if(_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x11')]===0x1f4){logger[_0xcb07('0x10')](_0xcb07('0xc'),_0x3e22bf,_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);return _0x49813b(_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);}logger[_0xcb07('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3e22bf,_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);return _0x12dae9(_0x3b89cb[_0xcb07('0x10')][_0xcb07('0x12')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3e22bf,_0xcb07('0xd'));_0x12dae9(_0x3b89cb[_0xcb07('0x13')][_0xcb07('0x12')]);}})[_0xcb07('0x14')](function(_0x12f8c2){logger[_0xcb07('0x10')](_0xcb07('0xc'),_0x3e22bf,_0x12f8c2);_0x49813b(_0x12f8c2);});});}
\ No newline at end of file
+var _0xd619=['request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x3d9d8e,_0x15909b){var _0x33e19e=function(_0x479cb9){while(--_0x479cb9){_0x3d9d8e['push'](_0x3d9d8e['shift']());}};_0x33e19e(++_0x15909b);}(_0xd619,0x1ea));var _0x9d61=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xd619[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x9d61('0x0'));var util=require('util');var moment=require(_0x9d61('0x1'));var BPromise=require(_0x9d61('0x2'));var rs=require(_0x9d61('0x3'));var fs=require('fs');var Redis=require(_0x9d61('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d61('0x5'));var logger=require(_0x9d61('0x6'))('rpc');var config=require(_0x9d61('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d61('0x8')][_0x9d61('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c25e8,_0x275e9b,_0x332dd1){return new BPromise(function(_0x34d062,_0x3f7ead){return client[_0x9d61('0xa')](_0x3c25e8,_0x332dd1)[_0x9d61('0xb')](function(_0x499e97){logger[_0x9d61('0xc')](_0x9d61('0xd'),_0x275e9b,_0x9d61('0xe'));logger['debug'](_0x9d61('0xf'),_0x275e9b,_0x9d61('0xe'),JSON[_0x9d61('0x10')](_0x499e97));if(_0x499e97[_0x9d61('0x11')]){if(_0x499e97['error'][_0x9d61('0x12')]===0x1f4){logger[_0x9d61('0x11')](_0x9d61('0xd'),_0x275e9b,_0x499e97[_0x9d61('0x11')][_0x9d61('0x13')]);return _0x3f7ead(_0x499e97[_0x9d61('0x11')][_0x9d61('0x13')]);}logger[_0x9d61('0x11')](_0x9d61('0xd'),_0x275e9b,_0x499e97['error'][_0x9d61('0x13')]);return _0x34d062(_0x499e97[_0x9d61('0x11')][_0x9d61('0x13')]);}else{logger[_0x9d61('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x275e9b,_0x9d61('0xe'));_0x34d062(_0x499e97['result'][_0x9d61('0x13')]);}})[_0x9d61('0x14')](function(_0x56b09b){logger[_0x9d61('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x275e9b,_0x56b09b);_0x3f7ead(_0x56b09b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index a88f960..c4cb17f 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 _0x326f=['/:id','show','post','/create_many','bulkCreate','/:id/create_many','addFields','update','/destroy_many','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x326f,0xd1));var _0xf326=function(_0x51c44c,_0x3f5c70){_0x51c44c=_0x51c44c-0x0;var _0xda306c=_0x326f[_0x51c44c];return _0xda306c;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf326('0xe'),auth[_0xf326('0x9')](),controller[_0xf326('0xf')]);router[_0xf326('0xd')](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['put'](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x12')]);router['delete'](_0xf326('0x13'),auth[_0xf326('0x9')](),controller['bulkDestroy']);router[_0xf326('0x14')](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x7217=['put','update','delete','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields'];(function(_0x418305,_0xcf9d75){var _0x39a433=function(_0x44dbfb){while(--_0x44dbfb){_0x418305['push'](_0x418305['shift']());}};_0x39a433(++_0xcf9d75);}(_0x7217,0x19e));var _0x7721=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7217[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xc')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0x10'),auth[_0x7721('0x8')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x13')]);router[_0x7721('0x14')]('/destroy_many',auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 4be0a20..447a1e2 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 _0x8093=['exports','STRING','name','TEXT','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8093,0xa9));var _0x3809=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x8093[_0x1064bc];return _0x5edc45;};'use strict';var Sequelize=require(_0x3809('0x0'));module[_0x3809('0x1')]={'name':{'type':Sequelize[_0x3809('0x2')],'allowNull':![],'unique':_0x3809('0x3')},'table':{'type':Sequelize[_0x3809('0x2')]},'metric':{'type':Sequelize[_0x3809('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe3bd=['name','TEXT','exports','STRING'];(function(_0x2b9e50,_0x17a5ff){var _0x50482b=function(_0x43ba03){while(--_0x43ba03){_0x2b9e50['push'](_0x2b9e50['shift']());}};_0x50482b(++_0x17a5ff);}(_0xe3bd,0x126));var _0xde3b=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0xe3bd[_0x53c256];return _0x25feb6;};'use strict';var Sequelize=require('sequelize');module[_0xde3b('0x0')]={'name':{'type':Sequelize[_0xde3b('0x1')],'allowNull':![],'unique':_0xde3b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xde3b('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6649eae..a572964 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 _0xa9e0=['status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus'];(function(_0x3edf96,_0x11e492){var _0x128e0e=function(_0x2db51f){while(--_0x2db51f){_0x3edf96['push'](_0x3edf96['shift']());}};_0x128e0e(++_0x11e492);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['AnalyticMetric'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':!![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x1e')]=function(_0x61bb17,_0x30decb){if(_0x61bb17[_0x0a9e('0x46')]['id']){delete _0x61bb17[_0x0a9e('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x61bb17['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](saveUpdates(_0x61bb17[_0x0a9e('0x46')],null))['then'](respondWithResult(_0x30decb,null))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports[_0x0a9e('0x20')]=function(_0x53d113,_0x5a88da){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x1f')](removeEntity(_0x5a88da,null))[_0x0a9e('0x40')](handleError(_0x5a88da,null));};
\ No newline at end of file
+var _0xa9e0=['status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus'];(function(_0x2b3208,_0x26f23b){var _0xde06e1=function(_0x6d46d1){while(--_0x6d46d1){_0x2b3208['push'](_0x2b3208['shift']());}};_0xde06e1(++_0x26f23b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['AnalyticMetric'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':!![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x1e')]=function(_0x61bb17,_0x30decb){if(_0x61bb17[_0x0a9e('0x46')]['id']){delete _0x61bb17[_0x0a9e('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x61bb17['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](saveUpdates(_0x61bb17[_0x0a9e('0x46')],null))['then'](respondWithResult(_0x30decb,null))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports[_0x0a9e('0x20')]=function(_0x53d113,_0x5a88da){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x42')]['id']}})['then'](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x1f')](removeEntity(_0x5a88da,null))[_0x0a9e('0x40')](handleError(_0x5a88da,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 0a780a9..45fff7e 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 _0xe442=['path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0xe442,0x132));var _0x2e44=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xe442[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x2e44('0x0'));var util=require(_0x2e44('0x1'));var logger=require(_0x2e44('0x2'))(_0x2e44('0x3'));var moment=require(_0x2e44('0x4'));var BPromise=require(_0x2e44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e44('0x6'));var rimraf=require(_0x2e44('0x7'));var config=require(_0x2e44('0x8'));var attributes=require(_0x2e44('0x9'));module['exports']=function(_0x37d6b0,_0x59702b){return _0x37d6b0['define'](_0x2e44('0xa'),attributes,{'tableName':_0x2e44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54e8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash'];(function(_0x1f0213,_0x3c3c9e){var _0x2048c4=function(_0x26d0c6){while(--_0x26d0c6){_0x1f0213['push'](_0x1f0213['shift']());}};_0x2048c4(++_0x3c3c9e);}(_0x54e8,0x1d3));var _0x854e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x54e8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x854e('0x0'));var util=require('util');var logger=require(_0x854e('0x1'))(_0x854e('0x2'));var moment=require(_0x854e('0x3'));var BPromise=require(_0x854e('0x4'));var rp=require(_0x854e('0x5'));var fs=require('fs');var path=require(_0x854e('0x6'));var rimraf=require(_0x854e('0x7'));var config=require(_0x854e('0x8'));var attributes=require(_0x854e('0x9'));module[_0x854e('0xa')]=function(_0x4c018c,_0x19df46){return _0x4c018c[_0x854e('0xb')](_0x854e('0xc'),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 fecd63c..417330f 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 _0x277e=['code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x277e,0x1ca));var _0xe277=function(_0x1605fc,_0x4b024d){_0x1605fc=_0x1605fc-0x0;var _0x288515=_0x277e[_0x1605fc];return _0x288515;};'use strict';var _=require(_0xe277('0x0'));var util=require(_0xe277('0x1'));var moment=require(_0xe277('0x2'));var BPromise=require(_0xe277('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe277('0x4'));var db=require(_0xe277('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe277('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe277('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x456923,_0x387b6e,_0x19a362){return new BPromise(function(_0x2b09a7,_0x19eb1b){return client[_0xe277('0x8')](_0x456923,_0x19a362)[_0xe277('0x9')](function(_0x2fc665){logger[_0xe277('0xa')](_0xe277('0xb'),_0x387b6e,_0xe277('0xc'));logger[_0xe277('0xd')](_0xe277('0xe'),_0x387b6e,'request\x20sent',JSON[_0xe277('0xf')](_0x2fc665));if(_0x2fc665[_0xe277('0x10')]){if(_0x2fc665[_0xe277('0x10')][_0xe277('0x11')]===0x1f4){logger[_0xe277('0x10')](_0xe277('0xb'),_0x387b6e,_0x2fc665['error'][_0xe277('0x12')]);return _0x19eb1b(_0x2fc665[_0xe277('0x10')][_0xe277('0x12')]);}logger['error'](_0xe277('0xb'),_0x387b6e,_0x2fc665['error'][_0xe277('0x12')]);return _0x2b09a7(_0x2fc665[_0xe277('0x10')][_0xe277('0x12')]);}else{logger[_0xe277('0xa')](_0xe277('0xb'),_0x387b6e,_0xe277('0xc'));_0x2b09a7(_0x2fc665['result'][_0xe277('0x12')]);}})['catch'](function(_0x2ccf64){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x387b6e,_0x2ccf64);_0x19eb1b(_0x2ccf64);});});}
\ No newline at end of file
+var _0xf02c=['../../config/logger','../../config/environment','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','ioredis'];(function(_0x912d90,_0x489efb){var _0x2d3709=function(_0x4553f2){while(--_0x4553f2){_0x912d90['push'](_0x912d90['shift']());}};_0x2d3709(++_0x489efb);}(_0xf02c,0x1d8));var _0xcf02=function(_0x5b6805,_0x14ac12){_0x5b6805=_0x5b6805-0x0;var _0x4d143c=_0xf02c[_0x5b6805];return _0x4d143c;};'use strict';var _=require('lodash');var util=require(_0xcf02('0x0'));var moment=require(_0xcf02('0x1'));var BPromise=require(_0xcf02('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf02('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcf02('0x4'))('rpc');var config=require(_0xcf02('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcf02('0x6')][_0xcf02('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xca9c31,_0x33df64,_0x1af068){return new BPromise(function(_0x327b28,_0x3b9e85){return client[_0xcf02('0x8')](_0xca9c31,_0x1af068)['then'](function(_0x571222){logger[_0xcf02('0x9')](_0xcf02('0xa'),_0x33df64,_0xcf02('0xb'));logger[_0xcf02('0xc')](_0xcf02('0xd'),_0x33df64,_0xcf02('0xb'),JSON['stringify'](_0x571222));if(_0x571222['error']){if(_0x571222[_0xcf02('0xe')]['code']===0x1f4){logger[_0xcf02('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x33df64,_0x571222[_0xcf02('0xe')][_0xcf02('0xf')]);return _0x3b9e85(_0x571222[_0xcf02('0xe')][_0xcf02('0xf')]);}logger[_0xcf02('0xe')](_0xcf02('0xa'),_0x33df64,_0x571222[_0xcf02('0xe')][_0xcf02('0xf')]);return _0x327b28(_0x571222['error'][_0xcf02('0xf')]);}else{logger[_0xcf02('0x9')](_0xcf02('0xa'),_0x33df64,'request\x20sent');_0x327b28(_0x571222[_0xcf02('0x10')][_0xcf02('0xf')]);}})['catch'](function(_0x477bd5){logger['error'](_0xcf02('0xa'),_0x33df64,_0x477bd5);_0x3b9e85(_0x477bd5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 4502191..ff5d538 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 _0xc2c7=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','post','create','put','/:id'];(function(_0x4fef5c,_0x1a805b){var _0x35d05c=function(_0x10db61){while(--_0x10db61){_0x4fef5c['push'](_0x4fef5c['shift']());}};_0x35d05c(++_0x1a805b);}(_0xc2c7,0x134));var _0x7c2c=function(_0x494163,_0x1f3669){_0x494163=_0x494163-0x0;var _0x25ef76=_0xc2c7[_0x494163];return _0x25ef76;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var auth=require(_0x7c2c('0x5'));var interaction=require(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x7c2c('0x8')](),controller[_0x7c2c('0x9')]);router[_0x7c2c('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7c2c('0xb')]('/',auth[_0x7c2c('0x8')](),controller[_0x7c2c('0xc')]);router[_0x7c2c('0xd')](_0x7c2c('0xe'),auth['isAuthenticated'](),controller[_0x7c2c('0xf')]);router[_0x7c2c('0x10')](_0x7c2c('0xe'),auth[_0x7c2c('0x8')](),controller[_0x7c2c('0x11')]);module[_0x7c2c('0x12')]=router;
\ No newline at end of file
+var _0xc4aa=['connect-timeout','express','Router','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path'];(function(_0xcdfc4f,_0x8a111a){var _0x3f70d1=function(_0xc0f333){while(--_0xc0f333){_0xcdfc4f['push'](_0xcdfc4f['shift']());}};_0x3f70d1(++_0x8a111a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('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 ac5a7d3..18a8167 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 _0xf413=['TEXT','sequelize','exports'];(function(_0x38fb1a,_0x4e4ab4){var _0x249fb7=function(_0x12a524){while(--_0x12a524){_0x38fb1a['push'](_0x38fb1a['shift']());}};_0x249fb7(++_0x4e4ab4);}(_0xf413,0x1d8));var _0x3f41=function(_0x495649,_0x1e7677){_0x495649=_0x495649-0x0;var _0xab5025=_0xf413[_0x495649];return _0xab5025;};'use strict';var Sequelize=require(_0x3f41('0x0'));module[_0x3f41('0x1')]={'tree':{'type':Sequelize[_0x3f41('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x8ab0=['exports'];(function(_0xf7224d,_0x2b8c21){var _0x525740=function(_0x10278d){while(--_0x10278d){_0xf7224d['push'](_0xf7224d['shift']());}};_0x525740(++_0x2b8c21);}(_0x8ab0,0x19f));var _0x08ab=function(_0x4ce7d2,_0x32e979){_0x4ce7d2=_0x4ce7d2-0x0;var _0x3af51e=_0x8ab0[_0x4ce7d2];return _0x3af51e;};'use strict';var Sequelize=require('sequelize');module[_0x08ab('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 27e4d0d..d0a6f83 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 _0x9957=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','AnalyticTreeReport','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','html-pdf','eml-format','rimraf'];(function(_0x2e9450,_0x456dbd){var _0x45c036=function(_0x1674d8){while(--_0x1674d8){_0x2e9450['push'](_0x2e9450['shift']());}};_0x45c036(++_0x456dbd);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=db[_0x7995('0x2a')]['rawAttributes'];_0x49bc7e[_0x7995('0x2b')]=_['keys'](_0x132a42);_0x49bc7e[_0x7995('0x2c')]=_[_0x7995('0x2d')](_0x47625f[_0x7995('0x2c')]);_0x49bc7e['filters']=_['intersection'](_0x49bc7e['model'],_0x49bc7e[_0x7995('0x2c')]);_0x229742[_0x7995('0x2e')]=_[_0x7995('0x2f')](_0x49bc7e[_0x7995('0x2b')],qs[_0x7995('0x30')](_0x47625f[_0x7995('0x2c')]['fields']));_0x229742['attributes']=_0x229742[_0x7995('0x2e')]['length']?_0x229742[_0x7995('0x2e')]:_0x49bc7e[_0x7995('0x2b')];if(!_0x47625f[_0x7995('0x2c')][_0x7995('0x31')](_0x7995('0x32'))){_0x229742['limit']=qs[_0x7995('0x1f')](_0x47625f[_0x7995('0x2c')]['limit']);_0x229742['offset']=qs['offset'](_0x47625f[_0x7995('0x2c')][_0x7995('0x1e')]);}_0x229742['order']=qs[_0x7995('0x33')](_0x47625f['query'][_0x7995('0x33')]);_0x229742[_0x7995('0x34')]=qs[_0x7995('0x35')](_['pick'](_0x47625f['query'],_0x49bc7e[_0x7995('0x35')]));if(_0x47625f['query']['filter']){_0x229742[_0x7995('0x34')]=_[_0x7995('0x36')](_0x229742['where'],{'$or':_[_0x7995('0x37')](_0x132a42,function(_0x1922b4){if(_0x1922b4[_0x7995('0x38')][_0x7995('0x39')]!==_0x7995('0x3a')){var _0x53002a={};_0x53002a[_0x1922b4[_0x7995('0x3b')]]={'$like':'%'+_0x47625f[_0x7995('0x2c')][_0x7995('0x3c')]+'%'};return _0x53002a;}})});}_0x229742=_[_0x7995('0x36')]({},_0x229742,_0x47625f['options']);var _0x2be2c0={'where':_0x229742[_0x7995('0x34')]};return db[_0x7995('0x2a')][_0x7995('0x3d')](_0x2be2c0)[_0x7995('0x24')](function(_0x1035dc){_0xf16cc2['count']=_0x1035dc;if(_0x47625f[_0x7995('0x2c')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x14d638){_0xf16cc2[_0x7995('0x41')]=_0x14d638;return _0xf16cc2;})[_0x7995('0x24')](respondWithFilteredResult(_0x5911c3,_0x229742))[_0x7995('0x42')](handleError(_0x5911c3,null));};exports[_0x7995('0x43')]=function(_0x270d52,_0x7b4e67){var _0x53cda2={'raw':!![],'where':{'id':_0x270d52[_0x7995('0x44')]['id']}},_0x50a98e={};_0x50a98e[_0x7995('0x2b')]=_['keys'](db['AnalyticTreeReport'][_0x7995('0x45')]);_0x50a98e['query']=_['keys'](_0x270d52[_0x7995('0x2c')]);_0x50a98e[_0x7995('0x35')]=_[_0x7995('0x2f')](_0x50a98e['model'],_0x50a98e[_0x7995('0x2c')]);_0x53cda2['attributes']=_[_0x7995('0x2f')](_0x50a98e['model'],qs['fields'](_0x270d52[_0x7995('0x2c')][_0x7995('0x30')]));_0x53cda2[_0x7995('0x2e')]=_0x53cda2[_0x7995('0x2e')]['length']?_0x53cda2[_0x7995('0x2e')]:_0x50a98e[_0x7995('0x2b')];if(_0x270d52[_0x7995('0x2c')][_0x7995('0x3e')]){_0x53cda2['include']=[{'all':!![]}];}_0x53cda2=_['merge']({},_0x53cda2,_0x270d52[_0x7995('0x46')]);return db['AnalyticTreeReport'][_0x7995('0x47')](_0x53cda2)['then'](handleEntityNotFound(_0x7b4e67,null))[_0x7995('0x24')](respondWithResult(_0x7b4e67,null))['catch'](handleError(_0x7b4e67,null));};exports[_0x7995('0x48')]=function(_0x1b0373,_0x4d9245){return db[_0x7995('0x2a')][_0x7995('0x48')](_0x1b0373[_0x7995('0x49')],{})[_0x7995('0x24')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports[_0x7995('0x4a')]=function(_0x3e787d,_0x237270){if(_0x3e787d['body']['id']){delete _0x3e787d[_0x7995('0x49')]['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3e787d[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x237270,null))['then'](saveUpdates(_0x3e787d[_0x7995('0x49')],null))[_0x7995('0x24')](respondWithResult(_0x237270,null))['catch'](handleError(_0x237270,null));};exports[_0x7995('0x25')]=function(_0x5843ba,_0x1d87f9){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x5843ba[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1d87f9,null))[_0x7995('0x24')](removeEntity(_0x1d87f9,null))[_0x7995('0x42')](handleError(_0x1d87f9,null));};
\ No newline at end of file
+var _0x9957=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','AnalyticTreeReport','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','merge','map','type','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','html-pdf','eml-format','rimraf'];(function(_0x52502d,_0x91e73e){var _0xd3092d=function(_0x1bac9f){while(--_0x1bac9f){_0x52502d['push'](_0x52502d['shift']());}};_0xd3092d(++_0x91e73e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=db[_0x7995('0x2a')]['rawAttributes'];_0x49bc7e[_0x7995('0x2b')]=_['keys'](_0x132a42);_0x49bc7e[_0x7995('0x2c')]=_[_0x7995('0x2d')](_0x47625f[_0x7995('0x2c')]);_0x49bc7e['filters']=_['intersection'](_0x49bc7e['model'],_0x49bc7e[_0x7995('0x2c')]);_0x229742[_0x7995('0x2e')]=_[_0x7995('0x2f')](_0x49bc7e[_0x7995('0x2b')],qs[_0x7995('0x30')](_0x47625f[_0x7995('0x2c')]['fields']));_0x229742['attributes']=_0x229742[_0x7995('0x2e')]['length']?_0x229742[_0x7995('0x2e')]:_0x49bc7e[_0x7995('0x2b')];if(!_0x47625f[_0x7995('0x2c')][_0x7995('0x31')](_0x7995('0x32'))){_0x229742['limit']=qs[_0x7995('0x1f')](_0x47625f[_0x7995('0x2c')]['limit']);_0x229742['offset']=qs['offset'](_0x47625f[_0x7995('0x2c')][_0x7995('0x1e')]);}_0x229742['order']=qs[_0x7995('0x33')](_0x47625f['query'][_0x7995('0x33')]);_0x229742[_0x7995('0x34')]=qs[_0x7995('0x35')](_['pick'](_0x47625f['query'],_0x49bc7e[_0x7995('0x35')]));if(_0x47625f['query']['filter']){_0x229742[_0x7995('0x34')]=_[_0x7995('0x36')](_0x229742['where'],{'$or':_[_0x7995('0x37')](_0x132a42,function(_0x1922b4){if(_0x1922b4[_0x7995('0x38')][_0x7995('0x39')]!==_0x7995('0x3a')){var _0x53002a={};_0x53002a[_0x1922b4[_0x7995('0x3b')]]={'$like':'%'+_0x47625f[_0x7995('0x2c')][_0x7995('0x3c')]+'%'};return _0x53002a;}})});}_0x229742=_[_0x7995('0x36')]({},_0x229742,_0x47625f['options']);var _0x2be2c0={'where':_0x229742[_0x7995('0x34')]};return db[_0x7995('0x2a')][_0x7995('0x3d')](_0x2be2c0)[_0x7995('0x24')](function(_0x1035dc){_0xf16cc2['count']=_0x1035dc;if(_0x47625f[_0x7995('0x2c')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x14d638){_0xf16cc2[_0x7995('0x41')]=_0x14d638;return _0xf16cc2;})[_0x7995('0x24')](respondWithFilteredResult(_0x5911c3,_0x229742))[_0x7995('0x42')](handleError(_0x5911c3,null));};exports[_0x7995('0x43')]=function(_0x270d52,_0x7b4e67){var _0x53cda2={'raw':!![],'where':{'id':_0x270d52[_0x7995('0x44')]['id']}},_0x50a98e={};_0x50a98e[_0x7995('0x2b')]=_['keys'](db['AnalyticTreeReport'][_0x7995('0x45')]);_0x50a98e['query']=_['keys'](_0x270d52[_0x7995('0x2c')]);_0x50a98e[_0x7995('0x35')]=_[_0x7995('0x2f')](_0x50a98e['model'],_0x50a98e[_0x7995('0x2c')]);_0x53cda2['attributes']=_[_0x7995('0x2f')](_0x50a98e['model'],qs['fields'](_0x270d52[_0x7995('0x2c')][_0x7995('0x30')]));_0x53cda2[_0x7995('0x2e')]=_0x53cda2[_0x7995('0x2e')]['length']?_0x53cda2[_0x7995('0x2e')]:_0x50a98e[_0x7995('0x2b')];if(_0x270d52[_0x7995('0x2c')][_0x7995('0x3e')]){_0x53cda2['include']=[{'all':!![]}];}_0x53cda2=_['merge']({},_0x53cda2,_0x270d52[_0x7995('0x46')]);return db['AnalyticTreeReport'][_0x7995('0x47')](_0x53cda2)['then'](handleEntityNotFound(_0x7b4e67,null))[_0x7995('0x24')](respondWithResult(_0x7b4e67,null))['catch'](handleError(_0x7b4e67,null));};exports[_0x7995('0x48')]=function(_0x1b0373,_0x4d9245){return db[_0x7995('0x2a')][_0x7995('0x48')](_0x1b0373[_0x7995('0x49')],{})[_0x7995('0x24')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports[_0x7995('0x4a')]=function(_0x3e787d,_0x237270){if(_0x3e787d['body']['id']){delete _0x3e787d[_0x7995('0x49')]['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3e787d[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x237270,null))['then'](saveUpdates(_0x3e787d[_0x7995('0x49')],null))[_0x7995('0x24')](respondWithResult(_0x237270,null))['catch'](handleError(_0x237270,null));};exports[_0x7995('0x25')]=function(_0x5843ba,_0x1d87f9){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x5843ba[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1d87f9,null))[_0x7995('0x24')](removeEntity(_0x1d87f9,null))[_0x7995('0x42')](handleError(_0x1d87f9,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index c248984..2ea0922 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 _0x6f44=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','api','moment'];(function(_0x422506,_0x1d698c){var _0x5699d1=function(_0x382d7d){while(--_0x382d7d){_0x422506['push'](_0x422506['shift']());}};_0x5699d1(++_0x1d698c);}(_0x6f44,0x1ea));var _0x46f4=function(_0x5853fe,_0x338eb7){_0x5853fe=_0x5853fe-0x0;var _0x251e6f=_0x6f44[_0x5853fe];return _0x251e6f;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var logger=require('../../config/logger')(_0x46f4('0x2'));var moment=require(_0x46f4('0x3'));var BPromise=require(_0x46f4('0x4'));var rp=require(_0x46f4('0x5'));var fs=require('fs');var path=require(_0x46f4('0x6'));var rimraf=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var attributes=require(_0x46f4('0x9'));module[_0x46f4('0xa')]=function(_0x57f1a9,_0x169a5a){return _0x57f1a9[_0x46f4('0xb')](_0x46f4('0xc'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa9f=['moment','bluebird','path','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xfa9f,0x93));var _0xffa9=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xfa9f[_0x3c504b];return _0x2e5354;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var logger=require(_0xffa9('0x1'))(_0xffa9('0x2'));var moment=require(_0xffa9('0x3'));var BPromise=require(_0xffa9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffa9('0x5'));var rimraf=require('rimraf');var config=require(_0xffa9('0x6'));var attributes=require(_0xffa9('0x7'));module['exports']=function(_0xf1a9c6,_0x4fb309){return _0xf1a9c6['define'](_0xffa9('0x8'),attributes,{'tableName':_0xffa9('0x9'),'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 24e9b78..74bec75 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 _0xed26=['http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xed26,0xa1));var _0x6ed2=function(_0x2cb21c,_0x4f6028){_0x2cb21c=_0x2cb21c-0x0;var _0x23ea2b=_0xed26[_0x2cb21c];return _0x23ea2b;};'use strict';var _=require(_0x6ed2('0x0'));var util=require(_0x6ed2('0x1'));var moment=require(_0x6ed2('0x2'));var BPromise=require(_0x6ed2('0x3'));var rs=require(_0x6ed2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ed2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6ed2('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ed2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x355b08,_0xfc060c,_0x48b99d){return new BPromise(function(_0x5d7e35,_0x42fddc){return client[_0x6ed2('0x8')](_0x355b08,_0x48b99d)[_0x6ed2('0x9')](function(_0x3f495f){logger[_0x6ed2('0xa')](_0x6ed2('0xb'),_0xfc060c,_0x6ed2('0xc'));logger[_0x6ed2('0xd')](_0x6ed2('0xe'),_0xfc060c,'request\x20sent',JSON[_0x6ed2('0xf')](_0x3f495f));if(_0x3f495f[_0x6ed2('0x10')]){if(_0x3f495f[_0x6ed2('0x10')][_0x6ed2('0x11')]===0x1f4){logger[_0x6ed2('0x10')](_0x6ed2('0xb'),_0xfc060c,_0x3f495f['error']['message']);return _0x42fddc(_0x3f495f['error'][_0x6ed2('0x12')]);}logger[_0x6ed2('0x10')](_0x6ed2('0xb'),_0xfc060c,_0x3f495f[_0x6ed2('0x10')][_0x6ed2('0x12')]);return _0x5d7e35(_0x3f495f[_0x6ed2('0x10')][_0x6ed2('0x12')]);}else{logger[_0x6ed2('0xa')](_0x6ed2('0xb'),_0xfc060c,_0x6ed2('0xc'));_0x5d7e35(_0x3f495f[_0x6ed2('0x13')][_0x6ed2('0x12')]);}})[_0x6ed2('0x14')](function(_0x4969cb){logger[_0x6ed2('0x10')](_0x6ed2('0xb'),_0xfc060c,_0x4969cb);_0x42fddc(_0x4969cb);});});}
\ No newline at end of file
+var _0xbe1e=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0xbe1e,0x1a9));var _0xebe1=function(_0x1751b3,_0x20798b){_0x1751b3=_0x1751b3-0x0;var _0x1090e5=_0xbe1e[_0x1751b3];return _0x1090e5;};'use strict';var _=require(_0xebe1('0x0'));var util=require(_0xebe1('0x1'));var moment=require('moment');var BPromise=require(_0xebe1('0x2'));var rs=require(_0xebe1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebe1('0x4'))['db'];var utils=require(_0xebe1('0x5'));var logger=require(_0xebe1('0x6'))(_0xebe1('0x7'));var config=require(_0xebe1('0x8'));var jayson=require(_0xebe1('0x9'));var client=jayson[_0xebe1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d2e4c,_0x1e5637,_0x1c925d){return new BPromise(function(_0x3bea6b,_0x3b8a2a){return client[_0xebe1('0xb')](_0x4d2e4c,_0x1c925d)['then'](function(_0x3c07b4){logger[_0xebe1('0xc')](_0xebe1('0xd'),_0x1e5637,'request\x20sent');logger[_0xebe1('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x1e5637,_0xebe1('0xf'),JSON[_0xebe1('0x10')](_0x3c07b4));if(_0x3c07b4[_0xebe1('0x11')]){if(_0x3c07b4['error'][_0xebe1('0x12')]===0x1f4){logger[_0xebe1('0x11')](_0xebe1('0xd'),_0x1e5637,_0x3c07b4[_0xebe1('0x11')][_0xebe1('0x13')]);return _0x3b8a2a(_0x3c07b4[_0xebe1('0x11')][_0xebe1('0x13')]);}logger['error'](_0xebe1('0xd'),_0x1e5637,_0x3c07b4[_0xebe1('0x11')]['message']);return _0x3bea6b(_0x3c07b4['error']['message']);}else{logger[_0xebe1('0xc')](_0xebe1('0xd'),_0x1e5637,_0xebe1('0xf'));_0x3bea6b(_0x3c07b4[_0xebe1('0x14')][_0xebe1('0x13')]);}})[_0xebe1('0x15')](function(_0x68b97d){logger['error'](_0xebe1('0xd'),_0x1e5637,_0x68b97d);_0x3b8a2a(_0x68b97d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 4c4d00d..c7103ad 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 _0x8711=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1c2708,_0x7ad2a3){var _0x41a1ed=function(_0x4916d7){while(--_0x4916d7){_0x1c2708['push'](_0x1c2708['shift']());}};_0x41a1ed(++_0x7ad2a3);}(_0x8711,0x1b9));var _0x1871=function(_0x1d7c54,_0x1ac0f7){_0x1d7c54=_0x1d7c54-0x0;var _0xdd6e7a=_0x8711[_0x1d7c54];return _0xdd6e7a;};'use strict';var multer=require(_0x1871('0x0'));var util=require(_0x1871('0x1'));var path=require(_0x1871('0x2'));var timeout=require(_0x1871('0x3'));var express=require(_0x1871('0x4'));var router=express[_0x1871('0x5')]();var auth=require(_0x1871('0x6'));var interaction=require(_0x1871('0x7'));var config=require(_0x1871('0x8'));var controller=require(_0x1871('0x9'));router[_0x1871('0xa')]('/',auth[_0x1871('0xb')](),controller['index']);router[_0x1871('0xa')](_0x1871('0xc'),auth[_0x1871('0xb')](),controller[_0x1871('0xd')]);router[_0x1871('0xe')]('/',auth[_0x1871('0xb')](),controller[_0x1871('0xf')]);router[_0x1871('0x10')]('/:id',auth[_0x1871('0xb')](),controller[_0x1871('0x11')]);router[_0x1871('0x12')](_0x1871('0xc'),auth['isAuthenticated'](),controller[_0x1871('0x13')]);module[_0x1871('0x14')]=router;
\ No newline at end of file
+var _0x78be=['../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x598a7c,_0x419f29){var _0x468a5b=function(_0x410715){while(--_0x410715){_0x598a7c['push'](_0x598a7c['shift']());}};_0x468a5b(++_0x419f29);}(_0x78be,0x151));var _0xe78b=function(_0x189c4d,_0x52e64c){_0x189c4d=_0x189c4d-0x0;var _0x5afe30=_0x78be[_0x189c4d];return _0x5afe30;};'use strict';var multer=require(_0xe78b('0x0'));var util=require(_0xe78b('0x1'));var path=require(_0xe78b('0x2'));var timeout=require(_0xe78b('0x3'));var express=require('express');var router=express[_0xe78b('0x4')]();var auth=require(_0xe78b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe78b('0x6'));var controller=require(_0xe78b('0x7'));router[_0xe78b('0x8')]('/',auth[_0xe78b('0x9')](),controller[_0xe78b('0xa')]);router['get'](_0xe78b('0xb'),auth[_0xe78b('0x9')](),controller[_0xe78b('0xc')]);router[_0xe78b('0xd')]('/',auth['isAuthenticated'](),controller[_0xe78b('0xe')]);router[_0xe78b('0xf')]('/:id',auth[_0xe78b('0x9')](),controller[_0xe78b('0x10')]);router['delete'](_0xe78b('0xb'),auth[_0xe78b('0x9')](),controller[_0xe78b('0x11')]);module[_0xe78b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f7170fc..38248ed 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 _0x549e=['exports','STRING','sequelize'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x549e,0x1e5));var _0xe549=function(_0x3483fb,_0x2141e6){_0x3483fb=_0x3483fb-0x0;var _0x4ab723=_0x549e[_0x3483fb];return _0x4ab723;};'use strict';var Sequelize=require(_0xe549('0x0'));module[_0xe549('0x1')]={'name':{'type':Sequelize[_0xe549('0x2')]},'basename':{'type':Sequelize[_0xe549('0x2')]},'type':{'type':Sequelize[_0xe549('0x2')]}};
\ No newline at end of file
+var _0x3e17=['sequelize','exports','STRING'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x3e17,0xff));var _0x73e1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e17[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x73e1('0x0'));module[_0x73e1('0x1')]={'name':{'type':Sequelize[_0x73e1('0x2')]},'basename':{'type':Sequelize[_0x73e1('0x2')]},'type':{'type':Sequelize[_0x73e1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b90ef2c..0c602e1 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 _0xabfb=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','save','update','then','destroy','error','stack','name','send','Attachment','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','body','params','create','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xabfb,0xf4));var _0xbabf=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xabfb[_0x7b173];return _0x1c598c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbabf('0x0'));var rimraf=require(_0xbabf('0x1'));var zipdir=require(_0xbabf('0x2'));var jsonpatch=require(_0xbabf('0x3'));var rp=require(_0xbabf('0x4'));var moment=require(_0xbabf('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbabf('0x6'));var path=require(_0xbabf('0x7'));var sox=require(_0xbabf('0x8'));var csv=require(_0xbabf('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbabf('0xa'));var squel=require('squel');var crypto=require(_0xbabf('0xb'));var jsforce=require(_0xbabf('0xc'));var deskjs=require(_0xbabf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbabf('0xe'));var Papa=require(_0xbabf('0xf'));var Redis=require(_0xbabf('0x10'));var authService=require(_0xbabf('0x11'));var qs=require(_0xbabf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbabf('0x13'));var logger=require(_0xbabf('0x14'))(_0xbabf('0x15'));var utils=require(_0xbabf('0x16'));var config=require(_0xbabf('0x17'));var db=require(_0xbabf('0x18'))['db'];function respondWithStatusCode(_0x260680,_0x4209b0){_0x4209b0=_0x4209b0||0xcc;return function(_0x3e2a3d){if(_0x3e2a3d){return _0x260680[_0xbabf('0x19')](_0x4209b0);}return _0x260680['status'](_0x4209b0)[_0xbabf('0x1a')]();};}function respondWithResult(_0x131c36,_0x4e2cd2){_0x4e2cd2=_0x4e2cd2||0xc8;return function(_0x4212ab){if(_0x4212ab){return _0x131c36['status'](_0x4e2cd2)[_0xbabf('0x1b')](_0x4212ab);}};}function respondWithFilteredResult(_0x50be86,_0x1e327c){return function(_0x506d99){if(_0x506d99){var _0x2e0c23=_0x506d99[_0xbabf('0x1c')],_0x33769f=_0x1e327c['offset'],_0x2e4d69=_0x1e327c[_0xbabf('0x1d')]+_0x1e327c[_0xbabf('0x1e')],_0x67bf59;if(_0x2e4d69>=_0x2e0c23){_0x2e4d69=_0x2e0c23;_0x67bf59=0xc8;}else{_0x67bf59=0xce;}_0x50be86[_0xbabf('0x1f')](_0x67bf59);return _0x50be86[_0xbabf('0x20')](_0xbabf('0x21'),_0x33769f+'-'+_0x2e4d69+'/'+_0x2e0c23)[_0xbabf('0x1b')](_0x506d99);}return null;};}function patchUpdates(_0x2c857b){return function(_0x199679){try{jsonpatch['apply'](_0x199679,_0x2c857b,!![]);}catch(_0x14d885){return BPromise['reject'](_0x14d885);}return _0x199679[_0xbabf('0x22')]();};}function saveUpdates(_0xbfdb4b,_0x4acab2){return function(_0x229252){if(_0x229252){return _0x229252[_0xbabf('0x23')](_0xbfdb4b)[_0xbabf('0x24')](function(_0x5a3c9f){return _0x5a3c9f;});}return null;};}function removeEntity(_0xe43119,_0x4d3b06){return function(_0x59cb9a){if(_0x59cb9a){return _0x59cb9a[_0xbabf('0x25')]()[_0xbabf('0x24')](function(){_0xe43119[_0xbabf('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e5c5a,_0x5bf480){return function(_0x4e8325){if(!_0x4e8325){_0x5e5c5a[_0xbabf('0x19')](0x194);}return _0x4e8325;};}function handleError(_0x218d22,_0x501a26){_0x501a26=_0x501a26||0x1f4;return function(_0x3f892a){logger[_0xbabf('0x26')](_0x3f892a[_0xbabf('0x27')]);if(_0x3f892a['name']){delete _0x3f892a[_0xbabf('0x28')];}_0x218d22['status'](_0x501a26)[_0xbabf('0x29')](_0x3f892a);};}exports['index']=function(_0x482755,_0xa6ab3f){var _0x34e0b6={},_0x164245={},_0x530d62={'count':0x0,'rows':[]};var _0x6a0231=db[_0xbabf('0x2a')]['rawAttributes'];_0x164245[_0xbabf('0x2b')]=_[_0xbabf('0x2c')](_0x6a0231);_0x164245['query']=_[_0xbabf('0x2c')](_0x482755[_0xbabf('0x2d')]);_0x164245[_0xbabf('0x2e')]=_[_0xbabf('0x2f')](_0x164245['model'],_0x164245[_0xbabf('0x2d')]);_0x34e0b6[_0xbabf('0x30')]=_['intersection'](_0x164245[_0xbabf('0x2b')],qs[_0xbabf('0x31')](_0x482755[_0xbabf('0x2d')][_0xbabf('0x31')]));_0x34e0b6[_0xbabf('0x30')]=_0x34e0b6[_0xbabf('0x30')]['length']?_0x34e0b6[_0xbabf('0x30')]:_0x164245['model'];if(!_0x482755['query'][_0xbabf('0x32')](_0xbabf('0x33'))){_0x34e0b6[_0xbabf('0x1e')]=qs['limit'](_0x482755[_0xbabf('0x2d')][_0xbabf('0x1e')]);_0x34e0b6[_0xbabf('0x1d')]=qs[_0xbabf('0x1d')](_0x482755[_0xbabf('0x2d')][_0xbabf('0x1d')]);}_0x34e0b6[_0xbabf('0x34')]=qs[_0xbabf('0x35')](_0x482755[_0xbabf('0x2d')]['sort']);_0x34e0b6['where']=qs[_0xbabf('0x2e')](_[_0xbabf('0x36')](_0x482755[_0xbabf('0x2d')],_0x164245[_0xbabf('0x2e')]));if(_0x482755['query'][_0xbabf('0x37')]){_0x34e0b6[_0xbabf('0x38')]=_[_0xbabf('0x39')](_0x34e0b6[_0xbabf('0x38')],{'$or':_[_0xbabf('0x3a')](_0x6a0231,function(_0x2bce16){if(_0x2bce16[_0xbabf('0x3b')][_0xbabf('0x3c')]!==_0xbabf('0x3d')){var _0x41108c={};_0x41108c[_0x2bce16[_0xbabf('0x3e')]]={'$like':'%'+_0x482755[_0xbabf('0x2d')][_0xbabf('0x37')]+'%'};return _0x41108c;}})});}_0x34e0b6=_['merge']({},_0x34e0b6,_0x482755[_0xbabf('0x3f')]);var _0x3b8307={'where':_0x34e0b6[_0xbabf('0x38')]};return db[_0xbabf('0x2a')]['count'](_0x3b8307)[_0xbabf('0x24')](function(_0x4acc58){_0x530d62[_0xbabf('0x1c')]=_0x4acc58;if(_0x482755[_0xbabf('0x2d')]['includeAll']){_0x34e0b6[_0xbabf('0x40')]=[{'all':!![]}];}return db[_0xbabf('0x2a')][_0xbabf('0x41')](_0x34e0b6);})[_0xbabf('0x24')](function(_0x8a1a27){_0x530d62[_0xbabf('0x42')]=_0x8a1a27;return _0x530d62;})[_0xbabf('0x24')](respondWithFilteredResult(_0xa6ab3f,_0x34e0b6))[_0xbabf('0x43')](handleError(_0xa6ab3f,null));};exports[_0xbabf('0x44')]=function(_0x18dcd4,_0x50691a){var _0x255fba={'raw':!![],'where':{'id':_0x18dcd4['params']['id']}},_0x3f2229={};_0x3f2229[_0xbabf('0x2b')]=_[_0xbabf('0x2c')](db[_0xbabf('0x2a')][_0xbabf('0x45')]);_0x3f2229['query']=_[_0xbabf('0x2c')](_0x18dcd4[_0xbabf('0x2d')]);_0x3f2229[_0xbabf('0x2e')]=_[_0xbabf('0x2f')](_0x3f2229[_0xbabf('0x2b')],_0x3f2229[_0xbabf('0x2d')]);_0x255fba[_0xbabf('0x30')]=_['intersection'](_0x3f2229[_0xbabf('0x2b')],qs['fields'](_0x18dcd4[_0xbabf('0x2d')]['fields']));_0x255fba['attributes']=_0x255fba[_0xbabf('0x30')]['length']?_0x255fba[_0xbabf('0x30')]:_0x3f2229[_0xbabf('0x2b')];if(_0x18dcd4[_0xbabf('0x2d')][_0xbabf('0x46')]){_0x255fba[_0xbabf('0x40')]=[{'all':!![]}];}_0x255fba=_[_0xbabf('0x39')]({},_0x255fba,_0x18dcd4[_0xbabf('0x3f')]);return db[_0xbabf('0x2a')][_0xbabf('0x47')](_0x255fba)[_0xbabf('0x24')](handleEntityNotFound(_0x50691a,null))[_0xbabf('0x24')](respondWithResult(_0x50691a,null))[_0xbabf('0x43')](handleError(_0x50691a,null));};exports[_0xbabf('0x23')]=function(_0x5a75b3,_0x550479){if(_0x5a75b3[_0xbabf('0x48')]['id']){delete _0x5a75b3[_0xbabf('0x48')]['id'];}return db[_0xbabf('0x2a')][_0xbabf('0x47')]({'where':{'id':_0x5a75b3['params']['id']}})['then'](handleEntityNotFound(_0x550479,null))[_0xbabf('0x24')](saveUpdates(_0x5a75b3['body'],null))[_0xbabf('0x24')](respondWithResult(_0x550479,null))[_0xbabf('0x43')](handleError(_0x550479,null));};exports[_0xbabf('0x25')]=function(_0x272d4a,_0x43b73d){return db[_0xbabf('0x2a')][_0xbabf('0x47')]({'where':{'id':_0x272d4a[_0xbabf('0x49')]['id']}})['then'](handleEntityNotFound(_0x43b73d,null))[_0xbabf('0x24')](removeEntity(_0x43b73d,null))['catch'](handleError(_0x43b73d,null));};exports[_0xbabf('0x4a')]=function(_0x4584bf,_0x2ef3b0,_0x1d7919){_0x4584bf[_0xbabf('0x48')][_0xbabf('0x28')]=_0x4584bf[_0xbabf('0x4b')][_0xbabf('0x4c')];_0x4584bf[_0xbabf('0x48')][_0xbabf('0x4d')]=_0x4584bf['file'][_0xbabf('0x4e')];_0x4584bf[_0xbabf('0x48')][_0xbabf('0x3b')]=_0x4584bf[_0xbabf('0x4b')][_0xbabf('0x4f')];return db[_0xbabf('0x2a')][_0xbabf('0x4a')](_0x4584bf[_0xbabf('0x48')])[_0xbabf('0x24')](respondWithResult(_0x2ef3b0,0xc9))[_0xbabf('0x43')](handleError(_0x2ef3b0,null));};exports[_0xbabf('0x50')]=function(_0x434a8b,_0x4126de,_0x4f0424){return db[_0xbabf('0x2a')][_0xbabf('0x51')]({'where':{'id':_0x434a8b[_0xbabf('0x49')]['id']},'raw':!![]})[_0xbabf('0x24')](handleEntityNotFound(_0x4126de,null))['then'](function(_0x11d892){if(_0x11d892){return _0x4126de[_0xbabf('0x50')](path[_0xbabf('0x52')](config[_0xbabf('0x53')],_0xbabf('0x54'),_0x11d892[_0xbabf('0x4d')]));}})[_0xbabf('0x43')](handleError(_0x4126de,null));};
\ No newline at end of file
+var _0xe673=['rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','map','type','key','filter','options','include','findAll','rows','catch','show','keys','find','params','body','create','originalname','filename','file','findOne','download','join','root','server/files/attachments/','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','reject','save','update','then','destroy','name','send','index','Attachment'];(function(_0x12d0c2,_0x420ee2){var _0x3867fd=function(_0x31182e){while(--_0x31182e){_0x12d0c2['push'](_0x12d0c2['shift']());}};_0x3867fd(++_0x420ee2);}(_0xe673,0x151));var _0x3e67=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe673[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3e67('0x0'));var rimraf=require(_0x3e67('0x1'));var zipdir=require(_0x3e67('0x2'));var jsonpatch=require(_0x3e67('0x3'));var rp=require('request-promise');var moment=require(_0x3e67('0x4'));var BPromise=require(_0x3e67('0x5'));var Mustache=require(_0x3e67('0x6'));var util=require('util');var path=require(_0x3e67('0x7'));var sox=require(_0x3e67('0x8'));var csv=require(_0x3e67('0x9'));var ejs=require(_0x3e67('0xa'));var fs=require('fs');var _=require(_0x3e67('0xb'));var squel=require('squel');var crypto=require(_0x3e67('0xc'));var jsforce=require(_0x3e67('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e67('0xe'));var Papa=require(_0x3e67('0xf'));var Redis=require(_0x3e67('0x10'));var authService=require(_0x3e67('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3e67('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e67('0x13'))(_0x3e67('0x14'));var utils=require('../../config/utils');var config=require(_0x3e67('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e602a,_0x1209d8){_0x1209d8=_0x1209d8||0xcc;return function(_0x3ec801){if(_0x3ec801){return _0x2e602a[_0x3e67('0x16')](_0x1209d8);}return _0x2e602a[_0x3e67('0x17')](_0x1209d8)[_0x3e67('0x18')]();};}function respondWithResult(_0x1ff1e6,_0x1c89d1){_0x1c89d1=_0x1c89d1||0xc8;return function(_0xad30c6){if(_0xad30c6){return _0x1ff1e6[_0x3e67('0x17')](_0x1c89d1)[_0x3e67('0x19')](_0xad30c6);}};}function respondWithFilteredResult(_0x4cdbcf,_0x251c49){return function(_0x2e040b){if(_0x2e040b){var _0x25e98e=_0x2e040b[_0x3e67('0x1a')],_0x256592=_0x251c49[_0x3e67('0x1b')],_0x366a9b=_0x251c49[_0x3e67('0x1b')]+_0x251c49[_0x3e67('0x1c')],_0x5e3f98;if(_0x366a9b>=_0x25e98e){_0x366a9b=_0x25e98e;_0x5e3f98=0xc8;}else{_0x5e3f98=0xce;}_0x4cdbcf[_0x3e67('0x17')](_0x5e3f98);return _0x4cdbcf['set']('Content-Range',_0x256592+'-'+_0x366a9b+'/'+_0x25e98e)[_0x3e67('0x19')](_0x2e040b);}return null;};}function patchUpdates(_0xa9bf64){return function(_0x3a6d0a){try{jsonpatch['apply'](_0x3a6d0a,_0xa9bf64,!![]);}catch(_0x40b562){return BPromise[_0x3e67('0x1d')](_0x40b562);}return _0x3a6d0a[_0x3e67('0x1e')]();};}function saveUpdates(_0x11b7b8,_0x26d2f1){return function(_0x4888f4){if(_0x4888f4){return _0x4888f4[_0x3e67('0x1f')](_0x11b7b8)[_0x3e67('0x20')](function(_0x46bf5d){return _0x46bf5d;});}return null;};}function removeEntity(_0x24ab54,_0x53c934){return function(_0xf4a5d0){if(_0xf4a5d0){return _0xf4a5d0[_0x3e67('0x21')]()[_0x3e67('0x20')](function(){_0x24ab54['status'](0xcc)[_0x3e67('0x18')]();});}};}function handleEntityNotFound(_0x59b23e,_0x49b290){return function(_0x3bc27f){if(!_0x3bc27f){_0x59b23e[_0x3e67('0x16')](0x194);}return _0x3bc27f;};}function handleError(_0x4d61ff,_0x24896b){_0x24896b=_0x24896b||0x1f4;return function(_0x201f0c){logger['error'](_0x201f0c['stack']);if(_0x201f0c[_0x3e67('0x22')]){delete _0x201f0c[_0x3e67('0x22')];}_0x4d61ff['status'](_0x24896b)[_0x3e67('0x23')](_0x201f0c);};}exports[_0x3e67('0x24')]=function(_0x5679d0,_0x333ec7){var _0x349144={},_0x410f97={},_0x53d0ba={'count':0x0,'rows':[]};var _0x3abb5e=db[_0x3e67('0x25')][_0x3e67('0x26')];_0x410f97[_0x3e67('0x27')]=_['keys'](_0x3abb5e);_0x410f97[_0x3e67('0x28')]=_['keys'](_0x5679d0[_0x3e67('0x28')]);_0x410f97[_0x3e67('0x29')]=_[_0x3e67('0x2a')](_0x410f97[_0x3e67('0x27')],_0x410f97[_0x3e67('0x28')]);_0x349144[_0x3e67('0x2b')]=_['intersection'](_0x410f97[_0x3e67('0x27')],qs[_0x3e67('0x2c')](_0x5679d0[_0x3e67('0x28')][_0x3e67('0x2c')]));_0x349144[_0x3e67('0x2b')]=_0x349144[_0x3e67('0x2b')][_0x3e67('0x2d')]?_0x349144[_0x3e67('0x2b')]:_0x410f97[_0x3e67('0x27')];if(!_0x5679d0['query'][_0x3e67('0x2e')]('nolimit')){_0x349144['limit']=qs[_0x3e67('0x1c')](_0x5679d0[_0x3e67('0x28')][_0x3e67('0x1c')]);_0x349144[_0x3e67('0x1b')]=qs[_0x3e67('0x1b')](_0x5679d0[_0x3e67('0x28')][_0x3e67('0x1b')]);}_0x349144['order']=qs['sort'](_0x5679d0['query'][_0x3e67('0x2f')]);_0x349144[_0x3e67('0x30')]=qs['filters'](_[_0x3e67('0x31')](_0x5679d0[_0x3e67('0x28')],_0x410f97[_0x3e67('0x29')]));if(_0x5679d0['query']['filter']){_0x349144[_0x3e67('0x30')]=_[_0x3e67('0x32')](_0x349144['where'],{'$or':_[_0x3e67('0x33')](_0x3abb5e,function(_0xa9c96b){if(_0xa9c96b[_0x3e67('0x34')][_0x3e67('0x35')]!=='VIRTUAL'){var _0x404545={};_0x404545[_0xa9c96b['field']]={'$like':'%'+_0x5679d0[_0x3e67('0x28')][_0x3e67('0x36')]+'%'};return _0x404545;}})});}_0x349144=_[_0x3e67('0x32')]({},_0x349144,_0x5679d0[_0x3e67('0x37')]);var _0x3f800a={'where':_0x349144[_0x3e67('0x30')]};return db['Attachment']['count'](_0x3f800a)[_0x3e67('0x20')](function(_0x1f11b6){_0x53d0ba[_0x3e67('0x1a')]=_0x1f11b6;if(_0x5679d0[_0x3e67('0x28')]['includeAll']){_0x349144[_0x3e67('0x38')]=[{'all':!![]}];}return db[_0x3e67('0x25')][_0x3e67('0x39')](_0x349144);})[_0x3e67('0x20')](function(_0x43aeca){_0x53d0ba[_0x3e67('0x3a')]=_0x43aeca;return _0x53d0ba;})[_0x3e67('0x20')](respondWithFilteredResult(_0x333ec7,_0x349144))[_0x3e67('0x3b')](handleError(_0x333ec7,null));};exports[_0x3e67('0x3c')]=function(_0x2bffca,_0x5c4df9){var _0x5788b4={'raw':!![],'where':{'id':_0x2bffca['params']['id']}},_0x5ffbb6={};_0x5ffbb6[_0x3e67('0x27')]=_['keys'](db[_0x3e67('0x25')]['rawAttributes']);_0x5ffbb6[_0x3e67('0x28')]=_[_0x3e67('0x3d')](_0x2bffca[_0x3e67('0x28')]);_0x5ffbb6[_0x3e67('0x29')]=_[_0x3e67('0x2a')](_0x5ffbb6[_0x3e67('0x27')],_0x5ffbb6[_0x3e67('0x28')]);_0x5788b4['attributes']=_[_0x3e67('0x2a')](_0x5ffbb6[_0x3e67('0x27')],qs[_0x3e67('0x2c')](_0x2bffca[_0x3e67('0x28')][_0x3e67('0x2c')]));_0x5788b4[_0x3e67('0x2b')]=_0x5788b4['attributes'][_0x3e67('0x2d')]?_0x5788b4[_0x3e67('0x2b')]:_0x5ffbb6[_0x3e67('0x27')];if(_0x2bffca['query']['includeAll']){_0x5788b4['include']=[{'all':!![]}];}_0x5788b4=_['merge']({},_0x5788b4,_0x2bffca[_0x3e67('0x37')]);return db[_0x3e67('0x25')][_0x3e67('0x3e')](_0x5788b4)[_0x3e67('0x20')](handleEntityNotFound(_0x5c4df9,null))[_0x3e67('0x20')](respondWithResult(_0x5c4df9,null))[_0x3e67('0x3b')](handleError(_0x5c4df9,null));};exports[_0x3e67('0x1f')]=function(_0x56e040,_0x45096c){if(_0x56e040['body']['id']){delete _0x56e040['body']['id'];}return db[_0x3e67('0x25')][_0x3e67('0x3e')]({'where':{'id':_0x56e040[_0x3e67('0x3f')]['id']}})[_0x3e67('0x20')](handleEntityNotFound(_0x45096c,null))[_0x3e67('0x20')](saveUpdates(_0x56e040[_0x3e67('0x40')],null))['then'](respondWithResult(_0x45096c,null))[_0x3e67('0x3b')](handleError(_0x45096c,null));};exports[_0x3e67('0x21')]=function(_0x27210c,_0x4a8daa){return db[_0x3e67('0x25')]['find']({'where':{'id':_0x27210c[_0x3e67('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a8daa,null))[_0x3e67('0x20')](removeEntity(_0x4a8daa,null))[_0x3e67('0x3b')](handleError(_0x4a8daa,null));};exports[_0x3e67('0x41')]=function(_0x20d37e,_0x336c28,_0x55e98b){_0x20d37e[_0x3e67('0x40')][_0x3e67('0x22')]=_0x20d37e['file'][_0x3e67('0x42')];_0x20d37e[_0x3e67('0x40')]['basename']=_0x20d37e['file'][_0x3e67('0x43')];_0x20d37e['body'][_0x3e67('0x34')]=_0x20d37e[_0x3e67('0x44')]['mimetype'];return db[_0x3e67('0x25')][_0x3e67('0x41')](_0x20d37e['body'])['then'](respondWithResult(_0x336c28,0xc9))[_0x3e67('0x3b')](handleError(_0x336c28,null));};exports['download']=function(_0x3845ae,_0x32706d,_0x101599){return db[_0x3e67('0x25')][_0x3e67('0x45')]({'where':{'id':_0x3845ae[_0x3e67('0x3f')]['id']},'raw':!![]})[_0x3e67('0x20')](handleEntityNotFound(_0x32706d,null))[_0x3e67('0x20')](function(_0x1b096a){if(_0x1b096a){return _0x32706d[_0x3e67('0x46')](path[_0x3e67('0x47')](config[_0x3e67('0x48')],_0x3e67('0x49'),_0x1b096a[_0x3e67('0x4a')]));}})[_0x3e67('0x3b')](handleError(_0x32706d,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 452967b..e6c69eb 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 _0x02a7=['Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x4f6f91,_0x350d77){var _0x19be71=function(_0x7f0b0d){while(--_0x7f0b0d){_0x4f6f91['push'](_0x4f6f91['shift']());}};_0x19be71(++_0x350d77);}(_0x02a7,0x1a6));var _0x702a=function(_0x30b9ec,_0x3cb903){_0x30b9ec=_0x30b9ec-0x0;var _0x33a019=_0x02a7[_0x30b9ec];return _0x33a019;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var rp=require(_0x702a('0x5'));var fs=require('fs');var path=require(_0x702a('0x6'));var rimraf=require(_0x702a('0x7'));var config=require(_0x702a('0x8'));var attributes=require(_0x702a('0x9'));module['exports']=function(_0x4d3e8a,_0x804234){return _0x4d3e8a['define'](_0x702a('0xa'),attributes,{'tableName':_0x702a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d62=['attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x6da0a4,_0x45595b){var _0x5cd603=function(_0x40c93e){while(--_0x40c93e){_0x6da0a4['push'](_0x6da0a4['shift']());}};_0x5cd603(++_0x45595b);}(_0x8d62,0xf8));var _0x28d6=function(_0xb2a550,_0x5ee869){_0xb2a550=_0xb2a550-0x0;var _0x27254d=_0x8d62[_0xb2a550];return _0x27254d;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var logger=require(_0x28d6('0x1'))(_0x28d6('0x2'));var moment=require(_0x28d6('0x3'));var BPromise=require(_0x28d6('0x4'));var rp=require(_0x28d6('0x5'));var fs=require('fs');var path=require(_0x28d6('0x6'));var rimraf=require(_0x28d6('0x7'));var config=require(_0x28d6('0x8'));var attributes=require(_0x28d6('0x9'));module[_0x28d6('0xa')]=function(_0x4385ba,_0x3c827b){return _0x4385ba[_0x28d6('0xb')]('Attachment',attributes,{'tableName':_0x28d6('0xc'),'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 10e32e8..d0d8634 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 _0x7919=['options','raw','then','debug','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','catch','CreateAttachment','Attachment','create','body'];(function(_0x48686f,_0x2afb41){var _0x464e25=function(_0x5a3bff){while(--_0x5a3bff){_0x48686f['push'](_0x48686f['shift']());}};_0x464e25(++_0x2afb41);}(_0x7919,0x9b));var _0x9791=function(_0xd8c9a8,_0x4e4005){_0xd8c9a8=_0xd8c9a8-0x0;var _0x5488cc=_0x7919[_0xd8c9a8];return _0x5488cc;};'use strict';var _=require('lodash');var util=require(_0x9791('0x0'));var moment=require('moment');var BPromise=require(_0x9791('0x1'));var rs=require(_0x9791('0x2'));var fs=require('fs');var Redis=require(_0x9791('0x3'));var db=require(_0x9791('0x4'))['db'];var utils=require(_0x9791('0x5'));var logger=require(_0x9791('0x6'))(_0x9791('0x7'));var config=require(_0x9791('0x8'));var jayson=require(_0x9791('0x9'));var client=jayson[_0x9791('0xa')][_0x9791('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc1368,_0x34fd09,_0x581fbb){return new BPromise(function(_0x100e6c,_0x25ba57){return client[_0x9791('0xc')](_0xc1368,_0x581fbb)['then'](function(_0x313db5){logger[_0x9791('0xd')](_0x9791('0xe'),_0x34fd09,_0x9791('0xf'));logger['debug'](_0x9791('0x10'),_0x34fd09,_0x9791('0xf'),JSON['stringify'](_0x313db5));if(_0x313db5['error']){if(_0x313db5['error'][_0x9791('0x11')]===0x1f4){logger[_0x9791('0x12')](_0x9791('0xe'),_0x34fd09,_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);return _0x25ba57(_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);}logger[_0x9791('0x12')](_0x9791('0xe'),_0x34fd09,_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);return _0x100e6c(_0x313db5[_0x9791('0x12')][_0x9791('0x13')]);}else{logger[_0x9791('0xd')](_0x9791('0xe'),_0x34fd09,_0x9791('0xf'));_0x100e6c(_0x313db5['result'][_0x9791('0x13')]);}})[_0x9791('0x14')](function(_0x583f92){logger[_0x9791('0x12')](_0x9791('0xe'),_0x34fd09,_0x583f92);_0x25ba57(_0x583f92);});});}exports[_0x9791('0x15')]=function(_0x3da368){var _0x4134fa=this;return new Promise(function(_0x5b8b65,_0x31700d){return db[_0x9791('0x16')][_0x9791('0x17')](_0x3da368[_0x9791('0x18')],{'raw':_0x3da368[_0x9791('0x19')]?_0x3da368[_0x9791('0x19')][_0x9791('0x1a')]===undefined?!![]:![]:!![]})[_0x9791('0x1b')](function(_0x2cc44b){logger[_0x9791('0xd')](_0x9791('0x15'),_0x3da368);logger[_0x9791('0x1c')](_0x9791('0x15'),_0x3da368,JSON[_0x9791('0x1d')](_0x2cc44b));_0x5b8b65(_0x2cc44b);})['catch'](function(_0x32ceda){logger[_0x9791('0x12')](_0x9791('0x15'),_0x32ceda[_0x9791('0x13')],_0x3da368);_0x31700d(_0x4134fa[_0x9791('0x12')](0x1f4,_0x32ceda['message']));});});};
\ No newline at end of file
+var _0xda4c=['CreateAttachment','body','options','raw','lodash','util','moment','bluebird','randomstring','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'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda4c,0x7c));var _0xcda4=function(_0x2d71ec,_0x569175){_0x2d71ec=_0x2d71ec-0x0;var _0x1e65d2=_0xda4c[_0x2d71ec];return _0x1e65d2;};'use strict';var _=require(_0xcda4('0x0'));var util=require(_0xcda4('0x1'));var moment=require(_0xcda4('0x2'));var BPromise=require(_0xcda4('0x3'));var rs=require(_0xcda4('0x4'));var fs=require('fs');var Redis=require(_0xcda4('0x5'));var db=require(_0xcda4('0x6'))['db'];var utils=require(_0xcda4('0x7'));var logger=require('../../config/logger')(_0xcda4('0x8'));var config=require(_0xcda4('0x9'));var jayson=require(_0xcda4('0xa'));var client=jayson[_0xcda4('0xb')][_0xcda4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d9138,_0x78299e,_0x6a63ee){return new BPromise(function(_0xdf4344,_0x32a530){return client[_0xcda4('0xd')](_0x3d9138,_0x6a63ee)[_0xcda4('0xe')](function(_0x2ebbf2){logger[_0xcda4('0xf')](_0xcda4('0x10'),_0x78299e,_0xcda4('0x11'));logger[_0xcda4('0x12')](_0xcda4('0x13'),_0x78299e,_0xcda4('0x11'),JSON[_0xcda4('0x14')](_0x2ebbf2));if(_0x2ebbf2['error']){if(_0x2ebbf2['error'][_0xcda4('0x15')]===0x1f4){logger[_0xcda4('0x16')](_0xcda4('0x10'),_0x78299e,_0x2ebbf2[_0xcda4('0x16')][_0xcda4('0x17')]);return _0x32a530(_0x2ebbf2[_0xcda4('0x16')][_0xcda4('0x17')]);}logger[_0xcda4('0x16')](_0xcda4('0x10'),_0x78299e,_0x2ebbf2[_0xcda4('0x16')][_0xcda4('0x17')]);return _0xdf4344(_0x2ebbf2[_0xcda4('0x16')]['message']);}else{logger[_0xcda4('0xf')](_0xcda4('0x10'),_0x78299e,_0xcda4('0x11'));_0xdf4344(_0x2ebbf2[_0xcda4('0x18')][_0xcda4('0x17')]);}})[_0xcda4('0x19')](function(_0x10a96c){logger[_0xcda4('0x16')]('Attachment,\x20%s,\x20%s',_0x78299e,_0x10a96c);_0x32a530(_0x10a96c);});});}exports[_0xcda4('0x1a')]=function(_0x37a0f9){var _0x33820e=this;return new Promise(function(_0xa2cc9b,_0x2662da){return db['Attachment']['create'](_0x37a0f9[_0xcda4('0x1b')],{'raw':_0x37a0f9[_0xcda4('0x1c')]?_0x37a0f9[_0xcda4('0x1c')][_0xcda4('0x1d')]===undefined?!![]:![]:!![]})[_0xcda4('0xe')](function(_0xd4b82e){logger[_0xcda4('0xf')](_0xcda4('0x1a'),_0x37a0f9);logger[_0xcda4('0x12')]('CreateAttachment',_0x37a0f9,JSON[_0xcda4('0x14')](_0xd4b82e));_0xa2cc9b(_0xd4b82e);})[_0xcda4('0x19')](function(_0x22f2ae){logger[_0xcda4('0x16')](_0xcda4('0x1a'),_0x22f2ae[_0xcda4('0x17')],_0x37a0f9);_0x2662da(_0x33820e[_0xcda4('0x16')](0x1f4,_0x22f2ae[_0xcda4('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 50409b7..688bc09 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 _0xdbb3=['../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','/:id','show','download','root','server/files/attachments/','format','%s-%s','now','post','single','file','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x213065,_0x3afd09){var _0x50a790=function(_0x5705dd){while(--_0x5705dd){_0x213065['push'](_0x213065['shift']());}};_0x50a790(++_0x3afd09);}(_0xdbb3,0x182));var _0x3dbb=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xdbb3[_0x12d033];return _0x3b4e80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3dbb('0x0'));var timeout=require(_0x3dbb('0x1'));var express=require(_0x3dbb('0x2'));var router=express[_0x3dbb('0x3')]();var auth=require(_0x3dbb('0x4'));var interaction=require(_0x3dbb('0x5'));var config=require(_0x3dbb('0x6'));var controller=require(_0x3dbb('0x7'));router[_0x3dbb('0x8')]('/',auth[_0x3dbb('0x9')](),controller['index']);router[_0x3dbb('0x8')](_0x3dbb('0xa'),auth[_0x3dbb('0x9')](),controller[_0x3dbb('0xb')]);router[_0x3dbb('0x8')]('/:id/download',auth[_0x3dbb('0x9')](),controller[_0x3dbb('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c838c,_0x3d9d41,_0x2fc473){_0x2fc473(null,path['join'](config[_0x3dbb('0xd')],_0x3dbb('0xe')));},'filename':function(_0x5a3d13,_0x25cd4d,_0x5b2eef){_0x5b2eef(null,util[_0x3dbb('0xf')](_0x3dbb('0x10'),Date[_0x3dbb('0x11')](),_0x25cd4d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3dbb('0x12')]('/',upload[_0x3dbb('0x13')](_0x3dbb('0x14')),controller['create']);router['put'](_0x3dbb('0xa'),auth[_0x3dbb('0x9')](),controller['update']);router['delete'](_0x3dbb('0xa'),auth[_0x3dbb('0x9')](),controller[_0x3dbb('0x15')]);module[_0x3dbb('0x16')]=router;
\ No newline at end of file
+var _0x78fa=['server/files/attachments/','format','%s-%s','now','originalname','post','single','file','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','download','diskStorage','join','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78fa,0x82));var _0xa78f=function(_0x9be738,_0xc3ae98){_0x9be738=_0x9be738-0x0;var _0x1f7dbc=_0x78fa[_0x9be738];return _0x1f7dbc;};'use strict';var multer=require('multer');var util=require(_0xa78f('0x0'));var path=require(_0xa78f('0x1'));var timeout=require('connect-timeout');var express=require(_0xa78f('0x2'));var router=express[_0xa78f('0x3')]();var auth=require(_0xa78f('0x4'));var interaction=require(_0xa78f('0x5'));var config=require(_0xa78f('0x6'));var controller=require('./attachment.controller');router[_0xa78f('0x7')]('/',auth[_0xa78f('0x8')](),controller[_0xa78f('0x9')]);router['get'](_0xa78f('0xa'),auth[_0xa78f('0x8')](),controller['show']);router[_0xa78f('0x7')]('/:id/download',auth[_0xa78f('0x8')](),controller[_0xa78f('0xb')]);var upload=multer({'storage':multer[_0xa78f('0xc')]({'destination':function(_0x57cfe0,_0x427443,_0x19ca74){_0x19ca74(null,path[_0xa78f('0xd')](config[_0xa78f('0xe')],_0xa78f('0xf')));},'filename':function(_0x54313f,_0xde16da,_0x4e0832){_0x4e0832(null,util[_0xa78f('0x10')](_0xa78f('0x11'),Date[_0xa78f('0x12')](),_0xde16da[_0xa78f('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa78f('0x14')]('/',upload[_0xa78f('0x15')](_0xa78f('0x16')),controller[_0xa78f('0x17')]);router[_0xa78f('0x18')](_0xa78f('0xa'),auth[_0xa78f('0x8')](),controller[_0xa78f('0x19')]);router[_0xa78f('0x1a')](_0xa78f('0xa'),auth[_0xa78f('0x8')](),controller[_0xa78f('0x1b')]);module[_0xa78f('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index e027bb7..008ded3 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 _0x2aa4=['../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','map','emails','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','blockDuration','minutes','clearBlockUser','getLicense','catch','passport-google-oauth20','moment'];(function(_0x497930,_0x206252){var _0x5cdd88=function(_0x1ebc6c){while(--_0x1ebc6c){_0x497930['push'](_0x497930['shift']());}};_0x5cdd88(++_0x206252);}(_0x2aa4,0x1ae));var _0x42aa=function(_0x48f109,_0x43477c){_0x48f109=_0x48f109-0x0;var _0x30f6f3=_0x2aa4[_0x48f109];return _0x30f6f3;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x42aa('0x0'))['Strategy'];var moment=require(_0x42aa('0x1'));var db=require(_0x42aa('0x2'))['db'];var config=require(_0x42aa('0x3'));var signToken=require(_0x42aa('0x4'))[_0x42aa('0x5')];var utils=require(_0x42aa('0x6'));exports[_0x42aa('0x7')]=passport['authenticate'](_0x42aa('0x8'),{'failureRedirect':_0x42aa('0x9'),'scope':[_0x42aa('0xa'),_0x42aa('0xb')],'session':![]});exports['callback']=passport[_0x42aa('0xc')](_0x42aa('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x42aa('0xd')](new GoogleStrategy({'clientID':config[_0x42aa('0x8')]?config[_0x42aa('0x8')][_0x42aa('0xe')]:'id','clientSecret':config['google']?config[_0x42aa('0x8')][_0x42aa('0xf')]:_0x42aa('0x10'),'callbackURL':config[_0x42aa('0x8')]?config[_0x42aa('0x8')][_0x42aa('0x11')]:''},function(_0x1b292e,_0x531b41,_0x20f5ac,_0x1a67f4){var _0x4fd443,_0x193429;return db[_0x42aa('0x12')][_0x42aa('0x13')]({'where':{'id':0x1},'attributes':[_0x42aa('0x14'),'blockDuration'],'raw':!![]})[_0x42aa('0x15')](function(_0x4bf14f){_0x4fd443=_0x4bf14f;return db['User']['find']({'where':{'email':_[_0x42aa('0x16')](_0x20f5ac[_0x42aa('0x17')],_0x42aa('0x18')),'role':{'$or':[_0x42aa('0x19'),_0x42aa('0x1a'),_0x42aa('0x1b')]}}});})['then'](function(_0x2a2e74){_0x193429=_0x2a2e74;if(_0x193429){if(_0x193429['disabled']){return _0x1a67f4(_0x42aa('0x1c'));}else if(_0x4fd443['blockDuration']>0x0){if(_0x193429[_0x42aa('0x1d')]){if(moment(_0x193429[_0x42aa('0x1e')])['add'](_0x4fd443[_0x42aa('0x1f')],_0x42aa('0x20'))>moment()){return _0x1a67f4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x42aa('0x21')](_0x193429,0x0,![],null)[_0x42aa('0x15')](function(){return utils[_0x42aa('0x22')](_0x193429);})[_0x42aa('0x15')](function(){return _0x1a67f4(null,_0x193429);});}}else{return utils[_0x42aa('0x22')](_0x193429)[_0x42aa('0x15')](function(){return _0x1a67f4(null,_0x193429);});}}else{return utils[_0x42aa('0x22')](_0x193429)[_0x42aa('0x15')](function(){return _0x1a67f4(null,_0x193429);});}}return _0x1a67f4(_0x42aa('0x1c'));})[_0x42aa('0x23')](function(_0x3e30db){_0x1a67f4(_0x3e30db);});}));
\ No newline at end of file
+var _0x967a=['User','find','map','admin','user','disabled','blockDuration','add','minutes','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','google','/login','profile','authenticate','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then'];(function(_0x27214f,_0x27d2cf){var _0x13dcfd=function(_0x2eb65e){while(--_0x2eb65e){_0x27214f['push'](_0x27214f['shift']());}};_0x13dcfd(++_0x27d2cf);}(_0x967a,0x160));var _0xa967=function(_0x3786f8,_0x3c3675){_0x3786f8=_0x3786f8-0x0;var _0x542370=_0x967a[_0x3786f8];return _0x542370;};'use strict';var _=require(_0xa967('0x0'));var passport=require(_0xa967('0x1'));var GoogleStrategy=require(_0xa967('0x2'))[_0xa967('0x3')];var moment=require(_0xa967('0x4'));var db=require(_0xa967('0x5'))['db'];var config=require(_0xa967('0x6'));var signToken=require(_0xa967('0x7'))[_0xa967('0x8')];var utils=require('../../config/utils');exports[_0xa967('0x9')]=passport['authenticate'](_0xa967('0xa'),{'failureRedirect':_0xa967('0xb'),'scope':[_0xa967('0xc'),'email'],'session':![]});exports['callback']=passport[_0xa967('0xd')]('google',{'failureRedirect':_0xa967('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xa967('0xa')]?config['google'][_0xa967('0xe')]:'id','clientSecret':config[_0xa967('0xa')]?config['google'][_0xa967('0xf')]:_0xa967('0x10'),'callbackURL':config[_0xa967('0xa')]?config[_0xa967('0xa')][_0xa967('0x11')]:''},function(_0x21a2ce,_0x7c88a4,_0x45473f,_0x5575c3){var _0x588995,_0x45a795;return db[_0xa967('0x12')][_0xa967('0x13')]({'where':{'id':0x1},'attributes':[_0xa967('0x14'),'blockDuration'],'raw':!![]})[_0xa967('0x15')](function(_0x22914c){_0x588995=_0x22914c;return db[_0xa967('0x16')][_0xa967('0x17')]({'where':{'email':_[_0xa967('0x18')](_0x45473f['emails'],'value'),'role':{'$or':[_0xa967('0x19'),_0xa967('0x1a'),'agent']}}});})['then'](function(_0x3b7b4b){_0x45a795=_0x3b7b4b;if(_0x45a795){if(_0x45a795[_0xa967('0x1b')]){return _0x5575c3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x588995[_0xa967('0x1c')]>0x0){if(_0x45a795['blocked']){if(moment(_0x45a795['blockedAt'])[_0xa967('0x1d')](_0x588995[_0xa967('0x1c')],_0xa967('0x1e'))>moment()){return _0x5575c3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x45a795,0x0,![],null)[_0xa967('0x15')](function(){return utils[_0xa967('0x1f')](_0x45a795);})[_0xa967('0x15')](function(){return _0x5575c3(null,_0x45a795);});}}else{return utils[_0xa967('0x1f')](_0x45a795)[_0xa967('0x15')](function(){return _0x5575c3(null,_0x45a795);});}}else{return utils[_0xa967('0x1f')](_0x45a795)['then'](function(){return _0x5575c3(null,_0x45a795);});}}return _0x5575c3(_0xa967('0x20'));})[_0xa967('0x21')](function(_0x202470){_0x5575c3(_0x202470);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 375ab73..0fa2516 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 _0xc125=['login','/callback','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xc125,0x150));var _0x5c12=function(_0x12b4ed,_0x241e7d){_0x12b4ed=_0x12b4ed-0x0;var _0x3720df=_0xc125[_0x12b4ed];return _0x3720df;};'use strict';var express=require('express');var passport=require(_0x5c12('0x0'));var router=express['Router']();var controller=require(_0x5c12('0x1'));var userController=require(_0x5c12('0x2'));var authService=require(_0x5c12('0x3'));router[_0x5c12('0x4')]('/',controller[_0x5c12('0x5')]);router[_0x5c12('0x4')](_0x5c12('0x6'),controller[_0x5c12('0x7')],authService[_0x5c12('0x8')],userController[_0x5c12('0x5')],authService[_0x5c12('0x9')]);module[_0x5c12('0xa')]=router;
\ No newline at end of file
+var _0x7794=['../user/user.controller.js','get','login','/callback','setTokenCookie','exports','passport','Router','./authGoogle.controller'];(function(_0x13c523,_0x5648df){var _0x19a977=function(_0x2992b6){while(--_0x2992b6){_0x13c523['push'](_0x13c523['shift']());}};_0x19a977(++_0x5648df);}(_0x7794,0x7b));var _0x4779=function(_0x35fec4,_0x378bb6){_0x35fec4=_0x35fec4-0x0;var _0x21a736=_0x7794[_0x35fec4];return _0x21a736;};'use strict';var express=require('express');var passport=require(_0x4779('0x0'));var router=express[_0x4779('0x1')]();var controller=require(_0x4779('0x2'));var userController=require(_0x4779('0x3'));var authService=require('../../components/auth/service');router[_0x4779('0x4')]('/',controller[_0x4779('0x5')]);router['get'](_0x4779('0x6'),controller['callback'],authService['isMiddleware'],userController['login'],authService[_0x4779('0x7')]);module[_0x4779('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 1033221..27d150d 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 _0xf494=['find','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','disabled','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','save','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','minutes','getLicense','catch','MailAccount'];(function(_0x2bdcf2,_0x52512b){var _0x216126=function(_0x34ae91){while(--_0x34ae91){_0x2bdcf2['push'](_0x2bdcf2['shift']());}};_0x216126(++_0x52512b);}(_0xf494,0x1c6));var _0x4f49=function(_0x22d4f5,_0x3edb4e){_0x22d4f5=_0x22d4f5-0x0;var _0x5f4d1e=_0xf494[_0x22d4f5];return _0x5f4d1e;};'use strict';var util=require(_0x4f49('0x0'));var passport=require(_0x4f49('0x1'));var LocalStrategy=require(_0x4f49('0x2'))['Strategy'];var jayson=require(_0x4f49('0x3'));var _=require(_0x4f49('0x4'));var rs=require(_0x4f49('0x5'));var moment=require(_0x4f49('0x6'));var db=require(_0x4f49('0x7'))['db'];var authService=require(_0x4f49('0x8'));var utils=require(_0x4f49('0x9'));var client=jayson[_0x4f49('0xa')][_0x4f49('0xb')]({'port':0x232b});function localAuthenticate(_0x413530,_0x42b0e8,_0x5eb186,_0x58e9a0){var _0x169c95,_0x327bd5;return db[_0x4f49('0xc')][_0x4f49('0xd')]({'where':{'id':0x1},'attributes':[_0x4f49('0xe'),_0x4f49('0xf')],'raw':!![]})[_0x4f49('0x10')](function(_0x410884){_0x169c95=_0x410884;return _0x413530['findOne']({'attributes':['id',_0x4f49('0x11'),_0x4f49('0x12'),'salt',_0x4f49('0x13'),'disabled','blocked',_0x4f49('0x14'),_0x4f49('0x15')],'where':{'name':_0x42b0e8,'role':{'$or':['admin',_0x4f49('0x16'),_0x4f49('0x17')]}}});})[_0x4f49('0x10')](function(_0x2efe49){if(!_0x2efe49||_0x2efe49&&_0x2efe49[_0x4f49('0x11')]!==_0x42b0e8){throw new Error(_0x4f49('0x18'));}else{_0x327bd5=_0x2efe49;return _0x327bd5;}})[_0x4f49('0x10')](function(){_0x327bd5['authenticate'](_0x5eb186,function(_0x515ace,_0x1f2d0d){var _0x415e83=_0x327bd5['loginAttempts']+0x1;if(_0x515ace){return _0x58e9a0(_0x515ace);}else if(!_0x1f2d0d){if(_0x327bd5['disabled']){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else if(_0x169c95[_0x4f49('0xe')]>0x0){if(_0x327bd5[_0x4f49('0x19')]){if(_0x169c95['blockDuration']>0x0){if(moment(_0x327bd5[_0x4f49('0x14')])[_0x4f49('0x1a')](_0x169c95[_0x4f49('0xf')],'minutes')>moment()){return _0x58e9a0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x327bd5,_0x415e83,![],null)['then'](function(){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});});}}else{return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}}else{if(_0x415e83>=_0x169c95[_0x4f49('0xe')]){return utils[_0x4f49('0x1b')](_0x327bd5,0x0,!![],moment())['then'](function(){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});});}else{return utils[_0x4f49('0x1b')](_0x327bd5,_0x415e83,![],null)[_0x4f49('0x10')](function(){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});});}}}else{return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}}else{if(_0x327bd5['disabled']){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else if(_0x169c95[_0x4f49('0xe')]>0x0){if(_0x327bd5[_0x4f49('0x19')]){if(_0x169c95['blockDuration']>0x0){if(moment(_0x327bd5[_0x4f49('0x14')])[_0x4f49('0x1a')](_0x169c95[_0x4f49('0xf')],_0x4f49('0x1c'))>moment()){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else{return utils[_0x4f49('0x1b')](_0x327bd5,0x0,![],null)['then'](function(){return utils['getLicense'](_0x327bd5);})[_0x4f49('0x10')](function(){return _0x58e9a0(null,_0x327bd5);});}}else{return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}}else{return utils['clearBlockUser'](_0x327bd5,0x0,![],null)[_0x4f49('0x10')](function(){return utils[_0x4f49('0x1d')](_0x327bd5);})[_0x4f49('0x10')](function(){return _0x58e9a0(null,_0x327bd5);})['catch'](function(_0xc54070){return _0x58e9a0(null,![],_0xc54070);});}}else{if(_0x327bd5[_0x4f49('0x19')]){return _0x58e9a0(null,![],{'message':_0x4f49('0x18')});}else{return utils[_0x4f49('0x1d')](_0x327bd5)[_0x4f49('0x10')](function(){return _0x58e9a0(null,_0x327bd5);});}}}});})[_0x4f49('0x1e')](function(_0x4915af){return _0x58e9a0(null,![],_0x4915af);});}function sendServiceMail(_0x50c571){return db[_0x4f49('0x1f')][_0x4f49('0x20')]({'where':{'service':!![]},'attributes':['id',_0x4f49('0x11'),'email'],'include':[{'model':db[_0x4f49('0x21')],'as':_0x4f49('0x22')}]})[_0x4f49('0x10')](function(_0x506b20){if(!_0x506b20){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3e207f={'tls':{'rejectUnauthorized':![]}};if(_0x506b20[_0x4f49('0x22')][_0x4f49('0x23')]){_0x3e207f['service']=_0x506b20[_0x4f49('0x22')][_0x4f49('0x23')];}else{_0x3e207f[_0x4f49('0x24')]=_0x506b20[_0x4f49('0x22')][_0x4f49('0x24')];_0x3e207f[_0x4f49('0x25')]=_0x506b20[_0x4f49('0x22')][_0x4f49('0x25')];_0x3e207f[_0x4f49('0x26')]=_0x506b20[_0x4f49('0x22')][_0x4f49('0x26')];}if(_0x506b20[_0x4f49('0x22')][_0x4f49('0x27')]){_0x3e207f[_0x4f49('0x28')]={'user':_0x506b20[_0x4f49('0x22')][_0x4f49('0x16')],'pass':_0x506b20[_0x4f49('0x22')][_0x4f49('0x29')]};}var _0x3e7a08={'account':_0x3e207f,'message':_['merge']({'from':util[_0x4f49('0x2a')](_0x4f49('0x2b'),_0x506b20[_0x4f49('0x11')],_0x506b20[_0x4f49('0x2c')]||_0x506b20[_0x4f49('0x22')][_0x4f49('0x16')])},_0x50c571)};return client[_0x4f49('0x2d')](_0x4f49('0x2e'),_0x3e7a08);})[_0x4f49('0x10')](function(_0x338db8){if(_0x338db8[_0x4f49('0x2f')]){throw new Error(util[_0x4f49('0x2a')](_0x4f49('0x30'),_0x338db8['error'][_0x4f49('0x31')]||JSON[_0x4f49('0x32')](_0x338db8[_0x4f49('0x2f')])));}return!![];});}function handleError(_0x26014f,_0x1c1e9b,_0x3ee818){return _0x26014f[_0x4f49('0x33')](_0x1c1e9b||0x1f4)[_0x4f49('0x34')]({'message':_0x3ee818?_0x3ee818[_0x4f49('0x31')]||_0x3ee818:''});}function checkPasswordPattern(_0xf8c377,_0x173b6e,_0x141db){if(_0x141db){var _0x19219c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19219c[_0x4f49('0x35')](_0x173b6e)){return _0xf8c377;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xf8c377;}}exports[_0x4f49('0x36')]=function(_0xb0e6c2,_0x543605,_0x2b7eed){passport[_0x4f49('0x37')]('local',function(_0x29e762,_0x1dd1a6,_0x2548ad){var _0x200b1d=_0x29e762||_0x2548ad;if(_0x200b1d){return handleError(_0x543605,0x191,_0x200b1d);}if(!_0x1dd1a6){return handleError(_0x543605,0x194,{'message':_0x4f49('0x38')});}else{var _0x3d5cf2={'payload':{'id':_0x1dd1a6['id'],'role':_0x1dd1a6[_0x4f49('0x13')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3d5cf2)['then'](function(_0x55960a){_0x543605[_0x4f49('0x39')]({'id':_0x1dd1a6['id'],'token':_0x55960a,'statusCall':'','isAlreadyLogged':_0x1dd1a6[_0x4f49('0x3a')]});});}})(_0xb0e6c2,_0x543605,_0x2b7eed);};exports[_0x4f49('0x3b')]=function(_0x373f90,_0x1053b2,_0x1ecf6c){if(!_0x373f90[_0x4f49('0x3c')][_0x4f49('0x2c')]){return handleError(_0x1053b2,0x1f4,{'message':_0x4f49('0x3d')});}var _0x486b82=rs['generate']();_0x373f90[_0x4f49('0x3c')][_0x4f49('0x2c')]=_0x373f90[_0x4f49('0x3c')]['email'][_0x4f49('0x3e')]()['toLowerCase']();var _0x4b1fcc;return db[_0x4f49('0xc')][_0x4f49('0xd')]({'where':{'id':0x1},'attributes':[_0x4f49('0xe'),'blockDuration'],'raw':!![]})[_0x4f49('0x10')](function(_0x11b4df){_0x4b1fcc=_0x11b4df;return db['User'][_0x4f49('0x20')]({'where':{'email':_0x373f90['body'][_0x4f49('0x2c')]}});})[_0x4f49('0x10')](function(_0x133f39){if(!_0x133f39){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x133f39[_0x4f49('0x3f')]){throw new Error(_0x4f49('0x40'));}if(_0x133f39[_0x4f49('0x19')]){if(moment(_0x133f39[_0x4f49('0x14')])[_0x4f49('0x1a')](_0x4b1fcc[_0x4f49('0xf')],_0x4f49('0x1c'))>moment()){throw new Error(_0x4f49('0x41'));}else{_0x133f39[_0x4f49('0x19')]=![];_0x133f39[_0x4f49('0x14')]=null;}}_0x133f39['resetPasswordToken']=_0x486b82;_0x133f39[_0x4f49('0x42')]=Date[_0x4f49('0x43')]()+0x36ee80;return _0x133f39['save']();})[_0x4f49('0x10')](function(){return sendServiceMail({'to':_0x373f90['body'][_0x4f49('0x2c')],'subject':_0x4f49('0x44'),'text':_0x4f49('0x45')+_0x4f49('0x46')+'http://'+_0x373f90[_0x4f49('0x47')][_0x4f49('0x24')]+_0x4f49('0x48')+_0x486b82+'\x0a\x0a'+_0x4f49('0x49')});})[_0x4f49('0x10')](function(){_0x1053b2[_0x4f49('0x33')](0xc8)[_0x4f49('0x34')]({'message':_0x4f49('0x4a')});})[_0x4f49('0x1e')](function(_0x3520b2){return handleError(_0x1053b2,0x1f4,_0x3520b2);});};exports[_0x4f49('0x4b')]=function(_0x4482f7,_0x148031,_0x2104d0){var _0x26464c;return db[_0x4f49('0x4c')]['find']({'where':{'resetPasswordToken':_0x4482f7['params'][_0x4f49('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x4f49('0x43')]()}}})[_0x4f49('0x10')](function(_0xe46c90){_0x26464c=_0xe46c90;if(!_0x26464c){throw new Error(_0x4f49('0x4e'));}return db[_0x4f49('0xc')][_0x4f49('0xd')]({'attributes':['id','securePassword']});})[_0x4f49('0x10')](function(_0x4ff0a2){return checkPasswordPattern(_0x4ff0a2,_0x4482f7[_0x4f49('0x3c')][_0x4f49('0x12')],_0x4ff0a2[_0x4f49('0x4f')]);})[_0x4f49('0x10')](function(){_0x26464c['password']=_0x4482f7[_0x4f49('0x3c')]['password'];_0x26464c['resetPasswordToken']=null;_0x26464c[_0x4f49('0x42')]=null;return _0x26464c[_0x4f49('0x50')]();})[_0x4f49('0x10')](function(){_0x148031[_0x4f49('0x33')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x4f49('0x1e')](function(_0x291a45){return handleError(_0x148031,0x1f4,_0x291a45);});};passport['use'](new LocalStrategy({'usernameField':_0x4f49('0x11'),'passwordField':'password'},function(_0x5a929a,_0xf90696,_0x5f3a80){return localAuthenticate(db[_0x4f49('0x4c')],_0x5a929a,_0xf90696,_0x5f3a80);}));
\ No newline at end of file
+var _0x7fbe=['reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','signToken','json','forgot','body','trim','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','Reset\x20Email\x20sent!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x406ba5,_0x39fa4b){_0x406ba5=_0x406ba5-0x0;var _0x557db7=_0x7fbe[_0x406ba5];return _0x557db7;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xe7fb('0x0'))[_0xe7fb('0x1')];var jayson=require(_0xe7fb('0x2'));var _=require(_0xe7fb('0x3'));var rs=require(_0xe7fb('0x4'));var moment=require(_0xe7fb('0x5'));var db=require(_0xe7fb('0x6'))['db'];var authService=require(_0xe7fb('0x7'));var utils=require(_0xe7fb('0x8'));var client=jayson[_0xe7fb('0x9')][_0xe7fb('0xa')]({'port':0x232b});function localAuthenticate(_0x12d1b0,_0x24cd67,_0x1f943f,_0x5ad75b){var _0x213ebc,_0x228f6b;return db[_0xe7fb('0xb')][_0xe7fb('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xe7fb('0xd')](function(_0x2f2ea0){_0x213ebc=_0x2f2ea0;return _0x12d1b0[_0xe7fb('0xc')]({'attributes':['id',_0xe7fb('0xe'),_0xe7fb('0xf'),_0xe7fb('0x10'),_0xe7fb('0x11'),_0xe7fb('0x12'),_0xe7fb('0x13'),_0xe7fb('0x14'),_0xe7fb('0x15')],'where':{'name':_0x24cd67,'role':{'$or':[_0xe7fb('0x16'),_0xe7fb('0x17'),_0xe7fb('0x18')]}}});})[_0xe7fb('0xd')](function(_0x598729){if(!_0x598729||_0x598729&&_0x598729[_0xe7fb('0xe')]!==_0x24cd67){throw new Error(_0xe7fb('0x19'));}else{_0x228f6b=_0x598729;return _0x228f6b;}})['then'](function(){_0x228f6b[_0xe7fb('0x1a')](_0x1f943f,function(_0x37eb9f,_0x482f7d){var _0xa76acf=_0x228f6b['loginAttempts']+0x1;if(_0x37eb9f){return _0x5ad75b(_0x37eb9f);}else if(!_0x482f7d){if(_0x228f6b[_0xe7fb('0x12')]){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else if(_0x213ebc[_0xe7fb('0x1b')]>0x0){if(_0x228f6b[_0xe7fb('0x13')]){if(_0x213ebc['blockDuration']>0x0){if(moment(_0x228f6b[_0xe7fb('0x14')])['add'](_0x213ebc[_0xe7fb('0x1c')],'minutes')>moment()){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else{return utils[_0xe7fb('0x1d')](_0x228f6b,_0xa76acf,![],null)[_0xe7fb('0xd')](function(){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});});}}else{return _0x5ad75b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xa76acf>=_0x213ebc[_0xe7fb('0x1b')]){return utils['clearBlockUser'](_0x228f6b,0x0,!![],moment())[_0xe7fb('0xd')](function(){return _0x5ad75b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xe7fb('0x1d')](_0x228f6b,_0xa76acf,![],null)['then'](function(){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});});}}}else{return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}}else{if(_0x228f6b['disabled']){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else if(_0x213ebc[_0xe7fb('0x1b')]>0x0){if(_0x228f6b[_0xe7fb('0x13')]){if(_0x213ebc['blockDuration']>0x0){if(moment(_0x228f6b[_0xe7fb('0x14')])[_0xe7fb('0x1e')](_0x213ebc['blockDuration'],'minutes')>moment()){return _0x5ad75b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe7fb('0x1d')](_0x228f6b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x228f6b);})[_0xe7fb('0xd')](function(){return _0x5ad75b(null,_0x228f6b);});}}else{return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}}else{return utils[_0xe7fb('0x1d')](_0x228f6b,0x0,![],null)['then'](function(){return utils[_0xe7fb('0x1f')](_0x228f6b);})[_0xe7fb('0xd')](function(){return _0x5ad75b(null,_0x228f6b);})[_0xe7fb('0x20')](function(_0x1ceed8){return _0x5ad75b(null,![],_0x1ceed8);});}}else{if(_0x228f6b[_0xe7fb('0x13')]){return _0x5ad75b(null,![],{'message':_0xe7fb('0x19')});}else{return utils[_0xe7fb('0x1f')](_0x228f6b)['then'](function(){return _0x5ad75b(null,_0x228f6b);});}}}});})['catch'](function(_0x1086e6){return _0x5ad75b(null,![],_0x1086e6);});}function sendServiceMail(_0x3bdee9){return db[_0xe7fb('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xe7fb('0xe'),_0xe7fb('0x22')],'include':[{'model':db[_0xe7fb('0x23')],'as':_0xe7fb('0x24')}]})[_0xe7fb('0xd')](function(_0x1256d4){if(!_0x1256d4){throw new Error(_0xe7fb('0x25'));}var _0x3dd0be={'tls':{'rejectUnauthorized':![]}};if(_0x1256d4['Smtp'][_0xe7fb('0x26')]){_0x3dd0be[_0xe7fb('0x26')]=_0x1256d4[_0xe7fb('0x24')]['service'];}else{_0x3dd0be['host']=_0x1256d4[_0xe7fb('0x24')]['host'];_0x3dd0be[_0xe7fb('0x27')]=_0x1256d4[_0xe7fb('0x24')][_0xe7fb('0x27')];_0x3dd0be[_0xe7fb('0x28')]=_0x1256d4['Smtp'][_0xe7fb('0x28')];}if(_0x1256d4[_0xe7fb('0x24')][_0xe7fb('0x29')]){_0x3dd0be[_0xe7fb('0x2a')]={'user':_0x1256d4[_0xe7fb('0x24')]['user'],'pass':_0x1256d4[_0xe7fb('0x24')][_0xe7fb('0x2b')]};}var _0x209eaa={'account':_0x3dd0be,'message':_[_0xe7fb('0x2c')]({'from':util[_0xe7fb('0x2d')](_0xe7fb('0x2e'),_0x1256d4[_0xe7fb('0xe')],_0x1256d4[_0xe7fb('0x22')]||_0x1256d4[_0xe7fb('0x24')]['user'])},_0x3bdee9)};return client[_0xe7fb('0x2f')](_0xe7fb('0x30'),_0x209eaa);})[_0xe7fb('0xd')](function(_0x56e17b){if(_0x56e17b[_0xe7fb('0x31')]){throw new Error(util[_0xe7fb('0x2d')](_0xe7fb('0x32'),_0x56e17b[_0xe7fb('0x31')][_0xe7fb('0x33')]||JSON[_0xe7fb('0x34')](_0x56e17b[_0xe7fb('0x31')])));}return!![];});}function handleError(_0xc4e271,_0x195c35,_0xebfe1d){return _0xc4e271[_0xe7fb('0x35')](_0x195c35||0x1f4)[_0xe7fb('0x36')]({'message':_0xebfe1d?_0xebfe1d[_0xe7fb('0x33')]||_0xebfe1d:''});}function checkPasswordPattern(_0x1c81fe,_0xeb7c29,_0x41e2d1){if(_0x41e2d1){var _0x30dd5b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30dd5b[_0xe7fb('0x37')](_0xeb7c29)){return _0x1c81fe;}else{throw new Error(_0xe7fb('0x38'));}}else{return _0x1c81fe;}}exports['login']=function(_0x261ec5,_0x23f9f9,_0x3f3207){passport[_0xe7fb('0x1a')]('local',function(_0x3426a9,_0x186418,_0xd472d){var _0x413a13=_0x3426a9||_0xd472d;if(_0x413a13){return handleError(_0x23f9f9,0x191,_0x413a13);}if(!_0x186418){return handleError(_0x23f9f9,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2f976f={'payload':{'id':_0x186418['id'],'role':_0x186418[_0xe7fb('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xe7fb('0x39')](_0x2f976f)[_0xe7fb('0xd')](function(_0x468d16){_0x23f9f9[_0xe7fb('0x3a')]({'id':_0x186418['id'],'token':_0x468d16,'statusCall':'','isAlreadyLogged':_0x186418['online']});});}})(_0x261ec5,_0x23f9f9,_0x3f3207);};exports[_0xe7fb('0x3b')]=function(_0x35139f,_0x3a96cd,_0x4b263d){if(!_0x35139f[_0xe7fb('0x3c')][_0xe7fb('0x22')]){return handleError(_0x3a96cd,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x490333=rs['generate']();_0x35139f['body']['email']=_0x35139f[_0xe7fb('0x3c')][_0xe7fb('0x22')][_0xe7fb('0x3d')]()['toLowerCase']();var _0x34cdd8;return db['Setting'][_0xe7fb('0xc')]({'where':{'id':0x1},'attributes':[_0xe7fb('0x1b'),'blockDuration'],'raw':!![]})[_0xe7fb('0xd')](function(_0x2a3422){_0x34cdd8=_0x2a3422;return db[_0xe7fb('0x3e')][_0xe7fb('0x3f')]({'where':{'email':_0x35139f['body'][_0xe7fb('0x22')]}});})[_0xe7fb('0xd')](function(_0x1b8a34){if(!_0x1b8a34){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x1b8a34[_0xe7fb('0x12')]){throw new Error(_0xe7fb('0x40'));}if(_0x1b8a34[_0xe7fb('0x13')]){if(moment(_0x1b8a34[_0xe7fb('0x14')])[_0xe7fb('0x1e')](_0x34cdd8['blockDuration'],_0xe7fb('0x41'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x1b8a34[_0xe7fb('0x13')]=![];_0x1b8a34[_0xe7fb('0x14')]=null;}}_0x1b8a34[_0xe7fb('0x42')]=_0x490333;_0x1b8a34[_0xe7fb('0x43')]=Date[_0xe7fb('0x44')]()+0x36ee80;return _0x1b8a34['save']();})[_0xe7fb('0xd')](function(){return sendServiceMail({'to':_0x35139f['body']['email'],'subject':_0xe7fb('0x45'),'text':_0xe7fb('0x46')+_0xe7fb('0x47')+'http://'+_0x35139f[_0xe7fb('0x48')][_0xe7fb('0x49')]+'/reset/'+_0x490333+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xe7fb('0xd')](function(){_0x3a96cd[_0xe7fb('0x35')](0xc8)[_0xe7fb('0x36')]({'message':_0xe7fb('0x4a')});})[_0xe7fb('0x20')](function(_0x1f0533){return handleError(_0x3a96cd,0x1f4,_0x1f0533);});};exports[_0xe7fb('0x4b')]=function(_0x347177,_0x5cd8e3,_0x925a5e){var _0x5cc28f;return db[_0xe7fb('0x3e')][_0xe7fb('0x3f')]({'where':{'resetPasswordToken':_0x347177['params'][_0xe7fb('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe7fb('0xd')](function(_0x484bd8){_0x5cc28f=_0x484bd8;if(!_0x5cc28f){throw new Error(_0xe7fb('0x4d'));}return db['Setting'][_0xe7fb('0xc')]({'attributes':['id','securePassword']});})[_0xe7fb('0xd')](function(_0x1b6442){return checkPasswordPattern(_0x1b6442,_0x347177[_0xe7fb('0x3c')][_0xe7fb('0xf')],_0x1b6442[_0xe7fb('0x4e')]);})[_0xe7fb('0xd')](function(){_0x5cc28f[_0xe7fb('0xf')]=_0x347177['body']['password'];_0x5cc28f[_0xe7fb('0x42')]=null;_0x5cc28f['resetPasswordExpires']=null;return _0x5cc28f['save']();})['then'](function(){_0x5cd8e3['status'](0xc8)['send']({'message':_0xe7fb('0x4f')});})[_0xe7fb('0x20')](function(_0xd2fd76){return handleError(_0x5cd8e3,0x1f4,_0xd2fd76);});};passport[_0xe7fb('0x50')](new LocalStrategy({'usernameField':'name','passwordField':_0xe7fb('0xf')},function(_0x236b35,_0x195e52,_0x4a9372){return localAuthenticate(db['User'],_0x236b35,_0x195e52,_0x4a9372);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 26cee9d..2c14931 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 _0xeb6c=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','express','Router'];(function(_0x23aee8,_0x5a67bd){var _0x39882d=function(_0x57d3a2){while(--_0x57d3a2){_0x23aee8['push'](_0x23aee8['shift']());}};_0x39882d(++_0x5a67bd);}(_0xeb6c,0x85));var _0xceb6=function(_0x5a924f,_0x22d1fa){_0x5a924f=_0x5a924f-0x0;var _0x265ab5=_0xeb6c[_0x5a924f];return _0x265ab5;};'use strict';var express=require(_0xceb6('0x0'));var router=express[_0xceb6('0x1')]();var controller=require(_0xceb6('0x2'));router[_0xceb6('0x3')]('/',controller[_0xceb6('0x4')]);router[_0xceb6('0x3')](_0xceb6('0x5'),controller[_0xceb6('0x6')]);router[_0xceb6('0x3')](_0xceb6('0x7'),controller[_0xceb6('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x93b5=['post','/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller'];(function(_0x565f9b,_0x3697c0){var _0x1a27f9=function(_0x1ba5de){while(--_0x1ba5de){_0x565f9b['push'](_0x565f9b['shift']());}};_0x1a27f9(++_0x3697c0);}(_0x93b5,0x145));var _0x593b=function(_0x4b5b50,_0x4b3240){_0x4b5b50=_0x4b5b50-0x0;var _0x28a9ab=_0x93b5[_0x4b5b50];return _0x28a9ab;};'use strict';var express=require(_0x593b('0x0'));var router=express[_0x593b('0x1')]();var controller=require(_0x593b('0x2'));router[_0x593b('0x3')]('/',controller['login']);router[_0x593b('0x3')](_0x593b('0x4'),controller[_0x593b('0x5')]);router[_0x593b('0x3')](_0x593b('0x6'),controller['reset']);module[_0x593b('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 f83223d..8942e79 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 _0xadf4=['exports','STRING','INTEGER','sequelize'];(function(_0x38d832,_0xf2104d){var _0x2e166e=function(_0x26e7d0){while(--_0x26e7d0){_0x38d832['push'](_0x38d832['shift']());}};_0x2e166e(++_0xf2104d);}(_0xadf4,0x6f));var _0x4adf=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xadf4[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x4adf('0x0'));module[_0x4adf('0x1')]={'name':{'type':Sequelize[_0x4adf('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x4adf('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x4adf('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xe32d=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x2e3871,_0x3128cf){var _0x169de8=function(_0x77aae3){while(--_0x77aae3){_0x2e3871['push'](_0x2e3871['shift']());}};_0x169de8(++_0x3128cf);}(_0xe32d,0x179));var _0xde32=function(_0x59ade3,_0x5cf215){_0x59ade3=_0x59ade3-0x0;var _0x18e940=_0xe32d[_0x59ade3];return _0x18e940;};'use strict';var Sequelize=require(_0xde32('0x0'));module['exports']={'name':{'type':Sequelize[_0xde32('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde32('0x1')]},'status':{'type':Sequelize[_0xde32('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xde32('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 22e5b3b..c922d35 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 _0xf815=['set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','findAll','catch','show','params','includeAll','find','create','body','Condition','addConditions','ids','order','getConditions','Action','addActions','omit','getActions','findOne','pick','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf815,0x1e4));var _0x5f81=function(_0x4346ed,_0xfe0647){_0x4346ed=_0x4346ed-0x0;var _0x3319ca=_0xf815[_0x4346ed];return _0x3319ca;};'use strict';var pdf=require(_0x5f81('0x0'));var emlformat=require(_0x5f81('0x1'));var rimraf=require(_0x5f81('0x2'));var zipdir=require(_0x5f81('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f81('0x4'));var moment=require(_0x5f81('0x5'));var BPromise=require(_0x5f81('0x6'));var Mustache=require(_0x5f81('0x7'));var util=require(_0x5f81('0x8'));var path=require(_0x5f81('0x9'));var sox=require(_0x5f81('0xa'));var csv=require(_0x5f81('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5f81('0xc'));var squel=require(_0x5f81('0xd'));var crypto=require(_0x5f81('0xe'));var jsforce=require(_0x5f81('0xf'));var deskjs=require(_0x5f81('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5f81('0x11'));var Papa=require(_0x5f81('0x12'));var Redis=require(_0x5f81('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5f81('0x14'));var as=require(_0x5f81('0x15'));var hardwareService=require(_0x5f81('0x16'));var logger=require(_0x5f81('0x17'))(_0x5f81('0x18'));var utils=require('../../config/utils');var config=require(_0x5f81('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4518eb,_0x272dc6){_0x272dc6=_0x272dc6||0xcc;return function(_0x37de4e){if(_0x37de4e){return _0x4518eb['sendStatus'](_0x272dc6);}return _0x4518eb[_0x5f81('0x1a')](_0x272dc6)[_0x5f81('0x1b')]();};}function respondWithResult(_0x1c28cb,_0x561a73){_0x561a73=_0x561a73||0xc8;return function(_0x5a3e6d){if(_0x5a3e6d){return _0x1c28cb[_0x5f81('0x1a')](_0x561a73)[_0x5f81('0x1c')](_0x5a3e6d);}};}function respondWithFilteredResult(_0x586df7,_0x3b764d){return function(_0x5e6c21){if(_0x5e6c21){var _0x3fc36e=_0x5e6c21[_0x5f81('0x1d')],_0xdd79e4=_0x3b764d[_0x5f81('0x1e')],_0x30617d=_0x3b764d['offset']+_0x3b764d[_0x5f81('0x1f')],_0x2460bd;if(_0x30617d>=_0x3fc36e){_0x30617d=_0x3fc36e;_0x2460bd=0xc8;}else{_0x2460bd=0xce;}_0x586df7['status'](_0x2460bd);return _0x586df7[_0x5f81('0x20')](_0x5f81('0x21'),_0xdd79e4+'-'+_0x30617d+'/'+_0x3fc36e)['json'](_0x5e6c21);}return null;};}function patchUpdates(_0x51199b){return function(_0x2f0459){try{jsonpatch[_0x5f81('0x22')](_0x2f0459,_0x51199b,!![]);}catch(_0x2a1613){return BPromise[_0x5f81('0x23')](_0x2a1613);}return _0x2f0459['save']();};}function saveUpdates(_0x4842af,_0x4b59b3){return function(_0x826eb7){if(_0x826eb7){return _0x826eb7[_0x5f81('0x24')](_0x4842af)[_0x5f81('0x25')](function(_0x3d96e5){return _0x3d96e5;});}return null;};}function removeEntity(_0x8f110e,_0x573644){return function(_0x19126b){if(_0x19126b){return _0x19126b[_0x5f81('0x26')]()['then'](function(){_0x8f110e[_0x5f81('0x1a')](0xcc)[_0x5f81('0x1b')]();});}};}function handleEntityNotFound(_0x2e5f67,_0x3a1da0){return function(_0x445d32){if(!_0x445d32){_0x2e5f67[_0x5f81('0x27')](0x194);}return _0x445d32;};}function handleError(_0x6eff84,_0x3f9e3e){_0x3f9e3e=_0x3f9e3e||0x1f4;return function(_0x434963){logger[_0x5f81('0x28')](_0x434963[_0x5f81('0x29')]);if(_0x434963[_0x5f81('0x2a')]){delete _0x434963[_0x5f81('0x2a')];}_0x6eff84[_0x5f81('0x1a')](_0x3f9e3e)[_0x5f81('0x2b')](_0x434963);};}exports[_0x5f81('0x2c')]=function(_0x1c6cb9,_0x3de032){var _0x4c4c20={},_0x2502f4={},_0x336a28={'count':0x0,'rows':[]};var _0x42f755=db[_0x5f81('0x2d')][_0x5f81('0x2e')];_0x2502f4[_0x5f81('0x2f')]=_['keys'](_0x42f755);_0x2502f4['query']=_[_0x5f81('0x30')](_0x1c6cb9[_0x5f81('0x31')]);_0x2502f4[_0x5f81('0x32')]=_[_0x5f81('0x33')](_0x2502f4[_0x5f81('0x2f')],_0x2502f4[_0x5f81('0x31')]);_0x4c4c20[_0x5f81('0x34')]=_[_0x5f81('0x33')](_0x2502f4[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x35')]));_0x4c4c20[_0x5f81('0x34')]=_0x4c4c20[_0x5f81('0x34')][_0x5f81('0x36')]?_0x4c4c20['attributes']:_0x2502f4['model'];if(!_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x37')](_0x5f81('0x38'))){_0x4c4c20[_0x5f81('0x1f')]=qs['limit'](_0x1c6cb9[_0x5f81('0x31')]['limit']);_0x4c4c20[_0x5f81('0x1e')]=qs[_0x5f81('0x1e')](_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x1e')]);}_0x4c4c20['order']=qs['sort'](_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x39')]);_0x4c4c20[_0x5f81('0x3a')]=qs[_0x5f81('0x32')](_['pick'](_0x1c6cb9['query'],_0x2502f4['filters']));if(_0x1c6cb9[_0x5f81('0x31')][_0x5f81('0x3b')]){_0x4c4c20[_0x5f81('0x3a')]=_[_0x5f81('0x3c')](_0x4c4c20[_0x5f81('0x3a')],{'$or':_[_0x5f81('0x3d')](_0x42f755,function(_0x19697a){if(_0x19697a[_0x5f81('0x3e')][_0x5f81('0x3f')]!==_0x5f81('0x40')){var _0x2b3394={};_0x2b3394[_0x19697a[_0x5f81('0x41')]]={'$like':'%'+_0x1c6cb9[_0x5f81('0x31')]['filter']+'%'};return _0x2b3394;}})});}_0x4c4c20=_[_0x5f81('0x3c')]({},_0x4c4c20,_0x1c6cb9[_0x5f81('0x42')]);var _0x5080a5={'where':_0x4c4c20[_0x5f81('0x3a')]};return db[_0x5f81('0x2d')]['count'](_0x5080a5)[_0x5f81('0x25')](function(_0x648409){_0x336a28['count']=_0x648409;if(_0x1c6cb9[_0x5f81('0x31')]['includeAll']){_0x4c4c20['include']=[{'all':!![]}];}return db[_0x5f81('0x2d')][_0x5f81('0x43')](_0x4c4c20);})[_0x5f81('0x25')](function(_0x51e2cd){_0x336a28['rows']=_0x51e2cd;return _0x336a28;})['then'](respondWithFilteredResult(_0x3de032,_0x4c4c20))[_0x5f81('0x44')](handleError(_0x3de032,null));};exports[_0x5f81('0x45')]=function(_0x356710,_0x3ffd2c){var _0x3fef42={'raw':![],'where':{'id':_0x356710[_0x5f81('0x46')]['id']}},_0xbc36aa={};_0xbc36aa['model']=_[_0x5f81('0x30')](db[_0x5f81('0x2d')][_0x5f81('0x2e')]);_0xbc36aa[_0x5f81('0x31')]=_[_0x5f81('0x30')](_0x356710['query']);_0xbc36aa['filters']=_[_0x5f81('0x33')](_0xbc36aa[_0x5f81('0x2f')],_0xbc36aa[_0x5f81('0x31')]);_0x3fef42['attributes']=_[_0x5f81('0x33')](_0xbc36aa[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x356710[_0x5f81('0x31')]['fields']));_0x3fef42['attributes']=_0x3fef42['attributes'][_0x5f81('0x36')]?_0x3fef42[_0x5f81('0x34')]:_0xbc36aa[_0x5f81('0x2f')];if(_0x356710[_0x5f81('0x31')][_0x5f81('0x47')]){_0x3fef42['include']=[{'all':!![]}];}_0x3fef42=_[_0x5f81('0x3c')]({},_0x3fef42,_0x356710['options']);return db[_0x5f81('0x2d')][_0x5f81('0x48')](_0x3fef42)[_0x5f81('0x25')](handleEntityNotFound(_0x3ffd2c,null))[_0x5f81('0x25')](respondWithResult(_0x3ffd2c,null))[_0x5f81('0x44')](handleError(_0x3ffd2c,null));};exports[_0x5f81('0x49')]=function(_0x115aaa,_0x2fbd82){return db[_0x5f81('0x2d')][_0x5f81('0x49')](_0x115aaa[_0x5f81('0x4a')],{})[_0x5f81('0x25')](respondWithResult(_0x2fbd82,0xc9))[_0x5f81('0x44')](handleError(_0x2fbd82,null));};exports[_0x5f81('0x24')]=function(_0x37900d,_0x4f7eea){if(_0x37900d[_0x5f81('0x4a')]['id']){delete _0x37900d['body']['id'];}return db[_0x5f81('0x2d')][_0x5f81('0x48')]({'where':{'id':_0x37900d[_0x5f81('0x46')]['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x4f7eea,null))[_0x5f81('0x25')](saveUpdates(_0x37900d[_0x5f81('0x4a')],null))[_0x5f81('0x25')](respondWithResult(_0x4f7eea,null))['catch'](handleError(_0x4f7eea,null));};exports[_0x5f81('0x26')]=function(_0x1d520b,_0x2736dc){return db[_0x5f81('0x2d')][_0x5f81('0x48')]({'where':{'id':_0x1d520b[_0x5f81('0x46')]['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x2736dc,null))[_0x5f81('0x25')](removeEntity(_0x2736dc,null))['catch'](handleError(_0x2736dc,null));};exports['addConditions']=function(_0x5e0b30,_0x1e990b,_0x1681b8){return db[_0x5f81('0x4b')][_0x5f81('0x48')]({'where':{'id':_0x5e0b30['params']['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x1e990b,null))[_0x5f81('0x25')](function(_0x13c917){if(_0x13c917){return _0x13c917[_0x5f81('0x4c')](_0x5e0b30[_0x5f81('0x4a')]['ids'],_['omit'](_0x5e0b30[_0x5f81('0x4a')],[_0x5f81('0x4d'),'id'])||{});}})[_0x5f81('0x25')](respondWithResult(_0x1e990b,null))[_0x5f81('0x44')](handleError(_0x1e990b,null));};exports['getConditions']=function(_0x4aab6d,_0x58031f,_0x9d6c9d){var _0x2c4105={};var _0x54bcc1={};var _0x56546a;var _0x18f0ea;return db['Automation']['findOne']({'where':{'id':_0x4aab6d[_0x5f81('0x46')]['id']}})['then'](handleEntityNotFound(_0x58031f,null))[_0x5f81('0x25')](function(_0x5b9e1a){if(_0x5b9e1a){_0x56546a=_0x5b9e1a;_0x54bcc1[_0x5f81('0x2f')]=_['keys'](db[_0x5f81('0x4b')][_0x5f81('0x2e')]);_0x54bcc1['query']=_[_0x5f81('0x30')](_0x4aab6d[_0x5f81('0x31')]);_0x54bcc1[_0x5f81('0x32')]=_['intersection'](_0x54bcc1['model'],_0x54bcc1[_0x5f81('0x31')]);_0x2c4105[_0x5f81('0x34')]=_[_0x5f81('0x33')](_0x54bcc1[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x4aab6d[_0x5f81('0x31')]['fields']));_0x2c4105['attributes']=_0x2c4105[_0x5f81('0x34')][_0x5f81('0x36')]?_0x2c4105['attributes']:_0x54bcc1[_0x5f81('0x2f')];_0x2c4105[_0x5f81('0x4e')]=qs[_0x5f81('0x39')](_0x4aab6d[_0x5f81('0x31')][_0x5f81('0x39')]);_0x2c4105[_0x5f81('0x3a')]=qs[_0x5f81('0x32')](_['pick'](_0x4aab6d[_0x5f81('0x31')],_0x54bcc1[_0x5f81('0x32')]));if(_0x4aab6d['query'][_0x5f81('0x3b')]){_0x2c4105['where']=_[_0x5f81('0x3c')](_0x2c4105[_0x5f81('0x3a')],{'$or':_[_0x5f81('0x3d')](_0x2c4105['attributes'],function(_0x43a02a){var _0x2e6de9={};_0x2e6de9[_0x43a02a]={'$like':'%'+_0x4aab6d['query'][_0x5f81('0x3b')]+'%'};return _0x2e6de9;})});}_0x2c4105=_[_0x5f81('0x3c')]({},_0x2c4105,_0x4aab6d[_0x5f81('0x42')]);return _0x56546a[_0x5f81('0x4f')](_0x2c4105);}})['then'](function(_0x931e6a){if(_0x931e6a){_0x18f0ea=_0x931e6a[_0x5f81('0x36')];if(!_0x4aab6d[_0x5f81('0x31')][_0x5f81('0x37')](_0x5f81('0x38'))){_0x2c4105[_0x5f81('0x1f')]=qs['limit'](_0x4aab6d['query']['limit']);_0x2c4105[_0x5f81('0x1e')]=qs[_0x5f81('0x1e')](_0x4aab6d[_0x5f81('0x31')][_0x5f81('0x1e')]);}return _0x56546a[_0x5f81('0x4f')](_0x2c4105);}})['then'](function(_0x3415fb){if(_0x3415fb){return _0x3415fb?{'count':_0x18f0ea,'rows':_0x3415fb}:null;}})[_0x5f81('0x25')](respondWithResult(_0x58031f,null))[_0x5f81('0x44')](handleError(_0x58031f,null));};exports['addActions']=function(_0x1d1285,_0x508b4e,_0x10f481){return db[_0x5f81('0x50')]['find']({'where':{'id':_0x1d1285['params']['id']}})['then'](handleEntityNotFound(_0x508b4e,null))[_0x5f81('0x25')](function(_0x170527){if(_0x170527){return _0x170527[_0x5f81('0x51')](_0x1d1285[_0x5f81('0x4a')][_0x5f81('0x4d')],_[_0x5f81('0x52')](_0x1d1285['body'],[_0x5f81('0x4d'),'id'])||{});}})[_0x5f81('0x25')](respondWithResult(_0x508b4e,null))[_0x5f81('0x44')](handleError(_0x508b4e,null));};exports[_0x5f81('0x53')]=function(_0x41c885,_0x30cd93,_0x214ffa){var _0x4048f1={};var _0x311371={};var _0xa40921;var _0x1fa173;return db['Automation'][_0x5f81('0x54')]({'where':{'id':_0x41c885[_0x5f81('0x46')]['id']}})[_0x5f81('0x25')](handleEntityNotFound(_0x30cd93,null))[_0x5f81('0x25')](function(_0x1a79eb){if(_0x1a79eb){_0xa40921=_0x1a79eb;_0x311371[_0x5f81('0x2f')]=_['keys'](db['Action']['rawAttributes']);_0x311371['query']=_['keys'](_0x41c885[_0x5f81('0x31')]);_0x311371[_0x5f81('0x32')]=_[_0x5f81('0x33')](_0x311371[_0x5f81('0x2f')],_0x311371[_0x5f81('0x31')]);_0x4048f1[_0x5f81('0x34')]=_[_0x5f81('0x33')](_0x311371[_0x5f81('0x2f')],qs[_0x5f81('0x35')](_0x41c885['query'][_0x5f81('0x35')]));_0x4048f1[_0x5f81('0x34')]=_0x4048f1[_0x5f81('0x34')]['length']?_0x4048f1[_0x5f81('0x34')]:_0x311371['model'];_0x4048f1[_0x5f81('0x4e')]=qs[_0x5f81('0x39')](_0x41c885[_0x5f81('0x31')][_0x5f81('0x39')]);_0x4048f1[_0x5f81('0x3a')]=qs[_0x5f81('0x32')](_[_0x5f81('0x55')](_0x41c885[_0x5f81('0x31')],_0x311371['filters']));if(_0x41c885['query'][_0x5f81('0x3b')]){_0x4048f1[_0x5f81('0x3a')]=_[_0x5f81('0x3c')](_0x4048f1[_0x5f81('0x3a')],{'$or':_[_0x5f81('0x3d')](_0x4048f1[_0x5f81('0x34')],function(_0x1b464d){var _0x18c243={};_0x18c243[_0x1b464d]={'$like':'%'+_0x41c885['query'][_0x5f81('0x3b')]+'%'};return _0x18c243;})});}_0x4048f1=_['merge']({},_0x4048f1,_0x41c885[_0x5f81('0x42')]);return _0xa40921[_0x5f81('0x53')](_0x4048f1);}})[_0x5f81('0x25')](function(_0x3963e4){if(_0x3963e4){_0x1fa173=_0x3963e4[_0x5f81('0x36')];if(!_0x41c885[_0x5f81('0x31')][_0x5f81('0x37')]('nolimit')){_0x4048f1['limit']=qs[_0x5f81('0x1f')](_0x41c885[_0x5f81('0x31')][_0x5f81('0x1f')]);_0x4048f1[_0x5f81('0x1e')]=qs[_0x5f81('0x1e')](_0x41c885[_0x5f81('0x31')][_0x5f81('0x1e')]);}return _0xa40921[_0x5f81('0x53')](_0x4048f1);}})[_0x5f81('0x25')](function(_0x5a4941){if(_0x5a4941){return _0x5a4941?{'count':_0x1fa173,'rows':_0x5a4941}:null;}})[_0x5f81('0x25')](respondWithResult(_0x30cd93,null))[_0x5f81('0x44')](handleError(_0x30cd93,null));};
\ No newline at end of file
+var _0x165b=['map','getConditions','nolimit','addActions','Action','findOne','getActions','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','field','options','includeAll','include','findAll','rows','catch','find','create','body','params','addConditions','ids','omit'];(function(_0x4b653a,_0x1e0b9c){var _0x5d8021=function(_0x373816){while(--_0x373816){_0x4b653a['push'](_0x4b653a['shift']());}};_0x5d8021(++_0x1e0b9c);}(_0x165b,0x1ed));var _0xb165=function(_0x77779b,_0x21eefe){_0x77779b=_0x77779b-0x0;var _0x16403a=_0x165b[_0x77779b];return _0x16403a;};'use strict';var pdf=require(_0xb165('0x0'));var emlformat=require(_0xb165('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb165('0x2'));var rp=require(_0xb165('0x3'));var moment=require(_0xb165('0x4'));var BPromise=require(_0xb165('0x5'));var Mustache=require(_0xb165('0x6'));var util=require(_0xb165('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb165('0x8'));var ejs=require(_0xb165('0x9'));var fs=require('fs');var _=require(_0xb165('0xa'));var squel=require(_0xb165('0xb'));var crypto=require('crypto');var jsforce=require(_0xb165('0xc'));var deskjs=require(_0xb165('0xd'));var toCsv=require(_0xb165('0x8'));var querystring=require(_0xb165('0xe'));var Papa=require(_0xb165('0xf'));var Redis=require(_0xb165('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb165('0x11'));var as=require(_0xb165('0x12'));var hardwareService=require(_0xb165('0x13'));var logger=require(_0xb165('0x14'))(_0xb165('0x15'));var utils=require(_0xb165('0x16'));var config=require('../../config/environment');var db=require(_0xb165('0x17'))['db'];function respondWithStatusCode(_0x10400f,_0x2ed7b6){_0x2ed7b6=_0x2ed7b6||0xcc;return function(_0x39deb8){if(_0x39deb8){return _0x10400f[_0xb165('0x18')](_0x2ed7b6);}return _0x10400f[_0xb165('0x19')](_0x2ed7b6)[_0xb165('0x1a')]();};}function respondWithResult(_0x457295,_0x3ca058){_0x3ca058=_0x3ca058||0xc8;return function(_0x37bef5){if(_0x37bef5){return _0x457295[_0xb165('0x19')](_0x3ca058)[_0xb165('0x1b')](_0x37bef5);}};}function respondWithFilteredResult(_0x24bfb4,_0x5c36a1){return function(_0x3db84c){if(_0x3db84c){var _0x1c6466=_0x3db84c[_0xb165('0x1c')],_0x1b5170=_0x5c36a1[_0xb165('0x1d')],_0x10f7a8=_0x5c36a1[_0xb165('0x1d')]+_0x5c36a1[_0xb165('0x1e')],_0x334595;if(_0x10f7a8>=_0x1c6466){_0x10f7a8=_0x1c6466;_0x334595=0xc8;}else{_0x334595=0xce;}_0x24bfb4[_0xb165('0x19')](_0x334595);return _0x24bfb4[_0xb165('0x1f')]('Content-Range',_0x1b5170+'-'+_0x10f7a8+'/'+_0x1c6466)[_0xb165('0x1b')](_0x3db84c);}return null;};}function patchUpdates(_0x31bfa6){return function(_0xf1062d){try{jsonpatch[_0xb165('0x20')](_0xf1062d,_0x31bfa6,!![]);}catch(_0x61c2db){return BPromise[_0xb165('0x21')](_0x61c2db);}return _0xf1062d[_0xb165('0x22')]();};}function saveUpdates(_0x2bba30,_0x388165){return function(_0x443006){if(_0x443006){return _0x443006[_0xb165('0x23')](_0x2bba30)[_0xb165('0x24')](function(_0x3f4e00){return _0x3f4e00;});}return null;};}function removeEntity(_0xf7ef25,_0x45c0a0){return function(_0x47c69f){if(_0x47c69f){return _0x47c69f[_0xb165('0x25')]()['then'](function(){_0xf7ef25[_0xb165('0x19')](0xcc)[_0xb165('0x1a')]();});}};}function handleEntityNotFound(_0x14f156,_0x597af1){return function(_0x8e7bd){if(!_0x8e7bd){_0x14f156[_0xb165('0x18')](0x194);}return _0x8e7bd;};}function handleError(_0x35d1a0,_0x47c8a6){_0x47c8a6=_0x47c8a6||0x1f4;return function(_0xb3cf3c){logger['error'](_0xb3cf3c[_0xb165('0x26')]);if(_0xb3cf3c[_0xb165('0x27')]){delete _0xb3cf3c[_0xb165('0x27')];}_0x35d1a0[_0xb165('0x19')](_0x47c8a6)[_0xb165('0x28')](_0xb3cf3c);};}exports['index']=function(_0x533149,_0x5c573e){var _0x4b38a2={},_0x2505d2={},_0x4cecc3={'count':0x0,'rows':[]};var _0x2fd5fe=db[_0xb165('0x29')][_0xb165('0x2a')];_0x2505d2[_0xb165('0x2b')]=_[_0xb165('0x2c')](_0x2fd5fe);_0x2505d2[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x533149['query']);_0x2505d2[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x2505d2[_0xb165('0x2b')],_0x2505d2[_0xb165('0x2d')]);_0x4b38a2[_0xb165('0x30')]=_['intersection'](_0x2505d2[_0xb165('0x2b')],qs[_0xb165('0x31')](_0x533149[_0xb165('0x2d')]['fields']));_0x4b38a2[_0xb165('0x30')]=_0x4b38a2[_0xb165('0x30')][_0xb165('0x32')]?_0x4b38a2['attributes']:_0x2505d2[_0xb165('0x2b')];if(!_0x533149['query'][_0xb165('0x33')]('nolimit')){_0x4b38a2[_0xb165('0x1e')]=qs[_0xb165('0x1e')](_0x533149[_0xb165('0x2d')][_0xb165('0x1e')]);_0x4b38a2[_0xb165('0x1d')]=qs[_0xb165('0x1d')](_0x533149[_0xb165('0x2d')][_0xb165('0x1d')]);}_0x4b38a2[_0xb165('0x34')]=qs['sort'](_0x533149[_0xb165('0x2d')][_0xb165('0x35')]);_0x4b38a2[_0xb165('0x36')]=qs[_0xb165('0x2e')](_[_0xb165('0x37')](_0x533149[_0xb165('0x2d')],_0x2505d2[_0xb165('0x2e')]));if(_0x533149[_0xb165('0x2d')][_0xb165('0x38')]){_0x4b38a2[_0xb165('0x36')]=_[_0xb165('0x39')](_0x4b38a2[_0xb165('0x36')],{'$or':_['map'](_0x2fd5fe,function(_0xf2aaf4){if(_0xf2aaf4[_0xb165('0x3a')][_0xb165('0x3b')]!=='VIRTUAL'){var _0x2331e9={};_0x2331e9[_0xf2aaf4[_0xb165('0x3c')]]={'$like':'%'+_0x533149[_0xb165('0x2d')][_0xb165('0x38')]+'%'};return _0x2331e9;}})});}_0x4b38a2=_[_0xb165('0x39')]({},_0x4b38a2,_0x533149[_0xb165('0x3d')]);var _0x290591={'where':_0x4b38a2['where']};return db['Automation'][_0xb165('0x1c')](_0x290591)[_0xb165('0x24')](function(_0x3c1149){_0x4cecc3['count']=_0x3c1149;if(_0x533149[_0xb165('0x2d')][_0xb165('0x3e')]){_0x4b38a2[_0xb165('0x3f')]=[{'all':!![]}];}return db[_0xb165('0x29')][_0xb165('0x40')](_0x4b38a2);})[_0xb165('0x24')](function(_0x64c79b){_0x4cecc3[_0xb165('0x41')]=_0x64c79b;return _0x4cecc3;})[_0xb165('0x24')](respondWithFilteredResult(_0x5c573e,_0x4b38a2))[_0xb165('0x42')](handleError(_0x5c573e,null));};exports['show']=function(_0x4f40b0,_0x3ad01a){var _0x48ce27={'raw':![],'where':{'id':_0x4f40b0['params']['id']}},_0x4b9410={};_0x4b9410[_0xb165('0x2b')]=_[_0xb165('0x2c')](db[_0xb165('0x29')][_0xb165('0x2a')]);_0x4b9410[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x4f40b0['query']);_0x4b9410[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x4b9410['model'],_0x4b9410['query']);_0x48ce27[_0xb165('0x30')]=_[_0xb165('0x2f')](_0x4b9410[_0xb165('0x2b')],qs[_0xb165('0x31')](_0x4f40b0[_0xb165('0x2d')]['fields']));_0x48ce27[_0xb165('0x30')]=_0x48ce27['attributes']['length']?_0x48ce27['attributes']:_0x4b9410[_0xb165('0x2b')];if(_0x4f40b0[_0xb165('0x2d')][_0xb165('0x3e')]){_0x48ce27[_0xb165('0x3f')]=[{'all':!![]}];}_0x48ce27=_[_0xb165('0x39')]({},_0x48ce27,_0x4f40b0[_0xb165('0x3d')]);return db[_0xb165('0x29')][_0xb165('0x43')](_0x48ce27)[_0xb165('0x24')](handleEntityNotFound(_0x3ad01a,null))[_0xb165('0x24')](respondWithResult(_0x3ad01a,null))['catch'](handleError(_0x3ad01a,null));};exports[_0xb165('0x44')]=function(_0x5fdbff,_0x1322bc){return db[_0xb165('0x29')][_0xb165('0x44')](_0x5fdbff[_0xb165('0x45')],{})[_0xb165('0x24')](respondWithResult(_0x1322bc,0xc9))[_0xb165('0x42')](handleError(_0x1322bc,null));};exports[_0xb165('0x23')]=function(_0x169e31,_0x1a918e){if(_0x169e31[_0xb165('0x45')]['id']){delete _0x169e31['body']['id'];}return db[_0xb165('0x29')][_0xb165('0x43')]({'where':{'id':_0x169e31[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x1a918e,null))[_0xb165('0x24')](saveUpdates(_0x169e31[_0xb165('0x45')],null))[_0xb165('0x24')](respondWithResult(_0x1a918e,null))[_0xb165('0x42')](handleError(_0x1a918e,null));};exports[_0xb165('0x25')]=function(_0x36bb28,_0x3cd0f0){return db[_0xb165('0x29')][_0xb165('0x43')]({'where':{'id':_0x36bb28[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x3cd0f0,null))[_0xb165('0x24')](removeEntity(_0x3cd0f0,null))[_0xb165('0x42')](handleError(_0x3cd0f0,null));};exports[_0xb165('0x47')]=function(_0xcac622,_0x4b8f2a,_0x17f835){return db['Condition'][_0xb165('0x43')]({'where':{'id':_0xcac622[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x4b8f2a,null))[_0xb165('0x24')](function(_0x55340a){if(_0x55340a){return _0x55340a[_0xb165('0x47')](_0xcac622[_0xb165('0x45')][_0xb165('0x48')],_[_0xb165('0x49')](_0xcac622[_0xb165('0x45')],[_0xb165('0x48'),'id'])||{});}})['then'](respondWithResult(_0x4b8f2a,null))[_0xb165('0x42')](handleError(_0x4b8f2a,null));};exports['getConditions']=function(_0x342c1f,_0x5e63f5,_0x4cabde){var _0x401c6e={};var _0x6a0e4b={};var _0x161df9;var _0x6ee94d;return db[_0xb165('0x29')]['findOne']({'where':{'id':_0x342c1f[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x5e63f5,null))['then'](function(_0x34c60c){if(_0x34c60c){_0x161df9=_0x34c60c;_0x6a0e4b[_0xb165('0x2b')]=_[_0xb165('0x2c')](db['Condition'][_0xb165('0x2a')]);_0x6a0e4b[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x342c1f[_0xb165('0x2d')]);_0x6a0e4b[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x6a0e4b[_0xb165('0x2b')],_0x6a0e4b['query']);_0x401c6e[_0xb165('0x30')]=_['intersection'](_0x6a0e4b[_0xb165('0x2b')],qs[_0xb165('0x31')](_0x342c1f['query'][_0xb165('0x31')]));_0x401c6e[_0xb165('0x30')]=_0x401c6e[_0xb165('0x30')][_0xb165('0x32')]?_0x401c6e['attributes']:_0x6a0e4b['model'];_0x401c6e['order']=qs[_0xb165('0x35')](_0x342c1f['query']['sort']);_0x401c6e[_0xb165('0x36')]=qs['filters'](_[_0xb165('0x37')](_0x342c1f[_0xb165('0x2d')],_0x6a0e4b[_0xb165('0x2e')]));if(_0x342c1f[_0xb165('0x2d')][_0xb165('0x38')]){_0x401c6e[_0xb165('0x36')]=_[_0xb165('0x39')](_0x401c6e[_0xb165('0x36')],{'$or':_[_0xb165('0x4a')](_0x401c6e[_0xb165('0x30')],function(_0x2cd6d2){var _0x2df585={};_0x2df585[_0x2cd6d2]={'$like':'%'+_0x342c1f[_0xb165('0x2d')][_0xb165('0x38')]+'%'};return _0x2df585;})});}_0x401c6e=_[_0xb165('0x39')]({},_0x401c6e,_0x342c1f[_0xb165('0x3d')]);return _0x161df9[_0xb165('0x4b')](_0x401c6e);}})['then'](function(_0x58461d){if(_0x58461d){_0x6ee94d=_0x58461d[_0xb165('0x32')];if(!_0x342c1f[_0xb165('0x2d')][_0xb165('0x33')](_0xb165('0x4c'))){_0x401c6e[_0xb165('0x1e')]=qs['limit'](_0x342c1f[_0xb165('0x2d')][_0xb165('0x1e')]);_0x401c6e[_0xb165('0x1d')]=qs['offset'](_0x342c1f[_0xb165('0x2d')][_0xb165('0x1d')]);}return _0x161df9[_0xb165('0x4b')](_0x401c6e);}})[_0xb165('0x24')](function(_0x531c19){if(_0x531c19){return _0x531c19?{'count':_0x6ee94d,'rows':_0x531c19}:null;}})[_0xb165('0x24')](respondWithResult(_0x5e63f5,null))[_0xb165('0x42')](handleError(_0x5e63f5,null));};exports[_0xb165('0x4d')]=function(_0x56a882,_0x3695e1,_0x395368){return db[_0xb165('0x4e')][_0xb165('0x43')]({'where':{'id':_0x56a882[_0xb165('0x46')]['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x3695e1,null))[_0xb165('0x24')](function(_0x1ab29c){if(_0x1ab29c){return _0x1ab29c[_0xb165('0x4d')](_0x56a882['body'][_0xb165('0x48')],_[_0xb165('0x49')](_0x56a882[_0xb165('0x45')],[_0xb165('0x48'),'id'])||{});}})[_0xb165('0x24')](respondWithResult(_0x3695e1,null))[_0xb165('0x42')](handleError(_0x3695e1,null));};exports['getActions']=function(_0x48c03f,_0x38c9a8,_0x37b52b){var _0x1f2612={};var _0x461975={};var _0x1f029c;var _0x2a0667;return db[_0xb165('0x29')][_0xb165('0x4f')]({'where':{'id':_0x48c03f['params']['id']}})[_0xb165('0x24')](handleEntityNotFound(_0x38c9a8,null))[_0xb165('0x24')](function(_0x326118){if(_0x326118){_0x1f029c=_0x326118;_0x461975[_0xb165('0x2b')]=_[_0xb165('0x2c')](db['Action'][_0xb165('0x2a')]);_0x461975[_0xb165('0x2d')]=_[_0xb165('0x2c')](_0x48c03f[_0xb165('0x2d')]);_0x461975[_0xb165('0x2e')]=_[_0xb165('0x2f')](_0x461975[_0xb165('0x2b')],_0x461975[_0xb165('0x2d')]);_0x1f2612[_0xb165('0x30')]=_[_0xb165('0x2f')](_0x461975[_0xb165('0x2b')],qs['fields'](_0x48c03f[_0xb165('0x2d')]['fields']));_0x1f2612[_0xb165('0x30')]=_0x1f2612[_0xb165('0x30')][_0xb165('0x32')]?_0x1f2612[_0xb165('0x30')]:_0x461975[_0xb165('0x2b')];_0x1f2612[_0xb165('0x34')]=qs[_0xb165('0x35')](_0x48c03f[_0xb165('0x2d')]['sort']);_0x1f2612['where']=qs[_0xb165('0x2e')](_[_0xb165('0x37')](_0x48c03f[_0xb165('0x2d')],_0x461975[_0xb165('0x2e')]));if(_0x48c03f[_0xb165('0x2d')][_0xb165('0x38')]){_0x1f2612[_0xb165('0x36')]=_['merge'](_0x1f2612[_0xb165('0x36')],{'$or':_[_0xb165('0x4a')](_0x1f2612['attributes'],function(_0x4cf5ec){var _0x555953={};_0x555953[_0x4cf5ec]={'$like':'%'+_0x48c03f[_0xb165('0x2d')][_0xb165('0x38')]+'%'};return _0x555953;})});}_0x1f2612=_[_0xb165('0x39')]({},_0x1f2612,_0x48c03f[_0xb165('0x3d')]);return _0x1f029c[_0xb165('0x50')](_0x1f2612);}})[_0xb165('0x24')](function(_0x3bf8b7){if(_0x3bf8b7){_0x2a0667=_0x3bf8b7[_0xb165('0x32')];if(!_0x48c03f['query']['hasOwnProperty'](_0xb165('0x4c'))){_0x1f2612[_0xb165('0x1e')]=qs['limit'](_0x48c03f['query'][_0xb165('0x1e')]);_0x1f2612[_0xb165('0x1d')]=qs[_0xb165('0x1d')](_0x48c03f[_0xb165('0x2d')][_0xb165('0x1d')]);}return _0x1f029c[_0xb165('0x50')](_0x1f2612);}})[_0xb165('0x24')](function(_0x137c90){if(_0x137c90){return _0x137c90?{'count':_0x2a0667,'rows':_0x137c90}:null;}})['then'](respondWithResult(_0x38c9a8,null))[_0xb165('0x42')](handleError(_0x38c9a8,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index febbd78..2d387e5 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 _0x0b83=['request-promise','path','rimraf','../../config/environment','define','tools_automations','lodash','util','api','moment','bluebird'];(function(_0x3a9802,_0x4bb06e){var _0x38e32a=function(_0x528565){while(--_0x528565){_0x3a9802['push'](_0x3a9802['shift']());}};_0x38e32a(++_0x4bb06e);}(_0x0b83,0x7f));var _0x30b8=function(_0x34b63c,_0x1ae608){_0x34b63c=_0x34b63c-0x0;var _0x128978=_0x0b83[_0x34b63c];return _0x128978;};'use strict';var _=require(_0x30b8('0x0'));var util=require(_0x30b8('0x1'));var logger=require('../../config/logger')(_0x30b8('0x2'));var moment=require(_0x30b8('0x3'));var BPromise=require(_0x30b8('0x4'));var rp=require(_0x30b8('0x5'));var fs=require('fs');var path=require(_0x30b8('0x6'));var rimraf=require(_0x30b8('0x7'));var config=require(_0x30b8('0x8'));var attributes=require('./automation.attributes');module['exports']=function(_0x25698d,_0x205d4b){return _0x25698d[_0x30b8('0x9')]('Automation',attributes,{'tableName':_0x30b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6df5=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','Automation','lodash'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6df5,0x1e9));var _0x56df=function(_0x5e1eae,_0x2d2a56){_0x5e1eae=_0x5e1eae-0x0;var _0x3217c5=_0x6df5[_0x5e1eae];return _0x3217c5;};'use strict';var _=require(_0x56df('0x0'));var util=require(_0x56df('0x1'));var logger=require(_0x56df('0x2'))(_0x56df('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x56df('0x4'));var fs=require('fs');var path=require(_0x56df('0x5'));var rimraf=require(_0x56df('0x6'));var config=require(_0x56df('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x5e5538,_0x5f2903){return _0x5e5538[_0x56df('0x8')](_0x56df('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 1e32cca..ea2214b 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 _0x8bfc=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xcae13a,_0x48a74b){var _0x4a2662=function(_0x2d5bb2){while(--_0x2d5bb2){_0xcae13a['push'](_0xcae13a['shift']());}};_0x4a2662(++_0x48a74b);}(_0x8bfc,0xdf));var _0xc8bf=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x8bfc[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xc8bf('0x0'));var util=require(_0xc8bf('0x1'));var moment=require(_0xc8bf('0x2'));var BPromise=require(_0xc8bf('0x3'));var rs=require(_0xc8bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc8bf('0x5'));var logger=require(_0xc8bf('0x6'))('rpc');var config=require(_0xc8bf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc8bf('0x8')][_0xc8bf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32e038,_0x1e5081,_0x47ddb2){return new BPromise(function(_0x3451ed,_0x197241){return client[_0xc8bf('0xa')](_0x32e038,_0x47ddb2)[_0xc8bf('0xb')](function(_0x13bdb0){logger['info'](_0xc8bf('0xc'),_0x1e5081,_0xc8bf('0xd'));logger[_0xc8bf('0xe')](_0xc8bf('0xf'),_0x1e5081,_0xc8bf('0xd'),JSON[_0xc8bf('0x10')](_0x13bdb0));if(_0x13bdb0[_0xc8bf('0x11')]){if(_0x13bdb0['error'][_0xc8bf('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x1e5081,_0x13bdb0[_0xc8bf('0x11')][_0xc8bf('0x13')]);return _0x197241(_0x13bdb0[_0xc8bf('0x11')][_0xc8bf('0x13')]);}logger[_0xc8bf('0x11')](_0xc8bf('0xc'),_0x1e5081,_0x13bdb0[_0xc8bf('0x11')][_0xc8bf('0x13')]);return _0x3451ed(_0x13bdb0['error']['message']);}else{logger['info'](_0xc8bf('0xc'),_0x1e5081,_0xc8bf('0xd'));_0x3451ed(_0x13bdb0[_0xc8bf('0x14')][_0xc8bf('0x13')]);}})[_0xc8bf('0x15')](function(_0x17820){logger[_0xc8bf('0x11')](_0xc8bf('0xc'),_0x1e5081,_0x17820);_0x197241(_0x17820);});});}
\ No newline at end of file
+var _0x7167=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','then'];(function(_0xf7bc,_0x3e2655){var _0x4c0f9d=function(_0x3ce601){while(--_0x3ce601){_0xf7bc['push'](_0xf7bc['shift']());}};_0x4c0f9d(++_0x3e2655);}(_0x7167,0xaa));var _0x7716=function(_0x923ab6,_0x200ec5){_0x923ab6=_0x923ab6-0x0;var _0x484752=_0x7167[_0x923ab6];return _0x484752;};'use strict';var _=require(_0x7716('0x0'));var util=require(_0x7716('0x1'));var moment=require(_0x7716('0x2'));var BPromise=require('bluebird');var rs=require(_0x7716('0x3'));var fs=require('fs');var Redis=require(_0x7716('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7716('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7716('0x6'));var client=jayson[_0x7716('0x7')][_0x7716('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2803cb,_0x42c5ef,_0x39add0){return new BPromise(function(_0x3d6afa,_0x51d0bf){return client['request'](_0x2803cb,_0x39add0)[_0x7716('0x9')](function(_0x18e0c9){logger[_0x7716('0xa')](_0x7716('0xb'),_0x42c5ef,_0x7716('0xc'));logger[_0x7716('0xd')](_0x7716('0xe'),_0x42c5ef,_0x7716('0xc'),JSON[_0x7716('0xf')](_0x18e0c9));if(_0x18e0c9['error']){if(_0x18e0c9[_0x7716('0x10')][_0x7716('0x11')]===0x1f4){logger[_0x7716('0x10')](_0x7716('0xb'),_0x42c5ef,_0x18e0c9[_0x7716('0x10')]['message']);return _0x51d0bf(_0x18e0c9[_0x7716('0x10')]['message']);}logger[_0x7716('0x10')]('Automation,\x20%s,\x20%s',_0x42c5ef,_0x18e0c9['error'][_0x7716('0x12')]);return _0x3d6afa(_0x18e0c9['error'][_0x7716('0x12')]);}else{logger[_0x7716('0xa')]('Automation,\x20%s,\x20%s',_0x42c5ef,'request\x20sent');_0x3d6afa(_0x18e0c9['result'][_0x7716('0x12')]);}})[_0x7716('0x13')](function(_0x3173a4){logger[_0x7716('0x10')]('Automation,\x20%s,\x20%s',_0x42c5ef,_0x3173a4);_0x51d0bf(_0x3173a4);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 27d33e0..214d0a6 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 _0x7cdc=['addActions','put','update','destroy','util','path','express','Router','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/actions','getActions','create','post','/:id/conditions','addConditions'];(function(_0x393a76,_0x10e845){var _0x2da669=function(_0x11e431){while(--_0x11e431){_0x393a76['push'](_0x393a76['shift']());}};_0x2da669(++_0x10e845);}(_0x7cdc,0x190));var _0xc7cd=function(_0x2758f6,_0x1dbb85){_0x2758f6=_0x2758f6-0x0;var _0x437ccf=_0x7cdc[_0x2758f6];return _0x437ccf;};'use strict';var multer=require('multer');var util=require(_0xc7cd('0x0'));var path=require(_0xc7cd('0x1'));var timeout=require('connect-timeout');var express=require(_0xc7cd('0x2'));var router=express[_0xc7cd('0x3')]();var auth=require(_0xc7cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc7cd('0x5'));var controller=require(_0xc7cd('0x6'));router['get']('/',auth[_0xc7cd('0x7')](),controller[_0xc7cd('0x8')]);router[_0xc7cd('0x9')](_0xc7cd('0xa'),auth[_0xc7cd('0x7')](),controller[_0xc7cd('0xb')]);router[_0xc7cd('0x9')]('/:id/conditions',auth[_0xc7cd('0x7')](),controller['getConditions']);router[_0xc7cd('0x9')](_0xc7cd('0xc'),auth[_0xc7cd('0x7')](),controller[_0xc7cd('0xd')]);router['post']('/',auth[_0xc7cd('0x7')](),controller[_0xc7cd('0xe')]);router[_0xc7cd('0xf')](_0xc7cd('0x10'),auth['isAuthenticated'](),controller[_0xc7cd('0x11')]);router['post'](_0xc7cd('0xc'),auth[_0xc7cd('0x7')](),controller[_0xc7cd('0x12')]);router[_0xc7cd('0x13')]('/:id',auth[_0xc7cd('0x7')](),controller[_0xc7cd('0x14')]);router['delete'](_0xc7cd('0xa'),auth['isAuthenticated'](),controller[_0xc7cd('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x952b=['exports','multer','path','connect-timeout','Router','./automation.controller','get','index','/:id','/:id/conditions','isAuthenticated','getConditions','getActions','post','create','addConditions','addActions','put','update'];(function(_0x50748b,_0x3ac11b){var _0x5a73a8=function(_0x596645){while(--_0x596645){_0x50748b['push'](_0x50748b['shift']());}};_0x5a73a8(++_0x3ac11b);}(_0x952b,0x99));var _0xb952=function(_0x14bf63,_0xdbd373){_0x14bf63=_0x14bf63-0x0;var _0x410d22=_0x952b[_0x14bf63];return _0x410d22;};'use strict';var multer=require(_0xb952('0x0'));var util=require('util');var path=require(_0xb952('0x1'));var timeout=require(_0xb952('0x2'));var express=require('express');var router=express[_0xb952('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb952('0x4'));router[_0xb952('0x5')]('/',auth['isAuthenticated'](),controller[_0xb952('0x6')]);router[_0xb952('0x5')](_0xb952('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xb952('0x5')](_0xb952('0x8'),auth[_0xb952('0x9')](),controller[_0xb952('0xa')]);router[_0xb952('0x5')]('/:id/actions',auth[_0xb952('0x9')](),controller[_0xb952('0xb')]);router[_0xb952('0xc')]('/',auth['isAuthenticated'](),controller[_0xb952('0xd')]);router[_0xb952('0xc')](_0xb952('0x8'),auth[_0xb952('0x9')](),controller[_0xb952('0xe')]);router[_0xb952('0xc')]('/:id/actions',auth[_0xb952('0x9')](),controller[_0xb952('0xf')]);router[_0xb952('0x10')](_0xb952('0x7'),auth[_0xb952('0x9')](),controller[_0xb952('0x11')]);router['delete'](_0xb952('0x7'),auth[_0xb952('0x9')](),controller['destroy']);module[_0xb952('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 4b2be92..17f37d0 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 _0x1b68=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x1b68,0x118));var _0x81b6=function(_0x529e2a,_0x1f2a17){_0x529e2a=_0x529e2a-0x0;var _0x484244=_0x1b68[_0x529e2a];return _0x484244;};'use strict';var Sequelize=require(_0x81b6('0x0'));module[_0x81b6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x81b6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x81b6('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x81b6('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x81b6('0x5')],'defaultValue':0x0,'comment':_0x81b6('0x6')},'limitCalls':{'type':Sequelize[_0x81b6('0x7')](0x4)[_0x81b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x81b6('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x81b6('0xa')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x81b6('0xa')]},'dialOriginateTimeout':{'type':Sequelize[_0x81b6('0x7')](0x3)[_0x81b6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81b6('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81b6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81b6('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x81b6('0x7')](0x5)[_0x81b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81b6('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x81b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81b6('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x81b6('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x81b6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x81b6('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x81b6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81b6('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x81b6('0x7')](0x3)[_0x81b6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x81b6('0x11')},'dialTimezone':{'type':Sequelize[_0x81b6('0xa')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x81b6('0xa')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x81b6('0x3')](_0x81b6('0x12'),_0x81b6('0x13'),_0x81b6('0x14')),'defaultValue':_0x81b6('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x81b6('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x81b6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x81b6('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x81b6('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81b6('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x81b6('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x81b6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x81b6('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x81b6('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x81b6('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x81b6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x81b6('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x81b6('0x7')](0x9)[_0x81b6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81b6('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x81b6('0x3')](_0x81b6('0x1d'),_0x81b6('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x81b6('0x7')](0x3)[_0x81b6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81b6('0x1f')},'dialCutDigit':{'type':Sequelize[_0x81b6('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81b6('0x20')}};
\ No newline at end of file
+var _0x284a=['STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','sequelize','exports'];(function(_0x1ad12c,_0x5bd618){var _0xb60e0f=function(_0x9fb490){while(--_0x9fb490){_0x1ad12c['push'](_0x1ad12c['shift']());}};_0xb60e0f(++_0x5bd618);}(_0x284a,0x1de));var _0xa284=function(_0xdf72e6,_0x487482){_0xdf72e6=_0xdf72e6-0x0;var _0x1bd374=_0x284a[_0xdf72e6];return _0x1bd374;};'use strict';var Sequelize=require(_0xa284('0x0'));module[_0xa284('0x1')]={'name':{'type':Sequelize[_0xa284('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa284('0x3')](_0xa284('0x4')),'allowNull':![],'defaultValue':_0xa284('0x4')},'description':{'type':Sequelize[_0xa284('0x2')]},'active':{'type':Sequelize[_0xa284('0x5')],'defaultValue':0x0,'comment':_0xa284('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xa284('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa284('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa284('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa284('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa284('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa284('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa284('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa284('0x9')](0x5)[_0xa284('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa284('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'defaultValue':0x3,'comment':_0xa284('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa284('0x9')](0x5)[_0xa284('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa284('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa284('0x10')},'dialTimezone':{'type':Sequelize[_0xa284('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa284('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xa284('0x3')](_0xa284('0x11'),_0xa284('0x12'),_0xa284('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xa284('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa284('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa284('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa284('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa284('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa284('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa284('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa284('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa284('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa284('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa284('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa284('0x9')](0x9)[_0xa284('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa284('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa284('0x1c'),_0xa284('0x1d')),'defaultValue':_0xa284('0x1c')},'dialPrefix':{'type':Sequelize[_0xa284('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa284('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa284('0x9')](0x3)[_0xa284('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index d7be0ee..8f3bdc6 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 _0xa9e0=['into','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','toString','NOW()','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','name','send','index','Campaign','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','findOne','CmHopper','CampaignId','filter','findAll','rows','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['Campaign'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x4e')]=function(_0x61bb17,_0x30decb){var _0x2e5165={'raw':![],'where':{'id':_0x61bb17['params']['id']}},_0x375c18={};_0x375c18['model']=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x2e5165[_0x0a9e('0x30')]=_['intersection'](_0x375c18[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x61bb17['query']['fields']));_0x2e5165[_0x0a9e('0x30')]=_0x2e5165['attributes'][_0x0a9e('0x31')]?_0x2e5165['attributes']:_0x375c18[_0x0a9e('0x2b')];if(_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2e5165['include']=[{'all':!![]}];}_0x2e5165=_[_0x0a9e('0x38')]({},_0x2e5165,_0x61bb17[_0x0a9e('0x3d')]);return db['Campaign']['find'](_0x2e5165)[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](function(_0x49c095){if(_0x49c095){var _0x145931=_0x49c095['get']({'plain':!![]});_0x145931=qs[_0x0a9e('0x4f')](_0x145931,['id','createdAt',_0x0a9e('0x50')]);_0x61bb17['body']=_['omit'](_0x61bb17['body'],['id',_0x0a9e('0x51'),'updatedAt']);return db[_0x0a9e('0x29')][_0x0a9e('0x45')](_[_0x0a9e('0x38')](_0x145931,_0x61bb17[_0x0a9e('0x46')]),{'include':_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]?[{'all':!![]}]:undefined})[_0x0a9e('0x1f')](function(_0x28d814){var _0x4e67ab=_0x61bb17[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x4e67ab)throw new Error(_0x0a9e('0x48'));if(_0x4e67ab[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x156662=_0x28d814['get']({'plain':!![]});var _0x956fbe=_0x0a9e('0x22');return db['UserProfileSection'][_0x0a9e('0x44')]({'where':{'name':_0x956fbe,'userProfileId':_0x4e67ab['userProfileId']},'raw':!![]})[_0x0a9e('0x1f')](function(_0x5ba1f9){if(_0x5ba1f9&&_0x5ba1f9['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x45')]({'name':_0x156662['name'],'resourceId':_0x156662['id'],'type':_0x5ba1f9[_0x0a9e('0x26')],'sectionId':_0x5ba1f9['id']},{})[_0x0a9e('0x1f')](function(){return _0x28d814;});}else{return _0x28d814;}})[_0x0a9e('0x40')](function(_0x7be420){logger[_0x0a9e('0x25')](_0x0a9e('0x4d'),_0x7be420);throw _0x7be420;});}return _0x28d814;});}})['then'](respondWithResult(_0x30decb,0xc9))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports['update']=function(_0xca4ade,_0x1f07cb){if(_0xca4ade[_0x0a9e('0x46')]['id']){delete _0xca4ade['body']['id'];}return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0xca4ade[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1f07cb,null))['then'](saveUpdates(_0xca4ade[_0x0a9e('0x46')],null))[_0x0a9e('0x1f')](respondWithResult(_0x1f07cb,null))['catch'](handleError(_0x1f07cb,null));};exports[_0x0a9e('0x20')]=function(_0x17e88c,_0x88dcbf){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x17e88c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x1f')](removeEntity(_0x88dcbf,null))[_0x0a9e('0x40')](handleError(_0x88dcbf,null));};exports['getHoppers']=function(_0x3528b7,_0x4f1e60,_0x5211e3){var _0x242745={'raw':!![],'where':{}};var _0x4556c5={};var _0x9375fb={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3528b7[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x4f1e60,null))[_0x0a9e('0x1f')](function(_0x2d7205){if(_0x2d7205){_0x4556c5[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x53')][_0x0a9e('0x2a')]);_0x4556c5[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3528b7[_0x0a9e('0x2d')]);_0x4556c5[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],_0x4556c5[_0x0a9e('0x2d')]);_0x242745[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],qs[_0x0a9e('0x43')](_0x3528b7[_0x0a9e('0x2d')]['fields']));_0x242745[_0x0a9e('0x30')]=_0x242745[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x242745[_0x0a9e('0x30')]:_0x4556c5[_0x0a9e('0x2b')];if(!_0x3528b7['query']['hasOwnProperty']('nolimit')){_0x242745[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x242745[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x242745['order']=qs[_0x0a9e('0x35')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x242745['where']=qs[_0x0a9e('0x2e')](_['pick'](_0x3528b7[_0x0a9e('0x2d')],_0x4556c5[_0x0a9e('0x2e')]));_0x242745['where'][_0x0a9e('0x54')]=_0x2d7205['id'];if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x242745[_0x0a9e('0x36')]=_['merge'](_0x242745[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x242745[_0x0a9e('0x30')],function(_0x278ab4){var _0x5b7fc3={};_0x5b7fc3[_0x278ab4]={'$like':'%'+_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5b7fc3;})});}_0x242745=_[_0x0a9e('0x38')]({},_0x242745,_0x3528b7[_0x0a9e('0x3d')]);return db['CmHopper'][_0x0a9e('0x17')]({'where':_0x242745[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0xf410e5){_0x9375fb[_0x0a9e('0x17')]=_0xf410e5;if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x242745[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x53')][_0x0a9e('0x56')](_0x242745);})[_0x0a9e('0x1f')](function(_0x1f10ef){_0x9375fb[_0x0a9e('0x57')]=_0x1f10ef;return _0x9375fb;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x4f1e60,_0x242745))['catch'](handleError(_0x4f1e60,null));};exports[_0x0a9e('0x58')]=function(_0x11da9c,_0xc599b3,_0x563627){var _0x3736e0={'raw':!![],'where':{}};var _0x33dda0={};var _0x8cea96={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x11da9c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xc599b3,null))[_0x0a9e('0x1f')](function(_0x4c54fa){if(_0x4c54fa){_0x33dda0[_0x0a9e('0x2b')]=_['keys'](db[_0x0a9e('0x59')][_0x0a9e('0x2a')]);_0x33dda0['query']=_[_0x0a9e('0x2c')](_0x11da9c[_0x0a9e('0x2d')]);_0x33dda0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x33dda0[_0x0a9e('0x2b')],_0x33dda0[_0x0a9e('0x2d')]);_0x3736e0[_0x0a9e('0x30')]=_['intersection'](_0x33dda0[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x3736e0['attributes']=_0x3736e0[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x3736e0['attributes']:_0x33dda0[_0x0a9e('0x2b')];if(!_0x11da9c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x3736e0[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x11da9c['query']['limit']);_0x3736e0[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x11da9c[_0x0a9e('0x2d')]['offset']);}_0x3736e0[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x11da9c['query']['sort']);_0x3736e0[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x11da9c['query'],_0x33dda0[_0x0a9e('0x2e')]));_0x3736e0[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x4c54fa['id'];if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x3736e0[_0x0a9e('0x36')]=_['merge'](_0x3736e0[_0x0a9e('0x36')],{'$or':_['map'](_0x3736e0[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x11da9c[_0x0a9e('0x2d')]['filter']+'%'};return _0x18ad56;})});}_0x3736e0=_[_0x0a9e('0x38')]({},_0x3736e0,_0x11da9c[_0x0a9e('0x3d')]);return db[_0x0a9e('0x59')]['count']({'where':_0x3736e0[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2a563d){_0x8cea96[_0x0a9e('0x17')]=_0x2a563d;if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x3736e0[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x59')]['findAll'](_0x3736e0);})[_0x0a9e('0x1f')](function(_0x3325c5){_0x8cea96['rows']=_0x3325c5;return _0x8cea96;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xc599b3,_0x3736e0))[_0x0a9e('0x40')](handleError(_0xc599b3,null));};exports[_0x0a9e('0x5b')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={'raw':!![],'where':{}};var _0x2b5148={};var _0x558a87={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x5a26c8[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x96672f,null))[_0x0a9e('0x1f')](function(_0x501050){if(_0x501050){_0x2b5148[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5c')][_0x0a9e('0x2a')]);_0x2b5148[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5a26c8[_0x0a9e('0x2d')]);_0x2b5148[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x2b5148[_0x0a9e('0x2b')],_0x2b5148[_0x0a9e('0x2d')]);_0x8c8fbe[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x2b5148['model'],qs[_0x0a9e('0x43')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x8c8fbe[_0x0a9e('0x30')]=_0x8c8fbe[_0x0a9e('0x30')]['length']?_0x8c8fbe[_0x0a9e('0x30')]:_0x2b5148[_0x0a9e('0x2b')];if(!_0x5a26c8['query'][_0x0a9e('0x32')]('nolimit')){_0x8c8fbe[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x8c8fbe['offset']=qs[_0x0a9e('0x18')](_0x5a26c8['query'][_0x0a9e('0x18')]);}_0x8c8fbe[_0x0a9e('0x5a')]=qs['sort'](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x8c8fbe[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x5a26c8[_0x0a9e('0x2d')],_0x2b5148[_0x0a9e('0x2e')]));_0x8c8fbe[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x501050['id'];if(_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x8c8fbe[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0x8c8fbe[_0x0a9e('0x36')],{'$or':_['map'](_0x8c8fbe[_0x0a9e('0x30')],function(_0x517081){var _0x287324={};_0x287324[_0x517081]={'$like':'%'+_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x287324;})});}_0x8c8fbe=_[_0x0a9e('0x38')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x3d')]);return db['CmHopperFinal'][_0x0a9e('0x17')]({'where':_0x8c8fbe[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aa5f2){_0x558a87[_0x0a9e('0x17')]=_0x2aa5f2;if(_0x5a26c8['query']['includeAll']){_0x8c8fbe[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0a9e('0x56')](_0x8c8fbe);})[_0x0a9e('0x1f')](function(_0x4672e1){_0x558a87[_0x0a9e('0x57')]=_0x4672e1;return _0x558a87;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x96672f,_0x8c8fbe))[_0x0a9e('0x40')](handleError(_0x96672f,null));};exports['getHopperBlacks']=function(_0x4db918,_0x1889ed,_0x5dfbe2){var _0x2469d1={'raw':!![],'where':{}};var _0x5c689c={};var _0x427ccc={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4db918[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1889ed,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5d')][_0x0a9e('0x2a')]);_0x5c689c['query']=_['keys'](_0x4db918[_0x0a9e('0x2d')]);_0x5c689c[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],_0x5c689c[_0x0a9e('0x2d')]);_0x2469d1['attributes']=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],qs['fields'](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2469d1[_0x0a9e('0x30')]=_0x2469d1[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2469d1[_0x0a9e('0x30')]:_0x5c689c[_0x0a9e('0x2b')];if(!_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x2469d1['limit']=qs[_0x0a9e('0x34')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x2469d1[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x4db918['query']['offset']);}_0x2469d1[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x2469d1[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x4db918[_0x0a9e('0x2d')],_0x5c689c[_0x0a9e('0x2e')]));_0x2469d1['where'][_0x0a9e('0x54')]=_0x170af6['id'];if(_0x4db918['query'][_0x0a9e('0x55')]){_0x2469d1['where']=_[_0x0a9e('0x38')](_0x2469d1[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x2469d1['attributes'],function(_0xc9529d){var _0x5ed560={};_0x5ed560[_0xc9529d]={'$like':'%'+_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5ed560;})});}_0x2469d1=_[_0x0a9e('0x38')]({},_0x2469d1,_0x4db918[_0x0a9e('0x3d')]);return db[_0x0a9e('0x5d')][_0x0a9e('0x17')]({'where':_0x2469d1[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aaf07){_0x427ccc[_0x0a9e('0x17')]=_0x2aaf07;if(_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2469d1[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5d')][_0x0a9e('0x56')](_0x2469d1);})[_0x0a9e('0x1f')](function(_0x5b93dd){_0x427ccc['rows']=_0x5b93dd;return _0x427ccc;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x1889ed,_0x2469d1))['catch'](handleError(_0x1889ed,null));};exports[_0x0a9e('0x5e')]=function(_0x3428c9,_0x5d6b69,_0x1a3754){var _0xe2b083={};var _0x387bbe={};var _0x18adc8;var _0x5585d5;return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3428c9[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d6b69,null))['then'](function(_0x19e9ed){if(_0x19e9ed){_0x18adc8=_0x19e9ed;_0x387bbe[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db['CmList'][_0x0a9e('0x2a')]);_0x387bbe[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3428c9['query']);_0x387bbe[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x387bbe[_0x0a9e('0x2b')],_0x387bbe[_0x0a9e('0x2d')]);_0xe2b083[_0x0a9e('0x30')]=_['intersection'](_0x387bbe[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x3428c9['query'][_0x0a9e('0x43')]));_0xe2b083[_0x0a9e('0x30')]=_0xe2b083[_0x0a9e('0x30')]['length']?_0xe2b083['attributes']:_0x387bbe['model'];_0xe2b083[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x3428c9['query'][_0x0a9e('0x35')]);_0xe2b083[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_['pick'](_0x3428c9[_0x0a9e('0x2d')],_0x387bbe[_0x0a9e('0x2e')]));if(_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0xe2b083[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0xe2b083[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0xe2b083[_0x0a9e('0x30')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x3428c9['query'][_0x0a9e('0x55')]+'%'};return _0x43c397;})});}_0xe2b083=_[_0x0a9e('0x38')]({},_0xe2b083,_0x3428c9[_0x0a9e('0x3d')]);return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x344cd4){if(_0x344cd4){_0x5585d5=_0x344cd4['length'];if(!_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0xe2b083[_0x0a9e('0x34')]=qs['limit'](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0xe2b083[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x3299b7){if(_0x3299b7){return _0x3299b7?{'count':_0x5585d5,'rows':_0x3299b7}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5d6b69,null))['catch'](handleError(_0x5d6b69,null));};exports[_0x0a9e('0x5f')]=function(_0x88b25f,_0x2ff265,_0x26b826){var _0xea8bd1,_0x253f74;return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x88b25f['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2ff265,null))[_0x0a9e('0x1f')](function(_0x1a9ef1){if(_0x1a9ef1){_0x253f74=_0x1a9ef1;return _0x1a9ef1['addLists'](_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x60')],_[_0x0a9e('0x4f')](_0x88b25f[_0x0a9e('0x46')],[_0x0a9e('0x60'),'id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x424f1b){var _0x336a19;_0xea8bd1=_0x424f1b||[];var _0x401601=[];if(_0x424f1b){for(var _0x451010=0x0;_0x451010<_0x424f1b['length'];_0x451010+=0x1){var _0x251753=_0x424f1b[_0x451010][_0x0a9e('0x21')]({'plain':!![]});_0x253f74[_0x0a9e('0x62')]=_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x62')]?_0x88b25f[_0x0a9e('0x46')]['dialCheckDuplicateType']:_0x253f74[_0x0a9e('0x62')];switch(_0x253f74['dialCheckDuplicateType']){case'always':_0x336a19=squel['insert']()[_0x0a9e('0x63')](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),'scheduledAt',_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()['field'](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('NOW()',_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))['field'](_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))['field']('NOW()','createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())[_0x0a9e('0x36')](_0x0a9e('0x6f'))[_0x0a9e('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x71'))['from'](_0x0a9e('0x72'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]()))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')]('COALESCE(phone,\x27\x27)')[_0x0a9e('0x6d')](_0x0a9e('0x64'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id']['toString']())))[_0x0a9e('0x6b')]();break;case _0x0a9e('0x75'):_0x336a19=squel[_0x0a9e('0x76')]()['into'](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x66'),'phone')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x251753['CmListId'][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x51'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())['where'](_0x0a9e('0x6f'))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x79'))[_0x0a9e('0x6d')]('cm_hopper')[_0x0a9e('0x36')](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]())))[_0x0a9e('0x6b')]();break;default:_0x336a19=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')]('cm_hopper')[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),'ContactId',_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id']['toString'](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())[_0x0a9e('0x36')](_0x0a9e('0x6f')))[_0x0a9e('0x6b')]();}_0x401601[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x336a19));}return BPromise[_0x0a9e('0x7b')](_0x401601);}})[_0x0a9e('0x1f')](function(){return _0xea8bd1;})[_0x0a9e('0x1f')](respondWithResult(_0x2ff265,null))[_0x0a9e('0x40')](handleError(_0x2ff265,null));};exports[_0x0a9e('0x7c')]=function(_0x31c937,_0x5312fa,_0x49baaa){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x31c937[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5312fa,null))[_0x0a9e('0x1f')](function(_0xa3695f){if(_0xa3695f){return _0xa3695f[_0x0a9e('0x7c')](_0x31c937[_0x0a9e('0x2d')]['ids']);}})[_0x0a9e('0x1f')](function(_0x59b872){if(_0x59b872){return db['CmHopper'][_0x0a9e('0x20')]({'where':{'ListId':_0x31c937['query'][_0x0a9e('0x60')],'CampaignId':_0x31c937['params']['id']}})['then'](function(){return _0x59b872;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x5312fa,null))['catch'](handleError(_0x5312fa,null));};exports[_0x0a9e('0x7d')]=function(_0x142e53,_0xe1ab0d,_0x48f532){var _0x4152cd={'raw':!![],'where':{}};var _0x1209c4={};var _0x3ea310={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x142e53[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe1ab0d,null))[_0x0a9e('0x1f')](function(_0x2f79fb){if(_0x2f79fb){_0x1209c4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x7e')][_0x0a9e('0x2a')]);_0x1209c4[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x142e53['query']);_0x1209c4['filters']=_['intersection'](_0x1209c4[_0x0a9e('0x2b')],_0x1209c4[_0x0a9e('0x2d')]);_0x4152cd[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1209c4[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x4152cd['attributes']=_0x4152cd['attributes'][_0x0a9e('0x31')]?_0x4152cd[_0x0a9e('0x30')]:_0x1209c4['model'];if(!_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x4152cd[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x4152cd[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x4152cd[_0x0a9e('0x5a')]=qs['sort'](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x4152cd[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x37')](_0x142e53[_0x0a9e('0x2d')],_0x1209c4[_0x0a9e('0x2e')]));_0x4152cd[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x2f79fb['id'];if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x4152cd[_0x0a9e('0x36')]=_['merge'](_0x4152cd['where'],{'$or':_[_0x0a9e('0x39')](_0x4152cd[_0x0a9e('0x30')],function(_0x4545a3){var _0x1ee9d3={};_0x1ee9d3[_0x4545a3]={'$like':'%'+_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x1ee9d3;})});}_0x4152cd=_[_0x0a9e('0x38')]({},_0x4152cd,_0x142e53['options']);return db[_0x0a9e('0x7e')]['count']({'where':_0x4152cd[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x1e9f9f){_0x3ea310[_0x0a9e('0x17')]=_0x1e9f9f;if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x4152cd[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x7e')][_0x0a9e('0x56')](_0x4152cd);})[_0x0a9e('0x1f')](function(_0x39d367){_0x3ea310[_0x0a9e('0x57')]=_0x39d367;return _0x3ea310;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xe1ab0d,_0x4152cd))[_0x0a9e('0x40')](handleError(_0xe1ab0d,null));};exports[_0x0a9e('0x7f')]=function(_0x2d5e00,_0x5b78a8,_0x54cf62){var _0x9dc1de,_0x410e12;return db['Campaign']['find']({'where':{'id':_0x2d5e00[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b78a8,null))[_0x0a9e('0x1f')](function(_0x596178){if(_0x596178){_0x410e12=_0x596178;return _0x596178[_0x0a9e('0x7f')](_0x2d5e00['body'][_0x0a9e('0x60')],_['omit'](_0x2d5e00[_0x0a9e('0x46')],['ids','id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x21e210){var _0x1d5432;_0x9dc1de=_0x21e210||[];var _0x50e7cc=[];if(_0x21e210){for(var _0x316b51=0x0;_0x316b51<_0x21e210['length'];_0x316b51+=0x1){var _0x505ffd=_0x21e210[_0x316b51][_0x0a9e('0x21')]({'plain':!![]});_0x1d5432=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')](_0x0a9e('0x80'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x505ffd[_0x0a9e('0x6a')]['toString'](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x2d5e00[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),'CampaignId')['field']('NOW()',_0x0a9e('0x51'))['field'](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x505ffd[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())['where'](_0x0a9e('0x6f')))['toString']();_0x50e7cc[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x1d5432));}return BPromise[_0x0a9e('0x7b')](_0x50e7cc);}})[_0x0a9e('0x1f')](function(){return _0x9dc1de;})['then'](respondWithResult(_0x5b78a8,null))[_0x0a9e('0x40')](handleError(_0x5b78a8,null));};exports[_0x0a9e('0x81')]=function(_0x531377,_0x53c4f0,_0x3fab79){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x531377['params']['id']}})['then'](handleEntityNotFound(_0x53c4f0,null))['then'](function(_0x374964){if(_0x374964){return _0x374964[_0x0a9e('0x81')](_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')]);}})[_0x0a9e('0x1f')](function(_0x23e6b5){if(_0x23e6b5){return db[_0x0a9e('0x5d')][_0x0a9e('0x20')]({'where':{'ListId':_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')],'CampaignId':_0x531377[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](function(){return _0x23e6b5;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x53c4f0,null))[_0x0a9e('0x40')](handleError(_0x53c4f0,null));};
\ No newline at end of file
+var _0xa9e0=['into','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','toString','NOW()','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','name','send','index','Campaign','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','type','key','field','options','includeAll','include','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','findOne','CmHopper','CampaignId','filter','findAll','rows','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=db[_0x0a9e('0x29')][_0x0a9e('0x2a')];_0x11c3b6[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x5a101a);_0x11c3b6['query']=_[_0x0a9e('0x2c')](_0x14433c[_0x0a9e('0x2d')]);_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],_0x11c3b6[_0x0a9e('0x2d')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x11c3b6[_0x0a9e('0x2b')],qs['fields'](_0x14433c[_0x0a9e('0x2d')]['fields']));_0x1538a4[_0x0a9e('0x30')]=_0x1538a4[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x1538a4[_0x0a9e('0x30')]:_0x11c3b6[_0x0a9e('0x2b')];if(!_0x14433c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x1538a4[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c['query'][_0x0a9e('0x18')]);}_0x1538a4['order']=qs[_0x0a9e('0x35')](_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x1538a4[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x14433c[_0x0a9e('0x2d')],_0x11c3b6[_0x0a9e('0x2e')]));if(_0x14433c[_0x0a9e('0x2d')]['filter']){_0x1538a4['where']=_[_0x0a9e('0x38')](_0x1538a4['where'],{'$or':_[_0x0a9e('0x39')](_0x5a101a,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x3a')][_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x14433c[_0x0a9e('0x2d')]['filter']+'%'};return _0x31916f;}})});}_0x1538a4=_[_0x0a9e('0x38')]({},_0x1538a4,_0x14433c[_0x0a9e('0x3d')]);var _0x289467={'where':_0x1538a4['where']};return db['Campaign'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x14de77[_0x0a9e('0x17')]=_0x5adda1;if(_0x14433c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x1538a4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x14de77['rows']=_0x45b3d0;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x40')](handleError(_0x140511,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x274e8e[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5b4f5e[_0x0a9e('0x2d')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x274e8e[_0x0a9e('0x2b')],_0x274e8e[_0x0a9e('0x2d')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x30')]=_0x2cfea9[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2cfea9[_0x0a9e('0x30')]:_0x274e8e[_0x0a9e('0x2b')];if(_0x5b4f5e[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x29')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x29')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](function(_0x8d6dd1){var _0x562fb4=_0x44dd99[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x562fb4)throw new Error(_0x0a9e('0x48'));if(_0x562fb4[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x37be73=_0x8d6dd1[_0x0a9e('0x21')]({'plain':!![]});var _0x5bbcde=_0x0a9e('0x22');return db[_0x0a9e('0x4a')][_0x0a9e('0x44')]({'where':{'name':_0x5bbcde,'userProfileId':_0x562fb4[_0x0a9e('0x4b')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x992c77){if(_0x992c77&&_0x992c77[_0x0a9e('0x4c')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x45')]({'name':_0x37be73['name'],'resourceId':_0x37be73['id'],'type':_0x992c77[_0x0a9e('0x26')],'sectionId':_0x992c77['id']},{})[_0x0a9e('0x1f')](function(){return _0x8d6dd1;});}else{return _0x8d6dd1;}})['catch'](function(_0x4ae14b){logger['error'](_0x0a9e('0x4d'),_0x4ae14b);throw _0x4ae14b;});}return _0x8d6dd1;})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x4e')]=function(_0x61bb17,_0x30decb){var _0x2e5165={'raw':![],'where':{'id':_0x61bb17['params']['id']}},_0x375c18={};_0x375c18['model']=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x2a')]);_0x2e5165[_0x0a9e('0x30')]=_['intersection'](_0x375c18[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x61bb17['query']['fields']));_0x2e5165[_0x0a9e('0x30')]=_0x2e5165['attributes'][_0x0a9e('0x31')]?_0x2e5165['attributes']:_0x375c18[_0x0a9e('0x2b')];if(_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2e5165['include']=[{'all':!![]}];}_0x2e5165=_[_0x0a9e('0x38')]({},_0x2e5165,_0x61bb17[_0x0a9e('0x3d')]);return db['Campaign']['find'](_0x2e5165)[_0x0a9e('0x1f')](handleEntityNotFound(_0x30decb,null))[_0x0a9e('0x1f')](function(_0x49c095){if(_0x49c095){var _0x145931=_0x49c095['get']({'plain':!![]});_0x145931=qs[_0x0a9e('0x4f')](_0x145931,['id','createdAt',_0x0a9e('0x50')]);_0x61bb17['body']=_['omit'](_0x61bb17['body'],['id',_0x0a9e('0x51'),'updatedAt']);return db[_0x0a9e('0x29')][_0x0a9e('0x45')](_[_0x0a9e('0x38')](_0x145931,_0x61bb17[_0x0a9e('0x46')]),{'include':_0x61bb17[_0x0a9e('0x2d')][_0x0a9e('0x3e')]?[{'all':!![]}]:undefined})[_0x0a9e('0x1f')](function(_0x28d814){var _0x4e67ab=_0x61bb17[_0x0a9e('0x47')][_0x0a9e('0x21')]({'plain':!![]});if(!_0x4e67ab)throw new Error(_0x0a9e('0x48'));if(_0x4e67ab[_0x0a9e('0x49')]===_0x0a9e('0x47')){var _0x156662=_0x28d814['get']({'plain':!![]});var _0x956fbe=_0x0a9e('0x22');return db['UserProfileSection'][_0x0a9e('0x44')]({'where':{'name':_0x956fbe,'userProfileId':_0x4e67ab['userProfileId']},'raw':!![]})[_0x0a9e('0x1f')](function(_0x5ba1f9){if(_0x5ba1f9&&_0x5ba1f9['autoAssociation']===0x0){return db['UserProfileResource'][_0x0a9e('0x45')]({'name':_0x156662['name'],'resourceId':_0x156662['id'],'type':_0x5ba1f9[_0x0a9e('0x26')],'sectionId':_0x5ba1f9['id']},{})[_0x0a9e('0x1f')](function(){return _0x28d814;});}else{return _0x28d814;}})[_0x0a9e('0x40')](function(_0x7be420){logger[_0x0a9e('0x25')](_0x0a9e('0x4d'),_0x7be420);throw _0x7be420;});}return _0x28d814;});}})['then'](respondWithResult(_0x30decb,0xc9))[_0x0a9e('0x40')](handleError(_0x30decb,null));};exports['update']=function(_0xca4ade,_0x1f07cb){if(_0xca4ade[_0x0a9e('0x46')]['id']){delete _0xca4ade['body']['id'];}return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0xca4ade[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1f07cb,null))['then'](saveUpdates(_0xca4ade[_0x0a9e('0x46')],null))[_0x0a9e('0x1f')](respondWithResult(_0x1f07cb,null))['catch'](handleError(_0x1f07cb,null));};exports[_0x0a9e('0x20')]=function(_0x17e88c,_0x88dcbf){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x17e88c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x88dcbf,null))[_0x0a9e('0x1f')](removeEntity(_0x88dcbf,null))[_0x0a9e('0x40')](handleError(_0x88dcbf,null));};exports['getHoppers']=function(_0x3528b7,_0x4f1e60,_0x5211e3){var _0x242745={'raw':!![],'where':{}};var _0x4556c5={};var _0x9375fb={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3528b7[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x4f1e60,null))[_0x0a9e('0x1f')](function(_0x2d7205){if(_0x2d7205){_0x4556c5[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x53')][_0x0a9e('0x2a')]);_0x4556c5[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3528b7[_0x0a9e('0x2d')]);_0x4556c5[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],_0x4556c5[_0x0a9e('0x2d')]);_0x242745[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x4556c5['model'],qs[_0x0a9e('0x43')](_0x3528b7[_0x0a9e('0x2d')]['fields']));_0x242745[_0x0a9e('0x30')]=_0x242745[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x242745[_0x0a9e('0x30')]:_0x4556c5[_0x0a9e('0x2b')];if(!_0x3528b7['query']['hasOwnProperty']('nolimit')){_0x242745[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x242745[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x242745['order']=qs[_0x0a9e('0x35')](_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x242745['where']=qs[_0x0a9e('0x2e')](_['pick'](_0x3528b7[_0x0a9e('0x2d')],_0x4556c5[_0x0a9e('0x2e')]));_0x242745['where'][_0x0a9e('0x54')]=_0x2d7205['id'];if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x242745[_0x0a9e('0x36')]=_['merge'](_0x242745[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x242745[_0x0a9e('0x30')],function(_0x278ab4){var _0x5b7fc3={};_0x5b7fc3[_0x278ab4]={'$like':'%'+_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5b7fc3;})});}_0x242745=_[_0x0a9e('0x38')]({},_0x242745,_0x3528b7[_0x0a9e('0x3d')]);return db['CmHopper'][_0x0a9e('0x17')]({'where':_0x242745[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0xf410e5){_0x9375fb[_0x0a9e('0x17')]=_0xf410e5;if(_0x3528b7[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x242745[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x53')][_0x0a9e('0x56')](_0x242745);})[_0x0a9e('0x1f')](function(_0x1f10ef){_0x9375fb[_0x0a9e('0x57')]=_0x1f10ef;return _0x9375fb;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x4f1e60,_0x242745))['catch'](handleError(_0x4f1e60,null));};exports[_0x0a9e('0x58')]=function(_0x11da9c,_0xc599b3,_0x563627){var _0x3736e0={'raw':!![],'where':{}};var _0x33dda0={};var _0x8cea96={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')]['findOne']({'where':{'id':_0x11da9c['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xc599b3,null))[_0x0a9e('0x1f')](function(_0x4c54fa){if(_0x4c54fa){_0x33dda0[_0x0a9e('0x2b')]=_['keys'](db[_0x0a9e('0x59')][_0x0a9e('0x2a')]);_0x33dda0['query']=_[_0x0a9e('0x2c')](_0x11da9c[_0x0a9e('0x2d')]);_0x33dda0[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x33dda0[_0x0a9e('0x2b')],_0x33dda0[_0x0a9e('0x2d')]);_0x3736e0[_0x0a9e('0x30')]=_['intersection'](_0x33dda0[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x3736e0['attributes']=_0x3736e0[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x3736e0['attributes']:_0x33dda0[_0x0a9e('0x2b')];if(!_0x11da9c['query'][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x3736e0[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x11da9c['query']['limit']);_0x3736e0[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x11da9c[_0x0a9e('0x2d')]['offset']);}_0x3736e0[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x11da9c['query']['sort']);_0x3736e0[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x11da9c['query'],_0x33dda0[_0x0a9e('0x2e')]));_0x3736e0[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x4c54fa['id'];if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x3736e0[_0x0a9e('0x36')]=_['merge'](_0x3736e0[_0x0a9e('0x36')],{'$or':_['map'](_0x3736e0[_0x0a9e('0x30')],function(_0x2aabab){var _0x18ad56={};_0x18ad56[_0x2aabab]={'$like':'%'+_0x11da9c[_0x0a9e('0x2d')]['filter']+'%'};return _0x18ad56;})});}_0x3736e0=_[_0x0a9e('0x38')]({},_0x3736e0,_0x11da9c[_0x0a9e('0x3d')]);return db[_0x0a9e('0x59')]['count']({'where':_0x3736e0[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2a563d){_0x8cea96[_0x0a9e('0x17')]=_0x2a563d;if(_0x11da9c[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x3736e0[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x59')]['findAll'](_0x3736e0);})[_0x0a9e('0x1f')](function(_0x3325c5){_0x8cea96['rows']=_0x3325c5;return _0x8cea96;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xc599b3,_0x3736e0))[_0x0a9e('0x40')](handleError(_0xc599b3,null));};exports[_0x0a9e('0x5b')]=function(_0x5a26c8,_0x96672f,_0x52ec10){var _0x8c8fbe={'raw':!![],'where':{}};var _0x2b5148={};var _0x558a87={'count':0x0,'rows':[]};return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x5a26c8[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x96672f,null))[_0x0a9e('0x1f')](function(_0x501050){if(_0x501050){_0x2b5148[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5c')][_0x0a9e('0x2a')]);_0x2b5148[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x5a26c8[_0x0a9e('0x2d')]);_0x2b5148[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x2b5148[_0x0a9e('0x2b')],_0x2b5148[_0x0a9e('0x2d')]);_0x8c8fbe[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x2b5148['model'],qs[_0x0a9e('0x43')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x8c8fbe[_0x0a9e('0x30')]=_0x8c8fbe[_0x0a9e('0x30')]['length']?_0x8c8fbe[_0x0a9e('0x30')]:_0x2b5148[_0x0a9e('0x2b')];if(!_0x5a26c8['query'][_0x0a9e('0x32')]('nolimit')){_0x8c8fbe[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x8c8fbe['offset']=qs[_0x0a9e('0x18')](_0x5a26c8['query'][_0x0a9e('0x18')]);}_0x8c8fbe[_0x0a9e('0x5a')]=qs['sort'](_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x8c8fbe[_0x0a9e('0x36')]=qs['filters'](_['pick'](_0x5a26c8[_0x0a9e('0x2d')],_0x2b5148[_0x0a9e('0x2e')]));_0x8c8fbe[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x501050['id'];if(_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x8c8fbe[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0x8c8fbe[_0x0a9e('0x36')],{'$or':_['map'](_0x8c8fbe[_0x0a9e('0x30')],function(_0x517081){var _0x287324={};_0x287324[_0x517081]={'$like':'%'+_0x5a26c8[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x287324;})});}_0x8c8fbe=_[_0x0a9e('0x38')]({},_0x8c8fbe,_0x5a26c8[_0x0a9e('0x3d')]);return db['CmHopperFinal'][_0x0a9e('0x17')]({'where':_0x8c8fbe[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aa5f2){_0x558a87[_0x0a9e('0x17')]=_0x2aa5f2;if(_0x5a26c8['query']['includeAll']){_0x8c8fbe[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0a9e('0x56')](_0x8c8fbe);})[_0x0a9e('0x1f')](function(_0x4672e1){_0x558a87[_0x0a9e('0x57')]=_0x4672e1;return _0x558a87;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x96672f,_0x8c8fbe))[_0x0a9e('0x40')](handleError(_0x96672f,null));};exports['getHopperBlacks']=function(_0x4db918,_0x1889ed,_0x5dfbe2){var _0x2469d1={'raw':!![],'where':{}};var _0x5c689c={};var _0x427ccc={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4db918[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x1889ed,null))['then'](function(_0x170af6){if(_0x170af6){_0x5c689c[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x5d')][_0x0a9e('0x2a')]);_0x5c689c['query']=_['keys'](_0x4db918[_0x0a9e('0x2d')]);_0x5c689c[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],_0x5c689c[_0x0a9e('0x2d')]);_0x2469d1['attributes']=_[_0x0a9e('0x2f')](_0x5c689c[_0x0a9e('0x2b')],qs['fields'](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x2469d1[_0x0a9e('0x30')]=_0x2469d1[_0x0a9e('0x30')][_0x0a9e('0x31')]?_0x2469d1[_0x0a9e('0x30')]:_0x5c689c[_0x0a9e('0x2b')];if(!_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x2469d1['limit']=qs[_0x0a9e('0x34')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x2469d1[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x4db918['query']['offset']);}_0x2469d1[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x2469d1[_0x0a9e('0x36')]=qs['filters'](_[_0x0a9e('0x37')](_0x4db918[_0x0a9e('0x2d')],_0x5c689c[_0x0a9e('0x2e')]));_0x2469d1['where'][_0x0a9e('0x54')]=_0x170af6['id'];if(_0x4db918['query'][_0x0a9e('0x55')]){_0x2469d1['where']=_[_0x0a9e('0x38')](_0x2469d1[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0x2469d1['attributes'],function(_0xc9529d){var _0x5ed560={};_0x5ed560[_0xc9529d]={'$like':'%'+_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x5ed560;})});}_0x2469d1=_[_0x0a9e('0x38')]({},_0x2469d1,_0x4db918[_0x0a9e('0x3d')]);return db[_0x0a9e('0x5d')][_0x0a9e('0x17')]({'where':_0x2469d1[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x2aaf07){_0x427ccc[_0x0a9e('0x17')]=_0x2aaf07;if(_0x4db918[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x2469d1[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x5d')][_0x0a9e('0x56')](_0x2469d1);})[_0x0a9e('0x1f')](function(_0x5b93dd){_0x427ccc['rows']=_0x5b93dd;return _0x427ccc;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x1889ed,_0x2469d1))['catch'](handleError(_0x1889ed,null));};exports[_0x0a9e('0x5e')]=function(_0x3428c9,_0x5d6b69,_0x1a3754){var _0xe2b083={};var _0x387bbe={};var _0x18adc8;var _0x5585d5;return db[_0x0a9e('0x29')][_0x0a9e('0x52')]({'where':{'id':_0x3428c9[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5d6b69,null))['then'](function(_0x19e9ed){if(_0x19e9ed){_0x18adc8=_0x19e9ed;_0x387bbe[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db['CmList'][_0x0a9e('0x2a')]);_0x387bbe[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x3428c9['query']);_0x387bbe[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x387bbe[_0x0a9e('0x2b')],_0x387bbe[_0x0a9e('0x2d')]);_0xe2b083[_0x0a9e('0x30')]=_['intersection'](_0x387bbe[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x3428c9['query'][_0x0a9e('0x43')]));_0xe2b083[_0x0a9e('0x30')]=_0xe2b083[_0x0a9e('0x30')]['length']?_0xe2b083['attributes']:_0x387bbe['model'];_0xe2b083[_0x0a9e('0x5a')]=qs[_0x0a9e('0x35')](_0x3428c9['query'][_0x0a9e('0x35')]);_0xe2b083[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_['pick'](_0x3428c9[_0x0a9e('0x2d')],_0x387bbe[_0x0a9e('0x2e')]));if(_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0xe2b083[_0x0a9e('0x36')]=_[_0x0a9e('0x38')](_0xe2b083[_0x0a9e('0x36')],{'$or':_[_0x0a9e('0x39')](_0xe2b083[_0x0a9e('0x30')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x3428c9['query'][_0x0a9e('0x55')]+'%'};return _0x43c397;})});}_0xe2b083=_[_0x0a9e('0x38')]({},_0xe2b083,_0x3428c9[_0x0a9e('0x3d')]);return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x344cd4){if(_0x344cd4){_0x5585d5=_0x344cd4['length'];if(!_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0xe2b083[_0x0a9e('0x34')]=qs['limit'](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0xe2b083[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3428c9[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}return _0x18adc8[_0x0a9e('0x5e')](_0xe2b083);}})[_0x0a9e('0x1f')](function(_0x3299b7){if(_0x3299b7){return _0x3299b7?{'count':_0x5585d5,'rows':_0x3299b7}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5d6b69,null))['catch'](handleError(_0x5d6b69,null));};exports[_0x0a9e('0x5f')]=function(_0x88b25f,_0x2ff265,_0x26b826){var _0xea8bd1,_0x253f74;return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x88b25f['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2ff265,null))[_0x0a9e('0x1f')](function(_0x1a9ef1){if(_0x1a9ef1){_0x253f74=_0x1a9ef1;return _0x1a9ef1['addLists'](_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x60')],_[_0x0a9e('0x4f')](_0x88b25f[_0x0a9e('0x46')],[_0x0a9e('0x60'),'id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x424f1b){var _0x336a19;_0xea8bd1=_0x424f1b||[];var _0x401601=[];if(_0x424f1b){for(var _0x451010=0x0;_0x451010<_0x424f1b['length'];_0x451010+=0x1){var _0x251753=_0x424f1b[_0x451010][_0x0a9e('0x21')]({'plain':!![]});_0x253f74[_0x0a9e('0x62')]=_0x88b25f[_0x0a9e('0x46')][_0x0a9e('0x62')]?_0x88b25f[_0x0a9e('0x46')]['dialCheckDuplicateType']:_0x253f74[_0x0a9e('0x62')];switch(_0x253f74['dialCheckDuplicateType']){case'always':_0x336a19=squel['insert']()[_0x0a9e('0x63')](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),'scheduledAt',_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()['field'](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('NOW()',_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))['field'](_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))['field']('NOW()','createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())[_0x0a9e('0x36')](_0x0a9e('0x6f'))[_0x0a9e('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x71'))['from'](_0x0a9e('0x72'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]()))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')]('COALESCE(phone,\x27\x27)')[_0x0a9e('0x6d')](_0x0a9e('0x64'))['where'](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id']['toString']())))[_0x0a9e('0x6b')]();break;case _0x0a9e('0x75'):_0x336a19=squel[_0x0a9e('0x76')]()['into'](_0x0a9e('0x64'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()['field'](_0x0a9e('0x66'),'phone')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x251753['CmListId'][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id'][_0x0a9e('0x6b')](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x51'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x251753[_0x0a9e('0x6a')]['toString']())['where'](_0x0a9e('0x6f'))[_0x0a9e('0x36')](_0x0a9e('0x74'),squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x79'))[_0x0a9e('0x6d')]('cm_hopper')[_0x0a9e('0x36')](_0x0a9e('0x73'),_0x88b25f[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')]())))[_0x0a9e('0x6b')]();break;default:_0x336a19=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')]('cm_hopper')[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x69'),'ContactId',_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel['select']()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),_0x0a9e('0x69'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))['field'](_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x88b25f['params']['id']['toString'](),_0x0a9e('0x54'))[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'createdAt')[_0x0a9e('0x3c')](_0x0a9e('0x6c'),'updatedAt')[_0x0a9e('0x6d')]('cm_contacts')[_0x0a9e('0x36')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x251753[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())[_0x0a9e('0x36')](_0x0a9e('0x6f')))[_0x0a9e('0x6b')]();}_0x401601[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x336a19));}return BPromise[_0x0a9e('0x7b')](_0x401601);}})[_0x0a9e('0x1f')](function(){return _0xea8bd1;})[_0x0a9e('0x1f')](respondWithResult(_0x2ff265,null))[_0x0a9e('0x40')](handleError(_0x2ff265,null));};exports[_0x0a9e('0x7c')]=function(_0x31c937,_0x5312fa,_0x49baaa){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x31c937[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5312fa,null))[_0x0a9e('0x1f')](function(_0xa3695f){if(_0xa3695f){return _0xa3695f[_0x0a9e('0x7c')](_0x31c937[_0x0a9e('0x2d')]['ids']);}})[_0x0a9e('0x1f')](function(_0x59b872){if(_0x59b872){return db['CmHopper'][_0x0a9e('0x20')]({'where':{'ListId':_0x31c937['query'][_0x0a9e('0x60')],'CampaignId':_0x31c937['params']['id']}})['then'](function(){return _0x59b872;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x5312fa,null))['catch'](handleError(_0x5312fa,null));};exports[_0x0a9e('0x7d')]=function(_0x142e53,_0xe1ab0d,_0x48f532){var _0x4152cd={'raw':!![],'where':{}};var _0x1209c4={};var _0x3ea310={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x142e53[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xe1ab0d,null))[_0x0a9e('0x1f')](function(_0x2f79fb){if(_0x2f79fb){_0x1209c4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x7e')][_0x0a9e('0x2a')]);_0x1209c4[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x142e53['query']);_0x1209c4['filters']=_['intersection'](_0x1209c4[_0x0a9e('0x2b')],_0x1209c4[_0x0a9e('0x2d')]);_0x4152cd[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1209c4[_0x0a9e('0x2b')],qs[_0x0a9e('0x43')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x43')]));_0x4152cd['attributes']=_0x4152cd['attributes'][_0x0a9e('0x31')]?_0x4152cd[_0x0a9e('0x30')]:_0x1209c4['model'];if(!_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x32')](_0x0a9e('0x33'))){_0x4152cd[_0x0a9e('0x34')]=qs[_0x0a9e('0x34')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x34')]);_0x4152cd[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x18')]);}_0x4152cd[_0x0a9e('0x5a')]=qs['sort'](_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x35')]);_0x4152cd[_0x0a9e('0x36')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x37')](_0x142e53[_0x0a9e('0x2d')],_0x1209c4[_0x0a9e('0x2e')]));_0x4152cd[_0x0a9e('0x36')][_0x0a9e('0x54')]=_0x2f79fb['id'];if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]){_0x4152cd[_0x0a9e('0x36')]=_['merge'](_0x4152cd['where'],{'$or':_[_0x0a9e('0x39')](_0x4152cd[_0x0a9e('0x30')],function(_0x4545a3){var _0x1ee9d3={};_0x1ee9d3[_0x4545a3]={'$like':'%'+_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x55')]+'%'};return _0x1ee9d3;})});}_0x4152cd=_[_0x0a9e('0x38')]({},_0x4152cd,_0x142e53['options']);return db[_0x0a9e('0x7e')]['count']({'where':_0x4152cd[_0x0a9e('0x36')]})[_0x0a9e('0x1f')](function(_0x1e9f9f){_0x3ea310[_0x0a9e('0x17')]=_0x1e9f9f;if(_0x142e53[_0x0a9e('0x2d')][_0x0a9e('0x3e')]){_0x4152cd[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x7e')][_0x0a9e('0x56')](_0x4152cd);})[_0x0a9e('0x1f')](function(_0x39d367){_0x3ea310[_0x0a9e('0x57')]=_0x39d367;return _0x3ea310;});}})[_0x0a9e('0x1f')](respondWithFilteredResult(_0xe1ab0d,_0x4152cd))[_0x0a9e('0x40')](handleError(_0xe1ab0d,null));};exports[_0x0a9e('0x7f')]=function(_0x2d5e00,_0x5b78a8,_0x54cf62){var _0x9dc1de,_0x410e12;return db['Campaign']['find']({'where':{'id':_0x2d5e00[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b78a8,null))[_0x0a9e('0x1f')](function(_0x596178){if(_0x596178){_0x410e12=_0x596178;return _0x596178[_0x0a9e('0x7f')](_0x2d5e00['body'][_0x0a9e('0x60')],_['omit'](_0x2d5e00[_0x0a9e('0x46')],['ids','id'])||{});}return null;})[_0x0a9e('0x61')](function(_0x21e210){var _0x1d5432;_0x9dc1de=_0x21e210||[];var _0x50e7cc=[];if(_0x21e210){for(var _0x316b51=0x0;_0x316b51<_0x21e210['length'];_0x316b51+=0x1){var _0x505ffd=_0x21e210[_0x316b51][_0x0a9e('0x21')]({'plain':!![]});_0x1d5432=squel[_0x0a9e('0x76')]()[_0x0a9e('0x63')](_0x0a9e('0x80'))[_0x0a9e('0x65')]([_0x0a9e('0x66'),_0x0a9e('0x67'),_0x0a9e('0x68'),_0x0a9e('0x54'),_0x0a9e('0x51'),_0x0a9e('0x50')],squel[_0x0a9e('0x70')]()[_0x0a9e('0x3c')](_0x0a9e('0x66'),_0x0a9e('0x66'))[_0x0a9e('0x3c')]('id',_0x0a9e('0x67'))[_0x0a9e('0x3c')](_0x505ffd[_0x0a9e('0x6a')]['toString'](),_0x0a9e('0x68'))[_0x0a9e('0x3c')](_0x2d5e00[_0x0a9e('0x42')]['id'][_0x0a9e('0x6b')](),'CampaignId')['field']('NOW()',_0x0a9e('0x51'))['field'](_0x0a9e('0x6c'),_0x0a9e('0x50'))[_0x0a9e('0x6d')](_0x0a9e('0x77'))[_0x0a9e('0x36')](_0x0a9e('0x78'))[_0x0a9e('0x36')](_0x0a9e('0x6e'),_0x505ffd[_0x0a9e('0x6a')][_0x0a9e('0x6b')]())['where'](_0x0a9e('0x6f')))['toString']();_0x50e7cc[_0x0a9e('0x7a')](db['sequelize'][_0x0a9e('0x2d')](_0x1d5432));}return BPromise[_0x0a9e('0x7b')](_0x50e7cc);}})[_0x0a9e('0x1f')](function(){return _0x9dc1de;})['then'](respondWithResult(_0x5b78a8,null))[_0x0a9e('0x40')](handleError(_0x5b78a8,null));};exports[_0x0a9e('0x81')]=function(_0x531377,_0x53c4f0,_0x3fab79){return db[_0x0a9e('0x29')][_0x0a9e('0x44')]({'where':{'id':_0x531377['params']['id']}})['then'](handleEntityNotFound(_0x53c4f0,null))['then'](function(_0x374964){if(_0x374964){return _0x374964[_0x0a9e('0x81')](_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')]);}})[_0x0a9e('0x1f')](function(_0x23e6b5){if(_0x23e6b5){return db[_0x0a9e('0x5d')][_0x0a9e('0x20')]({'where':{'ListId':_0x531377[_0x0a9e('0x2d')][_0x0a9e('0x60')],'CampaignId':_0x531377[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](function(){return _0x23e6b5;});}})[_0x0a9e('0x1f')](respondWithStatusCode(_0x53c4f0,null))[_0x0a9e('0x40')](handleError(_0x53c4f0,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index e19d924..f5c10d5 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 _0xd7e9=['lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','Campaign'];(function(_0x3763df,_0x5d4818){var _0x2b732e=function(_0x46acdc){while(--_0x46acdc){_0x3763df['push'](_0x3763df['shift']());}};_0x2b732e(++_0x5d4818);}(_0xd7e9,0xc8));var _0x9d7e=function(_0x399e5a,_0x1a6958){_0x399e5a=_0x399e5a-0x0;var _0x480e80=_0xd7e9[_0x399e5a];return _0x480e80;};'use strict';var _=require(_0x9d7e('0x0'));var util=require(_0x9d7e('0x1'));var logger=require(_0x9d7e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9d7e('0x3'));var rp=require(_0x9d7e('0x4'));var fs=require('fs');var path=require(_0x9d7e('0x5'));var rimraf=require('rimraf');var config=require(_0x9d7e('0x6'));var attributes=require('./campaign.attributes');module[_0x9d7e('0x7')]=function(_0x56ce6d,_0x6a3990){return _0x56ce6d[_0x9d7e('0x8')](_0x9d7e('0x9'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x957a=['path','../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x464d1c,_0x45ca2e){var _0x22d8e8=function(_0x114519){while(--_0x114519){_0x464d1c['push'](_0x464d1c['shift']());}};_0x22d8e8(++_0x45ca2e);}(_0x957a,0x1a7));var _0xa957=function(_0x567b21,_0x1b2eea){_0x567b21=_0x567b21-0x0;var _0x5cfd5a=_0x957a[_0x567b21];return _0x5cfd5a;};'use strict';var _=require(_0xa957('0x0'));var util=require(_0xa957('0x1'));var logger=require(_0xa957('0x2'))(_0xa957('0x3'));var moment=require('moment');var BPromise=require(_0xa957('0x4'));var rp=require(_0xa957('0x5'));var fs=require('fs');var path=require(_0xa957('0x6'));var rimraf=require('rimraf');var config=require(_0xa957('0x7'));var attributes=require(_0xa957('0x8'));module[_0xa957('0x9')]=function(_0x2330b7,_0x465acf){return _0x2330b7[_0xa957('0xa')](_0xa957('0xb'),attributes,{'tableName':_0xa957('0xc'),'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 df51e11..8ee16bb 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x588f79,_0x1230d0){var _0x13f2cc=function(_0x312649){while(--_0x312649){_0x588f79['push'](_0x588f79['shift']());}};_0x13f2cc(++_0x1230d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x5b7903,_0x414d07){var _0x576373=function(_0x1e230b){while(--_0x1e230b){_0x5b7903['push'](_0x5b7903['shift']());}};_0x576373(++_0x414d07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 1931d39..2ccf12a 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 _0x8cda=['getLists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','put','update','delete','destroy','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists'];(function(_0x47abb1,_0x3f5545){var _0x26ef7c=function(_0x1f7d42){while(--_0x1f7d42){_0x47abb1['push'](_0x47abb1['shift']());}};_0x26ef7c(++_0x3f5545);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xa8cd('0x0'));var path=require(_0xa8cd('0x1'));var timeout=require(_0xa8cd('0x2'));var express=require(_0xa8cd('0x3'));var router=express[_0xa8cd('0x4')]();var auth=require(_0xa8cd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa8cd('0x6'));var controller=require(_0xa8cd('0x7'));router[_0xa8cd('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8cd('0x9')]);router[_0xa8cd('0x8')](_0xa8cd('0xa'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0xc')]);router[_0xa8cd('0x8')](_0xa8cd('0xd'),auth[_0xa8cd('0xb')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0xa8cd('0xb')](),controller['getHopperHistories']);router[_0xa8cd('0x8')](_0xa8cd('0xe'),auth['isAuthenticated'](),controller[_0xa8cd('0xf')]);router[_0xa8cd('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xa8cd('0x10')]);router[_0xa8cd('0x8')](_0xa8cd('0x11'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x12')]);router['get'](_0xa8cd('0x13'),auth['isAuthenticated'](),controller[_0xa8cd('0x14')]);router['post']('/',auth[_0xa8cd('0xb')](),controller['create']);router[_0xa8cd('0x15')](_0xa8cd('0x16'),auth[_0xa8cd('0xb')](),controller['clone']);router['post'](_0xa8cd('0x11'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x17')]);router[_0xa8cd('0x15')]('/:id/blacklists',auth[_0xa8cd('0xb')](),controller['addBlackLists']);router[_0xa8cd('0x18')](_0xa8cd('0xa'),auth['isAuthenticated'](),controller[_0xa8cd('0x19')]);router[_0xa8cd('0x1a')]('/:id',auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x1b')]);router[_0xa8cd('0x1a')](_0xa8cd('0x11'),auth[_0xa8cd('0xb')](),controller['removeLists']);router[_0xa8cd('0x1a')](_0xa8cd('0x13'),auth[_0xa8cd('0xb')](),controller[_0xa8cd('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x0268=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','delete','removeBlackLists','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','/:id/hoppers'];(function(_0x1f7b4f,_0x5bffc5){var _0x4c61d0=function(_0x135b0e){while(--_0x135b0e){_0x1f7b4f['push'](_0x1f7b4f['shift']());}};_0x4c61d0(++_0x5bffc5);}(_0x0268,0x17e));var _0x8026=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0268[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x8026('0x0'));var util=require('util');var path=require(_0x8026('0x1'));var timeout=require(_0x8026('0x2'));var express=require('express');var router=express[_0x8026('0x3')]();var auth=require(_0x8026('0x4'));var interaction=require(_0x8026('0x5'));var config=require(_0x8026('0x6'));var controller=require(_0x8026('0x7'));router['get']('/',auth[_0x8026('0x8')](),controller[_0x8026('0x9')]);router['get'](_0x8026('0xa'),auth[_0x8026('0x8')](),controller[_0x8026('0xb')]);router[_0x8026('0xc')](_0x8026('0xd'),auth[_0x8026('0x8')](),controller[_0x8026('0xe')]);router[_0x8026('0xc')](_0x8026('0xf'),auth[_0x8026('0x8')](),controller[_0x8026('0x10')]);router[_0x8026('0xc')](_0x8026('0x11'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x8026('0x12'),auth['isAuthenticated'](),controller[_0x8026('0x13')]);router[_0x8026('0xc')](_0x8026('0x14'),auth[_0x8026('0x8')](),controller[_0x8026('0x15')]);router[_0x8026('0xc')](_0x8026('0x16'),auth[_0x8026('0x8')](),controller[_0x8026('0x17')]);router[_0x8026('0x18')]('/',auth[_0x8026('0x8')](),controller[_0x8026('0x19')]);router[_0x8026('0x18')](_0x8026('0x1a'),auth[_0x8026('0x8')](),controller[_0x8026('0x1b')]);router[_0x8026('0x18')]('/:id/lists',auth['isAuthenticated'](),controller[_0x8026('0x1c')]);router[_0x8026('0x18')](_0x8026('0x16'),auth[_0x8026('0x8')](),controller[_0x8026('0x1d')]);router['put'](_0x8026('0xa'),auth[_0x8026('0x8')](),controller['update']);router[_0x8026('0x1e')](_0x8026('0xa'),auth[_0x8026('0x8')](),controller['destroy']);router['delete'](_0x8026('0x14'),auth[_0x8026('0x8')](),controller['removeLists']);router[_0x8026('0x1e')](_0x8026('0x16'),auth['isAuthenticated'](),controller[_0x8026('0x1f')]);module[_0x8026('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 ee08b65..f08ad5f 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 _0xae1f=['sequelize','exports','STRING','VIRTUAL','key'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0xae1f,0x1b8));var _0xfae1=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0xae1f[_0x5a187b];return _0x14d601;};'use strict';var Sequelize=require(_0xfae1('0x0'));module[_0xfae1('0x1')]={'key':{'type':Sequelize[_0xfae1('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xfae1('0x2')]},'name':{'type':Sequelize[_0xfae1('0x3')],'get':function(){return this['getDataValue'](_0xfae1('0x4'));}}};
\ No newline at end of file
+var _0xd3ff=['sequelize','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x4abe74,_0x5f0c0){var _0x1653f5=function(_0x35de5d){while(--_0x35de5d){_0x4abe74['push'](_0x4abe74['shift']());}};_0x1653f5(++_0x5f0c0);}(_0xd3ff,0x1ce));var _0xfd3f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd3ff[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xfd3f('0x0'));module['exports']={'key':{'type':Sequelize[_0xfd3f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xfd3f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfd3f('0x1')]},'name':{'type':Sequelize[_0xfd3f('0x3')],'get':function(){return this[_0xfd3f('0x4')](_0xfd3f('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d32fe25..93a6bdc 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 _0x832c=['hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','options','findAll','rows','catch','show','params','includeAll','include','find','update','body','create','MailAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','CannedAnswers','sendStatus','stack','name','send','index','CannedAnswer','rawAttributes','model','keys','query','intersection','attributes','fields','length'];(function(_0x1b1ce1,_0x12b132){var _0x4d1645=function(_0x5652a2){while(--_0x5652a2){_0x1b1ce1['push'](_0x1b1ce1['shift']());}};_0x4d1645(++_0x12b132);}(_0x832c,0x193));var _0xc832=function(_0x405599,_0x2db0f5){_0x405599=_0x405599-0x0;var _0x132c5e=_0x832c[_0x405599];return _0x132c5e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc832('0x0'));var rimraf=require(_0xc832('0x1'));var zipdir=require(_0xc832('0x2'));var jsonpatch=require(_0xc832('0x3'));var rp=require(_0xc832('0x4'));var moment=require(_0xc832('0x5'));var BPromise=require(_0xc832('0x6'));var Mustache=require(_0xc832('0x7'));var util=require(_0xc832('0x8'));var path=require(_0xc832('0x9'));var sox=require(_0xc832('0xa'));var csv=require(_0xc832('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc832('0xc'));var crypto=require(_0xc832('0xd'));var jsforce=require(_0xc832('0xe'));var deskjs=require(_0xc832('0xf'));var toCsv=require(_0xc832('0xb'));var querystring=require('querystring');var Papa=require(_0xc832('0x10'));var Redis=require(_0xc832('0x11'));var authService=require(_0xc832('0x12'));var qs=require(_0xc832('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc832('0x14'));var logger=require('../../config/logger')(_0xc832('0x15'));var utils=require(_0xc832('0x16'));var config=require(_0xc832('0x17'));var db=require(_0xc832('0x18'))['db'];function respondWithStatusCode(_0x32daef,_0x456497){_0x456497=_0x456497||0xcc;return function(_0x3ffdd9){if(_0x3ffdd9){return _0x32daef['sendStatus'](_0x456497);}return _0x32daef[_0xc832('0x19')](_0x456497)[_0xc832('0x1a')]();};}function respondWithResult(_0x35475,_0x5b3949){_0x5b3949=_0x5b3949||0xc8;return function(_0x24f974){if(_0x24f974){return _0x35475[_0xc832('0x19')](_0x5b3949)[_0xc832('0x1b')](_0x24f974);}};}function respondWithFilteredResult(_0x33e590,_0x328d21){return function(_0x480d17){if(_0x480d17){var _0x5de658=_0x480d17[_0xc832('0x1c')],_0x303937=_0x328d21[_0xc832('0x1d')],_0x5215fc=_0x328d21[_0xc832('0x1d')]+_0x328d21['limit'],_0x580cdf;if(_0x5215fc>=_0x5de658){_0x5215fc=_0x5de658;_0x580cdf=0xc8;}else{_0x580cdf=0xce;}_0x33e590[_0xc832('0x19')](_0x580cdf);return _0x33e590[_0xc832('0x1e')](_0xc832('0x1f'),_0x303937+'-'+_0x5215fc+'/'+_0x5de658)['json'](_0x480d17);}return null;};}function patchUpdates(_0x4a4385){return function(_0x1ff037){try{jsonpatch[_0xc832('0x20')](_0x1ff037,_0x4a4385,!![]);}catch(_0x11cb26){return BPromise[_0xc832('0x21')](_0x11cb26);}return _0x1ff037[_0xc832('0x22')]();};}function saveUpdates(_0x510ca8,_0x12e2b1){return function(_0x5dc0f2){if(_0x5dc0f2){return _0x5dc0f2['update'](_0x510ca8)[_0xc832('0x23')](function(_0x18bd06){return _0x18bd06;});}return null;};}function removeEntity(_0x3fa08f,_0x80bf05){return function(_0x12cb55){if(_0x12cb55){return _0x12cb55[_0xc832('0x24')]()[_0xc832('0x23')](function(){var _0x15ce93=_0x12cb55['get']({'plain':!![]});var _0x40262a=_0xc832('0x25');return db['UserProfileResource'][_0xc832('0x24')]({'where':{'type':_0x40262a,'resourceId':_0x15ce93['id']}})[_0xc832('0x23')](function(){return _0x12cb55;});})['then'](function(){_0x3fa08f[_0xc832('0x19')](0xcc)[_0xc832('0x1a')]();});}};}function handleEntityNotFound(_0x4b977c,_0x17d264){return function(_0x1ab248){if(!_0x1ab248){_0x4b977c[_0xc832('0x26')](0x194);}return _0x1ab248;};}function handleError(_0x5f4f62,_0x3f0b2e){_0x3f0b2e=_0x3f0b2e||0x1f4;return function(_0x2091fb){logger['error'](_0x2091fb[_0xc832('0x27')]);if(_0x2091fb[_0xc832('0x28')]){delete _0x2091fb[_0xc832('0x28')];}_0x5f4f62['status'](_0x3f0b2e)[_0xc832('0x29')](_0x2091fb);};}exports[_0xc832('0x2a')]=function(_0x38c1b1,_0x4883fa){var _0x4d10fa={},_0x2d1afd={},_0x4151ad={'count':0x0,'rows':[]};var _0x56ef42=db[_0xc832('0x2b')][_0xc832('0x2c')];_0x2d1afd[_0xc832('0x2d')]=_[_0xc832('0x2e')](_0x56ef42);_0x2d1afd[_0xc832('0x2f')]=_['keys'](_0x38c1b1[_0xc832('0x2f')]);_0x2d1afd['filters']=_[_0xc832('0x30')](_0x2d1afd[_0xc832('0x2d')],_0x2d1afd[_0xc832('0x2f')]);_0x4d10fa[_0xc832('0x31')]=_[_0xc832('0x30')](_0x2d1afd[_0xc832('0x2d')],qs[_0xc832('0x32')](_0x38c1b1[_0xc832('0x2f')][_0xc832('0x32')]));_0x4d10fa['attributes']=_0x4d10fa[_0xc832('0x31')][_0xc832('0x33')]?_0x4d10fa[_0xc832('0x31')]:_0x2d1afd[_0xc832('0x2d')];if(!_0x38c1b1['query'][_0xc832('0x34')](_0xc832('0x35'))){_0x4d10fa[_0xc832('0x36')]=qs[_0xc832('0x36')](_0x38c1b1[_0xc832('0x2f')][_0xc832('0x36')]);_0x4d10fa[_0xc832('0x1d')]=qs[_0xc832('0x1d')](_0x38c1b1['query'][_0xc832('0x1d')]);}_0x4d10fa[_0xc832('0x37')]=qs[_0xc832('0x38')](_0x38c1b1['query'][_0xc832('0x38')]);_0x4d10fa[_0xc832('0x39')]=qs[_0xc832('0x3a')](_[_0xc832('0x3b')](_0x38c1b1[_0xc832('0x2f')],_0x2d1afd['filters']));if(_0x38c1b1[_0xc832('0x2f')][_0xc832('0x3c')]){_0x4d10fa['where']=_[_0xc832('0x3d')](_0x4d10fa[_0xc832('0x39')],{'$or':_['map'](_0x56ef42,function(_0x4bcce8){if(_0x4bcce8[_0xc832('0x3e')][_0xc832('0x3f')]!==_0xc832('0x40')){var _0x3a4850={};_0x3a4850[_0x4bcce8[_0xc832('0x41')]]={'$like':'%'+_0x38c1b1[_0xc832('0x2f')][_0xc832('0x3c')]+'%'};return _0x3a4850;}})});}_0x4d10fa=_[_0xc832('0x3d')]({},_0x4d10fa,_0x38c1b1[_0xc832('0x42')]);var _0x21a380={'where':_0x4d10fa['where']};return db[_0xc832('0x2b')][_0xc832('0x1c')](_0x21a380)[_0xc832('0x23')](function(_0x1728b4){_0x4151ad['count']=_0x1728b4;if(_0x38c1b1['query']['includeAll']){_0x4d10fa['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc832('0x43')](_0x4d10fa);})[_0xc832('0x23')](function(_0x4ed064){_0x4151ad[_0xc832('0x44')]=_0x4ed064;return _0x4151ad;})[_0xc832('0x23')](respondWithFilteredResult(_0x4883fa,_0x4d10fa))[_0xc832('0x45')](handleError(_0x4883fa,null));};exports[_0xc832('0x46')]=function(_0x4dbdc0,_0x161ea4){var _0x1e5e2a={'raw':!![],'where':{'id':_0x4dbdc0[_0xc832('0x47')]['id']}},_0x14e020={};_0x14e020[_0xc832('0x2d')]=_['keys'](db[_0xc832('0x2b')]['rawAttributes']);_0x14e020[_0xc832('0x2f')]=_[_0xc832('0x2e')](_0x4dbdc0[_0xc832('0x2f')]);_0x14e020['filters']=_[_0xc832('0x30')](_0x14e020['model'],_0x14e020[_0xc832('0x2f')]);_0x1e5e2a[_0xc832('0x31')]=_['intersection'](_0x14e020['model'],qs[_0xc832('0x32')](_0x4dbdc0[_0xc832('0x2f')][_0xc832('0x32')]));_0x1e5e2a[_0xc832('0x31')]=_0x1e5e2a[_0xc832('0x31')][_0xc832('0x33')]?_0x1e5e2a[_0xc832('0x31')]:_0x14e020['model'];if(_0x4dbdc0['query'][_0xc832('0x48')]){_0x1e5e2a[_0xc832('0x49')]=[{'all':!![]}];}_0x1e5e2a=_[_0xc832('0x3d')]({},_0x1e5e2a,_0x4dbdc0[_0xc832('0x42')]);return db[_0xc832('0x2b')][_0xc832('0x4a')](_0x1e5e2a)[_0xc832('0x23')](handleEntityNotFound(_0x161ea4,null))['then'](respondWithResult(_0x161ea4,null))[_0xc832('0x45')](handleError(_0x161ea4,null));};exports[_0xc832('0x4b')]=function(_0x3c4e58,_0x1eb766){if(_0x3c4e58[_0xc832('0x4c')]['id']){delete _0x3c4e58[_0xc832('0x4c')]['id'];}return db[_0xc832('0x2b')][_0xc832('0x4a')]({'where':{'id':_0x3c4e58[_0xc832('0x47')]['id']}})['then'](handleEntityNotFound(_0x1eb766,null))['then'](saveUpdates(_0x3c4e58[_0xc832('0x4c')],null))[_0xc832('0x23')](respondWithResult(_0x1eb766,null))[_0xc832('0x45')](handleError(_0x1eb766,null));};exports['destroy']=function(_0x4398ed,_0x27e15c){return db['CannedAnswer'][_0xc832('0x4a')]({'where':{'id':_0x4398ed[_0xc832('0x47')]['id']}})[_0xc832('0x23')](handleEntityNotFound(_0x27e15c,null))['then'](removeEntity(_0x27e15c,null))[_0xc832('0x45')](handleError(_0x27e15c,null));};exports[_0xc832('0x4d')]=function(_0xfc2a02,_0x35e0bb){var _0x40fe10={'key':_0xfc2a02['body']['key']};if(_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4e')]){_0x40fe10[_0xc832('0x4e')]=_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4e')];}else if(_0xfc2a02[_0xc832('0x4c')]['SmsAccountId']){_0x40fe10['SmsAccountId']=_0xfc2a02['body']['SmsAccountId'];}else if(_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4f')]){_0x40fe10[_0xc832('0x4f')]=_0xfc2a02[_0xc832('0x4c')][_0xc832('0x4f')];}else if(_0xfc2a02[_0xc832('0x4c')][_0xc832('0x50')]){_0x40fe10[_0xc832('0x50')]=_0xfc2a02[_0xc832('0x4c')][_0xc832('0x50')];}return db[_0xc832('0x2b')][_0xc832('0x4a')]({'where':_0x40fe10})[_0xc832('0x23')](function(_0x13ecdd){if(_0x13ecdd){throw new db[(_0xc832('0x51'))][(_0xc832('0x52'))](_0xc832('0x53'));}return db[_0xc832('0x2b')][_0xc832('0x4d')](_0xfc2a02[_0xc832('0x4c')]);})[_0xc832('0x23')](function(_0x2d4a71){var _0x40ab98=_0xfc2a02[_0xc832('0x54')]['get']({'plain':!![]});if(!_0x40ab98)throw new Error(_0xc832('0x55'));if(_0x40ab98[_0xc832('0x56')]===_0xc832('0x54')){var _0xe0ba4c=_0x2d4a71[_0xc832('0x57')]({'plain':!![]});return db[_0xc832('0x58')][_0xc832('0x4a')]({'where':{'name':_0xc832('0x25'),'userProfileId':_0x40ab98[_0xc832('0x59')]},'raw':!![]})[_0xc832('0x23')](function(_0x3ac2a1){if(_0x3ac2a1&&_0x3ac2a1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xe0ba4c[_0xc832('0x28')],'resourceId':_0xe0ba4c['id'],'type':_0x3ac2a1[_0xc832('0x28')],'sectionId':_0x3ac2a1['id']},{})[_0xc832('0x23')](function(){return _0x2d4a71;});}else{return _0x2d4a71;}})[_0xc832('0x45')](function(_0x3ada8d){logger['error'](_0xc832('0x5a'),_0x3ada8d);throw _0x3ada8d;});}return _0x2d4a71;})[_0xc832('0x23')](respondWithResult(_0x35e0bb,0xc9))['catch'](handleError(_0x35e0bb,null));};
\ No newline at end of file
+var _0x15fe=['filter','merge','options','includeAll','include','CannedAnswer','findAll','rows','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','map','key','field'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x15fe,0x158));var _0xe15f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x15fe[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0xe15f('0x0'));var emlformat=require(_0xe15f('0x1'));var rimraf=require(_0xe15f('0x2'));var zipdir=require(_0xe15f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe15f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe15f('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe15f('0x6'));var csv=require(_0xe15f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe15f('0x8'));var squel=require(_0xe15f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe15f('0xa'));var toCsv=require(_0xe15f('0x7'));var querystring=require(_0xe15f('0xb'));var Papa=require('papaparse');var Redis=require(_0xe15f('0xc'));var authService=require(_0xe15f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe15f('0xe'));var hardwareService=require(_0xe15f('0xf'));var logger=require('../../config/logger')(_0xe15f('0x10'));var utils=require('../../config/utils');var config=require(_0xe15f('0x11'));var db=require(_0xe15f('0x12'))['db'];function respondWithStatusCode(_0x34b0d8,_0x2c7d78){_0x2c7d78=_0x2c7d78||0xcc;return function(_0x476914){if(_0x476914){return _0x34b0d8[_0xe15f('0x13')](_0x2c7d78);}return _0x34b0d8[_0xe15f('0x14')](_0x2c7d78)[_0xe15f('0x15')]();};}function respondWithResult(_0x181d9c,_0x152812){_0x152812=_0x152812||0xc8;return function(_0xb371fc){if(_0xb371fc){return _0x181d9c['status'](_0x152812)['json'](_0xb371fc);}};}function respondWithFilteredResult(_0x1d5fa6,_0x37d7cd){return function(_0x3b1c3e){if(_0x3b1c3e){var _0x4eebfc=_0x3b1c3e[_0xe15f('0x16')],_0x12225d=_0x37d7cd[_0xe15f('0x17')],_0x582589=_0x37d7cd['offset']+_0x37d7cd['limit'],_0x16d48d;if(_0x582589>=_0x4eebfc){_0x582589=_0x4eebfc;_0x16d48d=0xc8;}else{_0x16d48d=0xce;}_0x1d5fa6[_0xe15f('0x14')](_0x16d48d);return _0x1d5fa6[_0xe15f('0x18')](_0xe15f('0x19'),_0x12225d+'-'+_0x582589+'/'+_0x4eebfc)[_0xe15f('0x1a')](_0x3b1c3e);}return null;};}function patchUpdates(_0x56c684){return function(_0x4e3eca){try{jsonpatch[_0xe15f('0x1b')](_0x4e3eca,_0x56c684,!![]);}catch(_0x260963){return BPromise[_0xe15f('0x1c')](_0x260963);}return _0x4e3eca[_0xe15f('0x1d')]();};}function saveUpdates(_0x9e8a8d,_0x4c5d4c){return function(_0x48c732){if(_0x48c732){return _0x48c732[_0xe15f('0x1e')](_0x9e8a8d)['then'](function(_0x5eaa45){return _0x5eaa45;});}return null;};}function removeEntity(_0x2b03a8,_0x1e72fc){return function(_0x3d4f4a){if(_0x3d4f4a){return _0x3d4f4a[_0xe15f('0x1f')]()[_0xe15f('0x20')](function(){var _0x18dede=_0x3d4f4a[_0xe15f('0x21')]({'plain':!![]});var _0x1e1713=_0xe15f('0x22');return db[_0xe15f('0x23')][_0xe15f('0x1f')]({'where':{'type':_0x1e1713,'resourceId':_0x18dede['id']}})[_0xe15f('0x20')](function(){return _0x3d4f4a;});})['then'](function(){_0x2b03a8[_0xe15f('0x14')](0xcc)[_0xe15f('0x15')]();});}};}function handleEntityNotFound(_0x2f6cd8,_0x519dda){return function(_0x18f3c7){if(!_0x18f3c7){_0x2f6cd8[_0xe15f('0x13')](0x194);}return _0x18f3c7;};}function handleError(_0x1b7454,_0x242992){_0x242992=_0x242992||0x1f4;return function(_0x54e311){logger[_0xe15f('0x24')](_0x54e311[_0xe15f('0x25')]);if(_0x54e311[_0xe15f('0x26')]){delete _0x54e311[_0xe15f('0x26')];}_0x1b7454[_0xe15f('0x14')](_0x242992)['send'](_0x54e311);};}exports[_0xe15f('0x27')]=function(_0x5be920,_0x55e91e){var _0x360e35={},_0x28b610={},_0x5b66eb={'count':0x0,'rows':[]};var _0x5030aa=db['CannedAnswer']['rawAttributes'];_0x28b610[_0xe15f('0x28')]=_[_0xe15f('0x29')](_0x5030aa);_0x28b610[_0xe15f('0x2a')]=_['keys'](_0x5be920[_0xe15f('0x2a')]);_0x28b610[_0xe15f('0x2b')]=_[_0xe15f('0x2c')](_0x28b610[_0xe15f('0x28')],_0x28b610[_0xe15f('0x2a')]);_0x360e35[_0xe15f('0x2d')]=_[_0xe15f('0x2c')](_0x28b610[_0xe15f('0x28')],qs[_0xe15f('0x2e')](_0x5be920['query'][_0xe15f('0x2e')]));_0x360e35[_0xe15f('0x2d')]=_0x360e35[_0xe15f('0x2d')]['length']?_0x360e35[_0xe15f('0x2d')]:_0x28b610[_0xe15f('0x28')];if(!_0x5be920[_0xe15f('0x2a')][_0xe15f('0x2f')](_0xe15f('0x30'))){_0x360e35[_0xe15f('0x31')]=qs['limit'](_0x5be920[_0xe15f('0x2a')]['limit']);_0x360e35[_0xe15f('0x17')]=qs[_0xe15f('0x17')](_0x5be920[_0xe15f('0x2a')][_0xe15f('0x17')]);}_0x360e35[_0xe15f('0x32')]=qs['sort'](_0x5be920[_0xe15f('0x2a')]['sort']);_0x360e35[_0xe15f('0x33')]=qs[_0xe15f('0x2b')](_[_0xe15f('0x34')](_0x5be920[_0xe15f('0x2a')],_0x28b610['filters']));if(_0x5be920[_0xe15f('0x2a')]['filter']){_0x360e35[_0xe15f('0x33')]=_['merge'](_0x360e35[_0xe15f('0x33')],{'$or':_[_0xe15f('0x35')](_0x5030aa,function(_0x5d31e9){if(_0x5d31e9['type'][_0xe15f('0x36')]!=='VIRTUAL'){var _0x1fb0a0={};_0x1fb0a0[_0x5d31e9[_0xe15f('0x37')]]={'$like':'%'+_0x5be920[_0xe15f('0x2a')][_0xe15f('0x38')]+'%'};return _0x1fb0a0;}})});}_0x360e35=_[_0xe15f('0x39')]({},_0x360e35,_0x5be920[_0xe15f('0x3a')]);var _0x31c875={'where':_0x360e35[_0xe15f('0x33')]};return db['CannedAnswer'][_0xe15f('0x16')](_0x31c875)[_0xe15f('0x20')](function(_0x3dbc87){_0x5b66eb[_0xe15f('0x16')]=_0x3dbc87;if(_0x5be920[_0xe15f('0x2a')][_0xe15f('0x3b')]){_0x360e35[_0xe15f('0x3c')]=[{'all':!![]}];}return db[_0xe15f('0x3d')][_0xe15f('0x3e')](_0x360e35);})['then'](function(_0x290de1){_0x5b66eb[_0xe15f('0x3f')]=_0x290de1;return _0x5b66eb;})[_0xe15f('0x20')](respondWithFilteredResult(_0x55e91e,_0x360e35))[_0xe15f('0x40')](handleError(_0x55e91e,null));};exports[_0xe15f('0x41')]=function(_0x3efafb,_0x1179ec){var _0x441c0d={'raw':!![],'where':{'id':_0x3efafb[_0xe15f('0x42')]['id']}},_0x44d8d5={};_0x44d8d5['model']=_[_0xe15f('0x29')](db[_0xe15f('0x3d')][_0xe15f('0x43')]);_0x44d8d5[_0xe15f('0x2a')]=_[_0xe15f('0x29')](_0x3efafb[_0xe15f('0x2a')]);_0x44d8d5[_0xe15f('0x2b')]=_[_0xe15f('0x2c')](_0x44d8d5[_0xe15f('0x28')],_0x44d8d5['query']);_0x441c0d['attributes']=_[_0xe15f('0x2c')](_0x44d8d5[_0xe15f('0x28')],qs[_0xe15f('0x2e')](_0x3efafb[_0xe15f('0x2a')][_0xe15f('0x2e')]));_0x441c0d[_0xe15f('0x2d')]=_0x441c0d['attributes']['length']?_0x441c0d['attributes']:_0x44d8d5['model'];if(_0x3efafb[_0xe15f('0x2a')]['includeAll']){_0x441c0d[_0xe15f('0x3c')]=[{'all':!![]}];}_0x441c0d=_[_0xe15f('0x39')]({},_0x441c0d,_0x3efafb['options']);return db[_0xe15f('0x3d')][_0xe15f('0x44')](_0x441c0d)['then'](handleEntityNotFound(_0x1179ec,null))[_0xe15f('0x20')](respondWithResult(_0x1179ec,null))[_0xe15f('0x40')](handleError(_0x1179ec,null));};exports['update']=function(_0x2eebb5,_0x2eaaca){if(_0x2eebb5[_0xe15f('0x45')]['id']){delete _0x2eebb5['body']['id'];}return db[_0xe15f('0x3d')][_0xe15f('0x44')]({'where':{'id':_0x2eebb5[_0xe15f('0x42')]['id']}})[_0xe15f('0x20')](handleEntityNotFound(_0x2eaaca,null))[_0xe15f('0x20')](saveUpdates(_0x2eebb5[_0xe15f('0x45')],null))[_0xe15f('0x20')](respondWithResult(_0x2eaaca,null))[_0xe15f('0x40')](handleError(_0x2eaaca,null));};exports['destroy']=function(_0x159f56,_0x1de5aa){return db[_0xe15f('0x3d')]['find']({'where':{'id':_0x159f56[_0xe15f('0x42')]['id']}})[_0xe15f('0x20')](handleEntityNotFound(_0x1de5aa,null))[_0xe15f('0x20')](removeEntity(_0x1de5aa,null))[_0xe15f('0x40')](handleError(_0x1de5aa,null));};exports[_0xe15f('0x46')]=function(_0x193d52,_0xf64884){var _0x184e6f={'key':_0x193d52[_0xe15f('0x45')][_0xe15f('0x36')]};if(_0x193d52[_0xe15f('0x45')]['MailAccountId']){_0x184e6f[_0xe15f('0x47')]=_0x193d52[_0xe15f('0x45')][_0xe15f('0x47')];}else if(_0x193d52['body'][_0xe15f('0x48')]){_0x184e6f[_0xe15f('0x48')]=_0x193d52[_0xe15f('0x45')][_0xe15f('0x48')];}else if(_0x193d52[_0xe15f('0x45')][_0xe15f('0x49')]){_0x184e6f['OpenchannelAccountId']=_0x193d52[_0xe15f('0x45')]['OpenchannelAccountId'];}else if(_0x193d52[_0xe15f('0x45')][_0xe15f('0x4a')]){_0x184e6f[_0xe15f('0x4a')]=_0x193d52[_0xe15f('0x45')][_0xe15f('0x4a')];}return db[_0xe15f('0x3d')][_0xe15f('0x44')]({'where':_0x184e6f})['then'](function(_0xc2f976){if(_0xc2f976){throw new db[(_0xe15f('0x4b'))]['ValidationError'](_0xe15f('0x4c'));}return db[_0xe15f('0x3d')][_0xe15f('0x46')](_0x193d52[_0xe15f('0x45')]);})[_0xe15f('0x20')](function(_0x153c6e){var _0x1250cc=_0x193d52[_0xe15f('0x4d')]['get']({'plain':!![]});if(!_0x1250cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1250cc['role']===_0xe15f('0x4d')){var _0x396432=_0x153c6e[_0xe15f('0x21')]({'plain':!![]});return db[_0xe15f('0x4e')]['find']({'where':{'name':_0xe15f('0x22'),'userProfileId':_0x1250cc['userProfileId']},'raw':!![]})[_0xe15f('0x20')](function(_0x49e0ae){if(_0x49e0ae&&_0x49e0ae['autoAssociation']===0x0){return db[_0xe15f('0x23')][_0xe15f('0x46')]({'name':_0x396432['name'],'resourceId':_0x396432['id'],'type':_0x49e0ae[_0xe15f('0x26')],'sectionId':_0x49e0ae['id']},{})[_0xe15f('0x20')](function(){return _0x153c6e;});}else{return _0x153c6e;}})[_0xe15f('0x40')](function(_0x28d3a4){logger[_0xe15f('0x24')](_0xe15f('0x4f'),_0x28d3a4);throw _0x28d3a4;});}return _0x153c6e;})[_0xe15f('0x20')](respondWithResult(_0xf64884,0xc9))[_0xe15f('0x40')](handleError(_0xf64884,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 4ac6854..158a7c8 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 _0x62cc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0x62cc,0xb1));var _0xc62c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62cc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc62c('0x0'));var util=require(_0xc62c('0x1'));var logger=require(_0xc62c('0x2'))(_0xc62c('0x3'));var moment=require(_0xc62c('0x4'));var BPromise=require(_0xc62c('0x5'));var rp=require(_0xc62c('0x6'));var fs=require('fs');var path=require(_0xc62c('0x7'));var rimraf=require(_0xc62c('0x8'));var config=require(_0xc62c('0x9'));var attributes=require(_0xc62c('0xa'));module[_0xc62c('0xb')]=function(_0x11ffef,_0x5c21e0){return _0x11ffef['define'](_0xc62c('0xc'),attributes,{'tableName':_0xc62c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc62c('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe418=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe418,0x73));var _0x8e41=function(_0x4f9423,_0x31aeb9){_0x4f9423=_0x4f9423-0x0;var _0x41799c=_0xe418[_0x4f9423];return _0x41799c;};'use strict';var _=require('lodash');var util=require(_0x8e41('0x0'));var logger=require('../../config/logger')(_0x8e41('0x1'));var moment=require(_0x8e41('0x2'));var BPromise=require(_0x8e41('0x3'));var rp=require(_0x8e41('0x4'));var fs=require('fs');var path=require(_0x8e41('0x5'));var rimraf=require(_0x8e41('0x6'));var config=require(_0x8e41('0x7'));var attributes=require(_0x8e41('0x8'));module[_0x8e41('0x9')]=function(_0x4b2f29,_0x4aad81){return _0x4b2f29[_0x8e41('0xa')](_0x8e41('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e41('0xc'),'collate':_0x8e41('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 3a7d22d..4307085 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 _0xb5b2=['catch','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0xb5b2,0xa3));var _0x2b5b=function(_0x491efd,_0xcec819){_0x491efd=_0x491efd-0x0;var _0x439bbc=_0xb5b2[_0x491efd];return _0x439bbc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b5b('0x0'));var rs=require(_0x2b5b('0x1'));var fs=require('fs');var Redis=require(_0x2b5b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2b5b('0x3'))('rpc');var config=require(_0x2b5b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x2b5b('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4db4e2,_0x151f18,_0x538faf){return new BPromise(function(_0x190f30,_0x2bea7a){return client['request'](_0x4db4e2,_0x538faf)[_0x2b5b('0x6')](function(_0x3d91c8){logger[_0x2b5b('0x7')]('CannedAnswer,\x20%s,\x20%s',_0x151f18,_0x2b5b('0x8'));logger[_0x2b5b('0x9')](_0x2b5b('0xa'),_0x151f18,_0x2b5b('0x8'),JSON[_0x2b5b('0xb')](_0x3d91c8));if(_0x3d91c8[_0x2b5b('0xc')]){if(_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xd')]===0x1f4){logger['error'](_0x2b5b('0xe'),_0x151f18,_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);return _0x2bea7a(_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);}logger[_0x2b5b('0xc')](_0x2b5b('0xe'),_0x151f18,_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);return _0x190f30(_0x3d91c8[_0x2b5b('0xc')][_0x2b5b('0xf')]);}else{logger['info'](_0x2b5b('0xe'),_0x151f18,_0x2b5b('0x8'));_0x190f30(_0x3d91c8[_0x2b5b('0x10')][_0x2b5b('0xf')]);}})[_0x2b5b('0x11')](function(_0x188000){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x151f18,_0x188000);_0x2bea7a(_0x188000);});});}
\ No newline at end of file
+var _0xc451=['error','code','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xc451,0xf5));var _0x1c45=function(_0x4166fc,_0x4fa546){_0x4166fc=_0x4166fc-0x0;var _0x362aec=_0xc451[_0x4166fc];return _0x362aec;};'use strict';var _=require('lodash');var util=require(_0x1c45('0x0'));var moment=require(_0x1c45('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c45('0x2'));var fs=require('fs');var Redis=require(_0x1c45('0x3'));var db=require(_0x1c45('0x4'))['db'];var utils=require(_0x1c45('0x5'));var logger=require(_0x1c45('0x6'))(_0x1c45('0x7'));var config=require(_0x1c45('0x8'));var jayson=require(_0x1c45('0x9'));var client=jayson[_0x1c45('0xa')][_0x1c45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x337aaf,_0x7fe166,_0x56fb25){return new BPromise(function(_0x113c45,_0x2ba921){return client[_0x1c45('0xc')](_0x337aaf,_0x56fb25)[_0x1c45('0xd')](function(_0x99ead6){logger['info'](_0x1c45('0xe'),_0x7fe166,_0x1c45('0xf'));logger[_0x1c45('0x10')](_0x1c45('0x11'),_0x7fe166,_0x1c45('0xf'),JSON[_0x1c45('0x12')](_0x99ead6));if(_0x99ead6[_0x1c45('0x13')]){if(_0x99ead6['error'][_0x1c45('0x14')]===0x1f4){logger[_0x1c45('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x7fe166,_0x99ead6[_0x1c45('0x13')][_0x1c45('0x15')]);return _0x2ba921(_0x99ead6[_0x1c45('0x13')][_0x1c45('0x15')]);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x7fe166,_0x99ead6[_0x1c45('0x13')][_0x1c45('0x15')]);return _0x113c45(_0x99ead6['error']['message']);}else{logger[_0x1c45('0x16')](_0x1c45('0xe'),_0x7fe166,_0x1c45('0xf'));_0x113c45(_0x99ead6['result'][_0x1c45('0x15')]);}})[_0x1c45('0x17')](function(_0x185689){logger[_0x1c45('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x7fe166,_0x185689);_0x2ba921(_0x185689);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index b00e95c..6ebfcfd 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 _0x44b6=['get','show','post','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index'];(function(_0x5c4423,_0x4043a9){var _0x38e00b=function(_0x497312){while(--_0x497312){_0x5c4423['push'](_0x5c4423['shift']());}};_0x38e00b(++_0x4043a9);}(_0x44b6,0x14c));var _0x644b=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0x44b6[_0x4c32f5];return _0x19cae9;};'use strict';var multer=require(_0x644b('0x0'));var util=require('util');var path=require(_0x644b('0x1'));var timeout=require(_0x644b('0x2'));var express=require(_0x644b('0x3'));var router=express[_0x644b('0x4')]();var auth=require(_0x644b('0x5'));var interaction=require(_0x644b('0x6'));var config=require('../../config/environment');var controller=require(_0x644b('0x7'));router['get']('/',auth[_0x644b('0x8')](),controller[_0x644b('0x9')]);router[_0x644b('0xa')]('/:id',auth[_0x644b('0x8')](),controller[_0x644b('0xb')]);router[_0x644b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x644b('0xd')](_0x644b('0xe'),auth[_0x644b('0x8')](),controller['update']);router[_0x644b('0xf')](_0x644b('0xe'),auth['isAuthenticated'](),controller[_0x644b('0x10')]);module[_0x644b('0x11')]=router;
\ No newline at end of file
+var _0x01f7=['put','isAuthenticated','update','delete','multer','path','connect-timeout','express','Router','../../config/environment','./cannedAnswer.controller','get','index','/:id','show','post'];(function(_0x5892ff,_0x3d75ea){var _0x54b137=function(_0x51187b){while(--_0x51187b){_0x5892ff['push'](_0x5892ff['shift']());}};_0x54b137(++_0x3d75ea);}(_0x01f7,0x194));var _0x701f=function(_0x5484cf,_0x153f52){_0x5484cf=_0x5484cf-0x0;var _0x5b7de7=_0x01f7[_0x5484cf];return _0x5b7de7;};'use strict';var multer=require(_0x701f('0x0'));var util=require('util');var path=require(_0x701f('0x1'));var timeout=require(_0x701f('0x2'));var express=require(_0x701f('0x3'));var router=express[_0x701f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x701f('0x5'));var controller=require(_0x701f('0x6'));router[_0x701f('0x7')]('/',auth['isAuthenticated'](),controller[_0x701f('0x8')]);router[_0x701f('0x7')](_0x701f('0x9'),auth['isAuthenticated'](),controller[_0x701f('0xa')]);router[_0x701f('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x701f('0xc')]('/:id',auth[_0x701f('0xd')](),controller[_0x701f('0xe')]);router[_0x701f('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 023a27e..43efd67 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 _0x0f1f=['sequelize','DATE','STRING','INTEGER'];(function(_0x52c8db,_0x3b313a){var _0x4bd7d2=function(_0x4215e1){while(--_0x4215e1){_0x52c8db['push'](_0x52c8db['shift']());}};_0x4bd7d2(++_0x3b313a);}(_0x0f1f,0x12c));var _0xf0f1=function(_0x220fd6,_0x1b5525){_0x220fd6=_0x220fd6-0x0;var _0x176722=_0x0f1f[_0x220fd6];return _0x176722;};'use strict';var Sequelize=require(_0xf0f1('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xf0f1('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xf0f1('0x2')]},'src':{'type':Sequelize[_0xf0f1('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf0f1('0x2')]},'dstchannel':{'type':Sequelize[_0xf0f1('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf0f1('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf0f1('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf0f1('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf0f1('0x2')]},'userfield':{'type':Sequelize[_0xf0f1('0x2')]},'uniqueid':{'type':Sequelize[_0xf0f1('0x2')]},'linkedid':{'type':Sequelize[_0xf0f1('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xf0f1('0x2')]},'type':{'type':Sequelize[_0xf0f1('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xde5b=['STRING','INTEGER','1970-01-01\x2000:00:01'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde5b,0x11f));var _0xbde5=function(_0x2e93a9,_0x1cf12b){_0x2e93a9=_0x2e93a9-0x0;var _0x57375d=_0xde5b[_0x2e93a9];return _0x57375d;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xbde5('0x0')},'clid':{'type':Sequelize[_0xbde5('0x1')]},'src':{'type':Sequelize[_0xbde5('0x1')]},'dst':{'type':Sequelize[_0xbde5('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbde5('0x1')]},'dstchannel':{'type':Sequelize[_0xbde5('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbde5('0x1')]},'duration':{'type':Sequelize[_0xbde5('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbde5('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbde5('0x1')]},'amaflags':{'type':Sequelize[_0xbde5('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbde5('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xbde5('0x1')]},'sequence':{'type':Sequelize[_0xbde5('0x1')]},'peeraccount':{'type':Sequelize[_0xbde5('0x1')]},'type':{'type':Sequelize[_0xbde5('0x1')]},'tag':{'type':Sequelize[_0xbde5('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index dd8e4d5..1863271 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 _0xfbc2=['name','send','index','Cdr','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','type','key','VIRTUAL','options','includeAll','rows','show','params','include','merge','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','update','then','destroy','error'];(function(_0x30fd21,_0x243160){var _0x9b474a=function(_0x20f2b2){while(--_0x20f2b2){_0x30fd21['push'](_0x30fd21['shift']());}};_0x9b474a(++_0x243160);}(_0xfbc2,0xee));var _0x2fbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfbc2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2fbc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2fbc('0x1'));var zipdir=require(_0x2fbc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2fbc('0x3'));var moment=require(_0x2fbc('0x4'));var BPromise=require(_0x2fbc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2fbc('0x6'));var csv=require(_0x2fbc('0x7'));var ejs=require(_0x2fbc('0x8'));var fs=require('fs');var _=require(_0x2fbc('0x9'));var squel=require(_0x2fbc('0xa'));var crypto=require(_0x2fbc('0xb'));var jsforce=require(_0x2fbc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2fbc('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2fbc('0xd'));var authService=require(_0x2fbc('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2fbc('0xf'));var logger=require('../../config/logger')(_0x2fbc('0x10'));var utils=require('../../config/utils');var config=require(_0x2fbc('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41e42a,_0x5cad47){_0x5cad47=_0x5cad47||0xcc;return function(_0x28c85d){if(_0x28c85d){return _0x41e42a[_0x2fbc('0x12')](_0x5cad47);}return _0x41e42a[_0x2fbc('0x13')](_0x5cad47)[_0x2fbc('0x14')]();};}function respondWithResult(_0x56f9fb,_0x29db66){_0x29db66=_0x29db66||0xc8;return function(_0x9bf37a){if(_0x9bf37a){return _0x56f9fb[_0x2fbc('0x13')](_0x29db66)['json'](_0x9bf37a);}};}function respondWithFilteredResult(_0x1bbb3b,_0x2b84ec){return function(_0x55ed49){if(_0x55ed49){var _0x369b33=_0x55ed49[_0x2fbc('0x15')],_0x360ce7=_0x2b84ec['offset'],_0x5638be=_0x2b84ec[_0x2fbc('0x16')]+_0x2b84ec['limit'],_0x47db45;if(_0x5638be>=_0x369b33){_0x5638be=_0x369b33;_0x47db45=0xc8;}else{_0x47db45=0xce;}_0x1bbb3b['status'](_0x47db45);return _0x1bbb3b[_0x2fbc('0x17')](_0x2fbc('0x18'),_0x360ce7+'-'+_0x5638be+'/'+_0x369b33)[_0x2fbc('0x19')](_0x55ed49);}return null;};}function patchUpdates(_0x3b85ba){return function(_0x18d115){try{jsonpatch['apply'](_0x18d115,_0x3b85ba,!![]);}catch(_0x1f48d4){return BPromise['reject'](_0x1f48d4);}return _0x18d115['save']();};}function saveUpdates(_0x1dbe62,_0xcbd7db){return function(_0xe5fff1){if(_0xe5fff1){return _0xe5fff1[_0x2fbc('0x1a')](_0x1dbe62)[_0x2fbc('0x1b')](function(_0x5848e1){return _0x5848e1;});}return null;};}function removeEntity(_0x5cceff,_0xdc2156){return function(_0x4d63d1){if(_0x4d63d1){return _0x4d63d1[_0x2fbc('0x1c')]()[_0x2fbc('0x1b')](function(){_0x5cceff[_0x2fbc('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58d0ce,_0x87c829){return function(_0xdcb9c2){if(!_0xdcb9c2){_0x58d0ce[_0x2fbc('0x12')](0x194);}return _0xdcb9c2;};}function handleError(_0x2f3ba9,_0x4a1e18){_0x4a1e18=_0x4a1e18||0x1f4;return function(_0x15e615){logger[_0x2fbc('0x1d')](_0x15e615['stack']);if(_0x15e615[_0x2fbc('0x1e')]){delete _0x15e615[_0x2fbc('0x1e')];}_0x2f3ba9['status'](_0x4a1e18)[_0x2fbc('0x1f')](_0x15e615);};}exports[_0x2fbc('0x20')]=function(_0xefbaf9,_0x1d37d3){var _0x6ae230={},_0x45ab53={},_0x37d67f={'count':0x0,'rows':[]};var _0x334369=db[_0x2fbc('0x21')][_0x2fbc('0x22')];_0x45ab53[_0x2fbc('0x23')]=_[_0x2fbc('0x24')](_0x334369);_0x45ab53[_0x2fbc('0x25')]=_[_0x2fbc('0x24')](_0xefbaf9[_0x2fbc('0x25')]);_0x45ab53[_0x2fbc('0x26')]=_[_0x2fbc('0x27')](_0x45ab53['model'],_0x45ab53[_0x2fbc('0x25')]);_0x6ae230[_0x2fbc('0x28')]=_[_0x2fbc('0x27')](_0x45ab53[_0x2fbc('0x23')],qs[_0x2fbc('0x29')](_0xefbaf9['query'][_0x2fbc('0x29')]));_0x6ae230[_0x2fbc('0x28')]=_0x6ae230[_0x2fbc('0x28')][_0x2fbc('0x2a')]?_0x6ae230[_0x2fbc('0x28')]:_0x45ab53['model'];if(!_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x2b')](_0x2fbc('0x2c'))){_0x6ae230[_0x2fbc('0x2d')]=qs['limit'](_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x2d')]);_0x6ae230[_0x2fbc('0x16')]=qs[_0x2fbc('0x16')](_0xefbaf9['query'][_0x2fbc('0x16')]);}_0x6ae230[_0x2fbc('0x2e')]=qs[_0x2fbc('0x2f')](_0xefbaf9[_0x2fbc('0x25')]['sort']);_0x6ae230['where']=qs['filters'](_[_0x2fbc('0x30')](_0xefbaf9['query'],_0x45ab53[_0x2fbc('0x26')]));if(_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x31')]){_0x6ae230[_0x2fbc('0x32')]=_['merge'](_0x6ae230['where'],{'$or':_[_0x2fbc('0x33')](_0x334369,function(_0x163689){if(_0x163689[_0x2fbc('0x34')][_0x2fbc('0x35')]!==_0x2fbc('0x36')){var _0x1dd050={};_0x1dd050[_0x163689['field']]={'$like':'%'+_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x31')]+'%'};return _0x1dd050;}})});}_0x6ae230=_['merge']({},_0x6ae230,_0xefbaf9[_0x2fbc('0x37')]);var _0x4fe52c={'where':_0x6ae230['where']};return db[_0x2fbc('0x21')][_0x2fbc('0x15')](_0x4fe52c)[_0x2fbc('0x1b')](function(_0x94f2fe){_0x37d67f[_0x2fbc('0x15')]=_0x94f2fe;if(_0xefbaf9[_0x2fbc('0x25')][_0x2fbc('0x38')]){_0x6ae230['include']=[{'all':!![]}];}return db[_0x2fbc('0x21')]['findAll'](_0x6ae230);})[_0x2fbc('0x1b')](function(_0x5de350){_0x37d67f[_0x2fbc('0x39')]=_0x5de350;return _0x37d67f;})[_0x2fbc('0x1b')](respondWithFilteredResult(_0x1d37d3,_0x6ae230))['catch'](handleError(_0x1d37d3,null));};exports[_0x2fbc('0x3a')]=function(_0x522d70,_0x5a9464){var _0xb003e5={'raw':!![],'where':{'id':_0x522d70[_0x2fbc('0x3b')]['id']}},_0x4b1aed={};_0x4b1aed[_0x2fbc('0x23')]=_[_0x2fbc('0x24')](db[_0x2fbc('0x21')][_0x2fbc('0x22')]);_0x4b1aed[_0x2fbc('0x25')]=_[_0x2fbc('0x24')](_0x522d70[_0x2fbc('0x25')]);_0x4b1aed[_0x2fbc('0x26')]=_[_0x2fbc('0x27')](_0x4b1aed['model'],_0x4b1aed[_0x2fbc('0x25')]);_0xb003e5[_0x2fbc('0x28')]=_[_0x2fbc('0x27')](_0x4b1aed[_0x2fbc('0x23')],qs[_0x2fbc('0x29')](_0x522d70['query'][_0x2fbc('0x29')]));_0xb003e5['attributes']=_0xb003e5[_0x2fbc('0x28')][_0x2fbc('0x2a')]?_0xb003e5[_0x2fbc('0x28')]:_0x4b1aed[_0x2fbc('0x23')];if(_0x522d70['query'][_0x2fbc('0x38')]){_0xb003e5[_0x2fbc('0x3c')]=[{'all':!![]}];}_0xb003e5=_[_0x2fbc('0x3d')]({},_0xb003e5,_0x522d70[_0x2fbc('0x37')]);return db[_0x2fbc('0x21')][_0x2fbc('0x3e')](_0xb003e5)[_0x2fbc('0x1b')](handleEntityNotFound(_0x5a9464,null))[_0x2fbc('0x1b')](respondWithResult(_0x5a9464,null))[_0x2fbc('0x3f')](handleError(_0x5a9464,null));};exports[_0x2fbc('0x40')]=function(_0x3a7be8,_0x5db50f){return db[_0x2fbc('0x21')][_0x2fbc('0x40')](_0x3a7be8[_0x2fbc('0x41')],{})[_0x2fbc('0x1b')](respondWithResult(_0x5db50f,0xc9))[_0x2fbc('0x3f')](handleError(_0x5db50f,null));};exports['update']=function(_0x2bcdba,_0xbaa65d){if(_0x2bcdba[_0x2fbc('0x41')]['id']){delete _0x2bcdba[_0x2fbc('0x41')]['id'];}return db['Cdr']['find']({'where':{'id':_0x2bcdba[_0x2fbc('0x3b')]['id']}})['then'](handleEntityNotFound(_0xbaa65d,null))[_0x2fbc('0x1b')](saveUpdates(_0x2bcdba[_0x2fbc('0x41')],null))[_0x2fbc('0x1b')](respondWithResult(_0xbaa65d,null))['catch'](handleError(_0xbaa65d,null));};exports['destroy']=function(_0x5dd54b,_0x2ecd39){return db[_0x2fbc('0x21')][_0x2fbc('0x3e')]({'where':{'id':_0x5dd54b['params']['id']}})[_0x2fbc('0x1b')](handleEntityNotFound(_0x2ecd39,null))[_0x2fbc('0x1b')](removeEntity(_0x2ecd39,null))[_0x2fbc('0x3f')](handleError(_0x2ecd39,null));};exports[_0x2fbc('0x42')]=function(_0x2cbe13,_0x39f402){return db[_0x2fbc('0x21')][_0x2fbc('0x42')]()[_0x2fbc('0x1b')](respondWithResult(_0x39f402,null))[_0x2fbc('0x3f')](handleError(_0x39f402,null));};
\ No newline at end of file
+var _0xec36=['offset','Content-Range','reject','save','then','destroy','error','name','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','VIRTUAL','merge','Cdr','include','findAll','catch','show','params','rawAttributes','includeAll','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x34a223,_0x4704d2){var _0x19cbf0=function(_0x8a82b1){while(--_0x8a82b1){_0x34a223['push'](_0x34a223['shift']());}};_0x19cbf0(++_0x4704d2);}(_0xec36,0xb7));var _0x6ec3=function(_0x54a761,_0x431fd4){_0x54a761=_0x54a761-0x0;var _0x37d1da=_0xec36[_0x54a761];return _0x37d1da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6ec3('0x0'));var rimraf=require(_0x6ec3('0x1'));var zipdir=require(_0x6ec3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ec3('0x3'));var moment=require(_0x6ec3('0x4'));var BPromise=require(_0x6ec3('0x5'));var Mustache=require(_0x6ec3('0x6'));var util=require('util');var path=require(_0x6ec3('0x7'));var sox=require(_0x6ec3('0x8'));var csv=require('to-csv');var ejs=require(_0x6ec3('0x9'));var fs=require('fs');var _=require(_0x6ec3('0xa'));var squel=require(_0x6ec3('0xb'));var crypto=require(_0x6ec3('0xc'));var jsforce=require(_0x6ec3('0xd'));var deskjs=require(_0x6ec3('0xe'));var toCsv=require(_0x6ec3('0xf'));var querystring=require(_0x6ec3('0x10'));var Papa=require('papaparse');var Redis=require(_0x6ec3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ec3('0x12'));var hardwareService=require(_0x6ec3('0x13'));var logger=require(_0x6ec3('0x14'))(_0x6ec3('0x15'));var utils=require(_0x6ec3('0x16'));var config=require(_0x6ec3('0x17'));var db=require(_0x6ec3('0x18'))['db'];function respondWithStatusCode(_0x1e8382,_0x23e15d){_0x23e15d=_0x23e15d||0xcc;return function(_0x2388c1){if(_0x2388c1){return _0x1e8382[_0x6ec3('0x19')](_0x23e15d);}return _0x1e8382[_0x6ec3('0x1a')](_0x23e15d)[_0x6ec3('0x1b')]();};}function respondWithResult(_0xa630f8,_0x488a85){_0x488a85=_0x488a85||0xc8;return function(_0x12b15e){if(_0x12b15e){return _0xa630f8[_0x6ec3('0x1a')](_0x488a85)[_0x6ec3('0x1c')](_0x12b15e);}};}function respondWithFilteredResult(_0x51fa45,_0x1e9c21){return function(_0x19cfe3){if(_0x19cfe3){var _0x5251e2=_0x19cfe3[_0x6ec3('0x1d')],_0x41ee3d=_0x1e9c21[_0x6ec3('0x1e')],_0x29929e=_0x1e9c21[_0x6ec3('0x1e')]+_0x1e9c21['limit'],_0x5b78b9;if(_0x29929e>=_0x5251e2){_0x29929e=_0x5251e2;_0x5b78b9=0xc8;}else{_0x5b78b9=0xce;}_0x51fa45[_0x6ec3('0x1a')](_0x5b78b9);return _0x51fa45['set'](_0x6ec3('0x1f'),_0x41ee3d+'-'+_0x29929e+'/'+_0x5251e2)[_0x6ec3('0x1c')](_0x19cfe3);}return null;};}function patchUpdates(_0x59e58b){return function(_0x255d11){try{jsonpatch['apply'](_0x255d11,_0x59e58b,!![]);}catch(_0x40bb06){return BPromise[_0x6ec3('0x20')](_0x40bb06);}return _0x255d11[_0x6ec3('0x21')]();};}function saveUpdates(_0x75d4ea,_0x4d7888){return function(_0x58aaf5){if(_0x58aaf5){return _0x58aaf5['update'](_0x75d4ea)[_0x6ec3('0x22')](function(_0x513748){return _0x513748;});}return null;};}function removeEntity(_0x133d01,_0x4139d7){return function(_0x7ed6f6){if(_0x7ed6f6){return _0x7ed6f6[_0x6ec3('0x23')]()[_0x6ec3('0x22')](function(){_0x133d01[_0x6ec3('0x1a')](0xcc)[_0x6ec3('0x1b')]();});}};}function handleEntityNotFound(_0x5d345a,_0x22c5ed){return function(_0x3ad6f5){if(!_0x3ad6f5){_0x5d345a['sendStatus'](0x194);}return _0x3ad6f5;};}function handleError(_0xdf0ab9,_0x315519){_0x315519=_0x315519||0x1f4;return function(_0xe2ea36){logger[_0x6ec3('0x24')](_0xe2ea36['stack']);if(_0xe2ea36['name']){delete _0xe2ea36[_0x6ec3('0x25')];}_0xdf0ab9['status'](_0x315519)['send'](_0xe2ea36);};}exports['index']=function(_0x44959a,_0x58af6a){var _0x5f0cd3={},_0x553839={},_0x43d621={'count':0x0,'rows':[]};var _0x5e29b2=db['Cdr']['rawAttributes'];_0x553839[_0x6ec3('0x26')]=_[_0x6ec3('0x27')](_0x5e29b2);_0x553839['query']=_[_0x6ec3('0x27')](_0x44959a['query']);_0x553839[_0x6ec3('0x28')]=_[_0x6ec3('0x29')](_0x553839['model'],_0x553839['query']);_0x5f0cd3['attributes']=_['intersection'](_0x553839['model'],qs[_0x6ec3('0x2a')](_0x44959a[_0x6ec3('0x2b')]['fields']));_0x5f0cd3[_0x6ec3('0x2c')]=_0x5f0cd3['attributes'][_0x6ec3('0x2d')]?_0x5f0cd3[_0x6ec3('0x2c')]:_0x553839[_0x6ec3('0x26')];if(!_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x2e')](_0x6ec3('0x2f'))){_0x5f0cd3[_0x6ec3('0x30')]=qs[_0x6ec3('0x30')](_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x30')]);_0x5f0cd3[_0x6ec3('0x1e')]=qs['offset'](_0x44959a['query'][_0x6ec3('0x1e')]);}_0x5f0cd3[_0x6ec3('0x31')]=qs[_0x6ec3('0x32')](_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x32')]);_0x5f0cd3['where']=qs['filters'](_[_0x6ec3('0x33')](_0x44959a['query'],_0x553839[_0x6ec3('0x28')]));if(_0x44959a[_0x6ec3('0x2b')][_0x6ec3('0x34')]){_0x5f0cd3['where']=_['merge'](_0x5f0cd3[_0x6ec3('0x35')],{'$or':_[_0x6ec3('0x36')](_0x5e29b2,function(_0x5bbc19){if(_0x5bbc19['type']['key']!==_0x6ec3('0x37')){var _0x4120e4={};_0x4120e4[_0x5bbc19['field']]={'$like':'%'+_0x44959a['query']['filter']+'%'};return _0x4120e4;}})});}_0x5f0cd3=_[_0x6ec3('0x38')]({},_0x5f0cd3,_0x44959a['options']);var _0x3f5af3={'where':_0x5f0cd3[_0x6ec3('0x35')]};return db[_0x6ec3('0x39')][_0x6ec3('0x1d')](_0x3f5af3)['then'](function(_0x9db3de){_0x43d621[_0x6ec3('0x1d')]=_0x9db3de;if(_0x44959a[_0x6ec3('0x2b')]['includeAll']){_0x5f0cd3[_0x6ec3('0x3a')]=[{'all':!![]}];}return db[_0x6ec3('0x39')][_0x6ec3('0x3b')](_0x5f0cd3);})[_0x6ec3('0x22')](function(_0xfe16c1){_0x43d621['rows']=_0xfe16c1;return _0x43d621;})[_0x6ec3('0x22')](respondWithFilteredResult(_0x58af6a,_0x5f0cd3))[_0x6ec3('0x3c')](handleError(_0x58af6a,null));};exports[_0x6ec3('0x3d')]=function(_0x5eec3c,_0x3e51be){var _0x2ffa38={'raw':!![],'where':{'id':_0x5eec3c[_0x6ec3('0x3e')]['id']}},_0xe98b10={};_0xe98b10[_0x6ec3('0x26')]=_['keys'](db[_0x6ec3('0x39')][_0x6ec3('0x3f')]);_0xe98b10['query']=_[_0x6ec3('0x27')](_0x5eec3c[_0x6ec3('0x2b')]);_0xe98b10[_0x6ec3('0x28')]=_['intersection'](_0xe98b10['model'],_0xe98b10['query']);_0x2ffa38[_0x6ec3('0x2c')]=_[_0x6ec3('0x29')](_0xe98b10['model'],qs[_0x6ec3('0x2a')](_0x5eec3c['query']['fields']));_0x2ffa38['attributes']=_0x2ffa38[_0x6ec3('0x2c')][_0x6ec3('0x2d')]?_0x2ffa38[_0x6ec3('0x2c')]:_0xe98b10[_0x6ec3('0x26')];if(_0x5eec3c[_0x6ec3('0x2b')][_0x6ec3('0x40')]){_0x2ffa38[_0x6ec3('0x3a')]=[{'all':!![]}];}_0x2ffa38=_[_0x6ec3('0x38')]({},_0x2ffa38,_0x5eec3c[_0x6ec3('0x41')]);return db['Cdr'][_0x6ec3('0x42')](_0x2ffa38)[_0x6ec3('0x22')](handleEntityNotFound(_0x3e51be,null))[_0x6ec3('0x22')](respondWithResult(_0x3e51be,null))[_0x6ec3('0x3c')](handleError(_0x3e51be,null));};exports[_0x6ec3('0x43')]=function(_0x366b7d,_0x5856f8){return db[_0x6ec3('0x39')][_0x6ec3('0x43')](_0x366b7d[_0x6ec3('0x44')],{})[_0x6ec3('0x22')](respondWithResult(_0x5856f8,0xc9))[_0x6ec3('0x3c')](handleError(_0x5856f8,null));};exports[_0x6ec3('0x45')]=function(_0x188f33,_0x276814){if(_0x188f33['body']['id']){delete _0x188f33['body']['id'];}return db[_0x6ec3('0x39')]['find']({'where':{'id':_0x188f33[_0x6ec3('0x3e')]['id']}})[_0x6ec3('0x22')](handleEntityNotFound(_0x276814,null))[_0x6ec3('0x22')](saveUpdates(_0x188f33[_0x6ec3('0x44')],null))[_0x6ec3('0x22')](respondWithResult(_0x276814,null))[_0x6ec3('0x3c')](handleError(_0x276814,null));};exports[_0x6ec3('0x23')]=function(_0x3a8578,_0x184cbf){return db[_0x6ec3('0x39')][_0x6ec3('0x42')]({'where':{'id':_0x3a8578[_0x6ec3('0x3e')]['id']}})[_0x6ec3('0x22')](handleEntityNotFound(_0x184cbf,null))[_0x6ec3('0x22')](removeEntity(_0x184cbf,null))[_0x6ec3('0x3c')](handleError(_0x184cbf,null));};exports[_0x6ec3('0x46')]=function(_0x5e66d1,_0x2d693e){return db[_0x6ec3('0x39')][_0x6ec3('0x46')]()[_0x6ec3('0x22')](respondWithResult(_0x2d693e,null))['catch'](handleError(_0x2d693e,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index d87cbe9..189cedd 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 _0xfcf0=['accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x188dfd,_0x480957){var _0x588d95=function(_0x10984f){while(--_0x10984f){_0x188dfd['push'](_0x188dfd['shift']());}};_0x588d95(++_0x480957);}(_0xfcf0,0x138));var _0x0fcf=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xfcf0[_0x52666e];return _0x515330;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['calldate']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]},{'name':_0x0fcf('0xf'),'fields':['dst']},{'name':_0x0fcf('0x10'),'fields':['src']},{'name':_0x0fcf('0x11'),'fields':[_0x0fcf('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xe3da=['accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x568d0c,_0x29328a){var _0x3f036f=function(_0x13fad7){while(--_0x13fad7){_0x568d0c['push'](_0x568d0c['shift']());}};_0x3f036f(++_0x29328a);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'calldate','fields':['calldate']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]},{'name':_0xae3d('0x10'),'fields':[_0xae3d('0x10')]},{'name':_0xae3d('0x11'),'fields':[_0xae3d('0x11')]},{'name':'uniqueid','fields':[_0xae3d('0x12')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 8893085..1e4a004 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 _0xc1c8=['message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3f5f76,_0x15d83a){var _0x5d2c79=function(_0xb3b373){while(--_0xb3b373){_0x3f5f76['push'](_0x3f5f76['shift']());}};_0x5d2c79(++_0x15d83a);}(_0xc1c8,0x179));var _0x8c1c=function(_0x4313cc,_0x3becb9){_0x4313cc=_0x4313cc-0x0;var _0x3f1707=_0xc1c8[_0x4313cc];return _0x3f1707;};'use strict';var _=require(_0x8c1c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8c1c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c1c('0x2'))['db'];var utils=require(_0x8c1c('0x3'));var logger=require('../../config/logger')(_0x8c1c('0x4'));var config=require(_0x8c1c('0x5'));var jayson=require(_0x8c1c('0x6'));var client=jayson['client'][_0x8c1c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb2245,_0x405f76,_0x49c99d){return new BPromise(function(_0xdcce5,_0x68aab){return client[_0x8c1c('0x8')](_0xb2245,_0x49c99d)['then'](function(_0x2be31f){logger[_0x8c1c('0x9')](_0x8c1c('0xa'),_0x405f76,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x405f76,_0x8c1c('0xb'),JSON['stringify'](_0x2be31f));if(_0x2be31f[_0x8c1c('0xc')]){if(_0x2be31f['error'][_0x8c1c('0xd')]===0x1f4){logger[_0x8c1c('0xc')](_0x8c1c('0xa'),_0x405f76,_0x2be31f[_0x8c1c('0xc')][_0x8c1c('0xe')]);return _0x68aab(_0x2be31f[_0x8c1c('0xc')]['message']);}logger[_0x8c1c('0xc')](_0x8c1c('0xa'),_0x405f76,_0x2be31f['error'][_0x8c1c('0xe')]);return _0xdcce5(_0x2be31f['error'][_0x8c1c('0xe')]);}else{logger[_0x8c1c('0x9')]('Cdr,\x20%s,\x20%s',_0x405f76,'request\x20sent');_0xdcce5(_0x2be31f[_0x8c1c('0xf')][_0x8c1c('0xe')]);}})[_0x8c1c('0x10')](function(_0x5c9191){logger[_0x8c1c('0xc')](_0x8c1c('0xa'),_0x405f76,_0x5c9191);_0x68aab(_0x5c9191);});});}
\ No newline at end of file
+var _0xde2b=['request\x20sent','debug','stringify','error','message','result','catch','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s'];(function(_0xd5275f,_0x1b6eb7){var _0x19cabf=function(_0x10e154){while(--_0x10e154){_0xd5275f['push'](_0xd5275f['shift']());}};_0x19cabf(++_0x1b6eb7);}(_0xde2b,0x6d));var _0xbde2=function(_0x43e5d0,_0x45e9bf){_0x43e5d0=_0x43e5d0-0x0;var _0x284330=_0xde2b[_0x43e5d0];return _0x284330;};'use strict';var _=require('lodash');var util=require(_0xbde2('0x0'));var moment=require(_0xbde2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbde2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbde2('0x3'));var config=require(_0xbde2('0x4'));var jayson=require(_0xbde2('0x5'));var client=jayson[_0xbde2('0x6')][_0xbde2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4041c1,_0x327d95,_0x3a974c){return new BPromise(function(_0x406934,_0x326349){return client['request'](_0x4041c1,_0x3a974c)[_0xbde2('0x8')](function(_0x135d3c){logger['info'](_0xbde2('0x9'),_0x327d95,_0xbde2('0xa'));logger[_0xbde2('0xb')]('Cdr,\x20%s,\x20%s,\x20%s',_0x327d95,'request\x20sent',JSON[_0xbde2('0xc')](_0x135d3c));if(_0x135d3c[_0xbde2('0xd')]){if(_0x135d3c[_0xbde2('0xd')]['code']===0x1f4){logger[_0xbde2('0xd')](_0xbde2('0x9'),_0x327d95,_0x135d3c[_0xbde2('0xd')]['message']);return _0x326349(_0x135d3c[_0xbde2('0xd')][_0xbde2('0xe')]);}logger[_0xbde2('0xd')]('Cdr,\x20%s,\x20%s',_0x327d95,_0x135d3c['error']['message']);return _0x406934(_0x135d3c[_0xbde2('0xd')][_0xbde2('0xe')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x327d95,_0xbde2('0xa'));_0x406934(_0x135d3c[_0xbde2('0xf')][_0xbde2('0xe')]);}})[_0xbde2('0x10')](function(_0x40e296){logger[_0xbde2('0xd')]('Cdr,\x20%s,\x20%s',_0x327d95,_0x40e296);_0x326349(_0x40e296);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 79b849a..0f3957b 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 _0x528c=['put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x7bde64,_0x4f3fc5){var _0x14bb79=function(_0x4799e0){while(--_0x4799e0){_0x7bde64['push'](_0x7bde64['shift']());}};_0x14bb79(++_0x4f3fc5);}(_0x528c,0x9d));var _0xc528=function(_0x3de419,_0x16e055){_0x3de419=_0x3de419-0x0;var _0x55874b=_0x528c[_0x3de419];return _0x55874b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc528('0x0'));var timeout=require(_0xc528('0x1'));var express=require(_0xc528('0x2'));var router=express[_0xc528('0x3')]();var auth=require(_0xc528('0x4'));var interaction=require(_0xc528('0x5'));var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0xc528('0x6')]('/',auth[_0xc528('0x7')](),controller[_0xc528('0x8')]);router['get'](_0xc528('0x9'),auth[_0xc528('0x7')](),controller['describe']);router[_0xc528('0x6')](_0xc528('0xa'),auth[_0xc528('0x7')](),controller[_0xc528('0xb')]);router[_0xc528('0xc')]('/',auth[_0xc528('0x7')](),controller['create']);router[_0xc528('0xd')](_0xc528('0xa'),auth[_0xc528('0x7')](),controller[_0xc528('0xe')]);router[_0xc528('0xf')](_0xc528('0xa'),auth[_0xc528('0x7')](),controller[_0xc528('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x21ee=['./cdr.controller','isAuthenticated','/describe','describe','get','/:id','show','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x20c989,_0x228a0a){var _0x3376ca=function(_0x583d71){while(--_0x583d71){_0x20c989['push'](_0x20c989['shift']());}};_0x3376ca(++_0x228a0a);}(_0x21ee,0x11a));var _0xe21e=function(_0x4c3d1e,_0x1e5212){_0x4c3d1e=_0x4c3d1e-0x0;var _0x29dcb1=_0x21ee[_0x4c3d1e];return _0x29dcb1;};'use strict';var multer=require(_0xe21e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe21e('0x1'));var express=require(_0xe21e('0x2'));var router=express[_0xe21e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe21e('0x4'));var config=require(_0xe21e('0x5'));var controller=require(_0xe21e('0x6'));router['get']('/',auth[_0xe21e('0x7')](),controller['index']);router['get'](_0xe21e('0x8'),auth[_0xe21e('0x7')](),controller[_0xe21e('0x9')]);router[_0xe21e('0xa')](_0xe21e('0xb'),auth[_0xe21e('0x7')](),controller[_0xe21e('0xc')]);router['post']('/',auth[_0xe21e('0x7')](),controller[_0xe21e('0xd')]);router[_0xe21e('0xe')](_0xe21e('0xb'),auth['isAuthenticated'](),controller[_0xe21e('0xf')]);router['delete'](_0xe21e('0xb'),auth['isAuthenticated'](),controller[_0xe21e('0x10')]);module[_0xe21e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index f028422..955960c 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 _0xe135=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0xe135,0x1e3));var _0x5e13=function(_0x207301,_0x235203){_0x207301=_0x207301-0x0;var _0x10be14=_0xe135[_0x207301];return _0x10be14;};'use strict';var Sequelize=require(_0x5e13('0x0'));module[_0x5e13('0x1')]={'priority':{'type':Sequelize[_0x5e13('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5e13('0x3')],'allowNull':![],'defaultValue':_0x5e13('0x4')},'appdata':{'type':Sequelize[_0x5e13('0x5')]()},'description':{'type':Sequelize[_0x5e13('0x3')]},'interval':{'type':Sequelize[_0x5e13('0x3')],'defaultValue':_0x5e13('0x6')}};
\ No newline at end of file
+var _0x52c6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x52c6,0x12f));var _0x652c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x52c6[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x652c('0x0'));module[_0x652c('0x1')]={'priority':{'type':Sequelize[_0x652c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x652c('0x3')],'allowNull':![],'defaultValue':_0x652c('0x4')},'appdata':{'type':Sequelize[_0x652c('0x5')]()},'description':{'type':Sequelize[_0x652c('0x3')]},'interval':{'type':Sequelize[_0x652c('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 12d1ef3..bc497ab 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 _0x2937=['params','model','ChatApplication','query','filters','intersection','attributes','length','includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','limit','status','set','Content-Range','apply','reject','update','destroy','then','error','name','show'];(function(_0x49bb05,_0x2e5caf){var _0x28445c=function(_0x15471b){while(--_0x15471b){_0x49bb05['push'](_0x49bb05['shift']());}};_0x28445c(++_0x2e5caf);}(_0x2937,0x164));var _0x7293=function(_0x2c0efd,_0x52fbbf){_0x2c0efd=_0x2c0efd-0x0;var _0x2864f8=_0x2937[_0x2c0efd];return _0x2864f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7293('0x0'));var rimraf=require(_0x7293('0x1'));var zipdir=require(_0x7293('0x2'));var jsonpatch=require(_0x7293('0x3'));var rp=require(_0x7293('0x4'));var moment=require(_0x7293('0x5'));var BPromise=require(_0x7293('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7293('0x7'));var sox=require(_0x7293('0x8'));var csv=require(_0x7293('0x9'));var ejs=require(_0x7293('0xa'));var fs=require('fs');var _=require(_0x7293('0xb'));var squel=require(_0x7293('0xc'));var crypto=require(_0x7293('0xd'));var jsforce=require(_0x7293('0xe'));var deskjs=require(_0x7293('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7293('0x10'));var Papa=require(_0x7293('0x11'));var Redis=require('ioredis');var authService=require(_0x7293('0x12'));var qs=require(_0x7293('0x13'));var as=require(_0x7293('0x14'));var hardwareService=require(_0x7293('0x15'));var logger=require(_0x7293('0x16'))(_0x7293('0x17'));var utils=require(_0x7293('0x18'));var config=require(_0x7293('0x19'));var db=require(_0x7293('0x1a'))['db'];function respondWithStatusCode(_0x4b94ce,_0x55b6ac){_0x55b6ac=_0x55b6ac||0xcc;return function(_0x54fa53){if(_0x54fa53){return _0x4b94ce[_0x7293('0x1b')](_0x55b6ac);}return _0x4b94ce['status'](_0x55b6ac)[_0x7293('0x1c')]();};}function respondWithResult(_0xddd819,_0x5037f1){_0x5037f1=_0x5037f1||0xc8;return function(_0xce1b61){if(_0xce1b61){return _0xddd819['status'](_0x5037f1)[_0x7293('0x1d')](_0xce1b61);}};}function respondWithFilteredResult(_0x1a567d,_0x10a598){return function(_0x2c476f){if(_0x2c476f){var _0x5f1667=_0x2c476f[_0x7293('0x1e')],_0x331b95=_0x10a598['offset'],_0x9c9989=_0x10a598['offset']+_0x10a598[_0x7293('0x1f')],_0x4e9600;if(_0x9c9989>=_0x5f1667){_0x9c9989=_0x5f1667;_0x4e9600=0xc8;}else{_0x4e9600=0xce;}_0x1a567d[_0x7293('0x20')](_0x4e9600);return _0x1a567d[_0x7293('0x21')](_0x7293('0x22'),_0x331b95+'-'+_0x9c9989+'/'+_0x5f1667)['json'](_0x2c476f);}return null;};}function patchUpdates(_0x421a65){return function(_0x42ac60){try{jsonpatch[_0x7293('0x23')](_0x42ac60,_0x421a65,!![]);}catch(_0x3673d4){return BPromise[_0x7293('0x24')](_0x3673d4);}return _0x42ac60['save']();};}function saveUpdates(_0x1c634c,_0x3b23a7){return function(_0xe5d47d){if(_0xe5d47d){return _0xe5d47d[_0x7293('0x25')](_0x1c634c)['then'](function(_0x387268){return _0x387268;});}return null;};}function removeEntity(_0x4ce767,_0x5f3f12){return function(_0x2a1fb6){if(_0x2a1fb6){return _0x2a1fb6[_0x7293('0x26')]()[_0x7293('0x27')](function(){_0x4ce767[_0x7293('0x20')](0xcc)[_0x7293('0x1c')]();});}};}function handleEntityNotFound(_0x3f6d54,_0x3c48b1){return function(_0x2a6e17){if(!_0x2a6e17){_0x3f6d54[_0x7293('0x1b')](0x194);}return _0x2a6e17;};}function handleError(_0xe687ae,_0x2e7c9e){_0x2e7c9e=_0x2e7c9e||0x1f4;return function(_0x12c948){logger[_0x7293('0x28')](_0x12c948['stack']);if(_0x12c948[_0x7293('0x29')]){delete _0x12c948['name'];}_0xe687ae[_0x7293('0x20')](_0x2e7c9e)['send'](_0x12c948);};}exports[_0x7293('0x2a')]=function(_0x146185,_0x308e48){var _0x567a0f={'raw':!![],'where':{'id':_0x146185[_0x7293('0x2b')]['id']}},_0x27df0f={};_0x27df0f[_0x7293('0x2c')]=_['keys'](db[_0x7293('0x2d')]['rawAttributes']);_0x27df0f[_0x7293('0x2e')]=_['keys'](_0x146185[_0x7293('0x2e')]);_0x27df0f[_0x7293('0x2f')]=_[_0x7293('0x30')](_0x27df0f[_0x7293('0x2c')],_0x27df0f['query']);_0x567a0f[_0x7293('0x31')]=_[_0x7293('0x30')](_0x27df0f[_0x7293('0x2c')],qs['fields'](_0x146185[_0x7293('0x2e')]['fields']));_0x567a0f[_0x7293('0x31')]=_0x567a0f[_0x7293('0x31')][_0x7293('0x32')]?_0x567a0f[_0x7293('0x31')]:_0x27df0f[_0x7293('0x2c')];if(_0x146185[_0x7293('0x2e')][_0x7293('0x33')]){_0x567a0f['include']=[{'all':!![]}];}_0x567a0f=_[_0x7293('0x34')]({},_0x567a0f,_0x146185[_0x7293('0x35')]);return db[_0x7293('0x2d')][_0x7293('0x36')](_0x567a0f)[_0x7293('0x27')](handleEntityNotFound(_0x308e48,null))[_0x7293('0x27')](respondWithResult(_0x308e48,null))[_0x7293('0x37')](handleError(_0x308e48,null));};exports[_0x7293('0x25')]=function(_0x472faa,_0x1fcaea){if(_0x472faa['body']['id']){delete _0x472faa[_0x7293('0x38')]['id'];}return db[_0x7293('0x2d')]['find']({'where':{'id':_0x472faa[_0x7293('0x2b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x1fcaea,null))[_0x7293('0x27')](saveUpdates(_0x472faa[_0x7293('0x38')],null))['then'](respondWithResult(_0x1fcaea,null))[_0x7293('0x37')](handleError(_0x1fcaea,null));};exports[_0x7293('0x26')]=function(_0x508f8f,_0x13759e){return db[_0x7293('0x2d')][_0x7293('0x36')]({'where':{'id':_0x508f8f[_0x7293('0x2b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x13759e,null))[_0x7293('0x27')](removeEntity(_0x13759e,null))[_0x7293('0x37')](handleError(_0x13759e,null));};
\ No newline at end of file
+var _0x188a=['length','include','merge','options','find','catch','body','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes'];(function(_0x4c227d,_0x511b96){var _0x14df74=function(_0x3be591){while(--_0x3be591){_0x4c227d['push'](_0x4c227d['shift']());}};_0x14df74(++_0x511b96);}(_0x188a,0x19d));var _0xa188=function(_0x17405a,_0x33fce5){_0x17405a=_0x17405a-0x0;var _0x171395=_0x188a[_0x17405a];return _0x171395;};'use strict';var pdf=require(_0xa188('0x0'));var emlformat=require(_0xa188('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa188('0x2'));var moment=require('moment');var BPromise=require(_0xa188('0x3'));var Mustache=require(_0xa188('0x4'));var util=require(_0xa188('0x5'));var path=require(_0xa188('0x6'));var sox=require(_0xa188('0x7'));var csv=require(_0xa188('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa188('0x9'));var squel=require(_0xa188('0xa'));var crypto=require(_0xa188('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa188('0xc'));var toCsv=require(_0xa188('0x8'));var querystring=require(_0xa188('0xd'));var Papa=require('papaparse');var Redis=require(_0xa188('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa188('0xf'));var as=require(_0xa188('0x10'));var hardwareService=require(_0xa188('0x11'));var logger=require(_0xa188('0x12'))(_0xa188('0x13'));var utils=require(_0xa188('0x14'));var config=require(_0xa188('0x15'));var db=require(_0xa188('0x16'))['db'];function respondWithStatusCode(_0x5e3797,_0x551e85){_0x551e85=_0x551e85||0xcc;return function(_0x297388){if(_0x297388){return _0x5e3797[_0xa188('0x17')](_0x551e85);}return _0x5e3797[_0xa188('0x18')](_0x551e85)[_0xa188('0x19')]();};}function respondWithResult(_0x464564,_0x347dc2){_0x347dc2=_0x347dc2||0xc8;return function(_0x50e2b7){if(_0x50e2b7){return _0x464564['status'](_0x347dc2)[_0xa188('0x1a')](_0x50e2b7);}};}function respondWithFilteredResult(_0x59f711,_0x46c8e4){return function(_0x2efc96){if(_0x2efc96){var _0x2a8832=_0x2efc96[_0xa188('0x1b')],_0x2b9e2f=_0x46c8e4[_0xa188('0x1c')],_0x11c06b=_0x46c8e4[_0xa188('0x1c')]+_0x46c8e4[_0xa188('0x1d')],_0x5914c4;if(_0x11c06b>=_0x2a8832){_0x11c06b=_0x2a8832;_0x5914c4=0xc8;}else{_0x5914c4=0xce;}_0x59f711['status'](_0x5914c4);return _0x59f711[_0xa188('0x1e')](_0xa188('0x1f'),_0x2b9e2f+'-'+_0x11c06b+'/'+_0x2a8832)[_0xa188('0x1a')](_0x2efc96);}return null;};}function patchUpdates(_0x8a5c23){return function(_0x4da97b){try{jsonpatch[_0xa188('0x20')](_0x4da97b,_0x8a5c23,!![]);}catch(_0x3cf8b1){return BPromise[_0xa188('0x21')](_0x3cf8b1);}return _0x4da97b[_0xa188('0x22')]();};}function saveUpdates(_0x1b5c78,_0x2185a7){return function(_0x32b369){if(_0x32b369){return _0x32b369[_0xa188('0x23')](_0x1b5c78)[_0xa188('0x24')](function(_0x378bc1){return _0x378bc1;});}return null;};}function removeEntity(_0x3d9e76,_0x36abbf){return function(_0x497ee2){if(_0x497ee2){return _0x497ee2[_0xa188('0x25')]()['then'](function(){_0x3d9e76[_0xa188('0x18')](0xcc)[_0xa188('0x19')]();});}};}function handleEntityNotFound(_0x104ced,_0x4e7f79){return function(_0x32a211){if(!_0x32a211){_0x104ced['sendStatus'](0x194);}return _0x32a211;};}function handleError(_0x3074cb,_0x4b1189){_0x4b1189=_0x4b1189||0x1f4;return function(_0x2e25bd){logger[_0xa188('0x26')](_0x2e25bd[_0xa188('0x27')]);if(_0x2e25bd[_0xa188('0x28')]){delete _0x2e25bd[_0xa188('0x28')];}_0x3074cb[_0xa188('0x18')](_0x4b1189)[_0xa188('0x29')](_0x2e25bd);};}exports['show']=function(_0x2dd593,_0x5d9b6b){var _0x14b23e={'raw':!![],'where':{'id':_0x2dd593[_0xa188('0x2a')]['id']}},_0x33e1e1={};_0x33e1e1[_0xa188('0x2b')]=_[_0xa188('0x2c')](db[_0xa188('0x2d')][_0xa188('0x2e')]);_0x33e1e1['query']=_[_0xa188('0x2c')](_0x2dd593[_0xa188('0x2f')]);_0x33e1e1['filters']=_[_0xa188('0x30')](_0x33e1e1[_0xa188('0x2b')],_0x33e1e1[_0xa188('0x2f')]);_0x14b23e['attributes']=_[_0xa188('0x30')](_0x33e1e1[_0xa188('0x2b')],qs[_0xa188('0x31')](_0x2dd593[_0xa188('0x2f')]['fields']));_0x14b23e[_0xa188('0x32')]=_0x14b23e['attributes'][_0xa188('0x33')]?_0x14b23e[_0xa188('0x32')]:_0x33e1e1[_0xa188('0x2b')];if(_0x2dd593['query']['includeAll']){_0x14b23e[_0xa188('0x34')]=[{'all':!![]}];}_0x14b23e=_[_0xa188('0x35')]({},_0x14b23e,_0x2dd593[_0xa188('0x36')]);return db[_0xa188('0x2d')][_0xa188('0x37')](_0x14b23e)[_0xa188('0x24')](handleEntityNotFound(_0x5d9b6b,null))[_0xa188('0x24')](respondWithResult(_0x5d9b6b,null))[_0xa188('0x38')](handleError(_0x5d9b6b,null));};exports[_0xa188('0x23')]=function(_0x59a2c8,_0x3409f6){if(_0x59a2c8[_0xa188('0x39')]['id']){delete _0x59a2c8[_0xa188('0x39')]['id'];}return db[_0xa188('0x2d')]['find']({'where':{'id':_0x59a2c8[_0xa188('0x2a')]['id']}})[_0xa188('0x24')](handleEntityNotFound(_0x3409f6,null))[_0xa188('0x24')](saveUpdates(_0x59a2c8[_0xa188('0x39')],null))['then'](respondWithResult(_0x3409f6,null))[_0xa188('0x38')](handleError(_0x3409f6,null));};exports[_0xa188('0x25')]=function(_0x124458,_0x2879fb){return db[_0xa188('0x2d')][_0xa188('0x37')]({'where':{'id':_0x124458[_0xa188('0x2a')]['id']}})[_0xa188('0x24')](handleEntityNotFound(_0x2879fb,null))[_0xa188('0x24')](removeEntity(_0x2879fb,null))[_0xa188('0x38')](handleError(_0x2879fb,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index cfa43cd..08fdb4e 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
+var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 60b9432..6342a62 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 _0x02a8=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x3c8d76,_0x38f57d){var _0x255482=function(_0x49b33a){while(--_0x49b33a){_0x3c8d76['push'](_0x3c8d76['shift']());}};_0x255482(++_0x38f57d);}(_0x02a8,0xf3));var _0x802a=function(_0x2b2538,_0x4992eb){_0x2b2538=_0x2b2538-0x0;var _0x4d0748=_0x02a8[_0x2b2538];return _0x4d0748;};'use strict';var _=require(_0x802a('0x0'));var util=require(_0x802a('0x1'));var moment=require(_0x802a('0x2'));var BPromise=require(_0x802a('0x3'));var rs=require(_0x802a('0x4'));var fs=require('fs');var Redis=require(_0x802a('0x5'));var db=require(_0x802a('0x6'))['db'];var utils=require(_0x802a('0x7'));var logger=require('../../config/logger')(_0x802a('0x8'));var config=require('../../config/environment');var jayson=require(_0x802a('0x9'));var client=jayson[_0x802a('0xa')][_0x802a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29af6f,_0xfb27d5,_0x4f890f){return new BPromise(function(_0x470e07,_0x2177e6){return client[_0x802a('0xc')](_0x29af6f,_0x4f890f)[_0x802a('0xd')](function(_0x77fd8){logger[_0x802a('0xe')](_0x802a('0xf'),_0xfb27d5,_0x802a('0x10'));logger[_0x802a('0x11')](_0x802a('0x12'),_0xfb27d5,_0x802a('0x10'),JSON['stringify'](_0x77fd8));if(_0x77fd8['error']){if(_0x77fd8['error']['code']===0x1f4){logger[_0x802a('0x13')](_0x802a('0xf'),_0xfb27d5,_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);return _0x2177e6(_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);}logger[_0x802a('0x13')](_0x802a('0xf'),_0xfb27d5,_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);return _0x470e07(_0x77fd8[_0x802a('0x13')][_0x802a('0x14')]);}else{logger[_0x802a('0xe')](_0x802a('0xf'),_0xfb27d5,_0x802a('0x10'));_0x470e07(_0x77fd8[_0x802a('0x15')]['message']);}})[_0x802a('0x16')](function(_0x15065c){logger[_0x802a('0x13')](_0x802a('0xf'),_0xfb27d5,_0x15065c);_0x2177e6(_0x15065c);});});}
\ No newline at end of file
+var _0xab27=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xab27,0xa4));var _0x7ab2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xab27[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7ab2('0x0'));var util=require(_0x7ab2('0x1'));var moment=require(_0x7ab2('0x2'));var BPromise=require(_0x7ab2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ab2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7ab2('0x5'))(_0x7ab2('0x6'));var config=require('../../config/environment');var jayson=require(_0x7ab2('0x7'));var client=jayson[_0x7ab2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f209f,_0x568581,_0x7324a0){return new BPromise(function(_0xc558c2,_0x1f923b){return client[_0x7ab2('0x9')](_0x1f209f,_0x7324a0)[_0x7ab2('0xa')](function(_0x4a2651){logger[_0x7ab2('0xb')](_0x7ab2('0xc'),_0x568581,_0x7ab2('0xd'));logger[_0x7ab2('0xe')](_0x7ab2('0xf'),_0x568581,'request\x20sent',JSON[_0x7ab2('0x10')](_0x4a2651));if(_0x4a2651[_0x7ab2('0x11')]){if(_0x4a2651[_0x7ab2('0x11')][_0x7ab2('0x12')]===0x1f4){logger[_0x7ab2('0x11')](_0x7ab2('0xc'),_0x568581,_0x4a2651[_0x7ab2('0x11')][_0x7ab2('0x13')]);return _0x1f923b(_0x4a2651[_0x7ab2('0x11')][_0x7ab2('0x13')]);}logger[_0x7ab2('0x11')](_0x7ab2('0xc'),_0x568581,_0x4a2651['error'][_0x7ab2('0x13')]);return _0xc558c2(_0x4a2651[_0x7ab2('0x11')]['message']);}else{logger[_0x7ab2('0xb')](_0x7ab2('0xc'),_0x568581,'request\x20sent');_0xc558c2(_0x4a2651[_0x7ab2('0x14')][_0x7ab2('0x13')]);}})[_0x7ab2('0x15')](function(_0x395ce1){logger[_0x7ab2('0x11')]('ChatApplication,\x20%s,\x20%s',_0x568581,_0x395ce1);_0x1f923b(_0x395ce1);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 41115be..22670c1 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 _0x25fb=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update','delete','destroy','exports'];(function(_0x2c5a0c,_0x484880){var _0x47f8e9=function(_0x32e6e8){while(--_0x32e6e8){_0x2c5a0c['push'](_0x2c5a0c['shift']());}};_0x47f8e9(++_0x484880);}(_0x25fb,0x1a4));var _0xb25f=function(_0x2ae0d2,_0x4ed4cf){_0x2ae0d2=_0x2ae0d2-0x0;var _0x1ad9a7=_0x25fb[_0x2ae0d2];return _0x1ad9a7;};'use strict';var multer=require('multer');var util=require(_0xb25f('0x0'));var path=require(_0xb25f('0x1'));var timeout=require(_0xb25f('0x2'));var express=require(_0xb25f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb25f('0x4'));var config=require(_0xb25f('0x5'));var controller=require(_0xb25f('0x6'));router[_0xb25f('0x7')](_0xb25f('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xb25f('0x9')](_0xb25f('0x8'),auth[_0xb25f('0xa')](),controller[_0xb25f('0xb')]);router[_0xb25f('0xc')]('/:id',auth[_0xb25f('0xa')](),controller[_0xb25f('0xd')]);module[_0xb25f('0xe')]=router;
\ No newline at end of file
+var _0x8381=['put','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x1c0263,_0xfbc52f){var _0x5c5f07=function(_0xd00858){while(--_0xd00858){_0x1c0263['push'](_0x1c0263['shift']());}};_0x5c5f07(++_0xfbc52f);}(_0x8381,0x148));var _0x1838=function(_0x59da0b,_0x798c56){_0x59da0b=_0x59da0b-0x0;var _0x42baf5=_0x8381[_0x59da0b];return _0x42baf5;};'use strict';var multer=require(_0x1838('0x0'));var util=require(_0x1838('0x1'));var path=require(_0x1838('0x2'));var timeout=require('connect-timeout');var express=require(_0x1838('0x3'));var router=express['Router']();var auth=require(_0x1838('0x4'));var interaction=require(_0x1838('0x5'));var config=require(_0x1838('0x6'));var controller=require('./chatApplication.controller');router[_0x1838('0x7')](_0x1838('0x8'),auth[_0x1838('0x9')](),controller['show']);router[_0x1838('0xa')]('/:id',auth[_0x1838('0x9')](),controller['update']);router[_0x1838('0xb')](_0x1838('0x8'),auth[_0x1838('0x9')](),controller[_0x1838('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index d8bba5d..3e73868 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 _0x35db=['sequelize','STRING','BOOLEAN'];(function(_0x244f8a,_0x5d6b6b){var _0x410e61=function(_0xf15e4f){while(--_0xf15e4f){_0x244f8a['push'](_0x244f8a['shift']());}};_0x410e61(++_0x5d6b6b);}(_0x35db,0x9f));var _0xb35d=function(_0x10a0bc,_0xef10cb){_0x10a0bc=_0x10a0bc-0x0;var _0x823d6e=_0x35db[_0x10a0bc];return _0x823d6e;};'use strict';var Sequelize=require(_0xb35d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb35d('0x1')]},'write':{'type':Sequelize[_0xb35d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x306b=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5c93e2,_0x258141){var _0x39ebad=function(_0x40795d){while(--_0x40795d){_0x5c93e2['push'](_0x5c93e2['shift']());}};_0x39ebad(++_0x258141);}(_0x306b,0xf9));var _0xb306=function(_0x3fa16a,_0x5b5af8){_0x3fa16a=_0x3fa16a-0x0;var _0x314345=_0x306b[_0x3fa16a];return _0x314345;};'use strict';var Sequelize=require(_0xb306('0x0'));module[_0xb306('0x1')]={'name':{'type':Sequelize[_0xb306('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb306('0x2')]},'write':{'type':Sequelize[_0xb306('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 63dfc9a..ab30803 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 _0x40b5=['key','VIRTUAL','field','merge','count','includeAll','include','ChatGroup','findAll','length','find','create','body','update','params','describe','getUnread','user','toInteger','addMembers','ids','omit','User','order','getMembers','hasOwnProperty','removeMembers','addMessage','getMessages','findOne','ChatInternalMessage','$gte','split','format','options','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','Content-Range','json','reject','save','then','destroy','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','map','type'];(function(_0x24ac99,_0x84fb2d){var _0x596b97=function(_0x1488e6){while(--_0x1488e6){_0x24ac99['push'](_0x24ac99['shift']());}};_0x596b97(++_0x84fb2d);}(_0x40b5,0x1db));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x540b('0x0'));var emlformat=require(_0x540b('0x1'));var rimraf=require(_0x540b('0x2'));var zipdir=require(_0x540b('0x3'));var jsonpatch=require(_0x540b('0x4'));var rp=require(_0x540b('0x5'));var moment=require(_0x540b('0x6'));var BPromise=require(_0x540b('0x7'));var Mustache=require('mustache');var util=require(_0x540b('0x8'));var path=require(_0x540b('0x9'));var sox=require(_0x540b('0xa'));var csv=require(_0x540b('0xb'));var ejs=require(_0x540b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x540b('0xd'));var crypto=require(_0x540b('0xe'));var jsforce=require(_0x540b('0xf'));var deskjs=require(_0x540b('0x10'));var toCsv=require(_0x540b('0xb'));var querystring=require(_0x540b('0x11'));var Papa=require(_0x540b('0x12'));var Redis=require(_0x540b('0x13'));var authService=require(_0x540b('0x14'));var qs=require(_0x540b('0x15'));var as=require(_0x540b('0x16'));var hardwareService=require(_0x540b('0x17'));var logger=require(_0x540b('0x18'))('api');var utils=require(_0x540b('0x19'));var config=require(_0x540b('0x1a'));var db=require(_0x540b('0x1b'))['db'];config[_0x540b('0x1c')]=_[_0x540b('0x1d')](config['redis'],{'host':_0x540b('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x540b('0x1c')]));require(_0x540b('0x1f'))[_0x540b('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x540b('0x21')][_0x540b('0x22')]({'port':0x232a});function checkPasswordPattern(_0x3cd7f0,_0x442c70,_0x239bfe){if(_0x239bfe){var _0x3792ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3792ff[_0x540b('0x23')](_0x442c70)){return _0x3cd7f0;}else{throw new Error(_0x540b('0x24'));}}else{return _0x3cd7f0;}}function respondWithRpcPromise(_0x1aa0cd,_0x210845,_0xc4f99a,_0x3e185c){return new BPromise(function(_0x510602,_0x5c6d3d){var _0x3b3ee2=_0x3e185c||client;return _0x3b3ee2[_0x540b('0x25')](_0x1aa0cd,_0xc4f99a)['then'](function(_0x546a7f){logger[_0x540b('0x26')](_0x540b('0x27'),_0x210845,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x210845,_0x540b('0x28'),JSON[_0x540b('0x29')](_0x546a7f));if(_0x546a7f['error']){if(_0x546a7f[_0x540b('0x2a')][_0x540b('0x2b')]===0x1f4){logger[_0x540b('0x2a')](_0x540b('0x27'),_0x210845,_0x546a7f[_0x540b('0x2a')][_0x540b('0x2c')]);return _0x5c6d3d(_0x546a7f[_0x540b('0x2a')]['message']);}logger[_0x540b('0x2a')](_0x540b('0x27'),_0x210845,_0x546a7f[_0x540b('0x2a')][_0x540b('0x2c')]);return _0x510602(_0x546a7f[_0x540b('0x2a')][_0x540b('0x2c')]);}else{logger[_0x540b('0x26')](_0x540b('0x27'),_0x210845,_0x540b('0x28'));_0x510602(_0x546a7f[_0x540b('0x2d')]['message']);}})[_0x540b('0x2e')](function(_0x269a77){logger['error']('ChatGroup,\x20%s,\x20%s',_0x210845,_0x269a77);_0x5c6d3d(_0x269a77);});});}function respondWithStatusCode(_0x2670c3,_0x5cbf91){_0x5cbf91=_0x5cbf91||0xcc;return function(_0x39229a){if(_0x39229a){return _0x2670c3[_0x540b('0x2f')](_0x5cbf91);}return _0x2670c3[_0x540b('0x30')](_0x5cbf91)[_0x540b('0x31')]();};}function respondWithResult(_0x5dbcfc,_0x5ca2c6){_0x5ca2c6=_0x5ca2c6||0xc8;return function(_0xa0af71){if(_0xa0af71){return _0x5dbcfc[_0x540b('0x30')](_0x5ca2c6)['json'](_0xa0af71);}};}function respondWithFilteredResult(_0x21d177,_0x133c95){return function(_0x36ab36){if(_0x36ab36){var _0x5d3024=_0x36ab36['count'],_0x49df69=_0x133c95[_0x540b('0x32')],_0x130dcf=_0x133c95[_0x540b('0x32')]+_0x133c95[_0x540b('0x33')],_0x5c6636;if(_0x130dcf>=_0x5d3024){_0x130dcf=_0x5d3024;_0x5c6636=0xc8;}else{_0x5c6636=0xce;}_0x21d177['status'](_0x5c6636);return _0x21d177['set'](_0x540b('0x34'),_0x49df69+'-'+_0x130dcf+'/'+_0x5d3024)[_0x540b('0x35')](_0x36ab36);}return null;};}function patchUpdates(_0x8b4721){return function(_0x50e5e6){try{jsonpatch['apply'](_0x50e5e6,_0x8b4721,!![]);}catch(_0x1ac3fe){return BPromise[_0x540b('0x36')](_0x1ac3fe);}return _0x50e5e6[_0x540b('0x37')]();};}function saveUpdates(_0xd06e82,_0x2b7a79){return function(_0x3988cc){if(_0x3988cc){return _0x3988cc['update'](_0xd06e82)[_0x540b('0x38')](function(_0x4f8c36){return _0x4f8c36;});}return null;};}function removeEntity(_0x5937b2,_0x1de2a7){return function(_0x4f43ac){if(_0x4f43ac){return _0x4f43ac[_0x540b('0x39')]()[_0x540b('0x38')](function(){_0x5937b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43e59d,_0x481bf2){return function(_0x295078){if(!_0x295078){_0x43e59d[_0x540b('0x2f')](0x194);}return _0x295078;};}function handleError(_0x4b602b,_0x5a6a2d){_0x5a6a2d=_0x5a6a2d||0x1f4;return function(_0x54e4bb){logger['error'](_0x54e4bb['stack']);if(_0x54e4bb['name']){delete _0x54e4bb['name'];}_0x4b602b[_0x540b('0x30')](_0x5a6a2d)[_0x540b('0x3a')](_0x54e4bb);};}exports[_0x540b('0x3b')]=function(_0x4b33a4,_0x2429d3){var _0x217b3e={},_0x3a7f8f={},_0xc13958={'count':0x0,'rows':[]};var _0x181798=db['ChatGroup'][_0x540b('0x3c')];_0x3a7f8f[_0x540b('0x3d')]=_[_0x540b('0x3e')](_0x181798);_0x3a7f8f[_0x540b('0x3f')]=_['keys'](_0x4b33a4[_0x540b('0x3f')]);_0x3a7f8f['filters']=_[_0x540b('0x40')](_0x3a7f8f[_0x540b('0x3d')],_0x3a7f8f[_0x540b('0x3f')]);_0x217b3e[_0x540b('0x41')]=_[_0x540b('0x40')](_0x3a7f8f[_0x540b('0x3d')],qs[_0x540b('0x42')](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x42')]));_0x217b3e['attributes']=_0x217b3e[_0x540b('0x41')]['length']?_0x217b3e[_0x540b('0x41')]:_0x3a7f8f['model'];if(!_0x4b33a4[_0x540b('0x3f')]['hasOwnProperty'](_0x540b('0x43'))){_0x217b3e[_0x540b('0x33')]=qs[_0x540b('0x33')](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x33')]);_0x217b3e[_0x540b('0x32')]=qs['offset'](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x32')]);}_0x217b3e['order']=qs[_0x540b('0x44')](_0x4b33a4[_0x540b('0x3f')][_0x540b('0x44')]);_0x217b3e[_0x540b('0x45')]=qs[_0x540b('0x46')](_[_0x540b('0x47')](_0x4b33a4['query'],_0x3a7f8f[_0x540b('0x46')]));if(_0x4b33a4['query'][_0x540b('0x48')]){_0x217b3e['where']=_['merge'](_0x217b3e[_0x540b('0x45')],{'$or':_[_0x540b('0x49')](_0x181798,function(_0x25d6bd){if(_0x25d6bd[_0x540b('0x4a')][_0x540b('0x4b')]!==_0x540b('0x4c')){var _0x405353={};_0x405353[_0x25d6bd[_0x540b('0x4d')]]={'$like':'%'+_0x4b33a4['query']['filter']+'%'};return _0x405353;}})});}_0x217b3e=_[_0x540b('0x4e')]({},_0x217b3e,_0x4b33a4['options']);var _0x8b4d8c={'where':_0x217b3e[_0x540b('0x45')]};return db['ChatGroup'][_0x540b('0x4f')](_0x8b4d8c)[_0x540b('0x38')](function(_0x4b134d){_0xc13958[_0x540b('0x4f')]=_0x4b134d;if(_0x4b33a4[_0x540b('0x3f')][_0x540b('0x50')]){_0x217b3e[_0x540b('0x51')]=[{'all':!![]}];}return db[_0x540b('0x52')][_0x540b('0x53')](_0x217b3e);})[_0x540b('0x38')](function(_0x27e404){_0xc13958['rows']=_0x27e404;return _0xc13958;})['then'](respondWithFilteredResult(_0x2429d3,_0x217b3e))[_0x540b('0x2e')](handleError(_0x2429d3,null));};exports['show']=function(_0x2e36c1,_0x5c6087){var _0x4d168a={'raw':!![],'where':{'id':_0x2e36c1['params']['id']}},_0x29f340={};_0x29f340[_0x540b('0x3d')]=_['keys'](db[_0x540b('0x52')]['rawAttributes']);_0x29f340[_0x540b('0x3f')]=_[_0x540b('0x3e')](_0x2e36c1['query']);_0x29f340['filters']=_['intersection'](_0x29f340[_0x540b('0x3d')],_0x29f340['query']);_0x4d168a[_0x540b('0x41')]=_[_0x540b('0x40')](_0x29f340[_0x540b('0x3d')],qs[_0x540b('0x42')](_0x2e36c1[_0x540b('0x3f')][_0x540b('0x42')]));_0x4d168a[_0x540b('0x41')]=_0x4d168a['attributes'][_0x540b('0x54')]?_0x4d168a[_0x540b('0x41')]:_0x29f340[_0x540b('0x3d')];if(_0x2e36c1[_0x540b('0x3f')][_0x540b('0x50')]){_0x4d168a['include']=[{'all':!![]}];}_0x4d168a=_[_0x540b('0x4e')]({},_0x4d168a,_0x2e36c1['options']);return db[_0x540b('0x52')][_0x540b('0x55')](_0x4d168a)[_0x540b('0x38')](handleEntityNotFound(_0x5c6087,null))[_0x540b('0x38')](respondWithResult(_0x5c6087,null))[_0x540b('0x2e')](handleError(_0x5c6087,null));};exports[_0x540b('0x56')]=function(_0x5897a8,_0x53d9ef){return db[_0x540b('0x52')][_0x540b('0x56')](_0x5897a8[_0x540b('0x57')],{})['then'](respondWithResult(_0x53d9ef,0xc9))['catch'](handleError(_0x53d9ef,null));};exports[_0x540b('0x58')]=function(_0x204196,_0xff89c3){if(_0x204196[_0x540b('0x57')]['id']){delete _0x204196[_0x540b('0x57')]['id'];}return db[_0x540b('0x52')]['find']({'where':{'id':_0x204196[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0xff89c3,null))[_0x540b('0x38')](saveUpdates(_0x204196['body'],null))[_0x540b('0x38')](respondWithResult(_0xff89c3,null))[_0x540b('0x2e')](handleError(_0xff89c3,null));};exports[_0x540b('0x39')]=function(_0x20e22c,_0x2062db){return db['ChatGroup'][_0x540b('0x55')]({'where':{'id':_0x20e22c['params']['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x2062db,null))[_0x540b('0x38')](removeEntity(_0x2062db,null))[_0x540b('0x2e')](handleError(_0x2062db,null));};exports[_0x540b('0x5a')]=function(_0xf22220,_0x2f9c9e){return db[_0x540b('0x52')][_0x540b('0x5a')]()[_0x540b('0x38')](respondWithResult(_0x2f9c9e,null))['catch'](handleError(_0x2f9c9e,null));};exports[_0x540b('0x5b')]=function(_0x49600d,_0x386550,_0x41bf3a){return db['ChatInternalMessage'][_0x540b('0x4f')]({'where':{'ChatGroupId':_0x49600d[_0x540b('0x59')]['id'],'ToId':_0x49600d[_0x540b('0x5c')]['id'],'read':![]}})[_0x540b('0x38')](function(_0x5b7f24){return{'id':_[_0x540b('0x5d')](_0x49600d['params']['id']),'count':_0x5b7f24};})[_0x540b('0x38')](respondWithResult(_0x386550,null))['catch'](handleError(_0x386550,null));};exports[_0x540b('0x5e')]=function(_0x2bff1f,_0x1b0683,_0x3a1e49){return db['ChatGroup'][_0x540b('0x55')]({'where':{'id':_0x2bff1f[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x1b0683,null))[_0x540b('0x38')](function(_0x18289b){if(_0x18289b){return _0x18289b[_0x540b('0x5e')](_0x2bff1f[_0x540b('0x57')][_0x540b('0x5f')],_[_0x540b('0x60')](_0x2bff1f[_0x540b('0x57')],[_0x540b('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x1b0683,null))['catch'](handleError(_0x1b0683,null));};exports['getMembers']=function(_0x4abdf0,_0x2fc3d5,_0x378609){var _0x1af0a1={};var _0x24a2eb={};var _0x20cec3;var _0x31cc7b;return db[_0x540b('0x52')]['findOne']({'where':{'id':_0x4abdf0[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x2fc3d5,null))[_0x540b('0x38')](function(_0x58b1a3){if(_0x58b1a3){_0x20cec3=_0x58b1a3;_0x24a2eb['model']=_[_0x540b('0x3e')](db[_0x540b('0x61')]['rawAttributes']);_0x24a2eb[_0x540b('0x3f')]=_['keys'](_0x4abdf0['query']);_0x24a2eb[_0x540b('0x46')]=_[_0x540b('0x40')](_0x24a2eb[_0x540b('0x3d')],_0x24a2eb[_0x540b('0x3f')]);_0x1af0a1['attributes']=_[_0x540b('0x40')](_0x24a2eb[_0x540b('0x3d')],qs[_0x540b('0x42')](_0x4abdf0[_0x540b('0x3f')]['fields']));_0x1af0a1[_0x540b('0x41')]=_0x1af0a1[_0x540b('0x41')][_0x540b('0x54')]?_0x1af0a1['attributes']:_0x24a2eb[_0x540b('0x3d')];_0x1af0a1[_0x540b('0x62')]=qs[_0x540b('0x44')](_0x4abdf0[_0x540b('0x3f')][_0x540b('0x44')]);_0x1af0a1[_0x540b('0x45')]=qs[_0x540b('0x46')](_[_0x540b('0x47')](_0x4abdf0['query'],_0x24a2eb[_0x540b('0x46')]));if(_0x4abdf0[_0x540b('0x3f')]['filter']){_0x1af0a1['where']=_[_0x540b('0x4e')](_0x1af0a1['where'],{'$or':_[_0x540b('0x49')](_0x1af0a1[_0x540b('0x41')],function(_0x4966e8){var _0x2f5946={};_0x2f5946[_0x4966e8]={'$like':'%'+_0x4abdf0[_0x540b('0x3f')][_0x540b('0x48')]+'%'};return _0x2f5946;})});}_0x1af0a1=_[_0x540b('0x4e')]({},_0x1af0a1,_0x4abdf0['options']);return _0x20cec3[_0x540b('0x63')](_0x1af0a1);}})[_0x540b('0x38')](function(_0x22d56c){if(_0x22d56c){_0x31cc7b=_0x22d56c[_0x540b('0x54')];if(!_0x4abdf0[_0x540b('0x3f')][_0x540b('0x64')](_0x540b('0x43'))){_0x1af0a1[_0x540b('0x33')]=qs['limit'](_0x4abdf0[_0x540b('0x3f')]['limit']);_0x1af0a1[_0x540b('0x32')]=qs['offset'](_0x4abdf0[_0x540b('0x3f')][_0x540b('0x32')]);}return _0x20cec3[_0x540b('0x63')](_0x1af0a1);}})[_0x540b('0x38')](function(_0xe42382){if(_0xe42382){return _0xe42382?{'count':_0x31cc7b,'rows':_0xe42382}:null;}})[_0x540b('0x38')](respondWithResult(_0x2fc3d5,null))[_0x540b('0x2e')](handleError(_0x2fc3d5,null));};exports[_0x540b('0x65')]=function(_0x5d0764,_0x5f475a,_0x937848){return db[_0x540b('0x52')][_0x540b('0x55')]({'where':{'id':_0x5d0764[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x5f475a,null))[_0x540b('0x38')](function(_0x236bfb){if(_0x236bfb){return _0x236bfb['removeMembers'](_0x5d0764[_0x540b('0x3f')][_0x540b('0x5f')]);}})[_0x540b('0x38')](respondWithStatusCode(_0x5f475a,null))[_0x540b('0x2e')](handleError(_0x5f475a,null));};exports[_0x540b('0x66')]=function(_0x53f9f6,_0x20962d,_0x3af234){if(_0x53f9f6[_0x540b('0x57')]['id']){delete _0x53f9f6[_0x540b('0x57')]['id'];}return db['ChatGroup'][_0x540b('0x55')]({'where':{'id':_0x53f9f6[_0x540b('0x59')]['id']}})['then'](handleEntityNotFound(_0x20962d,null))[_0x540b('0x38')](function(_0x5e0f37){if(_0x5e0f37){_0x53f9f6[_0x540b('0x57')]['ChatGroupId']=_0x5e0f37['id'];return db['ChatInternalMessage'][_0x540b('0x56')](_0x53f9f6[_0x540b('0x57')]);}})[_0x540b('0x38')](respondWithResult(_0x20962d,null))[_0x540b('0x2e')](handleError(_0x20962d,null));};exports[_0x540b('0x67')]=function(_0x1167ee,_0x8eeba9,_0x344d18){var _0x178e22={};var _0x127d67={};var _0xac7874;var _0x50008c;return db['ChatGroup'][_0x540b('0x68')]({'where':{'id':_0x1167ee[_0x540b('0x59')]['id']}})[_0x540b('0x38')](handleEntityNotFound(_0x8eeba9,null))[_0x540b('0x38')](function(_0x4c8418){if(_0x4c8418){_0xac7874=_0x4c8418;_0x127d67[_0x540b('0x3d')]=_['keys'](db[_0x540b('0x69')]['rawAttributes']);_0x127d67['query']=_[_0x540b('0x3e')](_0x1167ee[_0x540b('0x3f')]);_0x127d67[_0x540b('0x46')]=_['intersection'](_0x127d67[_0x540b('0x3d')],_0x127d67[_0x540b('0x3f')]);_0x178e22[_0x540b('0x41')]=_[_0x540b('0x40')](_0x127d67['model'],qs['fields'](_0x1167ee[_0x540b('0x3f')][_0x540b('0x42')]));_0x178e22['attributes']=_0x178e22[_0x540b('0x41')][_0x540b('0x54')]?_0x178e22[_0x540b('0x41')]:_0x127d67[_0x540b('0x3d')];_0x178e22[_0x540b('0x62')]=qs[_0x540b('0x44')](_0x1167ee[_0x540b('0x3f')][_0x540b('0x44')]);_0x178e22[_0x540b('0x45')]=qs[_0x540b('0x46')](_[_0x540b('0x47')](_0x1167ee[_0x540b('0x3f')],_0x127d67[_0x540b('0x46')]));if(_0x1167ee[_0x540b('0x3f')][_0x540b('0x48')]){_0x178e22[_0x540b('0x45')]=_['merge'](_0x178e22[_0x540b('0x45')],{'$or':_[_0x540b('0x49')](_0x178e22[_0x540b('0x41')],function(_0x8877ef){var _0x104444={};_0x104444[_0x8877ef]={'$like':'%'+_0x1167ee['query'][_0x540b('0x48')]+'%'};return _0x104444;})});}if(_0x1167ee[_0x540b('0x3f')][_0x540b('0x6a')]){var _0x570867=_0x1167ee[_0x540b('0x3f')][_0x540b('0x6a')][_0x540b('0x6b')](',');var _0x3b4338={};_0x3b4338[_0x570867[0x0]]={'$gte':moment(_0x570867[0x1])[_0x540b('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x178e22['where']=_[_0x540b('0x4e')](_0x178e22[_0x540b('0x45')],_0x3b4338);}_0x178e22=_[_0x540b('0x4e')]({},_0x178e22,_0x1167ee[_0x540b('0x6d')]);return _0xac7874[_0x540b('0x67')](_0x178e22);}})[_0x540b('0x38')](function(_0xed2e7f){if(_0xed2e7f){_0x50008c=_0xed2e7f['length'];if(!_0x1167ee['query'][_0x540b('0x64')](_0x540b('0x43'))){_0x178e22['limit']=qs[_0x540b('0x33')](_0x1167ee[_0x540b('0x3f')][_0x540b('0x33')]);_0x178e22[_0x540b('0x32')]=qs[_0x540b('0x32')](_0x1167ee['query'][_0x540b('0x32')]);}return _0xac7874[_0x540b('0x67')](_0x178e22);}})['then'](function(_0x1878da){if(_0x1878da){return _0x1878da?{'count':_0x50008c,'rows':_0x1878da}:null;}})[_0x540b('0x38')](respondWithResult(_0x8eeba9,null))[_0x540b('0x2e')](handleError(_0x8eeba9,null));};
\ No newline at end of file
+var _0xda80=['destroy','end','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','VIRTUAL','filter','options','ChatGroup','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','User','pick','removeMembers','addMessage','ChatGroupId','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x18134e,_0x431cdf){var _0x7d5edf=function(_0x5a8090){while(--_0x5a8090){_0x18134e['push'](_0x18134e['shift']());}};_0x7d5edf(++_0x431cdf);}(_0xda80,0x116));var _0x0da8=function(_0xbbeebe,_0x2b0774){_0xbbeebe=_0xbbeebe-0x0;var _0xb4171e=_0xda80[_0xbbeebe];return _0xb4171e;};'use strict';var pdf=require(_0x0da8('0x0'));var emlformat=require(_0x0da8('0x1'));var rimraf=require(_0x0da8('0x2'));var zipdir=require(_0x0da8('0x3'));var jsonpatch=require(_0x0da8('0x4'));var rp=require('request-promise');var moment=require(_0x0da8('0x5'));var BPromise=require(_0x0da8('0x6'));var Mustache=require(_0x0da8('0x7'));var util=require(_0x0da8('0x8'));var path=require(_0x0da8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0da8('0xa'));var fs=require('fs');var _=require(_0x0da8('0xb'));var squel=require('squel');var crypto=require(_0x0da8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0da8('0xd'));var querystring=require(_0x0da8('0xe'));var Papa=require(_0x0da8('0xf'));var Redis=require(_0x0da8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0da8('0x11'));var as=require(_0x0da8('0x12'));var hardwareService=require(_0x0da8('0x13'));var logger=require(_0x0da8('0x14'))(_0x0da8('0x15'));var utils=require(_0x0da8('0x16'));var config=require(_0x0da8('0x17'));var db=require(_0x0da8('0x18'))['db'];config[_0x0da8('0x19')]=_[_0x0da8('0x1a')](config[_0x0da8('0x19')],{'host':_0x0da8('0x1b'),'port':0x18eb});var socket=require(_0x0da8('0x1c'))(new Redis(config[_0x0da8('0x19')]));require(_0x0da8('0x1d'))[_0x0da8('0x1e')](socket);var jayson=require(_0x0da8('0x1f'));var client=jayson[_0x0da8('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x17c2a7,_0x250caf,_0x4fa96d){if(_0x4fa96d){var _0x36cace=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36cace['test'](_0x250caf)){return _0x17c2a7;}else{throw new Error(_0x0da8('0x21'));}}else{return _0x17c2a7;}}function respondWithRpcPromise(_0x5d4d0e,_0x389158,_0x5e9d2f,_0x5d378a){return new BPromise(function(_0x1994f7,_0x595322){var _0x1572c6=_0x5d378a||client;return _0x1572c6['request'](_0x5d4d0e,_0x5e9d2f)[_0x0da8('0x22')](function(_0x4884e9){logger[_0x0da8('0x23')](_0x0da8('0x24'),_0x389158,_0x0da8('0x25'));logger[_0x0da8('0x26')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x389158,_0x0da8('0x25'),JSON[_0x0da8('0x27')](_0x4884e9));if(_0x4884e9[_0x0da8('0x28')]){if(_0x4884e9['error'][_0x0da8('0x29')]===0x1f4){logger[_0x0da8('0x28')]('ChatGroup,\x20%s,\x20%s',_0x389158,_0x4884e9[_0x0da8('0x28')][_0x0da8('0x2a')]);return _0x595322(_0x4884e9[_0x0da8('0x28')][_0x0da8('0x2a')]);}logger[_0x0da8('0x28')](_0x0da8('0x24'),_0x389158,_0x4884e9['error']['message']);return _0x1994f7(_0x4884e9[_0x0da8('0x28')]['message']);}else{logger[_0x0da8('0x23')](_0x0da8('0x24'),_0x389158,_0x0da8('0x25'));_0x1994f7(_0x4884e9[_0x0da8('0x2b')]['message']);}})[_0x0da8('0x2c')](function(_0x5cc597){logger[_0x0da8('0x28')](_0x0da8('0x24'),_0x389158,_0x5cc597);_0x595322(_0x5cc597);});});}function respondWithStatusCode(_0x248a2f,_0x44a8c9){_0x44a8c9=_0x44a8c9||0xcc;return function(_0x2675f9){if(_0x2675f9){return _0x248a2f['sendStatus'](_0x44a8c9);}return _0x248a2f['status'](_0x44a8c9)['end']();};}function respondWithResult(_0x423967,_0x279174){_0x279174=_0x279174||0xc8;return function(_0x5910ec){if(_0x5910ec){return _0x423967[_0x0da8('0x2d')](_0x279174)[_0x0da8('0x2e')](_0x5910ec);}};}function respondWithFilteredResult(_0x231424,_0x4fa471){return function(_0x584d57){if(_0x584d57){var _0x3e755a=_0x584d57['count'],_0x2db399=_0x4fa471[_0x0da8('0x2f')],_0x3c54f9=_0x4fa471[_0x0da8('0x2f')]+_0x4fa471[_0x0da8('0x30')],_0x34cc2a;if(_0x3c54f9>=_0x3e755a){_0x3c54f9=_0x3e755a;_0x34cc2a=0xc8;}else{_0x34cc2a=0xce;}_0x231424[_0x0da8('0x2d')](_0x34cc2a);return _0x231424[_0x0da8('0x31')](_0x0da8('0x32'),_0x2db399+'-'+_0x3c54f9+'/'+_0x3e755a)[_0x0da8('0x2e')](_0x584d57);}return null;};}function patchUpdates(_0x5cf5ce){return function(_0x39b938){try{jsonpatch[_0x0da8('0x33')](_0x39b938,_0x5cf5ce,!![]);}catch(_0x263a48){return BPromise[_0x0da8('0x34')](_0x263a48);}return _0x39b938[_0x0da8('0x35')]();};}function saveUpdates(_0x58a87b,_0x547670){return function(_0x21e5ef){if(_0x21e5ef){return _0x21e5ef[_0x0da8('0x36')](_0x58a87b)[_0x0da8('0x22')](function(_0x58f667){return _0x58f667;});}return null;};}function removeEntity(_0x2aa3ee,_0x219928){return function(_0x58fa3b){if(_0x58fa3b){return _0x58fa3b[_0x0da8('0x37')]()[_0x0da8('0x22')](function(){_0x2aa3ee['status'](0xcc)[_0x0da8('0x38')]();});}};}function handleEntityNotFound(_0x21c4f5,_0x334064){return function(_0x380222){if(!_0x380222){_0x21c4f5[_0x0da8('0x39')](0x194);}return _0x380222;};}function handleError(_0x1cefcf,_0x3e6a0b){_0x3e6a0b=_0x3e6a0b||0x1f4;return function(_0xfb72f5){logger[_0x0da8('0x28')](_0xfb72f5[_0x0da8('0x3a')]);if(_0xfb72f5[_0x0da8('0x3b')]){delete _0xfb72f5[_0x0da8('0x3b')];}_0x1cefcf[_0x0da8('0x2d')](_0x3e6a0b)[_0x0da8('0x3c')](_0xfb72f5);};}exports[_0x0da8('0x3d')]=function(_0x428dd6,_0x1c1168){var _0x50ca4f={},_0x5ea27a={},_0x11cb7b={'count':0x0,'rows':[]};var _0xc74a83=db['ChatGroup'][_0x0da8('0x3e')];_0x5ea27a[_0x0da8('0x3f')]=_[_0x0da8('0x40')](_0xc74a83);_0x5ea27a['query']=_[_0x0da8('0x40')](_0x428dd6[_0x0da8('0x41')]);_0x5ea27a[_0x0da8('0x42')]=_[_0x0da8('0x43')](_0x5ea27a['model'],_0x5ea27a[_0x0da8('0x41')]);_0x50ca4f[_0x0da8('0x44')]=_[_0x0da8('0x43')](_0x5ea27a[_0x0da8('0x3f')],qs[_0x0da8('0x45')](_0x428dd6[_0x0da8('0x41')][_0x0da8('0x45')]));_0x50ca4f[_0x0da8('0x44')]=_0x50ca4f['attributes'][_0x0da8('0x46')]?_0x50ca4f[_0x0da8('0x44')]:_0x5ea27a[_0x0da8('0x3f')];if(!_0x428dd6['query'][_0x0da8('0x47')](_0x0da8('0x48'))){_0x50ca4f[_0x0da8('0x30')]=qs[_0x0da8('0x30')](_0x428dd6[_0x0da8('0x41')][_0x0da8('0x30')]);_0x50ca4f['offset']=qs[_0x0da8('0x2f')](_0x428dd6[_0x0da8('0x41')]['offset']);}_0x50ca4f[_0x0da8('0x49')]=qs[_0x0da8('0x4a')](_0x428dd6[_0x0da8('0x41')][_0x0da8('0x4a')]);_0x50ca4f[_0x0da8('0x4b')]=qs[_0x0da8('0x42')](_['pick'](_0x428dd6[_0x0da8('0x41')],_0x5ea27a[_0x0da8('0x42')]));if(_0x428dd6[_0x0da8('0x41')]['filter']){_0x50ca4f['where']=_[_0x0da8('0x4c')](_0x50ca4f[_0x0da8('0x4b')],{'$or':_[_0x0da8('0x4d')](_0xc74a83,function(_0x52350d){if(_0x52350d['type'][_0x0da8('0x4e')]!==_0x0da8('0x4f')){var _0x1768ed={};_0x1768ed[_0x52350d['field']]={'$like':'%'+_0x428dd6[_0x0da8('0x41')][_0x0da8('0x50')]+'%'};return _0x1768ed;}})});}_0x50ca4f=_[_0x0da8('0x4c')]({},_0x50ca4f,_0x428dd6[_0x0da8('0x51')]);var _0x4754e7={'where':_0x50ca4f[_0x0da8('0x4b')]};return db[_0x0da8('0x52')][_0x0da8('0x53')](_0x4754e7)[_0x0da8('0x22')](function(_0x47ab57){_0x11cb7b['count']=_0x47ab57;if(_0x428dd6[_0x0da8('0x41')][_0x0da8('0x54')]){_0x50ca4f[_0x0da8('0x55')]=[{'all':!![]}];}return db[_0x0da8('0x52')][_0x0da8('0x56')](_0x50ca4f);})[_0x0da8('0x22')](function(_0x3e53c9){_0x11cb7b[_0x0da8('0x57')]=_0x3e53c9;return _0x11cb7b;})['then'](respondWithFilteredResult(_0x1c1168,_0x50ca4f))[_0x0da8('0x2c')](handleError(_0x1c1168,null));};exports[_0x0da8('0x58')]=function(_0x107bb3,_0x519b50){var _0x41cdbe={'raw':!![],'where':{'id':_0x107bb3[_0x0da8('0x59')]['id']}},_0x401f79={};_0x401f79[_0x0da8('0x3f')]=_['keys'](db[_0x0da8('0x52')][_0x0da8('0x3e')]);_0x401f79['query']=_['keys'](_0x107bb3[_0x0da8('0x41')]);_0x401f79['filters']=_[_0x0da8('0x43')](_0x401f79[_0x0da8('0x3f')],_0x401f79[_0x0da8('0x41')]);_0x41cdbe['attributes']=_[_0x0da8('0x43')](_0x401f79[_0x0da8('0x3f')],qs[_0x0da8('0x45')](_0x107bb3[_0x0da8('0x41')][_0x0da8('0x45')]));_0x41cdbe['attributes']=_0x41cdbe[_0x0da8('0x44')]['length']?_0x41cdbe[_0x0da8('0x44')]:_0x401f79[_0x0da8('0x3f')];if(_0x107bb3[_0x0da8('0x41')][_0x0da8('0x54')]){_0x41cdbe[_0x0da8('0x55')]=[{'all':!![]}];}_0x41cdbe=_[_0x0da8('0x4c')]({},_0x41cdbe,_0x107bb3['options']);return db[_0x0da8('0x52')][_0x0da8('0x5a')](_0x41cdbe)[_0x0da8('0x22')](handleEntityNotFound(_0x519b50,null))[_0x0da8('0x22')](respondWithResult(_0x519b50,null))[_0x0da8('0x2c')](handleError(_0x519b50,null));};exports[_0x0da8('0x5b')]=function(_0x5073b2,_0x2239da){return db[_0x0da8('0x52')][_0x0da8('0x5b')](_0x5073b2['body'],{})[_0x0da8('0x22')](respondWithResult(_0x2239da,0xc9))[_0x0da8('0x2c')](handleError(_0x2239da,null));};exports[_0x0da8('0x36')]=function(_0x39fc8b,_0x58221c){if(_0x39fc8b['body']['id']){delete _0x39fc8b[_0x0da8('0x5c')]['id'];}return db[_0x0da8('0x52')][_0x0da8('0x5a')]({'where':{'id':_0x39fc8b['params']['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x58221c,null))[_0x0da8('0x22')](saveUpdates(_0x39fc8b[_0x0da8('0x5c')],null))[_0x0da8('0x22')](respondWithResult(_0x58221c,null))[_0x0da8('0x2c')](handleError(_0x58221c,null));};exports[_0x0da8('0x37')]=function(_0x54de77,_0x6966d5){return db['ChatGroup']['find']({'where':{'id':_0x54de77[_0x0da8('0x59')]['id']}})['then'](handleEntityNotFound(_0x6966d5,null))['then'](removeEntity(_0x6966d5,null))['catch'](handleError(_0x6966d5,null));};exports[_0x0da8('0x5d')]=function(_0x48fb51,_0x1c0232){return db[_0x0da8('0x52')]['describe']()[_0x0da8('0x22')](respondWithResult(_0x1c0232,null))[_0x0da8('0x2c')](handleError(_0x1c0232,null));};exports[_0x0da8('0x5e')]=function(_0x42dc52,_0x111954,_0x136376){return db[_0x0da8('0x5f')]['count']({'where':{'ChatGroupId':_0x42dc52[_0x0da8('0x59')]['id'],'ToId':_0x42dc52[_0x0da8('0x60')]['id'],'read':![]}})[_0x0da8('0x22')](function(_0x1a3eb8){return{'id':_['toInteger'](_0x42dc52['params']['id']),'count':_0x1a3eb8};})[_0x0da8('0x22')](respondWithResult(_0x111954,null))[_0x0da8('0x2c')](handleError(_0x111954,null));};exports['addMembers']=function(_0x10a09e,_0x2b38fb,_0x1f1bd3){return db[_0x0da8('0x52')]['find']({'where':{'id':_0x10a09e[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x2b38fb,null))[_0x0da8('0x22')](function(_0x99581e){if(_0x99581e){return _0x99581e[_0x0da8('0x61')](_0x10a09e[_0x0da8('0x5c')][_0x0da8('0x62')],_['omit'](_0x10a09e['body'],['ids','id'])||{});}})[_0x0da8('0x22')](respondWithResult(_0x2b38fb,null))['catch'](handleError(_0x2b38fb,null));};exports[_0x0da8('0x63')]=function(_0x2ed5fd,_0x35a111,_0x55419c){var _0x49de53={};var _0x4b673e={};var _0x59b81f;var _0xc73787;return db[_0x0da8('0x52')]['findOne']({'where':{'id':_0x2ed5fd[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x35a111,null))['then'](function(_0x141106){if(_0x141106){_0x59b81f=_0x141106;_0x4b673e[_0x0da8('0x3f')]=_[_0x0da8('0x40')](db[_0x0da8('0x64')][_0x0da8('0x3e')]);_0x4b673e[_0x0da8('0x41')]=_['keys'](_0x2ed5fd[_0x0da8('0x41')]);_0x4b673e[_0x0da8('0x42')]=_['intersection'](_0x4b673e[_0x0da8('0x3f')],_0x4b673e[_0x0da8('0x41')]);_0x49de53[_0x0da8('0x44')]=_[_0x0da8('0x43')](_0x4b673e['model'],qs[_0x0da8('0x45')](_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x45')]));_0x49de53[_0x0da8('0x44')]=_0x49de53[_0x0da8('0x44')][_0x0da8('0x46')]?_0x49de53[_0x0da8('0x44')]:_0x4b673e[_0x0da8('0x3f')];_0x49de53[_0x0da8('0x49')]=qs['sort'](_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x4a')]);_0x49de53[_0x0da8('0x4b')]=qs[_0x0da8('0x42')](_[_0x0da8('0x65')](_0x2ed5fd[_0x0da8('0x41')],_0x4b673e['filters']));if(_0x2ed5fd[_0x0da8('0x41')]['filter']){_0x49de53['where']=_[_0x0da8('0x4c')](_0x49de53[_0x0da8('0x4b')],{'$or':_[_0x0da8('0x4d')](_0x49de53[_0x0da8('0x44')],function(_0x464ebb){var _0x53b8c3={};_0x53b8c3[_0x464ebb]={'$like':'%'+_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x50')]+'%'};return _0x53b8c3;})});}_0x49de53=_[_0x0da8('0x4c')]({},_0x49de53,_0x2ed5fd[_0x0da8('0x51')]);return _0x59b81f[_0x0da8('0x63')](_0x49de53);}})[_0x0da8('0x22')](function(_0x1c0c83){if(_0x1c0c83){_0xc73787=_0x1c0c83[_0x0da8('0x46')];if(!_0x2ed5fd[_0x0da8('0x41')]['hasOwnProperty'](_0x0da8('0x48'))){_0x49de53[_0x0da8('0x30')]=qs['limit'](_0x2ed5fd[_0x0da8('0x41')]['limit']);_0x49de53[_0x0da8('0x2f')]=qs[_0x0da8('0x2f')](_0x2ed5fd[_0x0da8('0x41')][_0x0da8('0x2f')]);}return _0x59b81f[_0x0da8('0x63')](_0x49de53);}})[_0x0da8('0x22')](function(_0x2bd854){if(_0x2bd854){return _0x2bd854?{'count':_0xc73787,'rows':_0x2bd854}:null;}})[_0x0da8('0x22')](respondWithResult(_0x35a111,null))[_0x0da8('0x2c')](handleError(_0x35a111,null));};exports['removeMembers']=function(_0x2ee3d7,_0x17357b,_0x157fde){return db[_0x0da8('0x52')][_0x0da8('0x5a')]({'where':{'id':_0x2ee3d7['params']['id']}})['then'](handleEntityNotFound(_0x17357b,null))['then'](function(_0x267180){if(_0x267180){return _0x267180[_0x0da8('0x66')](_0x2ee3d7[_0x0da8('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x17357b,null))[_0x0da8('0x2c')](handleError(_0x17357b,null));};exports[_0x0da8('0x67')]=function(_0x3f65c7,_0x16850f,_0x3e7ea6){if(_0x3f65c7[_0x0da8('0x5c')]['id']){delete _0x3f65c7['body']['id'];}return db['ChatGroup'][_0x0da8('0x5a')]({'where':{'id':_0x3f65c7[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x16850f,null))['then'](function(_0xee4932){if(_0xee4932){_0x3f65c7[_0x0da8('0x5c')][_0x0da8('0x68')]=_0xee4932['id'];return db[_0x0da8('0x5f')]['create'](_0x3f65c7[_0x0da8('0x5c')]);}})[_0x0da8('0x22')](respondWithResult(_0x16850f,null))['catch'](handleError(_0x16850f,null));};exports['getMessages']=function(_0x479966,_0x21decd,_0x38672f){var _0x340e3c={};var _0x552220={};var _0x5e96cb;var _0x30328a;return db['ChatGroup'][_0x0da8('0x69')]({'where':{'id':_0x479966[_0x0da8('0x59')]['id']}})[_0x0da8('0x22')](handleEntityNotFound(_0x21decd,null))[_0x0da8('0x22')](function(_0x39158b){if(_0x39158b){_0x5e96cb=_0x39158b;_0x552220[_0x0da8('0x3f')]=_[_0x0da8('0x40')](db[_0x0da8('0x5f')][_0x0da8('0x3e')]);_0x552220[_0x0da8('0x41')]=_[_0x0da8('0x40')](_0x479966[_0x0da8('0x41')]);_0x552220[_0x0da8('0x42')]=_[_0x0da8('0x43')](_0x552220[_0x0da8('0x3f')],_0x552220[_0x0da8('0x41')]);_0x340e3c[_0x0da8('0x44')]=_[_0x0da8('0x43')](_0x552220[_0x0da8('0x3f')],qs['fields'](_0x479966[_0x0da8('0x41')][_0x0da8('0x45')]));_0x340e3c['attributes']=_0x340e3c[_0x0da8('0x44')][_0x0da8('0x46')]?_0x340e3c[_0x0da8('0x44')]:_0x552220[_0x0da8('0x3f')];_0x340e3c[_0x0da8('0x49')]=qs[_0x0da8('0x4a')](_0x479966[_0x0da8('0x41')][_0x0da8('0x4a')]);_0x340e3c[_0x0da8('0x4b')]=qs[_0x0da8('0x42')](_['pick'](_0x479966['query'],_0x552220[_0x0da8('0x42')]));if(_0x479966[_0x0da8('0x41')]['filter']){_0x340e3c['where']=_[_0x0da8('0x4c')](_0x340e3c[_0x0da8('0x4b')],{'$or':_[_0x0da8('0x4d')](_0x340e3c['attributes'],function(_0x231a2f){var _0x490f5e={};_0x490f5e[_0x231a2f]={'$like':'%'+_0x479966[_0x0da8('0x41')][_0x0da8('0x50')]+'%'};return _0x490f5e;})});}if(_0x479966['query'][_0x0da8('0x6a')]){var _0xcba6fb=_0x479966[_0x0da8('0x41')][_0x0da8('0x6a')][_0x0da8('0x6b')](',');var _0x281c15={};_0x281c15[_0xcba6fb[0x0]]={'$gte':moment(_0xcba6fb[0x1])[_0x0da8('0x6c')](_0x0da8('0x6d'))};_0x340e3c['where']=_[_0x0da8('0x4c')](_0x340e3c[_0x0da8('0x4b')],_0x281c15);}_0x340e3c=_['merge']({},_0x340e3c,_0x479966[_0x0da8('0x51')]);return _0x5e96cb[_0x0da8('0x6e')](_0x340e3c);}})['then'](function(_0x1fdb31){if(_0x1fdb31){_0x30328a=_0x1fdb31[_0x0da8('0x46')];if(!_0x479966['query'][_0x0da8('0x47')]('nolimit')){_0x340e3c[_0x0da8('0x30')]=qs[_0x0da8('0x30')](_0x479966[_0x0da8('0x41')][_0x0da8('0x30')]);_0x340e3c[_0x0da8('0x2f')]=qs[_0x0da8('0x2f')](_0x479966[_0x0da8('0x41')][_0x0da8('0x2f')]);}return _0x5e96cb[_0x0da8('0x6e')](_0x340e3c);}})[_0x0da8('0x22')](function(_0x306511){if(_0x306511){return _0x306511?{'count':_0x30328a,'rows':_0x306511}:null;}})[_0x0da8('0x22')](respondWithResult(_0x21decd,null))['catch'](handleError(_0x21decd,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index d0a9120..de38c1c 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 _0xe6a8=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x38f8d3,_0x4f226b){var _0x24faa3=function(_0x42aa5b){while(--_0x42aa5b){_0x38f8d3['push'](_0x38f8d3['shift']());}};_0x24faa3(++_0x4f226b);}(_0xe6a8,0x1c7));var _0x8e6a=function(_0x6649e7,_0x10e609){_0x6649e7=_0x6649e7-0x0;var _0x1634e8=_0xe6a8[_0x6649e7];return _0x1634e8;};'use strict';var EventEmitter=require(_0x8e6a('0x0'));var ChatGroup=require(_0x8e6a('0x1'))['db'][_0x8e6a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8e6a('0x3')](0x0);var events={'afterCreate':_0x8e6a('0x4'),'afterUpdate':_0x8e6a('0x5'),'afterDestroy':_0x8e6a('0x6')};function emitEvent(_0x527988){return function(_0x208608,_0x49399c,_0x2d26fd){ChatGroupEvents[_0x8e6a('0x7')](_0x527988+':'+_0x208608['id'],_0x208608);ChatGroupEvents[_0x8e6a('0x7')](_0x527988,_0x208608);_0x2d26fd(null);};}for(var e in events){if(events[_0x8e6a('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8e6a('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xceb1=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','ChatGroup'];(function(_0x1c7ce3,_0x560247){var _0x4f57cc=function(_0x2993f6){while(--_0x2993f6){_0x1c7ce3['push'](_0x1c7ce3['shift']());}};_0x4f57cc(++_0x560247);}(_0xceb1,0x8d));var _0x1ceb=function(_0x1c12f8,_0x4d76a9){_0x1c12f8=_0x1c12f8-0x0;var _0x53e492=_0xceb1[_0x1c12f8];return _0x53e492;};'use strict';var EventEmitter=require(_0x1ceb('0x0'));var ChatGroup=require(_0x1ceb('0x1'))['db'][_0x1ceb('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1ceb('0x3')](0x0);var events={'afterCreate':_0x1ceb('0x4'),'afterUpdate':_0x1ceb('0x5'),'afterDestroy':_0x1ceb('0x6')};function emitEvent(_0x593bc2){return function(_0x435647,_0x43d8ba,_0x323bd0){ChatGroupEvents['emit'](_0x593bc2+':'+_0x435647['id'],_0x435647);ChatGroupEvents[_0x1ceb('0x7')](_0x593bc2,_0x435647);_0x323bd0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x1ceb('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 231bd32..4103576 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 _0x7c22=['lodash','util','api','moment','request-promise','path','./chatGroup.attributes','define','ChatGroup'];(function(_0x3c9999,_0x2cfc2d){var _0x3bc334=function(_0x592c7c){while(--_0x592c7c){_0x3c9999['push'](_0x3c9999['shift']());}};_0x3bc334(++_0x2cfc2d);}(_0x7c22,0x6c));var _0x27c2=function(_0x3da448,_0x3ae546){_0x3da448=_0x3da448-0x0;var _0x2e88f8=_0x7c22[_0x3da448];return _0x2e88f8;};'use strict';var _=require(_0x27c2('0x0'));var util=require(_0x27c2('0x1'));var logger=require('../../config/logger')(_0x27c2('0x2'));var moment=require(_0x27c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x27c2('0x4'));var fs=require('fs');var path=require(_0x27c2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x27c2('0x6'));module['exports']=function(_0x28548d,_0x5006bd){return _0x28548d[_0x27c2('0x7')](_0x27c2('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x885a,0x180));var _0xa885=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x885a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'chat_groups','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 55823c0..229a8e5 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 _0x2c12=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x244a49,_0x22a349){var _0x2519c2=function(_0x3edc63){while(--_0x3edc63){_0x244a49['push'](_0x244a49['shift']());}};_0x2519c2(++_0x22a349);}(_0x2c12,0xf3));var _0x22c1=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x2c12[_0x2a0183];return _0x158c3a;};'use strict';var _=require(_0x22c1('0x0'));var util=require(_0x22c1('0x1'));var moment=require(_0x22c1('0x2'));var BPromise=require(_0x22c1('0x3'));var rs=require(_0x22c1('0x4'));var fs=require('fs');var Redis=require(_0x22c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x22c1('0x6'))(_0x22c1('0x7'));var config=require('../../config/environment');var jayson=require(_0x22c1('0x8'));var client=jayson[_0x22c1('0x9')][_0x22c1('0xa')]({'port':0x232a});config['redis']=_[_0x22c1('0xb')](config[_0x22c1('0xc')],{'host':_0x22c1('0xd'),'port':0x18eb});var socket=require(_0x22c1('0xe'))(new Redis(config[_0x22c1('0xc')]));require(_0x22c1('0xf'))[_0x22c1('0x10')](socket);function respondWithRpcPromise(_0x5081f0,_0x51420a,_0x5abb74){return new BPromise(function(_0x4718fb,_0xe72bc6){return client[_0x22c1('0x11')](_0x5081f0,_0x5abb74)[_0x22c1('0x12')](function(_0x12db96){logger[_0x22c1('0x13')](_0x22c1('0x14'),_0x51420a,_0x22c1('0x15'));logger[_0x22c1('0x16')](_0x22c1('0x17'),_0x51420a,'request\x20sent',JSON[_0x22c1('0x18')](_0x12db96));if(_0x12db96[_0x22c1('0x19')]){if(_0x12db96['error'][_0x22c1('0x1a')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x51420a,_0x12db96[_0x22c1('0x19')][_0x22c1('0x1b')]);return _0xe72bc6(_0x12db96['error']['message']);}logger[_0x22c1('0x19')](_0x22c1('0x14'),_0x51420a,_0x12db96[_0x22c1('0x19')][_0x22c1('0x1b')]);return _0x4718fb(_0x12db96[_0x22c1('0x19')][_0x22c1('0x1b')]);}else{logger[_0x22c1('0x13')](_0x22c1('0x14'),_0x51420a,'request\x20sent');_0x4718fb(_0x12db96[_0x22c1('0x1c')][_0x22c1('0x1b')]);}})['catch'](function(_0x166cbf){logger[_0x22c1('0x19')](_0x22c1('0x14'),_0x51420a,_0x166cbf);_0xe72bc6(_0x166cbf);});});}
\ No newline at end of file
+var _0xcdfe=['./chatGroup.socket','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5bbfc9,_0x3a0f20){var _0x52a9ba=function(_0x57aff5){while(--_0x57aff5){_0x5bbfc9['push'](_0x5bbfc9['shift']());}};_0x52a9ba(++_0x3a0f20);}(_0xcdfe,0x1c3));var _0xecdf=function(_0x45bcfe,_0x618e1c){_0x45bcfe=_0x45bcfe-0x0;var _0x7a17d4=_0xcdfe[_0x45bcfe];return _0x7a17d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xecdf('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecdf('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0xecdf('0x2'))(_0xecdf('0x3'));var config=require(_0xecdf('0x4'));var jayson=require(_0xecdf('0x5'));var client=jayson['client'][_0xecdf('0x6')]({'port':0x232a});config[_0xecdf('0x7')]=_[_0xecdf('0x8')](config[_0xecdf('0x7')],{'host':_0xecdf('0x9'),'port':0x18eb});var socket=require(_0xecdf('0xa'))(new Redis(config[_0xecdf('0x7')]));require(_0xecdf('0xb'))['register'](socket);function respondWithRpcPromise(_0x3e8fae,_0x404df5,_0x58f30b){return new BPromise(function(_0xb3d7ff,_0x21194e){return client['request'](_0x3e8fae,_0x58f30b)[_0xecdf('0xc')](function(_0x335baa){logger[_0xecdf('0xd')](_0xecdf('0xe'),_0x404df5,_0xecdf('0xf'));logger[_0xecdf('0x10')](_0xecdf('0x11'),_0x404df5,_0xecdf('0xf'),JSON['stringify'](_0x335baa));if(_0x335baa[_0xecdf('0x12')]){if(_0x335baa[_0xecdf('0x12')][_0xecdf('0x13')]===0x1f4){logger[_0xecdf('0x12')]('ChatGroup,\x20%s,\x20%s',_0x404df5,_0x335baa[_0xecdf('0x12')][_0xecdf('0x14')]);return _0x21194e(_0x335baa['error'][_0xecdf('0x14')]);}logger[_0xecdf('0x12')]('ChatGroup,\x20%s,\x20%s',_0x404df5,_0x335baa['error'][_0xecdf('0x14')]);return _0xb3d7ff(_0x335baa[_0xecdf('0x12')][_0xecdf('0x14')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x404df5,'request\x20sent');_0xb3d7ff(_0x335baa['result'][_0xecdf('0x14')]);}})[_0xecdf('0x15')](function(_0x8b8e17){logger['error']('ChatGroup,\x20%s,\x20%s',_0x404df5,_0x8b8e17);_0x21194e(_0x8b8e17);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 9232330..8b05686 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 _0xe603=['save','remove','update','emit','removeListener','register','length','./chatGroup.events'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe603,0x16f));var _0x3e60=function(_0x29e513,_0x44cb99){_0x29e513=_0x29e513-0x0;var _0x70792b=_0xe603[_0x29e513];return _0x70792b;};'use strict';var ChatGroupEvents=require(_0x3e60('0x0'));var events=[_0x3e60('0x1'),_0x3e60('0x2'),_0x3e60('0x3')];function createListener(_0x581ba1,_0x1d5e39){return function(_0x5663dd){_0x1d5e39[_0x3e60('0x4')](_0x581ba1,_0x5663dd);};}function removeListener(_0xb48900,_0x324ced){return function(){ChatGroupEvents[_0x3e60('0x5')](_0xb48900,_0x324ced);};}exports[_0x3e60('0x6')]=function(_0x195b6e){for(var _0x4d619a=0x0,_0x73dc04=events[_0x3e60('0x7')];_0x4d619a<_0x73dc04;_0x4d619a++){var _0x353dfc=events[_0x4d619a];var _0x5d3467=createListener('chatGroup:'+_0x353dfc,_0x195b6e);ChatGroupEvents['on'](_0x353dfc,_0x5d3467);}};
\ No newline at end of file
+var _0xc495=['emit','removeListener','register','length','chatGroup:','remove','update'];(function(_0x4221e0,_0x474373){var _0x3e5d3c=function(_0x1c1874){while(--_0x1c1874){_0x4221e0['push'](_0x4221e0['shift']());}};_0x3e5d3c(++_0x474373);}(_0xc495,0x7c));var _0x5c49=function(_0x2c0af1,_0x4b5709){_0x2c0af1=_0x2c0af1-0x0;var _0x53fe48=_0xc495[_0x2c0af1];return _0x53fe48;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x5c49('0x0'),_0x5c49('0x1')];function createListener(_0x17958a,_0x26c214){return function(_0x4ce9ea){_0x26c214[_0x5c49('0x2')](_0x17958a,_0x4ce9ea);};}function removeListener(_0x5f1f27,_0x51ab93){return function(){ChatGroupEvents[_0x5c49('0x3')](_0x5f1f27,_0x51ab93);};}exports[_0x5c49('0x4')]=function(_0x434dfa){for(var _0x40eeb3=0x0,_0x356d76=events[_0x5c49('0x5')];_0x40eeb3<_0x356d76;_0x40eeb3++){var _0xcc0216=events[_0x40eeb3];var _0x157826=createListener(_0x5c49('0x6')+_0xcc0216,_0x434dfa);ChatGroupEvents['on'](_0xcc0216,_0x157826);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 800970e..d7459b0 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 _0xe8f3=['index','get','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xe8f3,0xc6));var _0x3e8f=function(_0x3b6320,_0x43164f){_0x3b6320=_0x3b6320-0x0;var _0x5c70a4=_0xe8f3[_0x3b6320];return _0x5c70a4;};'use strict';var multer=require('multer');var util=require(_0x3e8f('0x0'));var path=require(_0x3e8f('0x1'));var timeout=require(_0x3e8f('0x2'));var express=require(_0x3e8f('0x3'));var router=express[_0x3e8f('0x4')]();var auth=require(_0x3e8f('0x5'));var interaction=require(_0x3e8f('0x6'));var config=require(_0x3e8f('0x7'));var controller=require(_0x3e8f('0x8'));router['get']('/',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xa')]);router[_0x3e8f('0xb')]('/describe',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xc')]);router[_0x3e8f('0xb')](_0x3e8f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x3e8f('0xb')](_0x3e8f('0xe'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0xf')]);router[_0x3e8f('0xb')](_0x3e8f('0x10'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x11')]);router[_0x3e8f('0xb')](_0x3e8f('0x12'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x13')]);router[_0x3e8f('0x14')]('/',auth[_0x3e8f('0x9')](),controller['create']);router[_0x3e8f('0x14')]('/:id/members',auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x15')]);router[_0x3e8f('0x14')](_0x3e8f('0x12'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x16')]);router[_0x3e8f('0x17')](_0x3e8f('0xd'),auth[_0x3e8f('0x9')](),controller['update']);router[_0x3e8f('0x18')](_0x3e8f('0xd'),auth[_0x3e8f('0x9')](),controller[_0x3e8f('0x19')]);router[_0x3e8f('0x18')](_0x3e8f('0x10'),auth[_0x3e8f('0x9')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x2ec0=['post','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x1c3be5,_0x43a6ae){var _0x57b3a5=function(_0x5e5f3d){while(--_0x5e5f3d){_0x1c3be5['push'](_0x1c3be5['shift']());}};_0x57b3a5(++_0x43a6ae);}(_0x2ec0,0x117));var _0x02ec=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x2ec0[_0x339129];return _0x1570df;};'use strict';var multer=require('multer');var util=require(_0x02ec('0x0'));var path=require(_0x02ec('0x1'));var timeout=require(_0x02ec('0x2'));var express=require(_0x02ec('0x3'));var router=express['Router']();var auth=require(_0x02ec('0x4'));var interaction=require(_0x02ec('0x5'));var config=require(_0x02ec('0x6'));var controller=require(_0x02ec('0x7'));router[_0x02ec('0x8')]('/',auth[_0x02ec('0x9')](),controller[_0x02ec('0xa')]);router[_0x02ec('0x8')](_0x02ec('0xb'),auth[_0x02ec('0x9')](),controller[_0x02ec('0xc')]);router[_0x02ec('0x8')](_0x02ec('0xd'),auth[_0x02ec('0x9')](),controller[_0x02ec('0xe')]);router[_0x02ec('0x8')](_0x02ec('0xf'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x10')]);router['get'](_0x02ec('0x11'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x12')]);router['get'](_0x02ec('0x13'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x14')]);router[_0x02ec('0x15')]('/',auth[_0x02ec('0x9')](),controller['create']);router[_0x02ec('0x15')](_0x02ec('0x11'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x16')]);router[_0x02ec('0x15')](_0x02ec('0x13'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x17')]);router[_0x02ec('0x18')](_0x02ec('0xd'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x19')]);router[_0x02ec('0x1a')](_0x02ec('0xd'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x1b')]);router['delete'](_0x02ec('0x11'),auth[_0x02ec('0x9')](),controller[_0x02ec('0x1c')]);module[_0x02ec('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index caf930c..9ef0730 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 _0x102b=['thumb','TEXT','STRING','long','DATE','out','exports','INTEGER','ENUM','star'];(function(_0x487c8f,_0x310704){var _0xe20c5f=function(_0x40fc9d){while(--_0x40fc9d){_0x487c8f['push'](_0x487c8f['shift']());}};_0xe20c5f(++_0x310704);}(_0x102b,0x1be));var _0xb102=function(_0x1d02a2,_0x452270){_0x1d02a2=_0x1d02a2-0x0;var _0x1e6d2e=_0x102b[_0x1d02a2];return _0x1e6d2e;};'use strict';var Sequelize=require('sequelize');module[_0xb102('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb102('0x1')]},'ratingType':{'type':Sequelize[_0xb102('0x2')](_0xb102('0x3'),_0xb102('0x4')),'defaultValue':_0xb102('0x3')},'ratingMessage':{'type':Sequelize[_0xb102('0x5')]},'pathTranscript':{'type':Sequelize[_0xb102('0x5')]},'mailTranscript':{'type':Sequelize[_0xb102('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb102('0x6')]},'note':{'type':Sequelize[_0xb102('0x6')]},'browserName':{'type':Sequelize[_0xb102('0x6')]},'browserVersion':{'type':Sequelize[_0xb102('0x6')]},'osName':{'type':Sequelize[_0xb102('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xb102('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xb102('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb102('0x7'))},'read1stAt':{'type':Sequelize[_0xb102('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb102('0x2')]('in',_0xb102('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xb102('0x6')]},'customerPort':{'type':Sequelize[_0xb102('0x6')]}};
\ No newline at end of file
+var _0x5e11=['sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','long','out'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x5e11,0x1c3));var _0x15e1=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x5e11[_0x2becba];return _0x90b5dd;};'use strict';var Sequelize=require(_0x15e1('0x0'));module['exports']={'closed':{'type':Sequelize[_0x15e1('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x15e1('0x2')]},'ratingType':{'type':Sequelize[_0x15e1('0x3')](_0x15e1('0x4'),_0x15e1('0x5')),'defaultValue':_0x15e1('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x15e1('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x15e1('0x7')]},'disposition':{'type':Sequelize[_0x15e1('0x8')]},'note':{'type':Sequelize[_0x15e1('0x8')]},'browserName':{'type':Sequelize[_0x15e1('0x8')]},'browserVersion':{'type':Sequelize[_0x15e1('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x15e1('0x8')]},'deviceModel':{'type':Sequelize[_0x15e1('0x8')]},'deviceVendor':{'type':Sequelize[_0x15e1('0x8')]},'deviceType':{'type':Sequelize[_0x15e1('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x15e1('0x8')]},'formData':{'type':Sequelize[_0x15e1('0x6')](_0x15e1('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x15e1('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x15e1('0x3')]('in',_0x15e1('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x15e1('0x8')]},'customerPort':{'type':Sequelize[_0x15e1('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 97cb060..2c20031 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 _0x3e68=['i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.ChatInteractionId\x20=\x20i.id','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','body','find','describe','customUpdate','abandon','sendStatus','ValidationError','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','type','mimetype','Attachment','findOne','Unauthorized','root','close','mailTranscript','format','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','UserId','%s%d','agentAlias','customer','agentIdentifier','System','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','Smtp','service','host','port','authentication','auth','user','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','alias','findAll','addTags','setTags','Tag','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','ChatWebsite','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','30px','
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
','YYYY-MM-DD','mkdirSync','Account','N.A.','closedAt','osName','customerIp','customerPort','tail','createReadStream','createWriteStream','out','renderFile','views','downloadInteraction.html','transcript-','.pdf','download','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','test','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','Users','map','TagIds','split','forEach','Tags','push','ChatInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','expr','advancedFilter','matchType','substr','omit','omitBy','options','custom','columns','hasMultipleConditions','value','values','table','getConditionValue','isRangeCondition','parseOperator','having','$between','`\x20>\x200','isNil','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','i.id','unreadMessages','DESC','tag','isArray','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition'];(function(_0x41cdcf,_0x5402c7){var _0x57651d=function(_0x26c39b){while(--_0x26c39b){_0x41cdcf['push'](_0x41cdcf['shift']());}};_0x57651d(++_0x5402c7);}(_0x3e68,0x82));var _0x83e6=function(_0x5e4cb0,_0x4dcfd4){_0x5e4cb0=_0x5e4cb0-0x0;var _0x45d913=_0x3e68[_0x5e4cb0];return _0x45d913;};'use strict';var pdf=require(_0x83e6('0x0'));var emlformat=require(_0x83e6('0x1'));var rimraf=require(_0x83e6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83e6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83e6('0x4'));var util=require(_0x83e6('0x5'));var path=require(_0x83e6('0x6'));var sox=require(_0x83e6('0x7'));var csv=require(_0x83e6('0x8'));var ejs=require(_0x83e6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x83e6('0xa'));var crypto=require('crypto');var jsforce=require(_0x83e6('0xb'));var deskjs=require(_0x83e6('0xc'));var toCsv=require(_0x83e6('0x8'));var querystring=require('querystring');var Papa=require(_0x83e6('0xd'));var Redis=require(_0x83e6('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83e6('0xf'));var hardwareService=require(_0x83e6('0x10'));var logger=require(_0x83e6('0x11'))(_0x83e6('0x12'));var utils=require(_0x83e6('0x13'));var config=require(_0x83e6('0x14'));var db=require('../../mysqldb')['db'];config[_0x83e6('0x15')]=_[_0x83e6('0x16')](config[_0x83e6('0x15')],{'host':_0x83e6('0x17'),'port':0x18eb});var socket=require(_0x83e6('0x18'))(new Redis(config[_0x83e6('0x15')]));require(_0x83e6('0x19'))['register'](socket);var jayson=require(_0x83e6('0x1a'));var client=jayson[_0x83e6('0x1b')][_0x83e6('0x1c')]({'port':0x232b});var client9004=jayson[_0x83e6('0x1b')][_0x83e6('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x393b3d,_0x53b95e,_0x128a90){if(_0x128a90){var _0xfe0ba1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfe0ba1[_0x83e6('0x1d')](_0x53b95e)){return _0x393b3d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x393b3d;}}function respondWithRpcPromise(_0xe717fb,_0x5659bc,_0x257fbe,_0x22a467){return new BPromise(function(_0x30516c,_0x71fd47){var _0x4e4e0f=_0x22a467||client;return _0x4e4e0f['request'](_0xe717fb,_0x257fbe)[_0x83e6('0x1e')](function(_0x44fe63){logger['info'](_0x83e6('0x1f'),_0x5659bc,_0x83e6('0x20'));logger[_0x83e6('0x21')](_0x83e6('0x22'),_0x5659bc,_0x83e6('0x20'),JSON[_0x83e6('0x23')](_0x44fe63));if(_0x44fe63[_0x83e6('0x24')]){if(_0x44fe63[_0x83e6('0x24')][_0x83e6('0x25')]===0x1f4){logger[_0x83e6('0x24')](_0x83e6('0x1f'),_0x5659bc,_0x44fe63[_0x83e6('0x24')][_0x83e6('0x26')]);return _0x71fd47(_0x44fe63['error']['message']);}logger[_0x83e6('0x24')](_0x83e6('0x1f'),_0x5659bc,_0x44fe63[_0x83e6('0x24')]['message']);return _0x30516c(_0x44fe63[_0x83e6('0x24')]['message']);}else{logger[_0x83e6('0x27')](_0x83e6('0x1f'),_0x5659bc,_0x83e6('0x20'));_0x30516c(_0x44fe63[_0x83e6('0x28')][_0x83e6('0x26')]);}})[_0x83e6('0x29')](function(_0x467ae5){logger[_0x83e6('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x5659bc,_0x467ae5);_0x71fd47(_0x467ae5);});});}function respondWithStatusCode(_0x28e2ce,_0x3d94da){_0x3d94da=_0x3d94da||0xcc;return function(_0x14012a){if(_0x14012a){return _0x28e2ce['sendStatus'](_0x3d94da);}return _0x28e2ce['status'](_0x3d94da)[_0x83e6('0x2a')]();};}function respondWithResult(_0x38fd4d,_0x4b820a){_0x4b820a=_0x4b820a||0xc8;return function(_0x546ed5){if(_0x546ed5){return _0x38fd4d['status'](_0x4b820a)[_0x83e6('0x2b')](_0x546ed5);}};}function respondWithFilteredResult(_0x5026f1,_0x186435){return function(_0x3fbdd9){if(_0x3fbdd9){var _0x2bddb7=_0x3fbdd9[_0x83e6('0x2c')],_0x2a3a25=_0x186435[_0x83e6('0x2d')],_0x308273=_0x186435[_0x83e6('0x2d')]+_0x186435[_0x83e6('0x2e')],_0x540e5f;if(_0x308273>=_0x2bddb7){_0x308273=_0x2bddb7;_0x540e5f=0xc8;}else{_0x540e5f=0xce;}_0x5026f1['status'](_0x540e5f);return _0x5026f1['set'](_0x83e6('0x2f'),_0x2a3a25+'-'+_0x308273+'/'+_0x2bddb7)[_0x83e6('0x2b')](_0x3fbdd9);}return null;};}function patchUpdates(_0x373e26){return function(_0x49afda){try{jsonpatch[_0x83e6('0x30')](_0x49afda,_0x373e26,!![]);}catch(_0x144513){return BPromise[_0x83e6('0x31')](_0x144513);}return _0x49afda[_0x83e6('0x32')]();};}function saveUpdates(_0x26bb09,_0x1ed29f){return function(_0x4ff8b4){if(_0x4ff8b4){return _0x4ff8b4[_0x83e6('0x33')](_0x26bb09)['then'](function(_0x156fb7){return _0x156fb7;});}return null;};}function removeEntity(_0x39efe9,_0x5b4bc5){return function(_0xa279c0){if(_0xa279c0){return _0xa279c0[_0x83e6('0x34')]()['then'](function(){_0x39efe9[_0x83e6('0x35')](0xcc)[_0x83e6('0x2a')]();});}};}function handleEntityNotFound(_0x483f8d,_0x2652ad){return function(_0x171739){if(!_0x171739){_0x483f8d['sendStatus'](0x194);}return _0x171739;};}function handleError(_0x542048,_0x516b34){_0x516b34=_0x516b34||0x1f4;return function(_0x10f199){logger[_0x83e6('0x24')](_0x10f199[_0x83e6('0x36')]);if(_0x10f199[_0x83e6('0x37')]){delete _0x10f199[_0x83e6('0x37')];}_0x542048[_0x83e6('0x35')](_0x516b34)[_0x83e6('0x38')](_0x10f199);};}function getInteractionUsers(_0x56a004,_0x3645c0){return new BPromise(function(_0x43f6ad,_0x436ac3){try{if(_0x3645c0[_0x56a004['id']]){_0x56a004[_0x83e6('0x39')]=_[_0x83e6('0x3a')](_0x3645c0[_0x56a004['id']],function(_0x1f57fd){return{'id':_0x1f57fd['id']};});}}catch(_0x5f2631){_0x436ac3(_0x5f2631);}_0x43f6ad(_0x56a004);});}function getInteractionTags(_0x4811a8,_0x56f51f){return new BPromise(function(_0x1b6344,_0x521fa8){try{if(_0x4811a8[_0x83e6('0x3b')]){_0x4811a8['Tags']=[];_0x4811a8[_0x83e6('0x3b')][_0x83e6('0x3c')](',')[_0x83e6('0x3d')](function(_0x4dd95c){_0x4811a8[_0x83e6('0x3e')][_0x83e6('0x3f')](_0x56f51f[_0x4dd95c]);});}delete _0x4811a8[_0x83e6('0x3b')];}catch(_0x56b370){_0x521fa8(_0x56b370);}_0x1b6344(_0x4811a8);});}function updateChatInteraction(_0x38d016,_0xd2ed9e,_0x1b6c28){return new BPromise(function(_0x5d8333,_0x4b13d2){return getInteractionUsers(_0x38d016,_0x1b6c28)[_0x83e6('0x1e')](function(_0x58c190){return getInteractionTags(_0x58c190,_0xd2ed9e);})[_0x83e6('0x1e')](function(_0x5568fb){_0x5d8333(_0x5568fb);})['catch'](function(_0x3ce12b){_0x4b13d2(_0x3ce12b);});});}exports['index']=function(_0x1f9d7e,_0x27aad){var _0x5e640f={},_0x177ca4={},_0x27a617={'count':0x0,'rows':[]};var _0x3c9ec0=db[_0x83e6('0x40')][_0x83e6('0x41')];_0x177ca4[_0x83e6('0x42')]=_[_0x83e6('0x43')](_0x3c9ec0);_0x177ca4['query']=_[_0x83e6('0x43')](_0x1f9d7e[_0x83e6('0x44')]);_0x177ca4[_0x83e6('0x45')]=_[_0x83e6('0x46')](_0x177ca4[_0x83e6('0x42')],_0x177ca4[_0x83e6('0x44')]);_0x5e640f[_0x83e6('0x47')]=_[_0x83e6('0x46')](_0x177ca4[_0x83e6('0x42')],qs['fields'](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x48')]));_0x5e640f[_0x83e6('0x47')]=_0x5e640f[_0x83e6('0x47')][_0x83e6('0x49')]?_0x5e640f[_0x83e6('0x47')]:_0x177ca4[_0x83e6('0x42')];if(!_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x4a')](_0x83e6('0x4b'))){_0x5e640f[_0x83e6('0x2e')]=qs[_0x83e6('0x2e')](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x2e')]);_0x5e640f[_0x83e6('0x2d')]=qs['offset'](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x2d')]);}_0x5e640f[_0x83e6('0x4c')]=qs[_0x83e6('0x4d')](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x4d')]);_0x5e640f[_0x83e6('0x4e')]=qs[_0x83e6('0x45')](_[_0x83e6('0x4f')](_0x1f9d7e[_0x83e6('0x44')],_0x177ca4['filters']));var _0xdac6e4=[];var _0x107d7d=squel[_0x83e6('0x50')]()[_0x83e6('0x51')]('id')[_0x83e6('0x51')]('name')[_0x83e6('0x51')](_0x83e6('0x52'))[_0x83e6('0x53')]('tools_tags');var _0x2aa358=squel[_0x83e6('0x50')]()[_0x83e6('0x51')](_0x83e6('0x54'))[_0x83e6('0x51')]('ui.ChatInteractionId')[_0x83e6('0x53')](_0x83e6('0x55'),'ui')[_0x83e6('0x56')](_0x83e6('0x57'),'u','u.id\x20=\x20ui.UserId');var _0x4d1a08=squel[_0x83e6('0x50')]()[_0x83e6('0x53')](_0x83e6('0x58'),'i')['left_join'](_0x83e6('0x59'),'c',_0x83e6('0x5a'))['left_join'](_0x83e6('0x57'),'o',_0x83e6('0x5b'))[_0x83e6('0x56')](_0x83e6('0x5c'),'a',_0x83e6('0x5d'))['left_join']('chat_messages','me',_0x83e6('0x5e'));var _0x3d82a4=squel[_0x83e6('0x5f')]();var _0x483ea3=_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x60')]?JSON['parse'](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x60')]):undefined;if(_0x483ea3){var _0x9954a6=_0x483ea3[_0x83e6('0x61')][_0x83e6('0x62')](0x1);_(_0x483ea3)[_0x83e6('0x63')](_0x83e6('0x61'))[_0x83e6('0x64')](function(_0xde46f8,_0x4c28ce){return _0xde46f8[_0x83e6('0x65')][_0x83e6('0x66')]===!![];})[_0x83e6('0x43')]()[_0x83e6('0x3d')](function(_0x5c7969){var _0xd38298=_0x483ea3[_0x5c7969];if(_0xd38298['options'][_0x83e6('0x67')]){var _0x1d789e=squel[_0x83e6('0x5f')]();if(as[_0x83e6('0x68')](_0xd38298[_0x83e6('0x69')])){var _0x2b4816=_[_0x83e6('0x6a')](_0xd38298[_0x83e6('0x69')])[0x0];_0x2b4816['forEach'](function(_0x3945ec){_0xd38298[_0x83e6('0x65')][_0x83e6('0x67')]['forEach'](function(_0x46b195){_0x1d789e['or'](_0xd38298[_0x83e6('0x65')][_0x83e6('0x6b')]+'.'+_0x46b195+'\x20'+as['parseOperator'](_0x3945ec),as[_0x83e6('0x6c')](_0x3945ec));});});}else{var _0x957ce2=as[_0x83e6('0x6d')](_0xd38298['value'])?_0xd38298[_0x83e6('0x69')][0x1]:undefined;_0xd38298[_0x83e6('0x65')]['columns'][_0x83e6('0x3d')](function(_0x4bcdb1){_0x1d789e['or'](_0xd38298[_0x83e6('0x65')][_0x83e6('0x6b')]+'.'+_0x4bcdb1+'\x20'+as[_0x83e6('0x6e')](_0xd38298[_0x83e6('0x69')]),as[_0x83e6('0x6c')](_0xd38298[_0x83e6('0x69')]),_0x957ce2);});}_0x3d82a4[_0x9954a6](_0x1d789e);}else if(as['hasMultipleConditions'](_0xd38298['value'])){var _0x2b4816=_[_0x83e6('0x6a')](_0xd38298[_0x83e6('0x69')])[0x0];_0x2b4816[_0x83e6('0x3d')](function(_0x4c51cf){if(!_0xd38298[_0x83e6('0x65')][_0x83e6('0x6f')]){var _0x160a3c=as[_0x83e6('0x6d')](_0x4c51cf)?_0x4c51cf[_0x83e6('0x70')][0x1]:undefined;_0x3d82a4[_0x9954a6](_0xd38298[_0x83e6('0x65')]['table']+'.'+_0x5c7969+'\x20'+as[_0x83e6('0x6e')](_0x4c51cf),as[_0x83e6('0x6c')](_0x4c51cf),_0x160a3c);}});}else{if(_0xd38298[_0x83e6('0x65')]['having']){var _0x2ffb3d=as[_0x83e6('0x6c')](_0xd38298[_0x83e6('0x69')]);if(_0x2ffb3d['length']===0x1){if(_0x2ffb3d==0x1){_0x4d1a08[_0x83e6('0x6f')]('`'+_0x5c7969+'`\x20=\x200');}else{_0x4d1a08[_0x83e6('0x6f')]('`'+_0x5c7969+_0x83e6('0x71'));}}}else{var _0x957ce2=as[_0x83e6('0x6d')](_0xd38298['value'])?_0xd38298[_0x83e6('0x69')][_0x83e6('0x70')][0x1]:undefined;_0x3d82a4[_0x9954a6](_0xd38298[_0x83e6('0x65')][_0x83e6('0x6b')]+'.'+_0x5c7969+'\x20'+as[_0x83e6('0x6e')](_0xd38298[_0x83e6('0x69')]),as[_0x83e6('0x6c')](_0xd38298['value']),_0x957ce2);}}});}else{var _0x4ce7cc=_(Object[_0x83e6('0x43')](_0x1f9d7e[_0x83e6('0x44')]))[_0x83e6('0x3a')](function(_0x5be714){return _0x3c9ec0[_0x83e6('0x4a')](_0x5be714)?_0x5be714:undefined;})['filter'](function(_0x35fa88){return!_[_0x83e6('0x72')](_0x35fa88);})[_0x83e6('0x69')]();if(!_['isEmpty'](_0x4ce7cc)){_0x4ce7cc[_0x83e6('0x3d')](function(_0x195d9d){if(_0x195d9d===_0x83e6('0x73')){_0x4d1a08['where'](_0x83e6('0x74'),[]['concat'](_0x1f9d7e[_0x83e6('0x44')][_0x195d9d]));}else if(_0x195d9d===_0x83e6('0x75')){var _0x2d70c1=JSON[_0x83e6('0x76')](_0x1f9d7e[_0x83e6('0x44')][_0x195d9d])['$gte'];var _0x4269a3=JSON['parse'](_0x1f9d7e[_0x83e6('0x44')][_0x195d9d])[_0x83e6('0x77')];_0x4d1a08[_0x83e6('0x4e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2d70c1,_0x4269a3);}else{if(_0x1f9d7e['query'][_0x195d9d]==='null'){_0x4d1a08[_0x83e6('0x4e')]('i.'+_0x195d9d+_0x83e6('0x78'));}else{_0x4d1a08['where']('i.'+_0x195d9d+'\x20=\x20?',_0x1f9d7e[_0x83e6('0x44')][_0x195d9d]);}}});}if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x79')]){if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x79')]==0x1){_0x4d1a08['having'](_0x83e6('0x7a'));}else{_0x4d1a08['having'](_0x83e6('0x7b'));}}if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x7c')]){var _0x2292c4=_0x1f9d7e[_0x83e6('0x44')]['filter'][_0x83e6('0x7d')]('\x5c','\x5c\x5c')[_0x83e6('0x7d')]('\x27\x27',_0x83e6('0x7e'));if(qs['isNumeric'](_0x2292c4)){_0x3d82a4['or'](_0x83e6('0x7f'),_0x2292c4+'%');}else{var _0x28604d=[];_0x2292c4[_0x83e6('0x3c')]('\x20')[_0x83e6('0x3d')](function(_0x98e3a0){_0x28604d[_0x83e6('0x3f')]('+'+_0x98e3a0['toString']());});var _0x11906f=_0x28604d[_0x83e6('0x80')]('\x20');_0x3d82a4['or'](_0x83e6('0x81'),_0x11906f)['or'](_0x83e6('0x82'),_0x2292c4+'%');}}}_0x4d1a08[_0x83e6('0x4e')](_0x3d82a4);_0x4d1a08['group']('i.id');var _0x24a0e8={'type':db[_0x83e6('0x83')][_0x83e6('0x84')]['SELECT'],'raw':!![]};var _0x4db528=_0x4d1a08['clone']();_0x4db528[_0x83e6('0x51')](_0x83e6('0x85'));_0x4db528[_0x83e6('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x83e6('0x86'));if(_0x5e640f['order']){_0x5e640f['order'][_0x83e6('0x3d')](function(_0x5134ca){_0x4d1a08[_0x83e6('0x4c')]('i.'+_0x5134ca[0x0],_0x5134ca[0x1]===_0x83e6('0x87')?![]:!![]);});}var _0x43bade=[];var _0x48c9be=squel[_0x83e6('0x5f')]();if(!_0x483ea3){if(_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x88')]){_0x43bade=_[_0x83e6('0x89')](_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x88')])?_0x1f9d7e[_0x83e6('0x44')][_0x83e6('0x88')]:new Array(_0x1f9d7e['query'][_0x83e6('0x88')]);_0x43bade['forEach'](function(_0x106ea3){_0x48c9be['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x106ea3+',%');});_0x4d1a08[_0x83e6('0x6f')](_0x48c9be);_0x4db528[_0x83e6('0x56')](_0x83e6('0x8a'),'it','it.ChatInteractionId\x20=\x20i.id');_0x4db528['left_join'](_0x83e6('0x8b'),'t',_0x83e6('0x8c'));_0x4db528[_0x83e6('0x4e')](_0x83e6('0x8d'),_0x43bade);}}else{if(_0x483ea3[_0x83e6('0x4a')]('TagId')){if(as[_0x83e6('0x68')](_0x483ea3[_0x83e6('0x8e')][_0x83e6('0x69')])){var _0x4cad09=_[_0x83e6('0x6a')](_0x483ea3[_0x83e6('0x8e')][_0x83e6('0x69')])[0x0];_0x4cad09[_0x83e6('0x3d')](function(_0x1f5612){as['getConditionValue'](_0x1f5612)[_0x83e6('0x3d')](function(_0x101621){_0x43bade[_0x83e6('0x3f')](_0x101621);});});}else{_0x43bade=as[_0x83e6('0x6c')](_0x483ea3[_0x83e6('0x8e')][_0x83e6('0x69')]);}_0x43bade[_0x83e6('0x3d')](function(_0x3c4fe3){_0x48c9be['or'](_0x83e6('0x8f'),'%,'+_0x3c4fe3+',%');});_0x4d1a08[_0x83e6('0x6f')](_0x48c9be);_0x4db528[_0x83e6('0x56')](_0x83e6('0x90'),'it',_0x83e6('0x91'));_0x4db528['left_join'](_0x83e6('0x8b'),'t',_0x83e6('0x8c'));_0x4db528[_0x83e6('0x4e')](_0x83e6('0x8d'),_0x43bade);}}db[_0x83e6('0x92')]['query'](_0x4db528['toString'](),_0x24a0e8)[_0x83e6('0x1e')](function(_0x1f7c6b){_0x27a617[_0x83e6('0x2c')]=_0x1f7c6b['length'];if(_0x27a617[_0x83e6('0x2c')]===0x0)return[];return db[_0x83e6('0x92')][_0x83e6('0x44')](_0x107d7d[_0x83e6('0x93')](),_0x24a0e8)[_0x83e6('0x1e')](function(_0x9fe8b){_0xdac6e4=_['keyBy'](_0x9fe8b,'id');_0x24a0e8=_[_0x83e6('0x94')](_0x24a0e8,{'model':db[_0x83e6('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x95'),_0x83e6('0x86'));_0x4d1a08[_0x83e6('0x51')]('a.key','Account.key');_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x96'),'Account.mandatoryDisposition');_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x97'));_0x4d1a08['field']('c.firstName',_0x83e6('0x98'));_0x4d1a08['field'](_0x83e6('0x99'),_0x83e6('0x9a'));_0x4d1a08['field'](_0x83e6('0x9b'),_0x83e6('0x9c'));_0x4d1a08[_0x83e6('0x51')](_0x83e6('0x9d'),_0x83e6('0x9e'));_0x4d1a08['field'](_0x83e6('0x9f'),_0x83e6('0xa0'));_0x4d1a08[_0x83e6('0x51')](_0x83e6('0xa1'),_0x83e6('0xa2'));_0x4d1a08[_0x83e6('0x51')](_0x83e6('0xa3'),_0x83e6('0x3b'));_0x4d1a08['left_join'](_0x83e6('0x8a'),'it',_0x83e6('0xa4'));_0x4d1a08['left_join'](_0x83e6('0x8b'),'t',_0x83e6('0x8c'));_0x4d1a08[_0x83e6('0x2e')](_0x5e640f['limit']);_0x4d1a08['offset'](_0x5e640f[_0x83e6('0x2d')]);return db['sequelize']['query'](_0x4d1a08['toString'](),_0x24a0e8);})[_0x83e6('0x1e')](function(_0x5411df){_0x2aa358[_0x83e6('0x4e')](_0x83e6('0xa5'),_[_0x83e6('0x3a')](_0x5411df,'id'));return db[_0x83e6('0x92')][_0x83e6('0x44')](_0x2aa358[_0x83e6('0x93')](),_0x24a0e8)['then'](function(_0x2e1260){var _0x297dcd=_[_0x83e6('0xa6')](_0x2e1260,_0x83e6('0xa7'));var _0x243b95=[];_0x5411df[_0x83e6('0x3d')](function(_0x5e6296){_0x243b95[_0x83e6('0x3f')](updateChatInteraction(_0x5e6296,_0xdac6e4,_0x297dcd));});return BPromise[_0x83e6('0xa8')](_0x243b95);});});})[_0x83e6('0x1e')](function(_0x404692){_0x27a617[_0x83e6('0xa9')]=_0x404692;return _0x27a617;})[_0x83e6('0x1e')](respondWithFilteredResult(_0x27aad,_0x5e640f))[_0x83e6('0x29')](handleError(_0x27aad,null));};exports[_0x83e6('0xaa')]=function(_0x204463,_0x2659ae){var _0x51d4c5={'raw':![],'where':{'id':_0x204463[_0x83e6('0xab')]['id']}},_0x3c4b56={};_0x3c4b56[_0x83e6('0x42')]=_['keys'](db['ChatInteraction'][_0x83e6('0x41')]);_0x3c4b56[_0x83e6('0x44')]=_['keys'](_0x204463[_0x83e6('0x44')]);_0x3c4b56[_0x83e6('0x45')]=_['intersection'](_0x3c4b56[_0x83e6('0x42')],_0x3c4b56[_0x83e6('0x44')]);_0x51d4c5[_0x83e6('0x47')]=_[_0x83e6('0x46')](_0x3c4b56['model'],qs[_0x83e6('0x48')](_0x204463['query']['fields']));_0x51d4c5[_0x83e6('0x47')]=_0x51d4c5[_0x83e6('0x47')]['length']?_0x51d4c5['attributes']:_0x3c4b56['model'];if(_0x204463[_0x83e6('0x44')][_0x83e6('0xac')]){_0x51d4c5[_0x83e6('0xad')]=[{'all':!![]}];}_0x51d4c5=_[_0x83e6('0x94')]({},_0x51d4c5,_0x204463['options']);return db[_0x83e6('0x40')]['find'](_0x51d4c5)[_0x83e6('0x1e')](handleEntityNotFound(_0x2659ae,null))[_0x83e6('0x1e')](respondWithResult(_0x2659ae,null))[_0x83e6('0x29')](handleError(_0x2659ae,null));};exports[_0x83e6('0xae')]=function(_0x40a0e9,_0x5bd37d){return db[_0x83e6('0x40')][_0x83e6('0xae')](_0x40a0e9['body'],{})[_0x83e6('0x1e')](respondWithResult(_0x5bd37d,0xc9))[_0x83e6('0x29')](handleError(_0x5bd37d,null));};exports[_0x83e6('0x33')]=function(_0x218b0b,_0x4b1536){if(_0x218b0b[_0x83e6('0xaf')]['id']){delete _0x218b0b[_0x83e6('0xaf')]['id'];}return db['ChatInteraction'][_0x83e6('0xb0')]({'where':{'id':_0x218b0b[_0x83e6('0xab')]['id']}})['then'](handleEntityNotFound(_0x4b1536,null))[_0x83e6('0x1e')](saveUpdates(_0x218b0b[_0x83e6('0xaf')],null))['then'](respondWithResult(_0x4b1536,null))[_0x83e6('0x29')](handleError(_0x4b1536,null));};exports[_0x83e6('0x34')]=function(_0x4c8227,_0x34f647){return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x4c8227['params']['id']}})['then'](handleEntityNotFound(_0x34f647,null))[_0x83e6('0x1e')](removeEntity(_0x34f647,null))[_0x83e6('0x29')](handleError(_0x34f647,null));};exports[_0x83e6('0xb1')]=function(_0x3543f5,_0x53932e){return db['ChatInteraction'][_0x83e6('0xb1')]()[_0x83e6('0x1e')](respondWithResult(_0x53932e,null))['catch'](handleError(_0x53932e,null));};exports[_0x83e6('0xb2')]=function(_0x54fdaa,_0x19788e){if(_0x54fdaa[_0x83e6('0xaf')]['id']){delete _0x54fdaa[_0x83e6('0xaf')]['id'];}return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x54fdaa[_0x83e6('0xab')]['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x19788e,null))[_0x83e6('0x1e')](saveUpdates(_0x54fdaa[_0x83e6('0xaf')],null))[_0x83e6('0x1e')](respondWithResult(_0x19788e,null))[_0x83e6('0x29')](handleError(_0x19788e,null));};exports[_0x83e6('0xb3')]=function(_0x4f7451,_0x453562,_0x14eb36){if(_0x4f7451[_0x83e6('0xaf')]['id']){delete _0x4f7451[_0x83e6('0xaf')]['id'];}return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x4f7451[_0x83e6('0xab')]['id']}})['then'](function(_0x186fe1){if(!_0x186fe1){logger[_0x83e6('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x83e6('0xb3'),0x194,'entity\x20not\x20found');_0x453562[_0x83e6('0xb4')](0x194);}else{if(_0x186fe1['UserId']){throw new db[(_0x83e6('0x83'))][(_0x83e6('0xb5'))](_0x83e6('0xb6'));}}return _0x186fe1;})[_0x83e6('0x1e')](function(_0x756aa5){if(_0x756aa5){return _0x756aa5['update']({'closed':_0x4f7451['body'][_0x83e6('0xb7')],'disposition':_0x4f7451[_0x83e6('0xaf')][_0x83e6('0xb8')]})[_0x83e6('0x1e')](function(_0x41637b){return _0x41637b;});}})[_0x83e6('0x1e')](function(_0x1f1d3d){return respondWithRpcPromise('AbandonInteraction',_0x83e6('0xb3'),_0x4f7451[_0x83e6('0xaf')],client9004);})['then'](respondWithResult(_0x453562,null))[_0x83e6('0x29')](handleError(_0x453562,null));};exports[_0x83e6('0xb9')]=function(_0x4581d5,_0x5c39f4,_0x49e7af){_0x4581d5[_0x83e6('0xaf')]['name']=_0x4581d5[_0x83e6('0xba')]['originalname'];_0x4581d5['body'][_0x83e6('0xbb')]=_0x4581d5['file'][_0x83e6('0xbc')];_0x4581d5[_0x83e6('0xaf')][_0x83e6('0xbd')]=_0x4581d5[_0x83e6('0xba')][_0x83e6('0xbe')];return db[_0x83e6('0xbf')]['create'](_0x4581d5['body'])['then'](respondWithResult(_0x5c39f4,0xc9))[_0x83e6('0x29')](handleError(_0x5c39f4,null));};exports['attachmentDownload']=function(_0x276f94,_0x41a546,_0x1349f2){return db[_0x83e6('0x40')][_0x83e6('0xc0')]({'where':{'id':_0x276f94[_0x83e6('0xab')]['id']},'raw':!![]})[_0x83e6('0x1e')](handleEntityNotFound(_0x41a546,null))[_0x83e6('0x1e')](function(_0x59cf96){if(_0x59cf96){if(_0x59cf96[_0x83e6('0xb7')]){return _0x41a546[_0x83e6('0x35')](0x193)['json']({'status':0x193,'message':_0x83e6('0xc1')});}return db[_0x83e6('0xbf')][_0x83e6('0xc0')]({'where':{'id':_0x276f94['query']['attachId']},'raw':!![]})[_0x83e6('0x1e')](handleEntityNotFound(_0x41a546,null));}})[_0x83e6('0x1e')](function(_0xfce1ba){if(_0xfce1ba){return _0x41a546['download'](path[_0x83e6('0x80')](config[_0x83e6('0xc2')],'server/files/attachments/',_0xfce1ba[_0x83e6('0xbb')]));}})[_0x83e6('0x29')](handleError(_0x41a546,null));};exports[_0x83e6('0xc3')]=function(_0x2760e3,_0x54182f){var _0xdb864=null;var _0x1f4d9e=null;var _0x35fd02=null;var _0x556795=null;if(_0x2760e3[_0x83e6('0xaf')]['id']){delete _0x2760e3[_0x83e6('0xaf')]['id'];}if(_0x2760e3[_0x83e6('0xaf')][_0x83e6('0xc4')]){_0x556795=path[_0x83e6('0x80')](config[_0x83e6('0xc2')],'server/files/chat/upload/',util[_0x83e6('0xc5')]('transcript-%s.txt',Date['now']()));_0x2760e3['body'][_0x83e6('0xc6')]=_0x556795;}return db['ChatInteraction'][_0x83e6('0xb0')]({'where':{'id':_0x2760e3[_0x83e6('0xab')]['id']},'include':[{'model':db[_0x83e6('0xc7')],'as':_0x83e6('0xc8'),'include':[{'model':db[_0x83e6('0xc9')],'as':'User'}]}]})[_0x83e6('0x1e')](handleEntityNotFound(_0x54182f,null))[_0x83e6('0x1e')](saveUpdates(_0x2760e3[_0x83e6('0xaf')],null))[_0x83e6('0x1e')](function(_0x5aebc7){if(_0x5aebc7){_0xdb864=_0x5aebc7;return db['ChatWebsite'][_0x83e6('0xb0')]({'where':{'id':_0xdb864[_0x83e6('0x73')]}});}})[_0x83e6('0x1e')](function(_0x38d563){if(_0x38d563){_0x35fd02=_0x38d563;return db[_0x83e6('0xca')]['find']({'where':{'id':_0xdb864[_0x83e6('0xcb')]}});}})[_0x83e6('0x1e')](function(_0x56845c){if(_0x56845c){_0x1f4d9e=_0x56845c;if(_0x556795){var _0x500382=null;for(var _0x51aab9=0x1;_0x51aab9<_0xdb864[_0x83e6('0xc8')][_0x83e6('0x49')];++_0x51aab9){_0x500382=_0xdb864[_0x83e6('0xc8')][_0x51aab9];var _0x21709e=_0x500382[_0x83e6('0xcc')]?util[_0x83e6('0xc5')](_0x83e6('0xcd'),_0x35fd02[_0x83e6('0xce')],_0x500382['UserId']):'System';var _0x997794=_0x2760e3['body'][_0x83e6('0xcf')]||util[_0x83e6('0xc5')](_0x83e6('0xcd'),'Visitor',_0x500382[_0x83e6('0xcb')]);switch(_0x35fd02[_0x83e6('0xd0')]){case'website_alias':_0x21709e=_0x500382[_0x83e6('0xcc')]?util[_0x83e6('0xc5')](_0x83e6('0xcd'),_0x35fd02['agentAlias'],_0x500382[_0x83e6('0xcc')]):_0x83e6('0xd1');break;case _0x83e6('0xd2'):_0x21709e=_0x500382[_0x83e6('0xcc')]?_0x500382[_0x83e6('0xc9')]['alias']||_0x500382[_0x83e6('0xc9')][_0x83e6('0xd3')]:_0x83e6('0xd1');break;case _0x83e6('0xd4'):_0x21709e=_0x500382[_0x83e6('0xcc')]?_0x500382['User']['fullname']:'System';break;default:_0x21709e=_0x500382[_0x83e6('0xcc')]?util[_0x83e6('0xc5')](_0x83e6('0xcd'),_0x35fd02[_0x83e6('0xce')],_0x500382[_0x83e6('0xcc')]):_0x83e6('0xd1');}var _0x3c6d31=util['format'](_0x83e6('0xd5'),moment(_0x500382[_0x83e6('0x75')])['format'](_0x83e6('0xd6')),_0x500382[_0x83e6('0xd7')]==='in'?_0x997794:_0x21709e,_0x500382[_0x83e6('0xaf')]);if(!_0x500382[_0x83e6('0xd8')]){fs['appendFileSync'](_0x556795,_0x3c6d31);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x83e6('0xd9'),'raw':!![]}]});}}})['then'](function(_0x5d9a1b){if(_0x5d9a1b&&_0x5d9a1b[_0x83e6('0xd9')]&&_0x2760e3[_0x83e6('0xaf')]){var _0x3865f4={'tls':{'rejectUnauthorized':![]}};if(_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xda')]){_0x3865f4[_0x83e6('0xda')]=_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xda')];}else{_0x3865f4[_0x83e6('0xdb')]=_0x5d9a1b['Smtp'][_0x83e6('0xdb')];_0x3865f4[_0x83e6('0xdc')]=_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdc')];_0x3865f4['secure']=_0x5d9a1b[_0x83e6('0xd9')]['secure'];}if(_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdd')]){_0x3865f4[_0x83e6('0xde')]={'user':_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdf')],'pass':_0x5d9a1b[_0x83e6('0xd9')]['pass']};}return respondWithRpcPromise(_0x83e6('0xe0'),_0x83e6('0xe1'),{'account':_0x3865f4,'message':{'from':util[_0x83e6('0xc5')](_0x83e6('0xe2'),_0x5d9a1b[_0x83e6('0x37')],_0x5d9a1b[_0x83e6('0xe3')]||_0x5d9a1b[_0x83e6('0xd9')][_0x83e6('0xdf')]),'to':_0x2760e3[_0x83e6('0xaf')][_0x83e6('0xc4')],'subject':_0x83e6('0xe4'),'text':util['format'](_0x83e6('0xe5'),_0x2760e3[_0x83e6('0xaf')][_0x83e6('0xc4')]),'attachments':[{'path':_0x556795}]}})[_0x83e6('0x1e')](function(){return _0xdb864;})[_0x83e6('0x29')](function(_0xfd8311){console['error'](_0xfd8311);});}else{return _0xdb864;}})[_0x83e6('0x1e')](respondWithStatusCode(_0x54182f,0xc8))[_0x83e6('0x29')](handleError(_0x54182f,null));};exports[_0x83e6('0xe6')]=function(_0x22154c,_0x3dd8ef,_0x42eda3){return db[_0x83e6('0xc7')][_0x83e6('0xb0')]({'where':{'id':_0x22154c['params']['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x3dd8ef,null))[_0x83e6('0x1e')](function(_0x2c8989){if(_0x2c8989){return _0x2c8989['addMessage'](_0x22154c[_0x83e6('0xaf')][_0x83e6('0xe7')],_['omit'](_0x22154c[_0x83e6('0xaf')],[_0x83e6('0xe7'),'id'])||{});}})[_0x83e6('0x1e')](respondWithResult(_0x3dd8ef,null))[_0x83e6('0x29')](handleError(_0x3dd8ef,null));};exports[_0x83e6('0xe8')]=function(_0x4923d5,_0xd78491,_0x3e9fa9){var _0x5213b2={'raw':![],'where':{}};var _0x568e76={};var _0x438fcc={'count':0x0,'rows':[]};return db[_0x83e6('0x40')][_0x83e6('0xc0')]({'where':{'id':_0x4923d5[_0x83e6('0xab')]['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0xd78491,null))[_0x83e6('0x1e')](function(_0x465364){if(_0x465364){_0x568e76[_0x83e6('0x42')]=_[_0x83e6('0x43')](db[_0x83e6('0xc7')][_0x83e6('0x41')]);_0x568e76[_0x83e6('0x44')]=_[_0x83e6('0x43')](_0x4923d5[_0x83e6('0x44')]);_0x568e76[_0x83e6('0x45')]=_[_0x83e6('0x46')](_0x568e76['model'],_0x568e76['query']);_0x5213b2['attributes']=_['intersection'](_0x568e76[_0x83e6('0x42')],qs[_0x83e6('0x48')](_0x4923d5['query']['fields']));_0x5213b2[_0x83e6('0x47')]=_0x5213b2[_0x83e6('0x47')][_0x83e6('0x49')]?_0x5213b2[_0x83e6('0x47')]:_0x568e76['model'];if(!_0x4923d5[_0x83e6('0x44')][_0x83e6('0x4a')](_0x83e6('0x4b'))){_0x5213b2[_0x83e6('0x2e')]=qs[_0x83e6('0x2e')](_0x4923d5[_0x83e6('0x44')][_0x83e6('0x2e')]);_0x5213b2['offset']=qs[_0x83e6('0x2d')](_0x4923d5[_0x83e6('0x44')][_0x83e6('0x2d')]);}_0x5213b2[_0x83e6('0x4c')]=qs[_0x83e6('0x4d')](_0x4923d5[_0x83e6('0x44')][_0x83e6('0x4d')]);_0x5213b2[_0x83e6('0x4e')]=qs[_0x83e6('0x45')](_['pick'](_0x4923d5[_0x83e6('0x44')],_0x568e76[_0x83e6('0x45')]));_0x5213b2[_0x83e6('0x4e')][_0x83e6('0xa7')]=_0x465364['id'];if(_0x4923d5[_0x83e6('0x44')][_0x83e6('0x7c')]){_0x5213b2[_0x83e6('0x4e')]=_['merge'](_0x5213b2['where'],{'$or':_[_0x83e6('0x3a')](_0x5213b2[_0x83e6('0x47')],function(_0x3fe966){var _0x5b35ff={};_0x5b35ff[_0x3fe966]={'$like':'%'+_0x4923d5['query'][_0x83e6('0x7c')]+'%'};return _0x5b35ff;})});}if(_0x4923d5[_0x83e6('0x44')][_0x83e6('0xe9')]){var _0x4d3c58=_0x4923d5[_0x83e6('0x44')][_0x83e6('0xe9')]['split'](',');var _0x46ee3a={};_0x46ee3a[_0x4d3c58[0x0]]={'$gte':moment(_0x4d3c58[0x1])[_0x83e6('0xc5')](_0x83e6('0xea'))};_0x5213b2[_0x83e6('0x4e')]=_[_0x83e6('0x94')](_0x5213b2['where'],_0x46ee3a);}_0x5213b2=_[_0x83e6('0x94')]({},_0x5213b2,_0x4923d5['options']);return db[_0x83e6('0xc7')][_0x83e6('0x2c')]({'where':_0x5213b2[_0x83e6('0x4e')]})[_0x83e6('0x1e')](function(_0x3b82ab){_0x438fcc['count']=_0x3b82ab;if(_0x4923d5[_0x83e6('0x44')]['includeAll']){_0x5213b2[_0x83e6('0xad')]=[{'all':!![]}];}return db[_0x83e6('0xc7')]['findAll'](_0x5213b2);})['then'](function(_0x53b72b){_0x438fcc[_0x83e6('0xa9')]=_0x53b72b;return _0x438fcc;});}})[_0x83e6('0x1e')](respondWithFilteredResult(_0xd78491,_0x5213b2))[_0x83e6('0x29')](handleError(_0xd78491,null));};exports[_0x83e6('0xeb')]=function(_0x4e5b17,_0x207b11,_0x13718e){var _0x35c537={'where':{}},_0x5f4b14={},_0x295d82={'count':0x0,'rows':[]};return db[_0x83e6('0x40')][_0x83e6('0xc0')]({'where':{'id':_0x4e5b17[_0x83e6('0xab')]['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x207b11,null))[_0x83e6('0x1e')](function(_0x23b837){if(_0x23b837){_0x5f4b14[_0x83e6('0x42')]=_[_0x83e6('0x43')](db['ChatMessage']['rawAttributes']);_0x5f4b14[_0x83e6('0x44')]=_[_0x83e6('0x43')](_0x4e5b17[_0x83e6('0x44')]);_0x5f4b14[_0x83e6('0x45')]=_[_0x83e6('0x46')](_0x5f4b14['model'],_0x5f4b14['query']);_0x35c537['attributes']=_['intersection'](_0x5f4b14[_0x83e6('0x42')],qs[_0x83e6('0x48')](_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x48')]));_0x35c537[_0x83e6('0x47')]=_0x35c537[_0x83e6('0x47')][_0x83e6('0x49')]?_0x35c537['attributes']:_0x5f4b14[_0x83e6('0x42')];if(!_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x4a')](_0x83e6('0x4b'))){_0x35c537[_0x83e6('0x2e')]=qs[_0x83e6('0x2e')](_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x2e')]);_0x35c537[_0x83e6('0x2d')]=qs['offset'](_0x4e5b17[_0x83e6('0x44')][_0x83e6('0x2d')]);}_0x35c537[_0x83e6('0x4c')]=qs[_0x83e6('0x4d')](_0x4e5b17[_0x83e6('0x44')]['sort']);_0x35c537[_0x83e6('0x4e')]=qs[_0x83e6('0x45')](_[_0x83e6('0x4f')](_0x4e5b17['query'],_0x5f4b14['filters']));_0x35c537[_0x83e6('0x4e')][_0x83e6('0xa7')]=_0x23b837['id'];if(_0x4e5b17[_0x83e6('0x44')]['filter']){_0x35c537[_0x83e6('0x4e')]=_['merge'](_0x35c537[_0x83e6('0x4e')],{'$or':_[_0x83e6('0x3a')](_0x35c537[_0x83e6('0x47')],function(_0x461f3d){var _0x515058={};_0x515058[_0x461f3d]={'$like':'%'+_0x4e5b17['query']['filter']+'%'};return _0x515058;})});}_0x35c537[_0x83e6('0x4e')][_0x83e6('0xd8')]=![];if(_0x4e5b17[_0x83e6('0x44')]['id']){_0x35c537[_0x83e6('0x4e')]['id']={'$gt':_0x4e5b17['query']['id']};}_0x35c537=_['merge']({},_0x35c537,_0x4e5b17[_0x83e6('0x65')]);return db[_0x83e6('0xc7')][_0x83e6('0x2c')]({'where':_0x35c537['where']})['then'](function(_0x325ef2){_0x295d82[_0x83e6('0x2c')]=_0x325ef2;_0x35c537[_0x83e6('0xad')]=[];if(_0x4e5b17[_0x83e6('0x44')][_0x83e6('0xec')]){_0x35c537['include'][_0x83e6('0x3f')]({'model':db[_0x83e6('0xc9')],'as':_0x83e6('0xc9'),'attributes':['id',_0x83e6('0xd3'),_0x83e6('0xed')]});}if(_0x4e5b17[_0x83e6('0x44')][_0x83e6('0xac')]){_0x35c537[_0x83e6('0xad')]=[{'all':!![]}];}return db[_0x83e6('0xc7')][_0x83e6('0xee')](_0x35c537);})[_0x83e6('0x1e')](function(_0x2dd6d4){_0x295d82[_0x83e6('0xa9')]=_0x2dd6d4;return _0x295d82;});}})[_0x83e6('0x1e')](respondWithFilteredResult(_0x207b11,_0x35c537))['catch'](handleError(_0x207b11,null));};exports[_0x83e6('0xef')]=function(_0x16a1ac,_0xd9c122,_0x4aead5){return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x16a1ac[_0x83e6('0xab')]['id']}})['then'](handleEntityNotFound(_0xd9c122,null))['then'](function(_0x4d8f0d){if(_0x4d8f0d){return _0x4d8f0d[_0x83e6('0xf0')](_0x16a1ac[_0x83e6('0xaf')][_0x83e6('0xe7')],_[_0x83e6('0x63')](_0x16a1ac[_0x83e6('0xaf')],[_0x83e6('0xe7'),'id'])||{})['spread'](function(){return db[_0x83e6('0xf1')][_0x83e6('0xee')]({'attributes':['id',_0x83e6('0x37'),_0x83e6('0x52')],'where':{'id':_0x16a1ac['body'][_0x83e6('0xe7')]}});})['then'](function(_0x1683fd){socket[_0x83e6('0xf2')](_0x83e6('0xf3'),{'id':Number(_0x16a1ac[_0x83e6('0xab')]['id']),'tags':_0x1683fd||[]});return{'id':Number(_0x16a1ac[_0x83e6('0xab')]['id']),'tags':_0x1683fd||[]};});}})[_0x83e6('0x1e')](respondWithResult(_0xd9c122,null))[_0x83e6('0x29')](handleError(_0xd9c122,null));};exports[_0x83e6('0xf4')]=function(_0x4f7605,_0x3ddc79,_0x4f53ab){return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x4f7605['params']['id']}})[_0x83e6('0x1e')](handleEntityNotFound(_0x3ddc79,null))['then'](function(_0x34bbec){if(_0x34bbec){return _0x34bbec[_0x83e6('0xf4')](_0x4f7605[_0x83e6('0x44')][_0x83e6('0xe7')]);}})['then'](respondWithStatusCode(_0x3ddc79,null))[_0x83e6('0x29')](handleError(_0x3ddc79,null));};exports['download']=function(_0x5c26f8,_0xdcd88f){var _0xf84a4=moment()[_0x83e6('0xf5')]()[_0x83e6('0x93')]();var _0xa13ca4=path[_0x83e6('0x80')](config[_0x83e6('0xc2')],_0x83e6('0xf6'),_0x83e6('0xf7'),_0x83e6('0xf8'));var _0x3e6722=path[_0x83e6('0x80')](config['root'],_0x83e6('0xf6'),_0x83e6('0xf7'),_0x83e6('0xf9'));var _0x7ff37a=path['join'](_0xa13ca4,_0xf84a4);var _0x1f091f=util[_0x83e6('0xc5')](_0x83e6('0xfa'),_0x5c26f8[_0x83e6('0xab')]['id'],_0xf84a4);var _0x429d46=path[_0x83e6('0x80')](_0xa13ca4,_0x1f091f);var _0x17562d=![];return db[_0x83e6('0x40')][_0x83e6('0xb0')]({'where':{'id':_0x5c26f8[_0x83e6('0xab')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x83e6('0xaf'),_0x83e6('0x75'),_0x83e6('0xd7'),_0x83e6('0xd8'),_0x83e6('0x79')],'include':[{'model':db[_0x83e6('0xc9')],'as':_0x83e6('0xc9'),'attributes':['id',_0x83e6('0xd3')],'raw':!![]},{'model':db[_0x83e6('0xca')],'as':_0x83e6('0xfb'),'attributes':['id',_0x83e6('0xfc'),_0x83e6('0xfd')],'raw':!![]},{'model':db[_0x83e6('0xbf')],'as':_0x83e6('0xbf'),'raw':!![]}]},{'model':db[_0x83e6('0xfe')],'as':'Account','attributes':['id',_0x83e6('0x37')]},{'model':db['User'],'as':_0x83e6('0xff'),'attributes':['id',_0x83e6('0xd3')]}]})[_0x83e6('0x1e')](handleEntityNotFound(_0xdcd88f,null))[_0x83e6('0x1e')](function(_0x51f2a6){if(_0x51f2a6){var _0x3cbf5a=_0x51f2a6[_0x83e6('0x100')]({'plain':!![]});_0x17562d=!![];var _0x55f290={'format':'A4','border':'10px','header':{'height':_0x83e6('0x101'),'contents':{'first':_0x83e6('0x102')}},'footer':{'height':_0x83e6('0x103'),'contents':{'default':util[_0x83e6('0xc5')](_0x83e6('0x104'),util['format']('%s\x20#%d','Chat',_0x3cbf5a['id']),moment()[_0x83e6('0xc5')](_0x83e6('0x105'))[_0x83e6('0x93')]())}}};fs[_0x83e6('0x106')](_0x7ff37a);var _0x3a77b9={'channel':'Chat','account':_0x3cbf5a[_0x83e6('0x107')][_0x83e6('0x37')],'agent':_0x3cbf5a[_0x83e6('0xff')]?_0x3cbf5a[_0x83e6('0xff')][_0x83e6('0xd3')]:_0x83e6('0x108'),'createdAt':moment(_0x3cbf5a[_0x83e6('0x75')])['format'](_0x83e6('0xea'))[_0x83e6('0x93')](),'closedAt':_0x3cbf5a[_0x83e6('0xb7')]?moment(_0x3cbf5a[_0x83e6('0x109')])[_0x83e6('0xc5')](_0x83e6('0xea'))[_0x83e6('0x93')]():'','disposition':_0x3cbf5a[_0x83e6('0xb8')],'chatInfo':{'browser':_0x3cbf5a['browserName'],'os':_0x3cbf5a[_0x83e6('0x10a')],'referer':_0x3cbf5a['referer'],'customerIp':_0x3cbf5a[_0x83e6('0x10b')],'customerPort':_0x3cbf5a[_0x83e6('0x10c')]?_0x3cbf5a[_0x83e6('0x10c')]:'N.A.'},'messages':_(_0x3cbf5a['Messages'])[_0x83e6('0x10d')]()[_0x83e6('0x7c')]({'secret':![]})['map'](function(_0x9661eb){if(_0x9661eb[_0x83e6('0xbf')]){var _0x49f002=path[_0x83e6('0x80')](_0x3e6722,_0x9661eb[_0x83e6('0xbf')]['basename']);if(fs['existsSync'](_0x49f002)){fs[_0x83e6('0x10e')](_0x49f002)['pipe'](fs[_0x83e6('0x10f')](path[_0x83e6('0x80')](_0x7ff37a,_0x9661eb[_0x83e6('0xbf')][_0x83e6('0xbb')])));}}return{'date':moment(_0x9661eb[_0x83e6('0x75')])[_0x83e6('0xc5')](_0x83e6('0xea'))['toString'](),'sender':_0x9661eb[_0x83e6('0xd7')]===_0x83e6('0x110')?_0x9661eb[_0x83e6('0xc9')]?_0x9661eb[_0x83e6('0xc9')]['fullname']:_0x83e6('0xd1'):_0x9661eb['Contact']['firstName']+(_0x9661eb[_0x83e6('0xfb')][_0x83e6('0xfd')]?'\x20'+_0x9661eb[_0x83e6('0xfb')][_0x83e6('0xfd')]:''),'body':_0x9661eb[_0x83e6('0xbf')]?_0x9661eb[_0x83e6('0xbf')][_0x83e6('0xbb')]:_0x9661eb[_0x83e6('0xaf')],'direction':_0x9661eb[_0x83e6('0xd7')]===_0x83e6('0x110')?'A':'C','secret':_0x9661eb['secret'],'read':_0x9661eb[_0x83e6('0x79')],'attachment':_0x9661eb[_0x83e6('0xbf')]};})[_0x83e6('0x69')]()};return ejs[_0x83e6('0x111')](path[_0x83e6('0x80')](config[_0x83e6('0xc2')],_0x83e6('0xf6'),_0x83e6('0x112'),_0x83e6('0x113')),{'interaction':_0x3a77b9})['then'](function(_0x3cccbf){return new BPromise(function(_0x7c1db4,_0x8eb731){pdf[_0x83e6('0xae')](_0x3cccbf,_0x55f290)['toFile'](path[_0x83e6('0x80')](_0x7ff37a,_0x83e6('0x114')+_0x3cbf5a['id']+'-'+_0xf84a4+_0x83e6('0x115')),function(_0x93c7b0,_0x1e356d){if(_0x93c7b0)return _0x8eb731(_0x93c7b0);_0x7c1db4(_0x1e356d);});});});}})[_0x83e6('0x1e')](function(){if(_0x17562d){return new BPromise(function(_0x4cccf3,_0x3a767f){zipdir(_0x7ff37a,{'saveTo':_0x429d46},function(_0x290eb7,_0x2b44dd){if(_0x290eb7)return _0x3a767f(_0x290eb7);return _0x4cccf3(_0x2b44dd);});})[_0x83e6('0x1e')](function(){return new BPromise(function(_0x1c1f38,_0x5ce5d9){rimraf(_0x7ff37a,function(_0x1bf252){if(_0x1bf252)_0x5ce5d9(_0x1bf252);return _0x1c1f38();});});})[_0x83e6('0x1e')](function(){return _0xdcd88f[_0x83e6('0x116')](_0x429d46,_0x1f091f,function(_0xc7dc){if(_0xc7dc){console['log'](_0x83e6('0x117'),_0xc7dc);}else{fs[_0x83e6('0x118')](_0x429d46);}});});}else{return _0xdcd88f[_0x83e6('0xb4')](0xc8);}})['catch'](handleError(_0xdcd88f,null));};
\ No newline at end of file
+var _0x657b=['transcript-','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','stack','name','send','Users','map','Tags','TagIds','forEach','push','index','ChatInteraction','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','advancedFilter','parse','matchType','options','custom','columns','hasMultipleConditions','value','values','table','getConditionValue','isRangeCondition','parseOperator','having','$between','`\x20>\x200','hasOwnProperty','filter','isNil','isEmpty','ChatWebsiteId','where','concat','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','expr','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','TagId','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','chat_interaction_has_tags','ui.ChatInteractionId\x20IN\x20?','groupBy','all','show','includeAll','include','find','create','body','params','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','disposition','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','download','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','ContactId','format','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','alias','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','lastName','Account','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','N.A.','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','direction','out','Contact','firstName','renderFile','views','downloadInteraction.html'];(function(_0x2ee7bc,_0x10bf5a){var _0x1dd0b1=function(_0x55d538){while(--_0x55d538){_0x2ee7bc['push'](_0x2ee7bc['shift']());}};_0x1dd0b1(++_0x10bf5a);}(_0x657b,0x126));var _0xb657=function(_0x336990,_0x4e7eb4){_0x336990=_0x336990-0x0;var _0x52294f=_0x657b[_0x336990];return _0x52294f;};'use strict';var pdf=require(_0xb657('0x0'));var emlformat=require(_0xb657('0x1'));var rimraf=require(_0xb657('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb657('0x3'));var rp=require(_0xb657('0x4'));var moment=require(_0xb657('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb657('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb657('0x7'));var csv=require(_0xb657('0x8'));var ejs=require(_0xb657('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb657('0xa'));var crypto=require('crypto');var jsforce=require(_0xb657('0xb'));var deskjs=require(_0xb657('0xc'));var toCsv=require(_0xb657('0x8'));var querystring=require(_0xb657('0xd'));var Papa=require(_0xb657('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb657('0xf'));var as=require(_0xb657('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb657('0x11'))('api');var utils=require(_0xb657('0x12'));var config=require(_0xb657('0x13'));var db=require(_0xb657('0x14'))['db'];config[_0xb657('0x15')]=_[_0xb657('0x16')](config[_0xb657('0x15')],{'host':_0xb657('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb657('0x15')]));require(_0xb657('0x18'))[_0xb657('0x19')](socket);var jayson=require(_0xb657('0x1a'));var client=jayson[_0xb657('0x1b')][_0xb657('0x1c')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x375b67,_0x1c4ac5,_0x4ae1e4){if(_0x4ae1e4){var _0xbc9008=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbc9008['test'](_0x1c4ac5)){return _0x375b67;}else{throw new Error(_0xb657('0x1d'));}}else{return _0x375b67;}}function respondWithRpcPromise(_0x2aafd6,_0x36755c,_0x41716a,_0x26a39e){return new BPromise(function(_0x16df27,_0x3cc347){var _0x3965c6=_0x26a39e||client;return _0x3965c6[_0xb657('0x1e')](_0x2aafd6,_0x41716a)['then'](function(_0x2e6dd3){logger['info'](_0xb657('0x1f'),_0x36755c,_0xb657('0x20'));logger['debug'](_0xb657('0x21'),_0x36755c,_0xb657('0x20'),JSON[_0xb657('0x22')](_0x2e6dd3));if(_0x2e6dd3[_0xb657('0x23')]){if(_0x2e6dd3['error'][_0xb657('0x24')]===0x1f4){logger[_0xb657('0x23')](_0xb657('0x1f'),_0x36755c,_0x2e6dd3[_0xb657('0x23')][_0xb657('0x25')]);return _0x3cc347(_0x2e6dd3[_0xb657('0x23')][_0xb657('0x25')]);}logger[_0xb657('0x23')](_0xb657('0x1f'),_0x36755c,_0x2e6dd3[_0xb657('0x23')][_0xb657('0x25')]);return _0x16df27(_0x2e6dd3[_0xb657('0x23')]['message']);}else{logger['info'](_0xb657('0x1f'),_0x36755c,'request\x20sent');_0x16df27(_0x2e6dd3[_0xb657('0x26')][_0xb657('0x25')]);}})[_0xb657('0x27')](function(_0x29b6a2){logger[_0xb657('0x23')](_0xb657('0x1f'),_0x36755c,_0x29b6a2);_0x3cc347(_0x29b6a2);});});}function respondWithStatusCode(_0x11249f,_0x334cfd){_0x334cfd=_0x334cfd||0xcc;return function(_0x13de72){if(_0x13de72){return _0x11249f[_0xb657('0x28')](_0x334cfd);}return _0x11249f[_0xb657('0x29')](_0x334cfd)['end']();};}function respondWithResult(_0x5ddc9b,_0x3a26ee){_0x3a26ee=_0x3a26ee||0xc8;return function(_0x549766){if(_0x549766){return _0x5ddc9b[_0xb657('0x29')](_0x3a26ee)[_0xb657('0x2a')](_0x549766);}};}function respondWithFilteredResult(_0x97c40d,_0x296820){return function(_0x47ebc9){if(_0x47ebc9){var _0x48da27=_0x47ebc9[_0xb657('0x2b')],_0x2e6fa5=_0x296820['offset'],_0x184c55=_0x296820[_0xb657('0x2c')]+_0x296820[_0xb657('0x2d')],_0x2bb595;if(_0x184c55>=_0x48da27){_0x184c55=_0x48da27;_0x2bb595=0xc8;}else{_0x2bb595=0xce;}_0x97c40d[_0xb657('0x29')](_0x2bb595);return _0x97c40d['set']('Content-Range',_0x2e6fa5+'-'+_0x184c55+'/'+_0x48da27)['json'](_0x47ebc9);}return null;};}function patchUpdates(_0x11356b){return function(_0x14233b){try{jsonpatch[_0xb657('0x2e')](_0x14233b,_0x11356b,!![]);}catch(_0x2fc4f0){return BPromise[_0xb657('0x2f')](_0x2fc4f0);}return _0x14233b[_0xb657('0x30')]();};}function saveUpdates(_0x1b14ff,_0x50614f){return function(_0x50d6d9){if(_0x50d6d9){return _0x50d6d9[_0xb657('0x31')](_0x1b14ff)[_0xb657('0x32')](function(_0x170a2c){return _0x170a2c;});}return null;};}function removeEntity(_0x3c5d6c,_0x1b1228){return function(_0x18098e){if(_0x18098e){return _0x18098e[_0xb657('0x33')]()[_0xb657('0x32')](function(){_0x3c5d6c[_0xb657('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55046f,_0x2ffd64){return function(_0x3703d8){if(!_0x3703d8){_0x55046f[_0xb657('0x28')](0x194);}return _0x3703d8;};}function handleError(_0x29d7f3,_0x3649b7){_0x3649b7=_0x3649b7||0x1f4;return function(_0x402479){logger['error'](_0x402479[_0xb657('0x34')]);if(_0x402479['name']){delete _0x402479[_0xb657('0x35')];}_0x29d7f3[_0xb657('0x29')](_0x3649b7)[_0xb657('0x36')](_0x402479);};}function getInteractionUsers(_0x54bcf3,_0x4c917b){return new BPromise(function(_0x20b779,_0x4f0759){try{if(_0x4c917b[_0x54bcf3['id']]){_0x54bcf3[_0xb657('0x37')]=_[_0xb657('0x38')](_0x4c917b[_0x54bcf3['id']],function(_0x36a539){return{'id':_0x36a539['id']};});}}catch(_0x32447e){_0x4f0759(_0x32447e);}_0x20b779(_0x54bcf3);});}function getInteractionTags(_0x41b0bd,_0x32a848){return new BPromise(function(_0x115ba8,_0x5a254a){try{if(_0x41b0bd['TagIds']){_0x41b0bd[_0xb657('0x39')]=[];_0x41b0bd[_0xb657('0x3a')]['split'](',')[_0xb657('0x3b')](function(_0x510f1c){_0x41b0bd[_0xb657('0x39')][_0xb657('0x3c')](_0x32a848[_0x510f1c]);});}delete _0x41b0bd[_0xb657('0x3a')];}catch(_0x30adca){_0x5a254a(_0x30adca);}_0x115ba8(_0x41b0bd);});}function updateChatInteraction(_0x126aca,_0x3a0e83,_0x491179){return new BPromise(function(_0x49f0d7,_0x538039){return getInteractionUsers(_0x126aca,_0x491179)[_0xb657('0x32')](function(_0x243e75){return getInteractionTags(_0x243e75,_0x3a0e83);})[_0xb657('0x32')](function(_0x32defe){_0x49f0d7(_0x32defe);})[_0xb657('0x27')](function(_0x47d488){_0x538039(_0x47d488);});});}exports[_0xb657('0x3d')]=function(_0xfe8310,_0x428447){var _0x7521fd={},_0x54a13e={},_0x2dae02={'count':0x0,'rows':[]};var _0x452b88=db[_0xb657('0x3e')][_0xb657('0x3f')];_0x54a13e[_0xb657('0x40')]=_['keys'](_0x452b88);_0x54a13e[_0xb657('0x41')]=_[_0xb657('0x42')](_0xfe8310['query']);_0x54a13e[_0xb657('0x43')]=_['intersection'](_0x54a13e[_0xb657('0x40')],_0x54a13e[_0xb657('0x41')]);_0x7521fd[_0xb657('0x44')]=_[_0xb657('0x45')](_0x54a13e[_0xb657('0x40')],qs[_0xb657('0x46')](_0xfe8310[_0xb657('0x41')]['fields']));_0x7521fd[_0xb657('0x44')]=_0x7521fd[_0xb657('0x44')][_0xb657('0x47')]?_0x7521fd[_0xb657('0x44')]:_0x54a13e['model'];if(!_0xfe8310[_0xb657('0x41')]['hasOwnProperty'](_0xb657('0x48'))){_0x7521fd['limit']=qs['limit'](_0xfe8310[_0xb657('0x41')][_0xb657('0x2d')]);_0x7521fd[_0xb657('0x2c')]=qs[_0xb657('0x2c')](_0xfe8310[_0xb657('0x41')]['offset']);}_0x7521fd[_0xb657('0x49')]=qs[_0xb657('0x4a')](_0xfe8310[_0xb657('0x41')][_0xb657('0x4a')]);_0x7521fd['where']=qs['filters'](_[_0xb657('0x4b')](_0xfe8310[_0xb657('0x41')],_0x54a13e[_0xb657('0x43')]));var _0x2ffd90=[];var _0x51bebd=squel[_0xb657('0x4c')]()[_0xb657('0x4d')]('id')[_0xb657('0x4d')](_0xb657('0x35'))['field'](_0xb657('0x4e'))[_0xb657('0x4f')](_0xb657('0x50'));var _0x55a178=squel[_0xb657('0x4c')]()[_0xb657('0x4d')]('u.id')[_0xb657('0x4d')]('ui.ChatInteractionId')[_0xb657('0x4f')](_0xb657('0x51'),'ui')[_0xb657('0x52')](_0xb657('0x53'),'u',_0xb657('0x54'));var _0x1fb8f=squel[_0xb657('0x4c')]()[_0xb657('0x4f')](_0xb657('0x55'),'i')[_0xb657('0x52')]('cm_contacts','c',_0xb657('0x56'))[_0xb657('0x52')](_0xb657('0x53'),'o',_0xb657('0x57'))['left_join'](_0xb657('0x58'),'a',_0xb657('0x59'))[_0xb657('0x52')](_0xb657('0x5a'),'me',_0xb657('0x5b'));var _0x57a164=squel['expr']();var _0x2b9982=_0xfe8310[_0xb657('0x41')][_0xb657('0x5c')]?JSON[_0xb657('0x5d')](_0xfe8310[_0xb657('0x41')][_0xb657('0x5c')]):undefined;if(_0x2b9982){var _0x296e3f=_0x2b9982[_0xb657('0x5e')]['substr'](0x1);_(_0x2b9982)['omit'](_0xb657('0x5e'))['omitBy'](function(_0x2a130c,_0x4062cd){return _0x2a130c[_0xb657('0x5f')][_0xb657('0x60')]===!![];})[_0xb657('0x42')]()['forEach'](function(_0x2f3e95){var _0x25743a=_0x2b9982[_0x2f3e95];if(_0x25743a[_0xb657('0x5f')][_0xb657('0x61')]){var _0x1205a6=squel['expr']();if(as[_0xb657('0x62')](_0x25743a[_0xb657('0x63')])){var _0x49d652=_[_0xb657('0x64')](_0x25743a[_0xb657('0x63')])[0x0];_0x49d652[_0xb657('0x3b')](function(_0x1fae69){_0x25743a[_0xb657('0x5f')][_0xb657('0x61')][_0xb657('0x3b')](function(_0x571a52){_0x1205a6['or'](_0x25743a['options'][_0xb657('0x65')]+'.'+_0x571a52+'\x20'+as['parseOperator'](_0x1fae69),as[_0xb657('0x66')](_0x1fae69));});});}else{var _0x7c71c9=as[_0xb657('0x67')](_0x25743a[_0xb657('0x63')])?_0x25743a['value'][0x1]:undefined;_0x25743a['options'][_0xb657('0x61')][_0xb657('0x3b')](function(_0x3c609a){_0x1205a6['or'](_0x25743a[_0xb657('0x5f')][_0xb657('0x65')]+'.'+_0x3c609a+'\x20'+as[_0xb657('0x68')](_0x25743a[_0xb657('0x63')]),as[_0xb657('0x66')](_0x25743a[_0xb657('0x63')]),_0x7c71c9);});}_0x57a164[_0x296e3f](_0x1205a6);}else if(as[_0xb657('0x62')](_0x25743a[_0xb657('0x63')])){var _0x49d652=_[_0xb657('0x64')](_0x25743a[_0xb657('0x63')])[0x0];_0x49d652[_0xb657('0x3b')](function(_0x5a9651){if(!_0x25743a[_0xb657('0x5f')][_0xb657('0x69')]){var _0x34dbbb=as[_0xb657('0x67')](_0x5a9651)?_0x5a9651[_0xb657('0x6a')][0x1]:undefined;_0x57a164[_0x296e3f](_0x25743a['options']['table']+'.'+_0x2f3e95+'\x20'+as[_0xb657('0x68')](_0x5a9651),as[_0xb657('0x66')](_0x5a9651),_0x34dbbb);}});}else{if(_0x25743a[_0xb657('0x5f')][_0xb657('0x69')]){var _0x1c1ea8=as[_0xb657('0x66')](_0x25743a[_0xb657('0x63')]);if(_0x1c1ea8['length']===0x1){if(_0x1c1ea8==0x1){_0x1fb8f['having']('`'+_0x2f3e95+'`\x20=\x200');}else{_0x1fb8f[_0xb657('0x69')]('`'+_0x2f3e95+_0xb657('0x6b'));}}}else{var _0x7c71c9=as[_0xb657('0x67')](_0x25743a[_0xb657('0x63')])?_0x25743a[_0xb657('0x63')][_0xb657('0x6a')][0x1]:undefined;_0x57a164[_0x296e3f](_0x25743a[_0xb657('0x5f')]['table']+'.'+_0x2f3e95+'\x20'+as[_0xb657('0x68')](_0x25743a['value']),as[_0xb657('0x66')](_0x25743a[_0xb657('0x63')]),_0x7c71c9);}}});}else{var _0x1ca676=_(Object[_0xb657('0x42')](_0xfe8310['query']))[_0xb657('0x38')](function(_0x53a8cf){return _0x452b88[_0xb657('0x6c')](_0x53a8cf)?_0x53a8cf:undefined;})[_0xb657('0x6d')](function(_0x14be25){return!_[_0xb657('0x6e')](_0x14be25);})[_0xb657('0x63')]();if(!_[_0xb657('0x6f')](_0x1ca676)){_0x1ca676['forEach'](function(_0x45ea0c){if(_0x45ea0c===_0xb657('0x70')){_0x1fb8f[_0xb657('0x71')]('i.ChatWebsiteId\x20IN\x20?',[][_0xb657('0x72')](_0xfe8310[_0xb657('0x41')][_0x45ea0c]));}else if(_0x45ea0c==='createdAt'){var _0x54d4f5=JSON[_0xb657('0x5d')](_0xfe8310[_0xb657('0x41')][_0x45ea0c])['$gte'];var _0x3b981a=JSON[_0xb657('0x5d')](_0xfe8310[_0xb657('0x41')][_0x45ea0c])[_0xb657('0x73')];_0x1fb8f[_0xb657('0x71')](_0xb657('0x74'),_0x54d4f5,_0x3b981a);}else{if(_0xfe8310['query'][_0x45ea0c]===_0xb657('0x75')){_0x1fb8f[_0xb657('0x71')]('i.'+_0x45ea0c+'\x20IS\x20NULL');}else{_0x1fb8f[_0xb657('0x71')]('i.'+_0x45ea0c+_0xb657('0x76'),_0xfe8310[_0xb657('0x41')][_0x45ea0c]);}}});}if(_0xfe8310['query'][_0xb657('0x77')]){if(_0xfe8310['query']['read']==0x1){_0x1fb8f[_0xb657('0x69')](_0xb657('0x78'));}else{_0x1fb8f[_0xb657('0x69')]('`unreadMessages`\x20>\x200');}}if(_0xfe8310[_0xb657('0x41')][_0xb657('0x6d')]){var _0x3e65ca=_0xfe8310[_0xb657('0x41')][_0xb657('0x6d')]['replace']('\x5c','\x5c\x5c')[_0xb657('0x79')]('\x27\x27',_0xb657('0x7a'));if(qs[_0xb657('0x7b')](_0x3e65ca)){_0x57a164['or'](_0xb657('0x7c'),_0x3e65ca+'%');}else{var _0x1f8c59=[];_0x3e65ca['split']('\x20')[_0xb657('0x3b')](function(_0x195842){_0x1f8c59['push']('+'+_0x195842[_0xb657('0x7d')]());});var _0x6ab7a9=_0x1f8c59[_0xb657('0x7e')]('\x20');_0x57a164['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x6ab7a9)['or'](_0xb657('0x7f'),_0x3e65ca+'%');}}}_0x1fb8f[_0xb657('0x71')](_0x57a164);_0x1fb8f[_0xb657('0x80')](_0xb657('0x81'));var _0xf565c3={'type':db[_0xb657('0x82')][_0xb657('0x83')][_0xb657('0x84')],'raw':!![]};var _0x126b9a=_0x1fb8f['clone']();_0x126b9a[_0xb657('0x4d')]('i.id');_0x126b9a[_0xb657('0x4d')](_0xb657('0x85'),_0xb657('0x86'));if(_0x7521fd['order']){_0x7521fd[_0xb657('0x49')][_0xb657('0x3b')](function(_0x2963b4){_0x1fb8f[_0xb657('0x49')]('i.'+_0x2963b4[0x0],_0x2963b4[0x1]===_0xb657('0x87')?![]:!![]);});}var _0x277548=[];var _0x317cc0=squel[_0xb657('0x88')]();if(!_0x2b9982){if(_0xfe8310[_0xb657('0x41')][_0xb657('0x89')]){_0x277548=_[_0xb657('0x8a')](_0xfe8310['query'][_0xb657('0x89')])?_0xfe8310[_0xb657('0x41')][_0xb657('0x89')]:new Array(_0xfe8310[_0xb657('0x41')][_0xb657('0x89')]);_0x277548[_0xb657('0x3b')](function(_0x385b20){_0x317cc0['or'](_0xb657('0x8b'),'%,'+_0x385b20+',%');});_0x1fb8f[_0xb657('0x69')](_0x317cc0);_0x126b9a['left_join']('chat_interaction_has_tags','it',_0xb657('0x8c'));_0x126b9a[_0xb657('0x52')](_0xb657('0x50'),'t',_0xb657('0x8d'));_0x126b9a[_0xb657('0x71')](_0xb657('0x8e'),_0x277548);}}else{if(_0x2b9982[_0xb657('0x6c')](_0xb657('0x8f'))){if(as[_0xb657('0x62')](_0x2b9982['TagId'][_0xb657('0x63')])){var _0x1bbab9=_[_0xb657('0x64')](_0x2b9982['TagId'][_0xb657('0x63')])[0x0];_0x1bbab9['forEach'](function(_0x136c9d){as[_0xb657('0x66')](_0x136c9d)[_0xb657('0x3b')](function(_0x1d239e){_0x277548['push'](_0x1d239e);});});}else{_0x277548=as[_0xb657('0x66')](_0x2b9982[_0xb657('0x8f')]['value']);}_0x277548[_0xb657('0x3b')](function(_0x50a46f){_0x317cc0['or'](_0xb657('0x8b'),'%,'+_0x50a46f+',%');});_0x1fb8f[_0xb657('0x69')](_0x317cc0);_0x126b9a[_0xb657('0x52')]('mail_interaction_has_tags','it',_0xb657('0x90'));_0x126b9a['left_join'](_0xb657('0x50'),'t',_0xb657('0x8d'));_0x126b9a[_0xb657('0x71')]('t.id\x20IN\x20?',_0x277548);}}db[_0xb657('0x91')][_0xb657('0x41')](_0x126b9a[_0xb657('0x7d')](),_0xf565c3)[_0xb657('0x32')](function(_0x45a6c0){_0x2dae02['count']=_0x45a6c0[_0xb657('0x47')];if(_0x2dae02['count']===0x0)return[];return db[_0xb657('0x91')][_0xb657('0x41')](_0x51bebd[_0xb657('0x7d')](),_0xf565c3)['then'](function(_0x278787){_0x2ffd90=_[_0xb657('0x92')](_0x278787,'id');_0xf565c3=_[_0xb657('0x93')](_0xf565c3,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1fb8f['field'](_0xb657('0x85'),_0xb657('0x86'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x94'),_0xb657('0x95'));_0x1fb8f['field'](_0xb657('0x96'),'Account.mandatoryDisposition');_0x1fb8f[_0xb657('0x4d')]('i.*');_0x1fb8f[_0xb657('0x4d')](_0xb657('0x97'),_0xb657('0x98'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x99'),_0xb657('0x9a'));_0x1fb8f['field']('c.email',_0xb657('0x9b'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x9c'),_0xb657('0x9d'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0x9e'),'Contact.mobile');_0x1fb8f['field'](_0xb657('0x9f'),_0xb657('0xa0'));_0x1fb8f[_0xb657('0x4d')](_0xb657('0xa1'),_0xb657('0x3a'));_0x1fb8f['left_join'](_0xb657('0xa2'),'it',_0xb657('0x8c'));_0x1fb8f[_0xb657('0x52')](_0xb657('0x50'),'t','t.id\x20=\x20it.TagId');_0x1fb8f[_0xb657('0x2d')](_0x7521fd[_0xb657('0x2d')]);_0x1fb8f[_0xb657('0x2c')](_0x7521fd[_0xb657('0x2c')]);return db[_0xb657('0x91')][_0xb657('0x41')](_0x1fb8f[_0xb657('0x7d')](),_0xf565c3);})['then'](function(_0xe423e){_0x55a178[_0xb657('0x71')](_0xb657('0xa3'),_['map'](_0xe423e,'id'));return db[_0xb657('0x91')][_0xb657('0x41')](_0x55a178[_0xb657('0x7d')](),_0xf565c3)['then'](function(_0x5cab80){var _0x5a90=_[_0xb657('0xa4')](_0x5cab80,'ChatInteractionId');var _0x4e76d3=[];_0xe423e[_0xb657('0x3b')](function(_0x2ed44c){_0x4e76d3[_0xb657('0x3c')](updateChatInteraction(_0x2ed44c,_0x2ffd90,_0x5a90));});return BPromise[_0xb657('0xa5')](_0x4e76d3);});});})[_0xb657('0x32')](function(_0x31b3cf){_0x2dae02['rows']=_0x31b3cf;return _0x2dae02;})[_0xb657('0x32')](respondWithFilteredResult(_0x428447,_0x7521fd))[_0xb657('0x27')](handleError(_0x428447,null));};exports[_0xb657('0xa6')]=function(_0x102e13,_0x6b597c){var _0x5e272b={'raw':![],'where':{'id':_0x102e13['params']['id']}},_0x32849c={};_0x32849c[_0xb657('0x40')]=_[_0xb657('0x42')](db[_0xb657('0x3e')][_0xb657('0x3f')]);_0x32849c[_0xb657('0x41')]=_['keys'](_0x102e13[_0xb657('0x41')]);_0x32849c[_0xb657('0x43')]=_[_0xb657('0x45')](_0x32849c[_0xb657('0x40')],_0x32849c[_0xb657('0x41')]);_0x5e272b[_0xb657('0x44')]=_[_0xb657('0x45')](_0x32849c['model'],qs[_0xb657('0x46')](_0x102e13[_0xb657('0x41')][_0xb657('0x46')]));_0x5e272b['attributes']=_0x5e272b['attributes'][_0xb657('0x47')]?_0x5e272b[_0xb657('0x44')]:_0x32849c[_0xb657('0x40')];if(_0x102e13[_0xb657('0x41')][_0xb657('0xa7')]){_0x5e272b[_0xb657('0xa8')]=[{'all':!![]}];}_0x5e272b=_[_0xb657('0x93')]({},_0x5e272b,_0x102e13['options']);return db['ChatInteraction'][_0xb657('0xa9')](_0x5e272b)[_0xb657('0x32')](handleEntityNotFound(_0x6b597c,null))[_0xb657('0x32')](respondWithResult(_0x6b597c,null))[_0xb657('0x27')](handleError(_0x6b597c,null));};exports[_0xb657('0xaa')]=function(_0x214631,_0x1a07e1){return db[_0xb657('0x3e')]['create'](_0x214631[_0xb657('0xab')],{})[_0xb657('0x32')](respondWithResult(_0x1a07e1,0xc9))['catch'](handleError(_0x1a07e1,null));};exports[_0xb657('0x31')]=function(_0x111b25,_0x477b9f){if(_0x111b25['body']['id']){delete _0x111b25[_0xb657('0xab')]['id'];}return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x111b25['params']['id']}})['then'](handleEntityNotFound(_0x477b9f,null))[_0xb657('0x32')](saveUpdates(_0x111b25[_0xb657('0xab')],null))[_0xb657('0x32')](respondWithResult(_0x477b9f,null))[_0xb657('0x27')](handleError(_0x477b9f,null));};exports[_0xb657('0x33')]=function(_0x28df3d,_0x1a7e93){return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x28df3d[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x1a7e93,null))[_0xb657('0x32')](removeEntity(_0x1a7e93,null))['catch'](handleError(_0x1a7e93,null));};exports[_0xb657('0xad')]=function(_0x231383,_0x544d56){return db[_0xb657('0x3e')][_0xb657('0xad')]()[_0xb657('0x32')](respondWithResult(_0x544d56,null))[_0xb657('0x27')](handleError(_0x544d56,null));};exports[_0xb657('0xae')]=function(_0x685a3b,_0x4bae97){if(_0x685a3b[_0xb657('0xab')]['id']){delete _0x685a3b[_0xb657('0xab')]['id'];}return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x685a3b[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x4bae97,null))[_0xb657('0x32')](saveUpdates(_0x685a3b[_0xb657('0xab')],null))[_0xb657('0x32')](respondWithResult(_0x4bae97,null))[_0xb657('0x27')](handleError(_0x4bae97,null));};exports['abandon']=function(_0x293546,_0x10f193,_0x1b6389){if(_0x293546['body']['id']){delete _0x293546[_0xb657('0xab')]['id'];}return db[_0xb657('0x3e')]['find']({'where':{'id':_0x293546['params']['id']}})[_0xb657('0x32')](function(_0x2abc4f){if(!_0x2abc4f){logger[_0xb657('0x23')](_0xb657('0xaf'),_0xb657('0xb0'),0x194,_0xb657('0xb1'));_0x10f193[_0xb657('0x28')](0x194);}else{if(_0x2abc4f[_0xb657('0xb2')]){throw new db[(_0xb657('0x82'))][(_0xb657('0xb3'))](_0xb657('0xb4'));}}return _0x2abc4f;})[_0xb657('0x32')](function(_0x54a17c){if(_0x54a17c){return _0x54a17c[_0xb657('0x31')]({'closed':_0x293546[_0xb657('0xab')]['closed'],'disposition':_0x293546['body'][_0xb657('0xb5')]})[_0xb657('0x32')](function(_0x5b8798){return _0x5b8798;});}})[_0xb657('0x32')](function(_0x334d1f){return respondWithRpcPromise('AbandonInteraction',_0xb657('0xb0'),_0x293546[_0xb657('0xab')],client9004);})[_0xb657('0x32')](respondWithResult(_0x10f193,null))[_0xb657('0x27')](handleError(_0x10f193,null));};exports['attachmentUpload']=function(_0x24611f,_0x2789b3,_0x19f6c5){_0x24611f[_0xb657('0xab')][_0xb657('0x35')]=_0x24611f[_0xb657('0xb6')][_0xb657('0xb7')];_0x24611f[_0xb657('0xab')][_0xb657('0xb8')]=_0x24611f[_0xb657('0xb6')][_0xb657('0xb9')];_0x24611f['body'][_0xb657('0xba')]=_0x24611f[_0xb657('0xb6')][_0xb657('0xbb')];return db[_0xb657('0xbc')][_0xb657('0xaa')](_0x24611f[_0xb657('0xab')])[_0xb657('0x32')](respondWithResult(_0x2789b3,0xc9))[_0xb657('0x27')](handleError(_0x2789b3,null));};exports[_0xb657('0xbd')]=function(_0xddfd66,_0x5bda88,_0x50c020){return db['ChatInteraction'][_0xb657('0xbe')]({'where':{'id':_0xddfd66['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5bda88,null))[_0xb657('0x32')](function(_0x56e989){if(_0x56e989){if(_0x56e989['closed']){return _0x5bda88[_0xb657('0x29')](0x193)[_0xb657('0x2a')]({'status':0x193,'message':_0xb657('0xbf')});}return db[_0xb657('0xbc')][_0xb657('0xbe')]({'where':{'id':_0xddfd66['query']['attachId']},'raw':!![]})[_0xb657('0x32')](handleEntityNotFound(_0x5bda88,null));}})['then'](function(_0x47a2c3){if(_0x47a2c3){return _0x5bda88[_0xb657('0xc0')](path[_0xb657('0x7e')](config[_0xb657('0xc1')],_0xb657('0xc2'),_0x47a2c3['basename']));}})['catch'](handleError(_0x5bda88,null));};exports[_0xb657('0xc3')]=function(_0x1b7534,_0x2a151c){var _0x2f0307=null;var _0x5b3e05=null;var _0x12a925=null;var _0x242492=null;if(_0x1b7534[_0xb657('0xab')]['id']){delete _0x1b7534[_0xb657('0xab')]['id'];}if(_0x1b7534['body'][_0xb657('0xc4')]){_0x242492=path[_0xb657('0x7e')](config['root'],_0xb657('0xc5'),util['format'](_0xb657('0xc6'),Date[_0xb657('0xc7')]()));_0x1b7534['body'][_0xb657('0xc8')]=_0x242492;}return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x1b7534[_0xb657('0xac')]['id']},'include':[{'model':db[_0xb657('0xc9')],'as':_0xb657('0xca'),'include':[{'model':db[_0xb657('0xcb')],'as':'User'}]}]})[_0xb657('0x32')](handleEntityNotFound(_0x2a151c,null))['then'](saveUpdates(_0x1b7534['body'],null))[_0xb657('0x32')](function(_0x14b0d6){if(_0x14b0d6){_0x2f0307=_0x14b0d6;return db[_0xb657('0xcc')][_0xb657('0xa9')]({'where':{'id':_0x2f0307[_0xb657('0x70')]}});}})[_0xb657('0x32')](function(_0x3f839b){if(_0x3f839b){_0x12a925=_0x3f839b;return db[_0xb657('0xcd')][_0xb657('0xa9')]({'where':{'id':_0x2f0307[_0xb657('0xce')]}});}})['then'](function(_0x544d16){if(_0x544d16){_0x5b3e05=_0x544d16;if(_0x242492){var _0x39f850=null;for(var _0x49460a=0x1;_0x49460a<_0x2f0307[_0xb657('0xca')][_0xb657('0x47')];++_0x49460a){_0x39f850=_0x2f0307[_0xb657('0xca')][_0x49460a];var _0x2cce99=_0x39f850[_0xb657('0xb2')]?util[_0xb657('0xcf')](_0xb657('0xd0'),_0x12a925[_0xb657('0xd1')],_0x39f850['UserId']):_0xb657('0xd2');var _0x27f194=_0x1b7534[_0xb657('0xab')][_0xb657('0xd3')]||util[_0xb657('0xcf')](_0xb657('0xd0'),_0xb657('0xd4'),_0x39f850[_0xb657('0xce')]);switch(_0x12a925['agentIdentifier']){case _0xb657('0xd5'):_0x2cce99=_0x39f850[_0xb657('0xb2')]?util[_0xb657('0xcf')]('%s%d',_0x12a925['agentAlias'],_0x39f850['UserId']):_0xb657('0xd2');break;case _0xb657('0xd6'):_0x2cce99=_0x39f850[_0xb657('0xb2')]?_0x39f850['User']['alias']||_0x39f850[_0xb657('0xcb')][_0xb657('0xd7')]:'System';break;case _0xb657('0xd8'):_0x2cce99=_0x39f850[_0xb657('0xb2')]?_0x39f850[_0xb657('0xcb')][_0xb657('0xd7')]:_0xb657('0xd2');break;default:_0x2cce99=_0x39f850[_0xb657('0xb2')]?util[_0xb657('0xcf')](_0xb657('0xd0'),_0x12a925[_0xb657('0xd1')],_0x39f850[_0xb657('0xb2')]):_0xb657('0xd2');}var _0x3b3ca1=util[_0xb657('0xcf')](_0xb657('0xd9'),moment(_0x39f850[_0xb657('0xda')])[_0xb657('0xcf')]('MM/DD/YYYY\x20HH:mm:ss'),_0x39f850['direction']==='in'?_0x27f194:_0x2cce99,_0x39f850['body']);if(!_0x39f850[_0xb657('0xdb')]){fs[_0xb657('0xdc')](_0x242492,_0x3b3ca1);}}return db[_0xb657('0xdd')][_0xb657('0xbe')]({'where':{'service':!![]},'include':[{'model':db[_0xb657('0xde')],'as':'Smtp','raw':!![]}]});}}})[_0xb657('0x32')](function(_0x5f0394){if(_0x5f0394&&_0x5f0394[_0xb657('0xdf')]&&_0x1b7534[_0xb657('0xab')]){var _0x57ffbf={'tls':{'rejectUnauthorized':![]}};if(_0x5f0394[_0xb657('0xdf')][_0xb657('0xe0')]){_0x57ffbf[_0xb657('0xe0')]=_0x5f0394[_0xb657('0xdf')][_0xb657('0xe0')];}else{_0x57ffbf[_0xb657('0xe1')]=_0x5f0394['Smtp'][_0xb657('0xe1')];_0x57ffbf[_0xb657('0xe2')]=_0x5f0394[_0xb657('0xdf')][_0xb657('0xe2')];_0x57ffbf[_0xb657('0xe3')]=_0x5f0394[_0xb657('0xdf')][_0xb657('0xe3')];}if(_0x5f0394[_0xb657('0xdf')][_0xb657('0xe4')]){_0x57ffbf[_0xb657('0xe5')]={'user':_0x5f0394[_0xb657('0xdf')]['user'],'pass':_0x5f0394[_0xb657('0xdf')]['pass']};}return respondWithRpcPromise(_0xb657('0xe6'),'sendMail',{'account':_0x57ffbf,'message':{'from':util[_0xb657('0xcf')](_0xb657('0xe7'),_0x5f0394['name'],_0x5f0394[_0xb657('0xe8')]||_0x5f0394[_0xb657('0xdf')][_0xb657('0xe9')]),'to':_0x1b7534['body']['mailTranscript'],'subject':_0xb657('0xea'),'text':util[_0xb657('0xcf')](_0xb657('0xeb'),_0x1b7534[_0xb657('0xab')]['mailTranscript']),'attachments':[{'path':_0x242492}]}})[_0xb657('0x32')](function(){return _0x2f0307;})[_0xb657('0x27')](function(_0x26079e){console[_0xb657('0x23')](_0x26079e);});}else{return _0x2f0307;}})[_0xb657('0x32')](respondWithStatusCode(_0x2a151c,0xc8))[_0xb657('0x27')](handleError(_0x2a151c,null));};exports['addMessage']=function(_0x3ea20d,_0x9073b3,_0x250cda){return db['ChatMessage'][_0xb657('0xa9')]({'where':{'id':_0x3ea20d[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x9073b3,null))['then'](function(_0x10e87c){if(_0x10e87c){return _0x10e87c[_0xb657('0xec')](_0x3ea20d['body'][_0xb657('0xed')],_[_0xb657('0xee')](_0x3ea20d[_0xb657('0xab')],[_0xb657('0xed'),'id'])||{});}})[_0xb657('0x32')](respondWithResult(_0x9073b3,null))[_0xb657('0x27')](handleError(_0x9073b3,null));};exports[_0xb657('0xef')]=function(_0x4abb63,_0x49e069,_0x51772a){var _0x3d0763={'raw':![],'where':{}};var _0x55b2c7={};var _0x288baf={'count':0x0,'rows':[]};return db[_0xb657('0x3e')][_0xb657('0xbe')]({'where':{'id':_0x4abb63[_0xb657('0xac')]['id']}})['then'](handleEntityNotFound(_0x49e069,null))[_0xb657('0x32')](function(_0x4d38b6){if(_0x4d38b6){_0x55b2c7[_0xb657('0x40')]=_[_0xb657('0x42')](db['ChatMessage'][_0xb657('0x3f')]);_0x55b2c7[_0xb657('0x41')]=_[_0xb657('0x42')](_0x4abb63[_0xb657('0x41')]);_0x55b2c7[_0xb657('0x43')]=_[_0xb657('0x45')](_0x55b2c7['model'],_0x55b2c7[_0xb657('0x41')]);_0x3d0763[_0xb657('0x44')]=_[_0xb657('0x45')](_0x55b2c7[_0xb657('0x40')],qs['fields'](_0x4abb63[_0xb657('0x41')]['fields']));_0x3d0763[_0xb657('0x44')]=_0x3d0763['attributes'][_0xb657('0x47')]?_0x3d0763[_0xb657('0x44')]:_0x55b2c7['model'];if(!_0x4abb63[_0xb657('0x41')][_0xb657('0x6c')]('nolimit')){_0x3d0763[_0xb657('0x2d')]=qs[_0xb657('0x2d')](_0x4abb63[_0xb657('0x41')][_0xb657('0x2d')]);_0x3d0763[_0xb657('0x2c')]=qs['offset'](_0x4abb63[_0xb657('0x41')]['offset']);}_0x3d0763[_0xb657('0x49')]=qs['sort'](_0x4abb63[_0xb657('0x41')][_0xb657('0x4a')]);_0x3d0763[_0xb657('0x71')]=qs[_0xb657('0x43')](_['pick'](_0x4abb63[_0xb657('0x41')],_0x55b2c7[_0xb657('0x43')]));_0x3d0763[_0xb657('0x71')][_0xb657('0xf0')]=_0x4d38b6['id'];if(_0x4abb63[_0xb657('0x41')][_0xb657('0x6d')]){_0x3d0763[_0xb657('0x71')]=_[_0xb657('0x93')](_0x3d0763[_0xb657('0x71')],{'$or':_[_0xb657('0x38')](_0x3d0763[_0xb657('0x44')],function(_0x2182d5){var _0x414ef4={};_0x414ef4[_0x2182d5]={'$like':'%'+_0x4abb63[_0xb657('0x41')][_0xb657('0x6d')]+'%'};return _0x414ef4;})});}if(_0x4abb63[_0xb657('0x41')][_0xb657('0xf1')]){var _0x4b2072=_0x4abb63['query'][_0xb657('0xf1')][_0xb657('0xf2')](',');var _0x268aa7={};_0x268aa7[_0x4b2072[0x0]]={'$gte':moment(_0x4b2072[0x1])[_0xb657('0xcf')](_0xb657('0xf3'))};_0x3d0763[_0xb657('0x71')]=_['merge'](_0x3d0763[_0xb657('0x71')],_0x268aa7);}_0x3d0763=_[_0xb657('0x93')]({},_0x3d0763,_0x4abb63[_0xb657('0x5f')]);return db[_0xb657('0xc9')][_0xb657('0x2b')]({'where':_0x3d0763[_0xb657('0x71')]})[_0xb657('0x32')](function(_0x5eb1f7){_0x288baf[_0xb657('0x2b')]=_0x5eb1f7;if(_0x4abb63[_0xb657('0x41')][_0xb657('0xa7')]){_0x3d0763[_0xb657('0xa8')]=[{'all':!![]}];}return db[_0xb657('0xc9')][_0xb657('0xf4')](_0x3d0763);})[_0xb657('0x32')](function(_0x296d45){_0x288baf[_0xb657('0xf5')]=_0x296d45;return _0x288baf;});}})[_0xb657('0x32')](respondWithFilteredResult(_0x49e069,_0x3d0763))['catch'](handleError(_0x49e069,null));};exports[_0xb657('0xf6')]=function(_0x248a27,_0x1cf2ee,_0xd207a){var _0x500430={'where':{}},_0x3af1f2={},_0x4bb203={'count':0x0,'rows':[]};return db[_0xb657('0x3e')][_0xb657('0xbe')]({'where':{'id':_0x248a27[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x1cf2ee,null))[_0xb657('0x32')](function(_0x574939){if(_0x574939){_0x3af1f2['model']=_[_0xb657('0x42')](db[_0xb657('0xc9')][_0xb657('0x3f')]);_0x3af1f2[_0xb657('0x41')]=_['keys'](_0x248a27[_0xb657('0x41')]);_0x3af1f2['filters']=_['intersection'](_0x3af1f2[_0xb657('0x40')],_0x3af1f2['query']);_0x500430[_0xb657('0x44')]=_[_0xb657('0x45')](_0x3af1f2['model'],qs[_0xb657('0x46')](_0x248a27[_0xb657('0x41')]['fields']));_0x500430[_0xb657('0x44')]=_0x500430[_0xb657('0x44')][_0xb657('0x47')]?_0x500430[_0xb657('0x44')]:_0x3af1f2[_0xb657('0x40')];if(!_0x248a27[_0xb657('0x41')]['hasOwnProperty'](_0xb657('0x48'))){_0x500430['limit']=qs[_0xb657('0x2d')](_0x248a27['query']['limit']);_0x500430[_0xb657('0x2c')]=qs[_0xb657('0x2c')](_0x248a27['query'][_0xb657('0x2c')]);}_0x500430['order']=qs[_0xb657('0x4a')](_0x248a27[_0xb657('0x41')][_0xb657('0x4a')]);_0x500430['where']=qs[_0xb657('0x43')](_[_0xb657('0x4b')](_0x248a27['query'],_0x3af1f2[_0xb657('0x43')]));_0x500430[_0xb657('0x71')]['ChatInteractionId']=_0x574939['id'];if(_0x248a27[_0xb657('0x41')][_0xb657('0x6d')]){_0x500430['where']=_['merge'](_0x500430[_0xb657('0x71')],{'$or':_[_0xb657('0x38')](_0x500430[_0xb657('0x44')],function(_0x204468){var _0x271a03={};_0x271a03[_0x204468]={'$like':'%'+_0x248a27[_0xb657('0x41')][_0xb657('0x6d')]+'%'};return _0x271a03;})});}_0x500430[_0xb657('0x71')][_0xb657('0xdb')]=![];if(_0x248a27[_0xb657('0x41')]['id']){_0x500430[_0xb657('0x71')]['id']={'$gt':_0x248a27['query']['id']};}_0x500430=_['merge']({},_0x500430,_0x248a27[_0xb657('0x5f')]);return db[_0xb657('0xc9')][_0xb657('0x2b')]({'where':_0x500430[_0xb657('0x71')]})['then'](function(_0x591aa9){_0x4bb203[_0xb657('0x2b')]=_0x591aa9;_0x500430[_0xb657('0xa8')]=[];if(_0x248a27[_0xb657('0x41')][_0xb657('0xf7')]){_0x500430[_0xb657('0xa8')][_0xb657('0x3c')]({'model':db[_0xb657('0xcb')],'as':_0xb657('0xcb'),'attributes':['id',_0xb657('0xd7'),_0xb657('0xf8')]});}if(_0x248a27[_0xb657('0x41')]['includeAll']){_0x500430[_0xb657('0xa8')]=[{'all':!![]}];}return db['ChatMessage'][_0xb657('0xf4')](_0x500430);})['then'](function(_0x4dab6a){_0x4bb203['rows']=_0x4dab6a;return _0x4bb203;});}})[_0xb657('0x32')](respondWithFilteredResult(_0x1cf2ee,_0x500430))[_0xb657('0x27')](handleError(_0x1cf2ee,null));};exports[_0xb657('0xf9')]=function(_0x4782b1,_0x16c7d2,_0x2191bb){return db[_0xb657('0x3e')]['find']({'where':{'id':_0x4782b1[_0xb657('0xac')]['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x16c7d2,null))[_0xb657('0x32')](function(_0x4a496d){if(_0x4a496d){return _0x4a496d[_0xb657('0xfa')](_0x4782b1[_0xb657('0xab')][_0xb657('0xed')],_[_0xb657('0xee')](_0x4782b1[_0xb657('0xab')],[_0xb657('0xed'),'id'])||{})[_0xb657('0xfb')](function(){return db[_0xb657('0xfc')][_0xb657('0xf4')]({'attributes':['id','name',_0xb657('0x4e')],'where':{'id':_0x4782b1[_0xb657('0xab')][_0xb657('0xed')]}});})[_0xb657('0x32')](function(_0x6e8dff){socket[_0xb657('0xfd')](_0xb657('0xfe'),{'id':Number(_0x4782b1['params']['id']),'tags':_0x6e8dff||[]});return{'id':Number(_0x4782b1[_0xb657('0xac')]['id']),'tags':_0x6e8dff||[]};});}})[_0xb657('0x32')](respondWithResult(_0x16c7d2,null))['catch'](handleError(_0x16c7d2,null));};exports['removeTags']=function(_0x4391e4,_0x565aed,_0x41c158){return db[_0xb657('0x3e')][_0xb657('0xa9')]({'where':{'id':_0x4391e4['params']['id']}})[_0xb657('0x32')](handleEntityNotFound(_0x565aed,null))['then'](function(_0x2e89a3){if(_0x2e89a3){return _0x2e89a3[_0xb657('0xff')](_0x4391e4[_0xb657('0x41')]['ids']);}})[_0xb657('0x32')](respondWithStatusCode(_0x565aed,null))['catch'](handleError(_0x565aed,null));};exports['download']=function(_0x3ecf42,_0x542fff){var _0x5c5a79=moment()[_0xb657('0x100')]()['toString']();var _0x1e61cf=path[_0xb657('0x7e')](config[_0xb657('0xc1')],'server',_0xb657('0x101'),'tmp');var _0x3d784a=path[_0xb657('0x7e')](config['root'],_0xb657('0x102'),_0xb657('0x101'),_0xb657('0x103'));var _0x4323f1=path[_0xb657('0x7e')](_0x1e61cf,_0x5c5a79);var _0x497104=util[_0xb657('0xcf')](_0xb657('0x104'),_0x3ecf42[_0xb657('0xac')]['id'],_0x5c5a79);var _0x356056=path['join'](_0x1e61cf,_0x497104);var _0x4b30fe=![];return db['ChatInteraction']['find']({'where':{'id':_0x3ecf42[_0xb657('0xac')]['id']},'include':[{'model':db[_0xb657('0xc9')],'as':_0xb657('0xca'),'attributes':['id',_0xb657('0xab'),_0xb657('0xda'),'direction','secret',_0xb657('0x77')],'include':[{'model':db['User'],'as':'User','attributes':['id',_0xb657('0xd7')],'raw':!![]},{'model':db[_0xb657('0xcd')],'as':'Contact','attributes':['id','firstName',_0xb657('0x105')],'raw':!![]},{'model':db[_0xb657('0xbc')],'as':_0xb657('0xbc'),'raw':!![]}]},{'model':db[_0xb657('0xcc')],'as':_0xb657('0x106'),'attributes':['id','name']},{'model':db[_0xb657('0xcb')],'as':_0xb657('0x107'),'attributes':['id',_0xb657('0xd7')]}]})[_0xb657('0x32')](handleEntityNotFound(_0x542fff,null))[_0xb657('0x32')](function(_0x275d5c){if(_0x275d5c){var _0x5bc8a2=_0x275d5c[_0xb657('0x108')]({'plain':!![]});_0x4b30fe=!![];var _0x39227d={'format':'A4','border':_0xb657('0x109'),'header':{'height':_0xb657('0x10a'),'contents':{'first':_0xb657('0x10b')}},'footer':{'height':_0xb657('0x10c'),'contents':{'default':util[_0xb657('0xcf')]('
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
',util[_0xb657('0xcf')](_0xb657('0x10d'),_0xb657('0x10e'),_0x5bc8a2['id']),moment()[_0xb657('0xcf')](_0xb657('0x10f'))[_0xb657('0x7d')]())}}};fs[_0xb657('0x110')](_0x4323f1);var _0x1a1f5b={'channel':_0xb657('0x10e'),'account':_0x5bc8a2[_0xb657('0x106')][_0xb657('0x35')],'agent':_0x5bc8a2[_0xb657('0x107')]?_0x5bc8a2[_0xb657('0x107')][_0xb657('0xd7')]:_0xb657('0x111'),'createdAt':moment(_0x5bc8a2[_0xb657('0xda')])[_0xb657('0xcf')](_0xb657('0xf3'))[_0xb657('0x7d')](),'closedAt':_0x5bc8a2['closed']?moment(_0x5bc8a2['closedAt'])[_0xb657('0xcf')](_0xb657('0xf3'))[_0xb657('0x7d')]():'','disposition':_0x5bc8a2['disposition'],'chatInfo':{'browser':_0x5bc8a2[_0xb657('0x112')],'os':_0x5bc8a2[_0xb657('0x113')],'referer':_0x5bc8a2[_0xb657('0x114')],'customerIp':_0x5bc8a2[_0xb657('0x115')],'customerPort':_0x5bc8a2[_0xb657('0x116')]?_0x5bc8a2[_0xb657('0x116')]:_0xb657('0x111')},'messages':_(_0x5bc8a2[_0xb657('0xca')])['tail']()[_0xb657('0x6d')]({'secret':![]})[_0xb657('0x38')](function(_0x2641b1){if(_0x2641b1['Attachment']){var _0x25c6e5=path['join'](_0x3d784a,_0x2641b1[_0xb657('0xbc')][_0xb657('0xb8')]);if(fs[_0xb657('0x117')](_0x25c6e5)){fs[_0xb657('0x118')](_0x25c6e5)[_0xb657('0x119')](fs[_0xb657('0x11a')](path[_0xb657('0x7e')](_0x4323f1,_0x2641b1['Attachment']['basename'])));}}return{'date':moment(_0x2641b1[_0xb657('0xda')])[_0xb657('0xcf')](_0xb657('0xf3'))[_0xb657('0x7d')](),'sender':_0x2641b1[_0xb657('0x11b')]===_0xb657('0x11c')?_0x2641b1[_0xb657('0xcb')]?_0x2641b1['User'][_0xb657('0xd7')]:_0xb657('0xd2'):_0x2641b1[_0xb657('0x11d')][_0xb657('0x11e')]+(_0x2641b1[_0xb657('0x11d')][_0xb657('0x105')]?'\x20'+_0x2641b1[_0xb657('0x11d')][_0xb657('0x105')]:''),'body':_0x2641b1[_0xb657('0xbc')]?_0x2641b1[_0xb657('0xbc')][_0xb657('0xb8')]:_0x2641b1[_0xb657('0xab')],'direction':_0x2641b1[_0xb657('0x11b')]===_0xb657('0x11c')?'A':'C','secret':_0x2641b1[_0xb657('0xdb')],'read':_0x2641b1[_0xb657('0x77')],'attachment':_0x2641b1[_0xb657('0xbc')]};})[_0xb657('0x63')]()};return ejs[_0xb657('0x11f')](path[_0xb657('0x7e')](config[_0xb657('0xc1')],_0xb657('0x102'),_0xb657('0x120'),_0xb657('0x121')),{'interaction':_0x1a1f5b})['then'](function(_0x15a28f){return new BPromise(function(_0xeec4c4,_0x50f597){pdf[_0xb657('0xaa')](_0x15a28f,_0x39227d)['toFile'](path[_0xb657('0x7e')](_0x4323f1,_0xb657('0x122')+_0x5bc8a2['id']+'-'+_0x5c5a79+'.pdf'),function(_0x1d3a6c,_0x2ae9ba){if(_0x1d3a6c)return _0x50f597(_0x1d3a6c);_0xeec4c4(_0x2ae9ba);});});});}})[_0xb657('0x32')](function(){if(_0x4b30fe){return new BPromise(function(_0x52838d,_0x1fd455){zipdir(_0x4323f1,{'saveTo':_0x356056},function(_0x4a9600,_0x28eb51){if(_0x4a9600)return _0x1fd455(_0x4a9600);return _0x52838d(_0x28eb51);});})[_0xb657('0x32')](function(){return new BPromise(function(_0x4d1b12,_0x13efc6){rimraf(_0x4323f1,function(_0xe0927b){if(_0xe0927b)_0x13efc6(_0xe0927b);return _0x4d1b12();});});})['then'](function(){return _0x542fff[_0xb657('0xc0')](_0x356056,_0x497104,function(_0x88df4){if(_0x88df4){console['log']('err',_0x88df4);}else{fs[_0xb657('0x123')](_0x356056);}});});}else{return _0x542fff[_0xb657('0x28')](0xc8);}})[_0xb657('0x27')](handleError(_0x542fff,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index b562c49..ba23d5c 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 _0x07a5=['save','remove','getUsers','then','Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0x07a5,0x1e8));var _0x507a=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x07a5[_0x5b27da];return _0x3254f4;};'use strict';var EventEmitter=require(_0x507a('0x0'));var ChatInteraction=require(_0x507a('0x1'))['db'][_0x507a('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x507a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x507a('0x4')](0x0);var events={'afterCreate':_0x507a('0x5'),'afterUpdate':'update','afterDestroy':_0x507a('0x6')};function emitEvent(_0x4beada){return function(_0x3540bc,_0x111317,_0x27e34f){_0x3540bc[_0x507a('0x7')]({'attributes':['id'],'raw':!![]})[_0x507a('0x8')](function(_0x5b14d5){_0x3540bc['setDataValue'](_0x507a('0x9'),_0x5b14d5[_0x507a('0xa')](function(_0x17a772){return{'id':_0x17a772['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3540bc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4ead6d){_0x3540bc['setDataValue'](_0x507a('0xb'),_0x4ead6d['length']);ChatInteractionEvents[_0x507a('0xc')](_0x4beada+':'+_0x3540bc['id'],_0x3540bc);ChatInteractionEvents['emit'](_0x4beada,_0x3540bc);_0x27e34f(null);})[_0x507a('0xd')](_0x27e34f(null));};}for(var e in events){if(events[_0x507a('0xe')](e)){var event=events[e];ChatInteraction[_0x507a('0xf')](e,emitEvent(event));}}module[_0x507a('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xd494=['exports','events','ChatInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd494,0x166));var _0x4d49=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd494[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x4d49('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4d49('0x1')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4d49('0x2')](0x0);var events={'afterCreate':_0x4d49('0x3'),'afterUpdate':_0x4d49('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b40e6){return function(_0x4c40e3,_0x25d162,_0x58b490){_0x4c40e3[_0x4d49('0x5')]({'attributes':['id'],'raw':!![]})[_0x4d49('0x6')](function(_0x1c149a){_0x4c40e3[_0x4d49('0x7')](_0x4d49('0x8'),_0x1c149a[_0x4d49('0x9')](function(_0xb74f36){return{'id':_0xb74f36['id']};}));return ChatMessage[_0x4d49('0xa')]({'where':{'ChatInteractionId':_0x4c40e3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3408a3){_0x4c40e3[_0x4d49('0x7')](_0x4d49('0xb'),_0x3408a3['length']);ChatInteractionEvents[_0x4d49('0xc')](_0x2b40e6+':'+_0x4c40e3['id'],_0x4c40e3);ChatInteractionEvents[_0x4d49('0xc')](_0x2b40e6,_0x4c40e3);_0x58b490(null);})[_0x4d49('0xd')](_0x58b490(null));};}for(var e in events){if(events[_0x4d49('0xe')](e)){var event=events[e];ChatInteraction[_0x4d49('0xf')](e,emitEvent(event));}}module[_0x4d49('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 4bd9580..b314b51 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 _0xd10b=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','../../config/logger','api','bluebird','./chatInteraction.attributes','exports','chat_interactions','changed'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xd10b,0x7c));var _0xbd10=function(_0x5aefd6,_0x2b3e9e){_0x5aefd6=_0x5aefd6-0x0;var _0x17d734=_0xd10b[_0x5aefd6];return _0x17d734;};'use strict';var _=require(_0xbd10('0x0'));var util=require('util');var logger=require(_0xbd10('0x1'))(_0xbd10('0x2'));var moment=require('moment');var BPromise=require(_0xbd10('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(_0xbd10('0x4'));module[_0xbd10('0x5')]=function(_0x171626,_0x1ff171){return _0x171626['define']('ChatInteraction',attributes,{'tableName':_0xbd10('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xaaa3bc,_0x5a426f,_0x206a8a){if(_0xaaa3bc[_0xbd10('0x7')](_0xbd10('0x8'))){_0xaaa3bc['closedAt']=moment()[_0xbd10('0x9')](_0xbd10('0xa'));}_0x206a8a(null,_0xaaa3bc);}},'charset':_0xbd10('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe3cc=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x1326cf,_0x407aa5){var _0x3cf7c8=function(_0x5488d8){while(--_0x5488d8){_0x1326cf['push'](_0x1326cf['shift']());}};_0x3cf7c8(++_0x407aa5);}(_0xe3cc,0x1a7));var _0xce3c=function(_0x294360,_0x2de107){_0x294360=_0x294360-0x0;var _0x2b5d49=_0xe3cc[_0x294360];return _0x2b5d49;};'use strict';var _=require(_0xce3c('0x0'));var util=require(_0xce3c('0x1'));var logger=require(_0xce3c('0x2'))(_0xce3c('0x3'));var moment=require(_0xce3c('0x4'));var BPromise=require('bluebird');var rp=require(_0xce3c('0x5'));var fs=require('fs');var path=require(_0xce3c('0x6'));var rimraf=require('rimraf');var config=require(_0xce3c('0x7'));var attributes=require(_0xce3c('0x8'));module[_0xce3c('0x9')]=function(_0xf0fceb,_0x54a956){return _0xf0fceb[_0xce3c('0xa')](_0xce3c('0xb'),attributes,{'tableName':_0xce3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3fd032,_0x278d81,_0x31e731){if(_0x3fd032[_0xce3c('0xd')]('closed')){_0x3fd032[_0xce3c('0xe')]=moment()[_0xce3c('0xf')](_0xce3c('0x10'));}_0x31e731(null,_0x3fd032);}},'charset':_0xce3c('0x11'),'collate':_0xce3c('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 2c75cdf..cb792d7 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 _0xd8b1=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','options','limit','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x4e8cb1,_0x2bcf96){var _0x510ee1=function(_0x3c170f){while(--_0x3c170f){_0x4e8cb1['push'](_0x4e8cb1['shift']());}};_0x510ee1(++_0x2bcf96);}(_0xd8b1,0x6d));var _0x1d8b=function(_0x39135b,_0x1115b0){_0x39135b=_0x39135b-0x0;var _0x20d9ab=_0xd8b1[_0x39135b];return _0x20d9ab;};'use strict';var _=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var moment=require(_0x1d8b('0x2'));var BPromise=require(_0x1d8b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d8b('0x4'));var db=require(_0x1d8b('0x5'))['db'];var utils=require(_0x1d8b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1d8b('0x7'));var jayson=require(_0x1d8b('0x8'));var client=jayson[_0x1d8b('0x9')][_0x1d8b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1d8b('0xb'),'port':0x18eb});var socket=require(_0x1d8b('0xc'))(new Redis(config[_0x1d8b('0xd')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1843e8,_0x4380ff,_0x15446b){return new BPromise(function(_0x56fc2e,_0x2bd218){return client[_0x1d8b('0xe')](_0x1843e8,_0x15446b)[_0x1d8b('0xf')](function(_0x2789db){logger['info'](_0x1d8b('0x10'),_0x4380ff,_0x1d8b('0x11'));logger[_0x1d8b('0x12')](_0x1d8b('0x13'),_0x4380ff,_0x1d8b('0x11'),JSON[_0x1d8b('0x14')](_0x2789db));if(_0x2789db[_0x1d8b('0x15')]){if(_0x2789db['error'][_0x1d8b('0x16')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4380ff,_0x2789db[_0x1d8b('0x15')][_0x1d8b('0x17')]);return _0x2bd218(_0x2789db['error'][_0x1d8b('0x17')]);}logger[_0x1d8b('0x15')](_0x1d8b('0x10'),_0x4380ff,_0x2789db['error'][_0x1d8b('0x17')]);return _0x56fc2e(_0x2789db[_0x1d8b('0x15')][_0x1d8b('0x17')]);}else{logger[_0x1d8b('0x18')](_0x1d8b('0x10'),_0x4380ff,_0x1d8b('0x11'));_0x56fc2e(_0x2789db[_0x1d8b('0x19')][_0x1d8b('0x17')]);}})[_0x1d8b('0x1a')](function(_0x28ed47){logger[_0x1d8b('0x15')](_0x1d8b('0x10'),_0x4380ff,_0x28ed47);_0x2bd218(_0x28ed47);});});}exports[_0x1d8b('0x1b')]=function(_0x105408){var _0x331152=this;return new Promise(function(_0x4952b2,_0x2b509c){return db[_0x1d8b('0x1c')]['update'](_0x105408['body'],{'raw':_0x105408[_0x1d8b('0x1d')]?_0x105408['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105408[_0x1d8b('0x1d')]?_0x105408[_0x1d8b('0x1d')]['where']||null:null,'attributes':_0x105408['options']?_0x105408['options']['attributes']||null:null,'limit':_0x105408[_0x1d8b('0x1d')]?_0x105408[_0x1d8b('0x1d')][_0x1d8b('0x1e')]||null:null})[_0x1d8b('0xf')](function(_0x1a196a){logger[_0x1d8b('0x18')](_0x1d8b('0x1b'),_0x105408);logger[_0x1d8b('0x12')](_0x1d8b('0x1b'),_0x105408,JSON[_0x1d8b('0x14')](_0x1a196a));_0x4952b2(_0x1a196a);})[_0x1d8b('0x1a')](function(_0x893c64){logger[_0x1d8b('0x15')](_0x1d8b('0x1b'),_0x893c64[_0x1d8b('0x17')],_0x105408);_0x2b509c(_0x331152['error'](0x1f4,_0x893c64[_0x1d8b('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x312f4f){return new Promise(function(_0x2a84a1,_0x24abea){return db[_0x1d8b('0x1c')][_0x1d8b('0x1f')]({'where':_0x312f4f[_0x1d8b('0x1d')]?_0x312f4f['options']['where']||null:null})[_0x1d8b('0xf')](function(_0x29c338){if(_0x29c338){return _0x29c338[_0x1d8b('0x20')](_0x312f4f[_0x1d8b('0x21')][_0x1d8b('0x22')],_[_0x1d8b('0x23')](_0x312f4f[_0x1d8b('0x21')],[_0x1d8b('0x22'),'id'])||{});}})[_0x1d8b('0x24')](function(_0x4ecce4){logger[_0x1d8b('0x18')](_0x1d8b('0x25'),_0x312f4f);logger[_0x1d8b('0x12')]('AddTags',_0x312f4f,JSON[_0x1d8b('0x14')](_0x4ecce4));_0x2a84a1(_0x4ecce4);})['catch'](function(_0x2945ba){logger[_0x1d8b('0x15')](_0x1d8b('0x25'),_0x2945ba[_0x1d8b('0x17')],_0x312f4f);_0x24abea(_this['error'](0x1f4,_0x2945ba[_0x1d8b('0x17')]));});});};
\ No newline at end of file
+var _0xac9c=['../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','debug','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','request\x20sent','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','limit','then','AddTagsToChatInteraction','find','where','addTags','ids','body','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xac9c,0x96));var _0xcac9=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xac9c[_0x176329];return _0x31997c;};'use strict';var _=require(_0xcac9('0x0'));var util=require(_0xcac9('0x1'));var moment=require('moment');var BPromise=require(_0xcac9('0x2'));var rs=require(_0xcac9('0x3'));var fs=require('fs');var Redis=require(_0xcac9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcac9('0x5'));var logger=require(_0xcac9('0x6'))('rpc');var config=require(_0xcac9('0x7'));var jayson=require(_0xcac9('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xcac9('0x9')]=_['defaults'](config[_0xcac9('0x9')],{'host':_0xcac9('0xa'),'port':0x18eb});var socket=require(_0xcac9('0xb'))(new Redis(config[_0xcac9('0x9')]));require(_0xcac9('0xc'))[_0xcac9('0xd')](socket);function respondWithRpcPromise(_0x3b2271,_0x38bb26,_0x2b30ae){return new BPromise(function(_0x2fb923,_0x235a76){return client[_0xcac9('0xe')](_0x3b2271,_0x2b30ae)['then'](function(_0x37700f){logger[_0xcac9('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x38bb26,'request\x20sent');logger[_0xcac9('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x38bb26,'request\x20sent',JSON[_0xcac9('0x11')](_0x37700f));if(_0x37700f['error']){if(_0x37700f[_0xcac9('0x12')][_0xcac9('0x13')]===0x1f4){logger[_0xcac9('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x38bb26,_0x37700f[_0xcac9('0x12')][_0xcac9('0x14')]);return _0x235a76(_0x37700f[_0xcac9('0x12')][_0xcac9('0x14')]);}logger[_0xcac9('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x38bb26,_0x37700f['error'][_0xcac9('0x14')]);return _0x2fb923(_0x37700f[_0xcac9('0x12')][_0xcac9('0x14')]);}else{logger[_0xcac9('0xf')](_0xcac9('0x15'),_0x38bb26,_0xcac9('0x16'));_0x2fb923(_0x37700f['result'][_0xcac9('0x14')]);}})[_0xcac9('0x17')](function(_0x5abda0){logger['error'](_0xcac9('0x15'),_0x38bb26,_0x5abda0);_0x235a76(_0x5abda0);});});}exports[_0xcac9('0x18')]=function(_0x406328){var _0x4a392c=this;return new Promise(function(_0x1399a6,_0x4021e9){return db[_0xcac9('0x19')][_0xcac9('0x1a')](_0x406328['body'],{'raw':_0x406328[_0xcac9('0x1b')]?_0x406328[_0xcac9('0x1b')][_0xcac9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x406328['options']?_0x406328[_0xcac9('0x1b')]['where']||null:null,'attributes':_0x406328['options']?_0x406328[_0xcac9('0x1b')]['attributes']||null:null,'limit':_0x406328['options']?_0x406328[_0xcac9('0x1b')][_0xcac9('0x1d')]||null:null})[_0xcac9('0x1e')](function(_0x2effaa){logger[_0xcac9('0xf')]('UpdateChatInteraction',_0x406328);logger[_0xcac9('0x10')](_0xcac9('0x18'),_0x406328,JSON['stringify'](_0x2effaa));_0x1399a6(_0x2effaa);})[_0xcac9('0x17')](function(_0x24d1f7){logger[_0xcac9('0x12')]('UpdateChatInteraction',_0x24d1f7[_0xcac9('0x14')],_0x406328);_0x4021e9(_0x4a392c['error'](0x1f4,_0x24d1f7[_0xcac9('0x14')]));});});};exports[_0xcac9('0x1f')]=function(_0x5e95ef){return new Promise(function(_0x21b0ea,_0x15ca3b){return db[_0xcac9('0x19')][_0xcac9('0x20')]({'where':_0x5e95ef[_0xcac9('0x1b')]?_0x5e95ef[_0xcac9('0x1b')][_0xcac9('0x21')]||null:null})[_0xcac9('0x1e')](function(_0xb98f){if(_0xb98f){return _0xb98f[_0xcac9('0x22')](_0x5e95ef['body'][_0xcac9('0x23')],_['omit'](_0x5e95ef[_0xcac9('0x24')],[_0xcac9('0x23'),'id'])||{});}})[_0xcac9('0x25')](function(_0x4ac097){logger['info'](_0xcac9('0x26'),_0x5e95ef);logger[_0xcac9('0x10')](_0xcac9('0x26'),_0x5e95ef,JSON[_0xcac9('0x11')](_0x4ac097));_0x21b0ea(_0x4ac097);})[_0xcac9('0x17')](function(_0x2159d6){logger[_0xcac9('0x12')](_0xcac9('0x26'),_0x2159d6[_0xcac9('0x14')],_0x5e95ef);_0x15ca3b(_this[_0xcac9('0x12')](0x1f4,_0x2159d6['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d0ac895..5f637f0 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 _0xf79b=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x46229b,_0x5f1823){var _0x2540dc=function(_0x599ab9){while(--_0x599ab9){_0x46229b['push'](_0x46229b['shift']());}};_0x2540dc(++_0x5f1823);}(_0xf79b,0xa4));var _0xbf79=function(_0x112d94,_0x878696){_0x112d94=_0x112d94-0x0;var _0x1d6b50=_0xf79b[_0x112d94];return _0x1d6b50;};'use strict';var ChatInteractionEvents=require(_0xbf79('0x0'));var events=[_0xbf79('0x1'),_0xbf79('0x2'),_0xbf79('0x3')];function createListener(_0x53eb29,_0x419b00){return function(_0x54e6cf){_0x419b00[_0xbf79('0x4')](_0x53eb29,_0x54e6cf);};}function removeListener(_0x4cf5f2,_0x4ad345){return function(){ChatInteractionEvents[_0xbf79('0x5')](_0x4cf5f2,_0x4ad345);};}exports[_0xbf79('0x6')]=function(_0x252862){for(var _0x33712a=0x0,_0x22a23a=events[_0xbf79('0x7')];_0x33712a<_0x22a23a;_0x33712a++){var _0x4bc791=events[_0x33712a];var _0x2f789c=createListener(_0xbf79('0x8')+_0x4bc791,_0x252862);ChatInteractionEvents['on'](_0x4bc791,_0x2f789c);}};
\ No newline at end of file
+var _0xae7e=['length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x196d3b,_0x112219){var _0x1d5707=function(_0x376a80){while(--_0x376a80){_0x196d3b['push'](_0x196d3b['shift']());}};_0x1d5707(++_0x112219);}(_0xae7e,0x11a));var _0xeae7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xae7e[_0x5b644e];return _0x49c6bf;};'use strict';var ChatInteractionEvents=require(_0xeae7('0x0'));var events=[_0xeae7('0x1'),'remove',_0xeae7('0x2')];function createListener(_0x133e71,_0x2492fc){return function(_0x4528b9){_0x2492fc['emit'](_0x133e71,_0x4528b9);};}function removeListener(_0x2a2537,_0x1ba5a7){return function(){ChatInteractionEvents['removeListener'](_0x2a2537,_0x1ba5a7);};}exports['register']=function(_0x4768e7){for(var _0x59a7b9=0x0,_0x2e806c=events[_0xeae7('0x3')];_0x59a7b9<_0x2e806c;_0x59a7b9++){var _0x51c762=events[_0x59a7b9];var _0x457abe=createListener(_0xeae7('0x4')+_0x51c762,_0x4768e7);ChatInteractionEvents['on'](_0x51c762,_0x457abe);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index f59d335..d6f3938 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 _0x2019=['chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','/:id/download','download','post','create','join','format','now','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put'];(function(_0x14c8ee,_0x34d4fb){var _0x51acc2=function(_0x4c1277){while(--_0x4c1277){_0x14c8ee['push'](_0x14c8ee['shift']());}};_0x51acc2(++_0x34d4fb);}(_0x2019,0x1c4));var _0x9201=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2019[_0x2aea9e];return _0x430b92;};'use strict';var multer=require('multer');var util=require(_0x9201('0x0'));var path=require('path');var timeout=require(_0x9201('0x1'));var express=require(_0x9201('0x2'));var router=express['Router']();var auth=require(_0x9201('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9201('0x4'));var controller=require(_0x9201('0x5'));router[_0x9201('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9201('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x9201('0x7')]);router[_0x9201('0x6')](_0x9201('0x8'),auth[_0x9201('0x9')](),controller['show']);router[_0x9201('0x6')](_0x9201('0xa'),auth[_0x9201('0x9')](),controller[_0x9201('0xb')]);router[_0x9201('0x6')](_0x9201('0xc'),auth[_0x9201('0xd')](),controller[_0x9201('0xe')]);router[_0x9201('0x6')](_0x9201('0xf'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0x9201('0x10'),auth[_0x9201('0xd')](),controller[_0x9201('0x11')]);router[_0x9201('0x12')]('/',auth['isAuthenticated'](),controller[_0x9201('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d1d3d,_0x41cf28,_0x530855){_0x530855(null,path[_0x9201('0x14')](config['root'],'server/files/attachments/'));},'filename':function(_0x56f405,_0x52171d,_0xd47a3c){_0xd47a3c(null,util[_0x9201('0x15')]('%s-%s',Date[_0x9201('0x16')](),_0x52171d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9201('0x12')](_0x9201('0x17'),upload[_0x9201('0x18')]('file'),controller[_0x9201('0x19')]);router[_0x9201('0x12')](_0x9201('0xc'),auth[_0x9201('0x9')](),controller[_0x9201('0x1a')]);router[_0x9201('0x12')]('/:id/tags',auth[_0x9201('0xd')](),interaction[_0x9201('0x1b')](_0x9201('0x1c'),_0x9201('0x1d')),controller[_0x9201('0x1e')]);router[_0x9201('0x1f')](_0x9201('0x8'),auth[_0x9201('0xd')](),interaction[_0x9201('0x1b')](_0x9201('0x1c'),_0x9201('0x20')),controller[_0x9201('0x21')]);router[_0x9201('0x1f')](_0x9201('0x22'),controller[_0x9201('0x23')]);router['put'](_0x9201('0x24'),auth['isChatInteractionAuthorized'](),controller[_0x9201('0x25')]);router[_0x9201('0x1f')](_0x9201('0x26'),controller['close']);router[_0x9201('0x27')](_0x9201('0x8'),auth[_0x9201('0xd')](),interaction[_0x9201('0x1b')](_0x9201('0x1c'),_0x9201('0x28')),controller[_0x9201('0x29')]);router[_0x9201('0x27')](_0x9201('0x2a'),auth[_0x9201('0xd')](),controller[_0x9201('0x2b')]);module['exports']=router;
\ No newline at end of file
+var _0x9fd9=['single','file','attachmentUpload','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','root','server/files/attachments/','now','originalname','/:id/attachment_upload'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x9fd9,0x1e6));var _0x99fd=function(_0x42d1c3,_0x42272d){_0x42d1c3=_0x42d1c3-0x0;var _0x1765e4=_0x9fd9[_0x42d1c3];return _0x1765e4;};'use strict';var multer=require(_0x99fd('0x0'));var util=require(_0x99fd('0x1'));var path=require('path');var timeout=require(_0x99fd('0x2'));var express=require(_0x99fd('0x3'));var router=express[_0x99fd('0x4')]();var auth=require(_0x99fd('0x5'));var interaction=require(_0x99fd('0x6'));var config=require(_0x99fd('0x7'));var controller=require('./chatInteraction.controller');router[_0x99fd('0x8')]('/',auth['isAuthenticated'](),controller[_0x99fd('0x9')]);router[_0x99fd('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x99fd('0xa')]);router[_0x99fd('0x8')](_0x99fd('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x99fd('0xc')]);router['get'](_0x99fd('0xd'),auth[_0x99fd('0xe')](),controller[_0x99fd('0xf')]);router[_0x99fd('0x8')](_0x99fd('0x10'),auth[_0x99fd('0x11')](),controller[_0x99fd('0x12')]);router['get'](_0x99fd('0x13'),auth[_0x99fd('0xe')](),controller[_0x99fd('0x14')]);router[_0x99fd('0x8')](_0x99fd('0x15'),auth[_0x99fd('0x11')](),controller[_0x99fd('0x16')]);router[_0x99fd('0x17')]('/',auth[_0x99fd('0x11')](),controller[_0x99fd('0x18')]);var upload=multer({'storage':multer[_0x99fd('0x19')]({'destination':function(_0x30f746,_0x575255,_0x5520eb){_0x5520eb(null,path['join'](config[_0x99fd('0x1a')],_0x99fd('0x1b')));},'filename':function(_0x50a94c,_0x496bb8,_0xe89423){_0xe89423(null,util['format']('%s-%s',Date[_0x99fd('0x1c')](),_0x496bb8[_0x99fd('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x99fd('0x17')](_0x99fd('0x1e'),upload[_0x99fd('0x1f')](_0x99fd('0x20')),controller[_0x99fd('0x21')]);router[_0x99fd('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x99fd('0x17')]('/:id/tags',auth[_0x99fd('0x11')](),interaction[_0x99fd('0x22')](_0x99fd('0x23'),_0x99fd('0x24')),controller[_0x99fd('0x25')]);router[_0x99fd('0x26')](_0x99fd('0xb'),auth['isAuthenticated'](),interaction[_0x99fd('0x22')]('chat',_0x99fd('0x27')),controller['update']);router[_0x99fd('0x26')](_0x99fd('0x28'),controller['customUpdate']);router[_0x99fd('0x26')](_0x99fd('0x29'),auth['isChatInteractionAuthorized'](),controller[_0x99fd('0x2a')]);router[_0x99fd('0x26')]('/:id/close',controller['close']);router[_0x99fd('0x2b')](_0x99fd('0xb'),auth[_0x99fd('0x11')](),interaction['tracked'](_0x99fd('0x23'),_0x99fd('0x2c')),controller[_0x99fd('0x2d')]);router[_0x99fd('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x99fd('0x2e')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7a1ece7..69f8b30 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 _0x1967=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x5533be,_0x2cfc30){var _0xb3a93e=function(_0x413412){while(--_0x413412){_0x5533be['push'](_0x5533be['shift']());}};_0xb3a93e(++_0x2cfc30);}(_0x1967,0x173));var _0x7196=function(_0x436d37,_0x27e3ff){_0x436d37=_0x436d37-0x0;var _0x39e623=_0x1967[_0x436d37];return _0x39e623;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'body':{'type':Sequelize[_0x7196('0x1')](_0x7196('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7196('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7196('0x4')]}};
\ No newline at end of file
+var _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x1d6aca,_0xd8fd0c){var _0x5739f2=function(_0x453fe8){while(--_0x453fe8){_0x1d6aca['push'](_0x1d6aca['shift']());}};_0x5739f2(++_0xd8fd0c);}(_0xdb28,0x106));var _0x8db2=function(_0x68497d,_0xd46bae){_0x68497d=_0x68497d-0x0;var _0x2144a5=_0xdb28[_0x68497d];return _0x2144a5;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 0a53dc2..dedbc4d 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 _0xbecf=['autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','keys','filters','intersection','attributes','model','fields','query','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId'];(function(_0x4e7551,_0x398ee5){var _0x2c2ae8=function(_0x31f000){while(--_0x31f000){_0x4e7551['push'](_0x4e7551['shift']());}};_0x2c2ae8(++_0x398ee5);}(_0xbecf,0x15c));var _0xfbec=function(_0x3372b9,_0x1cee51){_0x3372b9=_0x3372b9-0x0;var _0x289618=_0xbecf[_0x3372b9];return _0x289618;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfbec('0x0'));var zipdir=require(_0xfbec('0x1'));var jsonpatch=require(_0xfbec('0x2'));var rp=require(_0xfbec('0x3'));var moment=require('moment');var BPromise=require(_0xfbec('0x4'));var Mustache=require(_0xfbec('0x5'));var util=require(_0xfbec('0x6'));var path=require(_0xfbec('0x7'));var sox=require(_0xfbec('0x8'));var csv=require('to-csv');var ejs=require(_0xfbec('0x9'));var fs=require('fs');var _=require(_0xfbec('0xa'));var squel=require(_0xfbec('0xb'));var crypto=require(_0xfbec('0xc'));var jsforce=require(_0xfbec('0xd'));var deskjs=require(_0xfbec('0xe'));var toCsv=require(_0xfbec('0xf'));var querystring=require(_0xfbec('0x10'));var Papa=require(_0xfbec('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbec('0x12'));var hardwareService=require(_0xfbec('0x13'));var logger=require(_0xfbec('0x14'))(_0xfbec('0x15'));var utils=require(_0xfbec('0x16'));var config=require('../../config/environment');var db=require(_0xfbec('0x17'))['db'];config[_0xfbec('0x18')]=_[_0xfbec('0x19')](config[_0xfbec('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xfbec('0x1a'))(new Redis(config[_0xfbec('0x18')]));require(_0xfbec('0x1b'))[_0xfbec('0x1c')](socket);function respondWithStatusCode(_0x53e749,_0x93609b){_0x93609b=_0x93609b||0xcc;return function(_0x5e021e){if(_0x5e021e){return _0x53e749[_0xfbec('0x1d')](_0x93609b);}return _0x53e749['status'](_0x93609b)[_0xfbec('0x1e')]();};}function respondWithResult(_0x923681,_0x171721){_0x171721=_0x171721||0xc8;return function(_0x4aa49e){if(_0x4aa49e){return _0x923681[_0xfbec('0x1f')](_0x171721)[_0xfbec('0x20')](_0x4aa49e);}};}function respondWithFilteredResult(_0x107658,_0x47d506){return function(_0x148453){if(_0x148453){var _0x267a4b=_0x148453[_0xfbec('0x21')],_0x259874=_0x47d506[_0xfbec('0x22')],_0x6fc8f=_0x47d506['offset']+_0x47d506['limit'],_0x42a6cf;if(_0x6fc8f>=_0x267a4b){_0x6fc8f=_0x267a4b;_0x42a6cf=0xc8;}else{_0x42a6cf=0xce;}_0x107658['status'](_0x42a6cf);return _0x107658[_0xfbec('0x23')](_0xfbec('0x24'),_0x259874+'-'+_0x6fc8f+'/'+_0x267a4b)[_0xfbec('0x20')](_0x148453);}return null;};}function patchUpdates(_0x5b94e3){return function(_0x315e9b){try{jsonpatch[_0xfbec('0x25')](_0x315e9b,_0x5b94e3,!![]);}catch(_0x5e8235){return BPromise[_0xfbec('0x26')](_0x5e8235);}return _0x315e9b[_0xfbec('0x27')]();};}function saveUpdates(_0x54a20f,_0xe1f8d6){return function(_0x4048b7){if(_0x4048b7){return _0x4048b7[_0xfbec('0x28')](_0x54a20f)[_0xfbec('0x29')](function(_0x25ff35){return _0x25ff35;});}return null;};}function removeEntity(_0x57b3ce,_0x2e172e){return function(_0x4bc10a){if(_0x4bc10a){return _0x4bc10a[_0xfbec('0x2a')]()[_0xfbec('0x29')](function(){_0x57b3ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8a3f,_0x10f5d3){return function(_0x421535){if(!_0x421535){_0x4d8a3f['sendStatus'](0x194);}return _0x421535;};}function handleError(_0x3210f3,_0xa56be8){_0xa56be8=_0xa56be8||0x1f4;return function(_0x1613de){logger['error'](_0x1613de[_0xfbec('0x2b')]);if(_0x1613de[_0xfbec('0x2c')]){delete _0x1613de[_0xfbec('0x2c')];}_0x3210f3[_0xfbec('0x1f')](_0xa56be8)[_0xfbec('0x2d')](_0x1613de);};}exports[_0xfbec('0x2e')]=function(_0x4aff99,_0x163987){var _0x12ba8d={},_0x57efc4={},_0x30d356={'count':0x0,'rows':[]};var _0x202e3b=db[_0xfbec('0x2f')][_0xfbec('0x30')];_0x57efc4['model']=_[_0xfbec('0x31')](_0x202e3b);_0x57efc4['query']=_['keys'](_0x4aff99['query']);_0x57efc4[_0xfbec('0x32')]=_[_0xfbec('0x33')](_0x57efc4['model'],_0x57efc4['query']);_0x12ba8d[_0xfbec('0x34')]=_[_0xfbec('0x33')](_0x57efc4[_0xfbec('0x35')],qs[_0xfbec('0x36')](_0x4aff99[_0xfbec('0x37')]['fields']));_0x12ba8d[_0xfbec('0x34')]=_0x12ba8d[_0xfbec('0x34')]['length']?_0x12ba8d[_0xfbec('0x34')]:_0x57efc4['model'];if(!_0x4aff99['query'][_0xfbec('0x38')](_0xfbec('0x39'))){_0x12ba8d[_0xfbec('0x3a')]=qs[_0xfbec('0x3a')](_0x4aff99['query'][_0xfbec('0x3a')]);_0x12ba8d[_0xfbec('0x22')]=qs[_0xfbec('0x22')](_0x4aff99['query']['offset']);}_0x12ba8d[_0xfbec('0x3b')]=qs['sort'](_0x4aff99[_0xfbec('0x37')][_0xfbec('0x3c')]);_0x12ba8d[_0xfbec('0x3d')]=qs[_0xfbec('0x32')](_[_0xfbec('0x3e')](_0x4aff99[_0xfbec('0x37')],_0x57efc4['filters']));if(_0x4aff99['query'][_0xfbec('0x3f')]){_0x12ba8d[_0xfbec('0x3d')]=_[_0xfbec('0x40')](_0x12ba8d[_0xfbec('0x3d')],{'$or':_['map'](_0x202e3b,function(_0x9cd7e8){if(_0x9cd7e8['type']['key']!==_0xfbec('0x41')){var _0x39bc67={};_0x39bc67[_0x9cd7e8[_0xfbec('0x42')]]={'$like':'%'+_0x4aff99[_0xfbec('0x37')][_0xfbec('0x3f')]+'%'};return _0x39bc67;}})});}_0x12ba8d=_[_0xfbec('0x40')]({},_0x12ba8d,_0x4aff99[_0xfbec('0x43')]);var _0xcd753c={'where':_0x12ba8d[_0xfbec('0x3d')]};return db[_0xfbec('0x2f')]['count'](_0xcd753c)['then'](function(_0x3b2b41){_0x30d356[_0xfbec('0x21')]=_0x3b2b41;if(_0x4aff99[_0xfbec('0x37')][_0xfbec('0x44')]){_0x12ba8d['include']=[{'all':!![]}];}return db[_0xfbec('0x2f')][_0xfbec('0x45')](_0x12ba8d);})[_0xfbec('0x29')](function(_0x4653dd){_0x30d356[_0xfbec('0x46')]=_0x4653dd;return _0x30d356;})[_0xfbec('0x29')](respondWithFilteredResult(_0x163987,_0x12ba8d))[_0xfbec('0x47')](handleError(_0x163987,null));};exports['show']=function(_0x29e368,_0x40bb85){var _0x4e3f57={'raw':!![],'where':{'id':_0x29e368[_0xfbec('0x48')]['id']}},_0x1670ab={};_0x1670ab[_0xfbec('0x35')]=_[_0xfbec('0x31')](db[_0xfbec('0x2f')][_0xfbec('0x30')]);_0x1670ab[_0xfbec('0x37')]=_['keys'](_0x29e368[_0xfbec('0x37')]);_0x1670ab[_0xfbec('0x32')]=_['intersection'](_0x1670ab[_0xfbec('0x35')],_0x1670ab['query']);_0x4e3f57[_0xfbec('0x34')]=_['intersection'](_0x1670ab[_0xfbec('0x35')],qs[_0xfbec('0x36')](_0x29e368[_0xfbec('0x37')][_0xfbec('0x36')]));_0x4e3f57[_0xfbec('0x34')]=_0x4e3f57[_0xfbec('0x34')][_0xfbec('0x49')]?_0x4e3f57['attributes']:_0x1670ab[_0xfbec('0x35')];if(_0x29e368[_0xfbec('0x37')][_0xfbec('0x44')]){_0x4e3f57[_0xfbec('0x4a')]=[{'all':!![]}];}_0x4e3f57=_['merge']({},_0x4e3f57,_0x29e368[_0xfbec('0x43')]);return db[_0xfbec('0x2f')][_0xfbec('0x4b')](_0x4e3f57)[_0xfbec('0x29')](handleEntityNotFound(_0x40bb85,null))[_0xfbec('0x29')](respondWithResult(_0x40bb85,null))[_0xfbec('0x47')](handleError(_0x40bb85,null));};exports[_0xfbec('0x4c')]=function(_0x4f1834,_0x12b1aa){return db[_0xfbec('0x2f')]['create'](_0x4f1834[_0xfbec('0x4d')],{})[_0xfbec('0x29')](respondWithResult(_0x12b1aa,0xc9))[_0xfbec('0x47')](handleError(_0x12b1aa,null));};exports[_0xfbec('0x28')]=function(_0xf69494,_0x500964){if(_0xf69494[_0xfbec('0x4d')]['id']){delete _0xf69494[_0xfbec('0x4d')]['id'];}return db[_0xfbec('0x2f')][_0xfbec('0x4b')]({'where':{'id':_0xf69494[_0xfbec('0x48')]['id']}})['then'](handleEntityNotFound(_0x500964,null))[_0xfbec('0x29')](saveUpdates(_0xf69494[_0xfbec('0x4d')],null))[_0xfbec('0x29')](respondWithResult(_0x500964,null))[_0xfbec('0x47')](handleError(_0x500964,null));};exports[_0xfbec('0x2a')]=function(_0x4e79ff,_0x238394){return db[_0xfbec('0x2f')][_0xfbec('0x4b')]({'where':{'id':_0x4e79ff[_0xfbec('0x48')]['id']}})[_0xfbec('0x29')](handleEntityNotFound(_0x238394,null))['then'](removeEntity(_0x238394,null))[_0xfbec('0x47')](handleError(_0x238394,null));};exports[_0xfbec('0x4e')]=function(_0x264057,_0x2c5a9a){return db[_0xfbec('0x2f')][_0xfbec('0x4e')]()[_0xfbec('0x29')](respondWithResult(_0x2c5a9a,null))[_0xfbec('0x47')](handleError(_0x2c5a9a,null));};function wrapUser(_0x120b1a){return function(_0x3c3452){var _0x980f20=_0x120b1a[_0xfbec('0x4f')]({'plain':!![]});_0x980f20[_0xfbec('0x50')]=[];if(_0x3c3452){_0x980f20['lastMessageAt']=_0x3c3452[_0xfbec('0x51')];_0x980f20[_0xfbec('0x52')]=_0x3c3452;}else{_0x980f20[_0xfbec('0x53')]=moment(0x0)[_0xfbec('0x54')](_0xfbec('0x55'));_0x980f20[_0xfbec('0x52')]={};}return _0x980f20;};}exports[_0xfbec('0x56')]=function(_0x4a6c0d,_0x4e7a08,_0x43e44f){var _0x454c86=[];return db[_0xfbec('0x57')][_0xfbec('0x45')]({'where':{'role':[_0xfbec('0x58'),_0xfbec('0x59'),'user']},'attributes':['id',_0xfbec('0x5a'),_0xfbec('0x2c'),_0xfbec('0x5b'),_0xfbec('0x5c'),_0xfbec('0x5d'),_0xfbec('0x5e'),_0xfbec('0x5f'),'allowmessenger',_0xfbec('0x60')],'order':qs[_0xfbec('0x3c')]('-online'),'include':[{'model':db[_0xfbec('0x61')],'as':_0xfbec('0x62'),'attributes':['id',_0xfbec('0x2c'),_0xfbec('0x63')],'through':{'attributes':[]}}]})[_0xfbec('0x29')](function(_0x4fbf88){if(_0x4fbf88){var _0x2b8d99=_0x4a6c0d[_0xfbec('0x64')][_0xfbec('0x4f')]({'plain':!![]});if(!_0x2b8d99)throw new Error(_0xfbec('0x65'));if(_0x2b8d99[_0xfbec('0x5b')]===_0xfbec('0x64')){return db['UserProfileSection']['find']({'where':{'name':_0xfbec('0x66'),'userProfileId':_0x2b8d99[_0xfbec('0x67')]},'raw':!![]})[_0xfbec('0x29')](function(_0x10e477){if(_0x10e477){if(_0x10e477[_0xfbec('0x68')]===0x0){return db[_0xfbec('0x69')][_0xfbec('0x45')]({'where':{'sectionId':_0x10e477['id']},'raw':!![]})[_0xfbec('0x29')](function(_0x583ba0){var _0x38ead0=[];if(_[_0xfbec('0x6a')](_0x583ba0)){_0x38ead0=_[_0xfbec('0x3f')](_0x4fbf88,function(_0x3aca57){if(_0x3aca57[_0xfbec('0x5b')]!==_0xfbec('0x58')){return _0x3aca57;}});return _0x38ead0;}else{for(var _0x4792e6=0x0;_0x4792e6<_0x4fbf88[_0xfbec('0x49')];_0x4792e6++){var _0x544d54=_0x4fbf88[_0x4792e6];if(_0x544d54[_0xfbec('0x5b')]==='agent'){var _0x139660=_[_0xfbec('0x4b')](_0x583ba0,function(_0x5585a3){return _0x5585a3[_0xfbec('0x6b')]===_0x544d54['id'];});if(_0x139660)_0x38ead0[_0xfbec('0x6c')](_0x544d54);}else{_0x38ead0['push'](_0x544d54);}}return _0x38ead0;}});}else{return _0x4fbf88;}}else{var _0x32d6c7=_['filter'](_0x4fbf88,function(_0x4a9b43){if(_0x4a9b43[_0xfbec('0x5b')]!==_0xfbec('0x58')){return _0x4a9b43;}});return _0x32d6c7;}});}else{return _0x4fbf88;}}})[_0xfbec('0x29')](function(_0x4db6d8){var _0x41ecb7=[];if(_0x4db6d8){_0x454c86=_0x4db6d8;for(var _0x462a78=0x0;_0x462a78<_0x4db6d8[_0xfbec('0x49')];_0x462a78+=0x1){_0x454c86[_0x462a78][_0xfbec('0x50')]=[];_0x41ecb7[_0xfbec('0x6c')](db[_0xfbec('0x2f')]['find']({'where':{'FromId':[_0x4a6c0d[_0xfbec('0x64')]['id'],_0x4db6d8[_0x462a78]['id']],'ToId':[_0x4a6c0d[_0xfbec('0x64')]['id'],_0x4db6d8[_0x462a78]['id']],'ChatGroupId':null},'attributes':['id',_0xfbec('0x51'),_0xfbec('0x6d'),'ToId',_0xfbec('0x6e'),_0xfbec('0x4d')],'order':qs[_0xfbec('0x3c')](_0xfbec('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfbec('0x29')](wrapUser(_0x4db6d8[_0x462a78])));}return BPromise[_0xfbec('0x70')](_0x41ecb7);}return[];})['then'](function(_0x2654e1){return{'rows':_0x2654e1,'count':_0x2654e1[_0xfbec('0x49')]};})[_0xfbec('0x29')](respondWithResult(_0x4e7a08,null))[_0xfbec('0x47')](handleError(_0x4e7a08,null));};
\ No newline at end of file
+var _0x23db=['Agents','userProfileId','autoAssociation','UserProfileResource','role','push','ToId','read','-createdAt','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','set','Content-Range','update','then','destroy','end','error','name','send','index','ChatInternalMessage','rawAttributes','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','catch','show','params','find','create','body','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','findAll','agent','admin','user','fullname','online','lastLoginAt','allowmessenger','-online','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x2d9296,_0x437f70){var _0x85dbac=function(_0x4f6cf5){while(--_0x4f6cf5){_0x2d9296['push'](_0x2d9296['shift']());}};_0x85dbac(++_0x437f70);}(_0x23db,0x141));var _0xb23d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x23db[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xb23d('0x0'));var emlformat=require(_0xb23d('0x1'));var rimraf=require(_0xb23d('0x2'));var zipdir=require(_0xb23d('0x3'));var jsonpatch=require(_0xb23d('0x4'));var rp=require(_0xb23d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb23d('0x6'));var util=require(_0xb23d('0x7'));var path=require('path');var sox=require(_0xb23d('0x8'));var csv=require(_0xb23d('0x9'));var ejs=require(_0xb23d('0xa'));var fs=require('fs');var _=require(_0xb23d('0xb'));var squel=require(_0xb23d('0xc'));var crypto=require(_0xb23d('0xd'));var jsforce=require(_0xb23d('0xe'));var deskjs=require(_0xb23d('0xf'));var toCsv=require(_0xb23d('0x9'));var querystring=require('querystring');var Papa=require(_0xb23d('0x10'));var Redis=require(_0xb23d('0x11'));var authService=require(_0xb23d('0x12'));var qs=require(_0xb23d('0x13'));var as=require(_0xb23d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb23d('0x15'));var config=require('../../config/environment');var db=require(_0xb23d('0x16'))['db'];config[_0xb23d('0x17')]=_[_0xb23d('0x18')](config[_0xb23d('0x17')],{'host':_0xb23d('0x19'),'port':0x18eb});var socket=require(_0xb23d('0x1a'))(new Redis(config[_0xb23d('0x17')]));require('./chatInternalMessage.socket')[_0xb23d('0x1b')](socket);function respondWithStatusCode(_0x2da615,_0x2fa37a){_0x2fa37a=_0x2fa37a||0xcc;return function(_0x199560){if(_0x199560){return _0x2da615[_0xb23d('0x1c')](_0x2fa37a);}return _0x2da615[_0xb23d('0x1d')](_0x2fa37a)['end']();};}function respondWithResult(_0x5a8364,_0x2fba80){_0x2fba80=_0x2fba80||0xc8;return function(_0x45f0d1){if(_0x45f0d1){return _0x5a8364[_0xb23d('0x1d')](_0x2fba80)[_0xb23d('0x1e')](_0x45f0d1);}};}function respondWithFilteredResult(_0x3c606f,_0x21f5a){return function(_0x5a09c3){if(_0x5a09c3){var _0x37bfe2=_0x5a09c3['count'],_0x3f2c6b=_0x21f5a[_0xb23d('0x1f')],_0x2b47e0=_0x21f5a['offset']+_0x21f5a[_0xb23d('0x20')],_0x2673d3;if(_0x2b47e0>=_0x37bfe2){_0x2b47e0=_0x37bfe2;_0x2673d3=0xc8;}else{_0x2673d3=0xce;}_0x3c606f[_0xb23d('0x1d')](_0x2673d3);return _0x3c606f[_0xb23d('0x21')](_0xb23d('0x22'),_0x3f2c6b+'-'+_0x2b47e0+'/'+_0x37bfe2)[_0xb23d('0x1e')](_0x5a09c3);}return null;};}function patchUpdates(_0x45d7b5){return function(_0x331838){try{jsonpatch['apply'](_0x331838,_0x45d7b5,!![]);}catch(_0x1a395c){return BPromise['reject'](_0x1a395c);}return _0x331838['save']();};}function saveUpdates(_0x20329a,_0x29cacf){return function(_0x8382ab){if(_0x8382ab){return _0x8382ab[_0xb23d('0x23')](_0x20329a)[_0xb23d('0x24')](function(_0x117f4c){return _0x117f4c;});}return null;};}function removeEntity(_0x921fc,_0x219d34){return function(_0x3f0142){if(_0x3f0142){return _0x3f0142[_0xb23d('0x25')]()[_0xb23d('0x24')](function(){_0x921fc['status'](0xcc)[_0xb23d('0x26')]();});}};}function handleEntityNotFound(_0x145ae9,_0x243416){return function(_0x4e1538){if(!_0x4e1538){_0x145ae9['sendStatus'](0x194);}return _0x4e1538;};}function handleError(_0x21a571,_0x2e758e){_0x2e758e=_0x2e758e||0x1f4;return function(_0xba0e97){logger[_0xb23d('0x27')](_0xba0e97['stack']);if(_0xba0e97[_0xb23d('0x28')]){delete _0xba0e97[_0xb23d('0x28')];}_0x21a571[_0xb23d('0x1d')](_0x2e758e)[_0xb23d('0x29')](_0xba0e97);};}exports[_0xb23d('0x2a')]=function(_0x67eaf3,_0x26990e){var _0x867d69={},_0x2f039f={},_0x349ba6={'count':0x0,'rows':[]};var _0x2931a2=db[_0xb23d('0x2b')][_0xb23d('0x2c')];_0x2f039f['model']=_['keys'](_0x2931a2);_0x2f039f['query']=_[_0xb23d('0x2d')](_0x67eaf3['query']);_0x2f039f['filters']=_[_0xb23d('0x2e')](_0x2f039f['model'],_0x2f039f[_0xb23d('0x2f')]);_0x867d69[_0xb23d('0x30')]=_[_0xb23d('0x2e')](_0x2f039f[_0xb23d('0x31')],qs[_0xb23d('0x32')](_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x32')]));_0x867d69[_0xb23d('0x30')]=_0x867d69[_0xb23d('0x30')][_0xb23d('0x33')]?_0x867d69[_0xb23d('0x30')]:_0x2f039f[_0xb23d('0x31')];if(!_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x34')](_0xb23d('0x35'))){_0x867d69[_0xb23d('0x20')]=qs['limit'](_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x20')]);_0x867d69[_0xb23d('0x1f')]=qs[_0xb23d('0x1f')](_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x1f')]);}_0x867d69[_0xb23d('0x36')]=qs[_0xb23d('0x37')](_0x67eaf3['query'][_0xb23d('0x37')]);_0x867d69[_0xb23d('0x38')]=qs[_0xb23d('0x39')](_[_0xb23d('0x3a')](_0x67eaf3[_0xb23d('0x2f')],_0x2f039f[_0xb23d('0x39')]));if(_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x3b')]){_0x867d69[_0xb23d('0x38')]=_[_0xb23d('0x3c')](_0x867d69[_0xb23d('0x38')],{'$or':_[_0xb23d('0x3d')](_0x2931a2,function(_0x4f84fb){if(_0x4f84fb[_0xb23d('0x3e')][_0xb23d('0x3f')]!==_0xb23d('0x40')){var _0x4dae03={};_0x4dae03[_0x4f84fb[_0xb23d('0x41')]]={'$like':'%'+_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x3b')]+'%'};return _0x4dae03;}})});}_0x867d69=_[_0xb23d('0x3c')]({},_0x867d69,_0x67eaf3[_0xb23d('0x42')]);var _0x3812c3={'where':_0x867d69[_0xb23d('0x38')]};return db[_0xb23d('0x2b')][_0xb23d('0x43')](_0x3812c3)['then'](function(_0x2c741e){_0x349ba6[_0xb23d('0x43')]=_0x2c741e;if(_0x67eaf3[_0xb23d('0x2f')][_0xb23d('0x44')]){_0x867d69['include']=[{'all':!![]}];}return db[_0xb23d('0x2b')]['findAll'](_0x867d69);})['then'](function(_0x7c9f47){_0x349ba6['rows']=_0x7c9f47;return _0x349ba6;})[_0xb23d('0x24')](respondWithFilteredResult(_0x26990e,_0x867d69))[_0xb23d('0x45')](handleError(_0x26990e,null));};exports[_0xb23d('0x46')]=function(_0x2ba970,_0x510947){var _0x12d7e8={'raw':!![],'where':{'id':_0x2ba970[_0xb23d('0x47')]['id']}},_0x4f747e={};_0x4f747e['model']=_[_0xb23d('0x2d')](db['ChatInternalMessage']['rawAttributes']);_0x4f747e['query']=_['keys'](_0x2ba970[_0xb23d('0x2f')]);_0x4f747e[_0xb23d('0x39')]=_['intersection'](_0x4f747e[_0xb23d('0x31')],_0x4f747e[_0xb23d('0x2f')]);_0x12d7e8[_0xb23d('0x30')]=_[_0xb23d('0x2e')](_0x4f747e['model'],qs['fields'](_0x2ba970[_0xb23d('0x2f')][_0xb23d('0x32')]));_0x12d7e8[_0xb23d('0x30')]=_0x12d7e8[_0xb23d('0x30')]['length']?_0x12d7e8[_0xb23d('0x30')]:_0x4f747e[_0xb23d('0x31')];if(_0x2ba970[_0xb23d('0x2f')][_0xb23d('0x44')]){_0x12d7e8['include']=[{'all':!![]}];}_0x12d7e8=_[_0xb23d('0x3c')]({},_0x12d7e8,_0x2ba970['options']);return db[_0xb23d('0x2b')][_0xb23d('0x48')](_0x12d7e8)[_0xb23d('0x24')](handleEntityNotFound(_0x510947,null))['then'](respondWithResult(_0x510947,null))[_0xb23d('0x45')](handleError(_0x510947,null));};exports['create']=function(_0x45303e,_0x5ec48e){return db[_0xb23d('0x2b')][_0xb23d('0x49')](_0x45303e[_0xb23d('0x4a')],{})[_0xb23d('0x24')](respondWithResult(_0x5ec48e,0xc9))[_0xb23d('0x45')](handleError(_0x5ec48e,null));};exports[_0xb23d('0x23')]=function(_0xca0470,_0x30c499){if(_0xca0470[_0xb23d('0x4a')]['id']){delete _0xca0470['body']['id'];}return db[_0xb23d('0x2b')][_0xb23d('0x48')]({'where':{'id':_0xca0470['params']['id']}})[_0xb23d('0x24')](handleEntityNotFound(_0x30c499,null))['then'](saveUpdates(_0xca0470[_0xb23d('0x4a')],null))[_0xb23d('0x24')](respondWithResult(_0x30c499,null))[_0xb23d('0x45')](handleError(_0x30c499,null));};exports['destroy']=function(_0xc78b28,_0x232f78){return db['ChatInternalMessage'][_0xb23d('0x48')]({'where':{'id':_0xc78b28[_0xb23d('0x47')]['id']}})[_0xb23d('0x24')](handleEntityNotFound(_0x232f78,null))[_0xb23d('0x24')](removeEntity(_0x232f78,null))[_0xb23d('0x45')](handleError(_0x232f78,null));};exports[_0xb23d('0x4b')]=function(_0x12ef37,_0x37e257){return db['ChatInternalMessage']['describe']()[_0xb23d('0x24')](respondWithResult(_0x37e257,null))['catch'](handleError(_0x37e257,null));};function wrapUser(_0x1edb03){return function(_0x40715f){var _0x39a713=_0x1edb03['get']({'plain':!![]});_0x39a713[_0xb23d('0x4c')]=[];if(_0x40715f){_0x39a713[_0xb23d('0x4d')]=_0x40715f[_0xb23d('0x4e')];_0x39a713['lastMessage']=_0x40715f;}else{_0x39a713[_0xb23d('0x4d')]=moment(0x0)['format'](_0xb23d('0x4f'));_0x39a713[_0xb23d('0x50')]={};}return _0x39a713;};}exports[_0xb23d('0x51')]=function(_0x2fc4d5,_0x3666f9,_0x5ea562){var _0xc59a8c=[];return db['User'][_0xb23d('0x52')]({'where':{'role':[_0xb23d('0x53'),_0xb23d('0x54'),_0xb23d('0x55')]},'attributes':['id',_0xb23d('0x56'),_0xb23d('0x28'),'role','userpic','internal',_0xb23d('0x57'),_0xb23d('0x58'),_0xb23d('0x59'),'showWebBar'],'order':qs[_0xb23d('0x37')](_0xb23d('0x5a')),'include':[{'model':db[_0xb23d('0x5b')],'as':'VoiceQueues','attributes':['id',_0xb23d('0x28'),_0xb23d('0x3e')],'through':{'attributes':[]}}]})[_0xb23d('0x24')](function(_0xefd2ee){if(_0xefd2ee){var _0x35b9fc=_0x2fc4d5['user'][_0xb23d('0x5c')]({'plain':!![]});if(!_0x35b9fc)throw new Error(_0xb23d('0x5d'));if(_0x35b9fc['role']===_0xb23d('0x55')){return db[_0xb23d('0x5e')]['find']({'where':{'name':_0xb23d('0x5f'),'userProfileId':_0x35b9fc[_0xb23d('0x60')]},'raw':!![]})[_0xb23d('0x24')](function(_0x337986){if(_0x337986){if(_0x337986[_0xb23d('0x61')]===0x0){return db[_0xb23d('0x62')][_0xb23d('0x52')]({'where':{'sectionId':_0x337986['id']},'raw':!![]})['then'](function(_0x18d80d){var _0x529150=[];if(_['isEmpty'](_0x18d80d)){_0x529150=_[_0xb23d('0x3b')](_0xefd2ee,function(_0x2fcecb){if(_0x2fcecb[_0xb23d('0x63')]!==_0xb23d('0x53')){return _0x2fcecb;}});return _0x529150;}else{for(var _0x12c60b=0x0;_0x12c60b<_0xefd2ee[_0xb23d('0x33')];_0x12c60b++){var _0x4fdcde=_0xefd2ee[_0x12c60b];if(_0x4fdcde[_0xb23d('0x63')]===_0xb23d('0x53')){var _0x3ff8a7=_[_0xb23d('0x48')](_0x18d80d,function(_0x93b08a){return _0x93b08a['resourceId']===_0x4fdcde['id'];});if(_0x3ff8a7)_0x529150[_0xb23d('0x64')](_0x4fdcde);}else{_0x529150['push'](_0x4fdcde);}}return _0x529150;}});}else{return _0xefd2ee;}}else{var _0x3462f9=_[_0xb23d('0x3b')](_0xefd2ee,function(_0xcbac6e){if(_0xcbac6e['role']!==_0xb23d('0x53')){return _0xcbac6e;}});return _0x3462f9;}});}else{return _0xefd2ee;}}})[_0xb23d('0x24')](function(_0x5d44c5){var _0x20bbc1=[];if(_0x5d44c5){_0xc59a8c=_0x5d44c5;for(var _0x186bfc=0x0;_0x186bfc<_0x5d44c5[_0xb23d('0x33')];_0x186bfc+=0x1){_0xc59a8c[_0x186bfc]['messages']=[];_0x20bbc1[_0xb23d('0x64')](db['ChatInternalMessage'][_0xb23d('0x48')]({'where':{'FromId':[_0x2fc4d5[_0xb23d('0x55')]['id'],_0x5d44c5[_0x186bfc]['id']],'ToId':[_0x2fc4d5[_0xb23d('0x55')]['id'],_0x5d44c5[_0x186bfc]['id']],'ChatGroupId':null},'attributes':['id',_0xb23d('0x4e'),'FromId',_0xb23d('0x65'),_0xb23d('0x66'),_0xb23d('0x4a')],'order':qs[_0xb23d('0x37')](_0xb23d('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb23d('0x24')](wrapUser(_0x5d44c5[_0x186bfc])));}return BPromise['all'](_0x20bbc1);}return[];})[_0xb23d('0x24')](function(_0x2e16d2){return{'rows':_0x2e16d2,'count':_0x2e16d2[_0xb23d('0x33')]};})['then'](respondWithResult(_0x3666f9,null))[_0xb23d('0x45')](handleError(_0x3666f9,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index a202d68..0a39425 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 _0x6e90=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5a86fc,_0x2e0cab){var _0x1c121f=function(_0x36cc62){while(--_0x36cc62){_0x5a86fc['push'](_0x5a86fc['shift']());}};_0x1c121f(++_0x2e0cab);}(_0x6e90,0x9f));var _0x06e9=function(_0x51f032,_0x1ececc){_0x51f032=_0x51f032-0x0;var _0x397471=_0x6e90[_0x51f032];return _0x397471;};'use strict';var EventEmitter=require(_0x06e9('0x0'));var ChatInternalMessage=require(_0x06e9('0x1'))['db'][_0x06e9('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x06e9('0x3')](0x0);var events={'afterCreate':_0x06e9('0x4'),'afterUpdate':_0x06e9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x29d2c6){return function(_0x480212,_0x1773a8,_0x481049){ChatInternalMessageEvents[_0x06e9('0x6')](_0x29d2c6+':'+_0x480212['id'],_0x480212);ChatInternalMessageEvents[_0x06e9('0x6')](_0x29d2c6,_0x480212);_0x481049(null);};}for(var e in events){if(events[_0x06e9('0x7')](e)){var event=events[e];ChatInternalMessage[_0x06e9('0x8')](e,emitEvent(event));}}module[_0x06e9('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x88b5=['../../mysqldb','ChatInternalMessage','save','update','remove','emit','exports','events'];(function(_0x1e50a4,_0x5bdfc2){var _0x1e13c5=function(_0x32024b){while(--_0x32024b){_0x1e50a4['push'](_0x1e50a4['shift']());}};_0x1e13c5(++_0x5bdfc2);}(_0x88b5,0x10f));var _0x588b=function(_0x320717,_0x5d670f){_0x320717=_0x320717-0x0;var _0x2c099b=_0x88b5[_0x320717];return _0x2c099b;};'use strict';var EventEmitter=require(_0x588b('0x0'));var ChatInternalMessage=require(_0x588b('0x1'))['db'][_0x588b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x588b('0x3'),'afterUpdate':_0x588b('0x4'),'afterDestroy':_0x588b('0x5')};function emitEvent(_0x289f63){return function(_0x119d23,_0x2e59db,_0x502add){ChatInternalMessageEvents[_0x588b('0x6')](_0x289f63+':'+_0x119d23['id'],_0x119d23);ChatInternalMessageEvents[_0x588b('0x6')](_0x289f63,_0x119d23);_0x502add(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x588b('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index b9f0388..f76fd37 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 _0xd8b0=['define','chat_internal_messages','utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x23fd26,_0x4c42c7){var _0x4c6d08=function(_0x1cb6e2){while(--_0x1cb6e2){_0x23fd26['push'](_0x23fd26['shift']());}};_0x4c6d08(++_0x4c42c7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d8b('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0713=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3071('0xc'),'collate':_0x3071('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index c4fd741..cb673a0 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 _0x3bbf=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x44fde1,_0x3f34f5){var _0x4d2227=function(_0x54d8f2){while(--_0x54d8f2){_0x44fde1['push'](_0x44fde1['shift']());}};_0x4d2227(++_0x3f34f5);}(_0x3bbf,0x1e1));var _0xf3bb=function(_0x743400,_0x5879a2){_0x743400=_0x743400-0x0;var _0x2be62e=_0x3bbf[_0x743400];return _0x2be62e;};'use strict';var _=require(_0xf3bb('0x0'));var util=require(_0xf3bb('0x1'));var moment=require(_0xf3bb('0x2'));var BPromise=require(_0xf3bb('0x3'));var rs=require(_0xf3bb('0x4'));var fs=require('fs');var Redis=require(_0xf3bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3bb('0x6'));var logger=require(_0xf3bb('0x7'))(_0xf3bb('0x8'));var config=require('../../config/environment');var jayson=require(_0xf3bb('0x9'));var client=jayson['client'][_0xf3bb('0xa')]({'port':0x232a});config[_0xf3bb('0xb')]=_['defaults'](config['redis'],{'host':_0xf3bb('0xc'),'port':0x18eb});var socket=require(_0xf3bb('0xd'))(new Redis(config[_0xf3bb('0xb')]));require(_0xf3bb('0xe'))[_0xf3bb('0xf')](socket);function respondWithRpcPromise(_0x52431c,_0x548505,_0x27fd3f){return new BPromise(function(_0x26be40,_0x267f46){return client['request'](_0x52431c,_0x27fd3f)[_0xf3bb('0x10')](function(_0x25a22b){logger['info'](_0xf3bb('0x11'),_0x548505,_0xf3bb('0x12'));logger['debug'](_0xf3bb('0x13'),_0x548505,'request\x20sent',JSON['stringify'](_0x25a22b));if(_0x25a22b[_0xf3bb('0x14')]){if(_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x15')]===0x1f4){logger[_0xf3bb('0x14')](_0xf3bb('0x11'),_0x548505,_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x16')]);return _0x267f46(_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x16')]);}logger[_0xf3bb('0x14')](_0xf3bb('0x11'),_0x548505,_0x25a22b[_0xf3bb('0x14')]['message']);return _0x26be40(_0x25a22b[_0xf3bb('0x14')][_0xf3bb('0x16')]);}else{logger['info'](_0xf3bb('0x11'),_0x548505,'request\x20sent');_0x26be40(_0x25a22b[_0xf3bb('0x17')][_0xf3bb('0x16')]);}})[_0xf3bb('0x18')](function(_0x2ed320){logger[_0xf3bb('0x14')](_0xf3bb('0x11'),_0x548505,_0x2ed320);_0x267f46(_0x2ed320);});});}
\ No newline at end of file
+var _0xd628=['../../config/logger','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e1a48,_0x3d5077){var _0x1aed69=function(_0xfb19eb){while(--_0xfb19eb){_0x4e1a48['push'](_0x4e1a48['shift']());}};_0x1aed69(++_0x3d5077);}(_0xd628,0x102));var _0x8d62=function(_0x409a63,_0x15e787){_0x409a63=_0x409a63-0x0;var _0x3056a0=_0xd628[_0x409a63];return _0x3056a0;};'use strict';var _=require('lodash');var util=require(_0x8d62('0x0'));var moment=require(_0x8d62('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d62('0x2'));var fs=require('fs');var Redis=require(_0x8d62('0x3'));var db=require(_0x8d62('0x4'))['db'];var utils=require(_0x8d62('0x5'));var logger=require(_0x8d62('0x6'))('rpc');var config=require(_0x8d62('0x7'));var jayson=require(_0x8d62('0x8'));var client=jayson[_0x8d62('0x9')]['http']({'port':0x232a});config[_0x8d62('0xa')]=_['defaults'](config[_0x8d62('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d62('0xb'))(new Redis(config['redis']));require(_0x8d62('0xc'))['register'](socket);function respondWithRpcPromise(_0x31cf3c,_0x170e06,_0x25b445){return new BPromise(function(_0x44f164,_0x1f9be5){return client[_0x8d62('0xd')](_0x31cf3c,_0x25b445)['then'](function(_0x391ff1){logger[_0x8d62('0xe')](_0x8d62('0xf'),_0x170e06,'request\x20sent');logger[_0x8d62('0x10')](_0x8d62('0x11'),_0x170e06,_0x8d62('0x12'),JSON[_0x8d62('0x13')](_0x391ff1));if(_0x391ff1[_0x8d62('0x14')]){if(_0x391ff1['error']['code']===0x1f4){logger['error'](_0x8d62('0xf'),_0x170e06,_0x391ff1[_0x8d62('0x14')][_0x8d62('0x15')]);return _0x1f9be5(_0x391ff1['error']['message']);}logger[_0x8d62('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x170e06,_0x391ff1['error']['message']);return _0x44f164(_0x391ff1[_0x8d62('0x14')][_0x8d62('0x15')]);}else{logger[_0x8d62('0xe')](_0x8d62('0xf'),_0x170e06,_0x8d62('0x12'));_0x44f164(_0x391ff1[_0x8d62('0x16')][_0x8d62('0x15')]);}})[_0x8d62('0x17')](function(_0x318aea){logger['error'](_0x8d62('0xf'),_0x170e06,_0x318aea);_0x1f9be5(_0x318aea);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index f572380..8e874cb 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 _0x562d=['./chatInternalMessage.events','save','remove','emit','length'];(function(_0x51594d,_0x110073){var _0x107268=function(_0x4c7a35){while(--_0x4c7a35){_0x51594d['push'](_0x51594d['shift']());}};_0x107268(++_0x110073);}(_0x562d,0xe1));var _0xd562=function(_0x59e893,_0x3adcb9){_0x59e893=_0x59e893-0x0;var _0x56046e=_0x562d[_0x59e893];return _0x56046e;};'use strict';var ChatInternalMessageEvents=require(_0xd562('0x0'));var events=[_0xd562('0x1'),_0xd562('0x2'),'update'];function createListener(_0x517c30,_0x3ea08c){return function(_0x29f939){_0x3ea08c[_0xd562('0x3')](_0x517c30,_0x29f939);};}function removeListener(_0x4c6430,_0xf71ee1){return function(){ChatInternalMessageEvents['removeListener'](_0x4c6430,_0xf71ee1);};}exports['register']=function(_0x1d05e9){for(var _0x46bf9b=0x0,_0x3e6465=events[_0xd562('0x4')];_0x46bf9b<_0x3e6465;_0x46bf9b++){var _0x21f82a=events[_0x46bf9b];var _0x38e1a7=createListener('chatInternalMessage:'+_0x21f82a,_0x1d05e9);ChatInternalMessageEvents['on'](_0x21f82a,_0x38e1a7);}};
\ No newline at end of file
+var _0xc9b7=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener'];(function(_0x509eca,_0x53b8ad){var _0x511c25=function(_0x1e3f70){while(--_0x1e3f70){_0x509eca['push'](_0x509eca['shift']());}};_0x511c25(++_0x53b8ad);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0xc9b7[_0x214266];return _0x568f75;};'use strict';var ChatInternalMessageEvents=require(_0x7c9b('0x0'));var events=[_0x7c9b('0x1'),_0x7c9b('0x2'),_0x7c9b('0x3')];function createListener(_0x49bfb8,_0x46f817){return function(_0x1ed731){_0x46f817['emit'](_0x49bfb8,_0x1ed731);};}function removeListener(_0x474486,_0x365dd6){return function(){ChatInternalMessageEvents[_0x7c9b('0x4')](_0x474486,_0x365dd6);};}exports[_0x7c9b('0x5')]=function(_0x3d19d7){for(var _0x4714e0=0x0,_0x351532=events[_0x7c9b('0x6')];_0x4714e0<_0x351532;_0x4714e0++){var _0x456555=events[_0x4714e0];var _0x440561=createListener(_0x7c9b('0x7')+_0x456555,_0x3d19d7);ChatInternalMessageEvents['on'](_0x456555,_0x440561);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 82fe3d5..5932c4f 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 _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x34032c,_0x34f33b){var _0x4146e1=function(_0x62cf40){while(--_0x62cf40){_0x34032c['push'](_0x34032c['shift']());}};_0x4146e1(++_0x34f33b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
+var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x3633f1,_0x5c7c23){var _0x3bbf02=function(_0x2d7c92){while(--_0x2d7c92){_0x3633f1['push'](_0x3633f1['shift']());}};_0x3bbf02(++_0x5c7c23);}(_0xb7e7,0x121));var _0x7b7e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb7e7[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('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 916f2c3..a6d4dfc 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 _0xfff0=['BOOLEAN','out','DATE','sequelize','TEXT','medium'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xfff0,0x159));var _0x0fff=function(_0x2905d2,_0x2337cb){_0x2905d2=_0x2905d2-0x0;var _0x8aa718=_0xfff0[_0x2905d2];return _0x8aa718;};'use strict';var Sequelize=require(_0x0fff('0x0'));module['exports']={'body':{'type':Sequelize[_0x0fff('0x1')](_0x0fff('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0fff('0x4')),'defaultValue':_0x0fff('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0fff('0x5')]}};
\ No newline at end of file
+var _0x8854=['out','DATE','exports','TEXT','BOOLEAN','ENUM'];(function(_0x16ce9e,_0x13abb9){var _0x2c29f5=function(_0x5050c8){while(--_0x5050c8){_0x16ce9e['push'](_0x16ce9e['shift']());}};_0x2c29f5(++_0x13abb9);}(_0x8854,0x1e2));var _0x4885=function(_0x562601,_0x3e379d){_0x562601=_0x562601-0x0;var _0xbbe2a3=_0x8854[_0x562601];return _0xbbe2a3;};'use strict';var Sequelize=require('sequelize');module[_0x4885('0x0')]={'body':{'type':Sequelize[_0x4885('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4885('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4885('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4885('0x3')]('in','out'),'defaultValue':_0x4885('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4885('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 4c65332..36020a7 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 _0x3d2c=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','stack','name','index','ChatMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','count','includeAll','include','findAll','rows','params','create','body','describe','chat-interactions','accept','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','ChatInteractionId','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','parse','formData','reject','agent','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0x3d2c,0xdc));var _0xc3d2=function(_0xfa2bd9,_0xf304a6){_0xfa2bd9=_0xfa2bd9-0x0;var _0x7f17ba=_0x3d2c[_0xfa2bd9];return _0x7f17ba;};'use strict';var pdf=require(_0xc3d2('0x0'));var emlformat=require(_0xc3d2('0x1'));var rimraf=require(_0xc3d2('0x2'));var zipdir=require(_0xc3d2('0x3'));var jsonpatch=require(_0xc3d2('0x4'));var rp=require(_0xc3d2('0x5'));var moment=require(_0xc3d2('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc3d2('0x7'));var util=require('util');var path=require(_0xc3d2('0x8'));var sox=require('sox');var csv=require(_0xc3d2('0x9'));var ejs=require(_0xc3d2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc3d2('0xb'));var crypto=require(_0xc3d2('0xc'));var jsforce=require(_0xc3d2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc3d2('0xe'));var Papa=require(_0xc3d2('0xf'));var Redis=require(_0xc3d2('0x10'));var authService=require(_0xc3d2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc3d2('0x12'));var hardwareService=require(_0xc3d2('0x13'));var logger=require(_0xc3d2('0x14'))(_0xc3d2('0x15'));var utils=require(_0xc3d2('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc3d2('0x17')]=_['defaults'](config['redis'],{'host':_0xc3d2('0x18'),'port':0x18eb});var socket=require(_0xc3d2('0x19'))(new Redis(config[_0xc3d2('0x17')]));require('./chatMessage.socket')[_0xc3d2('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc3d2('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xc3d2('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2b033,_0x5eacf7,_0xcf6474){if(_0xcf6474){var _0x1f1200=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f1200[_0xc3d2('0x1c')](_0x5eacf7)){return _0x2b033;}else{throw new Error(_0xc3d2('0x1d'));}}else{return _0x2b033;}}function respondWithRpcPromise(_0x57e27c,_0x5ac9f0,_0x5d2140,_0x5a9c19){return new BPromise(function(_0x355c04,_0x42f5e4){var _0x2073f4=_0x5a9c19||client;return _0x2073f4[_0xc3d2('0x1e')](_0x57e27c,_0x5d2140)[_0xc3d2('0x1f')](function(_0x42da6b){logger[_0xc3d2('0x20')](_0xc3d2('0x21'),_0x5ac9f0,_0xc3d2('0x22'));logger[_0xc3d2('0x23')](_0xc3d2('0x24'),_0x5ac9f0,_0xc3d2('0x22'),JSON[_0xc3d2('0x25')](_0x42da6b));if(_0x42da6b['error']){if(_0x42da6b[_0xc3d2('0x26')]['code']===0x1f4){logger[_0xc3d2('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5ac9f0,_0x42da6b[_0xc3d2('0x26')][_0xc3d2('0x27')]);return _0x42f5e4(_0x42da6b[_0xc3d2('0x26')][_0xc3d2('0x27')]);}logger[_0xc3d2('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5ac9f0,_0x42da6b[_0xc3d2('0x26')][_0xc3d2('0x27')]);return _0x355c04(_0x42da6b[_0xc3d2('0x26')]['message']);}else{logger[_0xc3d2('0x20')](_0xc3d2('0x21'),_0x5ac9f0,_0xc3d2('0x22'));_0x355c04(_0x42da6b[_0xc3d2('0x28')][_0xc3d2('0x27')]);}})[_0xc3d2('0x29')](function(_0x5c967d){logger['error'](_0xc3d2('0x21'),_0x5ac9f0,_0x5c967d);_0x42f5e4(_0x5c967d);});});}function respondWithStatusCode(_0x3a71db,_0x27162b){_0x27162b=_0x27162b||0xcc;return function(_0x1c0e3c){if(_0x1c0e3c){return _0x3a71db[_0xc3d2('0x2a')](_0x27162b);}return _0x3a71db[_0xc3d2('0x2b')](_0x27162b)[_0xc3d2('0x2c')]();};}function respondWithResult(_0x2ff866,_0x199278){_0x199278=_0x199278||0xc8;return function(_0x20780f){if(_0x20780f){return _0x2ff866[_0xc3d2('0x2b')](_0x199278)[_0xc3d2('0x2d')](_0x20780f);}};}function respondWithFilteredResult(_0x353524,_0x468dc1){return function(_0x42c7ff){if(_0x42c7ff){var _0x5464d4=_0x42c7ff['count'],_0x41a66f=_0x468dc1[_0xc3d2('0x2e')],_0x126ac0=_0x468dc1[_0xc3d2('0x2e')]+_0x468dc1[_0xc3d2('0x2f')],_0x5e5a3c;if(_0x126ac0>=_0x5464d4){_0x126ac0=_0x5464d4;_0x5e5a3c=0xc8;}else{_0x5e5a3c=0xce;}_0x353524[_0xc3d2('0x2b')](_0x5e5a3c);return _0x353524[_0xc3d2('0x30')](_0xc3d2('0x31'),_0x41a66f+'-'+_0x126ac0+'/'+_0x5464d4)[_0xc3d2('0x2d')](_0x42c7ff);}return null;};}function patchUpdates(_0x32243c){return function(_0x3a9c04){try{jsonpatch[_0xc3d2('0x32')](_0x3a9c04,_0x32243c,!![]);}catch(_0x476778){return BPromise['reject'](_0x476778);}return _0x3a9c04[_0xc3d2('0x33')]();};}function saveUpdates(_0x5e4a38,_0x693d99){return function(_0x260aa1){if(_0x260aa1){return _0x260aa1[_0xc3d2('0x34')](_0x5e4a38)[_0xc3d2('0x1f')](function(_0x49998){return _0x49998;});}return null;};}function removeEntity(_0x44034a,_0x9a2218){return function(_0x42527c){if(_0x42527c){return _0x42527c['destroy']()[_0xc3d2('0x1f')](function(){_0x44034a[_0xc3d2('0x2b')](0xcc)[_0xc3d2('0x2c')]();});}};}function handleEntityNotFound(_0x18c22b,_0x350446){return function(_0x1b1b79){if(!_0x1b1b79){_0x18c22b[_0xc3d2('0x2a')](0x194);}return _0x1b1b79;};}function handleError(_0x5c8932,_0x563730){_0x563730=_0x563730||0x1f4;return function(_0x5a7bc0){logger['error'](_0x5a7bc0[_0xc3d2('0x35')]);if(_0x5a7bc0[_0xc3d2('0x36')]){delete _0x5a7bc0[_0xc3d2('0x36')];}_0x5c8932[_0xc3d2('0x2b')](_0x563730)['send'](_0x5a7bc0);};}exports[_0xc3d2('0x37')]=function(_0x4e65c9,_0x971881){var _0x232d8d={},_0x127395={},_0x5958a8={'count':0x0,'rows':[]};var _0x563ff6=db[_0xc3d2('0x38')][_0xc3d2('0x39')];_0x127395['model']=_[_0xc3d2('0x3a')](_0x563ff6);_0x127395['query']=_[_0xc3d2('0x3a')](_0x4e65c9[_0xc3d2('0x3b')]);_0x127395[_0xc3d2('0x3c')]=_[_0xc3d2('0x3d')](_0x127395[_0xc3d2('0x3e')],_0x127395['query']);_0x232d8d[_0xc3d2('0x3f')]=_[_0xc3d2('0x3d')](_0x127395[_0xc3d2('0x3e')],qs[_0xc3d2('0x40')](_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x40')]));_0x232d8d[_0xc3d2('0x3f')]=_0x232d8d['attributes'][_0xc3d2('0x41')]?_0x232d8d[_0xc3d2('0x3f')]:_0x127395[_0xc3d2('0x3e')];if(!_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x42')](_0xc3d2('0x43'))){_0x232d8d[_0xc3d2('0x2f')]=qs[_0xc3d2('0x2f')](_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x2f')]);_0x232d8d[_0xc3d2('0x2e')]=qs[_0xc3d2('0x2e')](_0x4e65c9['query'][_0xc3d2('0x2e')]);}_0x232d8d[_0xc3d2('0x44')]=qs[_0xc3d2('0x45')](_0x4e65c9[_0xc3d2('0x3b')]['sort']);_0x232d8d[_0xc3d2('0x46')]=qs[_0xc3d2('0x3c')](_[_0xc3d2('0x47')](_0x4e65c9['query'],_0x127395[_0xc3d2('0x3c')]));if(_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x48')]){_0x232d8d[_0xc3d2('0x46')]=_[_0xc3d2('0x49')](_0x232d8d[_0xc3d2('0x46')],{'$or':_[_0xc3d2('0x4a')](_0x563ff6,function(_0x5a1b74){if(_0x5a1b74['type']['key']!==_0xc3d2('0x4b')){var _0x24d315={};_0x24d315[_0x5a1b74[_0xc3d2('0x4c')]]={'$like':'%'+_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x48')]+'%'};return _0x24d315;}})});}_0x232d8d=_[_0xc3d2('0x49')]({},_0x232d8d,_0x4e65c9[_0xc3d2('0x4d')]);var _0x4b625f={'where':_0x232d8d[_0xc3d2('0x46')]};return db[_0xc3d2('0x38')][_0xc3d2('0x4e')](_0x4b625f)[_0xc3d2('0x1f')](function(_0x4a2f39){_0x5958a8[_0xc3d2('0x4e')]=_0x4a2f39;if(_0x4e65c9[_0xc3d2('0x3b')][_0xc3d2('0x4f')]){_0x232d8d[_0xc3d2('0x50')]=[{'all':!![]}];}return db[_0xc3d2('0x38')][_0xc3d2('0x51')](_0x232d8d);})['then'](function(_0x3a0ce8){_0x5958a8[_0xc3d2('0x52')]=_0x3a0ce8;return _0x5958a8;})[_0xc3d2('0x1f')](respondWithFilteredResult(_0x971881,_0x232d8d))['catch'](handleError(_0x971881,null));};exports['show']=function(_0xde2cd7,_0x3c4f4e){var _0x3b06f6={'raw':!![],'where':{'id':_0xde2cd7[_0xc3d2('0x53')]['id']}},_0x19be7a={};_0x19be7a[_0xc3d2('0x3e')]=_['keys'](db[_0xc3d2('0x38')]['rawAttributes']);_0x19be7a[_0xc3d2('0x3b')]=_[_0xc3d2('0x3a')](_0xde2cd7['query']);_0x19be7a[_0xc3d2('0x3c')]=_['intersection'](_0x19be7a['model'],_0x19be7a[_0xc3d2('0x3b')]);_0x3b06f6[_0xc3d2('0x3f')]=_['intersection'](_0x19be7a[_0xc3d2('0x3e')],qs['fields'](_0xde2cd7[_0xc3d2('0x3b')][_0xc3d2('0x40')]));_0x3b06f6[_0xc3d2('0x3f')]=_0x3b06f6[_0xc3d2('0x3f')][_0xc3d2('0x41')]?_0x3b06f6[_0xc3d2('0x3f')]:_0x19be7a['model'];if(_0xde2cd7[_0xc3d2('0x3b')][_0xc3d2('0x4f')]){_0x3b06f6[_0xc3d2('0x50')]=[{'all':!![]}];}_0x3b06f6=_[_0xc3d2('0x49')]({},_0x3b06f6,_0xde2cd7['options']);return db[_0xc3d2('0x38')]['find'](_0x3b06f6)[_0xc3d2('0x1f')](handleEntityNotFound(_0x3c4f4e,null))[_0xc3d2('0x1f')](respondWithResult(_0x3c4f4e,null))[_0xc3d2('0x29')](handleError(_0x3c4f4e,null));};exports[_0xc3d2('0x54')]=function(_0x12f4d3,_0x1c0429){return db[_0xc3d2('0x38')][_0xc3d2('0x54')](_0x12f4d3[_0xc3d2('0x55')],{})[_0xc3d2('0x1f')](respondWithResult(_0x1c0429,0xc9))[_0xc3d2('0x29')](handleError(_0x1c0429,null));};exports[_0xc3d2('0x34')]=function(_0x4b2ee5,_0x234874){if(_0x4b2ee5['body']['id']){delete _0x4b2ee5[_0xc3d2('0x55')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x4b2ee5['params']['id']}})['then'](handleEntityNotFound(_0x234874,null))[_0xc3d2('0x1f')](saveUpdates(_0x4b2ee5[_0xc3d2('0x55')],null))[_0xc3d2('0x1f')](respondWithResult(_0x234874,null))['catch'](handleError(_0x234874,null));};exports['destroy']=function(_0x5c7ec7,_0x3d95d0){return db[_0xc3d2('0x38')]['find']({'where':{'id':_0x5c7ec7['params']['id']}})['then'](handleEntityNotFound(_0x3d95d0,null))[_0xc3d2('0x1f')](removeEntity(_0x3d95d0,null))['catch'](handleError(_0x3d95d0,null));};exports[_0xc3d2('0x56')]=function(_0x119241,_0x2318ba){return db[_0xc3d2('0x38')][_0xc3d2('0x56')]()['then'](respondWithResult(_0x2318ba,null))['catch'](handleError(_0x2318ba,null));};var interaction_log=require('../../config/logger')(_0xc3d2('0x57'));exports[_0xc3d2('0x58')]=function(_0x300f2e,_0x45031e,_0x245d54){var _0x3499d2={'channel':_0xc3d2('0x59')};if(_0x300f2e[_0xc3d2('0x55')]['id']){delete _0x300f2e[_0xc3d2('0x55')]['id'];}_0x300f2e[_0xc3d2('0x55')][_0xc3d2('0x5a')]=!![];_0x300f2e[_0xc3d2('0x55')]['readAt']=moment()['format'](_0xc3d2('0x5b'));_0x300f2e['body']['UserId']=_0x300f2e[_0xc3d2('0x55')][_0xc3d2('0x5c')]||_0x300f2e[_0xc3d2('0x5d')]['id'];return db[_0xc3d2('0x38')][_0xc3d2('0x5e')]({'where':{'id':_0x300f2e[_0xc3d2('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xc3d2('0x1f')](handleEntityNotFound(_0x45031e,null))[_0xc3d2('0x1f')](saveUpdates(_0x300f2e[_0xc3d2('0x55')],null))['then'](function(_0x1424ae){if(_0x1424ae){_0x3499d2['message']=_0x1424ae['get']({'plain':!![]});return db['ChatInteraction'][_0xc3d2('0x5e')]({'where':{'id':_0x1424ae[_0xc3d2('0x5f')]}});}return null;})[_0xc3d2('0x1f')](handleEntityNotFound(_0x45031e,null))[_0xc3d2('0x1f')](function(_0x239462){if(_0x239462){return _0x239462[_0xc3d2('0x34')]({'UserId':_0x300f2e['body']['UserId'],'read1stAt':_['isNil'](_0x239462[_0xc3d2('0x60')])?moment()[_0xc3d2('0x61')](_0xc3d2('0x5b')):undefined});}return null;})[_0xc3d2('0x1f')](function(_0x13009c){if(_0x13009c){_0x3499d2[_0xc3d2('0x62')]=_0x13009c['get']({'plain':!![]});interaction_log[_0xc3d2('0x20')](_0xc3d2('0x63'),_0x300f2e[_0xc3d2('0x5d')]['id'],_0x300f2e[_0xc3d2('0x5d')][_0xc3d2('0x36')],_0x300f2e[_0xc3d2('0x5d')][_0xc3d2('0x64')],_0x3499d2[_0xc3d2('0x62')]['id'],_0x300f2e['body']?JSON['stringify'](_0x300f2e[_0xc3d2('0x55')]):_0xc3d2('0x65'));return respondWithRpcPromise('AcceptMessage',_0xc3d2('0x66'),_0x3499d2);}return null;})[_0xc3d2('0x1f')](function(_0x97c779){if(_0x97c779){if(_0x300f2e[_0xc3d2('0x55')][_0xc3d2('0x67')]){_0x3499d2[_0xc3d2('0x27')][_0xc3d2('0x68')]=util[_0xc3d2('0x61')](_0xc3d2('0x69'),_0x300f2e['user'][_0xc3d2('0x36')]);_0x3499d2['message'][_0xc3d2('0x6a')]=_0x3499d2[_0xc3d2('0x6a')];_0x3499d2['message'][_0xc3d2('0x6b')]='accept';return respondWithRpcPromise(_0xc3d2('0x6c'),_0xc3d2('0x6c'),{'event':'acceptmessage','message':_[_0xc3d2('0x49')](_0x3499d2[_0xc3d2('0x27')],JSON[_0xc3d2('0x6d')](_0x3499d2[_0xc3d2('0x62')][_0xc3d2('0x6e')]))},client9002)[_0xc3d2('0x1f')](function(){return _0x3499d2;});}return _0x3499d2;}return null;})['then'](respondWithResult(_0x45031e,null))[_0xc3d2('0x29')](handleError(_0x45031e,null));};var interaction_log=require(_0xc3d2('0x14'))(_0xc3d2('0x57'));exports[_0xc3d2('0x6f')]=function(_0x32a057,_0xf43d2,_0x10c0df){var _0x433d0c={'agent':{},'channel':_0xc3d2('0x59')};if(_0x32a057[_0xc3d2('0x55')]['id']){delete _0x32a057[_0xc3d2('0x55')]['id'];}_0x32a057[_0xc3d2('0x55')][_0xc3d2('0x5c')]=_0x32a057[_0xc3d2('0x55')]['UserId']||_0x32a057[_0xc3d2('0x5d')]['id'];_0x433d0c[_0xc3d2('0x70')]['id']=_0x32a057[_0xc3d2('0x55')][_0xc3d2('0x5c')];return db[_0xc3d2('0x38')]['find']({'where':{'id':_0x32a057[_0xc3d2('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xf43d2,null))[_0xc3d2('0x1f')](function(_0x5b027f){if(_0x5b027f){_0x433d0c[_0xc3d2('0x27')]=_0x5b027f[_0xc3d2('0x71')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5b027f['ChatInteractionId']}});}return null;})[_0xc3d2('0x1f')](handleEntityNotFound(_0xf43d2,null))[_0xc3d2('0x1f')](function(_0x5efcbc){if(_0x5efcbc){_0x433d0c['interaction']=_0x5efcbc['get']({'plain':!![]});interaction_log[_0xc3d2('0x20')](_0xc3d2('0x72'),_0x32a057[_0xc3d2('0x5d')]['id'],_0x32a057['user'][_0xc3d2('0x36')],_0x32a057[_0xc3d2('0x5d')][_0xc3d2('0x64')],_0x433d0c[_0xc3d2('0x62')]['id'],_0x32a057[_0xc3d2('0x55')]?JSON[_0xc3d2('0x25')](_0x32a057[_0xc3d2('0x55')]):'null');return respondWithRpcPromise('RejectMessage',_0xc3d2('0x73'),_0x433d0c);}return null;})[_0xc3d2('0x1f')](function(_0x386b03){if(_0x386b03){_0x386b03[_0xc3d2('0x27')][_0xc3d2('0x68')]=util[_0xc3d2('0x61')](_0xc3d2('0x69'),_0x32a057[_0xc3d2('0x5d')][_0xc3d2('0x36')]);_0x386b03[_0xc3d2('0x27')][_0xc3d2('0x6a')]=_0x433d0c[_0xc3d2('0x6a')];_0x386b03[_0xc3d2('0x27')][_0xc3d2('0x6b')]=_0xc3d2('0x6f');respondWithRpcPromise(_0xc3d2('0x6c'),_0xc3d2('0x6c'),{'event':_0xc3d2('0x74'),'message':_0x386b03[_0xc3d2('0x27')]},client9002);return _0x433d0c;}return null;})['then'](respondWithResult(_0xf43d2,null))[_0xc3d2('0x29')](handleError(_0xf43d2,null));};
\ No newline at end of file
+var _0x86ae=['sort','where','pick','merge','type','key','VIRTUAL','options','includeAll','include','rows','params','create','body','catch','update','find','describe','../../config/logger','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','EventManager','acceptmessage','parse','formData','chat','agent','RejectMessage','rejectMessage','SIP/%s','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','socket.io-emitter','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','ChatMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x122cc1,_0x5c956e){var _0x1e33af=function(_0x949b75){while(--_0x949b75){_0x122cc1['push'](_0x122cc1['shift']());}};_0x1e33af(++_0x5c956e);}(_0x86ae,0x1a9));var _0xe86a=function(_0xd6d189,_0x16674f){_0xd6d189=_0xd6d189-0x0;var _0xb84d8d=_0x86ae[_0xd6d189];return _0xb84d8d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe86a('0x0'));var rimraf=require(_0xe86a('0x1'));var zipdir=require(_0xe86a('0x2'));var jsonpatch=require(_0xe86a('0x3'));var rp=require(_0xe86a('0x4'));var moment=require(_0xe86a('0x5'));var BPromise=require(_0xe86a('0x6'));var Mustache=require(_0xe86a('0x7'));var util=require(_0xe86a('0x8'));var path=require(_0xe86a('0x9'));var sox=require(_0xe86a('0xa'));var csv=require(_0xe86a('0xb'));var ejs=require(_0xe86a('0xc'));var fs=require('fs');var _=require(_0xe86a('0xd'));var squel=require(_0xe86a('0xe'));var crypto=require(_0xe86a('0xf'));var jsforce=require(_0xe86a('0x10'));var deskjs=require(_0xe86a('0x11'));var toCsv=require(_0xe86a('0xb'));var querystring=require(_0xe86a('0x12'));var Papa=require(_0xe86a('0x13'));var Redis=require('ioredis');var authService=require(_0xe86a('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe86a('0x15'));var logger=require('../../config/logger')(_0xe86a('0x16'));var utils=require(_0xe86a('0x17'));var config=require(_0xe86a('0x18'));var db=require('../../mysqldb')['db'];config[_0xe86a('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe86a('0x1a'))(new Redis(config[_0xe86a('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xe86a('0x1b'));var client=jayson[_0xe86a('0x1c')][_0xe86a('0x1d')]({'port':0x232c});var client9002=jayson[_0xe86a('0x1c')][_0xe86a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x30debc,_0x4590a3,_0x24a1ae){if(_0x24a1ae){var _0x3833fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3833fc[_0xe86a('0x1e')](_0x4590a3)){return _0x30debc;}else{throw new Error(_0xe86a('0x1f'));}}else{return _0x30debc;}}function respondWithRpcPromise(_0x615ad2,_0x4ffcee,_0x1c37f5,_0x4cc4e3){return new BPromise(function(_0x20bf1e,_0xe6ad96){var _0x3a81b5=_0x4cc4e3||client;return _0x3a81b5['request'](_0x615ad2,_0x1c37f5)['then'](function(_0x318f36){logger['info'](_0xe86a('0x20'),_0x4ffcee,_0xe86a('0x21'));logger['debug'](_0xe86a('0x22'),_0x4ffcee,_0xe86a('0x21'),JSON[_0xe86a('0x23')](_0x318f36));if(_0x318f36[_0xe86a('0x24')]){if(_0x318f36[_0xe86a('0x24')][_0xe86a('0x25')]===0x1f4){logger[_0xe86a('0x24')](_0xe86a('0x20'),_0x4ffcee,_0x318f36[_0xe86a('0x24')]['message']);return _0xe6ad96(_0x318f36['error']['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4ffcee,_0x318f36[_0xe86a('0x24')]['message']);return _0x20bf1e(_0x318f36[_0xe86a('0x24')][_0xe86a('0x26')]);}else{logger[_0xe86a('0x27')](_0xe86a('0x20'),_0x4ffcee,_0xe86a('0x21'));_0x20bf1e(_0x318f36[_0xe86a('0x28')][_0xe86a('0x26')]);}})['catch'](function(_0x425ee9){logger[_0xe86a('0x24')](_0xe86a('0x20'),_0x4ffcee,_0x425ee9);_0xe6ad96(_0x425ee9);});});}function respondWithStatusCode(_0x2e861e,_0x3e1a1c){_0x3e1a1c=_0x3e1a1c||0xcc;return function(_0x27e06b){if(_0x27e06b){return _0x2e861e[_0xe86a('0x29')](_0x3e1a1c);}return _0x2e861e[_0xe86a('0x2a')](_0x3e1a1c)[_0xe86a('0x2b')]();};}function respondWithResult(_0x59a20d,_0x3e4bce){_0x3e4bce=_0x3e4bce||0xc8;return function(_0x44a949){if(_0x44a949){return _0x59a20d[_0xe86a('0x2a')](_0x3e4bce)[_0xe86a('0x2c')](_0x44a949);}};}function respondWithFilteredResult(_0x2b3b15,_0x562e54){return function(_0x3cf9a2){if(_0x3cf9a2){var _0x18bbc6=_0x3cf9a2[_0xe86a('0x2d')],_0x25ffec=_0x562e54[_0xe86a('0x2e')],_0x5068a9=_0x562e54[_0xe86a('0x2e')]+_0x562e54[_0xe86a('0x2f')],_0x45a94b;if(_0x5068a9>=_0x18bbc6){_0x5068a9=_0x18bbc6;_0x45a94b=0xc8;}else{_0x45a94b=0xce;}_0x2b3b15[_0xe86a('0x2a')](_0x45a94b);return _0x2b3b15[_0xe86a('0x30')](_0xe86a('0x31'),_0x25ffec+'-'+_0x5068a9+'/'+_0x18bbc6)['json'](_0x3cf9a2);}return null;};}function patchUpdates(_0x497172){return function(_0x255692){try{jsonpatch[_0xe86a('0x32')](_0x255692,_0x497172,!![]);}catch(_0x24181b){return BPromise[_0xe86a('0x33')](_0x24181b);}return _0x255692[_0xe86a('0x34')]();};}function saveUpdates(_0x4b22f0,_0x23661f){return function(_0x146bb2){if(_0x146bb2){return _0x146bb2['update'](_0x4b22f0)['then'](function(_0x39e626){return _0x39e626;});}return null;};}function removeEntity(_0x8ed5fa,_0x501ec3){return function(_0x1ece6d){if(_0x1ece6d){return _0x1ece6d[_0xe86a('0x35')]()[_0xe86a('0x36')](function(){_0x8ed5fa[_0xe86a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a838,_0x4957c4){return function(_0x389572){if(!_0x389572){_0x41a838[_0xe86a('0x29')](0x194);}return _0x389572;};}function handleError(_0x2a20a4,_0x202e2c){_0x202e2c=_0x202e2c||0x1f4;return function(_0x43343e){logger['error'](_0x43343e[_0xe86a('0x37')]);if(_0x43343e[_0xe86a('0x38')]){delete _0x43343e['name'];}_0x2a20a4[_0xe86a('0x2a')](_0x202e2c)[_0xe86a('0x39')](_0x43343e);};}exports[_0xe86a('0x3a')]=function(_0xdeeeeb,_0x5ad07b){var _0x172d39={},_0x3a0ed7={},_0xa89298={'count':0x0,'rows':[]};var _0x5bbcb9=db[_0xe86a('0x3b')][_0xe86a('0x3c')];_0x3a0ed7[_0xe86a('0x3d')]=_[_0xe86a('0x3e')](_0x5bbcb9);_0x3a0ed7[_0xe86a('0x3f')]=_[_0xe86a('0x3e')](_0xdeeeeb['query']);_0x3a0ed7[_0xe86a('0x40')]=_[_0xe86a('0x41')](_0x3a0ed7[_0xe86a('0x3d')],_0x3a0ed7[_0xe86a('0x3f')]);_0x172d39[_0xe86a('0x42')]=_[_0xe86a('0x41')](_0x3a0ed7['model'],qs['fields'](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x43')]));_0x172d39[_0xe86a('0x42')]=_0x172d39['attributes'][_0xe86a('0x44')]?_0x172d39[_0xe86a('0x42')]:_0x3a0ed7[_0xe86a('0x3d')];if(!_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x45')](_0xe86a('0x46'))){_0x172d39[_0xe86a('0x2f')]=qs[_0xe86a('0x2f')](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x2f')]);_0x172d39[_0xe86a('0x2e')]=qs[_0xe86a('0x2e')](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x2e')]);}_0x172d39['order']=qs[_0xe86a('0x47')](_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x47')]);_0x172d39[_0xe86a('0x48')]=qs['filters'](_[_0xe86a('0x49')](_0xdeeeeb[_0xe86a('0x3f')],_0x3a0ed7['filters']));if(_0xdeeeeb[_0xe86a('0x3f')]['filter']){_0x172d39[_0xe86a('0x48')]=_[_0xe86a('0x4a')](_0x172d39[_0xe86a('0x48')],{'$or':_['map'](_0x5bbcb9,function(_0xe48494){if(_0xe48494[_0xe86a('0x4b')][_0xe86a('0x4c')]!==_0xe86a('0x4d')){var _0x5c291e={};_0x5c291e[_0xe48494['field']]={'$like':'%'+_0xdeeeeb['query']['filter']+'%'};return _0x5c291e;}})});}_0x172d39=_['merge']({},_0x172d39,_0xdeeeeb[_0xe86a('0x4e')]);var _0x50cba1={'where':_0x172d39['where']};return db['ChatMessage'][_0xe86a('0x2d')](_0x50cba1)[_0xe86a('0x36')](function(_0x56339f){_0xa89298['count']=_0x56339f;if(_0xdeeeeb[_0xe86a('0x3f')][_0xe86a('0x4f')]){_0x172d39[_0xe86a('0x50')]=[{'all':!![]}];}return db[_0xe86a('0x3b')]['findAll'](_0x172d39);})[_0xe86a('0x36')](function(_0x2c9d0e){_0xa89298[_0xe86a('0x51')]=_0x2c9d0e;return _0xa89298;})[_0xe86a('0x36')](respondWithFilteredResult(_0x5ad07b,_0x172d39))['catch'](handleError(_0x5ad07b,null));};exports['show']=function(_0x22217d,_0x15622c){var _0x58a207={'raw':!![],'where':{'id':_0x22217d[_0xe86a('0x52')]['id']}},_0x361a90={};_0x361a90[_0xe86a('0x3d')]=_['keys'](db['ChatMessage'][_0xe86a('0x3c')]);_0x361a90['query']=_[_0xe86a('0x3e')](_0x22217d[_0xe86a('0x3f')]);_0x361a90[_0xe86a('0x40')]=_[_0xe86a('0x41')](_0x361a90[_0xe86a('0x3d')],_0x361a90[_0xe86a('0x3f')]);_0x58a207[_0xe86a('0x42')]=_['intersection'](_0x361a90[_0xe86a('0x3d')],qs[_0xe86a('0x43')](_0x22217d[_0xe86a('0x3f')][_0xe86a('0x43')]));_0x58a207['attributes']=_0x58a207[_0xe86a('0x42')][_0xe86a('0x44')]?_0x58a207[_0xe86a('0x42')]:_0x361a90[_0xe86a('0x3d')];if(_0x22217d['query']['includeAll']){_0x58a207[_0xe86a('0x50')]=[{'all':!![]}];}_0x58a207=_[_0xe86a('0x4a')]({},_0x58a207,_0x22217d[_0xe86a('0x4e')]);return db[_0xe86a('0x3b')]['find'](_0x58a207)[_0xe86a('0x36')](handleEntityNotFound(_0x15622c,null))[_0xe86a('0x36')](respondWithResult(_0x15622c,null))['catch'](handleError(_0x15622c,null));};exports[_0xe86a('0x53')]=function(_0x429eac,_0xb4c14b){return db[_0xe86a('0x3b')][_0xe86a('0x53')](_0x429eac[_0xe86a('0x54')],{})[_0xe86a('0x36')](respondWithResult(_0xb4c14b,0xc9))[_0xe86a('0x55')](handleError(_0xb4c14b,null));};exports[_0xe86a('0x56')]=function(_0x3ec046,_0x44d3fb){if(_0x3ec046['body']['id']){delete _0x3ec046[_0xe86a('0x54')]['id'];}return db[_0xe86a('0x3b')][_0xe86a('0x57')]({'where':{'id':_0x3ec046[_0xe86a('0x52')]['id']}})[_0xe86a('0x36')](handleEntityNotFound(_0x44d3fb,null))['then'](saveUpdates(_0x3ec046[_0xe86a('0x54')],null))[_0xe86a('0x36')](respondWithResult(_0x44d3fb,null))[_0xe86a('0x55')](handleError(_0x44d3fb,null));};exports[_0xe86a('0x35')]=function(_0x9ad84b,_0xeafab4){return db[_0xe86a('0x3b')][_0xe86a('0x57')]({'where':{'id':_0x9ad84b['params']['id']}})[_0xe86a('0x36')](handleEntityNotFound(_0xeafab4,null))[_0xe86a('0x36')](removeEntity(_0xeafab4,null))[_0xe86a('0x55')](handleError(_0xeafab4,null));};exports[_0xe86a('0x58')]=function(_0x15c294,_0x1cade1){return db[_0xe86a('0x3b')]['describe']()[_0xe86a('0x36')](respondWithResult(_0x1cade1,null))[_0xe86a('0x55')](handleError(_0x1cade1,null));};var interaction_log=require(_0xe86a('0x59'))(_0xe86a('0x5a'));exports[_0xe86a('0x5b')]=function(_0x325460,_0x267cdc,_0x425124){var _0x3e008e={'channel':'chat'};if(_0x325460[_0xe86a('0x54')]['id']){delete _0x325460[_0xe86a('0x54')]['id'];}_0x325460[_0xe86a('0x54')][_0xe86a('0x5c')]=!![];_0x325460[_0xe86a('0x54')][_0xe86a('0x5d')]=moment()[_0xe86a('0x5e')](_0xe86a('0x5f'));_0x325460[_0xe86a('0x54')]['UserId']=_0x325460[_0xe86a('0x54')][_0xe86a('0x60')]||_0x325460[_0xe86a('0x61')]['id'];return db[_0xe86a('0x3b')]['find']({'where':{'id':_0x325460[_0xe86a('0x52')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xe86a('0x62')}]})[_0xe86a('0x36')](handleEntityNotFound(_0x267cdc,null))[_0xe86a('0x36')](saveUpdates(_0x325460['body'],null))[_0xe86a('0x36')](function(_0x214ea7){if(_0x214ea7){_0x3e008e[_0xe86a('0x26')]=_0x214ea7[_0xe86a('0x63')]({'plain':!![]});return db[_0xe86a('0x64')][_0xe86a('0x57')]({'where':{'id':_0x214ea7[_0xe86a('0x65')]}});}return null;})[_0xe86a('0x36')](handleEntityNotFound(_0x267cdc,null))['then'](function(_0x1b9c11){if(_0x1b9c11){return _0x1b9c11[_0xe86a('0x56')]({'UserId':_0x325460[_0xe86a('0x54')]['UserId'],'read1stAt':_[_0xe86a('0x66')](_0x1b9c11[_0xe86a('0x67')])?moment()['format'](_0xe86a('0x5f')):undefined});}return null;})[_0xe86a('0x36')](function(_0x245562){if(_0x245562){_0x3e008e[_0xe86a('0x68')]=_0x245562[_0xe86a('0x63')]({'plain':!![]});interaction_log[_0xe86a('0x27')](_0xe86a('0x69'),_0x325460[_0xe86a('0x61')]['id'],_0x325460['user']['name'],_0x325460[_0xe86a('0x61')][_0xe86a('0x6a')],_0x3e008e['interaction']['id'],_0x325460['body']?JSON[_0xe86a('0x23')](_0x325460[_0xe86a('0x54')]):_0xe86a('0x6b'));return respondWithRpcPromise(_0xe86a('0x6c'),_0xe86a('0x6d'),_0x3e008e);}return null;})['then'](function(_0xaf2ee1){if(_0xaf2ee1){if(_0x325460[_0xe86a('0x54')][_0xe86a('0x6e')]){_0x3e008e[_0xe86a('0x26')][_0xe86a('0x6f')]=util[_0xe86a('0x5e')]('SIP/%s',_0x325460['user']['name']);_0x3e008e[_0xe86a('0x26')][_0xe86a('0x70')]=_0x3e008e[_0xe86a('0x70')];_0x3e008e[_0xe86a('0x26')]['event']=_0xe86a('0x5b');return respondWithRpcPromise(_0xe86a('0x71'),_0xe86a('0x71'),{'event':_0xe86a('0x72'),'message':_[_0xe86a('0x4a')](_0x3e008e['message'],JSON[_0xe86a('0x73')](_0x3e008e['interaction'][_0xe86a('0x74')]))},client9002)[_0xe86a('0x36')](function(){return _0x3e008e;});}return _0x3e008e;}return null;})[_0xe86a('0x36')](respondWithResult(_0x267cdc,null))['catch'](handleError(_0x267cdc,null));};var interaction_log=require(_0xe86a('0x59'))(_0xe86a('0x5a'));exports['reject']=function(_0x181262,_0x19fa5f,_0x1e920e){var _0x32be3d={'agent':{},'channel':_0xe86a('0x75')};if(_0x181262['body']['id']){delete _0x181262['body']['id'];}_0x181262[_0xe86a('0x54')][_0xe86a('0x60')]=_0x181262[_0xe86a('0x54')][_0xe86a('0x60')]||_0x181262[_0xe86a('0x61')]['id'];_0x32be3d[_0xe86a('0x76')]['id']=_0x181262['body']['UserId'];return db[_0xe86a('0x3b')][_0xe86a('0x57')]({'where':{'id':_0x181262[_0xe86a('0x52')]['id'],'UserId':null}})[_0xe86a('0x36')](handleEntityNotFound(_0x19fa5f,null))[_0xe86a('0x36')](function(_0x151f83){if(_0x151f83){_0x32be3d[_0xe86a('0x26')]=_0x151f83[_0xe86a('0x63')]({'plain':!![]});return db[_0xe86a('0x64')][_0xe86a('0x57')]({'where':{'id':_0x151f83[_0xe86a('0x65')]}});}return null;})[_0xe86a('0x36')](handleEntityNotFound(_0x19fa5f,null))['then'](function(_0x2b1327){if(_0x2b1327){_0x32be3d['interaction']=_0x2b1327[_0xe86a('0x63')]({'plain':!![]});interaction_log[_0xe86a('0x27')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x181262[_0xe86a('0x61')]['id'],_0x181262['user'][_0xe86a('0x38')],_0x181262[_0xe86a('0x61')][_0xe86a('0x6a')],_0x32be3d[_0xe86a('0x68')]['id'],_0x181262['body']?JSON[_0xe86a('0x23')](_0x181262[_0xe86a('0x54')]):_0xe86a('0x6b'));return respondWithRpcPromise(_0xe86a('0x77'),_0xe86a('0x78'),_0x32be3d);}return null;})[_0xe86a('0x36')](function(_0x3d16e4){if(_0x3d16e4){_0x3d16e4['message'][_0xe86a('0x6f')]=util['format'](_0xe86a('0x79'),_0x181262[_0xe86a('0x61')]['name']);_0x3d16e4['message']['channel']=_0x32be3d[_0xe86a('0x70')];_0x3d16e4[_0xe86a('0x26')][_0xe86a('0x7a')]=_0xe86a('0x33');respondWithRpcPromise('EventManager',_0xe86a('0x71'),{'event':_0xe86a('0x7b'),'message':_0x3d16e4[_0xe86a('0x26')]},client9002);return _0x32be3d;}return null;})['then'](respondWithResult(_0x19fa5f,null))[_0xe86a('0x55')](handleError(_0x19fa5f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 070b9d2..1727750 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 _0x29b6=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x5d707a,_0x4b283d){var _0x5a6cac=function(_0x21ca6a){while(--_0x21ca6a){_0x5d707a['push'](_0x5d707a['shift']());}};_0x5a6cac(++_0x4b283d);}(_0x29b6,0x172));var _0x629b=function(_0x59bf70,_0x54e5e7){_0x59bf70=_0x59bf70-0x0;var _0x5e004e=_0x29b6[_0x59bf70];return _0x5e004e;};'use strict';var EventEmitter=require(_0x629b('0x0'));var ChatMessage=require(_0x629b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x629b('0x2')](0x0);var events={'afterCreate':_0x629b('0x3'),'afterUpdate':_0x629b('0x4'),'afterDestroy':_0x629b('0x5')};function emitEvent(_0x4a0a84){return function(_0x222652,_0x48e855,_0x4a9d45){ChatMessageEvents[_0x629b('0x6')](_0x4a0a84+':'+_0x222652['id'],_0x222652);ChatMessageEvents[_0x629b('0x6')](_0x4a0a84,_0x222652);_0x4a9d45(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x629b('0x7')](e,emitEvent(event));}}module[_0x629b('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x7b06=['hook','exports','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x35ed88,_0x25a1ee){var _0x41d1ec=function(_0x133da5){while(--_0x133da5){_0x35ed88['push'](_0x35ed88['shift']());}};_0x41d1ec(++_0x25a1ee);}(_0x7b06,0x1b2));var _0x67b0=function(_0xfd1945,_0x29827d){_0xfd1945=_0xfd1945-0x0;var _0x53d788=_0x7b06[_0xfd1945];return _0x53d788;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x67b0('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x67b0('0x1'),'afterUpdate':_0x67b0('0x2'),'afterDestroy':_0x67b0('0x3')};function emitEvent(_0x4fff20){return function(_0x4766cc,_0x44df75,_0x4b6afd){ChatMessageEvents['emit'](_0x4fff20+':'+_0x4766cc['id'],_0x4766cc);ChatMessageEvents[_0x67b0('0x4')](_0x4fff20,_0x4766cc);_0x4b6afd(null);};}for(var e in events){if(events[_0x67b0('0x5')](e)){var event=events[e];ChatMessage[_0x67b0('0x6')](e,emitEvent(event));}}module[_0x67b0('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index fdf822b..54956ef 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 _0x868f=['../../config/logger','api','bluebird','request-promise','path','rimraf','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x19b83b,_0x41b4d7){var _0x2d9d07=function(_0x2e50a0){while(--_0x2e50a0){_0x19b83b['push'](_0x19b83b['shift']());}};_0x2d9d07(++_0x41b4d7);}(_0x868f,0x1ae));var _0xf868=function(_0x4afc06,_0x1499bf){_0x4afc06=_0x4afc06-0x0;var _0x24c1ca=_0x868f[_0x4afc06];return _0x24c1ca;};'use strict';var _=require(_0xf868('0x0'));var util=require(_0xf868('0x1'));var logger=require(_0xf868('0x2'))(_0xf868('0x3'));var moment=require('moment');var BPromise=require(_0xf868('0x4'));var rp=require(_0xf868('0x5'));var fs=require('fs');var path=require(_0xf868('0x6'));var rimraf=require(_0xf868('0x7'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2c12fb,_0x145d35){return _0x2c12fb[_0xf868('0x8')](_0xf868('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xf868('0xa'),'fields':[_0xf868('0xb')],'type':_0xf868('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x54b943,_0x31fb51,_0x17f50e){var _0x4cbbb0=_0x2c12fb[_0xf868('0xd')];var _0x4ed673=_0x54b943[_0xf868('0xe')]({'plain':!![]});if(_0x4ed673[_0xf868('0xf')][_0xf868('0x10')]()==='in'||_0x4ed673['direction'][_0xf868('0x10')]()===_0xf868('0x11')&&!_0x4ed673['secret']&&!_[_0xf868('0x12')](_0x4ed673[_0xf868('0x13')])){_0x4cbbb0[_0xf868('0x14')][_0xf868('0x15')]({'where':{'id':_0x4ed673['ChatInteractionId']}})[_0xf868('0x16')](function(_0x11e24d){if(_0x11e24d){_0x11e24d[_0xf868('0x17')]({'lastMsgAt':_0x4ed673['createdAt'],'lastMsgDirection':_0x4ed673[_0xf868('0xf')][_0xf868('0x10')]()});}})[_0xf868('0x18')](function(_0x394515){console['error'](_0x394515);});}_0x17f50e();}},'charset':_0xf868('0x19'),'collate':_0xf868('0x1a')});};
\ No newline at end of file
+var _0x9f32=['findOne','then','update','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId'];(function(_0x3e3508,_0x11a30e){var _0x23dce6=function(_0x2e3b47){while(--_0x2e3b47){_0x3e3508['push'](_0x3e3508['shift']());}};_0x23dce6(++_0x11a30e);}(_0x9f32,0xc3));var _0x29f3=function(_0x4b3682,_0x1725d9){_0x4b3682=_0x4b3682-0x0;var _0x3421ba=_0x9f32[_0x4b3682];return _0x3421ba;};'use strict';var _=require(_0x29f3('0x0'));var util=require('util');var logger=require(_0x29f3('0x1'))(_0x29f3('0x2'));var moment=require('moment');var BPromise=require(_0x29f3('0x3'));var rp=require(_0x29f3('0x4'));var fs=require('fs');var path=require(_0x29f3('0x5'));var rimraf=require(_0x29f3('0x6'));var config=require('../../config/environment');var attributes=require(_0x29f3('0x7'));module[_0x29f3('0x8')]=function(_0x2eb0ee,_0xba7964){return _0x2eb0ee[_0x29f3('0x9')](_0x29f3('0xa'),attributes,{'tableName':_0x29f3('0xb'),'paranoid':![],'indexes':[{'name':_0x29f3('0xc'),'fields':['body'],'type':_0x29f3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x578589,_0x2955d3,_0x2ceb3c){var _0x52b409=_0x2eb0ee[_0x29f3('0xe')];var _0x25a9d1=_0x578589[_0x29f3('0xf')]({'plain':!![]});if(_0x25a9d1[_0x29f3('0x10')]['toLowerCase']()==='in'||_0x25a9d1['direction'][_0x29f3('0x11')]()===_0x29f3('0x12')&&!_0x25a9d1['secret']&&!_[_0x29f3('0x13')](_0x25a9d1[_0x29f3('0x14')])){_0x52b409['ChatInteraction'][_0x29f3('0x15')]({'where':{'id':_0x25a9d1['ChatInteractionId']}})[_0x29f3('0x16')](function(_0x33bbd3){if(_0x33bbd3){_0x33bbd3[_0x29f3('0x17')]({'lastMsgAt':_0x25a9d1['createdAt'],'lastMsgDirection':_0x25a9d1[_0x29f3('0x10')][_0x29f3('0x11')]()});}})[_0x29f3('0x18')](function(_0x312da8){console[_0x29f3('0x19')](_0x312da8);});}_0x2ceb3c();}},'charset':'utf8mb4','collate':_0x29f3('0x1a')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 96f1ada..5095c84 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 _0x5d98=['raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x470a14,_0x349610){var _0x58c12c=function(_0x4cfb7d){while(--_0x4cfb7d){_0x470a14['push'](_0x470a14['shift']());}};_0x58c12c(++_0x349610);}(_0x5d98,0x178));var _0x85d9=function(_0xe628ce,_0x4c8fc4){_0xe628ce=_0xe628ce-0x0;var _0xc744=_0x5d98[_0xe628ce];return _0xc744;};'use strict';var _=require(_0x85d9('0x0'));var util=require(_0x85d9('0x1'));var moment=require(_0x85d9('0x2'));var BPromise=require(_0x85d9('0x3'));var rs=require(_0x85d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85d9('0x5'))['db'];var utils=require(_0x85d9('0x6'));var logger=require(_0x85d9('0x7'))(_0x85d9('0x8'));var config=require(_0x85d9('0x9'));var jayson=require(_0x85d9('0xa'));var client=jayson[_0x85d9('0xb')][_0x85d9('0xc')]({'port':0x232a});config[_0x85d9('0xd')]=_[_0x85d9('0xe')](config[_0x85d9('0xd')],{'host':_0x85d9('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85d9('0xd')]));require(_0x85d9('0x10'))[_0x85d9('0x11')](socket);function respondWithRpcPromise(_0x2f0cd9,_0x1b1728,_0x12b4ce){return new BPromise(function(_0xe5179e,_0x2a4a5b){return client['request'](_0x2f0cd9,_0x12b4ce)[_0x85d9('0x12')](function(_0x2960b4){logger[_0x85d9('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1b1728,_0x85d9('0x14'));logger['debug'](_0x85d9('0x15'),_0x1b1728,_0x85d9('0x14'),JSON['stringify'](_0x2960b4));if(_0x2960b4['error']){if(_0x2960b4[_0x85d9('0x16')][_0x85d9('0x17')]===0x1f4){logger['error'](_0x85d9('0x18'),_0x1b1728,_0x2960b4[_0x85d9('0x16')][_0x85d9('0x19')]);return _0x2a4a5b(_0x2960b4[_0x85d9('0x16')]['message']);}logger[_0x85d9('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1b1728,_0x2960b4[_0x85d9('0x16')]['message']);return _0xe5179e(_0x2960b4[_0x85d9('0x16')][_0x85d9('0x19')]);}else{logger[_0x85d9('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1b1728,_0x85d9('0x14'));_0xe5179e(_0x2960b4[_0x85d9('0x1a')][_0x85d9('0x19')]);}})['catch'](function(_0x2a7089){logger[_0x85d9('0x16')](_0x85d9('0x18'),_0x1b1728,_0x2a7089);_0x2a4a5b(_0x2a7089);});});}exports[_0x85d9('0x1b')]=function(_0x116af3){var _0x5a0128=this;return new Promise(function(_0x16a6ca,_0x32da36){return db[_0x85d9('0x1c')][_0x85d9('0x1d')](_0x116af3[_0x85d9('0x1e')],{'raw':_0x116af3[_0x85d9('0x1f')]?_0x116af3[_0x85d9('0x1f')][_0x85d9('0x20')]===undefined?!![]:![]:!![]})[_0x85d9('0x12')](function(_0x1def30){logger[_0x85d9('0x13')]('CreateChatMessage',_0x116af3);logger['debug'](_0x85d9('0x1b'),_0x116af3,JSON[_0x85d9('0x21')](_0x1def30));_0x16a6ca(_0x1def30);})['catch'](function(_0x16b0a9){logger[_0x85d9('0x16')](_0x85d9('0x1b'),_0x16b0a9[_0x85d9('0x19')],_0x116af3);_0x32da36(_0x5a0128[_0x85d9('0x16')](0x1f4,_0x16b0a9[_0x85d9('0x19')]));});});};
\ No newline at end of file
+var _0x9e86=['code','message','catch','CreateChatMessage','ChatMessage','body','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x204d21,_0x5d3952){var _0x55df50=function(_0x52de7a){while(--_0x52de7a){_0x204d21['push'](_0x204d21['shift']());}};_0x55df50(++_0x5d3952);}(_0x9e86,0x15d));var _0x69e8=function(_0x269dd7,_0x3f893c){_0x269dd7=_0x269dd7-0x0;var _0x4fed23=_0x9e86[_0x269dd7];return _0x4fed23;};'use strict';var _=require('lodash');var util=require(_0x69e8('0x0'));var moment=require('moment');var BPromise=require(_0x69e8('0x1'));var rs=require(_0x69e8('0x2'));var fs=require('fs');var Redis=require(_0x69e8('0x3'));var db=require(_0x69e8('0x4'))['db'];var utils=require(_0x69e8('0x5'));var logger=require(_0x69e8('0x6'))(_0x69e8('0x7'));var config=require(_0x69e8('0x8'));var jayson=require(_0x69e8('0x9'));var client=jayson[_0x69e8('0xa')][_0x69e8('0xb')]({'port':0x232a});config[_0x69e8('0xc')]=_[_0x69e8('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x69e8('0xe'))(new Redis(config[_0x69e8('0xc')]));require(_0x69e8('0xf'))[_0x69e8('0x10')](socket);function respondWithRpcPromise(_0x1535cb,_0x21096d,_0x31660a){return new BPromise(function(_0x21061c,_0x77e799){return client[_0x69e8('0x11')](_0x1535cb,_0x31660a)['then'](function(_0x67151){logger[_0x69e8('0x12')](_0x69e8('0x13'),_0x21096d,_0x69e8('0x14'));logger[_0x69e8('0x15')](_0x69e8('0x16'),_0x21096d,_0x69e8('0x14'),JSON[_0x69e8('0x17')](_0x67151));if(_0x67151['error']){if(_0x67151[_0x69e8('0x18')][_0x69e8('0x19')]===0x1f4){logger[_0x69e8('0x18')](_0x69e8('0x13'),_0x21096d,_0x67151['error'][_0x69e8('0x1a')]);return _0x77e799(_0x67151[_0x69e8('0x18')]['message']);}logger[_0x69e8('0x18')](_0x69e8('0x13'),_0x21096d,_0x67151[_0x69e8('0x18')]['message']);return _0x21061c(_0x67151[_0x69e8('0x18')][_0x69e8('0x1a')]);}else{logger[_0x69e8('0x12')](_0x69e8('0x13'),_0x21096d,'request\x20sent');_0x21061c(_0x67151['result']['message']);}})[_0x69e8('0x1b')](function(_0x586ba4){logger[_0x69e8('0x18')](_0x69e8('0x13'),_0x21096d,_0x586ba4);_0x77e799(_0x586ba4);});});}exports[_0x69e8('0x1c')]=function(_0x133777){var _0x3e672d=this;return new Promise(function(_0x3bb5ee,_0x253519){return db[_0x69e8('0x1d')]['create'](_0x133777[_0x69e8('0x1e')],{'raw':_0x133777[_0x69e8('0x1f')]?_0x133777[_0x69e8('0x1f')][_0x69e8('0x20')]===undefined?!![]:![]:!![]})[_0x69e8('0x21')](function(_0x457ae0){logger['info'](_0x69e8('0x1c'),_0x133777);logger[_0x69e8('0x15')](_0x69e8('0x1c'),_0x133777,JSON[_0x69e8('0x17')](_0x457ae0));_0x3bb5ee(_0x457ae0);})[_0x69e8('0x1b')](function(_0x58261e){logger[_0x69e8('0x18')]('CreateChatMessage',_0x58261e['message'],_0x133777);_0x253519(_0x3e672d[_0x69e8('0x18')](0x1f4,_0x58261e['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index ad46d7c..675eae3 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 _0x1623=['removeListener','length','chatMessage:','./chatMessage.events','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0x15551d,_0x51ef90){_0x15551d=_0x15551d-0x0;var _0x38a2cf=_0x1623[_0x15551d];return _0x38a2cf;};'use strict';var ChatMessageEvents=require(_0x3162('0x0'));var events=['save','remove',_0x3162('0x1')];function createListener(_0x27ee21,_0x36ccc3){return function(_0x2cc4d7){_0x36ccc3[_0x3162('0x2')](_0x27ee21,_0x2cc4d7);};}function removeListener(_0x4ce2bd,_0x5d49d0){return function(){ChatMessageEvents[_0x3162('0x3')](_0x4ce2bd,_0x5d49d0);};}exports['register']=function(_0x1b55f2){for(var _0x428de6=0x0,_0x53260d=events[_0x3162('0x4')];_0x428de6<_0x53260d;_0x428de6++){var _0x2dc07e=events[_0x428de6];var _0x26ee32=createListener(_0x3162('0x5')+_0x2dc07e,_0x1b55f2);ChatMessageEvents['on'](_0x2dc07e,_0x26ee32);}};
\ No newline at end of file
+var _0x4991=['length','chatMessage:','./chatMessage.events','remove','emit','removeListener','register'];(function(_0x13d6fe,_0x11956f){var _0x320fe6=function(_0x2063e7){while(--_0x2063e7){_0x13d6fe['push'](_0x13d6fe['shift']());}};_0x320fe6(++_0x11956f);}(_0x4991,0xf7));var _0x1499=function(_0x1e2a4c,_0x482ae7){_0x1e2a4c=_0x1e2a4c-0x0;var _0x38c9c8=_0x4991[_0x1e2a4c];return _0x38c9c8;};'use strict';var ChatMessageEvents=require(_0x1499('0x0'));var events=['save',_0x1499('0x1'),'update'];function createListener(_0x30d640,_0x256e41){return function(_0x16ac22){_0x256e41[_0x1499('0x2')](_0x30d640,_0x16ac22);};}function removeListener(_0x1b291f,_0x158134){return function(){ChatMessageEvents[_0x1499('0x3')](_0x1b291f,_0x158134);};}exports[_0x1499('0x4')]=function(_0x4b6154){for(var _0x2a8e96=0x0,_0x1c3bd7=events[_0x1499('0x5')];_0x2a8e96<_0x1c3bd7;_0x2a8e96++){var _0x33b261=events[_0x2a8e96];var _0x133bae=createListener(_0x1499('0x6')+_0x33b261,_0x4b6154);ChatMessageEvents['on'](_0x33b261,_0x133bae);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 973aa02..c0f0bb2 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 _0x168c=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','delete'];(function(_0x5a852d,_0x77e846){var _0x191725=function(_0x3e87a0){while(--_0x3e87a0){_0x5a852d['push'](_0x5a852d['shift']());}};_0x191725(++_0x77e846);}(_0x168c,0x93));var _0xc168=function(_0x39a663,_0x23a6b5){_0x39a663=_0x39a663-0x0;var _0x3ff948=_0x168c[_0x39a663];return _0x3ff948;};'use strict';var multer=require(_0xc168('0x0'));var util=require(_0xc168('0x1'));var path=require(_0xc168('0x2'));var timeout=require(_0xc168('0x3'));var express=require(_0xc168('0x4'));var router=express[_0xc168('0x5')]();var auth=require(_0xc168('0x6'));var interaction=require(_0xc168('0x7'));var config=require(_0xc168('0x8'));var controller=require(_0xc168('0x9'));router['get']('/',auth[_0xc168('0xa')](),controller[_0xc168('0xb')]);router[_0xc168('0xc')](_0xc168('0xd'),auth[_0xc168('0xa')](),controller[_0xc168('0xe')]);router['get'](_0xc168('0xf'),auth['isAuthenticated'](),controller[_0xc168('0x10')]);router[_0xc168('0x11')]('/',auth[_0xc168('0xa')](),interaction[_0xc168('0x12')](_0xc168('0x13'),_0xc168('0x14')),controller[_0xc168('0x15')]);router['put']('/:id',controller[_0xc168('0x16')]);router[_0xc168('0x17')](_0xc168('0x18'),auth[_0xc168('0xa')](),controller[_0xc168('0x19')]);router[_0xc168('0x17')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0xc168('0x1a')](_0xc168('0xf'),auth[_0xc168('0xa')](),controller[_0xc168('0x1b')]);module[_0xc168('0x1c')]=router;
\ No newline at end of file
+var _0x410e=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy'];(function(_0x302320,_0x1e21f2){var _0x47ac0b=function(_0x4565cc){while(--_0x4565cc){_0x302320['push'](_0x302320['shift']());}};_0x47ac0b(++_0x1e21f2);}(_0x410e,0x68));var _0xe410=function(_0x1b7c17,_0x3db643){_0x1b7c17=_0x1b7c17-0x0;var _0x155d7b=_0x410e[_0x1b7c17];return _0x155d7b;};'use strict';var multer=require('multer');var util=require(_0xe410('0x0'));var path=require('path');var timeout=require(_0xe410('0x1'));var express=require(_0xe410('0x2'));var router=express[_0xe410('0x3')]();var auth=require(_0xe410('0x4'));var interaction=require(_0xe410('0x5'));var config=require(_0xe410('0x6'));var controller=require(_0xe410('0x7'));router[_0xe410('0x8')]('/',auth['isAuthenticated'](),controller[_0xe410('0x9')]);router[_0xe410('0x8')](_0xe410('0xa'),auth[_0xe410('0xb')](),controller[_0xe410('0xc')]);router[_0xe410('0x8')](_0xe410('0xd'),auth[_0xe410('0xb')](),controller[_0xe410('0xe')]);router[_0xe410('0xf')]('/',auth[_0xe410('0xb')](),interaction[_0xe410('0x10')]('chat',_0xe410('0x11')),controller[_0xe410('0x12')]);router[_0xe410('0x13')](_0xe410('0xd'),controller[_0xe410('0x14')]);router['put'](_0xe410('0x15'),auth[_0xe410('0xb')](),controller[_0xe410('0x16')]);router[_0xe410('0x13')](_0xe410('0x17'),auth['isAuthenticated'](),controller[_0xe410('0x18')]);router['delete'](_0xe410('0xd'),auth[_0xe410('0xb')](),controller[_0xe410('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 25d9afd..2b1c776 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 _0x6bef=['medium','sequelize','exports'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x6bef,0x15d));var _0xf6be=function(_0x539428,_0x17309c){_0x539428=_0x539428-0x0;var _0x368257=_0x6bef[_0x539428];return _0x368257;};'use strict';var Sequelize=require(_0xf6be('0x0'));module[_0xf6be('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf6be('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xf50d=['medium','sequelize','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xf50d,0x190));var _0xdf50=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xf50d[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require(_0xdf50('0x0'));module[_0xdf50('0x1')]={'body':{'type':Sequelize['TEXT'](_0xdf50('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 3892259..5e00ec8 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 _0xa734=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','ChatOfflineMessage','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','key','VIRTUAL','then','includeAll','include','rows','catch','show','options','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa734,0x80));var _0x4a73=function(_0x2ed840,_0x4ca88b){_0x2ed840=_0x2ed840-0x0;var _0x1d2ea1=_0xa734[_0x2ed840];return _0x1d2ea1;};'use strict';var pdf=require(_0x4a73('0x0'));var emlformat=require(_0x4a73('0x1'));var rimraf=require(_0x4a73('0x2'));var zipdir=require(_0x4a73('0x3'));var jsonpatch=require(_0x4a73('0x4'));var rp=require(_0x4a73('0x5'));var moment=require(_0x4a73('0x6'));var BPromise=require(_0x4a73('0x7'));var Mustache=require(_0x4a73('0x8'));var util=require(_0x4a73('0x9'));var path=require(_0x4a73('0xa'));var sox=require('sox');var csv=require(_0x4a73('0xb'));var ejs=require(_0x4a73('0xc'));var fs=require('fs');var _=require(_0x4a73('0xd'));var squel=require(_0x4a73('0xe'));var crypto=require('crypto');var jsforce=require(_0x4a73('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4a73('0xb'));var querystring=require(_0x4a73('0x10'));var Papa=require(_0x4a73('0x11'));var Redis=require('ioredis');var authService=require(_0x4a73('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4a73('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a73('0x14'))(_0x4a73('0x15'));var utils=require(_0x4a73('0x16'));var config=require(_0x4a73('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x509454,_0x5e05a1){_0x5e05a1=_0x5e05a1||0xcc;return function(_0x5ce2b0){if(_0x5ce2b0){return _0x509454[_0x4a73('0x18')](_0x5e05a1);}return _0x509454[_0x4a73('0x19')](_0x5e05a1)['end']();};}function respondWithResult(_0x13f2f1,_0x54631e){_0x54631e=_0x54631e||0xc8;return function(_0xa668c3){if(_0xa668c3){return _0x13f2f1['status'](_0x54631e)[_0x4a73('0x1a')](_0xa668c3);}};}function respondWithFilteredResult(_0x263e15,_0x2546d6){return function(_0x5eedf9){if(_0x5eedf9){var _0x506b2b=_0x5eedf9[_0x4a73('0x1b')],_0x4fb44f=_0x2546d6[_0x4a73('0x1c')],_0x58782c=_0x2546d6[_0x4a73('0x1c')]+_0x2546d6[_0x4a73('0x1d')],_0x124fb6;if(_0x58782c>=_0x506b2b){_0x58782c=_0x506b2b;_0x124fb6=0xc8;}else{_0x124fb6=0xce;}_0x263e15['status'](_0x124fb6);return _0x263e15[_0x4a73('0x1e')](_0x4a73('0x1f'),_0x4fb44f+'-'+_0x58782c+'/'+_0x506b2b)[_0x4a73('0x1a')](_0x5eedf9);}return null;};}function patchUpdates(_0x1485f4){return function(_0x2e9fec){try{jsonpatch[_0x4a73('0x20')](_0x2e9fec,_0x1485f4,!![]);}catch(_0x95c119){return BPromise[_0x4a73('0x21')](_0x95c119);}return _0x2e9fec[_0x4a73('0x22')]();};}function saveUpdates(_0xc50a02,_0x429103){return function(_0x1d73a4){if(_0x1d73a4){return _0x1d73a4[_0x4a73('0x23')](_0xc50a02)['then'](function(_0x27755b){return _0x27755b;});}return null;};}function removeEntity(_0x58811f,_0x3ceec8){return function(_0x4b1826){if(_0x4b1826){return _0x4b1826[_0x4a73('0x24')]()['then'](function(){_0x58811f[_0x4a73('0x19')](0xcc)[_0x4a73('0x25')]();});}};}function handleEntityNotFound(_0x2005f5,_0x38520a){return function(_0x2c772a){if(!_0x2c772a){_0x2005f5['sendStatus'](0x194);}return _0x2c772a;};}function handleError(_0x3b800a,_0x571185){_0x571185=_0x571185||0x1f4;return function(_0x1e02b4){logger['error'](_0x1e02b4[_0x4a73('0x26')]);if(_0x1e02b4[_0x4a73('0x27')]){delete _0x1e02b4[_0x4a73('0x27')];}_0x3b800a[_0x4a73('0x19')](_0x571185)['send'](_0x1e02b4);};}exports[_0x4a73('0x28')]=function(_0xa1b7fe,_0x34f794){var _0x2efac1={},_0x23b377={},_0xe37523={'count':0x0,'rows':[]};var _0x2521ab=db[_0x4a73('0x29')][_0x4a73('0x2a')];_0x23b377['model']=_[_0x4a73('0x2b')](_0x2521ab);_0x23b377['query']=_[_0x4a73('0x2b')](_0xa1b7fe[_0x4a73('0x2c')]);_0x23b377[_0x4a73('0x2d')]=_['intersection'](_0x23b377[_0x4a73('0x2e')],_0x23b377[_0x4a73('0x2c')]);_0x2efac1[_0x4a73('0x2f')]=_[_0x4a73('0x30')](_0x23b377[_0x4a73('0x2e')],qs['fields'](_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x31')]));_0x2efac1[_0x4a73('0x2f')]=_0x2efac1['attributes'][_0x4a73('0x32')]?_0x2efac1['attributes']:_0x23b377[_0x4a73('0x2e')];if(!_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x33')](_0x4a73('0x34'))){_0x2efac1['limit']=qs[_0x4a73('0x1d')](_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x1d')]);_0x2efac1[_0x4a73('0x1c')]=qs['offset'](_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x1c')]);}_0x2efac1[_0x4a73('0x35')]=qs['sort'](_0xa1b7fe[_0x4a73('0x2c')]['sort']);_0x2efac1[_0x4a73('0x36')]=qs['filters'](_[_0x4a73('0x37')](_0xa1b7fe[_0x4a73('0x2c')],_0x23b377[_0x4a73('0x2d')]));if(_0xa1b7fe['query'][_0x4a73('0x38')]){_0x2efac1[_0x4a73('0x36')]=_[_0x4a73('0x39')](_0x2efac1['where'],{'$or':_[_0x4a73('0x3a')](_0x2521ab,function(_0x4a22de){if(_0x4a22de['type'][_0x4a73('0x3b')]!==_0x4a73('0x3c')){var _0x5874be={};_0x5874be[_0x4a22de['field']]={'$like':'%'+_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x38')]+'%'};return _0x5874be;}})});}_0x2efac1=_['merge']({},_0x2efac1,_0xa1b7fe['options']);var _0xb1a8e4={'where':_0x2efac1[_0x4a73('0x36')]};return db[_0x4a73('0x29')]['count'](_0xb1a8e4)[_0x4a73('0x3d')](function(_0x4d970f){_0xe37523[_0x4a73('0x1b')]=_0x4d970f;if(_0xa1b7fe[_0x4a73('0x2c')][_0x4a73('0x3e')]){_0x2efac1[_0x4a73('0x3f')]=[{'all':!![]}];}return db[_0x4a73('0x29')]['findAll'](_0x2efac1);})[_0x4a73('0x3d')](function(_0x48b13b){_0xe37523[_0x4a73('0x40')]=_0x48b13b;return _0xe37523;})['then'](respondWithFilteredResult(_0x34f794,_0x2efac1))[_0x4a73('0x41')](handleError(_0x34f794,null));};exports[_0x4a73('0x42')]=function(_0x1728b0,_0xacdb6b){var _0xce870c={'raw':!![],'where':{'id':_0x1728b0['params']['id']}},_0x44eff2={};_0x44eff2[_0x4a73('0x2e')]=_[_0x4a73('0x2b')](db[_0x4a73('0x29')][_0x4a73('0x2a')]);_0x44eff2[_0x4a73('0x2c')]=_[_0x4a73('0x2b')](_0x1728b0[_0x4a73('0x2c')]);_0x44eff2[_0x4a73('0x2d')]=_[_0x4a73('0x30')](_0x44eff2[_0x4a73('0x2e')],_0x44eff2[_0x4a73('0x2c')]);_0xce870c[_0x4a73('0x2f')]=_[_0x4a73('0x30')](_0x44eff2['model'],qs[_0x4a73('0x31')](_0x1728b0['query'][_0x4a73('0x31')]));_0xce870c[_0x4a73('0x2f')]=_0xce870c[_0x4a73('0x2f')][_0x4a73('0x32')]?_0xce870c[_0x4a73('0x2f')]:_0x44eff2[_0x4a73('0x2e')];if(_0x1728b0['query'][_0x4a73('0x3e')]){_0xce870c[_0x4a73('0x3f')]=[{'all':!![]}];}_0xce870c=_[_0x4a73('0x39')]({},_0xce870c,_0x1728b0[_0x4a73('0x43')]);return db[_0x4a73('0x29')]['find'](_0xce870c)[_0x4a73('0x3d')](handleEntityNotFound(_0xacdb6b,null))[_0x4a73('0x3d')](respondWithResult(_0xacdb6b,null))[_0x4a73('0x41')](handleError(_0xacdb6b,null));};exports[_0x4a73('0x44')]=function(_0x5ed8ce,_0xb1e683){return db['ChatOfflineMessage'][_0x4a73('0x44')](_0x5ed8ce[_0x4a73('0x45')],{})[_0x4a73('0x3d')](respondWithResult(_0xb1e683,0xc9))[_0x4a73('0x41')](handleError(_0xb1e683,null));};exports[_0x4a73('0x23')]=function(_0x159dd1,_0x1c9b65){if(_0x159dd1[_0x4a73('0x45')]['id']){delete _0x159dd1[_0x4a73('0x45')]['id'];}return db[_0x4a73('0x29')][_0x4a73('0x46')]({'where':{'id':_0x159dd1[_0x4a73('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c9b65,null))['then'](saveUpdates(_0x159dd1[_0x4a73('0x45')],null))[_0x4a73('0x3d')](respondWithResult(_0x1c9b65,null))[_0x4a73('0x41')](handleError(_0x1c9b65,null));};exports['destroy']=function(_0xe0fac6,_0x36c4a6){return db['ChatOfflineMessage'][_0x4a73('0x46')]({'where':{'id':_0xe0fac6['params']['id']}})['then'](handleEntityNotFound(_0x36c4a6,null))[_0x4a73('0x3d')](removeEntity(_0x36c4a6,null))['catch'](handleError(_0x36c4a6,null));};exports[_0x4a73('0x48')]=function(_0x299658,_0x144e2a){return db[_0x4a73('0x29')][_0x4a73('0x48')]()[_0x4a73('0x3d')](respondWithResult(_0x144e2a,null))[_0x4a73('0x41')](handleError(_0x144e2a,null));};
\ No newline at end of file
+var _0xb3e5=['api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','describe','rimraf','zip-dir','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x24cc59,_0x470f5f){var _0x1d621f=function(_0x4895be){while(--_0x4895be){_0x24cc59['push'](_0x24cc59['shift']());}};_0x1d621f(++_0x470f5f);}(_0xb3e5,0x1df));var _0x5b3e=function(_0x7d854f,_0x133df5){_0x7d854f=_0x7d854f-0x0;var _0x39a9da=_0xb3e5[_0x7d854f];return _0x39a9da;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5b3e('0x0'));var zipdir=require(_0x5b3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b3e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5b3e('0x3'));var util=require(_0x5b3e('0x4'));var path=require('path');var sox=require(_0x5b3e('0x5'));var csv=require(_0x5b3e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5b3e('0x7'));var squel=require(_0x5b3e('0x8'));var crypto=require(_0x5b3e('0x9'));var jsforce=require(_0x5b3e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5b3e('0x6'));var querystring=require(_0x5b3e('0xb'));var Papa=require(_0x5b3e('0xc'));var Redis=require(_0x5b3e('0xd'));var authService=require(_0x5b3e('0xe'));var qs=require(_0x5b3e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b3e('0x10'));var logger=require(_0x5b3e('0x11'))(_0x5b3e('0x12'));var utils=require(_0x5b3e('0x13'));var config=require('../../config/environment');var db=require(_0x5b3e('0x14'))['db'];function respondWithStatusCode(_0x5a42da,_0x541666){_0x541666=_0x541666||0xcc;return function(_0x27bee7){if(_0x27bee7){return _0x5a42da[_0x5b3e('0x15')](_0x541666);}return _0x5a42da[_0x5b3e('0x16')](_0x541666)[_0x5b3e('0x17')]();};}function respondWithResult(_0x11d667,_0x145428){_0x145428=_0x145428||0xc8;return function(_0xe21ba8){if(_0xe21ba8){return _0x11d667[_0x5b3e('0x16')](_0x145428)[_0x5b3e('0x18')](_0xe21ba8);}};}function respondWithFilteredResult(_0x35814f,_0x4dc888){return function(_0x1308ef){if(_0x1308ef){var _0x2db2f2=_0x1308ef[_0x5b3e('0x19')],_0x3d6a9c=_0x4dc888[_0x5b3e('0x1a')],_0x1285db=_0x4dc888[_0x5b3e('0x1a')]+_0x4dc888[_0x5b3e('0x1b')],_0x1d5f84;if(_0x1285db>=_0x2db2f2){_0x1285db=_0x2db2f2;_0x1d5f84=0xc8;}else{_0x1d5f84=0xce;}_0x35814f[_0x5b3e('0x16')](_0x1d5f84);return _0x35814f['set'](_0x5b3e('0x1c'),_0x3d6a9c+'-'+_0x1285db+'/'+_0x2db2f2)[_0x5b3e('0x18')](_0x1308ef);}return null;};}function patchUpdates(_0xb546a0){return function(_0x3d78bd){try{jsonpatch[_0x5b3e('0x1d')](_0x3d78bd,_0xb546a0,!![]);}catch(_0x47ee60){return BPromise[_0x5b3e('0x1e')](_0x47ee60);}return _0x3d78bd[_0x5b3e('0x1f')]();};}function saveUpdates(_0x4e9536,_0x38fd63){return function(_0x432fc1){if(_0x432fc1){return _0x432fc1[_0x5b3e('0x20')](_0x4e9536)[_0x5b3e('0x21')](function(_0x40d97f){return _0x40d97f;});}return null;};}function removeEntity(_0x52a67a,_0xe15139){return function(_0x35bd90){if(_0x35bd90){return _0x35bd90[_0x5b3e('0x22')]()[_0x5b3e('0x21')](function(){_0x52a67a[_0x5b3e('0x16')](0xcc)[_0x5b3e('0x17')]();});}};}function handleEntityNotFound(_0x21244c,_0x20a2ae){return function(_0x557032){if(!_0x557032){_0x21244c['sendStatus'](0x194);}return _0x557032;};}function handleError(_0x49511c,_0x50c2c){_0x50c2c=_0x50c2c||0x1f4;return function(_0x5f5412){logger[_0x5b3e('0x23')](_0x5f5412[_0x5b3e('0x24')]);if(_0x5f5412[_0x5b3e('0x25')]){delete _0x5f5412['name'];}_0x49511c['status'](_0x50c2c)[_0x5b3e('0x26')](_0x5f5412);};}exports[_0x5b3e('0x27')]=function(_0x18f617,_0x3f2557){var _0x53dd52={},_0xe06574={},_0x51db44={'count':0x0,'rows':[]};var _0x5e385d=db[_0x5b3e('0x28')][_0x5b3e('0x29')];_0xe06574['model']=_[_0x5b3e('0x2a')](_0x5e385d);_0xe06574[_0x5b3e('0x2b')]=_[_0x5b3e('0x2a')](_0x18f617[_0x5b3e('0x2b')]);_0xe06574[_0x5b3e('0x2c')]=_[_0x5b3e('0x2d')](_0xe06574['model'],_0xe06574[_0x5b3e('0x2b')]);_0x53dd52[_0x5b3e('0x2e')]=_[_0x5b3e('0x2d')](_0xe06574[_0x5b3e('0x2f')],qs['fields'](_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x30')]));_0x53dd52[_0x5b3e('0x2e')]=_0x53dd52[_0x5b3e('0x2e')]['length']?_0x53dd52[_0x5b3e('0x2e')]:_0xe06574[_0x5b3e('0x2f')];if(!_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x31')](_0x5b3e('0x32'))){_0x53dd52[_0x5b3e('0x1b')]=qs[_0x5b3e('0x1b')](_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x1b')]);_0x53dd52[_0x5b3e('0x1a')]=qs['offset'](_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x1a')]);}_0x53dd52[_0x5b3e('0x33')]=qs['sort'](_0x18f617[_0x5b3e('0x2b')]['sort']);_0x53dd52[_0x5b3e('0x34')]=qs[_0x5b3e('0x2c')](_[_0x5b3e('0x35')](_0x18f617['query'],_0xe06574[_0x5b3e('0x2c')]));if(_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x36')]){_0x53dd52[_0x5b3e('0x34')]=_[_0x5b3e('0x37')](_0x53dd52[_0x5b3e('0x34')],{'$or':_[_0x5b3e('0x38')](_0x5e385d,function(_0x5ac74a){if(_0x5ac74a[_0x5b3e('0x39')][_0x5b3e('0x3a')]!==_0x5b3e('0x3b')){var _0x270512={};_0x270512[_0x5ac74a['field']]={'$like':'%'+_0x18f617['query'][_0x5b3e('0x36')]+'%'};return _0x270512;}})});}_0x53dd52=_[_0x5b3e('0x37')]({},_0x53dd52,_0x18f617[_0x5b3e('0x3c')]);var _0x290ff2={'where':_0x53dd52[_0x5b3e('0x34')]};return db[_0x5b3e('0x28')]['count'](_0x290ff2)[_0x5b3e('0x21')](function(_0x1a1eb0){_0x51db44[_0x5b3e('0x19')]=_0x1a1eb0;if(_0x18f617[_0x5b3e('0x2b')][_0x5b3e('0x3d')]){_0x53dd52[_0x5b3e('0x3e')]=[{'all':!![]}];}return db[_0x5b3e('0x28')]['findAll'](_0x53dd52);})[_0x5b3e('0x21')](function(_0x4f9cc0){_0x51db44[_0x5b3e('0x3f')]=_0x4f9cc0;return _0x51db44;})[_0x5b3e('0x21')](respondWithFilteredResult(_0x3f2557,_0x53dd52))[_0x5b3e('0x40')](handleError(_0x3f2557,null));};exports['show']=function(_0x53d632,_0xfacc8a){var _0xe2231c={'raw':!![],'where':{'id':_0x53d632[_0x5b3e('0x41')]['id']}},_0x27c417={};_0x27c417[_0x5b3e('0x2f')]=_['keys'](db[_0x5b3e('0x28')][_0x5b3e('0x29')]);_0x27c417[_0x5b3e('0x2b')]=_[_0x5b3e('0x2a')](_0x53d632[_0x5b3e('0x2b')]);_0x27c417[_0x5b3e('0x2c')]=_[_0x5b3e('0x2d')](_0x27c417['model'],_0x27c417[_0x5b3e('0x2b')]);_0xe2231c['attributes']=_[_0x5b3e('0x2d')](_0x27c417['model'],qs['fields'](_0x53d632[_0x5b3e('0x2b')][_0x5b3e('0x30')]));_0xe2231c[_0x5b3e('0x2e')]=_0xe2231c['attributes'][_0x5b3e('0x42')]?_0xe2231c[_0x5b3e('0x2e')]:_0x27c417['model'];if(_0x53d632[_0x5b3e('0x2b')][_0x5b3e('0x3d')]){_0xe2231c[_0x5b3e('0x3e')]=[{'all':!![]}];}_0xe2231c=_[_0x5b3e('0x37')]({},_0xe2231c,_0x53d632[_0x5b3e('0x3c')]);return db[_0x5b3e('0x28')][_0x5b3e('0x43')](_0xe2231c)[_0x5b3e('0x21')](handleEntityNotFound(_0xfacc8a,null))['then'](respondWithResult(_0xfacc8a,null))[_0x5b3e('0x40')](handleError(_0xfacc8a,null));};exports['create']=function(_0x3bd7c7,_0x40a0ff){return db['ChatOfflineMessage'][_0x5b3e('0x44')](_0x3bd7c7[_0x5b3e('0x45')],{})['then'](respondWithResult(_0x40a0ff,0xc9))[_0x5b3e('0x40')](handleError(_0x40a0ff,null));};exports['update']=function(_0x458543,_0x21a5d0){if(_0x458543[_0x5b3e('0x45')]['id']){delete _0x458543[_0x5b3e('0x45')]['id'];}return db[_0x5b3e('0x28')][_0x5b3e('0x43')]({'where':{'id':_0x458543[_0x5b3e('0x41')]['id']}})[_0x5b3e('0x21')](handleEntityNotFound(_0x21a5d0,null))[_0x5b3e('0x21')](saveUpdates(_0x458543[_0x5b3e('0x45')],null))[_0x5b3e('0x21')](respondWithResult(_0x21a5d0,null))[_0x5b3e('0x40')](handleError(_0x21a5d0,null));};exports[_0x5b3e('0x22')]=function(_0x2a00ca,_0x597aee){return db[_0x5b3e('0x28')][_0x5b3e('0x43')]({'where':{'id':_0x2a00ca[_0x5b3e('0x41')]['id']}})[_0x5b3e('0x21')](handleEntityNotFound(_0x597aee,null))[_0x5b3e('0x21')](removeEntity(_0x597aee,null))[_0x5b3e('0x40')](handleError(_0x597aee,null));};exports[_0x5b3e('0x46')]=function(_0x43ca79,_0xe7a223){return db[_0x5b3e('0x28')][_0x5b3e('0x46')]()[_0x5b3e('0x21')](respondWithResult(_0xe7a223,null))[_0x5b3e('0x40')](handleError(_0xe7a223,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 7369918..4590653 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 _0x9c44=['chat_offline_messages','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x2e84f3,_0x4140a2){var _0x4c1a38=function(_0x57978d){while(--_0x57978d){_0x2e84f3['push'](_0x2e84f3['shift']());}};_0x4c1a38(++_0x4140a2);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x49c4('0xa')});};
\ No newline at end of file
+var _0xc368=['./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x549fb4,_0x57140c){var _0xc64c37=function(_0x40e702){while(--_0x40e702){_0x549fb4['push'](_0x549fb4['shift']());}};_0xc64c37(++_0x57140c);}(_0xc368,0x7b));var _0x8c36=function(_0xa885d6,_0x19c713){_0xa885d6=_0xa885d6-0x0;var _0x2d0187=_0xc368[_0xa885d6];return _0x2d0187;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var moment=require(_0x8c36('0x2'));var BPromise=require(_0x8c36('0x3'));var rp=require(_0x8c36('0x4'));var fs=require('fs');var path=require(_0x8c36('0x5'));var rimraf=require('rimraf');var config=require(_0x8c36('0x6'));var attributes=require(_0x8c36('0x7'));module[_0x8c36('0x8')]=function(_0x1d3660,_0x5ebfc1){return _0x1d3660['define'](_0x8c36('0x9'),attributes,{'tableName':_0x8c36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c36('0xb'),'collate':_0x8c36('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index df4b55d..2fbf2c7 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 _0x349e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x349e,0x157));var _0xe349=function(_0x13fc13,_0x4e895f){_0x13fc13=_0x13fc13-0x0;var _0x18bfaa=_0x349e[_0x13fc13];return _0x18bfaa;};'use strict';var _=require(_0xe349('0x0'));var util=require('util');var moment=require(_0xe349('0x1'));var BPromise=require(_0xe349('0x2'));var rs=require(_0xe349('0x3'));var fs=require('fs');var Redis=require(_0xe349('0x4'));var db=require(_0xe349('0x5'))['db'];var utils=require(_0xe349('0x6'));var logger=require(_0xe349('0x7'))(_0xe349('0x8'));var config=require(_0xe349('0x9'));var jayson=require(_0xe349('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a69f9,_0x48427a,_0x51ceab){return new BPromise(function(_0x1e43f5,_0x4f1cfe){return client[_0xe349('0xb')](_0x1a69f9,_0x51ceab)[_0xe349('0xc')](function(_0x2058c6){logger[_0xe349('0xd')](_0xe349('0xe'),_0x48427a,'request\x20sent');logger[_0xe349('0xf')](_0xe349('0x10'),_0x48427a,_0xe349('0x11'),JSON[_0xe349('0x12')](_0x2058c6));if(_0x2058c6[_0xe349('0x13')]){if(_0x2058c6[_0xe349('0x13')]['code']===0x1f4){logger[_0xe349('0x13')](_0xe349('0xe'),_0x48427a,_0x2058c6['error']['message']);return _0x4f1cfe(_0x2058c6[_0xe349('0x13')]['message']);}logger[_0xe349('0x13')](_0xe349('0xe'),_0x48427a,_0x2058c6[_0xe349('0x13')][_0xe349('0x14')]);return _0x1e43f5(_0x2058c6[_0xe349('0x13')]['message']);}else{logger[_0xe349('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48427a,_0xe349('0x11'));_0x1e43f5(_0x2058c6[_0xe349('0x15')]['message']);}})[_0xe349('0x16')](function(_0x152722){logger[_0xe349('0x13')](_0xe349('0xe'),_0x48427a,_0x152722);_0x4f1cfe(_0x152722);});});}
\ No newline at end of file
+var _0xe2e9=['code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xe2e9,0xad));var _0x9e2e=function(_0x491544,_0x5874f1){_0x491544=_0x491544-0x0;var _0x33cbdb=_0xe2e9[_0x491544];return _0x33cbdb;};'use strict';var _=require('lodash');var util=require(_0x9e2e('0x0'));var moment=require(_0x9e2e('0x1'));var BPromise=require(_0x9e2e('0x2'));var rs=require(_0x9e2e('0x3'));var fs=require('fs');var Redis=require(_0x9e2e('0x4'));var db=require(_0x9e2e('0x5'))['db'];var utils=require(_0x9e2e('0x6'));var logger=require(_0x9e2e('0x7'))(_0x9e2e('0x8'));var config=require('../../config/environment');var jayson=require(_0x9e2e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1a65,_0x2114cc,_0x1d0c6d){return new BPromise(function(_0x21f9c4,_0x40ad5b){return client[_0x9e2e('0xa')](_0x4d1a65,_0x1d0c6d)['then'](function(_0x4883ee){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x2114cc,_0x9e2e('0xb'));logger[_0x9e2e('0xc')](_0x9e2e('0xd'),_0x2114cc,'request\x20sent',JSON[_0x9e2e('0xe')](_0x4883ee));if(_0x4883ee[_0x9e2e('0xf')]){if(_0x4883ee[_0x9e2e('0xf')][_0x9e2e('0x10')]===0x1f4){logger['error'](_0x9e2e('0x11'),_0x2114cc,_0x4883ee[_0x9e2e('0xf')][_0x9e2e('0x12')]);return _0x40ad5b(_0x4883ee[_0x9e2e('0xf')][_0x9e2e('0x12')]);}logger[_0x9e2e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2114cc,_0x4883ee[_0x9e2e('0xf')]['message']);return _0x21f9c4(_0x4883ee['error'][_0x9e2e('0x12')]);}else{logger[_0x9e2e('0x13')](_0x9e2e('0x11'),_0x2114cc,_0x9e2e('0xb'));_0x21f9c4(_0x4883ee[_0x9e2e('0x14')]['message']);}})['catch'](function(_0x2b55f0){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x2114cc,_0x2b55f0);_0x40ad5b(_0x2b55f0);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 1361048..b85698f 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 _0x74e6=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5bc281,_0x65466d){var _0x25e43a=function(_0x12990e){while(--_0x12990e){_0x5bc281['push'](_0x5bc281['shift']());}};_0x25e43a(++_0x65466d);}(_0x74e6,0x1e7));var _0x674e=function(_0x49aeea,_0x88a64b){_0x49aeea=_0x49aeea-0x0;var _0x143cb6=_0x74e6[_0x49aeea];return _0x143cb6;};'use strict';var multer=require(_0x674e('0x0'));var util=require(_0x674e('0x1'));var path=require('path');var timeout=require(_0x674e('0x2'));var express=require(_0x674e('0x3'));var router=express[_0x674e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x674e('0x5'));var config=require(_0x674e('0x6'));var controller=require(_0x674e('0x7'));router[_0x674e('0x8')]('/',auth[_0x674e('0x9')](),controller[_0x674e('0xa')]);router[_0x674e('0x8')](_0x674e('0xb'),auth['isAuthenticated'](),controller[_0x674e('0xc')]);router[_0x674e('0x8')](_0x674e('0xd'),auth[_0x674e('0x9')](),controller['show']);router[_0x674e('0xe')]('/',auth[_0x674e('0x9')](),controller[_0x674e('0xf')]);router[_0x674e('0x10')](_0x674e('0xd'),auth[_0x674e('0x9')](),controller['update']);router['delete']('/:id',auth[_0x674e('0x9')](),controller[_0x674e('0x11')]);module[_0x674e('0x12')]=router;
\ No newline at end of file
+var _0x5afb=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0x5afb,0xcd));var _0xb5af=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x5afb[_0x5cd51d];return _0x444608;};'use strict';var multer=require(_0xb5af('0x0'));var util=require(_0xb5af('0x1'));var path=require(_0xb5af('0x2'));var timeout=require(_0xb5af('0x3'));var express=require('express');var router=express[_0xb5af('0x4')]();var auth=require(_0xb5af('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xb5af('0x6')]('/',auth[_0xb5af('0x7')](),controller[_0xb5af('0x8')]);router[_0xb5af('0x6')](_0xb5af('0x9'),auth[_0xb5af('0x7')](),controller[_0xb5af('0xa')]);router[_0xb5af('0x6')](_0xb5af('0xb'),auth[_0xb5af('0x7')](),controller[_0xb5af('0xc')]);router[_0xb5af('0xd')]('/',auth[_0xb5af('0x7')](),controller['create']);router['put'](_0xb5af('0xb'),auth[_0xb5af('0x7')](),controller[_0xb5af('0xe')]);router[_0xb5af('0xf')](_0xb5af('0xb'),auth[_0xb5af('0x7')](),controller['destroy']);module[_0xb5af('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 6244940..6a55a19 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 _0x1b8b=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x49fcfb,_0x504dec){var _0x964926=function(_0x327977){while(--_0x327977){_0x49fcfb['push'](_0x49fcfb['shift']());}};_0x964926(++_0x504dec);}(_0x1b8b,0xc3));var _0xb1b8=function(_0x4929f8,_0xc8f56a){_0x4929f8=_0x4929f8-0x0;var _0x354230=_0x1b8b[_0x4929f8];return _0x354230;};'use strict';var Sequelize=require(_0xb1b8('0x0'));module[_0xb1b8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb1b8('0x2')](_0xb1b8('0x3'),_0xb1b8('0x4')),'defaultValue':_0xb1b8('0x3')},'selector':{'type':Sequelize[_0xb1b8('0x5')]},'timeout':{'type':Sequelize[_0xb1b8('0x6')]}};
\ No newline at end of file
+var _0x39d3=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x39d3,0xaf));var _0x339d=function(_0x57dcc3,_0x346edb){_0x57dcc3=_0x57dcc3-0x0;var _0x4e0061=_0x39d3[_0x57dcc3];return _0x4e0061;};'use strict';var Sequelize=require(_0x339d('0x0'));module[_0x339d('0x1')]={'name':{'type':Sequelize[_0x339d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x339d('0x3')]('mouseOver','timeout'),'defaultValue':_0x339d('0x4')},'selector':{'type':Sequelize[_0x339d('0x2')]},'timeout':{'type':Sequelize[_0x339d('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 36041bb..c2f37ca 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 _0xbea5=['attributes','fields','includeAll','merge','options','ChatProactiveAction','catch','create','body','find','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','show','params','keys','query','filters','intersection','model'];(function(_0x1f5303,_0x354414){var _0x84ef1a=function(_0x27e275){while(--_0x27e275){_0x1f5303['push'](_0x1f5303['shift']());}};_0x84ef1a(++_0x354414);}(_0xbea5,0x177));var _0x5bea=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xbea5[_0x296897];return _0x2b44ab;};'use strict';var pdf=require(_0x5bea('0x0'));var emlformat=require(_0x5bea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5bea('0x2'));var jsonpatch=require(_0x5bea('0x3'));var rp=require(_0x5bea('0x4'));var moment=require(_0x5bea('0x5'));var BPromise=require(_0x5bea('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5bea('0x7'));var sox=require('sox');var csv=require(_0x5bea('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5bea('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5bea('0xa'));var toCsv=require(_0x5bea('0x8'));var querystring=require(_0x5bea('0xb'));var Papa=require('papaparse');var Redis=require(_0x5bea('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5bea('0xd'));var hardwareService=require(_0x5bea('0xe'));var logger=require(_0x5bea('0xf'))(_0x5bea('0x10'));var utils=require(_0x5bea('0x11'));var config=require(_0x5bea('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9190f9,_0x1f49a0){_0x1f49a0=_0x1f49a0||0xcc;return function(_0x5aef2d){if(_0x5aef2d){return _0x9190f9[_0x5bea('0x13')](_0x1f49a0);}return _0x9190f9[_0x5bea('0x14')](_0x1f49a0)['end']();};}function respondWithResult(_0xcf4b7e,_0x229e09){_0x229e09=_0x229e09||0xc8;return function(_0x26cfca){if(_0x26cfca){return _0xcf4b7e[_0x5bea('0x14')](_0x229e09)[_0x5bea('0x15')](_0x26cfca);}};}function respondWithFilteredResult(_0x464d29,_0x14d46c){return function(_0x5e0518){if(_0x5e0518){var _0x492190=_0x5e0518['count'],_0x1ad017=_0x14d46c[_0x5bea('0x16')],_0x1590f4=_0x14d46c[_0x5bea('0x16')]+_0x14d46c[_0x5bea('0x17')],_0x22f509;if(_0x1590f4>=_0x492190){_0x1590f4=_0x492190;_0x22f509=0xc8;}else{_0x22f509=0xce;}_0x464d29['status'](_0x22f509);return _0x464d29[_0x5bea('0x18')](_0x5bea('0x19'),_0x1ad017+'-'+_0x1590f4+'/'+_0x492190)['json'](_0x5e0518);}return null;};}function patchUpdates(_0x163bf7){return function(_0x55d6d1){try{jsonpatch[_0x5bea('0x1a')](_0x55d6d1,_0x163bf7,!![]);}catch(_0x358ad0){return BPromise[_0x5bea('0x1b')](_0x358ad0);}return _0x55d6d1['save']();};}function saveUpdates(_0x57667c,_0x4169e5){return function(_0x2bf974){if(_0x2bf974){return _0x2bf974[_0x5bea('0x1c')](_0x57667c)['then'](function(_0x1d328a){return _0x1d328a;});}return null;};}function removeEntity(_0x451eec,_0x146177){return function(_0xda92cf){if(_0xda92cf){return _0xda92cf['destroy']()[_0x5bea('0x1d')](function(){_0x451eec[_0x5bea('0x14')](0xcc)[_0x5bea('0x1e')]();});}};}function handleEntityNotFound(_0x245c81,_0x5984f8){return function(_0x406ac8){if(!_0x406ac8){_0x245c81['sendStatus'](0x194);}return _0x406ac8;};}function handleError(_0x274f19,_0x56cb86){_0x56cb86=_0x56cb86||0x1f4;return function(_0x1e4f97){logger[_0x5bea('0x1f')](_0x1e4f97[_0x5bea('0x20')]);if(_0x1e4f97[_0x5bea('0x21')]){delete _0x1e4f97['name'];}_0x274f19['status'](_0x56cb86)['send'](_0x1e4f97);};}exports[_0x5bea('0x22')]=function(_0x358cf3,_0x4d5dd5){var _0x4aa9a1={'raw':!![],'where':{'id':_0x358cf3[_0x5bea('0x23')]['id']}},_0x35059f={};_0x35059f['model']=_[_0x5bea('0x24')](db['ChatProactiveAction']['rawAttributes']);_0x35059f[_0x5bea('0x25')]=_[_0x5bea('0x24')](_0x358cf3[_0x5bea('0x25')]);_0x35059f[_0x5bea('0x26')]=_[_0x5bea('0x27')](_0x35059f[_0x5bea('0x28')],_0x35059f[_0x5bea('0x25')]);_0x4aa9a1[_0x5bea('0x29')]=_[_0x5bea('0x27')](_0x35059f['model'],qs['fields'](_0x358cf3[_0x5bea('0x25')][_0x5bea('0x2a')]));_0x4aa9a1[_0x5bea('0x29')]=_0x4aa9a1[_0x5bea('0x29')]['length']?_0x4aa9a1[_0x5bea('0x29')]:_0x35059f[_0x5bea('0x28')];if(_0x358cf3[_0x5bea('0x25')][_0x5bea('0x2b')]){_0x4aa9a1['include']=[{'all':!![]}];}_0x4aa9a1=_[_0x5bea('0x2c')]({},_0x4aa9a1,_0x358cf3[_0x5bea('0x2d')]);return db[_0x5bea('0x2e')]['find'](_0x4aa9a1)[_0x5bea('0x1d')](handleEntityNotFound(_0x4d5dd5,null))[_0x5bea('0x1d')](respondWithResult(_0x4d5dd5,null))[_0x5bea('0x2f')](handleError(_0x4d5dd5,null));};exports[_0x5bea('0x30')]=function(_0x691435,_0xe796bf){return db['ChatProactiveAction']['create'](_0x691435[_0x5bea('0x31')],{})[_0x5bea('0x1d')](respondWithResult(_0xe796bf,0xc9))['catch'](handleError(_0xe796bf,null));};exports[_0x5bea('0x1c')]=function(_0x54a831,_0x2f439c){if(_0x54a831[_0x5bea('0x31')]['id']){delete _0x54a831['body']['id'];}return db[_0x5bea('0x2e')][_0x5bea('0x32')]({'where':{'id':_0x54a831[_0x5bea('0x23')]['id']}})['then'](handleEntityNotFound(_0x2f439c,null))['then'](saveUpdates(_0x54a831[_0x5bea('0x31')],null))[_0x5bea('0x1d')](respondWithResult(_0x2f439c,null))[_0x5bea('0x2f')](handleError(_0x2f439c,null));};exports[_0x5bea('0x33')]=function(_0xa4270f,_0x4c6594){return db[_0x5bea('0x2e')]['find']({'where':{'id':_0xa4270f[_0x5bea('0x23')]['id']}})[_0x5bea('0x1d')](handleEntityNotFound(_0x4c6594,null))[_0x5bea('0x1d')](removeEntity(_0x4c6594,null))[_0x5bea('0x2f')](handleError(_0x4c6594,null));};
\ No newline at end of file
+var _0x2dc3=['stack','name','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy'];(function(_0x2812a5,_0x850394){var _0x58b102=function(_0x27ba7d){while(--_0x27ba7d){_0x2812a5['push'](_0x2812a5['shift']());}};_0x58b102(++_0x850394);}(_0x2dc3,0x127));var _0x32dc=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2dc3[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x32dc('0x0'));var rimraf=require(_0x32dc('0x1'));var zipdir=require(_0x32dc('0x2'));var jsonpatch=require(_0x32dc('0x3'));var rp=require(_0x32dc('0x4'));var moment=require(_0x32dc('0x5'));var BPromise=require(_0x32dc('0x6'));var Mustache=require(_0x32dc('0x7'));var util=require('util');var path=require('path');var sox=require(_0x32dc('0x8'));var csv=require('to-csv');var ejs=require(_0x32dc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x32dc('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x32dc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x32dc('0xc'));var Papa=require(_0x32dc('0xd'));var Redis=require(_0x32dc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x32dc('0xf'));var hardwareService=require(_0x32dc('0x10'));var logger=require(_0x32dc('0x11'))(_0x32dc('0x12'));var utils=require(_0x32dc('0x13'));var config=require(_0x32dc('0x14'));var db=require(_0x32dc('0x15'))['db'];function respondWithStatusCode(_0x5f0482,_0x36ab9f){_0x36ab9f=_0x36ab9f||0xcc;return function(_0x480027){if(_0x480027){return _0x5f0482[_0x32dc('0x16')](_0x36ab9f);}return _0x5f0482[_0x32dc('0x17')](_0x36ab9f)[_0x32dc('0x18')]();};}function respondWithResult(_0x5c54c2,_0x355d98){_0x355d98=_0x355d98||0xc8;return function(_0x10f169){if(_0x10f169){return _0x5c54c2['status'](_0x355d98)[_0x32dc('0x19')](_0x10f169);}};}function respondWithFilteredResult(_0x4bf4ca,_0x2dee08){return function(_0x5954f3){if(_0x5954f3){var _0x47fe19=_0x5954f3[_0x32dc('0x1a')],_0x497b11=_0x2dee08['offset'],_0x2e1a9d=_0x2dee08[_0x32dc('0x1b')]+_0x2dee08[_0x32dc('0x1c')],_0x328940;if(_0x2e1a9d>=_0x47fe19){_0x2e1a9d=_0x47fe19;_0x328940=0xc8;}else{_0x328940=0xce;}_0x4bf4ca[_0x32dc('0x17')](_0x328940);return _0x4bf4ca['set'](_0x32dc('0x1d'),_0x497b11+'-'+_0x2e1a9d+'/'+_0x47fe19)[_0x32dc('0x19')](_0x5954f3);}return null;};}function patchUpdates(_0x2671b1){return function(_0x1710a5){try{jsonpatch['apply'](_0x1710a5,_0x2671b1,!![]);}catch(_0x7e27ea){return BPromise[_0x32dc('0x1e')](_0x7e27ea);}return _0x1710a5[_0x32dc('0x1f')]();};}function saveUpdates(_0xc07d3b,_0x43b4a3){return function(_0x445c79){if(_0x445c79){return _0x445c79[_0x32dc('0x20')](_0xc07d3b)[_0x32dc('0x21')](function(_0x5ed1d9){return _0x5ed1d9;});}return null;};}function removeEntity(_0x227563,_0x37e2d1){return function(_0xd8dd68){if(_0xd8dd68){return _0xd8dd68[_0x32dc('0x22')]()['then'](function(){_0x227563[_0x32dc('0x17')](0xcc)[_0x32dc('0x18')]();});}};}function handleEntityNotFound(_0x36398c,_0x39182b){return function(_0x57e1e3){if(!_0x57e1e3){_0x36398c[_0x32dc('0x16')](0x194);}return _0x57e1e3;};}function handleError(_0x18fc9c,_0x11d7d0){_0x11d7d0=_0x11d7d0||0x1f4;return function(_0x5f2b99){logger['error'](_0x5f2b99[_0x32dc('0x23')]);if(_0x5f2b99['name']){delete _0x5f2b99[_0x32dc('0x24')];}_0x18fc9c['status'](_0x11d7d0)['send'](_0x5f2b99);};}exports['show']=function(_0x2664db,_0x4a1e63){var _0x6f190e={'raw':!![],'where':{'id':_0x2664db['params']['id']}},_0x26e348={};_0x26e348[_0x32dc('0x25')]=_[_0x32dc('0x26')](db[_0x32dc('0x27')][_0x32dc('0x28')]);_0x26e348[_0x32dc('0x29')]=_[_0x32dc('0x26')](_0x2664db[_0x32dc('0x29')]);_0x26e348['filters']=_[_0x32dc('0x2a')](_0x26e348[_0x32dc('0x25')],_0x26e348['query']);_0x6f190e['attributes']=_[_0x32dc('0x2a')](_0x26e348['model'],qs[_0x32dc('0x2b')](_0x2664db['query'][_0x32dc('0x2b')]));_0x6f190e[_0x32dc('0x2c')]=_0x6f190e['attributes'][_0x32dc('0x2d')]?_0x6f190e[_0x32dc('0x2c')]:_0x26e348[_0x32dc('0x25')];if(_0x2664db['query'][_0x32dc('0x2e')]){_0x6f190e[_0x32dc('0x2f')]=[{'all':!![]}];}_0x6f190e=_[_0x32dc('0x30')]({},_0x6f190e,_0x2664db[_0x32dc('0x31')]);return db[_0x32dc('0x27')][_0x32dc('0x32')](_0x6f190e)[_0x32dc('0x21')](handleEntityNotFound(_0x4a1e63,null))[_0x32dc('0x21')](respondWithResult(_0x4a1e63,null))[_0x32dc('0x33')](handleError(_0x4a1e63,null));};exports[_0x32dc('0x34')]=function(_0x4846be,_0x33a602){return db[_0x32dc('0x27')][_0x32dc('0x34')](_0x4846be[_0x32dc('0x35')],{})[_0x32dc('0x21')](respondWithResult(_0x33a602,0xc9))['catch'](handleError(_0x33a602,null));};exports[_0x32dc('0x20')]=function(_0x56a93e,_0x26c987){if(_0x56a93e['body']['id']){delete _0x56a93e[_0x32dc('0x35')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x56a93e[_0x32dc('0x36')]['id']}})[_0x32dc('0x21')](handleEntityNotFound(_0x26c987,null))[_0x32dc('0x21')](saveUpdates(_0x56a93e[_0x32dc('0x35')],null))['then'](respondWithResult(_0x26c987,null))[_0x32dc('0x33')](handleError(_0x26c987,null));};exports[_0x32dc('0x22')]=function(_0x62c2cb,_0x477004){return db['ChatProactiveAction'][_0x32dc('0x32')]({'where':{'id':_0x62c2cb[_0x32dc('0x36')]['id']}})[_0x32dc('0x21')](handleEntityNotFound(_0x477004,null))[_0x32dc('0x21')](removeEntity(_0x477004,null))[_0x32dc('0x33')](handleError(_0x477004,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 8471144..31743a4 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 _0x9bf2=['api','moment','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x1af415,_0x488cf7){var _0x442de9=function(_0xcc3d94){while(--_0xcc3d94){_0x1af415['push'](_0x1af415['shift']());}};_0x442de9(++_0x488cf7);}(_0x9bf2,0x6c));var _0x29bf=function(_0x170e91,_0x2ee5d0){_0x170e91=_0x170e91-0x0;var _0x5a4e86=_0x9bf2[_0x170e91];return _0x5a4e86;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x29bf('0x0'));var moment=require(_0x29bf('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29bf('0x2'));var config=require(_0x29bf('0x3'));var attributes=require(_0x29bf('0x4'));module[_0x29bf('0x5')]=function(_0x5055a3,_0xc9ce74){return _0x5055a3[_0x29bf('0x6')](_0x29bf('0x7'),attributes,{'tableName':_0x29bf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c2a=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','moment','bluebird'];(function(_0x1b227f,_0x127701){var _0x43f712=function(_0x1bad23){while(--_0x1bad23){_0x1b227f['push'](_0x1b227f['shift']());}};_0x43f712(++_0x127701);}(_0x4c2a,0x1c5));var _0xa4c2=function(_0x30c63d,_0x44d49a){_0x30c63d=_0x30c63d-0x0;var _0x8b3b92=_0x4c2a[_0x30c63d];return _0x8b3b92;};'use strict';var _=require('lodash');var util=require(_0xa4c2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa4c2('0x1'));var BPromise=require(_0xa4c2('0x2'));var rp=require(_0xa4c2('0x3'));var fs=require('fs');var path=require(_0xa4c2('0x4'));var rimraf=require(_0xa4c2('0x5'));var config=require(_0xa4c2('0x6'));var attributes=require(_0xa4c2('0x7'));module[_0xa4c2('0x8')]=function(_0x1dbbe0,_0x27fab5){return _0x1dbbe0[_0xa4c2('0x9')](_0xa4c2('0xa'),attributes,{'tableName':_0xa4c2('0xb'),'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 7ff6c97..8bba539 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 _0x9a0c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x52065c,_0x2449d2){var _0x5da1e=function(_0xfc6f8b){while(--_0xfc6f8b){_0x52065c['push'](_0x52065c['shift']());}};_0x5da1e(++_0x2449d2);}(_0x9a0c,0xea));var _0xc9a0=function(_0x580de6,_0x178c0e){_0x580de6=_0x580de6-0x0;var _0x5849e0=_0x9a0c[_0x580de6];return _0x5849e0;};'use strict';var _=require(_0xc9a0('0x0'));var util=require(_0xc9a0('0x1'));var moment=require(_0xc9a0('0x2'));var BPromise=require(_0xc9a0('0x3'));var rs=require(_0xc9a0('0x4'));var fs=require('fs');var Redis=require(_0xc9a0('0x5'));var db=require(_0xc9a0('0x6'))['db'];var utils=require(_0xc9a0('0x7'));var logger=require(_0xc9a0('0x8'))(_0xc9a0('0x9'));var config=require('../../config/environment');var jayson=require(_0xc9a0('0xa'));var client=jayson['client'][_0xc9a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d3c05,_0x429654,_0x15ceb4){return new BPromise(function(_0x2cac41,_0x4c3192){return client[_0xc9a0('0xc')](_0x5d3c05,_0x15ceb4)[_0xc9a0('0xd')](function(_0xa13cb6){logger['info'](_0xc9a0('0xe'),_0x429654,'request\x20sent');logger['debug'](_0xc9a0('0xf'),_0x429654,_0xc9a0('0x10'),JSON[_0xc9a0('0x11')](_0xa13cb6));if(_0xa13cb6['error']){if(_0xa13cb6[_0xc9a0('0x12')]['code']===0x1f4){logger['error'](_0xc9a0('0xe'),_0x429654,_0xa13cb6['error'][_0xc9a0('0x13')]);return _0x4c3192(_0xa13cb6[_0xc9a0('0x12')][_0xc9a0('0x13')]);}logger[_0xc9a0('0x12')](_0xc9a0('0xe'),_0x429654,_0xa13cb6['error'][_0xc9a0('0x13')]);return _0x2cac41(_0xa13cb6[_0xc9a0('0x12')][_0xc9a0('0x13')]);}else{logger[_0xc9a0('0x14')](_0xc9a0('0xe'),_0x429654,_0xc9a0('0x10'));_0x2cac41(_0xa13cb6[_0xc9a0('0x15')][_0xc9a0('0x13')]);}})[_0xc9a0('0x16')](function(_0x347370){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x429654,_0x347370);_0x4c3192(_0x347370);});});}
\ No newline at end of file
+var _0x90db=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x90db,0x1b3));var _0xb90d=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x90db[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0xb90d('0x0'));var util=require(_0xb90d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb90d('0x2'));var fs=require('fs');var Redis=require(_0xb90d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb90d('0x4'));var logger=require(_0xb90d('0x5'))('rpc');var config=require(_0xb90d('0x6'));var jayson=require(_0xb90d('0x7'));var client=jayson[_0xb90d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3482ec,_0xbbd9e8,_0x3e106e){return new BPromise(function(_0x179440,_0x139e90){return client[_0xb90d('0x9')](_0x3482ec,_0x3e106e)[_0xb90d('0xa')](function(_0x24a40f){logger[_0xb90d('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0xbbd9e8,_0xb90d('0xc'));logger[_0xb90d('0xd')](_0xb90d('0xe'),_0xbbd9e8,_0xb90d('0xc'),JSON[_0xb90d('0xf')](_0x24a40f));if(_0x24a40f[_0xb90d('0x10')]){if(_0x24a40f[_0xb90d('0x10')]['code']===0x1f4){logger[_0xb90d('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0xbbd9e8,_0x24a40f[_0xb90d('0x10')][_0xb90d('0x11')]);return _0x139e90(_0x24a40f['error'][_0xb90d('0x11')]);}logger[_0xb90d('0x10')](_0xb90d('0x12'),_0xbbd9e8,_0x24a40f['error'][_0xb90d('0x11')]);return _0x179440(_0x24a40f[_0xb90d('0x10')]['message']);}else{logger['info'](_0xb90d('0x12'),_0xbbd9e8,_0xb90d('0xc'));_0x179440(_0x24a40f[_0xb90d('0x13')]['message']);}})[_0xb90d('0x14')](function(_0x1da57a){logger[_0xb90d('0x10')](_0xb90d('0x12'),_0xbbd9e8,_0x1da57a);_0x139e90(_0x1da57a);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 8501415..a091b43 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 _0x3291=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x551d84,_0x4ab862){var _0x581062=function(_0x1e65a9){while(--_0x1e65a9){_0x551d84['push'](_0x551d84['shift']());}};_0x581062(++_0x4ab862);}(_0x3291,0x1cb));var _0x1329=function(_0x5f3c83,_0x4b3b2d){_0x5f3c83=_0x5f3c83-0x0;var _0x1a5574=_0x3291[_0x5f3c83];return _0x1a5574;};'use strict';var multer=require(_0x1329('0x0'));var util=require(_0x1329('0x1'));var path=require(_0x1329('0x2'));var timeout=require('connect-timeout');var express=require(_0x1329('0x3'));var router=express[_0x1329('0x4')]();var auth=require(_0x1329('0x5'));var interaction=require(_0x1329('0x6'));var config=require(_0x1329('0x7'));var controller=require(_0x1329('0x8'));router['get']('/:id',auth[_0x1329('0x9')](),controller[_0x1329('0xa')]);router[_0x1329('0xb')]('/',auth[_0x1329('0x9')](),controller[_0x1329('0xc')]);router[_0x1329('0xd')](_0x1329('0xe'),auth[_0x1329('0x9')](),controller[_0x1329('0xf')]);router[_0x1329('0x10')]('/:id',auth[_0x1329('0x9')](),controller[_0x1329('0x11')]);module[_0x1329('0x12')]=router;
\ No newline at end of file
+var _0xa8de=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','create','put','isAuthenticated','update','delete','multer','util'];(function(_0xb376cb,_0x364ca7){var _0x5452c1=function(_0x444e84){while(--_0x444e84){_0xb376cb['push'](_0xb376cb['shift']());}};_0x5452c1(++_0x364ca7);}(_0xa8de,0x17e));var _0xea8d=function(_0x279d97,_0x1b7180){_0x279d97=_0x279d97-0x0;var _0x12163d=_0xa8de[_0x279d97];return _0x12163d;};'use strict';var multer=require(_0xea8d('0x0'));var util=require(_0xea8d('0x1'));var path=require(_0xea8d('0x2'));var timeout=require(_0xea8d('0x3'));var express=require(_0xea8d('0x4'));var router=express[_0xea8d('0x5')]();var auth=require(_0xea8d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea8d('0x7'));var controller=require(_0xea8d('0x8'));router['get'](_0xea8d('0x9'),auth['isAuthenticated'](),controller[_0xea8d('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea8d('0xb')]);router[_0xea8d('0xc')]('/:id',auth[_0xea8d('0xd')](),controller[_0xea8d('0xe')]);router[_0xea8d('0xf')](_0xea8d('0x9'),auth[_0xea8d('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 43fcf14..53fd38a 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 _0xee81=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x20fb24,_0x4f8ed9){var _0x9c451=function(_0x10eeb6){while(--_0x10eeb6){_0x20fb24['push'](_0x20fb24['shift']());}};_0x9c451(++_0x4f8ed9);}(_0xee81,0x19c));var _0x1ee8=function(_0x2bf699,_0x5ce8b8){_0x2bf699=_0x2bf699-0x0;var _0x57aea0=_0xee81[_0x2bf699];return _0x57aea0;};'use strict';var Sequelize=require(_0x1ee8('0x0'));module[_0x1ee8('0x1')]={'name':{'type':Sequelize[_0x1ee8('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1ee8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ee8('0x4')](_0x1ee8('0x5'),'beepall',_0x1ee8('0x6'))}};
\ No newline at end of file
+var _0x14f1=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x14f1,0x18b));var _0x114f=function(_0x30988a,_0x36c871){_0x30988a=_0x30988a-0x0;var _0x5dbca2=_0x14f1[_0x30988a];return _0x5dbca2;};'use strict';var Sequelize=require(_0x114f('0x0'));module[_0x114f('0x1')]={'name':{'type':Sequelize[_0x114f('0x2')],'unique':_0x114f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x114f('0x2')]},'timeout':{'type':Sequelize[_0x114f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x114f('0x5')]('rrmemory',_0x114f('0x6'),_0x114f('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 21078dd..a8d64a9 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 _0xdc9c=['addAgents','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','save','update','destroy','ChatQueues','UserProfileResource','end','stack','name','send','rawAttributes','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','map','type','key','field','filter','ChatQueue','include','findAll','rows','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','intersection','ChatQueueId','options','UserChatQueue','UserId','updatedAt','format','%s/%s','SIP','chatPause','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','transaction','each','forEach','emit','userChatQueue:save','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeAgents','userChatQueue:remove'];(function(_0x234f7a,_0x42db6f){var _0x4fbd23=function(_0x1f2733){while(--_0x1f2733){_0x234f7a['push'](_0x234f7a['shift']());}};_0x4fbd23(++_0x42db6f);}(_0xdc9c,0x122));var _0xcdc9=function(_0x5622b1,_0xddf988){_0x5622b1=_0x5622b1-0x0;var _0x3bde7f=_0xdc9c[_0x5622b1];return _0x3bde7f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcdc9('0x0'));var rimraf=require(_0xcdc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcdc9('0x2'));var rp=require(_0xcdc9('0x3'));var moment=require('moment');var BPromise=require(_0xcdc9('0x4'));var Mustache=require(_0xcdc9('0x5'));var util=require(_0xcdc9('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcdc9('0x7'));var fs=require('fs');var _=require(_0xcdc9('0x8'));var squel=require(_0xcdc9('0x9'));var crypto=require(_0xcdc9('0xa'));var jsforce=require(_0xcdc9('0xb'));var deskjs=require(_0xcdc9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcdc9('0xd'));var Papa=require(_0xcdc9('0xe'));var Redis=require(_0xcdc9('0xf'));var authService=require(_0xcdc9('0x10'));var qs=require(_0xcdc9('0x11'));var as=require(_0xcdc9('0x12'));var hardwareService=require(_0xcdc9('0x13'));var logger=require(_0xcdc9('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcdc9('0x15'))['db'];config[_0xcdc9('0x16')]=_[_0xcdc9('0x17')](config[_0xcdc9('0x16')],{'host':_0xcdc9('0x18'),'port':0x18eb});var socket=require(_0xcdc9('0x19'))(new Redis(config['redis']));require(_0xcdc9('0x1a'))[_0xcdc9('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x331d84,_0x4d1ba4,_0x35e9af){if(_0x35e9af){var _0x2ef8b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ef8b2['test'](_0x4d1ba4)){return _0x331d84;}else{throw new Error(_0xcdc9('0x1c'));}}else{return _0x331d84;}}function respondWithRpcPromise(_0x423741,_0x40b3b6,_0x366f38,_0x210264){return new BPromise(function(_0x2bea5e,_0x2de901){var _0x4475d0=_0x210264||client;return _0x4475d0[_0xcdc9('0x1d')](_0x423741,_0x366f38)[_0xcdc9('0x1e')](function(_0xbe24e4){logger[_0xcdc9('0x1f')](_0xcdc9('0x20'),_0x40b3b6,_0xcdc9('0x21'));logger[_0xcdc9('0x22')](_0xcdc9('0x23'),_0x40b3b6,_0xcdc9('0x21'),JSON['stringify'](_0xbe24e4));if(_0xbe24e4[_0xcdc9('0x24')]){if(_0xbe24e4['error'][_0xcdc9('0x25')]===0x1f4){logger['error'](_0xcdc9('0x20'),_0x40b3b6,_0xbe24e4['error'][_0xcdc9('0x26')]);return _0x2de901(_0xbe24e4[_0xcdc9('0x24')]['message']);}logger[_0xcdc9('0x24')]('ChatQueue,\x20%s,\x20%s',_0x40b3b6,_0xbe24e4[_0xcdc9('0x24')][_0xcdc9('0x26')]);return _0x2bea5e(_0xbe24e4[_0xcdc9('0x24')][_0xcdc9('0x26')]);}else{logger['info'](_0xcdc9('0x20'),_0x40b3b6,'request\x20sent');_0x2bea5e(_0xbe24e4[_0xcdc9('0x27')]['message']);}})[_0xcdc9('0x28')](function(_0x2aa737){logger[_0xcdc9('0x24')](_0xcdc9('0x20'),_0x40b3b6,_0x2aa737);_0x2de901(_0x2aa737);});});}function respondWithStatusCode(_0xcb4789,_0x4973fe){_0x4973fe=_0x4973fe||0xcc;return function(_0xb453f9){if(_0xb453f9){return _0xcb4789[_0xcdc9('0x29')](_0x4973fe);}return _0xcb4789[_0xcdc9('0x2a')](_0x4973fe)['end']();};}function respondWithResult(_0x13d4ab,_0x6371f4){_0x6371f4=_0x6371f4||0xc8;return function(_0x110800){if(_0x110800){return _0x13d4ab['status'](_0x6371f4)['json'](_0x110800);}};}function respondWithFilteredResult(_0x35f93e,_0x4c8c2d){return function(_0xbad43f){if(_0xbad43f){var _0xe1ff8b=_0xbad43f[_0xcdc9('0x2b')],_0x487d5f=_0x4c8c2d[_0xcdc9('0x2c')],_0x13a56f=_0x4c8c2d['offset']+_0x4c8c2d['limit'],_0x169961;if(_0x13a56f>=_0xe1ff8b){_0x13a56f=_0xe1ff8b;_0x169961=0xc8;}else{_0x169961=0xce;}_0x35f93e[_0xcdc9('0x2a')](_0x169961);return _0x35f93e[_0xcdc9('0x2d')](_0xcdc9('0x2e'),_0x487d5f+'-'+_0x13a56f+'/'+_0xe1ff8b)[_0xcdc9('0x2f')](_0xbad43f);}return null;};}function patchUpdates(_0x233487){return function(_0x4fca63){try{jsonpatch[_0xcdc9('0x30')](_0x4fca63,_0x233487,!![]);}catch(_0x4a5f35){return BPromise['reject'](_0x4a5f35);}return _0x4fca63[_0xcdc9('0x31')]();};}function saveUpdates(_0x482de5,_0x104619){return function(_0x518ab6){if(_0x518ab6){return _0x518ab6[_0xcdc9('0x32')](_0x482de5)[_0xcdc9('0x1e')](function(_0x6f2939){return _0x6f2939;});}return null;};}function removeEntity(_0x4b1c4d,_0x2b9a69){return function(_0x223fcf){if(_0x223fcf){return _0x223fcf[_0xcdc9('0x33')]()[_0xcdc9('0x1e')](function(){var _0xe3dac6=_0x223fcf['get']({'plain':!![]});var _0x2238b7=_0xcdc9('0x34');return db[_0xcdc9('0x35')][_0xcdc9('0x33')]({'where':{'type':_0x2238b7,'resourceId':_0xe3dac6['id']}})['then'](function(){return _0x223fcf;});})[_0xcdc9('0x1e')](function(){_0x4b1c4d[_0xcdc9('0x2a')](0xcc)[_0xcdc9('0x36')]();});}};}function handleEntityNotFound(_0x19e959,_0x6b6b84){return function(_0x43b015){if(!_0x43b015){_0x19e959[_0xcdc9('0x29')](0x194);}return _0x43b015;};}function handleError(_0x1b1577,_0x4723d0){_0x4723d0=_0x4723d0||0x1f4;return function(_0x30558f){logger[_0xcdc9('0x24')](_0x30558f[_0xcdc9('0x37')]);if(_0x30558f[_0xcdc9('0x38')]){delete _0x30558f[_0xcdc9('0x38')];}_0x1b1577[_0xcdc9('0x2a')](_0x4723d0)[_0xcdc9('0x39')](_0x30558f);};}exports['index']=function(_0x86915a,_0x452c91){var _0xa8994d={},_0x208fec={},_0x8f083a={'count':0x0,'rows':[]};var _0x3886d5=db['ChatQueue'][_0xcdc9('0x3a')];_0x208fec[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](_0x3886d5);_0x208fec[_0xcdc9('0x3d')]=_[_0xcdc9('0x3c')](_0x86915a[_0xcdc9('0x3d')]);_0x208fec[_0xcdc9('0x3e')]=_['intersection'](_0x208fec['model'],_0x208fec[_0xcdc9('0x3d')]);_0xa8994d[_0xcdc9('0x3f')]=_['intersection'](_0x208fec[_0xcdc9('0x3b')],qs[_0xcdc9('0x40')](_0x86915a[_0xcdc9('0x3d')]['fields']));_0xa8994d[_0xcdc9('0x3f')]=_0xa8994d[_0xcdc9('0x3f')]['length']?_0xa8994d[_0xcdc9('0x3f')]:_0x208fec[_0xcdc9('0x3b')];if(!_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x41')](_0xcdc9('0x42'))){_0xa8994d[_0xcdc9('0x43')]=qs[_0xcdc9('0x43')](_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x43')]);_0xa8994d['offset']=qs[_0xcdc9('0x2c')](_0x86915a['query'][_0xcdc9('0x2c')]);}_0xa8994d[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x45')]);_0xa8994d['where']=qs[_0xcdc9('0x3e')](_[_0xcdc9('0x46')](_0x86915a['query'],_0x208fec['filters']));if(_0x86915a[_0xcdc9('0x3d')]['filter']){_0xa8994d['where']=_[_0xcdc9('0x47')](_0xa8994d[_0xcdc9('0x48')],{'$or':_[_0xcdc9('0x49')](_0x3886d5,function(_0x1250e7){if(_0x1250e7[_0xcdc9('0x4a')][_0xcdc9('0x4b')]!=='VIRTUAL'){var _0x5bb577={};_0x5bb577[_0x1250e7[_0xcdc9('0x4c')]]={'$like':'%'+_0x86915a[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0x5bb577;}})});}_0xa8994d=_['merge']({},_0xa8994d,_0x86915a['options']);var _0x37332b={'where':_0xa8994d['where']};return db[_0xcdc9('0x4e')]['count'](_0x37332b)[_0xcdc9('0x1e')](function(_0x2f11db){_0x8f083a['count']=_0x2f11db;if(_0x86915a[_0xcdc9('0x3d')]['includeAll']){_0xa8994d[_0xcdc9('0x4f')]=[{'all':!![]}];}return db[_0xcdc9('0x4e')][_0xcdc9('0x50')](_0xa8994d);})['then'](function(_0x1e4079){_0x8f083a[_0xcdc9('0x51')]=_0x1e4079;return _0x8f083a;})['then'](respondWithFilteredResult(_0x452c91,_0xa8994d))[_0xcdc9('0x28')](handleError(_0x452c91,null));};exports[_0xcdc9('0x52')]=function(_0x55a0cc,_0xce8f99){var _0x58604e={'raw':!![],'where':{'id':_0x55a0cc[_0xcdc9('0x53')]['id']}},_0x4d35b0={};_0x4d35b0['model']=_['keys'](db[_0xcdc9('0x4e')][_0xcdc9('0x3a')]);_0x4d35b0['query']=_[_0xcdc9('0x3c')](_0x55a0cc[_0xcdc9('0x3d')]);_0x4d35b0[_0xcdc9('0x3e')]=_['intersection'](_0x4d35b0[_0xcdc9('0x3b')],_0x4d35b0[_0xcdc9('0x3d')]);_0x58604e[_0xcdc9('0x3f')]=_['intersection'](_0x4d35b0[_0xcdc9('0x3b')],qs['fields'](_0x55a0cc[_0xcdc9('0x3d')][_0xcdc9('0x40')]));_0x58604e['attributes']=_0x58604e['attributes'][_0xcdc9('0x54')]?_0x58604e['attributes']:_0x4d35b0[_0xcdc9('0x3b')];if(_0x55a0cc['query']['includeAll']){_0x58604e['include']=[{'all':!![]}];}_0x58604e=_[_0xcdc9('0x47')]({},_0x58604e,_0x55a0cc['options']);return db[_0xcdc9('0x4e')]['find'](_0x58604e)[_0xcdc9('0x1e')](handleEntityNotFound(_0xce8f99,null))[_0xcdc9('0x1e')](respondWithResult(_0xce8f99,null))['catch'](handleError(_0xce8f99,null));};exports['create']=function(_0x4e6e1d,_0x24a07c){return db['ChatQueue'][_0xcdc9('0x55')](_0x4e6e1d[_0xcdc9('0x56')],{})['then'](function(_0x577323){var _0x306dd7=_0x4e6e1d[_0xcdc9('0x57')][_0xcdc9('0x58')]({'plain':!![]});if(!_0x306dd7)throw new Error(_0xcdc9('0x59'));if(_0x306dd7[_0xcdc9('0x5a')]==='user'){var _0x185b75=_0x577323['get']({'plain':!![]});var _0xbd379f=_0xcdc9('0x34');return db['UserProfileSection'][_0xcdc9('0x5b')]({'where':{'name':_0xbd379f,'userProfileId':_0x306dd7[_0xcdc9('0x5c')]},'raw':!![]})[_0xcdc9('0x1e')](function(_0x59d9d8){if(_0x59d9d8&&_0x59d9d8[_0xcdc9('0x5d')]===0x0){return db[_0xcdc9('0x35')][_0xcdc9('0x55')]({'name':_0x185b75[_0xcdc9('0x38')],'resourceId':_0x185b75['id'],'type':_0x59d9d8['name'],'sectionId':_0x59d9d8['id']},{})[_0xcdc9('0x1e')](function(){return _0x577323;});}else{return _0x577323;}})['catch'](function(_0x8dfb91){logger['error'](_0xcdc9('0x5e'),_0x8dfb91);throw _0x8dfb91;});}return _0x577323;})['then'](respondWithResult(_0x24a07c,0xc9))[_0xcdc9('0x28')](handleError(_0x24a07c,null));};exports[_0xcdc9('0x32')]=function(_0xc563ae,_0x434407){if(_0xc563ae[_0xcdc9('0x56')]['id']){delete _0xc563ae[_0xcdc9('0x56')]['id'];}return db[_0xcdc9('0x4e')][_0xcdc9('0x5b')]({'where':{'id':_0xc563ae[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x434407,null))[_0xcdc9('0x1e')](saveUpdates(_0xc563ae[_0xcdc9('0x56')],null))[_0xcdc9('0x1e')](respondWithResult(_0x434407,null))['catch'](handleError(_0x434407,null));};exports[_0xcdc9('0x33')]=function(_0x221af9,_0xa0e1eb){return db[_0xcdc9('0x4e')]['find']({'where':{'id':_0x221af9[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0xa0e1eb,null))[_0xcdc9('0x1e')](removeEntity(_0xa0e1eb,null))[_0xcdc9('0x28')](handleError(_0xa0e1eb,null));};exports[_0xcdc9('0x5f')]=function(_0x857fb0,_0x19bb62){return db['ChatQueue'][_0xcdc9('0x5f')]()[_0xcdc9('0x1e')](respondWithResult(_0x19bb62,null))[_0xcdc9('0x28')](handleError(_0x19bb62,null));};exports[_0xcdc9('0x60')]=function(_0x59c3b5,_0x581e37,_0x31d0e8){var _0xb9815b={'raw':!![],'where':{}},_0x4397b8={},_0xaac0a8;return db[_0xcdc9('0x4e')]['findOne']({'where':{'id':_0x59c3b5[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x581e37,null))[_0xcdc9('0x1e')](function(_0xeb3d0a){if(_0xeb3d0a){_0xaac0a8=_0xeb3d0a[_0xcdc9('0x58')]({'plain':!![]});_0x4397b8[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](db['UserChatQueue'][_0xcdc9('0x3a')]);_0x4397b8['query']=_['keys'](_0x59c3b5[_0xcdc9('0x3d')]);_0x4397b8['filters']=_[_0xcdc9('0x61')](_0x4397b8[_0xcdc9('0x3b')],_0x4397b8[_0xcdc9('0x3d')]);_0xb9815b[_0xcdc9('0x3f')]=_[_0xcdc9('0x61')](_0x4397b8[_0xcdc9('0x3b')],qs[_0xcdc9('0x40')](_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x40')]));_0xb9815b[_0xcdc9('0x3f')]=_0xb9815b[_0xcdc9('0x3f')][_0xcdc9('0x54')]?_0xb9815b['attributes']:_0x4397b8[_0xcdc9('0x3b')];if(!_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x41')]('nolimit')){_0xb9815b['limit']=qs[_0xcdc9('0x43')](_0x59c3b5[_0xcdc9('0x3d')]['limit']);_0xb9815b[_0xcdc9('0x2c')]=qs['offset'](_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x2c')]);}_0xb9815b[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x59c3b5['query'][_0xcdc9('0x45')]);_0xb9815b[_0xcdc9('0x48')]=qs[_0xcdc9('0x3e')](_[_0xcdc9('0x46')](_0x59c3b5[_0xcdc9('0x3d')],_0x4397b8[_0xcdc9('0x3e')]));_0xb9815b[_0xcdc9('0x48')][_0xcdc9('0x62')]=_0xeb3d0a['id'];if(_0x59c3b5[_0xcdc9('0x3d')]['filter']){_0xb9815b[_0xcdc9('0x48')]=_[_0xcdc9('0x47')](_0xb9815b['where'],{'$or':_[_0xcdc9('0x49')](_0xb9815b[_0xcdc9('0x3f')],function(_0x543ddf){var _0x16d2d8={};_0x16d2d8[_0x543ddf]={'$like':'%'+_0x59c3b5[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0x16d2d8;})});}_0xb9815b=_[_0xcdc9('0x47')]({},_0xb9815b,_0x59c3b5[_0xcdc9('0x63')]);return db[_0xcdc9('0x64')][_0xcdc9('0x50')](_0xb9815b);}})[_0xcdc9('0x1e')](function(_0x1c0ac1){if(_0x1c0ac1){return db['User']['findAndCountAll']({'where':{'id':_[_0xcdc9('0x49')](_0x1c0ac1,_0xcdc9('0x65')),'role':'agent'},'attributes':['id',_0xcdc9('0x38'),'chatPause',_0xcdc9('0x66'),'createdAt']});}})[_0xcdc9('0x1e')](function(_0x230b04){if(_0x230b04){return{'count':_0x230b04[_0xcdc9('0x2b')],'rows':_[_0xcdc9('0x49')](_0x230b04['rows'],function(_0x588c4e){return{'membername':_0x588c4e[_0xcdc9('0x38')],'UserId':_0x588c4e['id'],'queue_name':_0xaac0a8[_0xcdc9('0x38')],'ChatQueueId':_0xaac0a8['id'],'interface':util[_0xcdc9('0x67')](_0xcdc9('0x68'),_0xcdc9('0x69'),_0x588c4e[_0xcdc9('0x38')]),'penalty':0x0,'paused':_0x588c4e[_0xcdc9('0x6a')],'createdAt':_0x588c4e['createdAt'],'updatedAt':_0x588c4e[_0xcdc9('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x581e37,_0xb9815b))[_0xcdc9('0x28')](handleError(_0x581e37,null));};exports[_0xcdc9('0x6b')]=function(_0x3a9022,_0x26af92,_0x5d12e9){var _0x567871={};var _0x53ab6a={};var _0x54f658;var _0x121f30;return db[_0xcdc9('0x4e')][_0xcdc9('0x6c')]({'where':{'id':_0x3a9022[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x26af92,null))['then'](function(_0x571e3f){if(_0x571e3f){_0x54f658=_0x571e3f;_0x53ab6a[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](db[_0xcdc9('0x6d')]['rawAttributes']);_0x53ab6a[_0xcdc9('0x3d')]=_['keys'](_0x3a9022[_0xcdc9('0x3d')]);_0x53ab6a[_0xcdc9('0x3e')]=_['intersection'](_0x53ab6a[_0xcdc9('0x3b')],_0x53ab6a[_0xcdc9('0x3d')]);_0x567871['attributes']=_['intersection'](_0x53ab6a['model'],qs[_0xcdc9('0x40')](_0x3a9022['query'][_0xcdc9('0x40')]));_0x567871['attributes']=_0x567871['attributes'][_0xcdc9('0x54')]?_0x567871['attributes']:_0x53ab6a['model'];_0x567871[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x3a9022['query'][_0xcdc9('0x45')]);_0x567871[_0xcdc9('0x48')]=qs[_0xcdc9('0x3e')](_['pick'](_0x3a9022[_0xcdc9('0x3d')],_0x53ab6a[_0xcdc9('0x3e')]));if(_0x3a9022[_0xcdc9('0x3d')][_0xcdc9('0x4d')]){_0x567871[_0xcdc9('0x48')]=_[_0xcdc9('0x47')](_0x567871['where'],{'$or':_[_0xcdc9('0x49')](_0x567871[_0xcdc9('0x3f')],function(_0x30c45d){var _0x2dac20={};_0x2dac20[_0x30c45d]={'$like':'%'+_0x3a9022[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0x2dac20;})});}_0x567871=_[_0xcdc9('0x47')]({},_0x567871,_0x3a9022['options']);return _0x54f658[_0xcdc9('0x6b')](_0x567871);}})[_0xcdc9('0x1e')](function(_0x377a56){if(_0x377a56){_0x121f30=_0x377a56[_0xcdc9('0x54')];if(!_0x3a9022[_0xcdc9('0x3d')][_0xcdc9('0x41')](_0xcdc9('0x42'))){_0x567871[_0xcdc9('0x43')]=qs['limit'](_0x3a9022[_0xcdc9('0x3d')]['limit']);_0x567871[_0xcdc9('0x2c')]=qs[_0xcdc9('0x2c')](_0x3a9022['query'][_0xcdc9('0x2c')]);}return _0x54f658[_0xcdc9('0x6b')](_0x567871);}})[_0xcdc9('0x1e')](function(_0x1e1a33){if(_0x1e1a33){return _0x1e1a33?{'count':_0x121f30,'rows':_0x1e1a33}:null;}})['then'](respondWithResult(_0x26af92,null))[_0xcdc9('0x28')](handleError(_0x26af92,null));};exports[_0xcdc9('0x6e')]=function(_0x5c518f,_0x40623b,_0x1e47a9){var _0x5a7c7b=_0x5c518f[_0xcdc9('0x56')][_0xcdc9('0x6f')];return db[_0xcdc9('0x6d')][_0xcdc9('0x50')]({'where':{'id':_0x5a7c7b},'attributes':['id'],'include':[{'model':db[_0xcdc9('0x70')],'as':_0xcdc9('0x71'),'attributes':['id',_0xcdc9('0x38'),_0xcdc9('0x72'),_0xcdc9('0x73'),'interface'],'raw':!![]}]})[_0xcdc9('0x1e')](function(_0x39357e){if(_0x39357e){var _0x4893ee=_['flatMap'](_0x39357e,function(_0x3fc5d1){var _0x34c880=_0x3fc5d1[_0xcdc9('0x58')]({'plain':!![]});return _0x34c880[_0xcdc9('0x71')];});return db[_0xcdc9('0x4e')]['find']({'where':{'id':_0x5c518f['params']['id']}})[_0xcdc9('0x1e')](function(_0x287c22){return db['sequelize'][_0xcdc9('0x74')](function(_0x3e3a62){return _0x287c22[_0xcdc9('0x6e')](_0x5a7c7b,{'transaction':_0x3e3a62})[_0xcdc9('0x1e')](function(){return BPromise[_0xcdc9('0x75')](_0x4893ee,function(_0x46fb11){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x46fb11['id'],'ChatQueueId':_0x5c518f['params']['id']},'transaction':_0x3e3a62});});})[_0xcdc9('0x1e')](function(){_0x4893ee[_0xcdc9('0x76')](function(_0x975c8){socket[_0xcdc9('0x77')](_0xcdc9('0x78'),{'UserId':_0x975c8['id'],'ChatQueueId':_0x287c22['id']});});});});});}})[_0xcdc9('0x1e')](respondWithStatusCode(_0x40623b,null))[_0xcdc9('0x28')](handleError(_0x40623b,null));};exports['removeTeams']=function(_0x914631,_0x2e9d04,_0x5924e7){return db[_0xcdc9('0x6d')][_0xcdc9('0x50')]({'where':{'id':_0x914631['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xcdc9('0x70')],'as':_0xcdc9('0x71'),'attributes':['id'],'raw':!![]}]})[_0xcdc9('0x1e')](handleEntityNotFound(_0x2e9d04,null))[_0xcdc9('0x1e')](function(_0x226f3e){var _0x56af09=_[_0xcdc9('0x49')](_0x226f3e,'id');var _0x356f8f=[];var _0x3454f6=[];var _0x245849=squel[_0xcdc9('0x79')]();_0x245849[_0xcdc9('0x4c')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0xcdc9('0x7a')](_0xcdc9('0x7b'),'ut',_0xcdc9('0x7c'))[_0xcdc9('0x48')](_0xcdc9('0x7d'),_0x914631['params']['id']);for(var _0x523c64=0x0;_0x523c64<_0x226f3e[_0xcdc9('0x54')];_0x523c64+=0x1){let _0x444059=_0x226f3e[_0x523c64];for(var _0x41c08f=0x0;_0x41c08f<_0x444059['Agents']['length'];_0x41c08f+=0x1){let _0x297d41=_0x444059['Agents'][_0x41c08f];var _0x6e0434=_0x245849['clone']();_0x6e0434['where'](_0xcdc9('0x7e'),_0x297d41['id']);_0x3454f6[_0xcdc9('0x7f')](db[_0xcdc9('0x80')][_0xcdc9('0x3d')](_0x6e0434[_0xcdc9('0x81')](),{'type':db[_0xcdc9('0x80')][_0xcdc9('0x82')]['SELECT']})[_0xcdc9('0x1e')](function(_0x4b748f){if(_0x4b748f[_0xcdc9('0x54')]===0x1){return _0x297d41['id'];}else{var _0x4b2d71=_[_0xcdc9('0x83')](_[_0xcdc9('0x49')](_0x4b748f,_0xcdc9('0x84')),function(_0x2a4a76){return _[_0xcdc9('0x85')](_0x56af09,_0x2a4a76);});if(_0x4b2d71){return _0x297d41['id'];}}}));}}return BPromise[_0xcdc9('0x86')](_0x3454f6)[_0xcdc9('0x1e')](function(_0x1324d1){_0x356f8f=_(_0x356f8f)['union'](_0x1324d1)[_0xcdc9('0x87')]()[_0xcdc9('0x88')]();return db['ChatQueue']['find']({'where':{'id':_0x914631[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](function(_0x6ffaaa){return db['sequelize']['transaction'](function(_0x286fbd){return _0x6ffaaa['removeTeams'](_0x914631[_0xcdc9('0x3d')][_0xcdc9('0x6f')],{'transaction':_0x286fbd})['then'](function(){if(!_['isEmpty'](_0x356f8f)){return _0x6ffaaa[_0xcdc9('0x89')](_0x356f8f,{'transaction':_0x286fbd});}})['then'](function(){_0x356f8f[_0xcdc9('0x76')](function(_0xe9cff8){socket[_0xcdc9('0x77')](_0xcdc9('0x8a'),{'UserId':_0xe9cff8,'ChatQueueId':_0x6ffaaa['id']});});});});});});})[_0xcdc9('0x1e')](respondWithStatusCode(_0x2e9d04,null))[_0xcdc9('0x28')](handleError(_0x2e9d04,null));};exports[_0xcdc9('0x8b')]=function(_0x26d035,_0x24539d,_0x4b6c51){return db['ChatQueue'][_0xcdc9('0x5b')]({'where':{'id':_0x26d035[_0xcdc9('0x53')]['id']}})['then'](handleEntityNotFound(_0x24539d,null))[_0xcdc9('0x1e')](function(_0x35cacf){if(_0x35cacf){return _0x35cacf[_0xcdc9('0x8b')](_0x26d035[_0xcdc9('0x56')][_0xcdc9('0x6f')],_[_0xcdc9('0x8c')](_0x26d035[_0xcdc9('0x56')],[_0xcdc9('0x6f'),'id'])||{})[_0xcdc9('0x8d')](function(_0x10a01d){for(var _0x2e6185=0x0;_0x2e6185<_0x26d035[_0xcdc9('0x56')][_0xcdc9('0x6f')]['length'];_0x2e6185+=0x1){socket[_0xcdc9('0x77')]('userChatQueue:save',{'UserId':_0x26d035[_0xcdc9('0x56')][_0xcdc9('0x6f')][_0x2e6185],'ChatQueueId':_0x26d035[_0xcdc9('0x53')]['id']});}return _0x10a01d;});}})[_0xcdc9('0x1e')](respondWithResult(_0x24539d,null))['catch'](handleError(_0x24539d,null));};exports[_0xcdc9('0x89')]=function(_0x99d96b,_0x586a2f,_0x5e676c){return db[_0xcdc9('0x4e')][_0xcdc9('0x5b')]({'where':{'id':_0x99d96b[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x586a2f,null))['then'](function(_0x65b951){if(_0x65b951){return _0x65b951[_0xcdc9('0x89')](_0x99d96b['query'][_0xcdc9('0x6f')])[_0xcdc9('0x1e')](function(){if(_['isArray'](_0x99d96b[_0xcdc9('0x3d')]['ids'])){for(var _0x534130=0x0;_0x534130<_0x99d96b[_0xcdc9('0x3d')][_0xcdc9('0x6f')][_0xcdc9('0x54')];_0x534130+=0x1){socket[_0xcdc9('0x77')]('userChatQueue:remove',{'UserId':Number(_0x99d96b[_0xcdc9('0x3d')][_0xcdc9('0x6f')][_0x534130]),'ChatQueueId':Number(_0x99d96b[_0xcdc9('0x53')]['id'])});}}else{socket[_0xcdc9('0x77')](_0xcdc9('0x8a'),{'UserId':Number(_0x99d96b['query']['ids']),'ChatQueueId':Number(_0x99d96b[_0xcdc9('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x586a2f,null))['catch'](handleError(_0x586a2f,null));};exports[_0xcdc9('0x8e')]=function(_0x2cc644,_0x18c2b9,_0x341d2b){var _0x272648={};var _0xd88782={};var _0x11c90e;var _0x7a9a27;return db[_0xcdc9('0x4e')][_0xcdc9('0x6c')]({'where':{'id':_0x2cc644[_0xcdc9('0x53')]['id']}})[_0xcdc9('0x1e')](handleEntityNotFound(_0x18c2b9,null))['then'](function(_0x820eff){if(_0x820eff){_0x11c90e=_0x820eff;_0xd88782[_0xcdc9('0x3b')]=_[_0xcdc9('0x3c')](db[_0xcdc9('0x70')][_0xcdc9('0x3a')]);_0xd88782[_0xcdc9('0x3d')]=_[_0xcdc9('0x3c')](_0x2cc644[_0xcdc9('0x3d')]);_0xd88782[_0xcdc9('0x3e')]=_[_0xcdc9('0x61')](_0xd88782[_0xcdc9('0x3b')],_0xd88782[_0xcdc9('0x3d')]);_0x272648[_0xcdc9('0x3f')]=_['intersection'](_0xd88782[_0xcdc9('0x3b')],qs[_0xcdc9('0x40')](_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x40')]));_0x272648['attributes']=_0x272648[_0xcdc9('0x3f')]['length']?_0x272648['attributes']:_0xd88782[_0xcdc9('0x3b')];_0x272648[_0xcdc9('0x44')]=qs[_0xcdc9('0x45')](_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x45')]);_0x272648[_0xcdc9('0x48')]=qs[_0xcdc9('0x3e')](_['pick'](_0x2cc644['query'],_0xd88782[_0xcdc9('0x3e')]));if(_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x4d')]){_0x272648[_0xcdc9('0x48')]=_['merge'](_0x272648[_0xcdc9('0x48')],{'$or':_[_0xcdc9('0x49')](_0x272648[_0xcdc9('0x3f')],function(_0x46e8da){var _0xb443b1={};_0xb443b1[_0x46e8da]={'$like':'%'+_0x2cc644[_0xcdc9('0x3d')][_0xcdc9('0x4d')]+'%'};return _0xb443b1;})});}_0x272648=_[_0xcdc9('0x47')]({},_0x272648,_0x2cc644[_0xcdc9('0x63')]);return _0x11c90e[_0xcdc9('0x8e')](_0x272648);}})[_0xcdc9('0x1e')](function(_0x4a1573){if(_0x4a1573){_0x7a9a27=_0x4a1573[_0xcdc9('0x54')];if(!_0x2cc644['query']['hasOwnProperty'](_0xcdc9('0x42'))){_0x272648['limit']=qs[_0xcdc9('0x43')](_0x2cc644['query'][_0xcdc9('0x43')]);_0x272648[_0xcdc9('0x2c')]=qs[_0xcdc9('0x2c')](_0x2cc644[_0xcdc9('0x3d')]['offset']);}return _0x11c90e[_0xcdc9('0x8e')](_0x272648);}})['then'](function(_0x244f04){if(_0x244f04){return _0x244f04?{'count':_0x7a9a27,'rows':_0x244f04}:null;}})[_0xcdc9('0x1e')](respondWithResult(_0x18c2b9,null))[_0xcdc9('0x28')](handleError(_0x18c2b9,null));};
\ No newline at end of file
+var _0xf6ab=['stack','name','send','index','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','ChatQueue','count','include','findAll','catch','show','params','fields','includeAll','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','describe','getMembers','UserChatQueue','rawAttributes','ChatQueueId','User','UserId','agent','chatPause','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','emit','userChatQueue:save','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','status','end','json','offset','Content-Range','save','update','destroy','get','ChatQueues','UserProfileResource'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xf6ab,0xfe));var _0xbf6a=function(_0x11054b,_0x353e1a){_0x11054b=_0x11054b-0x0;var _0x21a096=_0xf6ab[_0x11054b];return _0x21a096;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbf6a('0x0'));var zipdir=require(_0xbf6a('0x1'));var jsonpatch=require(_0xbf6a('0x2'));var rp=require(_0xbf6a('0x3'));var moment=require('moment');var BPromise=require(_0xbf6a('0x4'));var Mustache=require('mustache');var util=require(_0xbf6a('0x5'));var path=require(_0xbf6a('0x6'));var sox=require('sox');var csv=require(_0xbf6a('0x7'));var ejs=require(_0xbf6a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbf6a('0x9'));var crypto=require(_0xbf6a('0xa'));var jsforce=require(_0xbf6a('0xb'));var deskjs=require(_0xbf6a('0xc'));var toCsv=require(_0xbf6a('0x7'));var querystring=require(_0xbf6a('0xd'));var Papa=require(_0xbf6a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf6a('0xf'));var logger=require(_0xbf6a('0x10'))(_0xbf6a('0x11'));var utils=require(_0xbf6a('0x12'));var config=require(_0xbf6a('0x13'));var db=require(_0xbf6a('0x14'))['db'];config['redis']=_[_0xbf6a('0x15')](config[_0xbf6a('0x16')],{'host':_0xbf6a('0x17'),'port':0x18eb});var socket=require(_0xbf6a('0x18'))(new Redis(config[_0xbf6a('0x16')]));require(_0xbf6a('0x19'))[_0xbf6a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbf6a('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x40a16a,_0x320e41,_0x1ba266){if(_0x1ba266){var _0x225d7c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x225d7c[_0xbf6a('0x1c')](_0x320e41)){return _0x40a16a;}else{throw new Error(_0xbf6a('0x1d'));}}else{return _0x40a16a;}}function respondWithRpcPromise(_0x9572b8,_0x44f45b,_0x59334e,_0xc2555b){return new BPromise(function(_0x1fc1ce,_0x41b005){var _0x1b67a2=_0xc2555b||client;return _0x1b67a2[_0xbf6a('0x1e')](_0x9572b8,_0x59334e)[_0xbf6a('0x1f')](function(_0x559530){logger[_0xbf6a('0x20')]('ChatQueue,\x20%s,\x20%s',_0x44f45b,_0xbf6a('0x21'));logger['debug'](_0xbf6a('0x22'),_0x44f45b,_0xbf6a('0x21'),JSON[_0xbf6a('0x23')](_0x559530));if(_0x559530['error']){if(_0x559530[_0xbf6a('0x24')][_0xbf6a('0x25')]===0x1f4){logger[_0xbf6a('0x24')](_0xbf6a('0x26'),_0x44f45b,_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);return _0x41b005(_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x44f45b,_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);return _0x1fc1ce(_0x559530[_0xbf6a('0x24')][_0xbf6a('0x27')]);}else{logger[_0xbf6a('0x20')](_0xbf6a('0x26'),_0x44f45b,_0xbf6a('0x21'));_0x1fc1ce(_0x559530[_0xbf6a('0x28')][_0xbf6a('0x27')]);}})['catch'](function(_0xfcf884){logger[_0xbf6a('0x24')]('ChatQueue,\x20%s,\x20%s',_0x44f45b,_0xfcf884);_0x41b005(_0xfcf884);});});}function respondWithStatusCode(_0x4aa804,_0x4484cf){_0x4484cf=_0x4484cf||0xcc;return function(_0xdad428){if(_0xdad428){return _0x4aa804['sendStatus'](_0x4484cf);}return _0x4aa804[_0xbf6a('0x29')](_0x4484cf)[_0xbf6a('0x2a')]();};}function respondWithResult(_0x4a6b6b,_0x5322f2){_0x5322f2=_0x5322f2||0xc8;return function(_0x4f1178){if(_0x4f1178){return _0x4a6b6b[_0xbf6a('0x29')](_0x5322f2)[_0xbf6a('0x2b')](_0x4f1178);}};}function respondWithFilteredResult(_0x8fe541,_0x4a5c8e){return function(_0x4cbfe9){if(_0x4cbfe9){var _0x57f8ed=_0x4cbfe9['count'],_0xbb6e43=_0x4a5c8e[_0xbf6a('0x2c')],_0x1b6928=_0x4a5c8e[_0xbf6a('0x2c')]+_0x4a5c8e['limit'],_0x481636;if(_0x1b6928>=_0x57f8ed){_0x1b6928=_0x57f8ed;_0x481636=0xc8;}else{_0x481636=0xce;}_0x8fe541[_0xbf6a('0x29')](_0x481636);return _0x8fe541['set'](_0xbf6a('0x2d'),_0xbb6e43+'-'+_0x1b6928+'/'+_0x57f8ed)[_0xbf6a('0x2b')](_0x4cbfe9);}return null;};}function patchUpdates(_0x356afa){return function(_0x9f6df9){try{jsonpatch['apply'](_0x9f6df9,_0x356afa,!![]);}catch(_0xce2469){return BPromise['reject'](_0xce2469);}return _0x9f6df9[_0xbf6a('0x2e')]();};}function saveUpdates(_0x2ede2e,_0x501358){return function(_0x191b21){if(_0x191b21){return _0x191b21[_0xbf6a('0x2f')](_0x2ede2e)[_0xbf6a('0x1f')](function(_0x55e407){return _0x55e407;});}return null;};}function removeEntity(_0x5109a4,_0x190c01){return function(_0x2d7bb6){if(_0x2d7bb6){return _0x2d7bb6[_0xbf6a('0x30')]()[_0xbf6a('0x1f')](function(){var _0x35e4c6=_0x2d7bb6[_0xbf6a('0x31')]({'plain':!![]});var _0x37d7b0=_0xbf6a('0x32');return db[_0xbf6a('0x33')][_0xbf6a('0x30')]({'where':{'type':_0x37d7b0,'resourceId':_0x35e4c6['id']}})['then'](function(){return _0x2d7bb6;});})[_0xbf6a('0x1f')](function(){_0x5109a4[_0xbf6a('0x29')](0xcc)[_0xbf6a('0x2a')]();});}};}function handleEntityNotFound(_0x274f95,_0x4cac0f){return function(_0x319f56){if(!_0x319f56){_0x274f95['sendStatus'](0x194);}return _0x319f56;};}function handleError(_0x15bb10,_0x534c22){_0x534c22=_0x534c22||0x1f4;return function(_0x596986){logger[_0xbf6a('0x24')](_0x596986[_0xbf6a('0x34')]);if(_0x596986[_0xbf6a('0x35')]){delete _0x596986['name'];}_0x15bb10[_0xbf6a('0x29')](_0x534c22)[_0xbf6a('0x36')](_0x596986);};}exports[_0xbf6a('0x37')]=function(_0x778336,_0x92ade6){var _0x558064={},_0x483e66={},_0x538e7d={'count':0x0,'rows':[]};var _0x10d405=db['ChatQueue']['rawAttributes'];_0x483e66[_0xbf6a('0x38')]=_['keys'](_0x10d405);_0x483e66['query']=_[_0xbf6a('0x39')](_0x778336[_0xbf6a('0x3a')]);_0x483e66['filters']=_[_0xbf6a('0x3b')](_0x483e66[_0xbf6a('0x38')],_0x483e66[_0xbf6a('0x3a')]);_0x558064[_0xbf6a('0x3c')]=_[_0xbf6a('0x3b')](_0x483e66[_0xbf6a('0x38')],qs['fields'](_0x778336['query']['fields']));_0x558064[_0xbf6a('0x3c')]=_0x558064[_0xbf6a('0x3c')][_0xbf6a('0x3d')]?_0x558064[_0xbf6a('0x3c')]:_0x483e66['model'];if(!_0x778336[_0xbf6a('0x3a')][_0xbf6a('0x3e')](_0xbf6a('0x3f'))){_0x558064[_0xbf6a('0x40')]=qs['limit'](_0x778336['query']['limit']);_0x558064[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x778336[_0xbf6a('0x3a')]['offset']);}_0x558064[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x778336[_0xbf6a('0x3a')][_0xbf6a('0x42')]);_0x558064['where']=qs[_0xbf6a('0x43')](_[_0xbf6a('0x44')](_0x778336[_0xbf6a('0x3a')],_0x483e66[_0xbf6a('0x43')]));if(_0x778336[_0xbf6a('0x3a')][_0xbf6a('0x45')]){_0x558064[_0xbf6a('0x46')]=_[_0xbf6a('0x47')](_0x558064[_0xbf6a('0x46')],{'$or':_[_0xbf6a('0x48')](_0x10d405,function(_0x194876){if(_0x194876[_0xbf6a('0x49')][_0xbf6a('0x4a')]!==_0xbf6a('0x4b')){var _0x536365={};_0x536365[_0x194876[_0xbf6a('0x4c')]]={'$like':'%'+_0x778336[_0xbf6a('0x3a')]['filter']+'%'};return _0x536365;}})});}_0x558064=_[_0xbf6a('0x47')]({},_0x558064,_0x778336[_0xbf6a('0x4d')]);var _0x14d532={'where':_0x558064[_0xbf6a('0x46')]};return db[_0xbf6a('0x4e')][_0xbf6a('0x4f')](_0x14d532)[_0xbf6a('0x1f')](function(_0x3ab7f1){_0x538e7d[_0xbf6a('0x4f')]=_0x3ab7f1;if(_0x778336[_0xbf6a('0x3a')]['includeAll']){_0x558064[_0xbf6a('0x50')]=[{'all':!![]}];}return db[_0xbf6a('0x4e')][_0xbf6a('0x51')](_0x558064);})[_0xbf6a('0x1f')](function(_0xde9dea){_0x538e7d['rows']=_0xde9dea;return _0x538e7d;})['then'](respondWithFilteredResult(_0x92ade6,_0x558064))[_0xbf6a('0x52')](handleError(_0x92ade6,null));};exports[_0xbf6a('0x53')]=function(_0x52e5c7,_0x25d036){var _0x89d1cb={'raw':!![],'where':{'id':_0x52e5c7[_0xbf6a('0x54')]['id']}},_0x479763={};_0x479763[_0xbf6a('0x38')]=_['keys'](db[_0xbf6a('0x4e')]['rawAttributes']);_0x479763[_0xbf6a('0x3a')]=_[_0xbf6a('0x39')](_0x52e5c7[_0xbf6a('0x3a')]);_0x479763[_0xbf6a('0x43')]=_[_0xbf6a('0x3b')](_0x479763[_0xbf6a('0x38')],_0x479763['query']);_0x89d1cb['attributes']=_['intersection'](_0x479763['model'],qs[_0xbf6a('0x55')](_0x52e5c7[_0xbf6a('0x3a')][_0xbf6a('0x55')]));_0x89d1cb[_0xbf6a('0x3c')]=_0x89d1cb['attributes']['length']?_0x89d1cb['attributes']:_0x479763[_0xbf6a('0x38')];if(_0x52e5c7[_0xbf6a('0x3a')][_0xbf6a('0x56')]){_0x89d1cb[_0xbf6a('0x50')]=[{'all':!![]}];}_0x89d1cb=_[_0xbf6a('0x47')]({},_0x89d1cb,_0x52e5c7[_0xbf6a('0x4d')]);return db[_0xbf6a('0x4e')]['find'](_0x89d1cb)[_0xbf6a('0x1f')](handleEntityNotFound(_0x25d036,null))[_0xbf6a('0x1f')](respondWithResult(_0x25d036,null))[_0xbf6a('0x52')](handleError(_0x25d036,null));};exports['create']=function(_0x5e6d0a,_0x2ceeeb){return db['ChatQueue'][_0xbf6a('0x57')](_0x5e6d0a[_0xbf6a('0x58')],{})[_0xbf6a('0x1f')](function(_0x572c6b){var _0x3b1e7e=_0x5e6d0a[_0xbf6a('0x59')][_0xbf6a('0x31')]({'plain':!![]});if(!_0x3b1e7e)throw new Error(_0xbf6a('0x5a'));if(_0x3b1e7e[_0xbf6a('0x5b')]===_0xbf6a('0x59')){var _0x1642de=_0x572c6b[_0xbf6a('0x31')]({'plain':!![]});var _0x246570=_0xbf6a('0x32');return db[_0xbf6a('0x5c')][_0xbf6a('0x5d')]({'where':{'name':_0x246570,'userProfileId':_0x3b1e7e[_0xbf6a('0x5e')]},'raw':!![]})[_0xbf6a('0x1f')](function(_0x28b642){if(_0x28b642&&_0x28b642[_0xbf6a('0x5f')]===0x0){return db[_0xbf6a('0x33')][_0xbf6a('0x57')]({'name':_0x1642de[_0xbf6a('0x35')],'resourceId':_0x1642de['id'],'type':_0x28b642['name'],'sectionId':_0x28b642['id']},{})[_0xbf6a('0x1f')](function(){return _0x572c6b;});}else{return _0x572c6b;}})[_0xbf6a('0x52')](function(_0x200ca8){logger[_0xbf6a('0x24')](_0xbf6a('0x60'),_0x200ca8);throw _0x200ca8;});}return _0x572c6b;})['then'](respondWithResult(_0x2ceeeb,0xc9))['catch'](handleError(_0x2ceeeb,null));};exports[_0xbf6a('0x2f')]=function(_0x79d0f9,_0x1a4348){if(_0x79d0f9[_0xbf6a('0x58')]['id']){delete _0x79d0f9[_0xbf6a('0x58')]['id'];}return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x79d0f9[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x1a4348,null))['then'](saveUpdates(_0x79d0f9['body'],null))[_0xbf6a('0x1f')](respondWithResult(_0x1a4348,null))[_0xbf6a('0x52')](handleError(_0x1a4348,null));};exports[_0xbf6a('0x30')]=function(_0x4e9f2f,_0x2690a6){return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x4e9f2f[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x2690a6,null))[_0xbf6a('0x1f')](removeEntity(_0x2690a6,null))[_0xbf6a('0x52')](handleError(_0x2690a6,null));};exports[_0xbf6a('0x61')]=function(_0xd2177a,_0x53cbf8){return db[_0xbf6a('0x4e')][_0xbf6a('0x61')]()[_0xbf6a('0x1f')](respondWithResult(_0x53cbf8,null))['catch'](handleError(_0x53cbf8,null));};exports[_0xbf6a('0x62')]=function(_0x543c72,_0x2d8fd9,_0xf3d988){var _0x3b6487={'raw':!![],'where':{}},_0x34b7c2={},_0x453301;return db[_0xbf6a('0x4e')]['findOne']({'where':{'id':_0x543c72[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x2d8fd9,null))['then'](function(_0x568ce6){if(_0x568ce6){_0x453301=_0x568ce6[_0xbf6a('0x31')]({'plain':!![]});_0x34b7c2[_0xbf6a('0x38')]=_['keys'](db[_0xbf6a('0x63')][_0xbf6a('0x64')]);_0x34b7c2[_0xbf6a('0x3a')]=_[_0xbf6a('0x39')](_0x543c72[_0xbf6a('0x3a')]);_0x34b7c2[_0xbf6a('0x43')]=_[_0xbf6a('0x3b')](_0x34b7c2[_0xbf6a('0x38')],_0x34b7c2[_0xbf6a('0x3a')]);_0x3b6487[_0xbf6a('0x3c')]=_[_0xbf6a('0x3b')](_0x34b7c2[_0xbf6a('0x38')],qs[_0xbf6a('0x55')](_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x55')]));_0x3b6487[_0xbf6a('0x3c')]=_0x3b6487[_0xbf6a('0x3c')][_0xbf6a('0x3d')]?_0x3b6487['attributes']:_0x34b7c2['model'];if(!_0x543c72[_0xbf6a('0x3a')]['hasOwnProperty'](_0xbf6a('0x3f'))){_0x3b6487[_0xbf6a('0x40')]=qs[_0xbf6a('0x40')](_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x40')]);_0x3b6487[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x543c72[_0xbf6a('0x3a')]['offset']);}_0x3b6487[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x543c72[_0xbf6a('0x3a')]['sort']);_0x3b6487[_0xbf6a('0x46')]=qs['filters'](_[_0xbf6a('0x44')](_0x543c72[_0xbf6a('0x3a')],_0x34b7c2[_0xbf6a('0x43')]));_0x3b6487[_0xbf6a('0x46')][_0xbf6a('0x65')]=_0x568ce6['id'];if(_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x45')]){_0x3b6487[_0xbf6a('0x46')]=_[_0xbf6a('0x47')](_0x3b6487['where'],{'$or':_['map'](_0x3b6487[_0xbf6a('0x3c')],function(_0x5f2dff){var _0x2a3122={};_0x2a3122[_0x5f2dff]={'$like':'%'+_0x543c72[_0xbf6a('0x3a')][_0xbf6a('0x45')]+'%'};return _0x2a3122;})});}_0x3b6487=_[_0xbf6a('0x47')]({},_0x3b6487,_0x543c72[_0xbf6a('0x4d')]);return db['UserChatQueue']['findAll'](_0x3b6487);}})['then'](function(_0x2161ee){if(_0x2161ee){return db[_0xbf6a('0x66')]['findAndCountAll']({'where':{'id':_['map'](_0x2161ee,_0xbf6a('0x67')),'role':_0xbf6a('0x68')},'attributes':['id','name',_0xbf6a('0x69'),'updatedAt',_0xbf6a('0x6a')]});}})['then'](function(_0x22386e){if(_0x22386e){return{'count':_0x22386e['count'],'rows':_[_0xbf6a('0x48')](_0x22386e[_0xbf6a('0x6b')],function(_0x2cebc0){return{'membername':_0x2cebc0[_0xbf6a('0x35')],'UserId':_0x2cebc0['id'],'queue_name':_0x453301[_0xbf6a('0x35')],'ChatQueueId':_0x453301['id'],'interface':util[_0xbf6a('0x6c')](_0xbf6a('0x6d'),'SIP',_0x2cebc0['name']),'penalty':0x0,'paused':_0x2cebc0[_0xbf6a('0x69')],'createdAt':_0x2cebc0[_0xbf6a('0x6a')],'updatedAt':_0x2cebc0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xbf6a('0x1f')](respondWithFilteredResult(_0x2d8fd9,_0x3b6487))[_0xbf6a('0x52')](handleError(_0x2d8fd9,null));};exports[_0xbf6a('0x6e')]=function(_0x3ec344,_0x723250,_0x369dbc){var _0x1b2ee2={};var _0x9079e8={};var _0x42f9f7;var _0x352924;return db[_0xbf6a('0x4e')]['findOne']({'where':{'id':_0x3ec344[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x723250,null))[_0xbf6a('0x1f')](function(_0x309dda){if(_0x309dda){_0x42f9f7=_0x309dda;_0x9079e8[_0xbf6a('0x38')]=_[_0xbf6a('0x39')](db[_0xbf6a('0x6f')][_0xbf6a('0x64')]);_0x9079e8[_0xbf6a('0x3a')]=_[_0xbf6a('0x39')](_0x3ec344[_0xbf6a('0x3a')]);_0x9079e8['filters']=_[_0xbf6a('0x3b')](_0x9079e8['model'],_0x9079e8[_0xbf6a('0x3a')]);_0x1b2ee2['attributes']=_[_0xbf6a('0x3b')](_0x9079e8[_0xbf6a('0x38')],qs[_0xbf6a('0x55')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x55')]));_0x1b2ee2['attributes']=_0x1b2ee2[_0xbf6a('0x3c')]['length']?_0x1b2ee2[_0xbf6a('0x3c')]:_0x9079e8[_0xbf6a('0x38')];_0x1b2ee2[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x42')]);_0x1b2ee2['where']=qs[_0xbf6a('0x43')](_[_0xbf6a('0x44')](_0x3ec344[_0xbf6a('0x3a')],_0x9079e8[_0xbf6a('0x43')]));if(_0x3ec344[_0xbf6a('0x3a')]['filter']){_0x1b2ee2[_0xbf6a('0x46')]=_['merge'](_0x1b2ee2[_0xbf6a('0x46')],{'$or':_[_0xbf6a('0x48')](_0x1b2ee2[_0xbf6a('0x3c')],function(_0x574569){var _0xd22e10={};_0xd22e10[_0x574569]={'$like':'%'+_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x45')]+'%'};return _0xd22e10;})});}_0x1b2ee2=_[_0xbf6a('0x47')]({},_0x1b2ee2,_0x3ec344[_0xbf6a('0x4d')]);return _0x42f9f7[_0xbf6a('0x6e')](_0x1b2ee2);}})['then'](function(_0x39fed4){if(_0x39fed4){_0x352924=_0x39fed4[_0xbf6a('0x3d')];if(!_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x3e')](_0xbf6a('0x3f'))){_0x1b2ee2[_0xbf6a('0x40')]=qs[_0xbf6a('0x40')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x40')]);_0x1b2ee2[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x3ec344[_0xbf6a('0x3a')][_0xbf6a('0x2c')]);}return _0x42f9f7[_0xbf6a('0x6e')](_0x1b2ee2);}})['then'](function(_0x474da2){if(_0x474da2){return _0x474da2?{'count':_0x352924,'rows':_0x474da2}:null;}})[_0xbf6a('0x1f')](respondWithResult(_0x723250,null))[_0xbf6a('0x52')](handleError(_0x723250,null));};exports[_0xbf6a('0x70')]=function(_0x2025ce,_0x530c6d,_0x3e47bf){var _0x395b6e=_0x2025ce['body'][_0xbf6a('0x71')];return db['Team'][_0xbf6a('0x51')]({'where':{'id':_0x395b6e},'attributes':['id'],'include':[{'model':db[_0xbf6a('0x66')],'as':_0xbf6a('0x72'),'attributes':['id',_0xbf6a('0x35'),_0xbf6a('0x73'),_0xbf6a('0x74'),_0xbf6a('0x75')],'raw':!![]}]})[_0xbf6a('0x1f')](function(_0x50c772){if(_0x50c772){var _0x4c2412=_['flatMap'](_0x50c772,function(_0x3e4ebe){var _0x1604d7=_0x3e4ebe[_0xbf6a('0x31')]({'plain':!![]});return _0x1604d7[_0xbf6a('0x72')];});return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x2025ce[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](function(_0x47cbb8){return db['sequelize'][_0xbf6a('0x76')](function(_0x1c4e6b){return _0x47cbb8[_0xbf6a('0x70')](_0x395b6e,{'transaction':_0x1c4e6b})[_0xbf6a('0x1f')](function(){return BPromise[_0xbf6a('0x77')](_0x4c2412,function(_0x2cad40){return db[_0xbf6a('0x63')][_0xbf6a('0x78')]({'where':{'UserId':_0x2cad40['id'],'ChatQueueId':_0x2025ce[_0xbf6a('0x54')]['id']},'transaction':_0x1c4e6b});});})[_0xbf6a('0x1f')](function(){_0x4c2412['forEach'](function(_0x2f72d6){socket[_0xbf6a('0x79')](_0xbf6a('0x7a'),{'UserId':_0x2f72d6['id'],'ChatQueueId':_0x47cbb8['id']});});});});});}})[_0xbf6a('0x1f')](respondWithStatusCode(_0x530c6d,null))['catch'](handleError(_0x530c6d,null));};exports['removeTeams']=function(_0x547da2,_0x3134c9,_0x2ee222){return db['Team'][_0xbf6a('0x51')]({'where':{'id':_0x547da2[_0xbf6a('0x3a')][_0xbf6a('0x71')]},'attributes':['id'],'include':[{'model':db[_0xbf6a('0x66')],'as':_0xbf6a('0x72'),'attributes':['id'],'raw':!![]}]})[_0xbf6a('0x1f')](handleEntityNotFound(_0x3134c9,null))[_0xbf6a('0x1f')](function(_0x282c8c){var _0x318cd9=_[_0xbf6a('0x48')](_0x282c8c,'id');var _0x1f3532=[];var _0xb4251c=[];var _0x2c49a6=squel[_0xbf6a('0x7b')]();_0x2c49a6['field'](_0xbf6a('0x7c'))[_0xbf6a('0x7d')](_0xbf6a('0x7e'),'tq')['join'](_0xbf6a('0x7f'),'ut',_0xbf6a('0x80'))[_0xbf6a('0x46')](_0xbf6a('0x81'),_0x547da2[_0xbf6a('0x54')]['id']);for(var _0x31a018=0x0;_0x31a018<_0x282c8c[_0xbf6a('0x3d')];_0x31a018+=0x1){let _0x301cba=_0x282c8c[_0x31a018];for(var _0x5c03ec=0x0;_0x5c03ec<_0x301cba[_0xbf6a('0x72')][_0xbf6a('0x3d')];_0x5c03ec+=0x1){let _0x12ebe0=_0x301cba[_0xbf6a('0x72')][_0x5c03ec];var _0x524717=_0x2c49a6['clone']();_0x524717[_0xbf6a('0x46')](_0xbf6a('0x82'),_0x12ebe0['id']);_0xb4251c[_0xbf6a('0x83')](db[_0xbf6a('0x84')][_0xbf6a('0x3a')](_0x524717['toString'](),{'type':db[_0xbf6a('0x84')][_0xbf6a('0x85')][_0xbf6a('0x86')]})['then'](function(_0x244637){if(_0x244637[_0xbf6a('0x3d')]===0x1){return _0x12ebe0['id'];}else{var _0x2046de=_[_0xbf6a('0x87')](_['map'](_0x244637,_0xbf6a('0x88')),function(_0x24cbf8){return _[_0xbf6a('0x89')](_0x318cd9,_0x24cbf8);});if(_0x2046de){return _0x12ebe0['id'];}}}));}}return BPromise[_0xbf6a('0x8a')](_0xb4251c)['then'](function(_0x11454e){_0x1f3532=_(_0x1f3532)[_0xbf6a('0x8b')](_0x11454e)[_0xbf6a('0x8c')]()[_0xbf6a('0x8d')]();return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x547da2[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](function(_0x34ccd2){return db[_0xbf6a('0x84')]['transaction'](function(_0x574340){return _0x34ccd2[_0xbf6a('0x8e')](_0x547da2[_0xbf6a('0x3a')][_0xbf6a('0x71')],{'transaction':_0x574340})[_0xbf6a('0x1f')](function(){if(!_[_0xbf6a('0x8f')](_0x1f3532)){return _0x34ccd2[_0xbf6a('0x90')](_0x1f3532,{'transaction':_0x574340});}})[_0xbf6a('0x1f')](function(){_0x1f3532[_0xbf6a('0x91')](function(_0x30a21){socket[_0xbf6a('0x79')](_0xbf6a('0x92'),{'UserId':_0x30a21,'ChatQueueId':_0x34ccd2['id']});});});});});});})[_0xbf6a('0x1f')](respondWithStatusCode(_0x3134c9,null))[_0xbf6a('0x52')](handleError(_0x3134c9,null));};exports['addAgents']=function(_0x1e2b4e,_0x1ce1b8,_0x5b72b2){return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x1e2b4e[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x1ce1b8,null))[_0xbf6a('0x1f')](function(_0x474655){if(_0x474655){return _0x474655[_0xbf6a('0x93')](_0x1e2b4e[_0xbf6a('0x58')]['ids'],_[_0xbf6a('0x94')](_0x1e2b4e['body'],[_0xbf6a('0x71'),'id'])||{})[_0xbf6a('0x95')](function(_0x2b12d6){for(var _0xb4ecda=0x0;_0xb4ecda<_0x1e2b4e[_0xbf6a('0x58')][_0xbf6a('0x71')]['length'];_0xb4ecda+=0x1){socket['emit'](_0xbf6a('0x7a'),{'UserId':_0x1e2b4e[_0xbf6a('0x58')][_0xbf6a('0x71')][_0xb4ecda],'ChatQueueId':_0x1e2b4e[_0xbf6a('0x54')]['id']});}return _0x2b12d6;});}})['then'](respondWithResult(_0x1ce1b8,null))['catch'](handleError(_0x1ce1b8,null));};exports['removeAgents']=function(_0x32463b,_0x1c740b,_0x581357){return db[_0xbf6a('0x4e')][_0xbf6a('0x5d')]({'where':{'id':_0x32463b[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x1c740b,null))[_0xbf6a('0x1f')](function(_0x456a8a){if(_0x456a8a){return _0x456a8a[_0xbf6a('0x90')](_0x32463b['query'][_0xbf6a('0x71')])['then'](function(){if(_[_0xbf6a('0x96')](_0x32463b[_0xbf6a('0x3a')][_0xbf6a('0x71')])){for(var _0x4f80c0=0x0;_0x4f80c0<_0x32463b['query'][_0xbf6a('0x71')][_0xbf6a('0x3d')];_0x4f80c0+=0x1){socket[_0xbf6a('0x79')](_0xbf6a('0x92'),{'UserId':Number(_0x32463b[_0xbf6a('0x3a')]['ids'][_0x4f80c0]),'ChatQueueId':Number(_0x32463b[_0xbf6a('0x54')]['id'])});}}else{socket[_0xbf6a('0x79')](_0xbf6a('0x92'),{'UserId':Number(_0x32463b[_0xbf6a('0x3a')][_0xbf6a('0x71')]),'ChatQueueId':Number(_0x32463b[_0xbf6a('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c740b,null))[_0xbf6a('0x52')](handleError(_0x1c740b,null));};exports[_0xbf6a('0x97')]=function(_0x46f9ad,_0x274644,_0x136e4d){var _0x3f978d={};var _0x584526={};var _0x1930dc;var _0x2e1a9e;return db[_0xbf6a('0x4e')][_0xbf6a('0x98')]({'where':{'id':_0x46f9ad[_0xbf6a('0x54')]['id']}})[_0xbf6a('0x1f')](handleEntityNotFound(_0x274644,null))[_0xbf6a('0x1f')](function(_0x2e7f36){if(_0x2e7f36){_0x1930dc=_0x2e7f36;_0x584526['model']=_[_0xbf6a('0x39')](db[_0xbf6a('0x66')]['rawAttributes']);_0x584526[_0xbf6a('0x3a')]=_['keys'](_0x46f9ad[_0xbf6a('0x3a')]);_0x584526['filters']=_[_0xbf6a('0x3b')](_0x584526['model'],_0x584526['query']);_0x3f978d[_0xbf6a('0x3c')]=_['intersection'](_0x584526[_0xbf6a('0x38')],qs[_0xbf6a('0x55')](_0x46f9ad['query'][_0xbf6a('0x55')]));_0x3f978d['attributes']=_0x3f978d['attributes']['length']?_0x3f978d[_0xbf6a('0x3c')]:_0x584526[_0xbf6a('0x38')];_0x3f978d[_0xbf6a('0x41')]=qs[_0xbf6a('0x42')](_0x46f9ad[_0xbf6a('0x3a')][_0xbf6a('0x42')]);_0x3f978d[_0xbf6a('0x46')]=qs[_0xbf6a('0x43')](_['pick'](_0x46f9ad[_0xbf6a('0x3a')],_0x584526[_0xbf6a('0x43')]));if(_0x46f9ad[_0xbf6a('0x3a')][_0xbf6a('0x45')]){_0x3f978d[_0xbf6a('0x46')]=_['merge'](_0x3f978d['where'],{'$or':_[_0xbf6a('0x48')](_0x3f978d[_0xbf6a('0x3c')],function(_0x258f8a){var _0x5ce17c={};_0x5ce17c[_0x258f8a]={'$like':'%'+_0x46f9ad['query'][_0xbf6a('0x45')]+'%'};return _0x5ce17c;})});}_0x3f978d=_[_0xbf6a('0x47')]({},_0x3f978d,_0x46f9ad['options']);return _0x1930dc['getAgents'](_0x3f978d);}})[_0xbf6a('0x1f')](function(_0x29e312){if(_0x29e312){_0x2e1a9e=_0x29e312[_0xbf6a('0x3d')];if(!_0x46f9ad[_0xbf6a('0x3a')]['hasOwnProperty'](_0xbf6a('0x3f'))){_0x3f978d[_0xbf6a('0x40')]=qs[_0xbf6a('0x40')](_0x46f9ad[_0xbf6a('0x3a')][_0xbf6a('0x40')]);_0x3f978d[_0xbf6a('0x2c')]=qs[_0xbf6a('0x2c')](_0x46f9ad[_0xbf6a('0x3a')]['offset']);}return _0x1930dc['getAgents'](_0x3f978d);}})[_0xbf6a('0x1f')](function(_0x28dfcc){if(_0x28dfcc){return _0x28dfcc?{'count':_0x2e1a9e,'rows':_0x28dfcc}:null;}})[_0xbf6a('0x1f')](respondWithResult(_0x274644,null))[_0xbf6a('0x52')](handleError(_0x274644,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 6297d52..5f31f78 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 _0xe49a=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x2b1413,_0x2ce9d0){var _0x69a7fb=function(_0x54cb7b){while(--_0x54cb7b){_0x2b1413['push'](_0x2b1413['shift']());}};_0x69a7fb(++_0x2ce9d0);}(_0xe49a,0xd7));var _0xae49=function(_0x295342,_0x56a8ce){_0x295342=_0x295342-0x0;var _0x21d2af=_0xe49a[_0x295342];return _0x21d2af;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xae49('0x0'))['db'][_0xae49('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xae49('0x2')](0x0);var events={'afterCreate':_0xae49('0x3'),'afterUpdate':_0xae49('0x4'),'afterDestroy':_0xae49('0x5')};function emitEvent(_0x82a917){return function(_0x526f75,_0x33ce72,_0x1a0dd1){ChatQueueEvents[_0xae49('0x6')](_0x82a917+':'+_0x526f75['id'],_0x526f75);ChatQueueEvents['emit'](_0x82a917,_0x526f75);_0x1a0dd1(null);};}for(var e in events){if(events[_0xae49('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xae49('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6455=['exports','events','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x43d067,_0x64756d){var _0x46958c=function(_0x585fc2){while(--_0x585fc2){_0x43d067['push'](_0x43d067['shift']());}};_0x46958c(++_0x64756d);}(_0x6455,0x97));var _0x5645=function(_0x1f66e1,_0x131e6a){_0x1f66e1=_0x1f66e1-0x0;var _0x3a283a=_0x6455[_0x1f66e1];return _0x3a283a;};'use strict';var EventEmitter=require(_0x5645('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x5645('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5645('0x2')](0x0);var events={'afterCreate':_0x5645('0x3'),'afterUpdate':_0x5645('0x4'),'afterDestroy':_0x5645('0x5')};function emitEvent(_0x35c21e){return function(_0x5388ff,_0x233875,_0x29cefe){ChatQueueEvents[_0x5645('0x6')](_0x35c21e+':'+_0x5388ff['id'],_0x5388ff);ChatQueueEvents[_0x5645('0x6')](_0x35c21e,_0x5388ff);_0x29cefe(null);};}for(var e in events){if(events[_0x5645('0x7')](e)){var event=events[e];ChatQueue[_0x5645('0x8')](e,emitEvent(event));}}module[_0x5645('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0ecfa3f..94ea6eb 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 _0xc437=['chat_queues','lodash','util','../../config/logger','api','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x2dffe0,_0x5a4d22){var _0x51ad55=function(_0x3228bf){while(--_0x3228bf){_0x2dffe0['push'](_0x2dffe0['shift']());}};_0x51ad55(++_0x5a4d22);}(_0xc437,0xe8));var _0x7c43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc437[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7c43('0x0'));var util=require(_0x7c43('0x1'));var logger=require(_0x7c43('0x2'))(_0x7c43('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7c43('0x4'));var fs=require('fs');var path=require(_0x7c43('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c43('0x6'));module[_0x7c43('0x7')]=function(_0x4642e3,_0x252ebc){return _0x4642e3[_0x7c43('0x8')](_0x7c43('0x9'),attributes,{'tableName':_0x7c43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4e9=['exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x530325,_0x477be4){var _0x13e765=function(_0x474fe9){while(--_0x474fe9){_0x530325['push'](_0x530325['shift']());}};_0x13e765(++_0x477be4);}(_0xc4e9,0x19a));var _0x9c4e=function(_0x189b3b,_0x484de8){_0x189b3b=_0x189b3b-0x0;var _0x7c4721=_0xc4e9[_0x189b3b];return _0x7c4721;};'use strict';var _=require(_0x9c4e('0x0'));var util=require(_0x9c4e('0x1'));var logger=require(_0x9c4e('0x2'))('api');var moment=require(_0x9c4e('0x3'));var BPromise=require(_0x9c4e('0x4'));var rp=require(_0x9c4e('0x5'));var fs=require('fs');var path=require(_0x9c4e('0x6'));var rimraf=require(_0x9c4e('0x7'));var config=require(_0x9c4e('0x8'));var attributes=require(_0x9c4e('0x9'));module[_0x9c4e('0xa')]=function(_0x137055,_0x202cf0){return _0x137055[_0x9c4e('0xb')](_0x9c4e('0xc'),attributes,{'tableName':_0x9c4e('0xd'),'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 30ee163..6e70217 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 _0x969e=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','then','ShowChatQueue','find','raw','lodash','util'];(function(_0x18b85e,_0x1a4727){var _0xdb0129=function(_0xf673c2){while(--_0xf673c2){_0x18b85e['push'](_0x18b85e['shift']());}};_0xdb0129(++_0x1a4727);}(_0x969e,0x136));var _0xe969=function(_0x68e0ee,_0x1523b2){_0x68e0ee=_0x68e0ee-0x0;var _0x5e4abb=_0x969e[_0x68e0ee];return _0x5e4abb;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var moment=require('moment');var BPromise=require(_0xe969('0x2'));var rs=require(_0xe969('0x3'));var fs=require('fs');var Redis=require(_0xe969('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe969('0x5'));var config=require(_0xe969('0x6'));var jayson=require(_0xe969('0x7'));var client=jayson[_0xe969('0x8')]['http']({'port':0x232a});config[_0xe969('0x9')]=_[_0xe969('0xa')](config[_0xe969('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe969('0xb'))(new Redis(config['redis']));require(_0xe969('0xc'))[_0xe969('0xd')](socket);function respondWithRpcPromise(_0x5d9841,_0x431f1c,_0x4ced4b){return new BPromise(function(_0x32d427,_0x2991d6){return client[_0xe969('0xe')](_0x5d9841,_0x4ced4b)['then'](function(_0x80b852){logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));logger[_0xe969('0x12')](_0xe969('0x13'),_0x431f1c,'request\x20sent',JSON[_0xe969('0x14')](_0x80b852));if(_0x80b852['error']){if(_0x80b852['error'][_0xe969('0x15')]===0x1f4){logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')]['message']);return _0x2991d6(_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);}logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);return _0x32d427(_0x80b852['error']['message']);}else{logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));_0x32d427(_0x80b852[_0xe969('0x18')][_0xe969('0x17')]);}})[_0xe969('0x19')](function(_0x5aa68c){logger['error'](_0xe969('0x10'),_0x431f1c,_0x5aa68c);_0x2991d6(_0x5aa68c);});});}exports[_0xe969('0x1a')]=function(_0x295b44){var _0x5dd070=this;return new Promise(function(_0x1f6e31,_0x524542){return db[_0xe969('0x1b')]['findAll']({'raw':_0x295b44[_0xe969('0x1c')]?_0x295b44['options']['raw']===undefined?!![]:![]:!![],'where':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x1d')]||null:null,'attributes':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x1e')]||null:null,'limit':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x1f')]||null:null,'include':_0x295b44[_0xe969('0x1c')]?_0x295b44[_0xe969('0x1c')][_0xe969('0x20')]?_[_0xe969('0x21')](_0x295b44['options']['include'],function(_0x522f8f){return{'model':db[_0x522f8f[_0xe969('0x22')]],'as':_0x522f8f['as'],'attributes':_0x522f8f[_0xe969('0x1e')],'include':_0x522f8f[_0xe969('0x20')]?_[_0xe969('0x21')](_0x522f8f[_0xe969('0x20')],function(_0x2c9ee1){return{'model':db[_0x2c9ee1[_0xe969('0x22')]],'as':_0x2c9ee1['as'],'attributes':_0x2c9ee1[_0xe969('0x1e')],'include':_0x2c9ee1['include']?_[_0xe969('0x21')](_0x2c9ee1[_0xe969('0x20')],function(_0x241639){return{'model':db[_0x241639[_0xe969('0x22')]],'as':_0x241639['as'],'attributes':_0x241639[_0xe969('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe969('0x23')](function(_0x4c9c3a){logger['info'](_0xe969('0x1a'),_0x295b44);logger[_0xe969('0x12')](_0xe969('0x1a'),_0x295b44,JSON[_0xe969('0x14')](_0x4c9c3a));_0x1f6e31(_0x4c9c3a);})[_0xe969('0x19')](function(_0x514ee8){logger['error'](_0xe969('0x1a'),_0x514ee8[_0xe969('0x17')],_0x295b44);_0x524542(_0x5dd070[_0xe969('0x16')](0x1f4,_0x514ee8[_0xe969('0x17')]));});});};exports[_0xe969('0x24')]=function(_0xca6728){var _0x1dff3e=this;return new Promise(function(_0x4b0af3,_0x2a1c7f){return db[_0xe969('0x1b')][_0xe969('0x25')]({'raw':_0xca6728[_0xe969('0x1c')]?_0xca6728['options'][_0xe969('0x26')]===undefined?!![]:![]:!![],'where':_0xca6728[_0xe969('0x1c')]?_0xca6728[_0xe969('0x1c')]['where']||null:null,'attributes':_0xca6728['options']?_0xca6728[_0xe969('0x1c')][_0xe969('0x1e')]||null:null,'include':_0xca6728[_0xe969('0x1c')]?_0xca6728[_0xe969('0x1c')][_0xe969('0x20')]?_['map'](_0xca6728[_0xe969('0x1c')]['include'],function(_0x4e8142){return{'model':db[_0x4e8142['model']],'as':_0x4e8142['as'],'attributes':_0x4e8142[_0xe969('0x1e')],'include':_0x4e8142['include']?_['map'](_0x4e8142[_0xe969('0x20')],function(_0x16be53){return{'model':db[_0x16be53['model']],'as':_0x16be53['as'],'attributes':_0x16be53['attributes'],'include':_0x16be53[_0xe969('0x20')]?_['map'](_0x16be53[_0xe969('0x20')],function(_0x4f8fa5){return{'model':db[_0x4f8fa5[_0xe969('0x22')]],'as':_0x4f8fa5['as'],'attributes':_0x4f8fa5[_0xe969('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe969('0x23')](function(_0x30a4eb){logger[_0xe969('0xf')]('ShowChatQueue',_0xca6728);logger[_0xe969('0x12')]('ShowChatQueue',_0xca6728,JSON[_0xe969('0x14')](_0x30a4eb));_0x4b0af3(_0x30a4eb);})[_0xe969('0x19')](function(_0x4a44f2){logger['error'](_0xe969('0x24'),_0x4a44f2['message'],_0xca6728);_0x2a1c7f(_0x1dff3e[_0xe969('0x16')](0x1f4,_0x4a44f2[_0xe969('0x17')]));});});};
\ No newline at end of file
+var _0x99e7=['socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x99e7,0x1b5));var _0x799e=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x99e7[_0x25b24a];return _0x224e68;};'use strict';var _=require(_0x799e('0x0'));var util=require(_0x799e('0x1'));var moment=require(_0x799e('0x2'));var BPromise=require(_0x799e('0x3'));var rs=require(_0x799e('0x4'));var fs=require('fs');var Redis=require(_0x799e('0x5'));var db=require(_0x799e('0x6'))['db'];var utils=require(_0x799e('0x7'));var logger=require(_0x799e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x799e('0x9'));var client=jayson['client'][_0x799e('0xa')]({'port':0x232a});config['redis']=_[_0x799e('0xb')](config[_0x799e('0xc')],{'host':_0x799e('0xd'),'port':0x18eb});var socket=require(_0x799e('0xe'))(new Redis(config[_0x799e('0xc')]));require('./chatQueue.socket')[_0x799e('0xf')](socket);function respondWithRpcPromise(_0x3477f3,_0x38cd71,_0x388e5c){return new BPromise(function(_0x5cf95e,_0x11615a){return client[_0x799e('0x10')](_0x3477f3,_0x388e5c)[_0x799e('0x11')](function(_0x108aa9){logger[_0x799e('0x12')](_0x799e('0x13'),_0x38cd71,_0x799e('0x14'));logger['debug'](_0x799e('0x15'),_0x38cd71,_0x799e('0x14'),JSON[_0x799e('0x16')](_0x108aa9));if(_0x108aa9[_0x799e('0x17')]){if(_0x108aa9[_0x799e('0x17')][_0x799e('0x18')]===0x1f4){logger[_0x799e('0x17')](_0x799e('0x13'),_0x38cd71,_0x108aa9[_0x799e('0x17')][_0x799e('0x19')]);return _0x11615a(_0x108aa9['error']['message']);}logger[_0x799e('0x17')](_0x799e('0x13'),_0x38cd71,_0x108aa9[_0x799e('0x17')]['message']);return _0x5cf95e(_0x108aa9[_0x799e('0x17')][_0x799e('0x19')]);}else{logger[_0x799e('0x12')](_0x799e('0x13'),_0x38cd71,_0x799e('0x14'));_0x5cf95e(_0x108aa9['result'][_0x799e('0x19')]);}})[_0x799e('0x1a')](function(_0x27f335){logger[_0x799e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x38cd71,_0x27f335);_0x11615a(_0x27f335);});});}exports[_0x799e('0x1b')]=function(_0x4c5500){var _0x1b1478=this;return new Promise(function(_0x29f9d9,_0x42e195){return db[_0x799e('0x1c')][_0x799e('0x1d')]({'raw':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')][_0x799e('0x1f')]===undefined?!![]:![]:!![],'where':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')][_0x799e('0x20')]||null:null,'attributes':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')]['attributes']||null:null,'limit':_0x4c5500[_0x799e('0x1e')]?_0x4c5500[_0x799e('0x1e')][_0x799e('0x21')]||null:null,'include':_0x4c5500['options']?_0x4c5500['options'][_0x799e('0x22')]?_[_0x799e('0x23')](_0x4c5500[_0x799e('0x1e')][_0x799e('0x22')],function(_0x39c61f){return{'model':db[_0x39c61f[_0x799e('0x24')]],'as':_0x39c61f['as'],'attributes':_0x39c61f[_0x799e('0x25')],'include':_0x39c61f[_0x799e('0x22')]?_[_0x799e('0x23')](_0x39c61f[_0x799e('0x22')],function(_0xde9d3c){return{'model':db[_0xde9d3c[_0x799e('0x24')]],'as':_0xde9d3c['as'],'attributes':_0xde9d3c['attributes'],'include':_0xde9d3c[_0x799e('0x22')]?_['map'](_0xde9d3c[_0x799e('0x22')],function(_0x2a5cf0){return{'model':db[_0x2a5cf0[_0x799e('0x24')]],'as':_0x2a5cf0['as'],'attributes':_0x2a5cf0['attributes']};}):[]};}):[]};}):[]:[]})[_0x799e('0x11')](function(_0x423728){logger[_0x799e('0x12')](_0x799e('0x1b'),_0x4c5500);logger[_0x799e('0x26')](_0x799e('0x1b'),_0x4c5500,JSON[_0x799e('0x16')](_0x423728));_0x29f9d9(_0x423728);})[_0x799e('0x1a')](function(_0x87d384){logger[_0x799e('0x17')](_0x799e('0x1b'),_0x87d384[_0x799e('0x19')],_0x4c5500);_0x42e195(_0x1b1478[_0x799e('0x17')](0x1f4,_0x87d384[_0x799e('0x19')]));});});};exports[_0x799e('0x27')]=function(_0x40acd3){var _0x486a2b=this;return new Promise(function(_0x206ad2,_0x2cc497){return db[_0x799e('0x1c')][_0x799e('0x28')]({'raw':_0x40acd3[_0x799e('0x1e')]?_0x40acd3[_0x799e('0x1e')][_0x799e('0x1f')]===undefined?!![]:![]:!![],'where':_0x40acd3[_0x799e('0x1e')]?_0x40acd3[_0x799e('0x1e')][_0x799e('0x20')]||null:null,'attributes':_0x40acd3['options']?_0x40acd3[_0x799e('0x1e')]['attributes']||null:null,'include':_0x40acd3[_0x799e('0x1e')]?_0x40acd3[_0x799e('0x1e')][_0x799e('0x22')]?_['map'](_0x40acd3[_0x799e('0x1e')]['include'],function(_0x1ff802){return{'model':db[_0x1ff802['model']],'as':_0x1ff802['as'],'attributes':_0x1ff802[_0x799e('0x25')],'include':_0x1ff802['include']?_[_0x799e('0x23')](_0x1ff802[_0x799e('0x22')],function(_0x47071d){return{'model':db[_0x47071d[_0x799e('0x24')]],'as':_0x47071d['as'],'attributes':_0x47071d['attributes'],'include':_0x47071d[_0x799e('0x22')]?_[_0x799e('0x23')](_0x47071d[_0x799e('0x22')],function(_0xad5cfa){return{'model':db[_0xad5cfa['model']],'as':_0xad5cfa['as'],'attributes':_0xad5cfa[_0x799e('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b00db){logger[_0x799e('0x12')](_0x799e('0x27'),_0x40acd3);logger[_0x799e('0x26')](_0x799e('0x27'),_0x40acd3,JSON[_0x799e('0x16')](_0x5b00db));_0x206ad2(_0x5b00db);})[_0x799e('0x1a')](function(_0x51ae05){logger[_0x799e('0x17')]('ShowChatQueue',_0x51ae05[_0x799e('0x19')],_0x40acd3);_0x2cc497(_0x486a2b[_0x799e('0x17')](0x1f4,_0x51ae05[_0x799e('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 24889a9..de1f8ed 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x3813d1,_0x1a3c34){var _0x3234a4=function(_0x3cbc92){while(--_0x3cbc92){_0x3813d1['push'](_0x3813d1['shift']());}};_0x3234a4(++_0x1a3c34);}(_0x0b0e,0x187));var _0xe0b0=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0b0e[_0x8c43de];return _0xa6591b;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}};
\ No newline at end of file
+var _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0x139b3d,_0x41cd2e){var _0x39c727=function(_0x6a310c){while(--_0x6a310c){_0x139b3d['push'](_0x139b3d['shift']());}};_0x39c727(++_0x41cd2e);}(_0xadb5,0xad));var _0x5adb=function(_0x3fd1b8,_0x1cfacf){_0x3fd1b8=_0x3fd1b8-0x0;var _0xdef695=_0xadb5[_0x3fd1b8];return _0xdef695;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){ChatQueueEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);ChatQueueEvents['on'](_0x353885,_0x47228a);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index af6d764..b227bcb 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 _0x76f1=['addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','getMembers','/:id/teams','getTeams','create','post','addTeams'];(function(_0xe1a964,_0x5ec09d){var _0x3de37b=function(_0x406ffc){while(--_0x406ffc){_0xe1a964['push'](_0xe1a964['shift']());}};_0x3de37b(++_0x5ec09d);}(_0x76f1,0x167));var _0x176f=function(_0x3666a0,_0x36636c){_0x3666a0=_0x3666a0-0x0;var _0x47882d=_0x76f1[_0x3666a0];return _0x47882d;};'use strict';var multer=require(_0x176f('0x0'));var util=require(_0x176f('0x1'));var path=require(_0x176f('0x2'));var timeout=require('connect-timeout');var express=require(_0x176f('0x3'));var router=express[_0x176f('0x4')]();var auth=require(_0x176f('0x5'));var interaction=require(_0x176f('0x6'));var config=require(_0x176f('0x7'));var controller=require('./chatQueue.controller');router[_0x176f('0x8')]('/',auth['isAuthenticated'](),controller[_0x176f('0x9')]);router[_0x176f('0x8')]('/describe',auth[_0x176f('0xa')](),controller[_0x176f('0xb')]);router['get'](_0x176f('0xc'),auth[_0x176f('0xa')](),controller['show']);router['get']('/:id/members',auth[_0x176f('0xa')](),controller[_0x176f('0xd')]);router[_0x176f('0x8')](_0x176f('0xe'),auth['isAuthenticated'](),controller[_0x176f('0xf')]);router['get']('/:id/users',auth[_0x176f('0xa')](),controller['getAgents']);router['post']('/',auth[_0x176f('0xa')](),controller[_0x176f('0x10')]);router[_0x176f('0x11')](_0x176f('0xe'),auth[_0x176f('0xa')](),controller[_0x176f('0x12')]);router['post']('/:id/users',auth[_0x176f('0xa')](),controller[_0x176f('0x13')]);router[_0x176f('0x14')]('/:id',auth[_0x176f('0xa')](),controller[_0x176f('0x15')]);router[_0x176f('0x16')](_0x176f('0xc'),auth['isAuthenticated'](),controller[_0x176f('0x17')]);router[_0x176f('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x176f('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x176f('0x19')]);module[_0x176f('0x1a')]=router;
\ No newline at end of file
+var _0x12fa=['removeTeams','multer','util','path','express','../../components/auth/service','index','get','/:id','/:id/members','isAuthenticated','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy'];(function(_0x3f43ef,_0x4c2ba9){var _0x20af43=function(_0x17fb2b){while(--_0x17fb2b){_0x3f43ef['push'](_0x3f43ef['shift']());}};_0x20af43(++_0x4c2ba9);}(_0x12fa,0x6f));var _0xa12f=function(_0x91bcac,_0x562d02){_0x91bcac=_0x91bcac-0x0;var _0x4cd502=_0x12fa[_0x91bcac];return _0x4cd502;};'use strict';var multer=require(_0xa12f('0x0'));var util=require(_0xa12f('0x1'));var path=require(_0xa12f('0x2'));var timeout=require('connect-timeout');var express=require(_0xa12f('0x3'));var router=express['Router']();var auth=require(_0xa12f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa12f('0x5')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa12f('0x6')](_0xa12f('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xa12f('0x6')](_0xa12f('0x8'),auth[_0xa12f('0x9')](),controller[_0xa12f('0xa')]);router[_0xa12f('0x6')](_0xa12f('0xb'),auth[_0xa12f('0x9')](),controller['getTeams']);router[_0xa12f('0x6')](_0xa12f('0xc'),auth[_0xa12f('0x9')](),controller[_0xa12f('0xd')]);router[_0xa12f('0xe')]('/',auth['isAuthenticated'](),controller[_0xa12f('0xf')]);router[_0xa12f('0xe')]('/:id/teams',auth[_0xa12f('0x9')](),controller[_0xa12f('0x10')]);router[_0xa12f('0xe')](_0xa12f('0xc'),auth[_0xa12f('0x9')](),controller['addAgents']);router[_0xa12f('0x11')](_0xa12f('0x7'),auth['isAuthenticated'](),controller[_0xa12f('0x12')]);router[_0xa12f('0x13')]('/:id',auth[_0xa12f('0x9')](),controller[_0xa12f('0x14')]);router['delete'](_0xa12f('0xb'),auth['isAuthenticated'](),controller[_0xa12f('0x15')]);router['delete'](_0xa12f('0xc'),auth['isAuthenticated'](),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 6d9c997..0056a62 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 _0x0990=['moment','sequelize','exports','STRING','DATE'];(function(_0x7d579a,_0x1580b){var _0x3b06cb=function(_0x4ba063){while(--_0x4ba063){_0x7d579a['push'](_0x7d579a['shift']());}};_0x3b06cb(++_0x1580b);}(_0x0990,0x64));var _0x0099=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x0990[_0x39bc44];return _0x2916d8;};'use strict';var moment=require(_0x0099('0x0'));var Sequelize=require(_0x0099('0x1'));module[_0x0099('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0099('0x3')]},'joinAt':{'type':Sequelize[_0x0099('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0099('0x4')]},'exitAt':{'type':Sequelize[_0x0099('0x4')]},'reason':{'type':Sequelize[_0x0099('0x3')]}};
\ No newline at end of file
+var _0x309c=['exports','STRING','DATE','sequelize'];(function(_0x1ca5a3,_0x40b024){var _0xc8acbf=function(_0x5b50df){while(--_0x5b50df){_0x1ca5a3['push'](_0x1ca5a3['shift']());}};_0xc8acbf(++_0x40b024);}(_0x309c,0x1a7));var _0xc309=function(_0x184027,_0x8018f6){_0x184027=_0x184027-0x0;var _0xf0e06c=_0x309c[_0x184027];return _0xf0e06c;};'use strict';var moment=require('moment');var Sequelize=require(_0xc309('0x0'));module[_0xc309('0x1')]={'uniqueid':{'type':Sequelize[_0xc309('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc309('0x3')]},'leaveAt':{'type':Sequelize[_0xc309('0x3')]},'acceptAt':{'type':Sequelize[_0xc309('0x3')]},'exitAt':{'type':Sequelize[_0xc309('0x3')]},'reason':{'type':Sequelize[_0xc309('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e45df15..0874740 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 _0x1674=['rows','catch','show','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','save','then','destroy','stack','name','send','index','ChatQueueReport','rawAttributes','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','findAll'];(function(_0x4e2359,_0x52ea8f){var _0x450821=function(_0x20b293){while(--_0x20b293){_0x4e2359['push'](_0x4e2359['shift']());}};_0x450821(++_0x52ea8f);}(_0x1674,0x139));var _0x4167=function(_0x153aae,_0x28cf2c){_0x153aae=_0x153aae-0x0;var _0xb918f7=_0x1674[_0x153aae];return _0xb918f7;};'use strict';var pdf=require(_0x4167('0x0'));var emlformat=require(_0x4167('0x1'));var rimraf=require(_0x4167('0x2'));var zipdir=require(_0x4167('0x3'));var jsonpatch=require(_0x4167('0x4'));var rp=require('request-promise');var moment=require(_0x4167('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4167('0x6'));var util=require(_0x4167('0x7'));var path=require(_0x4167('0x8'));var sox=require('sox');var csv=require(_0x4167('0x9'));var ejs=require(_0x4167('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4167('0xb'));var crypto=require(_0x4167('0xc'));var jsforce=require(_0x4167('0xd'));var deskjs=require(_0x4167('0xe'));var toCsv=require(_0x4167('0x9'));var querystring=require(_0x4167('0xf'));var Papa=require(_0x4167('0x10'));var Redis=require(_0x4167('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4167('0x12'));var as=require(_0x4167('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4167('0x14'))(_0x4167('0x15'));var utils=require(_0x4167('0x16'));var config=require(_0x4167('0x17'));var db=require(_0x4167('0x18'))['db'];function respondWithStatusCode(_0x29010e,_0x280845){_0x280845=_0x280845||0xcc;return function(_0xa0aeb0){if(_0xa0aeb0){return _0x29010e[_0x4167('0x19')](_0x280845);}return _0x29010e[_0x4167('0x1a')](_0x280845)[_0x4167('0x1b')]();};}function respondWithResult(_0x353fa6,_0x10ca2b){_0x10ca2b=_0x10ca2b||0xc8;return function(_0xa12e9d){if(_0xa12e9d){return _0x353fa6['status'](_0x10ca2b)[_0x4167('0x1c')](_0xa12e9d);}};}function respondWithFilteredResult(_0x3a074a,_0x1096b3){return function(_0x22d9c4){if(_0x22d9c4){var _0x38be37=_0x22d9c4['count'],_0x154f53=_0x1096b3['offset'],_0x1ca433=_0x1096b3[_0x4167('0x1d')]+_0x1096b3['limit'],_0x2056f5;if(_0x1ca433>=_0x38be37){_0x1ca433=_0x38be37;_0x2056f5=0xc8;}else{_0x2056f5=0xce;}_0x3a074a['status'](_0x2056f5);return _0x3a074a[_0x4167('0x1e')](_0x4167('0x1f'),_0x154f53+'-'+_0x1ca433+'/'+_0x38be37)[_0x4167('0x1c')](_0x22d9c4);}return null;};}function patchUpdates(_0x21b795){return function(_0x377b96){try{jsonpatch[_0x4167('0x20')](_0x377b96,_0x21b795,!![]);}catch(_0x362d5a){return BPromise['reject'](_0x362d5a);}return _0x377b96[_0x4167('0x21')]();};}function saveUpdates(_0x40cb01,_0x1d8d22){return function(_0x22072b){if(_0x22072b){return _0x22072b['update'](_0x40cb01)[_0x4167('0x22')](function(_0x2a2fd4){return _0x2a2fd4;});}return null;};}function removeEntity(_0x10e7bb,_0x39f272){return function(_0x47cf1f){if(_0x47cf1f){return _0x47cf1f[_0x4167('0x23')]()[_0x4167('0x22')](function(){_0x10e7bb['status'](0xcc)[_0x4167('0x1b')]();});}};}function handleEntityNotFound(_0x55db84,_0x76a02a){return function(_0x27b649){if(!_0x27b649){_0x55db84[_0x4167('0x19')](0x194);}return _0x27b649;};}function handleError(_0x38681a,_0x51b4cf){_0x51b4cf=_0x51b4cf||0x1f4;return function(_0x435bfd){logger['error'](_0x435bfd[_0x4167('0x24')]);if(_0x435bfd[_0x4167('0x25')]){delete _0x435bfd[_0x4167('0x25')];}_0x38681a['status'](_0x51b4cf)[_0x4167('0x26')](_0x435bfd);};}exports[_0x4167('0x27')]=function(_0x12b364,_0x3eaea0){var _0x489e90={},_0x3028b2={},_0x3a9ab1={'count':0x0,'rows':[]};var _0x585767=db[_0x4167('0x28')][_0x4167('0x29')];_0x3028b2['model']=_['keys'](_0x585767);_0x3028b2[_0x4167('0x2a')]=_[_0x4167('0x2b')](_0x12b364['query']);_0x3028b2[_0x4167('0x2c')]=_['intersection'](_0x3028b2[_0x4167('0x2d')],_0x3028b2[_0x4167('0x2a')]);_0x489e90['attributes']=_[_0x4167('0x2e')](_0x3028b2[_0x4167('0x2d')],qs['fields'](_0x12b364[_0x4167('0x2a')][_0x4167('0x2f')]));_0x489e90[_0x4167('0x30')]=_0x489e90[_0x4167('0x30')][_0x4167('0x31')]?_0x489e90[_0x4167('0x30')]:_0x3028b2[_0x4167('0x2d')];if(!_0x12b364[_0x4167('0x2a')][_0x4167('0x32')]('nolimit')){_0x489e90['limit']=qs[_0x4167('0x33')](_0x12b364[_0x4167('0x2a')]['limit']);_0x489e90[_0x4167('0x1d')]=qs[_0x4167('0x1d')](_0x12b364[_0x4167('0x2a')][_0x4167('0x1d')]);}_0x489e90[_0x4167('0x34')]=qs[_0x4167('0x35')](_0x12b364[_0x4167('0x2a')][_0x4167('0x35')]);_0x489e90[_0x4167('0x36')]=qs[_0x4167('0x2c')](_[_0x4167('0x37')](_0x12b364[_0x4167('0x2a')],_0x3028b2[_0x4167('0x2c')]));if(_0x12b364['query'][_0x4167('0x38')]){_0x489e90[_0x4167('0x36')]=_[_0x4167('0x39')](_0x489e90[_0x4167('0x36')],{'$or':_[_0x4167('0x3a')](_0x585767,function(_0x20608b){if(_0x20608b[_0x4167('0x3b')][_0x4167('0x3c')]!==_0x4167('0x3d')){var _0x504c0c={};_0x504c0c[_0x20608b[_0x4167('0x3e')]]={'$like':'%'+_0x12b364[_0x4167('0x2a')]['filter']+'%'};return _0x504c0c;}})});}_0x489e90=_[_0x4167('0x39')]({},_0x489e90,_0x12b364[_0x4167('0x3f')]);var _0x33e3ac={'where':_0x489e90[_0x4167('0x36')]};return db[_0x4167('0x28')][_0x4167('0x40')](_0x33e3ac)[_0x4167('0x22')](function(_0x45abd8){_0x3a9ab1[_0x4167('0x40')]=_0x45abd8;if(_0x12b364[_0x4167('0x2a')][_0x4167('0x41')]){_0x489e90['include']=[{'all':!![]}];}return db[_0x4167('0x28')][_0x4167('0x42')](_0x489e90);})[_0x4167('0x22')](function(_0x2b2de5){_0x3a9ab1[_0x4167('0x43')]=_0x2b2de5;return _0x3a9ab1;})['then'](respondWithFilteredResult(_0x3eaea0,_0x489e90))[_0x4167('0x44')](handleError(_0x3eaea0,null));};exports[_0x4167('0x45')]=function(_0x250702,_0x4313fd){var _0x525841={'raw':!![],'where':{'id':_0x250702['params']['id']}},_0x464854={};_0x464854[_0x4167('0x2d')]=_[_0x4167('0x2b')](db[_0x4167('0x28')][_0x4167('0x29')]);_0x464854[_0x4167('0x2a')]=_[_0x4167('0x2b')](_0x250702['query']);_0x464854[_0x4167('0x2c')]=_[_0x4167('0x2e')](_0x464854[_0x4167('0x2d')],_0x464854[_0x4167('0x2a')]);_0x525841['attributes']=_[_0x4167('0x2e')](_0x464854[_0x4167('0x2d')],qs[_0x4167('0x2f')](_0x250702[_0x4167('0x2a')][_0x4167('0x2f')]));_0x525841[_0x4167('0x30')]=_0x525841[_0x4167('0x30')][_0x4167('0x31')]?_0x525841['attributes']:_0x464854[_0x4167('0x2d')];if(_0x250702['query'][_0x4167('0x41')]){_0x525841['include']=[{'all':!![]}];}_0x525841=_[_0x4167('0x39')]({},_0x525841,_0x250702['options']);return db[_0x4167('0x28')][_0x4167('0x46')](_0x525841)[_0x4167('0x22')](handleEntityNotFound(_0x4313fd,null))[_0x4167('0x22')](respondWithResult(_0x4313fd,null))[_0x4167('0x44')](handleError(_0x4313fd,null));};exports[_0x4167('0x47')]=function(_0xa3df06,_0xdbba01){return db[_0x4167('0x28')][_0x4167('0x47')](_0xa3df06[_0x4167('0x48')],{})[_0x4167('0x22')](respondWithResult(_0xdbba01,0xc9))[_0x4167('0x44')](handleError(_0xdbba01,null));};exports[_0x4167('0x49')]=function(_0x241327,_0x5ef9c5){if(_0x241327[_0x4167('0x48')]['id']){delete _0x241327[_0x4167('0x48')]['id'];}return db[_0x4167('0x28')][_0x4167('0x46')]({'where':{'id':_0x241327[_0x4167('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ef9c5,null))[_0x4167('0x22')](saveUpdates(_0x241327[_0x4167('0x48')],null))[_0x4167('0x22')](respondWithResult(_0x5ef9c5,null))[_0x4167('0x44')](handleError(_0x5ef9c5,null));};exports['destroy']=function(_0x27bd4d,_0x4633ce){return db[_0x4167('0x28')][_0x4167('0x46')]({'where':{'id':_0x27bd4d[_0x4167('0x4a')]['id']}})[_0x4167('0x22')](handleEntityNotFound(_0x4633ce,null))[_0x4167('0x22')](removeEntity(_0x4633ce,null))[_0x4167('0x44')](handleError(_0x4633ce,null));};exports['describe']=function(_0x5253d9,_0x13e8be){return db[_0x4167('0x28')][_0x4167('0x4b')]()[_0x4167('0x22')](respondWithResult(_0x13e8be,null))[_0x4167('0x44')](handleError(_0x13e8be,null));};
\ No newline at end of file
+var _0xd9a8=['squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','field','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash'];(function(_0x56d0aa,_0x455804){var _0x38e885=function(_0x3d6254){while(--_0x3d6254){_0x56d0aa['push'](_0x56d0aa['shift']());}};_0x38e885(++_0x455804);}(_0xd9a8,0x12c));var _0x8d9a=function(_0x5daea6,_0x4e7c17){_0x5daea6=_0x5daea6-0x0;var _0x23d522=_0xd9a8[_0x5daea6];return _0x23d522;};'use strict';var pdf=require(_0x8d9a('0x0'));var emlformat=require(_0x8d9a('0x1'));var rimraf=require(_0x8d9a('0x2'));var zipdir=require(_0x8d9a('0x3'));var jsonpatch=require(_0x8d9a('0x4'));var rp=require(_0x8d9a('0x5'));var moment=require(_0x8d9a('0x6'));var BPromise=require(_0x8d9a('0x7'));var Mustache=require('mustache');var util=require(_0x8d9a('0x8'));var path=require(_0x8d9a('0x9'));var sox=require(_0x8d9a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8d9a('0xb'));var squel=require(_0x8d9a('0xc'));var crypto=require(_0x8d9a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d9a('0xe'));var querystring=require(_0x8d9a('0xf'));var Papa=require(_0x8d9a('0x10'));var Redis=require(_0x8d9a('0x11'));var authService=require(_0x8d9a('0x12'));var qs=require(_0x8d9a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d9a('0x14'));var logger=require(_0x8d9a('0x15'))(_0x8d9a('0x16'));var utils=require(_0x8d9a('0x17'));var config=require(_0x8d9a('0x18'));var db=require(_0x8d9a('0x19'))['db'];function respondWithStatusCode(_0xd08567,_0x185b16){_0x185b16=_0x185b16||0xcc;return function(_0x2dae86){if(_0x2dae86){return _0xd08567['sendStatus'](_0x185b16);}return _0xd08567[_0x8d9a('0x1a')](_0x185b16)[_0x8d9a('0x1b')]();};}function respondWithResult(_0x1caad4,_0x4a17b7){_0x4a17b7=_0x4a17b7||0xc8;return function(_0xbff0d7){if(_0xbff0d7){return _0x1caad4[_0x8d9a('0x1a')](_0x4a17b7)['json'](_0xbff0d7);}};}function respondWithFilteredResult(_0x16f2ed,_0x41b518){return function(_0x415782){if(_0x415782){var _0x1befc6=_0x415782[_0x8d9a('0x1c')],_0x35a1b9=_0x41b518[_0x8d9a('0x1d')],_0xdd4730=_0x41b518[_0x8d9a('0x1d')]+_0x41b518[_0x8d9a('0x1e')],_0x25205a;if(_0xdd4730>=_0x1befc6){_0xdd4730=_0x1befc6;_0x25205a=0xc8;}else{_0x25205a=0xce;}_0x16f2ed[_0x8d9a('0x1a')](_0x25205a);return _0x16f2ed[_0x8d9a('0x1f')](_0x8d9a('0x20'),_0x35a1b9+'-'+_0xdd4730+'/'+_0x1befc6)[_0x8d9a('0x21')](_0x415782);}return null;};}function patchUpdates(_0x409b0e){return function(_0xa9134a){try{jsonpatch[_0x8d9a('0x22')](_0xa9134a,_0x409b0e,!![]);}catch(_0x57b6a3){return BPromise[_0x8d9a('0x23')](_0x57b6a3);}return _0xa9134a['save']();};}function saveUpdates(_0x217c02,_0x5a6383){return function(_0x5dae72){if(_0x5dae72){return _0x5dae72[_0x8d9a('0x24')](_0x217c02)[_0x8d9a('0x25')](function(_0x3aaf46){return _0x3aaf46;});}return null;};}function removeEntity(_0x5acfd5,_0x43fa38){return function(_0x569c2d){if(_0x569c2d){return _0x569c2d[_0x8d9a('0x26')]()['then'](function(){_0x5acfd5['status'](0xcc)[_0x8d9a('0x1b')]();});}};}function handleEntityNotFound(_0x3c024a,_0x127afa){return function(_0x3c8536){if(!_0x3c8536){_0x3c024a[_0x8d9a('0x27')](0x194);}return _0x3c8536;};}function handleError(_0x119421,_0x36bee9){_0x36bee9=_0x36bee9||0x1f4;return function(_0xabf22d){logger[_0x8d9a('0x28')](_0xabf22d[_0x8d9a('0x29')]);if(_0xabf22d[_0x8d9a('0x2a')]){delete _0xabf22d[_0x8d9a('0x2a')];}_0x119421[_0x8d9a('0x1a')](_0x36bee9)[_0x8d9a('0x2b')](_0xabf22d);};}exports[_0x8d9a('0x2c')]=function(_0x3b2730,_0x2da76a){var _0x162053={},_0x31b946={},_0x261a7a={'count':0x0,'rows':[]};var _0x261a34=db[_0x8d9a('0x2d')][_0x8d9a('0x2e')];_0x31b946[_0x8d9a('0x2f')]=_['keys'](_0x261a34);_0x31b946['query']=_[_0x8d9a('0x30')](_0x3b2730[_0x8d9a('0x31')]);_0x31b946['filters']=_[_0x8d9a('0x32')](_0x31b946[_0x8d9a('0x2f')],_0x31b946['query']);_0x162053[_0x8d9a('0x33')]=_[_0x8d9a('0x32')](_0x31b946[_0x8d9a('0x2f')],qs[_0x8d9a('0x34')](_0x3b2730['query'][_0x8d9a('0x34')]));_0x162053[_0x8d9a('0x33')]=_0x162053[_0x8d9a('0x33')][_0x8d9a('0x35')]?_0x162053[_0x8d9a('0x33')]:_0x31b946[_0x8d9a('0x2f')];if(!_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x36')](_0x8d9a('0x37'))){_0x162053[_0x8d9a('0x1e')]=qs[_0x8d9a('0x1e')](_0x3b2730[_0x8d9a('0x31')]['limit']);_0x162053[_0x8d9a('0x1d')]=qs['offset'](_0x3b2730['query']['offset']);}_0x162053[_0x8d9a('0x38')]=qs[_0x8d9a('0x39')](_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x39')]);_0x162053['where']=qs[_0x8d9a('0x3a')](_[_0x8d9a('0x3b')](_0x3b2730['query'],_0x31b946[_0x8d9a('0x3a')]));if(_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x3c')]){_0x162053[_0x8d9a('0x3d')]=_[_0x8d9a('0x3e')](_0x162053[_0x8d9a('0x3d')],{'$or':_[_0x8d9a('0x3f')](_0x261a34,function(_0x338e58){if(_0x338e58[_0x8d9a('0x40')]['key']!==_0x8d9a('0x41')){var _0x3cd3ca={};_0x3cd3ca[_0x338e58[_0x8d9a('0x42')]]={'$like':'%'+_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x3c')]+'%'};return _0x3cd3ca;}})});}_0x162053=_[_0x8d9a('0x3e')]({},_0x162053,_0x3b2730['options']);var _0x420f47={'where':_0x162053['where']};return db['ChatQueueReport']['count'](_0x420f47)[_0x8d9a('0x25')](function(_0x5235a6){_0x261a7a[_0x8d9a('0x1c')]=_0x5235a6;if(_0x3b2730[_0x8d9a('0x31')][_0x8d9a('0x43')]){_0x162053[_0x8d9a('0x44')]=[{'all':!![]}];}return db[_0x8d9a('0x2d')][_0x8d9a('0x45')](_0x162053);})[_0x8d9a('0x25')](function(_0x2dc046){_0x261a7a['rows']=_0x2dc046;return _0x261a7a;})[_0x8d9a('0x25')](respondWithFilteredResult(_0x2da76a,_0x162053))[_0x8d9a('0x46')](handleError(_0x2da76a,null));};exports[_0x8d9a('0x47')]=function(_0x131eab,_0x211465){var _0x70eaa5={'raw':!![],'where':{'id':_0x131eab['params']['id']}},_0x33d5cd={};_0x33d5cd[_0x8d9a('0x2f')]=_['keys'](db['ChatQueueReport'][_0x8d9a('0x2e')]);_0x33d5cd['query']=_[_0x8d9a('0x30')](_0x131eab[_0x8d9a('0x31')]);_0x33d5cd[_0x8d9a('0x3a')]=_[_0x8d9a('0x32')](_0x33d5cd['model'],_0x33d5cd[_0x8d9a('0x31')]);_0x70eaa5[_0x8d9a('0x33')]=_[_0x8d9a('0x32')](_0x33d5cd['model'],qs['fields'](_0x131eab['query']['fields']));_0x70eaa5['attributes']=_0x70eaa5[_0x8d9a('0x33')]['length']?_0x70eaa5[_0x8d9a('0x33')]:_0x33d5cd[_0x8d9a('0x2f')];if(_0x131eab['query'][_0x8d9a('0x43')]){_0x70eaa5[_0x8d9a('0x44')]=[{'all':!![]}];}_0x70eaa5=_[_0x8d9a('0x3e')]({},_0x70eaa5,_0x131eab[_0x8d9a('0x48')]);return db[_0x8d9a('0x2d')][_0x8d9a('0x49')](_0x70eaa5)[_0x8d9a('0x25')](handleEntityNotFound(_0x211465,null))[_0x8d9a('0x25')](respondWithResult(_0x211465,null))[_0x8d9a('0x46')](handleError(_0x211465,null));};exports[_0x8d9a('0x4a')]=function(_0x462f67,_0x47c007){return db[_0x8d9a('0x2d')][_0x8d9a('0x4a')](_0x462f67['body'],{})[_0x8d9a('0x25')](respondWithResult(_0x47c007,0xc9))[_0x8d9a('0x46')](handleError(_0x47c007,null));};exports[_0x8d9a('0x24')]=function(_0x58434a,_0x4d0ca8){if(_0x58434a[_0x8d9a('0x4b')]['id']){delete _0x58434a[_0x8d9a('0x4b')]['id'];}return db[_0x8d9a('0x2d')][_0x8d9a('0x49')]({'where':{'id':_0x58434a[_0x8d9a('0x4c')]['id']}})[_0x8d9a('0x25')](handleEntityNotFound(_0x4d0ca8,null))[_0x8d9a('0x25')](saveUpdates(_0x58434a['body'],null))[_0x8d9a('0x25')](respondWithResult(_0x4d0ca8,null))['catch'](handleError(_0x4d0ca8,null));};exports[_0x8d9a('0x26')]=function(_0x1c2a19,_0x5eec45){return db[_0x8d9a('0x2d')][_0x8d9a('0x49')]({'where':{'id':_0x1c2a19[_0x8d9a('0x4c')]['id']}})[_0x8d9a('0x25')](handleEntityNotFound(_0x5eec45,null))[_0x8d9a('0x25')](removeEntity(_0x5eec45,null))[_0x8d9a('0x46')](handleError(_0x5eec45,null));};exports['describe']=function(_0x14cb64,_0x2f40a8){return db[_0x8d9a('0x2d')][_0x8d9a('0x4d')]()['then'](respondWithResult(_0x2f40a8,null))['catch'](handleError(_0x2f40a8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 8b2073c..b8534a6 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 _0x1a0a=['./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x390947,_0x172077){var _0x18c126=function(_0x3caeae){while(--_0x3caeae){_0x390947['push'](_0x390947['shift']());}};_0x18c126(++_0x172077);}(_0x1a0a,0x1e6));var _0xa1a0=function(_0x3727a9,_0x1c2edb){_0x3727a9=_0x3727a9-0x0;var _0xa16806=_0x1a0a[_0x3727a9];return _0xa16806;};'use strict';var _=require(_0xa1a0('0x0'));var util=require(_0xa1a0('0x1'));var logger=require(_0xa1a0('0x2'))(_0xa1a0('0x3'));var moment=require(_0xa1a0('0x4'));var BPromise=require(_0xa1a0('0x5'));var rp=require(_0xa1a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1a0('0x7'));var config=require('../../config/environment');var attributes=require(_0xa1a0('0x8'));module[_0xa1a0('0x9')]=function(_0x2670a9,_0x4435b6){return _0x2670a9[_0xa1a0('0xa')](_0xa1a0('0xb'),attributes,{'tableName':_0xa1a0('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ddd=['report_chat_queue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatQueueReport.attributes','exports','define','ChatQueueReport'];(function(_0x49d467,_0x8149a3){var _0x46d7de=function(_0x2b1df7){while(--_0x2b1df7){_0x49d467['push'](_0x49d467['shift']());}};_0x46d7de(++_0x8149a3);}(_0x3ddd,0xd1));var _0xd3dd=function(_0x316e35,_0x15a76a){_0x316e35=_0x316e35-0x0;var _0x3713f6=_0x3ddd[_0x316e35];return _0x3713f6;};'use strict';var _=require(_0xd3dd('0x0'));var util=require(_0xd3dd('0x1'));var logger=require(_0xd3dd('0x2'))(_0xd3dd('0x3'));var moment=require(_0xd3dd('0x4'));var BPromise=require('bluebird');var rp=require(_0xd3dd('0x5'));var fs=require('fs');var path=require(_0xd3dd('0x6'));var rimraf=require(_0xd3dd('0x7'));var config=require('../../config/environment');var attributes=require(_0xd3dd('0x8'));module[_0xd3dd('0x9')]=function(_0x106e82,_0x5242e3){return _0x106e82[_0xd3dd('0xa')](_0xd3dd('0xb'),attributes,{'tableName':_0xd3dd('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 450361e..97828c7 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 _0x76a7=['then','update','where','attributes','limit','UpdateChatQueueReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw'];(function(_0x2a57b9,_0x30cfed){var _0x20b6cc=function(_0x1fd421){while(--_0x1fd421){_0x2a57b9['push'](_0x2a57b9['shift']());}};_0x20b6cc(++_0x30cfed);}(_0x76a7,0xd2));var _0x776a=function(_0xc7b26f,_0x1cb695){_0xc7b26f=_0xc7b26f-0x0;var _0x5750f6=_0x76a7[_0xc7b26f];return _0x5750f6;};'use strict';var _=require(_0x776a('0x0'));var util=require('util');var moment=require(_0x776a('0x1'));var BPromise=require('bluebird');var rs=require(_0x776a('0x2'));var fs=require('fs');var Redis=require(_0x776a('0x3'));var db=require(_0x776a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x776a('0x5'))('rpc');var config=require(_0x776a('0x6'));var jayson=require(_0x776a('0x7'));var client=jayson[_0x776a('0x8')][_0x776a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd3ac,_0x16b624,_0x22615f){return new BPromise(function(_0x199c95,_0x3559a7){return client[_0x776a('0xa')](_0x2fd3ac,_0x22615f)['then'](function(_0x813c1a){logger[_0x776a('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x16b624,_0x776a('0xc'));logger[_0x776a('0xd')](_0x776a('0xe'),_0x16b624,_0x776a('0xc'),JSON[_0x776a('0xf')](_0x813c1a));if(_0x813c1a[_0x776a('0x10')]){if(_0x813c1a['error'][_0x776a('0x11')]===0x1f4){logger['error'](_0x776a('0x12'),_0x16b624,_0x813c1a[_0x776a('0x10')][_0x776a('0x13')]);return _0x3559a7(_0x813c1a[_0x776a('0x10')]['message']);}logger[_0x776a('0x10')](_0x776a('0x12'),_0x16b624,_0x813c1a[_0x776a('0x10')][_0x776a('0x13')]);return _0x199c95(_0x813c1a['error'][_0x776a('0x13')]);}else{logger[_0x776a('0xb')](_0x776a('0x12'),_0x16b624,_0x776a('0xc'));_0x199c95(_0x813c1a[_0x776a('0x14')]['message']);}})[_0x776a('0x15')](function(_0x48329b){logger[_0x776a('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x16b624,_0x48329b);_0x3559a7(_0x48329b);});});}exports[_0x776a('0x16')]=function(_0x5b7d65){var _0x344f3b=this;return new Promise(function(_0x225287,_0x58c1e3){return db[_0x776a('0x17')][_0x776a('0x18')](_0x5b7d65[_0x776a('0x19')],{'raw':_0x5b7d65[_0x776a('0x1a')]?_0x5b7d65['options'][_0x776a('0x1b')]===undefined?!![]:![]:!![]})[_0x776a('0x1c')](function(_0x5eca7c){logger[_0x776a('0xb')](_0x776a('0x16'),_0x5b7d65);logger[_0x776a('0xd')](_0x776a('0x16'),_0x5b7d65,JSON[_0x776a('0xf')](_0x5eca7c));_0x225287(_0x5eca7c);})['catch'](function(_0x1a35cc){logger[_0x776a('0x10')](_0x776a('0x16'),_0x1a35cc['message'],_0x5b7d65);_0x58c1e3(_0x344f3b[_0x776a('0x10')](0x1f4,_0x1a35cc['message']));});});};exports['UpdateChatQueueReport']=function(_0x5929d1){var _0x263537=this;return new Promise(function(_0x428320,_0xa28940){return db['ChatQueueReport'][_0x776a('0x1d')](_0x5929d1[_0x776a('0x19')],{'raw':_0x5929d1[_0x776a('0x1a')]?_0x5929d1[_0x776a('0x1a')][_0x776a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5929d1[_0x776a('0x1a')]?_0x5929d1[_0x776a('0x1a')][_0x776a('0x1e')]||null:null,'attributes':_0x5929d1['options']?_0x5929d1[_0x776a('0x1a')][_0x776a('0x1f')]||null:null,'limit':_0x5929d1[_0x776a('0x1a')]?_0x5929d1[_0x776a('0x1a')][_0x776a('0x20')]||null:null})[_0x776a('0x1c')](function(_0x39f0fd){logger[_0x776a('0xb')](_0x776a('0x21'),_0x5929d1);logger['debug'](_0x776a('0x21'),_0x5929d1,JSON[_0x776a('0xf')](_0x39f0fd));_0x428320(_0x39f0fd);})[_0x776a('0x15')](function(_0x55ffe6){logger[_0x776a('0x10')]('UpdateChatQueueReport',_0x55ffe6['message'],_0x5929d1);_0xa28940(_0x263537['error'](0x1f4,_0x55ffe6[_0x776a('0x13')]));});});};
\ No newline at end of file
+var _0x10b9=['result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x28d97d,_0x3abe64){var _0x2c538e=function(_0x31e746){while(--_0x31e746){_0x28d97d['push'](_0x28d97d['shift']());}};_0x2c538e(++_0x3abe64);}(_0x10b9,0x16d));var _0x910b=function(_0xb5b373,_0xd2d06){_0xb5b373=_0xb5b373-0x0;var _0xa3d925=_0x10b9[_0xb5b373];return _0xa3d925;};'use strict';var _=require('lodash');var util=require(_0x910b('0x0'));var moment=require('moment');var BPromise=require(_0x910b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x910b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x910b('0x3'));var logger=require(_0x910b('0x4'))(_0x910b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x910b('0x6')][_0x910b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bc611,_0x30990d,_0x2c894e){return new BPromise(function(_0x1a405d,_0x3a94b0){return client[_0x910b('0x8')](_0x2bc611,_0x2c894e)[_0x910b('0x9')](function(_0x176f55){logger[_0x910b('0xa')](_0x910b('0xb'),_0x30990d,_0x910b('0xc'));logger[_0x910b('0xd')](_0x910b('0xe'),_0x30990d,_0x910b('0xc'),JSON[_0x910b('0xf')](_0x176f55));if(_0x176f55['error']){if(_0x176f55['error'][_0x910b('0x10')]===0x1f4){logger[_0x910b('0x11')](_0x910b('0xb'),_0x30990d,_0x176f55[_0x910b('0x11')]['message']);return _0x3a94b0(_0x176f55[_0x910b('0x11')][_0x910b('0x12')]);}logger[_0x910b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x30990d,_0x176f55[_0x910b('0x11')][_0x910b('0x12')]);return _0x1a405d(_0x176f55['error']['message']);}else{logger['info'](_0x910b('0xb'),_0x30990d,_0x910b('0xc'));_0x1a405d(_0x176f55[_0x910b('0x13')][_0x910b('0x12')]);}})[_0x910b('0x14')](function(_0x4b1c76){logger['error'](_0x910b('0xb'),_0x30990d,_0x4b1c76);_0x3a94b0(_0x4b1c76);});});}exports['CreateChatQueueReport']=function(_0x5626ee){var _0xf5cc76=this;return new Promise(function(_0x54ba88,_0x11c161){return db[_0x910b('0x15')][_0x910b('0x16')](_0x5626ee[_0x910b('0x17')],{'raw':_0x5626ee[_0x910b('0x18')]?_0x5626ee[_0x910b('0x18')][_0x910b('0x19')]===undefined?!![]:![]:!![]})[_0x910b('0x9')](function(_0x34a378){logger[_0x910b('0xa')](_0x910b('0x1a'),_0x5626ee);logger[_0x910b('0xd')](_0x910b('0x1a'),_0x5626ee,JSON[_0x910b('0xf')](_0x34a378));_0x54ba88(_0x34a378);})[_0x910b('0x14')](function(_0x17e8bb){logger['error'](_0x910b('0x1a'),_0x17e8bb[_0x910b('0x12')],_0x5626ee);_0x11c161(_0xf5cc76[_0x910b('0x11')](0x1f4,_0x17e8bb[_0x910b('0x12')]));});});};exports[_0x910b('0x1b')]=function(_0x3d32ff){var _0x11e7d5=this;return new Promise(function(_0x3fd7a5,_0x57b44a){return db[_0x910b('0x15')][_0x910b('0x1c')](_0x3d32ff[_0x910b('0x17')],{'raw':_0x3d32ff['options']?_0x3d32ff[_0x910b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d32ff[_0x910b('0x18')]?_0x3d32ff[_0x910b('0x18')][_0x910b('0x1d')]||null:null,'attributes':_0x3d32ff[_0x910b('0x18')]?_0x3d32ff['options'][_0x910b('0x1e')]||null:null,'limit':_0x3d32ff[_0x910b('0x18')]?_0x3d32ff['options'][_0x910b('0x1f')]||null:null})[_0x910b('0x9')](function(_0x5dd89a){logger[_0x910b('0xa')]('UpdateChatQueueReport',_0x3d32ff);logger[_0x910b('0xd')](_0x910b('0x1b'),_0x3d32ff,JSON[_0x910b('0xf')](_0x5dd89a));_0x3fd7a5(_0x5dd89a);})[_0x910b('0x14')](function(_0x32c292){logger[_0x910b('0x11')](_0x910b('0x1b'),_0x32c292[_0x910b('0x12')],_0x3d32ff);_0x57b44a(_0x11e7d5[_0x910b('0x11')](0x1f4,_0x32c292[_0x910b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index afb1ee6..627fae1 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 _0x45e7=['Router','../../components/auth/service','./chatQueueReport.controller','get','isAuthenticated','/describe','/:id','show','create','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x45e7,0x1bc));var _0x745e=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0x45e7[_0x11f226];return _0x30be77;};'use strict';var multer=require(_0x745e('0x0'));var util=require(_0x745e('0x1'));var path=require('path');var timeout=require(_0x745e('0x2'));var express=require(_0x745e('0x3'));var router=express[_0x745e('0x4')]();var auth=require(_0x745e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x745e('0x6'));router[_0x745e('0x7')]('/',auth[_0x745e('0x8')](),controller['index']);router[_0x745e('0x7')](_0x745e('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x745e('0x7')](_0x745e('0xa'),auth['isAuthenticated'](),controller[_0x745e('0xb')]);router['post']('/',auth[_0x745e('0x8')](),controller[_0x745e('0xc')]);router['put'](_0x745e('0xa'),auth[_0x745e('0x8')](),controller[_0x745e('0xd')]);router['delete'](_0x745e('0xa'),auth[_0x745e('0x8')](),controller[_0x745e('0xe')]);module[_0x745e('0xf')]=router;
\ No newline at end of file
+var _0xbdcb=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4b4889,_0x41cc03){var _0x38aac9=function(_0x514501){while(--_0x514501){_0x4b4889['push'](_0x4b4889['shift']());}};_0x38aac9(++_0x41cc03);}(_0xbdcb,0x141));var _0xbbdc=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xbdcb[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xbbdc('0x0'));var util=require(_0xbbdc('0x1'));var path=require(_0xbbdc('0x2'));var timeout=require(_0xbbdc('0x3'));var express=require(_0xbbdc('0x4'));var router=express[_0xbbdc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbbdc('0x6'));var config=require('../../config/environment');var controller=require(_0xbbdc('0x7'));router[_0xbbdc('0x8')]('/',auth[_0xbbdc('0x9')](),controller[_0xbbdc('0xa')]);router[_0xbbdc('0x8')](_0xbbdc('0xb'),auth['isAuthenticated'](),controller[_0xbbdc('0xc')]);router[_0xbbdc('0x8')](_0xbbdc('0xd'),auth[_0xbbdc('0x9')](),controller[_0xbbdc('0xe')]);router[_0xbbdc('0xf')]('/',auth[_0xbbdc('0x9')](),controller[_0xbbdc('0x10')]);router[_0xbbdc('0x11')](_0xbbdc('0xd'),auth[_0xbbdc('0x9')](),controller[_0xbbdc('0x12')]);router[_0xbbdc('0x13')](_0xbbdc('0xd'),auth[_0xbbdc('0x9')](),controller['destroy']);module[_0xbbdc('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index dcf1db5..a0332ec 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 _0xe26d=['DATE','NOW','STRING','agent','queue'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xe26d,0xb6));var _0xde26=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe26d[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xde26('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xde26('0x1'),_0xde26('0x2')),'allowNull':![],'defaultValue':_0xde26('0x2')},'transferredAt':{'type':Sequelize[_0xde26('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xde26('0x4')]}};
\ No newline at end of file
+var _0x5bb3=['exports','STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x39099b,_0x5722b3){var _0x26c171=function(_0x4eadc1){while(--_0x4eadc1){_0x39099b['push'](_0x39099b['shift']());}};_0x26c171(++_0x5722b3);}(_0x5bb3,0xdf));var _0x35bb=function(_0x40dc9b,_0x43b3ba){_0x40dc9b=_0x40dc9b-0x0;var _0x552fcd=_0x5bb3[_0x40dc9b];return _0x552fcd;};'use strict';var moment=require(_0x35bb('0x0'));var Sequelize=require('sequelize');module[_0x35bb('0x1')]={'uniqueid':{'type':Sequelize[_0x35bb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x35bb('0x3')](_0x35bb('0x4'),_0x35bb('0x5'),_0x35bb('0x6')),'allowNull':![],'defaultValue':_0x35bb('0x6')},'transferredAt':{'type':Sequelize[_0x35bb('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 4503f89..21917be 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 _0x70e1=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','name','send','index','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','field','filter','options','ChatTransferReport','includeAll','findAll','rows','catch','params','rawAttributes','length','include','find','create','body','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x2bd992,_0x468766){var _0x1cd071=function(_0x3e2a71){while(--_0x3e2a71){_0x2bd992['push'](_0x2bd992['shift']());}};_0x1cd071(++_0x468766);}(_0x70e1,0x1e1));var _0x170e=function(_0x335f5c,_0xce622c){_0x335f5c=_0x335f5c-0x0;var _0x27458c=_0x70e1[_0x335f5c];return _0x27458c;};'use strict';var pdf=require(_0x170e('0x0'));var emlformat=require(_0x170e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x170e('0x2'));var rp=require('request-promise');var moment=require(_0x170e('0x3'));var BPromise=require(_0x170e('0x4'));var Mustache=require(_0x170e('0x5'));var util=require('util');var path=require(_0x170e('0x6'));var sox=require(_0x170e('0x7'));var csv=require(_0x170e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x170e('0x9'));var crypto=require(_0x170e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x170e('0xb'));var toCsv=require(_0x170e('0x8'));var querystring=require(_0x170e('0xc'));var Papa=require(_0x170e('0xd'));var Redis=require(_0x170e('0xe'));var authService=require(_0x170e('0xf'));var qs=require(_0x170e('0x10'));var as=require(_0x170e('0x11'));var hardwareService=require(_0x170e('0x12'));var logger=require(_0x170e('0x13'))(_0x170e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3804aa,_0x147add){_0x147add=_0x147add||0xcc;return function(_0x4b17af){if(_0x4b17af){return _0x3804aa[_0x170e('0x15')](_0x147add);}return _0x3804aa[_0x170e('0x16')](_0x147add)[_0x170e('0x17')]();};}function respondWithResult(_0x5bdfbc,_0x4a2021){_0x4a2021=_0x4a2021||0xc8;return function(_0x4018ac){if(_0x4018ac){return _0x5bdfbc[_0x170e('0x16')](_0x4a2021)[_0x170e('0x18')](_0x4018ac);}};}function respondWithFilteredResult(_0x2708e3,_0x142daa){return function(_0x4e2d8c){if(_0x4e2d8c){var _0x4397c0=_0x4e2d8c[_0x170e('0x19')],_0x180d93=_0x142daa[_0x170e('0x1a')],_0x924094=_0x142daa['offset']+_0x142daa[_0x170e('0x1b')],_0x1e6a04;if(_0x924094>=_0x4397c0){_0x924094=_0x4397c0;_0x1e6a04=0xc8;}else{_0x1e6a04=0xce;}_0x2708e3[_0x170e('0x16')](_0x1e6a04);return _0x2708e3[_0x170e('0x1c')]('Content-Range',_0x180d93+'-'+_0x924094+'/'+_0x4397c0)[_0x170e('0x18')](_0x4e2d8c);}return null;};}function patchUpdates(_0x18debf){return function(_0x4c4b4d){try{jsonpatch[_0x170e('0x1d')](_0x4c4b4d,_0x18debf,!![]);}catch(_0x507b91){return BPromise[_0x170e('0x1e')](_0x507b91);}return _0x4c4b4d[_0x170e('0x1f')]();};}function saveUpdates(_0x45ded4,_0x3d46b3){return function(_0x13c6f7){if(_0x13c6f7){return _0x13c6f7[_0x170e('0x20')](_0x45ded4)[_0x170e('0x21')](function(_0x34d31d){return _0x34d31d;});}return null;};}function removeEntity(_0x4fce05,_0x450b97){return function(_0x1f2b4a){if(_0x1f2b4a){return _0x1f2b4a[_0x170e('0x22')]()[_0x170e('0x21')](function(){_0x4fce05[_0x170e('0x16')](0xcc)[_0x170e('0x17')]();});}};}function handleEntityNotFound(_0x197979,_0x562943){return function(_0x249b65){if(!_0x249b65){_0x197979[_0x170e('0x15')](0x194);}return _0x249b65;};}function handleError(_0x453c15,_0x4c3e56){_0x4c3e56=_0x4c3e56||0x1f4;return function(_0x265148){logger['error'](_0x265148['stack']);if(_0x265148['name']){delete _0x265148[_0x170e('0x23')];}_0x453c15[_0x170e('0x16')](_0x4c3e56)[_0x170e('0x24')](_0x265148);};}exports[_0x170e('0x25')]=function(_0x57853e,_0x5bc25c){var _0x48b7f4={},_0x59ba35={},_0x16a305={'count':0x0,'rows':[]};var _0x4d9d88=db['ChatTransferReport']['rawAttributes'];_0x59ba35[_0x170e('0x26')]=_[_0x170e('0x27')](_0x4d9d88);_0x59ba35[_0x170e('0x28')]=_[_0x170e('0x27')](_0x57853e[_0x170e('0x28')]);_0x59ba35[_0x170e('0x29')]=_['intersection'](_0x59ba35[_0x170e('0x26')],_0x59ba35[_0x170e('0x28')]);_0x48b7f4[_0x170e('0x2a')]=_[_0x170e('0x2b')](_0x59ba35[_0x170e('0x26')],qs[_0x170e('0x2c')](_0x57853e[_0x170e('0x28')][_0x170e('0x2c')]));_0x48b7f4['attributes']=_0x48b7f4[_0x170e('0x2a')]['length']?_0x48b7f4[_0x170e('0x2a')]:_0x59ba35[_0x170e('0x26')];if(!_0x57853e[_0x170e('0x28')][_0x170e('0x2d')](_0x170e('0x2e'))){_0x48b7f4['limit']=qs[_0x170e('0x1b')](_0x57853e[_0x170e('0x28')][_0x170e('0x1b')]);_0x48b7f4[_0x170e('0x1a')]=qs[_0x170e('0x1a')](_0x57853e['query'][_0x170e('0x1a')]);}_0x48b7f4[_0x170e('0x2f')]=qs['sort'](_0x57853e['query'][_0x170e('0x30')]);_0x48b7f4[_0x170e('0x31')]=qs[_0x170e('0x29')](_[_0x170e('0x32')](_0x57853e[_0x170e('0x28')],_0x59ba35[_0x170e('0x29')]));if(_0x57853e[_0x170e('0x28')]['filter']){_0x48b7f4[_0x170e('0x31')]=_[_0x170e('0x33')](_0x48b7f4[_0x170e('0x31')],{'$or':_[_0x170e('0x34')](_0x4d9d88,function(_0x10555f){if(_0x10555f['type']['key']!==_0x170e('0x35')){var _0x1ac80d={};_0x1ac80d[_0x10555f[_0x170e('0x36')]]={'$like':'%'+_0x57853e[_0x170e('0x28')][_0x170e('0x37')]+'%'};return _0x1ac80d;}})});}_0x48b7f4=_[_0x170e('0x33')]({},_0x48b7f4,_0x57853e[_0x170e('0x38')]);var _0x4a4116={'where':_0x48b7f4[_0x170e('0x31')]};return db[_0x170e('0x39')]['count'](_0x4a4116)['then'](function(_0x556e98){_0x16a305[_0x170e('0x19')]=_0x556e98;if(_0x57853e[_0x170e('0x28')][_0x170e('0x3a')]){_0x48b7f4['include']=[{'all':!![]}];}return db[_0x170e('0x39')][_0x170e('0x3b')](_0x48b7f4);})[_0x170e('0x21')](function(_0x2fc1b1){_0x16a305[_0x170e('0x3c')]=_0x2fc1b1;return _0x16a305;})[_0x170e('0x21')](respondWithFilteredResult(_0x5bc25c,_0x48b7f4))[_0x170e('0x3d')](handleError(_0x5bc25c,null));};exports['show']=function(_0x28bce3,_0x281325){var _0x4d2371={'raw':!![],'where':{'id':_0x28bce3[_0x170e('0x3e')]['id']}},_0x1d4b2c={};_0x1d4b2c[_0x170e('0x26')]=_[_0x170e('0x27')](db['ChatTransferReport'][_0x170e('0x3f')]);_0x1d4b2c['query']=_[_0x170e('0x27')](_0x28bce3[_0x170e('0x28')]);_0x1d4b2c['filters']=_[_0x170e('0x2b')](_0x1d4b2c[_0x170e('0x26')],_0x1d4b2c[_0x170e('0x28')]);_0x4d2371[_0x170e('0x2a')]=_[_0x170e('0x2b')](_0x1d4b2c['model'],qs[_0x170e('0x2c')](_0x28bce3[_0x170e('0x28')][_0x170e('0x2c')]));_0x4d2371[_0x170e('0x2a')]=_0x4d2371['attributes'][_0x170e('0x40')]?_0x4d2371[_0x170e('0x2a')]:_0x1d4b2c[_0x170e('0x26')];if(_0x28bce3['query'][_0x170e('0x3a')]){_0x4d2371[_0x170e('0x41')]=[{'all':!![]}];}_0x4d2371=_[_0x170e('0x33')]({},_0x4d2371,_0x28bce3[_0x170e('0x38')]);return db[_0x170e('0x39')][_0x170e('0x42')](_0x4d2371)[_0x170e('0x21')](handleEntityNotFound(_0x281325,null))[_0x170e('0x21')](respondWithResult(_0x281325,null))['catch'](handleError(_0x281325,null));};exports[_0x170e('0x43')]=function(_0x35e4b1,_0x559e76){return db[_0x170e('0x39')][_0x170e('0x43')](_0x35e4b1[_0x170e('0x44')],{})[_0x170e('0x21')](respondWithResult(_0x559e76,0xc9))['catch'](handleError(_0x559e76,null));};exports[_0x170e('0x20')]=function(_0x544f33,_0x1fd35c){if(_0x544f33[_0x170e('0x44')]['id']){delete _0x544f33[_0x170e('0x44')]['id'];}return db[_0x170e('0x39')][_0x170e('0x42')]({'where':{'id':_0x544f33[_0x170e('0x3e')]['id']}})[_0x170e('0x21')](handleEntityNotFound(_0x1fd35c,null))['then'](saveUpdates(_0x544f33['body'],null))[_0x170e('0x21')](respondWithResult(_0x1fd35c,null))[_0x170e('0x3d')](handleError(_0x1fd35c,null));};exports[_0x170e('0x22')]=function(_0x4e5c9c,_0x40cda1){return db[_0x170e('0x39')]['find']({'where':{'id':_0x4e5c9c['params']['id']}})[_0x170e('0x21')](handleEntityNotFound(_0x40cda1,null))[_0x170e('0x21')](removeEntity(_0x40cda1,null))['catch'](handleError(_0x40cda1,null));};exports[_0x170e('0x45')]=function(_0x2eb1a6,_0x3e01b5){return db['ChatTransferReport']['describe']()[_0x170e('0x21')](respondWithResult(_0x3e01b5,null))[_0x170e('0x3d')](handleError(_0x3e01b5,null));};
\ No newline at end of file
+var _0xd2ad=['to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','rawAttributes','model','query','keys','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','ChatTransferReport','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2ad,0x1e7));var _0xdd2a=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0xd2ad[_0x1f8053];return _0x174fd8;};'use strict';var pdf=require(_0xdd2a('0x0'));var emlformat=require(_0xdd2a('0x1'));var rimraf=require(_0xdd2a('0x2'));var zipdir=require(_0xdd2a('0x3'));var jsonpatch=require(_0xdd2a('0x4'));var rp=require(_0xdd2a('0x5'));var moment=require(_0xdd2a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdd2a('0x7'));var path=require(_0xdd2a('0x8'));var sox=require(_0xdd2a('0x9'));var csv=require(_0xdd2a('0xa'));var ejs=require(_0xdd2a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdd2a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdd2a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdd2a('0xe'));var Papa=require(_0xdd2a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd2a('0x10'));var as=require(_0xdd2a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd2a('0x12'))(_0xdd2a('0x13'));var utils=require(_0xdd2a('0x14'));var config=require(_0xdd2a('0x15'));var db=require(_0xdd2a('0x16'))['db'];function respondWithStatusCode(_0x4896f9,_0x5157d1){_0x5157d1=_0x5157d1||0xcc;return function(_0x51e0df){if(_0x51e0df){return _0x4896f9[_0xdd2a('0x17')](_0x5157d1);}return _0x4896f9[_0xdd2a('0x18')](_0x5157d1)[_0xdd2a('0x19')]();};}function respondWithResult(_0x59b144,_0x7c5bbc){_0x7c5bbc=_0x7c5bbc||0xc8;return function(_0x29a705){if(_0x29a705){return _0x59b144['status'](_0x7c5bbc)['json'](_0x29a705);}};}function respondWithFilteredResult(_0x2ee4ce,_0x4d6245){return function(_0x5cc894){if(_0x5cc894){var _0x23e2ba=_0x5cc894['count'],_0x46a43b=_0x4d6245[_0xdd2a('0x1a')],_0x3d1a35=_0x4d6245[_0xdd2a('0x1a')]+_0x4d6245['limit'],_0x2d4f18;if(_0x3d1a35>=_0x23e2ba){_0x3d1a35=_0x23e2ba;_0x2d4f18=0xc8;}else{_0x2d4f18=0xce;}_0x2ee4ce['status'](_0x2d4f18);return _0x2ee4ce[_0xdd2a('0x1b')](_0xdd2a('0x1c'),_0x46a43b+'-'+_0x3d1a35+'/'+_0x23e2ba)[_0xdd2a('0x1d')](_0x5cc894);}return null;};}function patchUpdates(_0x3db851){return function(_0x5d8d50){try{jsonpatch[_0xdd2a('0x1e')](_0x5d8d50,_0x3db851,!![]);}catch(_0x2152d0){return BPromise[_0xdd2a('0x1f')](_0x2152d0);}return _0x5d8d50['save']();};}function saveUpdates(_0x1a2ca9,_0x51b601){return function(_0x29d51d){if(_0x29d51d){return _0x29d51d[_0xdd2a('0x20')](_0x1a2ca9)[_0xdd2a('0x21')](function(_0xe49c0b){return _0xe49c0b;});}return null;};}function removeEntity(_0x278c92,_0x3beb07){return function(_0x57d58a){if(_0x57d58a){return _0x57d58a[_0xdd2a('0x22')]()[_0xdd2a('0x21')](function(){_0x278c92[_0xdd2a('0x18')](0xcc)[_0xdd2a('0x19')]();});}};}function handleEntityNotFound(_0x178ceb,_0x36f61f){return function(_0x45b634){if(!_0x45b634){_0x178ceb[_0xdd2a('0x17')](0x194);}return _0x45b634;};}function handleError(_0x27b811,_0x86a7a0){_0x86a7a0=_0x86a7a0||0x1f4;return function(_0xd0ab09){logger[_0xdd2a('0x23')](_0xd0ab09['stack']);if(_0xd0ab09[_0xdd2a('0x24')]){delete _0xd0ab09[_0xdd2a('0x24')];}_0x27b811['status'](_0x86a7a0)[_0xdd2a('0x25')](_0xd0ab09);};}exports['index']=function(_0x322d71,_0x92eccb){var _0x282c34={},_0x4a6f61={},_0x250e39={'count':0x0,'rows':[]};var _0x42b506=db['ChatTransferReport'][_0xdd2a('0x26')];_0x4a6f61[_0xdd2a('0x27')]=_['keys'](_0x42b506);_0x4a6f61[_0xdd2a('0x28')]=_[_0xdd2a('0x29')](_0x322d71[_0xdd2a('0x28')]);_0x4a6f61['filters']=_[_0xdd2a('0x2a')](_0x4a6f61[_0xdd2a('0x27')],_0x4a6f61['query']);_0x282c34[_0xdd2a('0x2b')]=_[_0xdd2a('0x2a')](_0x4a6f61[_0xdd2a('0x27')],qs[_0xdd2a('0x2c')](_0x322d71['query']['fields']));_0x282c34[_0xdd2a('0x2b')]=_0x282c34[_0xdd2a('0x2b')]['length']?_0x282c34[_0xdd2a('0x2b')]:_0x4a6f61[_0xdd2a('0x27')];if(!_0x322d71[_0xdd2a('0x28')]['hasOwnProperty'](_0xdd2a('0x2d'))){_0x282c34[_0xdd2a('0x2e')]=qs['limit'](_0x322d71['query'][_0xdd2a('0x2e')]);_0x282c34[_0xdd2a('0x1a')]=qs['offset'](_0x322d71[_0xdd2a('0x28')]['offset']);}_0x282c34['order']=qs['sort'](_0x322d71[_0xdd2a('0x28')][_0xdd2a('0x2f')]);_0x282c34[_0xdd2a('0x30')]=qs[_0xdd2a('0x31')](_[_0xdd2a('0x32')](_0x322d71[_0xdd2a('0x28')],_0x4a6f61[_0xdd2a('0x31')]));if(_0x322d71[_0xdd2a('0x28')][_0xdd2a('0x33')]){_0x282c34[_0xdd2a('0x30')]=_[_0xdd2a('0x34')](_0x282c34[_0xdd2a('0x30')],{'$or':_[_0xdd2a('0x35')](_0x42b506,function(_0x32cbbc){if(_0x32cbbc[_0xdd2a('0x36')][_0xdd2a('0x37')]!==_0xdd2a('0x38')){var _0x464f48={};_0x464f48[_0x32cbbc['field']]={'$like':'%'+_0x322d71['query'][_0xdd2a('0x33')]+'%'};return _0x464f48;}})});}_0x282c34=_[_0xdd2a('0x34')]({},_0x282c34,_0x322d71[_0xdd2a('0x39')]);var _0x2cf67f={'where':_0x282c34[_0xdd2a('0x30')]};return db[_0xdd2a('0x3a')][_0xdd2a('0x3b')](_0x2cf67f)[_0xdd2a('0x21')](function(_0x1ffee0){_0x250e39[_0xdd2a('0x3b')]=_0x1ffee0;if(_0x322d71[_0xdd2a('0x28')][_0xdd2a('0x3c')]){_0x282c34['include']=[{'all':!![]}];}return db[_0xdd2a('0x3a')][_0xdd2a('0x3d')](_0x282c34);})['then'](function(_0x4934fc){_0x250e39[_0xdd2a('0x3e')]=_0x4934fc;return _0x250e39;})[_0xdd2a('0x21')](respondWithFilteredResult(_0x92eccb,_0x282c34))[_0xdd2a('0x3f')](handleError(_0x92eccb,null));};exports[_0xdd2a('0x40')]=function(_0x51bc3b,_0x146aa4){var _0x3d21ca={'raw':!![],'where':{'id':_0x51bc3b[_0xdd2a('0x41')]['id']}},_0x204495={};_0x204495['model']=_[_0xdd2a('0x29')](db['ChatTransferReport'][_0xdd2a('0x26')]);_0x204495['query']=_['keys'](_0x51bc3b['query']);_0x204495['filters']=_[_0xdd2a('0x2a')](_0x204495[_0xdd2a('0x27')],_0x204495[_0xdd2a('0x28')]);_0x3d21ca[_0xdd2a('0x2b')]=_[_0xdd2a('0x2a')](_0x204495[_0xdd2a('0x27')],qs[_0xdd2a('0x2c')](_0x51bc3b['query'][_0xdd2a('0x2c')]));_0x3d21ca[_0xdd2a('0x2b')]=_0x3d21ca[_0xdd2a('0x2b')]['length']?_0x3d21ca[_0xdd2a('0x2b')]:_0x204495[_0xdd2a('0x27')];if(_0x51bc3b[_0xdd2a('0x28')][_0xdd2a('0x3c')]){_0x3d21ca[_0xdd2a('0x42')]=[{'all':!![]}];}_0x3d21ca=_[_0xdd2a('0x34')]({},_0x3d21ca,_0x51bc3b['options']);return db[_0xdd2a('0x3a')][_0xdd2a('0x43')](_0x3d21ca)[_0xdd2a('0x21')](handleEntityNotFound(_0x146aa4,null))[_0xdd2a('0x21')](respondWithResult(_0x146aa4,null))[_0xdd2a('0x3f')](handleError(_0x146aa4,null));};exports[_0xdd2a('0x44')]=function(_0xaf0773,_0x483541){return db[_0xdd2a('0x3a')][_0xdd2a('0x44')](_0xaf0773[_0xdd2a('0x45')],{})[_0xdd2a('0x21')](respondWithResult(_0x483541,0xc9))['catch'](handleError(_0x483541,null));};exports[_0xdd2a('0x20')]=function(_0x189fd8,_0x2badca){if(_0x189fd8[_0xdd2a('0x45')]['id']){delete _0x189fd8[_0xdd2a('0x45')]['id'];}return db[_0xdd2a('0x3a')][_0xdd2a('0x43')]({'where':{'id':_0x189fd8[_0xdd2a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2badca,null))[_0xdd2a('0x21')](saveUpdates(_0x189fd8['body'],null))[_0xdd2a('0x21')](respondWithResult(_0x2badca,null))[_0xdd2a('0x3f')](handleError(_0x2badca,null));};exports[_0xdd2a('0x22')]=function(_0x596e61,_0x518cd5){return db[_0xdd2a('0x3a')]['find']({'where':{'id':_0x596e61['params']['id']}})['then'](handleEntityNotFound(_0x518cd5,null))[_0xdd2a('0x21')](removeEntity(_0x518cd5,null))['catch'](handleError(_0x518cd5,null));};exports[_0xdd2a('0x46')]=function(_0x51c920,_0x3b0d88){return db[_0xdd2a('0x3a')]['describe']()['then'](respondWithResult(_0x3b0d88,null))['catch'](handleError(_0x3b0d88,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c794be9..0c225a0 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 _0xa73e=['report_chat_transfer','uniqueid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatTransferReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa73e,0x1be));var _0xea73=function(_0x4118bb,_0x13c41c){_0x4118bb=_0x4118bb-0x0;var _0x5c9df2=_0xa73e[_0x4118bb];return _0x5c9df2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xea73('0x0'));var moment=require(_0xea73('0x1'));var BPromise=require(_0xea73('0x2'));var rp=require(_0xea73('0x3'));var fs=require('fs');var path=require(_0xea73('0x4'));var rimraf=require(_0xea73('0x5'));var config=require(_0xea73('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xea73('0x7')]=function(_0x40077e,_0x2a0f64){return _0x40077e[_0xea73('0x8')](_0xea73('0x9'),attributes,{'tableName':_0xea73('0xa'),'paranoid':![],'indexes':[{'name':_0xea73('0xb'),'fields':[_0xea73('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9601=['util','../../config/logger','api','request-promise','path','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0xc6eed2,_0xbc2550){var _0x5e9611=function(_0x28adc6){while(--_0x28adc6){_0xc6eed2['push'](_0xc6eed2['shift']());}};_0x5e9611(++_0xbc2550);}(_0x9601,0xdb));var _0x1960=function(_0x42819,_0x536bf0){_0x42819=_0x42819-0x0;var _0x333751=_0x9601[_0x42819];return _0x333751;};'use strict';var _=require(_0x1960('0x0'));var util=require(_0x1960('0x1'));var logger=require(_0x1960('0x2'))(_0x1960('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1960('0x4'));var fs=require('fs');var path=require(_0x1960('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x1960('0x6')]=function(_0x2d9eba,_0x258f19){return _0x2d9eba['define'](_0x1960('0x7'),attributes,{'tableName':_0x1960('0x8'),'paranoid':![],'indexes':[{'name':_0x1960('0x9'),'fields':[_0x1960('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index fb6a579..14e7682 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 _0x1dab=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xaee1ab,_0x260f30){var _0x4f0ed5=function(_0x2e65c5){while(--_0x2e65c5){_0xaee1ab['push'](_0xaee1ab['shift']());}};_0x4f0ed5(++_0x260f30);}(_0x1dab,0x143));var _0xb1da=function(_0x10a29d,_0x6b51d3){_0x10a29d=_0x10a29d-0x0;var _0xff1b77=_0x1dab[_0x10a29d];return _0xff1b77;};'use strict';var _=require(_0xb1da('0x0'));var util=require(_0xb1da('0x1'));var moment=require('moment');var BPromise=require(_0xb1da('0x2'));var rs=require(_0xb1da('0x3'));var fs=require('fs');var Redis=require(_0xb1da('0x4'));var db=require(_0xb1da('0x5'))['db'];var utils=require(_0xb1da('0x6'));var logger=require(_0xb1da('0x7'))(_0xb1da('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1da('0x9'));var client=jayson[_0xb1da('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3de965,_0x28ef31,_0x28060f){return new BPromise(function(_0x10dbcf,_0x654dfb){return client['request'](_0x3de965,_0x28060f)[_0xb1da('0xb')](function(_0x51ffef){logger[_0xb1da('0xc')](_0xb1da('0xd'),_0x28ef31,_0xb1da('0xe'));logger[_0xb1da('0xf')](_0xb1da('0x10'),_0x28ef31,_0xb1da('0xe'),JSON[_0xb1da('0x11')](_0x51ffef));if(_0x51ffef[_0xb1da('0x12')]){if(_0x51ffef[_0xb1da('0x12')][_0xb1da('0x13')]===0x1f4){logger[_0xb1da('0x12')](_0xb1da('0xd'),_0x28ef31,_0x51ffef[_0xb1da('0x12')][_0xb1da('0x14')]);return _0x654dfb(_0x51ffef['error'][_0xb1da('0x14')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x28ef31,_0x51ffef[_0xb1da('0x12')][_0xb1da('0x14')]);return _0x10dbcf(_0x51ffef[_0xb1da('0x12')][_0xb1da('0x14')]);}else{logger[_0xb1da('0xc')](_0xb1da('0xd'),_0x28ef31,_0xb1da('0xe'));_0x10dbcf(_0x51ffef[_0xb1da('0x15')][_0xb1da('0x14')]);}})[_0xb1da('0x16')](function(_0x362a96){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x28ef31,_0x362a96);_0x654dfb(_0x362a96);});});}
\ No newline at end of file
+var _0x75ec=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x53976f,_0x2bc57b){var _0x423224=function(_0x25fb09){while(--_0x25fb09){_0x53976f['push'](_0x53976f['shift']());}};_0x423224(++_0x2bc57b);}(_0x75ec,0x1e6));var _0xc75e=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x75ec[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xc75e('0x0'));var util=require('util');var moment=require(_0xc75e('0x1'));var BPromise=require(_0xc75e('0x2'));var rs=require(_0xc75e('0x3'));var fs=require('fs');var Redis=require(_0xc75e('0x4'));var db=require(_0xc75e('0x5'))['db'];var utils=require(_0xc75e('0x6'));var logger=require(_0xc75e('0x7'))(_0xc75e('0x8'));var config=require(_0xc75e('0x9'));var jayson=require(_0xc75e('0xa'));var client=jayson['client'][_0xc75e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f54ce,_0x5ee6bd,_0x2d13dc){return new BPromise(function(_0x23db38,_0x25580e){return client['request'](_0x1f54ce,_0x2d13dc)[_0xc75e('0xc')](function(_0x187d30){logger[_0xc75e('0xd')](_0xc75e('0xe'),_0x5ee6bd,'request\x20sent');logger['debug'](_0xc75e('0xf'),_0x5ee6bd,_0xc75e('0x10'),JSON[_0xc75e('0x11')](_0x187d30));if(_0x187d30[_0xc75e('0x12')]){if(_0x187d30[_0xc75e('0x12')][_0xc75e('0x13')]===0x1f4){logger[_0xc75e('0x12')](_0xc75e('0xe'),_0x5ee6bd,_0x187d30[_0xc75e('0x12')]['message']);return _0x25580e(_0x187d30[_0xc75e('0x12')][_0xc75e('0x14')]);}logger[_0xc75e('0x12')](_0xc75e('0xe'),_0x5ee6bd,_0x187d30[_0xc75e('0x12')][_0xc75e('0x14')]);return _0x23db38(_0x187d30[_0xc75e('0x12')][_0xc75e('0x14')]);}else{logger[_0xc75e('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x5ee6bd,_0xc75e('0x10'));_0x23db38(_0x187d30[_0xc75e('0x15')][_0xc75e('0x14')]);}})[_0xc75e('0x16')](function(_0x54b30d){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5ee6bd,_0x54b30d);_0x25580e(_0x54b30d);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index ade1dba..fae63dc 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 _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xb10b,0x12a));var _0xbb10=function(_0x19e9a7,_0x57e686){_0x19e9a7=_0x19e9a7-0x0;var _0x3a8442=_0xb10b[_0x19e9a7];return _0x3a8442;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index e049e06..f71a9b9 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 _0xa600=['#9f946a','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','Feedback','ENUM','thumb','star','stringify','name','text','getDataValue','onlineForm','parse','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','Agent'];(function(_0x359068,_0x5bf191){var _0x1175f1=function(_0x44fbb9){while(--_0x44fbb9){_0x359068['push'](_0x359068['shift']());}};_0x1175f1(++_0x5bf191);}(_0xa600,0x1ee));var _0x0a60=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0xa600[_0x31295c];return _0x2c150e;};'use strict';var Sequelize=require(_0x0a60('0x0'));var rs=require(_0x0a60('0x1'));module[_0x0a60('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0a60('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x0a60('0x3')]},'mapKey':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x4')},'key':{'type':Sequelize[_0x0a60('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x5')},'customerAlias':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a60('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a60('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a60('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0a60('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0a60('0x3')]},'animation':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x0a60('0xa'),_0x0a60('0xb')),'defaultValue':_0x0a60('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0xe')},'download_transcript':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0a60('0xf')]},'closingQuestion':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x12')},'noteTitle':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x14')},'closingMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x15')},'skipMessageButton':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x16')},'conditionAgreement':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x17')},'ratingType':{'type':Sequelize[_0x0a60('0x18')]('star',_0x0a60('0x19')),'defaultValue':_0x0a60('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0a60('0xf')],'defaultValue':function(){return JSON[_0x0a60('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0a60('0x1c'),'type':_0x0a60('0x1d'),'required':!![]},'props':{'title':_0x0a60('0x1c'),'helpText':''}},{'type':'input','props':{'title':_0x0a60('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0a60('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0a60('0x1e')](_0x0a60('0x1f'))?JSON[_0x0a60('0x20')](this[_0x0a60('0x1e')](_0x0a60('0x1f'))):{};},'set':function(_0x2f3559){return this['setDataValue'](_0x0a60('0x1f'),JSON['stringify'](_0x2f3559));}},'offlineForm':{'type':Sequelize[_0x0a60('0xf')],'defaultValue':function(){return JSON[_0x0a60('0x1b')]({'items':[{'type':_0x0a60('0x21'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0a60('0x4')},'variable':null},{'type':_0x0a60('0x22'),'config':{'placeholder':_0x0a60('0x23')},'props':{'title':'Comments','helpText':_0x0a60('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x0a60('0x1e')](_0x0a60('0x25'))?JSON['parse'](this[_0x0a60('0x1e')](_0x0a60('0x25'))):{};},'set':function(_0xd019c7){return this[_0x0a60('0x26')](_0x0a60('0x25'),JSON['stringify'](_0xd019c7));}},'token':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0a60('0x3')]},'waitingTitle':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x27')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x16')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0a60('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0a60('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0a60('0xf')],'defaultValue':function(){return _0x0a60('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':_0x0a60('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0a60('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x0a60('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0a60('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0a60('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0a60('0x3')],'allowNull':![],'defaultValue':_0x0a60('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a60('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a60('0x8')],'comment':_0x0a60('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x0a60('0x9')],'defaultValue':![],'comment':_0x0a60('0x30'),'set':function(_0x3d5aa2){if(!_0x3d5aa2)this[_0x0a60('0x26')]('mandatoryDispositionPauseId',null);this[_0x0a60('0x26')](_0x0a60('0x31'),_0x3d5aa2);}}};
\ No newline at end of file
+var _0xef89=['Skip','Feedback','thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','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}}','bottom_right','alternate','System','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#9f946a','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xef89,0x71));var _0x9ef8=function(_0x21d355,_0x3ff119){_0x21d355=_0x21d355-0x0;var _0x2caaa3=_0xef89[_0x21d355];return _0x2caaa3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9ef8('0x0'));module[_0x9ef8('0x1')]={'name':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'unique':_0x9ef8('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x4')},'key':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0x5')},'customerAlias':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':_0x9ef8('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9ef8('0x2')]},'animation':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9ef8('0x8')](_0x9ef8('0x9'),'squared'),'defaultValue':_0x9ef8('0x9')},'header_online':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xa')},'start_chat_button':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0xb')},'header_offline':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xc')},'download_transcript':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9ef8('0xf')]},'closingQuestion':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x12')},'closingMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xb')},'skipMessageButton':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x13')},'conditionAgreement':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x14')},'ratingType':{'type':Sequelize[_0x9ef8('0x8')]('star',_0x9ef8('0x15')),'defaultValue':_0x9ef8('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9ef8('0xf')],'defaultValue':function(){return JSON[_0x9ef8('0x17')]({'items':[{'type':_0x9ef8('0x18'),'variable':null,'config':{'placeholder':_0x9ef8('0x19'),'type':_0x9ef8('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x9ef8('0x18'),'props':{'title':_0x9ef8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9ef8('0x4'),'type':_0x9ef8('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9ef8('0x1b')](_0x9ef8('0x1c'))?JSON[_0x9ef8('0x1d')](this['getDataValue'](_0x9ef8('0x1c'))):{};},'set':function(_0xe142){return this[_0x9ef8('0x1e')](_0x9ef8('0x1c'),JSON[_0x9ef8('0x17')](_0xe142));}},'offlineForm':{'type':Sequelize[_0x9ef8('0xf')],'defaultValue':function(){return JSON[_0x9ef8('0x17')]({'items':[{'type':_0x9ef8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9ef8('0x4'),'type':_0x9ef8('0x4')},'variable':null},{'type':_0x9ef8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x9ef8('0x20'),'helpText':_0x9ef8('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x9ef8('0x1b')](_0x9ef8('0x22'))?JSON[_0x9ef8('0x1d')](this['getDataValue']('offlineForm')):{};},'set':function(_0x2267ed){return this[_0x9ef8('0x1e')](_0x9ef8('0x22'),JSON[_0x9ef8('0x17')](_0x2267ed));}},'token':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':function(){return rs[_0x9ef8('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9ef8('0x2')]},'waitingTitle':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9ef8('0x13')},'sendUnmanaged':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9ef8('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9ef8('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9ef8('0x27');}},'notificationSound':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x9ef8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x28')},'verticalAlignment':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x9ef8('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9ef8('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9ef8('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ef8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ef8('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9ef8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9ef8('0x2')],'defaultValue':_0x9ef8('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ef8('0xd')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x511859){if(!_0x511859)this[_0x9ef8('0x1e')]('mandatoryDispositionPauseId',null);this[_0x9ef8('0x1e')](_0x9ef8('0x2b'),_0x511859);}}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 62e9c2b..737a368 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 _0xb7b3=['lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor','format','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','notify','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.js','remote','remoteAddress','replace','alignment','verticalAlignment','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','count','offset','limit','reject','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','send','index','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','field','options','ChatWebsite','includeAll','findAll','show','params','Pause','keys','include','find','create','body','user','role','UserProfileSection','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','file','filename','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','custom','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','chat','CmContact','ValidationError','difference','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','updatedAt','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','x-forwarded-for','first','split'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb7b3,0x75));var _0x3b7b=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xb7b3[_0x5e42a7];return _0x36d21b;};'use strict';var pdf=require(_0x3b7b('0x0'));var emlformat=require(_0x3b7b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3b7b('0x2'));var jsonpatch=require(_0x3b7b('0x3'));var rp=require(_0x3b7b('0x4'));var moment=require(_0x3b7b('0x5'));var BPromise=require(_0x3b7b('0x6'));var Mustache=require(_0x3b7b('0x7'));var util=require(_0x3b7b('0x8'));var path=require('path');var sox=require(_0x3b7b('0x9'));var csv=require(_0x3b7b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3b7b('0xb'));var squel=require(_0x3b7b('0xc'));var crypto=require(_0x3b7b('0xd'));var jsforce=require(_0x3b7b('0xe'));var deskjs=require(_0x3b7b('0xf'));var toCsv=require(_0x3b7b('0xa'));var querystring=require(_0x3b7b('0x10'));var Papa=require(_0x3b7b('0x11'));var Redis=require(_0x3b7b('0x12'));var authService=require(_0x3b7b('0x13'));var qs=require(_0x3b7b('0x14'));var as=require(_0x3b7b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3b7b('0x16'));var utils=require(_0x3b7b('0x17'));var config=require(_0x3b7b('0x18'));var db=require(_0x3b7b('0x19'))['db'];config[_0x3b7b('0x1a')]=_[_0x3b7b('0x1b')](config[_0x3b7b('0x1a')],{'host':_0x3b7b('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3b7b('0x1d'))[_0x3b7b('0x1e')](socket);var jayson=require(_0x3b7b('0x1f'));var client=jayson[_0x3b7b('0x20')][_0x3b7b('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x3b7b('0x21')]({'port':0x232a});var client9003=jayson[_0x3b7b('0x20')][_0x3b7b('0x21')]({'port':0x232b});function checkPasswordPattern(_0x1fcc98,_0x4ab966,_0x39aa84){if(_0x39aa84){var _0x48228b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48228b[_0x3b7b('0x22')](_0x4ab966)){return _0x1fcc98;}else{throw new Error(_0x3b7b('0x23'));}}else{return _0x1fcc98;}}function respondWithRpcPromise(_0x143fbb,_0x55baf3,_0x45b2dd,_0x3d2e44){return new BPromise(function(_0x94a946,_0x1837f7){var _0x4ea300=_0x3d2e44||client;return _0x4ea300[_0x3b7b('0x24')](_0x143fbb,_0x45b2dd)[_0x3b7b('0x25')](function(_0x3afa49){logger[_0x3b7b('0x26')](_0x3b7b('0x27'),_0x55baf3,'request\x20sent');logger[_0x3b7b('0x28')](_0x3b7b('0x29'),_0x55baf3,_0x3b7b('0x2a'),JSON['stringify'](_0x3afa49));if(_0x3afa49['error']){if(_0x3afa49[_0x3b7b('0x2b')][_0x3b7b('0x2c')]===0x1f4){logger[_0x3b7b('0x2b')](_0x3b7b('0x27'),_0x55baf3,_0x3afa49['error'][_0x3b7b('0x2d')]);return _0x1837f7(_0x3afa49[_0x3b7b('0x2b')][_0x3b7b('0x2d')]);}logger[_0x3b7b('0x2b')](_0x3b7b('0x27'),_0x55baf3,_0x3afa49['error'][_0x3b7b('0x2d')]);return _0x94a946(_0x3afa49[_0x3b7b('0x2b')][_0x3b7b('0x2d')]);}else{logger[_0x3b7b('0x26')](_0x3b7b('0x27'),_0x55baf3,'request\x20sent');_0x94a946(_0x3afa49[_0x3b7b('0x2e')][_0x3b7b('0x2d')]);}})[_0x3b7b('0x2f')](function(_0x5d06db){logger[_0x3b7b('0x2b')](_0x3b7b('0x27'),_0x55baf3,_0x5d06db);_0x1837f7(_0x5d06db);});});}function respondWithStatusCode(_0x2a50ee,_0x37db69){_0x37db69=_0x37db69||0xcc;return function(_0x20e5c7){if(_0x20e5c7){return _0x2a50ee['sendStatus'](_0x37db69);}return _0x2a50ee[_0x3b7b('0x30')](_0x37db69)['end']();};}function respondWithResult(_0x39d6d1,_0x1c9618){_0x1c9618=_0x1c9618||0xc8;return function(_0x25ac23){if(_0x25ac23){return _0x39d6d1[_0x3b7b('0x30')](_0x1c9618)[_0x3b7b('0x31')](_0x25ac23);}};}function respondWithFilteredResult(_0x2df972,_0xe53a22){return function(_0x460314){if(_0x460314){var _0x303dd4=_0x460314[_0x3b7b('0x32')],_0x54472d=_0xe53a22[_0x3b7b('0x33')],_0x19f2f4=_0xe53a22[_0x3b7b('0x33')]+_0xe53a22[_0x3b7b('0x34')],_0x165d11;if(_0x19f2f4>=_0x303dd4){_0x19f2f4=_0x303dd4;_0x165d11=0xc8;}else{_0x165d11=0xce;}_0x2df972['status'](_0x165d11);return _0x2df972['set']('Content-Range',_0x54472d+'-'+_0x19f2f4+'/'+_0x303dd4)[_0x3b7b('0x31')](_0x460314);}return null;};}function patchUpdates(_0x8eee07){return function(_0x3654aa){try{jsonpatch['apply'](_0x3654aa,_0x8eee07,!![]);}catch(_0x483d07){return BPromise[_0x3b7b('0x35')](_0x483d07);}return _0x3654aa['save']();};}function saveUpdates(_0x34fd25,_0x32a804){return function(_0xdc75d3){if(_0xdc75d3){return _0xdc75d3[_0x3b7b('0x36')](_0x34fd25)['then'](function(_0x3b567f){return _0x3b567f;});}return null;};}function removeEntity(_0x40a8a8,_0x3e4230){return function(_0x13ac0a){if(_0x13ac0a){return _0x13ac0a[_0x3b7b('0x37')]()[_0x3b7b('0x25')](function(){var _0x40ecce=_0x13ac0a[_0x3b7b('0x38')]({'plain':!![]});var _0x3e4887=_0x3b7b('0x39');return db[_0x3b7b('0x3a')][_0x3b7b('0x37')]({'where':{'type':_0x3e4887,'resourceId':_0x40ecce['id']}})[_0x3b7b('0x25')](function(){return _0x13ac0a;});})[_0x3b7b('0x25')](function(){_0x40a8a8[_0x3b7b('0x30')](0xcc)[_0x3b7b('0x3b')]();});}};}function handleEntityNotFound(_0x4ad9ca,_0x379f3a){return function(_0x4ef38f){if(!_0x4ef38f){_0x4ad9ca[_0x3b7b('0x3c')](0x194);}return _0x4ef38f;};}function handleError(_0x5239a0,_0xce3743){_0xce3743=_0xce3743||0x1f4;return function(_0x3238d8){logger[_0x3b7b('0x2b')](_0x3238d8[_0x3b7b('0x3d')]);if(_0x3238d8['name']){delete _0x3238d8['name'];}_0x5239a0[_0x3b7b('0x30')](_0xce3743)[_0x3b7b('0x3e')](_0x3238d8);};}exports[_0x3b7b('0x3f')]=function(_0x24f7d6,_0x1d16c0){var _0x3dd295={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ea76e={},_0x6079d6={'count':0x0,'rows':[]};var _0x3d9657=db['ChatWebsite'][_0x3b7b('0x40')];_0x3ea76e['model']=_['keys'](_0x3d9657);_0x3ea76e[_0x3b7b('0x41')]=_['keys'](_0x24f7d6['query']);_0x3ea76e['filters']=_[_0x3b7b('0x42')](_0x3ea76e[_0x3b7b('0x43')],_0x3ea76e[_0x3b7b('0x41')]);_0x3dd295[_0x3b7b('0x44')]=_[_0x3b7b('0x42')](_0x3ea76e['model'],qs[_0x3b7b('0x45')](_0x24f7d6['query'][_0x3b7b('0x45')]));_0x3dd295[_0x3b7b('0x44')]=_0x3dd295[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x3dd295[_0x3b7b('0x44')]:_0x3ea76e[_0x3b7b('0x43')];if(!_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x3dd295[_0x3b7b('0x34')]=qs['limit'](_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x3dd295['offset']=qs['offset'](_0x24f7d6[_0x3b7b('0x41')]['offset']);}_0x3dd295[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x3dd295[_0x3b7b('0x4b')]=qs['filters'](_[_0x3b7b('0x4c')](_0x24f7d6[_0x3b7b('0x41')],_0x3ea76e[_0x3b7b('0x4d')]));if(_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x4e')]){_0x3dd295[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x3dd295[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0x3d9657,function(_0x594f0f){if(_0x594f0f[_0x3b7b('0x51')][_0x3b7b('0x52')]!=='VIRTUAL'){var _0x389778={};_0x389778[_0x594f0f[_0x3b7b('0x53')]]={'$like':'%'+_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x389778;}})});}_0x3dd295=_[_0x3b7b('0x4f')]({},_0x3dd295,_0x24f7d6[_0x3b7b('0x54')]);var _0x41b955={'where':_0x3dd295[_0x3b7b('0x4b')]};return db[_0x3b7b('0x55')][_0x3b7b('0x32')](_0x41b955)['then'](function(_0xc669e0){_0x6079d6[_0x3b7b('0x32')]=_0xc669e0;if(_0x24f7d6[_0x3b7b('0x41')][_0x3b7b('0x56')]){_0x3dd295['include']=[{'all':!![]}];}return db[_0x3b7b('0x55')][_0x3b7b('0x57')](_0x3dd295);})[_0x3b7b('0x25')](function(_0x31760a){_0x6079d6['rows']=_0x31760a;return _0x6079d6;})[_0x3b7b('0x25')](respondWithFilteredResult(_0x1d16c0,_0x3dd295))['catch'](handleError(_0x1d16c0,null));};exports[_0x3b7b('0x58')]=function(_0xcd610a,_0x5265c6){var _0x41e550={'raw':![],'where':{'id':_0xcd610a[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0x5a')],'as':'mandatoryDispositionPause'}]},_0x5ddfbd={};_0x5ddfbd[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db[_0x3b7b('0x55')][_0x3b7b('0x40')]);_0x5ddfbd[_0x3b7b('0x41')]=_['keys'](_0xcd610a[_0x3b7b('0x41')]);_0x5ddfbd['filters']=_[_0x3b7b('0x42')](_0x5ddfbd['model'],_0x5ddfbd[_0x3b7b('0x41')]);_0x41e550['attributes']=_['intersection'](_0x5ddfbd[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0xcd610a['query']['fields']));_0x41e550[_0x3b7b('0x44')]=_0x41e550[_0x3b7b('0x44')]['length']?_0x41e550[_0x3b7b('0x44')]:_0x5ddfbd['model'];if(_0xcd610a['query'][_0x3b7b('0x56')]){_0x41e550[_0x3b7b('0x5c')]=[{'all':!![]}];}_0x41e550=_[_0x3b7b('0x4f')]({},_0x41e550,_0xcd610a[_0x3b7b('0x54')]);return db['ChatWebsite'][_0x3b7b('0x5d')](_0x41e550)[_0x3b7b('0x25')](handleEntityNotFound(_0x5265c6,null))['then'](respondWithResult(_0x5265c6,null))['catch'](handleError(_0x5265c6,null));};exports[_0x3b7b('0x5e')]=function(_0x2daef7,_0x3b84a6){return db[_0x3b7b('0x55')][_0x3b7b('0x5e')](_0x2daef7[_0x3b7b('0x5f')],{})[_0x3b7b('0x25')](function(_0x2723a9){var _0x40915f=_0x2daef7[_0x3b7b('0x60')][_0x3b7b('0x38')]({'plain':!![]});if(!_0x40915f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40915f[_0x3b7b('0x61')]===_0x3b7b('0x60')){var _0x2c6fac=_0x2723a9[_0x3b7b('0x38')]({'plain':!![]});var _0x4522e2=_0x3b7b('0x39');return db[_0x3b7b('0x62')][_0x3b7b('0x5d')]({'where':{'name':_0x4522e2,'userProfileId':_0x40915f['userProfileId']},'raw':!![]})[_0x3b7b('0x25')](function(_0x3d0ec9){if(_0x3d0ec9&&_0x3d0ec9['autoAssociation']===0x0){return db['UserProfileResource'][_0x3b7b('0x5e')]({'name':_0x2c6fac['name'],'resourceId':_0x2c6fac['id'],'type':_0x3d0ec9[_0x3b7b('0x63')],'sectionId':_0x3d0ec9['id']},{})['then'](function(){return _0x2723a9;});}else{return _0x2723a9;}})['catch'](function(_0x588e99){logger[_0x3b7b('0x2b')](_0x3b7b('0x64'),_0x588e99);throw _0x588e99;});}return _0x2723a9;})[_0x3b7b('0x25')](respondWithResult(_0x3b84a6,0xc9))[_0x3b7b('0x2f')](handleError(_0x3b84a6,null));};exports['update']=function(_0x5df0a8,_0x5c04a7){if(_0x5df0a8[_0x3b7b('0x5f')]['id']){delete _0x5df0a8['body']['id'];}return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x5df0a8[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0x5a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x5c04a7,null))[_0x3b7b('0x25')](saveUpdates(_0x5df0a8[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x5c04a7,null))[_0x3b7b('0x2f')](handleError(_0x5c04a7,null));};exports[_0x3b7b('0x37')]=function(_0x2da043,_0xf2823c){return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x2da043[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xf2823c,null))[_0x3b7b('0x25')](removeEntity(_0xf2823c,null))[_0x3b7b('0x2f')](handleError(_0xf2823c,null));};exports[_0x3b7b('0x65')]=function(_0x20ee46,_0x45a544){return db[_0x3b7b('0x55')][_0x3b7b('0x65')]()[_0x3b7b('0x25')](respondWithResult(_0x45a544,null))[_0x3b7b('0x2f')](handleError(_0x45a544,null));};exports['addDisposition']=function(_0x2de100,_0xb587b2,_0x1a884c){if(_0x2de100[_0x3b7b('0x5f')]['id']){delete _0x2de100[_0x3b7b('0x5f')]['id'];}return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x2de100[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xb587b2,null))['then'](function(_0x5b7eb1){if(_0x5b7eb1){_0x2de100[_0x3b7b('0x5f')][_0x3b7b('0x66')]=_0x5b7eb1['id'];return db[_0x3b7b('0x67')][_0x3b7b('0x5e')](_0x2de100['body']);}})[_0x3b7b('0x25')](respondWithResult(_0xb587b2,null))[_0x3b7b('0x2f')](handleError(_0xb587b2,null));};exports['getDispositions']=function(_0x4a5b09,_0xc979d1,_0x1bea3b){var _0x1832b4={'raw':![],'where':{}};var _0x3c126e={};var _0x1fc38f={'count':0x0,'rows':[]};return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x4a5b09[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0xc979d1,null))['then'](function(_0x73508){if(_0x73508){_0x3c126e[_0x3b7b('0x43')]=_['keys'](db[_0x3b7b('0x67')]['rawAttributes']);_0x3c126e[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x4a5b09['query']);_0x3c126e[_0x3b7b('0x4d')]=_[_0x3b7b('0x42')](_0x3c126e[_0x3b7b('0x43')],_0x3c126e[_0x3b7b('0x41')]);_0x1832b4[_0x3b7b('0x44')]=_[_0x3b7b('0x42')](_0x3c126e[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x4a5b09['query']['fields']));_0x1832b4[_0x3b7b('0x44')]=_0x1832b4['attributes'][_0x3b7b('0x46')]?_0x1832b4[_0x3b7b('0x44')]:_0x3c126e[_0x3b7b('0x43')];if(!_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x1832b4[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x4a5b09['query'][_0x3b7b('0x34')]);_0x1832b4[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x33')]);}_0x1832b4[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x1832b4[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_[_0x3b7b('0x4c')](_0x4a5b09[_0x3b7b('0x41')],_0x3c126e['filters']));_0x1832b4[_0x3b7b('0x4b')][_0x3b7b('0x66')]=_0x73508['id'];if(_0x4a5b09['query']['filter']){_0x1832b4[_0x3b7b('0x4b')]=_['merge'](_0x1832b4[_0x3b7b('0x4b')],{'$or':_['map'](_0x1832b4[_0x3b7b('0x44')],function(_0x3a1f3a){var _0x15da2d={};_0x15da2d[_0x3a1f3a]={'$like':'%'+_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x15da2d;})});}_0x1832b4=_['merge']({},_0x1832b4,_0x4a5b09['options']);return db[_0x3b7b('0x67')]['count']({'where':_0x1832b4['where']})[_0x3b7b('0x25')](function(_0x4cfe09){_0x1fc38f[_0x3b7b('0x32')]=_0x4cfe09;if(_0x4a5b09[_0x3b7b('0x41')][_0x3b7b('0x56')]){_0x1832b4[_0x3b7b('0x5c')]=[{'all':!![]}];}return db[_0x3b7b('0x67')][_0x3b7b('0x57')](_0x1832b4);})[_0x3b7b('0x25')](function(_0x45ba32){_0x1fc38f['rows']=_0x45ba32;return _0x1fc38f;});}})[_0x3b7b('0x25')](respondWithFilteredResult(_0xc979d1,_0x1832b4))['catch'](handleError(_0xc979d1,null));};exports[_0x3b7b('0x69')]=function(_0x4d59ae,_0x452e6b,_0x207995){return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x4d59ae[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x452e6b,null))[_0x3b7b('0x25')](function(_0x1f665f){if(_0x1f665f){return _0x1f665f[_0x3b7b('0x69')](_0x4d59ae[_0x3b7b('0x41')][_0x3b7b('0x6a')]);}})['then'](respondWithStatusCode(_0x452e6b,null))[_0x3b7b('0x2f')](handleError(_0x452e6b,null));};exports['addAnswer']=function(_0x57d777,_0x28c0c8,_0x292a72){if(_0x57d777[_0x3b7b('0x5f')]['id']){delete _0x57d777[_0x3b7b('0x5f')]['id'];}return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x57d777[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x28c0c8,null))[_0x3b7b('0x25')](function(_0x4f2db6){if(_0x4f2db6){_0x57d777[_0x3b7b('0x5f')][_0x3b7b('0x66')]=_0x4f2db6['id'];return db[_0x3b7b('0x6b')][_0x3b7b('0x5e')](_0x57d777['body']);}})['then'](respondWithResult(_0x28c0c8,null))[_0x3b7b('0x2f')](handleError(_0x28c0c8,null));};exports[_0x3b7b('0x6c')]=function(_0x183ed9,_0x2aa6ba,_0x422315){var _0x469636={'raw':![],'where':{}};var _0x1eb6df={};var _0x4fd319={'count':0x0,'rows':[]};return db[_0x3b7b('0x55')]['findOne']({'where':{'id':_0x183ed9['params']['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x2aa6ba,null))[_0x3b7b('0x25')](function(_0x2ca6ff){if(_0x2ca6ff){_0x1eb6df['model']=_[_0x3b7b('0x5b')](db['CannedAnswer'][_0x3b7b('0x40')]);_0x1eb6df[_0x3b7b('0x41')]=_['keys'](_0x183ed9['query']);_0x1eb6df['filters']=_['intersection'](_0x1eb6df[_0x3b7b('0x43')],_0x1eb6df[_0x3b7b('0x41')]);_0x469636[_0x3b7b('0x44')]=_['intersection'](_0x1eb6df[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x183ed9['query'][_0x3b7b('0x45')]));_0x469636[_0x3b7b('0x44')]=_0x469636[_0x3b7b('0x44')]['length']?_0x469636['attributes']:_0x1eb6df['model'];if(!_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x469636[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x469636[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x33')]);}_0x469636['order']=qs[_0x3b7b('0x4a')](_0x183ed9[_0x3b7b('0x41')]['sort']);_0x469636[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_['pick'](_0x183ed9[_0x3b7b('0x41')],_0x1eb6df['filters']));_0x469636[_0x3b7b('0x4b')][_0x3b7b('0x66')]=_0x2ca6ff['id'];if(_0x183ed9[_0x3b7b('0x41')]['filter']){_0x469636[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x469636[_0x3b7b('0x4b')],{'$or':_['map'](_0x469636['attributes'],function(_0x1ee9ec){var _0x531f98={};_0x531f98[_0x1ee9ec]={'$like':'%'+_0x183ed9['query']['filter']+'%'};return _0x531f98;})});}_0x469636=_[_0x3b7b('0x4f')]({},_0x469636,_0x183ed9[_0x3b7b('0x54')]);return db[_0x3b7b('0x6b')][_0x3b7b('0x32')]({'where':_0x469636[_0x3b7b('0x4b')]})[_0x3b7b('0x25')](function(_0x5da924){_0x4fd319['count']=_0x5da924;if(_0x183ed9[_0x3b7b('0x41')][_0x3b7b('0x56')]){_0x469636[_0x3b7b('0x5c')]=[{'all':!![]}];}return db[_0x3b7b('0x6b')][_0x3b7b('0x57')](_0x469636);})[_0x3b7b('0x25')](function(_0x18f6bc){_0x4fd319[_0x3b7b('0x6d')]=_0x18f6bc;return _0x4fd319;});}})['then'](respondWithFilteredResult(_0x2aa6ba,_0x469636))['catch'](handleError(_0x2aa6ba,null));};exports[_0x3b7b('0x6e')]=function(_0x32edc8,_0x25cc97,_0x2d68a8){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x32edc8[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x25cc97,null))[_0x3b7b('0x25')](function(_0x308468){if(_0x308468){return _0x308468[_0x3b7b('0x6e')](_0x32edc8[_0x3b7b('0x41')][_0x3b7b('0x6a')]);}})['then'](respondWithStatusCode(_0x25cc97,null))[_0x3b7b('0x2f')](handleError(_0x25cc97,null));};exports[_0x3b7b('0x6f')]=function(_0x442250,_0xf96a53,_0x2f3f80){_0x442250[_0x3b7b('0x5f')]['sitepic']=_0x442250['file']['filename'];return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x442250[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xf96a53,null))['then'](saveUpdates(_0x442250[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0xf96a53,null))[_0x3b7b('0x2f')](handleError(_0xf96a53,null));};exports['addAvatar']=function(_0x3f8ed6,_0x114bb3,_0x281e18){_0x3f8ed6['body']['agentAvatar']=_0x3f8ed6[_0x3b7b('0x70')][_0x3b7b('0x71')];return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x3f8ed6[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x114bb3,null))[_0x3b7b('0x25')](saveUpdates(_0x3f8ed6[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x114bb3,null))[_0x3b7b('0x2f')](handleError(_0x114bb3,null));};exports[_0x3b7b('0x72')]=function(_0x42a29a,_0x47513a,_0x4e0388){_0x42a29a[_0x3b7b('0x5f')]['customerAvatar']=_0x42a29a[_0x3b7b('0x70')][_0x3b7b('0x71')];return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x42a29a[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x47513a,null))[_0x3b7b('0x25')](saveUpdates(_0x42a29a[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x47513a,null))[_0x3b7b('0x2f')](handleError(_0x47513a,null));};exports[_0x3b7b('0x73')]=function(_0x22420d,_0x16b30a,_0x392a5d){_0x22420d[_0x3b7b('0x5f')][_0x3b7b('0x74')]=_0x22420d['file'][_0x3b7b('0x71')];return db[_0x3b7b('0x55')]['find']({'where':{'id':_0x22420d[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x16b30a,null))[_0x3b7b('0x25')](saveUpdates(_0x22420d[_0x3b7b('0x5f')],null))[_0x3b7b('0x25')](respondWithResult(_0x16b30a,null))[_0x3b7b('0x2f')](handleError(_0x16b30a,null));};exports[_0x3b7b('0x75')]=function(_0x23432d,_0x1bd020,_0x11cf20){var _0x534d24=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],'server/files/images/logos/default_logo.png');var _0x2c3011={'where':{'id':_0x23432d[_0x3b7b('0x59')]['id']},'attributes':['id',_0x3b7b('0x78')],'raw':!![]};var _0x118668=![];return require(_0x3b7b('0x79'))['getLicense']()[_0x3b7b('0x25')](function(_0x2d79fa){if(_0x2d79fa){_0x118668=_0x2d79fa[_0x3b7b('0x7a')];}})[_0x3b7b('0x25')](function(){return db[_0x3b7b('0x55')]['find'](_0x2c3011);})['then'](handleEntityNotFound(_0x1bd020,null))['then'](function(_0x3fdf61){if(_0x3fdf61){if(!_['isNil'](_0x3fdf61['sitepic'])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config['root'],_0x3b7b('0x7c'),_0x3fdf61['sitepic']))&&_0x118668){_0x534d24=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x7c'),_0x3fdf61[_0x3b7b('0x78')]);}}return _0x1bd020['download'](_0x534d24);}})[_0x3b7b('0x2f')](handleError(_0x1bd020,null));};exports['getAvatar']=function(_0x4b8e32,_0xac65f2,_0x51027b){var _0x7e6c1a=path['join'](config['root'],_0x3b7b('0x7d'));var _0x14ba3a={'where':{'id':_0x4b8e32['params']['id']},'attributes':['id',_0x3b7b('0x7e')],'raw':!![]};return db[_0x3b7b('0x55')][_0x3b7b('0x5d')](_0x14ba3a)['then'](handleEntityNotFound(_0xac65f2,null))[_0x3b7b('0x25')](function(_0x37e13e){if(_0x37e13e){if(!_[_0x3b7b('0x7f')](_0x37e13e[_0x3b7b('0x7e')])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config['root'],_0x3b7b('0x80'),_0x37e13e[_0x3b7b('0x7e')]))){_0x7e6c1a=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],'server/files/images/avatars/',_0x37e13e[_0x3b7b('0x7e')]);}}return _0xac65f2[_0x3b7b('0x81')](_0x7e6c1a);}})[_0x3b7b('0x2f')](handleError(_0xac65f2,null));};exports['getCustomerAvatar']=function(_0x115c56,_0x4c45d2,_0x141910){var _0x55d8f0=path[_0x3b7b('0x76')](config['root'],_0x3b7b('0x82'));var _0x41f7b3={'where':{'id':_0x115c56[_0x3b7b('0x59')]['id']},'attributes':['id',_0x3b7b('0x83'),_0x3b7b('0x84')],'raw':!![]};return db[_0x3b7b('0x55')][_0x3b7b('0x5d')](_0x41f7b3)[_0x3b7b('0x25')](handleEntityNotFound(_0x4c45d2,null))[_0x3b7b('0x25')](function(_0x3c5cfd){if(_0x3c5cfd){if(!_[_0x3b7b('0x7f')](_0x3c5cfd[_0x3b7b('0x83')])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x80'),_0x3c5cfd[_0x3b7b('0x83')]))&&_0x3c5cfd[_0x3b7b('0x84')]){_0x55d8f0=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x80'),_0x3c5cfd[_0x3b7b('0x83')]);}}return _0x4c45d2[_0x3b7b('0x81')](_0x55d8f0);}})[_0x3b7b('0x2f')](handleError(_0x4c45d2,null));};exports[_0x3b7b('0x85')]=function(_0x2cfd16,_0x2016c5,_0x20abaa){var _0x1ebb7f=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x86'));var _0x5e4d2d={'where':{'id':_0x2cfd16[_0x3b7b('0x59')]['id']},'attributes':['id',_0x3b7b('0x74')],'raw':!![]};return db[_0x3b7b('0x55')][_0x3b7b('0x5d')](_0x5e4d2d)[_0x3b7b('0x25')](handleEntityNotFound(_0x2016c5,null))[_0x3b7b('0x25')](function(_0x34dcdc){if(_0x34dcdc){if(!_[_0x3b7b('0x7f')](_0x34dcdc[_0x3b7b('0x74')])){if(fs[_0x3b7b('0x7b')](path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],'server/files/images/avatars/',_0x34dcdc[_0x3b7b('0x74')]))){_0x1ebb7f=path[_0x3b7b('0x76')](config[_0x3b7b('0x77')],_0x3b7b('0x80'),_0x34dcdc[_0x3b7b('0x74')]);}}return _0x2016c5[_0x3b7b('0x81')](_0x1ebb7f);}})[_0x3b7b('0x2f')](handleError(_0x2016c5,null));};exports['notify']=function(_0x34ac89,_0x1db168,_0x1374e9){var _0xbe923=require(_0x3b7b('0x87'));var _0x533553=new _0xbe923();var _0x8fca6=_0x533553[_0x3b7b('0x88')](_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0x8a')])['getResult']();var _0x2ab974={'body':_0x34ac89[_0x3b7b('0x5f')],'channel':_0x3b7b('0x8b')};var _0x2cadf3=[];var _0x3182e0=[];var _0x5231b6={};var _0x131c54=![];return db[_0x3b7b('0x8c')]['describe']()[_0x3b7b('0x25')](function(_0x4f8b86){if(!_0x4f8b86){throw new db['Sequelize'][(_0x3b7b('0x8d'))]('no\x20available\x20attributes');}_0x2cadf3=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x4f8b86),[_0x3b7b('0x8f'),'updatedAt']);_0x3182e0=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x4f8b86),[_0x3b7b('0x8f'),'updatedAt',_0x3b7b('0x90'),_0x3b7b('0x91')]);if(_0x34ac89[_0x3b7b('0x5f')]['id']){delete _0x34ac89[_0x3b7b('0x5f')]['id'];}if(_[_0x3b7b('0x7f')](_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x92')])){throw new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x94'));}if(_[_0x3b7b('0x7f')](_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x5f')])||_0x34ac89[_0x3b7b('0x5f')]['body']===''){throw new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x95'));}if(_['isNil'](_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x96')])){throw new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x97')+_0x3182e0);}if(!_[_0x3b7b('0x98')](_0x3182e0,_0x34ac89[_0x3b7b('0x5f')]['mapKey'])){throw new db['Sequelize'][(_0x3b7b('0x8d'))](_0x3b7b('0x99')+_0x3182e0);}_0x5231b6[_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x96')]]=_0x34ac89[_0x3b7b('0x5f')]['from'];})['then'](function(){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x34ac89[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0x9a')],'as':_0x3b7b('0x9b'),'include':[{'model':db[_0x3b7b('0x8c')],'as':_0x3b7b('0x9c'),'where':_0x5231b6,'limit':0x1,'order':[[_0x3b7b('0x9d'),_0x3b7b('0x9e')]]}]},{'model':db[_0x3b7b('0x9f')],'as':_0x3b7b('0xa0')}]});})['then'](handleEntityNotFound(_0x1db168,null))[_0x3b7b('0x25')](function(_0x5368ca){if(_0x5368ca&&_0x5368ca[_0x3b7b('0x9b')]){_0x2ab974[_0x3b7b('0xa1')]=_0x5368ca;_0x2ab974[_0x3b7b('0xa2')]=_0x5368ca[_0x3b7b('0xa0')];_0x2ab974[_0x3b7b('0xa3')]=_0x5368ca['List'];_0x2ab974['applications']=_[_0x3b7b('0xa4')](_0x2ab974[_0x3b7b('0xa2')],[_0x3b7b('0xa5')],[_0x3b7b('0xa6')]);if(_0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0xa0')]){delete _0x2ab974['account'][_0x3b7b('0xa0')];}if(_0x2ab974[_0x3b7b('0xa1')]['List']&&_0x2ab974['account'][_0x3b7b('0x9b')][_0x3b7b('0x9c')][_0x3b7b('0x46')]){return _0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0x9b')][_0x3b7b('0x9c')][0x0];}var _0x5b854b=_[_0x3b7b('0x1b')](_0x34ac89[_0x3b7b('0x5f')],{'firstName':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x92')],'ListId':_0x5368ca[_0x3b7b('0x91')]});_0x5b854b[_0x34ac89[_0x3b7b('0x5f')]['mapKey']]=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x92')];return db[_0x3b7b('0x8c')][_0x3b7b('0x5e')](_0x5b854b,{'fields':_0x2cadf3,'raw':!![]});}})['then'](handleEntityNotFound(_0x1db168,null))[_0x3b7b('0x25')](function(_0x3c8a87){_0x2ab974[_0x3b7b('0xa7')]=_0x3c8a87;var _0x1ff42a=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xa8')];if(_0x34ac89['headers']['cf-connecting-ip']){_0x1ff42a=_0x34ac89[_0x3b7b('0x89')]['cf-connecting-ip'];}else if(_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0xa9')]){_0x1ff42a=_[_0x3b7b('0xaa')](_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0xa9')][_0x3b7b('0xab')](','));}if(_0x3c8a87){var _0x6f9977={'ContactId':_0x3c8a87['id'],'ChatWebsiteId':_0x34ac89[_0x3b7b('0x59')]['id'],'from':(_0x3c8a87['firstName']||'')+'\x20'+(_0x3c8a87[_0x3b7b('0xac')]||''),'customerIp':_0x1ff42a,'customerPort':_0x34ac89['headers'][_0x3b7b('0xad')]?_0x34ac89[_0x3b7b('0x89')][_0x3b7b('0xad')]:null,'referer':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xae')],'browserName':_0x8fca6[_0x3b7b('0xaf')]['name']&&_0x8fca6[_0x3b7b('0xaf')][_0x3b7b('0xb0')]?util['format']('%s\x20%s',_0x8fca6[_0x3b7b('0xaf')]['name'],_0x8fca6['browser'][_0x3b7b('0xb0')]):_0x3b7b('0xb1'),'browserVersion':_0x8fca6[_0x3b7b('0xaf')][_0x3b7b('0xb0')]||_0x3b7b('0xb1'),'osName':util['format'](_0x3b7b('0xb2'),_0x8fca6['os']['name'],_0x8fca6['os'][_0x3b7b('0xb0')]),'osVersion':_0x8fca6['os'][_0x3b7b('0xb0')],'deviceModel':_0x8fca6[_0x3b7b('0xb3')]['model']&&_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0xb4')]?util[_0x3b7b('0xb5')](_0x3b7b('0xb6'),_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0x43')],_0x8fca6['device'][_0x3b7b('0xb4')],_0x8fca6['device'][_0x3b7b('0x51')]):null,'deviceVendor':_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0xb4')],'deviceType':_0x8fca6[_0x3b7b('0xb3')][_0x3b7b('0x51')],'formData':JSON[_0x3b7b('0xb7')](_0x34ac89[_0x3b7b('0x5f')])};var _0x16d416={'ChatWebsiteId':_0x34ac89['params']['id'],'closed':![]};if(_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xb8')]){_0x16d416[_0x3b7b('0xb8')]=_0x34ac89['body'][_0x3b7b('0xb8')];return db[_0x3b7b('0xb9')][_0x3b7b('0x5d')]({'where':_0x16d416})[_0x3b7b('0x25')](function(_0x34d3ab){if(_0x34d3ab){return[_0x34d3ab,![]];}_0x6f9977[_0x3b7b('0xb8')]=_0x34ac89['body']['threadId'];_0x6f9977['externalUrl']=_0x34ac89['body'][_0x3b7b('0xba')];return db[_0x3b7b('0xb9')][_0x3b7b('0x5e')](_0x6f9977)['then'](function(_0x41868c){return[_0x41868c,!![]];});});}_0x16d416[_0x3b7b('0xbb')]=_0x3c8a87['id'];if(_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbc')]&&_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbc')]['id']){_0x16d416['id']=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbc')]['id'];return db['ChatInteraction'][_0x3b7b('0x5d')]({'where':_0x16d416})[_0x3b7b('0x25')](function(_0x5ebca6){if(_0x5ebca6){return[_0x5ebca6,![]];}return db['ChatInteraction'][_0x3b7b('0x5e')](_0x6f9977)['then'](function(_0x26811b){return[_0x26811b,!![]];});});}return db[_0x3b7b('0xb9')][_0x3b7b('0x5e')](_0x6f9977)[_0x3b7b('0x25')](function(_0x1295fe){return[_0x1295fe,!![]];});}})['spread'](function(_0xc57368,_0x3fd845){if(_0xc57368){_0x131c54=_0x3fd845;if(!_0x3fd845){var _0x335d52={'from':(_0x2ab974[_0x3b7b('0xa7')][_0x3b7b('0xbd')]||'')+'\x20'+(_0x2ab974[_0x3b7b('0xa7')][_0x3b7b('0xac')]||'')};if(_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xb8')]&&_0x34ac89['body'][_0x3b7b('0xbe')]&&_0x34ac89['body'][_0x3b7b('0xb8')]!=_0x34ac89['body'][_0x3b7b('0xbe')]){_0x335d52[_0x3b7b('0xb8')]=_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xbe')];}return _0xc57368['update'](_0x335d52);}else{return _0xc57368;}}})[_0x3b7b('0x25')](function(_0x14d48d){_0x2ab974['interaction']=_0x14d48d[_0x3b7b('0x38')]({'plain':!![]});_0x2ab974[_0x3b7b('0xbc')][_0x3b7b('0xbf')]=_0x131c54;if(_0x2ab974[_0x3b7b('0xbc')]['created']){if(_0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0xc0')]){_0x2ab974['applications'][_0x3b7b('0xc1')]({'id':0x0,'priority':_0x2ab974[_0x3b7b('0xa2')][_0x3b7b('0x46')]+0x1,'app':'close','appdata':_0x3b7b('0xc2'),'interval':_0x3b7b('0xc3')});}}return db[_0x3b7b('0xc4')][_0x3b7b('0x5e')]({'body':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0x5f')],'ChatWebsiteId':_0x34ac89[_0x3b7b('0x59')]['id'],'ChatInteractionId':_0x14d48d['id'],'direction':'in','ContactId':_0x2ab974[_0x3b7b('0xa7')]['id'],'AttachmentId':_0x34ac89[_0x3b7b('0x5f')][_0x3b7b('0xc5')]});})[_0x3b7b('0x25')](function(_0x30031f){_0x2ab974[_0x3b7b('0x2d')]=_0x30031f;if(_0x2ab974['interaction'][_0x3b7b('0xc6')]){return db['User']['find']({'attributes':['id',_0x3b7b('0x63')],'where':{'id':_0x2ab974[_0x3b7b('0xbc')]['UserId']}})[_0x3b7b('0x25')](function(_0x4616bb){if(_0x4616bb){_0x2ab974[_0x3b7b('0xa2')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3b7b('0xc7'),'appdata':_0x4616bb[_0x3b7b('0x63')]+','+(_0x2ab974[_0x3b7b('0xa1')][_0x3b7b('0xc8')]||0xa),'interval':'*,*,*,*'});_0x2ab974['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x3b7b('0xc9'),_0x2ab974);});}return respondWithRpcPromise(_0x3b7b('0xca'),_0x3b7b('0xc9'),_0x2ab974);})[_0x3b7b('0x25')](function(_0x359125){respondWithRpcPromise(_0x3b7b('0xcb'),'EventManager',{'event':_0x3b7b('0xcc'),'message':_0x359125},client9002);return _0x359125;})[_0x3b7b('0x25')](respondWithResult(_0x1db168,null))['catch'](handleError(_0x1db168,null));};exports['offline']=function(_0xf86887,_0x2265ba,_0x2f59cf){var _0x163d8e,_0x1541b4,_0x27688c;var _0x33e4d0=[];var _0x269f92=[];var _0x15ecd8={};return db[_0x3b7b('0x8c')][_0x3b7b('0x65')]()[_0x3b7b('0x25')](function(_0x414c6e){if(!_0x414c6e){throw new db['Sequelize'][(_0x3b7b('0x8d'))](_0x3b7b('0xcd'));}_0x269f92=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x414c6e),['createdAt',_0x3b7b('0x9d')]);_0x33e4d0=_[_0x3b7b('0x8e')](_[_0x3b7b('0x5b')](_0x414c6e),[_0x3b7b('0x8f'),'updatedAt',_0x3b7b('0x90'),'ListId']);if(_0xf86887[_0x3b7b('0x5f')]['id']){delete _0xf86887[_0x3b7b('0x5f')]['id'];}if(_[_0x3b7b('0x7f')](_0xf86887['body'][_0x3b7b('0x92')])){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))]('from\x20is\x20mandatory'));}if(_[_0x3b7b('0x7f')](_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x5f')])||_0xf86887[_0x3b7b('0x5f')]['body']===''){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0x95')));}if(_['isNil'](_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')])){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db[(_0x3b7b('0x93'))][(_0x3b7b('0x8d'))](_0x3b7b('0xcf')+_0x33e4d0));}if(!_[_0x3b7b('0x98')](_0x33e4d0,_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')])){throw _0x2265ba[_0x3b7b('0x30')](0x1f4)[_0x3b7b('0x3e')](new db['Sequelize'][(_0x3b7b('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x33e4d0));}_0x15ecd8[_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')]]=_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x92')];})[_0x3b7b('0x25')](function(){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0xf86887['params']['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0x3b7b('0x25')](handleEntityNotFound(_0x2265ba,null))['then'](function(_0x3b8292){if(_0x3b8292&&_0x3b8292[_0x3b7b('0x9b')]){_0x1541b4=_0x3b8292;var _0xc0e145=_[_0x3b7b('0x1b')](_0xf86887['body'],{'firstName':_0xf86887['body']['from'],'phone':_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x92')],'ListId':_0x3b8292[_0x3b7b('0x91')]});_0xc0e145[_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0xce')]]=_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x92')];return db[_0x3b7b('0x8c')][_0x3b7b('0xd0')]({'where':_0x15ecd8,'defaults':_0xc0e145});}})[_0x3b7b('0xd1')](function(_0x4e5f0e){if(_0x4e5f0e){_0x27688c=_0x4e5f0e;var _0x3950f5=fs['readFileSync'](path[_0x3b7b('0x76')](config['root'],_0x3b7b('0xd2')),_0x3b7b('0xd3'));var _0x32621c=ejs[_0x3b7b('0xd4')](_0x3950f5,{'body':_['toPairs'](_0xf86887[_0x3b7b('0x5f')][_0x3b7b('0x5f')]),'bodyTitle':_0x1541b4[_0x3b7b('0xd5')]});return db[_0x3b7b('0xd6')][_0x3b7b('0x5e')]({'body':_0x32621c,'ContactId':_0x4e5f0e['id'],'ChatWebsiteId':_0x1541b4['id']});}})['then'](function(_0x736474){if(_0x736474){_0x163d8e=_0x736474;return db[_0x3b7b('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x37652a){if(_0x37652a&&_0x37652a[_0x3b7b('0xd8')]&&_0x1541b4[_0x3b7b('0xd9')]){var _0x50c9e2={'tls':{'rejectUnauthorized':![]}};if(_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xda')]){_0x50c9e2[_0x3b7b('0xda')]=_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xda')];}else{_0x50c9e2[_0x3b7b('0xdb')]=_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xdb')];_0x50c9e2[_0x3b7b('0xdc')]=_0x37652a['Smtp'][_0x3b7b('0xdc')];_0x50c9e2[_0x3b7b('0xdd')]=_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xdd')];}if(_0x37652a['Smtp'][_0x3b7b('0xde')]){_0x50c9e2['auth']={'user':_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0x60')],'pass':_0x37652a[_0x3b7b('0xd8')][_0x3b7b('0xdf')]};}return respondWithRpcPromise(_0x3b7b('0xe0'),_0x3b7b('0xe1'),{'account':_0x50c9e2,'message':{'from':util[_0x3b7b('0xb5')](_0x3b7b('0xe2'),_0x37652a[_0x3b7b('0x63')],_0x37652a[_0x3b7b('0xe3')]||_0x37652a[_0x3b7b('0xd8')]['user']),'to':_0x1541b4[_0x3b7b('0xd9')],'subject':_0x1541b4[_0x3b7b('0xe4')],'text':_0x163d8e[_0x3b7b('0x5f')]}},client9003)['then'](function(){return _0x163d8e;})['catch'](function(_0x536b6d){console[_0x3b7b('0x2b')](_0x536b6d);});}})[_0x3b7b('0x25')](function(){if(_0x163d8e){return _0x163d8e;}})['then'](respondWithResult(_0x2265ba,null))['catch'](handleError(_0x2265ba,null));};exports[_0x3b7b('0xe5')]=function(_0x4ccfe2,_0x166493,_0x79293){return db[_0x3b7b('0xb9')][_0x3b7b('0x5d')]({'where':{'id':_0x4ccfe2['params']['id']}})['then'](handleEntityNotFound(_0x166493,null))[_0x3b7b('0x25')](function(_0x208fca){if(_0x208fca){return _0x208fca[_0x3b7b('0xe5')](_0x4ccfe2[_0x3b7b('0x5f')][_0x3b7b('0x6a')],_[_0x3b7b('0xe6')](_0x4ccfe2['body'],[_0x3b7b('0x6a'),'id'])||{});}})[_0x3b7b('0x25')](respondWithResult(_0x166493,null))[_0x3b7b('0x2f')](handleError(_0x166493,null));};exports[_0x3b7b('0xe7')]=function(_0x4dfa16,_0x58d5e8,_0x549621){var _0xf61eac={'raw':![],'where':{}};var _0x20d694={};var _0x541346={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3b7b('0x68')]({'where':{'id':_0x4dfa16[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x58d5e8,null))['then'](function(_0xd070db){if(_0xd070db){_0x20d694[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db['ChatInteraction'][_0x3b7b('0x40')]);_0x20d694[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x4dfa16['query']);_0x20d694[_0x3b7b('0x4d')]=_[_0x3b7b('0x42')](_0x20d694[_0x3b7b('0x43')],_0x20d694[_0x3b7b('0x41')]);_0xf61eac[_0x3b7b('0x44')]=_['intersection'](_0x20d694[_0x3b7b('0x43')],qs['fields'](_0x4dfa16[_0x3b7b('0x41')]['fields']));_0xf61eac[_0x3b7b('0x44')]=_0xf61eac['attributes'][_0x3b7b('0x46')]?_0xf61eac[_0x3b7b('0x44')]:_0x20d694[_0x3b7b('0x43')];if(!_0x4dfa16[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0xf61eac[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x4dfa16[_0x3b7b('0x41')]['limit']);_0xf61eac['offset']=qs['offset'](_0x4dfa16['query'][_0x3b7b('0x33')]);}_0xf61eac[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x4dfa16['query']['sort']);_0xf61eac[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_['pick'](_0x4dfa16[_0x3b7b('0x41')],_0x20d694[_0x3b7b('0x4d')]));_0xf61eac[_0x3b7b('0x4b')][_0x3b7b('0x66')]=_0xd070db['id'];if(_0x4dfa16[_0x3b7b('0x41')]['filter']){_0xf61eac[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0xf61eac[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0xf61eac['attributes'],function(_0x4bbb5b){var _0x40d96c={};_0x40d96c[_0x4bbb5b]={'$like':'%'+_0x4dfa16[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x40d96c;})});}_0xf61eac=_[_0x3b7b('0x4f')]({},_0xf61eac,_0x4dfa16['options']);return db['ChatInteraction'][_0x3b7b('0x32')]({'where':_0xf61eac['where']})[_0x3b7b('0x25')](function(_0x2521e3){_0x541346[_0x3b7b('0x32')]=_0x2521e3;if(_0x4dfa16['query'][_0x3b7b('0x56')]){_0xf61eac[_0x3b7b('0x5c')]=[{'model':db[_0x3b7b('0x8c')],'as':_0x3b7b('0xe8'),'required':![]},{'model':db[_0x3b7b('0xe9')],'as':_0x3b7b('0xea'),'attributes':[_0x3b7b('0x63'),_0x3b7b('0xeb'),_0x3b7b('0xec')],'required':![]},{'model':db[_0x3b7b('0xed')],'as':_0x3b7b('0xee'),'attributes':['id',_0x3b7b('0x63'),_0x3b7b('0xef')],'where':_0x4dfa16['query'][_0x3b7b('0xf0')]?{'id':_0x4dfa16['query']['tag']}:undefined,'required':_0x4dfa16['query'][_0x3b7b('0xf0')]?!![]:![]}];}return db[_0x3b7b('0xb9')]['findAll'](_0xf61eac);})[_0x3b7b('0x25')](function(_0x599695){_0x541346[_0x3b7b('0x6d')]=_0x599695;return _0x541346;});}})[_0x3b7b('0x25')](respondWithFilteredResult(_0x58d5e8,_0xf61eac))[_0x3b7b('0x2f')](handleError(_0x58d5e8,null));};function iftimePromise(_0x4861fe,_0x24c7c1){return respondWithRpcPromise('Command',_0x3b7b('0xf1'),{'command':_0x24c7c1[_0x3b7b('0xf2')]?util['format'](_0x3b7b('0xf3'),_0x4861fe[_0x3b7b('0xf4')],_0x24c7c1[_0x3b7b('0xf2')]):util[_0x3b7b('0xb5')](_0x3b7b('0xf5'),_0x4861fe[_0x3b7b('0xf4')])},client9002)['then'](function(_0x50a052){var _0x59cf6c=_0x50a052&&_0x50a052[_0x3b7b('0xf6')](_0x3b7b('0xf7'))>=0x0?!![]:![];logger[_0x3b7b('0x26')](_0x3b7b('0xf8'),_0x24c7c1['id'],_0x4861fe['id'],_0x4861fe['interval'],_0x59cf6c?_0x3b7b('0xf9'):_0x3b7b('0xfa'),_0x24c7c1[_0x3b7b('0xf2')]?_0x24c7c1[_0x3b7b('0xf2')]:'No\x20timezone');return _0x59cf6c;})[_0x3b7b('0x2f')](function(_0xcc7b9b){logger['error'](_0x3b7b('0xf8'),_0x24c7c1['id'],_0x4861fe['id'],_0x4861fe[_0x3b7b('0xf4')],util['inspect'](_0xcc7b9b,{'showHidden':![],'depth':null}),_0x24c7c1[_0x3b7b('0xf2')]?_0x24c7c1[_0x3b7b('0xf2')]:_0x3b7b('0xfb'));return![];});}exports['getSnippet']=function(_0x2cc4bf,_0x5a2771,_0x584461){var _0x1aadd2=0x0;var _0x328de6=0x0;var _0x1b1e4b=![];var _0xdabe37;var _0x130ce4;return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x2cc4bf[_0x3b7b('0x59')]['id']},'include':[{'model':db[_0x3b7b('0xfc')],'as':_0x3b7b('0xfc'),'include':[{'model':db[_0x3b7b('0xfc')],'as':_0x3b7b('0xfd'),'attributes':['id',_0x3b7b('0xf4')],'raw':!![]}]}]})[_0x3b7b('0x25')](handleEntityNotFound(_0x5a2771,null))[_0x3b7b('0x25')](function(_0x17834c){if(_0x17834c){_0xdabe37=_0x17834c;return _0x17834c[_0x3b7b('0xfe')]({'raw':!![]});}})['then'](function(_0x5f55e3){if(_0xdabe37){if(_0x5f55e3){_0x130ce4=_0x5f55e3;}}return require(_0x3b7b('0x79'))[_0x3b7b('0xff')]();})[_0x3b7b('0x25')](function(_0x2726cd){if(_0x2726cd){_0x328de6=_0x2726cd[_0x3b7b('0x100')];_0x1b1e4b=_0x2726cd[_0x3b7b('0x7a')];}})['then'](function(){return db[_0x3b7b('0xb9')][_0x3b7b('0x32')]({'where':{'closed':![]}});})[_0x3b7b('0x25')](function(_0x5d376b){_0x1aadd2=_0x5d376b;if(_0x328de6&&_0x5d376b>_0x328de6){return db[_0x3b7b('0x101')][_0x3b7b('0x68')]({'where':{'id':0x1}})[_0x3b7b('0x25')](function(_0x1bed9a){if(_0x1bed9a){_0x1bed9a['increment'](_0x3b7b('0x102'));}});}})[_0x3b7b('0x25')](function(){if(_0xdabe37['Interval']&&_0xdabe37[_0x3b7b('0xfc')][_0x3b7b('0xfd')]){var _0x4e2ccc=[];for(var _0x34dd1a=0x0;_0x34dd1a<_0xdabe37[_0x3b7b('0xfc')][_0x3b7b('0xfd')][_0x3b7b('0x46')];_0x34dd1a++){var _0x266d94=_0xdabe37['Interval'][_0x3b7b('0xfd')][_0x34dd1a][_0x3b7b('0x38')]({'plain':!![]});_0x4e2ccc[_0x3b7b('0xc1')](iftimePromise(_0x266d94,_0xdabe37));}return BPromise[_0x3b7b('0x103')](_0x4e2ccc)[_0x3b7b('0x25')](function(_0x42e828){return _[_0x3b7b('0x104')](_0x42e828);});}else{return!![];}})[_0x3b7b('0x25')](function(_0x46958d){var _0x12dbf2=fs[_0x3b7b('0x105')](path['join'](config[_0x3b7b('0x77')],_0x3b7b('0x106')),_0x3b7b('0xd3'));var _0x2a68a5={'remote':_0xdabe37[_0x3b7b('0x107')],'query':querystring[_0x3b7b('0xb7')](_[_0x3b7b('0x4f')](_0xdabe37[_0x3b7b('0x38')]({'plain':!![]}),{'customerIp':_0x2cc4bf[_0x3b7b('0x89')]['x-forwarded-for']||_0x2cc4bf['headers']['x-real-ip']||_0x2cc4bf['connection'][_0x3b7b('0x108')]||_0x2cc4bf['ip'],'referer':_0x2cc4bf[_0x3b7b('0x89')][_0x3b7b('0xae')],'openedInteractions':_0x1aadd2,'maxInteractions':_0x328de6,'virtual':_0x1b1e4b[_0x3b7b('0x100')],'online':_0x46958d,'custom':_0x1b1e4b}))[_0x3b7b('0x109')](/'/g,'\x5c\x27')};_0x5a2771[_0x3b7b('0x3e')](ejs[_0x3b7b('0xd4')](Mustache[_0x3b7b('0xd4')](_0x12dbf2,_0x2a68a5),{'proactiveActions':_0x130ce4,'alignment':_0xdabe37[_0x3b7b('0x10a')],'verticalAlignment':_0xdabe37[_0x3b7b('0x10b')]}));})[_0x3b7b('0x2f')](handleError(_0x5a2771,null));};exports['addApplications']=function(_0xea9bfa,_0xbd8813,_0x3fa60d){return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0xea9bfa[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0xbd8813,null))[_0x3b7b('0x25')](function(_0x5d2e16){if(_0x5d2e16){return db[_0x3b7b('0x10c')][_0x3b7b('0x10d')](function(_0x9cd313){return db[_0x3b7b('0x9f')][_0x3b7b('0x37')]({'where':{'ChatWebsiteId':_0xea9bfa[_0x3b7b('0x59')]['id']},'transaction':_0x9cd313})[_0x3b7b('0x25')](function(_0x53154e){var _0x181ed3=_[_0x3b7b('0x50')](_0xea9bfa[_0x3b7b('0x5f')],function(_0x42fbbe){_0x42fbbe[_0x3b7b('0x66')]=_0xea9bfa[_0x3b7b('0x59')]['id'];return _0x42fbbe;});return db[_0x3b7b('0x9f')][_0x3b7b('0x10e')](_0x181ed3,{'transaction':_0x9cd313});});})['then'](function(){return db[_0x3b7b('0x9f')][_0x3b7b('0x10f')]({'where':{'ChatWebsiteId':_0xea9bfa[_0x3b7b('0x59')]['id']},'order':_0x3b7b('0xa5')});});}})[_0x3b7b('0x25')](respondWithResult(_0xbd8813,null))[_0x3b7b('0x2f')](handleError(_0xbd8813,null));};exports[_0x3b7b('0x110')]=function(_0x2f8afc,_0xb17a4e,_0x1cc30c){var _0x205b54={};var _0x2c3582={};var _0x21c3bb;var _0x63cac0;return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x2f8afc[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0xb17a4e,null))[_0x3b7b('0x25')](function(_0x15a5f2){if(_0x15a5f2){_0x21c3bb=_0x15a5f2;_0x2c3582[_0x3b7b('0x43')]=_['keys'](db[_0x3b7b('0x9f')][_0x3b7b('0x40')]);_0x2c3582[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x2f8afc['query']);_0x2c3582[_0x3b7b('0x4d')]=_['intersection'](_0x2c3582[_0x3b7b('0x43')],_0x2c3582[_0x3b7b('0x41')]);_0x205b54['attributes']=_['intersection'](_0x2c3582[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x45')]));_0x205b54[_0x3b7b('0x44')]=_0x205b54[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x205b54['attributes']:_0x2c3582[_0x3b7b('0x43')];_0x205b54[_0x3b7b('0x49')]=qs['sort'](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x205b54[_0x3b7b('0x4b')]=qs['filters'](_['pick'](_0x2f8afc[_0x3b7b('0x41')],_0x2c3582[_0x3b7b('0x4d')]));if(_0x2f8afc[_0x3b7b('0x41')]['filter']){_0x205b54['where']=_[_0x3b7b('0x4f')](_0x205b54[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0x205b54[_0x3b7b('0x44')],function(_0x1ddefd){var _0x99261b={};_0x99261b[_0x1ddefd]={'$like':'%'+_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x99261b;})});}_0x205b54=_[_0x3b7b('0x4f')]({},_0x205b54,_0x2f8afc[_0x3b7b('0x54')]);return _0x21c3bb['getApplications'](_0x205b54);}})[_0x3b7b('0x25')](function(_0x42b27d){if(_0x42b27d){_0x63cac0=_0x42b27d['length'];if(!_0x2f8afc[_0x3b7b('0x41')]['hasOwnProperty'](_0x3b7b('0x48'))){_0x205b54[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x205b54['offset']=qs['offset'](_0x2f8afc[_0x3b7b('0x41')][_0x3b7b('0x33')]);}return _0x21c3bb['getApplications'](_0x205b54);}})[_0x3b7b('0x25')](function(_0x4d7930){if(_0x4d7930){return _0x4d7930?{'count':_0x63cac0,'rows':_0x4d7930}:null;}})[_0x3b7b('0x25')](respondWithResult(_0xb17a4e,null))[_0x3b7b('0x2f')](handleError(_0xb17a4e,null));};exports[_0x3b7b('0x111')]=function(_0x1b470d,_0x39be0a,_0x387d44){return db[_0x3b7b('0x112')][_0x3b7b('0x5d')]({'where':{'id':_0x1b470d[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x39be0a,null))['then'](function(_0x5af8ae){if(_0x5af8ae){return _0x5af8ae[_0x3b7b('0x111')](_0x1b470d[_0x3b7b('0x5f')]['ids'],_[_0x3b7b('0xe6')](_0x1b470d[_0x3b7b('0x5f')],[_0x3b7b('0x6a'),'id'])||{});}})[_0x3b7b('0x25')](respondWithResult(_0x39be0a,null))[_0x3b7b('0x2f')](handleError(_0x39be0a,null));};exports[_0x3b7b('0xfe')]=function(_0x31af31,_0x45f40c,_0x2e2620){var _0x2e18f6={};var _0x5ccd92={};var _0x11e169;var _0x58420d;return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x31af31[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x45f40c,null))[_0x3b7b('0x25')](function(_0xd78144){if(_0xd78144){_0x11e169=_0xd78144;_0x5ccd92[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db[_0x3b7b('0x113')][_0x3b7b('0x40')]);_0x5ccd92[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x31af31[_0x3b7b('0x41')]);_0x5ccd92[_0x3b7b('0x4d')]=_[_0x3b7b('0x42')](_0x5ccd92['model'],_0x5ccd92[_0x3b7b('0x41')]);_0x2e18f6[_0x3b7b('0x44')]=_['intersection'](_0x5ccd92[_0x3b7b('0x43')],qs[_0x3b7b('0x45')](_0x31af31['query']['fields']));_0x2e18f6['attributes']=_0x2e18f6[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x2e18f6[_0x3b7b('0x44')]:_0x5ccd92[_0x3b7b('0x43')];_0x2e18f6[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x31af31[_0x3b7b('0x41')]['sort']);_0x2e18f6[_0x3b7b('0x4b')]=qs['filters'](_[_0x3b7b('0x4c')](_0x31af31[_0x3b7b('0x41')],_0x5ccd92[_0x3b7b('0x4d')]));if(_0x31af31['query'][_0x3b7b('0x4e')]){_0x2e18f6[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x2e18f6[_0x3b7b('0x4b')],{'$or':_[_0x3b7b('0x50')](_0x2e18f6['attributes'],function(_0x5644a0){var _0x19662d={};_0x19662d[_0x5644a0]={'$like':'%'+_0x31af31[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0x19662d;})});}_0x2e18f6=_[_0x3b7b('0x4f')]({},_0x2e18f6,_0x31af31[_0x3b7b('0x54')]);return _0x11e169['getProactiveActions'](_0x2e18f6);}})[_0x3b7b('0x25')](function(_0x382de6){if(_0x382de6){_0x58420d=_0x382de6['length'];if(!_0x31af31[_0x3b7b('0x41')][_0x3b7b('0x47')]('nolimit')){_0x2e18f6[_0x3b7b('0x34')]=qs['limit'](_0x31af31[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x2e18f6[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x31af31['query']['offset']);}return _0x11e169[_0x3b7b('0xfe')](_0x2e18f6);}})[_0x3b7b('0x25')](function(_0x4de246){if(_0x4de246){return _0x4de246?{'count':_0x58420d,'rows':_0x4de246}:null;}})[_0x3b7b('0x25')](respondWithResult(_0x45f40c,null))['catch'](handleError(_0x45f40c,null));};exports[_0x3b7b('0x114')]=function(_0x524a01,_0x2b7139,_0x34822c){var _0x41d3d0=_0x524a01[_0x3b7b('0x41')][_0x3b7b('0x115')]===_0x3b7b('0x116')?'offlineForm':_0x3b7b('0x117');return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'attributes':['id',_0x41d3d0],'where':{'id':_0x524a01[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x2b7139,null))[_0x3b7b('0x25')](function(_0x2517b4){if(_0x2517b4){var _0x54bfcf=_0x2517b4[_0x41d3d0];var _0x5a4529=_0x54bfcf&&_0x54bfcf[_0x3b7b('0x118')]?_0x54bfcf[_0x3b7b('0x118')]:[];_0x2b7139[_0x3b7b('0x3e')]({'fromKey':_[_0x3b7b('0x7f')](_0x54bfcf['fromKey'])?undefined:_0x54bfcf[_0x3b7b('0x119')],'count':_0x5a4529[_0x3b7b('0x46')],'rows':_0x5a4529});}})[_0x3b7b('0x2f')](handleError(_0x2b7139,null));};exports[_0x3b7b('0x11a')]=function(_0x648b16,_0x1a8642,_0x5dd048){var _0x4f7a0f={'raw':!![],'where':{}};var _0x57a3ad={};var _0x268015={'count':0x0,'rows':[]};return db[_0x3b7b('0x55')][_0x3b7b('0x68')]({'where':{'id':_0x648b16[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x1a8642,null))[_0x3b7b('0x25')](function(_0x51c6a2){if(_0x51c6a2){_0x57a3ad[_0x3b7b('0x43')]=_[_0x3b7b('0x5b')](db[_0x3b7b('0xd6')][_0x3b7b('0x40')]);_0x57a3ad[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x648b16[_0x3b7b('0x41')]);_0x57a3ad['filters']=_[_0x3b7b('0x42')](_0x57a3ad[_0x3b7b('0x43')],_0x57a3ad[_0x3b7b('0x41')]);_0x4f7a0f[_0x3b7b('0x44')]=_[_0x3b7b('0x42')](_0x57a3ad[_0x3b7b('0x43')],qs['fields'](_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x45')]));_0x4f7a0f[_0x3b7b('0x44')]=_0x4f7a0f[_0x3b7b('0x44')]['length']?_0x4f7a0f['attributes']:_0x57a3ad[_0x3b7b('0x43')];if(!_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x4f7a0f[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x4f7a0f[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x33')]);}_0x4f7a0f['order']=qs[_0x3b7b('0x4a')](_0x648b16['query'][_0x3b7b('0x4a')]);_0x4f7a0f[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_['pick'](_0x648b16[_0x3b7b('0x41')],_0x57a3ad[_0x3b7b('0x4d')]));_0x4f7a0f['where']['ChatWebsiteId']=_0x51c6a2['id'];if(_0x648b16[_0x3b7b('0x41')][_0x3b7b('0x4e')]){_0x4f7a0f[_0x3b7b('0x4b')]=_[_0x3b7b('0x4f')](_0x4f7a0f[_0x3b7b('0x4b')],{'$or':_['map'](_0x4f7a0f[_0x3b7b('0x44')],function(_0x533171){var _0x4ac2d8={};_0x4ac2d8[_0x533171]={'$like':'%'+_0x648b16['query'][_0x3b7b('0x4e')]+'%'};return _0x4ac2d8;})});}_0x4f7a0f=_[_0x3b7b('0x4f')]({},_0x4f7a0f,_0x648b16[_0x3b7b('0x54')]);return db[_0x3b7b('0xd6')][_0x3b7b('0x32')]({'where':_0x4f7a0f['where']})[_0x3b7b('0x25')](function(_0x2a0369){_0x268015['count']=_0x2a0369;if(_0x648b16[_0x3b7b('0x41')]['includeAll']){_0x4f7a0f[_0x3b7b('0x5c')]=[{'all':!![]}];}return db[_0x3b7b('0xd6')][_0x3b7b('0x57')](_0x4f7a0f);})[_0x3b7b('0x25')](function(_0x5ed0fb){_0x268015[_0x3b7b('0x6d')]=_0x5ed0fb;return _0x268015;});}})[_0x3b7b('0x25')](respondWithFilteredResult(_0x1a8642,_0x4f7a0f))[_0x3b7b('0x2f')](handleError(_0x1a8642,null));};exports[_0x3b7b('0x11b')]=function(_0x25c149,_0x490b2f,_0x1ad2e0){return db[_0x3b7b('0x55')][_0x3b7b('0x5d')]({'where':{'id':_0x25c149[_0x3b7b('0x59')]['id']}})['then'](handleEntityNotFound(_0x490b2f,null))[_0x3b7b('0x25')](function(_0x541515){if(_0x541515){return _0x541515['addAgents'](_0x25c149[_0x3b7b('0x5f')][_0x3b7b('0x6a')],_[_0x3b7b('0xe6')](_0x25c149['body'],[_0x3b7b('0x6a'),'id'])||{})[_0x3b7b('0xd1')](function(_0x5427ce){for(var _0x2eef88=0x0;_0x2eef88<_0x25c149['body'][_0x3b7b('0x6a')][_0x3b7b('0x46')];_0x2eef88+=0x1){socket[_0x3b7b('0x11c')]('userChatWebsite:save',{'UserId':_0x25c149['body'][_0x3b7b('0x6a')][_0x2eef88],'ChatWebsiteId':_0x25c149[_0x3b7b('0x59')]['id']});}return _0x5427ce;});}})[_0x3b7b('0x25')](respondWithResult(_0x490b2f,null))[_0x3b7b('0x2f')](handleError(_0x490b2f,null));};exports['removeAgents']=function(_0x2c8a4c,_0x2583eb,_0x465d7d){return db['ChatWebsite'][_0x3b7b('0x5d')]({'where':{'id':_0x2c8a4c[_0x3b7b('0x59')]['id']}})[_0x3b7b('0x25')](handleEntityNotFound(_0x2583eb,null))['then'](function(_0x5f2449){if(_0x5f2449){return _0x5f2449[_0x3b7b('0x11d')](_0x2c8a4c['query'][_0x3b7b('0x6a')])['then'](function(){if(_[_0x3b7b('0x11e')](_0x2c8a4c['query'][_0x3b7b('0x6a')])){for(var _0xf97102=0x0;_0xf97102<_0x2c8a4c[_0x3b7b('0x41')][_0x3b7b('0x6a')][_0x3b7b('0x46')];_0xf97102+=0x1){socket[_0x3b7b('0x11c')](_0x3b7b('0x11f'),{'UserId':Number(_0x2c8a4c[_0x3b7b('0x41')][_0x3b7b('0x6a')][_0xf97102]),'ChatWebsiteId':Number(_0x2c8a4c[_0x3b7b('0x59')]['id'])});}}else{socket[_0x3b7b('0x11c')](_0x3b7b('0x11f'),{'UserId':Number(_0x2c8a4c[_0x3b7b('0x41')][_0x3b7b('0x6a')]),'ChatWebsiteId':Number(_0x2c8a4c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2583eb,null))[_0x3b7b('0x2f')](handleError(_0x2583eb,null));};exports[_0x3b7b('0x120')]=function(_0x552f85,_0x127e3e,_0x113069){var _0x25bf64={};var _0x2e1701={};var _0x484e0d;var _0x58d481;return db[_0x3b7b('0x55')]['findOne']({'where':{'id':_0x552f85['params']['id']}})['then'](handleEntityNotFound(_0x127e3e,null))[_0x3b7b('0x25')](function(_0x4d4156){if(_0x4d4156){_0x484e0d=_0x4d4156;_0x2e1701[_0x3b7b('0x43')]=_['keys'](db['User'][_0x3b7b('0x40')]);_0x2e1701[_0x3b7b('0x41')]=_[_0x3b7b('0x5b')](_0x552f85[_0x3b7b('0x41')]);_0x2e1701[_0x3b7b('0x4d')]=_['intersection'](_0x2e1701[_0x3b7b('0x43')],_0x2e1701[_0x3b7b('0x41')]);_0x25bf64['attributes']=_['intersection'](_0x2e1701[_0x3b7b('0x43')],qs['fields'](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x45')]));_0x25bf64[_0x3b7b('0x44')]=_0x25bf64[_0x3b7b('0x44')][_0x3b7b('0x46')]?_0x25bf64[_0x3b7b('0x44')]:_0x2e1701['model'];_0x25bf64[_0x3b7b('0x49')]=qs[_0x3b7b('0x4a')](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x4a')]);_0x25bf64[_0x3b7b('0x4b')]=qs[_0x3b7b('0x4d')](_[_0x3b7b('0x4c')](_0x552f85[_0x3b7b('0x41')],_0x2e1701[_0x3b7b('0x4d')]));if(_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x4e')]){_0x25bf64[_0x3b7b('0x4b')]=_['merge'](_0x25bf64[_0x3b7b('0x4b')],{'$or':_['map'](_0x25bf64[_0x3b7b('0x44')],function(_0x24b865){var _0xefa6da={};_0xefa6da[_0x24b865]={'$like':'%'+_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x4e')]+'%'};return _0xefa6da;})});}_0x25bf64=_['merge']({},_0x25bf64,_0x552f85['options']);return _0x484e0d['getAgents'](_0x25bf64);}})[_0x3b7b('0x25')](function(_0x57cd5d){if(_0x57cd5d){_0x58d481=_0x57cd5d['length'];if(!_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x47')](_0x3b7b('0x48'))){_0x25bf64[_0x3b7b('0x34')]=qs[_0x3b7b('0x34')](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x34')]);_0x25bf64[_0x3b7b('0x33')]=qs[_0x3b7b('0x33')](_0x552f85[_0x3b7b('0x41')][_0x3b7b('0x33')]);}return _0x484e0d['getAgents'](_0x25bf64);}})['then'](function(_0x5188e9){if(_0x5188e9){return _0x5188e9?{'count':_0x58d481,'rows':_0x5188e9}:null;}})[_0x3b7b('0x25')](respondWithResult(_0x127e3e,null))[_0x3b7b('0x2f')](handleError(_0x127e3e,null));};
\ No newline at end of file
+var _0x2839=['CannedAnswer','getAnswers','map','removeAnswers','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','setUA','headers','user-agent','getResult','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','Applications','list','applications','orderBy','priority','asc','account','defaults','mapKey','CmContact','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','*,*,*,*','AttachmentId','User','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','getInteractions','Contact','Owner','fullname','internal','color','tag','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','utf8','remoteAddress','virtual','replace','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','request-promise','moment','mustache','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','test','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','set','Content-Range','json','save','update','ChatWebsites','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','order','ChatWebsiteId','removeDispositions','ids','addAnswer'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2839,0xae));var _0x9283=function(_0x313db1,_0x10120d){_0x313db1=_0x313db1-0x0;var _0x2d9e9e=_0x2839[_0x313db1];return _0x2d9e9e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9283('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9283('0x1'));var moment=require(_0x9283('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9283('0x3'));var util=require('util');var path=require(_0x9283('0x4'));var sox=require('sox');var csv=require(_0x9283('0x5'));var ejs=require(_0x9283('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9283('0x7'));var jsforce=require(_0x9283('0x8'));var deskjs=require(_0x9283('0x9'));var toCsv=require(_0x9283('0x5'));var querystring=require(_0x9283('0xa'));var Papa=require(_0x9283('0xb'));var Redis=require(_0x9283('0xc'));var authService=require(_0x9283('0xd'));var qs=require(_0x9283('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9283('0xf'))(_0x9283('0x10'));var utils=require(_0x9283('0x11'));var config=require(_0x9283('0x12'));var db=require(_0x9283('0x13'))['db'];config[_0x9283('0x14')]=_['defaults'](config[_0x9283('0x14')],{'host':_0x9283('0x15'),'port':0x18eb});var socket=require(_0x9283('0x16'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x9283('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9283('0x18')][_0x9283('0x19')]({'port':0x232c});var client9002=jayson[_0x9283('0x18')][_0x9283('0x19')]({'port':0x232a});var client9003=jayson['client'][_0x9283('0x19')]({'port':0x232b});function checkPasswordPattern(_0x3f8f6d,_0x26537d,_0x31f082){if(_0x31f082){var _0x329746=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x329746[_0x9283('0x1a')](_0x26537d)){return _0x3f8f6d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3f8f6d;}}function respondWithRpcPromise(_0x213cac,_0x310411,_0x4d0162,_0x5b069f){return new BPromise(function(_0x4cf9ec,_0x329be6){var _0xb87224=_0x5b069f||client;return _0xb87224[_0x9283('0x1b')](_0x213cac,_0x4d0162)[_0x9283('0x1c')](function(_0x3978e2){logger[_0x9283('0x1d')](_0x9283('0x1e'),_0x310411,_0x9283('0x1f'));logger[_0x9283('0x20')](_0x9283('0x21'),_0x310411,_0x9283('0x1f'),JSON[_0x9283('0x22')](_0x3978e2));if(_0x3978e2[_0x9283('0x23')]){if(_0x3978e2[_0x9283('0x23')][_0x9283('0x24')]===0x1f4){logger[_0x9283('0x23')](_0x9283('0x1e'),_0x310411,_0x3978e2['error']['message']);return _0x329be6(_0x3978e2[_0x9283('0x23')][_0x9283('0x25')]);}logger[_0x9283('0x23')](_0x9283('0x1e'),_0x310411,_0x3978e2[_0x9283('0x23')][_0x9283('0x25')]);return _0x4cf9ec(_0x3978e2[_0x9283('0x23')][_0x9283('0x25')]);}else{logger[_0x9283('0x1d')](_0x9283('0x1e'),_0x310411,'request\x20sent');_0x4cf9ec(_0x3978e2[_0x9283('0x26')][_0x9283('0x25')]);}})['catch'](function(_0x4dfbf1){logger[_0x9283('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x310411,_0x4dfbf1);_0x329be6(_0x4dfbf1);});});}function respondWithStatusCode(_0xe1cb41,_0x4698a1){_0x4698a1=_0x4698a1||0xcc;return function(_0x3c676c){if(_0x3c676c){return _0xe1cb41[_0x9283('0x27')](_0x4698a1);}return _0xe1cb41[_0x9283('0x28')](_0x4698a1)[_0x9283('0x29')]();};}function respondWithResult(_0x568526,_0x292286){_0x292286=_0x292286||0xc8;return function(_0x2eb16c){if(_0x2eb16c){return _0x568526[_0x9283('0x28')](_0x292286)['json'](_0x2eb16c);}};}function respondWithFilteredResult(_0x5315c0,_0x33ce47){return function(_0x3d6120){if(_0x3d6120){var _0x8bff70=_0x3d6120['count'],_0x48123f=_0x33ce47['offset'],_0x298b22=_0x33ce47[_0x9283('0x2a')]+_0x33ce47[_0x9283('0x2b')],_0x15fb87;if(_0x298b22>=_0x8bff70){_0x298b22=_0x8bff70;_0x15fb87=0xc8;}else{_0x15fb87=0xce;}_0x5315c0[_0x9283('0x28')](_0x15fb87);return _0x5315c0[_0x9283('0x2c')](_0x9283('0x2d'),_0x48123f+'-'+_0x298b22+'/'+_0x8bff70)[_0x9283('0x2e')](_0x3d6120);}return null;};}function patchUpdates(_0x1ea86b){return function(_0x39efac){try{jsonpatch['apply'](_0x39efac,_0x1ea86b,!![]);}catch(_0x4c98b1){return BPromise['reject'](_0x4c98b1);}return _0x39efac[_0x9283('0x2f')]();};}function saveUpdates(_0x5f3645,_0x3badf9){return function(_0x2afe53){if(_0x2afe53){return _0x2afe53[_0x9283('0x30')](_0x5f3645)['then'](function(_0x5e27d5){return _0x5e27d5;});}return null;};}function removeEntity(_0x2c0814,_0x55285c){return function(_0x35ec61){if(_0x35ec61){return _0x35ec61['destroy']()['then'](function(){var _0x502d3d=_0x35ec61['get']({'plain':!![]});var _0x306149=_0x9283('0x31');return db[_0x9283('0x32')][_0x9283('0x33')]({'where':{'type':_0x306149,'resourceId':_0x502d3d['id']}})[_0x9283('0x1c')](function(){return _0x35ec61;});})['then'](function(){_0x2c0814[_0x9283('0x28')](0xcc)[_0x9283('0x29')]();});}};}function handleEntityNotFound(_0x41699f,_0x1a088a){return function(_0x48285f){if(!_0x48285f){_0x41699f[_0x9283('0x27')](0x194);}return _0x48285f;};}function handleError(_0x2f8d3c,_0x240594){_0x240594=_0x240594||0x1f4;return function(_0x10774d){logger[_0x9283('0x23')](_0x10774d[_0x9283('0x34')]);if(_0x10774d[_0x9283('0x35')]){delete _0x10774d[_0x9283('0x35')];}_0x2f8d3c[_0x9283('0x28')](_0x240594)['send'](_0x10774d);};}exports[_0x9283('0x36')]=function(_0x52e057,_0x22771b){var _0x4b7f2e={'include':[{'model':db[_0x9283('0x37')],'as':_0x9283('0x38')}]},_0x34a517={},_0x53fccb={'count':0x0,'rows':[]};var _0xcd170e=db[_0x9283('0x39')][_0x9283('0x3a')];_0x34a517[_0x9283('0x3b')]=_['keys'](_0xcd170e);_0x34a517[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x52e057[_0x9283('0x3c')]);_0x34a517[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x34a517[_0x9283('0x3b')],_0x34a517[_0x9283('0x3c')]);_0x4b7f2e['attributes']=_[_0x9283('0x3f')](_0x34a517['model'],qs[_0x9283('0x40')](_0x52e057[_0x9283('0x3c')][_0x9283('0x40')]));_0x4b7f2e[_0x9283('0x41')]=_0x4b7f2e[_0x9283('0x41')][_0x9283('0x42')]?_0x4b7f2e[_0x9283('0x41')]:_0x34a517[_0x9283('0x3b')];if(!_0x52e057[_0x9283('0x3c')]['hasOwnProperty'](_0x9283('0x43'))){_0x4b7f2e[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x52e057[_0x9283('0x3c')][_0x9283('0x2b')]);_0x4b7f2e[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x52e057[_0x9283('0x3c')]['offset']);}_0x4b7f2e['order']=qs['sort'](_0x52e057[_0x9283('0x3c')][_0x9283('0x44')]);_0x4b7f2e['where']=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x52e057[_0x9283('0x3c')],_0x34a517[_0x9283('0x3e')]));if(_0x52e057[_0x9283('0x3c')][_0x9283('0x46')]){_0x4b7f2e[_0x9283('0x47')]=_[_0x9283('0x48')](_0x4b7f2e['where'],{'$or':_['map'](_0xcd170e,function(_0x10625d){if(_0x10625d[_0x9283('0x49')]['key']!==_0x9283('0x4a')){var _0xa01367={};_0xa01367[_0x10625d[_0x9283('0x4b')]]={'$like':'%'+_0x52e057[_0x9283('0x3c')][_0x9283('0x46')]+'%'};return _0xa01367;}})});}_0x4b7f2e=_[_0x9283('0x48')]({},_0x4b7f2e,_0x52e057[_0x9283('0x4c')]);var _0x757b22={'where':_0x4b7f2e[_0x9283('0x47')]};return db[_0x9283('0x39')][_0x9283('0x4d')](_0x757b22)['then'](function(_0x55598d){_0x53fccb['count']=_0x55598d;if(_0x52e057[_0x9283('0x3c')][_0x9283('0x4e')]){_0x4b7f2e[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0x39')][_0x9283('0x50')](_0x4b7f2e);})[_0x9283('0x1c')](function(_0x5c4a4a){_0x53fccb[_0x9283('0x51')]=_0x5c4a4a;return _0x53fccb;})[_0x9283('0x1c')](respondWithFilteredResult(_0x22771b,_0x4b7f2e))[_0x9283('0x52')](handleError(_0x22771b,null));};exports['show']=function(_0x1650c9,_0x1d5923){var _0x2a25ef={'raw':![],'where':{'id':_0x1650c9[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x37')],'as':_0x9283('0x38')}]},_0x9c2185={};_0x9c2185[_0x9283('0x3b')]=_[_0x9283('0x3d')](db['ChatWebsite']['rawAttributes']);_0x9c2185[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x1650c9[_0x9283('0x3c')]);_0x9c2185['filters']=_[_0x9283('0x3f')](_0x9c2185[_0x9283('0x3b')],_0x9c2185[_0x9283('0x3c')]);_0x2a25ef[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x9c2185[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x1650c9[_0x9283('0x3c')]['fields']));_0x2a25ef[_0x9283('0x41')]=_0x2a25ef[_0x9283('0x41')][_0x9283('0x42')]?_0x2a25ef['attributes']:_0x9c2185['model'];if(_0x1650c9[_0x9283('0x3c')]['includeAll']){_0x2a25ef['include']=[{'all':!![]}];}_0x2a25ef=_['merge']({},_0x2a25ef,_0x1650c9[_0x9283('0x4c')]);return db['ChatWebsite'][_0x9283('0x54')](_0x2a25ef)['then'](handleEntityNotFound(_0x1d5923,null))[_0x9283('0x1c')](respondWithResult(_0x1d5923,null))[_0x9283('0x52')](handleError(_0x1d5923,null));};exports[_0x9283('0x55')]=function(_0x3b3b8e,_0x139e4e){return db[_0x9283('0x39')][_0x9283('0x55')](_0x3b3b8e[_0x9283('0x56')],{})[_0x9283('0x1c')](function(_0x848a39){var _0x48c023=_0x3b3b8e[_0x9283('0x57')][_0x9283('0x58')]({'plain':!![]});if(!_0x48c023)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48c023['role']===_0x9283('0x57')){var _0x8c2324=_0x848a39[_0x9283('0x58')]({'plain':!![]});var _0x20aec3='ChatWebsites';return db[_0x9283('0x59')]['find']({'where':{'name':_0x20aec3,'userProfileId':_0x48c023[_0x9283('0x5a')]},'raw':!![]})[_0x9283('0x1c')](function(_0x264edd){if(_0x264edd&&_0x264edd[_0x9283('0x5b')]===0x0){return db[_0x9283('0x32')][_0x9283('0x55')]({'name':_0x8c2324[_0x9283('0x35')],'resourceId':_0x8c2324['id'],'type':_0x264edd[_0x9283('0x35')],'sectionId':_0x264edd['id']},{})[_0x9283('0x1c')](function(){return _0x848a39;});}else{return _0x848a39;}})[_0x9283('0x52')](function(_0x5214fa){logger[_0x9283('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5214fa);throw _0x5214fa;});}return _0x848a39;})[_0x9283('0x1c')](respondWithResult(_0x139e4e,0xc9))[_0x9283('0x52')](handleError(_0x139e4e,null));};exports[_0x9283('0x30')]=function(_0x30f3c4,_0x4aff67){if(_0x30f3c4['body']['id']){delete _0x30f3c4['body']['id'];}return db[_0x9283('0x39')]['find']({'where':{'id':_0x30f3c4[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x37')],'as':_0x9283('0x38')}]})[_0x9283('0x1c')](handleEntityNotFound(_0x4aff67,null))[_0x9283('0x1c')](saveUpdates(_0x30f3c4[_0x9283('0x56')],null))[_0x9283('0x1c')](respondWithResult(_0x4aff67,null))[_0x9283('0x52')](handleError(_0x4aff67,null));};exports[_0x9283('0x33')]=function(_0x5cf52e,_0x52ac23){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x5cf52e['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x52ac23,null))['then'](removeEntity(_0x52ac23,null))['catch'](handleError(_0x52ac23,null));};exports['describe']=function(_0x28aa9d,_0x43b148){return db['ChatWebsite'][_0x9283('0x5c')]()[_0x9283('0x1c')](respondWithResult(_0x43b148,null))[_0x9283('0x52')](handleError(_0x43b148,null));};exports[_0x9283('0x5d')]=function(_0x49a199,_0x244642,_0x788452){if(_0x49a199[_0x9283('0x56')]['id']){delete _0x49a199[_0x9283('0x56')]['id'];}return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x49a199[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x244642,null))[_0x9283('0x1c')](function(_0xb6397b){if(_0xb6397b){_0x49a199[_0x9283('0x56')]['ChatWebsiteId']=_0xb6397b['id'];return db['Disposition']['create'](_0x49a199[_0x9283('0x56')]);}})[_0x9283('0x1c')](respondWithResult(_0x244642,null))[_0x9283('0x52')](handleError(_0x244642,null));};exports[_0x9283('0x5e')]=function(_0x512a68,_0x7f146b,_0x2efb57){var _0x2e4467={'raw':![],'where':{}};var _0x1cfbb0={};var _0x2b8d3c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9283('0x5f')]({'where':{'id':_0x512a68['params']['id']}})['then'](handleEntityNotFound(_0x7f146b,null))['then'](function(_0x4b1bb7){if(_0x4b1bb7){_0x1cfbb0['model']=_[_0x9283('0x3d')](db[_0x9283('0x60')][_0x9283('0x3a')]);_0x1cfbb0['query']=_[_0x9283('0x3d')](_0x512a68[_0x9283('0x3c')]);_0x1cfbb0[_0x9283('0x3e')]=_['intersection'](_0x1cfbb0[_0x9283('0x3b')],_0x1cfbb0[_0x9283('0x3c')]);_0x2e4467[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x1cfbb0[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x512a68[_0x9283('0x3c')]['fields']));_0x2e4467['attributes']=_0x2e4467['attributes'][_0x9283('0x42')]?_0x2e4467[_0x9283('0x41')]:_0x1cfbb0[_0x9283('0x3b')];if(!_0x512a68[_0x9283('0x3c')][_0x9283('0x61')](_0x9283('0x43'))){_0x2e4467[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x512a68['query'][_0x9283('0x2b')]);_0x2e4467[_0x9283('0x2a')]=qs['offset'](_0x512a68[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x2e4467[_0x9283('0x62')]=qs['sort'](_0x512a68[_0x9283('0x3c')]['sort']);_0x2e4467[_0x9283('0x47')]=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x512a68[_0x9283('0x3c')],_0x1cfbb0[_0x9283('0x3e')]));_0x2e4467[_0x9283('0x47')][_0x9283('0x63')]=_0x4b1bb7['id'];if(_0x512a68['query'][_0x9283('0x46')]){_0x2e4467['where']=_[_0x9283('0x48')](_0x2e4467['where'],{'$or':_['map'](_0x2e4467[_0x9283('0x41')],function(_0x2a9b4c){var _0x48983b={};_0x48983b[_0x2a9b4c]={'$like':'%'+_0x512a68['query']['filter']+'%'};return _0x48983b;})});}_0x2e4467=_[_0x9283('0x48')]({},_0x2e4467,_0x512a68[_0x9283('0x4c')]);return db['Disposition'][_0x9283('0x4d')]({'where':_0x2e4467[_0x9283('0x47')]})[_0x9283('0x1c')](function(_0x4dc722){_0x2b8d3c['count']=_0x4dc722;if(_0x512a68[_0x9283('0x3c')][_0x9283('0x4e')]){_0x2e4467[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0x60')]['findAll'](_0x2e4467);})['then'](function(_0x41aa64){_0x2b8d3c[_0x9283('0x51')]=_0x41aa64;return _0x2b8d3c;});}})[_0x9283('0x1c')](respondWithFilteredResult(_0x7f146b,_0x2e4467))[_0x9283('0x52')](handleError(_0x7f146b,null));};exports[_0x9283('0x64')]=function(_0x1ddab0,_0xa265f4,_0x205a47){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x1ddab0['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0xa265f4,null))[_0x9283('0x1c')](function(_0x4c917e){if(_0x4c917e){return _0x4c917e[_0x9283('0x64')](_0x1ddab0['query'][_0x9283('0x65')]);}})[_0x9283('0x1c')](respondWithStatusCode(_0xa265f4,null))['catch'](handleError(_0xa265f4,null));};exports[_0x9283('0x66')]=function(_0x179fb9,_0x42a466,_0x48e985){if(_0x179fb9[_0x9283('0x56')]['id']){delete _0x179fb9[_0x9283('0x56')]['id'];}return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x179fb9[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x42a466,null))[_0x9283('0x1c')](function(_0x4b9aa3){if(_0x4b9aa3){_0x179fb9[_0x9283('0x56')]['ChatWebsiteId']=_0x4b9aa3['id'];return db[_0x9283('0x67')][_0x9283('0x55')](_0x179fb9[_0x9283('0x56')]);}})[_0x9283('0x1c')](respondWithResult(_0x42a466,null))[_0x9283('0x52')](handleError(_0x42a466,null));};exports[_0x9283('0x68')]=function(_0x49502c,_0x26eb57,_0x2733ec){var _0x4efefc={'raw':![],'where':{}};var _0x30725d={};var _0x113588={'count':0x0,'rows':[]};return db[_0x9283('0x39')]['findOne']({'where':{'id':_0x49502c[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x26eb57,null))[_0x9283('0x1c')](function(_0x145a2d){if(_0x145a2d){_0x30725d['model']=_[_0x9283('0x3d')](db[_0x9283('0x67')][_0x9283('0x3a')]);_0x30725d[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x49502c[_0x9283('0x3c')]);_0x30725d[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x30725d[_0x9283('0x3b')],_0x30725d[_0x9283('0x3c')]);_0x4efefc[_0x9283('0x41')]=_['intersection'](_0x30725d[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x49502c['query'][_0x9283('0x40')]));_0x4efefc[_0x9283('0x41')]=_0x4efefc['attributes']['length']?_0x4efefc[_0x9283('0x41')]:_0x30725d[_0x9283('0x3b')];if(!_0x49502c['query'][_0x9283('0x61')]('nolimit')){_0x4efefc[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x49502c['query']['limit']);_0x4efefc[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x49502c[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x4efefc[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x49502c[_0x9283('0x3c')][_0x9283('0x44')]);_0x4efefc[_0x9283('0x47')]=qs['filters'](_['pick'](_0x49502c[_0x9283('0x3c')],_0x30725d[_0x9283('0x3e')]));_0x4efefc['where'][_0x9283('0x63')]=_0x145a2d['id'];if(_0x49502c[_0x9283('0x3c')][_0x9283('0x46')]){_0x4efefc[_0x9283('0x47')]=_[_0x9283('0x48')](_0x4efefc['where'],{'$or':_[_0x9283('0x69')](_0x4efefc[_0x9283('0x41')],function(_0x31275d){var _0x511f31={};_0x511f31[_0x31275d]={'$like':'%'+_0x49502c[_0x9283('0x3c')][_0x9283('0x46')]+'%'};return _0x511f31;})});}_0x4efefc=_[_0x9283('0x48')]({},_0x4efefc,_0x49502c['options']);return db['CannedAnswer']['count']({'where':_0x4efefc['where']})['then'](function(_0xdd9002){_0x113588[_0x9283('0x4d')]=_0xdd9002;if(_0x49502c[_0x9283('0x3c')][_0x9283('0x4e')]){_0x4efefc[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0x67')][_0x9283('0x50')](_0x4efefc);})['then'](function(_0x339d94){_0x113588[_0x9283('0x51')]=_0x339d94;return _0x113588;});}})[_0x9283('0x1c')](respondWithFilteredResult(_0x26eb57,_0x4efefc))[_0x9283('0x52')](handleError(_0x26eb57,null));};exports[_0x9283('0x6a')]=function(_0x4228e1,_0x27b4b4,_0x1d826e){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x4228e1[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x27b4b4,null))[_0x9283('0x1c')](function(_0x1fe86b){if(_0x1fe86b){return _0x1fe86b[_0x9283('0x6a')](_0x4228e1[_0x9283('0x3c')][_0x9283('0x65')]);}})[_0x9283('0x1c')](respondWithStatusCode(_0x27b4b4,null))['catch'](handleError(_0x27b4b4,null));};exports['addLogo']=function(_0x42213f,_0x2f1426,_0x2f29f6){_0x42213f['body'][_0x9283('0x6b')]=_0x42213f[_0x9283('0x6c')][_0x9283('0x6d')];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x42213f[_0x9283('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f1426,null))[_0x9283('0x1c')](saveUpdates(_0x42213f['body'],null))['then'](respondWithResult(_0x2f1426,null))[_0x9283('0x52')](handleError(_0x2f1426,null));};exports['addAvatar']=function(_0x1b976c,_0x48d86f,_0x5158d0){_0x1b976c[_0x9283('0x56')][_0x9283('0x6e')]=_0x1b976c[_0x9283('0x6c')][_0x9283('0x6d')];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x1b976c['params']['id']}})['then'](handleEntityNotFound(_0x48d86f,null))[_0x9283('0x1c')](saveUpdates(_0x1b976c['body'],null))[_0x9283('0x1c')](respondWithResult(_0x48d86f,null))[_0x9283('0x52')](handleError(_0x48d86f,null));};exports[_0x9283('0x6f')]=function(_0x3641ff,_0x17d19c,_0x4c6c2b){_0x3641ff[_0x9283('0x56')][_0x9283('0x70')]=_0x3641ff[_0x9283('0x6c')][_0x9283('0x6d')];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x3641ff[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x17d19c,null))[_0x9283('0x1c')](saveUpdates(_0x3641ff[_0x9283('0x56')],null))[_0x9283('0x1c')](respondWithResult(_0x17d19c,null))[_0x9283('0x52')](handleError(_0x17d19c,null));};exports['addSystemAvatar']=function(_0x3f4d15,_0xf327e6,_0x121e98){_0x3f4d15[_0x9283('0x56')]['systemAvatar']=_0x3f4d15[_0x9283('0x6c')]['filename'];return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x3f4d15[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0xf327e6,null))[_0x9283('0x1c')](saveUpdates(_0x3f4d15['body'],null))[_0x9283('0x1c')](respondWithResult(_0xf327e6,null))[_0x9283('0x52')](handleError(_0xf327e6,null));};exports[_0x9283('0x71')]=function(_0xb6df7e,_0x185baa,_0x254605){var _0x5a3a7d=path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x74'));var _0x1c9a50={'where':{'id':_0xb6df7e[_0x9283('0x53')]['id']},'attributes':['id',_0x9283('0x6b')],'raw':!![]};var _0x37bcb9=![];return require(_0x9283('0x75'))[_0x9283('0x76')]()[_0x9283('0x1c')](function(_0x3fcc3b){if(_0x3fcc3b){_0x37bcb9=_0x3fcc3b[_0x9283('0x77')];}})['then'](function(){return db['ChatWebsite'][_0x9283('0x54')](_0x1c9a50);})[_0x9283('0x1c')](handleEntityNotFound(_0x185baa,null))[_0x9283('0x1c')](function(_0x1dc29b){if(_0x1dc29b){if(!_[_0x9283('0x78')](_0x1dc29b['sitepic'])){if(fs[_0x9283('0x79')](path[_0x9283('0x72')](config['root'],_0x9283('0x7a'),_0x1dc29b['sitepic']))&&_0x37bcb9){_0x5a3a7d=path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7a'),_0x1dc29b[_0x9283('0x6b')]);}}return _0x185baa[_0x9283('0x7b')](_0x5a3a7d);}})[_0x9283('0x52')](handleError(_0x185baa,null));};exports[_0x9283('0x7c')]=function(_0x18ae94,_0x962ba7,_0x319365){var _0xc2b304=path[_0x9283('0x72')](config[_0x9283('0x73')],'server/files/images/avatars/default_avatar.png');var _0x1b0867={'where':{'id':_0x18ae94[_0x9283('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x9283('0x39')]['find'](_0x1b0867)[_0x9283('0x1c')](handleEntityNotFound(_0x962ba7,null))[_0x9283('0x1c')](function(_0x139e7f){if(_0x139e7f){if(!_[_0x9283('0x78')](_0x139e7f[_0x9283('0x6e')])){if(fs['existsSync'](path[_0x9283('0x72')](config['root'],_0x9283('0x7d'),_0x139e7f[_0x9283('0x6e')]))){_0xc2b304=path['join'](config[_0x9283('0x73')],_0x9283('0x7d'),_0x139e7f[_0x9283('0x6e')]);}}return _0x962ba7[_0x9283('0x7b')](_0xc2b304);}})[_0x9283('0x52')](handleError(_0x962ba7,null));};exports[_0x9283('0x7e')]=function(_0x5d2e10,_0xd39903,_0x5229bc){var _0x20ee9e=path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7f'));var _0x1eea63={'where':{'id':_0x5d2e10[_0x9283('0x53')]['id']},'attributes':['id',_0x9283('0x70'),_0x9283('0x80')],'raw':!![]};return db['ChatWebsite'][_0x9283('0x54')](_0x1eea63)[_0x9283('0x1c')](handleEntityNotFound(_0xd39903,null))[_0x9283('0x1c')](function(_0x150289){if(_0x150289){if(!_[_0x9283('0x78')](_0x150289[_0x9283('0x70')])){if(fs[_0x9283('0x79')](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7d'),_0x150289[_0x9283('0x70')]))&&_0x150289[_0x9283('0x80')]){_0x20ee9e=path['join'](config[_0x9283('0x73')],'server/files/images/avatars/',_0x150289[_0x9283('0x70')]);}}return _0xd39903['download'](_0x20ee9e);}})['catch'](handleError(_0xd39903,null));};exports[_0x9283('0x81')]=function(_0x261bbd,_0x4ae0d1,_0x50a77f){var _0x34bbea=path['join'](config[_0x9283('0x73')],'server/files/images/avatars/system_avatar.png');var _0x54152f={'where':{'id':_0x261bbd['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x9283('0x39')]['find'](_0x54152f)['then'](handleEntityNotFound(_0x4ae0d1,null))['then'](function(_0x23196a){if(_0x23196a){if(!_[_0x9283('0x78')](_0x23196a[_0x9283('0x82')])){if(fs['existsSync'](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0x7d'),_0x23196a[_0x9283('0x82')]))){_0x34bbea=path[_0x9283('0x72')](config['root'],_0x9283('0x7d'),_0x23196a[_0x9283('0x82')]);}}return _0x4ae0d1['download'](_0x34bbea);}})[_0x9283('0x52')](handleError(_0x4ae0d1,null));};exports[_0x9283('0x83')]=function(_0x278150,_0x100570,_0x34a36c){var _0x4f4c0d=require('user-agent-parser');var _0x4956de=new _0x4f4c0d();var _0x130f91=_0x4956de[_0x9283('0x84')](_0x278150[_0x9283('0x85')][_0x9283('0x86')])[_0x9283('0x87')]();var _0x17c117={'body':_0x278150[_0x9283('0x56')],'channel':'chat'};var _0x5991c4=[];var _0x2e11d2=[];var _0x1b0dda={};var _0x34400b=![];return db['CmContact']['describe']()[_0x9283('0x1c')](function(_0x36e630){if(!_0x36e630){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x8a'));}_0x5991c4=_[_0x9283('0x8b')](_[_0x9283('0x3d')](_0x36e630),['createdAt',_0x9283('0x8c')]);_0x2e11d2=_[_0x9283('0x8b')](_[_0x9283('0x3d')](_0x36e630),[_0x9283('0x8d'),'updatedAt','CompanyId',_0x9283('0x8e')]);if(_0x278150[_0x9283('0x56')]['id']){delete _0x278150[_0x9283('0x56')]['id'];}if(_['isNil'](_0x278150[_0x9283('0x56')]['from'])){throw new db['Sequelize'][(_0x9283('0x89'))]('from\x20is\x20mandatory');}if(_[_0x9283('0x78')](_0x278150['body']['body'])||_0x278150[_0x9283('0x56')][_0x9283('0x56')]===''){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x8f'));}if(_[_0x9283('0x78')](_0x278150[_0x9283('0x56')]['mapKey'])){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x90')+_0x2e11d2);}if(!_[_0x9283('0x91')](_0x2e11d2,_0x278150[_0x9283('0x56')]['mapKey'])){throw new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0x92')+_0x2e11d2);}_0x1b0dda[_0x278150[_0x9283('0x56')]['mapKey']]=_0x278150['body'][_0x9283('0x93')];})[_0x9283('0x1c')](function(){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x278150[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x94')],'as':_0x9283('0x95'),'include':[{'model':db['CmContact'],'as':_0x9283('0x96'),'where':_0x1b0dda,'limit':0x1,'order':[[_0x9283('0x8c'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x9283('0x97')}]});})[_0x9283('0x1c')](handleEntityNotFound(_0x100570,null))[_0x9283('0x1c')](function(_0x511942){if(_0x511942&&_0x511942['List']){_0x17c117['account']=_0x511942;_0x17c117['applications']=_0x511942['Applications'];_0x17c117[_0x9283('0x98')]=_0x511942[_0x9283('0x95')];_0x17c117[_0x9283('0x99')]=_[_0x9283('0x9a')](_0x17c117[_0x9283('0x99')],[_0x9283('0x9b')],[_0x9283('0x9c')]);if(_0x17c117[_0x9283('0x9d')]['Applications']){delete _0x17c117['account']['Applications'];}if(_0x17c117[_0x9283('0x9d')][_0x9283('0x95')]&&_0x17c117[_0x9283('0x9d')][_0x9283('0x95')]['Contacts'][_0x9283('0x42')]){return _0x17c117['account']['List']['Contacts'][0x0];}var _0x279a16=_[_0x9283('0x9e')](_0x278150[_0x9283('0x56')],{'firstName':_0x278150['body']['from'],'ListId':_0x511942[_0x9283('0x8e')]});_0x279a16[_0x278150['body'][_0x9283('0x9f')]]=_0x278150[_0x9283('0x56')][_0x9283('0x93')];return db[_0x9283('0xa0')][_0x9283('0x55')](_0x279a16,{'fields':_0x5991c4,'raw':!![]});}})['then'](handleEntityNotFound(_0x100570,null))[_0x9283('0x1c')](function(_0xd9829e){_0x17c117[_0x9283('0xa1')]=_0xd9829e;var _0x4a8c86=_0x278150[_0x9283('0x56')][_0x9283('0xa2')];if(_0x278150['headers'][_0x9283('0xa3')]){_0x4a8c86=_0x278150[_0x9283('0x85')][_0x9283('0xa3')];}else if(_0x278150['headers']['x-forwarded-for']){_0x4a8c86=_[_0x9283('0xa4')](_0x278150[_0x9283('0x85')][_0x9283('0xa5')][_0x9283('0xa6')](','));}if(_0xd9829e){var _0x5e05e9={'ContactId':_0xd9829e['id'],'ChatWebsiteId':_0x278150[_0x9283('0x53')]['id'],'from':(_0xd9829e[_0x9283('0xa7')]||'')+'\x20'+(_0xd9829e[_0x9283('0xa8')]||''),'customerIp':_0x4a8c86,'customerPort':_0x278150[_0x9283('0x85')]['x-real-port']?_0x278150[_0x9283('0x85')][_0x9283('0xa9')]:null,'referer':_0x278150[_0x9283('0x56')][_0x9283('0xaa')],'browserName':_0x130f91[_0x9283('0xab')][_0x9283('0x35')]&&_0x130f91['browser'][_0x9283('0xac')]?util[_0x9283('0xad')](_0x9283('0xae'),_0x130f91[_0x9283('0xab')][_0x9283('0x35')],_0x130f91[_0x9283('0xab')][_0x9283('0xac')]):_0x9283('0xaf'),'browserVersion':_0x130f91[_0x9283('0xab')]['version']||_0x9283('0xaf'),'osName':util[_0x9283('0xad')](_0x9283('0xae'),_0x130f91['os']['name'],_0x130f91['os'][_0x9283('0xac')]),'osVersion':_0x130f91['os'][_0x9283('0xac')],'deviceModel':_0x130f91['device'][_0x9283('0x3b')]&&_0x130f91['device'][_0x9283('0xb0')]?util[_0x9283('0xad')](_0x9283('0xb1'),_0x130f91[_0x9283('0xb2')][_0x9283('0x3b')],_0x130f91['device'][_0x9283('0xb0')],_0x130f91[_0x9283('0xb2')]['type']):null,'deviceVendor':_0x130f91['device'][_0x9283('0xb0')],'deviceType':_0x130f91[_0x9283('0xb2')][_0x9283('0x49')],'formData':JSON['stringify'](_0x278150[_0x9283('0x56')])};var _0x2015db={'ChatWebsiteId':_0x278150['params']['id'],'closed':![]};if(_0x278150[_0x9283('0x56')][_0x9283('0xb3')]){_0x2015db[_0x9283('0xb3')]=_0x278150['body'][_0x9283('0xb3')];return db['ChatInteraction']['find']({'where':_0x2015db})[_0x9283('0x1c')](function(_0x24f9cb){if(_0x24f9cb){return[_0x24f9cb,![]];}_0x5e05e9[_0x9283('0xb3')]=_0x278150[_0x9283('0x56')]['threadId'];_0x5e05e9[_0x9283('0xb4')]=_0x278150['body'][_0x9283('0xb4')];return db[_0x9283('0xb5')][_0x9283('0x55')](_0x5e05e9)[_0x9283('0x1c')](function(_0x2dffb8){return[_0x2dffb8,!![]];});});}_0x2015db[_0x9283('0xb6')]=_0xd9829e['id'];if(_0x278150['body'][_0x9283('0xb7')]&&_0x278150['body'][_0x9283('0xb7')]['id']){_0x2015db['id']=_0x278150['body'][_0x9283('0xb7')]['id'];return db[_0x9283('0xb5')]['find']({'where':_0x2015db})['then'](function(_0x27df41){if(_0x27df41){return[_0x27df41,![]];}return db['ChatInteraction'][_0x9283('0x55')](_0x5e05e9)[_0x9283('0x1c')](function(_0x5bb796){return[_0x5bb796,!![]];});});}return db[_0x9283('0xb5')][_0x9283('0x55')](_0x5e05e9)[_0x9283('0x1c')](function(_0x5e45f3){return[_0x5e45f3,!![]];});}})['spread'](function(_0x1988d7,_0x2fa81c){if(_0x1988d7){_0x34400b=_0x2fa81c;if(!_0x2fa81c){var _0x17eb29={'from':(_0x17c117[_0x9283('0xa1')][_0x9283('0xa7')]||'')+'\x20'+(_0x17c117['contact'][_0x9283('0xa8')]||'')};if(_0x278150[_0x9283('0x56')][_0x9283('0xb3')]&&_0x278150[_0x9283('0x56')][_0x9283('0xb8')]&&_0x278150[_0x9283('0x56')][_0x9283('0xb3')]!=_0x278150[_0x9283('0x56')]['messageId']){_0x17eb29['threadId']=_0x278150[_0x9283('0x56')][_0x9283('0xb8')];}return _0x1988d7[_0x9283('0x30')](_0x17eb29);}else{return _0x1988d7;}}})[_0x9283('0x1c')](function(_0x3ab0f6){_0x17c117[_0x9283('0xb7')]=_0x3ab0f6[_0x9283('0x58')]({'plain':!![]});_0x17c117[_0x9283('0xb7')][_0x9283('0xb9')]=_0x34400b;if(_0x17c117['interaction']['created']){if(_0x17c117['account'][_0x9283('0xba')]){_0x17c117[_0x9283('0x99')][_0x9283('0xbb')]({'id':0x0,'priority':_0x17c117[_0x9283('0x99')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x9283('0xbc')});}}return db['ChatMessage']['create']({'body':_0x278150[_0x9283('0x56')][_0x9283('0x56')],'ChatWebsiteId':_0x278150['params']['id'],'ChatInteractionId':_0x3ab0f6['id'],'direction':'in','ContactId':_0x17c117['contact']['id'],'AttachmentId':_0x278150[_0x9283('0x56')][_0x9283('0xbd')]});})[_0x9283('0x1c')](function(_0x410731){_0x17c117['message']=_0x410731;if(_0x17c117[_0x9283('0xb7')]['UserId']){return db[_0x9283('0xbe')]['find']({'attributes':['id','name'],'where':{'id':_0x17c117[_0x9283('0xb7')][_0x9283('0xbf')]}})['then'](function(_0x588078){if(_0x588078){_0x17c117[_0x9283('0x99')][_0x9283('0xc0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x588078[_0x9283('0x35')]+','+(_0x17c117[_0x9283('0x9d')]['waitForTheAssignedAgent']||0xa),'interval':_0x9283('0xbc')});_0x17c117[_0x9283('0xc1')]=!![];}return respondWithRpcPromise(_0x9283('0xc2'),'startRouting',_0x17c117);});}return respondWithRpcPromise(_0x9283('0xc2'),_0x9283('0xc3'),_0x17c117);})[_0x9283('0x1c')](function(_0xe6b913){respondWithRpcPromise('EventManager',_0x9283('0xc4'),{'event':_0x9283('0x83'),'message':_0xe6b913},client9002);return _0xe6b913;})[_0x9283('0x1c')](respondWithResult(_0x100570,null))[_0x9283('0x52')](handleError(_0x100570,null));};exports[_0x9283('0xc5')]=function(_0x4b0dd7,_0x588b14,_0x4118b5){var _0x46192c,_0x99fb3d,_0x2ecd43;var _0x5e066c=[];var _0x43351a=[];var _0x525092={};return db[_0x9283('0xa0')][_0x9283('0x5c')]()[_0x9283('0x1c')](function(_0x35a443){if(!_0x35a443){throw new db['Sequelize'][(_0x9283('0x89'))](_0x9283('0x8a'));}_0x43351a=_[_0x9283('0x8b')](_[_0x9283('0x3d')](_0x35a443),[_0x9283('0x8d'),'updatedAt']);_0x5e066c=_['difference'](_[_0x9283('0x3d')](_0x35a443),['createdAt',_0x9283('0x8c'),_0x9283('0xc6'),_0x9283('0x8e')]);if(_0x4b0dd7['body']['id']){delete _0x4b0dd7[_0x9283('0x56')]['id'];}if(_[_0x9283('0x78')](_0x4b0dd7['body'][_0x9283('0x93')])){throw _0x588b14[_0x9283('0x28')](0x1f4)[_0x9283('0xc7')](new db[(_0x9283('0x88'))][(_0x9283('0x89'))]('from\x20is\x20mandatory'));}if(_[_0x9283('0x78')](_0x4b0dd7[_0x9283('0x56')][_0x9283('0x56')])||_0x4b0dd7[_0x9283('0x56')][_0x9283('0x56')]===''){throw _0x588b14[_0x9283('0x28')](0x1f4)[_0x9283('0xc7')](new db['Sequelize'][(_0x9283('0x89'))](_0x9283('0x8f')));}if(_['isNil'](_0x4b0dd7[_0x9283('0x56')][_0x9283('0xc8')])){throw _0x588b14['status'](0x1f4)[_0x9283('0xc7')](new db['Sequelize'][(_0x9283('0x89'))](_0x9283('0xc9')+_0x5e066c));}if(!_[_0x9283('0x91')](_0x5e066c,_0x4b0dd7[_0x9283('0x56')][_0x9283('0xc8')])){throw _0x588b14['status'](0x1f4)[_0x9283('0xc7')](new db[(_0x9283('0x88'))][(_0x9283('0x89'))](_0x9283('0xca')+_0x5e066c));}_0x525092[_0x4b0dd7[_0x9283('0x56')]['mapKeyOffline']]=_0x4b0dd7['body']['from'];})[_0x9283('0x1c')](function(){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x4b0dd7[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0x94')],'as':_0x9283('0x95')}]});})[_0x9283('0x1c')](handleEntityNotFound(_0x588b14,null))[_0x9283('0x1c')](function(_0x348b6d){if(_0x348b6d&&_0x348b6d['List']){_0x99fb3d=_0x348b6d;var _0x4d07de=_[_0x9283('0x9e')](_0x4b0dd7[_0x9283('0x56')],{'firstName':_0x4b0dd7[_0x9283('0x56')][_0x9283('0x93')],'phone':_0x4b0dd7[_0x9283('0x56')][_0x9283('0x93')],'ListId':_0x348b6d[_0x9283('0x8e')]});_0x4d07de[_0x4b0dd7['body']['mapKeyOffline']]=_0x4b0dd7['body']['from'];return db[_0x9283('0xa0')]['findOrCreate']({'where':_0x525092,'defaults':_0x4d07de});}})[_0x9283('0xcb')](function(_0x449619){if(_0x449619){_0x2ecd43=_0x449619;var _0x3caa13=fs['readFileSync'](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0xcc')),'utf8');var _0x3bdae0=ejs[_0x9283('0xcd')](_0x3caa13,{'body':_[_0x9283('0xce')](_0x4b0dd7[_0x9283('0x56')][_0x9283('0x56')]),'bodyTitle':_0x99fb3d[_0x9283('0xcf')]});return db[_0x9283('0xd0')][_0x9283('0x55')]({'body':_0x3bdae0,'ContactId':_0x449619['id'],'ChatWebsiteId':_0x99fb3d['id']});}})[_0x9283('0x1c')](function(_0x276f58){if(_0x276f58){_0x46192c=_0x276f58;return db[_0x9283('0xd1')][_0x9283('0x5f')]({'where':{'service':!![]},'include':[{'model':db[_0x9283('0xd2')],'as':_0x9283('0xd3'),'raw':!![]}]});}})[_0x9283('0x1c')](function(_0x272942){if(_0x272942&&_0x272942[_0x9283('0xd3')]&&_0x99fb3d[_0x9283('0xd4')]){var _0x428315={'tls':{'rejectUnauthorized':![]}};if(_0x272942[_0x9283('0xd3')][_0x9283('0xd5')]){_0x428315['service']=_0x272942[_0x9283('0xd3')]['service'];}else{_0x428315['host']=_0x272942[_0x9283('0xd3')][_0x9283('0xd6')];_0x428315[_0x9283('0xd7')]=_0x272942[_0x9283('0xd3')][_0x9283('0xd7')];_0x428315[_0x9283('0xd8')]=_0x272942[_0x9283('0xd3')][_0x9283('0xd8')];}if(_0x272942[_0x9283('0xd3')][_0x9283('0xd9')]){_0x428315['auth']={'user':_0x272942[_0x9283('0xd3')][_0x9283('0x57')],'pass':_0x272942[_0x9283('0xd3')]['pass']};}return respondWithRpcPromise(_0x9283('0xda'),_0x9283('0xdb'),{'account':_0x428315,'message':{'from':util[_0x9283('0xad')](_0x9283('0xdc'),_0x272942['name'],_0x272942['email']||_0x272942['Smtp'][_0x9283('0x57')]),'to':_0x99fb3d[_0x9283('0xd4')],'subject':_0x99fb3d[_0x9283('0xdd')],'text':_0x46192c['body']}},client9003)[_0x9283('0x1c')](function(){return _0x46192c;})[_0x9283('0x52')](function(_0x14bcc2){console['error'](_0x14bcc2);});}})[_0x9283('0x1c')](function(){if(_0x46192c){return _0x46192c;}})[_0x9283('0x1c')](respondWithResult(_0x588b14,null))[_0x9283('0x52')](handleError(_0x588b14,null));};exports['addInteraction']=function(_0x38bb0b,_0x1a9d59,_0x3af3c3){return db[_0x9283('0xb5')][_0x9283('0x54')]({'where':{'id':_0x38bb0b[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x1a9d59,null))[_0x9283('0x1c')](function(_0xbf8713){if(_0xbf8713){return _0xbf8713['addInteraction'](_0x38bb0b[_0x9283('0x56')][_0x9283('0x65')],_['omit'](_0x38bb0b[_0x9283('0x56')],['ids','id'])||{});}})[_0x9283('0x1c')](respondWithResult(_0x1a9d59,null))['catch'](handleError(_0x1a9d59,null));};exports[_0x9283('0xde')]=function(_0x5c367a,_0x2197f4,_0x58c84a){var _0x3e997a={'raw':![],'where':{}};var _0x1f4e22={};var _0x42be9d={'count':0x0,'rows':[]};return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x5c367a[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x2197f4,null))['then'](function(_0x564870){if(_0x564870){_0x1f4e22['model']=_[_0x9283('0x3d')](db[_0x9283('0xb5')]['rawAttributes']);_0x1f4e22[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x5c367a[_0x9283('0x3c')]);_0x1f4e22[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x1f4e22['model'],_0x1f4e22[_0x9283('0x3c')]);_0x3e997a[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x1f4e22[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x5c367a[_0x9283('0x3c')][_0x9283('0x40')]));_0x3e997a[_0x9283('0x41')]=_0x3e997a[_0x9283('0x41')]['length']?_0x3e997a[_0x9283('0x41')]:_0x1f4e22[_0x9283('0x3b')];if(!_0x5c367a[_0x9283('0x3c')][_0x9283('0x61')](_0x9283('0x43'))){_0x3e997a['limit']=qs[_0x9283('0x2b')](_0x5c367a[_0x9283('0x3c')][_0x9283('0x2b')]);_0x3e997a[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x5c367a[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x3e997a[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x5c367a[_0x9283('0x3c')]['sort']);_0x3e997a[_0x9283('0x47')]=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x5c367a[_0x9283('0x3c')],_0x1f4e22[_0x9283('0x3e')]));_0x3e997a[_0x9283('0x47')][_0x9283('0x63')]=_0x564870['id'];if(_0x5c367a['query'][_0x9283('0x46')]){_0x3e997a[_0x9283('0x47')]=_['merge'](_0x3e997a['where'],{'$or':_['map'](_0x3e997a[_0x9283('0x41')],function(_0x1546c4){var _0x3f4873={};_0x3f4873[_0x1546c4]={'$like':'%'+_0x5c367a[_0x9283('0x3c')]['filter']+'%'};return _0x3f4873;})});}_0x3e997a=_[_0x9283('0x48')]({},_0x3e997a,_0x5c367a[_0x9283('0x4c')]);return db[_0x9283('0xb5')][_0x9283('0x4d')]({'where':_0x3e997a['where']})[_0x9283('0x1c')](function(_0x2b89dc){_0x42be9d['count']=_0x2b89dc;if(_0x5c367a[_0x9283('0x3c')][_0x9283('0x4e')]){_0x3e997a['include']=[{'model':db[_0x9283('0xa0')],'as':_0x9283('0xdf'),'required':![]},{'model':db[_0x9283('0xbe')],'as':_0x9283('0xe0'),'attributes':[_0x9283('0x35'),_0x9283('0xe1'),_0x9283('0xe2')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x9283('0x35'),_0x9283('0xe3')],'where':_0x5c367a[_0x9283('0x3c')][_0x9283('0xe4')]?{'id':_0x5c367a[_0x9283('0x3c')][_0x9283('0xe4')]}:undefined,'required':_0x5c367a['query'][_0x9283('0xe4')]?!![]:![]}];}return db[_0x9283('0xb5')][_0x9283('0x50')](_0x3e997a);})['then'](function(_0x48530f){_0x42be9d[_0x9283('0x51')]=_0x48530f;return _0x42be9d;});}})['then'](respondWithFilteredResult(_0x2197f4,_0x3e997a))[_0x9283('0x52')](handleError(_0x2197f4,null));};function iftimePromise(_0x2bb757,_0x25f961){return respondWithRpcPromise('Command',_0x9283('0xe5'),{'command':_0x25f961['timezone']?util[_0x9283('0xad')](_0x9283('0xe6'),_0x2bb757[_0x9283('0xe7')],_0x25f961['timezone']):util['format'](_0x9283('0xe8'),_0x2bb757[_0x9283('0xe7')])},client9002)[_0x9283('0x1c')](function(_0x462db2){var _0x720781=_0x462db2&&_0x462db2['indexOf'](_0x9283('0xe9'))>=0x0?!![]:![];logger['info'](_0x9283('0xea'),_0x25f961['id'],_0x2bb757['id'],_0x2bb757[_0x9283('0xe7')],_0x720781?_0x9283('0xeb'):_0x9283('0xec'),_0x25f961[_0x9283('0xed')]?_0x25f961[_0x9283('0xed')]:'No\x20timezone');return _0x720781;})['catch'](function(_0x4cf7d7){logger[_0x9283('0x23')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x25f961['id'],_0x2bb757['id'],_0x2bb757[_0x9283('0xe7')],util[_0x9283('0xee')](_0x4cf7d7,{'showHidden':![],'depth':null}),_0x25f961[_0x9283('0xed')]?_0x25f961[_0x9283('0xed')]:_0x9283('0xef'));return![];});}exports[_0x9283('0xe5')]=function(_0x4c931a,_0x469b9a,_0x12b5c7){var _0x4aee98=0x0;var _0x4f72e4=0x0;var _0x385c19=![];var _0x11244f;var _0x5dd440;return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x4c931a[_0x9283('0x53')]['id']},'include':[{'model':db[_0x9283('0xf0')],'as':'Interval','include':[{'model':db[_0x9283('0xf0')],'as':_0x9283('0xf1'),'attributes':['id',_0x9283('0xe7')],'raw':!![]}]}]})[_0x9283('0x1c')](handleEntityNotFound(_0x469b9a,null))[_0x9283('0x1c')](function(_0x394996){if(_0x394996){_0x11244f=_0x394996;return _0x394996[_0x9283('0xf2')]({'raw':!![]});}})[_0x9283('0x1c')](function(_0x3bd54a){if(_0x11244f){if(_0x3bd54a){_0x5dd440=_0x3bd54a;}}return require(_0x9283('0x75'))[_0x9283('0x76')]();})[_0x9283('0x1c')](function(_0x3d1e4b){if(_0x3d1e4b){_0x4f72e4=_0x3d1e4b['virtual'];_0x385c19=_0x3d1e4b[_0x9283('0x77')];}})['then'](function(){return db[_0x9283('0xb5')][_0x9283('0x4d')]({'where':{'closed':![]}});})[_0x9283('0x1c')](function(_0x4eb4ab){_0x4aee98=_0x4eb4ab;if(_0x4f72e4&&_0x4eb4ab>_0x4f72e4){return db[_0x9283('0xf3')][_0x9283('0x5f')]({'where':{'id':0x1}})['then'](function(_0x4bde4e){if(_0x4bde4e){_0x4bde4e[_0x9283('0xf4')](_0x9283('0xf5'));}});}})[_0x9283('0x1c')](function(){if(_0x11244f[_0x9283('0xf0')]&&_0x11244f['Interval'][_0x9283('0xf1')]){var _0x5736d7=[];for(var _0xabdd2a=0x0;_0xabdd2a<_0x11244f[_0x9283('0xf0')][_0x9283('0xf1')]['length'];_0xabdd2a++){var _0xa236bd=_0x11244f[_0x9283('0xf0')]['Intervals'][_0xabdd2a]['get']({'plain':!![]});_0x5736d7[_0x9283('0xbb')](iftimePromise(_0xa236bd,_0x11244f));}return BPromise['all'](_0x5736d7)[_0x9283('0x1c')](function(_0x3a8d8e){return _[_0x9283('0xf6')](_0x3a8d8e);});}else{return!![];}})[_0x9283('0x1c')](function(_0x15881d){var _0x15f005=fs['readFileSync'](path[_0x9283('0x72')](config[_0x9283('0x73')],_0x9283('0xf7')),_0x9283('0xf8'));var _0x5a82b1={'remote':_0x11244f['remote'],'query':querystring['stringify'](_[_0x9283('0x48')](_0x11244f[_0x9283('0x58')]({'plain':!![]}),{'customerIp':_0x4c931a[_0x9283('0x85')][_0x9283('0xa5')]||_0x4c931a[_0x9283('0x85')]['x-real-ip']||_0x4c931a['connection'][_0x9283('0xf9')]||_0x4c931a['ip'],'referer':_0x4c931a[_0x9283('0x85')][_0x9283('0xaa')],'openedInteractions':_0x4aee98,'maxInteractions':_0x4f72e4,'virtual':_0x385c19[_0x9283('0xfa')],'online':_0x15881d,'custom':_0x385c19}))[_0x9283('0xfb')](/'/g,'\x5c\x27')};_0x469b9a[_0x9283('0xc7')](ejs[_0x9283('0xcd')](Mustache[_0x9283('0xcd')](_0x15f005,_0x5a82b1),{'proactiveActions':_0x5dd440,'alignment':_0x11244f[_0x9283('0xfc')],'verticalAlignment':_0x11244f[_0x9283('0xfd')]}));})[_0x9283('0x52')](handleError(_0x469b9a,null));};exports[_0x9283('0xfe')]=function(_0x1ee05b,_0x3e2073,_0x43eec3){return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x1ee05b['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x3e2073,null))[_0x9283('0x1c')](function(_0x38654f){if(_0x38654f){return db[_0x9283('0xff')][_0x9283('0x100')](function(_0x1421f1){return db[_0x9283('0x101')][_0x9283('0x33')]({'where':{'ChatWebsiteId':_0x1ee05b[_0x9283('0x53')]['id']},'transaction':_0x1421f1})['then'](function(_0x419358){var _0x11c955=_['map'](_0x1ee05b[_0x9283('0x56')],function(_0x1c9db2){_0x1c9db2['ChatWebsiteId']=_0x1ee05b[_0x9283('0x53')]['id'];return _0x1c9db2;});return db[_0x9283('0x101')]['bulkCreate'](_0x11c955,{'transaction':_0x1421f1});});})[_0x9283('0x1c')](function(){return db[_0x9283('0x101')][_0x9283('0x102')]({'where':{'ChatWebsiteId':_0x1ee05b['params']['id']},'order':_0x9283('0x9b')});});}})['then'](respondWithResult(_0x3e2073,null))['catch'](handleError(_0x3e2073,null));};exports[_0x9283('0x103')]=function(_0x3e77c6,_0x39d3a5,_0xac3896){var _0x46fbb5={};var _0x27a42a={};var _0x30937f;var _0x406226;return db['ChatWebsite'][_0x9283('0x5f')]({'where':{'id':_0x3e77c6['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x39d3a5,null))['then'](function(_0x14a841){if(_0x14a841){_0x30937f=_0x14a841;_0x27a42a[_0x9283('0x3b')]=_[_0x9283('0x3d')](db[_0x9283('0x101')][_0x9283('0x3a')]);_0x27a42a[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x3e77c6[_0x9283('0x3c')]);_0x27a42a[_0x9283('0x3e')]=_['intersection'](_0x27a42a['model'],_0x27a42a[_0x9283('0x3c')]);_0x46fbb5['attributes']=_['intersection'](_0x27a42a['model'],qs[_0x9283('0x40')](_0x3e77c6['query'][_0x9283('0x40')]));_0x46fbb5[_0x9283('0x41')]=_0x46fbb5[_0x9283('0x41')][_0x9283('0x42')]?_0x46fbb5[_0x9283('0x41')]:_0x27a42a['model'];_0x46fbb5[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x3e77c6[_0x9283('0x3c')][_0x9283('0x44')]);_0x46fbb5['where']=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x3e77c6['query'],_0x27a42a['filters']));if(_0x3e77c6[_0x9283('0x3c')]['filter']){_0x46fbb5[_0x9283('0x47')]=_['merge'](_0x46fbb5[_0x9283('0x47')],{'$or':_[_0x9283('0x69')](_0x46fbb5['attributes'],function(_0x33486a){var _0x4fdc14={};_0x4fdc14[_0x33486a]={'$like':'%'+_0x3e77c6['query'][_0x9283('0x46')]+'%'};return _0x4fdc14;})});}_0x46fbb5=_[_0x9283('0x48')]({},_0x46fbb5,_0x3e77c6[_0x9283('0x4c')]);return _0x30937f[_0x9283('0x103')](_0x46fbb5);}})[_0x9283('0x1c')](function(_0x4f2055){if(_0x4f2055){_0x406226=_0x4f2055['length'];if(!_0x3e77c6['query'][_0x9283('0x61')](_0x9283('0x43'))){_0x46fbb5['limit']=qs[_0x9283('0x2b')](_0x3e77c6[_0x9283('0x3c')][_0x9283('0x2b')]);_0x46fbb5['offset']=qs[_0x9283('0x2a')](_0x3e77c6[_0x9283('0x3c')][_0x9283('0x2a')]);}return _0x30937f[_0x9283('0x103')](_0x46fbb5);}})[_0x9283('0x1c')](function(_0x42dd4e){if(_0x42dd4e){return _0x42dd4e?{'count':_0x406226,'rows':_0x42dd4e}:null;}})[_0x9283('0x1c')](respondWithResult(_0x39d3a5,null))[_0x9283('0x52')](handleError(_0x39d3a5,null));};exports['addProactiveActions']=function(_0x198e1a,_0xe6308,_0x3fa5b4){return db[_0x9283('0x104')][_0x9283('0x54')]({'where':{'id':_0x198e1a['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0xe6308,null))[_0x9283('0x1c')](function(_0x4d9f0a){if(_0x4d9f0a){return _0x4d9f0a[_0x9283('0x105')](_0x198e1a[_0x9283('0x56')][_0x9283('0x65')],_[_0x9283('0x106')](_0x198e1a[_0x9283('0x56')],[_0x9283('0x65'),'id'])||{});}})[_0x9283('0x1c')](respondWithResult(_0xe6308,null))[_0x9283('0x52')](handleError(_0xe6308,null));};exports[_0x9283('0xf2')]=function(_0x1a1055,_0x596c97,_0x57fe87){var _0x4d8cc4={};var _0x3d33ab={};var _0x3d4144;var _0x4d0932;return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x1a1055[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x596c97,null))['then'](function(_0x308f03){if(_0x308f03){_0x3d4144=_0x308f03;_0x3d33ab[_0x9283('0x3b')]=_[_0x9283('0x3d')](db['ChatProactiveAction'][_0x9283('0x3a')]);_0x3d33ab[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x1a1055['query']);_0x3d33ab[_0x9283('0x3e')]=_['intersection'](_0x3d33ab['model'],_0x3d33ab['query']);_0x4d8cc4[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x3d33ab['model'],qs[_0x9283('0x40')](_0x1a1055[_0x9283('0x3c')][_0x9283('0x40')]));_0x4d8cc4[_0x9283('0x41')]=_0x4d8cc4[_0x9283('0x41')][_0x9283('0x42')]?_0x4d8cc4[_0x9283('0x41')]:_0x3d33ab[_0x9283('0x3b')];_0x4d8cc4[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x1a1055['query'][_0x9283('0x44')]);_0x4d8cc4[_0x9283('0x47')]=qs[_0x9283('0x3e')](_[_0x9283('0x45')](_0x1a1055[_0x9283('0x3c')],_0x3d33ab[_0x9283('0x3e')]));if(_0x1a1055[_0x9283('0x3c')][_0x9283('0x46')]){_0x4d8cc4[_0x9283('0x47')]=_[_0x9283('0x48')](_0x4d8cc4[_0x9283('0x47')],{'$or':_['map'](_0x4d8cc4[_0x9283('0x41')],function(_0x2aab07){var _0x12da76={};_0x12da76[_0x2aab07]={'$like':'%'+_0x1a1055[_0x9283('0x3c')]['filter']+'%'};return _0x12da76;})});}_0x4d8cc4=_[_0x9283('0x48')]({},_0x4d8cc4,_0x1a1055[_0x9283('0x4c')]);return _0x3d4144[_0x9283('0xf2')](_0x4d8cc4);}})['then'](function(_0x4af69d){if(_0x4af69d){_0x4d0932=_0x4af69d['length'];if(!_0x1a1055[_0x9283('0x3c')][_0x9283('0x61')](_0x9283('0x43'))){_0x4d8cc4[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x1a1055[_0x9283('0x3c')]['limit']);_0x4d8cc4['offset']=qs['offset'](_0x1a1055[_0x9283('0x3c')]['offset']);}return _0x3d4144[_0x9283('0xf2')](_0x4d8cc4);}})[_0x9283('0x1c')](function(_0x33e257){if(_0x33e257){return _0x33e257?{'count':_0x4d0932,'rows':_0x33e257}:null;}})[_0x9283('0x1c')](respondWithResult(_0x596c97,null))['catch'](handleError(_0x596c97,null));};exports[_0x9283('0x107')]=function(_0x2d6fd1,_0x56b7a0,_0x145377){var _0x5eafbd=_0x2d6fd1[_0x9283('0x3c')][_0x9283('0x108')]===_0x9283('0x109')?_0x9283('0x10a'):_0x9283('0x10b');return db[_0x9283('0x39')][_0x9283('0x54')]({'attributes':['id',_0x5eafbd],'where':{'id':_0x2d6fd1['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x56b7a0,null))[_0x9283('0x1c')](function(_0x550b3a){if(_0x550b3a){var _0x3aa459=_0x550b3a[_0x5eafbd];var _0x42a5f7=_0x3aa459&&_0x3aa459[_0x9283('0x10c')]?_0x3aa459['items']:[];_0x56b7a0[_0x9283('0xc7')]({'fromKey':_[_0x9283('0x78')](_0x3aa459[_0x9283('0x10d')])?undefined:_0x3aa459['fromKey'],'count':_0x42a5f7[_0x9283('0x42')],'rows':_0x42a5f7});}})[_0x9283('0x52')](handleError(_0x56b7a0,null));};exports['getOfflineMessages']=function(_0x4d7f79,_0x543201,_0x16213c){var _0x429191={'raw':!![],'where':{}};var _0x2bfe77={};var _0x11ff3a={'count':0x0,'rows':[]};return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x4d7f79[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x543201,null))[_0x9283('0x1c')](function(_0x21a640){if(_0x21a640){_0x2bfe77[_0x9283('0x3b')]=_['keys'](db[_0x9283('0xd0')][_0x9283('0x3a')]);_0x2bfe77[_0x9283('0x3c')]=_['keys'](_0x4d7f79[_0x9283('0x3c')]);_0x2bfe77[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x2bfe77[_0x9283('0x3b')],_0x2bfe77[_0x9283('0x3c')]);_0x429191[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x2bfe77[_0x9283('0x3b')],qs[_0x9283('0x40')](_0x4d7f79[_0x9283('0x3c')][_0x9283('0x40')]));_0x429191['attributes']=_0x429191[_0x9283('0x41')][_0x9283('0x42')]?_0x429191[_0x9283('0x41')]:_0x2bfe77[_0x9283('0x3b')];if(!_0x4d7f79[_0x9283('0x3c')][_0x9283('0x61')]('nolimit')){_0x429191[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x4d7f79[_0x9283('0x3c')][_0x9283('0x2b')]);_0x429191[_0x9283('0x2a')]=qs[_0x9283('0x2a')](_0x4d7f79[_0x9283('0x3c')][_0x9283('0x2a')]);}_0x429191[_0x9283('0x62')]=qs[_0x9283('0x44')](_0x4d7f79[_0x9283('0x3c')]['sort']);_0x429191[_0x9283('0x47')]=qs[_0x9283('0x3e')](_['pick'](_0x4d7f79[_0x9283('0x3c')],_0x2bfe77[_0x9283('0x3e')]));_0x429191['where'][_0x9283('0x63')]=_0x21a640['id'];if(_0x4d7f79[_0x9283('0x3c')][_0x9283('0x46')]){_0x429191[_0x9283('0x47')]=_[_0x9283('0x48')](_0x429191['where'],{'$or':_['map'](_0x429191[_0x9283('0x41')],function(_0x22c456){var _0x4e3d7c={};_0x4e3d7c[_0x22c456]={'$like':'%'+_0x4d7f79[_0x9283('0x3c')][_0x9283('0x46')]+'%'};return _0x4e3d7c;})});}_0x429191=_[_0x9283('0x48')]({},_0x429191,_0x4d7f79[_0x9283('0x4c')]);return db[_0x9283('0xd0')][_0x9283('0x4d')]({'where':_0x429191[_0x9283('0x47')]})[_0x9283('0x1c')](function(_0x334f73){_0x11ff3a[_0x9283('0x4d')]=_0x334f73;if(_0x4d7f79[_0x9283('0x3c')][_0x9283('0x4e')]){_0x429191[_0x9283('0x4f')]=[{'all':!![]}];}return db[_0x9283('0xd0')][_0x9283('0x50')](_0x429191);})[_0x9283('0x1c')](function(_0x5610e5){_0x11ff3a[_0x9283('0x51')]=_0x5610e5;return _0x11ff3a;});}})[_0x9283('0x1c')](respondWithFilteredResult(_0x543201,_0x429191))[_0x9283('0x52')](handleError(_0x543201,null));};exports['addAgents']=function(_0x53cf77,_0x30fc85,_0x4add6a){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x53cf77['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x30fc85,null))[_0x9283('0x1c')](function(_0x2dd045){if(_0x2dd045){return _0x2dd045[_0x9283('0x10e')](_0x53cf77[_0x9283('0x56')]['ids'],_[_0x9283('0x106')](_0x53cf77[_0x9283('0x56')],['ids','id'])||{})[_0x9283('0xcb')](function(_0x55a7b0){for(var _0xccf42=0x0;_0xccf42<_0x53cf77[_0x9283('0x56')][_0x9283('0x65')][_0x9283('0x42')];_0xccf42+=0x1){socket[_0x9283('0x10f')](_0x9283('0x110'),{'UserId':_0x53cf77[_0x9283('0x56')][_0x9283('0x65')][_0xccf42],'ChatWebsiteId':_0x53cf77[_0x9283('0x53')]['id']});}return _0x55a7b0;});}})[_0x9283('0x1c')](respondWithResult(_0x30fc85,null))[_0x9283('0x52')](handleError(_0x30fc85,null));};exports['removeAgents']=function(_0x563274,_0x29a38c,_0x47cd79){return db[_0x9283('0x39')][_0x9283('0x54')]({'where':{'id':_0x563274[_0x9283('0x53')]['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x29a38c,null))['then'](function(_0x3cf1e5){if(_0x3cf1e5){return _0x3cf1e5[_0x9283('0x111')](_0x563274[_0x9283('0x3c')][_0x9283('0x65')])[_0x9283('0x1c')](function(){if(_[_0x9283('0x112')](_0x563274[_0x9283('0x3c')][_0x9283('0x65')])){for(var _0x51d64a=0x0;_0x51d64a<_0x563274[_0x9283('0x3c')][_0x9283('0x65')][_0x9283('0x42')];_0x51d64a+=0x1){socket[_0x9283('0x10f')](_0x9283('0x113'),{'UserId':Number(_0x563274[_0x9283('0x3c')][_0x9283('0x65')][_0x51d64a]),'ChatWebsiteId':Number(_0x563274[_0x9283('0x53')]['id'])});}}else{socket[_0x9283('0x10f')](_0x9283('0x113'),{'UserId':Number(_0x563274['query'][_0x9283('0x65')]),'ChatWebsiteId':Number(_0x563274['params']['id'])});}});}})['then'](respondWithStatusCode(_0x29a38c,null))[_0x9283('0x52')](handleError(_0x29a38c,null));};exports['getAgents']=function(_0x405c19,_0x5728a1,_0x5400ae){var _0x28f0d7={};var _0x4f35b4={};var _0x1cc164;var _0x25d618;return db[_0x9283('0x39')][_0x9283('0x5f')]({'where':{'id':_0x405c19['params']['id']}})[_0x9283('0x1c')](handleEntityNotFound(_0x5728a1,null))[_0x9283('0x1c')](function(_0x4f95be){if(_0x4f95be){_0x1cc164=_0x4f95be;_0x4f35b4[_0x9283('0x3b')]=_[_0x9283('0x3d')](db[_0x9283('0xbe')][_0x9283('0x3a')]);_0x4f35b4[_0x9283('0x3c')]=_[_0x9283('0x3d')](_0x405c19['query']);_0x4f35b4[_0x9283('0x3e')]=_[_0x9283('0x3f')](_0x4f35b4[_0x9283('0x3b')],_0x4f35b4[_0x9283('0x3c')]);_0x28f0d7[_0x9283('0x41')]=_[_0x9283('0x3f')](_0x4f35b4[_0x9283('0x3b')],qs['fields'](_0x405c19[_0x9283('0x3c')]['fields']));_0x28f0d7['attributes']=_0x28f0d7[_0x9283('0x41')]['length']?_0x28f0d7[_0x9283('0x41')]:_0x4f35b4[_0x9283('0x3b')];_0x28f0d7['order']=qs[_0x9283('0x44')](_0x405c19[_0x9283('0x3c')][_0x9283('0x44')]);_0x28f0d7[_0x9283('0x47')]=qs[_0x9283('0x3e')](_['pick'](_0x405c19['query'],_0x4f35b4[_0x9283('0x3e')]));if(_0x405c19['query'][_0x9283('0x46')]){_0x28f0d7[_0x9283('0x47')]=_['merge'](_0x28f0d7['where'],{'$or':_[_0x9283('0x69')](_0x28f0d7['attributes'],function(_0x13435c){var _0x594908={};_0x594908[_0x13435c]={'$like':'%'+_0x405c19['query'][_0x9283('0x46')]+'%'};return _0x594908;})});}_0x28f0d7=_[_0x9283('0x48')]({},_0x28f0d7,_0x405c19['options']);return _0x1cc164[_0x9283('0x114')](_0x28f0d7);}})[_0x9283('0x1c')](function(_0x56cc59){if(_0x56cc59){_0x25d618=_0x56cc59['length'];if(!_0x405c19['query'][_0x9283('0x61')]('nolimit')){_0x28f0d7[_0x9283('0x2b')]=qs[_0x9283('0x2b')](_0x405c19[_0x9283('0x3c')]['limit']);_0x28f0d7['offset']=qs[_0x9283('0x2a')](_0x405c19[_0x9283('0x3c')][_0x9283('0x2a')]);}return _0x1cc164[_0x9283('0x114')](_0x28f0d7);}})[_0x9283('0x1c')](function(_0x196a6d){if(_0x196a6d){return _0x196a6d?{'count':_0x25d618,'rows':_0x196a6d}:null;}})[_0x9283('0x1c')](respondWithResult(_0x5728a1,null))['catch'](handleError(_0x5728a1,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 46e49c5..a268e3d 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 _0x89c7=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x4ac41d,_0x797f24){var _0x5b9770=function(_0x164fe4){while(--_0x164fe4){_0x4ac41d['push'](_0x4ac41d['shift']());}};_0x5b9770(++_0x797f24);}(_0x89c7,0x135));var _0x789c=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0x89c7[_0x264d4d];return _0xc917e2;};'use strict';var EventEmitter=require(_0x789c('0x0'));var ChatWebsite=require(_0x789c('0x1'))['db'][_0x789c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x789c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x789c('0x4'),'afterDestroy':_0x789c('0x5')};function emitEvent(_0x49f846){return function(_0x2682e2,_0x2e085e,_0x3bcf8c){ChatWebsiteEvents[_0x789c('0x6')](_0x49f846+':'+_0x2682e2['id'],_0x2682e2);ChatWebsiteEvents['emit'](_0x49f846,_0x2682e2);_0x3bcf8c(null);};}for(var e in events){if(events[_0x789c('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x789c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x5c4e=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x974518,_0x497ecf){var _0x3221f7=function(_0x17834a){while(--_0x17834a){_0x974518['push'](_0x974518['shift']());}};_0x3221f7(++_0x497ecf);}(_0x5c4e,0xea));var _0xe5c4=function(_0x46e4e6,_0x45e2cc){_0x46e4e6=_0x46e4e6-0x0;var _0x33a6da=_0x5c4e[_0x46e4e6];return _0x33a6da;};'use strict';var EventEmitter=require(_0xe5c4('0x0'));var ChatWebsite=require(_0xe5c4('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe5c4('0x2'),'afterUpdate':_0xe5c4('0x3'),'afterDestroy':_0xe5c4('0x4')};function emitEvent(_0x36d260){return function(_0xa35382,_0x22022e,_0x2d2429){ChatWebsiteEvents[_0xe5c4('0x5')](_0x36d260+':'+_0xa35382['id'],_0xa35382);ChatWebsiteEvents[_0xe5c4('0x5')](_0x36d260,_0xa35382);_0x2d2429(null);};}for(var e in events){if(events[_0xe5c4('0x6')](e)){var event=events[e];ChatWebsite[_0xe5c4('0x7')](e,emitEvent(event));}}module[_0xe5c4('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9c5ebb6..8b38860 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 _0x6215=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatWebsite','chat_websites'];(function(_0xba3578,_0xc6c0a9){var _0x488411=function(_0x588de1){while(--_0x588de1){_0xba3578['push'](_0xba3578['shift']());}};_0x488411(++_0xc6c0a9);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5621('0x0'));var util=require(_0x5621('0x1'));var logger=require(_0x5621('0x2'))('api');var moment=require(_0x5621('0x3'));var BPromise=require(_0x5621('0x4'));var rp=require(_0x5621('0x5'));var fs=require('fs');var path=require(_0x5621('0x6'));var rimraf=require(_0x5621('0x7'));var config=require(_0x5621('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x52f3c6,_0x5ae3af){return _0x52f3c6[_0x5621('0x9')](_0x5621('0xa'),attributes,{'tableName':_0x5621('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2da=['exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x1187b2,_0x56f2bf){var _0x20c567=function(_0x5d9f8c){while(--_0x5d9f8c){_0x1187b2['push'](_0x1187b2['shift']());}};_0x20c567(++_0x56f2bf);}(_0xc2da,0x124));var _0xac2d=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xc2da[_0xb99421];return _0x4b3ec7;};'use strict';var _=require(_0xac2d('0x0'));var util=require('util');var logger=require(_0xac2d('0x1'))('api');var moment=require(_0xac2d('0x2'));var BPromise=require('bluebird');var rp=require(_0xac2d('0x3'));var fs=require('fs');var path=require(_0xac2d('0x4'));var rimraf=require(_0xac2d('0x5'));var config=require(_0xac2d('0x6'));var attributes=require(_0xac2d('0x7'));module[_0xac2d('0x8')]=function(_0x3db400,_0x133e22){return _0x3db400[_0xac2d('0x9')](_0xac2d('0xa'),attributes,{'tableName':_0xac2d('0xb'),'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 c5972c0..e6dc82b 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 _0xd943=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x59ffbb,_0x2e6896){var _0x479c56=function(_0x2f7ce5){while(--_0x2f7ce5){_0x59ffbb['push'](_0x59ffbb['shift']());}};_0x479c56(++_0x2e6896);}(_0xd943,0x15d));var _0x3d94=function(_0x3c4202,_0x1fbcf3){_0x3c4202=_0x3c4202-0x0;var _0x157707=_0xd943[_0x3c4202];return _0x157707;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d94('0xa')],{'host':_0x3d94('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3d94('0xc'))[_0x3d94('0xd')](socket);function respondWithRpcPromise(_0x1cc58c,_0x5908a7,_0x182066){return new BPromise(function(_0x4ac968,_0x39e2fa){return client[_0x3d94('0xe')](_0x1cc58c,_0x182066)['then'](function(_0x1897de){logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));logger[_0x3d94('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5908a7,_0x3d94('0x11'),JSON[_0x3d94('0x13')](_0x1897de));if(_0x1897de[_0x3d94('0x14')]){if(_0x1897de['error'][_0x3d94('0x15')]===0x1f4){logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de['error'][_0x3d94('0x16')]);return _0x39e2fa(_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);}logger[_0x3d94('0x14')](_0x3d94('0x10'),_0x5908a7,_0x1897de[_0x3d94('0x14')][_0x3d94('0x16')]);return _0x4ac968(_0x1897de[_0x3d94('0x14')]['message']);}else{logger[_0x3d94('0xf')](_0x3d94('0x10'),_0x5908a7,_0x3d94('0x11'));_0x4ac968(_0x1897de[_0x3d94('0x17')][_0x3d94('0x16')]);}})[_0x3d94('0x18')](function(_0xef8b3){logger['error'](_0x3d94('0x10'),_0x5908a7,_0xef8b3);_0x39e2fa(_0xef8b3);});});}
\ No newline at end of file
+var _0x8952=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','then','info','request\x20sent','debug','stringify','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x8952,0x17e));var _0x2895=function(_0xae57ae,_0x51d19b){_0xae57ae=_0xae57ae-0x0;var _0x2325fb=_0x8952[_0xae57ae];return _0x2325fb;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d961824..78283b1 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5694d3,_0x2e3008){var _0x1ca96e=function(_0x33a079){while(--_0x33a079){_0x5694d3['push'](_0x5694d3['shift']());}};_0x1ca96e(++_0x2e3008);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18f5a1,_0x15d109){_0x18f5a1=_0x18f5a1-0x0;var _0x564804=_0x5f2f[_0x18f5a1];return _0x564804;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
+var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x29d6f1,_0x4465c0){var _0x3cd8b8=function(_0x4b8069){while(--_0x4b8069){_0x29d6f1['push'](_0x29d6f1['shift']());}};_0x3cd8b8(++_0x4465c0);}(_0x5f2f,0x73));var _0xf5f2=function(_0xb59a47,_0x3702d1){_0xb59a47=_0xb59a47-0x0;var _0x5057d4=_0x5f2f[_0xb59a47];return _0x5057d4;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index a0264ad..3b6d604 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 _0x35ea=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline','addInteraction','addApplications','/:id/users','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x39596d,_0x302824){var _0x55f3cc=function(_0x4e0d41){while(--_0x4e0d41){_0x39596d['push'](_0x39596d['shift']());}};_0x55f3cc(++_0x302824);}(_0x35ea,0x185));var _0xa35e=function(_0x2e752b,_0x5cb17d){_0x2e752b=_0x2e752b-0x0;var _0x40a0b4=_0x35ea[_0x2e752b];return _0x40a0b4;};'use strict';var multer=require(_0xa35e('0x0'));var util=require(_0xa35e('0x1'));var path=require(_0xa35e('0x2'));var timeout=require(_0xa35e('0x3'));var express=require(_0xa35e('0x4'));var router=express[_0xa35e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa35e('0x6'));var config=require(_0xa35e('0x7'));var controller=require('./chatWebsite.controller');router[_0xa35e('0x8')]('/',auth[_0xa35e('0x9')](),controller[_0xa35e('0xa')]);router['get'](_0xa35e('0xb'),auth[_0xa35e('0x9')](),controller['describe']);router[_0xa35e('0x8')](_0xa35e('0xc'),auth[_0xa35e('0x9')](),controller['show']);router[_0xa35e('0x8')](_0xa35e('0xd'),auth[_0xa35e('0x9')](),controller[_0xa35e('0xe')]);router[_0xa35e('0x8')](_0xa35e('0xf'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x10')]);router['get'](_0xa35e('0x11'),controller[_0xa35e('0x12')]);router[_0xa35e('0x8')]('/:id/avatar',controller[_0xa35e('0x13')]);router[_0xa35e('0x8')]('/:id/customer_avatar',controller[_0xa35e('0x14')]);router[_0xa35e('0x8')]('/:id/system_avatar',controller[_0xa35e('0x15')]);router[_0xa35e('0x8')](_0xa35e('0x16'),auth[_0xa35e('0x9')](),controller['getInteractions']);router[_0xa35e('0x8')]('/:id/snippet',controller[_0xa35e('0x17')]);router['get'](_0xa35e('0x18'),auth['isAuthenticated'](),controller[_0xa35e('0x19')]);router[_0xa35e('0x8')](_0xa35e('0x1a'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x1b')]);router[_0xa35e('0x8')](_0xa35e('0x1c'),controller[_0xa35e('0x1d')]);router[_0xa35e('0x8')](_0xa35e('0x1e'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x1f')]);router[_0xa35e('0x8')]('/:id/users',auth[_0xa35e('0x9')](),controller[_0xa35e('0x20')]);router[_0xa35e('0x21')]('/',auth[_0xa35e('0x9')](),controller['create']);router['post'](_0xa35e('0xd'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x22')]);router['post'](_0xa35e('0xf'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2655f7,_0x903d5e,_0x2e9ee2){_0x2e9ee2(null,path[_0xa35e('0x24')](config[_0xa35e('0x25')],_0xa35e('0x26')));},'filename':function(_0x310b24,_0x4a2c77,_0x1871db){_0x1871db(null,util[_0xa35e('0x27')](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0x4a2c77[_0xa35e('0x2a')]));}})});router['post'](_0xa35e('0x11'),upload[_0xa35e('0x2b')](_0xa35e('0x2c')),controller[_0xa35e('0x2d')]);var upload=multer({'storage':multer[_0xa35e('0x2e')]({'destination':function(_0x5c1111,_0x46a7f4,_0x12aad5){_0x12aad5(null,path[_0xa35e('0x24')](config[_0xa35e('0x25')],_0xa35e('0x2f')));},'filename':function(_0x429680,_0x3918ba,_0x1d9bc7){_0x1d9bc7(null,util[_0xa35e('0x27')](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0x3918ba[_0xa35e('0x2a')]));}})});router[_0xa35e('0x21')](_0xa35e('0x30'),upload[_0xa35e('0x2b')]('file'),controller[_0xa35e('0x31')]);var upload=multer({'storage':multer[_0xa35e('0x2e')]({'destination':function(_0x5c7979,_0x4bfd70,_0x277032){_0x277032(null,path[_0xa35e('0x24')](config[_0xa35e('0x25')],'server/files/images/avatars/'));},'filename':function(_0x360eb8,_0xf8dd11,_0x76a107){_0x76a107(null,util['format'](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0xf8dd11[_0xa35e('0x2a')]));}})});router[_0xa35e('0x21')](_0xa35e('0x32'),upload[_0xa35e('0x2b')]('file'),controller[_0xa35e('0x33')]);var upload=multer({'storage':multer[_0xa35e('0x2e')]({'destination':function(_0x1a5f17,_0x25646d,_0x52be19){_0x52be19(null,path['join'](config[_0xa35e('0x25')],_0xa35e('0x2f')));},'filename':function(_0x1a2591,_0xc5b95f,_0x5c6958){_0x5c6958(null,util['format'](_0xa35e('0x28'),Date[_0xa35e('0x29')](),_0xc5b95f['originalname']));}})});router[_0xa35e('0x21')](_0xa35e('0x34'),upload[_0xa35e('0x2b')]('file'),controller[_0xa35e('0x35')]);router[_0xa35e('0x21')](_0xa35e('0x36'),controller[_0xa35e('0x37')]);router['post']('/:id/offline',controller[_0xa35e('0x38')]);router['post'](_0xa35e('0x16'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x39')]);router['post'](_0xa35e('0x18'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3a')]);router[_0xa35e('0x21')](_0xa35e('0x1a'),auth[_0xa35e('0x9')](),controller['addProactiveActions']);router[_0xa35e('0x21')](_0xa35e('0x3b'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xa35e('0xc'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3c')]);router[_0xa35e('0x3d')](_0xa35e('0xc'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3e')]);router['delete'](_0xa35e('0xd'),auth[_0xa35e('0x9')](),controller[_0xa35e('0x3f')]);router[_0xa35e('0x3d')](_0xa35e('0xf'),auth['isAuthenticated'](),controller[_0xa35e('0x40')]);router[_0xa35e('0x3d')](_0xa35e('0x3b'),auth['isAuthenticated'](),controller[_0xa35e('0x41')]);module[_0xa35e('0x42')]=router;
\ No newline at end of file
+var _0x60c7=['join','root','server/files/images/logos/','format','%s-%s','now','file','addLogo','server/files/images/avatars/','originalname','single','addAvatar','addCustomerAvatar','/:id/system_avatar','/:id/notify','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','put','update','delete','removeDispositions','removeAgents','multer','util','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x60c7,0xd0));var _0x760c=function(_0x7b33ae,_0x3a1ef5){_0x7b33ae=_0x7b33ae-0x0;var _0x58f2d3=_0x60c7[_0x7b33ae];return _0x58f2d3;};'use strict';var multer=require(_0x760c('0x0'));var util=require(_0x760c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x760c('0x2')]();var auth=require(_0x760c('0x3'));var interaction=require(_0x760c('0x4'));var config=require('../../config/environment');var controller=require(_0x760c('0x5'));router[_0x760c('0x6')]('/',auth[_0x760c('0x7')](),controller[_0x760c('0x8')]);router[_0x760c('0x6')](_0x760c('0x9'),auth['isAuthenticated'](),controller[_0x760c('0xa')]);router[_0x760c('0x6')](_0x760c('0xb'),auth['isAuthenticated'](),controller[_0x760c('0xc')]);router[_0x760c('0x6')](_0x760c('0xd'),auth[_0x760c('0x7')](),controller['getDispositions']);router[_0x760c('0x6')](_0x760c('0xe'),auth[_0x760c('0x7')](),controller[_0x760c('0xf')]);router['get'](_0x760c('0x10'),controller[_0x760c('0x11')]);router[_0x760c('0x6')]('/:id/avatar',controller[_0x760c('0x12')]);router[_0x760c('0x6')](_0x760c('0x13'),controller[_0x760c('0x14')]);router[_0x760c('0x6')]('/:id/system_avatar',controller[_0x760c('0x15')]);router[_0x760c('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x760c('0x16')]);router[_0x760c('0x6')](_0x760c('0x17'),controller[_0x760c('0x18')]);router[_0x760c('0x6')](_0x760c('0x19'),auth['isAuthenticated'](),controller[_0x760c('0x1a')]);router[_0x760c('0x6')](_0x760c('0x1b'),auth[_0x760c('0x7')](),controller['getProactiveActions']);router[_0x760c('0x6')](_0x760c('0x1c'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0x760c('0x7')](),controller[_0x760c('0x1d')]);router['get'](_0x760c('0x1e'),auth[_0x760c('0x7')](),controller[_0x760c('0x1f')]);router[_0x760c('0x20')]('/',auth[_0x760c('0x7')](),controller[_0x760c('0x21')]);router[_0x760c('0x20')]('/:id/dispositions',auth[_0x760c('0x7')](),controller['addDisposition']);router['post'](_0x760c('0xe'),auth[_0x760c('0x7')](),controller[_0x760c('0x22')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x35463b,_0x2c9433,_0x2448d5){_0x2448d5(null,path[_0x760c('0x24')](config[_0x760c('0x25')],_0x760c('0x26')));},'filename':function(_0x1a260a,_0x19fd98,_0x1c2f5d){_0x1c2f5d(null,util[_0x760c('0x27')](_0x760c('0x28'),Date[_0x760c('0x29')](),_0x19fd98['originalname']));}})});router['post'](_0x760c('0x10'),upload['single'](_0x760c('0x2a')),controller[_0x760c('0x2b')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x4593cf,_0xff9a79,_0x2bc1a4){_0x2bc1a4(null,path[_0x760c('0x24')](config[_0x760c('0x25')],_0x760c('0x2c')));},'filename':function(_0xd0238f,_0x345538,_0x16ef0e){_0x16ef0e(null,util[_0x760c('0x27')](_0x760c('0x28'),Date['now'](),_0x345538[_0x760c('0x2d')]));}})});router['post']('/:id/avatar',upload[_0x760c('0x2e')](_0x760c('0x2a')),controller[_0x760c('0x2f')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x1bca0c,_0x420725,_0x26334f){_0x26334f(null,path[_0x760c('0x24')](config[_0x760c('0x25')],_0x760c('0x2c')));},'filename':function(_0x9434bd,_0x1cdbde,_0x5618c6){_0x5618c6(null,util['format'](_0x760c('0x28'),Date[_0x760c('0x29')](),_0x1cdbde['originalname']));}})});router[_0x760c('0x20')](_0x760c('0x13'),upload[_0x760c('0x2e')]('file'),controller[_0x760c('0x30')]);var upload=multer({'storage':multer[_0x760c('0x23')]({'destination':function(_0x43796f,_0x12953f,_0x3d5ad5){_0x3d5ad5(null,path[_0x760c('0x24')](config[_0x760c('0x25')],'server/files/images/avatars/'));},'filename':function(_0x139c3c,_0x125303,_0x25ecc0){_0x25ecc0(null,util['format']('%s-%s',Date[_0x760c('0x29')](),_0x125303['originalname']));}})});router[_0x760c('0x20')](_0x760c('0x31'),upload[_0x760c('0x2e')](_0x760c('0x2a')),controller['addSystemAvatar']);router[_0x760c('0x20')](_0x760c('0x32'),controller['notify']);router[_0x760c('0x20')]('/:id/offline',controller[_0x760c('0x33')]);router[_0x760c('0x20')](_0x760c('0x34'),auth['isAuthenticated'](),controller[_0x760c('0x35')]);router[_0x760c('0x20')](_0x760c('0x19'),auth[_0x760c('0x7')](),controller[_0x760c('0x36')]);router[_0x760c('0x20')](_0x760c('0x1b'),auth[_0x760c('0x7')](),controller[_0x760c('0x37')]);router[_0x760c('0x20')](_0x760c('0x1e'),auth[_0x760c('0x7')](),controller['addAgents']);router[_0x760c('0x38')](_0x760c('0xb'),auth['isAuthenticated'](),controller[_0x760c('0x39')]);router[_0x760c('0x3a')](_0x760c('0xb'),auth[_0x760c('0x7')](),controller['destroy']);router[_0x760c('0x3a')](_0x760c('0xd'),auth[_0x760c('0x7')](),controller[_0x760c('0x3b')]);router['delete'](_0x760c('0xe'),auth[_0x760c('0x7')](),controller['removeAnswers']);router[_0x760c('0x3a')]('/:id/users',auth[_0x760c('0x7')](),controller[_0x760c('0x3c')]);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 f7ad91b..d87e897 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 _0x6e29=['name','STRING','exports'];(function(_0x3113ea,_0x34708b){var _0x3d5310=function(_0x4b886d){while(--_0x4b886d){_0x3113ea['push'](_0x3113ea['shift']());}};_0x3d5310(++_0x34708b);}(_0x6e29,0x140));var _0x96e2=function(_0x5784cb,_0x3e380c){_0x5784cb=_0x5784cb-0x0;var _0x3626a7=_0x6e29[_0x5784cb];return _0x3626a7;};'use strict';var Sequelize=require('sequelize');module[_0x96e2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x96e2('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x96e2('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x96e2('0x2')]},'phone':{'type':Sequelize[_0x96e2('0x2')]},'fax':{'type':Sequelize[_0x96e2('0x2')]},'type':{'type':Sequelize[_0x96e2('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x96e2('0x2')]},'city':{'type':Sequelize[_0x96e2('0x2')]},'country':{'type':Sequelize[_0x96e2('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x96e2('0x2')]},'sStreet':{'type':Sequelize[_0x96e2('0x2')]},'sPostalCode':{'type':Sequelize[_0x96e2('0x2')]},'sCity':{'type':Sequelize[_0x96e2('0x2')]},'sCountry':{'type':Sequelize[_0x96e2('0x2')]},'description':{'type':Sequelize[_0x96e2('0x2')]}};
\ No newline at end of file
+var _0x0c3f=['STRING','sequelize'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x0c3f,0x1cb));var _0xf0c3=function(_0x2eebeb,_0x256ae8){_0x2eebeb=_0x2eebeb-0x0;var _0x19f428=_0x0c3f[_0x2eebeb];return _0x19f428;};'use strict';var Sequelize=require(_0xf0c3('0x0'));module['exports']={'name':{'type':Sequelize[_0xf0c3('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf0c3('0x1')]},'companyId':{'type':Sequelize[_0xf0c3('0x1')]},'website':{'type':Sequelize[_0xf0c3('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf0c3('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf0c3('0x1')]},'city':{'type':Sequelize[_0xf0c3('0x1')]},'country':{'type':Sequelize[_0xf0c3('0x1')]},'email':{'type':Sequelize[_0xf0c3('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf0c3('0x1')]},'sStreet':{'type':Sequelize[_0xf0c3('0x1')]},'sPostalCode':{'type':Sequelize[_0xf0c3('0x1')]},'sCity':{'type':Sequelize[_0xf0c3('0x1')]},'sCountry':{'type':Sequelize[_0xf0c3('0x1')]},'description':{'type':Sequelize[_0xf0c3('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5a14235..8c17418 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 _0xe7ea=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','Companies','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','map','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','findOne','rawAttributes','getContacts','hasOwnProperty','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash'];(function(_0x5d1b80,_0x3725d){var _0x32ba6b=function(_0x135def){while(--_0x135def){_0x5d1b80['push'](_0x5d1b80['shift']());}};_0x32ba6b(++_0x3725d);}(_0xe7ea,0x151));var _0xae7e=function(_0x398841,_0xfa02fe){_0x398841=_0x398841-0x0;var _0x171adc=_0xe7ea[_0x398841];return _0x171adc;};'use strict';var pdf=require(_0xae7e('0x0'));var emlformat=require(_0xae7e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xae7e('0x2'));var jsonpatch=require(_0xae7e('0x3'));var rp=require('request-promise');var moment=require(_0xae7e('0x4'));var BPromise=require(_0xae7e('0x5'));var Mustache=require(_0xae7e('0x6'));var util=require(_0xae7e('0x7'));var path=require(_0xae7e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xae7e('0x9'));var fs=require('fs');var _=require(_0xae7e('0xa'));var squel=require(_0xae7e('0xb'));var crypto=require(_0xae7e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xae7e('0xd'));var toCsv=require(_0xae7e('0xe'));var querystring=require(_0xae7e('0xf'));var Papa=require(_0xae7e('0x10'));var Redis=require(_0xae7e('0x11'));var authService=require(_0xae7e('0x12'));var qs=require(_0xae7e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae7e('0x14'));var logger=require(_0xae7e('0x15'))(_0xae7e('0x16'));var utils=require('../../config/utils');var config=require(_0xae7e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68fc00,_0x2c7d26){_0x2c7d26=_0x2c7d26||0xcc;return function(_0x13b715){if(_0x13b715){return _0x68fc00[_0xae7e('0x18')](_0x2c7d26);}return _0x68fc00[_0xae7e('0x19')](_0x2c7d26)[_0xae7e('0x1a')]();};}function respondWithResult(_0x1019f0,_0x142950){_0x142950=_0x142950||0xc8;return function(_0x4a2e0d){if(_0x4a2e0d){return _0x1019f0['status'](_0x142950)[_0xae7e('0x1b')](_0x4a2e0d);}};}function respondWithFilteredResult(_0x36cd84,_0x566209){return function(_0x1304e7){if(_0x1304e7){var _0x2bd691=_0x1304e7['count'],_0x56503a=_0x566209[_0xae7e('0x1c')],_0x9fff17=_0x566209[_0xae7e('0x1c')]+_0x566209[_0xae7e('0x1d')],_0x458134;if(_0x9fff17>=_0x2bd691){_0x9fff17=_0x2bd691;_0x458134=0xc8;}else{_0x458134=0xce;}_0x36cd84[_0xae7e('0x19')](_0x458134);return _0x36cd84[_0xae7e('0x1e')]('Content-Range',_0x56503a+'-'+_0x9fff17+'/'+_0x2bd691)['json'](_0x1304e7);}return null;};}function patchUpdates(_0x42a3b0){return function(_0x16b997){try{jsonpatch[_0xae7e('0x1f')](_0x16b997,_0x42a3b0,!![]);}catch(_0x577e74){return BPromise[_0xae7e('0x20')](_0x577e74);}return _0x16b997[_0xae7e('0x21')]();};}function saveUpdates(_0x1c3285,_0x56933d){return function(_0x232cb0){if(_0x232cb0){return _0x232cb0[_0xae7e('0x22')](_0x1c3285)[_0xae7e('0x23')](function(_0x221854){return _0x221854;});}return null;};}function removeEntity(_0x1a9d4,_0x1a4a35){return function(_0x2d6ce4){if(_0x2d6ce4){return _0x2d6ce4[_0xae7e('0x24')]()['then'](function(){var _0xfe36b8=_0x2d6ce4[_0xae7e('0x25')]({'plain':!![]});var _0x4dc5d9=_0xae7e('0x26');return db['UserProfileResource'][_0xae7e('0x24')]({'where':{'type':_0x4dc5d9,'resourceId':_0xfe36b8['id']}})[_0xae7e('0x23')](function(){return _0x2d6ce4;});})[_0xae7e('0x23')](function(){_0x1a9d4[_0xae7e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x566dbd,_0x1dbe83){return function(_0xdaedd2){if(!_0xdaedd2){_0x566dbd['sendStatus'](0x194);}return _0xdaedd2;};}function handleError(_0x44266e,_0x1811e8){_0x1811e8=_0x1811e8||0x1f4;return function(_0x88f628){logger['error'](_0x88f628[_0xae7e('0x27')]);if(_0x88f628['name']){delete _0x88f628[_0xae7e('0x28')];}_0x44266e[_0xae7e('0x19')](_0x1811e8)[_0xae7e('0x29')](_0x88f628);};}exports[_0xae7e('0x2a')]=function(_0x1688cf,_0x1adc35){var _0xf864db={},_0x7bc690={},_0x3fa488={'count':0x0,'rows':[]};return db[_0xae7e('0x2b')][_0xae7e('0x2c')]()[_0xae7e('0x23')](function(_0x5bd1fd){_0x7bc690[_0xae7e('0x2d')]=_['keys'](_0x5bd1fd);_0x7bc690[_0xae7e('0x2e')]=_[_0xae7e('0x2f')](_0x1688cf[_0xae7e('0x2e')]);_0x7bc690[_0xae7e('0x30')]=_[_0xae7e('0x31')](_0x7bc690['model'],_0x7bc690[_0xae7e('0x2e')]);_0xf864db[_0xae7e('0x32')]=_[_0xae7e('0x31')](_0x7bc690[_0xae7e('0x2d')],qs[_0xae7e('0x33')](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x33')]));_0xf864db[_0xae7e('0x32')]=_0xf864db[_0xae7e('0x32')][_0xae7e('0x34')]?_0xf864db[_0xae7e('0x32')]:_0x7bc690['model'];if(!_0x1688cf['query']['hasOwnProperty']('nolimit')){_0xf864db['limit']=qs['limit'](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x1d')]);_0xf864db[_0xae7e('0x1c')]=qs[_0xae7e('0x1c')](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x1c')]);}_0xf864db[_0xae7e('0x35')]=qs[_0xae7e('0x36')](_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x36')]);_0xf864db['where']=qs['filters'](_[_0xae7e('0x37')](_0x1688cf[_0xae7e('0x2e')],_0x7bc690['filters']));if(_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x38')]){_0xf864db[_0xae7e('0x39')]=_[_0xae7e('0x3a')](_0xf864db[_0xae7e('0x39')],{'$or':_[_0xae7e('0x3b')](_0xf864db[_0xae7e('0x32')],function(_0x3c70ef){var _0x41f753={};_0x41f753[_0x3c70ef]={'$like':'%'+_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x38')]+'%'};return _0x41f753;})});}_0xf864db=_['merge']({},_0xf864db,_0x1688cf[_0xae7e('0x3c')]);var _0x1bbae7={'where':_0xf864db['where']};return db[_0xae7e('0x2b')]['count'](_0x1bbae7)['then'](function(_0x5b8caf){_0x3fa488[_0xae7e('0x3d')]=_0x5b8caf;if(_0x1688cf[_0xae7e('0x2e')][_0xae7e('0x3e')]){_0xf864db[_0xae7e('0x3f')]=[{'all':!![]}];}return db[_0xae7e('0x2b')][_0xae7e('0x40')](_0xf864db);})['then'](function(_0x1191ee){_0x3fa488[_0xae7e('0x41')]=_0x1191ee;return _0x3fa488;})[_0xae7e('0x23')](respondWithFilteredResult(_0x1adc35,_0xf864db))[_0xae7e('0x42')](handleError(_0x1adc35,null));});};exports[_0xae7e('0x43')]=function(_0x56bdc8,_0x174bc4){var _0x25190b={'raw':![],'where':{'id':_0x56bdc8[_0xae7e('0x44')]['id']}},_0x39aae6={};_0x39aae6[_0xae7e('0x2d')]=_['keys'](db['CmCompany']['rawAttributes']);_0x39aae6['query']=_[_0xae7e('0x2f')](_0x56bdc8['query']);_0x39aae6[_0xae7e('0x30')]=_[_0xae7e('0x31')](_0x39aae6[_0xae7e('0x2d')],_0x39aae6[_0xae7e('0x2e')]);_0x25190b[_0xae7e('0x32')]=_['intersection'](_0x39aae6[_0xae7e('0x2d')],qs[_0xae7e('0x33')](_0x56bdc8['query'][_0xae7e('0x33')]));_0x25190b[_0xae7e('0x32')]=_0x25190b['attributes'][_0xae7e('0x34')]?_0x25190b[_0xae7e('0x32')]:_0x39aae6[_0xae7e('0x2d')];if(_0x56bdc8[_0xae7e('0x2e')][_0xae7e('0x3e')]){_0x25190b[_0xae7e('0x3f')]=[{'all':!![]}];}_0x25190b=_[_0xae7e('0x3a')]({},_0x25190b,_0x56bdc8[_0xae7e('0x3c')]);return db[_0xae7e('0x2b')][_0xae7e('0x45')](_0x25190b)[_0xae7e('0x23')](handleEntityNotFound(_0x174bc4,null))[_0xae7e('0x23')](respondWithResult(_0x174bc4,null))['catch'](handleError(_0x174bc4,null));};exports[_0xae7e('0x46')]=function(_0xec9c9f,_0x3796f9){return db['CmCompany']['create'](_0xec9c9f[_0xae7e('0x47')],{})[_0xae7e('0x23')](function(_0x3c905f){var _0x5881ce=_0xec9c9f[_0xae7e('0x48')][_0xae7e('0x25')]({'plain':!![]});if(!_0x5881ce)throw new Error(_0xae7e('0x49'));if(_0x5881ce[_0xae7e('0x4a')]==='user'){var _0x2d00c5=_0x3c905f['get']({'plain':!![]});var _0x4c20dc=_0xae7e('0x26');return db[_0xae7e('0x4b')][_0xae7e('0x45')]({'where':{'name':_0x4c20dc,'userProfileId':_0x5881ce['userProfileId']},'raw':!![]})[_0xae7e('0x23')](function(_0x40a3a8){if(_0x40a3a8&&_0x40a3a8[_0xae7e('0x4c')]===0x0){return db['UserProfileResource'][_0xae7e('0x46')]({'name':_0x2d00c5[_0xae7e('0x28')],'resourceId':_0x2d00c5['id'],'type':_0x40a3a8['name'],'sectionId':_0x40a3a8['id']},{})[_0xae7e('0x23')](function(){return _0x3c905f;});}else{return _0x3c905f;}})[_0xae7e('0x42')](function(_0xcfd1ac){logger[_0xae7e('0x4d')](_0xae7e('0x4e'),_0xcfd1ac);throw _0xcfd1ac;});}return _0x3c905f;})['then'](respondWithResult(_0x3796f9,0xc9))[_0xae7e('0x42')](handleError(_0x3796f9,null));};exports[_0xae7e('0x22')]=function(_0x201401,_0x42ce7f){if(_0x201401[_0xae7e('0x47')]['id']){delete _0x201401[_0xae7e('0x47')]['id'];}return db[_0xae7e('0x2b')][_0xae7e('0x45')]({'where':{'id':_0x201401['params']['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0x42ce7f,null))['then'](saveUpdates(_0x201401[_0xae7e('0x47')],null))['then'](respondWithResult(_0x42ce7f,null))[_0xae7e('0x42')](handleError(_0x42ce7f,null));};exports[_0xae7e('0x24')]=function(_0x1fc9fb,_0xcfb763){return db[_0xae7e('0x2b')]['find']({'where':{'id':_0x1fc9fb['params']['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0xcfb763,null))[_0xae7e('0x23')](removeEntity(_0xcfb763,null))['catch'](handleError(_0xcfb763,null));};exports[_0xae7e('0x2c')]=function(_0x2ab8d8,_0xea277e){return db[_0xae7e('0x2b')][_0xae7e('0x2c')]()['then'](respondWithResult(_0xea277e,null))[_0xae7e('0x42')](handleError(_0xea277e,null));};exports[_0xae7e('0x4f')]=function(_0x20c7a8,_0x4af1e9,_0x11f8a0){return db[_0xae7e('0x50')][_0xae7e('0x45')]({'where':{'id':_0x20c7a8[_0xae7e('0x44')]['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0x4af1e9,null))[_0xae7e('0x23')](function(_0x3d0525){if(_0x3d0525){return _0x3d0525['addContacts'](_0x20c7a8[_0xae7e('0x47')]['ids'],_[_0xae7e('0x51')](_0x20c7a8[_0xae7e('0x47')],['ids','id'])||{});}})[_0xae7e('0x23')](respondWithResult(_0x4af1e9,null))[_0xae7e('0x42')](handleError(_0x4af1e9,null));};exports['getContacts']=function(_0x23efa2,_0x1af830,_0xc63352){var _0x5f10c0={};var _0x5bf5d3={};var _0x5ec6aa;var _0x47a607;return db[_0xae7e('0x2b')][_0xae7e('0x52')]({'where':{'id':_0x23efa2['params']['id']}})[_0xae7e('0x23')](handleEntityNotFound(_0x1af830,null))[_0xae7e('0x23')](function(_0x281120){if(_0x281120){_0x5ec6aa=_0x281120;_0x5bf5d3[_0xae7e('0x2d')]=_[_0xae7e('0x2f')](db[_0xae7e('0x50')][_0xae7e('0x53')]);_0x5bf5d3[_0xae7e('0x2e')]=_[_0xae7e('0x2f')](_0x23efa2[_0xae7e('0x2e')]);_0x5bf5d3[_0xae7e('0x30')]=_[_0xae7e('0x31')](_0x5bf5d3[_0xae7e('0x2d')],_0x5bf5d3[_0xae7e('0x2e')]);_0x5f10c0[_0xae7e('0x32')]=_[_0xae7e('0x31')](_0x5bf5d3[_0xae7e('0x2d')],qs[_0xae7e('0x33')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x33')]));_0x5f10c0[_0xae7e('0x32')]=_0x5f10c0['attributes'][_0xae7e('0x34')]?_0x5f10c0[_0xae7e('0x32')]:_0x5bf5d3[_0xae7e('0x2d')];_0x5f10c0['order']=qs[_0xae7e('0x36')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x36')]);_0x5f10c0[_0xae7e('0x39')]=qs[_0xae7e('0x30')](_[_0xae7e('0x37')](_0x23efa2[_0xae7e('0x2e')],_0x5bf5d3['filters']));if(_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x38')]){_0x5f10c0['where']=_[_0xae7e('0x3a')](_0x5f10c0['where'],{'$or':_[_0xae7e('0x3b')](_0x5f10c0[_0xae7e('0x32')],function(_0x1cb92f){var _0x5b5248={};_0x5b5248[_0x1cb92f]={'$like':'%'+_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x38')]+'%'};return _0x5b5248;})});}_0x5f10c0=_[_0xae7e('0x3a')]({},_0x5f10c0,_0x23efa2[_0xae7e('0x3c')]);return _0x5ec6aa[_0xae7e('0x54')](_0x5f10c0);}})[_0xae7e('0x23')](function(_0x2c2c20){if(_0x2c2c20){_0x47a607=_0x2c2c20['length'];if(!_0x23efa2['query'][_0xae7e('0x55')](_0xae7e('0x56'))){_0x5f10c0['limit']=qs[_0xae7e('0x1d')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x1d')]);_0x5f10c0[_0xae7e('0x1c')]=qs[_0xae7e('0x1c')](_0x23efa2[_0xae7e('0x2e')][_0xae7e('0x1c')]);}return _0x5ec6aa[_0xae7e('0x54')](_0x5f10c0);}})[_0xae7e('0x23')](function(_0x1af29d){if(_0x1af29d){return _0x1af29d?{'count':_0x47a607,'rows':_0x1af29d}:null;}})[_0xae7e('0x23')](respondWithResult(_0x1af830,null))[_0xae7e('0x42')](handleError(_0x1af830,null));};
\ No newline at end of file
+var _0x1f8c=['CmCompany','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','CmContact','ids','omit','getContacts','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','json','apply','reject','then','get','Companies','UserProfileResource','destroy','end','error','stack','name','send','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options'];(function(_0x3ebff4,_0x5efe9a){var _0x6331b7=function(_0x4860d6){while(--_0x4860d6){_0x3ebff4['push'](_0x3ebff4['shift']());}};_0x6331b7(++_0x5efe9a);}(_0x1f8c,0x6d));var _0xc1f8=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x1f8c[_0x4996d5];return _0x4793f9;};'use strict';var pdf=require(_0xc1f8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc1f8('0x1'));var zipdir=require(_0xc1f8('0x2'));var jsonpatch=require(_0xc1f8('0x3'));var rp=require(_0xc1f8('0x4'));var moment=require('moment');var BPromise=require(_0xc1f8('0x5'));var Mustache=require(_0xc1f8('0x6'));var util=require(_0xc1f8('0x7'));var path=require(_0xc1f8('0x8'));var sox=require(_0xc1f8('0x9'));var csv=require(_0xc1f8('0xa'));var ejs=require(_0xc1f8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc1f8('0xc'));var crypto=require(_0xc1f8('0xd'));var jsforce=require(_0xc1f8('0xe'));var deskjs=require(_0xc1f8('0xf'));var toCsv=require(_0xc1f8('0xa'));var querystring=require('querystring');var Papa=require(_0xc1f8('0x10'));var Redis=require(_0xc1f8('0x11'));var authService=require(_0xc1f8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc1f8('0x13'));var hardwareService=require(_0xc1f8('0x14'));var logger=require(_0xc1f8('0x15'))(_0xc1f8('0x16'));var utils=require(_0xc1f8('0x17'));var config=require(_0xc1f8('0x18'));var db=require(_0xc1f8('0x19'))['db'];function respondWithStatusCode(_0x26964d,_0x391333){_0x391333=_0x391333||0xcc;return function(_0x17e3c8){if(_0x17e3c8){return _0x26964d['sendStatus'](_0x391333);}return _0x26964d[_0xc1f8('0x1a')](_0x391333)['end']();};}function respondWithResult(_0x20fc07,_0x48618e){_0x48618e=_0x48618e||0xc8;return function(_0x2df9ee){if(_0x2df9ee){return _0x20fc07[_0xc1f8('0x1a')](_0x48618e)['json'](_0x2df9ee);}};}function respondWithFilteredResult(_0x122686,_0x292649){return function(_0x57d716){if(_0x57d716){var _0x15fc76=_0x57d716[_0xc1f8('0x1b')],_0x132dac=_0x292649[_0xc1f8('0x1c')],_0x1e209d=_0x292649['offset']+_0x292649[_0xc1f8('0x1d')],_0x1d8016;if(_0x1e209d>=_0x15fc76){_0x1e209d=_0x15fc76;_0x1d8016=0xc8;}else{_0x1d8016=0xce;}_0x122686['status'](_0x1d8016);return _0x122686[_0xc1f8('0x1e')]('Content-Range',_0x132dac+'-'+_0x1e209d+'/'+_0x15fc76)[_0xc1f8('0x1f')](_0x57d716);}return null;};}function patchUpdates(_0x187d4b){return function(_0x145aea){try{jsonpatch[_0xc1f8('0x20')](_0x145aea,_0x187d4b,!![]);}catch(_0x3918c9){return BPromise[_0xc1f8('0x21')](_0x3918c9);}return _0x145aea['save']();};}function saveUpdates(_0x13cab7,_0x32b469){return function(_0x51f287){if(_0x51f287){return _0x51f287['update'](_0x13cab7)['then'](function(_0x58443c){return _0x58443c;});}return null;};}function removeEntity(_0x5f428a,_0x10d7fe){return function(_0x544970){if(_0x544970){return _0x544970['destroy']()[_0xc1f8('0x22')](function(){var _0x103753=_0x544970[_0xc1f8('0x23')]({'plain':!![]});var _0x352a2b=_0xc1f8('0x24');return db[_0xc1f8('0x25')][_0xc1f8('0x26')]({'where':{'type':_0x352a2b,'resourceId':_0x103753['id']}})[_0xc1f8('0x22')](function(){return _0x544970;});})[_0xc1f8('0x22')](function(){_0x5f428a['status'](0xcc)[_0xc1f8('0x27')]();});}};}function handleEntityNotFound(_0x53da10,_0x5b6a5d){return function(_0x28cbf9){if(!_0x28cbf9){_0x53da10['sendStatus'](0x194);}return _0x28cbf9;};}function handleError(_0x58ca93,_0x39cd3f){_0x39cd3f=_0x39cd3f||0x1f4;return function(_0x2c547d){logger[_0xc1f8('0x28')](_0x2c547d[_0xc1f8('0x29')]);if(_0x2c547d[_0xc1f8('0x2a')]){delete _0x2c547d[_0xc1f8('0x2a')];}_0x58ca93[_0xc1f8('0x1a')](_0x39cd3f)[_0xc1f8('0x2b')](_0x2c547d);};}exports['index']=function(_0x537f30,_0x477c7e){var _0x46d2ea={},_0x221c53={},_0x1b276a={'count':0x0,'rows':[]};return db['CmCompany'][_0xc1f8('0x2c')]()['then'](function(_0xf8ba58){_0x221c53['model']=_[_0xc1f8('0x2d')](_0xf8ba58);_0x221c53[_0xc1f8('0x2e')]=_[_0xc1f8('0x2d')](_0x537f30[_0xc1f8('0x2e')]);_0x221c53[_0xc1f8('0x2f')]=_[_0xc1f8('0x30')](_0x221c53[_0xc1f8('0x31')],_0x221c53['query']);_0x46d2ea[_0xc1f8('0x32')]=_[_0xc1f8('0x30')](_0x221c53[_0xc1f8('0x31')],qs[_0xc1f8('0x33')](_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x33')]));_0x46d2ea[_0xc1f8('0x32')]=_0x46d2ea[_0xc1f8('0x32')][_0xc1f8('0x34')]?_0x46d2ea['attributes']:_0x221c53[_0xc1f8('0x31')];if(!_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x35')](_0xc1f8('0x36'))){_0x46d2ea[_0xc1f8('0x1d')]=qs['limit'](_0x537f30['query'][_0xc1f8('0x1d')]);_0x46d2ea[_0xc1f8('0x1c')]=qs[_0xc1f8('0x1c')](_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x1c')]);}_0x46d2ea[_0xc1f8('0x37')]=qs[_0xc1f8('0x38')](_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x38')]);_0x46d2ea[_0xc1f8('0x39')]=qs[_0xc1f8('0x2f')](_[_0xc1f8('0x3a')](_0x537f30[_0xc1f8('0x2e')],_0x221c53[_0xc1f8('0x2f')]));if(_0x537f30[_0xc1f8('0x2e')]['filter']){_0x46d2ea[_0xc1f8('0x39')]=_[_0xc1f8('0x3b')](_0x46d2ea[_0xc1f8('0x39')],{'$or':_[_0xc1f8('0x3c')](_0x46d2ea[_0xc1f8('0x32')],function(_0x227d42){var _0xc16985={};_0xc16985[_0x227d42]={'$like':'%'+_0x537f30[_0xc1f8('0x2e')][_0xc1f8('0x3d')]+'%'};return _0xc16985;})});}_0x46d2ea=_[_0xc1f8('0x3b')]({},_0x46d2ea,_0x537f30[_0xc1f8('0x3e')]);var _0x12f571={'where':_0x46d2ea[_0xc1f8('0x39')]};return db[_0xc1f8('0x3f')][_0xc1f8('0x1b')](_0x12f571)['then'](function(_0x5df01f){_0x1b276a[_0xc1f8('0x1b')]=_0x5df01f;if(_0x537f30[_0xc1f8('0x2e')]['includeAll']){_0x46d2ea['include']=[{'all':!![]}];}return db[_0xc1f8('0x3f')][_0xc1f8('0x40')](_0x46d2ea);})[_0xc1f8('0x22')](function(_0x47857c){_0x1b276a[_0xc1f8('0x41')]=_0x47857c;return _0x1b276a;})[_0xc1f8('0x22')](respondWithFilteredResult(_0x477c7e,_0x46d2ea))[_0xc1f8('0x42')](handleError(_0x477c7e,null));});};exports[_0xc1f8('0x43')]=function(_0x17dae6,_0x103924){var _0x309fc5={'raw':![],'where':{'id':_0x17dae6['params']['id']}},_0x2f04e1={};_0x2f04e1[_0xc1f8('0x31')]=_[_0xc1f8('0x2d')](db[_0xc1f8('0x3f')]['rawAttributes']);_0x2f04e1[_0xc1f8('0x2e')]=_[_0xc1f8('0x2d')](_0x17dae6[_0xc1f8('0x2e')]);_0x2f04e1[_0xc1f8('0x2f')]=_[_0xc1f8('0x30')](_0x2f04e1[_0xc1f8('0x31')],_0x2f04e1[_0xc1f8('0x2e')]);_0x309fc5[_0xc1f8('0x32')]=_[_0xc1f8('0x30')](_0x2f04e1[_0xc1f8('0x31')],qs[_0xc1f8('0x33')](_0x17dae6[_0xc1f8('0x2e')][_0xc1f8('0x33')]));_0x309fc5[_0xc1f8('0x32')]=_0x309fc5[_0xc1f8('0x32')][_0xc1f8('0x34')]?_0x309fc5['attributes']:_0x2f04e1[_0xc1f8('0x31')];if(_0x17dae6[_0xc1f8('0x2e')][_0xc1f8('0x44')]){_0x309fc5['include']=[{'all':!![]}];}_0x309fc5=_[_0xc1f8('0x3b')]({},_0x309fc5,_0x17dae6[_0xc1f8('0x3e')]);return db[_0xc1f8('0x3f')]['find'](_0x309fc5)['then'](handleEntityNotFound(_0x103924,null))[_0xc1f8('0x22')](respondWithResult(_0x103924,null))[_0xc1f8('0x42')](handleError(_0x103924,null));};exports['create']=function(_0x2f26ec,_0x1300d3){return db[_0xc1f8('0x3f')][_0xc1f8('0x45')](_0x2f26ec[_0xc1f8('0x46')],{})[_0xc1f8('0x22')](function(_0x27d43c){var _0x55b6e9=_0x2f26ec[_0xc1f8('0x47')][_0xc1f8('0x23')]({'plain':!![]});if(!_0x55b6e9)throw new Error(_0xc1f8('0x48'));if(_0x55b6e9[_0xc1f8('0x49')]===_0xc1f8('0x47')){var _0x37a9d2=_0x27d43c[_0xc1f8('0x23')]({'plain':!![]});var _0x32d5cd='Companies';return db['UserProfileSection'][_0xc1f8('0x4a')]({'where':{'name':_0x32d5cd,'userProfileId':_0x55b6e9[_0xc1f8('0x4b')]},'raw':!![]})[_0xc1f8('0x22')](function(_0x4111a7){if(_0x4111a7&&_0x4111a7[_0xc1f8('0x4c')]===0x0){return db[_0xc1f8('0x25')][_0xc1f8('0x45')]({'name':_0x37a9d2[_0xc1f8('0x2a')],'resourceId':_0x37a9d2['id'],'type':_0x4111a7[_0xc1f8('0x2a')],'sectionId':_0x4111a7['id']},{})[_0xc1f8('0x22')](function(){return _0x27d43c;});}else{return _0x27d43c;}})[_0xc1f8('0x42')](function(_0x1f0c6f){logger[_0xc1f8('0x28')](_0xc1f8('0x4d'),_0x1f0c6f);throw _0x1f0c6f;});}return _0x27d43c;})[_0xc1f8('0x22')](respondWithResult(_0x1300d3,0xc9))[_0xc1f8('0x42')](handleError(_0x1300d3,null));};exports[_0xc1f8('0x4e')]=function(_0x82fefc,_0x140bd){if(_0x82fefc[_0xc1f8('0x46')]['id']){delete _0x82fefc[_0xc1f8('0x46')]['id'];}return db[_0xc1f8('0x3f')][_0xc1f8('0x4a')]({'where':{'id':_0x82fefc[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x140bd,null))[_0xc1f8('0x22')](saveUpdates(_0x82fefc[_0xc1f8('0x46')],null))['then'](respondWithResult(_0x140bd,null))[_0xc1f8('0x42')](handleError(_0x140bd,null));};exports[_0xc1f8('0x26')]=function(_0x179f79,_0x3b2808){return db['CmCompany'][_0xc1f8('0x4a')]({'where':{'id':_0x179f79[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x3b2808,null))['then'](removeEntity(_0x3b2808,null))[_0xc1f8('0x42')](handleError(_0x3b2808,null));};exports[_0xc1f8('0x2c')]=function(_0x51cf48,_0x596eab){return db[_0xc1f8('0x3f')][_0xc1f8('0x2c')]()[_0xc1f8('0x22')](respondWithResult(_0x596eab,null))[_0xc1f8('0x42')](handleError(_0x596eab,null));};exports[_0xc1f8('0x50')]=function(_0x42125f,_0x31616f,_0x1b2d33){return db[_0xc1f8('0x51')][_0xc1f8('0x4a')]({'where':{'id':_0x42125f[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x31616f,null))[_0xc1f8('0x22')](function(_0x341ca0){if(_0x341ca0){return _0x341ca0[_0xc1f8('0x50')](_0x42125f[_0xc1f8('0x46')][_0xc1f8('0x52')],_[_0xc1f8('0x53')](_0x42125f[_0xc1f8('0x46')],[_0xc1f8('0x52'),'id'])||{});}})[_0xc1f8('0x22')](respondWithResult(_0x31616f,null))[_0xc1f8('0x42')](handleError(_0x31616f,null));};exports[_0xc1f8('0x54')]=function(_0x4c2fba,_0x1b8e89,_0x2a9f59){var _0x45fec7={};var _0x1343f2={};var _0xca772f;var _0x2996a0;return db[_0xc1f8('0x3f')][_0xc1f8('0x55')]({'where':{'id':_0x4c2fba[_0xc1f8('0x4f')]['id']}})[_0xc1f8('0x22')](handleEntityNotFound(_0x1b8e89,null))[_0xc1f8('0x22')](function(_0x359f74){if(_0x359f74){_0xca772f=_0x359f74;_0x1343f2[_0xc1f8('0x31')]=_[_0xc1f8('0x2d')](db[_0xc1f8('0x51')]['rawAttributes']);_0x1343f2[_0xc1f8('0x2e')]=_['keys'](_0x4c2fba['query']);_0x1343f2[_0xc1f8('0x2f')]=_[_0xc1f8('0x30')](_0x1343f2[_0xc1f8('0x31')],_0x1343f2[_0xc1f8('0x2e')]);_0x45fec7[_0xc1f8('0x32')]=_[_0xc1f8('0x30')](_0x1343f2[_0xc1f8('0x31')],qs[_0xc1f8('0x33')](_0x4c2fba['query'][_0xc1f8('0x33')]));_0x45fec7[_0xc1f8('0x32')]=_0x45fec7[_0xc1f8('0x32')][_0xc1f8('0x34')]?_0x45fec7['attributes']:_0x1343f2[_0xc1f8('0x31')];_0x45fec7[_0xc1f8('0x37')]=qs[_0xc1f8('0x38')](_0x4c2fba['query'][_0xc1f8('0x38')]);_0x45fec7[_0xc1f8('0x39')]=qs[_0xc1f8('0x2f')](_[_0xc1f8('0x3a')](_0x4c2fba[_0xc1f8('0x2e')],_0x1343f2[_0xc1f8('0x2f')]));if(_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x3d')]){_0x45fec7[_0xc1f8('0x39')]=_['merge'](_0x45fec7[_0xc1f8('0x39')],{'$or':_[_0xc1f8('0x3c')](_0x45fec7[_0xc1f8('0x32')],function(_0x1306f6){var _0x49d21c={};_0x49d21c[_0x1306f6]={'$like':'%'+_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x3d')]+'%'};return _0x49d21c;})});}_0x45fec7=_[_0xc1f8('0x3b')]({},_0x45fec7,_0x4c2fba[_0xc1f8('0x3e')]);return _0xca772f['getContacts'](_0x45fec7);}})[_0xc1f8('0x22')](function(_0x132af7){if(_0x132af7){_0x2996a0=_0x132af7[_0xc1f8('0x34')];if(!_0x4c2fba['query'][_0xc1f8('0x35')](_0xc1f8('0x36'))){_0x45fec7[_0xc1f8('0x1d')]=qs['limit'](_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x1d')]);_0x45fec7[_0xc1f8('0x1c')]=qs[_0xc1f8('0x1c')](_0x4c2fba[_0xc1f8('0x2e')][_0xc1f8('0x1c')]);}return _0xca772f[_0xc1f8('0x54')](_0x45fec7);}})[_0xc1f8('0x22')](function(_0x414f65){if(_0x414f65){return _0x414f65?{'count':_0x2996a0,'rows':_0x414f65}:null;}})[_0xc1f8('0x22')](respondWithResult(_0x1b8e89,null))['catch'](handleError(_0x1b8e89,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 2fdef32..8a8b1cc 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 _0x3edc=['cm_companies','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x338224,_0x1fb425){_0x338224=_0x338224-0x0;var _0x1d5fc5=_0x3edc[_0x338224];return _0x1d5fc5;};'use strict';var _=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var logger=require(_0xc3ed('0x2'))(_0xc3ed('0x3'));var moment=require(_0xc3ed('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3ed('0x6'));var config=require(_0xc3ed('0x7'));var attributes=require(_0xc3ed('0x8'));module[_0xc3ed('0x9')]=function(_0x3f8468,_0x50b95c){return _0x3f8468[_0xc3ed('0xa')](_0xc3ed('0xb'),attributes,{'tableName':_0xc3ed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34aa=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2b7646,_0x2a17ae){var _0x1af89e=function(_0x5734e2){while(--_0x5734e2){_0x2b7646['push'](_0x2b7646['shift']());}};_0x1af89e(++_0x2a17ae);}(_0x34aa,0x171));var _0xa34a=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0x34aa[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require(_0xa34a('0x0'));var util=require('util');var logger=require(_0xa34a('0x1'))(_0xa34a('0x2'));var moment=require(_0xa34a('0x3'));var BPromise=require(_0xa34a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa34a('0x5'));var rimraf=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var attributes=require(_0xa34a('0x8'));module[_0xa34a('0x9')]=function(_0x475f8f,_0x27349c){return _0x475f8f[_0xa34a('0xa')](_0xa34a('0xb'),attributes,{'tableName':_0xa34a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 7f10cd4..a7ccae7 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 _0x5d10=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x5d10,0x90));var _0x05d1=function(_0x5a58db,_0x2d7f41){_0x5a58db=_0x5a58db-0x0;var _0x42dd9a=_0x5d10[_0x5a58db];return _0x42dd9a;};'use strict';var _=require(_0x05d1('0x0'));var util=require(_0x05d1('0x1'));var moment=require(_0x05d1('0x2'));var BPromise=require(_0x05d1('0x3'));var rs=require(_0x05d1('0x4'));var fs=require('fs');var Redis=require(_0x05d1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x05d1('0x6'));var logger=require(_0x05d1('0x7'))(_0x05d1('0x8'));var config=require('../../config/environment');var jayson=require(_0x05d1('0x9'));var client=jayson[_0x05d1('0xa')][_0x05d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16feeb,_0x567537,_0x56eec3){return new BPromise(function(_0x514e0e,_0x1fa3ca){return client[_0x05d1('0xc')](_0x16feeb,_0x56eec3)[_0x05d1('0xd')](function(_0x5290fd){logger[_0x05d1('0xe')]('CmCompany,\x20%s,\x20%s',_0x567537,_0x05d1('0xf'));logger[_0x05d1('0x10')](_0x05d1('0x11'),_0x567537,'request\x20sent',JSON[_0x05d1('0x12')](_0x5290fd));if(_0x5290fd['error']){if(_0x5290fd[_0x05d1('0x13')][_0x05d1('0x14')]===0x1f4){logger[_0x05d1('0x13')](_0x05d1('0x15'),_0x567537,_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);return _0x1fa3ca(_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x567537,_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);return _0x514e0e(_0x5290fd[_0x05d1('0x13')][_0x05d1('0x16')]);}else{logger['info'](_0x05d1('0x15'),_0x567537,_0x05d1('0xf'));_0x514e0e(_0x5290fd['result'][_0x05d1('0x16')]);}})[_0x05d1('0x17')](function(_0xe3786a){logger[_0x05d1('0x13')](_0x05d1('0x15'),_0x567537,_0xe3786a);_0x1fa3ca(_0xe3786a);});});}
\ No newline at end of file
+var _0xb444=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash'];(function(_0x380aec,_0x496aa2){var _0x322921=function(_0x4dd863){while(--_0x4dd863){_0x380aec['push'](_0x380aec['shift']());}};_0x322921(++_0x496aa2);}(_0xb444,0x1b4));var _0x4b44=function(_0x2c54cc,_0x32161b){_0x2c54cc=_0x2c54cc-0x0;var _0x4cde90=_0xb444[_0x2c54cc];return _0x4cde90;};'use strict';var _=require(_0x4b44('0x0'));var util=require(_0x4b44('0x1'));var moment=require(_0x4b44('0x2'));var BPromise=require(_0x4b44('0x3'));var rs=require(_0x4b44('0x4'));var fs=require('fs');var Redis=require(_0x4b44('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b44('0x6'));var logger=require(_0x4b44('0x7'))(_0x4b44('0x8'));var config=require(_0x4b44('0x9'));var jayson=require(_0x4b44('0xa'));var client=jayson[_0x4b44('0xb')][_0x4b44('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf9c68a,_0x9ac929,_0x5b5a21){return new BPromise(function(_0x41367c,_0x1d8a23){return client[_0x4b44('0xd')](_0xf9c68a,_0x5b5a21)['then'](function(_0x59fcb8){logger[_0x4b44('0xe')](_0x4b44('0xf'),_0x9ac929,'request\x20sent');logger[_0x4b44('0x10')](_0x4b44('0x11'),_0x9ac929,_0x4b44('0x12'),JSON['stringify'](_0x59fcb8));if(_0x59fcb8[_0x4b44('0x13')]){if(_0x59fcb8['error']['code']===0x1f4){logger[_0x4b44('0x13')](_0x4b44('0xf'),_0x9ac929,_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);return _0x1d8a23(_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);}logger['error'](_0x4b44('0xf'),_0x9ac929,_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);return _0x41367c(_0x59fcb8[_0x4b44('0x13')][_0x4b44('0x14')]);}else{logger[_0x4b44('0xe')](_0x4b44('0xf'),_0x9ac929,_0x4b44('0x12'));_0x41367c(_0x59fcb8[_0x4b44('0x15')][_0x4b44('0x14')]);}})[_0x4b44('0x16')](function(_0x5184f2){logger[_0x4b44('0x13')]('CmCompany,\x20%s,\x20%s',_0x9ac929,_0x5184f2);_0x1d8a23(_0x5184f2);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index d54ca98..2e6f7e4 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 _0xd943=['get','show','/:id/contacts','getContacts','isAuthenticated','create','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','describe'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0xd943,0x15d));var _0x3d94=function(_0x4a16c5,_0x536da5){_0x4a16c5=_0x4a16c5-0x0;var _0xec71cf=_0xd943[_0x4a16c5];return _0xec71cf;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var auth=require(_0x3d94('0x5'));var interaction=require(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var controller=require(_0x3d94('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d94('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3d94('0xa')]);router[_0x3d94('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3d94('0xc')]);router[_0x3d94('0xb')](_0x3d94('0xd'),auth['isAuthenticated'](),controller[_0x3d94('0xe')]);router['post']('/',auth[_0x3d94('0xf')](),controller[_0x3d94('0x10')]);router['post'](_0x3d94('0xd'),auth[_0x3d94('0xf')](),controller[_0x3d94('0x11')]);router[_0x3d94('0x12')](_0x3d94('0x13'),auth['isAuthenticated'](),controller[_0x3d94('0x14')]);router[_0x3d94('0x15')](_0x3d94('0x13'),auth['isAuthenticated'](),controller[_0x3d94('0x16')]);module[_0x3d94('0x17')]=router;
\ No newline at end of file
+var _0xed1c=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','util','../../components/auth/service'];(function(_0x238dea,_0x14b7d7){var _0x4d2231=function(_0x57a158){while(--_0x57a158){_0x238dea['push'](_0x238dea['shift']());}};_0x4d2231(++_0x14b7d7);}(_0xed1c,0xe4));var _0xced1=function(_0x16c685,_0x41e68b){_0x16c685=_0x16c685-0x0;var _0x10217e=_0xed1c[_0x16c685];return _0x10217e;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xced1('0x2'));var interaction=require(_0xced1('0x3'));var config=require(_0xced1('0x4'));var controller=require('./cmCompany.controller');router[_0xced1('0x5')]('/',auth[_0xced1('0x6')](),controller[_0xced1('0x7')]);router[_0xced1('0x5')]('/describe',auth[_0xced1('0x6')](),controller[_0xced1('0x8')]);router[_0xced1('0x5')](_0xced1('0x9'),auth[_0xced1('0x6')](),controller[_0xced1('0xa')]);router[_0xced1('0x5')](_0xced1('0xb'),auth['isAuthenticated'](),controller[_0xced1('0xc')]);router['post']('/',auth[_0xced1('0x6')](),controller[_0xced1('0xd')]);router[_0xced1('0xe')](_0xced1('0xb'),auth[_0xced1('0x6')](),controller[_0xced1('0xf')]);router[_0xced1('0x10')]('/:id',auth[_0xced1('0x6')](),controller[_0xced1('0x11')]);router[_0xced1('0x12')](_0xced1('0x9'),auth['isAuthenticated'](),controller[_0xced1('0x13')]);module[_0xced1('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 349e623..8cfcc1e 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 _0xe674=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x527233,_0x2ec398){var _0x39eeeb=function(_0x10f3b8){while(--_0x10f3b8){_0x527233['push'](_0x527233['shift']());}};_0x39eeeb(++_0x2ec398);}(_0xe674,0x18a));var _0x4e67=function(_0x2b6559,_0x3e515c){_0x2b6559=_0x2b6559-0x0;var _0x36bddc=_0xe674[_0x2b6559];return _0x36bddc;};'use strict';var _=require(_0x4e67('0x0'));var Sequelize=require(_0x4e67('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4e67('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4e67('0x2')]},'street':{'type':Sequelize[_0x4e67('0x2')]},'postalCode':{'type':Sequelize[_0x4e67('0x2')]},'city':{'type':Sequelize[_0x4e67('0x2')]},'country':{'type':Sequelize[_0x4e67('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4e67('0x3')]},'phone':{'type':Sequelize[_0x4e67('0x2')]},'mobile':{'type':Sequelize[_0x4e67('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4e67('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4e67('0x2')]},'twitter':{'type':Sequelize[_0x4e67('0x2')]},'skype':{'type':Sequelize[_0x4e67('0x2')]},'teams':{'type':Sequelize[_0x4e67('0x2')]},'viber':{'type':Sequelize[_0x4e67('0x2')]},'line':{'type':Sequelize[_0x4e67('0x2')]},'wechat':{'type':Sequelize[_0x4e67('0x2')]},'telegram':{'type':Sequelize[_0x4e67('0x2')]},'UserId':{'type':Sequelize[_0x4e67('0x4')]},'priority':{'type':Sequelize[_0x4e67('0x4')](0x2)[_0x4e67('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4e67('0x6')],'defaultValue':Sequelize[_0x4e67('0x7')]}};
\ No newline at end of file
+var _0x83b2=['STRING','INTEGER','UNSIGNED','lodash','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x83b2,0x1a7));var _0x283b=function(_0x1381ce,_0x57a5b0){_0x1381ce=_0x1381ce-0x0;var _0x11dd79=_0x83b2[_0x1381ce];return _0x11dd79;};'use strict';var _=require(_0x283b('0x0'));var Sequelize=require('sequelize');module[_0x283b('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x283b('0x2')]},'street':{'type':Sequelize[_0x283b('0x2')]},'postalCode':{'type':Sequelize[_0x283b('0x2')]},'city':{'type':Sequelize[_0x283b('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x283b('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x283b('0x2')]},'mobile':{'type':Sequelize[_0x283b('0x2')]},'fax':{'type':Sequelize[_0x283b('0x2')]},'email':{'type':Sequelize[_0x283b('0x2')]},'url':{'type':Sequelize[_0x283b('0x2')]},'facebook':{'type':Sequelize[_0x283b('0x2')]},'fb_data':{'type':Sequelize[_0x283b('0x2')]},'twitter':{'type':Sequelize[_0x283b('0x2')]},'skype':{'type':Sequelize[_0x283b('0x2')]},'teams':{'type':Sequelize[_0x283b('0x2')]},'viber':{'type':Sequelize[_0x283b('0x2')]},'line':{'type':Sequelize[_0x283b('0x2')]},'wechat':{'type':Sequelize[_0x283b('0x2')]},'telegram':{'type':Sequelize[_0x283b('0x2')]},'UserId':{'type':Sequelize[_0x283b('0x3')]},'priority':{'type':Sequelize[_0x283b('0x3')](0x2)[_0x283b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index d575021..91e4647 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 _0x814b=['CmContact','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','field','color','tools_tags','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','where','c.deletedAt\x20IS\x20NULL','advancedFilter','parse','matchType','substr','omit','options','hasMultipleConditions','value','values','forEach','having','table','parseOperator','getConditionValue','isRangeCondition','$gte','$lte','`\x20=\x200','`\x20>\x200','map','filter','Contact','push','isEmpty','c.ListId\x20IN\x20?','concat','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','replace','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','uc.UserId','Sequelize','QueryTypes','SELECT','clone','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','TagId','toString','keyBy','sequelize','merge','c.mobile','c.email','c.UserId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','catch','params','describe','startsWith','columnName','displayName','CmCustomField','cf_','alias','custom','type','body','from','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','bulkCreate','each','duplicates','ListId','findOrCreate','spread','show','find','findAll','$and','pickBy','format','cf_%d','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','setTags','ids','getHoppers','ContactId','count','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','upload','import','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x814b,0x1a2));var _0xb814=function(_0x301064,_0x1985aa){_0x301064=_0x301064-0x0;var _0x5bc841=_0x814b[_0x301064];return _0x5bc841;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}exports['index']=function(_0x9008b2,_0x37d24d){var _0x530744={},_0x499f22={},_0x20577b={'count':0x0,'rows':[]};return db[_0xb814('0x30')]['describe']()[_0xb814('0x2b')](function(_0x526610){_0x499f22[_0xb814('0x31')]=_['keys'](_0x526610);_0x499f22['query']=_[_0xb814('0x32')](_0x9008b2['query']);_0x499f22[_0xb814('0x33')]=_[_0xb814('0x34')](_0x499f22[_0xb814('0x31')],_0x499f22['query']);_0x530744['attributes']=_[_0xb814('0x34')](_0x499f22[_0xb814('0x31')],qs['fields'](_0x9008b2[_0xb814('0x35')][_0xb814('0x36')]));_0x530744[_0xb814('0x37')]=_0x530744[_0xb814('0x37')][_0xb814('0x38')]?_0x530744[_0xb814('0x37')]:_0x499f22[_0xb814('0x31')];if(!_0x9008b2['query'][_0xb814('0x39')](_0xb814('0x3a'))){_0x530744[_0xb814('0x3b')]=qs[_0xb814('0x3b')](_0x9008b2[_0xb814('0x35')]['limit']);_0x530744[_0xb814('0x24')]=qs['offset'](_0x9008b2[_0xb814('0x35')][_0xb814('0x24')]);}_0x530744[_0xb814('0x3c')]=qs['sort'](_0x9008b2[_0xb814('0x35')][_0xb814('0x3d')]);_0x530744['where']=qs[_0xb814('0x33')](_[_0xb814('0x3e')](_0x9008b2[_0xb814('0x35')],_0x499f22[_0xb814('0x33')]));var _0xd77d96=[];var _0x467cf9=squel['select']()[_0xb814('0x3f')]('id')['field'](_0xb814('0x2e'))['field'](_0xb814('0x40'))['from'](_0xb814('0x41'));var _0x26675a=squel['select']()['from']('cm_contacts','c')['left_join'](_0xb814('0x42'),'uc',_0xb814('0x43'))[_0xb814('0x44')](_0xb814('0x45'));var _0x51cdba=squel['expr']();var _0x6f15d3=_0x9008b2['query'][_0xb814('0x46')]?JSON[_0xb814('0x47')](_0x9008b2[_0xb814('0x35')][_0xb814('0x46')]):undefined;if(_0x6f15d3){var _0x42653f=_0x6f15d3[_0xb814('0x48')][_0xb814('0x49')](0x1);_(_0x6f15d3)[_0xb814('0x4a')](_0xb814('0x48'))['omitBy'](function(_0x544d36,_0x5d26be){return _0x544d36[_0xb814('0x4b')]['custom']===!![];})[_0xb814('0x32')]()['forEach'](function(_0x411723){var _0x44ff56=_0x6f15d3[_0x411723];if(as[_0xb814('0x4c')](_0x44ff56[_0xb814('0x4d')])){var _0x4fae23=_[_0xb814('0x4e')](_0x44ff56[_0xb814('0x4d')])[0x0];_0x4fae23[_0xb814('0x4f')](function(_0x22cf27){if(!_0x44ff56[_0xb814('0x4b')][_0xb814('0x50')]){_0x51cdba[_0x42653f](_0x44ff56['options'][_0xb814('0x51')]+'.'+_0x411723+'\x20'+as[_0xb814('0x52')](_0x22cf27),as[_0xb814('0x53')](_0x22cf27));}});}else if(as[_0xb814('0x54')](_0x44ff56[_0xb814('0x4d')])){_0x51cdba[_0x42653f](_0x44ff56[_0xb814('0x4b')][_0xb814('0x51')]+'.'+_0x411723+'\x20BETWEEN\x20?\x20AND\x20?',_0x44ff56['value'][_0xb814('0x55')],_0x44ff56[_0xb814('0x4d')][_0xb814('0x56')]);}else{if(_0x44ff56[_0xb814('0x4b')][_0xb814('0x50')]){var _0x40e627=as[_0xb814('0x53')](_0x44ff56[_0xb814('0x4d')]);if(_0x40e627[_0xb814('0x38')]===0x1){if(_0x40e627==0x1){_0x26675a[_0xb814('0x50')]('`'+_0x411723+_0xb814('0x57'));}else{_0x26675a['having']('`'+_0x411723+_0xb814('0x58'));}}}else{_0x51cdba[_0x42653f](_0x44ff56[_0xb814('0x4b')]['table']+'.'+_0x411723+'\x20'+as[_0xb814('0x52')](_0x44ff56['value']),as[_0xb814('0x53')](_0x44ff56[_0xb814('0x4d')]));}}});}else{var _0xc71270=_(Object[_0xb814('0x32')](_0x9008b2[_0xb814('0x35')]))[_0xb814('0x59')](function(_0x2cc806){return _0x526610[_0xb814('0x39')](_0x2cc806)?_0x2cc806:undefined;})[_0xb814('0x5a')](function(_0x2a422a){return!_['isNil'](_0x2a422a);})['value']();if(_0x9008b2[_0xb814('0x35')][_0xb814('0x5b')])_0xc71270[_0xb814('0x5c')](_0xb814('0x5b'));if(!_[_0xb814('0x5d')](_0xc71270)){_0xc71270[_0xb814('0x4f')](function(_0x135208){if(_0x135208==='ListId'){_0x26675a[_0xb814('0x44')](_0xb814('0x5e'),[][_0xb814('0x5f')](_0x9008b2['query'][_0x135208]));}else if(_0x135208===_0xb814('0x5b')){var _0x4e6f3c='%'+_0x9008b2[_0xb814('0x35')][_0x135208]+'%';_0x26675a['where'](_0xb814('0x60'),_0x4e6f3c,_0x4e6f3c,_0x4e6f3c);}else{_0x26675a[_0xb814('0x44')]('c.'+_0x135208+'\x20=\x20?',_0x9008b2[_0xb814('0x35')][_0x135208]);}});}if(_0x9008b2[_0xb814('0x35')][_0xb814('0x5a')]){var _0x5209d1=_0x9008b2[_0xb814('0x35')]['filter'][_0xb814('0x61')]('\x5c','\x5c\x5c')[_0xb814('0x61')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xb814('0x62')](_0x5209d1)){_0x51cdba['or']('c.id\x20LIKE\x20?',_0x5209d1+'%');_0x51cdba['or']('c.phone\x20LIKE\x20?',_0x5209d1+'%');_0x51cdba['or'](_0xb814('0x63'),_0x5209d1+'%');_0x51cdba['or'](_0xb814('0x64'),_0x5209d1+'%');}else if(qs[_0xb814('0x65')](_0x5209d1)){_0x51cdba['or']('c.email\x20LIKE\x20?',_0x5209d1+'%');}else{_0x51cdba['or'](_0xb814('0x66'),_0x5209d1+'%');_0x51cdba['or']('c.firstName\x20LIKE\x20?',_0x5209d1+'%');_0x51cdba['or'](_0xb814('0x67'),_0x5209d1+'%');}}}_0x26675a[_0xb814('0x44')](_0x51cdba);_0x26675a['group'](_0xb814('0x68'));_0x26675a['group'](_0xb814('0x69'));var _0x1656ed={'type':db[_0xb814('0x6a')][_0xb814('0x6b')][_0xb814('0x6c')],'raw':!![]};var _0x34acca=_0x26675a[_0xb814('0x6d')]()[_0xb814('0x3f')]('c.id');if(_0x530744[_0xb814('0x3c')]){_0x530744[_0xb814('0x3c')]['forEach'](function(_0x29a127){_0x26675a[_0xb814('0x3c')]('c.'+_0x29a127[0x0],_0x29a127[0x1]==='DESC'?![]:!![]);});}var _0x371000=[];var _0x58b9a6=squel['expr']();if(!_0x6f15d3){if(_0x9008b2[_0xb814('0x35')]['tag']){_0x371000=_[_0xb814('0x6e')](_0x9008b2[_0xb814('0x35')][_0xb814('0x6f')])?_0x9008b2['query'][_0xb814('0x6f')]:new Array(_0x9008b2['query'][_0xb814('0x6f')]);_0x371000[_0xb814('0x4f')](function(_0x1236d4){_0x58b9a6['or'](_0xb814('0x70'),'%,'+_0x1236d4+',%');});_0x26675a[_0xb814('0x50')](_0x58b9a6);_0x34acca[_0xb814('0x71')](_0xb814('0x72'),'ct',_0xb814('0x73'));_0x34acca[_0xb814('0x71')]('tools_tags','t',_0xb814('0x74'));_0x34acca[_0xb814('0x44')](_0xb814('0x75'),_0x371000);}}else{if(_0x6f15d3[_0xb814('0x39')](_0xb814('0x76'))){if(as[_0xb814('0x4c')](_0x6f15d3['TagId'][_0xb814('0x4d')])){var _0x4ccd94=_[_0xb814('0x4e')](_0x6f15d3[_0xb814('0x76')][_0xb814('0x4d')])[0x0];_0x4ccd94['forEach'](function(_0x150e73){as['getConditionValue'](_0x150e73)[_0xb814('0x4f')](function(_0x4a65d0){_0x371000[_0xb814('0x5c')](_0x4a65d0);});});}else{_0x371000=as[_0xb814('0x53')](_0x6f15d3[_0xb814('0x76')][_0xb814('0x4d')]);}_0x371000[_0xb814('0x4f')](function(_0x167d82){_0x58b9a6['or'](_0xb814('0x70'),'%,'+_0x167d82+',%');});_0x26675a['having'](_0x58b9a6);_0x34acca[_0xb814('0x71')]('cm_contact_has_tags','ct',_0xb814('0x73'));_0x34acca[_0xb814('0x71')](_0xb814('0x41'),'t',_0xb814('0x74'));_0x34acca[_0xb814('0x44')](_0xb814('0x75'),_0x371000);}}db['sequelize'][_0xb814('0x35')](_0x467cf9[_0xb814('0x77')](),_0x1656ed)['then'](function(_0x3bb2b4){_0xd77d96=_[_0xb814('0x78')](_0x3bb2b4,'id');return db[_0xb814('0x79')][_0xb814('0x35')](_0x34acca[_0xb814('0x77')](),_0x1656ed);})['then'](function(_0x3a4d4b){_0x20577b['count']=_0x3a4d4b[_0xb814('0x38')];_0x1656ed=_[_0xb814('0x7a')](_0x1656ed,{'model':db[_0xb814('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x26675a[_0xb814('0x3f')](_0xb814('0x68'));_0x26675a[_0xb814('0x3f')]('c.firstName');_0x26675a['field']('c.lastName');_0x26675a[_0xb814('0x3f')]('c.phone');_0x26675a[_0xb814('0x3f')](_0xb814('0x7b'));_0x26675a[_0xb814('0x3f')]('c.fax');_0x26675a[_0xb814('0x3f')](_0xb814('0x7c'));_0x26675a[_0xb814('0x3f')]('c.ListId');_0x26675a[_0xb814('0x3f')](_0xb814('0x7d'));_0x26675a[_0xb814('0x3f')](_0xb814('0x7e'));_0x26675a['field']('uc.UserId');_0x26675a[_0xb814('0x3f')](_0xb814('0x7f'),_0xb814('0x80'));_0x26675a[_0xb814('0x71')](_0xb814('0x72'),'ct',_0xb814('0x73'));_0x26675a[_0xb814('0x71')](_0xb814('0x41'),'t',_0xb814('0x74'));if(_0x530744[_0xb814('0x3b')]){_0x26675a[_0xb814('0x3b')](_0x530744[_0xb814('0x3b')]);}if(_0x530744[_0xb814('0x24')]){_0x26675a[_0xb814('0x24')](_0x530744[_0xb814('0x24')]);}db['sequelize'][_0xb814('0x35')](_0x26675a[_0xb814('0x77')](),_0x1656ed)[_0xb814('0x2b')](function(_0x357b90){_0x357b90[_0xb814('0x4f')](function(_0x283b0f){if(_0x283b0f['TagIds']){_0x283b0f[_0xb814('0x81')]=[];_0x283b0f['TagIds'][_0xb814('0x82')](',')[_0xb814('0x4f')](function(_0x3c5a58){_0x283b0f[_0xb814('0x81')][_0xb814('0x5c')](_0xd77d96[_0x3c5a58]);});}delete _0x283b0f['TagIds'];});_0x20577b['rows']=_0x357b90;return _0x20577b;})[_0xb814('0x2b')](respondWithFilteredResult(_0x37d24d,_0x530744))[_0xb814('0x83')](handleError(_0x37d24d,null));});});};exports[_0xb814('0x2a')]=function(_0x1cbf0c,_0x488ef2){return db[_0xb814('0x30')]['find']({'where':{'id':_0x1cbf0c[_0xb814('0x84')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x488ef2,null))['then'](removeEntity(_0x488ef2,null))['catch'](handleError(_0x488ef2,null));};exports[_0xb814('0x85')]=function(_0x52e17a,_0x3e9222){return db[_0xb814('0x30')][_0xb814('0x85')]()[_0xb814('0x2b')](function(_0x46784f){for(var _0x420bde=0x0;_0x420bde','Attachments','Title','Data','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','name','slice','Anonymous','split','length','pop','value'];(function(_0x2fb39f,_0x3808bd){var _0x5a3641=function(_0x44b140){while(--_0x44b140){_0x2fb39f['push'](_0x2fb39f['shift']());}};_0x5a3641(++_0x3808bd);}(_0x7175,0xe5));var _0x5717=function(_0x265773,_0x5d1b6e){_0x265773=_0x265773-0x0;var _0x4ed75d=_0x7175[_0x265773];return _0x4ed75d;};'use strict';var _=require(_0x5717('0x0'));var moment=require(_0x5717('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x5717('0x2'));var util=require(_0x5717('0x3'));var tnef=require(_0x5717('0x4'));var logger=require(_0x5717('0x5'))(_0x5717('0x6'));var config=require(_0x5717('0x7'));function getAddress(_0x1322d4){var _0x5bf6b7=_[_0x5717('0x8')](_0x1322d4['value']);return _0x5bf6b7&&_0x5bf6b7[_0x5717('0x9')]?_0x5bf6b7['address']:_0x5717('0xa')+random[_0x5717('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x297e23){var _0x5228e1=_['head'](_0x297e23['value']);if(_0x5228e1&&_0x5228e1['name']){var _0x50d15c=_0x5228e1[_0x5717('0xc')]['split'](/\s+/);return _0x50d15c['length']?_0x50d15c[_0x5717('0xd')](0x0,-0x1)['join']('\x20'):_0x5228e1[_0x5717('0xc')];}return _0x5717('0xe');}function getLastName(_0x42e11c){var _0x4dab69=_[_0x5717('0x8')](_0x42e11c['value']);if(_0x4dab69&&_0x4dab69[_0x5717('0xc')]){var _0x14b8ee=_0x4dab69[_0x5717('0xc')][_0x5717('0xf')](/\s+/);return _0x14b8ee[_0x5717('0x10')]>0x1?_0x14b8ee[_0x5717('0x11')]():'';}return'';}function getMails(_0x14422c,_0x39aac4){var _0x177a67='';for(var _0x52ad3a=0x0;_0x52ad3a<_0x39aac4['value'][_0x5717('0x10')];_0x52ad3a+=0x1){if(_0x39aac4[_0x5717('0x12')][_0x52ad3a]['address']!==_0x14422c){if(!_[_0x5717('0x13')](_0x177a67)){_0x177a67+=',';}_0x177a67+=_0x39aac4['value'][_0x52ad3a]['name']||_0x39aac4[_0x5717('0x12')][_0x52ad3a]['address']||'';_0x177a67+='\x20<';_0x177a67+=_0x39aac4[_0x5717('0x12')][_0x52ad3a][_0x5717('0x9')]?_0x39aac4[_0x5717('0x12')][_0x52ad3a][_0x5717('0x9')]:_0x5717('0xa')+random[_0x5717('0xb')](0x6)+_0x5717('0x14');_0x177a67+='>';}}return _0x177a67;}function parseEmail(_0x3cd615,_0x1e74b1,_0x45051c){if(_0x1e74b1[_0x5717('0x15')]){var _0x27e6a8=/