From 27e7bf3eb1b47147d1a6ac42280dccd62d19c64d Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Wed, 27 Oct 2021 09:56:40 +0200
Subject: [PATCH] Built motion from commit 58e5e647.|2.5.37
---
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 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../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/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/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/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/safe-template.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/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
1154 files changed, 1154 insertions(+), 1154 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 7e4947e..ebaf333 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-27T07:28:49.275Z",
+ "time": "2021-10-27T07:47:58.385Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index dbdcee1..8ca7ebe 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-27T07:28:49.275Z",
+ "time": "2021-10-27T07:47:58.385Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 4437aba..8cc766e 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 _0x4725=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','STRING'];(function(_0x28a180,_0x5bb5b0){var _0x1161d3=function(_0x2bb4cf){while(--_0x2bb4cf){_0x28a180['push'](_0x28a180['shift']());}};_0x1161d3(++_0x5bb5b0);}(_0x4725,0x14a));var _0x5472=function(_0x28df33,_0x549ccc){_0x28df33=_0x28df33-0x0;var _0x28b828=_0x4725[_0x28df33];return _0x28b828;};'use strict';var Sequelize=require(_0x5472('0x0'));module[_0x5472('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x899901){return this[_0x5472('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5472('0x3'),_0x5472('0x4'),_0x5472('0x5'),_0x5472('0x6'),'browser',_0x5472('0x7'),'script']],'msg':_0x5472('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5472('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x5472('0xa')},'data3':{'type':Sequelize[_0x5472('0xb')](0x1000),'comment':_0x5472('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x5472('0xd')},'data5':{'type':Sequelize[_0x5472('0xb')](0x1000),'comments':_0x5472('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x5472('0xf')},'data7':{'type':Sequelize[_0x5472('0x10')],'comments':_0x5472('0x11')}};
\ No newline at end of file
+var _0x3435=['integration','urlForward','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager'];(function(_0x10413d,_0x39ceb2){var _0x26c937=function(_0x3fb540){while(--_0x3fb540){_0x10413d['push'](_0x10413d['shift']());}};_0x26c937(++_0x39ceb2);}(_0x3435,0xfa));var _0x5343=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x3435[_0x5eaa0b];return _0x28b295;};'use strict';var Sequelize=require(_0x5343('0x0'));module[_0x5343('0x1')]={'name':{'type':Sequelize[_0x5343('0x2')],'get':function(_0x9ab4a3){return this[_0x5343('0x3')](_0x5343('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x5343('0x5'),_0x5343('0x6'),'motionbar','jscripty',_0x5343('0x7'),_0x5343('0x8'),'bot','script']],'msg':_0x5343('0x9')}},'comment':_0x5343('0x9')},'data1':{'type':Sequelize[_0x5343('0xa')](0x1000),'comment':_0x5343('0xb')},'data2':{'type':Sequelize[_0x5343('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x5343('0xa')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x5343('0xa')](0x1000),'comments':_0x5343('0xc')},'data5':{'type':Sequelize[_0x5343('0xa')](0x1000),'comments':_0x5343('0xd')},'data6':{'type':Sequelize[_0x5343('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x5343('0xe')],'comments':_0x5343('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 8a0404b..7c321c5 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 _0x484c=['send','body','Action','find','params','catch','destroy','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','then','error','stack','name'];(function(_0x22be6d,_0x90876b){var _0x1985e1=function(_0x4a8921){while(--_0x4a8921){_0x22be6d['push'](_0x22be6d['shift']());}};_0x1985e1(++_0x90876b);}(_0x484c,0x15f));var _0xc484=function(_0x379268,_0x1a0759){_0x379268=_0x379268-0x0;var _0x2b5f77=_0x484c[_0x379268];return _0x2b5f77;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc484('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc484('0x1'));var util=require(_0xc484('0x2'));var path=require(_0xc484('0x3'));var sox=require(_0xc484('0x4'));var csv=require(_0xc484('0x5'));var ejs=require(_0xc484('0x6'));var fs=require('fs');var fs_extra=require(_0xc484('0x7'));var _=require('lodash');var squel=require(_0xc484('0x8'));var crypto=require(_0xc484('0x9'));var jsforce=require(_0xc484('0xa'));var deskjs=require(_0xc484('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc484('0xc'));var authService=require(_0xc484('0xd'));var qs=require(_0xc484('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc484('0xf'));var logger=require(_0xc484('0x10'))(_0xc484('0x11'));var utils=require(_0xc484('0x12'));var config=require(_0xc484('0x13'));var licenseUtil=require(_0xc484('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e565f,_0xf5c181){_0xf5c181=_0xf5c181||0xcc;return function(_0x56f60d){if(_0x56f60d){return _0x4e565f[_0xc484('0x15')](_0xf5c181);}return _0x4e565f[_0xc484('0x16')](_0xf5c181)[_0xc484('0x17')]();};}function respondWithResult(_0x11f952,_0x3c8f79){_0x3c8f79=_0x3c8f79||0xc8;return function(_0x3bcc6b){if(_0x3bcc6b){return _0x11f952[_0xc484('0x16')](_0x3c8f79)['json'](_0x3bcc6b);}};}function respondWithFilteredResult(_0x3e1617,_0x12946e){return function(_0x4646c6){if(_0x4646c6){var _0x5cd1ef=typeof _0x12946e[_0xc484('0x18')]===_0xc484('0x19')&&typeof _0x12946e[_0xc484('0x1a')]===_0xc484('0x19');var _0x5ed637=_0x4646c6[_0xc484('0x1b')];var _0x19821b=_0x5cd1ef?0x0:_0x12946e[_0xc484('0x18')];var _0x1591fb=_0x5cd1ef?_0x4646c6['count']:_0x12946e[_0xc484('0x18')]+_0x12946e[_0xc484('0x1a')];var _0x2d9c46;if(_0x1591fb>=_0x5ed637){_0x1591fb=_0x5ed637;_0x2d9c46=0xc8;}else{_0x2d9c46=0xce;}_0x3e1617[_0xc484('0x16')](_0x2d9c46);return _0x3e1617[_0xc484('0x1c')]('Content-Range',_0x19821b+'-'+_0x1591fb+'/'+_0x5ed637)[_0xc484('0x1d')](_0x4646c6);}return null;};}function patchUpdates(_0x14ca34){return function(_0x43091c){try{jsonpatch['apply'](_0x43091c,_0x14ca34,!![]);}catch(_0x1c5286){return BPromise['reject'](_0x1c5286);}return _0x43091c[_0xc484('0x1e')]();};}function saveUpdates(_0x57b48e,_0x3c1923){return function(_0xc33690){if(_0xc33690){return _0xc33690[_0xc484('0x1f')](_0x57b48e)[_0xc484('0x20')](function(_0x484849){return _0x484849;});}return null;};}function removeEntity(_0x3ffc35,_0x14043a){return function(_0x363824){if(_0x363824){return _0x363824['destroy']()[_0xc484('0x20')](function(){_0x3ffc35[_0xc484('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x73eebe,_0x552850){return function(_0x55c656){if(!_0x55c656){_0x73eebe[_0xc484('0x15')](0x194);}return _0x55c656;};}function handleError(_0xedcc26,_0x4ee8a5){_0x4ee8a5=_0x4ee8a5||0x1f4;return function(_0x346511){logger[_0xc484('0x21')](_0x346511[_0xc484('0x22')]);if(_0x346511[_0xc484('0x23')]){delete _0x346511[_0xc484('0x23')];}_0xedcc26[_0xc484('0x16')](_0x4ee8a5)[_0xc484('0x24')](_0x346511);};}exports[_0xc484('0x1f')]=function(_0x568669,_0x37e17c){if(_0x568669[_0xc484('0x25')]['id']){delete _0x568669['body']['id'];}return db[_0xc484('0x26')][_0xc484('0x27')]({'where':{'id':_0x568669[_0xc484('0x28')]['id']}})[_0xc484('0x20')](handleEntityNotFound(_0x37e17c,null))[_0xc484('0x20')](saveUpdates(_0x568669[_0xc484('0x25')],null))[_0xc484('0x20')](respondWithResult(_0x37e17c,null))[_0xc484('0x29')](handleError(_0x37e17c,null));};exports[_0xc484('0x2a')]=function(_0x50a704,_0x9d54a1){return db[_0xc484('0x26')][_0xc484('0x27')]({'where':{'id':_0x50a704[_0xc484('0x28')]['id']}})[_0xc484('0x20')](handleEntityNotFound(_0x9d54a1,null))[_0xc484('0x20')](removeEntity(_0x9d54a1,null))[_0xc484('0x29')](handleError(_0x9d54a1,null));};
\ No newline at end of file
+var _0x554b=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','error','stack','name','update','body','Action','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x554b,0xa5));var _0xb554=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x554b[_0x3718b7];return _0xf8c91e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb554('0x0'));var zipdir=require(_0xb554('0x1'));var jsonpatch=require(_0xb554('0x2'));var rp=require(_0xb554('0x3'));var moment=require(_0xb554('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb554('0x5'));var util=require(_0xb554('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb554('0x7'));var ejs=require(_0xb554('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb554('0x9'));var squel=require(_0xb554('0xa'));var crypto=require('crypto');var jsforce=require(_0xb554('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb554('0xc'));var Papa=require('papaparse');var Redis=require(_0xb554('0xd'));var authService=require(_0xb554('0xe'));var qs=require(_0xb554('0xf'));var as=require(_0xb554('0x10'));var hardwareService=require(_0xb554('0x11'));var logger=require(_0xb554('0x12'))(_0xb554('0x13'));var utils=require('../../config/utils');var config=require(_0xb554('0x14'));var licenseUtil=require(_0xb554('0x15'));var db=require(_0xb554('0x16'))['db'];function respondWithStatusCode(_0x2fa647,_0x3e05af){_0x3e05af=_0x3e05af||0xcc;return function(_0x2f22e4){if(_0x2f22e4){return _0x2fa647[_0xb554('0x17')](_0x3e05af);}return _0x2fa647['status'](_0x3e05af)[_0xb554('0x18')]();};}function respondWithResult(_0x21cea3,_0x222173){_0x222173=_0x222173||0xc8;return function(_0x3f3ef6){if(_0x3f3ef6){return _0x21cea3[_0xb554('0x19')](_0x222173)[_0xb554('0x1a')](_0x3f3ef6);}};}function respondWithFilteredResult(_0x3dfb1a,_0x231252){return function(_0x52a2da){if(_0x52a2da){var _0x12171f=typeof _0x231252[_0xb554('0x1b')]===_0xb554('0x1c')&&typeof _0x231252['limit']===_0xb554('0x1c');var _0x2c2474=_0x52a2da[_0xb554('0x1d')];var _0xcf9df=_0x12171f?0x0:_0x231252[_0xb554('0x1b')];var _0xf14b1c=_0x12171f?_0x52a2da[_0xb554('0x1d')]:_0x231252['offset']+_0x231252[_0xb554('0x1e')];var _0x3b5688;if(_0xf14b1c>=_0x2c2474){_0xf14b1c=_0x2c2474;_0x3b5688=0xc8;}else{_0x3b5688=0xce;}_0x3dfb1a[_0xb554('0x19')](_0x3b5688);return _0x3dfb1a['set'](_0xb554('0x1f'),_0xcf9df+'-'+_0xf14b1c+'/'+_0x2c2474)['json'](_0x52a2da);}return null;};}function patchUpdates(_0x4104c0){return function(_0x22a9be){try{jsonpatch[_0xb554('0x20')](_0x22a9be,_0x4104c0,!![]);}catch(_0x344237){return BPromise[_0xb554('0x21')](_0x344237);}return _0x22a9be[_0xb554('0x22')]();};}function saveUpdates(_0x5537bc,_0x410041){return function(_0x299f5a){if(_0x299f5a){return _0x299f5a['update'](_0x5537bc)[_0xb554('0x23')](function(_0x425974){return _0x425974;});}return null;};}function removeEntity(_0x1d073a,_0x1decf5){return function(_0x13057d){if(_0x13057d){return _0x13057d['destroy']()[_0xb554('0x23')](function(){_0x1d073a[_0xb554('0x19')](0xcc)[_0xb554('0x18')]();});}};}function handleEntityNotFound(_0x5d2977,_0x55844d){return function(_0xb84bab){if(!_0xb84bab){_0x5d2977[_0xb554('0x17')](0x194);}return _0xb84bab;};}function handleError(_0x333752,_0x5db5af){_0x5db5af=_0x5db5af||0x1f4;return function(_0x57b897){logger[_0xb554('0x24')](_0x57b897[_0xb554('0x25')]);if(_0x57b897['name']){delete _0x57b897[_0xb554('0x26')];}_0x333752[_0xb554('0x19')](_0x5db5af)['send'](_0x57b897);};}exports[_0xb554('0x27')]=function(_0x31cdd3,_0x12dff9){if(_0x31cdd3[_0xb554('0x28')]['id']){delete _0x31cdd3['body']['id'];}return db[_0xb554('0x29')][_0xb554('0x2a')]({'where':{'id':_0x31cdd3[_0xb554('0x2b')]['id']}})['then'](handleEntityNotFound(_0x12dff9,null))[_0xb554('0x23')](saveUpdates(_0x31cdd3['body'],null))[_0xb554('0x23')](respondWithResult(_0x12dff9,null))[_0xb554('0x2c')](handleError(_0x12dff9,null));};exports[_0xb554('0x2d')]=function(_0x21e869,_0x372703){return db['Action'][_0xb554('0x2a')]({'where':{'id':_0x21e869[_0xb554('0x2b')]['id']}})['then'](handleEntityNotFound(_0x372703,null))['then'](removeEntity(_0x372703,null))[_0xb554('0x2c')](handleError(_0x372703,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index a02043d..50ac3b2 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 _0xfb09=['bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','lodash','api','moment'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xfb09,0x97));var _0x9fb0=function(_0x5bc7af,_0x2a800c){_0x5bc7af=_0x5bc7af-0x0;var _0xb4c545=_0xfb09[_0x5bc7af];return _0xb4c545;};'use strict';var _=require(_0x9fb0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9fb0('0x1'));var moment=require(_0x9fb0('0x2'));var BPromise=require(_0x9fb0('0x3'));var rp=require(_0x9fb0('0x4'));var fs=require('fs');var path=require(_0x9fb0('0x5'));var rimraf=require(_0x9fb0('0x6'));var config=require(_0x9fb0('0x7'));var attributes=require(_0x9fb0('0x8'));module[_0x9fb0('0x9')]=function(_0x17ae11,_0x57d79a){return _0x17ae11['define'](_0x9fb0('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7a5=['./action.attributes','exports','Action','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x320368,_0x445e5e){var _0x3aa97e=function(_0x10bcb7){while(--_0x10bcb7){_0x320368['push'](_0x320368['shift']());}};_0x3aa97e(++_0x445e5e);}(_0xb7a5,0x67));var _0x5b7a=function(_0x3d1968,_0x56be8b){_0x3d1968=_0x3d1968-0x0;var _0x8b014c=_0xb7a5[_0x3d1968];return _0x8b014c;};'use strict';var _=require(_0x5b7a('0x0'));var util=require(_0x5b7a('0x1'));var logger=require(_0x5b7a('0x2'))('api');var moment=require(_0x5b7a('0x3'));var BPromise=require('bluebird');var rp=require(_0x5b7a('0x4'));var fs=require('fs');var path=require(_0x5b7a('0x5'));var rimraf=require(_0x5b7a('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b7a('0x7'));module[_0x5b7a('0x8')]=function(_0x1eb9a7,_0x54a7c5){return _0x1eb9a7['define'](_0x5b7a('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index fff4b14..d93b9a5 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3be42b,_0x1b2af6){var _0xbade0c=function(_0x564653){while(--_0x564653){_0x3be42b['push'](_0x3be42b['shift']());}};_0xbade0c(++_0x1b2af6);}(_0x326f,0xd1));var _0xf326=function(_0x4c0d88,_0x293b0c){_0x4c0d88=_0x4c0d88-0x0;var _0x301f0c=_0x326f[_0x4c0d88];return _0x301f0c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x7217,0x19e));var _0x7721=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7217[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index c0dd547..f3c8d92 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 _0x56fa=['../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x3015d0,_0x2f6634){var _0x78e6aa=function(_0x5a69ab){while(--_0x5a69ab){_0x3015d0['push'](_0x3015d0['shift']());}};_0x78e6aa(++_0x2f6634);}(_0x56fa,0x1d5));var _0xa56f=function(_0x3e05ec,_0x213f7f){_0x3e05ec=_0x3e05ec-0x0;var _0xd6960=_0x56fa[_0x3e05ec];return _0xd6960;};'use strict';var multer=require(_0xa56f('0x0'));var util=require(_0xa56f('0x1'));var path=require(_0xa56f('0x2'));var timeout=require(_0xa56f('0x3'));var express=require('express');var router=express[_0xa56f('0x4')]();var fs_extra=require(_0xa56f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa56f('0x6'));var config=require(_0xa56f('0x7'));var controller=require(_0xa56f('0x8'));router[_0xa56f('0x9')](_0xa56f('0xa'),auth['isAuthenticated'](),controller[_0xa56f('0xb')]);router['delete']('/:id',auth[_0xa56f('0xc')](),controller[_0xa56f('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x4b49=['../../components/auth/service','../../components/interaction/service','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x2d7916,_0xeb769c){var _0x2d6c4a=function(_0x6179ae){while(--_0x6179ae){_0x2d7916['push'](_0x2d7916['shift']());}};_0x2d6c4a(++_0xeb769c);}(_0x4b49,0xb8));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x94b4('0x0'));var util=require(_0x94b4('0x1'));var path=require(_0x94b4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x94b4('0x3'));var interaction=require(_0x94b4('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0x94b4('0x5'),auth['isAuthenticated'](),controller[_0x94b4('0x6')]);router[_0x94b4('0x7')](_0x94b4('0x5'),auth[_0x94b4('0x8')](),controller[_0x94b4('0x9')]);module[_0x94b4('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 8e1511f..1a04160 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x4ab56d,_0x1bb873){var _0x5d77b5=function(_0x5b66fd){while(--_0x5b66fd){_0x4ab56d['push'](_0x4ab56d['shift']());}};_0x5d77b5(++_0x1bb873);}(_0x31f0,0xb7));var _0x031f=function(_0x5b1b21,_0x421036){_0x5b1b21=_0x5b1b21-0x0;var _0x3f25f7=_0x31f0[_0x5b1b21];return _0x3f25f7;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
+var _0x7c09=['exports','STRING','TEXT'];(function(_0x1df5f4,_0xe4f23f){var _0x23ce14=function(_0x281104){while(--_0x281104){_0x1df5f4['push'](_0x1df5f4['shift']());}};_0x23ce14(++_0xe4f23f);}(_0x7c09,0x102));var _0x97c0=function(_0x54e41b,_0x3faa37){_0x54e41b=_0x54e41b-0x0;var _0x1f3559=_0x7c09[_0x54e41b];return _0x1f3559;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 4a12331..92a521d 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 _0x4910=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','name','send','index','map','AnalyticCustomReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','offset','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','toString','sequelize','SELECT','right_join','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','ValidationErrorItem','AnalyticMetric','web','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','runReport','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x1d8f95,_0xcd1d0e){var _0x4cb618=function(_0xddea13){while(--_0xddea13){_0x1d8f95['push'](_0x1d8f95['shift']());}};_0x4cb618(++_0xcd1d0e);}(_0x4910,0x1d9));var _0x0491=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4910[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x0491('0x0'));var rimraf=require(_0x0491('0x1'));var zipdir=require(_0x0491('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0491('0x3'));var moment=require(_0x0491('0x4'));var BPromise=require(_0x0491('0x5'));var Mustache=require(_0x0491('0x6'));var util=require(_0x0491('0x7'));var path=require('path');var sox=require(_0x0491('0x8'));var csv=require(_0x0491('0x9'));var ejs=require(_0x0491('0xa'));var fs=require('fs');var fs_extra=require(_0x0491('0xb'));var _=require(_0x0491('0xc'));var squel=require('squel');var crypto=require(_0x0491('0xd'));var jsforce=require(_0x0491('0xe'));var deskjs=require(_0x0491('0xf'));var toCsv=require(_0x0491('0x9'));var querystring=require(_0x0491('0x10'));var Papa=require('papaparse');var Redis=require(_0x0491('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0491('0x12'));var as=require(_0x0491('0x13'));var hardwareService=require(_0x0491('0x14'));var logger=require(_0x0491('0x15'))(_0x0491('0x16'));var utils=require(_0x0491('0x17'));var config=require(_0x0491('0x18'));var licenseUtil=require(_0x0491('0x19'));var db=require(_0x0491('0x1a'))['db'];var dbH=require(_0x0491('0x1a'))['dbH'];function respondWithStatusCode(_0x9e022,_0x47caf3){_0x47caf3=_0x47caf3||0xcc;return function(_0x760dfe){if(_0x760dfe){return _0x9e022['sendStatus'](_0x47caf3);}return _0x9e022['status'](_0x47caf3)[_0x0491('0x1b')]();};}function respondWithResult(_0x7ba36,_0x439f5c){_0x439f5c=_0x439f5c||0xc8;return function(_0x2f1a37){if(_0x2f1a37){return _0x7ba36[_0x0491('0x1c')](_0x439f5c)[_0x0491('0x1d')](_0x2f1a37);}};}function respondWithFilteredResult(_0x7972b9,_0xbd94bd){return function(_0xf12423){if(_0xf12423){var _0x1411a6=typeof _0xbd94bd['offset']===_0x0491('0x1e')&&typeof _0xbd94bd[_0x0491('0x1f')]===_0x0491('0x1e');var _0x31bc2c=_0xf12423[_0x0491('0x20')];var _0xc02328=_0x1411a6?0x0:_0xbd94bd['offset'];var _0x1a924b=_0x1411a6?_0xf12423[_0x0491('0x20')]:_0xbd94bd['offset']+_0xbd94bd['limit'];var _0x1ba594;if(_0x1a924b>=_0x31bc2c){_0x1a924b=_0x31bc2c;_0x1ba594=0xc8;}else{_0x1ba594=0xce;}_0x7972b9['status'](_0x1ba594);return _0x7972b9[_0x0491('0x21')](_0x0491('0x22'),_0xc02328+'-'+_0x1a924b+'/'+_0x31bc2c)['json'](_0xf12423);}return null;};}function patchUpdates(_0x6141b9){return function(_0x22776d){try{jsonpatch[_0x0491('0x23')](_0x22776d,_0x6141b9,!![]);}catch(_0x291d40){return BPromise['reject'](_0x291d40);}return _0x22776d[_0x0491('0x24')]();};}function saveUpdates(_0x358117,_0x1fb8a5){return function(_0x55f326){if(_0x55f326){return _0x55f326[_0x0491('0x25')](_0x358117)[_0x0491('0x26')](function(_0x31c4ba){return _0x31c4ba;});}return null;};}function removeEntity(_0x1934a0,_0x30ad41){return function(_0xdda718){if(_0xdda718){return _0xdda718[_0x0491('0x27')]()['then'](function(){var _0x7c03ef=_0xdda718[_0x0491('0x28')]({'plain':!![]});var _0xc0c021=_0x0491('0x29');return db[_0x0491('0x2a')]['destroy']({'where':{'type':_0xc0c021,'resourceId':_0x7c03ef['id']}})[_0x0491('0x26')](function(){return _0xdda718;});})[_0x0491('0x26')](function(){_0x1934a0[_0x0491('0x1c')](0xcc)[_0x0491('0x1b')]();});}};}function handleEntityNotFound(_0xe0e31e,_0xae6fc6){return function(_0x2c3f39){if(!_0x2c3f39){_0xe0e31e[_0x0491('0x2b')](0x194);}return _0x2c3f39;};}function handleError(_0x38b4b8,_0x15b80d){_0x15b80d=_0x15b80d||0x1f4;return function(_0x5c9ee2){logger['error'](_0x5c9ee2['stack']);if(_0x5c9ee2['name']){delete _0x5c9ee2[_0x0491('0x2c')];}_0x38b4b8['status'](_0x15b80d)[_0x0491('0x2d')](_0x5c9ee2);};}exports[_0x0491('0x2e')]=function(_0x3b66d0,_0x7d4feb){var _0x2e3223={},_0x18278b={},_0x448f42={'count':0x0,'rows':[]};var _0x49206a=_[_0x0491('0x2f')](db[_0x0491('0x30')][_0x0491('0x31')],function(_0x5cb278){return{'name':_0x5cb278['fieldName'],'type':_0x5cb278['type']['key']};});_0x18278b[_0x0491('0x32')]=_['map'](_0x49206a,_0x0491('0x2c'));_0x18278b[_0x0491('0x33')]=_[_0x0491('0x34')](_0x3b66d0[_0x0491('0x33')]);_0x18278b[_0x0491('0x35')]=_[_0x0491('0x36')](_0x18278b[_0x0491('0x32')],_0x18278b[_0x0491('0x33')]);_0x2e3223['attributes']=_[_0x0491('0x36')](_0x18278b['model'],qs[_0x0491('0x37')](_0x3b66d0[_0x0491('0x33')]['fields']));_0x2e3223[_0x0491('0x38')]=_0x2e3223['attributes'][_0x0491('0x39')]?_0x2e3223[_0x0491('0x38')]:_0x18278b[_0x0491('0x32')];if(!_0x3b66d0[_0x0491('0x33')]['hasOwnProperty']('nolimit')){_0x2e3223[_0x0491('0x1f')]=qs[_0x0491('0x1f')](_0x3b66d0[_0x0491('0x33')]['limit']);_0x2e3223[_0x0491('0x3a')]=qs['offset'](_0x3b66d0[_0x0491('0x33')]['offset']);}_0x2e3223[_0x0491('0x3b')]=qs[_0x0491('0x3c')](_0x3b66d0[_0x0491('0x33')]['sort']);_0x2e3223['where']=qs[_0x0491('0x35')](_[_0x0491('0x3d')](_0x3b66d0[_0x0491('0x33')],_0x18278b['filters']),_0x49206a);if(_0x3b66d0['query'][_0x0491('0x3e')]){_0x2e3223[_0x0491('0x3f')]=_[_0x0491('0x40')](_0x2e3223[_0x0491('0x3f')],{'$or':_[_0x0491('0x2f')](_0x49206a,function(_0x2f0e31){if(_0x2f0e31[_0x0491('0x41')]!=='VIRTUAL'){var _0x3b9f21={};_0x3b9f21[_0x2f0e31[_0x0491('0x2c')]]={'$like':'%'+_0x3b66d0['query'][_0x0491('0x3e')]+'%'};return _0x3b9f21;}})});}_0x2e3223=_[_0x0491('0x40')]({},_0x2e3223,_0x3b66d0[_0x0491('0x42')]);var _0x28cfbb={'where':_0x2e3223[_0x0491('0x3f')]};return db['AnalyticCustomReport'][_0x0491('0x20')](_0x28cfbb)[_0x0491('0x26')](function(_0x30982f){_0x448f42[_0x0491('0x20')]=_0x30982f;if(_0x3b66d0[_0x0491('0x33')][_0x0491('0x43')]){_0x2e3223[_0x0491('0x44')]=[{'all':!![]}];}return db[_0x0491('0x30')][_0x0491('0x45')](_0x2e3223);})[_0x0491('0x26')](function(_0x443544){_0x448f42[_0x0491('0x46')]=_0x443544;return _0x448f42;})['then'](respondWithFilteredResult(_0x7d4feb,_0x2e3223))['catch'](handleError(_0x7d4feb,null));};exports[_0x0491('0x47')]=function(_0x4af10d,_0x5dc807){var _0x4e8fa0={'raw':![],'where':{'id':_0x4af10d[_0x0491('0x48')]['id']}},_0x4ccaf4={};_0x4ccaf4['model']=_[_0x0491('0x34')](db[_0x0491('0x30')][_0x0491('0x31')]);_0x4ccaf4['query']=_[_0x0491('0x34')](_0x4af10d['query']);_0x4ccaf4[_0x0491('0x35')]=_['intersection'](_0x4ccaf4[_0x0491('0x32')],_0x4ccaf4[_0x0491('0x33')]);_0x4e8fa0[_0x0491('0x38')]=_[_0x0491('0x36')](_0x4ccaf4[_0x0491('0x32')],qs[_0x0491('0x37')](_0x4af10d[_0x0491('0x33')][_0x0491('0x37')]));_0x4e8fa0[_0x0491('0x38')]=_0x4e8fa0[_0x0491('0x38')][_0x0491('0x39')]?_0x4e8fa0[_0x0491('0x38')]:_0x4ccaf4[_0x0491('0x32')];if(_0x4af10d['query'][_0x0491('0x43')]){_0x4e8fa0[_0x0491('0x44')]=[{'all':!![]}];}_0x4e8fa0=_[_0x0491('0x40')]({},_0x4e8fa0,_0x4af10d[_0x0491('0x42')]);return db[_0x0491('0x30')][_0x0491('0x49')](_0x4e8fa0)['then'](handleEntityNotFound(_0x5dc807,null))[_0x0491('0x26')](respondWithResult(_0x5dc807,null))[_0x0491('0x4a')](handleError(_0x5dc807,null));};exports[_0x0491('0x4b')]=function(_0x290ed4,_0x569e55){return db['AnalyticCustomReport'][_0x0491('0x4b')](_0x290ed4[_0x0491('0x4c')],{})[_0x0491('0x26')](function(_0x563c4f){var _0x6dd643=_0x290ed4['user'][_0x0491('0x28')]({'plain':!![]});if(!_0x6dd643)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6dd643[_0x0491('0x4d')]===_0x0491('0x4e')){var _0x24a850=_0x563c4f[_0x0491('0x28')]({'plain':!![]});var _0x3c114a='Reports';return db[_0x0491('0x4f')]['find']({'where':{'name':_0x3c114a,'userProfileId':_0x6dd643['userProfileId']},'raw':!![]})[_0x0491('0x26')](function(_0x294cce){if(_0x294cce&&_0x294cce[_0x0491('0x50')]===0x0){return db[_0x0491('0x2a')][_0x0491('0x4b')]({'name':_0x24a850[_0x0491('0x2c')],'resourceId':_0x24a850['id'],'type':_0x0491('0x29'),'sectionId':_0x294cce['id']},{})[_0x0491('0x26')](function(){return _0x563c4f;});}else{return _0x563c4f;}})['catch'](function(_0xec5404){logger[_0x0491('0x51')](_0x0491('0x52'),_0xec5404);throw _0xec5404;});}return _0x563c4f;})[_0x0491('0x26')](respondWithResult(_0x569e55,0xc9))[_0x0491('0x4a')](handleError(_0x569e55,null));};exports['update']=function(_0x9a980e,_0x225a34){if(_0x9a980e[_0x0491('0x4c')]['id']){delete _0x9a980e[_0x0491('0x4c')]['id'];}return db[_0x0491('0x30')][_0x0491('0x49')]({'where':{'id':_0x9a980e[_0x0491('0x48')]['id']}})[_0x0491('0x26')](handleEntityNotFound(_0x225a34,null))['then'](saveUpdates(_0x9a980e[_0x0491('0x4c')],null))[_0x0491('0x26')](respondWithResult(_0x225a34,null))[_0x0491('0x4a')](handleError(_0x225a34,null));};exports[_0x0491('0x27')]=function(_0x3d3145,_0x112f8b){return db[_0x0491('0x30')][_0x0491('0x49')]({'where':{'id':_0x3d3145[_0x0491('0x48')]['id']}})['then'](handleEntityNotFound(_0x112f8b,null))[_0x0491('0x26')](removeEntity(_0x112f8b,null))[_0x0491('0x4a')](handleError(_0x112f8b,null));};exports[_0x0491('0x53')]=function(_0x260d06,_0x5a97ae){var _0x5df9e2=0xa;var _0x547de3=[_0x0491('0x54'),_0x0491('0x55'),'right_join',_0x0491('0x56')];var _0x475602={'SUM':'SUM(%s)','COUNT':_0x0491('0x57'),'COUNT DISTINCT':_0x0491('0x58'),'MAX':_0x0491('0x59'),'MIN':_0x0491('0x5a'),'AVG':_0x0491('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0491('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4ea662={'SEC_TO_TIME':_0x0491('0x5d'),'DATE':_0x0491('0x5e'),'HOUR':_0x0491('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0491('0x60')};var _0x185a20=function(_0x52e5e0){return!_[_0x0491('0x61')]([_0x0491('0x62'),_0x0491('0x63'),_0x0491('0x64'),_0x0491('0x65')],_0x52e5e0);};var _0x4c12e0=function(_0x41da4a){if(!_0x41da4a||!_0x41da4a['rules']['length']){return'';}for(var _0x2b77ce='(',_0x11de4c=0x0;_0x11de4c<_0x41da4a['rules'][_0x0491('0x39')];_0x11de4c+=0x1){_0x11de4c>0x0&&(_0x2b77ce+='\x20'+_0x41da4a[_0x0491('0x66')]+'\x20');_0x2b77ce+=_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x68')]?_0x4c12e0(_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x68')]):_0x41da4a['rules'][_0x11de4c][_0x0491('0x69')]+'\x20'+_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x6a')]+(_0x185a20(_0x41da4a[_0x0491('0x67')][_0x11de4c]['condition'])?'\x20'+_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x6b')]:'');}return _0x2b77ce+')';};var _0x110c2c={'where':{'id':_0x260d06[_0x0491('0x48')]['id']}},_0x1359ef,_0x5c8e7d,_0x45c75e,_0x442a97,_0x2652d9;_0x110c2c=_[_0x0491('0x40')]({},_0x110c2c,_0x260d06['options']);return db['AnalyticCustomReport']['find'](_0x110c2c)[_0x0491('0x26')](function(_0xfab5b1){if(_0xfab5b1){_0x1359ef=_0xfab5b1;return _0xfab5b1[_0x0491('0x6c')]();}return null;})[_0x0491('0x26')](function(_0x4236e5){if(_0x4236e5){if(!_0x4236e5[_0x0491('0x39')]){throw new db[(_0x0491('0x6d'))]['ValidationErrorItem'](_0x0491('0x6e'),0x193);}_0x5c8e7d=_0x4236e5;return db['AnalyticMetric'][_0x0491('0x45')]({'raw':!![]});}return null;})[_0x0491('0x26')](function(_0x6f2731){if(_0x6f2731){_0x45c75e=_[_0x0491('0x6f')](_0x6f2731,'id');var _0x35d4c0;var _0x537256=squel[_0x0491('0x70')]();_0x537256[_0x0491('0x71')](_0x1359ef['table']);for(var _0x590363=0x0;_0x590363<_0x5c8e7d[_0x0491('0x39')];_0x590363+=0x1){_0x35d4c0=_0x5c8e7d[_0x590363][_0x0491('0x72')]?_0x45c75e[_0x5c8e7d[_0x590363]['MetricId']][_0x0491('0x73')]:_0x5c8e7d[_0x590363]['field'];_0x35d4c0=_0x5c8e7d[_0x590363][_0x0491('0x74')]?_[_0x0491('0x75')](_0x475602[_0x5c8e7d[_0x590363][_0x0491('0x74')]],'%s',_0x35d4c0):_0x35d4c0;_0x35d4c0=_0x5c8e7d[_0x590363][_0x0491('0x76')]?_[_0x0491('0x75')](_0x4ea662[_0x5c8e7d[_0x590363]['format']],'%s',_0x35d4c0):_0x35d4c0;if(_0x5c8e7d[_0x590363][_0x0491('0x77')]){_0x537256[_0x0491('0x68')](_0x35d4c0);}_0x5c8e7d[_0x590363][_0x0491('0x78')]&&_0x537256[_0x0491('0x3b')](_0x35d4c0,_0x5c8e7d[_0x590363][_0x0491('0x78')]===_0x0491('0x79')?![]:!![]);_0x537256[_0x0491('0x69')](_0x35d4c0,_0x5c8e7d[_0x590363][_0x0491('0x7a')]||_0x35d4c0);}if(_0x1359ef[_0x0491('0x7b')]){_0x1359ef[_0x0491('0x7b')]=JSON[_0x0491('0x7c')](_0x1359ef[_0x0491('0x7b')]);for(var _0x492d88=0x0;_0x492d88<_0x1359ef[_0x0491('0x7b')][_0x0491('0x39')];_0x492d88+=0x1){if(_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x41')]&&_[_0x0491('0x61')](_0x547de3,_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x41')])&&_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7d')]&&_0x1359ef['joins'][_0x492d88][_0x0491('0x7e')]&&_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7f')]){_0x537256[_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x41')]](_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7e')],null,util['format'](_0x0491('0x80'),_0x1359ef[_0x0491('0x81')],_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7d')],_0x1359ef['joins'][_0x492d88][_0x0491('0x7e')],_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7f')]));}}}if(_0x1359ef['conditions']){_0x1359ef[_0x0491('0x82')]=JSON['parse'](_0x1359ef[_0x0491('0x82')]);_0x537256[_0x0491('0x3f')](_0x4c12e0(_0x1359ef[_0x0491('0x82')][_0x0491('0x68')]));}_0x2652d9=_0x537256[_0x0491('0x83')]();_0x537256['limit'](_0x5df9e2);_0x537256['offset'](0x0);logger['debug']('Limited\x20Query:',_0x537256[_0x0491('0x84')]());return dbH['sequelize'][_0x0491('0x33')](_0x537256['toString'](),{'type':dbH[_0x0491('0x85')]['QueryTypes'][_0x0491('0x86')]});}})['then'](respondWithResult(_0x5a97ae,null))[_0x0491('0x4a')](handleError(_0x5a97ae,null));};function runReport(_0x1a455e,_0x21d22b,_0xae356c){var _0x500022=_0x21d22b[_0x0491('0x2c')];var _0x1e4487=0xa;var _0xce4147=['join',_0x0491('0x55'),_0x0491('0x87'),_0x0491('0x56')];var _0x18bd6a={'SUM':_0x0491('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0491('0x58'),'MAX':'MAX(%s)','MIN':_0x0491('0x5a'),'AVG':_0x0491('0x5b'),'GROUP_CONCAT':_0x0491('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0491('0x8a')};var _0x4316ef={'SEC_TO_TIME':_0x0491('0x5d'),'DATE':_0x0491('0x5e'),'HOUR':_0x0491('0x5f'),'ROUND':_0x0491('0x8b'),'UNIX_TIMESTAMP':_0x0491('0x60')};var _0x36e0a0=function(_0x4a1d7f){return!_[_0x0491('0x61')]([_0x0491('0x62'),'IS\x20NOT\x20NULL',_0x0491('0x64'),'IS\x20NOT\x20EMPTY'],_0x4a1d7f);};var _0x4e3252=function(_0x48d967){if(!_0x48d967||!_0x48d967[_0x0491('0x67')][_0x0491('0x39')]){return'';}for(var _0x3b07c2='(',_0x3bc888=0x0;_0x3bc888<_0x48d967['rules']['length'];_0x3bc888+=0x1){_0x3bc888>0x0&&(_0x3b07c2+='\x20'+_0x48d967[_0x0491('0x66')]+'\x20');_0x3b07c2+=_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x68')]?_0x4e3252(_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x68')]):_0x48d967['rules'][_0x3bc888][_0x0491('0x69')]+'\x20'+_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x6a')]+(_0x36e0a0(_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x6a')])?'\x20'+_0x48d967[_0x0491('0x67')][_0x3bc888]['value']:'');}return _0x3b07c2+')';};var _0x50c727={'where':{'id':_0x1a455e['id']}},_0x543699,_0x52772b,_0x5b91f5,_0x26ff9a,_0x33e3c5;_0x50c727=_[_0x0491('0x40')]({},_0x50c727,_0xae356c);return db['AnalyticCustomReport'][_0x0491('0x49')](_0x50c727)[_0x0491('0x26')](function(_0x3bd19d){if(_0x3bd19d){_0x543699=_0x3bd19d;return _0x3bd19d[_0x0491('0x6c')]();}return null;})[_0x0491('0x26')](function(_0x546d2f){if(_0x546d2f){if(!_0x546d2f['length']){throw new db['Sequelize'][(_0x0491('0x8c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x52772b=_0x546d2f;return db[_0x0491('0x8d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1b7241){if(_0x1b7241){_0x5b91f5=_['keyBy'](_0x1b7241,'id');var _0x270766;var _0x1e92f7=squel['select']();_0x1e92f7['from'](_0x543699[_0x0491('0x81')]);for(var _0x2891c9=0x0;_0x2891c9<_0x52772b['length'];_0x2891c9+=0x1){_0x270766=_0x52772b[_0x2891c9][_0x0491('0x72')]?_0x5b91f5[_0x52772b[_0x2891c9]['MetricId']]['metric']:_0x52772b[_0x2891c9][_0x0491('0x69')];_0x270766=_0x52772b[_0x2891c9][_0x0491('0x74')]?_['replace'](_0x18bd6a[_0x52772b[_0x2891c9][_0x0491('0x74')]],'%s',_0x270766):_0x270766;_0x270766=_0x52772b[_0x2891c9]['format']?_[_0x0491('0x75')](_0x4316ef[_0x52772b[_0x2891c9]['format']],'%s',_0x270766):_0x270766;if(_0x52772b[_0x2891c9][_0x0491('0x77')]){_0x1e92f7[_0x0491('0x68')](_0x270766);}_0x52772b[_0x2891c9][_0x0491('0x78')]&&_0x1e92f7[_0x0491('0x3b')](_0x270766,_0x52772b[_0x2891c9][_0x0491('0x78')]===_0x0491('0x79')?![]:!![]);_0x1e92f7[_0x0491('0x69')](_0x270766,_0x52772b[_0x2891c9]['alias']||_0x270766);}if(_0x543699[_0x0491('0x7b')]){_0x543699[_0x0491('0x7b')]=JSON[_0x0491('0x7c')](_0x543699['joins']);for(var _0x530665=0x0;_0x530665<_0x543699[_0x0491('0x7b')][_0x0491('0x39')];_0x530665+=0x1){if(_0x543699['joins'][_0x530665]['type']&&_[_0x0491('0x61')](_0xce4147,_0x543699['joins'][_0x530665][_0x0491('0x41')])&&_0x543699[_0x0491('0x7b')][_0x530665]['parentKey']&&_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x7e')]&&_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x7f')]){_0x1e92f7[_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x41')]](_0x543699['joins'][_0x530665][_0x0491('0x7e')],null,util[_0x0491('0x76')](_0x0491('0x80'),_0x543699[_0x0491('0x81')],_0x543699[_0x0491('0x7b')][_0x530665]['parentKey'],_0x543699[_0x0491('0x7b')][_0x530665]['foreignTable'],_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x7f')]));}}}if(_0x543699[_0x0491('0x82')]){_0x543699[_0x0491('0x82')]=JSON[_0x0491('0x7c')](_0x543699[_0x0491('0x82')]);_0x1e92f7[_0x0491('0x3f')](_0x4e3252(_0x543699[_0x0491('0x82')][_0x0491('0x68')]));}_0x33e3c5=_0x1e92f7[_0x0491('0x83')]();_0x1e92f7[_0x0491('0x1f')](_0x1e4487);_0x1e92f7[_0x0491('0x3a')](0x0);return;}})[_0x0491('0x26')](function(){if(_0x21d22b['output']===_0x0491('0x8e')){return null;}var _0x4a446e=_[_0x0491('0x40')](_0x21d22b,{'name':_0x21d22b['fullPath']||_0x21d22b['name']||_0x543699[_0x0491('0x2c')],'basename':_0x500022,'savename':util[_0x0491('0x76')](_0x0491('0x8f'),_0x21d22b[_0x0491('0x2c')]||_0x543699['name'],require('randomstring')[_0x0491('0x90')](0x4),_0x21d22b[_0x0491('0x91')]||_0x0491('0x92')),'reportId':_0x543699['id'],'reportType':_0x0491('0x93')});return db[_0x0491('0x94')][_0x0491('0x4b')](_0x4a446e,{'raw':!![]});})[_0x0491('0x26')](function(_0x30ab30){if(_0x543699['table']===_0x0491('0x95')){_0x33e3c5[_0x0491('0x3f')](_0x543699[_0x0491('0x81')]+_0x0491('0x96'),_0x21d22b[_0x0491('0x97')],_0x21d22b[_0x0491('0x98')]);}else{_0x33e3c5[_0x0491('0x3f')](_0x543699['table']+_0x0491('0x99'),_0x21d22b['startDate'],_0x21d22b[_0x0491('0x98')]);}if(_0x30ab30){logger['info'](_0x0491('0x9a'),_0x33e3c5[_0x0491('0x84')]());require(_0x0491('0x9b'))[_0x0491('0x9c')](path[_0x0491('0x54')](__dirname,_0x0491('0x9d'),_0x30ab30[_0x0491('0x91')]),[_0x30ab30['id'],_0x33e3c5[_0x0491('0x84')](),path[_0x0491('0x54')](__dirname,_0x0491('0x9e'),_0x30ab30['savename']),_0x500022]);return _0x30ab30;}else{var _0x43b5bd=squel[_0x0491('0x70')]();_0x43b5bd[_0x0491('0x71')]('('+_0x33e3c5[_0x0491('0x84')]()+')',_0x0491('0x9f'));_0x43b5bd[_0x0491('0x69')](_0x0491('0xa0'),_0x0491('0x20'));_0x33e3c5[_0x0491('0x1f')](_0x21d22b[_0x0491('0x1f')]||_0x1e4487);_0x33e3c5['offset'](_0x21d22b['offset']||0x0);return dbH[_0x0491('0x85')]['query'](_0x43b5bd[_0x0491('0x84')](),{'type':dbH[_0x0491('0x85')]['QueryTypes'][_0x0491('0x86')]})[_0x0491('0x26')](function(_0x5231fb){if(!_0x5231fb[_0x0491('0x39')]){_0x26ff9a=0x0;}else{_0x26ff9a=_0x5231fb[0x0][_0x0491('0x20')]||0x0;}return dbH[_0x0491('0x85')][_0x0491('0x33')](_0x33e3c5[_0x0491('0x84')](),{'type':dbH['sequelize'][_0x0491('0xa1')][_0x0491('0x86')]});})[_0x0491('0x26')](function(_0xc3557f){return{'rows':_0xc3557f||[],'count':_0x26ff9a};});}});}exports['run']=function(_0x911ebe,_0x589aa7){return runReport(_0x911ebe['params'],_0x911ebe[_0x0491('0x33')],_0x911ebe['options'])[_0x0491('0x26')](respondWithResult(_0x589aa7,null))['catch'](handleError(_0x589aa7,null));};exports[_0x0491('0xa2')]=runReport;exports[_0x0491('0x33')]=function(_0x5c6f51,_0x3400e3){var _0x544771=0xa;var _0x24bb69=['join',_0x0491('0x55'),'right_join',_0x0491('0x56')];var _0x251a8f={'SUM':_0x0491('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0491('0x58'),'MAX':_0x0491('0x59'),'MIN':_0x0491('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0491('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x203494={'SEC_TO_TIME':_0x0491('0x5d'),'DATE':_0x0491('0x5e'),'HOUR':_0x0491('0x5f'),'ROUND':_0x0491('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x386a30=function(_0x4a697e){return!_['includes']([_0x0491('0x62'),_0x0491('0x63'),_0x0491('0x64'),_0x0491('0x65')],_0x4a697e);};var _0x3b0b24=function(_0x33a0aa){if(!_0x33a0aa||!_0x33a0aa[_0x0491('0x67')][_0x0491('0x39')]){return'';}for(var _0x4ef3e6='(',_0x49901c=0x0;_0x49901c<_0x33a0aa[_0x0491('0x67')]['length'];_0x49901c+=0x1){_0x49901c>0x0&&(_0x4ef3e6+='\x20'+_0x33a0aa[_0x0491('0x66')]+'\x20');_0x4ef3e6+=_0x33a0aa['rules'][_0x49901c][_0x0491('0x68')]?_0x3b0b24(_0x33a0aa['rules'][_0x49901c][_0x0491('0x68')]):_0x33a0aa[_0x0491('0x67')][_0x49901c][_0x0491('0x69')]+'\x20'+_0x33a0aa['rules'][_0x49901c][_0x0491('0x6a')]+(_0x386a30(_0x33a0aa[_0x0491('0x67')][_0x49901c][_0x0491('0x6a')])?'\x20'+_0x33a0aa['rules'][_0x49901c][_0x0491('0x6b')]:'');}return _0x4ef3e6+')';};var _0x49d549={'where':{'id':_0x5c6f51[_0x0491('0x48')]['id']}},_0x906305,_0x1c4f45,_0x5d454b,_0x1e2364,_0x119a86;_0x49d549=_[_0x0491('0x40')]({},_0x49d549,_0x5c6f51[_0x0491('0x42')]);return db['AnalyticCustomReport']['find'](_0x49d549)[_0x0491('0x26')](function(_0x229b68){if(_0x229b68){_0x906305=_0x229b68;return _0x229b68['getFields']();}return null;})[_0x0491('0x26')](function(_0x322402){if(_0x322402){if(!_0x322402['length']){throw new db['Sequelize'][(_0x0491('0x8c'))](_0x0491('0x6e'),0x193);}_0x1c4f45=_0x322402;return db[_0x0491('0x8d')][_0x0491('0x45')]({'raw':!![]});}return null;})[_0x0491('0x26')](function(_0x5830ec){if(_0x5830ec){_0x5d454b=_['keyBy'](_0x5830ec,'id');var _0x5604ab;var _0x139056=squel[_0x0491('0x70')]();_0x139056[_0x0491('0x71')](_0x906305[_0x0491('0x81')]);for(var _0x13c4fe=0x0;_0x13c4fe<_0x1c4f45[_0x0491('0x39')];_0x13c4fe+=0x1){_0x5604ab=_0x1c4f45[_0x13c4fe][_0x0491('0x72')]?_0x5d454b[_0x1c4f45[_0x13c4fe]['MetricId']]['metric']:_0x1c4f45[_0x13c4fe][_0x0491('0x69')];_0x5604ab=_0x1c4f45[_0x13c4fe][_0x0491('0x74')]?_[_0x0491('0x75')](_0x251a8f[_0x1c4f45[_0x13c4fe]['function']],'%s',_0x5604ab):_0x5604ab;_0x5604ab=_0x1c4f45[_0x13c4fe][_0x0491('0x76')]?_['replace'](_0x203494[_0x1c4f45[_0x13c4fe][_0x0491('0x76')]],'%s',_0x5604ab):_0x5604ab;if(_0x1c4f45[_0x13c4fe]['groupBy']){_0x139056[_0x0491('0x68')](_0x5604ab);}_0x1c4f45[_0x13c4fe]['orderBy']&&_0x139056[_0x0491('0x3b')](_0x5604ab,_0x1c4f45[_0x13c4fe][_0x0491('0x78')]===_0x0491('0x79')?![]:!![]);_0x139056[_0x0491('0x69')](_0x5604ab,_0x1c4f45[_0x13c4fe]['alias']||_0x5604ab);}if(_0x906305[_0x0491('0x7b')]){_0x906305[_0x0491('0x7b')]=JSON[_0x0491('0x7c')](_0x906305[_0x0491('0x7b')]);for(var _0x3a0367=0x0;_0x3a0367<_0x906305[_0x0491('0x7b')][_0x0491('0x39')];_0x3a0367+=0x1){if(_0x906305['joins'][_0x3a0367][_0x0491('0x41')]&&_['includes'](_0x24bb69,_0x906305[_0x0491('0x7b')][_0x3a0367]['type'])&&_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7d')]&&_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7e')]&&_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7f')]){_0x139056[_0x906305[_0x0491('0x7b')][_0x3a0367]['type']](_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7e')],null,util[_0x0491('0x76')]('%s.%s\x20=\x20%s.%s',_0x906305[_0x0491('0x81')],_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7d')],_0x906305['joins'][_0x3a0367][_0x0491('0x7e')],_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7f')]));}}}if(_0x906305[_0x0491('0x82')]){_0x906305[_0x0491('0x82')]=JSON[_0x0491('0x7c')](_0x906305[_0x0491('0x82')]);_0x139056[_0x0491('0x3f')](_0x3b0b24(_0x906305['conditions']['group']));}_0x119a86=_0x139056[_0x0491('0x83')]();_0x139056[_0x0491('0x1f')](_0x544771);_0x139056['offset'](0x0);logger[_0x0491('0xa3')]('Limited\x20Query:',_0x139056[_0x0491('0x84')]());return dbH[_0x0491('0x85')][_0x0491('0x33')](_0x139056[_0x0491('0x84')](),{'type':dbH[_0x0491('0x85')][_0x0491('0xa1')][_0x0491('0x86')]});}})['then'](function(){return{'sql':_0x119a86['toString']()};})[_0x0491('0x26')](respondWithResult(_0x3400e3,null))[_0x0491('0x4a')](handleError(_0x3400e3,null));};
\ No newline at end of file
+var _0xe5a2=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','catch','show','params','length','includeAll','merge','find','create','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','metric','function','replace','format','orderBy','DESC','alias','parse','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','value','getFields','Sequelize','AnalyticMetric','select','from','MetricId','output','web','fullPath','randomstring','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','runReport','COUNT(%s)','groupBy','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path'];(function(_0x35009a,_0x4c647b){var _0x41ae8a=function(_0x594c04){while(--_0x594c04){_0x35009a['push'](_0x35009a['shift']());}};_0x41ae8a(++_0x4c647b);}(_0xe5a2,0x98));var _0x2e5a=function(_0x3e8158,_0x377fe3){_0x3e8158=_0x3e8158-0x0;var _0x1825b4=_0xe5a2[_0x3e8158];return _0x1825b4;};'use strict';var emlformat=require(_0x2e5a('0x0'));var rimraf=require(_0x2e5a('0x1'));var zipdir=require(_0x2e5a('0x2'));var jsonpatch=require(_0x2e5a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2e5a('0x4'));var util=require(_0x2e5a('0x5'));var path=require(_0x2e5a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e5a('0x8'));var squel=require(_0x2e5a('0x9'));var crypto=require('crypto');var jsforce=require(_0x2e5a('0xa'));var deskjs=require(_0x2e5a('0xb'));var toCsv=require(_0x2e5a('0xc'));var querystring=require(_0x2e5a('0xd'));var Papa=require('papaparse');var Redis=require(_0x2e5a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2e5a('0xf'));var as=require(_0x2e5a('0x10'));var hardwareService=require(_0x2e5a('0x11'));var logger=require('../../config/logger')(_0x2e5a('0x12'));var utils=require(_0x2e5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2e5a('0x14'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x431806,_0x4970b9){_0x4970b9=_0x4970b9||0xcc;return function(_0x2dadc9){if(_0x2dadc9){return _0x431806['sendStatus'](_0x4970b9);}return _0x431806[_0x2e5a('0x15')](_0x4970b9)['end']();};}function respondWithResult(_0x55683b,_0x3d1363){_0x3d1363=_0x3d1363||0xc8;return function(_0x3209b6){if(_0x3209b6){return _0x55683b[_0x2e5a('0x15')](_0x3d1363)['json'](_0x3209b6);}};}function respondWithFilteredResult(_0x33d65b,_0xea48b4){return function(_0x3c1119){if(_0x3c1119){var _0xf84490=typeof _0xea48b4[_0x2e5a('0x16')]===_0x2e5a('0x17')&&typeof _0xea48b4[_0x2e5a('0x18')]==='undefined';var _0x4a2834=_0x3c1119[_0x2e5a('0x19')];var _0x7d81dc=_0xf84490?0x0:_0xea48b4[_0x2e5a('0x16')];var _0x58a949=_0xf84490?_0x3c1119[_0x2e5a('0x19')]:_0xea48b4['offset']+_0xea48b4['limit'];var _0x11471a;if(_0x58a949>=_0x4a2834){_0x58a949=_0x4a2834;_0x11471a=0xc8;}else{_0x11471a=0xce;}_0x33d65b['status'](_0x11471a);return _0x33d65b[_0x2e5a('0x1a')](_0x2e5a('0x1b'),_0x7d81dc+'-'+_0x58a949+'/'+_0x4a2834)[_0x2e5a('0x1c')](_0x3c1119);}return null;};}function patchUpdates(_0x26c64b){return function(_0x241a92){try{jsonpatch[_0x2e5a('0x1d')](_0x241a92,_0x26c64b,!![]);}catch(_0xf4786d){return BPromise[_0x2e5a('0x1e')](_0xf4786d);}return _0x241a92[_0x2e5a('0x1f')]();};}function saveUpdates(_0x243ae2,_0x9908b7){return function(_0x5c8c19){if(_0x5c8c19){return _0x5c8c19[_0x2e5a('0x20')](_0x243ae2)[_0x2e5a('0x21')](function(_0x28518f){return _0x28518f;});}return null;};}function removeEntity(_0x33df1e,_0x474ad4){return function(_0x1b3dc5){if(_0x1b3dc5){return _0x1b3dc5[_0x2e5a('0x22')]()[_0x2e5a('0x21')](function(){var _0x26b708=_0x1b3dc5[_0x2e5a('0x23')]({'plain':!![]});var _0x4dcf8d='CustomReports';return db[_0x2e5a('0x24')][_0x2e5a('0x22')]({'where':{'type':_0x4dcf8d,'resourceId':_0x26b708['id']}})[_0x2e5a('0x21')](function(){return _0x1b3dc5;});})[_0x2e5a('0x21')](function(){_0x33df1e[_0x2e5a('0x15')](0xcc)[_0x2e5a('0x25')]();});}};}function handleEntityNotFound(_0x23ed50,_0x16a4b9){return function(_0x1681f2){if(!_0x1681f2){_0x23ed50['sendStatus'](0x194);}return _0x1681f2;};}function handleError(_0x4dea20,_0x445278){_0x445278=_0x445278||0x1f4;return function(_0x4e44b3){logger[_0x2e5a('0x26')](_0x4e44b3[_0x2e5a('0x27')]);if(_0x4e44b3[_0x2e5a('0x28')]){delete _0x4e44b3['name'];}_0x4dea20['status'](_0x445278)['send'](_0x4e44b3);};}exports[_0x2e5a('0x29')]=function(_0x5f52c0,_0x3c66b4){var _0x252e71={},_0x4bf525={},_0x33dff9={'count':0x0,'rows':[]};var _0x46700b=_[_0x2e5a('0x2a')](db[_0x2e5a('0x2b')][_0x2e5a('0x2c')],function(_0x529681){return{'name':_0x529681['fieldName'],'type':_0x529681[_0x2e5a('0x2d')][_0x2e5a('0x2e')]};});_0x4bf525['model']=_['map'](_0x46700b,_0x2e5a('0x28'));_0x4bf525[_0x2e5a('0x2f')]=_[_0x2e5a('0x30')](_0x5f52c0[_0x2e5a('0x2f')]);_0x4bf525[_0x2e5a('0x31')]=_[_0x2e5a('0x32')](_0x4bf525[_0x2e5a('0x33')],_0x4bf525[_0x2e5a('0x2f')]);_0x252e71[_0x2e5a('0x34')]=_['intersection'](_0x4bf525[_0x2e5a('0x33')],qs[_0x2e5a('0x35')](_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x35')]));_0x252e71[_0x2e5a('0x34')]=_0x252e71[_0x2e5a('0x34')]['length']?_0x252e71['attributes']:_0x4bf525[_0x2e5a('0x33')];if(!_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x36')](_0x2e5a('0x37'))){_0x252e71[_0x2e5a('0x18')]=qs[_0x2e5a('0x18')](_0x5f52c0['query'][_0x2e5a('0x18')]);_0x252e71[_0x2e5a('0x16')]=qs['offset'](_0x5f52c0[_0x2e5a('0x2f')]['offset']);}_0x252e71[_0x2e5a('0x38')]=qs[_0x2e5a('0x39')](_0x5f52c0['query'][_0x2e5a('0x39')]);_0x252e71[_0x2e5a('0x3a')]=qs[_0x2e5a('0x31')](_[_0x2e5a('0x3b')](_0x5f52c0[_0x2e5a('0x2f')],_0x4bf525['filters']),_0x46700b);if(_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x3c')]){_0x252e71[_0x2e5a('0x3a')]=_['merge'](_0x252e71[_0x2e5a('0x3a')],{'$or':_['map'](_0x46700b,function(_0x1c8fe9){if(_0x1c8fe9['type']!=='VIRTUAL'){var _0x66db77={};_0x66db77[_0x1c8fe9[_0x2e5a('0x28')]]={'$like':'%'+_0x5f52c0[_0x2e5a('0x2f')][_0x2e5a('0x3c')]+'%'};return _0x66db77;}})});}_0x252e71=_['merge']({},_0x252e71,_0x5f52c0[_0x2e5a('0x3d')]);var _0x5864f6={'where':_0x252e71[_0x2e5a('0x3a')]};return db[_0x2e5a('0x2b')][_0x2e5a('0x19')](_0x5864f6)[_0x2e5a('0x21')](function(_0x23f29f){_0x33dff9[_0x2e5a('0x19')]=_0x23f29f;if(_0x5f52c0[_0x2e5a('0x2f')]['includeAll']){_0x252e71[_0x2e5a('0x3e')]=[{'all':!![]}];}return db[_0x2e5a('0x2b')][_0x2e5a('0x3f')](_0x252e71);})[_0x2e5a('0x21')](function(_0x5da7d3){_0x33dff9['rows']=_0x5da7d3;return _0x33dff9;})[_0x2e5a('0x21')](respondWithFilteredResult(_0x3c66b4,_0x252e71))[_0x2e5a('0x40')](handleError(_0x3c66b4,null));};exports[_0x2e5a('0x41')]=function(_0x4714c8,_0x5ef991){var _0x3707a9={'raw':![],'where':{'id':_0x4714c8[_0x2e5a('0x42')]['id']}},_0x39742c={};_0x39742c[_0x2e5a('0x33')]=_[_0x2e5a('0x30')](db[_0x2e5a('0x2b')][_0x2e5a('0x2c')]);_0x39742c[_0x2e5a('0x2f')]=_[_0x2e5a('0x30')](_0x4714c8[_0x2e5a('0x2f')]);_0x39742c['filters']=_[_0x2e5a('0x32')](_0x39742c[_0x2e5a('0x33')],_0x39742c['query']);_0x3707a9['attributes']=_[_0x2e5a('0x32')](_0x39742c[_0x2e5a('0x33')],qs[_0x2e5a('0x35')](_0x4714c8['query'][_0x2e5a('0x35')]));_0x3707a9[_0x2e5a('0x34')]=_0x3707a9['attributes'][_0x2e5a('0x43')]?_0x3707a9[_0x2e5a('0x34')]:_0x39742c[_0x2e5a('0x33')];if(_0x4714c8[_0x2e5a('0x2f')][_0x2e5a('0x44')]){_0x3707a9[_0x2e5a('0x3e')]=[{'all':!![]}];}_0x3707a9=_[_0x2e5a('0x45')]({},_0x3707a9,_0x4714c8[_0x2e5a('0x3d')]);return db['AnalyticCustomReport'][_0x2e5a('0x46')](_0x3707a9)[_0x2e5a('0x21')](handleEntityNotFound(_0x5ef991,null))[_0x2e5a('0x21')](respondWithResult(_0x5ef991,null))['catch'](handleError(_0x5ef991,null));};exports[_0x2e5a('0x47')]=function(_0x1d156d,_0x1259ab){return db[_0x2e5a('0x2b')][_0x2e5a('0x47')](_0x1d156d['body'],{})[_0x2e5a('0x21')](function(_0x4e8568){var _0xad7b0a=_0x1d156d['user']['get']({'plain':!![]});if(!_0xad7b0a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xad7b0a[_0x2e5a('0x48')]===_0x2e5a('0x49')){var _0x28e813=_0x4e8568[_0x2e5a('0x23')]({'plain':!![]});var _0xa1c349=_0x2e5a('0x4a');return db[_0x2e5a('0x4b')]['find']({'where':{'name':_0xa1c349,'userProfileId':_0xad7b0a[_0x2e5a('0x4c')]},'raw':!![]})[_0x2e5a('0x21')](function(_0x5f2429){if(_0x5f2429&&_0x5f2429[_0x2e5a('0x4d')]===0x0){return db[_0x2e5a('0x24')]['create']({'name':_0x28e813[_0x2e5a('0x28')],'resourceId':_0x28e813['id'],'type':_0x2e5a('0x4e'),'sectionId':_0x5f2429['id']},{})[_0x2e5a('0x21')](function(){return _0x4e8568;});}else{return _0x4e8568;}})[_0x2e5a('0x40')](function(_0x1c9934){logger[_0x2e5a('0x26')](_0x2e5a('0x4f'),_0x1c9934);throw _0x1c9934;});}return _0x4e8568;})[_0x2e5a('0x21')](respondWithResult(_0x1259ab,0xc9))[_0x2e5a('0x40')](handleError(_0x1259ab,null));};exports['update']=function(_0xfffb23,_0x4c9bcf){if(_0xfffb23[_0x2e5a('0x50')]['id']){delete _0xfffb23['body']['id'];}return db[_0x2e5a('0x2b')][_0x2e5a('0x46')]({'where':{'id':_0xfffb23['params']['id']}})[_0x2e5a('0x21')](handleEntityNotFound(_0x4c9bcf,null))[_0x2e5a('0x21')](saveUpdates(_0xfffb23['body'],null))[_0x2e5a('0x21')](respondWithResult(_0x4c9bcf,null))['catch'](handleError(_0x4c9bcf,null));};exports[_0x2e5a('0x22')]=function(_0x647a92,_0x4d801d){return db[_0x2e5a('0x2b')][_0x2e5a('0x46')]({'where':{'id':_0x647a92[_0x2e5a('0x42')]['id']}})[_0x2e5a('0x21')](handleEntityNotFound(_0x4d801d,null))[_0x2e5a('0x21')](removeEntity(_0x4d801d,null))[_0x2e5a('0x40')](handleError(_0x4d801d,null));};exports[_0x2e5a('0x51')]=function(_0x13d757,_0x5045b2){var _0x3ce217=0xa;var _0x50a53a=[_0x2e5a('0x52'),_0x2e5a('0x53'),_0x2e5a('0x54'),_0x2e5a('0x55')];var _0x6919ca={'SUM':_0x2e5a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2e5a('0x57'),'MAX':_0x2e5a('0x58'),'MIN':'MIN(%s)','AVG':_0x2e5a('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x2e5a('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x254169={'SEC_TO_TIME':_0x2e5a('0x5b'),'DATE':_0x2e5a('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x2e5a('0x5d'),'UNIX_TIMESTAMP':_0x2e5a('0x5e')};var _0x2caba6=function(_0x3b3d7f){return!_['includes']([_0x2e5a('0x5f'),_0x2e5a('0x60'),_0x2e5a('0x61'),_0x2e5a('0x62')],_0x3b3d7f);};var _0x5452da=function(_0x2c1717){if(!_0x2c1717||!_0x2c1717['rules'][_0x2e5a('0x43')]){return'';}for(var _0x5ef0bc='(',_0x409211=0x0;_0x409211<_0x2c1717[_0x2e5a('0x63')]['length'];_0x409211+=0x1){_0x409211>0x0&&(_0x5ef0bc+='\x20'+_0x2c1717[_0x2e5a('0x64')]+'\x20');_0x5ef0bc+=_0x2c1717[_0x2e5a('0x63')][_0x409211][_0x2e5a('0x65')]?_0x5452da(_0x2c1717['rules'][_0x409211][_0x2e5a('0x65')]):_0x2c1717[_0x2e5a('0x63')][_0x409211][_0x2e5a('0x66')]+'\x20'+_0x2c1717[_0x2e5a('0x63')][_0x409211][_0x2e5a('0x67')]+(_0x2caba6(_0x2c1717[_0x2e5a('0x63')][_0x409211]['condition'])?'\x20'+_0x2c1717[_0x2e5a('0x63')][_0x409211]['value']:'');}return _0x5ef0bc+')';};var _0x25acb6={'where':{'id':_0x13d757[_0x2e5a('0x42')]['id']}},_0x44f52c,_0x5a6047,_0x5279f1,_0x27f95e,_0x1545c8;_0x25acb6=_['merge']({},_0x25acb6,_0x13d757[_0x2e5a('0x3d')]);return db['AnalyticCustomReport'][_0x2e5a('0x46')](_0x25acb6)[_0x2e5a('0x21')](function(_0x346649){if(_0x346649){_0x44f52c=_0x346649;return _0x346649['getFields']();}return null;})[_0x2e5a('0x21')](function(_0x4e64a2){if(_0x4e64a2){if(!_0x4e64a2[_0x2e5a('0x43')]){throw new db['Sequelize'][(_0x2e5a('0x68'))](_0x2e5a('0x69'),0x193);}_0x5a6047=_0x4e64a2;return db['AnalyticMetric'][_0x2e5a('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x32cfd1){if(_0x32cfd1){_0x5279f1=_[_0x2e5a('0x6a')](_0x32cfd1,'id');var _0x261f91;var _0x556ddf=squel['select']();_0x556ddf['from'](_0x44f52c['table']);for(var _0x3aa46c=0x0;_0x3aa46c<_0x5a6047[_0x2e5a('0x43')];_0x3aa46c+=0x1){_0x261f91=_0x5a6047[_0x3aa46c]['MetricId']?_0x5279f1[_0x5a6047[_0x3aa46c]['MetricId']][_0x2e5a('0x6b')]:_0x5a6047[_0x3aa46c][_0x2e5a('0x66')];_0x261f91=_0x5a6047[_0x3aa46c][_0x2e5a('0x6c')]?_[_0x2e5a('0x6d')](_0x6919ca[_0x5a6047[_0x3aa46c]['function']],'%s',_0x261f91):_0x261f91;_0x261f91=_0x5a6047[_0x3aa46c]['format']?_[_0x2e5a('0x6d')](_0x254169[_0x5a6047[_0x3aa46c][_0x2e5a('0x6e')]],'%s',_0x261f91):_0x261f91;if(_0x5a6047[_0x3aa46c]['groupBy']){_0x556ddf[_0x2e5a('0x65')](_0x261f91);}_0x5a6047[_0x3aa46c][_0x2e5a('0x6f')]&&_0x556ddf[_0x2e5a('0x38')](_0x261f91,_0x5a6047[_0x3aa46c][_0x2e5a('0x6f')]===_0x2e5a('0x70')?![]:!![]);_0x556ddf[_0x2e5a('0x66')](_0x261f91,_0x5a6047[_0x3aa46c][_0x2e5a('0x71')]||_0x261f91);}if(_0x44f52c['joins']){_0x44f52c['joins']=JSON[_0x2e5a('0x72')](_0x44f52c['joins']);for(var _0x3a05eb=0x0;_0x3a05eb<_0x44f52c['joins'][_0x2e5a('0x43')];_0x3a05eb+=0x1){if(_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x2d')]&&_[_0x2e5a('0x74')](_0x50a53a,_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x2d')])&&_0x44f52c['joins'][_0x3a05eb][_0x2e5a('0x75')]&&_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x76')]&&_0x44f52c['joins'][_0x3a05eb][_0x2e5a('0x77')]){_0x556ddf[_0x44f52c[_0x2e5a('0x73')][_0x3a05eb]['type']](_0x44f52c['joins'][_0x3a05eb]['foreignTable'],null,util[_0x2e5a('0x6e')](_0x2e5a('0x78'),_0x44f52c[_0x2e5a('0x79')],_0x44f52c[_0x2e5a('0x73')][_0x3a05eb][_0x2e5a('0x75')],_0x44f52c['joins'][_0x3a05eb]['foreignTable'],_0x44f52c['joins'][_0x3a05eb]['foreignKey']));}}}if(_0x44f52c['conditions']){_0x44f52c[_0x2e5a('0x7a')]=JSON[_0x2e5a('0x72')](_0x44f52c[_0x2e5a('0x7a')]);_0x556ddf['where'](_0x5452da(_0x44f52c[_0x2e5a('0x7a')]['group']));}_0x1545c8=_0x556ddf[_0x2e5a('0x7b')]();_0x556ddf['limit'](_0x3ce217);_0x556ddf[_0x2e5a('0x16')](0x0);logger[_0x2e5a('0x7c')](_0x2e5a('0x7d'),_0x556ddf['toString']());return dbH[_0x2e5a('0x7e')]['query'](_0x556ddf[_0x2e5a('0x7f')](),{'type':dbH[_0x2e5a('0x7e')][_0x2e5a('0x80')]['SELECT']});}})[_0x2e5a('0x21')](respondWithResult(_0x5045b2,null))[_0x2e5a('0x40')](handleError(_0x5045b2,null));};function runReport(_0x190061,_0x4c94cc,_0x4c2280){var _0x1aa6b5=_0x4c94cc['name'];var _0x158e81=0xa;var _0x2e451f=[_0x2e5a('0x52'),'left_join',_0x2e5a('0x54'),'cross_join'];var _0x25c356={'SUM':_0x2e5a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2e5a('0x57'),'MAX':_0x2e5a('0x58'),'MIN':_0x2e5a('0x81'),'AVG':_0x2e5a('0x59'),'GROUP_CONCAT':_0x2e5a('0x82'),'GROUP_CONCAT ASC':_0x2e5a('0x5a'),'GROUP_CONCAT DESC':_0x2e5a('0x83')};var _0x218984={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2e5a('0x5c'),'HOUR':_0x2e5a('0x84'),'ROUND':_0x2e5a('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485582=function(_0x120da8){return!_[_0x2e5a('0x74')](['IS\x20NULL',_0x2e5a('0x60'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x120da8);};var _0x2bb374=function(_0x36ed6c){if(!_0x36ed6c||!_0x36ed6c[_0x2e5a('0x63')][_0x2e5a('0x43')]){return'';}for(var _0x1bbc14='(',_0x522ea7=0x0;_0x522ea7<_0x36ed6c[_0x2e5a('0x63')][_0x2e5a('0x43')];_0x522ea7+=0x1){_0x522ea7>0x0&&(_0x1bbc14+='\x20'+_0x36ed6c[_0x2e5a('0x64')]+'\x20');_0x1bbc14+=_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x65')]?_0x2bb374(_0x36ed6c['rules'][_0x522ea7][_0x2e5a('0x65')]):_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x66')]+'\x20'+_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x67')]+(_0x485582(_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x67')])?'\x20'+_0x36ed6c[_0x2e5a('0x63')][_0x522ea7][_0x2e5a('0x85')]:'');}return _0x1bbc14+')';};var _0x53a675={'where':{'id':_0x190061['id']}},_0x514c81,_0x310c50,_0x18df2d,_0x573dae,_0x2e01cf;_0x53a675=_[_0x2e5a('0x45')]({},_0x53a675,_0x4c2280);return db[_0x2e5a('0x2b')][_0x2e5a('0x46')](_0x53a675)[_0x2e5a('0x21')](function(_0x5e78dd){if(_0x5e78dd){_0x514c81=_0x5e78dd;return _0x5e78dd[_0x2e5a('0x86')]();}return null;})['then'](function(_0x2c83f6){if(_0x2c83f6){if(!_0x2c83f6[_0x2e5a('0x43')]){throw new db[(_0x2e5a('0x87'))][(_0x2e5a('0x68'))](_0x2e5a('0x69'),0x193);}_0x310c50=_0x2c83f6;return db[_0x2e5a('0x88')][_0x2e5a('0x3f')]({'raw':!![]});}return null;})[_0x2e5a('0x21')](function(_0x4f329a){if(_0x4f329a){_0x18df2d=_[_0x2e5a('0x6a')](_0x4f329a,'id');var _0x13820d;var _0x92178d=squel[_0x2e5a('0x89')]();_0x92178d[_0x2e5a('0x8a')](_0x514c81['table']);for(var _0x4170bd=0x0;_0x4170bd<_0x310c50['length'];_0x4170bd+=0x1){_0x13820d=_0x310c50[_0x4170bd][_0x2e5a('0x8b')]?_0x18df2d[_0x310c50[_0x4170bd][_0x2e5a('0x8b')]][_0x2e5a('0x6b')]:_0x310c50[_0x4170bd][_0x2e5a('0x66')];_0x13820d=_0x310c50[_0x4170bd][_0x2e5a('0x6c')]?_[_0x2e5a('0x6d')](_0x25c356[_0x310c50[_0x4170bd][_0x2e5a('0x6c')]],'%s',_0x13820d):_0x13820d;_0x13820d=_0x310c50[_0x4170bd][_0x2e5a('0x6e')]?_[_0x2e5a('0x6d')](_0x218984[_0x310c50[_0x4170bd]['format']],'%s',_0x13820d):_0x13820d;if(_0x310c50[_0x4170bd]['groupBy']){_0x92178d[_0x2e5a('0x65')](_0x13820d);}_0x310c50[_0x4170bd][_0x2e5a('0x6f')]&&_0x92178d['order'](_0x13820d,_0x310c50[_0x4170bd]['orderBy']===_0x2e5a('0x70')?![]:!![]);_0x92178d['field'](_0x13820d,_0x310c50[_0x4170bd]['alias']||_0x13820d);}if(_0x514c81[_0x2e5a('0x73')]){_0x514c81['joins']=JSON[_0x2e5a('0x72')](_0x514c81[_0x2e5a('0x73')]);for(var _0x2fe56f=0x0;_0x2fe56f<_0x514c81[_0x2e5a('0x73')]['length'];_0x2fe56f+=0x1){if(_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x2d')]&&_[_0x2e5a('0x74')](_0x2e451f,_0x514c81[_0x2e5a('0x73')][_0x2fe56f]['type'])&&_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x75')]&&_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x76')]&&_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x77')]){_0x92178d[_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x2d')]](_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x76')],null,util[_0x2e5a('0x6e')](_0x2e5a('0x78'),_0x514c81[_0x2e5a('0x79')],_0x514c81['joins'][_0x2fe56f][_0x2e5a('0x75')],_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x76')],_0x514c81[_0x2e5a('0x73')][_0x2fe56f][_0x2e5a('0x77')]));}}}if(_0x514c81['conditions']){_0x514c81[_0x2e5a('0x7a')]=JSON[_0x2e5a('0x72')](_0x514c81[_0x2e5a('0x7a')]);_0x92178d['where'](_0x2bb374(_0x514c81[_0x2e5a('0x7a')][_0x2e5a('0x65')]));}_0x2e01cf=_0x92178d[_0x2e5a('0x7b')]();_0x92178d[_0x2e5a('0x18')](_0x158e81);_0x92178d['offset'](0x0);return;}})[_0x2e5a('0x21')](function(){if(_0x4c94cc[_0x2e5a('0x8c')]===_0x2e5a('0x8d')){return null;}var _0x526ddb=_[_0x2e5a('0x45')](_0x4c94cc,{'name':_0x4c94cc[_0x2e5a('0x8e')]||_0x4c94cc[_0x2e5a('0x28')]||_0x514c81[_0x2e5a('0x28')],'basename':_0x1aa6b5,'savename':util[_0x2e5a('0x6e')]('%s-%s.%s',_0x4c94cc['name']||_0x514c81['name'],require(_0x2e5a('0x8f'))['generate'](0x4),_0x4c94cc[_0x2e5a('0x8c')]||'csv'),'reportId':_0x514c81['id'],'reportType':'custom'});return db[_0x2e5a('0x90')][_0x2e5a('0x47')](_0x526ddb,{'raw':!![]});})[_0x2e5a('0x21')](function(_0x1f49a6){if(_0x514c81[_0x2e5a('0x79')]==='cdr'){_0x2e01cf[_0x2e5a('0x3a')](_0x514c81[_0x2e5a('0x79')]+_0x2e5a('0x91'),_0x4c94cc['startDate'],_0x4c94cc[_0x2e5a('0x92')]);}else{_0x2e01cf[_0x2e5a('0x3a')](_0x514c81['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4c94cc['startDate'],_0x4c94cc[_0x2e5a('0x92')]);}if(_0x1f49a6){logger['info'](_0x2e5a('0x93'),_0x2e01cf[_0x2e5a('0x7f')]());require(_0x2e5a('0x94'))[_0x2e5a('0x95')](path[_0x2e5a('0x52')](__dirname,_0x2e5a('0x96'),_0x1f49a6['output']),[_0x1f49a6['id'],_0x2e01cf[_0x2e5a('0x7f')](),path[_0x2e5a('0x52')](__dirname,'../../files/reports',_0x1f49a6[_0x2e5a('0x97')]),_0x1aa6b5]);return _0x1f49a6;}else{var _0xdb45e8=squel['select']();_0xdb45e8['from']('('+_0x2e01cf['toString']()+')',_0x2e5a('0x98'));_0xdb45e8['field'](_0x2e5a('0x99'),_0x2e5a('0x19'));_0x2e01cf[_0x2e5a('0x18')](_0x4c94cc['limit']||_0x158e81);_0x2e01cf[_0x2e5a('0x16')](_0x4c94cc['offset']||0x0);return dbH[_0x2e5a('0x7e')][_0x2e5a('0x2f')](_0xdb45e8[_0x2e5a('0x7f')](),{'type':dbH[_0x2e5a('0x7e')][_0x2e5a('0x80')][_0x2e5a('0x9a')]})['then'](function(_0x4d2674){if(!_0x4d2674[_0x2e5a('0x43')]){_0x573dae=0x0;}else{_0x573dae=_0x4d2674[0x0][_0x2e5a('0x19')]||0x0;}return dbH['sequelize'][_0x2e5a('0x2f')](_0x2e01cf[_0x2e5a('0x7f')](),{'type':dbH['sequelize'][_0x2e5a('0x80')][_0x2e5a('0x9a')]});})[_0x2e5a('0x21')](function(_0xfc3cd2){return{'rows':_0xfc3cd2||[],'count':_0x573dae};});}});}exports[_0x2e5a('0x9b')]=function(_0x6f2cf,_0x3963e5){return runReport(_0x6f2cf[_0x2e5a('0x42')],_0x6f2cf[_0x2e5a('0x2f')],_0x6f2cf[_0x2e5a('0x3d')])[_0x2e5a('0x21')](respondWithResult(_0x3963e5,null))['catch'](handleError(_0x3963e5,null));};exports[_0x2e5a('0x9c')]=runReport;exports[_0x2e5a('0x2f')]=function(_0x544176,_0x2b86d8){var _0x4bbd50=0xa;var _0x16edd7=['join','left_join',_0x2e5a('0x54'),'cross_join'];var _0x447cdc={'SUM':_0x2e5a('0x56'),'COUNT':_0x2e5a('0x9d'),'COUNT DISTINCT':_0x2e5a('0x57'),'MAX':_0x2e5a('0x58'),'MIN':_0x2e5a('0x81'),'AVG':_0x2e5a('0x59'),'GROUP_CONCAT':_0x2e5a('0x82'),'GROUP_CONCAT ASC':_0x2e5a('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x13312e={'SEC_TO_TIME':_0x2e5a('0x5b'),'DATE':'DATE(%s)','HOUR':_0x2e5a('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x56e9a7=function(_0x4e8b3a){return!_[_0x2e5a('0x74')](['IS\x20NULL',_0x2e5a('0x60'),'IS\x20EMPTY',_0x2e5a('0x62')],_0x4e8b3a);};var _0xb34b1d=function(_0x44ace1){if(!_0x44ace1||!_0x44ace1[_0x2e5a('0x63')][_0x2e5a('0x43')]){return'';}for(var _0x4c4f06='(',_0x31e6ee=0x0;_0x31e6ee<_0x44ace1[_0x2e5a('0x63')][_0x2e5a('0x43')];_0x31e6ee+=0x1){_0x31e6ee>0x0&&(_0x4c4f06+='\x20'+_0x44ace1[_0x2e5a('0x64')]+'\x20');_0x4c4f06+=_0x44ace1['rules'][_0x31e6ee]['group']?_0xb34b1d(_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x65')]):_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x66')]+'\x20'+_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x67')]+(_0x56e9a7(_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x67')])?'\x20'+_0x44ace1[_0x2e5a('0x63')][_0x31e6ee][_0x2e5a('0x85')]:'');}return _0x4c4f06+')';};var _0x4a9b7f={'where':{'id':_0x544176['params']['id']}},_0x44f2a2,_0x24d564,_0x1dc4a8,_0x8c6804,_0x191101;_0x4a9b7f=_['merge']({},_0x4a9b7f,_0x544176[_0x2e5a('0x3d')]);return db[_0x2e5a('0x2b')][_0x2e5a('0x46')](_0x4a9b7f)['then'](function(_0x534da3){if(_0x534da3){_0x44f2a2=_0x534da3;return _0x534da3[_0x2e5a('0x86')]();}return null;})[_0x2e5a('0x21')](function(_0x1fe5d3){if(_0x1fe5d3){if(!_0x1fe5d3[_0x2e5a('0x43')]){throw new db['Sequelize'][(_0x2e5a('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x24d564=_0x1fe5d3;return db[_0x2e5a('0x88')][_0x2e5a('0x3f')]({'raw':!![]});}return null;})[_0x2e5a('0x21')](function(_0x5df8dd){if(_0x5df8dd){_0x1dc4a8=_[_0x2e5a('0x6a')](_0x5df8dd,'id');var _0x4f3305;var _0x5e6445=squel['select']();_0x5e6445[_0x2e5a('0x8a')](_0x44f2a2['table']);for(var _0x5af953=0x0;_0x5af953<_0x24d564['length'];_0x5af953+=0x1){_0x4f3305=_0x24d564[_0x5af953][_0x2e5a('0x8b')]?_0x1dc4a8[_0x24d564[_0x5af953][_0x2e5a('0x8b')]]['metric']:_0x24d564[_0x5af953]['field'];_0x4f3305=_0x24d564[_0x5af953][_0x2e5a('0x6c')]?_[_0x2e5a('0x6d')](_0x447cdc[_0x24d564[_0x5af953]['function']],'%s',_0x4f3305):_0x4f3305;_0x4f3305=_0x24d564[_0x5af953][_0x2e5a('0x6e')]?_[_0x2e5a('0x6d')](_0x13312e[_0x24d564[_0x5af953][_0x2e5a('0x6e')]],'%s',_0x4f3305):_0x4f3305;if(_0x24d564[_0x5af953][_0x2e5a('0x9e')]){_0x5e6445[_0x2e5a('0x65')](_0x4f3305);}_0x24d564[_0x5af953][_0x2e5a('0x6f')]&&_0x5e6445['order'](_0x4f3305,_0x24d564[_0x5af953][_0x2e5a('0x6f')]==='DESC'?![]:!![]);_0x5e6445[_0x2e5a('0x66')](_0x4f3305,_0x24d564[_0x5af953][_0x2e5a('0x71')]||_0x4f3305);}if(_0x44f2a2[_0x2e5a('0x73')]){_0x44f2a2['joins']=JSON[_0x2e5a('0x72')](_0x44f2a2[_0x2e5a('0x73')]);for(var _0x28277d=0x0;_0x28277d<_0x44f2a2[_0x2e5a('0x73')][_0x2e5a('0x43')];_0x28277d+=0x1){if(_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x2d')]&&_[_0x2e5a('0x74')](_0x16edd7,_0x44f2a2[_0x2e5a('0x73')][_0x28277d]['type'])&&_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x75')]&&_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x76')]&&_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x77')]){_0x5e6445[_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x2d')]](_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x76')],null,util['format'](_0x2e5a('0x78'),_0x44f2a2[_0x2e5a('0x79')],_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x75')],_0x44f2a2[_0x2e5a('0x73')][_0x28277d][_0x2e5a('0x76')],_0x44f2a2['joins'][_0x28277d]['foreignKey']));}}}if(_0x44f2a2[_0x2e5a('0x7a')]){_0x44f2a2[_0x2e5a('0x7a')]=JSON[_0x2e5a('0x72')](_0x44f2a2[_0x2e5a('0x7a')]);_0x5e6445['where'](_0xb34b1d(_0x44f2a2[_0x2e5a('0x7a')][_0x2e5a('0x65')]));}_0x191101=_0x5e6445[_0x2e5a('0x7b')]();_0x5e6445[_0x2e5a('0x18')](_0x4bbd50);_0x5e6445[_0x2e5a('0x16')](0x0);logger[_0x2e5a('0x7c')](_0x2e5a('0x7d'),_0x5e6445[_0x2e5a('0x7f')]());return dbH[_0x2e5a('0x7e')][_0x2e5a('0x2f')](_0x5e6445[_0x2e5a('0x7f')](),{'type':dbH[_0x2e5a('0x7e')][_0x2e5a('0x80')][_0x2e5a('0x9a')]});}})[_0x2e5a('0x21')](function(){return{'sql':_0x191101[_0x2e5a('0x7f')]()};})[_0x2e5a('0x21')](respondWithResult(_0x2b86d8,null))[_0x2e5a('0x40')](handleError(_0x2b86d8,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 0c89dec..f2abf62 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 _0x97e8=['exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x4a0f37,_0x1ef8cf){var _0x40e833=function(_0x4a87da){while(--_0x4a87da){_0x4a0f37['push'](_0x4a0f37['shift']());}};_0x40e833(++_0x1ef8cf);}(_0x97e8,0xc7));var _0x897e=function(_0x1f70fe,_0x188759){_0x1f70fe=_0x1f70fe-0x0;var _0x57fe92=_0x97e8[_0x1f70fe];return _0x57fe92;};'use strict';var _=require('lodash');var util=require(_0x897e('0x0'));var logger=require(_0x897e('0x1'))(_0x897e('0x2'));var moment=require('moment');var BPromise=require(_0x897e('0x3'));var rp=require(_0x897e('0x4'));var fs=require('fs');var path=require(_0x897e('0x5'));var rimraf=require(_0x897e('0x6'));var config=require(_0x897e('0x7'));var attributes=require(_0x897e('0x8'));module[_0x897e('0x9')]=function(_0x73d9c2,_0x5074ee){return _0x73d9c2[_0x897e('0xa')](_0x897e('0xb'),attributes,{'tableName':_0x897e('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb13=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x25807b,_0x3368c0){var _0x21cd77=function(_0x187587){while(--_0x187587){_0x25807b['push'](_0x25807b['shift']());}};_0x21cd77(++_0x3368c0);}(_0xeb13,0x197));var _0x3eb1=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0xeb13[_0xa28b1a];return _0x4c9b78;};'use strict';var _=require(_0x3eb1('0x0'));var util=require(_0x3eb1('0x1'));var logger=require(_0x3eb1('0x2'))('api');var moment=require(_0x3eb1('0x3'));var BPromise=require(_0x3eb1('0x4'));var rp=require(_0x3eb1('0x5'));var fs=require('fs');var path=require(_0x3eb1('0x6'));var rimraf=require(_0x3eb1('0x7'));var config=require(_0x3eb1('0x8'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x3a8b3d,_0x5814f3){return _0x3a8b3d[_0x3eb1('0x9')](_0x3eb1('0xa'),attributes,{'tableName':_0x3eb1('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 33e355b..ab29f30 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 _0x8f24=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x59e441,_0x1119c6){var _0x3cd9de=function(_0x5c4f15){while(--_0x5c4f15){_0x59e441['push'](_0x59e441['shift']());}};_0x3cd9de(++_0x1119c6);}(_0x8f24,0x1a1));var _0x48f2=function(_0x347374,_0x2e15fe){_0x347374=_0x347374-0x0;var _0x7f6dc1=_0x8f24[_0x347374];return _0x7f6dc1;};'use strict';var _=require('lodash');var util=require(_0x48f2('0x0'));var moment=require(_0x48f2('0x1'));var BPromise=require(_0x48f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48f2('0x3'));var db=require(_0x48f2('0x4'))['db'];var utils=require(_0x48f2('0x5'));var logger=require(_0x48f2('0x6'))(_0x48f2('0x7'));var config=require(_0x48f2('0x8'));var jayson=require(_0x48f2('0x9'));var client=jayson[_0x48f2('0xa')][_0x48f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45bac7,_0x1ef8fd,_0x558431){return new BPromise(function(_0x298a95,_0x2160e1){return client['request'](_0x45bac7,_0x558431)[_0x48f2('0xc')](function(_0x4c9134){logger['info'](_0x48f2('0xd'),_0x1ef8fd,_0x48f2('0xe'));logger[_0x48f2('0xf')](_0x48f2('0x10'),_0x1ef8fd,'request\x20sent',JSON[_0x48f2('0x11')](_0x4c9134));if(_0x4c9134[_0x48f2('0x12')]){if(_0x4c9134['error'][_0x48f2('0x13')]===0x1f4){logger[_0x48f2('0x12')](_0x48f2('0xd'),_0x1ef8fd,_0x4c9134[_0x48f2('0x12')][_0x48f2('0x14')]);return _0x2160e1(_0x4c9134[_0x48f2('0x12')]['message']);}logger[_0x48f2('0x12')](_0x48f2('0xd'),_0x1ef8fd,_0x4c9134[_0x48f2('0x12')][_0x48f2('0x14')]);return _0x298a95(_0x4c9134['error']['message']);}else{logger['info'](_0x48f2('0xd'),_0x1ef8fd,_0x48f2('0xe'));_0x298a95(_0x4c9134[_0x48f2('0x15')][_0x48f2('0x14')]);}})[_0x48f2('0x16')](function(_0x527f88){logger[_0x48f2('0x12')](_0x48f2('0xd'),_0x1ef8fd,_0x527f88);_0x2160e1(_0x527f88);});});}
\ No newline at end of file
+var _0x784b=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x784b,0x171));var _0xb784=function(_0x2d443f,_0x526db0){_0x2d443f=_0x2d443f-0x0;var _0x26cdf6=_0x784b[_0x2d443f];return _0x26cdf6;};'use strict';var _=require(_0xb784('0x0'));var util=require(_0xb784('0x1'));var moment=require(_0xb784('0x2'));var BPromise=require(_0xb784('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb784('0x4'));var db=require(_0xb784('0x5'))['db'];var utils=require(_0xb784('0x6'));var logger=require(_0xb784('0x7'))(_0xb784('0x8'));var config=require(_0xb784('0x9'));var jayson=require(_0xb784('0xa'));var client=jayson[_0xb784('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x346a0e,_0x37b9a4,_0x364ad0){return new BPromise(function(_0x76b1ed,_0x61170b){return client[_0xb784('0xc')](_0x346a0e,_0x364ad0)[_0xb784('0xd')](function(_0x4ffc38){logger[_0xb784('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x37b9a4,_0xb784('0xf'));logger[_0xb784('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x37b9a4,_0xb784('0xf'),JSON[_0xb784('0x11')](_0x4ffc38));if(_0x4ffc38['error']){if(_0x4ffc38[_0xb784('0x12')][_0xb784('0x13')]===0x1f4){logger['error'](_0xb784('0x14'),_0x37b9a4,_0x4ffc38[_0xb784('0x12')]['message']);return _0x61170b(_0x4ffc38['error'][_0xb784('0x15')]);}logger[_0xb784('0x12')](_0xb784('0x14'),_0x37b9a4,_0x4ffc38['error']['message']);return _0x76b1ed(_0x4ffc38[_0xb784('0x12')]['message']);}else{logger[_0xb784('0xe')](_0xb784('0x14'),_0x37b9a4,_0xb784('0xf'));_0x76b1ed(_0x4ffc38[_0xb784('0x16')]['message']);}})['catch'](function(_0x581951){logger[_0xb784('0x12')](_0xb784('0x14'),_0x37b9a4,_0x581951);_0x61170b(_0x581951);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index cab01f8..eb2b46e 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 _0x1e13=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put','delete'];(function(_0x65c7c6,_0x7ed6f0){var _0x4307fc=function(_0x5c77a9){while(--_0x5c77a9){_0x65c7c6['push'](_0x65c7c6['shift']());}};_0x4307fc(++_0x7ed6f0);}(_0x1e13,0xa1));var _0x31e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1e13[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x31e1('0x0'));var path=require(_0x31e1('0x1'));var timeout=require(_0x31e1('0x2'));var express=require(_0x31e1('0x3'));var router=express[_0x31e1('0x4')]();var fs_extra=require(_0x31e1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x31e1('0x6'));var config=require('../../config/environment');var controller=require(_0x31e1('0x7'));router[_0x31e1('0x8')]('/',auth[_0x31e1('0x9')](),controller['index']);router[_0x31e1('0x8')](_0x31e1('0xa'),auth[_0x31e1('0x9')](),controller[_0x31e1('0xb')]);router[_0x31e1('0x8')](_0x31e1('0xc'),auth[_0x31e1('0x9')](),controller[_0x31e1('0xd')]);router[_0x31e1('0x8')](_0x31e1('0xe'),auth[_0x31e1('0x9')](),controller['run']);router['get'](_0x31e1('0xf'),auth[_0x31e1('0x9')](),controller['query']);router['post']('/',auth[_0x31e1('0x9')](),controller[_0x31e1('0x10')]);router[_0x31e1('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x31e1('0x12')](_0x31e1('0xa'),auth[_0x31e1('0x9')](),controller[_0x31e1('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x0cfb=['/:id/run','run','/:id/query','query','post','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x0cfb,0x162));var _0xb0cf=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0cfb[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xb0cf('0x0'));var util=require('util');var path=require(_0xb0cf('0x1'));var timeout=require(_0xb0cf('0x2'));var express=require(_0xb0cf('0x3'));var router=express['Router']();var fs_extra=require(_0xb0cf('0x4'));var auth=require(_0xb0cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb0cf('0x6'));var controller=require(_0xb0cf('0x7'));router[_0xb0cf('0x8')]('/',auth[_0xb0cf('0x9')](),controller['index']);router[_0xb0cf('0x8')](_0xb0cf('0xa'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0xb')]);router[_0xb0cf('0x8')](_0xb0cf('0xc'),auth['isAuthenticated'](),controller[_0xb0cf('0xd')]);router[_0xb0cf('0x8')](_0xb0cf('0xe'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0xf')]);router[_0xb0cf('0x8')](_0xb0cf('0x10'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0x11')]);router[_0xb0cf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb0cf('0x13')](_0xb0cf('0xa'),auth[_0xb0cf('0x9')](),controller[_0xb0cf('0x14')]);router[_0xb0cf('0x15')]('/:id',auth[_0xb0cf('0x9')](),controller['destroy']);module[_0xb0cf('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 826972e..8625591 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0x2675,0x75));var _0x5267=function(_0x56a636,_0x572a55){_0x56a636=_0x56a636-0x0;var _0xb24add=_0x2675[_0x56a636];return _0xb24add;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x380c5e,_0x4d2c7b){var _0x4baaa9=function(_0x2c1720){while(--_0x2c1720){_0x380c5e['push'](_0x380c5e['shift']());}};_0x4baaa9(++_0x4d2c7b);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 5a88144..b59da93 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x4306b0,_0x3c8014){var _0x7a3254=function(_0x1f29cb){while(--_0x1f29cb){_0x4306b0['push'](_0x4306b0['shift']());}};_0x7a3254(++_0x3c8014);}(_0x31f0,0xb7));var _0x031f=function(_0x1a04de,_0x4d291d){_0x1a04de=_0x1a04de-0x0;var _0x327cd0=_0x31f0[_0x1a04de];return _0x327cd0;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x3683d1,_0x14f861){var _0x1af47f=function(_0x57786b){while(--_0x57786b){_0x3683d1['push'](_0x3683d1['shift']());}};_0x1af47f(++_0x14f861);}(_0xf494,0x1c6));var _0x4f49=function(_0x452201,_0x151be2){_0x452201=_0x452201-0x0;var _0x552d57=_0xf494[_0x452201];return _0x552d57;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 170324c..c08012b 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 _0x3aad=['rimraf','../../config/environment','./analyticDefaultReport.attributes','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2efc0f,_0x3bb8ed){var _0x432e17=function(_0x52dd3a){while(--_0x52dd3a){_0x2efc0f['push'](_0x2efc0f['shift']());}};_0x432e17(++_0x3bb8ed);}(_0x3aad,0x9c));var _0xd3aa=function(_0x75e719,_0x33c3ce){_0x75e719=_0x75e719-0x0;var _0x1fcd73=_0x3aad[_0x75e719];return _0x1fcd73;};'use strict';var _=require(_0xd3aa('0x0'));var util=require('util');var logger=require(_0xd3aa('0x1'))(_0xd3aa('0x2'));var moment=require(_0xd3aa('0x3'));var BPromise=require(_0xd3aa('0x4'));var rp=require(_0xd3aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3aa('0x6'));var config=require(_0xd3aa('0x7'));var attributes=require(_0xd3aa('0x8'));module['exports']=function(_0x88abbc,_0x587cc5){return _0x88abbc['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4226=['path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','util','../../config/logger','api','request-promise'];(function(_0x9aa177,_0x79bee0){var _0x3071ba=function(_0x1f6b5e){while(--_0x1f6b5e){_0x9aa177['push'](_0x9aa177['shift']());}};_0x3071ba(++_0x79bee0);}(_0x4226,0x114));var _0x6422=function(_0x78f30d,_0x5679e1){_0x78f30d=_0x78f30d-0x0;var _0x5ad226=_0x4226[_0x78f30d];return _0x5ad226;};'use strict';var _=require('lodash');var util=require(_0x6422('0x0'));var logger=require(_0x6422('0x1'))(_0x6422('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6422('0x3'));var fs=require('fs');var path=require(_0x6422('0x4'));var rimraf=require(_0x6422('0x5'));var config=require('../../config/environment');var attributes=require(_0x6422('0x6'));module[_0x6422('0x7')]=function(_0x5bca5f,_0xca347b){return _0x5bca5f[_0x6422('0x8')](_0x6422('0x9'),attributes,{'tableName':'analytics_default_reports','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 251f0b7..46598e4 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 _0xc2d2=['../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x41f02b,_0x2ca2f0){var _0x3411eb=function(_0x5ac22c){while(--_0x5ac22c){_0x41f02b['push'](_0x41f02b['shift']());}};_0x3411eb(++_0x2ca2f0);}(_0xc2d2,0x196));var _0x2c2d=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0xc2d2[_0x158da6];return _0x429c30;};'use strict';var _=require(_0x2c2d('0x0'));var util=require(_0x2c2d('0x1'));var moment=require(_0x2c2d('0x2'));var BPromise=require(_0x2c2d('0x3'));var rs=require(_0x2c2d('0x4'));var fs=require('fs');var Redis=require(_0x2c2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c2d('0x6'));var logger=require('../../config/logger')(_0x2c2d('0x7'));var config=require(_0x2c2d('0x8'));var jayson=require(_0x2c2d('0x9'));var client=jayson[_0x2c2d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x308eb6,_0x18b865,_0x574a7a){return new BPromise(function(_0x19820f,_0x28c3c8){return client[_0x2c2d('0xb')](_0x308eb6,_0x574a7a)[_0x2c2d('0xc')](function(_0x216293){logger[_0x2c2d('0xd')](_0x2c2d('0xe'),_0x18b865,_0x2c2d('0xf'));logger[_0x2c2d('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x18b865,_0x2c2d('0xf'),JSON[_0x2c2d('0x11')](_0x216293));if(_0x216293[_0x2c2d('0x12')]){if(_0x216293[_0x2c2d('0x12')][_0x2c2d('0x13')]===0x1f4){logger[_0x2c2d('0x12')](_0x2c2d('0xe'),_0x18b865,_0x216293[_0x2c2d('0x12')]['message']);return _0x28c3c8(_0x216293[_0x2c2d('0x12')][_0x2c2d('0x14')]);}logger[_0x2c2d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x18b865,_0x216293[_0x2c2d('0x12')][_0x2c2d('0x14')]);return _0x19820f(_0x216293['error'][_0x2c2d('0x14')]);}else{logger[_0x2c2d('0xd')](_0x2c2d('0xe'),_0x18b865,_0x2c2d('0xf'));_0x19820f(_0x216293[_0x2c2d('0x15')][_0x2c2d('0x14')]);}})[_0x2c2d('0x16')](function(_0x1d9ae7){logger[_0x2c2d('0x12')](_0x2c2d('0xe'),_0x18b865,_0x1d9ae7);_0x28c3c8(_0x1d9ae7);});});}
\ No newline at end of file
+var _0x1efa=['error','code','message','request\x20sent','result','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f14ca,_0x74d66a){var _0x5497de=function(_0x436ac9){while(--_0x436ac9){_0x5f14ca['push'](_0x5f14ca['shift']());}};_0x5497de(++_0x74d66a);}(_0x1efa,0x145));var _0xa1ef=function(_0x1e3aaf,_0x361e79){_0x1e3aaf=_0x1e3aaf-0x0;var _0x1f63c6=_0x1efa[_0x1e3aaf];return _0x1f63c6;};'use strict';var _=require(_0xa1ef('0x0'));var util=require(_0xa1ef('0x1'));var moment=require(_0xa1ef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1ef('0x3'))['db'];var utils=require(_0xa1ef('0x4'));var logger=require('../../config/logger')(_0xa1ef('0x5'));var config=require(_0xa1ef('0x6'));var jayson=require(_0xa1ef('0x7'));var client=jayson['client'][_0xa1ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4872db,_0x12e088,_0x241d6f){return new BPromise(function(_0x1a25da,_0x3685aa){return client[_0xa1ef('0x9')](_0x4872db,_0x241d6f)['then'](function(_0x3a46d2){logger[_0xa1ef('0xa')](_0xa1ef('0xb'),_0x12e088,'request\x20sent');logger[_0xa1ef('0xc')](_0xa1ef('0xd'),_0x12e088,'request\x20sent',JSON[_0xa1ef('0xe')](_0x3a46d2));if(_0x3a46d2[_0xa1ef('0xf')]){if(_0x3a46d2[_0xa1ef('0xf')][_0xa1ef('0x10')]===0x1f4){logger[_0xa1ef('0xf')](_0xa1ef('0xb'),_0x12e088,_0x3a46d2[_0xa1ef('0xf')]['message']);return _0x3685aa(_0x3a46d2[_0xa1ef('0xf')][_0xa1ef('0x11')]);}logger[_0xa1ef('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x12e088,_0x3a46d2[_0xa1ef('0xf')][_0xa1ef('0x11')]);return _0x1a25da(_0x3a46d2[_0xa1ef('0xf')]['message']);}else{logger[_0xa1ef('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x12e088,_0xa1ef('0x12'));_0x1a25da(_0x3a46d2[_0xa1ef('0x13')][_0xa1ef('0x11')]);}})['catch'](function(_0x114560){logger[_0xa1ef('0xf')](_0xa1ef('0xb'),_0x12e088,_0x114560);_0x3685aa(_0x114560);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 942ab08..e2c2196 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 _0xbe35=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x4f83b9,_0x4554fa){var _0x2387ef=function(_0x2ae04f){while(--_0x2ae04f){_0x4f83b9['push'](_0x4f83b9['shift']());}};_0x2387ef(++_0x4554fa);}(_0xbe35,0x7d));var _0x5be3=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xbe35[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0x5be3('0x0'));var util=require(_0x5be3('0x1'));var path=require(_0x5be3('0x2'));var timeout=require(_0x5be3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5be3('0x4'));var interaction=require(_0x5be3('0x5'));var config=require(_0x5be3('0x6'));var controller=require(_0x5be3('0x7'));router[_0x5be3('0x8')]('/',auth[_0x5be3('0x9')](),controller[_0x5be3('0xa')]);router[_0x5be3('0x8')](_0x5be3('0xb'),auth[_0x5be3('0x9')](),controller[_0x5be3('0xc')]);router[_0x5be3('0x8')](_0x5be3('0xd'),auth[_0x5be3('0x9')](),controller[_0x5be3('0xe')]);router[_0x5be3('0x8')](_0x5be3('0xf'),auth['isAuthenticated'](),controller[_0x5be3('0x10')]);router[_0x5be3('0x8')](_0x5be3('0x11'),auth[_0x5be3('0x9')](),controller[_0x5be3('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5be3('0x13')]);router['put'](_0x5be3('0xb'),auth['isAuthenticated'](),controller[_0x5be3('0x14')]);router[_0x5be3('0x15')](_0x5be3('0xb'),auth[_0x5be3('0x9')](),controller[_0x5be3('0x16')]);module[_0x5be3('0x17')]=router;
\ No newline at end of file
+var _0xf7ec=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','delete','destroy','exports'];(function(_0x3165cf,_0x552f9c){var _0x18455a=function(_0x59efeb){while(--_0x59efeb){_0x3165cf['push'](_0x3165cf['shift']());}};_0x18455a(++_0x552f9c);}(_0xf7ec,0x1cc));var _0xcf7e=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xf7ec[_0x47a12a];return _0x30cd40;};'use strict';var multer=require('multer');var util=require(_0xcf7e('0x0'));var path=require(_0xcf7e('0x1'));var timeout=require('connect-timeout');var express=require(_0xcf7e('0x2'));var router=express[_0xcf7e('0x3')]();var fs_extra=require(_0xcf7e('0x4'));var auth=require(_0xcf7e('0x5'));var interaction=require(_0xcf7e('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xcf7e('0x7')]('/',auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x9')]);router[_0xcf7e('0x7')](_0xcf7e('0xa'),auth['isAuthenticated'](),controller[_0xcf7e('0xb')]);router['get'](_0xcf7e('0xc'),auth[_0xcf7e('0x8')](),controller[_0xcf7e('0xd')]);router[_0xcf7e('0x7')]('/:id/run',auth[_0xcf7e('0x8')](),controller[_0xcf7e('0xe')]);router[_0xcf7e('0x7')](_0xcf7e('0xf'),auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x10')]);router[_0xcf7e('0x11')]('/',auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x12')]);router[_0xcf7e('0x13')]('/:id',auth[_0xcf7e('0x8')](),controller['update']);router[_0xcf7e('0x14')](_0xcf7e('0xa'),auth[_0xcf7e('0x8')](),controller[_0xcf7e('0x15')]);module[_0xcf7e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ac721c5..edd2349 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 _0xfad8=['Loading','manual','scheduled','UNSIGNED','moment','exports','STRING','ENUM','csv','DATE'];(function(_0x1ebc78,_0x53935a){var _0x4a08c3=function(_0x3d604d){while(--_0x3d604d){_0x1ebc78['push'](_0x1ebc78['shift']());}};_0x4a08c3(++_0x53935a);}(_0xfad8,0x68));var _0x8fad=function(_0x4ebb99,_0x150983){_0x4ebb99=_0x4ebb99-0x0;var _0x487026=_0xfad8[_0x4ebb99];return _0x487026;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8fad('0x0'));module[_0x8fad('0x1')]={'name':{'type':Sequelize[_0x8fad('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8fad('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8fad('0x3')](_0x8fad('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8fad('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8fad('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8fad('0x2')],'defaultValue':_0x8fad('0x6')},'type':{'type':Sequelize['ENUM'](_0x8fad('0x7'),_0x8fad('0x8')),'allowNull':![],'defaultValue':_0x8fad('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8fad('0x9')]},'reportType':{'type':Sequelize[_0x8fad('0x2')]}};
\ No newline at end of file
+var _0x0e21=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports'];(function(_0x393013,_0x4b40c6){var _0x3baf20=function(_0x5c45dc){while(--_0x5c45dc){_0x393013['push'](_0x393013['shift']());}};_0x3baf20(++_0x4b40c6);}(_0x0e21,0x16a));var _0x10e2=function(_0x5ebcaa,_0x639130){_0x5ebcaa=_0x5ebcaa-0x0;var _0x280fb9=_0x0e21[_0x5ebcaa];return _0x280fb9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x10e2('0x0'));module[_0x10e2('0x1')]={'name':{'type':Sequelize[_0x10e2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x10e2('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x10e2('0x3')](_0x10e2('0x4'),_0x10e2('0x5'),_0x10e2('0x6')),'allowNull':![],'defaultValue':_0x10e2('0x4')},'savename':{'type':Sequelize[_0x10e2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x10e2('0x7')]},'status':{'type':Sequelize[_0x10e2('0x2')],'defaultValue':_0x10e2('0x8')},'type':{'type':Sequelize['ENUM'](_0x10e2('0x9'),_0x10e2('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x10e2('0xb')](0xb)[_0x10e2('0xc')]},'reportType':{'type':Sequelize[_0x10e2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 92eb745..ba360bf 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 _0x187b=['query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','catch','keys','rawAttributes','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','download','basename','savename','output','existsSync','join','Sequelize','ValidationError','exists','sendStatus','server/files/reports','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','ExtractedReports','UserProfileResource','error','name','index','map','AnalyticExtractedReport','type','key'];(function(_0x3975d0,_0x4f27d0){var _0x1b1699=function(_0x3e19db){while(--_0x3e19db){_0x3975d0['push'](_0x3975d0['shift']());}};_0x1b1699(++_0x4f27d0);}(_0x187b,0x1a6));var _0xb187=function(_0x3ad049,_0xe48ae6){_0x3ad049=_0x3ad049-0x0;var _0x5b6832=_0x187b[_0x3ad049];return _0x5b6832;};'use strict';var emlformat=require(_0xb187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb187('0x1'));var jsonpatch=require(_0xb187('0x2'));var rp=require(_0xb187('0x3'));var moment=require(_0xb187('0x4'));var BPromise=require(_0xb187('0x5'));var Mustache=require(_0xb187('0x6'));var util=require(_0xb187('0x7'));var path=require(_0xb187('0x8'));var sox=require(_0xb187('0x9'));var csv=require(_0xb187('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb187('0xb'));var squel=require(_0xb187('0xc'));var crypto=require(_0xb187('0xd'));var jsforce=require(_0xb187('0xe'));var deskjs=require(_0xb187('0xf'));var toCsv=require(_0xb187('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb187('0x10'));var authService=require(_0xb187('0x11'));var qs=require(_0xb187('0x12'));var as=require(_0xb187('0x13'));var hardwareService=require(_0xb187('0x14'));var logger=require(_0xb187('0x15'))(_0xb187('0x16'));var utils=require(_0xb187('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb187('0x18'))['db'];function respondWithStatusCode(_0x24b8db,_0x79a56d){_0x79a56d=_0x79a56d||0xcc;return function(_0x184249){if(_0x184249){return _0x24b8db['sendStatus'](_0x79a56d);}return _0x24b8db[_0xb187('0x19')](_0x79a56d)[_0xb187('0x1a')]();};}function respondWithResult(_0x2ddfd2,_0x198eba){_0x198eba=_0x198eba||0xc8;return function(_0x2bff29){if(_0x2bff29){return _0x2ddfd2[_0xb187('0x19')](_0x198eba)[_0xb187('0x1b')](_0x2bff29);}};}function respondWithFilteredResult(_0x5f05dc,_0x2a13cb){return function(_0x14e189){if(_0x14e189){var _0x29cedd=typeof _0x2a13cb[_0xb187('0x1c')]===_0xb187('0x1d')&&typeof _0x2a13cb[_0xb187('0x1e')]===_0xb187('0x1d');var _0x32e112=_0x14e189[_0xb187('0x1f')];var _0x38f778=_0x29cedd?0x0:_0x2a13cb[_0xb187('0x1c')];var _0x2f7577=_0x29cedd?_0x14e189[_0xb187('0x1f')]:_0x2a13cb[_0xb187('0x1c')]+_0x2a13cb[_0xb187('0x1e')];var _0x35788f;if(_0x2f7577>=_0x32e112){_0x2f7577=_0x32e112;_0x35788f=0xc8;}else{_0x35788f=0xce;}_0x5f05dc[_0xb187('0x19')](_0x35788f);return _0x5f05dc[_0xb187('0x20')](_0xb187('0x21'),_0x38f778+'-'+_0x2f7577+'/'+_0x32e112)[_0xb187('0x1b')](_0x14e189);}return null;};}function patchUpdates(_0x36a7e6){return function(_0x25c0f5){try{jsonpatch[_0xb187('0x22')](_0x25c0f5,_0x36a7e6,!![]);}catch(_0x4c0fcb){return BPromise[_0xb187('0x23')](_0x4c0fcb);}return _0x25c0f5['save']();};}function saveUpdates(_0x385dfc,_0x28648b){return function(_0x4a1c9d){if(_0x4a1c9d){return _0x4a1c9d['update'](_0x385dfc)['then'](function(_0x38fe3e){return _0x38fe3e;});}return null;};}function removeEntity(_0x4ed8c2,_0x2ec855){return function(_0x54df6f){if(_0x54df6f){return _0x54df6f[_0xb187('0x24')]()[_0xb187('0x25')](function(){var _0x1c55bf=_0x54df6f[_0xb187('0x26')]({'plain':!![]});var _0xccc6c7=_0xb187('0x27');return db[_0xb187('0x28')][_0xb187('0x24')]({'where':{'type':_0xccc6c7,'resourceId':_0x1c55bf['id']}})[_0xb187('0x25')](function(){return _0x54df6f;});})['then'](function(){_0x4ed8c2[_0xb187('0x19')](0xcc)[_0xb187('0x1a')]();});}};}function handleEntityNotFound(_0x237704,_0x15c0f0){return function(_0xf45198){if(!_0xf45198){_0x237704['sendStatus'](0x194);}return _0xf45198;};}function handleError(_0x4306b8,_0x5d73fa){_0x5d73fa=_0x5d73fa||0x1f4;return function(_0x55aca0){logger[_0xb187('0x29')](_0x55aca0['stack']);if(_0x55aca0[_0xb187('0x2a')]){delete _0x55aca0[_0xb187('0x2a')];}_0x4306b8['status'](_0x5d73fa)['send'](_0x55aca0);};}exports[_0xb187('0x2b')]=function(_0x58db97,_0x52125a){var _0x288b3f={},_0x19f4dc={},_0xf5d4f7={'count':0x0,'rows':[]};var _0x43f3e9=_[_0xb187('0x2c')](db[_0xb187('0x2d')]['rawAttributes'],function(_0x4a9182){return{'name':_0x4a9182['fieldName'],'type':_0x4a9182[_0xb187('0x2e')][_0xb187('0x2f')]};});_0x19f4dc['model']=_['map'](_0x43f3e9,'name');_0x19f4dc[_0xb187('0x30')]=_['keys'](_0x58db97[_0xb187('0x30')]);_0x19f4dc['filters']=_[_0xb187('0x31')](_0x19f4dc[_0xb187('0x32')],_0x19f4dc[_0xb187('0x30')]);_0x288b3f[_0xb187('0x33')]=_[_0xb187('0x31')](_0x19f4dc[_0xb187('0x32')],qs['fields'](_0x58db97[_0xb187('0x30')][_0xb187('0x34')]));_0x288b3f[_0xb187('0x33')]=_0x288b3f[_0xb187('0x33')]['length']?_0x288b3f[_0xb187('0x33')]:_0x19f4dc[_0xb187('0x32')];if(!_0x58db97['query'][_0xb187('0x35')](_0xb187('0x36'))){_0x288b3f[_0xb187('0x1e')]=qs[_0xb187('0x1e')](_0x58db97['query'][_0xb187('0x1e')]);_0x288b3f[_0xb187('0x1c')]=qs['offset'](_0x58db97[_0xb187('0x30')][_0xb187('0x1c')]);}_0x288b3f[_0xb187('0x37')]=qs[_0xb187('0x38')](_0x58db97[_0xb187('0x30')][_0xb187('0x38')]);_0x288b3f[_0xb187('0x39')]=qs[_0xb187('0x3a')](_['pick'](_0x58db97['query'],_0x19f4dc['filters']),_0x43f3e9);if(_0x58db97[_0xb187('0x30')][_0xb187('0x3b')]){_0x288b3f['where']=_[_0xb187('0x3c')](_0x288b3f[_0xb187('0x39')],{'$or':_[_0xb187('0x2c')](_0x43f3e9,function(_0x411acc){if(_0x411acc[_0xb187('0x2e')]!==_0xb187('0x3d')){var _0x5bb12a={};_0x5bb12a[_0x411acc[_0xb187('0x2a')]]={'$like':'%'+_0x58db97['query'][_0xb187('0x3b')]+'%'};return _0x5bb12a;}})});}_0x288b3f=_['merge']({},_0x288b3f,_0x58db97[_0xb187('0x3e')]);var _0x4e276e={'where':_0x288b3f[_0xb187('0x39')]};return db[_0xb187('0x2d')][_0xb187('0x1f')](_0x4e276e)[_0xb187('0x25')](function(_0x531e1b){_0xf5d4f7[_0xb187('0x1f')]=_0x531e1b;if(_0x58db97['query']['includeAll']){_0x288b3f['include']=[{'all':!![]}];}return db[_0xb187('0x2d')][_0xb187('0x3f')](_0x288b3f);})[_0xb187('0x25')](function(_0x4aed1d){_0xf5d4f7['rows']=_0x4aed1d;return _0xf5d4f7;})[_0xb187('0x25')](respondWithFilteredResult(_0x52125a,_0x288b3f))[_0xb187('0x40')](handleError(_0x52125a,null));};exports['show']=function(_0x2802a8,_0x879f45){var _0x3e3079={'raw':!![],'where':{'id':_0x2802a8['params']['id']}},_0x147884={};_0x147884[_0xb187('0x32')]=_[_0xb187('0x41')](db[_0xb187('0x2d')][_0xb187('0x42')]);_0x147884['query']=_[_0xb187('0x41')](_0x2802a8[_0xb187('0x30')]);_0x147884['filters']=_['intersection'](_0x147884[_0xb187('0x32')],_0x147884['query']);_0x3e3079[_0xb187('0x33')]=_[_0xb187('0x31')](_0x147884[_0xb187('0x32')],qs[_0xb187('0x34')](_0x2802a8[_0xb187('0x30')][_0xb187('0x34')]));_0x3e3079['attributes']=_0x3e3079['attributes'][_0xb187('0x43')]?_0x3e3079['attributes']:_0x147884[_0xb187('0x32')];if(_0x2802a8['query'][_0xb187('0x44')]){_0x3e3079['include']=[{'all':!![]}];}_0x3e3079=_[_0xb187('0x3c')]({},_0x3e3079,_0x2802a8[_0xb187('0x3e')]);return db['AnalyticExtractedReport'][_0xb187('0x45')](_0x3e3079)[_0xb187('0x25')](handleEntityNotFound(_0x879f45,null))[_0xb187('0x25')](respondWithResult(_0x879f45,null))[_0xb187('0x40')](handleError(_0x879f45,null));};exports[_0xb187('0x46')]=function(_0x15c7a7,_0x43300d){return db[_0xb187('0x2d')][_0xb187('0x46')](_0x15c7a7['body'],{})['then'](function(_0x518b81){var _0x193546=_0x15c7a7[_0xb187('0x47')]['get']({'plain':!![]});if(!_0x193546)throw new Error(_0xb187('0x48'));if(_0x193546[_0xb187('0x49')]===_0xb187('0x47')){var _0x1518ca=_0x518b81[_0xb187('0x26')]({'plain':!![]});var _0x1cb794=_0xb187('0x27');return db[_0xb187('0x4a')][_0xb187('0x45')]({'where':{'name':_0x1cb794,'userProfileId':_0x193546[_0xb187('0x4b')]},'raw':!![]})['then'](function(_0x4b967d){if(_0x4b967d&&_0x4b967d[_0xb187('0x4c')]===0x0){return db[_0xb187('0x28')]['create']({'name':_0x1518ca[_0xb187('0x2a')],'resourceId':_0x1518ca['id'],'type':_0x4b967d['name'],'sectionId':_0x4b967d['id']},{})[_0xb187('0x25')](function(){return _0x518b81;});}else{return _0x518b81;}})[_0xb187('0x40')](function(_0x295522){logger[_0xb187('0x29')](_0xb187('0x4d'),_0x295522);throw _0x295522;});}return _0x518b81;})[_0xb187('0x25')](respondWithResult(_0x43300d,0xc9))[_0xb187('0x40')](handleError(_0x43300d,null));};exports[_0xb187('0x4e')]=function(_0x42eeaa,_0x38ae23){if(_0x42eeaa[_0xb187('0x4f')]['id']){delete _0x42eeaa[_0xb187('0x4f')]['id'];}return db[_0xb187('0x2d')]['find']({'where':{'id':_0x42eeaa[_0xb187('0x50')]['id']}})['then'](handleEntityNotFound(_0x38ae23,null))['then'](saveUpdates(_0x42eeaa[_0xb187('0x4f')],null))['then'](respondWithResult(_0x38ae23,null))[_0xb187('0x40')](handleError(_0x38ae23,null));};exports['destroy']=function(_0x1200e1,_0xef5419){return db[_0xb187('0x2d')][_0xb187('0x45')]({'where':{'id':_0x1200e1['params']['id']}})['then'](handleEntityNotFound(_0xef5419,null))[_0xb187('0x25')](removeEntity(_0xef5419,null))[_0xb187('0x40')](handleError(_0xef5419,null));};exports[_0xb187('0x51')]=function(_0x43ca12,_0x34d891,_0x6ac0d2){return db[_0xb187('0x2d')][_0xb187('0x45')]({'where':{'id':_0x43ca12['params']['id']},'attributes':[_0xb187('0x2a'),_0xb187('0x52'),_0xb187('0x53'),_0xb187('0x54')],'raw':!![]})[_0xb187('0x25')](handleEntityNotFound(_0x34d891,null))['then'](function(_0x186b6f){if(_0x186b6f){if(!fs[_0xb187('0x55')](path[_0xb187('0x56')](config['root'],'server/files/reports',_0x186b6f['savename']))){throw new db[(_0xb187('0x57'))][(_0xb187('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x43ca12[_0xb187('0x30')][_0xb187('0x59')]){return _0x34d891[_0xb187('0x5a')](0xc8);}return _0x34d891['download'](path['join'](config['root'],_0xb187('0x5b'),_0x186b6f[_0xb187('0x53')]),util['format'](_0xb187('0x5c'),_0x186b6f['basename']||_0x186b6f['name'],_0x186b6f[_0xb187('0x54')][_0xb187('0x5d')]()));}})[_0xb187('0x40')](handleError(_0x34d891,null));};
\ No newline at end of file
+var _0xd55c=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','error','name','index','AnalyticExtractedReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','server/files/reports','Sequelize','ValidationError','exists','join','root','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x24c89b,_0x349631){var _0x5caf2e=function(_0x5b4ae9){while(--_0x5b4ae9){_0x24c89b['push'](_0x24c89b['shift']());}};_0x5caf2e(++_0x349631);}(_0xd55c,0x11d));var _0xcd55=function(_0x1c47ad,_0x30085b){_0x1c47ad=_0x1c47ad-0x0;var _0x288777=_0xd55c[_0x1c47ad];return _0x288777;};'use strict';var emlformat=require(_0xcd55('0x0'));var rimraf=require(_0xcd55('0x1'));var zipdir=require(_0xcd55('0x2'));var jsonpatch=require(_0xcd55('0x3'));var rp=require(_0xcd55('0x4'));var moment=require(_0xcd55('0x5'));var BPromise=require(_0xcd55('0x6'));var Mustache=require(_0xcd55('0x7'));var util=require(_0xcd55('0x8'));var path=require(_0xcd55('0x9'));var sox=require('sox');var csv=require(_0xcd55('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd55('0xb'));var _=require(_0xcd55('0xc'));var squel=require(_0xcd55('0xd'));var crypto=require(_0xcd55('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcd55('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcd55('0x10'));var Papa=require(_0xcd55('0x11'));var Redis=require(_0xcd55('0x12'));var authService=require(_0xcd55('0x13'));var qs=require(_0xcd55('0x14'));var as=require(_0xcd55('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd55('0x16'))(_0xcd55('0x17'));var utils=require('../../config/utils');var config=require(_0xcd55('0x18'));var licenseUtil=require(_0xcd55('0x19'));var db=require(_0xcd55('0x1a'))['db'];function respondWithStatusCode(_0x523362,_0x6bc3b3){_0x6bc3b3=_0x6bc3b3||0xcc;return function(_0x509211){if(_0x509211){return _0x523362[_0xcd55('0x1b')](_0x6bc3b3);}return _0x523362['status'](_0x6bc3b3)[_0xcd55('0x1c')]();};}function respondWithResult(_0x202d49,_0xab2180){_0xab2180=_0xab2180||0xc8;return function(_0x539500){if(_0x539500){return _0x202d49[_0xcd55('0x1d')](_0xab2180)[_0xcd55('0x1e')](_0x539500);}};}function respondWithFilteredResult(_0x1be967,_0x29a12e){return function(_0x581df6){if(_0x581df6){var _0x252976=typeof _0x29a12e[_0xcd55('0x1f')]===_0xcd55('0x20')&&typeof _0x29a12e['limit']===_0xcd55('0x20');var _0x8b1370=_0x581df6[_0xcd55('0x21')];var _0x20d4fb=_0x252976?0x0:_0x29a12e[_0xcd55('0x1f')];var _0x3ca7e8=_0x252976?_0x581df6[_0xcd55('0x21')]:_0x29a12e[_0xcd55('0x1f')]+_0x29a12e[_0xcd55('0x22')];var _0x299632;if(_0x3ca7e8>=_0x8b1370){_0x3ca7e8=_0x8b1370;_0x299632=0xc8;}else{_0x299632=0xce;}_0x1be967[_0xcd55('0x1d')](_0x299632);return _0x1be967[_0xcd55('0x23')](_0xcd55('0x24'),_0x20d4fb+'-'+_0x3ca7e8+'/'+_0x8b1370)[_0xcd55('0x1e')](_0x581df6);}return null;};}function patchUpdates(_0x13ab91){return function(_0x46ec4b){try{jsonpatch[_0xcd55('0x25')](_0x46ec4b,_0x13ab91,!![]);}catch(_0x463e3c){return BPromise[_0xcd55('0x26')](_0x463e3c);}return _0x46ec4b[_0xcd55('0x27')]();};}function saveUpdates(_0x2b1a5b,_0x3777d2){return function(_0xe7c1d0){if(_0xe7c1d0){return _0xe7c1d0[_0xcd55('0x28')](_0x2b1a5b)[_0xcd55('0x29')](function(_0xd57442){return _0xd57442;});}return null;};}function removeEntity(_0x3d237f,_0x3188d5){return function(_0x4267c1){if(_0x4267c1){return _0x4267c1['destroy']()[_0xcd55('0x29')](function(){var _0x23929d=_0x4267c1[_0xcd55('0x2a')]({'plain':!![]});var _0x5b1fff=_0xcd55('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x5b1fff,'resourceId':_0x23929d['id']}})[_0xcd55('0x29')](function(){return _0x4267c1;});})[_0xcd55('0x29')](function(){_0x3d237f['status'](0xcc)[_0xcd55('0x1c')]();});}};}function handleEntityNotFound(_0x2e24ed,_0x286bf6){return function(_0x4fa723){if(!_0x4fa723){_0x2e24ed[_0xcd55('0x1b')](0x194);}return _0x4fa723;};}function handleError(_0x3f119a,_0x826c06){_0x826c06=_0x826c06||0x1f4;return function(_0x16047b){logger[_0xcd55('0x2c')](_0x16047b['stack']);if(_0x16047b['name']){delete _0x16047b[_0xcd55('0x2d')];}_0x3f119a['status'](_0x826c06)['send'](_0x16047b);};}exports[_0xcd55('0x2e')]=function(_0x49c701,_0x5bfe50){var _0x5922f2={},_0x3dc377={},_0x41d4bc={'count':0x0,'rows':[]};var _0x568b92=_['map'](db[_0xcd55('0x2f')]['rawAttributes'],function(_0x2ff94b){return{'name':_0x2ff94b[_0xcd55('0x30')],'type':_0x2ff94b['type'][_0xcd55('0x31')]};});_0x3dc377[_0xcd55('0x32')]=_['map'](_0x568b92,_0xcd55('0x2d'));_0x3dc377[_0xcd55('0x33')]=_['keys'](_0x49c701['query']);_0x3dc377[_0xcd55('0x34')]=_[_0xcd55('0x35')](_0x3dc377[_0xcd55('0x32')],_0x3dc377[_0xcd55('0x33')]);_0x5922f2[_0xcd55('0x36')]=_[_0xcd55('0x35')](_0x3dc377[_0xcd55('0x32')],qs[_0xcd55('0x37')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x37')]));_0x5922f2[_0xcd55('0x36')]=_0x5922f2['attributes'][_0xcd55('0x38')]?_0x5922f2[_0xcd55('0x36')]:_0x3dc377['model'];if(!_0x49c701['query'][_0xcd55('0x39')](_0xcd55('0x3a'))){_0x5922f2[_0xcd55('0x22')]=qs[_0xcd55('0x22')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x22')]);_0x5922f2[_0xcd55('0x1f')]=qs[_0xcd55('0x1f')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x1f')]);}_0x5922f2[_0xcd55('0x3b')]=qs[_0xcd55('0x3c')](_0x49c701[_0xcd55('0x33')][_0xcd55('0x3c')]);_0x5922f2[_0xcd55('0x3d')]=qs['filters'](_[_0xcd55('0x3e')](_0x49c701[_0xcd55('0x33')],_0x3dc377['filters']),_0x568b92);if(_0x49c701[_0xcd55('0x33')][_0xcd55('0x3f')]){_0x5922f2['where']=_[_0xcd55('0x40')](_0x5922f2[_0xcd55('0x3d')],{'$or':_[_0xcd55('0x41')](_0x568b92,function(_0x31a361){if(_0x31a361[_0xcd55('0x42')]!==_0xcd55('0x43')){var _0x44ad44={};_0x44ad44[_0x31a361[_0xcd55('0x2d')]]={'$like':'%'+_0x49c701['query'][_0xcd55('0x3f')]+'%'};return _0x44ad44;}})});}_0x5922f2=_['merge']({},_0x5922f2,_0x49c701[_0xcd55('0x44')]);var _0x348fce={'where':_0x5922f2[_0xcd55('0x3d')]};return db[_0xcd55('0x2f')][_0xcd55('0x21')](_0x348fce)[_0xcd55('0x29')](function(_0x4ab128){_0x41d4bc[_0xcd55('0x21')]=_0x4ab128;if(_0x49c701[_0xcd55('0x33')]['includeAll']){_0x5922f2[_0xcd55('0x45')]=[{'all':!![]}];}return db[_0xcd55('0x2f')][_0xcd55('0x46')](_0x5922f2);})[_0xcd55('0x29')](function(_0x1ddb84){_0x41d4bc[_0xcd55('0x47')]=_0x1ddb84;return _0x41d4bc;})['then'](respondWithFilteredResult(_0x5bfe50,_0x5922f2))[_0xcd55('0x48')](handleError(_0x5bfe50,null));};exports[_0xcd55('0x49')]=function(_0x9dab47,_0x3fb47c){var _0x4152c3={'raw':!![],'where':{'id':_0x9dab47[_0xcd55('0x4a')]['id']}},_0x1bab0e={};_0x1bab0e[_0xcd55('0x32')]=_[_0xcd55('0x4b')](db[_0xcd55('0x2f')]['rawAttributes']);_0x1bab0e[_0xcd55('0x33')]=_[_0xcd55('0x4b')](_0x9dab47[_0xcd55('0x33')]);_0x1bab0e[_0xcd55('0x34')]=_[_0xcd55('0x35')](_0x1bab0e[_0xcd55('0x32')],_0x1bab0e[_0xcd55('0x33')]);_0x4152c3[_0xcd55('0x36')]=_['intersection'](_0x1bab0e[_0xcd55('0x32')],qs[_0xcd55('0x37')](_0x9dab47[_0xcd55('0x33')][_0xcd55('0x37')]));_0x4152c3['attributes']=_0x4152c3[_0xcd55('0x36')][_0xcd55('0x38')]?_0x4152c3[_0xcd55('0x36')]:_0x1bab0e[_0xcd55('0x32')];if(_0x9dab47[_0xcd55('0x33')]['includeAll']){_0x4152c3[_0xcd55('0x45')]=[{'all':!![]}];}_0x4152c3=_[_0xcd55('0x40')]({},_0x4152c3,_0x9dab47[_0xcd55('0x44')]);return db[_0xcd55('0x2f')]['find'](_0x4152c3)[_0xcd55('0x29')](handleEntityNotFound(_0x3fb47c,null))[_0xcd55('0x29')](respondWithResult(_0x3fb47c,null))[_0xcd55('0x48')](handleError(_0x3fb47c,null));};exports[_0xcd55('0x4c')]=function(_0x54a95b,_0x118d0e){return db[_0xcd55('0x2f')][_0xcd55('0x4c')](_0x54a95b[_0xcd55('0x4d')],{})[_0xcd55('0x29')](function(_0x953632){var _0xdbd1e5=_0x54a95b[_0xcd55('0x4e')][_0xcd55('0x2a')]({'plain':!![]});if(!_0xdbd1e5)throw new Error(_0xcd55('0x4f'));if(_0xdbd1e5[_0xcd55('0x50')]===_0xcd55('0x4e')){var _0x34695d=_0x953632[_0xcd55('0x2a')]({'plain':!![]});var _0x143b4a=_0xcd55('0x2b');return db[_0xcd55('0x51')][_0xcd55('0x52')]({'where':{'name':_0x143b4a,'userProfileId':_0xdbd1e5['userProfileId']},'raw':!![]})[_0xcd55('0x29')](function(_0x46f4e6){if(_0x46f4e6&&_0x46f4e6[_0xcd55('0x53')]===0x0){return db[_0xcd55('0x54')]['create']({'name':_0x34695d[_0xcd55('0x2d')],'resourceId':_0x34695d['id'],'type':_0x46f4e6[_0xcd55('0x2d')],'sectionId':_0x46f4e6['id']},{})[_0xcd55('0x29')](function(){return _0x953632;});}else{return _0x953632;}})[_0xcd55('0x48')](function(_0xfc7e39){logger['error'](_0xcd55('0x55'),_0xfc7e39);throw _0xfc7e39;});}return _0x953632;})['then'](respondWithResult(_0x118d0e,0xc9))[_0xcd55('0x48')](handleError(_0x118d0e,null));};exports[_0xcd55('0x28')]=function(_0x247f21,_0x5800c8){if(_0x247f21['body']['id']){delete _0x247f21[_0xcd55('0x4d')]['id'];}return db[_0xcd55('0x2f')][_0xcd55('0x52')]({'where':{'id':_0x247f21['params']['id']}})[_0xcd55('0x29')](handleEntityNotFound(_0x5800c8,null))[_0xcd55('0x29')](saveUpdates(_0x247f21[_0xcd55('0x4d')],null))[_0xcd55('0x29')](respondWithResult(_0x5800c8,null))['catch'](handleError(_0x5800c8,null));};exports['destroy']=function(_0x2680aa,_0x31e40e){return db[_0xcd55('0x2f')][_0xcd55('0x52')]({'where':{'id':_0x2680aa[_0xcd55('0x4a')]['id']}})[_0xcd55('0x29')](handleEntityNotFound(_0x31e40e,null))[_0xcd55('0x29')](removeEntity(_0x31e40e,null))['catch'](handleError(_0x31e40e,null));};exports[_0xcd55('0x56')]=function(_0x2b654f,_0x62a445,_0x4e0f6b){return db[_0xcd55('0x2f')][_0xcd55('0x52')]({'where':{'id':_0x2b654f[_0xcd55('0x4a')]['id']},'attributes':[_0xcd55('0x2d'),_0xcd55('0x57'),'savename',_0xcd55('0x58')],'raw':!![]})['then'](handleEntityNotFound(_0x62a445,null))['then'](function(_0x6db47b){if(_0x6db47b){if(!fs['existsSync'](path['join'](config['root'],_0xcd55('0x59'),_0x6db47b['savename']))){throw new db[(_0xcd55('0x5a'))][(_0xcd55('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2b654f[_0xcd55('0x33')][_0xcd55('0x5c')]){return _0x62a445[_0xcd55('0x1b')](0xc8);}return _0x62a445['download'](path[_0xcd55('0x5d')](config[_0xcd55('0x5e')],_0xcd55('0x59'),_0x6db47b['savename']),util['format']('%s.%s',_0x6db47b['basename']||_0x6db47b[_0xcd55('0x2d')],_0x6db47b[_0xcd55('0x58')][_0xcd55('0x5f')]()));}})[_0xcd55('0x48')](handleError(_0x62a445,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index f346f71..9353c0c 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 _0xd3ff=['util','../../config/logger','request-promise','path','define','AnalyticExtractedReport','lodash'];(function(_0x24619a,_0x56413a){var _0x3e92f4=function(_0x4f81ec){while(--_0x4f81ec){_0x24619a['push'](_0x24619a['shift']());}};_0x3e92f4(++_0x56413a);}(_0xd3ff,0xdf));var _0xfd3f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd3ff[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xfd3f('0x0'));var util=require(_0xfd3f('0x1'));var logger=require(_0xfd3f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfd3f('0x3'));var fs=require('fs');var path=require(_0xfd3f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x1c9016,_0x549581){return _0x1c9016[_0xfd3f('0x5')](_0xfd3f('0x6'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e4b=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','request-promise','path','../../config/environment'];(function(_0xefd7df,_0xe44e5b){var _0x28b914=function(_0x156cdf){while(--_0x156cdf){_0xefd7df['push'](_0xefd7df['shift']());}};_0x28b914(++_0xe44e5b);}(_0x0e4b,0x145));var _0xb0e4=function(_0x3162b1,_0x14bf24){_0x3162b1=_0x3162b1-0x0;var _0x54ae57=_0x0e4b[_0x3162b1];return _0x54ae57;};'use strict';var _=require(_0xb0e4('0x0'));var util=require('util');var logger=require(_0xb0e4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb0e4('0x2'));var fs=require('fs');var path=require(_0xb0e4('0x3'));var rimraf=require('rimraf');var config=require(_0xb0e4('0x4'));var attributes=require(_0xb0e4('0x5'));module[_0xb0e4('0x6')]=function(_0x5d16e5,_0x21429e){return _0x5d16e5[_0xb0e4('0x7')](_0xb0e4('0x8'),attributes,{'tableName':_0xb0e4('0x9'),'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 402b423..7d822c9 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 _0x77b5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','util'];(function(_0xb16562,_0x515f12){var _0x4a86e2=function(_0xfe1e57){while(--_0xfe1e57){_0xb16562['push'](_0xb16562['shift']());}};_0x4a86e2(++_0x515f12);}(_0x77b5,0x107));var _0x577b=function(_0x3b8915,_0x1fbe14){_0x3b8915=_0x3b8915-0x0;var _0x455805=_0x77b5[_0x3b8915];return _0x455805;};'use strict';var _=require('lodash');var util=require(_0x577b('0x0'));var moment=require(_0x577b('0x1'));var BPromise=require(_0x577b('0x2'));var rs=require(_0x577b('0x3'));var fs=require('fs');var Redis=require(_0x577b('0x4'));var db=require(_0x577b('0x5'))['db'];var utils=require(_0x577b('0x6'));var logger=require(_0x577b('0x7'))(_0x577b('0x8'));var config=require(_0x577b('0x9'));var jayson=require(_0x577b('0xa'));var client=jayson[_0x577b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x61917f,_0x59b340,_0x32b301){return new BPromise(function(_0x1cee86,_0x1c0401){return client[_0x577b('0xc')](_0x61917f,_0x32b301)['then'](function(_0x2c8515){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x59b340,_0x577b('0xd'));logger['debug'](_0x577b('0xe'),_0x59b340,_0x577b('0xd'),JSON['stringify'](_0x2c8515));if(_0x2c8515[_0x577b('0xf')]){if(_0x2c8515[_0x577b('0xf')][_0x577b('0x10')]===0x1f4){logger[_0x577b('0xf')](_0x577b('0x11'),_0x59b340,_0x2c8515[_0x577b('0xf')]['message']);return _0x1c0401(_0x2c8515['error'][_0x577b('0x12')]);}logger['error'](_0x577b('0x11'),_0x59b340,_0x2c8515[_0x577b('0xf')][_0x577b('0x12')]);return _0x1cee86(_0x2c8515[_0x577b('0xf')][_0x577b('0x12')]);}else{logger[_0x577b('0x13')](_0x577b('0x11'),_0x59b340,_0x577b('0xd'));_0x1cee86(_0x2c8515[_0x577b('0x14')][_0x577b('0x12')]);}})[_0x577b('0x15')](function(_0x2daf15){logger[_0x577b('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x59b340,_0x2daf15);_0x1c0401(_0x2daf15);});});}
\ No newline at end of file
+var _0xdda4=['message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2deecf,_0x50aba8){var _0x2f5c1a=function(_0x1c98f2){while(--_0x1c98f2){_0x2deecf['push'](_0x2deecf['shift']());}};_0x2f5c1a(++_0x50aba8);}(_0xdda4,0x1a6));var _0x4dda=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xdda4[_0x5ecadc];return _0x565037;};'use strict';var _=require('lodash');var util=require(_0x4dda('0x0'));var moment=require('moment');var BPromise=require(_0x4dda('0x1'));var rs=require(_0x4dda('0x2'));var fs=require('fs');var Redis=require(_0x4dda('0x3'));var db=require(_0x4dda('0x4'))['db'];var utils=require(_0x4dda('0x5'));var logger=require(_0x4dda('0x6'))(_0x4dda('0x7'));var config=require(_0x4dda('0x8'));var jayson=require(_0x4dda('0x9'));var client=jayson[_0x4dda('0xa')][_0x4dda('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f7fd8,_0x335764,_0x199afc){return new BPromise(function(_0x296f64,_0x3d3ab6){return client['request'](_0x2f7fd8,_0x199afc)[_0x4dda('0xc')](function(_0x4c243a){logger['info'](_0x4dda('0xd'),_0x335764,_0x4dda('0xe'));logger[_0x4dda('0xf')](_0x4dda('0x10'),_0x335764,_0x4dda('0xe'),JSON[_0x4dda('0x11')](_0x4c243a));if(_0x4c243a[_0x4dda('0x12')]){if(_0x4c243a[_0x4dda('0x12')]['code']===0x1f4){logger[_0x4dda('0x12')](_0x4dda('0xd'),_0x335764,_0x4c243a[_0x4dda('0x12')]['message']);return _0x3d3ab6(_0x4c243a['error'][_0x4dda('0x13')]);}logger[_0x4dda('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x335764,_0x4c243a[_0x4dda('0x12')]['message']);return _0x296f64(_0x4c243a[_0x4dda('0x12')][_0x4dda('0x13')]);}else{logger['info'](_0x4dda('0xd'),_0x335764,'request\x20sent');_0x296f64(_0x4c243a['result'][_0x4dda('0x13')]);}})[_0x4dda('0x14')](function(_0x355375){logger[_0x4dda('0x12')](_0x4dda('0xd'),_0x335764,_0x355375);_0x3d3ab6(_0x355375);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 3e89b21..d921dab 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 _0x5cd1=['./analyticExtractedReport.controller','get','index','show','/:id/download','download','post','create','put','isAuthenticated','update','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x363b89,_0x2f2e75){var _0x2ffc54=function(_0x314260){while(--_0x314260){_0x363b89['push'](_0x363b89['shift']());}};_0x2ffc54(++_0x2f2e75);}(_0x5cd1,0x194));var _0x15cd=function(_0x14847e,_0x5d97ab){_0x14847e=_0x14847e-0x0;var _0x5bd792=_0x5cd1[_0x14847e];return _0x5bd792;};'use strict';var multer=require(_0x15cd('0x0'));var util=require(_0x15cd('0x1'));var path=require(_0x15cd('0x2'));var timeout=require(_0x15cd('0x3'));var express=require(_0x15cd('0x4'));var router=express[_0x15cd('0x5')]();var fs_extra=require(_0x15cd('0x6'));var auth=require(_0x15cd('0x7'));var interaction=require(_0x15cd('0x8'));var config=require(_0x15cd('0x9'));var controller=require(_0x15cd('0xa'));router[_0x15cd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15cd('0xc')]);router[_0x15cd('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x15cd('0xd')]);router[_0x15cd('0xb')](_0x15cd('0xe'),auth['isAuthenticated'](),controller[_0x15cd('0xf')]);router[_0x15cd('0x10')]('/',auth['isAuthenticated'](),controller[_0x15cd('0x11')]);router[_0x15cd('0x12')]('/:id',auth[_0x15cd('0x13')](),controller[_0x15cd('0x14')]);router['delete'](_0x15cd('0x15'),auth[_0x15cd('0x13')](),controller['destroy']);module[_0x15cd('0x16')]=router;
\ No newline at end of file
+var _0xbd1e=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2513c7,_0x30ca8f){var _0x51d34b=function(_0x35937e){while(--_0x35937e){_0x2513c7['push'](_0x2513c7['shift']());}};_0x51d34b(++_0x30ca8f);}(_0xbd1e,0x109));var _0xebd1=function(_0x5442a5,_0x4110f1){_0x5442a5=_0x5442a5-0x0;var _0x130af0=_0xbd1e[_0x5442a5];return _0x130af0;};'use strict';var multer=require(_0xebd1('0x0'));var util=require(_0xebd1('0x1'));var path=require(_0xebd1('0x2'));var timeout=require(_0xebd1('0x3'));var express=require(_0xebd1('0x4'));var router=express[_0xebd1('0x5')]();var fs_extra=require(_0xebd1('0x6'));var auth=require(_0xebd1('0x7'));var interaction=require(_0xebd1('0x8'));var config=require(_0xebd1('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0xebd1('0xa')]('/',auth[_0xebd1('0xb')](),controller[_0xebd1('0xc')]);router[_0xebd1('0xa')](_0xebd1('0xd'),auth[_0xebd1('0xb')](),controller[_0xebd1('0xe')]);router[_0xebd1('0xa')]('/:id/download',auth[_0xebd1('0xb')](),controller['download']);router[_0xebd1('0xf')]('/',auth[_0xebd1('0xb')](),controller[_0xebd1('0x10')]);router['put'](_0xebd1('0xd'),auth['isAuthenticated'](),controller[_0xebd1('0x11')]);router[_0xebd1('0x12')](_0xebd1('0xd'),auth[_0xebd1('0xb')](),controller[_0xebd1('0x13')]);module[_0xebd1('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 536eb3a..4c03256 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 _0xa1cc=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa1cc,0x105));var _0xca1c=function(_0x5e3c7b,_0x4e6e5a){_0x5e3c7b=_0x5e3c7b-0x0;var _0x1d94a0=_0xa1cc[_0x5e3c7b];return _0x1d94a0;};'use strict';var Sequelize=require(_0xca1c('0x0'));module['exports']={'field':{'type':Sequelize[_0xca1c('0x1')]},'alias':{'type':Sequelize[_0xca1c('0x2')]},'function':{'type':Sequelize[_0xca1c('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xca1c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x0fa5=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x335dda,_0x572399){var _0x3a2c49=function(_0x21f348){while(--_0x21f348){_0x335dda['push'](_0x335dda['shift']());}};_0x3a2c49(++_0x572399);}(_0x0fa5,0xa5));var _0x50fa=function(_0x295a5c,_0xfd0b5){_0x295a5c=_0x295a5c-0x0;var _0x53339e=_0x0fa5[_0x295a5c];return _0x53339e;};'use strict';var Sequelize=require(_0x50fa('0x0'));module[_0x50fa('0x1')]={'field':{'type':Sequelize[_0x50fa('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x50fa('0x3')]},'groupBy':{'type':Sequelize[_0x50fa('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x50fa('0x3')]},'custom':{'type':Sequelize[_0x50fa('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index c64865e..9c095f3 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 _0x2239=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','set','json','reject','update','then','destroy','name','index','AnalyticFieldReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','create','body','bulkCreate','find','bulkDestroy','addFields','findOne','sequelize','transaction','CustomReportId'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x2239,0x18b));var _0x9223=function(_0x1ad589,_0x11d461){_0x1ad589=_0x1ad589-0x0;var _0x5ecf6c=_0x2239[_0x1ad589];return _0x5ecf6c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9223('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9223('0x1'));var rp=require(_0x9223('0x2'));var moment=require(_0x9223('0x3'));var BPromise=require(_0x9223('0x4'));var Mustache=require(_0x9223('0x5'));var util=require(_0x9223('0x6'));var path=require('path');var sox=require(_0x9223('0x7'));var csv=require(_0x9223('0x8'));var ejs=require(_0x9223('0x9'));var fs=require('fs');var fs_extra=require(_0x9223('0xa'));var _=require(_0x9223('0xb'));var squel=require(_0x9223('0xc'));var crypto=require('crypto');var jsforce=require(_0x9223('0xd'));var deskjs=require(_0x9223('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9223('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9223('0x10'));var qs=require(_0x9223('0x11'));var as=require(_0x9223('0x12'));var hardwareService=require(_0x9223('0x13'));var logger=require(_0x9223('0x14'))(_0x9223('0x15'));var utils=require('../../config/utils');var config=require(_0x9223('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9223('0x17'))['db'];function respondWithStatusCode(_0x2e03c9,_0x3cb16b){_0x3cb16b=_0x3cb16b||0xcc;return function(_0x34d0a7){if(_0x34d0a7){return _0x2e03c9[_0x9223('0x18')](_0x3cb16b);}return _0x2e03c9['status'](_0x3cb16b)[_0x9223('0x19')]();};}function respondWithResult(_0x3926d5,_0x88f93c){_0x88f93c=_0x88f93c||0xc8;return function(_0x2970a9){if(_0x2970a9){return _0x3926d5['status'](_0x88f93c)['json'](_0x2970a9);}};}function respondWithFilteredResult(_0x2c5a0e,_0x88db4a){return function(_0x2c1817){if(_0x2c1817){var _0x2b14bf=typeof _0x88db4a['offset']===_0x9223('0x1a')&&typeof _0x88db4a['limit']==='undefined';var _0x5ce7ad=_0x2c1817[_0x9223('0x1b')];var _0x42e7e8=_0x2b14bf?0x0:_0x88db4a[_0x9223('0x1c')];var _0xaaad6d=_0x2b14bf?_0x2c1817[_0x9223('0x1b')]:_0x88db4a[_0x9223('0x1c')]+_0x88db4a[_0x9223('0x1d')];var _0x4bc9c4;if(_0xaaad6d>=_0x5ce7ad){_0xaaad6d=_0x5ce7ad;_0x4bc9c4=0xc8;}else{_0x4bc9c4=0xce;}_0x2c5a0e[_0x9223('0x1e')](_0x4bc9c4);return _0x2c5a0e[_0x9223('0x1f')]('Content-Range',_0x42e7e8+'-'+_0xaaad6d+'/'+_0x5ce7ad)[_0x9223('0x20')](_0x2c1817);}return null;};}function patchUpdates(_0x47a9fc){return function(_0x110318){try{jsonpatch['apply'](_0x110318,_0x47a9fc,!![]);}catch(_0x3f6a24){return BPromise[_0x9223('0x21')](_0x3f6a24);}return _0x110318['save']();};}function saveUpdates(_0x667c30,_0x401e3e){return function(_0x18148c){if(_0x18148c){return _0x18148c[_0x9223('0x22')](_0x667c30)[_0x9223('0x23')](function(_0x5724f7){return _0x5724f7;});}return null;};}function removeEntity(_0x741262,_0xe3d65a){return function(_0x3869e4){if(_0x3869e4){return _0x3869e4[_0x9223('0x24')]()[_0x9223('0x23')](function(){_0x741262[_0x9223('0x1e')](0xcc)[_0x9223('0x19')]();});}};}function handleEntityNotFound(_0x23397b,_0x4287c9){return function(_0x586bf1){if(!_0x586bf1){_0x23397b[_0x9223('0x18')](0x194);}return _0x586bf1;};}function handleError(_0x509e96,_0x5026b0){_0x5026b0=_0x5026b0||0x1f4;return function(_0x5e662f){logger['error'](_0x5e662f['stack']);if(_0x5e662f[_0x9223('0x25')]){delete _0x5e662f[_0x9223('0x25')];}_0x509e96[_0x9223('0x1e')](_0x5026b0)['send'](_0x5e662f);};}exports[_0x9223('0x26')]=function(_0x4d8b54,_0x11504d){var _0x43e147={},_0x338c6b={},_0x35c9e3={'count':0x0,'rows':[]};var _0x521cf3=_['map'](db[_0x9223('0x27')]['rawAttributes'],function(_0xedb4ea){return{'name':_0xedb4ea[_0x9223('0x28')],'type':_0xedb4ea[_0x9223('0x29')][_0x9223('0x2a')]};});_0x338c6b[_0x9223('0x2b')]=_[_0x9223('0x2c')](_0x521cf3,_0x9223('0x25'));_0x338c6b[_0x9223('0x2d')]=_[_0x9223('0x2e')](_0x4d8b54['query']);_0x338c6b[_0x9223('0x2f')]=_[_0x9223('0x30')](_0x338c6b['model'],_0x338c6b['query']);_0x43e147[_0x9223('0x31')]=_[_0x9223('0x30')](_0x338c6b[_0x9223('0x2b')],qs['fields'](_0x4d8b54[_0x9223('0x2d')]['fields']));_0x43e147[_0x9223('0x31')]=_0x43e147['attributes'][_0x9223('0x32')]?_0x43e147[_0x9223('0x31')]:_0x338c6b[_0x9223('0x2b')];if(!_0x4d8b54[_0x9223('0x2d')]['hasOwnProperty'](_0x9223('0x33'))){_0x43e147[_0x9223('0x1d')]=qs['limit'](_0x4d8b54[_0x9223('0x2d')]['limit']);_0x43e147[_0x9223('0x1c')]=qs[_0x9223('0x1c')](_0x4d8b54[_0x9223('0x2d')]['offset']);}_0x43e147[_0x9223('0x34')]=qs[_0x9223('0x35')](_0x4d8b54[_0x9223('0x2d')][_0x9223('0x35')]);_0x43e147[_0x9223('0x36')]=qs[_0x9223('0x2f')](_[_0x9223('0x37')](_0x4d8b54[_0x9223('0x2d')],_0x338c6b[_0x9223('0x2f')]),_0x521cf3);if(_0x4d8b54[_0x9223('0x2d')][_0x9223('0x38')]){_0x43e147[_0x9223('0x36')]=_[_0x9223('0x39')](_0x43e147[_0x9223('0x36')],{'$or':_[_0x9223('0x2c')](_0x521cf3,function(_0x5c6d55){if(_0x5c6d55['type']!==_0x9223('0x3a')){var _0x1d2e00={};_0x1d2e00[_0x5c6d55[_0x9223('0x25')]]={'$like':'%'+_0x4d8b54[_0x9223('0x2d')][_0x9223('0x38')]+'%'};return _0x1d2e00;}})});}_0x43e147=_[_0x9223('0x39')]({},_0x43e147,_0x4d8b54[_0x9223('0x3b')]);var _0x5bc382={'where':_0x43e147[_0x9223('0x36')]};return db[_0x9223('0x27')]['count'](_0x5bc382)[_0x9223('0x23')](function(_0xc284a9){_0x35c9e3[_0x9223('0x1b')]=_0xc284a9;if(_0x4d8b54[_0x9223('0x2d')][_0x9223('0x3c')]){_0x43e147[_0x9223('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9223('0x3e')](_0x43e147);})[_0x9223('0x23')](function(_0x363373){_0x35c9e3[_0x9223('0x3f')]=_0x363373;return _0x35c9e3;})[_0x9223('0x23')](respondWithFilteredResult(_0x11504d,_0x43e147))[_0x9223('0x40')](handleError(_0x11504d,null));};exports[_0x9223('0x41')]=function(_0x522e4c,_0x97a781){var _0x4befad={'raw':![],'where':{'id':_0x522e4c[_0x9223('0x42')]['id']}},_0x2a2f0a={};_0x2a2f0a[_0x9223('0x2b')]=_['keys'](db[_0x9223('0x27')][_0x9223('0x43')]);_0x2a2f0a[_0x9223('0x2d')]=_[_0x9223('0x2e')](_0x522e4c['query']);_0x2a2f0a[_0x9223('0x2f')]=_[_0x9223('0x30')](_0x2a2f0a[_0x9223('0x2b')],_0x2a2f0a[_0x9223('0x2d')]);_0x4befad[_0x9223('0x31')]=_[_0x9223('0x30')](_0x2a2f0a[_0x9223('0x2b')],qs[_0x9223('0x44')](_0x522e4c[_0x9223('0x2d')]['fields']));_0x4befad['attributes']=_0x4befad[_0x9223('0x31')][_0x9223('0x32')]?_0x4befad[_0x9223('0x31')]:_0x2a2f0a[_0x9223('0x2b')];if(_0x522e4c['query'][_0x9223('0x3c')]){_0x4befad[_0x9223('0x3d')]=[{'all':!![]}];}_0x4befad=_[_0x9223('0x39')]({},_0x4befad,_0x522e4c[_0x9223('0x3b')]);return db['AnalyticFieldReport']['find'](_0x4befad)['then'](handleEntityNotFound(_0x97a781,null))[_0x9223('0x23')](respondWithResult(_0x97a781,null))[_0x9223('0x40')](handleError(_0x97a781,null));};exports[_0x9223('0x45')]=function(_0x4f5577,_0x4c8724){return db['AnalyticFieldReport'][_0x9223('0x45')](_0x4f5577[_0x9223('0x46')],{})[_0x9223('0x23')](respondWithResult(_0x4c8724,0xc9))[_0x9223('0x40')](handleError(_0x4c8724,null));};exports[_0x9223('0x47')]=function(_0x25af2e,_0xcb2add){return db[_0x9223('0x27')]['bulkCreate'](_0x25af2e[_0x9223('0x46')],{'raw':![],'individualHooks':!![]})[_0x9223('0x23')](respondWithResult(_0xcb2add,0xc9))[_0x9223('0x40')](handleError(_0xcb2add,null));};exports[_0x9223('0x22')]=function(_0x329671,_0x5063eb){if(_0x329671[_0x9223('0x46')]['id']){delete _0x329671[_0x9223('0x46')]['id'];}return db[_0x9223('0x27')]['find']({'where':{'id':_0x329671[_0x9223('0x42')]['id']}})[_0x9223('0x23')](handleEntityNotFound(_0x5063eb,null))['then'](saveUpdates(_0x329671[_0x9223('0x46')],null))['then'](respondWithResult(_0x5063eb,null))['catch'](handleError(_0x5063eb,null));};exports['destroy']=function(_0x479408,_0x40e76c){return db[_0x9223('0x27')][_0x9223('0x48')]({'where':{'id':_0x479408[_0x9223('0x42')]['id']}})[_0x9223('0x23')](handleEntityNotFound(_0x40e76c,null))[_0x9223('0x23')](removeEntity(_0x40e76c,null))[_0x9223('0x40')](handleError(_0x40e76c,null));};exports[_0x9223('0x49')]=function(_0x2d72a4,_0x2b5918){return db[_0x9223('0x27')][_0x9223('0x24')]({'where':{'id':_0x2d72a4[_0x9223('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2b5918,0xcc))[_0x9223('0x40')](handleError(_0x2b5918,null));};exports[_0x9223('0x4a')]=function(_0x575b83,_0x3ab50f,_0x5b8d24){return db['AnalyticCustomReport'][_0x9223('0x4b')]({'where':{'id':_0x575b83[_0x9223('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ab50f,null))[_0x9223('0x23')](function(_0x53caa8){if(_0x53caa8){return db[_0x9223('0x4c')][_0x9223('0x4d')](function(_0x131bcb){return db[_0x9223('0x27')]['destroy']({'where':{'CustomReportId':_0x575b83['params']['id']},'transaction':_0x131bcb})[_0x9223('0x23')](function(_0x44f256){var _0x1dd9b4=_[_0x9223('0x2c')](_0x575b83['body'],function(_0x2a3309){delete _0x2a3309['id'];_0x2a3309[_0x9223('0x4e')]=_0x575b83[_0x9223('0x42')]['id'];return _0x2a3309;});return db[_0x9223('0x27')]['bulkCreate'](_0x1dd9b4,{'transaction':_0x131bcb});});})[_0x9223('0x23')](function(){return db[_0x9223('0x27')][_0x9223('0x3e')]({'where':{'CustomReportId':_0x575b83['params']['id']}});});}})[_0x9223('0x23')](respondWithResult(_0x3ab50f,null))[_0x9223('0x40')](handleError(_0x3ab50f,null));};
\ No newline at end of file
+var _0x2dff=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','json','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','params','merge','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x43b5ff,_0x491b75){var _0x4fa086=function(_0xbd7ec3){while(--_0xbd7ec3){_0x43b5ff['push'](_0x43b5ff['shift']());}};_0x4fa086(++_0x491b75);}(_0x2dff,0x8b));var _0xf2df=function(_0x1d65e4,_0x49f4f0){_0x1d65e4=_0x1d65e4-0x0;var _0x1e7fe3=_0x2dff[_0x1d65e4];return _0x1e7fe3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2df('0x0'));var zipdir=require(_0xf2df('0x1'));var jsonpatch=require(_0xf2df('0x2'));var rp=require(_0xf2df('0x3'));var moment=require(_0xf2df('0x4'));var BPromise=require(_0xf2df('0x5'));var Mustache=require(_0xf2df('0x6'));var util=require(_0xf2df('0x7'));var path=require(_0xf2df('0x8'));var sox=require(_0xf2df('0x9'));var csv=require(_0xf2df('0xa'));var ejs=require(_0xf2df('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf2df('0xc'));var crypto=require(_0xf2df('0xd'));var jsforce=require(_0xf2df('0xe'));var deskjs=require(_0xf2df('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf2df('0x10'));var Papa=require(_0xf2df('0x11'));var Redis=require(_0xf2df('0x12'));var authService=require(_0xf2df('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf2df('0x14'));var hardwareService=require(_0xf2df('0x15'));var logger=require(_0xf2df('0x16'))(_0xf2df('0x17'));var utils=require(_0xf2df('0x18'));var config=require(_0xf2df('0x19'));var licenseUtil=require(_0xf2df('0x1a'));var db=require(_0xf2df('0x1b'))['db'];function respondWithStatusCode(_0x3e9e7a,_0x24e163){_0x24e163=_0x24e163||0xcc;return function(_0x47ab5d){if(_0x47ab5d){return _0x3e9e7a[_0xf2df('0x1c')](_0x24e163);}return _0x3e9e7a['status'](_0x24e163)[_0xf2df('0x1d')]();};}function respondWithResult(_0xaa6c2e,_0x5f1761){_0x5f1761=_0x5f1761||0xc8;return function(_0x28acb1){if(_0x28acb1){return _0xaa6c2e['status'](_0x5f1761)['json'](_0x28acb1);}};}function respondWithFilteredResult(_0x4a9484,_0x358e8a){return function(_0x2ce2de){if(_0x2ce2de){var _0x37f9b4=typeof _0x358e8a['offset']===_0xf2df('0x1e')&&typeof _0x358e8a['limit']===_0xf2df('0x1e');var _0xf524bb=_0x2ce2de[_0xf2df('0x1f')];var _0x2186a2=_0x37f9b4?0x0:_0x358e8a[_0xf2df('0x20')];var _0x4a019d=_0x37f9b4?_0x2ce2de[_0xf2df('0x1f')]:_0x358e8a[_0xf2df('0x20')]+_0x358e8a[_0xf2df('0x21')];var _0x232d9e;if(_0x4a019d>=_0xf524bb){_0x4a019d=_0xf524bb;_0x232d9e=0xc8;}else{_0x232d9e=0xce;}_0x4a9484[_0xf2df('0x22')](_0x232d9e);return _0x4a9484['set']('Content-Range',_0x2186a2+'-'+_0x4a019d+'/'+_0xf524bb)[_0xf2df('0x23')](_0x2ce2de);}return null;};}function patchUpdates(_0xbab6d2){return function(_0x16ee71){try{jsonpatch['apply'](_0x16ee71,_0xbab6d2,!![]);}catch(_0x1b81e8){return BPromise[_0xf2df('0x24')](_0x1b81e8);}return _0x16ee71[_0xf2df('0x25')]();};}function saveUpdates(_0x839925,_0x3a4337){return function(_0x30ac4b){if(_0x30ac4b){return _0x30ac4b[_0xf2df('0x26')](_0x839925)[_0xf2df('0x27')](function(_0x27c17e){return _0x27c17e;});}return null;};}function removeEntity(_0x3389f6,_0x1caa88){return function(_0x191419){if(_0x191419){return _0x191419[_0xf2df('0x28')]()[_0xf2df('0x27')](function(){_0x3389f6[_0xf2df('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40b1b9,_0x5a2299){return function(_0x141ce6){if(!_0x141ce6){_0x40b1b9[_0xf2df('0x1c')](0x194);}return _0x141ce6;};}function handleError(_0x3fb4f1,_0x400cbc){_0x400cbc=_0x400cbc||0x1f4;return function(_0x6a7373){logger[_0xf2df('0x29')](_0x6a7373[_0xf2df('0x2a')]);if(_0x6a7373[_0xf2df('0x2b')]){delete _0x6a7373['name'];}_0x3fb4f1['status'](_0x400cbc)[_0xf2df('0x2c')](_0x6a7373);};}exports['index']=function(_0x3a739b,_0x37d607){var _0x4f8f87={},_0x277bbd={},_0x2ccffe={'count':0x0,'rows':[]};var _0x37c6b6=_[_0xf2df('0x2d')](db[_0xf2df('0x2e')]['rawAttributes'],function(_0x1c98c9){return{'name':_0x1c98c9['fieldName'],'type':_0x1c98c9[_0xf2df('0x2f')]['key']};});_0x277bbd[_0xf2df('0x30')]=_[_0xf2df('0x2d')](_0x37c6b6,_0xf2df('0x2b'));_0x277bbd[_0xf2df('0x31')]=_[_0xf2df('0x32')](_0x3a739b[_0xf2df('0x31')]);_0x277bbd[_0xf2df('0x33')]=_[_0xf2df('0x34')](_0x277bbd[_0xf2df('0x30')],_0x277bbd[_0xf2df('0x31')]);_0x4f8f87[_0xf2df('0x35')]=_[_0xf2df('0x34')](_0x277bbd[_0xf2df('0x30')],qs[_0xf2df('0x36')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x36')]));_0x4f8f87[_0xf2df('0x35')]=_0x4f8f87['attributes'][_0xf2df('0x37')]?_0x4f8f87[_0xf2df('0x35')]:_0x277bbd[_0xf2df('0x30')];if(!_0x3a739b[_0xf2df('0x31')][_0xf2df('0x38')](_0xf2df('0x39'))){_0x4f8f87[_0xf2df('0x21')]=qs[_0xf2df('0x21')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x21')]);_0x4f8f87[_0xf2df('0x20')]=qs[_0xf2df('0x20')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x20')]);}_0x4f8f87[_0xf2df('0x3a')]=qs[_0xf2df('0x3b')](_0x3a739b[_0xf2df('0x31')][_0xf2df('0x3b')]);_0x4f8f87[_0xf2df('0x3c')]=qs[_0xf2df('0x33')](_[_0xf2df('0x3d')](_0x3a739b[_0xf2df('0x31')],_0x277bbd[_0xf2df('0x33')]),_0x37c6b6);if(_0x3a739b[_0xf2df('0x31')][_0xf2df('0x3e')]){_0x4f8f87[_0xf2df('0x3c')]=_['merge'](_0x4f8f87[_0xf2df('0x3c')],{'$or':_[_0xf2df('0x2d')](_0x37c6b6,function(_0x2110c5){if(_0x2110c5[_0xf2df('0x2f')]!==_0xf2df('0x3f')){var _0x3c2b08={};_0x3c2b08[_0x2110c5['name']]={'$like':'%'+_0x3a739b[_0xf2df('0x31')][_0xf2df('0x3e')]+'%'};return _0x3c2b08;}})});}_0x4f8f87=_['merge']({},_0x4f8f87,_0x3a739b[_0xf2df('0x40')]);var _0x5516e4={'where':_0x4f8f87[_0xf2df('0x3c')]};return db[_0xf2df('0x2e')][_0xf2df('0x1f')](_0x5516e4)[_0xf2df('0x27')](function(_0x534518){_0x2ccffe['count']=_0x534518;if(_0x3a739b[_0xf2df('0x31')][_0xf2df('0x41')]){_0x4f8f87['include']=[{'all':!![]}];}return db[_0xf2df('0x2e')]['findAll'](_0x4f8f87);})['then'](function(_0x5c800c){_0x2ccffe[_0xf2df('0x42')]=_0x5c800c;return _0x2ccffe;})[_0xf2df('0x27')](respondWithFilteredResult(_0x37d607,_0x4f8f87))[_0xf2df('0x43')](handleError(_0x37d607,null));};exports['show']=function(_0x6ee061,_0x38dbce){var _0x3e0aea={'raw':![],'where':{'id':_0x6ee061[_0xf2df('0x44')]['id']}},_0x439d72={};_0x439d72['model']=_['keys'](db[_0xf2df('0x2e')]['rawAttributes']);_0x439d72[_0xf2df('0x31')]=_[_0xf2df('0x32')](_0x6ee061[_0xf2df('0x31')]);_0x439d72['filters']=_[_0xf2df('0x34')](_0x439d72[_0xf2df('0x30')],_0x439d72[_0xf2df('0x31')]);_0x3e0aea[_0xf2df('0x35')]=_[_0xf2df('0x34')](_0x439d72['model'],qs[_0xf2df('0x36')](_0x6ee061[_0xf2df('0x31')][_0xf2df('0x36')]));_0x3e0aea[_0xf2df('0x35')]=_0x3e0aea[_0xf2df('0x35')][_0xf2df('0x37')]?_0x3e0aea[_0xf2df('0x35')]:_0x439d72[_0xf2df('0x30')];if(_0x6ee061[_0xf2df('0x31')][_0xf2df('0x41')]){_0x3e0aea['include']=[{'all':!![]}];}_0x3e0aea=_[_0xf2df('0x45')]({},_0x3e0aea,_0x6ee061[_0xf2df('0x40')]);return db['AnalyticFieldReport'][_0xf2df('0x46')](_0x3e0aea)[_0xf2df('0x27')](handleEntityNotFound(_0x38dbce,null))[_0xf2df('0x27')](respondWithResult(_0x38dbce,null))[_0xf2df('0x43')](handleError(_0x38dbce,null));};exports[_0xf2df('0x47')]=function(_0x16b1e1,_0x179510){return db[_0xf2df('0x2e')][_0xf2df('0x47')](_0x16b1e1[_0xf2df('0x48')],{})[_0xf2df('0x27')](respondWithResult(_0x179510,0xc9))[_0xf2df('0x43')](handleError(_0x179510,null));};exports[_0xf2df('0x49')]=function(_0x5d35c3,_0x2ec8de){return db['AnalyticFieldReport']['bulkCreate'](_0x5d35c3[_0xf2df('0x48')],{'raw':![],'individualHooks':!![]})[_0xf2df('0x27')](respondWithResult(_0x2ec8de,0xc9))[_0xf2df('0x43')](handleError(_0x2ec8de,null));};exports[_0xf2df('0x26')]=function(_0x575c32,_0x1d4456){if(_0x575c32[_0xf2df('0x48')]['id']){delete _0x575c32[_0xf2df('0x48')]['id'];}return db[_0xf2df('0x2e')]['find']({'where':{'id':_0x575c32[_0xf2df('0x44')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x1d4456,null))[_0xf2df('0x27')](saveUpdates(_0x575c32['body'],null))[_0xf2df('0x27')](respondWithResult(_0x1d4456,null))[_0xf2df('0x43')](handleError(_0x1d4456,null));};exports[_0xf2df('0x28')]=function(_0xf4cd87,_0x334a43){return db[_0xf2df('0x2e')]['find']({'where':{'id':_0xf4cd87[_0xf2df('0x44')]['id']}})[_0xf2df('0x27')](handleEntityNotFound(_0x334a43,null))['then'](removeEntity(_0x334a43,null))[_0xf2df('0x43')](handleError(_0x334a43,null));};exports[_0xf2df('0x4a')]=function(_0x47d797,_0x5a9a8e){return db[_0xf2df('0x2e')][_0xf2df('0x28')]({'where':{'id':_0x47d797['query'][_0xf2df('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xf2df('0x27')](respondWithResult(_0x5a9a8e,0xcc))['catch'](handleError(_0x5a9a8e,null));};exports[_0xf2df('0x4c')]=function(_0x307603,_0x5f3036,_0x4e66ec){return db[_0xf2df('0x4d')][_0xf2df('0x4e')]({'where':{'id':_0x307603[_0xf2df('0x44')]['id']}})['then'](handleEntityNotFound(_0x5f3036,null))['then'](function(_0x2e3927){if(_0x2e3927){return db[_0xf2df('0x4f')][_0xf2df('0x50')](function(_0x19e69b){return db[_0xf2df('0x2e')][_0xf2df('0x28')]({'where':{'CustomReportId':_0x307603[_0xf2df('0x44')]['id']},'transaction':_0x19e69b})['then'](function(_0x1003f4){var _0x25616e=_[_0xf2df('0x2d')](_0x307603[_0xf2df('0x48')],function(_0x27db3e){delete _0x27db3e['id'];_0x27db3e['CustomReportId']=_0x307603['params']['id'];return _0x27db3e;});return db[_0xf2df('0x2e')][_0xf2df('0x49')](_0x25616e,{'transaction':_0x19e69b});});})[_0xf2df('0x27')](function(){return db[_0xf2df('0x2e')]['findAll']({'where':{'CustomReportId':_0x307603[_0xf2df('0x44')]['id']}});});}})[_0xf2df('0x27')](respondWithResult(_0x5f3036,null))['catch'](handleError(_0x5f3036,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 85a1671..7e8a67e 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 _0x0385=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes'];(function(_0x1be186,_0x2b68b5){var _0x46038c=function(_0x10904d){while(--_0x10904d){_0x1be186['push'](_0x1be186['shift']());}};_0x46038c(++_0x2b68b5);}(_0x0385,0xca));var _0x5038=function(_0x26725b,_0x3f7880){_0x26725b=_0x26725b-0x0;var _0x39d354=_0x0385[_0x26725b];return _0x39d354;};'use strict';var _=require(_0x5038('0x0'));var util=require(_0x5038('0x1'));var logger=require(_0x5038('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5038('0x3'));var rp=require(_0x5038('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5038('0x5'));var attributes=require(_0x5038('0x6'));module[_0x5038('0x7')]=function(_0x1eb7d6,_0x31a8c9){return _0x1eb7d6[_0x5038('0x8')](_0x5038('0x9'),attributes,{'tableName':_0x5038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdcad=['bluebird','request-promise','path','../../config/environment','exports','define','AnalyticFieldReport','../../config/logger'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0xdcad,0xcf));var _0xddca=function(_0x431e6e,_0x4c4775){_0x431e6e=_0x431e6e-0x0;var _0xe20f3f=_0xdcad[_0x431e6e];return _0xe20f3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xddca('0x0'))('api');var moment=require('moment');var BPromise=require(_0xddca('0x1'));var rp=require(_0xddca('0x2'));var fs=require('fs');var path=require(_0xddca('0x3'));var rimraf=require('rimraf');var config=require(_0xddca('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0xddca('0x5')]=function(_0x4ef1e7,_0x1c1e63){return _0x4ef1e7[_0xddca('0x6')](_0xddca('0x7'),attributes,{'tableName':'analytics_report_fields','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 3f062fc..0f697e9 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 _0x413a=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4ea2d3,_0x53a3e1){var _0x83728b=function(_0x5e2309){while(--_0x5e2309){_0x4ea2d3['push'](_0x4ea2d3['shift']());}};_0x83728b(++_0x53a3e1);}(_0x413a,0x1a1));var _0xa413=function(_0x36b7dc,_0x30bb7b){_0x36b7dc=_0x36b7dc-0x0;var _0x14f36a=_0x413a[_0x36b7dc];return _0x14f36a;};'use strict';var _=require(_0xa413('0x0'));var util=require(_0xa413('0x1'));var moment=require(_0xa413('0x2'));var BPromise=require(_0xa413('0x3'));var rs=require(_0xa413('0x4'));var fs=require('fs');var Redis=require(_0xa413('0x5'));var db=require(_0xa413('0x6'))['db'];var utils=require(_0xa413('0x7'));var logger=require('../../config/logger')(_0xa413('0x8'));var config=require(_0xa413('0x9'));var jayson=require(_0xa413('0xa'));var client=jayson[_0xa413('0xb')][_0xa413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x428ea2,_0x63d26,_0x108c16){return new BPromise(function(_0x43e959,_0x46672c){return client[_0xa413('0xd')](_0x428ea2,_0x108c16)['then'](function(_0x965bb8){logger['info'](_0xa413('0xe'),_0x63d26,_0xa413('0xf'));logger[_0xa413('0x10')](_0xa413('0x11'),_0x63d26,_0xa413('0xf'),JSON['stringify'](_0x965bb8));if(_0x965bb8[_0xa413('0x12')]){if(_0x965bb8[_0xa413('0x12')][_0xa413('0x13')]===0x1f4){logger[_0xa413('0x12')](_0xa413('0xe'),_0x63d26,_0x965bb8[_0xa413('0x12')][_0xa413('0x14')]);return _0x46672c(_0x965bb8[_0xa413('0x12')]['message']);}logger['error'](_0xa413('0xe'),_0x63d26,_0x965bb8[_0xa413('0x12')]['message']);return _0x43e959(_0x965bb8[_0xa413('0x12')]['message']);}else{logger[_0xa413('0x15')](_0xa413('0xe'),_0x63d26,'request\x20sent');_0x43e959(_0x965bb8[_0xa413('0x16')][_0xa413('0x14')]);}})['catch'](function(_0x3f70e3){logger[_0xa413('0x12')](_0xa413('0xe'),_0x63d26,_0x3f70e3);_0x46672c(_0x3f70e3);});});}
\ No newline at end of file
+var _0x6391=['jayson/promise','client','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x1954de,_0x3dc727){var _0x5b46f1=function(_0x134848){while(--_0x134848){_0x1954de['push'](_0x1954de['shift']());}};_0x5b46f1(++_0x3dc727);}(_0x6391,0x162));var _0x1639=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x6391[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x1639('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1639('0x1'));var rs=require(_0x1639('0x2'));var fs=require('fs');var Redis=require(_0x1639('0x3'));var db=require(_0x1639('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1639('0x5'))('rpc');var config=require(_0x1639('0x6'));var jayson=require(_0x1639('0x7'));var client=jayson[_0x1639('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51cfad,_0x1f1c3b,_0x406745){return new BPromise(function(_0x2477dc,_0x1ca08f){return client['request'](_0x51cfad,_0x406745)['then'](function(_0x27d39b){logger[_0x1639('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f1c3b,'request\x20sent');logger[_0x1639('0xa')](_0x1639('0xb'),_0x1f1c3b,_0x1639('0xc'),JSON[_0x1639('0xd')](_0x27d39b));if(_0x27d39b['error']){if(_0x27d39b[_0x1639('0xe')][_0x1639('0xf')]===0x1f4){logger[_0x1639('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f1c3b,_0x27d39b['error'][_0x1639('0x10')]);return _0x1ca08f(_0x27d39b['error'][_0x1639('0x10')]);}logger[_0x1639('0xe')](_0x1639('0x11'),_0x1f1c3b,_0x27d39b[_0x1639('0xe')]['message']);return _0x2477dc(_0x27d39b[_0x1639('0xe')][_0x1639('0x10')]);}else{logger[_0x1639('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1f1c3b,_0x1639('0xc'));_0x2477dc(_0x27d39b['result'][_0x1639('0x10')]);}})[_0x1639('0x12')](function(_0x5d3d74){logger[_0x1639('0xe')](_0x1639('0x11'),_0x1f1c3b,_0x5d3d74);_0x1ca08f(_0x5d3d74);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 29083bd..bf19d14 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x1a986b,_0x311a51){var _0x43fce3=function(_0x4444fe){while(--_0x4444fe){_0x1a986b['push'](_0x1a986b['shift']());}};_0x43fce3(++_0x311a51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x15a3b0,_0x1ef3d3){var _0x56c9b7=function(_0xa7800e){while(--_0xa7800e){_0x15a3b0['push'](_0x15a3b0['shift']());}};_0x56c9b7(++_0x1ef3d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index f9922fb..fdd089e 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 _0x7fce=['STRING','sequelize','exports'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x7fce,0xdc));var _0xe7fc=function(_0x280dbe,_0x82d71f){_0x280dbe=_0x280dbe-0x0;var _0x4727b9=_0x7fce[_0x280dbe];return _0x4727b9;};'use strict';var Sequelize=require(_0xe7fc('0x0'));module[_0xe7fc('0x1')]={'name':{'type':Sequelize[_0xe7fc('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe7fc('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xe7fc('0x2')]}};
\ No newline at end of file
+var _0x48bc=['STRING','TEXT','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x48bc,0x1b6));var _0xc48b=function(_0x363b62,_0x4d22dd){_0x363b62=_0x363b62-0x0;var _0x5ded2b=_0x48bc[_0x363b62];return _0x5ded2b;};'use strict';var Sequelize=require(_0xc48b('0x0'));module[_0xc48b('0x1')]={'name':{'type':Sequelize[_0xc48b('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc48b('0x2')]},'metric':{'type':Sequelize[_0xc48b('0x3')]},'description':{'type':Sequelize[_0xc48b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 1989632..a896f9e 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x17ef68,_0x5f47e7){_0x17ef68=_0x17ef68-0x0;var _0x55c3a4=_0x1cb9[_0x17ef68];return _0x55c3a4;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x5aca58,_0xe9bc4b){var _0x5de6c6=function(_0x1e8300){while(--_0x1e8300){_0x5aca58['push'](_0x5aca58['shift']());}};_0x5de6c6(++_0xe9bc4b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x58d408,_0x165433){_0x58d408=_0x58d408-0x0;var _0x5047b2=_0xe5b3[_0x58d408];return _0x5047b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d6c0315..9a0ccc8 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 _0x1134=['AnalyticMetric','analytics_metrics','lodash','util','api','moment','request-promise','path','../../config/environment','exports'];(function(_0x472f31,_0x231437){var _0x1a8f26=function(_0x7a0f3e){while(--_0x7a0f3e){_0x472f31['push'](_0x472f31['shift']());}};_0x1a8f26(++_0x231437);}(_0x1134,0x19c));var _0x4113=function(_0x21c11d,_0x129cf9){_0x21c11d=_0x21c11d-0x0;var _0x11a58d=_0x1134[_0x21c11d];return _0x11a58d;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var logger=require('../../config/logger')(_0x4113('0x2'));var moment=require(_0x4113('0x3'));var BPromise=require('bluebird');var rp=require(_0x4113('0x4'));var fs=require('fs');var path=require(_0x4113('0x5'));var rimraf=require('rimraf');var config=require(_0x4113('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x4113('0x7')]=function(_0x499091,_0x39ca01){return _0x499091['define'](_0x4113('0x8'),attributes,{'tableName':_0x4113('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8917=['define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x3bca94,_0x5445d5){var _0x4049c9=function(_0x3a8fa5){while(--_0x3a8fa5){_0x3bca94['push'](_0x3bca94['shift']());}};_0x4049c9(++_0x5445d5);}(_0x8917,0x1d7));var _0x7891=function(_0x18bb0b,_0x5201cd){_0x18bb0b=_0x18bb0b-0x0;var _0x2812c5=_0x8917[_0x18bb0b];return _0x2812c5;};'use strict';var _=require(_0x7891('0x0'));var util=require('util');var logger=require(_0x7891('0x1'))(_0x7891('0x2'));var moment=require(_0x7891('0x3'));var BPromise=require(_0x7891('0x4'));var rp=require(_0x7891('0x5'));var fs=require('fs');var path=require(_0x7891('0x6'));var rimraf=require(_0x7891('0x7'));var config=require(_0x7891('0x8'));var attributes=require(_0x7891('0x9'));module['exports']=function(_0x46b52a,_0x43a48e){return _0x46b52a[_0x7891('0xa')](_0x7891('0xb'),attributes,{'tableName':_0x7891('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index a0ffc59..4e41a55 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 _0x090a=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x214e68,_0x30426f){var _0x389d11=function(_0x21970a){while(--_0x21970a){_0x214e68['push'](_0x214e68['shift']());}};_0x389d11(++_0x30426f);}(_0x090a,0x64));var _0xa090=function(_0x8604f9,_0xb5a59){_0x8604f9=_0x8604f9-0x0;var _0x2a3ff3=_0x090a[_0x8604f9];return _0x2a3ff3;};'use strict';var _=require(_0xa090('0x0'));var util=require('util');var moment=require(_0xa090('0x1'));var BPromise=require(_0xa090('0x2'));var rs=require(_0xa090('0x3'));var fs=require('fs');var Redis=require(_0xa090('0x4'));var db=require(_0xa090('0x5'))['db'];var utils=require(_0xa090('0x6'));var logger=require(_0xa090('0x7'))(_0xa090('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa090('0x9')][_0xa090('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6963f7,_0x26c65a,_0x3b1caa){return new BPromise(function(_0x4a98c8,_0x182685){return client[_0xa090('0xb')](_0x6963f7,_0x3b1caa)[_0xa090('0xc')](function(_0x2b0fdb){logger[_0xa090('0xd')](_0xa090('0xe'),_0x26c65a,'request\x20sent');logger[_0xa090('0xf')](_0xa090('0x10'),_0x26c65a,_0xa090('0x11'),JSON[_0xa090('0x12')](_0x2b0fdb));if(_0x2b0fdb[_0xa090('0x13')]){if(_0x2b0fdb['error'][_0xa090('0x14')]===0x1f4){logger[_0xa090('0x13')](_0xa090('0xe'),_0x26c65a,_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);return _0x182685(_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);}logger['error'](_0xa090('0xe'),_0x26c65a,_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);return _0x4a98c8(_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);}else{logger[_0xa090('0xd')](_0xa090('0xe'),_0x26c65a,'request\x20sent');_0x4a98c8(_0x2b0fdb[_0xa090('0x16')][_0xa090('0x15')]);}})[_0xa090('0x17')](function(_0x304b06){logger[_0xa090('0x13')](_0xa090('0xe'),_0x26c65a,_0x304b06);_0x182685(_0x304b06);});});}
\ No newline at end of file
+var _0xa092=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x6c40ba,_0x5e39fa){var _0x7a54dd=function(_0x166452){while(--_0x166452){_0x6c40ba['push'](_0x6c40ba['shift']());}};_0x7a54dd(++_0x5e39fa);}(_0xa092,0x1d3));var _0x2a09=function(_0x1b3f63,_0x5578c9){_0x1b3f63=_0x1b3f63-0x0;var _0x39005d=_0xa092[_0x1b3f63];return _0x39005d;};'use strict';var _=require(_0x2a09('0x0'));var util=require(_0x2a09('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2a09('0x2'));var fs=require('fs');var Redis=require(_0x2a09('0x3'));var db=require(_0x2a09('0x4'))['db'];var utils=require(_0x2a09('0x5'));var logger=require(_0x2a09('0x6'))('rpc');var config=require(_0x2a09('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f5732,_0x459e6d,_0x986720){return new BPromise(function(_0x26fdea,_0x38d19b){return client['request'](_0x2f5732,_0x986720)[_0x2a09('0x8')](function(_0x828c4){logger[_0x2a09('0x9')](_0x2a09('0xa'),_0x459e6d,_0x2a09('0xb'));logger['debug'](_0x2a09('0xc'),_0x459e6d,_0x2a09('0xb'),JSON[_0x2a09('0xd')](_0x828c4));if(_0x828c4[_0x2a09('0xe')]){if(_0x828c4[_0x2a09('0xe')][_0x2a09('0xf')]===0x1f4){logger[_0x2a09('0xe')](_0x2a09('0xa'),_0x459e6d,_0x828c4[_0x2a09('0xe')][_0x2a09('0x10')]);return _0x38d19b(_0x828c4[_0x2a09('0xe')]['message']);}logger[_0x2a09('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x459e6d,_0x828c4[_0x2a09('0xe')]['message']);return _0x26fdea(_0x828c4[_0x2a09('0xe')][_0x2a09('0x10')]);}else{logger[_0x2a09('0x9')](_0x2a09('0xa'),_0x459e6d,_0x2a09('0xb'));_0x26fdea(_0x828c4[_0x2a09('0x11')][_0x2a09('0x10')]);}})['catch'](function(_0xace625){logger[_0x2a09('0xe')](_0x2a09('0xa'),_0x459e6d,_0xace625);_0x38d19b(_0xace625);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index c271cc6..dbe1e83 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 _0x2123=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','isAuthenticated','create','put','delete','destroy'];(function(_0x2f3cb4,_0x206261){var _0x2e37fd=function(_0x347b5a){while(--_0x347b5a){_0x2f3cb4['push'](_0x2f3cb4['shift']());}};_0x2e37fd(++_0x206261);}(_0x2123,0x190));var _0x3212=function(_0x3f49b9,_0x4424e6){_0x3f49b9=_0x3f49b9-0x0;var _0x2e8876=_0x2123[_0x3f49b9];return _0x2e8876;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),auth['isAuthenticated'](),controller[_0x3212('0xe')]);router['post']('/',auth[_0x3212('0xf')](),controller[_0x3212('0x10')]);router[_0x3212('0x11')](_0x3212('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x3212('0x12')](_0x3212('0xd'),auth[_0x3212('0xf')](),controller[_0x3212('0x13')]);module[_0x3212('0x14')]=router;
\ No newline at end of file
+var _0x4fd7=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x135652,_0x4f2320){var _0x49e17a=function(_0x5eefe7){while(--_0x5eefe7){_0x135652['push'](_0x135652['shift']());}};_0x49e17a(++_0x4f2320);}(_0x4fd7,0xe6));var _0x74fd=function(_0x1cfdfd,_0x4e09f6){_0x1cfdfd=_0x1cfdfd-0x0;var _0xd09110=_0x4fd7[_0x1cfdfd];return _0xd09110;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require(_0x74fd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x4'));var auth=require(_0x74fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74fd('0x6'));var controller=require('./analyticMetric.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router[_0x74fd('0x7')]('/:id',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router['post']('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xb')]);router[_0x74fd('0xc')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xe')]);router[_0x74fd('0xf')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x10')]);module[_0x74fd('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 38badfd..c95457d 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 _0x2116=['sequelize'];(function(_0x460fd9,_0x4b4b97){var _0x424e18=function(_0x4a4942){while(--_0x4a4942){_0x460fd9['push'](_0x460fd9['shift']());}};_0x424e18(++_0x4b4b97);}(_0x2116,0x1f2));var _0x6211=function(_0x370c84,_0x1163e0){_0x370c84=_0x370c84-0x0;var _0x4cca44=_0x2116[_0x370c84];return _0x4cca44;};'use strict';var Sequelize=require(_0x6211('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x97dd=['exports','TEXT','sequelize'];(function(_0x22d7ea,_0x557536){var _0x35ccc3=function(_0x2e2b43){while(--_0x2e2b43){_0x22d7ea['push'](_0x22d7ea['shift']());}};_0x35ccc3(++_0x557536);}(_0x97dd,0x71));var _0xd97d=function(_0x205bcb,_0x187305){_0x205bcb=_0x205bcb-0x0;var _0x517b8f=_0x97dd[_0x205bcb];return _0x517b8f;};'use strict';var Sequelize=require(_0xd97d('0x0'));module[_0xd97d('0x1')]={'tree':{'type':Sequelize[_0xd97d('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 9c15cbb..e835ed0 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 _0xf89f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','AnalyticTreeReport','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','keys','rawAttributes','body','find','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x545bed,_0x221e96){var _0x16c79c=function(_0x465346){while(--_0x465346){_0x545bed['push'](_0x545bed['shift']());}};_0x16c79c(++_0x221e96);}(_0xf89f,0x166));var _0xff89=function(_0x17df77,_0x200e0b){_0x17df77=_0x17df77-0x0;var _0x35c153=_0xf89f[_0x17df77];return _0x35c153;};'use strict';var emlformat=require(_0xff89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xff89('0x1'));var rp=require(_0xff89('0x2'));var moment=require(_0xff89('0x3'));var BPromise=require(_0xff89('0x4'));var Mustache=require('mustache');var util=require(_0xff89('0x5'));var path=require(_0xff89('0x6'));var sox=require(_0xff89('0x7'));var csv=require(_0xff89('0x8'));var ejs=require(_0xff89('0x9'));var fs=require('fs');var fs_extra=require(_0xff89('0xa'));var _=require('lodash');var squel=require(_0xff89('0xb'));var crypto=require('crypto');var jsforce=require(_0xff89('0xc'));var deskjs=require(_0xff89('0xd'));var toCsv=require('to-csv');var querystring=require(_0xff89('0xe'));var Papa=require(_0xff89('0xf'));var Redis=require(_0xff89('0x10'));var authService=require(_0xff89('0x11'));var qs=require(_0xff89('0x12'));var as=require(_0xff89('0x13'));var hardwareService=require(_0xff89('0x14'));var logger=require(_0xff89('0x15'))(_0xff89('0x16'));var utils=require('../../config/utils');var config=require(_0xff89('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xff89('0x18'))['db'];function respondWithStatusCode(_0x2e0dde,_0x318dee){_0x318dee=_0x318dee||0xcc;return function(_0xdd6ba){if(_0xdd6ba){return _0x2e0dde['sendStatus'](_0x318dee);}return _0x2e0dde['status'](_0x318dee)[_0xff89('0x19')]();};}function respondWithResult(_0x5969a0,_0x5aac35){_0x5aac35=_0x5aac35||0xc8;return function(_0x444473){if(_0x444473){return _0x5969a0[_0xff89('0x1a')](_0x5aac35)[_0xff89('0x1b')](_0x444473);}};}function respondWithFilteredResult(_0x5e2b60,_0x565d07){return function(_0x383e6b){if(_0x383e6b){var _0x58de3b=typeof _0x565d07['offset']===_0xff89('0x1c')&&typeof _0x565d07['limit']===_0xff89('0x1c');var _0x3e2433=_0x383e6b['count'];var _0x5e675e=_0x58de3b?0x0:_0x565d07[_0xff89('0x1d')];var _0x4ea7da=_0x58de3b?_0x383e6b[_0xff89('0x1e')]:_0x565d07[_0xff89('0x1d')]+_0x565d07[_0xff89('0x1f')];var _0x5cb786;if(_0x4ea7da>=_0x3e2433){_0x4ea7da=_0x3e2433;_0x5cb786=0xc8;}else{_0x5cb786=0xce;}_0x5e2b60[_0xff89('0x1a')](_0x5cb786);return _0x5e2b60[_0xff89('0x20')](_0xff89('0x21'),_0x5e675e+'-'+_0x4ea7da+'/'+_0x3e2433)[_0xff89('0x1b')](_0x383e6b);}return null;};}function patchUpdates(_0x44c5c1){return function(_0x5b1b34){try{jsonpatch[_0xff89('0x22')](_0x5b1b34,_0x44c5c1,!![]);}catch(_0x48477c){return BPromise[_0xff89('0x23')](_0x48477c);}return _0x5b1b34[_0xff89('0x24')]();};}function saveUpdates(_0x19c493,_0x392001){return function(_0x2d63aa){if(_0x2d63aa){return _0x2d63aa[_0xff89('0x25')](_0x19c493)['then'](function(_0x1a5bf8){return _0x1a5bf8;});}return null;};}function removeEntity(_0x5aebbe,_0x4dc956){return function(_0x446e16){if(_0x446e16){return _0x446e16[_0xff89('0x26')]()['then'](function(){_0x5aebbe[_0xff89('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d807d,_0xf2d7a8){return function(_0x43908b){if(!_0x43908b){_0x3d807d['sendStatus'](0x194);}return _0x43908b;};}function handleError(_0x3feaf1,_0x5890ae){_0x5890ae=_0x5890ae||0x1f4;return function(_0x5ef937){logger['error'](_0x5ef937[_0xff89('0x27')]);if(_0x5ef937[_0xff89('0x28')]){delete _0x5ef937[_0xff89('0x28')];}_0x3feaf1['status'](_0x5890ae)[_0xff89('0x29')](_0x5ef937);};}exports['index']=function(_0x211b99,_0x408e87){var _0x1fc9ef={},_0x49f689={},_0x404f87={'count':0x0,'rows':[]};var _0x36b0b3=_['map'](db[_0xff89('0x2a')]['rawAttributes'],function(_0x280e96){return{'name':_0x280e96[_0xff89('0x2b')],'type':_0x280e96[_0xff89('0x2c')][_0xff89('0x2d')]};});_0x49f689[_0xff89('0x2e')]=_[_0xff89('0x2f')](_0x36b0b3,_0xff89('0x28'));_0x49f689[_0xff89('0x30')]=_['keys'](_0x211b99[_0xff89('0x30')]);_0x49f689[_0xff89('0x31')]=_[_0xff89('0x32')](_0x49f689[_0xff89('0x2e')],_0x49f689[_0xff89('0x30')]);_0x1fc9ef['attributes']=_[_0xff89('0x32')](_0x49f689['model'],qs[_0xff89('0x33')](_0x211b99['query']['fields']));_0x1fc9ef[_0xff89('0x34')]=_0x1fc9ef['attributes'][_0xff89('0x35')]?_0x1fc9ef[_0xff89('0x34')]:_0x49f689[_0xff89('0x2e')];if(!_0x211b99[_0xff89('0x30')][_0xff89('0x36')](_0xff89('0x37'))){_0x1fc9ef[_0xff89('0x1f')]=qs[_0xff89('0x1f')](_0x211b99[_0xff89('0x30')][_0xff89('0x1f')]);_0x1fc9ef[_0xff89('0x1d')]=qs[_0xff89('0x1d')](_0x211b99[_0xff89('0x30')][_0xff89('0x1d')]);}_0x1fc9ef[_0xff89('0x38')]=qs[_0xff89('0x39')](_0x211b99[_0xff89('0x30')][_0xff89('0x39')]);_0x1fc9ef[_0xff89('0x3a')]=qs[_0xff89('0x31')](_['pick'](_0x211b99[_0xff89('0x30')],_0x49f689['filters']),_0x36b0b3);if(_0x211b99[_0xff89('0x30')][_0xff89('0x3b')]){_0x1fc9ef[_0xff89('0x3a')]=_[_0xff89('0x3c')](_0x1fc9ef[_0xff89('0x3a')],{'$or':_[_0xff89('0x2f')](_0x36b0b3,function(_0x4a8a8a){if(_0x4a8a8a['type']!==_0xff89('0x3d')){var _0x171bcd={};_0x171bcd[_0x4a8a8a['name']]={'$like':'%'+_0x211b99[_0xff89('0x30')][_0xff89('0x3b')]+'%'};return _0x171bcd;}})});}_0x1fc9ef=_[_0xff89('0x3c')]({},_0x1fc9ef,_0x211b99[_0xff89('0x3e')]);var _0x23dc00={'where':_0x1fc9ef[_0xff89('0x3a')]};return db['AnalyticTreeReport'][_0xff89('0x1e')](_0x23dc00)['then'](function(_0x5d8317){_0x404f87['count']=_0x5d8317;if(_0x211b99[_0xff89('0x30')][_0xff89('0x3f')]){_0x1fc9ef[_0xff89('0x40')]=[{'all':!![]}];}return db[_0xff89('0x2a')][_0xff89('0x41')](_0x1fc9ef);})[_0xff89('0x42')](function(_0x2726fd){_0x404f87[_0xff89('0x43')]=_0x2726fd;return _0x404f87;})['then'](respondWithFilteredResult(_0x408e87,_0x1fc9ef))[_0xff89('0x44')](handleError(_0x408e87,null));};exports[_0xff89('0x45')]=function(_0x1f0060,_0x25c5fe){var _0x3dfd8a={'raw':!![],'where':{'id':_0x1f0060['params']['id']}},_0x3f41a4={};_0x3f41a4[_0xff89('0x2e')]=_[_0xff89('0x46')](db[_0xff89('0x2a')][_0xff89('0x47')]);_0x3f41a4[_0xff89('0x30')]=_[_0xff89('0x46')](_0x1f0060[_0xff89('0x30')]);_0x3f41a4[_0xff89('0x31')]=_[_0xff89('0x32')](_0x3f41a4[_0xff89('0x2e')],_0x3f41a4[_0xff89('0x30')]);_0x3dfd8a[_0xff89('0x34')]=_['intersection'](_0x3f41a4[_0xff89('0x2e')],qs['fields'](_0x1f0060['query']['fields']));_0x3dfd8a[_0xff89('0x34')]=_0x3dfd8a['attributes'][_0xff89('0x35')]?_0x3dfd8a['attributes']:_0x3f41a4[_0xff89('0x2e')];if(_0x1f0060[_0xff89('0x30')]['includeAll']){_0x3dfd8a[_0xff89('0x40')]=[{'all':!![]}];}_0x3dfd8a=_[_0xff89('0x3c')]({},_0x3dfd8a,_0x1f0060[_0xff89('0x3e')]);return db[_0xff89('0x2a')]['find'](_0x3dfd8a)['then'](handleEntityNotFound(_0x25c5fe,null))[_0xff89('0x42')](respondWithResult(_0x25c5fe,null))[_0xff89('0x44')](handleError(_0x25c5fe,null));};exports['create']=function(_0x2978e0,_0x4f849f){return db[_0xff89('0x2a')]['create'](_0x2978e0[_0xff89('0x48')],{})[_0xff89('0x42')](respondWithResult(_0x4f849f,0xc9))['catch'](handleError(_0x4f849f,null));};exports[_0xff89('0x25')]=function(_0x1ecb14,_0x95f5){if(_0x1ecb14['body']['id']){delete _0x1ecb14['body']['id'];}return db[_0xff89('0x2a')][_0xff89('0x49')]({'where':{'id':_0x1ecb14[_0xff89('0x4a')]['id']}})[_0xff89('0x42')](handleEntityNotFound(_0x95f5,null))['then'](saveUpdates(_0x1ecb14['body'],null))['then'](respondWithResult(_0x95f5,null))[_0xff89('0x44')](handleError(_0x95f5,null));};exports['destroy']=function(_0x38db6c,_0x1caa39){return db[_0xff89('0x2a')][_0xff89('0x49')]({'where':{'id':_0x38db6c['params']['id']}})[_0xff89('0x42')](handleEntityNotFound(_0x1caa39,null))['then'](removeEntity(_0x1caa39,null))[_0xff89('0x44')](handleError(_0x1caa39,null));};
\ No newline at end of file
+var _0x86d5=['save','update','then','error','name','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x86d5,0xb8));var _0x586d=function(_0x12ee31,_0x4fb176){_0x12ee31=_0x12ee31-0x0;var _0x5ede94=_0x86d5[_0x12ee31];return _0x5ede94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x586d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x586d('0x1'));var rp=require(_0x586d('0x2'));var moment=require(_0x586d('0x3'));var BPromise=require(_0x586d('0x4'));var Mustache=require(_0x586d('0x5'));var util=require('util');var path=require(_0x586d('0x6'));var sox=require(_0x586d('0x7'));var csv=require('to-csv');var ejs=require(_0x586d('0x8'));var fs=require('fs');var fs_extra=require(_0x586d('0x9'));var _=require(_0x586d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x586d('0xb'));var deskjs=require(_0x586d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x586d('0xd'));var Papa=require(_0x586d('0xe'));var Redis=require(_0x586d('0xf'));var authService=require(_0x586d('0x10'));var qs=require(_0x586d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x586d('0x12'));var logger=require(_0x586d('0x13'))(_0x586d('0x14'));var utils=require(_0x586d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x586d('0x16'))['db'];function respondWithStatusCode(_0x7f50b9,_0x23c6a6){_0x23c6a6=_0x23c6a6||0xcc;return function(_0x2faa1b){if(_0x2faa1b){return _0x7f50b9[_0x586d('0x17')](_0x23c6a6);}return _0x7f50b9[_0x586d('0x18')](_0x23c6a6)[_0x586d('0x19')]();};}function respondWithResult(_0x2ab4a3,_0x4abf8b){_0x4abf8b=_0x4abf8b||0xc8;return function(_0x377e9d){if(_0x377e9d){return _0x2ab4a3[_0x586d('0x18')](_0x4abf8b)[_0x586d('0x1a')](_0x377e9d);}};}function respondWithFilteredResult(_0x1e715b,_0xc427ad){return function(_0x1c27c6){if(_0x1c27c6){var _0x36ebeb=typeof _0xc427ad[_0x586d('0x1b')]==='undefined'&&typeof _0xc427ad[_0x586d('0x1c')]===_0x586d('0x1d');var _0xac99a0=_0x1c27c6[_0x586d('0x1e')];var _0x83c30a=_0x36ebeb?0x0:_0xc427ad['offset'];var _0x4f08ef=_0x36ebeb?_0x1c27c6[_0x586d('0x1e')]:_0xc427ad[_0x586d('0x1b')]+_0xc427ad['limit'];var _0xc89485;if(_0x4f08ef>=_0xac99a0){_0x4f08ef=_0xac99a0;_0xc89485=0xc8;}else{_0xc89485=0xce;}_0x1e715b['status'](_0xc89485);return _0x1e715b[_0x586d('0x1f')](_0x586d('0x20'),_0x83c30a+'-'+_0x4f08ef+'/'+_0xac99a0)[_0x586d('0x1a')](_0x1c27c6);}return null;};}function patchUpdates(_0x4a98d1){return function(_0x3595bd){try{jsonpatch[_0x586d('0x21')](_0x3595bd,_0x4a98d1,!![]);}catch(_0x5a24bb){return BPromise[_0x586d('0x22')](_0x5a24bb);}return _0x3595bd[_0x586d('0x23')]();};}function saveUpdates(_0x2c89cf,_0x5ed444){return function(_0x13d532){if(_0x13d532){return _0x13d532[_0x586d('0x24')](_0x2c89cf)['then'](function(_0x7f92bb){return _0x7f92bb;});}return null;};}function removeEntity(_0x3cf200,_0x5ccd59){return function(_0x5e7656){if(_0x5e7656){return _0x5e7656['destroy']()[_0x586d('0x25')](function(){_0x3cf200[_0x586d('0x18')](0xcc)[_0x586d('0x19')]();});}};}function handleEntityNotFound(_0x7017d1,_0x1c174a){return function(_0x4f93b1){if(!_0x4f93b1){_0x7017d1[_0x586d('0x17')](0x194);}return _0x4f93b1;};}function handleError(_0x190570,_0x2b0c5f){_0x2b0c5f=_0x2b0c5f||0x1f4;return function(_0x290ade){logger[_0x586d('0x26')](_0x290ade['stack']);if(_0x290ade[_0x586d('0x27')]){delete _0x290ade[_0x586d('0x27')];}_0x190570[_0x586d('0x18')](_0x2b0c5f)['send'](_0x290ade);};}exports['index']=function(_0x2bdd3a,_0x3d0553){var _0x64df75={},_0x223f97={},_0x457d18={'count':0x0,'rows':[]};var _0x2270d9=_[_0x586d('0x28')](db[_0x586d('0x29')][_0x586d('0x2a')],function(_0x5a5df0){return{'name':_0x5a5df0[_0x586d('0x2b')],'type':_0x5a5df0['type'][_0x586d('0x2c')]};});_0x223f97[_0x586d('0x2d')]=_['map'](_0x2270d9,_0x586d('0x27'));_0x223f97[_0x586d('0x2e')]=_[_0x586d('0x2f')](_0x2bdd3a[_0x586d('0x2e')]);_0x223f97[_0x586d('0x30')]=_[_0x586d('0x31')](_0x223f97[_0x586d('0x2d')],_0x223f97[_0x586d('0x2e')]);_0x64df75[_0x586d('0x32')]=_[_0x586d('0x31')](_0x223f97[_0x586d('0x2d')],qs[_0x586d('0x33')](_0x2bdd3a[_0x586d('0x2e')]['fields']));_0x64df75[_0x586d('0x32')]=_0x64df75[_0x586d('0x32')][_0x586d('0x34')]?_0x64df75[_0x586d('0x32')]:_0x223f97[_0x586d('0x2d')];if(!_0x2bdd3a[_0x586d('0x2e')]['hasOwnProperty'](_0x586d('0x35'))){_0x64df75[_0x586d('0x1c')]=qs[_0x586d('0x1c')](_0x2bdd3a['query'][_0x586d('0x1c')]);_0x64df75['offset']=qs[_0x586d('0x1b')](_0x2bdd3a['query'][_0x586d('0x1b')]);}_0x64df75['order']=qs[_0x586d('0x36')](_0x2bdd3a[_0x586d('0x2e')][_0x586d('0x36')]);_0x64df75['where']=qs['filters'](_[_0x586d('0x37')](_0x2bdd3a['query'],_0x223f97[_0x586d('0x30')]),_0x2270d9);if(_0x2bdd3a[_0x586d('0x2e')]['filter']){_0x64df75[_0x586d('0x38')]=_[_0x586d('0x39')](_0x64df75['where'],{'$or':_[_0x586d('0x28')](_0x2270d9,function(_0x423122){if(_0x423122[_0x586d('0x3a')]!==_0x586d('0x3b')){var _0x332e2f={};_0x332e2f[_0x423122[_0x586d('0x27')]]={'$like':'%'+_0x2bdd3a['query'][_0x586d('0x3c')]+'%'};return _0x332e2f;}})});}_0x64df75=_[_0x586d('0x39')]({},_0x64df75,_0x2bdd3a[_0x586d('0x3d')]);var _0x5877ad={'where':_0x64df75[_0x586d('0x38')]};return db['AnalyticTreeReport'][_0x586d('0x1e')](_0x5877ad)['then'](function(_0x3b8b44){_0x457d18['count']=_0x3b8b44;if(_0x2bdd3a['query'][_0x586d('0x3e')]){_0x64df75[_0x586d('0x3f')]=[{'all':!![]}];}return db[_0x586d('0x29')][_0x586d('0x40')](_0x64df75);})[_0x586d('0x25')](function(_0x1968a8){_0x457d18[_0x586d('0x41')]=_0x1968a8;return _0x457d18;})[_0x586d('0x25')](respondWithFilteredResult(_0x3d0553,_0x64df75))[_0x586d('0x42')](handleError(_0x3d0553,null));};exports[_0x586d('0x43')]=function(_0x52a269,_0x51f326){var _0x5a3eb6={'raw':!![],'where':{'id':_0x52a269['params']['id']}},_0x458533={};_0x458533[_0x586d('0x2d')]=_['keys'](db[_0x586d('0x29')]['rawAttributes']);_0x458533[_0x586d('0x2e')]=_[_0x586d('0x2f')](_0x52a269[_0x586d('0x2e')]);_0x458533['filters']=_[_0x586d('0x31')](_0x458533['model'],_0x458533[_0x586d('0x2e')]);_0x5a3eb6['attributes']=_[_0x586d('0x31')](_0x458533['model'],qs[_0x586d('0x33')](_0x52a269['query']['fields']));_0x5a3eb6['attributes']=_0x5a3eb6['attributes'][_0x586d('0x34')]?_0x5a3eb6[_0x586d('0x32')]:_0x458533['model'];if(_0x52a269[_0x586d('0x2e')]['includeAll']){_0x5a3eb6['include']=[{'all':!![]}];}_0x5a3eb6=_[_0x586d('0x39')]({},_0x5a3eb6,_0x52a269[_0x586d('0x3d')]);return db['AnalyticTreeReport'][_0x586d('0x44')](_0x5a3eb6)[_0x586d('0x25')](handleEntityNotFound(_0x51f326,null))[_0x586d('0x25')](respondWithResult(_0x51f326,null))[_0x586d('0x42')](handleError(_0x51f326,null));};exports[_0x586d('0x45')]=function(_0x16450e,_0x2be22c){return db[_0x586d('0x29')][_0x586d('0x45')](_0x16450e['body'],{})[_0x586d('0x25')](respondWithResult(_0x2be22c,0xc9))['catch'](handleError(_0x2be22c,null));};exports[_0x586d('0x24')]=function(_0x40225c,_0x15072c){if(_0x40225c[_0x586d('0x46')]['id']){delete _0x40225c['body']['id'];}return db['AnalyticTreeReport'][_0x586d('0x44')]({'where':{'id':_0x40225c['params']['id']}})[_0x586d('0x25')](handleEntityNotFound(_0x15072c,null))[_0x586d('0x25')](saveUpdates(_0x40225c['body'],null))[_0x586d('0x25')](respondWithResult(_0x15072c,null))[_0x586d('0x42')](handleError(_0x15072c,null));};exports[_0x586d('0x47')]=function(_0x132c68,_0x39d07b){return db[_0x586d('0x29')][_0x586d('0x44')]({'where':{'id':_0x132c68[_0x586d('0x48')]['id']}})[_0x586d('0x25')](handleEntityNotFound(_0x39d07b,null))['then'](removeEntity(_0x39d07b,null))[_0x586d('0x42')](handleError(_0x39d07b,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 8e62d79..77c592f 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 _0xc310=['moment','bluebird','request-promise','rimraf','exports','define','AnalyticTreeReport','lodash','../../config/logger','api'];(function(_0x2a6ddc,_0x26c454){var _0x4e76c3=function(_0x2ee9cd){while(--_0x2ee9cd){_0x2a6ddc['push'](_0x2a6ddc['shift']());}};_0x4e76c3(++_0x26c454);}(_0xc310,0xcf));var _0x0c31=function(_0x5b56c8,_0x12eb0b){_0x5b56c8=_0x5b56c8-0x0;var _0x499a47=_0xc310[_0x5b56c8];return _0x499a47;};'use strict';var _=require(_0x0c31('0x0'));var util=require('util');var logger=require(_0x0c31('0x1'))(_0x0c31('0x2'));var moment=require(_0x0c31('0x3'));var BPromise=require(_0x0c31('0x4'));var rp=require(_0x0c31('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c31('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x0c31('0x7')]=function(_0x1bf2a9,_0x482567){return _0x1bf2a9[_0x0c31('0x8')](_0x0c31('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbbfc=['util','../../config/logger','api','moment','bluebird','request-promise','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbfc,0x82));var _0xcbbf=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xbbfc[_0x277af0];return _0x43bd7c;};'use strict';var _=require('lodash');var util=require(_0xcbbf('0x0'));var logger=require(_0xcbbf('0x1'))(_0xcbbf('0x2'));var moment=require(_0xcbbf('0x3'));var BPromise=require(_0xcbbf('0x4'));var rp=require(_0xcbbf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcbbf('0x6'));module[_0xcbbf('0x7')]=function(_0x77b3fe,_0x44d400){return _0x77b3fe['define'](_0xcbbf('0x8'),attributes,{'tableName':_0xcbbf('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 7657daf..663b8c1 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5cbd7e,_0x37db0e){_0x5cbd7e=_0x5cbd7e-0x0;var _0x55c701=_0x7a54[_0x5cbd7e];return _0x55c701;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x6243bb,_0x269bd7){var _0x16ef17=function(_0x5771f1){while(--_0x5771f1){_0x6243bb['push'](_0x6243bb['shift']());}};_0x16ef17(++_0x269bd7);}(_0x2ef3,0xba));var _0x32ef=function(_0x4eac29,_0x2b4300){_0x4eac29=_0x4eac29-0x0;var _0x238dfe=_0x2ef3[_0x4eac29];return _0x238dfe;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 32bf39f..ad01c3c 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 _0xbb02=['show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0xbb02,0x93));var _0x2bb0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbb02[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x2bb0('0x0'));var util=require(_0x2bb0('0x1'));var path=require(_0x2bb0('0x2'));var timeout=require(_0x2bb0('0x3'));var express=require('express');var router=express[_0x2bb0('0x4')]();var fs_extra=require(_0x2bb0('0x5'));var auth=require(_0x2bb0('0x6'));var interaction=require(_0x2bb0('0x7'));var config=require(_0x2bb0('0x8'));var controller=require(_0x2bb0('0x9'));router[_0x2bb0('0xa')]('/',auth[_0x2bb0('0xb')](),controller[_0x2bb0('0xc')]);router[_0x2bb0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2bb0('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2bb0('0xe')](_0x2bb0('0xf'),auth[_0x2bb0('0xb')](),controller[_0x2bb0('0x10')]);router[_0x2bb0('0x11')](_0x2bb0('0xf'),auth['isAuthenticated'](),controller[_0x2bb0('0x12')]);module[_0x2bb0('0x13')]=router;
\ No newline at end of file
+var _0x89db=['put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x37f85c,_0x47b996){var _0x30c9da=function(_0x3ba669){while(--_0x3ba669){_0x37f85c['push'](_0x37f85c['shift']());}};_0x30c9da(++_0x47b996);}(_0x89db,0x101));var _0xb89d=function(_0x177de5,_0x7de17b){_0x177de5=_0x177de5-0x0;var _0x86f211=_0x89db[_0x177de5];return _0x86f211;};'use strict';var multer=require('multer');var util=require(_0xb89d('0x0'));var path=require(_0xb89d('0x1'));var timeout=require(_0xb89d('0x2'));var express=require(_0xb89d('0x3'));var router=express[_0xb89d('0x4')]();var fs_extra=require(_0xb89d('0x5'));var auth=require(_0xb89d('0x6'));var interaction=require(_0xb89d('0x7'));var config=require(_0xb89d('0x8'));var controller=require(_0xb89d('0x9'));router[_0xb89d('0xa')]('/',auth[_0xb89d('0xb')](),controller[_0xb89d('0xc')]);router[_0xb89d('0xa')](_0xb89d('0xd'),auth[_0xb89d('0xb')](),controller[_0xb89d('0xe')]);router['post']('/',auth[_0xb89d('0xb')](),controller['create']);router[_0xb89d('0xf')]('/:id',auth[_0xb89d('0xb')](),controller[_0xb89d('0x10')]);router['delete'](_0xb89d('0xd'),auth[_0xb89d('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 5f98e78..307aede 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 _0x7a72=['exports','STRING'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x7a72,0x1be));var _0x27a7=function(_0x226e13,_0x26ef2a){_0x226e13=_0x226e13-0x0;var _0x53ce21=_0x7a72[_0x226e13];return _0x53ce21;};'use strict';var Sequelize=require('sequelize');module[_0x27a7('0x0')]={'name':{'type':Sequelize[_0x27a7('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x27a7('0x1')]}};
\ No newline at end of file
+var _0x95d9=['STRING','sequelize','exports'];(function(_0x49d21f,_0x6e7f5){var _0x1b93f2=function(_0x1cd8e7){while(--_0x1cd8e7){_0x49d21f['push'](_0x49d21f['shift']());}};_0x1b93f2(++_0x6e7f5);}(_0x95d9,0x97));var _0x995d=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x95d9[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0x995d('0x0'));module[_0x995d('0x1')]={'name':{'type':Sequelize[_0x995d('0x2')]},'basename':{'type':Sequelize[_0x995d('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b2931f9..2f4302b 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 _0x968b=['pick','filter','merge','type','options','includeAll','catch','show','params','clone','get','omit','createdAt','updatedAt','body','find','create','basename','file','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','update','then','destroy','error','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x2e83e1,_0x45c0b1){var _0x2e91c0=function(_0x45697d){while(--_0x45697d){_0x2e83e1['push'](_0x2e83e1['shift']());}};_0x2e91c0(++_0x45c0b1);}(_0x968b,0x16e));var _0xb968=function(_0x148bc0,_0xf5cfdc){_0x148bc0=_0x148bc0-0x0;var _0x34d7d0=_0x968b[_0x148bc0];return _0x34d7d0;};'use strict';var emlformat=require(_0xb968('0x0'));var rimraf=require(_0xb968('0x1'));var zipdir=require(_0xb968('0x2'));var jsonpatch=require(_0xb968('0x3'));var rp=require(_0xb968('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb968('0x5'));var util=require('util');var path=require(_0xb968('0x6'));var sox=require(_0xb968('0x7'));var csv=require(_0xb968('0x8'));var ejs=require(_0xb968('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb968('0xa'));var squel=require(_0xb968('0xb'));var crypto=require('crypto');var jsforce=require(_0xb968('0xc'));var deskjs=require(_0xb968('0xd'));var toCsv=require(_0xb968('0x8'));var querystring=require(_0xb968('0xe'));var Papa=require(_0xb968('0xf'));var Redis=require('ioredis');var authService=require(_0xb968('0x10'));var qs=require(_0xb968('0x11'));var as=require(_0xb968('0x12'));var hardwareService=require(_0xb968('0x13'));var logger=require(_0xb968('0x14'))(_0xb968('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb968('0x16'));var db=require(_0xb968('0x17'))['db'];function respondWithStatusCode(_0x489ae6,_0xb2a066){_0xb2a066=_0xb2a066||0xcc;return function(_0x570384){if(_0x570384){return _0x489ae6[_0xb968('0x18')](_0xb2a066);}return _0x489ae6[_0xb968('0x19')](_0xb2a066)[_0xb968('0x1a')]();};}function respondWithResult(_0x22c2b2,_0x4e2415){_0x4e2415=_0x4e2415||0xc8;return function(_0x1d209c){if(_0x1d209c){return _0x22c2b2[_0xb968('0x19')](_0x4e2415)['json'](_0x1d209c);}};}function respondWithFilteredResult(_0x5691b5,_0x507269){return function(_0xef004e){if(_0xef004e){var _0x785e82=typeof _0x507269[_0xb968('0x1b')]===_0xb968('0x1c')&&typeof _0x507269['limit']===_0xb968('0x1c');var _0x1c1daf=_0xef004e[_0xb968('0x1d')];var _0x17c914=_0x785e82?0x0:_0x507269[_0xb968('0x1b')];var _0x42ad5c=_0x785e82?_0xef004e[_0xb968('0x1d')]:_0x507269[_0xb968('0x1b')]+_0x507269['limit'];var _0x23f3b9;if(_0x42ad5c>=_0x1c1daf){_0x42ad5c=_0x1c1daf;_0x23f3b9=0xc8;}else{_0x23f3b9=0xce;}_0x5691b5[_0xb968('0x19')](_0x23f3b9);return _0x5691b5[_0xb968('0x1e')]('Content-Range',_0x17c914+'-'+_0x42ad5c+'/'+_0x1c1daf)[_0xb968('0x1f')](_0xef004e);}return null;};}function patchUpdates(_0x1f3a00){return function(_0x4736ef){try{jsonpatch[_0xb968('0x20')](_0x4736ef,_0x1f3a00,!![]);}catch(_0x2a7616){return BPromise[_0xb968('0x21')](_0x2a7616);}return _0x4736ef['save']();};}function saveUpdates(_0x427b2f,_0x5321bb){return function(_0x41c3a9){if(_0x41c3a9){return _0x41c3a9[_0xb968('0x22')](_0x427b2f)[_0xb968('0x23')](function(_0x2e1b14){return _0x2e1b14;});}return null;};}function removeEntity(_0x5bb351,_0x3d7665){return function(_0x43f766){if(_0x43f766){return _0x43f766[_0xb968('0x24')]()[_0xb968('0x23')](function(){_0x5bb351[_0xb968('0x19')](0xcc)[_0xb968('0x1a')]();});}};}function handleEntityNotFound(_0x11199d,_0xa98390){return function(_0x6652a7){if(!_0x6652a7){_0x11199d[_0xb968('0x18')](0x194);}return _0x6652a7;};}function handleError(_0x51e3c9,_0x36a2c8){_0x36a2c8=_0x36a2c8||0x1f4;return function(_0x4a6527){logger[_0xb968('0x25')](_0x4a6527['stack']);if(_0x4a6527['name']){delete _0x4a6527[_0xb968('0x26')];}_0x51e3c9[_0xb968('0x19')](_0x36a2c8)[_0xb968('0x27')](_0x4a6527);};}exports[_0xb968('0x28')]=function(_0x174c62,_0x1099df){var _0x40366f={},_0xeafb76={},_0x1f5ab4={'count':0x0,'rows':[]};var _0x4dd2ed=_['map'](db[_0xb968('0x29')][_0xb968('0x2a')],function(_0x110d89){return{'name':_0x110d89[_0xb968('0x2b')],'type':_0x110d89['type'][_0xb968('0x2c')]};});_0xeafb76[_0xb968('0x2d')]=_[_0xb968('0x2e')](_0x4dd2ed,_0xb968('0x26'));_0xeafb76['query']=_[_0xb968('0x2f')](_0x174c62['query']);_0xeafb76[_0xb968('0x30')]=_[_0xb968('0x31')](_0xeafb76[_0xb968('0x2d')],_0xeafb76[_0xb968('0x32')]);_0x40366f[_0xb968('0x33')]=_[_0xb968('0x31')](_0xeafb76[_0xb968('0x2d')],qs[_0xb968('0x34')](_0x174c62[_0xb968('0x32')][_0xb968('0x34')]));_0x40366f[_0xb968('0x33')]=_0x40366f[_0xb968('0x33')]['length']?_0x40366f['attributes']:_0xeafb76['model'];if(!_0x174c62['query'][_0xb968('0x35')](_0xb968('0x36'))){_0x40366f[_0xb968('0x37')]=qs[_0xb968('0x37')](_0x174c62['query'][_0xb968('0x37')]);_0x40366f[_0xb968('0x1b')]=qs[_0xb968('0x1b')](_0x174c62[_0xb968('0x32')][_0xb968('0x1b')]);}_0x40366f[_0xb968('0x38')]=qs[_0xb968('0x39')](_0x174c62['query'][_0xb968('0x39')]);_0x40366f[_0xb968('0x3a')]=qs['filters'](_[_0xb968('0x3b')](_0x174c62[_0xb968('0x32')],_0xeafb76[_0xb968('0x30')]),_0x4dd2ed);if(_0x174c62[_0xb968('0x32')][_0xb968('0x3c')]){_0x40366f['where']=_[_0xb968('0x3d')](_0x40366f[_0xb968('0x3a')],{'$or':_['map'](_0x4dd2ed,function(_0x4b9175){if(_0x4b9175[_0xb968('0x3e')]!=='VIRTUAL'){var _0x35469f={};_0x35469f[_0x4b9175[_0xb968('0x26')]]={'$like':'%'+_0x174c62['query']['filter']+'%'};return _0x35469f;}})});}_0x40366f=_[_0xb968('0x3d')]({},_0x40366f,_0x174c62[_0xb968('0x3f')]);var _0x22ebb8={'where':_0x40366f['where']};return db[_0xb968('0x29')][_0xb968('0x1d')](_0x22ebb8)['then'](function(_0x4928ad){_0x1f5ab4[_0xb968('0x1d')]=_0x4928ad;if(_0x174c62[_0xb968('0x32')][_0xb968('0x40')]){_0x40366f['include']=[{'all':!![]}];}return db[_0xb968('0x29')]['findAll'](_0x40366f);})[_0xb968('0x23')](function(_0x1f8976){_0x1f5ab4['rows']=_0x1f8976;return _0x1f5ab4;})[_0xb968('0x23')](respondWithFilteredResult(_0x1099df,_0x40366f))[_0xb968('0x41')](handleError(_0x1099df,null));};exports[_0xb968('0x42')]=function(_0x4f227b,_0x50016e){var _0x19780f={'raw':!![],'where':{'id':_0x4f227b[_0xb968('0x43')]['id']}},_0x20d743={};_0x20d743[_0xb968('0x2d')]=_[_0xb968('0x2f')](db[_0xb968('0x29')]['rawAttributes']);_0x20d743[_0xb968('0x32')]=_[_0xb968('0x2f')](_0x4f227b['query']);_0x20d743[_0xb968('0x30')]=_[_0xb968('0x31')](_0x20d743[_0xb968('0x2d')],_0x20d743['query']);_0x19780f[_0xb968('0x33')]=_['intersection'](_0x20d743[_0xb968('0x2d')],qs[_0xb968('0x34')](_0x4f227b[_0xb968('0x32')][_0xb968('0x34')]));_0x19780f[_0xb968('0x33')]=_0x19780f[_0xb968('0x33')]['length']?_0x19780f['attributes']:_0x20d743['model'];if(_0x4f227b[_0xb968('0x32')][_0xb968('0x40')]){_0x19780f['include']=[{'all':!![]}];}_0x19780f=_[_0xb968('0x3d')]({},_0x19780f,_0x4f227b['options']);return db['Attachment']['find'](_0x19780f)[_0xb968('0x23')](handleEntityNotFound(_0x50016e,null))[_0xb968('0x23')](respondWithResult(_0x50016e,null))['catch'](handleError(_0x50016e,null));};exports[_0xb968('0x44')]=function(_0x3a9f7d,_0x129b4b){var _0x2d0763={'where':{'id':_0x3a9f7d[_0xb968('0x43')]['id']}},_0x5da24e={};_0x5da24e[_0xb968('0x2d')]=_[_0xb968('0x2f')](db['Attachment'][_0xb968('0x2a')]);_0x2d0763[_0xb968('0x33')]=_[_0xb968('0x31')](_0x5da24e[_0xb968('0x2d')],qs[_0xb968('0x34')](_0x3a9f7d[_0xb968('0x32')][_0xb968('0x34')]));_0x2d0763[_0xb968('0x33')]=_0x2d0763[_0xb968('0x33')]['length']?_0x2d0763[_0xb968('0x33')]:_0x5da24e['model'];if(_0x3a9f7d[_0xb968('0x32')][_0xb968('0x40')]){_0x2d0763['include']=[{'all':!![]}];}_0x2d0763=_['merge']({},_0x2d0763,_0x3a9f7d['options']);return db[_0xb968('0x29')]['find'](_0x2d0763)[_0xb968('0x23')](handleEntityNotFound(_0x129b4b,null))[_0xb968('0x23')](function(_0xb4b323){if(_0xb4b323){var _0x115281=_0xb4b323[_0xb968('0x45')]({'plain':!![]});_0x115281=qs[_0xb968('0x46')](_0x115281,['id',_0xb968('0x47'),_0xb968('0x48')]);_0x3a9f7d['body']=_[_0xb968('0x46')](_0x3a9f7d[_0xb968('0x49')],['id',_0xb968('0x47'),_0xb968('0x48')]);return db[_0xb968('0x29')]['create'](_[_0xb968('0x3d')](_0x115281,_0x3a9f7d[_0xb968('0x49')]),{'include':_0x3a9f7d[_0xb968('0x32')][_0xb968('0x40')]?[{'all':!![]}]:undefined});}})[_0xb968('0x23')](respondWithResult(_0x129b4b,0xc9))[_0xb968('0x41')](handleError(_0x129b4b,null));};exports[_0xb968('0x22')]=function(_0x345e72,_0x1d12d8){if(_0x345e72['body']['id']){delete _0x345e72['body']['id'];}return db['Attachment'][_0xb968('0x4a')]({'where':{'id':_0x345e72['params']['id']}})[_0xb968('0x23')](handleEntityNotFound(_0x1d12d8,null))[_0xb968('0x23')](saveUpdates(_0x345e72['body'],null))[_0xb968('0x23')](respondWithResult(_0x1d12d8,null))[_0xb968('0x41')](handleError(_0x1d12d8,null));};exports[_0xb968('0x24')]=function(_0x333eeb,_0x393821){return db['Attachment']['find']({'where':{'id':_0x333eeb[_0xb968('0x43')]['id']}})['then'](handleEntityNotFound(_0x393821,null))[_0xb968('0x23')](removeEntity(_0x393821,null))[_0xb968('0x41')](handleError(_0x393821,null));};exports[_0xb968('0x4b')]=function(_0x4c1313,_0xc49574,_0x44d623){_0x4c1313[_0xb968('0x49')][_0xb968('0x26')]=_0x4c1313['file']['originalname'];_0x4c1313[_0xb968('0x49')][_0xb968('0x4c')]=_0x4c1313[_0xb968('0x4d')][_0xb968('0x4e')];_0x4c1313[_0xb968('0x49')][_0xb968('0x3e')]=_0x4c1313['file'][_0xb968('0x4f')];return db[_0xb968('0x29')][_0xb968('0x4b')](_0x4c1313['body'])[_0xb968('0x23')](respondWithResult(_0xc49574,0xc9))['catch'](handleError(_0xc49574,null));};exports[_0xb968('0x50')]=function(_0x189f07,_0x5791a2,_0x3c4055){return db['Attachment']['findOne']({'where':{'id':_0x189f07[_0xb968('0x43')]['id']},'raw':!![]})[_0xb968('0x23')](handleEntityNotFound(_0x5791a2,null))[_0xb968('0x23')](function(_0x216194){if(_0x216194){var _0x32b5d5=_0x216194['ChatOfflineMessageId']!==null;var _0x24e391=path[_0xb968('0x51')](config[_0xb968('0x52')],_0xb968('0x53'));if(_0x32b5d5){_0x24e391=path['join'](_0x24e391,_0xb968('0x54'));}var _0x2f435c=path[_0xb968('0x51')](_0x24e391,_0x216194[_0xb968('0x4c')]);return _0x5791a2[_0xb968('0x50')](_0x2f435c);}})['catch'](handleError(_0x5791a2,null));};
\ No newline at end of file
+var _0x73b3=['keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query'];(function(_0x558fe9,_0x1ca3f7){var _0x554d2a=function(_0x16895a){while(--_0x16895a){_0x558fe9['push'](_0x558fe9['shift']());}};_0x554d2a(++_0x1ca3f7);}(_0x73b3,0x82));var _0x373b=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x73b3[_0x4099ee];return _0x1b7bfc;};'use strict';var emlformat=require(_0x373b('0x0'));var rimraf=require(_0x373b('0x1'));var zipdir=require(_0x373b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x373b('0x3'));var moment=require('moment');var BPromise=require(_0x373b('0x4'));var Mustache=require(_0x373b('0x5'));var util=require('util');var path=require(_0x373b('0x6'));var sox=require(_0x373b('0x7'));var csv=require(_0x373b('0x8'));var ejs=require(_0x373b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x373b('0xa'));var squel=require(_0x373b('0xb'));var crypto=require(_0x373b('0xc'));var jsforce=require(_0x373b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x373b('0xe'));var Papa=require(_0x373b('0xf'));var Redis=require('ioredis');var authService=require(_0x373b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x373b('0x11'));var hardwareService=require(_0x373b('0x12'));var logger=require(_0x373b('0x13'))(_0x373b('0x14'));var utils=require('../../config/utils');var config=require(_0x373b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x373b('0x16'))['db'];function respondWithStatusCode(_0x2ca878,_0x2fda51){_0x2fda51=_0x2fda51||0xcc;return function(_0x12277d){if(_0x12277d){return _0x2ca878['sendStatus'](_0x2fda51);}return _0x2ca878[_0x373b('0x17')](_0x2fda51)[_0x373b('0x18')]();};}function respondWithResult(_0x4cb186,_0x1cf216){_0x1cf216=_0x1cf216||0xc8;return function(_0x20c8b5){if(_0x20c8b5){return _0x4cb186[_0x373b('0x17')](_0x1cf216)[_0x373b('0x19')](_0x20c8b5);}};}function respondWithFilteredResult(_0x425074,_0x7fa2d0){return function(_0x3ce803){if(_0x3ce803){var _0x1a0378=typeof _0x7fa2d0[_0x373b('0x1a')]==='undefined'&&typeof _0x7fa2d0['limit']===_0x373b('0x1b');var _0x328114=_0x3ce803[_0x373b('0x1c')];var _0x5ab218=_0x1a0378?0x0:_0x7fa2d0[_0x373b('0x1a')];var _0x973f23=_0x1a0378?_0x3ce803[_0x373b('0x1c')]:_0x7fa2d0[_0x373b('0x1a')]+_0x7fa2d0[_0x373b('0x1d')];var _0x24daf5;if(_0x973f23>=_0x328114){_0x973f23=_0x328114;_0x24daf5=0xc8;}else{_0x24daf5=0xce;}_0x425074[_0x373b('0x17')](_0x24daf5);return _0x425074[_0x373b('0x1e')]('Content-Range',_0x5ab218+'-'+_0x973f23+'/'+_0x328114)[_0x373b('0x19')](_0x3ce803);}return null;};}function patchUpdates(_0x7834ce){return function(_0x118a0d){try{jsonpatch[_0x373b('0x1f')](_0x118a0d,_0x7834ce,!![]);}catch(_0x439aea){return BPromise[_0x373b('0x20')](_0x439aea);}return _0x118a0d['save']();};}function saveUpdates(_0x3e5197,_0x502cf7){return function(_0x1d2684){if(_0x1d2684){return _0x1d2684[_0x373b('0x21')](_0x3e5197)[_0x373b('0x22')](function(_0x213686){return _0x213686;});}return null;};}function removeEntity(_0x4ec9ba,_0x3a4273){return function(_0x23be95){if(_0x23be95){return _0x23be95[_0x373b('0x23')]()['then'](function(){_0x4ec9ba['status'](0xcc)[_0x373b('0x18')]();});}};}function handleEntityNotFound(_0x23528a,_0x209f17){return function(_0x5311f5){if(!_0x5311f5){_0x23528a[_0x373b('0x24')](0x194);}return _0x5311f5;};}function handleError(_0x5f2fa7,_0x106144){_0x106144=_0x106144||0x1f4;return function(_0x2b251c){logger[_0x373b('0x25')](_0x2b251c[_0x373b('0x26')]);if(_0x2b251c[_0x373b('0x27')]){delete _0x2b251c[_0x373b('0x27')];}_0x5f2fa7[_0x373b('0x17')](_0x106144)[_0x373b('0x28')](_0x2b251c);};}exports[_0x373b('0x29')]=function(_0x5398c5,_0x1a6b9e){var _0x117eca={},_0x8692ce={},_0x114551={'count':0x0,'rows':[]};var _0xca40de=_[_0x373b('0x2a')](db[_0x373b('0x2b')][_0x373b('0x2c')],function(_0x45d1d1){return{'name':_0x45d1d1[_0x373b('0x2d')],'type':_0x45d1d1[_0x373b('0x2e')][_0x373b('0x2f')]};});_0x8692ce[_0x373b('0x30')]=_[_0x373b('0x2a')](_0xca40de,_0x373b('0x27'));_0x8692ce[_0x373b('0x31')]=_[_0x373b('0x32')](_0x5398c5[_0x373b('0x31')]);_0x8692ce[_0x373b('0x33')]=_[_0x373b('0x34')](_0x8692ce[_0x373b('0x30')],_0x8692ce[_0x373b('0x31')]);_0x117eca[_0x373b('0x35')]=_[_0x373b('0x34')](_0x8692ce[_0x373b('0x30')],qs[_0x373b('0x36')](_0x5398c5['query'][_0x373b('0x36')]));_0x117eca[_0x373b('0x35')]=_0x117eca[_0x373b('0x35')][_0x373b('0x37')]?_0x117eca['attributes']:_0x8692ce[_0x373b('0x30')];if(!_0x5398c5[_0x373b('0x31')]['hasOwnProperty'](_0x373b('0x38'))){_0x117eca[_0x373b('0x1d')]=qs[_0x373b('0x1d')](_0x5398c5[_0x373b('0x31')][_0x373b('0x1d')]);_0x117eca['offset']=qs[_0x373b('0x1a')](_0x5398c5[_0x373b('0x31')][_0x373b('0x1a')]);}_0x117eca[_0x373b('0x39')]=qs[_0x373b('0x3a')](_0x5398c5[_0x373b('0x31')][_0x373b('0x3a')]);_0x117eca[_0x373b('0x3b')]=qs[_0x373b('0x33')](_[_0x373b('0x3c')](_0x5398c5['query'],_0x8692ce[_0x373b('0x33')]),_0xca40de);if(_0x5398c5[_0x373b('0x31')][_0x373b('0x3d')]){_0x117eca[_0x373b('0x3b')]=_[_0x373b('0x3e')](_0x117eca[_0x373b('0x3b')],{'$or':_[_0x373b('0x2a')](_0xca40de,function(_0xc90bdf){if(_0xc90bdf[_0x373b('0x2e')]!==_0x373b('0x3f')){var _0x3feae3={};_0x3feae3[_0xc90bdf[_0x373b('0x27')]]={'$like':'%'+_0x5398c5['query'][_0x373b('0x3d')]+'%'};return _0x3feae3;}})});}_0x117eca=_[_0x373b('0x3e')]({},_0x117eca,_0x5398c5[_0x373b('0x40')]);var _0x391d22={'where':_0x117eca[_0x373b('0x3b')]};return db[_0x373b('0x2b')][_0x373b('0x1c')](_0x391d22)[_0x373b('0x22')](function(_0x269b52){_0x114551[_0x373b('0x1c')]=_0x269b52;if(_0x5398c5[_0x373b('0x31')]['includeAll']){_0x117eca[_0x373b('0x41')]=[{'all':!![]}];}return db['Attachment'][_0x373b('0x42')](_0x117eca);})[_0x373b('0x22')](function(_0x26bb98){_0x114551[_0x373b('0x43')]=_0x26bb98;return _0x114551;})['then'](respondWithFilteredResult(_0x1a6b9e,_0x117eca))[_0x373b('0x44')](handleError(_0x1a6b9e,null));};exports['show']=function(_0x51cae0,_0x128959){var _0x3b1f07={'raw':!![],'where':{'id':_0x51cae0[_0x373b('0x45')]['id']}},_0x486b26={};_0x486b26[_0x373b('0x30')]=_[_0x373b('0x32')](db[_0x373b('0x2b')]['rawAttributes']);_0x486b26[_0x373b('0x31')]=_[_0x373b('0x32')](_0x51cae0[_0x373b('0x31')]);_0x486b26[_0x373b('0x33')]=_['intersection'](_0x486b26[_0x373b('0x30')],_0x486b26['query']);_0x3b1f07['attributes']=_[_0x373b('0x34')](_0x486b26[_0x373b('0x30')],qs['fields'](_0x51cae0[_0x373b('0x31')]['fields']));_0x3b1f07[_0x373b('0x35')]=_0x3b1f07[_0x373b('0x35')][_0x373b('0x37')]?_0x3b1f07[_0x373b('0x35')]:_0x486b26[_0x373b('0x30')];if(_0x51cae0[_0x373b('0x31')][_0x373b('0x46')]){_0x3b1f07[_0x373b('0x41')]=[{'all':!![]}];}_0x3b1f07=_[_0x373b('0x3e')]({},_0x3b1f07,_0x51cae0[_0x373b('0x40')]);return db['Attachment'][_0x373b('0x47')](_0x3b1f07)[_0x373b('0x22')](handleEntityNotFound(_0x128959,null))[_0x373b('0x22')](respondWithResult(_0x128959,null))['catch'](handleError(_0x128959,null));};exports['clone']=function(_0x17e02d,_0x4cacd2){var _0x49aae2={'where':{'id':_0x17e02d[_0x373b('0x45')]['id']}},_0x416f20={};_0x416f20[_0x373b('0x30')]=_[_0x373b('0x32')](db[_0x373b('0x2b')]['rawAttributes']);_0x49aae2['attributes']=_[_0x373b('0x34')](_0x416f20[_0x373b('0x30')],qs[_0x373b('0x36')](_0x17e02d[_0x373b('0x31')][_0x373b('0x36')]));_0x49aae2['attributes']=_0x49aae2['attributes'][_0x373b('0x37')]?_0x49aae2['attributes']:_0x416f20[_0x373b('0x30')];if(_0x17e02d[_0x373b('0x31')]['includeAll']){_0x49aae2[_0x373b('0x41')]=[{'all':!![]}];}_0x49aae2=_[_0x373b('0x3e')]({},_0x49aae2,_0x17e02d[_0x373b('0x40')]);return db['Attachment'][_0x373b('0x47')](_0x49aae2)['then'](handleEntityNotFound(_0x4cacd2,null))[_0x373b('0x22')](function(_0xe4c800){if(_0xe4c800){var _0x2fb243=_0xe4c800[_0x373b('0x48')]({'plain':!![]});_0x2fb243=qs[_0x373b('0x49')](_0x2fb243,['id',_0x373b('0x4a'),_0x373b('0x4b')]);_0x17e02d[_0x373b('0x4c')]=_[_0x373b('0x49')](_0x17e02d['body'],['id',_0x373b('0x4a'),_0x373b('0x4b')]);return db[_0x373b('0x2b')][_0x373b('0x4d')](_['merge'](_0x2fb243,_0x17e02d[_0x373b('0x4c')]),{'include':_0x17e02d['query'][_0x373b('0x46')]?[{'all':!![]}]:undefined});}})[_0x373b('0x22')](respondWithResult(_0x4cacd2,0xc9))['catch'](handleError(_0x4cacd2,null));};exports[_0x373b('0x21')]=function(_0x305c97,_0x46bca0){if(_0x305c97[_0x373b('0x4c')]['id']){delete _0x305c97[_0x373b('0x4c')]['id'];}return db[_0x373b('0x2b')]['find']({'where':{'id':_0x305c97[_0x373b('0x45')]['id']}})[_0x373b('0x22')](handleEntityNotFound(_0x46bca0,null))[_0x373b('0x22')](saveUpdates(_0x305c97[_0x373b('0x4c')],null))['then'](respondWithResult(_0x46bca0,null))[_0x373b('0x44')](handleError(_0x46bca0,null));};exports[_0x373b('0x23')]=function(_0x359c74,_0x397d50){return db[_0x373b('0x2b')][_0x373b('0x47')]({'where':{'id':_0x359c74[_0x373b('0x45')]['id']}})[_0x373b('0x22')](handleEntityNotFound(_0x397d50,null))['then'](removeEntity(_0x397d50,null))[_0x373b('0x44')](handleError(_0x397d50,null));};exports[_0x373b('0x4d')]=function(_0x5555ad,_0xf05ce,_0x917137){_0x5555ad[_0x373b('0x4c')][_0x373b('0x27')]=_0x5555ad['file'][_0x373b('0x4e')];_0x5555ad[_0x373b('0x4c')][_0x373b('0x4f')]=_0x5555ad[_0x373b('0x50')][_0x373b('0x51')];_0x5555ad[_0x373b('0x4c')][_0x373b('0x2e')]=_0x5555ad[_0x373b('0x50')][_0x373b('0x52')];return db[_0x373b('0x2b')][_0x373b('0x4d')](_0x5555ad[_0x373b('0x4c')])['then'](respondWithResult(_0xf05ce,0xc9))['catch'](handleError(_0xf05ce,null));};exports[_0x373b('0x53')]=function(_0x5de6d6,_0x2ecf5d,_0x42e946){return db[_0x373b('0x2b')][_0x373b('0x54')]({'where':{'id':_0x5de6d6['params']['id']},'raw':!![]})[_0x373b('0x22')](handleEntityNotFound(_0x2ecf5d,null))[_0x373b('0x22')](function(_0xd54f31){if(_0xd54f31){var _0x1a1090=_0xd54f31[_0x373b('0x55')]!==null;var _0x2f60db=path['join'](config[_0x373b('0x56')],_0x373b('0x57'));if(_0x1a1090){_0x2f60db=path[_0x373b('0x58')](_0x2f60db,_0x373b('0x59'));}var _0x6f5962=path[_0x373b('0x58')](_0x2f60db,_0xd54f31[_0x373b('0x4f')]);return _0x2ecf5d['download'](_0x6f5962);}})[_0x373b('0x44')](handleError(_0x2ecf5d,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index f124f30..763a30c 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 _0xf39f=['request-promise','path','rimraf','../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0xf39f,0xff));var _0xff39=function(_0x27ef6a,_0x135e40){_0x27ef6a=_0x27ef6a-0x0;var _0x5371b1=_0xf39f[_0x27ef6a];return _0x5371b1;};'use strict';var _=require(_0xff39('0x0'));var util=require(_0xff39('0x1'));var logger=require(_0xff39('0x2'))('api');var moment=require(_0xff39('0x3'));var BPromise=require(_0xff39('0x4'));var rp=require(_0xff39('0x5'));var fs=require('fs');var path=require(_0xff39('0x6'));var rimraf=require(_0xff39('0x7'));var config=require(_0xff39('0x8'));var attributes=require('./attachment.attributes');module[_0xff39('0x9')]=function(_0x33fb02,_0x34fdd2){return _0x33fb02[_0xff39('0xa')](_0xff39('0xb'),attributes,{'tableName':_0xff39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfda=['bluebird','path','rimraf','../../config/environment','exports','Attachment','attachments','lodash','util','api','moment'];(function(_0x5be986,_0x458f50){var _0x17d2b5=function(_0x38c620){while(--_0x38c620){_0x5be986['push'](_0x5be986['shift']());}};_0x17d2b5(++_0x458f50);}(_0xcfda,0xd8));var _0xacfd=function(_0x34685f,_0x468943){_0x34685f=_0x34685f-0x0;var _0x4ebee5=_0xcfda[_0x34685f];return _0x4ebee5;};'use strict';var _=require(_0xacfd('0x0'));var util=require(_0xacfd('0x1'));var logger=require('../../config/logger')(_0xacfd('0x2'));var moment=require(_0xacfd('0x3'));var BPromise=require(_0xacfd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xacfd('0x5'));var rimraf=require(_0xacfd('0x6'));var config=require(_0xacfd('0x7'));var attributes=require('./attachment.attributes');module[_0xacfd('0x8')]=function(_0x23fb97,_0x2fa34a){return _0x23fb97['define'](_0xacfd('0x9'),attributes,{'tableName':_0xacfd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 38037c4..4510e67 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 _0xc6d8=['moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','create','body','options','raw','CreateAttachment','lodash'];(function(_0x54e141,_0x13a666){var _0x325464=function(_0xfe5aad){while(--_0xfe5aad){_0x54e141['push'](_0x54e141['shift']());}};_0x325464(++_0x13a666);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4b4340,_0x295fc0){_0x4b4340=_0x4b4340-0x0;var _0x4cdb42=_0xc6d8[_0x4b4340];return _0x4cdb42;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Attachment,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['CreateAttachment']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['Attachment'][_0x8c6d('0x13')](_0x3e5495[_0x8c6d('0x14')],{'raw':_0x3e5495[_0x8c6d('0x15')]?_0x3e5495[_0x8c6d('0x15')][_0x8c6d('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5512be){logger['info'](_0x8c6d('0x17'),_0x3e5495);logger['debug'](_0x8c6d('0x17'),_0x3e5495,JSON['stringify'](_0x5512be));_0x4c2f8d(_0x5512be);})['catch'](function(_0x37fd7c){logger[_0x8c6d('0x10')]('CreateAttachment',_0x37fd7c['message'],_0x3e5495);_0x21b8ee(_0x5a22de['error'](0x1f4,_0x37fd7c['message']));});});};
\ No newline at end of file
+var _0x3eec=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x5344b8,_0x13b897){_0x5344b8=_0x5344b8-0x0;var _0x3f7bd2=_0x3eec[_0x5344b8];return _0x3f7bd2;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('Attachment,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('Attachment,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')](_0x219db0[_0xc3ee('0x1b')],{'raw':_0x219db0[_0xc3ee('0x1c')]?_0x219db0[_0xc3ee('0x1c')][_0xc3ee('0x1d')]===undefined?!![]:![]:!![]})[_0xc3ee('0xd')](function(_0x3e7224){logger[_0xc3ee('0x15')](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x1e')](_0x3e7224));_0x3acb0c(_0x3e7224);})[_0xc3ee('0x17')](function(_0x493fea){logger['error'](_0xc3ee('0x18'),_0x493fea[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x493fea[_0xc3ee('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 43f4b5f..d2e5963 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x18aaaf,_0x385db6){_0x18aaaf=_0x18aaaf-0x0;var _0x52d892=_0x0b0e[_0x18aaaf];return _0x52d892;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x514b67,_0x35ab51){var _0x2295fb=function(_0x4f5bd1){while(--_0x4f5bd1){_0x514b67['push'](_0x514b67['shift']());}};_0x2295fb(++_0x35ab51);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b8bda,_0x43ad31){_0x1b8bda=_0x1b8bda-0x0;var _0x1f7050=_0xb10b[_0x1b8bda];return _0x1f7050;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index fcc650c..afa26a8 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 _0x44c3=['agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','getLicense','catch','passport','passport-google-oauth20','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','callback','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','then','User','map','value','admin','user'];(function(_0x46688f,_0x302e66){var _0x5ee527=function(_0x38337c){while(--_0x38337c){_0x46688f['push'](_0x46688f['shift']());}};_0x5ee527(++_0x302e66);}(_0x44c3,0x1a0));var _0x344c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var passport=require(_0x344c('0x0'));var GoogleStrategy=require(_0x344c('0x1'))['Strategy'];var moment=require('moment');var db=require(_0x344c('0x2'))['db'];var config=require(_0x344c('0x3'));var signToken=require(_0x344c('0x4'))[_0x344c('0x5')];var utils=require(_0x344c('0x6'));exports[_0x344c('0x7')]=passport[_0x344c('0x8')](_0x344c('0x9'),{'failureRedirect':_0x344c('0xa'),'scope':['profile','email'],'session':![]});exports[_0x344c('0xb')]=passport['authenticate'](_0x344c('0x9'),{'failureRedirect':_0x344c('0xa'),'session':![]});passport[_0x344c('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x344c('0x9')][_0x344c('0xd')]:'id','clientSecret':config[_0x344c('0x9')]?config[_0x344c('0x9')][_0x344c('0xe')]:_0x344c('0xf'),'callbackURL':config[_0x344c('0x9')]?config[_0x344c('0x9')][_0x344c('0x10')]:''},function(_0x4fe977,_0x6b66fa,_0x498ed0,_0x24863c){var _0x3b291a,_0x791553;return db[_0x344c('0x11')][_0x344c('0x12')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x344c('0x13')],'raw':!![]})[_0x344c('0x14')](function(_0x56358c){_0x3b291a=_0x56358c;return db[_0x344c('0x15')]['find']({'where':{'email':_[_0x344c('0x16')](_0x498ed0['emails'],_0x344c('0x17')),'role':{'$or':[_0x344c('0x18'),_0x344c('0x19'),_0x344c('0x1a')]}}});})[_0x344c('0x14')](function(_0xab16b3){_0x791553=_0xab16b3;if(_0x791553){if(_0x791553[_0x344c('0x1b')]){return _0x24863c(_0x344c('0x1c'));}else if(_0x3b291a[_0x344c('0x13')]>0x0){if(_0x791553[_0x344c('0x1d')]){if(moment(_0x791553['blockedAt'])[_0x344c('0x1e')](_0x3b291a[_0x344c('0x13')],_0x344c('0x1f'))>moment()){return _0x24863c(_0x344c('0x1c'));}else{return utils['clearBlockUser'](_0x791553,0x0,![],null)['then'](function(){return utils['getLicense'](_0x791553);})[_0x344c('0x14')](function(){return _0x24863c(null,_0x791553);});}}else{return utils[_0x344c('0x20')](_0x791553)['then'](function(){return _0x24863c(null,_0x791553);});}}else{return utils[_0x344c('0x20')](_0x791553)[_0x344c('0x14')](function(){return _0x24863c(null,_0x791553);});}}return _0x24863c(_0x344c('0x1c'));})[_0x344c('0x21')](function(_0x57e375){_0x24863c(_0x57e375);});}));
\ No newline at end of file
+var _0x23cb=['minutes','getLicense','catch','lodash','passport','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x23cb,0x1b0));var _0xb23c=function(_0x6054be,_0x2f4ffa){_0x6054be=_0x6054be-0x0;var _0xd1d697=_0x23cb[_0x6054be];return _0xd1d697;};'use strict';var _=require(_0xb23c('0x0'));var passport=require(_0xb23c('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0xb23c('0x2')];var moment=require(_0xb23c('0x3'));var db=require(_0xb23c('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0xb23c('0x5'))[_0xb23c('0x6')];var utils=require(_0xb23c('0x7'));exports[_0xb23c('0x8')]=passport['authenticate'](_0xb23c('0x9'),{'failureRedirect':_0xb23c('0xa'),'scope':[_0xb23c('0xb'),_0xb23c('0xc')],'session':![]});exports[_0xb23c('0xd')]=passport[_0xb23c('0xe')]('google',{'failureRedirect':_0xb23c('0xa'),'session':![]});passport[_0xb23c('0xf')](new GoogleStrategy({'clientID':config[_0xb23c('0x9')]?config[_0xb23c('0x9')][_0xb23c('0x10')]:'id','clientSecret':config[_0xb23c('0x9')]?config[_0xb23c('0x9')][_0xb23c('0x11')]:_0xb23c('0x12'),'callbackURL':config['google']?config[_0xb23c('0x9')][_0xb23c('0x13')]:''},function(_0x503cb7,_0x2a14bb,_0x3cd603,_0x5b8bb4){var _0xe04b8f,_0x55e737;return db[_0xb23c('0x14')][_0xb23c('0x15')]({'where':{'id':0x1},'attributes':[_0xb23c('0x16'),'blockDuration'],'raw':!![]})[_0xb23c('0x17')](function(_0x8d1e7a){_0xe04b8f=_0x8d1e7a;return db[_0xb23c('0x18')][_0xb23c('0x19')]({'where':{'email':_[_0xb23c('0x1a')](_0x3cd603[_0xb23c('0x1b')],_0xb23c('0x1c')),'role':{'$or':[_0xb23c('0x1d'),_0xb23c('0x1e'),_0xb23c('0x1f')]}}});})[_0xb23c('0x17')](function(_0x3ac11b){_0x55e737=_0x3ac11b;if(_0x55e737){if(_0x55e737[_0xb23c('0x20')]){return _0x5b8bb4(_0xb23c('0x21'));}else if(_0xe04b8f[_0xb23c('0x22')]>0x0){if(_0x55e737[_0xb23c('0x23')]){if(moment(_0x55e737['blockedAt'])['add'](_0xe04b8f[_0xb23c('0x22')],_0xb23c('0x24'))>moment()){return _0x5b8bb4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x55e737,0x0,![],null)[_0xb23c('0x17')](function(){return utils[_0xb23c('0x25')](_0x55e737);})['then'](function(){return _0x5b8bb4(null,_0x55e737);});}}else{return utils[_0xb23c('0x25')](_0x55e737)['then'](function(){return _0x5b8bb4(null,_0x55e737);});}}else{return utils[_0xb23c('0x25')](_0x55e737)[_0xb23c('0x17')](function(){return _0x5b8bb4(null,_0x55e737);});}}return _0x5b8bb4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xb23c('0x26')](function(_0xd13bd){_0x5b8bb4(_0xd13bd);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 9e9e7ee..dc036c7 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 _0xbf24=['exports','express','passport','Router','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie'];(function(_0x29e116,_0x451907){var _0x918c53=function(_0x125adc){while(--_0x125adc){_0x29e116['push'](_0x29e116['shift']());}};_0x918c53(++_0x451907);}(_0xbf24,0x155));var _0x4bf2=function(_0x153c6a,_0x2a217a){_0x153c6a=_0x153c6a-0x0;var _0xce898f=_0xbf24[_0x153c6a];return _0xce898f;};'use strict';var express=require(_0x4bf2('0x0'));var passport=require(_0x4bf2('0x1'));var router=express[_0x4bf2('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x4bf2('0x3'));router[_0x4bf2('0x4')]('/',controller[_0x4bf2('0x5')]);router[_0x4bf2('0x4')]('/callback',controller[_0x4bf2('0x6')],authService[_0x4bf2('0x7')],userController[_0x4bf2('0x5')],authService[_0x4bf2('0x8')]);module[_0x4bf2('0x9')]=router;
\ No newline at end of file
+var _0x25f6=['./authGoogle.controller','get','login','/callback','callback','setTokenCookie','exports','express','passport','Router'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x25f6,0x197));var _0x625f=function(_0x57a352,_0xbd7532){_0x57a352=_0x57a352-0x0;var _0x5cd613=_0x25f6[_0x57a352];return _0x5cd613;};'use strict';var express=require(_0x625f('0x0'));var passport=require(_0x625f('0x1'));var router=express[_0x625f('0x2')]();var controller=require(_0x625f('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x625f('0x4')]('/',controller[_0x625f('0x5')]);router['get'](_0x625f('0x6'),controller[_0x625f('0x7')],authService['isMiddleware'],userController['login'],authService[_0x625f('0x8')]);module[_0x625f('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 0b11c49..e4b1682 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 _0xea85=['request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','pass','format','\x22%s\x22\x20<%s>'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xea85,0x1cd));var _0x5ea8=function(_0x1ff48d,_0x488d6c){_0x1ff48d=_0x1ff48d-0x0;var _0x4958c1=_0xea85[_0x1ff48d];return _0x4958c1;};'use strict';var util=require(_0x5ea8('0x0'));var passport=require('passport');var LocalStrategy=require(_0x5ea8('0x1'))[_0x5ea8('0x2')];var jayson=require(_0x5ea8('0x3'));var _=require(_0x5ea8('0x4'));var rs=require(_0x5ea8('0x5'));var moment=require(_0x5ea8('0x6'));var db=require(_0x5ea8('0x7'))['db'];var authService=require(_0x5ea8('0x8'));var utils=require(_0x5ea8('0x9'));var client=jayson[_0x5ea8('0xa')][_0x5ea8('0xb')]({'port':0x232b});function localAuthenticate(_0x3e8eeb,_0x322848,_0x25aa3c,_0xa604ff){var _0x53baa9,_0x27938b;return db[_0x5ea8('0xc')][_0x5ea8('0xd')]({'where':{'id':0x1},'attributes':[_0x5ea8('0xe'),'blockDuration'],'raw':!![]})[_0x5ea8('0xf')](function(_0x1fa8ba){_0x53baa9=_0x1fa8ba;return _0x3e8eeb[_0x5ea8('0xd')]({'attributes':['id',_0x5ea8('0x10'),_0x5ea8('0x11'),_0x5ea8('0x12'),_0x5ea8('0x13'),_0x5ea8('0x14'),_0x5ea8('0x15'),_0x5ea8('0x16'),_0x5ea8('0x17')],'where':{'name':_0x322848,'role':{'$or':['admin',_0x5ea8('0x18'),'agent']}}});})[_0x5ea8('0xf')](function(_0x35dbf4){if(!_0x35dbf4||_0x35dbf4&&_0x35dbf4[_0x5ea8('0x10')]!==_0x322848){throw new Error(_0x5ea8('0x19'));}else{_0x27938b=_0x35dbf4;return _0x27938b;}})[_0x5ea8('0xf')](function(){_0x27938b[_0x5ea8('0x1a')](_0x25aa3c,function(_0x326643,_0x2a82e3){var _0xf63e52=_0x27938b[_0x5ea8('0x17')]+0x1;if(_0x326643){return _0xa604ff(_0x326643);}else if(!_0x2a82e3){if(_0x27938b['disabled']){return _0xa604ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x53baa9[_0x5ea8('0xe')]>0x0){if(_0x27938b[_0x5ea8('0x15')]){if(_0x53baa9[_0x5ea8('0x1b')]>0x0){if(moment(_0x27938b[_0x5ea8('0x16')])[_0x5ea8('0x1c')](_0x53baa9[_0x5ea8('0x1b')],_0x5ea8('0x1d'))>moment()){return _0xa604ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5ea8('0x1e')](_0x27938b,_0xf63e52,![],null)[_0x5ea8('0xf')](function(){return _0xa604ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}}else{if(_0xf63e52>=_0x53baa9[_0x5ea8('0xe')]){return utils['clearBlockUser'](_0x27938b,0x0,!![],moment())[_0x5ea8('0xf')](function(){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});});}else{return utils[_0x5ea8('0x1e')](_0x27938b,_0xf63e52,![],null)['then'](function(){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});});}}}else{return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}}else{if(_0x27938b[_0x5ea8('0x14')]){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}else if(_0x53baa9[_0x5ea8('0xe')]>0x0){if(_0x27938b[_0x5ea8('0x15')]){if(_0x53baa9[_0x5ea8('0x1b')]>0x0){if(moment(_0x27938b[_0x5ea8('0x16')])[_0x5ea8('0x1c')](_0x53baa9[_0x5ea8('0x1b')],'minutes')>moment()){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}else{return utils['clearBlockUser'](_0x27938b,0x0,![],null)[_0x5ea8('0xf')](function(){return utils[_0x5ea8('0x1f')](_0x27938b);})['then'](function(){return _0xa604ff(null,_0x27938b);});}}else{return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}}else{return utils[_0x5ea8('0x1e')](_0x27938b,0x0,![],null)[_0x5ea8('0xf')](function(){return utils[_0x5ea8('0x1f')](_0x27938b);})[_0x5ea8('0xf')](function(){return _0xa604ff(null,_0x27938b);})['catch'](function(_0x26dcf2){return _0xa604ff(null,![],_0x26dcf2);});}}else{if(_0x27938b[_0x5ea8('0x15')]){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}else{return utils[_0x5ea8('0x1f')](_0x27938b)[_0x5ea8('0xf')](function(){return _0xa604ff(null,_0x27938b);});}}}});})[_0x5ea8('0x20')](function(_0x310f00){return _0xa604ff(null,![],_0x310f00);});}function sendServiceMail(_0x1d15ff){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x5ea8('0x10'),_0x5ea8('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x5ea8('0xf')](function(_0x10d7ee){if(!_0x10d7ee){throw new Error(_0x5ea8('0x22'));}var _0x5ccdc0={'tls':{'rejectUnauthorized':![]}};if(_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x24')]){_0x5ccdc0[_0x5ea8('0x24')]=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x24')];}else{_0x5ccdc0['host']=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x25')];_0x5ccdc0[_0x5ea8('0x26')]=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x26')];_0x5ccdc0[_0x5ea8('0x27')]=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x27')];}if(_0x10d7ee['Smtp']['authentication']){_0x5ccdc0['auth']={'user':_0x10d7ee['Smtp'][_0x5ea8('0x18')],'pass':_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x28')]};}var _0x2d8569={'account':_0x5ccdc0,'message':_['merge']({'from':util[_0x5ea8('0x29')](_0x5ea8('0x2a'),_0x10d7ee[_0x5ea8('0x10')],_0x10d7ee['email']||_0x10d7ee['Smtp'][_0x5ea8('0x18')])},_0x1d15ff)};return client[_0x5ea8('0x2b')]('SendMail',_0x2d8569);})[_0x5ea8('0xf')](function(_0x2043f7){if(_0x2043f7['error']){throw new Error(util[_0x5ea8('0x29')](_0x5ea8('0x2c'),_0x2043f7[_0x5ea8('0x2d')][_0x5ea8('0x2e')]||JSON[_0x5ea8('0x2f')](_0x2043f7['error'])));}return!![];});}function handleError(_0x5cd6ad,_0x26cce2,_0x4b6f75){return _0x5cd6ad[_0x5ea8('0x30')](_0x26cce2||0x1f4)[_0x5ea8('0x31')]({'message':_0x4b6f75?_0x4b6f75['message']||_0x4b6f75:''});}exports[_0x5ea8('0x32')]=function(_0x336484,_0x29b858,_0x2f32be){passport[_0x5ea8('0x1a')]('local',function(_0x37e513,_0x1d41af,_0x272f4d){var _0x1ca94d=_0x37e513||_0x272f4d;if(_0x1ca94d){return handleError(_0x29b858,0x191,_0x1ca94d);}if(!_0x1d41af){return handleError(_0x29b858,0x194,{'message':_0x5ea8('0x33')});}else{var _0x26194a={'payload':{'id':_0x1d41af['id'],'role':_0x1d41af['role']},'options':{'expiresIn':0x15180}};return authService[_0x5ea8('0x34')](_0x26194a)[_0x5ea8('0xf')](function(_0x53bb00){_0x29b858[_0x5ea8('0x35')]({'id':_0x1d41af['id'],'token':_0x53bb00,'statusCall':'','isAlreadyLogged':_0x1d41af[_0x5ea8('0x36')]});});}})(_0x336484,_0x29b858,_0x2f32be);};exports[_0x5ea8('0x37')]=function(_0x36479e,_0x5693f9,_0x149b69){if(!_0x36479e['body']['email']){return handleError(_0x5693f9,0x1f4,{'message':_0x5ea8('0x38')});}var _0x3fb795=rs[_0x5ea8('0x39')]();_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')]=_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')][_0x5ea8('0x3b')]()[_0x5ea8('0x3c')]();var _0x5ece13;return db[_0x5ea8('0xc')][_0x5ea8('0xd')]({'where':{'id':0x1},'attributes':[_0x5ea8('0xe'),_0x5ea8('0x1b')],'raw':!![]})[_0x5ea8('0xf')](function(_0x589e00){_0x5ece13=_0x589e00;return db[_0x5ea8('0x3d')][_0x5ea8('0x3e')]({'where':{'email':_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')]}});})[_0x5ea8('0xf')](function(_0x40b0ee){if(!_0x40b0ee){throw new Error(_0x5ea8('0x3f'));}if(_0x40b0ee['disabled']){throw new Error(_0x5ea8('0x40'));}if(_0x40b0ee[_0x5ea8('0x15')]){if(moment(_0x40b0ee['blockedAt'])['add'](_0x5ece13[_0x5ea8('0x1b')],_0x5ea8('0x1d'))>moment()){throw new Error(_0x5ea8('0x41'));}else{_0x40b0ee['blocked']=![];_0x40b0ee['blockedAt']=null;}}_0x40b0ee[_0x5ea8('0x42')]=_0x3fb795;_0x40b0ee['resetPasswordExpires']=Date[_0x5ea8('0x43')]()+0x36ee80;return _0x40b0ee[_0x5ea8('0x44')]();})[_0x5ea8('0xf')](function(){return sendServiceMail({'to':_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')],'subject':_0x5ea8('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5ea8('0x46')+_0x5ea8('0x47')+_0x36479e['headers'][_0x5ea8('0x25')]+'/reset/'+_0x3fb795+'\x0a\x0a'+_0x5ea8('0x48')});})[_0x5ea8('0xf')](function(){_0x5693f9[_0x5ea8('0x30')](0xc8)[_0x5ea8('0x31')]({'message':_0x5ea8('0x49')});})[_0x5ea8('0x20')](function(_0x2ffa03){return handleError(_0x5693f9,0x1f4,_0x2ffa03);});};exports[_0x5ea8('0x4a')]=function(_0x225bee,_0x1d017d,_0x2d9508){return db[_0x5ea8('0x3d')][_0x5ea8('0x3e')]({'where':{'resetPasswordToken':_0x225bee['params'][_0x5ea8('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x5ea8('0x43')]()}}})['then'](function(_0xe4e9f6){if(!_0xe4e9f6){throw new Error(_0x5ea8('0x4c'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x5ea8('0x4d'),_0x5ea8('0x4e')]})[_0x5ea8('0xf')](function(_0xeb4ceb){if(_0xeb4ceb[_0x5ea8('0x4f')])authService[_0x5ea8('0x50')](_0x225bee['body'][_0x5ea8('0x11')]);if(!_0xeb4ceb[_0x5ea8('0x4d')]||!_0xe4e9f6[_0x5ea8('0x51')])return _0xe4e9f6;authService[_0x5ea8('0x52')](_0x225bee['body'][_0x5ea8('0x11')],_0xe4e9f6['previousPasswords'],_0xeb4ceb[_0x5ea8('0x4e')]);return _0xe4e9f6;})[_0x5ea8('0xf')](function(){_0xe4e9f6[_0x5ea8('0x11')]=_0x225bee[_0x5ea8('0x3a')][_0x5ea8('0x11')];_0xe4e9f6[_0x5ea8('0x42')]=null;_0xe4e9f6['resetPasswordExpires']=null;return _0xe4e9f6['save']();});})[_0x5ea8('0xf')](function(){_0x1d017d[_0x5ea8('0x30')](0xc8)[_0x5ea8('0x31')]({'message':'Password\x20reset!'});})[_0x5ea8('0x20')](function(_0x20b5ff){return handleError(_0x1d017d,0x1f4,_0x20b5ff);});};passport[_0x5ea8('0x53')](new LocalStrategy({'usernameField':_0x5ea8('0x10'),'passwordField':_0x5ea8('0x11')},function(_0x77112f,_0x81993c,_0x168cc9){return localAuthenticate(db['User'],_0x77112f,_0x81993c,_0x168cc9);}));
\ No newline at end of file
+var _0xe0dc=['send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','status','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','passwordHistoryLimit','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify'];(function(_0x2e447a,_0x2d694f){var _0x1a3e77=function(_0x585e08){while(--_0x585e08){_0x2e447a['push'](_0x2e447a['shift']());}};_0x1a3e77(++_0x2d694f);}(_0xe0dc,0x77));var _0xce0d=function(_0x135c17,_0x1188b2){_0x135c17=_0x135c17-0x0;var _0x2546b0=_0xe0dc[_0x135c17];return _0x2546b0;};'use strict';var util=require('util');var passport=require(_0xce0d('0x0'));var LocalStrategy=require(_0xce0d('0x1'))[_0xce0d('0x2')];var jayson=require('jayson/promise');var _=require(_0xce0d('0x3'));var rs=require(_0xce0d('0x4'));var moment=require('moment');var db=require(_0xce0d('0x5'))['db'];var authService=require(_0xce0d('0x6'));var utils=require(_0xce0d('0x7'));var client=jayson[_0xce0d('0x8')][_0xce0d('0x9')]({'port':0x232b});function localAuthenticate(_0x499c84,_0x2af3f4,_0x3c9bd5,_0x2d8919){var _0x267b83,_0x374cd8;return db['Setting'][_0xce0d('0xa')]({'where':{'id':0x1},'attributes':[_0xce0d('0xb'),_0xce0d('0xc')],'raw':!![]})[_0xce0d('0xd')](function(_0x1a8bef){_0x267b83=_0x1a8bef;return _0x499c84[_0xce0d('0xa')]({'attributes':['id',_0xce0d('0xe'),'password','salt',_0xce0d('0xf'),_0xce0d('0x10'),_0xce0d('0x11'),'blockedAt',_0xce0d('0x12')],'where':{'name':_0x2af3f4,'role':{'$or':[_0xce0d('0x13'),_0xce0d('0x14'),_0xce0d('0x15')]}}});})[_0xce0d('0xd')](function(_0xd45c05){if(!_0xd45c05||_0xd45c05&&_0xd45c05[_0xce0d('0xe')]!==_0x2af3f4){throw new Error(_0xce0d('0x16'));}else{_0x374cd8=_0xd45c05;return _0x374cd8;}})[_0xce0d('0xd')](function(){_0x374cd8[_0xce0d('0x17')](_0x3c9bd5,function(_0x98505d,_0x6852f1){var _0x1f8b05=_0x374cd8[_0xce0d('0x12')]+0x1;if(_0x98505d){return _0x2d8919(_0x98505d);}else if(!_0x6852f1){if(_0x374cd8['disabled']){return _0x2d8919(null,![],{'message':_0xce0d('0x16')});}else if(_0x267b83[_0xce0d('0xb')]>0x0){if(_0x374cd8[_0xce0d('0x11')]){if(_0x267b83[_0xce0d('0xc')]>0x0){if(moment(_0x374cd8['blockedAt'])[_0xce0d('0x18')](_0x267b83[_0xce0d('0xc')],_0xce0d('0x19'))>moment()){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xce0d('0x1a')](_0x374cd8,_0x1f8b05,![],null)[_0xce0d('0xd')](function(){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1f8b05>=_0x267b83[_0xce0d('0xb')]){return utils['clearBlockUser'](_0x374cd8,0x0,!![],moment())[_0xce0d('0xd')](function(){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xce0d('0x1a')](_0x374cd8,_0x1f8b05,![],null)[_0xce0d('0xd')](function(){return _0x2d8919(null,![],{'message':_0xce0d('0x16')});});}}}else{return _0x2d8919(null,![],{'message':_0xce0d('0x16')});}}else{if(_0x374cd8[_0xce0d('0x10')]){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x267b83[_0xce0d('0xb')]>0x0){if(_0x374cd8['blocked']){if(_0x267b83['blockDuration']>0x0){if(moment(_0x374cd8[_0xce0d('0x1b')])[_0xce0d('0x18')](_0x267b83[_0xce0d('0xc')],_0xce0d('0x19'))>moment()){return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x374cd8,0x0,![],null)[_0xce0d('0xd')](function(){return utils[_0xce0d('0x1c')](_0x374cd8);})[_0xce0d('0xd')](function(){return _0x2d8919(null,_0x374cd8);});}}else{return _0x2d8919(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xce0d('0x1a')](_0x374cd8,0x0,![],null)[_0xce0d('0xd')](function(){return utils[_0xce0d('0x1c')](_0x374cd8);})['then'](function(){return _0x2d8919(null,_0x374cd8);})[_0xce0d('0x1d')](function(_0x3a0b50){return _0x2d8919(null,![],_0x3a0b50);});}}else{if(_0x374cd8[_0xce0d('0x11')]){return _0x2d8919(null,![],{'message':_0xce0d('0x16')});}else{return utils['getLicense'](_0x374cd8)['then'](function(){return _0x2d8919(null,_0x374cd8);});}}}});})[_0xce0d('0x1d')](function(_0x2d9d9f){return _0x2d8919(null,![],_0x2d9d9f);});}function sendServiceMail(_0x2fbaca){return db[_0xce0d('0x1e')][_0xce0d('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xce0d('0xe'),_0xce0d('0x20')],'include':[{'model':db[_0xce0d('0x21')],'as':_0xce0d('0x22')}]})[_0xce0d('0xd')](function(_0x452503){if(!_0x452503){throw new Error(_0xce0d('0x23'));}var _0x2ac5a1={'tls':{'rejectUnauthorized':![]}};if(_0x452503[_0xce0d('0x22')][_0xce0d('0x24')]){_0x2ac5a1[_0xce0d('0x24')]=_0x452503['Smtp'][_0xce0d('0x24')];}else{_0x2ac5a1['host']=_0x452503['Smtp'][_0xce0d('0x25')];_0x2ac5a1['port']=_0x452503[_0xce0d('0x22')]['port'];_0x2ac5a1[_0xce0d('0x26')]=_0x452503[_0xce0d('0x22')][_0xce0d('0x26')];}if(_0x452503[_0xce0d('0x22')]['authentication']){_0x2ac5a1[_0xce0d('0x27')]={'user':_0x452503['Smtp'][_0xce0d('0x14')],'pass':_0x452503[_0xce0d('0x22')][_0xce0d('0x28')]};}var _0x50438f={'account':_0x2ac5a1,'message':_[_0xce0d('0x29')]({'from':util[_0xce0d('0x2a')](_0xce0d('0x2b'),_0x452503[_0xce0d('0xe')],_0x452503[_0xce0d('0x20')]||_0x452503['Smtp'][_0xce0d('0x14')])},_0x2fbaca)};return client[_0xce0d('0x2c')](_0xce0d('0x2d'),_0x50438f);})[_0xce0d('0xd')](function(_0x46da95){if(_0x46da95[_0xce0d('0x2e')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x46da95['error'][_0xce0d('0x2f')]||JSON[_0xce0d('0x30')](_0x46da95[_0xce0d('0x2e')])));}return!![];});}function handleError(_0x226cc0,_0x43bc5e,_0x216908){return _0x226cc0['status'](_0x43bc5e||0x1f4)[_0xce0d('0x31')]({'message':_0x216908?_0x216908[_0xce0d('0x2f')]||_0x216908:''});}exports[_0xce0d('0x32')]=function(_0x47cefc,_0x2ccd1b,_0x44e043){passport[_0xce0d('0x17')](_0xce0d('0x33'),function(_0x5f3d8b,_0x3b7a10,_0x4b0724){var _0x215004=_0x5f3d8b||_0x4b0724;if(_0x215004){return handleError(_0x2ccd1b,0x191,_0x215004);}if(!_0x3b7a10){return handleError(_0x2ccd1b,0x194,{'message':_0xce0d('0x34')});}else{var _0x50df43={'payload':{'id':_0x3b7a10['id'],'role':_0x3b7a10[_0xce0d('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xce0d('0x35')](_0x50df43)[_0xce0d('0xd')](function(_0x312ba4){_0x2ccd1b[_0xce0d('0x36')]({'id':_0x3b7a10['id'],'token':_0x312ba4,'statusCall':'','isAlreadyLogged':_0x3b7a10[_0xce0d('0x37')]});});}})(_0x47cefc,_0x2ccd1b,_0x44e043);};exports[_0xce0d('0x38')]=function(_0x1e6059,_0xed794,_0x22cd15){if(!_0x1e6059[_0xce0d('0x39')][_0xce0d('0x20')]){return handleError(_0xed794,0x1f4,{'message':_0xce0d('0x3a')});}var _0x5206d3=rs[_0xce0d('0x3b')]();_0x1e6059['body'][_0xce0d('0x20')]=_0x1e6059[_0xce0d('0x39')][_0xce0d('0x20')]['trim']()[_0xce0d('0x3c')]();var _0x2290ab;return db[_0xce0d('0x3d')][_0xce0d('0xa')]({'where':{'id':0x1},'attributes':[_0xce0d('0xb'),_0xce0d('0xc')],'raw':!![]})[_0xce0d('0xd')](function(_0x1205ae){_0x2290ab=_0x1205ae;return db[_0xce0d('0x3e')][_0xce0d('0x1f')]({'where':{'email':_0x1e6059[_0xce0d('0x39')]['email']}});})[_0xce0d('0xd')](function(_0x432ded){if(!_0x432ded){throw new Error(_0xce0d('0x3f'));}if(_0x432ded['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x432ded['blocked']){if(moment(_0x432ded[_0xce0d('0x1b')])[_0xce0d('0x18')](_0x2290ab[_0xce0d('0xc')],_0xce0d('0x19'))>moment()){throw new Error(_0xce0d('0x40'));}else{_0x432ded[_0xce0d('0x11')]=![];_0x432ded[_0xce0d('0x1b')]=null;}}_0x432ded[_0xce0d('0x41')]=_0x5206d3;_0x432ded[_0xce0d('0x42')]=Date[_0xce0d('0x43')]()+0x36ee80;return _0x432ded[_0xce0d('0x44')]();})[_0xce0d('0xd')](function(){return sendServiceMail({'to':_0x1e6059[_0xce0d('0x39')][_0xce0d('0x20')],'subject':_0xce0d('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xce0d('0x46')+_0xce0d('0x47')+_0x1e6059['headers']['host']+'/reset/'+_0x5206d3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xce0d('0xd')](function(){_0xed794[_0xce0d('0x48')](0xc8)[_0xce0d('0x31')]({'message':_0xce0d('0x49')});})[_0xce0d('0x1d')](function(_0x36ca3c){return handleError(_0xed794,0x1f4,_0x36ca3c);});};exports['reset']=function(_0x5ba16e,_0x150f8e,_0x5c029c){return db[_0xce0d('0x3e')][_0xce0d('0x1f')]({'where':{'resetPasswordToken':_0x5ba16e[_0xce0d('0x4a')][_0xce0d('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xce0d('0x43')]()}}})['then'](function(_0x41b501){if(!_0x41b501){throw new Error(_0xce0d('0x4c'));}return db[_0xce0d('0x3d')][_0xce0d('0xa')]({'attributes':['id',_0xce0d('0x4d'),_0xce0d('0x4e'),'passwordHistoryLimit']})['then'](function(_0x15e46b){if(_0x15e46b[_0xce0d('0x4d')])authService[_0xce0d('0x4f')](_0x5ba16e[_0xce0d('0x39')][_0xce0d('0x50')]);if(!_0x15e46b['enforcePasswordHistory']||!_0x41b501['previousPasswords'])return _0x41b501;authService[_0xce0d('0x51')](_0x5ba16e['body'][_0xce0d('0x50')],_0x41b501[_0xce0d('0x52')],_0x15e46b[_0xce0d('0x53')]);return _0x41b501;})['then'](function(){_0x41b501[_0xce0d('0x50')]=_0x5ba16e[_0xce0d('0x39')][_0xce0d('0x50')];_0x41b501[_0xce0d('0x41')]=null;_0x41b501[_0xce0d('0x42')]=null;return _0x41b501[_0xce0d('0x44')]();});})[_0xce0d('0xd')](function(){_0x150f8e[_0xce0d('0x48')](0xc8)[_0xce0d('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x279d8c){return handleError(_0x150f8e,0x1f4,_0x279d8c);});};passport['use'](new LocalStrategy({'usernameField':_0xce0d('0xe'),'passwordField':_0xce0d('0x50')},function(_0x185056,_0x5650b3,_0x1033b0){return localAuthenticate(db[_0xce0d('0x3e')],_0x185056,_0x5650b3,_0x1033b0);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index f934ef3..bcd1c63 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 _0xb52c=['post','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x2d6e76,_0x3684f0){var _0x4f651b=function(_0x469f42){while(--_0x469f42){_0x2d6e76['push'](_0x2d6e76['shift']());}};_0x4f651b(++_0x3684f0);}(_0xb52c,0xfd));var _0xcb52=function(_0x3706c9,_0x116ed2){_0x3706c9=_0x3706c9-0x0;var _0x381b53=_0xb52c[_0x3706c9];return _0x381b53;};'use strict';var express=require(_0xcb52('0x0'));var router=express[_0xcb52('0x1')]();var controller=require(_0xcb52('0x2'));router[_0xcb52('0x3')]('/',controller['login']);router[_0xcb52('0x3')]('/forgot',controller[_0xcb52('0x4')]);router[_0xcb52('0x3')](_0xcb52('0x5'),controller[_0xcb52('0x6')]);module[_0xcb52('0x7')]=router;
\ No newline at end of file
+var _0x2bc3=['post','login','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller'];(function(_0x4983b2,_0x25cb64){var _0x315d3a=function(_0x1827a3){while(--_0x1827a3){_0x4983b2['push'](_0x4983b2['shift']());}};_0x315d3a(++_0x25cb64);}(_0x2bc3,0xf9));var _0x32bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc3[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x32bc('0x0'));var router=express[_0x32bc('0x1')]();var controller=require(_0x32bc('0x2'));router[_0x32bc('0x3')]('/',controller[_0x32bc('0x4')]);router[_0x32bc('0x3')](_0x32bc('0x5'),controller[_0x32bc('0x6')]);router['post'](_0x32bc('0x7'),controller[_0x32bc('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 2bb5fdf..30d3c2f 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 _0x6bbe=['STRING','sequelize'];(function(_0x309c84,_0x4b6cd4){var _0x13e5ce=function(_0x3a2d94){while(--_0x3a2d94){_0x309c84['push'](_0x309c84['shift']());}};_0x13e5ce(++_0x4b6cd4);}(_0x6bbe,0x87));var _0xe6bb=function(_0x2b3a83,_0x17a5ea){_0x2b3a83=_0x2b3a83-0x0;var _0x2881c1=_0x6bbe[_0x2b3a83];return _0x2881c1;};'use strict';var Sequelize=require(_0xe6bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xe6bb('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe6bb('0x1')]},'description':{'type':Sequelize[_0xe6bb('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xd9f3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x251504,_0x5abb14){var _0x56ef48=function(_0x33b0ae){while(--_0x33b0ae){_0x251504['push'](_0x251504['shift']());}};_0x56ef48(++_0x5abb14);}(_0xd9f3,0x111));var _0x3d9f=function(_0x1f78aa,_0x36db6f){_0x1f78aa=_0x1f78aa-0x0;var _0x3cb5f9=_0xd9f3[_0x1f78aa];return _0x3cb5f9;};'use strict';var Sequelize=require(_0x3d9f('0x0'));module[_0x3d9f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3d9f('0x2')]},'description':{'type':Sequelize[_0x3d9f('0x2')]},'status':{'type':Sequelize[_0x3d9f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3d9f('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index bde0007..8997390 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 _0x63da=['catch','show','params','keys','options','create','body','find','addConditions','Condition','ids','omit','findOne','order','nolimit','getConditions','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows'];(function(_0x3b37ba,_0x3dc349){var _0x3e6483=function(_0x5b51d7){while(--_0x5b51d7){_0x3b37ba['push'](_0x3b37ba['shift']());}};_0x3e6483(++_0x3dc349);}(_0x63da,0x67));var _0xa63d=function(_0x45f7c9,_0x192a73){_0x45f7c9=_0x45f7c9-0x0;var _0x2c6810=_0x63da[_0x45f7c9];return _0x2c6810;};'use strict';var emlformat=require(_0xa63d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa63d('0x1'));var jsonpatch=require(_0xa63d('0x2'));var rp=require('request-promise');var moment=require(_0xa63d('0x3'));var BPromise=require(_0xa63d('0x4'));var Mustache=require(_0xa63d('0x5'));var util=require(_0xa63d('0x6'));var path=require(_0xa63d('0x7'));var sox=require('sox');var csv=require(_0xa63d('0x8'));var ejs=require(_0xa63d('0x9'));var fs=require('fs');var fs_extra=require(_0xa63d('0xa'));var _=require(_0xa63d('0xb'));var squel=require('squel');var crypto=require(_0xa63d('0xc'));var jsforce=require(_0xa63d('0xd'));var deskjs=require(_0xa63d('0xe'));var toCsv=require(_0xa63d('0x8'));var querystring=require(_0xa63d('0xf'));var Papa=require('papaparse');var Redis=require(_0xa63d('0x10'));var authService=require(_0xa63d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa63d('0x12'));var hardwareService=require(_0xa63d('0x13'));var logger=require(_0xa63d('0x14'))(_0xa63d('0x15'));var utils=require('../../config/utils');var config=require(_0xa63d('0x16'));var licenseUtil=require(_0xa63d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d6fad,_0x1e841b){_0x1e841b=_0x1e841b||0xcc;return function(_0x4c7143){if(_0x4c7143){return _0x2d6fad[_0xa63d('0x18')](_0x1e841b);}return _0x2d6fad[_0xa63d('0x19')](_0x1e841b)[_0xa63d('0x1a')]();};}function respondWithResult(_0x29a41e,_0x4c4cc6){_0x4c4cc6=_0x4c4cc6||0xc8;return function(_0xe47f98){if(_0xe47f98){return _0x29a41e['status'](_0x4c4cc6)[_0xa63d('0x1b')](_0xe47f98);}};}function respondWithFilteredResult(_0x4426c1,_0x10c829){return function(_0x3f46cf){if(_0x3f46cf){var _0x381392=typeof _0x10c829[_0xa63d('0x1c')]==='undefined'&&typeof _0x10c829[_0xa63d('0x1d')]===_0xa63d('0x1e');var _0x4e248e=_0x3f46cf[_0xa63d('0x1f')];var _0x2f4409=_0x381392?0x0:_0x10c829[_0xa63d('0x1c')];var _0x2b1d7e=_0x381392?_0x3f46cf[_0xa63d('0x1f')]:_0x10c829[_0xa63d('0x1c')]+_0x10c829['limit'];var _0x3f84f1;if(_0x2b1d7e>=_0x4e248e){_0x2b1d7e=_0x4e248e;_0x3f84f1=0xc8;}else{_0x3f84f1=0xce;}_0x4426c1[_0xa63d('0x19')](_0x3f84f1);return _0x4426c1[_0xa63d('0x20')](_0xa63d('0x21'),_0x2f4409+'-'+_0x2b1d7e+'/'+_0x4e248e)[_0xa63d('0x1b')](_0x3f46cf);}return null;};}function patchUpdates(_0x4f3a63){return function(_0x4b2abe){try{jsonpatch[_0xa63d('0x22')](_0x4b2abe,_0x4f3a63,!![]);}catch(_0x58c879){return BPromise[_0xa63d('0x23')](_0x58c879);}return _0x4b2abe['save']();};}function saveUpdates(_0x2cf643,_0x195c66){return function(_0x4d6119){if(_0x4d6119){return _0x4d6119[_0xa63d('0x24')](_0x2cf643)[_0xa63d('0x25')](function(_0x12b9ec){return _0x12b9ec;});}return null;};}function removeEntity(_0x23bb42,_0x547a7a){return function(_0x3831b8){if(_0x3831b8){return _0x3831b8[_0xa63d('0x26')]()['then'](function(){_0x23bb42[_0xa63d('0x19')](0xcc)[_0xa63d('0x1a')]();});}};}function handleEntityNotFound(_0x4becd1,_0x10709a){return function(_0x1e1b3c){if(!_0x1e1b3c){_0x4becd1[_0xa63d('0x18')](0x194);}return _0x1e1b3c;};}function handleError(_0x227267,_0x303519){_0x303519=_0x303519||0x1f4;return function(_0x4353c2){logger['error'](_0x4353c2[_0xa63d('0x27')]);if(_0x4353c2[_0xa63d('0x28')]){delete _0x4353c2[_0xa63d('0x28')];}_0x227267[_0xa63d('0x19')](_0x303519)['send'](_0x4353c2);};}exports[_0xa63d('0x29')]=function(_0x15f03a,_0x5e8771){var _0x432316={},_0xf94d1e={},_0x501a3d={'count':0x0,'rows':[]};var _0x34524b=_[_0xa63d('0x2a')](db[_0xa63d('0x2b')][_0xa63d('0x2c')],function(_0x25576a){return{'name':_0x25576a[_0xa63d('0x2d')],'type':_0x25576a[_0xa63d('0x2e')][_0xa63d('0x2f')]};});_0xf94d1e['model']=_[_0xa63d('0x2a')](_0x34524b,_0xa63d('0x28'));_0xf94d1e[_0xa63d('0x30')]=_['keys'](_0x15f03a[_0xa63d('0x30')]);_0xf94d1e['filters']=_[_0xa63d('0x31')](_0xf94d1e[_0xa63d('0x32')],_0xf94d1e[_0xa63d('0x30')]);_0x432316[_0xa63d('0x33')]=_[_0xa63d('0x31')](_0xf94d1e['model'],qs['fields'](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x34')]));_0x432316['attributes']=_0x432316['attributes'][_0xa63d('0x35')]?_0x432316[_0xa63d('0x33')]:_0xf94d1e[_0xa63d('0x32')];if(!_0x15f03a[_0xa63d('0x30')][_0xa63d('0x36')]('nolimit')){_0x432316['limit']=qs['limit'](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x1d')]);_0x432316[_0xa63d('0x1c')]=qs[_0xa63d('0x1c')](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x1c')]);}_0x432316['order']=qs['sort'](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x37')]);_0x432316[_0xa63d('0x38')]=qs[_0xa63d('0x39')](_[_0xa63d('0x3a')](_0x15f03a[_0xa63d('0x30')],_0xf94d1e[_0xa63d('0x39')]),_0x34524b);if(_0x15f03a['query']['filter']){_0x432316[_0xa63d('0x38')]=_[_0xa63d('0x3b')](_0x432316[_0xa63d('0x38')],{'$or':_[_0xa63d('0x2a')](_0x34524b,function(_0x40003a){if(_0x40003a[_0xa63d('0x2e')]!==_0xa63d('0x3c')){var _0x558652={};_0x558652[_0x40003a[_0xa63d('0x28')]]={'$like':'%'+_0x15f03a[_0xa63d('0x30')][_0xa63d('0x3d')]+'%'};return _0x558652;}})});}_0x432316=_[_0xa63d('0x3b')]({},_0x432316,_0x15f03a['options']);var _0x1026a2={'where':_0x432316[_0xa63d('0x38')]};return db[_0xa63d('0x2b')][_0xa63d('0x1f')](_0x1026a2)['then'](function(_0x2066be){_0x501a3d[_0xa63d('0x1f')]=_0x2066be;if(_0x15f03a[_0xa63d('0x30')]['includeAll']){_0x432316[_0xa63d('0x3e')]=[{'all':!![]}];}return db[_0xa63d('0x2b')][_0xa63d('0x3f')](_0x432316);})[_0xa63d('0x25')](function(_0x41125d){_0x501a3d[_0xa63d('0x40')]=_0x41125d;return _0x501a3d;})['then'](respondWithFilteredResult(_0x5e8771,_0x432316))[_0xa63d('0x41')](handleError(_0x5e8771,null));};exports[_0xa63d('0x42')]=function(_0x3701cd,_0x54d3f2){var _0x1546b5={'raw':![],'where':{'id':_0x3701cd[_0xa63d('0x43')]['id']}},_0x4ba20d={};_0x4ba20d['model']=_[_0xa63d('0x44')](db['Automation'][_0xa63d('0x2c')]);_0x4ba20d['query']=_['keys'](_0x3701cd[_0xa63d('0x30')]);_0x4ba20d[_0xa63d('0x39')]=_[_0xa63d('0x31')](_0x4ba20d[_0xa63d('0x32')],_0x4ba20d[_0xa63d('0x30')]);_0x1546b5[_0xa63d('0x33')]=_[_0xa63d('0x31')](_0x4ba20d[_0xa63d('0x32')],qs[_0xa63d('0x34')](_0x3701cd[_0xa63d('0x30')][_0xa63d('0x34')]));_0x1546b5[_0xa63d('0x33')]=_0x1546b5[_0xa63d('0x33')]['length']?_0x1546b5['attributes']:_0x4ba20d['model'];if(_0x3701cd[_0xa63d('0x30')]['includeAll']){_0x1546b5['include']=[{'all':!![]}];}_0x1546b5=_['merge']({},_0x1546b5,_0x3701cd[_0xa63d('0x45')]);return db[_0xa63d('0x2b')]['find'](_0x1546b5)[_0xa63d('0x25')](handleEntityNotFound(_0x54d3f2,null))[_0xa63d('0x25')](respondWithResult(_0x54d3f2,null))['catch'](handleError(_0x54d3f2,null));};exports[_0xa63d('0x46')]=function(_0xa9086b,_0x5709b7){return db[_0xa63d('0x2b')][_0xa63d('0x46')](_0xa9086b[_0xa63d('0x47')],{})[_0xa63d('0x25')](respondWithResult(_0x5709b7,0xc9))['catch'](handleError(_0x5709b7,null));};exports[_0xa63d('0x24')]=function(_0x55984e,_0x233dc0){if(_0x55984e['body']['id']){delete _0x55984e[_0xa63d('0x47')]['id'];}return db[_0xa63d('0x2b')][_0xa63d('0x48')]({'where':{'id':_0x55984e[_0xa63d('0x43')]['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x233dc0,null))['then'](saveUpdates(_0x55984e[_0xa63d('0x47')],null))[_0xa63d('0x25')](respondWithResult(_0x233dc0,null))['catch'](handleError(_0x233dc0,null));};exports['destroy']=function(_0x9196c,_0x76891d){return db[_0xa63d('0x2b')][_0xa63d('0x48')]({'where':{'id':_0x9196c[_0xa63d('0x43')]['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x76891d,null))[_0xa63d('0x25')](removeEntity(_0x76891d,null))['catch'](handleError(_0x76891d,null));};exports[_0xa63d('0x49')]=function(_0xe9e1cc,_0x5f1c29,_0x5de103){return db[_0xa63d('0x4a')][_0xa63d('0x48')]({'where':{'id':_0xe9e1cc['params']['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x5f1c29,null))[_0xa63d('0x25')](function(_0x4bc459){if(_0x4bc459){return _0x4bc459['addConditions'](_0xe9e1cc[_0xa63d('0x47')][_0xa63d('0x4b')],_[_0xa63d('0x4c')](_0xe9e1cc['body'],[_0xa63d('0x4b'),'id'])||{});}})[_0xa63d('0x25')](respondWithResult(_0x5f1c29,null))[_0xa63d('0x41')](handleError(_0x5f1c29,null));};exports['getConditions']=function(_0x24c971,_0x324c4b,_0x271b55){var _0x853f29={};var _0xffc7e5={};var _0x3c2608;var _0x102d40;return db[_0xa63d('0x2b')][_0xa63d('0x4d')]({'where':{'id':_0x24c971['params']['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x324c4b,null))[_0xa63d('0x25')](function(_0x2717ae){if(_0x2717ae){_0x3c2608=_0x2717ae;_0xffc7e5['model']=_[_0xa63d('0x44')](db[_0xa63d('0x4a')][_0xa63d('0x2c')]);_0xffc7e5[_0xa63d('0x30')]=_['keys'](_0x24c971['query']);_0xffc7e5['filters']=_[_0xa63d('0x31')](_0xffc7e5['model'],_0xffc7e5[_0xa63d('0x30')]);_0x853f29[_0xa63d('0x33')]=_['intersection'](_0xffc7e5[_0xa63d('0x32')],qs[_0xa63d('0x34')](_0x24c971[_0xa63d('0x30')][_0xa63d('0x34')]));_0x853f29['attributes']=_0x853f29[_0xa63d('0x33')]['length']?_0x853f29[_0xa63d('0x33')]:_0xffc7e5[_0xa63d('0x32')];_0x853f29[_0xa63d('0x4e')]=qs['sort'](_0x24c971['query'][_0xa63d('0x37')]);_0x853f29[_0xa63d('0x38')]=qs[_0xa63d('0x39')](_['pick'](_0x24c971[_0xa63d('0x30')],_0xffc7e5[_0xa63d('0x39')]));if(_0x24c971['query']['filter']){_0x853f29[_0xa63d('0x38')]=_['merge'](_0x853f29[_0xa63d('0x38')],{'$or':_[_0xa63d('0x2a')](_0x853f29[_0xa63d('0x33')],function(_0x24f96e){var _0x2a824a={};_0x2a824a[_0x24f96e]={'$like':'%'+_0x24c971['query'][_0xa63d('0x3d')]+'%'};return _0x2a824a;})});}_0x853f29=_['merge']({},_0x853f29,_0x24c971[_0xa63d('0x45')]);return _0x3c2608['getConditions'](_0x853f29);}})[_0xa63d('0x25')](function(_0x3ec44e){if(_0x3ec44e){_0x102d40=_0x3ec44e[_0xa63d('0x35')];if(!_0x24c971[_0xa63d('0x30')][_0xa63d('0x36')](_0xa63d('0x4f'))){_0x853f29[_0xa63d('0x1d')]=qs[_0xa63d('0x1d')](_0x24c971[_0xa63d('0x30')][_0xa63d('0x1d')]);_0x853f29[_0xa63d('0x1c')]=qs[_0xa63d('0x1c')](_0x24c971[_0xa63d('0x30')][_0xa63d('0x1c')]);}return _0x3c2608[_0xa63d('0x50')](_0x853f29);}})[_0xa63d('0x25')](function(_0x5499ee){if(_0x5499ee){return _0x5499ee?{'count':_0x102d40,'rows':_0x5499ee}:null;}})[_0xa63d('0x25')](respondWithResult(_0x324c4b,null))[_0xa63d('0x41')](handleError(_0x324c4b,null));};exports[_0xa63d('0x51')]=function(_0x1d37e4,_0x552d8e,_0x207777){return db[_0xa63d('0x52')]['find']({'where':{'id':_0x1d37e4[_0xa63d('0x43')]['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x552d8e,null))[_0xa63d('0x25')](function(_0x1b13c0){if(_0x1b13c0){return _0x1b13c0['addActions'](_0x1d37e4[_0xa63d('0x47')][_0xa63d('0x4b')],_[_0xa63d('0x4c')](_0x1d37e4[_0xa63d('0x47')],[_0xa63d('0x4b'),'id'])||{});}})[_0xa63d('0x25')](respondWithResult(_0x552d8e,null))[_0xa63d('0x41')](handleError(_0x552d8e,null));};exports[_0xa63d('0x53')]=function(_0x5f3db1,_0x4276c0,_0x1ec35d){var _0x2a814c={};var _0x309a3a={};var _0x4523bc;var _0x187d2d;return db[_0xa63d('0x2b')][_0xa63d('0x4d')]({'where':{'id':_0x5f3db1['params']['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x4276c0,null))['then'](function(_0x3b1989){if(_0x3b1989){_0x4523bc=_0x3b1989;_0x309a3a[_0xa63d('0x32')]=_[_0xa63d('0x44')](db[_0xa63d('0x52')][_0xa63d('0x2c')]);_0x309a3a['query']=_[_0xa63d('0x44')](_0x5f3db1[_0xa63d('0x30')]);_0x309a3a[_0xa63d('0x39')]=_[_0xa63d('0x31')](_0x309a3a[_0xa63d('0x32')],_0x309a3a[_0xa63d('0x30')]);_0x2a814c['attributes']=_[_0xa63d('0x31')](_0x309a3a['model'],qs[_0xa63d('0x34')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x34')]));_0x2a814c[_0xa63d('0x33')]=_0x2a814c['attributes'][_0xa63d('0x35')]?_0x2a814c[_0xa63d('0x33')]:_0x309a3a[_0xa63d('0x32')];_0x2a814c[_0xa63d('0x4e')]=qs[_0xa63d('0x37')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x37')]);_0x2a814c[_0xa63d('0x38')]=qs[_0xa63d('0x39')](_[_0xa63d('0x3a')](_0x5f3db1[_0xa63d('0x30')],_0x309a3a[_0xa63d('0x39')]));if(_0x5f3db1[_0xa63d('0x30')]['filter']){_0x2a814c[_0xa63d('0x38')]=_[_0xa63d('0x3b')](_0x2a814c[_0xa63d('0x38')],{'$or':_[_0xa63d('0x2a')](_0x2a814c[_0xa63d('0x33')],function(_0x2e2c02){var _0x24853a={};_0x24853a[_0x2e2c02]={'$like':'%'+_0x5f3db1['query'][_0xa63d('0x3d')]+'%'};return _0x24853a;})});}_0x2a814c=_['merge']({},_0x2a814c,_0x5f3db1['options']);return _0x4523bc[_0xa63d('0x53')](_0x2a814c);}})['then'](function(_0x19057e){if(_0x19057e){_0x187d2d=_0x19057e[_0xa63d('0x35')];if(!_0x5f3db1['query'][_0xa63d('0x36')](_0xa63d('0x4f'))){_0x2a814c[_0xa63d('0x1d')]=qs[_0xa63d('0x1d')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x1d')]);_0x2a814c[_0xa63d('0x1c')]=qs[_0xa63d('0x1c')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x1c')]);}return _0x4523bc[_0xa63d('0x53')](_0x2a814c);}})[_0xa63d('0x25')](function(_0xc847b9){if(_0xc847b9){return _0xc847b9?{'count':_0x187d2d,'rows':_0xc847b9}:null;}})[_0xa63d('0x25')](respondWithResult(_0x4276c0,null))[_0xa63d('0x41')](handleError(_0x4276c0,null));};
\ No newline at end of file
+var _0x8a92=['then','rows','catch','show','params','options','create','update','body','find','addConditions','Condition','ids','omit','getConditions','pick','nolimit','addActions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','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','end','status','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','sendStatus','name','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll'];(function(_0x385eee,_0x270cca){var _0x41fd49=function(_0x6bb501){while(--_0x6bb501){_0x385eee['push'](_0x385eee['shift']());}};_0x41fd49(++_0x270cca);}(_0x8a92,0xbb));var _0x28a9=function(_0x1494a3,_0x1e2a9b){_0x1494a3=_0x1494a3-0x0;var _0x262530=_0x8a92[_0x1494a3];return _0x262530;};'use strict';var emlformat=require(_0x28a9('0x0'));var rimraf=require(_0x28a9('0x1'));var zipdir=require(_0x28a9('0x2'));var jsonpatch=require(_0x28a9('0x3'));var rp=require(_0x28a9('0x4'));var moment=require(_0x28a9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x28a9('0x6'));var util=require(_0x28a9('0x7'));var path=require(_0x28a9('0x8'));var sox=require(_0x28a9('0x9'));var csv=require(_0x28a9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28a9('0xb'));var squel=require('squel');var crypto=require(_0x28a9('0xc'));var jsforce=require(_0x28a9('0xd'));var deskjs=require(_0x28a9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x28a9('0xf'));var Papa=require(_0x28a9('0x10'));var Redis=require(_0x28a9('0x11'));var authService=require(_0x28a9('0x12'));var qs=require(_0x28a9('0x13'));var as=require(_0x28a9('0x14'));var hardwareService=require(_0x28a9('0x15'));var logger=require(_0x28a9('0x16'))('api');var utils=require(_0x28a9('0x17'));var config=require(_0x28a9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x28a9('0x19'))['db'];function respondWithStatusCode(_0x11b390,_0x4b31e4){_0x4b31e4=_0x4b31e4||0xcc;return function(_0x4d283a){if(_0x4d283a){return _0x11b390['sendStatus'](_0x4b31e4);}return _0x11b390['status'](_0x4b31e4)[_0x28a9('0x1a')]();};}function respondWithResult(_0x373ada,_0x120cb8){_0x120cb8=_0x120cb8||0xc8;return function(_0x14b41f){if(_0x14b41f){return _0x373ada[_0x28a9('0x1b')](_0x120cb8)['json'](_0x14b41f);}};}function respondWithFilteredResult(_0x56fdc6,_0x19c450){return function(_0x439d43){if(_0x439d43){var _0xa45b6a=typeof _0x19c450[_0x28a9('0x1c')]==='undefined'&&typeof _0x19c450[_0x28a9('0x1d')]===_0x28a9('0x1e');var _0x423cb6=_0x439d43[_0x28a9('0x1f')];var _0x1c8739=_0xa45b6a?0x0:_0x19c450['offset'];var _0xc6d99f=_0xa45b6a?_0x439d43[_0x28a9('0x1f')]:_0x19c450['offset']+_0x19c450['limit'];var _0x2097c7;if(_0xc6d99f>=_0x423cb6){_0xc6d99f=_0x423cb6;_0x2097c7=0xc8;}else{_0x2097c7=0xce;}_0x56fdc6[_0x28a9('0x1b')](_0x2097c7);return _0x56fdc6[_0x28a9('0x20')](_0x28a9('0x21'),_0x1c8739+'-'+_0xc6d99f+'/'+_0x423cb6)['json'](_0x439d43);}return null;};}function patchUpdates(_0x544775){return function(_0xebfca7){try{jsonpatch['apply'](_0xebfca7,_0x544775,!![]);}catch(_0x4a7af3){return BPromise[_0x28a9('0x22')](_0x4a7af3);}return _0xebfca7[_0x28a9('0x23')]();};}function saveUpdates(_0x3de8e2,_0x2cf5e1){return function(_0x500297){if(_0x500297){return _0x500297['update'](_0x3de8e2)['then'](function(_0x27f089){return _0x27f089;});}return null;};}function removeEntity(_0x2fe7bf,_0x412eb3){return function(_0x1e2b77){if(_0x1e2b77){return _0x1e2b77[_0x28a9('0x24')]()['then'](function(){_0x2fe7bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa0ab21,_0x134795){return function(_0x3fb900){if(!_0x3fb900){_0xa0ab21[_0x28a9('0x25')](0x194);}return _0x3fb900;};}function handleError(_0x159c3d,_0x4b35ac){_0x4b35ac=_0x4b35ac||0x1f4;return function(_0x4628b3){logger['error'](_0x4628b3['stack']);if(_0x4628b3['name']){delete _0x4628b3[_0x28a9('0x26')];}_0x159c3d[_0x28a9('0x1b')](_0x4b35ac)['send'](_0x4628b3);};}exports[_0x28a9('0x27')]=function(_0x50e5e5,_0x429e7b){var _0x3c233c={},_0x46cba7={},_0x3cd009={'count':0x0,'rows':[]};var _0x2c2048=_[_0x28a9('0x28')](db[_0x28a9('0x29')][_0x28a9('0x2a')],function(_0x2b24ea){return{'name':_0x2b24ea[_0x28a9('0x2b')],'type':_0x2b24ea[_0x28a9('0x2c')][_0x28a9('0x2d')]};});_0x46cba7['model']=_[_0x28a9('0x28')](_0x2c2048,_0x28a9('0x26'));_0x46cba7['query']=_[_0x28a9('0x2e')](_0x50e5e5[_0x28a9('0x2f')]);_0x46cba7[_0x28a9('0x30')]=_['intersection'](_0x46cba7[_0x28a9('0x31')],_0x46cba7[_0x28a9('0x2f')]);_0x3c233c[_0x28a9('0x32')]=_[_0x28a9('0x33')](_0x46cba7[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x34')]));_0x3c233c[_0x28a9('0x32')]=_0x3c233c[_0x28a9('0x32')][_0x28a9('0x35')]?_0x3c233c[_0x28a9('0x32')]:_0x46cba7[_0x28a9('0x31')];if(!_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x36')]('nolimit')){_0x3c233c['limit']=qs[_0x28a9('0x1d')](_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x1d')]);_0x3c233c['offset']=qs['offset'](_0x50e5e5['query'][_0x28a9('0x1c')]);}_0x3c233c[_0x28a9('0x37')]=qs[_0x28a9('0x38')](_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x38')]);_0x3c233c[_0x28a9('0x39')]=qs[_0x28a9('0x30')](_['pick'](_0x50e5e5[_0x28a9('0x2f')],_0x46cba7[_0x28a9('0x30')]),_0x2c2048);if(_0x50e5e5['query'][_0x28a9('0x3a')]){_0x3c233c[_0x28a9('0x39')]=_[_0x28a9('0x3b')](_0x3c233c[_0x28a9('0x39')],{'$or':_[_0x28a9('0x28')](_0x2c2048,function(_0x1bab6f){if(_0x1bab6f[_0x28a9('0x2c')]!==_0x28a9('0x3c')){var _0x2dfe32={};_0x2dfe32[_0x1bab6f[_0x28a9('0x26')]]={'$like':'%'+_0x50e5e5[_0x28a9('0x2f')]['filter']+'%'};return _0x2dfe32;}})});}_0x3c233c=_[_0x28a9('0x3b')]({},_0x3c233c,_0x50e5e5['options']);var _0x584522={'where':_0x3c233c[_0x28a9('0x39')]};return db['Automation'][_0x28a9('0x1f')](_0x584522)['then'](function(_0x3cdcee){_0x3cd009[_0x28a9('0x1f')]=_0x3cdcee;if(_0x50e5e5[_0x28a9('0x2f')][_0x28a9('0x3d')]){_0x3c233c['include']=[{'all':!![]}];}return db[_0x28a9('0x29')]['findAll'](_0x3c233c);})[_0x28a9('0x3e')](function(_0x12dd3f){_0x3cd009[_0x28a9('0x3f')]=_0x12dd3f;return _0x3cd009;})['then'](respondWithFilteredResult(_0x429e7b,_0x3c233c))[_0x28a9('0x40')](handleError(_0x429e7b,null));};exports[_0x28a9('0x41')]=function(_0x32b87f,_0x541787){var _0x597e8d={'raw':![],'where':{'id':_0x32b87f[_0x28a9('0x42')]['id']}},_0x18c94a={};_0x18c94a['model']=_['keys'](db['Automation']['rawAttributes']);_0x18c94a[_0x28a9('0x2f')]=_[_0x28a9('0x2e')](_0x32b87f[_0x28a9('0x2f')]);_0x18c94a['filters']=_['intersection'](_0x18c94a[_0x28a9('0x31')],_0x18c94a['query']);_0x597e8d['attributes']=_[_0x28a9('0x33')](_0x18c94a[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x32b87f[_0x28a9('0x2f')]['fields']));_0x597e8d[_0x28a9('0x32')]=_0x597e8d['attributes'][_0x28a9('0x35')]?_0x597e8d[_0x28a9('0x32')]:_0x18c94a[_0x28a9('0x31')];if(_0x32b87f[_0x28a9('0x2f')][_0x28a9('0x3d')]){_0x597e8d['include']=[{'all':!![]}];}_0x597e8d=_[_0x28a9('0x3b')]({},_0x597e8d,_0x32b87f[_0x28a9('0x43')]);return db[_0x28a9('0x29')]['find'](_0x597e8d)[_0x28a9('0x3e')](handleEntityNotFound(_0x541787,null))[_0x28a9('0x3e')](respondWithResult(_0x541787,null))[_0x28a9('0x40')](handleError(_0x541787,null));};exports['create']=function(_0x13e724,_0x428188){return db[_0x28a9('0x29')][_0x28a9('0x44')](_0x13e724['body'],{})[_0x28a9('0x3e')](respondWithResult(_0x428188,0xc9))['catch'](handleError(_0x428188,null));};exports[_0x28a9('0x45')]=function(_0x418426,_0x228dbd){if(_0x418426['body']['id']){delete _0x418426['body']['id'];}return db[_0x28a9('0x29')]['find']({'where':{'id':_0x418426[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0x228dbd,null))[_0x28a9('0x3e')](saveUpdates(_0x418426[_0x28a9('0x46')],null))['then'](respondWithResult(_0x228dbd,null))[_0x28a9('0x40')](handleError(_0x228dbd,null));};exports[_0x28a9('0x24')]=function(_0x8a6749,_0xf27f14){return db[_0x28a9('0x29')][_0x28a9('0x47')]({'where':{'id':_0x8a6749[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0xf27f14,null))[_0x28a9('0x3e')](removeEntity(_0xf27f14,null))['catch'](handleError(_0xf27f14,null));};exports[_0x28a9('0x48')]=function(_0x1b0200,_0x3c4884,_0x2d4f88){return db[_0x28a9('0x49')][_0x28a9('0x47')]({'where':{'id':_0x1b0200['params']['id']}})['then'](handleEntityNotFound(_0x3c4884,null))[_0x28a9('0x3e')](function(_0x5c231e){if(_0x5c231e){return _0x5c231e[_0x28a9('0x48')](_0x1b0200[_0x28a9('0x46')][_0x28a9('0x4a')],_[_0x28a9('0x4b')](_0x1b0200[_0x28a9('0x46')],[_0x28a9('0x4a'),'id'])||{});}})[_0x28a9('0x3e')](respondWithResult(_0x3c4884,null))[_0x28a9('0x40')](handleError(_0x3c4884,null));};exports[_0x28a9('0x4c')]=function(_0x29ee32,_0x58ed36,_0x14eb23){var _0x131f83={};var _0x52400d={};var _0x3724a1;var _0xbc5d33;return db['Automation']['findOne']({'where':{'id':_0x29ee32[_0x28a9('0x42')]['id']}})['then'](handleEntityNotFound(_0x58ed36,null))[_0x28a9('0x3e')](function(_0x3b5f44){if(_0x3b5f44){_0x3724a1=_0x3b5f44;_0x52400d[_0x28a9('0x31')]=_[_0x28a9('0x2e')](db['Condition']['rawAttributes']);_0x52400d[_0x28a9('0x2f')]=_['keys'](_0x29ee32['query']);_0x52400d[_0x28a9('0x30')]=_[_0x28a9('0x33')](_0x52400d[_0x28a9('0x31')],_0x52400d[_0x28a9('0x2f')]);_0x131f83[_0x28a9('0x32')]=_[_0x28a9('0x33')](_0x52400d[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x29ee32['query'][_0x28a9('0x34')]));_0x131f83['attributes']=_0x131f83['attributes'][_0x28a9('0x35')]?_0x131f83['attributes']:_0x52400d['model'];_0x131f83['order']=qs[_0x28a9('0x38')](_0x29ee32[_0x28a9('0x2f')][_0x28a9('0x38')]);_0x131f83[_0x28a9('0x39')]=qs['filters'](_[_0x28a9('0x4d')](_0x29ee32[_0x28a9('0x2f')],_0x52400d[_0x28a9('0x30')]));if(_0x29ee32['query'][_0x28a9('0x3a')]){_0x131f83['where']=_[_0x28a9('0x3b')](_0x131f83[_0x28a9('0x39')],{'$or':_['map'](_0x131f83['attributes'],function(_0x75d099){var _0xc879c0={};_0xc879c0[_0x75d099]={'$like':'%'+_0x29ee32[_0x28a9('0x2f')][_0x28a9('0x3a')]+'%'};return _0xc879c0;})});}_0x131f83=_[_0x28a9('0x3b')]({},_0x131f83,_0x29ee32[_0x28a9('0x43')]);return _0x3724a1[_0x28a9('0x4c')](_0x131f83);}})[_0x28a9('0x3e')](function(_0x45699e){if(_0x45699e){_0xbc5d33=_0x45699e[_0x28a9('0x35')];if(!_0x29ee32[_0x28a9('0x2f')]['hasOwnProperty'](_0x28a9('0x4e'))){_0x131f83[_0x28a9('0x1d')]=qs[_0x28a9('0x1d')](_0x29ee32['query'][_0x28a9('0x1d')]);_0x131f83[_0x28a9('0x1c')]=qs['offset'](_0x29ee32[_0x28a9('0x2f')]['offset']);}return _0x3724a1['getConditions'](_0x131f83);}})[_0x28a9('0x3e')](function(_0x27e5ed){if(_0x27e5ed){return _0x27e5ed?{'count':_0xbc5d33,'rows':_0x27e5ed}:null;}})[_0x28a9('0x3e')](respondWithResult(_0x58ed36,null))[_0x28a9('0x40')](handleError(_0x58ed36,null));};exports['addActions']=function(_0x284b59,_0xa5531,_0x276f7f){return db['Action'][_0x28a9('0x47')]({'where':{'id':_0x284b59[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0xa5531,null))[_0x28a9('0x3e')](function(_0x536406){if(_0x536406){return _0x536406[_0x28a9('0x4f')](_0x284b59[_0x28a9('0x46')][_0x28a9('0x4a')],_[_0x28a9('0x4b')](_0x284b59['body'],[_0x28a9('0x4a'),'id'])||{});}})[_0x28a9('0x3e')](respondWithResult(_0xa5531,null))[_0x28a9('0x40')](handleError(_0xa5531,null));};exports['getActions']=function(_0x1effcf,_0x32325c,_0x35955c){var _0x139dfc={};var _0x23a2b7={};var _0x290b84;var _0x375cd2;return db[_0x28a9('0x29')][_0x28a9('0x50')]({'where':{'id':_0x1effcf[_0x28a9('0x42')]['id']}})[_0x28a9('0x3e')](handleEntityNotFound(_0x32325c,null))['then'](function(_0x2e45a0){if(_0x2e45a0){_0x290b84=_0x2e45a0;_0x23a2b7[_0x28a9('0x31')]=_['keys'](db[_0x28a9('0x51')][_0x28a9('0x2a')]);_0x23a2b7[_0x28a9('0x2f')]=_[_0x28a9('0x2e')](_0x1effcf[_0x28a9('0x2f')]);_0x23a2b7[_0x28a9('0x30')]=_[_0x28a9('0x33')](_0x23a2b7[_0x28a9('0x31')],_0x23a2b7[_0x28a9('0x2f')]);_0x139dfc['attributes']=_[_0x28a9('0x33')](_0x23a2b7[_0x28a9('0x31')],qs[_0x28a9('0x34')](_0x1effcf['query']['fields']));_0x139dfc[_0x28a9('0x32')]=_0x139dfc[_0x28a9('0x32')][_0x28a9('0x35')]?_0x139dfc[_0x28a9('0x32')]:_0x23a2b7[_0x28a9('0x31')];_0x139dfc[_0x28a9('0x37')]=qs['sort'](_0x1effcf[_0x28a9('0x2f')][_0x28a9('0x38')]);_0x139dfc[_0x28a9('0x39')]=qs[_0x28a9('0x30')](_[_0x28a9('0x4d')](_0x1effcf[_0x28a9('0x2f')],_0x23a2b7[_0x28a9('0x30')]));if(_0x1effcf[_0x28a9('0x2f')]['filter']){_0x139dfc[_0x28a9('0x39')]=_['merge'](_0x139dfc[_0x28a9('0x39')],{'$or':_[_0x28a9('0x28')](_0x139dfc['attributes'],function(_0x29042c){var _0x31eb0e={};_0x31eb0e[_0x29042c]={'$like':'%'+_0x1effcf[_0x28a9('0x2f')]['filter']+'%'};return _0x31eb0e;})});}_0x139dfc=_[_0x28a9('0x3b')]({},_0x139dfc,_0x1effcf['options']);return _0x290b84[_0x28a9('0x52')](_0x139dfc);}})[_0x28a9('0x3e')](function(_0x16fd1d){if(_0x16fd1d){_0x375cd2=_0x16fd1d['length'];if(!_0x1effcf[_0x28a9('0x2f')][_0x28a9('0x36')](_0x28a9('0x4e'))){_0x139dfc['limit']=qs[_0x28a9('0x1d')](_0x1effcf[_0x28a9('0x2f')]['limit']);_0x139dfc['offset']=qs[_0x28a9('0x1c')](_0x1effcf[_0x28a9('0x2f')][_0x28a9('0x1c')]);}return _0x290b84[_0x28a9('0x52')](_0x139dfc);}})[_0x28a9('0x3e')](function(_0x1d85d9){if(_0x1d85d9){return _0x1d85d9?{'count':_0x375cd2,'rows':_0x1d85d9}:null;}})[_0x28a9('0x3e')](respondWithResult(_0x32325c,null))[_0x28a9('0x40')](handleError(_0x32325c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3f2899b..c1d0f6b 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 _0x0540=['moment','bluebird','request-promise','./automation.attributes','exports','define','Automation','lodash','util'];(function(_0x4ff15a,_0x509c8e){var _0x281ac6=function(_0x1de6d1){while(--_0x1de6d1){_0x4ff15a['push'](_0x4ff15a['shift']());}};_0x281ac6(++_0x509c8e);}(_0x0540,0x103));var _0x0054=function(_0x3baf7f,_0x2c14ce){_0x3baf7f=_0x3baf7f-0x0;var _0x49cf7b=_0x0540[_0x3baf7f];return _0x49cf7b;};'use strict';var _=require(_0x0054('0x0'));var util=require(_0x0054('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0054('0x2'));var BPromise=require(_0x0054('0x3'));var rp=require(_0x0054('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0054('0x5'));module[_0x0054('0x6')]=function(_0x449b7f,_0x5e9d2b){return _0x449b7f[_0x0054('0x7')](_0x0054('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63a1=['define','Automation','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x63a1,0xe6));var _0x163a=function(_0x5e6f63,_0x36f9ba){_0x5e6f63=_0x5e6f63-0x0;var _0x3e1b24=_0x63a1[_0x5e6f63];return _0x3e1b24;};'use strict';var _=require(_0x163a('0x0'));var util=require(_0x163a('0x1'));var logger=require(_0x163a('0x2'))(_0x163a('0x3'));var moment=require(_0x163a('0x4'));var BPromise=require(_0x163a('0x5'));var rp=require(_0x163a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x163a('0x7'));var config=require(_0x163a('0x8'));var attributes=require('./automation.attributes');module[_0x163a('0x9')]=function(_0x46e19b,_0x3f2000){return _0x46e19b[_0x163a('0xa')](_0x163a('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 6e0ea5e..f24d842 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 _0x45d8=['../../config/utils','rpc','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5497d3,_0x193adf){var _0x42f1ef=function(_0x83263f){while(--_0x83263f){_0x5497d3['push'](_0x5497d3['shift']());}};_0x42f1ef(++_0x193adf);}(_0x45d8,0x174));var _0x845d=function(_0x9e05d1,_0x3cef4a){_0x9e05d1=_0x9e05d1-0x0;var _0x4f7e97=_0x45d8[_0x9e05d1];return _0x4f7e97;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var moment=require(_0x845d('0x2'));var BPromise=require(_0x845d('0x3'));var rs=require(_0x845d('0x4'));var fs=require('fs');var Redis=require(_0x845d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x845d('0x6'));var logger=require('../../config/logger')(_0x845d('0x7'));var config=require(_0x845d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x845d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a59a2,_0x33c493,_0x94a7f5){return new BPromise(function(_0x34a0bf,_0xc26c7d){return client[_0x845d('0xa')](_0x4a59a2,_0x94a7f5)[_0x845d('0xb')](function(_0x5a9113){logger[_0x845d('0xc')](_0x845d('0xd'),_0x33c493,'request\x20sent');logger['debug'](_0x845d('0xe'),_0x33c493,_0x845d('0xf'),JSON[_0x845d('0x10')](_0x5a9113));if(_0x5a9113[_0x845d('0x11')]){if(_0x5a9113[_0x845d('0x11')]['code']===0x1f4){logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')][_0x845d('0x12')]);return _0xc26c7d(_0x5a9113['error']['message']);}logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')]['message']);return _0x34a0bf(_0x5a9113[_0x845d('0x11')]['message']);}else{logger[_0x845d('0xc')]('Automation,\x20%s,\x20%s',_0x33c493,_0x845d('0xf'));_0x34a0bf(_0x5a9113[_0x845d('0x13')][_0x845d('0x12')]);}})[_0x845d('0x14')](function(_0x2a592){logger['error']('Automation,\x20%s,\x20%s',_0x33c493,_0x2a592);_0xc26c7d(_0x2a592);});});}
\ No newline at end of file
+var _0x9148=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57d640,_0x4af08a){var _0xd11d78=function(_0x44e824){while(--_0x44e824){_0x57d640['push'](_0x57d640['shift']());}};_0xd11d78(++_0x4af08a);}(_0x9148,0x10d));var _0x8914=function(_0x4a5070,_0x43eca5){_0x4a5070=_0x4a5070-0x0;var _0x1800de=_0x9148[_0x4a5070];return _0x1800de;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd146,_0x58e892,_0x1b0445){return new BPromise(function(_0x15aff5,_0x1e2d12){return client[_0x8914('0xc')](_0x1cd146,_0x1b0445)['then'](function(_0x2e7aac){logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));logger[_0x8914('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x58e892,_0x8914('0xf'),JSON[_0x8914('0x11')](_0x2e7aac));if(_0x2e7aac['error']){if(_0x2e7aac['error'][_0x8914('0x12')]===0x1f4){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);return _0x1e2d12(_0x2e7aac[_0x8914('0x13')]['message']);}logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x2e7aac['error'][_0x8914('0x14')]);return _0x15aff5(_0x2e7aac[_0x8914('0x13')][_0x8914('0x14')]);}else{logger[_0x8914('0xd')](_0x8914('0xe'),_0x58e892,_0x8914('0xf'));_0x15aff5(_0x2e7aac[_0x8914('0x15')][_0x8914('0x14')]);}})[_0x8914('0x16')](function(_0x4ca130){logger[_0x8914('0x13')](_0x8914('0xe'),_0x58e892,_0x4ca130);_0x1e2d12(_0x4ca130);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index b8db463..cc7ab36 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 _0xabcb=['isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x8e2972,_0x349a62){var _0x29b2f4=function(_0x45009c){while(--_0x45009c){_0x8e2972['push'](_0x8e2972['shift']());}};_0x29b2f4(++_0x349a62);}(_0xabcb,0xf9));var _0xbabc=function(_0x59399b,_0x355fdf){_0x59399b=_0x59399b-0x0;var _0x5658bb=_0xabcb[_0x59399b];return _0x5658bb;};'use strict';var multer=require('multer');var util=require(_0xbabc('0x0'));var path=require(_0xbabc('0x1'));var timeout=require(_0xbabc('0x2'));var express=require(_0xbabc('0x3'));var router=express[_0xbabc('0x4')]();var fs_extra=require(_0xbabc('0x5'));var auth=require(_0xbabc('0x6'));var interaction=require(_0xbabc('0x7'));var config=require(_0xbabc('0x8'));var controller=require(_0xbabc('0x9'));router[_0xbabc('0xa')]('/',auth[_0xbabc('0xb')](),controller[_0xbabc('0xc')]);router[_0xbabc('0xa')](_0xbabc('0xd'),auth[_0xbabc('0xb')](),controller[_0xbabc('0xe')]);router[_0xbabc('0xa')](_0xbabc('0xf'),auth[_0xbabc('0xb')](),controller['getConditions']);router[_0xbabc('0xa')](_0xbabc('0x10'),auth[_0xbabc('0xb')](),controller['getActions']);router[_0xbabc('0x11')]('/',auth[_0xbabc('0xb')](),controller[_0xbabc('0x12')]);router[_0xbabc('0x11')]('/:id/conditions',auth[_0xbabc('0xb')](),controller[_0xbabc('0x13')]);router[_0xbabc('0x11')](_0xbabc('0x10'),auth[_0xbabc('0xb')](),controller[_0xbabc('0x14')]);router[_0xbabc('0x15')]('/:id',auth[_0xbabc('0xb')](),controller[_0xbabc('0x16')]);router[_0xbabc('0x17')]('/:id',auth[_0xbabc('0xb')](),controller[_0xbabc('0x18')]);module[_0xbabc('0x19')]=router;
\ No newline at end of file
+var _0xdb4b=['addActions','put','/:id','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getActions','post','addConditions'];(function(_0x56b557,_0x4e06b1){var _0x596b6a=function(_0x5e5033){while(--_0x5e5033){_0x56b557['push'](_0x56b557['shift']());}};_0x596b6a(++_0x4e06b1);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x54691d,_0x391ae4){_0x54691d=_0x54691d-0x0;var _0x4636bd=_0xdb4b[_0x54691d];return _0x4636bd;};'use strict';var multer=require('multer');var util=require(_0xbdb4('0x0'));var path=require('path');var timeout=require(_0xbdb4('0x1'));var express=require(_0xbdb4('0x2'));var router=express[_0xbdb4('0x3')]();var fs_extra=require(_0xbdb4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbdb4('0x5'));var config=require(_0xbdb4('0x6'));var controller=require(_0xbdb4('0x7'));router[_0xbdb4('0x8')]('/',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xa')]);router[_0xbdb4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbdb4('0xb')]);router[_0xbdb4('0x8')](_0xbdb4('0xc'),auth[_0xbdb4('0x9')](),controller['getConditions']);router[_0xbdb4('0x8')]('/:id/actions',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xd')]);router[_0xbdb4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbdb4('0xe')](_0xbdb4('0xc'),auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xf')]);router['post']('/:id/actions',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x10')]);router[_0xbdb4('0x11')](_0xbdb4('0x12'),auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x13')]);router['delete']('/:id',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e2f41ea..241e49d 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 _0xe285=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x15dfac,_0x14f237){var _0x106f8f=function(_0x31dad9){while(--_0x31dad9){_0x15dfac['push'](_0x15dfac['shift']());}};_0x106f8f(++_0x14f237);}(_0xe285,0xe5));var _0x5e28=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe285[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x5e28('0x0'));module[_0x5e28('0x1')]={'name':{'type':Sequelize[_0x5e28('0x2')],'unique':_0x5e28('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5e28('0x4')](_0x5e28('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5e28('0x6')},'limitCalls':{'type':Sequelize[_0x5e28('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5e28('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5e28('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5e28('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'comment':_0x5e28('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5e28('0x10')},'dialTimezone':{'type':Sequelize[_0x5e28('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5e28('0x2')],'defaultValue':_0x5e28('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x5e28('0x4')](_0x5e28('0x12'),'never',_0x5e28('0x13')),'defaultValue':_0x5e28('0x12')},'dialAMDActive':{'type':Sequelize[_0x5e28('0x14')],'defaultValue':0x0,'comment':_0x5e28('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x5e28('0x7')](0x9)[_0x5e28('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5e28('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5e28('0x7')](0x9)[_0x5e28('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5e28('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5e28('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5e28('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5e28('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5e28('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e28('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5e28('0x4')](_0x5e28('0x1c'),_0x5e28('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x5e28('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e28('0x1e')},'dialCutDigit':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e28('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x29')}};
\ No newline at end of file
+var _0xf577=['Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xf577,0x1da));var _0x7f57=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xf577[_0x2080a3];return _0x8d7d17;};'use strict';var Sequelize=require(_0x7f57('0x0'));module[_0x7f57('0x1')]={'name':{'type':Sequelize[_0x7f57('0x2')],'unique':_0x7f57('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7f57('0x4')](_0x7f57('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x7f57('0x2')]},'active':{'type':Sequelize[_0x7f57('0x6')],'defaultValue':0x0,'comment':_0x7f57('0x7')},'limitCalls':{'type':Sequelize[_0x7f57('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7f57('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7f57('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7f57('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'comment':_0x7f57('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7f57('0x10')},'dialTimezone':{'type':Sequelize[_0x7f57('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7f57('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7f57('0x4')](_0x7f57('0x11'),'never',_0x7f57('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7f57('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x7f57('0x8')](0x9)[_0x7f57('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7f57('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x7f57('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7f57('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7f57('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7f57('0x8')](0x9)[_0x7f57('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7f57('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7f57('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7f57('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7f57('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7f57('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7f57('0x8')](0x9)[_0x7f57('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7f57('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7f57('0x4')](_0x7f57('0x19'),_0x7f57('0x1a')),'defaultValue':_0x7f57('0x19')},'dialPrefix':{'type':Sequelize[_0x7f57('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7f57('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7f57('0x8')](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7f57('0x8')](0x3)[_0x7f57('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7f57('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7f57('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7f57('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 53e9910..621f5da 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 _0x767c=['status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','UserProfileSection','error','findOne','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','from','phone\x20NOT\x20IN\x20(?)','insert','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end'];(function(_0x82a995,_0xa40fb8){var _0x2e0f77=function(_0x396659){while(--_0x396659){_0x82a995['push'](_0x82a995['shift']());}};_0x2e0f77(++_0xa40fb8);}(_0x767c,0x183));var _0xc767=function(_0x9de3e0,_0x186627){_0x9de3e0=_0x9de3e0-0x0;var _0x4ad4bc=_0x767c[_0x9de3e0];return _0x4ad4bc;};'use strict';var emlformat=require(_0xc767('0x0'));var rimraf=require(_0xc767('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc767('0x2'));var moment=require(_0xc767('0x3'));var BPromise=require(_0xc767('0x4'));var Mustache=require(_0xc767('0x5'));var util=require(_0xc767('0x6'));var path=require(_0xc767('0x7'));var sox=require(_0xc767('0x8'));var csv=require(_0xc767('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc767('0xa'));var _=require('lodash');var squel=require(_0xc767('0xb'));var crypto=require(_0xc767('0xc'));var jsforce=require(_0xc767('0xd'));var deskjs=require(_0xc767('0xe'));var toCsv=require(_0xc767('0x9'));var querystring=require(_0xc767('0xf'));var Papa=require(_0xc767('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc767('0x11'));var as=require(_0xc767('0x12'));var hardwareService=require(_0xc767('0x13'));var logger=require(_0xc767('0x14'))(_0xc767('0x15'));var utils=require(_0xc767('0x16'));var config=require(_0xc767('0x17'));var licenseUtil=require(_0xc767('0x18'));var db=require(_0xc767('0x19'))['db'];function respondWithStatusCode(_0x449241,_0x19caec){_0x19caec=_0x19caec||0xcc;return function(_0x1342dd){if(_0x1342dd){return _0x449241['sendStatus'](_0x19caec);}return _0x449241['status'](_0x19caec)[_0xc767('0x1a')]();};}function respondWithResult(_0x3a89ca,_0x2c6670){_0x2c6670=_0x2c6670||0xc8;return function(_0x49f8c8){if(_0x49f8c8){return _0x3a89ca[_0xc767('0x1b')](_0x2c6670)[_0xc767('0x1c')](_0x49f8c8);}};}function respondWithFilteredResult(_0x46cd1d,_0x41ba67){return function(_0x15acc4){if(_0x15acc4){var _0x3a8a7f=typeof _0x41ba67[_0xc767('0x1d')]===_0xc767('0x1e')&&typeof _0x41ba67['limit']===_0xc767('0x1e');var _0x3a16fa=_0x15acc4[_0xc767('0x1f')];var _0x1f856a=_0x3a8a7f?0x0:_0x41ba67[_0xc767('0x1d')];var _0x3746b7=_0x3a8a7f?_0x15acc4[_0xc767('0x1f')]:_0x41ba67['offset']+_0x41ba67['limit'];var _0x566712;if(_0x3746b7>=_0x3a16fa){_0x3746b7=_0x3a16fa;_0x566712=0xc8;}else{_0x566712=0xce;}_0x46cd1d[_0xc767('0x1b')](_0x566712);return _0x46cd1d[_0xc767('0x20')](_0xc767('0x21'),_0x1f856a+'-'+_0x3746b7+'/'+_0x3a16fa)[_0xc767('0x1c')](_0x15acc4);}return null;};}function patchUpdates(_0x2a1156){return function(_0x12df88){try{jsonpatch[_0xc767('0x22')](_0x12df88,_0x2a1156,!![]);}catch(_0x61cab3){return BPromise[_0xc767('0x23')](_0x61cab3);}return _0x12df88[_0xc767('0x24')]();};}function saveUpdates(_0x143e32,_0x45b5d1){return function(_0x59c03f){if(_0x59c03f){return _0x59c03f[_0xc767('0x25')](_0x143e32)[_0xc767('0x26')](function(_0x54bdc5){return _0x54bdc5;});}return null;};}function removeEntity(_0x454ccc,_0x5990bd){return function(_0x39b227){if(_0x39b227){return _0x39b227[_0xc767('0x27')]()['then'](function(){var _0x57c54a=_0x39b227[_0xc767('0x28')]({'plain':!![]});var _0x36c62c=_0xc767('0x29');return db[_0xc767('0x2a')][_0xc767('0x27')]({'where':{'type':_0x36c62c,'resourceId':_0x57c54a['id']}})[_0xc767('0x26')](function(){return _0x39b227;});})[_0xc767('0x26')](function(){_0x454ccc[_0xc767('0x1b')](0xcc)[_0xc767('0x1a')]();});}};}function handleEntityNotFound(_0x4867f1,_0x18fd59){return function(_0x15cfda){if(!_0x15cfda){_0x4867f1[_0xc767('0x2b')](0x194);}return _0x15cfda;};}function handleError(_0xf9de41,_0x914ba2){_0x914ba2=_0x914ba2||0x1f4;return function(_0x456ad5){logger['error'](_0x456ad5['stack']);if(_0x456ad5[_0xc767('0x2c')]){delete _0x456ad5['name'];}_0xf9de41[_0xc767('0x1b')](_0x914ba2)['send'](_0x456ad5);};}exports[_0xc767('0x2d')]=function(_0xbfedff,_0x4a4fc2){var _0x34c793={},_0x226350={},_0x319d68={'count':0x0,'rows':[]};var _0x7cbd57=_[_0xc767('0x2e')](db[_0xc767('0x2f')][_0xc767('0x30')],function(_0x1684f9){return{'name':_0x1684f9[_0xc767('0x31')],'type':_0x1684f9['type'][_0xc767('0x32')]};});_0x226350[_0xc767('0x33')]=_[_0xc767('0x2e')](_0x7cbd57,'name');_0x226350[_0xc767('0x34')]=_[_0xc767('0x35')](_0xbfedff[_0xc767('0x34')]);_0x226350[_0xc767('0x36')]=_[_0xc767('0x37')](_0x226350['model'],_0x226350[_0xc767('0x34')]);_0x34c793[_0xc767('0x38')]=_[_0xc767('0x37')](_0x226350[_0xc767('0x33')],qs[_0xc767('0x39')](_0xbfedff[_0xc767('0x34')][_0xc767('0x39')]));_0x34c793['attributes']=_0x34c793['attributes']['length']?_0x34c793[_0xc767('0x38')]:_0x226350[_0xc767('0x33')];if(!_0xbfedff[_0xc767('0x34')][_0xc767('0x3a')](_0xc767('0x3b'))){_0x34c793[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0xbfedff[_0xc767('0x34')][_0xc767('0x3c')]);_0x34c793[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0xbfedff[_0xc767('0x34')][_0xc767('0x1d')]);}_0x34c793['order']=qs[_0xc767('0x3d')](_0xbfedff['query'][_0xc767('0x3d')]);_0x34c793[_0xc767('0x3e')]=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0xbfedff[_0xc767('0x34')],_0x226350[_0xc767('0x36')]),_0x7cbd57);if(_0xbfedff[_0xc767('0x34')]['filter']){_0x34c793[_0xc767('0x3e')]=_[_0xc767('0x40')](_0x34c793[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0x7cbd57,function(_0xf395fc){if(_0xf395fc[_0xc767('0x41')]!==_0xc767('0x42')){var _0x2e1f4f={};_0x2e1f4f[_0xf395fc[_0xc767('0x2c')]]={'$like':'%'+_0xbfedff[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x2e1f4f;}})});}_0x34c793=_[_0xc767('0x40')]({},_0x34c793,_0xbfedff[_0xc767('0x44')]);var _0x20ad73={'where':_0x34c793[_0xc767('0x3e')]};return db[_0xc767('0x2f')][_0xc767('0x1f')](_0x20ad73)[_0xc767('0x26')](function(_0x597780){_0x319d68[_0xc767('0x1f')]=_0x597780;if(_0xbfedff[_0xc767('0x34')][_0xc767('0x45')]){_0x34c793[_0xc767('0x46')]=[{'all':!![]}];}return db['Campaign'][_0xc767('0x47')](_0x34c793);})[_0xc767('0x26')](function(_0x4728e9){_0x319d68[_0xc767('0x48')]=_0x4728e9;return _0x319d68;})['then'](respondWithFilteredResult(_0x4a4fc2,_0x34c793))['catch'](handleError(_0x4a4fc2,null));};exports['show']=function(_0x4be2c4,_0x39da01){var _0x1074fb={'raw':![],'where':{'id':_0x4be2c4['params']['id']}},_0x2d6b30={};_0x2d6b30[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x2f')][_0xc767('0x30')]);_0x2d6b30[_0xc767('0x34')]=_[_0xc767('0x35')](_0x4be2c4['query']);_0x2d6b30[_0xc767('0x36')]=_[_0xc767('0x37')](_0x2d6b30[_0xc767('0x33')],_0x2d6b30[_0xc767('0x34')]);_0x1074fb[_0xc767('0x38')]=_[_0xc767('0x37')](_0x2d6b30[_0xc767('0x33')],qs[_0xc767('0x39')](_0x4be2c4['query'][_0xc767('0x39')]));_0x1074fb[_0xc767('0x38')]=_0x1074fb[_0xc767('0x38')][_0xc767('0x49')]?_0x1074fb['attributes']:_0x2d6b30[_0xc767('0x33')];if(_0x4be2c4[_0xc767('0x34')][_0xc767('0x45')]){_0x1074fb['include']=[{'all':!![]}];}_0x1074fb=_['merge']({},_0x1074fb,_0x4be2c4[_0xc767('0x44')]);return db[_0xc767('0x2f')][_0xc767('0x4a')](_0x1074fb)['then'](handleEntityNotFound(_0x39da01,null))['then'](respondWithResult(_0x39da01,null))[_0xc767('0x4b')](handleError(_0x39da01,null));};exports['create']=function(_0x543d36,_0xa32e38){return db[_0xc767('0x2f')][_0xc767('0x4c')](_0x543d36[_0xc767('0x4d')],{})[_0xc767('0x26')](function(_0x2d9259){var _0x299012=_0x543d36['user'][_0xc767('0x28')]({'plain':!![]});if(!_0x299012)throw new Error(_0xc767('0x4e'));if(_0x299012[_0xc767('0x4f')]===_0xc767('0x50')){var _0x4b8f06=_0x2d9259[_0xc767('0x28')]({'plain':!![]});var _0x1b88dd=_0xc767('0x29');return db['UserProfileSection'][_0xc767('0x4a')]({'where':{'name':_0x1b88dd,'userProfileId':_0x299012[_0xc767('0x51')]},'raw':!![]})[_0xc767('0x26')](function(_0x2a6c09){if(_0x2a6c09&&_0x2a6c09[_0xc767('0x52')]===0x0){return db[_0xc767('0x2a')][_0xc767('0x4c')]({'name':_0x4b8f06[_0xc767('0x2c')],'resourceId':_0x4b8f06['id'],'type':_0x2a6c09[_0xc767('0x2c')],'sectionId':_0x2a6c09['id']},{})[_0xc767('0x26')](function(){return _0x2d9259;});}else{return _0x2d9259;}})[_0xc767('0x4b')](function(_0x5bda83){logger['error'](_0xc767('0x53'),_0x5bda83);throw _0x5bda83;});}return _0x2d9259;})['then'](respondWithResult(_0xa32e38,0xc9))['catch'](handleError(_0xa32e38,null));};exports[_0xc767('0x54')]=function(_0x2cba2b,_0x6de5fe){var _0x208c58={'where':{'id':_0x2cba2b[_0xc767('0x55')]['id']}},_0x5cc350={};_0x5cc350[_0xc767('0x33')]=_['keys'](db[_0xc767('0x2f')][_0xc767('0x30')]);_0x208c58['attributes']=_['intersection'](_0x5cc350[_0xc767('0x33')],qs[_0xc767('0x39')](_0x2cba2b['query'][_0xc767('0x39')]));_0x208c58[_0xc767('0x38')]=_0x208c58[_0xc767('0x38')][_0xc767('0x49')]?_0x208c58[_0xc767('0x38')]:_0x5cc350[_0xc767('0x33')];if(_0x2cba2b['query'][_0xc767('0x45')]){_0x208c58['include']=[{'all':!![]}];}_0x208c58=_['merge']({},_0x208c58,_0x2cba2b[_0xc767('0x44')]);return db[_0xc767('0x2f')][_0xc767('0x4a')](_0x208c58)[_0xc767('0x26')](handleEntityNotFound(_0x6de5fe,null))['then'](function(_0x2d467a){if(_0x2d467a){var _0x4ce63c=_0x2d467a[_0xc767('0x28')]({'plain':!![]});_0x4ce63c=qs[_0xc767('0x56')](_0x4ce63c,['id','createdAt',_0xc767('0x57')]);_0x2cba2b[_0xc767('0x4d')]=_['omit'](_0x2cba2b[_0xc767('0x4d')],['id',_0xc767('0x58'),'updatedAt']);return db[_0xc767('0x2f')][_0xc767('0x4c')](_[_0xc767('0x40')](_0x4ce63c,_0x2cba2b[_0xc767('0x4d')]),{'include':_0x2cba2b['query'][_0xc767('0x45')]?[{'all':!![]}]:undefined})[_0xc767('0x26')](function(_0x4196eb){var _0x5b2438=_0x2cba2b[_0xc767('0x50')][_0xc767('0x28')]({'plain':!![]});if(!_0x5b2438)throw new Error(_0xc767('0x4e'));if(_0x5b2438[_0xc767('0x4f')]===_0xc767('0x50')){var _0x350ffa=_0x4196eb[_0xc767('0x28')]({'plain':!![]});var _0x57ec0a='IvrCampaigns';return db[_0xc767('0x59')][_0xc767('0x4a')]({'where':{'name':_0x57ec0a,'userProfileId':_0x5b2438[_0xc767('0x51')]},'raw':!![]})[_0xc767('0x26')](function(_0x5e1b6c){if(_0x5e1b6c&&_0x5e1b6c['autoAssociation']===0x0){return db[_0xc767('0x2a')][_0xc767('0x4c')]({'name':_0x350ffa[_0xc767('0x2c')],'resourceId':_0x350ffa['id'],'type':_0x5e1b6c[_0xc767('0x2c')],'sectionId':_0x5e1b6c['id']},{})[_0xc767('0x26')](function(){return _0x4196eb;});}else{return _0x4196eb;}})[_0xc767('0x4b')](function(_0x415607){logger[_0xc767('0x5a')](_0xc767('0x53'),_0x415607);throw _0x415607;});}return _0x4196eb;});}})[_0xc767('0x26')](respondWithResult(_0x6de5fe,0xc9))[_0xc767('0x4b')](handleError(_0x6de5fe,null));};exports['update']=function(_0x1101e3,_0x15e483){if(_0x1101e3[_0xc767('0x4d')]['id']){delete _0x1101e3[_0xc767('0x4d')]['id'];}return db[_0xc767('0x2f')][_0xc767('0x4a')]({'where':{'id':_0x1101e3['params']['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x15e483,null))['then'](saveUpdates(_0x1101e3['body'],null))['then'](respondWithResult(_0x15e483,null))[_0xc767('0x4b')](handleError(_0x15e483,null));};exports['destroy']=function(_0x2eecb7,_0x17aa46){return db['Campaign'][_0xc767('0x4a')]({'where':{'id':_0x2eecb7['params']['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x17aa46,null))[_0xc767('0x26')](removeEntity(_0x17aa46,null))[_0xc767('0x4b')](handleError(_0x17aa46,null));};exports['getHoppers']=function(_0x5a1ec1,_0x365e23,_0xa7d687){var _0xe63a69={'raw':!![],'where':{}};var _0x25754f={};var _0x20cf73={'count':0x0,'rows':[]};return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x5a1ec1[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x365e23,null))[_0xc767('0x26')](function(_0x45beb8){if(_0x45beb8){_0x25754f[_0xc767('0x33')]=_['keys'](db[_0xc767('0x5c')][_0xc767('0x30')]);_0x25754f[_0xc767('0x34')]=_[_0xc767('0x35')](_0x5a1ec1['query']);_0x25754f['filters']=_[_0xc767('0x37')](_0x25754f[_0xc767('0x33')],_0x25754f[_0xc767('0x34')]);_0xe63a69[_0xc767('0x38')]=_[_0xc767('0x37')](_0x25754f['model'],qs[_0xc767('0x39')](_0x5a1ec1[_0xc767('0x34')][_0xc767('0x39')]));_0xe63a69['attributes']=_0xe63a69[_0xc767('0x38')][_0xc767('0x49')]?_0xe63a69['attributes']:_0x25754f[_0xc767('0x33')];if(!_0x5a1ec1[_0xc767('0x34')]['hasOwnProperty'](_0xc767('0x3b'))){_0xe63a69['limit']=qs[_0xc767('0x3c')](_0x5a1ec1[_0xc767('0x34')][_0xc767('0x3c')]);_0xe63a69[_0xc767('0x1d')]=qs['offset'](_0x5a1ec1[_0xc767('0x34')]['offset']);}_0xe63a69['order']=qs['sort'](_0x5a1ec1[_0xc767('0x34')][_0xc767('0x3d')]);_0xe63a69['where']=qs['filters'](_[_0xc767('0x3f')](_0x5a1ec1[_0xc767('0x34')],_0x25754f[_0xc767('0x36')]));_0xe63a69['where']['CampaignId']=_0x45beb8['id'];if(_0x5a1ec1['query']['filter']){_0xe63a69[_0xc767('0x3e')]=_[_0xc767('0x40')](_0xe63a69['where'],{'$or':_[_0xc767('0x2e')](_0xe63a69[_0xc767('0x38')],function(_0x23c6e3){var _0x52cf12={};_0x52cf12[_0x23c6e3]={'$like':'%'+_0x5a1ec1[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x52cf12;})});}_0xe63a69=_[_0xc767('0x40')]({},_0xe63a69,_0x5a1ec1[_0xc767('0x44')]);return db['CmHopper']['count']({'where':_0xe63a69[_0xc767('0x3e')]})[_0xc767('0x26')](function(_0xc4863f){_0x20cf73[_0xc767('0x1f')]=_0xc4863f;if(_0x5a1ec1['query'][_0xc767('0x45')]){_0xe63a69[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x5c')][_0xc767('0x47')](_0xe63a69);})[_0xc767('0x26')](function(_0xa8e6d2){_0x20cf73[_0xc767('0x48')]=_0xa8e6d2;return _0x20cf73;});}})['then'](respondWithFilteredResult(_0x365e23,_0xe63a69))[_0xc767('0x4b')](handleError(_0x365e23,null));};exports[_0xc767('0x5d')]=function(_0x50e93a,_0x5af055,_0x1ae9d2){var _0x4785fc={'raw':!![],'where':{}};var _0x5b752f={};var _0x2bf022={'count':0x0,'rows':[]};return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x50e93a[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x5af055,null))[_0xc767('0x26')](function(_0x589c0d){if(_0x589c0d){_0x5b752f[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x5e')][_0xc767('0x30')]);_0x5b752f[_0xc767('0x34')]=_[_0xc767('0x35')](_0x50e93a[_0xc767('0x34')]);_0x5b752f[_0xc767('0x36')]=_[_0xc767('0x37')](_0x5b752f[_0xc767('0x33')],_0x5b752f['query']);_0x4785fc['attributes']=_['intersection'](_0x5b752f[_0xc767('0x33')],qs[_0xc767('0x39')](_0x50e93a['query'][_0xc767('0x39')]));_0x4785fc[_0xc767('0x38')]=_0x4785fc[_0xc767('0x38')][_0xc767('0x49')]?_0x4785fc[_0xc767('0x38')]:_0x5b752f[_0xc767('0x33')];if(!_0x50e93a[_0xc767('0x34')]['hasOwnProperty'](_0xc767('0x3b'))){_0x4785fc['limit']=qs['limit'](_0x50e93a[_0xc767('0x34')][_0xc767('0x3c')]);_0x4785fc[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x50e93a[_0xc767('0x34')][_0xc767('0x1d')]);}_0x4785fc['order']=qs['sort'](_0x50e93a['query'][_0xc767('0x3d')]);_0x4785fc[_0xc767('0x3e')]=qs[_0xc767('0x36')](_['pick'](_0x50e93a[_0xc767('0x34')],_0x5b752f['filters']));_0x4785fc[_0xc767('0x3e')][_0xc767('0x5f')]=_0x589c0d['id'];if(_0x50e93a[_0xc767('0x34')][_0xc767('0x43')]){_0x4785fc[_0xc767('0x3e')]=_[_0xc767('0x40')](_0x4785fc[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0x4785fc[_0xc767('0x38')],function(_0x254868){var _0x1e1385={};_0x1e1385[_0x254868]={'$like':'%'+_0x50e93a[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x1e1385;})});}_0x4785fc=_['merge']({},_0x4785fc,_0x50e93a[_0xc767('0x44')]);return db[_0xc767('0x5e')][_0xc767('0x1f')]({'where':_0x4785fc[_0xc767('0x3e')]})[_0xc767('0x26')](function(_0x3842a6){_0x2bf022[_0xc767('0x1f')]=_0x3842a6;if(_0x50e93a[_0xc767('0x34')][_0xc767('0x45')]){_0x4785fc[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x5e')]['findAll'](_0x4785fc);})[_0xc767('0x26')](function(_0x1dae6b){_0x2bf022[_0xc767('0x48')]=_0x1dae6b;return _0x2bf022;});}})[_0xc767('0x26')](respondWithFilteredResult(_0x5af055,_0x4785fc))[_0xc767('0x4b')](handleError(_0x5af055,null));};exports[_0xc767('0x60')]=function(_0x5f0bbe,_0x37545c,_0x54a70a){var _0x36a70b={'raw':!![],'where':{}};var _0x108e5b={};var _0x5db1fb={'count':0x0,'rows':[]};return db['Campaign'][_0xc767('0x5b')]({'where':{'id':_0x5f0bbe[_0xc767('0x55')]['id']}})['then'](handleEntityNotFound(_0x37545c,null))[_0xc767('0x26')](function(_0x4c1283){if(_0x4c1283){_0x108e5b[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x61')][_0xc767('0x30')]);_0x108e5b[_0xc767('0x34')]=_[_0xc767('0x35')](_0x5f0bbe[_0xc767('0x34')]);_0x108e5b[_0xc767('0x36')]=_[_0xc767('0x37')](_0x108e5b[_0xc767('0x33')],_0x108e5b[_0xc767('0x34')]);_0x36a70b[_0xc767('0x38')]=_[_0xc767('0x37')](_0x108e5b['model'],qs['fields'](_0x5f0bbe[_0xc767('0x34')][_0xc767('0x39')]));_0x36a70b['attributes']=_0x36a70b[_0xc767('0x38')][_0xc767('0x49')]?_0x36a70b[_0xc767('0x38')]:_0x108e5b[_0xc767('0x33')];if(!_0x5f0bbe[_0xc767('0x34')][_0xc767('0x3a')](_0xc767('0x3b'))){_0x36a70b[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0x5f0bbe['query'][_0xc767('0x3c')]);_0x36a70b[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x5f0bbe['query'][_0xc767('0x1d')]);}_0x36a70b[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x5f0bbe['query'][_0xc767('0x3d')]);_0x36a70b[_0xc767('0x3e')]=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0x5f0bbe[_0xc767('0x34')],_0x108e5b[_0xc767('0x36')]));_0x36a70b[_0xc767('0x3e')][_0xc767('0x5f')]=_0x4c1283['id'];if(_0x5f0bbe[_0xc767('0x34')][_0xc767('0x43')]){_0x36a70b['where']=_[_0xc767('0x40')](_0x36a70b[_0xc767('0x3e')],{'$or':_['map'](_0x36a70b[_0xc767('0x38')],function(_0x416b50){var _0x1317e6={};_0x1317e6[_0x416b50]={'$like':'%'+_0x5f0bbe['query'][_0xc767('0x43')]+'%'};return _0x1317e6;})});}_0x36a70b=_[_0xc767('0x40')]({},_0x36a70b,_0x5f0bbe[_0xc767('0x44')]);return db['CmHopperFinal']['count']({'where':_0x36a70b[_0xc767('0x3e')]})[_0xc767('0x26')](function(_0x5e8817){_0x5db1fb[_0xc767('0x1f')]=_0x5e8817;if(_0x5f0bbe[_0xc767('0x34')][_0xc767('0x45')]){_0x36a70b[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x61')][_0xc767('0x47')](_0x36a70b);})['then'](function(_0x3269fb){_0x5db1fb[_0xc767('0x48')]=_0x3269fb;return _0x5db1fb;});}})[_0xc767('0x26')](respondWithFilteredResult(_0x37545c,_0x36a70b))['catch'](handleError(_0x37545c,null));};exports[_0xc767('0x63')]=function(_0x1d25c4,_0x125b5a,_0x43181d){var _0xb3093={'raw':!![],'where':{}};var _0x4141bc={};var _0x590ec3={'count':0x0,'rows':[]};return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x1d25c4['params']['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x125b5a,null))[_0xc767('0x26')](function(_0x481c18){if(_0x481c18){_0x4141bc[_0xc767('0x33')]=_[_0xc767('0x35')](db['CmHopperBlack'][_0xc767('0x30')]);_0x4141bc['query']=_[_0xc767('0x35')](_0x1d25c4[_0xc767('0x34')]);_0x4141bc[_0xc767('0x36')]=_[_0xc767('0x37')](_0x4141bc[_0xc767('0x33')],_0x4141bc['query']);_0xb3093[_0xc767('0x38')]=_['intersection'](_0x4141bc['model'],qs[_0xc767('0x39')](_0x1d25c4[_0xc767('0x34')][_0xc767('0x39')]));_0xb3093[_0xc767('0x38')]=_0xb3093[_0xc767('0x38')]['length']?_0xb3093[_0xc767('0x38')]:_0x4141bc[_0xc767('0x33')];if(!_0x1d25c4[_0xc767('0x34')][_0xc767('0x3a')](_0xc767('0x3b'))){_0xb3093[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0x1d25c4[_0xc767('0x34')]['limit']);_0xb3093[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x1d25c4[_0xc767('0x34')][_0xc767('0x1d')]);}_0xb3093[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x1d25c4['query'][_0xc767('0x3d')]);_0xb3093['where']=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0x1d25c4['query'],_0x4141bc[_0xc767('0x36')]));_0xb3093[_0xc767('0x3e')][_0xc767('0x5f')]=_0x481c18['id'];if(_0x1d25c4[_0xc767('0x34')][_0xc767('0x43')]){_0xb3093[_0xc767('0x3e')]=_['merge'](_0xb3093[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0xb3093['attributes'],function(_0x3ef298){var _0x1cbef4={};_0x1cbef4[_0x3ef298]={'$like':'%'+_0x1d25c4[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x1cbef4;})});}_0xb3093=_[_0xc767('0x40')]({},_0xb3093,_0x1d25c4[_0xc767('0x44')]);return db[_0xc767('0x64')]['count']({'where':_0xb3093[_0xc767('0x3e')]})['then'](function(_0xa9070c){_0x590ec3[_0xc767('0x1f')]=_0xa9070c;if(_0x1d25c4[_0xc767('0x34')][_0xc767('0x45')]){_0xb3093[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x64')][_0xc767('0x47')](_0xb3093);})[_0xc767('0x26')](function(_0x1691e3){_0x590ec3['rows']=_0x1691e3;return _0x590ec3;});}})[_0xc767('0x26')](respondWithFilteredResult(_0x125b5a,_0xb3093))['catch'](handleError(_0x125b5a,null));};exports['getLists']=function(_0x4308a0,_0x4d2e2f,_0xfa2392){var _0x38a618={};var _0x585700={};var _0x5f49ba;var _0x1a3f39;return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x4308a0[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x4d2e2f,null))[_0xc767('0x26')](function(_0x12a19c){if(_0x12a19c){_0x5f49ba=_0x12a19c;_0x585700[_0xc767('0x33')]=_['keys'](db[_0xc767('0x65')]['rawAttributes']);_0x585700[_0xc767('0x34')]=_[_0xc767('0x35')](_0x4308a0[_0xc767('0x34')]);_0x585700['filters']=_[_0xc767('0x37')](_0x585700['model'],_0x585700[_0xc767('0x34')]);_0x38a618['attributes']=_[_0xc767('0x37')](_0x585700['model'],qs[_0xc767('0x39')](_0x4308a0[_0xc767('0x34')][_0xc767('0x39')]));_0x38a618[_0xc767('0x38')]=_0x38a618['attributes']['length']?_0x38a618['attributes']:_0x585700[_0xc767('0x33')];_0x38a618[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x4308a0['query'][_0xc767('0x3d')]);_0x38a618['where']=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0x4308a0[_0xc767('0x34')],_0x585700['filters']));if(_0x4308a0[_0xc767('0x34')][_0xc767('0x43')]){_0x38a618[_0xc767('0x3e')]=_[_0xc767('0x40')](_0x38a618['where'],{'$or':_['map'](_0x38a618[_0xc767('0x38')],function(_0x4cae68){var _0x42f382={};_0x42f382[_0x4cae68]={'$like':'%'+_0x4308a0[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x42f382;})});}_0x38a618=_['merge']({},_0x38a618,_0x4308a0[_0xc767('0x44')]);return _0x5f49ba['getLists'](_0x38a618);}})[_0xc767('0x26')](function(_0x596d15){if(_0x596d15){_0x1a3f39=_0x596d15[_0xc767('0x49')];if(!_0x4308a0[_0xc767('0x34')][_0xc767('0x3a')]('nolimit')){_0x38a618['limit']=qs[_0xc767('0x3c')](_0x4308a0[_0xc767('0x34')][_0xc767('0x3c')]);_0x38a618[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x4308a0[_0xc767('0x34')][_0xc767('0x1d')]);}return _0x5f49ba[_0xc767('0x66')](_0x38a618);}})[_0xc767('0x26')](function(_0x29a21e){if(_0x29a21e){return _0x29a21e?{'count':_0x1a3f39,'rows':_0x29a21e}:null;}})[_0xc767('0x26')](respondWithResult(_0x4d2e2f,null))[_0xc767('0x4b')](handleError(_0x4d2e2f,null));};exports[_0xc767('0x67')]=function(_0x534674,_0x5f28ea,_0x509077){var _0xb8eafa,_0x56def2;return db[_0xc767('0x2f')][_0xc767('0x4a')]({'where':{'id':_0x534674[_0xc767('0x55')]['id']}})['then'](handleEntityNotFound(_0x5f28ea,null))[_0xc767('0x26')](function(_0x347b0b){if(_0x347b0b){_0x56def2=_0x347b0b;return _0x347b0b['addLists'](_0x534674[_0xc767('0x4d')][_0xc767('0x68')],_[_0xc767('0x56')](_0x534674[_0xc767('0x4d')],[_0xc767('0x68'),'id'])||{});}return null;})[_0xc767('0x69')](function(_0x526b57){var _0x4f55e7;_0xb8eafa=_0x526b57||[];var _0x128de1=[];if(_0x526b57){for(var _0x4c3c86=0x0;_0x4c3c86<_0x526b57[_0xc767('0x49')];_0x4c3c86+=0x1){var _0x2d5eb8=_0x526b57[_0x4c3c86][_0xc767('0x28')]({'plain':!![]});_0x56def2[_0xc767('0x6a')]=_0x534674[_0xc767('0x4d')]['dialCheckDuplicateType']?_0x534674['body'][_0xc767('0x6a')]:_0x56def2[_0xc767('0x6a')];switch(_0x56def2[_0xc767('0x6a')]){case'always':_0x4f55e7=squel['insert']()[_0xc767('0x6b')](_0xc767('0x6c'))['fromQuery']([_0xc767('0x6d'),_0xc767('0x6e'),_0xc767('0x6f'),_0xc767('0x70'),'CampaignId',_0xc767('0x58'),_0xc767('0x57')],squel[_0xc767('0x71')]()[_0xc767('0x72')]('phone','phone')[_0xc767('0x72')]('NOW()',_0xc767('0x6e'))[_0xc767('0x72')]('id',_0xc767('0x6f'))[_0xc767('0x72')](_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')](),_0xc767('0x70'))[_0xc767('0x72')](_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')](),_0xc767('0x5f'))['field'](_0xc767('0x75'),_0xc767('0x58'))[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x57'))['from'](_0xc767('0x76'))[_0xc767('0x3e')](_0xc767('0x77'))[_0xc767('0x3e')](_0xc767('0x78'),_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79'))[_0xc767('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xc767('0x72')](_0xc767('0x7a'))['from'](_0xc767('0x7b'))['where'](_0xc767('0x7c'),_0x534674['params']['id']['toString']()))[_0xc767('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc767('0x71')]()[_0xc767('0x72')](_0xc767('0x7d'))['from'](_0xc767('0x6c'))[_0xc767('0x3e')]('CampaignId\x20=\x20?',_0x534674[_0xc767('0x55')]['id']['toString']())))[_0xc767('0x74')]();break;case'onlyIfOpen':_0x4f55e7=squel['insert']()[_0xc767('0x6b')](_0xc767('0x6c'))[_0xc767('0x7e')]([_0xc767('0x6d'),'scheduledAt',_0xc767('0x6f'),_0xc767('0x70'),_0xc767('0x5f'),_0xc767('0x58'),_0xc767('0x57')],squel[_0xc767('0x71')]()[_0xc767('0x72')](_0xc767('0x6d'),_0xc767('0x6d'))[_0xc767('0x72')]('NOW()',_0xc767('0x6e'))[_0xc767('0x72')]('id','ContactId')[_0xc767('0x72')](_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')](),_0xc767('0x70'))['field'](_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')](),'CampaignId')[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x58'))[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x57'))[_0xc767('0x7f')](_0xc767('0x76'))['where'](_0xc767('0x77'))['where'](_0xc767('0x78'),_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79'))['where'](_0xc767('0x80'),squel['select']()[_0xc767('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0xc767('0x6c'))[_0xc767('0x3e')]('CampaignId\x20=\x20?',_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')]())))[_0xc767('0x74')]();break;default:_0x4f55e7=squel[_0xc767('0x81')]()[_0xc767('0x6b')](_0xc767('0x6c'))['fromQuery']([_0xc767('0x6d'),_0xc767('0x6e'),_0xc767('0x6f'),_0xc767('0x70'),_0xc767('0x5f'),_0xc767('0x58'),'updatedAt'],squel[_0xc767('0x71')]()[_0xc767('0x72')](_0xc767('0x6d'),_0xc767('0x6d'))['field']('NOW()',_0xc767('0x6e'))[_0xc767('0x72')]('id',_0xc767('0x6f'))[_0xc767('0x72')](_0x2d5eb8[_0xc767('0x73')]['toString'](),'ListId')[_0xc767('0x72')](_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')](),_0xc767('0x5f'))[_0xc767('0x72')](_0xc767('0x75'),'createdAt')[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x57'))[_0xc767('0x7f')](_0xc767('0x76'))[_0xc767('0x3e')](_0xc767('0x77'))[_0xc767('0x3e')](_0xc767('0x78'),_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79')))[_0xc767('0x74')]();}_0x128de1[_0xc767('0x82')](db['sequelize'][_0xc767('0x34')](_0x4f55e7));}return BPromise[_0xc767('0x83')](_0x128de1);}})[_0xc767('0x26')](function(){return _0xb8eafa;})[_0xc767('0x26')](respondWithResult(_0x5f28ea,null))[_0xc767('0x4b')](handleError(_0x5f28ea,null));};exports['removeLists']=function(_0x42290a,_0x21d2e6,_0x4e75dc){return db['Campaign']['find']({'where':{'id':_0x42290a['params']['id']}})['then'](handleEntityNotFound(_0x21d2e6,null))[_0xc767('0x26')](function(_0x18bd60){if(_0x18bd60){return _0x18bd60[_0xc767('0x84')](_0x42290a[_0xc767('0x34')]['ids']);}})['then'](function(_0x59cf12){if(_0x59cf12){return db[_0xc767('0x5c')][_0xc767('0x27')]({'where':{'ListId':_0x42290a['query'][_0xc767('0x68')],'CampaignId':_0x42290a[_0xc767('0x55')]['id']}})[_0xc767('0x26')](function(){return _0x59cf12;});}})[_0xc767('0x26')](respondWithStatusCode(_0x21d2e6,null))['catch'](handleError(_0x21d2e6,null));};exports['getBlackLists']=function(_0x2061a3,_0x44b3bc,_0x312de7){var _0x5b3788={};var _0x4ae947={};var _0x51959a;var _0x4cdf17;return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x2061a3[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x44b3bc,null))[_0xc767('0x26')](function(_0x53fcf3){if(_0x53fcf3){_0x51959a=_0x53fcf3;_0x4ae947[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x65')]['rawAttributes']);_0x4ae947[_0xc767('0x34')]=_[_0xc767('0x35')](_0x2061a3[_0xc767('0x34')]);_0x4ae947[_0xc767('0x36')]=_[_0xc767('0x37')](_0x4ae947[_0xc767('0x33')],_0x4ae947['query']);_0x5b3788['attributes']=_[_0xc767('0x37')](_0x4ae947['model'],qs[_0xc767('0x39')](_0x2061a3[_0xc767('0x34')][_0xc767('0x39')]));_0x5b3788[_0xc767('0x38')]=_0x5b3788['attributes'][_0xc767('0x49')]?_0x5b3788[_0xc767('0x38')]:_0x4ae947[_0xc767('0x33')];_0x5b3788[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x2061a3[_0xc767('0x34')][_0xc767('0x3d')]);_0x5b3788[_0xc767('0x3e')]=qs['filters'](_['pick'](_0x2061a3[_0xc767('0x34')],_0x4ae947[_0xc767('0x36')]));if(_0x2061a3['query'][_0xc767('0x43')]){_0x5b3788[_0xc767('0x3e')]=_['merge'](_0x5b3788[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0x5b3788[_0xc767('0x38')],function(_0x56f599){var _0x454feb={};_0x454feb[_0x56f599]={'$like':'%'+_0x2061a3['query'][_0xc767('0x43')]+'%'};return _0x454feb;})});}_0x5b3788=_['merge']({},_0x5b3788,_0x2061a3['options']);return _0x51959a[_0xc767('0x85')](_0x5b3788);}})[_0xc767('0x26')](function(_0x3d0a35){if(_0x3d0a35){_0x4cdf17=_0x3d0a35['length'];if(!_0x2061a3['query'][_0xc767('0x3a')](_0xc767('0x3b'))){_0x5b3788[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0x2061a3['query']['limit']);_0x5b3788[_0xc767('0x1d')]=qs['offset'](_0x2061a3[_0xc767('0x34')][_0xc767('0x1d')]);}return _0x51959a[_0xc767('0x85')](_0x5b3788);}})['then'](function(_0x13aa75){if(_0x13aa75){return _0x13aa75?{'count':_0x4cdf17,'rows':_0x13aa75}:null;}})[_0xc767('0x26')](respondWithResult(_0x44b3bc,null))['catch'](handleError(_0x44b3bc,null));};exports[_0xc767('0x86')]=function(_0x56bf5e,_0xf12eac,_0x442bd9){var _0x1feb24,_0x1e0280;return db[_0xc767('0x2f')]['find']({'where':{'id':_0x56bf5e[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0xf12eac,null))[_0xc767('0x26')](function(_0x42ab2c){if(_0x42ab2c){_0x1e0280=_0x42ab2c;return _0x42ab2c[_0xc767('0x86')](_0x56bf5e[_0xc767('0x4d')]['ids'],_[_0xc767('0x56')](_0x56bf5e['body'],[_0xc767('0x68'),'id'])||{});}return null;})[_0xc767('0x69')](function(_0x348552){var _0x469fd1;_0x1feb24=_0x348552||[];var _0x5156fe=[];if(_0x348552){for(var _0x418979=0x0;_0x418979<_0x348552[_0xc767('0x49')];_0x418979+=0x1){var _0x3772e6=_0x348552[_0x418979][_0xc767('0x28')]({'plain':!![]});_0x469fd1=squel[_0xc767('0x81')]()['into'](_0xc767('0x87'))[_0xc767('0x7e')]([_0xc767('0x6d'),_0xc767('0x6f'),_0xc767('0x70'),'CampaignId',_0xc767('0x58'),'updatedAt'],squel['select']()[_0xc767('0x72')](_0xc767('0x6d'),_0xc767('0x6d'))['field']('id',_0xc767('0x6f'))[_0xc767('0x72')](_0x3772e6['CmListId'][_0xc767('0x74')](),_0xc767('0x70'))[_0xc767('0x72')](_0x56bf5e[_0xc767('0x55')]['id']['toString'](),'CampaignId')['field'](_0xc767('0x75'),_0xc767('0x58'))['field'](_0xc767('0x75'),_0xc767('0x57'))[_0xc767('0x7f')]('cm_contacts')[_0xc767('0x3e')](_0xc767('0x77'))[_0xc767('0x3e')]('ListId\x20=\x20?',_0x3772e6['CmListId'][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79')))[_0xc767('0x74')]();_0x5156fe['push'](db[_0xc767('0x88')][_0xc767('0x34')](_0x469fd1));}return BPromise[_0xc767('0x83')](_0x5156fe);}})['then'](function(){return _0x1feb24;})[_0xc767('0x26')](respondWithResult(_0xf12eac,null))[_0xc767('0x4b')](handleError(_0xf12eac,null));};exports['removeBlackLists']=function(_0xe1d62d,_0x94481a,_0x489aaa){return db['Campaign'][_0xc767('0x4a')]({'where':{'id':_0xe1d62d['params']['id']}})['then'](handleEntityNotFound(_0x94481a,null))[_0xc767('0x26')](function(_0xbeeb1c){if(_0xbeeb1c){return _0xbeeb1c[_0xc767('0x89')](_0xe1d62d[_0xc767('0x34')][_0xc767('0x68')]);}})[_0xc767('0x26')](function(_0x568780){if(_0x568780){return db[_0xc767('0x64')][_0xc767('0x27')]({'where':{'ListId':_0xe1d62d[_0xc767('0x34')][_0xc767('0x68')],'CampaignId':_0xe1d62d[_0xc767('0x55')]['id']}})[_0xc767('0x26')](function(){return _0x568780;});}})[_0xc767('0x26')](respondWithStatusCode(_0x94481a,null))[_0xc767('0x4b')](handleError(_0x94481a,null));};
\ No newline at end of file
+var _0x86ec=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','update','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','select','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash'];(function(_0x5eb215,_0x3c9318){var _0x9af3a1=function(_0x129122){while(--_0x129122){_0x5eb215['push'](_0x5eb215['shift']());}};_0x9af3a1(++_0x3c9318);}(_0x86ec,0x102));var _0xc86e=function(_0x139e81,_0x53418){_0x139e81=_0x139e81-0x0;var _0x348c8c=_0x86ec[_0x139e81];return _0x348c8c;};'use strict';var emlformat=require(_0xc86e('0x0'));var rimraf=require(_0xc86e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc86e('0x2'));var rp=require(_0xc86e('0x3'));var moment=require(_0xc86e('0x4'));var BPromise=require(_0xc86e('0x5'));var Mustache=require('mustache');var util=require(_0xc86e('0x6'));var path=require(_0xc86e('0x7'));var sox=require(_0xc86e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc86e('0x9'));var squel=require(_0xc86e('0xa'));var crypto=require(_0xc86e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc86e('0xc'));var toCsv=require(_0xc86e('0xd'));var querystring=require(_0xc86e('0xe'));var Papa=require(_0xc86e('0xf'));var Redis=require(_0xc86e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc86e('0x11'));var hardwareService=require(_0xc86e('0x12'));var logger=require('../../config/logger')(_0xc86e('0x13'));var utils=require(_0xc86e('0x14'));var config=require(_0xc86e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9fdc35,_0x434167){_0x434167=_0x434167||0xcc;return function(_0x5b74ab){if(_0x5b74ab){return _0x9fdc35[_0xc86e('0x16')](_0x434167);}return _0x9fdc35['status'](_0x434167)[_0xc86e('0x17')]();};}function respondWithResult(_0x2d5f96,_0x581a05){_0x581a05=_0x581a05||0xc8;return function(_0x2bcf58){if(_0x2bcf58){return _0x2d5f96[_0xc86e('0x18')](_0x581a05)[_0xc86e('0x19')](_0x2bcf58);}};}function respondWithFilteredResult(_0xe7dc41,_0xb2c616){return function(_0x314f60){if(_0x314f60){var _0x5a1eb3=typeof _0xb2c616[_0xc86e('0x1a')]===_0xc86e('0x1b')&&typeof _0xb2c616[_0xc86e('0x1c')]===_0xc86e('0x1b');var _0xe3f46d=_0x314f60[_0xc86e('0x1d')];var _0x2a9198=_0x5a1eb3?0x0:_0xb2c616[_0xc86e('0x1a')];var _0x8d481b=_0x5a1eb3?_0x314f60[_0xc86e('0x1d')]:_0xb2c616[_0xc86e('0x1a')]+_0xb2c616[_0xc86e('0x1c')];var _0x1fbf58;if(_0x8d481b>=_0xe3f46d){_0x8d481b=_0xe3f46d;_0x1fbf58=0xc8;}else{_0x1fbf58=0xce;}_0xe7dc41[_0xc86e('0x18')](_0x1fbf58);return _0xe7dc41['set'](_0xc86e('0x1e'),_0x2a9198+'-'+_0x8d481b+'/'+_0xe3f46d)[_0xc86e('0x19')](_0x314f60);}return null;};}function patchUpdates(_0x3ab039){return function(_0x5bd15b){try{jsonpatch['apply'](_0x5bd15b,_0x3ab039,!![]);}catch(_0x249903){return BPromise['reject'](_0x249903);}return _0x5bd15b[_0xc86e('0x1f')]();};}function saveUpdates(_0x3a6106,_0x4c63a3){return function(_0x1eb523){if(_0x1eb523){return _0x1eb523['update'](_0x3a6106)[_0xc86e('0x20')](function(_0x2e4c7f){return _0x2e4c7f;});}return null;};}function removeEntity(_0x263e9e,_0x442e50){return function(_0x2432fb){if(_0x2432fb){return _0x2432fb[_0xc86e('0x21')]()['then'](function(){var _0x25a01e=_0x2432fb[_0xc86e('0x22')]({'plain':!![]});var _0x451374=_0xc86e('0x23');return db['UserProfileResource'][_0xc86e('0x21')]({'where':{'type':_0x451374,'resourceId':_0x25a01e['id']}})[_0xc86e('0x20')](function(){return _0x2432fb;});})['then'](function(){_0x263e9e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52e655,_0x4763e3){return function(_0x2ab034){if(!_0x2ab034){_0x52e655[_0xc86e('0x16')](0x194);}return _0x2ab034;};}function handleError(_0x376104,_0x4b0a84){_0x4b0a84=_0x4b0a84||0x1f4;return function(_0xd1e56c){logger[_0xc86e('0x24')](_0xd1e56c[_0xc86e('0x25')]);if(_0xd1e56c['name']){delete _0xd1e56c[_0xc86e('0x26')];}_0x376104['status'](_0x4b0a84)[_0xc86e('0x27')](_0xd1e56c);};}exports[_0xc86e('0x28')]=function(_0x4fc828,_0x18e5d4){var _0x2c20b8={},_0x5c5c2c={},_0x43e25f={'count':0x0,'rows':[]};var _0x4d2f8e=_[_0xc86e('0x29')](db[_0xc86e('0x2a')][_0xc86e('0x2b')],function(_0x16ebc0){return{'name':_0x16ebc0[_0xc86e('0x2c')],'type':_0x16ebc0[_0xc86e('0x2d')]['key']};});_0x5c5c2c[_0xc86e('0x2e')]=_[_0xc86e('0x29')](_0x4d2f8e,'name');_0x5c5c2c[_0xc86e('0x2f')]=_['keys'](_0x4fc828[_0xc86e('0x2f')]);_0x5c5c2c[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x5c5c2c[_0xc86e('0x2e')],_0x5c5c2c[_0xc86e('0x2f')]);_0x2c20b8['attributes']=_[_0xc86e('0x31')](_0x5c5c2c[_0xc86e('0x2e')],qs['fields'](_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x2c20b8[_0xc86e('0x33')]=_0x2c20b8[_0xc86e('0x33')][_0xc86e('0x34')]?_0x2c20b8[_0xc86e('0x33')]:_0x5c5c2c[_0xc86e('0x2e')];if(!_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x35')]('nolimit')){_0x2c20b8['limit']=qs[_0xc86e('0x1c')](_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x2c20b8[_0xc86e('0x1a')]=qs['offset'](_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x2c20b8[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x4fc828[_0xc86e('0x2f')]['sort']);_0x2c20b8[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x4fc828[_0xc86e('0x2f')],_0x5c5c2c[_0xc86e('0x30')]),_0x4d2f8e);if(_0x4fc828['query'][_0xc86e('0x3a')]){_0x2c20b8[_0xc86e('0x38')]=_[_0xc86e('0x3b')](_0x2c20b8['where'],{'$or':_[_0xc86e('0x29')](_0x4d2f8e,function(_0x255889){if(_0x255889[_0xc86e('0x2d')]!==_0xc86e('0x3c')){var _0x51115e={};_0x51115e[_0x255889[_0xc86e('0x26')]]={'$like':'%'+_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x51115e;}})});}_0x2c20b8=_[_0xc86e('0x3b')]({},_0x2c20b8,_0x4fc828[_0xc86e('0x3d')]);var _0x510841={'where':_0x2c20b8[_0xc86e('0x38')]};return db[_0xc86e('0x2a')][_0xc86e('0x1d')](_0x510841)[_0xc86e('0x20')](function(_0xb10538){_0x43e25f[_0xc86e('0x1d')]=_0xb10538;if(_0x4fc828[_0xc86e('0x2f')][_0xc86e('0x3e')]){_0x2c20b8[_0xc86e('0x3f')]=[{'all':!![]}];}return db[_0xc86e('0x2a')]['findAll'](_0x2c20b8);})[_0xc86e('0x20')](function(_0x33dd29){_0x43e25f[_0xc86e('0x40')]=_0x33dd29;return _0x43e25f;})[_0xc86e('0x20')](respondWithFilteredResult(_0x18e5d4,_0x2c20b8))[_0xc86e('0x41')](handleError(_0x18e5d4,null));};exports[_0xc86e('0x42')]=function(_0x516279,_0x2ac706){var _0x34d763={'raw':![],'where':{'id':_0x516279[_0xc86e('0x43')]['id']}},_0x3bfb09={};_0x3bfb09[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x2a')][_0xc86e('0x2b')]);_0x3bfb09[_0xc86e('0x2f')]=_[_0xc86e('0x44')](_0x516279[_0xc86e('0x2f')]);_0x3bfb09[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x3bfb09[_0xc86e('0x2e')],_0x3bfb09[_0xc86e('0x2f')]);_0x34d763['attributes']=_[_0xc86e('0x31')](_0x3bfb09[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x516279[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x34d763[_0xc86e('0x33')]=_0x34d763['attributes'][_0xc86e('0x34')]?_0x34d763[_0xc86e('0x33')]:_0x3bfb09[_0xc86e('0x2e')];if(_0x516279['query'][_0xc86e('0x3e')]){_0x34d763[_0xc86e('0x3f')]=[{'all':!![]}];}_0x34d763=_[_0xc86e('0x3b')]({},_0x34d763,_0x516279[_0xc86e('0x3d')]);return db['Campaign'][_0xc86e('0x45')](_0x34d763)[_0xc86e('0x20')](handleEntityNotFound(_0x2ac706,null))[_0xc86e('0x20')](respondWithResult(_0x2ac706,null))[_0xc86e('0x41')](handleError(_0x2ac706,null));};exports['create']=function(_0x5b3003,_0x345733){return db['Campaign'][_0xc86e('0x46')](_0x5b3003[_0xc86e('0x47')],{})['then'](function(_0x544d31){var _0x52574c=_0x5b3003[_0xc86e('0x48')][_0xc86e('0x22')]({'plain':!![]});if(!_0x52574c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52574c['role']===_0xc86e('0x48')){var _0x25a75e=_0x544d31[_0xc86e('0x22')]({'plain':!![]});var _0x2a71c8=_0xc86e('0x23');return db[_0xc86e('0x49')][_0xc86e('0x45')]({'where':{'name':_0x2a71c8,'userProfileId':_0x52574c[_0xc86e('0x4a')]},'raw':!![]})[_0xc86e('0x20')](function(_0x416ccd){if(_0x416ccd&&_0x416ccd['autoAssociation']===0x0){return db[_0xc86e('0x4b')][_0xc86e('0x46')]({'name':_0x25a75e['name'],'resourceId':_0x25a75e['id'],'type':_0x416ccd[_0xc86e('0x26')],'sectionId':_0x416ccd['id']},{})['then'](function(){return _0x544d31;});}else{return _0x544d31;}})[_0xc86e('0x41')](function(_0x4a0d9f){logger[_0xc86e('0x24')](_0xc86e('0x4c'),_0x4a0d9f);throw _0x4a0d9f;});}return _0x544d31;})[_0xc86e('0x20')](respondWithResult(_0x345733,0xc9))[_0xc86e('0x41')](handleError(_0x345733,null));};exports[_0xc86e('0x4d')]=function(_0x3649ec,_0x3df6da){var _0x1860a1={'where':{'id':_0x3649ec['params']['id']}},_0x18df65={};_0x18df65[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x2a')]['rawAttributes']);_0x1860a1[_0xc86e('0x33')]=_[_0xc86e('0x31')](_0x18df65[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x3649ec[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x1860a1[_0xc86e('0x33')]=_0x1860a1[_0xc86e('0x33')]['length']?_0x1860a1['attributes']:_0x18df65[_0xc86e('0x2e')];if(_0x3649ec['query'][_0xc86e('0x3e')]){_0x1860a1[_0xc86e('0x3f')]=[{'all':!![]}];}_0x1860a1=_[_0xc86e('0x3b')]({},_0x1860a1,_0x3649ec[_0xc86e('0x3d')]);return db[_0xc86e('0x2a')][_0xc86e('0x45')](_0x1860a1)[_0xc86e('0x20')](handleEntityNotFound(_0x3df6da,null))['then'](function(_0x43c8fe){if(_0x43c8fe){var _0xaf3677=_0x43c8fe[_0xc86e('0x22')]({'plain':!![]});_0xaf3677=qs[_0xc86e('0x4e')](_0xaf3677,['id','createdAt',_0xc86e('0x4f')]);_0x3649ec[_0xc86e('0x47')]=_[_0xc86e('0x4e')](_0x3649ec[_0xc86e('0x47')],['id',_0xc86e('0x50'),'updatedAt']);return db[_0xc86e('0x2a')][_0xc86e('0x46')](_[_0xc86e('0x3b')](_0xaf3677,_0x3649ec['body']),{'include':_0x3649ec[_0xc86e('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0xc86e('0x20')](function(_0x3a821d){var _0x6c78b5=_0x3649ec[_0xc86e('0x48')][_0xc86e('0x22')]({'plain':!![]});if(!_0x6c78b5)throw new Error(_0xc86e('0x51'));if(_0x6c78b5[_0xc86e('0x52')]===_0xc86e('0x48')){var _0x3a5c12=_0x3a821d['get']({'plain':!![]});var _0x3138e5=_0xc86e('0x23');return db['UserProfileSection'][_0xc86e('0x45')]({'where':{'name':_0x3138e5,'userProfileId':_0x6c78b5[_0xc86e('0x4a')]},'raw':!![]})[_0xc86e('0x20')](function(_0x5671e2){if(_0x5671e2&&_0x5671e2[_0xc86e('0x53')]===0x0){return db[_0xc86e('0x4b')][_0xc86e('0x46')]({'name':_0x3a5c12[_0xc86e('0x26')],'resourceId':_0x3a5c12['id'],'type':_0x5671e2['name'],'sectionId':_0x5671e2['id']},{})['then'](function(){return _0x3a821d;});}else{return _0x3a821d;}})[_0xc86e('0x41')](function(_0x527bd7){logger[_0xc86e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x527bd7);throw _0x527bd7;});}return _0x3a821d;});}})[_0xc86e('0x20')](respondWithResult(_0x3df6da,0xc9))[_0xc86e('0x41')](handleError(_0x3df6da,null));};exports[_0xc86e('0x54')]=function(_0x12b1a9,_0xe74150){if(_0x12b1a9['body']['id']){delete _0x12b1a9[_0xc86e('0x47')]['id'];}return db['Campaign'][_0xc86e('0x45')]({'where':{'id':_0x12b1a9[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0xe74150,null))[_0xc86e('0x20')](saveUpdates(_0x12b1a9['body'],null))[_0xc86e('0x20')](respondWithResult(_0xe74150,null))[_0xc86e('0x41')](handleError(_0xe74150,null));};exports[_0xc86e('0x21')]=function(_0x3cd3d,_0x46a782){return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x3cd3d[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x46a782,null))[_0xc86e('0x20')](removeEntity(_0x46a782,null))['catch'](handleError(_0x46a782,null));};exports[_0xc86e('0x55')]=function(_0x482b58,_0x1fc165,_0x70dc75){var _0x77eb31={'raw':!![],'where':{}};var _0x538907={};var _0x43fc1c={'count':0x0,'rows':[]};return db[_0xc86e('0x2a')][_0xc86e('0x56')]({'where':{'id':_0x482b58['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x1fc165,null))[_0xc86e('0x20')](function(_0x1080d8){if(_0x1080d8){_0x538907[_0xc86e('0x2e')]=_['keys'](db[_0xc86e('0x57')][_0xc86e('0x2b')]);_0x538907[_0xc86e('0x2f')]=_[_0xc86e('0x44')](_0x482b58[_0xc86e('0x2f')]);_0x538907[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x538907[_0xc86e('0x2e')],_0x538907[_0xc86e('0x2f')]);_0x77eb31[_0xc86e('0x33')]=_['intersection'](_0x538907[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x482b58[_0xc86e('0x2f')]['fields']));_0x77eb31[_0xc86e('0x33')]=_0x77eb31[_0xc86e('0x33')][_0xc86e('0x34')]?_0x77eb31[_0xc86e('0x33')]:_0x538907[_0xc86e('0x2e')];if(!_0x482b58[_0xc86e('0x2f')][_0xc86e('0x35')]('nolimit')){_0x77eb31[_0xc86e('0x1c')]=qs[_0xc86e('0x1c')](_0x482b58[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x77eb31[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x482b58[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x77eb31[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x482b58['query'][_0xc86e('0x37')]);_0x77eb31[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x482b58['query'],_0x538907[_0xc86e('0x30')]));_0x77eb31[_0xc86e('0x38')][_0xc86e('0x58')]=_0x1080d8['id'];if(_0x482b58[_0xc86e('0x2f')][_0xc86e('0x3a')]){_0x77eb31[_0xc86e('0x38')]=_[_0xc86e('0x3b')](_0x77eb31[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x77eb31['attributes'],function(_0x9f2223){var _0x515da5={};_0x515da5[_0x9f2223]={'$like':'%'+_0x482b58[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x515da5;})});}_0x77eb31=_[_0xc86e('0x3b')]({},_0x77eb31,_0x482b58[_0xc86e('0x3d')]);return db[_0xc86e('0x57')]['count']({'where':_0x77eb31[_0xc86e('0x38')]})[_0xc86e('0x20')](function(_0x51d660){_0x43fc1c[_0xc86e('0x1d')]=_0x51d660;if(_0x482b58['query'][_0xc86e('0x3e')]){_0x77eb31['include']=[{'all':!![]}];}return db[_0xc86e('0x57')][_0xc86e('0x59')](_0x77eb31);})[_0xc86e('0x20')](function(_0x1373ce){_0x43fc1c[_0xc86e('0x40')]=_0x1373ce;return _0x43fc1c;});}})['then'](respondWithFilteredResult(_0x1fc165,_0x77eb31))[_0xc86e('0x41')](handleError(_0x1fc165,null));};exports[_0xc86e('0x5a')]=function(_0x37f6d2,_0x170484,_0x59dd40){var _0x15eeb7={'raw':!![],'where':{}};var _0x4dd141={};var _0x239183={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x37f6d2[_0xc86e('0x43')]['id']}})['then'](handleEntityNotFound(_0x170484,null))[_0xc86e('0x20')](function(_0x5e01f0){if(_0x5e01f0){_0x4dd141[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x5b')][_0xc86e('0x2b')]);_0x4dd141[_0xc86e('0x2f')]=_['keys'](_0x37f6d2['query']);_0x4dd141[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0x4dd141['model'],_0x4dd141[_0xc86e('0x2f')]);_0x15eeb7[_0xc86e('0x33')]=_[_0xc86e('0x31')](_0x4dd141['model'],qs[_0xc86e('0x32')](_0x37f6d2['query']['fields']));_0x15eeb7['attributes']=_0x15eeb7['attributes'][_0xc86e('0x34')]?_0x15eeb7[_0xc86e('0x33')]:_0x4dd141[_0xc86e('0x2e')];if(!_0x37f6d2[_0xc86e('0x2f')]['hasOwnProperty'](_0xc86e('0x5c'))){_0x15eeb7['limit']=qs[_0xc86e('0x1c')](_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x15eeb7[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x15eeb7[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x37')]);_0x15eeb7['where']=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x37f6d2['query'],_0x4dd141[_0xc86e('0x30')]));_0x15eeb7[_0xc86e('0x38')][_0xc86e('0x58')]=_0x5e01f0['id'];if(_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x3a')]){_0x15eeb7['where']=_['merge'](_0x15eeb7[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x15eeb7[_0xc86e('0x33')],function(_0x4e7cae){var _0x3de7bb={};_0x3de7bb[_0x4e7cae]={'$like':'%'+_0x37f6d2[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x3de7bb;})});}_0x15eeb7=_[_0xc86e('0x3b')]({},_0x15eeb7,_0x37f6d2[_0xc86e('0x3d')]);return db[_0xc86e('0x5b')][_0xc86e('0x1d')]({'where':_0x15eeb7[_0xc86e('0x38')]})['then'](function(_0x53b909){_0x239183[_0xc86e('0x1d')]=_0x53b909;if(_0x37f6d2['query'][_0xc86e('0x3e')]){_0x15eeb7[_0xc86e('0x3f')]=[{'all':!![]}];}return db[_0xc86e('0x5b')][_0xc86e('0x59')](_0x15eeb7);})[_0xc86e('0x20')](function(_0x1e7b8a){_0x239183[_0xc86e('0x40')]=_0x1e7b8a;return _0x239183;});}})[_0xc86e('0x20')](respondWithFilteredResult(_0x170484,_0x15eeb7))['catch'](handleError(_0x170484,null));};exports[_0xc86e('0x5d')]=function(_0x4bf747,_0x45b0aa,_0x1f24a5){var _0x259a42={'raw':!![],'where':{}};var _0x222432={};var _0x327aef={'count':0x0,'rows':[]};return db[_0xc86e('0x2a')][_0xc86e('0x56')]({'where':{'id':_0x4bf747[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x45b0aa,null))[_0xc86e('0x20')](function(_0x5b81e6){if(_0x5b81e6){_0x222432[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x5e')][_0xc86e('0x2b')]);_0x222432[_0xc86e('0x2f')]=_['keys'](_0x4bf747[_0xc86e('0x2f')]);_0x222432[_0xc86e('0x30')]=_['intersection'](_0x222432[_0xc86e('0x2e')],_0x222432[_0xc86e('0x2f')]);_0x259a42[_0xc86e('0x33')]=_[_0xc86e('0x31')](_0x222432[_0xc86e('0x2e')],qs['fields'](_0x4bf747['query'][_0xc86e('0x32')]));_0x259a42['attributes']=_0x259a42[_0xc86e('0x33')]['length']?_0x259a42['attributes']:_0x222432['model'];if(!_0x4bf747[_0xc86e('0x2f')]['hasOwnProperty'](_0xc86e('0x5c'))){_0x259a42['limit']=qs['limit'](_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x259a42[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x259a42[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x37')]);_0x259a42[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x4bf747[_0xc86e('0x2f')],_0x222432[_0xc86e('0x30')]));_0x259a42['where'][_0xc86e('0x58')]=_0x5b81e6['id'];if(_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x3a')]){_0x259a42[_0xc86e('0x38')]=_['merge'](_0x259a42[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x259a42['attributes'],function(_0x5b789c){var _0x24b106={};_0x24b106[_0x5b789c]={'$like':'%'+_0x4bf747[_0xc86e('0x2f')]['filter']+'%'};return _0x24b106;})});}_0x259a42=_[_0xc86e('0x3b')]({},_0x259a42,_0x4bf747[_0xc86e('0x3d')]);return db[_0xc86e('0x5e')][_0xc86e('0x1d')]({'where':_0x259a42[_0xc86e('0x38')]})[_0xc86e('0x20')](function(_0x19b29b){_0x327aef[_0xc86e('0x1d')]=_0x19b29b;if(_0x4bf747[_0xc86e('0x2f')][_0xc86e('0x3e')]){_0x259a42[_0xc86e('0x3f')]=[{'all':!![]}];}return db[_0xc86e('0x5e')]['findAll'](_0x259a42);})['then'](function(_0x5bc867){_0x327aef[_0xc86e('0x40')]=_0x5bc867;return _0x327aef;});}})[_0xc86e('0x20')](respondWithFilteredResult(_0x45b0aa,_0x259a42))['catch'](handleError(_0x45b0aa,null));};exports['getHopperBlacks']=function(_0x5afab2,_0x5dd41f,_0x9c3fe7){var _0x480105={'raw':!![],'where':{}};var _0xc0171d={};var _0x1cf1df={'count':0x0,'rows':[]};return db[_0xc86e('0x2a')][_0xc86e('0x56')]({'where':{'id':_0x5afab2['params']['id']}})['then'](handleEntityNotFound(_0x5dd41f,null))[_0xc86e('0x20')](function(_0x5be4bb){if(_0x5be4bb){_0xc0171d['model']=_['keys'](db[_0xc86e('0x5f')][_0xc86e('0x2b')]);_0xc0171d[_0xc86e('0x2f')]=_['keys'](_0x5afab2[_0xc86e('0x2f')]);_0xc0171d[_0xc86e('0x30')]=_[_0xc86e('0x31')](_0xc0171d[_0xc86e('0x2e')],_0xc0171d['query']);_0x480105['attributes']=_['intersection'](_0xc0171d[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x5afab2['query'][_0xc86e('0x32')]));_0x480105[_0xc86e('0x33')]=_0x480105[_0xc86e('0x33')][_0xc86e('0x34')]?_0x480105['attributes']:_0xc0171d[_0xc86e('0x2e')];if(!_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x35')](_0xc86e('0x5c'))){_0x480105[_0xc86e('0x1c')]=qs[_0xc86e('0x1c')](_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x480105['offset']=qs[_0xc86e('0x1a')](_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x1a')]);}_0x480105['order']=qs[_0xc86e('0x37')](_0x5afab2['query'][_0xc86e('0x37')]);_0x480105[_0xc86e('0x38')]=qs['filters'](_[_0xc86e('0x39')](_0x5afab2['query'],_0xc0171d[_0xc86e('0x30')]));_0x480105['where'][_0xc86e('0x58')]=_0x5be4bb['id'];if(_0x5afab2[_0xc86e('0x2f')]['filter']){_0x480105['where']=_[_0xc86e('0x3b')](_0x480105[_0xc86e('0x38')],{'$or':_['map'](_0x480105[_0xc86e('0x33')],function(_0x4c31c1){var _0x2a53ba={};_0x2a53ba[_0x4c31c1]={'$like':'%'+_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x3a')]+'%'};return _0x2a53ba;})});}_0x480105=_[_0xc86e('0x3b')]({},_0x480105,_0x5afab2[_0xc86e('0x3d')]);return db[_0xc86e('0x5f')]['count']({'where':_0x480105[_0xc86e('0x38')]})['then'](function(_0x251c79){_0x1cf1df[_0xc86e('0x1d')]=_0x251c79;if(_0x5afab2[_0xc86e('0x2f')][_0xc86e('0x3e')]){_0x480105['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xc86e('0x59')](_0x480105);})[_0xc86e('0x20')](function(_0x37a2f4){_0x1cf1df['rows']=_0x37a2f4;return _0x1cf1df;});}})[_0xc86e('0x20')](respondWithFilteredResult(_0x5dd41f,_0x480105))[_0xc86e('0x41')](handleError(_0x5dd41f,null));};exports[_0xc86e('0x60')]=function(_0x9abb5c,_0x53a887,_0x47b8bd){var _0x519c80={};var _0x5a5417={};var _0x497c24;var _0x3bb377;return db['Campaign'][_0xc86e('0x56')]({'where':{'id':_0x9abb5c[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x53a887,null))[_0xc86e('0x20')](function(_0x35878b){if(_0x35878b){_0x497c24=_0x35878b;_0x5a5417[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x61')][_0xc86e('0x2b')]);_0x5a5417[_0xc86e('0x2f')]=_[_0xc86e('0x44')](_0x9abb5c['query']);_0x5a5417['filters']=_[_0xc86e('0x31')](_0x5a5417[_0xc86e('0x2e')],_0x5a5417[_0xc86e('0x2f')]);_0x519c80['attributes']=_[_0xc86e('0x31')](_0x5a5417[_0xc86e('0x2e')],qs[_0xc86e('0x32')](_0x9abb5c['query'][_0xc86e('0x32')]));_0x519c80[_0xc86e('0x33')]=_0x519c80[_0xc86e('0x33')][_0xc86e('0x34')]?_0x519c80[_0xc86e('0x33')]:_0x5a5417['model'];_0x519c80[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x9abb5c[_0xc86e('0x2f')]['sort']);_0x519c80['where']=qs[_0xc86e('0x30')](_['pick'](_0x9abb5c[_0xc86e('0x2f')],_0x5a5417[_0xc86e('0x30')]));if(_0x9abb5c['query'][_0xc86e('0x3a')]){_0x519c80['where']=_[_0xc86e('0x3b')](_0x519c80[_0xc86e('0x38')],{'$or':_[_0xc86e('0x29')](_0x519c80[_0xc86e('0x33')],function(_0x21425e){var _0x376dc1={};_0x376dc1[_0x21425e]={'$like':'%'+_0x9abb5c['query'][_0xc86e('0x3a')]+'%'};return _0x376dc1;})});}_0x519c80=_[_0xc86e('0x3b')]({},_0x519c80,_0x9abb5c['options']);return _0x497c24[_0xc86e('0x60')](_0x519c80);}})[_0xc86e('0x20')](function(_0x26aaf1){if(_0x26aaf1){_0x3bb377=_0x26aaf1[_0xc86e('0x34')];if(!_0x9abb5c[_0xc86e('0x2f')][_0xc86e('0x35')]('nolimit')){_0x519c80[_0xc86e('0x1c')]=qs[_0xc86e('0x1c')](_0x9abb5c[_0xc86e('0x2f')][_0xc86e('0x1c')]);_0x519c80[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x9abb5c['query'][_0xc86e('0x1a')]);}return _0x497c24[_0xc86e('0x60')](_0x519c80);}})[_0xc86e('0x20')](function(_0x13ef83){if(_0x13ef83){return _0x13ef83?{'count':_0x3bb377,'rows':_0x13ef83}:null;}})[_0xc86e('0x20')](respondWithResult(_0x53a887,null))[_0xc86e('0x41')](handleError(_0x53a887,null));};exports[_0xc86e('0x62')]=function(_0x45ae32,_0x4de0eb,_0x3a00f2){var _0x422ea2,_0x526a14;return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x45ae32[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x4de0eb,null))[_0xc86e('0x20')](function(_0x3a6458){if(_0x3a6458){_0x526a14=_0x3a6458;return _0x3a6458[_0xc86e('0x62')](_0x45ae32[_0xc86e('0x47')]['ids'],_[_0xc86e('0x4e')](_0x45ae32[_0xc86e('0x47')],['ids','id'])||{});}return null;})[_0xc86e('0x63')](function(_0x57fed9){var _0x5d8c5b;_0x422ea2=_0x57fed9||[];var _0x54423a=[];if(_0x57fed9){for(var _0x3269b3=0x0;_0x3269b3<_0x57fed9['length'];_0x3269b3+=0x1){var _0x2f7284=_0x57fed9[_0x3269b3]['get']({'plain':!![]});_0x526a14[_0xc86e('0x64')]=_0x45ae32['body'][_0xc86e('0x64')]?_0x45ae32[_0xc86e('0x47')][_0xc86e('0x64')]:_0x526a14['dialCheckDuplicateType'];switch(_0x526a14[_0xc86e('0x64')]){case _0xc86e('0x65'):_0x5d8c5b=squel[_0xc86e('0x66')]()[_0xc86e('0x67')](_0xc86e('0x68'))[_0xc86e('0x69')]([_0xc86e('0x6a'),_0xc86e('0x6b'),_0xc86e('0x6c'),_0xc86e('0x6d'),_0xc86e('0x58'),'createdAt',_0xc86e('0x4f')],squel['select']()['field'](_0xc86e('0x6a'),_0xc86e('0x6a'))[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x6b'))[_0xc86e('0x6e')]('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x2f7284['CmListId'][_0xc86e('0x70')](),_0xc86e('0x6d'))[_0xc86e('0x6e')](_0x45ae32['params']['id'][_0xc86e('0x70')](),'CampaignId')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x50'))['field']('NOW()',_0xc86e('0x4f'))[_0xc86e('0x71')](_0xc86e('0x72'))['where']('deletedAt\x20IS\x20NULL')[_0xc86e('0x38')](_0xc86e('0x73'),_0x2f7284[_0xc86e('0x74')][_0xc86e('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xc86e('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc86e('0x75')]()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0xc86e('0x76'))[_0xc86e('0x38')](_0xc86e('0x77'),_0x45ae32[_0xc86e('0x43')]['id']['toString']()))[_0xc86e('0x38')](_0xc86e('0x78'),squel[_0xc86e('0x75')]()['field'](_0xc86e('0x79'))['from'](_0xc86e('0x68'))[_0xc86e('0x38')](_0xc86e('0x77'),_0x45ae32[_0xc86e('0x43')]['id'][_0xc86e('0x70')]())))[_0xc86e('0x70')]();break;case _0xc86e('0x7a'):_0x5d8c5b=squel['insert']()['into'](_0xc86e('0x68'))[_0xc86e('0x69')](['phone','scheduledAt','ContactId','ListId',_0xc86e('0x58'),_0xc86e('0x50'),'updatedAt'],squel['select']()[_0xc86e('0x6e')]('phone',_0xc86e('0x6a'))[_0xc86e('0x6e')](_0xc86e('0x6f'),'scheduledAt')['field']('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x2f7284[_0xc86e('0x74')][_0xc86e('0x70')](),_0xc86e('0x6d'))['field'](_0x45ae32[_0xc86e('0x43')]['id']['toString'](),_0xc86e('0x58'))[_0xc86e('0x6e')]('NOW()','createdAt')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x4f'))[_0xc86e('0x71')](_0xc86e('0x72'))[_0xc86e('0x38')](_0xc86e('0x7b'))[_0xc86e('0x38')](_0xc86e('0x73'),_0x2f7284[_0xc86e('0x74')][_0xc86e('0x70')]())[_0xc86e('0x38')]('phone\x20IS\x20NOT\x20NULL')[_0xc86e('0x38')](_0xc86e('0x78'),squel['select']()[_0xc86e('0x6e')](_0xc86e('0x79'))[_0xc86e('0x71')](_0xc86e('0x68'))[_0xc86e('0x38')]('CampaignId\x20=\x20?',_0x45ae32['params']['id'][_0xc86e('0x70')]())))[_0xc86e('0x70')]();break;default:_0x5d8c5b=squel[_0xc86e('0x66')]()[_0xc86e('0x67')]('cm_hopper')[_0xc86e('0x69')]([_0xc86e('0x6a'),_0xc86e('0x6b'),_0xc86e('0x6c'),_0xc86e('0x6d'),'CampaignId',_0xc86e('0x50'),_0xc86e('0x4f')],squel[_0xc86e('0x75')]()[_0xc86e('0x6e')](_0xc86e('0x6a'),'phone')[_0xc86e('0x6e')]('NOW()',_0xc86e('0x6b'))['field']('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x2f7284['CmListId'][_0xc86e('0x70')](),'ListId')['field'](_0x45ae32[_0xc86e('0x43')]['id'][_0xc86e('0x70')](),'CampaignId')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x50'))[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x4f'))[_0xc86e('0x71')](_0xc86e('0x72'))['where'](_0xc86e('0x7b'))[_0xc86e('0x38')](_0xc86e('0x73'),_0x2f7284['CmListId'][_0xc86e('0x70')]())[_0xc86e('0x38')](_0xc86e('0x7c')))[_0xc86e('0x70')]();}_0x54423a[_0xc86e('0x7d')](db[_0xc86e('0x7e')][_0xc86e('0x2f')](_0x5d8c5b));}return BPromise[_0xc86e('0x7f')](_0x54423a);}})[_0xc86e('0x20')](function(){return _0x422ea2;})['then'](respondWithResult(_0x4de0eb,null))[_0xc86e('0x41')](handleError(_0x4de0eb,null));};exports[_0xc86e('0x80')]=function(_0x562981,_0x3a502d,_0x387464){return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x562981['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x3a502d,null))[_0xc86e('0x20')](function(_0xa391d5){if(_0xa391d5){return _0xa391d5[_0xc86e('0x80')](_0x562981[_0xc86e('0x2f')][_0xc86e('0x81')]);}})['then'](function(_0x2e94b1){if(_0x2e94b1){return db['CmHopper']['destroy']({'where':{'ListId':_0x562981[_0xc86e('0x2f')][_0xc86e('0x81')],'CampaignId':_0x562981[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](function(){return _0x2e94b1;});}})[_0xc86e('0x20')](respondWithStatusCode(_0x3a502d,null))[_0xc86e('0x41')](handleError(_0x3a502d,null));};exports[_0xc86e('0x82')]=function(_0x45b4ba,_0x1db1d3,_0x30d30f){var _0x19d13f={};var _0x22a1fe={};var _0x419f32;var _0x570a8e;return db['Campaign']['findOne']({'where':{'id':_0x45b4ba['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x1db1d3,null))[_0xc86e('0x20')](function(_0x14f008){if(_0x14f008){_0x419f32=_0x14f008;_0x22a1fe[_0xc86e('0x2e')]=_[_0xc86e('0x44')](db[_0xc86e('0x61')][_0xc86e('0x2b')]);_0x22a1fe['query']=_[_0xc86e('0x44')](_0x45b4ba[_0xc86e('0x2f')]);_0x22a1fe[_0xc86e('0x30')]=_['intersection'](_0x22a1fe[_0xc86e('0x2e')],_0x22a1fe[_0xc86e('0x2f')]);_0x19d13f[_0xc86e('0x33')]=_['intersection'](_0x22a1fe['model'],qs['fields'](_0x45b4ba[_0xc86e('0x2f')][_0xc86e('0x32')]));_0x19d13f['attributes']=_0x19d13f['attributes'][_0xc86e('0x34')]?_0x19d13f[_0xc86e('0x33')]:_0x22a1fe[_0xc86e('0x2e')];_0x19d13f[_0xc86e('0x36')]=qs[_0xc86e('0x37')](_0x45b4ba[_0xc86e('0x2f')][_0xc86e('0x37')]);_0x19d13f[_0xc86e('0x38')]=qs[_0xc86e('0x30')](_[_0xc86e('0x39')](_0x45b4ba[_0xc86e('0x2f')],_0x22a1fe[_0xc86e('0x30')]));if(_0x45b4ba[_0xc86e('0x2f')]['filter']){_0x19d13f[_0xc86e('0x38')]=_[_0xc86e('0x3b')](_0x19d13f['where'],{'$or':_[_0xc86e('0x29')](_0x19d13f['attributes'],function(_0x7b0349){var _0x123549={};_0x123549[_0x7b0349]={'$like':'%'+_0x45b4ba[_0xc86e('0x2f')]['filter']+'%'};return _0x123549;})});}_0x19d13f=_['merge']({},_0x19d13f,_0x45b4ba['options']);return _0x419f32[_0xc86e('0x82')](_0x19d13f);}})[_0xc86e('0x20')](function(_0x3eb62c){if(_0x3eb62c){_0x570a8e=_0x3eb62c[_0xc86e('0x34')];if(!_0x45b4ba['query'][_0xc86e('0x35')](_0xc86e('0x5c'))){_0x19d13f['limit']=qs[_0xc86e('0x1c')](_0x45b4ba[_0xc86e('0x2f')]['limit']);_0x19d13f[_0xc86e('0x1a')]=qs[_0xc86e('0x1a')](_0x45b4ba[_0xc86e('0x2f')][_0xc86e('0x1a')]);}return _0x419f32['getBlackLists'](_0x19d13f);}})['then'](function(_0x37f9ae){if(_0x37f9ae){return _0x37f9ae?{'count':_0x570a8e,'rows':_0x37f9ae}:null;}})[_0xc86e('0x20')](respondWithResult(_0x1db1d3,null))[_0xc86e('0x41')](handleError(_0x1db1d3,null));};exports['addBlackLists']=function(_0x3a6ac2,_0x1b50e3,_0x2ad880){var _0x152f34,_0x1295ff;return db[_0xc86e('0x2a')][_0xc86e('0x45')]({'where':{'id':_0x3a6ac2[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x1b50e3,null))[_0xc86e('0x20')](function(_0x4c09e0){if(_0x4c09e0){_0x1295ff=_0x4c09e0;return _0x4c09e0[_0xc86e('0x83')](_0x3a6ac2['body'][_0xc86e('0x81')],_['omit'](_0x3a6ac2[_0xc86e('0x47')],['ids','id'])||{});}return null;})[_0xc86e('0x63')](function(_0xf28a74){var _0x1c8195;_0x152f34=_0xf28a74||[];var _0x168903=[];if(_0xf28a74){for(var _0x4277c6=0x0;_0x4277c6<_0xf28a74['length'];_0x4277c6+=0x1){var _0x160753=_0xf28a74[_0x4277c6]['get']({'plain':!![]});_0x1c8195=squel[_0xc86e('0x66')]()[_0xc86e('0x67')](_0xc86e('0x84'))['fromQuery']([_0xc86e('0x6a'),_0xc86e('0x6c'),_0xc86e('0x6d'),_0xc86e('0x58'),_0xc86e('0x50'),_0xc86e('0x4f')],squel[_0xc86e('0x75')]()[_0xc86e('0x6e')]('phone','phone')[_0xc86e('0x6e')]('id',_0xc86e('0x6c'))[_0xc86e('0x6e')](_0x160753[_0xc86e('0x74')]['toString'](),_0xc86e('0x6d'))[_0xc86e('0x6e')](_0x3a6ac2[_0xc86e('0x43')]['id'][_0xc86e('0x70')](),'CampaignId')[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x50'))[_0xc86e('0x6e')](_0xc86e('0x6f'),_0xc86e('0x4f'))['from'](_0xc86e('0x72'))[_0xc86e('0x38')](_0xc86e('0x7b'))[_0xc86e('0x38')](_0xc86e('0x73'),_0x160753[_0xc86e('0x74')][_0xc86e('0x70')]())[_0xc86e('0x38')](_0xc86e('0x7c')))[_0xc86e('0x70')]();_0x168903[_0xc86e('0x7d')](db['sequelize'][_0xc86e('0x2f')](_0x1c8195));}return BPromise[_0xc86e('0x7f')](_0x168903);}})[_0xc86e('0x20')](function(){return _0x152f34;})['then'](respondWithResult(_0x1b50e3,null))[_0xc86e('0x41')](handleError(_0x1b50e3,null));};exports[_0xc86e('0x85')]=function(_0x39bdca,_0x49fabe,_0x238604){return db[_0xc86e('0x2a')]['find']({'where':{'id':_0x39bdca['params']['id']}})[_0xc86e('0x20')](handleEntityNotFound(_0x49fabe,null))['then'](function(_0x58abb9){if(_0x58abb9){return _0x58abb9['removeBlackLists'](_0x39bdca[_0xc86e('0x2f')]['ids']);}})[_0xc86e('0x20')](function(_0x29823f){if(_0x29823f){return db[_0xc86e('0x5f')][_0xc86e('0x21')]({'where':{'ListId':_0x39bdca[_0xc86e('0x2f')][_0xc86e('0x81')],'CampaignId':_0x39bdca[_0xc86e('0x43')]['id']}})[_0xc86e('0x20')](function(){return _0x29823f;});}})['then'](respondWithStatusCode(_0x49fabe,null))[_0xc86e('0x41')](handleError(_0x49fabe,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f11ae70..0dcc405 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x55b86a,_0x9f9772){var _0x46f950=function(_0x3113b0){while(--_0x3113b0){_0x55b86a['push'](_0x55b86a['shift']());}};_0x46f950(++_0x9f9772);}(_0x7a54,0x106));var _0x47a5=function(_0x525189,_0x23b67c){_0x525189=_0x525189-0x0;var _0x71ffaa=_0x7a54[_0x525189];return _0x71ffaa;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index a98356c..8c624c5 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 _0xfc1e=['result','GetCampaign','findAll','options','attributes','limit','include','map','model','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x945b63,_0x59dc52){var _0x40697f=function(_0x3bf9b1){while(--_0x3bf9b1){_0x945b63['push'](_0x945b63['shift']());}};_0x40697f(++_0x59dc52);}(_0xfc1e,0x1c9));var _0xefc1=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xfc1e[_0xf2662b];return _0x257dc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('Campaign,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['Campaign'][_0xefc1('0x15')]({'raw':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x257914['options']?_0x257914[_0xefc1('0x16')]['where']||null:null,'attributes':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x17')]||null:null,'limit':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x18')]||null:null,'include':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')][_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x257914[_0xefc1('0x16')]['include'],function(_0x2f4935){return{'model':db[_0x2f4935[_0xefc1('0x1b')]],'as':_0x2f4935['as'],'attributes':_0x2f4935['attributes'],'include':_0x2f4935[_0xefc1('0x19')]?_['map'](_0x2f4935['include'],function(_0x21aa3b){return{'model':db[_0x21aa3b[_0xefc1('0x1b')]],'as':_0x21aa3b['as'],'attributes':_0x21aa3b[_0xefc1('0x17')],'include':_0x21aa3b[_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x21aa3b[_0xefc1('0x19')],function(_0x538145){return{'model':db[_0x538145['model']],'as':_0x538145['as'],'attributes':_0x538145[_0xefc1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xefc1('0x9')](function(_0x20e438){logger[_0xefc1('0xa')](_0xefc1('0x14'),_0x257914);logger['debug'](_0xefc1('0x14'),_0x257914,JSON[_0xefc1('0xf')](_0x20e438));_0x3b5a6e(_0x20e438);})['catch'](function(_0x486a5b){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x486a5b[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c['error'](0x1f4,_0x486a5b[_0xefc1('0x12')]));});});};
\ No newline at end of file
+var _0x59ce=['../../config/environment','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','findAll','options','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x59ce,0x92));var _0xe59c=function(_0x20a03b,_0x4a8942){_0x20a03b=_0x20a03b-0x0;var _0x3a6628=_0x59ce[_0x20a03b];return _0x3a6628;};'use strict';var _=require(_0xe59c('0x0'));var util=require(_0xe59c('0x1'));var moment=require(_0xe59c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe59c('0x3'));var fs=require('fs');var Redis=require(_0xe59c('0x4'));var db=require(_0xe59c('0x5'))['db'];var utils=require(_0xe59c('0x6'));var logger=require(_0xe59c('0x7'))(_0xe59c('0x8'));var config=require(_0xe59c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe59c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x534601,_0x4f07e9,_0x2c1d11){return new BPromise(function(_0x101a79,_0x206753){return client[_0xe59c('0xb')](_0x534601,_0x2c1d11)[_0xe59c('0xc')](function(_0x3981be){logger[_0xe59c('0xd')](_0xe59c('0xe'),_0x4f07e9,_0xe59c('0xf'));logger[_0xe59c('0x10')](_0xe59c('0x11'),_0x4f07e9,_0xe59c('0xf'),JSON[_0xe59c('0x12')](_0x3981be));if(_0x3981be[_0xe59c('0x13')]){if(_0x3981be[_0xe59c('0x13')][_0xe59c('0x14')]===0x1f4){logger[_0xe59c('0x13')](_0xe59c('0xe'),_0x4f07e9,_0x3981be['error'][_0xe59c('0x15')]);return _0x206753(_0x3981be[_0xe59c('0x13')][_0xe59c('0x15')]);}logger[_0xe59c('0x13')]('Campaign,\x20%s,\x20%s',_0x4f07e9,_0x3981be['error'][_0xe59c('0x15')]);return _0x101a79(_0x3981be[_0xe59c('0x13')][_0xe59c('0x15')]);}else{logger[_0xe59c('0xd')](_0xe59c('0xe'),_0x4f07e9,'request\x20sent');_0x101a79(_0x3981be[_0xe59c('0x16')]['message']);}})['catch'](function(_0xee38fc){logger[_0xe59c('0x13')]('Campaign,\x20%s,\x20%s',_0x4f07e9,_0xee38fc);_0x206753(_0xee38fc);});});}exports[_0xe59c('0x17')]=function(_0x38f4b0){var _0x32bfd7=this;return new Promise(function(_0x529c0d,_0xe9f0a1){return db['Campaign'][_0xe59c('0x18')]({'raw':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1a')]||null:null,'attributes':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1b')]||null:null,'limit':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')]['limit']||null:null,'include':_0x38f4b0[_0xe59c('0x19')]?_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1c')]?_[_0xe59c('0x1d')](_0x38f4b0[_0xe59c('0x19')][_0xe59c('0x1c')],function(_0x58f192){return{'model':db[_0x58f192['model']],'as':_0x58f192['as'],'attributes':_0x58f192[_0xe59c('0x1b')],'include':_0x58f192[_0xe59c('0x1c')]?_['map'](_0x58f192[_0xe59c('0x1c')],function(_0x3ee3e9){return{'model':db[_0x3ee3e9['model']],'as':_0x3ee3e9['as'],'attributes':_0x3ee3e9['attributes'],'include':_0x3ee3e9[_0xe59c('0x1c')]?_[_0xe59c('0x1d')](_0x3ee3e9[_0xe59c('0x1c')],function(_0x391fe7){return{'model':db[_0x391fe7[_0xe59c('0x1e')]],'as':_0x391fe7['as'],'attributes':_0x391fe7[_0xe59c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe59c('0xc')](function(_0x4012c6){logger[_0xe59c('0xd')](_0xe59c('0x17'),_0x38f4b0);logger[_0xe59c('0x10')](_0xe59c('0x17'),_0x38f4b0,JSON[_0xe59c('0x12')](_0x4012c6));_0x529c0d(_0x4012c6);})['catch'](function(_0x21bfdc){logger[_0xe59c('0x13')](_0xe59c('0x17'),_0x21bfdc[_0xe59c('0x15')],_0x38f4b0);_0xe9f0a1(_0x32bfd7[_0xe59c('0x13')](0x1f4,_0x21bfdc['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index add68e5..35f88a8 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 _0x2828=['Router','fs-extra','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','update','delete','destroy','removeBlackLists','exports','util','path','connect-timeout','express'];(function(_0x105cd1,_0x277472){var _0x28480f=function(_0x4a706a){while(--_0x4a706a){_0x105cd1['push'](_0x105cd1['shift']());}};_0x28480f(++_0x277472);}(_0x2828,0x1dc));var _0x8282=function(_0x4a1cb6,_0x2401f4){_0x4a1cb6=_0x4a1cb6-0x0;var _0x5c33cf=_0x2828[_0x4a1cb6];return _0x5c33cf;};'use strict';var multer=require('multer');var util=require(_0x8282('0x0'));var path=require(_0x8282('0x1'));var timeout=require(_0x8282('0x2'));var express=require(_0x8282('0x3'));var router=express[_0x8282('0x4')]();var fs_extra=require(_0x8282('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8282('0x6'));var config=require('../../config/environment');var controller=require(_0x8282('0x7'));router['get']('/',auth[_0x8282('0x8')](),controller[_0x8282('0x9')]);router[_0x8282('0xa')](_0x8282('0xb'),auth[_0x8282('0x8')](),controller['show']);router[_0x8282('0xa')](_0x8282('0xc'),auth[_0x8282('0x8')](),controller[_0x8282('0xd')]);router[_0x8282('0xa')](_0x8282('0xe'),auth[_0x8282('0x8')](),controller['getHopperHistories']);router[_0x8282('0xa')](_0x8282('0xf'),auth['isAuthenticated'](),controller[_0x8282('0x10')]);router[_0x8282('0xa')](_0x8282('0x11'),auth['isAuthenticated'](),controller[_0x8282('0x12')]);router[_0x8282('0xa')](_0x8282('0x13'),auth['isAuthenticated'](),controller['getLists']);router[_0x8282('0xa')](_0x8282('0x14'),auth[_0x8282('0x8')](),controller[_0x8282('0x15')]);router[_0x8282('0x16')]('/',auth[_0x8282('0x8')](),controller['create']);router[_0x8282('0x16')](_0x8282('0x17'),auth[_0x8282('0x8')](),controller['clone']);router[_0x8282('0x16')](_0x8282('0x13'),auth[_0x8282('0x8')](),controller[_0x8282('0x18')]);router[_0x8282('0x16')](_0x8282('0x14'),auth['isAuthenticated'](),controller['addBlackLists']);router['put']('/:id',auth[_0x8282('0x8')](),controller[_0x8282('0x19')]);router[_0x8282('0x1a')](_0x8282('0xb'),auth['isAuthenticated'](),controller[_0x8282('0x1b')]);router['delete'](_0x8282('0x13'),auth['isAuthenticated'](),controller['removeLists']);router[_0x8282('0x1a')](_0x8282('0x14'),auth['isAuthenticated'](),controller[_0x8282('0x1c')]);module[_0x8282('0x1d')]=router;
\ No newline at end of file
+var _0xbc4b=['getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','addBlackLists','put','destroy','delete','/:id/lists','removeLists','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals'];(function(_0x30d8e7,_0x4f0c59){var _0x11cde7=function(_0x4d101e){while(--_0x4d101e){_0x30d8e7['push'](_0x30d8e7['shift']());}};_0x11cde7(++_0x4f0c59);}(_0xbc4b,0x17a));var _0xbbc4=function(_0x499007,_0x44b8fb){_0x499007=_0x499007-0x0;var _0x52fad7=_0xbc4b[_0x499007];return _0x52fad7;};'use strict';var multer=require(_0xbbc4('0x0'));var util=require('util');var path=require(_0xbbc4('0x1'));var timeout=require('connect-timeout');var express=require(_0xbbc4('0x2'));var router=express[_0xbbc4('0x3')]();var fs_extra=require(_0xbbc4('0x4'));var auth=require(_0xbbc4('0x5'));var interaction=require(_0xbbc4('0x6'));var config=require(_0xbbc4('0x7'));var controller=require(_0xbbc4('0x8'));router[_0xbbc4('0x9')]('/',auth[_0xbbc4('0xa')](),controller[_0xbbc4('0xb')]);router[_0xbbc4('0x9')](_0xbbc4('0xc'),auth['isAuthenticated'](),controller[_0xbbc4('0xd')]);router[_0xbbc4('0x9')](_0xbbc4('0xe'),auth['isAuthenticated'](),controller[_0xbbc4('0xf')]);router[_0xbbc4('0x9')](_0xbbc4('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbbc4('0x9')](_0xbbc4('0x11'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x12')]);router[_0xbbc4('0x9')](_0xbbc4('0x13'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x14')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xbbc4('0x15')]);router[_0xbbc4('0x9')](_0xbbc4('0x16'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x17')]);router[_0xbbc4('0x18')]('/',auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x19')]);router[_0xbbc4('0x18')]('/:id/clone',auth[_0xbbc4('0xa')](),controller['clone']);router['post']('/:id/lists',auth[_0xbbc4('0xa')](),controller['addLists']);router[_0xbbc4('0x18')]('/:id/blacklists',auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x1a')]);router[_0xbbc4('0x1b')](_0xbbc4('0xc'),auth[_0xbbc4('0xa')](),controller['update']);router['delete'](_0xbbc4('0xc'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x1c')]);router[_0xbbc4('0x1d')](_0xbbc4('0x1e'),auth[_0xbbc4('0xa')](),controller[_0xbbc4('0x1f')]);router[_0xbbc4('0x1d')](_0xbbc4('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xbbc4('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 9e16267..089691b 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 _0x2d92=['exports','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x41396d,_0x2bdcc7){var _0x3ec7f0=function(_0x430fb9){while(--_0x430fb9){_0x41396d['push'](_0x41396d['shift']());}};_0x3ec7f0(++_0x2bdcc7);}(_0x2d92,0x1df));var _0x22d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d92[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x22d9('0x0'));module[_0x22d9('0x1')]={'key':{'type':Sequelize[_0x22d9('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x22d9('0x2')]},'name':{'type':Sequelize[_0x22d9('0x3')],'get':function(){return this[_0x22d9('0x4')](_0x22d9('0x5'));}}};
\ No newline at end of file
+var _0xce3d=['VIRTUAL','getDataValue','key','sequelize','TEXT'];(function(_0x210b93,_0x133e6d){var _0x2b020f=function(_0x3f9601){while(--_0x3f9601){_0x210b93['push'](_0x210b93['shift']());}};_0x2b020f(++_0x133e6d);}(_0xce3d,0x166));var _0xdce3=function(_0x490f59,_0x51681d){_0x490f59=_0x490f59-0x0;var _0x5e4394=_0xce3d[_0x490f59];return _0x5e4394;};'use strict';var Sequelize=require(_0xdce3('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xdce3('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xdce3('0x2')],'get':function(){return this[_0xdce3('0x3')](_0xdce3('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index f92ac10..35587b7 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 _0x5a93=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','then','end','error','stack','name','send','map','CannedAnswer','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service'];(function(_0x2e2eb2,_0x29d6fb){var _0x1d0647=function(_0x9c5826){while(--_0x9c5826){_0x2e2eb2['push'](_0x2e2eb2['shift']());}};_0x1d0647(++_0x29d6fb);}(_0x5a93,0xab));var _0x35a9=function(_0x228685,_0x2fdfe3){_0x228685=_0x228685-0x0;var _0x2364ac=_0x5a93[_0x228685];return _0x2364ac;};'use strict';var emlformat=require(_0x35a9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x35a9('0x1'));var rp=require(_0x35a9('0x2'));var moment=require(_0x35a9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x35a9('0x4'));var util=require(_0x35a9('0x5'));var path=require(_0x35a9('0x6'));var sox=require(_0x35a9('0x7'));var csv=require(_0x35a9('0x8'));var ejs=require(_0x35a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35a9('0xa'));var squel=require(_0x35a9('0xb'));var crypto=require(_0x35a9('0xc'));var jsforce=require(_0x35a9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x35a9('0x8'));var querystring=require(_0x35a9('0xe'));var Papa=require(_0x35a9('0xf'));var Redis=require('ioredis');var authService=require(_0x35a9('0x10'));var qs=require(_0x35a9('0x11'));var as=require(_0x35a9('0x12'));var hardwareService=require(_0x35a9('0x13'));var logger=require(_0x35a9('0x14'))(_0x35a9('0x15'));var utils=require('../../config/utils');var config=require(_0x35a9('0x16'));var licenseUtil=require(_0x35a9('0x17'));var db=require(_0x35a9('0x18'))['db'];function respondWithStatusCode(_0x5dfe37,_0x111e2d){_0x111e2d=_0x111e2d||0xcc;return function(_0x3067c8){if(_0x3067c8){return _0x5dfe37[_0x35a9('0x19')](_0x111e2d);}return _0x5dfe37[_0x35a9('0x1a')](_0x111e2d)['end']();};}function respondWithResult(_0x3d9241,_0x4af1c7){_0x4af1c7=_0x4af1c7||0xc8;return function(_0x335469){if(_0x335469){return _0x3d9241[_0x35a9('0x1a')](_0x4af1c7)[_0x35a9('0x1b')](_0x335469);}};}function respondWithFilteredResult(_0x3a7ff3,_0x3a8403){return function(_0x1f1ac5){if(_0x1f1ac5){var _0x5af421=typeof _0x3a8403['offset']===_0x35a9('0x1c')&&typeof _0x3a8403[_0x35a9('0x1d')]==='undefined';var _0x24398e=_0x1f1ac5[_0x35a9('0x1e')];var _0x158e67=_0x5af421?0x0:_0x3a8403[_0x35a9('0x1f')];var _0x2374c4=_0x5af421?_0x1f1ac5[_0x35a9('0x1e')]:_0x3a8403[_0x35a9('0x1f')]+_0x3a8403[_0x35a9('0x1d')];var _0x124a8e;if(_0x2374c4>=_0x24398e){_0x2374c4=_0x24398e;_0x124a8e=0xc8;}else{_0x124a8e=0xce;}_0x3a7ff3['status'](_0x124a8e);return _0x3a7ff3['set'](_0x35a9('0x20'),_0x158e67+'-'+_0x2374c4+'/'+_0x24398e)[_0x35a9('0x1b')](_0x1f1ac5);}return null;};}function patchUpdates(_0x3a8f85){return function(_0x146b99){try{jsonpatch[_0x35a9('0x21')](_0x146b99,_0x3a8f85,!![]);}catch(_0x562f81){return BPromise[_0x35a9('0x22')](_0x562f81);}return _0x146b99[_0x35a9('0x23')]();};}function saveUpdates(_0x1e9f58,_0x14d884){return function(_0x3b31a1){if(_0x3b31a1){return _0x3b31a1[_0x35a9('0x24')](_0x1e9f58)['then'](function(_0x33dc58){return _0x33dc58;});}return null;};}function removeEntity(_0x4f57e3,_0x3953c6){return function(_0xcf1c03){if(_0xcf1c03){return _0xcf1c03[_0x35a9('0x25')]()['then'](function(){var _0x33c4f8=_0xcf1c03[_0x35a9('0x26')]({'plain':!![]});var _0x4a18e3=_0x35a9('0x27');return db[_0x35a9('0x28')][_0x35a9('0x25')]({'where':{'type':_0x4a18e3,'resourceId':_0x33c4f8['id']}})[_0x35a9('0x29')](function(){return _0xcf1c03;});})[_0x35a9('0x29')](function(){_0x4f57e3['status'](0xcc)[_0x35a9('0x2a')]();});}};}function handleEntityNotFound(_0x2b7dd0,_0x516e5b){return function(_0x42d348){if(!_0x42d348){_0x2b7dd0[_0x35a9('0x19')](0x194);}return _0x42d348;};}function handleError(_0x784b3b,_0x566dcb){_0x566dcb=_0x566dcb||0x1f4;return function(_0x5dd3fc){logger[_0x35a9('0x2b')](_0x5dd3fc[_0x35a9('0x2c')]);if(_0x5dd3fc['name']){delete _0x5dd3fc[_0x35a9('0x2d')];}_0x784b3b[_0x35a9('0x1a')](_0x566dcb)[_0x35a9('0x2e')](_0x5dd3fc);};}exports['index']=function(_0x4f0e2c,_0x28c407){var _0x3b00ae={},_0x17c481={},_0x29d9c6={'count':0x0,'rows':[]};var _0x3fa77d=_[_0x35a9('0x2f')](db[_0x35a9('0x30')]['rawAttributes'],function(_0x19d3ad){return{'name':_0x19d3ad[_0x35a9('0x31')],'type':_0x19d3ad[_0x35a9('0x32')][_0x35a9('0x33')]};});_0x17c481['model']=_[_0x35a9('0x2f')](_0x3fa77d,'name');_0x17c481[_0x35a9('0x34')]=_[_0x35a9('0x35')](_0x4f0e2c[_0x35a9('0x34')]);_0x17c481[_0x35a9('0x36')]=_[_0x35a9('0x37')](_0x17c481[_0x35a9('0x38')],_0x17c481['query']);_0x3b00ae['attributes']=_[_0x35a9('0x37')](_0x17c481[_0x35a9('0x38')],qs[_0x35a9('0x39')](_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x39')]));_0x3b00ae[_0x35a9('0x3a')]=_0x3b00ae['attributes'][_0x35a9('0x3b')]?_0x3b00ae['attributes']:_0x17c481[_0x35a9('0x38')];if(!_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x3c')](_0x35a9('0x3d'))){_0x3b00ae[_0x35a9('0x1d')]=qs[_0x35a9('0x1d')](_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x1d')]);_0x3b00ae['offset']=qs[_0x35a9('0x1f')](_0x4f0e2c[_0x35a9('0x34')]['offset']);}_0x3b00ae[_0x35a9('0x3e')]=qs[_0x35a9('0x3f')](_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x3f')]);_0x3b00ae[_0x35a9('0x40')]=qs[_0x35a9('0x36')](_[_0x35a9('0x41')](_0x4f0e2c[_0x35a9('0x34')],_0x17c481['filters']),_0x3fa77d);if(_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x42')]){_0x3b00ae[_0x35a9('0x40')]=_[_0x35a9('0x43')](_0x3b00ae[_0x35a9('0x40')],{'$or':[{'key':{'$like':'%'+_0x4f0e2c['query']['filter']+'%'}},{'value':{'$like':'%'+_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x42')]+'%'}}]});}_0x3b00ae=_[_0x35a9('0x43')]({},_0x3b00ae,_0x4f0e2c['options']);var _0x10dc44={'where':_0x3b00ae[_0x35a9('0x40')]};return db[_0x35a9('0x30')]['count'](_0x10dc44)[_0x35a9('0x29')](function(_0x36f4d9){_0x29d9c6[_0x35a9('0x1e')]=_0x36f4d9;if(_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x44')]){_0x3b00ae[_0x35a9('0x45')]=[{'all':!![]}];}return db[_0x35a9('0x30')][_0x35a9('0x46')](_0x3b00ae);})[_0x35a9('0x29')](function(_0x11e25e){_0x29d9c6[_0x35a9('0x47')]=_0x11e25e;return _0x29d9c6;})[_0x35a9('0x29')](respondWithFilteredResult(_0x28c407,_0x3b00ae))[_0x35a9('0x48')](handleError(_0x28c407,null));};exports[_0x35a9('0x49')]=function(_0x9dc6fe,_0x18b7c3){var _0x41614f={'raw':!![],'where':{'id':_0x9dc6fe[_0x35a9('0x4a')]['id']}},_0x38238a={};_0x38238a['model']=_['keys'](db[_0x35a9('0x30')][_0x35a9('0x4b')]);_0x38238a[_0x35a9('0x34')]=_[_0x35a9('0x35')](_0x9dc6fe[_0x35a9('0x34')]);_0x38238a[_0x35a9('0x36')]=_['intersection'](_0x38238a[_0x35a9('0x38')],_0x38238a[_0x35a9('0x34')]);_0x41614f[_0x35a9('0x3a')]=_[_0x35a9('0x37')](_0x38238a[_0x35a9('0x38')],qs['fields'](_0x9dc6fe['query'][_0x35a9('0x39')]));_0x41614f[_0x35a9('0x3a')]=_0x41614f[_0x35a9('0x3a')]['length']?_0x41614f[_0x35a9('0x3a')]:_0x38238a['model'];if(_0x9dc6fe[_0x35a9('0x34')][_0x35a9('0x44')]){_0x41614f['include']=[{'all':!![]}];}_0x41614f=_[_0x35a9('0x43')]({},_0x41614f,_0x9dc6fe[_0x35a9('0x4c')]);return db['CannedAnswer'][_0x35a9('0x4d')](_0x41614f)[_0x35a9('0x29')](handleEntityNotFound(_0x18b7c3,null))['then'](respondWithResult(_0x18b7c3,null))[_0x35a9('0x48')](handleError(_0x18b7c3,null));};exports[_0x35a9('0x24')]=function(_0x14905e,_0x1c7666){if(_0x14905e[_0x35a9('0x4e')]['id']){delete _0x14905e[_0x35a9('0x4e')]['id'];}return db[_0x35a9('0x30')]['find']({'where':{'id':_0x14905e[_0x35a9('0x4a')]['id']}})[_0x35a9('0x29')](handleEntityNotFound(_0x1c7666,null))[_0x35a9('0x29')](saveUpdates(_0x14905e[_0x35a9('0x4e')],null))['then'](respondWithResult(_0x1c7666,null))[_0x35a9('0x48')](handleError(_0x1c7666,null));};exports['destroy']=function(_0x5b38a3,_0x8cd91d){return db[_0x35a9('0x30')][_0x35a9('0x4d')]({'where':{'id':_0x5b38a3[_0x35a9('0x4a')]['id']}})[_0x35a9('0x29')](handleEntityNotFound(_0x8cd91d,null))['then'](removeEntity(_0x8cd91d,null))['catch'](handleError(_0x8cd91d,null));};exports[_0x35a9('0x4f')]=function(_0x43139a,_0x5656af){var _0x2676de={'key':_0x43139a[_0x35a9('0x4e')][_0x35a9('0x33')]};if(_0x43139a[_0x35a9('0x4e')]['MailAccountId']){_0x2676de[_0x35a9('0x50')]=_0x43139a[_0x35a9('0x4e')]['MailAccountId'];}else if(_0x43139a[_0x35a9('0x4e')][_0x35a9('0x51')]){_0x2676de[_0x35a9('0x51')]=_0x43139a[_0x35a9('0x4e')][_0x35a9('0x51')];}else if(_0x43139a[_0x35a9('0x4e')][_0x35a9('0x52')]){_0x2676de[_0x35a9('0x52')]=_0x43139a[_0x35a9('0x4e')][_0x35a9('0x52')];}else if(_0x43139a[_0x35a9('0x4e')][_0x35a9('0x53')]){_0x2676de[_0x35a9('0x53')]=_0x43139a[_0x35a9('0x4e')][_0x35a9('0x53')];}return db[_0x35a9('0x30')]['find']({'where':_0x2676de})[_0x35a9('0x29')](function(_0x127dbc){if(_0x127dbc){throw new db[(_0x35a9('0x54'))][(_0x35a9('0x55'))](_0x35a9('0x56'));}return db['CannedAnswer'][_0x35a9('0x4f')](_0x43139a[_0x35a9('0x4e')]);})[_0x35a9('0x29')](function(_0x3f846e){var _0x23496c=_0x43139a[_0x35a9('0x57')]['get']({'plain':!![]});if(!_0x23496c)throw new Error(_0x35a9('0x58'));if(_0x23496c[_0x35a9('0x59')]==='user'){var _0x26ee4c=_0x3f846e[_0x35a9('0x26')]({'plain':!![]});return db[_0x35a9('0x5a')][_0x35a9('0x4d')]({'where':{'name':_0x35a9('0x27'),'userProfileId':_0x23496c[_0x35a9('0x5b')]},'raw':!![]})[_0x35a9('0x29')](function(_0x29733a){if(_0x29733a&&_0x29733a[_0x35a9('0x5c')]===0x0){return db['UserProfileResource'][_0x35a9('0x4f')]({'name':_0x26ee4c[_0x35a9('0x2d')],'resourceId':_0x26ee4c['id'],'type':_0x29733a[_0x35a9('0x2d')],'sectionId':_0x29733a['id']},{})[_0x35a9('0x29')](function(){return _0x3f846e;});}else{return _0x3f846e;}})[_0x35a9('0x48')](function(_0x442e9c){logger[_0x35a9('0x2b')](_0x35a9('0x5d'),_0x442e9c);throw _0x442e9c;});}return _0x3f846e;})['then'](respondWithResult(_0x5656af,0xc9))['catch'](handleError(_0x5656af,null));};
\ No newline at end of file
+var _0x51f4=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','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','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3ad776,_0x3b8ad8){var _0x10bd47=function(_0x4e4897){while(--_0x4e4897){_0x3ad776['push'](_0x3ad776['shift']());}};_0x10bd47(++_0x3b8ad8);}(_0x51f4,0xb3));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x451f('0x0'));var rimraf=require(_0x451f('0x1'));var zipdir=require(_0x451f('0x2'));var jsonpatch=require(_0x451f('0x3'));var rp=require(_0x451f('0x4'));var moment=require(_0x451f('0x5'));var BPromise=require(_0x451f('0x6'));var Mustache=require(_0x451f('0x7'));var util=require('util');var path=require(_0x451f('0x8'));var sox=require(_0x451f('0x9'));var csv=require(_0x451f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x451f('0xb'));var _=require(_0x451f('0xc'));var squel=require(_0x451f('0xd'));var crypto=require(_0x451f('0xe'));var jsforce=require(_0x451f('0xf'));var deskjs=require(_0x451f('0x10'));var toCsv=require(_0x451f('0xa'));var querystring=require(_0x451f('0x11'));var Papa=require(_0x451f('0x12'));var Redis=require('ioredis');var authService=require(_0x451f('0x13'));var qs=require(_0x451f('0x14'));var as=require(_0x451f('0x15'));var hardwareService=require(_0x451f('0x16'));var logger=require(_0x451f('0x17'))(_0x451f('0x18'));var utils=require(_0x451f('0x19'));var config=require(_0x451f('0x1a'));var licenseUtil=require(_0x451f('0x1b'));var db=require(_0x451f('0x1c'))['db'];function respondWithStatusCode(_0xeacd9c,_0x5f7eb5){_0x5f7eb5=_0x5f7eb5||0xcc;return function(_0x3471ae){if(_0x3471ae){return _0xeacd9c['sendStatus'](_0x5f7eb5);}return _0xeacd9c[_0x451f('0x1d')](_0x5f7eb5)[_0x451f('0x1e')]();};}function respondWithResult(_0x43f6db,_0x5f4483){_0x5f4483=_0x5f4483||0xc8;return function(_0x4837c7){if(_0x4837c7){return _0x43f6db['status'](_0x5f4483)['json'](_0x4837c7);}};}function respondWithFilteredResult(_0x4187b7,_0x5255fd){return function(_0x5ba41f){if(_0x5ba41f){var _0x286b8f=typeof _0x5255fd[_0x451f('0x1f')]===_0x451f('0x20')&&typeof _0x5255fd[_0x451f('0x21')]==='undefined';var _0xa77027=_0x5ba41f[_0x451f('0x22')];var _0x504335=_0x286b8f?0x0:_0x5255fd[_0x451f('0x1f')];var _0x273e6e=_0x286b8f?_0x5ba41f[_0x451f('0x22')]:_0x5255fd[_0x451f('0x1f')]+_0x5255fd[_0x451f('0x21')];var _0x2a1fc8;if(_0x273e6e>=_0xa77027){_0x273e6e=_0xa77027;_0x2a1fc8=0xc8;}else{_0x2a1fc8=0xce;}_0x4187b7[_0x451f('0x1d')](_0x2a1fc8);return _0x4187b7[_0x451f('0x23')](_0x451f('0x24'),_0x504335+'-'+_0x273e6e+'/'+_0xa77027)['json'](_0x5ba41f);}return null;};}function patchUpdates(_0x1b275f){return function(_0x2effcc){try{jsonpatch[_0x451f('0x25')](_0x2effcc,_0x1b275f,!![]);}catch(_0x18ad17){return BPromise[_0x451f('0x26')](_0x18ad17);}return _0x2effcc['save']();};}function saveUpdates(_0x3dbde8,_0x1f0a7f){return function(_0x2a8580){if(_0x2a8580){return _0x2a8580[_0x451f('0x27')](_0x3dbde8)[_0x451f('0x28')](function(_0x375619){return _0x375619;});}return null;};}function removeEntity(_0x462c43,_0x168753){return function(_0x3d3f94){if(_0x3d3f94){return _0x3d3f94[_0x451f('0x29')]()[_0x451f('0x28')](function(){var _0x59f3bc=_0x3d3f94['get']({'plain':!![]});var _0x580c7f=_0x451f('0x2a');return db[_0x451f('0x2b')][_0x451f('0x29')]({'where':{'type':_0x580c7f,'resourceId':_0x59f3bc['id']}})[_0x451f('0x28')](function(){return _0x3d3f94;});})[_0x451f('0x28')](function(){_0x462c43[_0x451f('0x1d')](0xcc)[_0x451f('0x1e')]();});}};}function handleEntityNotFound(_0x4dbac8,_0x30b8be){return function(_0x5750cc){if(!_0x5750cc){_0x4dbac8['sendStatus'](0x194);}return _0x5750cc;};}function handleError(_0x24b8f3,_0x2dd3dc){_0x2dd3dc=_0x2dd3dc||0x1f4;return function(_0x28306d){logger[_0x451f('0x2c')](_0x28306d[_0x451f('0x2d')]);if(_0x28306d['name']){delete _0x28306d['name'];}_0x24b8f3[_0x451f('0x1d')](_0x2dd3dc)[_0x451f('0x2e')](_0x28306d);};}exports[_0x451f('0x2f')]=function(_0x480f3b,_0x57b925){var _0x18d5b3={},_0x12be7c={},_0x446beb={'count':0x0,'rows':[]};var _0x15a654=_['map'](db['CannedAnswer'][_0x451f('0x30')],function(_0x120efd){return{'name':_0x120efd[_0x451f('0x31')],'type':_0x120efd['type'][_0x451f('0x32')]};});_0x12be7c['model']=_[_0x451f('0x33')](_0x15a654,'name');_0x12be7c['query']=_['keys'](_0x480f3b[_0x451f('0x34')]);_0x12be7c[_0x451f('0x35')]=_['intersection'](_0x12be7c[_0x451f('0x36')],_0x12be7c[_0x451f('0x34')]);_0x18d5b3[_0x451f('0x37')]=_[_0x451f('0x38')](_0x12be7c['model'],qs[_0x451f('0x39')](_0x480f3b[_0x451f('0x34')][_0x451f('0x39')]));_0x18d5b3[_0x451f('0x37')]=_0x18d5b3[_0x451f('0x37')][_0x451f('0x3a')]?_0x18d5b3[_0x451f('0x37')]:_0x12be7c['model'];if(!_0x480f3b['query'][_0x451f('0x3b')](_0x451f('0x3c'))){_0x18d5b3[_0x451f('0x21')]=qs[_0x451f('0x21')](_0x480f3b['query'][_0x451f('0x21')]);_0x18d5b3['offset']=qs[_0x451f('0x1f')](_0x480f3b[_0x451f('0x34')][_0x451f('0x1f')]);}_0x18d5b3['order']=qs['sort'](_0x480f3b['query'][_0x451f('0x3d')]);_0x18d5b3['where']=qs[_0x451f('0x35')](_['pick'](_0x480f3b[_0x451f('0x34')],_0x12be7c[_0x451f('0x35')]),_0x15a654);if(_0x480f3b[_0x451f('0x34')][_0x451f('0x3e')]){_0x18d5b3[_0x451f('0x3f')]=_[_0x451f('0x40')](_0x18d5b3[_0x451f('0x3f')],{'$or':[{'key':{'$like':'%'+_0x480f3b[_0x451f('0x34')][_0x451f('0x3e')]+'%'}},{'value':{'$like':'%'+_0x480f3b[_0x451f('0x34')][_0x451f('0x3e')]+'%'}}]});}_0x18d5b3=_['merge']({},_0x18d5b3,_0x480f3b[_0x451f('0x41')]);var _0x44e7e3={'where':_0x18d5b3['where']};return db[_0x451f('0x42')]['count'](_0x44e7e3)['then'](function(_0x406c7c){_0x446beb[_0x451f('0x22')]=_0x406c7c;if(_0x480f3b[_0x451f('0x34')][_0x451f('0x43')]){_0x18d5b3[_0x451f('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x451f('0x45')](_0x18d5b3);})[_0x451f('0x28')](function(_0x26dcfb){_0x446beb[_0x451f('0x46')]=_0x26dcfb;return _0x446beb;})[_0x451f('0x28')](respondWithFilteredResult(_0x57b925,_0x18d5b3))[_0x451f('0x47')](handleError(_0x57b925,null));};exports[_0x451f('0x48')]=function(_0x296bdc,_0xa0a259){var _0x58539e={'raw':!![],'where':{'id':_0x296bdc[_0x451f('0x49')]['id']}},_0x4ba027={};_0x4ba027[_0x451f('0x36')]=_[_0x451f('0x4a')](db['CannedAnswer'][_0x451f('0x30')]);_0x4ba027['query']=_[_0x451f('0x4a')](_0x296bdc['query']);_0x4ba027['filters']=_['intersection'](_0x4ba027[_0x451f('0x36')],_0x4ba027[_0x451f('0x34')]);_0x58539e['attributes']=_[_0x451f('0x38')](_0x4ba027['model'],qs[_0x451f('0x39')](_0x296bdc[_0x451f('0x34')][_0x451f('0x39')]));_0x58539e[_0x451f('0x37')]=_0x58539e['attributes'][_0x451f('0x3a')]?_0x58539e[_0x451f('0x37')]:_0x4ba027[_0x451f('0x36')];if(_0x296bdc[_0x451f('0x34')][_0x451f('0x43')]){_0x58539e[_0x451f('0x44')]=[{'all':!![]}];}_0x58539e=_[_0x451f('0x40')]({},_0x58539e,_0x296bdc[_0x451f('0x41')]);return db['CannedAnswer'][_0x451f('0x4b')](_0x58539e)[_0x451f('0x28')](handleEntityNotFound(_0xa0a259,null))[_0x451f('0x28')](respondWithResult(_0xa0a259,null))['catch'](handleError(_0xa0a259,null));};exports['update']=function(_0x477fcf,_0x39fe89){if(_0x477fcf[_0x451f('0x4c')]['id']){delete _0x477fcf['body']['id'];}return db[_0x451f('0x42')][_0x451f('0x4b')]({'where':{'id':_0x477fcf[_0x451f('0x49')]['id']}})['then'](handleEntityNotFound(_0x39fe89,null))[_0x451f('0x28')](saveUpdates(_0x477fcf[_0x451f('0x4c')],null))[_0x451f('0x28')](respondWithResult(_0x39fe89,null))[_0x451f('0x47')](handleError(_0x39fe89,null));};exports[_0x451f('0x29')]=function(_0x221214,_0x3a3cb0){return db[_0x451f('0x42')][_0x451f('0x4b')]({'where':{'id':_0x221214['params']['id']}})[_0x451f('0x28')](handleEntityNotFound(_0x3a3cb0,null))[_0x451f('0x28')](removeEntity(_0x3a3cb0,null))['catch'](handleError(_0x3a3cb0,null));};exports[_0x451f('0x4d')]=function(_0x2d8986,_0x440adc){var _0x2ae6b0={'key':_0x2d8986[_0x451f('0x4c')]['key']};if(_0x2d8986['body'][_0x451f('0x4e')]){_0x2ae6b0[_0x451f('0x4e')]=_0x2d8986[_0x451f('0x4c')][_0x451f('0x4e')];}else if(_0x2d8986[_0x451f('0x4c')][_0x451f('0x4f')]){_0x2ae6b0[_0x451f('0x4f')]=_0x2d8986[_0x451f('0x4c')][_0x451f('0x4f')];}else if(_0x2d8986[_0x451f('0x4c')][_0x451f('0x50')]){_0x2ae6b0[_0x451f('0x50')]=_0x2d8986['body'][_0x451f('0x50')];}else if(_0x2d8986[_0x451f('0x4c')]['ChatWebsiteId']){_0x2ae6b0[_0x451f('0x51')]=_0x2d8986['body'][_0x451f('0x51')];}return db[_0x451f('0x42')][_0x451f('0x4b')]({'where':_0x2ae6b0})[_0x451f('0x28')](function(_0x4d3ec3){if(_0x4d3ec3){throw new db[(_0x451f('0x52'))][(_0x451f('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x451f('0x4d')](_0x2d8986[_0x451f('0x4c')]);})['then'](function(_0x483244){var _0x42153f=_0x2d8986['user']['get']({'plain':!![]});if(!_0x42153f)throw new Error(_0x451f('0x54'));if(_0x42153f['role']===_0x451f('0x55')){var _0x94ea8b=_0x483244[_0x451f('0x56')]({'plain':!![]});return db[_0x451f('0x57')][_0x451f('0x4b')]({'where':{'name':_0x451f('0x2a'),'userProfileId':_0x42153f[_0x451f('0x58')]},'raw':!![]})[_0x451f('0x28')](function(_0x2c8e57){if(_0x2c8e57&&_0x2c8e57[_0x451f('0x59')]===0x0){return db['UserProfileResource'][_0x451f('0x4d')]({'name':_0x94ea8b[_0x451f('0x5a')],'resourceId':_0x94ea8b['id'],'type':_0x2c8e57['name'],'sectionId':_0x2c8e57['id']},{})['then'](function(){return _0x483244;});}else{return _0x483244;}})[_0x451f('0x47')](function(_0x433a42){logger['error'](_0x451f('0x5b'),_0x433a42);throw _0x433a42;});}return _0x483244;})['then'](respondWithResult(_0x440adc,0xc9))[_0x451f('0x47')](handleError(_0x440adc,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 1210012..9081d36 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 _0x4ca0=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash'];(function(_0x27081f,_0x5942ef){var _0x43d207=function(_0x25be6c){while(--_0x25be6c){_0x27081f['push'](_0x27081f['shift']());}};_0x43d207(++_0x5942ef);}(_0x4ca0,0x1c1));var _0x04ca=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x4ca0[_0x349148];return _0x2f2b0f;};'use strict';var _=require(_0x04ca('0x0'));var util=require(_0x04ca('0x1'));var logger=require(_0x04ca('0x2'))('api');var moment=require(_0x04ca('0x3'));var BPromise=require(_0x04ca('0x4'));var rp=require(_0x04ca('0x5'));var fs=require('fs');var path=require(_0x04ca('0x6'));var rimraf=require(_0x04ca('0x7'));var config=require(_0x04ca('0x8'));var attributes=require(_0x04ca('0x9'));module[_0x04ca('0xa')]=function(_0x32c73b,_0x338dd6){return _0x32c73b[_0x04ca('0xb')](_0x04ca('0xc'),attributes,{'tableName':_0x04ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x04ca('0xe')});};
\ No newline at end of file
+var _0x657b=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1f74af,_0x3d34b1){var _0x55374f=function(_0x26c179){while(--_0x26c179){_0x1f74af['push'](_0x1f74af['shift']());}};_0x55374f(++_0x3d34b1);}(_0x657b,0x131));var _0xb657=function(_0x28d518,_0x473f87){_0x28d518=_0x28d518-0x0;var _0x87c9a1=_0x657b[_0x28d518];return _0x87c9a1;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var logger=require(_0xb657('0x2'))(_0xb657('0x3'));var moment=require(_0xb657('0x4'));var BPromise=require('bluebird');var rp=require(_0xb657('0x5'));var fs=require('fs');var path=require(_0xb657('0x6'));var rimraf=require('rimraf');var config=require(_0xb657('0x7'));var attributes=require(_0xb657('0x8'));module[_0xb657('0x9')]=function(_0x25738d,_0x446b17){return _0x25738d['define'](_0xb657('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb657('0xb'),'collate':_0xb657('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 6769f83..4c1e561 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5e1b60,_0x41fcca){var _0x284a1e=function(_0x38f226){while(--_0x38f226){_0x5e1b60['push'](_0x5e1b60['shift']());}};_0x284a1e(++_0x41fcca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x167198,_0x55bffd){var _0x21acf6=function(_0x34e7ae){while(--_0x34e7ae){_0x167198['push'](_0x167198['shift']());}};_0x21acf6(++_0x55bffd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 7870614..c488043 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 _0xefde=['fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xefde,0xaf));var _0xeefd=function(_0x39956f,_0x3cf033){_0x39956f=_0x39956f-0x0;var _0x220c40=_0xefde[_0x39956f];return _0x220c40;};'use strict';var multer=require(_0xeefd('0x0'));var util=require(_0xeefd('0x1'));var path=require(_0xeefd('0x2'));var timeout=require(_0xeefd('0x3'));var express=require(_0xeefd('0x4'));var router=express['Router']();var fs_extra=require(_0xeefd('0x5'));var auth=require(_0xeefd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeefd('0x7'));router[_0xeefd('0x8')]('/',auth[_0xeefd('0x9')](),controller[_0xeefd('0xa')]);router[_0xeefd('0x8')](_0xeefd('0xb'),auth['isAuthenticated'](),controller[_0xeefd('0xc')]);router[_0xeefd('0xd')]('/',auth[_0xeefd('0x9')](),controller['create']);router['put'](_0xeefd('0xb'),auth[_0xeefd('0x9')](),controller[_0xeefd('0xe')]);router[_0xeefd('0xf')](_0xeefd('0xb'),auth[_0xeefd('0x9')](),controller[_0xeefd('0x10')]);module[_0xeefd('0x11')]=router;
\ No newline at end of file
+var _0xba06=['create','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xba06,0x1e0));var _0x6ba0=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xba06[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require('multer');var util=require(_0x6ba0('0x0'));var path=require(_0x6ba0('0x1'));var timeout=require(_0x6ba0('0x2'));var express=require(_0x6ba0('0x3'));var router=express[_0x6ba0('0x4')]();var fs_extra=require(_0x6ba0('0x5'));var auth=require(_0x6ba0('0x6'));var interaction=require(_0x6ba0('0x7'));var config=require(_0x6ba0('0x8'));var controller=require(_0x6ba0('0x9'));router[_0x6ba0('0xa')]('/',auth[_0x6ba0('0xb')](),controller[_0x6ba0('0xc')]);router[_0x6ba0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6ba0('0xd')]);router['post']('/',auth[_0x6ba0('0xb')](),controller[_0x6ba0('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6ba0('0xf')]);router[_0x6ba0('0x10')](_0x6ba0('0x11'),auth[_0x6ba0('0xb')](),controller['destroy']);module[_0x6ba0('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 6dfa174..d1d4649 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 _0x38d0=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2b4f12,_0x281a09){var _0x53a86b=function(_0x5592a1){while(--_0x5592a1){_0x2b4f12['push'](_0x2b4f12['shift']());}};_0x53a86b(++_0x281a09);}(_0x38d0,0x123));var _0x038d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x38d0[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x038d('0x0')]={'calldate':{'type':Sequelize[_0x038d('0x1')],'allowNull':![],'defaultValue':_0x038d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x038d('0x3')]},'dst':{'type':Sequelize[_0x038d('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x038d('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x038d('0x3')]},'duration':{'type':Sequelize[_0x038d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x038d('0x3')]},'amaflags':{'type':Sequelize[_0x038d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x038d('0x3')]},'userfield':{'type':Sequelize[_0x038d('0x3')]},'uniqueid':{'type':Sequelize[_0x038d('0x3')]},'linkedid':{'type':Sequelize[_0x038d('0x3')]},'sequence':{'type':Sequelize[_0x038d('0x3')]},'peeraccount':{'type':Sequelize[_0x038d('0x3')]},'type':{'type':Sequelize[_0x038d('0x3')]},'tag':{'type':Sequelize[_0x038d('0x3')]}};
\ No newline at end of file
+var _0x6a00=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x5f418c,_0x470146){var _0x3681eb=function(_0x2369a3){while(--_0x2369a3){_0x5f418c['push'](_0x5f418c['shift']());}};_0x3681eb(++_0x470146);}(_0x6a00,0xc9));var _0x06a0=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x6a00[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x06a0('0x0'));module[_0x06a0('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x06a0('0x2')},'clid':{'type':Sequelize[_0x06a0('0x3')]},'src':{'type':Sequelize[_0x06a0('0x3')]},'dst':{'type':Sequelize[_0x06a0('0x3')]},'dcontext':{'type':Sequelize[_0x06a0('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x06a0('0x3')]},'lastdata':{'type':Sequelize[_0x06a0('0x3')]},'duration':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x06a0('0x3')]},'amaflags':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x06a0('0x3')]},'uniqueid':{'type':Sequelize[_0x06a0('0x3')]},'linkedid':{'type':Sequelize[_0x06a0('0x3')]},'sequence':{'type':Sequelize[_0x06a0('0x3')]},'peeraccount':{'type':Sequelize[_0x06a0('0x3')]},'type':{'type':Sequelize[_0x06a0('0x3')]},'tag':{'type':Sequelize[_0x06a0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index bc4b36d..bb8eb13 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 _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2b05b5,_0x4484cc){var _0x1977ba=function(_0x2357a6){while(--_0x2357a6){_0x2b05b5['push'](_0x2b05b5['shift']());}};_0x1977ba(++_0x4484cc);}(_0x86f4,0x18a));var _0x486f=function(_0x2dbd46,_0x1120dd){_0x2dbd46=_0x2dbd46-0x0;var _0x2a7979=_0x86f4[_0x2dbd46];return _0x2a7979;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['Cdr'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['Cdr'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));};
\ No newline at end of file
+var _0x31af=['fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs'];(function(_0x1054fb,_0x2ea752){var _0x36507b=function(_0x145718){while(--_0x145718){_0x1054fb['push'](_0x1054fb['shift']());}};_0x36507b(++_0x2ea752);}(_0x31af,0xde));var _0xf31a=function(_0x504f7b,_0x1ac4e0){_0x504f7b=_0x504f7b-0x0;var _0x2b0904=_0x31af[_0x504f7b];return _0x2b0904;};'use strict';var emlformat=require(_0xf31a('0x0'));var rimraf=require(_0xf31a('0x1'));var zipdir=require(_0xf31a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf31a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf31a('0x4'));var util=require(_0xf31a('0x5'));var path=require(_0xf31a('0x6'));var sox=require(_0xf31a('0x7'));var csv=require('to-csv');var ejs=require(_0xf31a('0x8'));var fs=require('fs');var fs_extra=require(_0xf31a('0x9'));var _=require(_0xf31a('0xa'));var squel=require(_0xf31a('0xb'));var crypto=require('crypto');var jsforce=require(_0xf31a('0xc'));var deskjs=require(_0xf31a('0xd'));var toCsv=require(_0xf31a('0xe'));var querystring=require(_0xf31a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf31a('0x10'));var authService=require(_0xf31a('0x11'));var qs=require(_0xf31a('0x12'));var as=require(_0xf31a('0x13'));var hardwareService=require(_0xf31a('0x14'));var logger=require('../../config/logger')(_0xf31a('0x15'));var utils=require(_0xf31a('0x16'));var config=require(_0xf31a('0x17'));var licenseUtil=require(_0xf31a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b662,_0x26b85e){_0x26b85e=_0x26b85e||0xcc;return function(_0x57ed2f){if(_0x57ed2f){return _0x4b662[_0xf31a('0x19')](_0x26b85e);}return _0x4b662[_0xf31a('0x1a')](_0x26b85e)[_0xf31a('0x1b')]();};}function respondWithResult(_0x18d266,_0x451107){_0x451107=_0x451107||0xc8;return function(_0x203031){if(_0x203031){return _0x18d266[_0xf31a('0x1a')](_0x451107)[_0xf31a('0x1c')](_0x203031);}};}function respondWithFilteredResult(_0x3f7c35,_0x22522c){return function(_0x6ea6f1){if(_0x6ea6f1){var _0x1da226=typeof _0x22522c[_0xf31a('0x1d')]===_0xf31a('0x1e')&&typeof _0x22522c[_0xf31a('0x1f')]==='undefined';var _0x454836=_0x6ea6f1[_0xf31a('0x20')];var _0x251ca7=_0x1da226?0x0:_0x22522c[_0xf31a('0x1d')];var _0x4c3589=_0x1da226?_0x6ea6f1[_0xf31a('0x20')]:_0x22522c[_0xf31a('0x1d')]+_0x22522c[_0xf31a('0x1f')];var _0x208da3;if(_0x4c3589>=_0x454836){_0x4c3589=_0x454836;_0x208da3=0xc8;}else{_0x208da3=0xce;}_0x3f7c35[_0xf31a('0x1a')](_0x208da3);return _0x3f7c35['set'](_0xf31a('0x21'),_0x251ca7+'-'+_0x4c3589+'/'+_0x454836)[_0xf31a('0x1c')](_0x6ea6f1);}return null;};}function patchUpdates(_0x5861df){return function(_0x22c9c3){try{jsonpatch[_0xf31a('0x22')](_0x22c9c3,_0x5861df,!![]);}catch(_0x55da11){return BPromise[_0xf31a('0x23')](_0x55da11);}return _0x22c9c3[_0xf31a('0x24')]();};}function saveUpdates(_0x54f9b5,_0x5724b3){return function(_0x534317){if(_0x534317){return _0x534317[_0xf31a('0x25')](_0x54f9b5)[_0xf31a('0x26')](function(_0x5c23db){return _0x5c23db;});}return null;};}function removeEntity(_0x41d359,_0x2a8a22){return function(_0x5d08ee){if(_0x5d08ee){return _0x5d08ee[_0xf31a('0x27')]()['then'](function(){_0x41d359['status'](0xcc)[_0xf31a('0x1b')]();});}};}function handleEntityNotFound(_0x714292,_0x54ad77){return function(_0x4e115c){if(!_0x4e115c){_0x714292['sendStatus'](0x194);}return _0x4e115c;};}function handleError(_0x531179,_0x14c82e){_0x14c82e=_0x14c82e||0x1f4;return function(_0x45df36){logger[_0xf31a('0x28')](_0x45df36['stack']);if(_0x45df36[_0xf31a('0x29')]){delete _0x45df36[_0xf31a('0x29')];}_0x531179[_0xf31a('0x1a')](_0x14c82e)[_0xf31a('0x2a')](_0x45df36);};}exports[_0xf31a('0x2b')]=function(_0x5a55c6,_0xed9bfd){var _0x2ebc27={},_0x52f8aa={},_0x52da7d={'count':0x0,'rows':[]};var _0x203f28=_[_0xf31a('0x2c')](db['Cdr'][_0xf31a('0x2d')],function(_0x221048){return{'name':_0x221048[_0xf31a('0x2e')],'type':_0x221048['type'][_0xf31a('0x2f')]};});_0x52f8aa[_0xf31a('0x30')]=_[_0xf31a('0x2c')](_0x203f28,_0xf31a('0x29'));_0x52f8aa[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x5a55c6['query']);_0x52f8aa[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],_0x52f8aa[_0xf31a('0x31')]);_0x2ebc27[_0xf31a('0x35')]=_[_0xf31a('0x34')](_0x52f8aa[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x36')]));_0x2ebc27[_0xf31a('0x35')]=_0x2ebc27[_0xf31a('0x35')][_0xf31a('0x37')]?_0x2ebc27[_0xf31a('0x35')]:_0x52f8aa[_0xf31a('0x30')];if(!_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x38')](_0xf31a('0x39'))){_0x2ebc27[_0xf31a('0x1f')]=qs['limit'](_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x1f')]);_0x2ebc27[_0xf31a('0x1d')]=qs[_0xf31a('0x1d')](_0x5a55c6[_0xf31a('0x31')]['offset']);}_0x2ebc27[_0xf31a('0x3a')]=qs[_0xf31a('0x3b')](_0x5a55c6[_0xf31a('0x31')]['sort']);_0x2ebc27[_0xf31a('0x3c')]=qs[_0xf31a('0x33')](_[_0xf31a('0x3d')](_0x5a55c6[_0xf31a('0x31')],_0x52f8aa[_0xf31a('0x33')]),_0x203f28);if(_0x5a55c6['query'][_0xf31a('0x3e')]){_0x2ebc27['where']=_[_0xf31a('0x3f')](_0x2ebc27[_0xf31a('0x3c')],{'$or':_['map'](_0x203f28,function(_0x35d5b6){if(_0x35d5b6[_0xf31a('0x40')]!==_0xf31a('0x41')){var _0x481d92={};_0x481d92[_0x35d5b6[_0xf31a('0x29')]]={'$like':'%'+_0x5a55c6[_0xf31a('0x31')][_0xf31a('0x3e')]+'%'};return _0x481d92;}})});}_0x2ebc27=_[_0xf31a('0x3f')]({},_0x2ebc27,_0x5a55c6[_0xf31a('0x42')]);var _0x2a240d={'where':_0x2ebc27[_0xf31a('0x3c')]};return db[_0xf31a('0x43')][_0xf31a('0x20')](_0x2a240d)['then'](function(_0x3b4aef){_0x52da7d[_0xf31a('0x20')]=_0x3b4aef;if(_0x5a55c6['query'][_0xf31a('0x44')]){_0x2ebc27[_0xf31a('0x45')]=[{'all':!![]}];}return db[_0xf31a('0x43')][_0xf31a('0x46')](_0x2ebc27);})['then'](function(_0x21b871){_0x52da7d[_0xf31a('0x47')]=_0x21b871;return _0x52da7d;})[_0xf31a('0x26')](respondWithFilteredResult(_0xed9bfd,_0x2ebc27))[_0xf31a('0x48')](handleError(_0xed9bfd,null));};exports['show']=function(_0x234e1a,_0x58163c){var _0x303066={'raw':!![],'where':{'id':_0x234e1a[_0xf31a('0x49')]['id']}},_0x172e1c={};_0x172e1c['model']=_[_0xf31a('0x32')](db['Cdr'][_0xf31a('0x2d')]);_0x172e1c[_0xf31a('0x31')]=_[_0xf31a('0x32')](_0x234e1a[_0xf31a('0x31')]);_0x172e1c[_0xf31a('0x33')]=_[_0xf31a('0x34')](_0x172e1c[_0xf31a('0x30')],_0x172e1c[_0xf31a('0x31')]);_0x303066[_0xf31a('0x35')]=_['intersection'](_0x172e1c[_0xf31a('0x30')],qs[_0xf31a('0x36')](_0x234e1a[_0xf31a('0x31')][_0xf31a('0x36')]));_0x303066[_0xf31a('0x35')]=_0x303066[_0xf31a('0x35')][_0xf31a('0x37')]?_0x303066['attributes']:_0x172e1c['model'];if(_0x234e1a[_0xf31a('0x31')][_0xf31a('0x44')]){_0x303066[_0xf31a('0x45')]=[{'all':!![]}];}_0x303066=_[_0xf31a('0x3f')]({},_0x303066,_0x234e1a[_0xf31a('0x42')]);return db[_0xf31a('0x43')]['find'](_0x303066)[_0xf31a('0x26')](handleEntityNotFound(_0x58163c,null))[_0xf31a('0x26')](respondWithResult(_0x58163c,null))[_0xf31a('0x48')](handleError(_0x58163c,null));};exports[_0xf31a('0x4a')]=function(_0x45b8ed,_0x287bc1){return db['Cdr'][_0xf31a('0x4a')](_0x45b8ed[_0xf31a('0x4b')],{})[_0xf31a('0x26')](respondWithResult(_0x287bc1,0xc9))[_0xf31a('0x48')](handleError(_0x287bc1,null));};exports[_0xf31a('0x25')]=function(_0x111f08,_0x20bd0c){if(_0x111f08[_0xf31a('0x4b')]['id']){delete _0x111f08[_0xf31a('0x4b')]['id'];}return db[_0xf31a('0x43')]['find']({'where':{'id':_0x111f08[_0xf31a('0x49')]['id']}})['then'](handleEntityNotFound(_0x20bd0c,null))[_0xf31a('0x26')](saveUpdates(_0x111f08[_0xf31a('0x4b')],null))[_0xf31a('0x26')](respondWithResult(_0x20bd0c,null))[_0xf31a('0x48')](handleError(_0x20bd0c,null));};exports[_0xf31a('0x27')]=function(_0x3a1a26,_0x25ad3d){return db[_0xf31a('0x43')]['find']({'where':{'id':_0x3a1a26[_0xf31a('0x49')]['id']}})[_0xf31a('0x26')](handleEntityNotFound(_0x25ad3d,null))[_0xf31a('0x26')](removeEntity(_0x25ad3d,null))[_0xf31a('0x48')](handleError(_0x25ad3d,null));};exports[_0xf31a('0x4c')]=function(_0x8c6795,_0x4d21ed){return db[_0xf31a('0x43')][_0xf31a('0x4c')]()[_0xf31a('0x26')](respondWithResult(_0x4d21ed,null))[_0xf31a('0x48')](handleError(_0x4d21ed,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 4dd8c5d..c1d9165 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x37397b,_0x408952){var _0x3c1277=function(_0x13289d){while(--_0x13289d){_0x37397b['push'](_0x37397b['shift']());}};_0x3c1277(++_0x408952);}(_0x7a54,0x106));var _0x47a5=function(_0x2526c4,_0x875be6){_0x2526c4=_0x2526c4-0x0;var _0x1f4759=_0x7a54[_0x2526c4];return _0x1f4759;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2d67a0,_0x506875){var _0x2547cf=function(_0x51032a){while(--_0x51032a){_0x2d67a0['push'](_0x2d67a0['shift']());}};_0x2547cf(++_0x506875);}(_0x7a54,0x106));var _0x47a5=function(_0x427db1,_0x4d5b2e){_0x427db1=_0x427db1-0x0;var _0xd989ed=_0x7a54[_0x427db1];return _0xd989ed;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 62550ad..9192d05 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 _0x5c2a=['client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0x5c2a,0x159));var _0xa5c2=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0x5c2a[_0x57966a];return _0x191765;};'use strict';var _=require(_0xa5c2('0x0'));var util=require(_0xa5c2('0x1'));var moment=require(_0xa5c2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa5c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa5c2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5c2('0x5'));var jayson=require(_0xa5c2('0x6'));var client=jayson[_0xa5c2('0x7')][_0xa5c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5252d7,_0x56522c,_0x43efdc){return new BPromise(function(_0xc2e593,_0x28ee2c){return client[_0xa5c2('0x9')](_0x5252d7,_0x43efdc)[_0xa5c2('0xa')](function(_0x3a68a2){logger[_0xa5c2('0xb')](_0xa5c2('0xc'),_0x56522c,_0xa5c2('0xd'));logger[_0xa5c2('0xe')](_0xa5c2('0xf'),_0x56522c,_0xa5c2('0xd'),JSON[_0xa5c2('0x10')](_0x3a68a2));if(_0x3a68a2[_0xa5c2('0x11')]){if(_0x3a68a2['error'][_0xa5c2('0x12')]===0x1f4){logger['error'](_0xa5c2('0xc'),_0x56522c,_0x3a68a2[_0xa5c2('0x11')][_0xa5c2('0x13')]);return _0x28ee2c(_0x3a68a2[_0xa5c2('0x11')][_0xa5c2('0x13')]);}logger['error'](_0xa5c2('0xc'),_0x56522c,_0x3a68a2[_0xa5c2('0x11')]['message']);return _0xc2e593(_0x3a68a2[_0xa5c2('0x11')][_0xa5c2('0x13')]);}else{logger[_0xa5c2('0xb')](_0xa5c2('0xc'),_0x56522c,'request\x20sent');_0xc2e593(_0x3a68a2[_0xa5c2('0x14')][_0xa5c2('0x13')]);}})[_0xa5c2('0x15')](function(_0x5792b7){logger['error'](_0xa5c2('0xc'),_0x56522c,_0x5792b7);_0x28ee2c(_0x5792b7);});});}
\ No newline at end of file
+var _0xcfee=['../../config/environment','jayson/promise','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','code','error','message','Cdr,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x271a53,_0x3d0d32){var _0x4e7481=function(_0xf211cc){while(--_0xf211cc){_0x271a53['push'](_0x271a53['shift']());}};_0x4e7481(++_0x3d0d32);}(_0xcfee,0xe2));var _0xecfe=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xcfee[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xecfe('0x0'));var util=require(_0xecfe('0x1'));var moment=require(_0xecfe('0x2'));var BPromise=require(_0xecfe('0x3'));var rs=require(_0xecfe('0x4'));var fs=require('fs');var Redis=require(_0xecfe('0x5'));var db=require(_0xecfe('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecfe('0x7'));var config=require(_0xecfe('0x8'));var jayson=require(_0xecfe('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a53f0,_0x2bf709,_0x1c8b56){return new BPromise(function(_0x2bb29e,_0x1ec7b4){return client['request'](_0x4a53f0,_0x1c8b56)['then'](function(_0xc18e0c){logger[_0xecfe('0xa')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0xecfe('0xb'));logger['debug'](_0xecfe('0xc'),_0x2bf709,'request\x20sent',JSON['stringify'](_0xc18e0c));if(_0xc18e0c['error']){if(_0xc18e0c['error'][_0xecfe('0xd')]===0x1f4){logger[_0xecfe('0xe')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0xc18e0c[_0xecfe('0xe')][_0xecfe('0xf')]);return _0x1ec7b4(_0xc18e0c[_0xecfe('0xe')][_0xecfe('0xf')]);}logger[_0xecfe('0xe')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0xc18e0c[_0xecfe('0xe')]['message']);return _0x2bb29e(_0xc18e0c['error'][_0xecfe('0xf')]);}else{logger['info'](_0xecfe('0x10'),_0x2bf709,_0xecfe('0xb'));_0x2bb29e(_0xc18e0c['result']['message']);}})[_0xecfe('0x11')](function(_0x25deee){logger[_0xecfe('0xe')]('Cdr,\x20%s,\x20%s',_0x2bf709,_0x25deee);_0x1ec7b4(_0x25deee);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index cca6550..59e9d6c 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4da196,_0x357dc9){var _0x375df3=function(_0x366603){while(--_0x366603){_0x4da196['push'](_0x4da196['shift']());}};_0x375df3(++_0x357dc9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x139d3a,_0x23931e){var _0x345d6b=function(_0x3b1433){while(--_0x3b1433){_0x139d3a['push'](_0x139d3a['shift']());}};_0x345d6b(++_0x23931e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index e710d59..c495b0d 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 _0x42a3=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x247357,_0x13b9ce){var _0x50f127=function(_0x295423){while(--_0x295423){_0x247357['push'](_0x247357['shift']());}};_0x50f127(++_0x13b9ce);}(_0x42a3,0x133));var _0x342a=function(_0x285457,_0x4fb41a){_0x285457=_0x285457-0x0;var _0x129ed9=_0x42a3[_0x285457];return _0x129ed9;};'use strict';var Sequelize=require(_0x342a('0x0'));module[_0x342a('0x1')]={'priority':{'type':Sequelize[_0x342a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x342a('0x3')},'appdata':{'type':Sequelize[_0x342a('0x4')]()},'description':{'type':Sequelize[_0x342a('0x5')]},'interval':{'type':Sequelize[_0x342a('0x5')],'defaultValue':_0x342a('0x6')}};
\ No newline at end of file
+var _0x90d0=['STRING','noop'];(function(_0x52839f,_0x4ce68b){var _0x250558=function(_0x5f5625){while(--_0x5f5625){_0x52839f['push'](_0x52839f['shift']());}};_0x250558(++_0x4ce68b);}(_0x90d0,0x64));var _0x090d=function(_0x1a2455,_0xdaa32e){_0x1a2455=_0x1a2455-0x0;var _0xd2286c=_0x90d0[_0x1a2455];return _0xd2286c;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x090d('0x0')],'allowNull':![],'defaultValue':_0x090d('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x090d('0x0')]},'interval':{'type':Sequelize[_0x090d('0x0')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 1169c83..a5d52f4 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 _0xbf3f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','body','eml-format','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfbf3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfbf3('0x1'));var Mustache=require(_0xfbf3('0x2'));var util=require(_0xfbf3('0x3'));var path=require('path');var sox=require(_0xfbf3('0x4'));var csv=require(_0xfbf3('0x5'));var ejs=require(_0xfbf3('0x6'));var fs=require('fs');var fs_extra=require(_0xfbf3('0x7'));var _=require(_0xfbf3('0x8'));var squel=require(_0xfbf3('0x9'));var crypto=require(_0xfbf3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfbf3('0xb'));var toCsv=require(_0xfbf3('0x5'));var querystring=require(_0xfbf3('0xc'));var Papa=require(_0xfbf3('0xd'));var Redis=require(_0xfbf3('0xe'));var authService=require(_0xfbf3('0xf'));var qs=require(_0xfbf3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbf3('0x11'));var logger=require(_0xfbf3('0x12'))('api');var utils=require(_0xfbf3('0x13'));var config=require(_0xfbf3('0x14'));var licenseUtil=require(_0xfbf3('0x15'));var db=require(_0xfbf3('0x16'))['db'];function respondWithStatusCode(_0x4a9f3c,_0x4c3898){_0x4c3898=_0x4c3898||0xcc;return function(_0x258bc4){if(_0x258bc4){return _0x4a9f3c[_0xfbf3('0x17')](_0x4c3898);}return _0x4a9f3c[_0xfbf3('0x18')](_0x4c3898)[_0xfbf3('0x19')]();};}function respondWithResult(_0x260348,_0x2683a1){_0x2683a1=_0x2683a1||0xc8;return function(_0x46c54c){if(_0x46c54c){return _0x260348[_0xfbf3('0x18')](_0x2683a1)['json'](_0x46c54c);}};}function respondWithFilteredResult(_0x51b30b,_0x3a24a5){return function(_0x565361){if(_0x565361){var _0x3cb3de=typeof _0x3a24a5[_0xfbf3('0x1a')]==='undefined'&&typeof _0x3a24a5[_0xfbf3('0x1b')]===_0xfbf3('0x1c');var _0x2e139b=_0x565361['count'];var _0x543b69=_0x3cb3de?0x0:_0x3a24a5[_0xfbf3('0x1a')];var _0x51af71=_0x3cb3de?_0x565361[_0xfbf3('0x1d')]:_0x3a24a5[_0xfbf3('0x1a')]+_0x3a24a5[_0xfbf3('0x1b')];var _0x228dfd;if(_0x51af71>=_0x2e139b){_0x51af71=_0x2e139b;_0x228dfd=0xc8;}else{_0x228dfd=0xce;}_0x51b30b[_0xfbf3('0x18')](_0x228dfd);return _0x51b30b['set'](_0xfbf3('0x1e'),_0x543b69+'-'+_0x51af71+'/'+_0x2e139b)[_0xfbf3('0x1f')](_0x565361);}return null;};}function patchUpdates(_0x3daba0){return function(_0x3ac52c){try{jsonpatch[_0xfbf3('0x20')](_0x3ac52c,_0x3daba0,!![]);}catch(_0x589300){return BPromise['reject'](_0x589300);}return _0x3ac52c['save']();};}function saveUpdates(_0x328c6f,_0x3233f5){return function(_0x4eb4dc){if(_0x4eb4dc){return _0x4eb4dc[_0xfbf3('0x21')](_0x328c6f)[_0xfbf3('0x22')](function(_0x512cec){return _0x512cec;});}return null;};}function removeEntity(_0x5ee5f7,_0x4f8175){return function(_0x147306){if(_0x147306){return _0x147306[_0xfbf3('0x23')]()[_0xfbf3('0x22')](function(){_0x5ee5f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf72528,_0xc9240f){return function(_0x441a99){if(!_0x441a99){_0xf72528['sendStatus'](0x194);}return _0x441a99;};}function handleError(_0x52e145,_0x3bdafe){_0x3bdafe=_0x3bdafe||0x1f4;return function(_0x5d6a07){logger[_0xfbf3('0x24')](_0x5d6a07[_0xfbf3('0x25')]);if(_0x5d6a07[_0xfbf3('0x26')]){delete _0x5d6a07[_0xfbf3('0x26')];}_0x52e145['status'](_0x3bdafe)[_0xfbf3('0x27')](_0x5d6a07);};}exports[_0xfbf3('0x28')]=function(_0xfe5877,_0x2191b2){var _0x4dbb5b={'raw':!![],'where':{'id':_0xfe5877[_0xfbf3('0x29')]['id']}},_0x2315ba={};_0x2315ba[_0xfbf3('0x2a')]=_[_0xfbf3('0x2b')](db[_0xfbf3('0x2c')][_0xfbf3('0x2d')]);_0x2315ba[_0xfbf3('0x2e')]=_['keys'](_0xfe5877[_0xfbf3('0x2e')]);_0x2315ba[_0xfbf3('0x2f')]=_[_0xfbf3('0x30')](_0x2315ba[_0xfbf3('0x2a')],_0x2315ba['query']);_0x4dbb5b[_0xfbf3('0x31')]=_[_0xfbf3('0x30')](_0x2315ba[_0xfbf3('0x2a')],qs['fields'](_0xfe5877[_0xfbf3('0x2e')][_0xfbf3('0x32')]));_0x4dbb5b[_0xfbf3('0x31')]=_0x4dbb5b[_0xfbf3('0x31')][_0xfbf3('0x33')]?_0x4dbb5b[_0xfbf3('0x31')]:_0x2315ba[_0xfbf3('0x2a')];if(_0xfe5877['query'][_0xfbf3('0x34')]){_0x4dbb5b[_0xfbf3('0x35')]=[{'all':!![]}];}_0x4dbb5b=_['merge']({},_0x4dbb5b,_0xfe5877[_0xfbf3('0x36')]);return db['ChatApplication'][_0xfbf3('0x37')](_0x4dbb5b)[_0xfbf3('0x22')](handleEntityNotFound(_0x2191b2,null))[_0xfbf3('0x22')](respondWithResult(_0x2191b2,null))[_0xfbf3('0x38')](handleError(_0x2191b2,null));};exports[_0xfbf3('0x21')]=function(_0x1c2071,_0x239869){if(_0x1c2071[_0xfbf3('0x39')]['id']){delete _0x1c2071['body']['id'];}return db[_0xfbf3('0x2c')]['find']({'where':{'id':_0x1c2071[_0xfbf3('0x29')]['id']}})[_0xfbf3('0x22')](handleEntityNotFound(_0x239869,null))[_0xfbf3('0x22')](saveUpdates(_0x1c2071[_0xfbf3('0x39')],null))[_0xfbf3('0x22')](respondWithResult(_0x239869,null))['catch'](handleError(_0x239869,null));};exports[_0xfbf3('0x23')]=function(_0x5aea6e,_0x49b116){return db['ChatApplication'][_0xfbf3('0x37')]({'where':{'id':_0x5aea6e[_0xfbf3('0x29')]['id']}})[_0xfbf3('0x22')](handleEntityNotFound(_0x49b116,null))[_0xfbf3('0x22')](removeEntity(_0x49b116,null))[_0xfbf3('0x38')](handleError(_0x49b116,null));};
\ No newline at end of file
+var _0x280f=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','model','ChatApplication','rawAttributes','keys','query','filters','intersection','attributes','fields','length','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x138c15,_0x357fff){var _0x50a854=function(_0x38f423){while(--_0x38f423){_0x138c15['push'](_0x138c15['shift']());}};_0x50a854(++_0x357fff);}(_0x280f,0xe2));var _0xf280=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0x280f[_0x184759];return _0xf26d5f;};'use strict';var emlformat=require(_0xf280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf280('0x1'));var jsonpatch=require(_0xf280('0x2'));var rp=require(_0xf280('0x3'));var moment=require(_0xf280('0x4'));var BPromise=require(_0xf280('0x5'));var Mustache=require(_0xf280('0x6'));var util=require(_0xf280('0x7'));var path=require('path');var sox=require(_0xf280('0x8'));var csv=require(_0xf280('0x9'));var ejs=require(_0xf280('0xa'));var fs=require('fs');var fs_extra=require(_0xf280('0xb'));var _=require(_0xf280('0xc'));var squel=require('squel');var crypto=require(_0xf280('0xd'));var jsforce=require(_0xf280('0xe'));var deskjs=require(_0xf280('0xf'));var toCsv=require(_0xf280('0x9'));var querystring=require(_0xf280('0x10'));var Papa=require(_0xf280('0x11'));var Redis=require('ioredis');var authService=require(_0xf280('0x12'));var qs=require(_0xf280('0x13'));var as=require(_0xf280('0x14'));var hardwareService=require(_0xf280('0x15'));var logger=require(_0xf280('0x16'))(_0xf280('0x17'));var utils=require(_0xf280('0x18'));var config=require(_0xf280('0x19'));var licenseUtil=require(_0xf280('0x1a'));var db=require(_0xf280('0x1b'))['db'];function respondWithStatusCode(_0x148d24,_0x56221f){_0x56221f=_0x56221f||0xcc;return function(_0x566eb7){if(_0x566eb7){return _0x148d24[_0xf280('0x1c')](_0x56221f);}return _0x148d24[_0xf280('0x1d')](_0x56221f)[_0xf280('0x1e')]();};}function respondWithResult(_0x1d7175,_0x3e9acc){_0x3e9acc=_0x3e9acc||0xc8;return function(_0x59fb22){if(_0x59fb22){return _0x1d7175[_0xf280('0x1d')](_0x3e9acc)[_0xf280('0x1f')](_0x59fb22);}};}function respondWithFilteredResult(_0x34cadb,_0x224162){return function(_0x1e8f4d){if(_0x1e8f4d){var _0x462177=typeof _0x224162[_0xf280('0x20')]==='undefined'&&typeof _0x224162['limit']==='undefined';var _0x30a9a6=_0x1e8f4d['count'];var _0x11c2b0=_0x462177?0x0:_0x224162['offset'];var _0x2a19e7=_0x462177?_0x1e8f4d[_0xf280('0x21')]:_0x224162['offset']+_0x224162[_0xf280('0x22')];var _0x59b8af;if(_0x2a19e7>=_0x30a9a6){_0x2a19e7=_0x30a9a6;_0x59b8af=0xc8;}else{_0x59b8af=0xce;}_0x34cadb[_0xf280('0x1d')](_0x59b8af);return _0x34cadb[_0xf280('0x23')](_0xf280('0x24'),_0x11c2b0+'-'+_0x2a19e7+'/'+_0x30a9a6)[_0xf280('0x1f')](_0x1e8f4d);}return null;};}function patchUpdates(_0x11db7d){return function(_0x3a4eff){try{jsonpatch[_0xf280('0x25')](_0x3a4eff,_0x11db7d,!![]);}catch(_0x469bdf){return BPromise[_0xf280('0x26')](_0x469bdf);}return _0x3a4eff['save']();};}function saveUpdates(_0x1ad62a,_0x5a1aa1){return function(_0xfb624e){if(_0xfb624e){return _0xfb624e[_0xf280('0x27')](_0x1ad62a)[_0xf280('0x28')](function(_0x32039f){return _0x32039f;});}return null;};}function removeEntity(_0x3de08f,_0x42020c){return function(_0x4c3618){if(_0x4c3618){return _0x4c3618[_0xf280('0x29')]()[_0xf280('0x28')](function(){_0x3de08f[_0xf280('0x1d')](0xcc)[_0xf280('0x1e')]();});}};}function handleEntityNotFound(_0x35cd2d,_0x302132){return function(_0x4509c1){if(!_0x4509c1){_0x35cd2d[_0xf280('0x1c')](0x194);}return _0x4509c1;};}function handleError(_0x485788,_0x368b24){_0x368b24=_0x368b24||0x1f4;return function(_0x1b21fb){logger[_0xf280('0x2a')](_0x1b21fb[_0xf280('0x2b')]);if(_0x1b21fb['name']){delete _0x1b21fb['name'];}_0x485788['status'](_0x368b24)['send'](_0x1b21fb);};}exports['show']=function(_0x3da40e,_0x2409f4){var _0xa1fbb7={'raw':!![],'where':{'id':_0x3da40e['params']['id']}},_0x34edaf={};_0x34edaf[_0xf280('0x2c')]=_['keys'](db[_0xf280('0x2d')][_0xf280('0x2e')]);_0x34edaf['query']=_[_0xf280('0x2f')](_0x3da40e[_0xf280('0x30')]);_0x34edaf[_0xf280('0x31')]=_[_0xf280('0x32')](_0x34edaf['model'],_0x34edaf[_0xf280('0x30')]);_0xa1fbb7[_0xf280('0x33')]=_[_0xf280('0x32')](_0x34edaf[_0xf280('0x2c')],qs[_0xf280('0x34')](_0x3da40e[_0xf280('0x30')][_0xf280('0x34')]));_0xa1fbb7[_0xf280('0x33')]=_0xa1fbb7['attributes'][_0xf280('0x35')]?_0xa1fbb7[_0xf280('0x33')]:_0x34edaf[_0xf280('0x2c')];if(_0x3da40e[_0xf280('0x30')]['includeAll']){_0xa1fbb7['include']=[{'all':!![]}];}_0xa1fbb7=_[_0xf280('0x36')]({},_0xa1fbb7,_0x3da40e['options']);return db[_0xf280('0x2d')][_0xf280('0x37')](_0xa1fbb7)[_0xf280('0x28')](handleEntityNotFound(_0x2409f4,null))[_0xf280('0x28')](respondWithResult(_0x2409f4,null))[_0xf280('0x38')](handleError(_0x2409f4,null));};exports['update']=function(_0x56bb42,_0x5c34a3){if(_0x56bb42[_0xf280('0x39')]['id']){delete _0x56bb42['body']['id'];}return db[_0xf280('0x2d')][_0xf280('0x37')]({'where':{'id':_0x56bb42['params']['id']}})[_0xf280('0x28')](handleEntityNotFound(_0x5c34a3,null))[_0xf280('0x28')](saveUpdates(_0x56bb42[_0xf280('0x39')],null))[_0xf280('0x28')](respondWithResult(_0x5c34a3,null))[_0xf280('0x38')](handleError(_0x5c34a3,null));};exports[_0xf280('0x29')]=function(_0x286b48,_0x22b20a){return db[_0xf280('0x2d')][_0xf280('0x37')]({'where':{'id':_0x286b48['params']['id']}})[_0xf280('0x28')](handleEntityNotFound(_0x22b20a,null))[_0xf280('0x28')](removeEntity(_0x22b20a,null))[_0xf280('0x38')](handleError(_0x22b20a,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d233c63..02339ba 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 _0xece1=['define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x5eaaa6,_0x17fcbd){var _0x265df4=function(_0x374db6){while(--_0x374db6){_0x5eaaa6['push'](_0x5eaaa6['shift']());}};_0x265df4(++_0x17fcbd);}(_0xece1,0x8a));var _0x1ece=function(_0x389089,_0x2f0865){_0x389089=_0x389089-0x0;var _0x2bc120=_0xece1[_0x389089];return _0x2bc120;};'use strict';var _=require(_0x1ece('0x0'));var util=require(_0x1ece('0x1'));var logger=require(_0x1ece('0x2'))(_0x1ece('0x3'));var moment=require(_0x1ece('0x4'));var BPromise=require(_0x1ece('0x5'));var rp=require(_0x1ece('0x6'));var fs=require('fs');var path=require(_0x1ece('0x7'));var rimraf=require(_0x1ece('0x8'));var config=require(_0x1ece('0x9'));var attributes=require(_0x1ece('0xa'));module[_0x1ece('0xb')]=function(_0xfe0b6c,_0x5a65b6){return _0xfe0b6c[_0x1ece('0xc')](_0x1ece('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ece('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4a06=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x3bd84e,_0x1e4a81){var _0xbf14d1=function(_0x4bdfe4){while(--_0x4bdfe4){_0x3bd84e['push'](_0x3bd84e['shift']());}};_0xbf14d1(++_0x1e4a81);}(_0x4a06,0x1f2));var _0x64a0=function(_0x59b8c9,_0x53714b){_0x59b8c9=_0x59b8c9-0x0;var _0x58f507=_0x4a06[_0x59b8c9];return _0x58f507;};'use strict';var _=require(_0x64a0('0x0'));var util=require(_0x64a0('0x1'));var logger=require(_0x64a0('0x2'))(_0x64a0('0x3'));var moment=require(_0x64a0('0x4'));var BPromise=require(_0x64a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64a0('0x6'));var rimraf=require(_0x64a0('0x7'));var config=require(_0x64a0('0x8'));var attributes=require(_0x64a0('0x9'));module[_0x64a0('0xa')]=function(_0xba1d8f,_0x37464e){return _0xba1d8f[_0x64a0('0xb')](_0x64a0('0xc'),attributes,{'tableName':_0x64a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x64a0('0xe'),'collate':_0x64a0('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index d2b1eb7..a14f6db 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 _0x671f=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3f1a94,_0x414986){var _0x565cf2=function(_0x1a730d){while(--_0x1a730d){_0x3f1a94['push'](_0x3f1a94['shift']());}};_0x565cf2(++_0x414986);}(_0x671f,0x9d));var _0xf671=function(_0x76c29a,_0xc993c6){_0x76c29a=_0x76c29a-0x0;var _0x274783=_0x671f[_0x76c29a];return _0x274783;};'use strict';var _=require(_0xf671('0x0'));var util=require(_0xf671('0x1'));var moment=require(_0xf671('0x2'));var BPromise=require(_0xf671('0x3'));var rs=require(_0xf671('0x4'));var fs=require('fs');var Redis=require(_0xf671('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf671('0x6'));var logger=require(_0xf671('0x7'))('rpc');var config=require(_0xf671('0x8'));var jayson=require(_0xf671('0x9'));var client=jayson['client'][_0xf671('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40da19,_0x5e944,_0x5c44b6){return new BPromise(function(_0x5071a9,_0x1d11ed){return client[_0xf671('0xb')](_0x40da19,_0x5c44b6)[_0xf671('0xc')](function(_0x2ab582){logger[_0xf671('0xd')](_0xf671('0xe'),_0x5e944,_0xf671('0xf'));logger[_0xf671('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5e944,_0xf671('0xf'),JSON[_0xf671('0x11')](_0x2ab582));if(_0x2ab582['error']){if(_0x2ab582[_0xf671('0x12')][_0xf671('0x13')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5e944,_0x2ab582[_0xf671('0x12')][_0xf671('0x14')]);return _0x1d11ed(_0x2ab582[_0xf671('0x12')][_0xf671('0x14')]);}logger[_0xf671('0x12')](_0xf671('0xe'),_0x5e944,_0x2ab582['error'][_0xf671('0x14')]);return _0x5071a9(_0x2ab582[_0xf671('0x12')]['message']);}else{logger[_0xf671('0xd')](_0xf671('0xe'),_0x5e944,'request\x20sent');_0x5071a9(_0x2ab582[_0xf671('0x15')][_0xf671('0x14')]);}})[_0xf671('0x16')](function(_0x398f26){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5e944,_0x398f26);_0x1d11ed(_0x398f26);});});}
\ No newline at end of file
+var _0x7da0=['result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x2e22c7,_0x1abc9c){var _0x4cf08b=function(_0x3ba681){while(--_0x3ba681){_0x2e22c7['push'](_0x2e22c7['shift']());}};_0x4cf08b(++_0x1abc9c);}(_0x7da0,0xd3));var _0x07da=function(_0x1537bb,_0x4e525d){_0x1537bb=_0x1537bb-0x0;var _0x14e28e=_0x7da0[_0x1537bb];return _0x14e28e;};'use strict';var _=require('lodash');var util=require(_0x07da('0x0'));var moment=require(_0x07da('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07da('0x2'));var db=require(_0x07da('0x3'))['db'];var utils=require(_0x07da('0x4'));var logger=require('../../config/logger')(_0x07da('0x5'));var config=require(_0x07da('0x6'));var jayson=require(_0x07da('0x7'));var client=jayson[_0x07da('0x8')][_0x07da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x557e26,_0x242904,_0x309d8c){return new BPromise(function(_0x1cef2f,_0x238f40){return client['request'](_0x557e26,_0x309d8c)['then'](function(_0xcaf580){logger[_0x07da('0xa')](_0x07da('0xb'),_0x242904,_0x07da('0xc'));logger[_0x07da('0xd')](_0x07da('0xe'),_0x242904,_0x07da('0xc'),JSON['stringify'](_0xcaf580));if(_0xcaf580[_0x07da('0xf')]){if(_0xcaf580[_0x07da('0xf')]['code']===0x1f4){logger[_0x07da('0xf')](_0x07da('0xb'),_0x242904,_0xcaf580['error']['message']);return _0x238f40(_0xcaf580[_0x07da('0xf')]['message']);}logger[_0x07da('0xf')](_0x07da('0xb'),_0x242904,_0xcaf580[_0x07da('0xf')][_0x07da('0x10')]);return _0x1cef2f(_0xcaf580[_0x07da('0xf')][_0x07da('0x10')]);}else{logger[_0x07da('0xa')](_0x07da('0xb'),_0x242904,_0x07da('0xc'));_0x1cef2f(_0xcaf580[_0x07da('0x11')][_0x07da('0x10')]);}})[_0x07da('0x12')](function(_0x47db72){logger[_0x07da('0xf')](_0x07da('0xb'),_0x242904,_0x47db72);_0x238f40(_0x47db72);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index f6a2a3e..d797643 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 _0x75a6=['isAuthenticated','show','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x75a6,0x1a8));var _0x675a=function(_0x3de426,_0xf9d115){_0x3de426=_0x3de426-0x0;var _0x5b6286=_0x75a6[_0x3de426];return _0x5b6286;};'use strict';var multer=require(_0x675a('0x0'));var util=require(_0x675a('0x1'));var path=require(_0x675a('0x2'));var timeout=require(_0x675a('0x3'));var express=require(_0x675a('0x4'));var router=express[_0x675a('0x5')]();var fs_extra=require(_0x675a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x675a('0x7'));var config=require(_0x675a('0x8'));var controller=require(_0x675a('0x9'));router['get'](_0x675a('0xa'),auth[_0x675a('0xb')](),controller[_0x675a('0xc')]);router['put'](_0x675a('0xa'),auth[_0x675a('0xb')](),controller['update']);router[_0x675a('0xd')]('/:id',auth[_0x675a('0xb')](),controller[_0x675a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x7c4b=['/:id','isAuthenticated','show','put','update','delete','destroy','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x18a282,_0x593f1f){var _0x22a9a4=function(_0x1b55bc){while(--_0x1b55bc){_0x18a282['push'](_0x18a282['shift']());}};_0x22a9a4(++_0x593f1f);}(_0x7c4b,0x149));var _0xb7c4=function(_0x239136,_0x2ac7a1){_0x239136=_0x239136-0x0;var _0x3b7f45=_0x7c4b[_0x239136];return _0x3b7f45;};'use strict';var multer=require(_0xb7c4('0x0'));var util=require('util');var path=require(_0xb7c4('0x1'));var timeout=require(_0xb7c4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb7c4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb7c4('0x4'));var config=require(_0xb7c4('0x5'));var controller=require(_0xb7c4('0x6'));router['get'](_0xb7c4('0x7'),auth[_0xb7c4('0x8')](),controller[_0xb7c4('0x9')]);router[_0xb7c4('0xa')]('/:id',auth[_0xb7c4('0x8')](),controller[_0xb7c4('0xb')]);router[_0xb7c4('0xc')](_0xb7c4('0x7'),auth[_0xb7c4('0x8')](),controller[_0xb7c4('0xd')]);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 e1f5f23..5ba1f21 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 _0xef2a=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4b5815,_0x44fb95){var _0x58634a=function(_0x5565ce){while(--_0x5565ce){_0x4b5815['push'](_0x4b5815['shift']());}};_0x58634a(++_0x44fb95);}(_0xef2a,0x1a0));var _0xaef2=function(_0x4539ac,_0x472c08){_0x4539ac=_0x4539ac-0x0;var _0x547d11=_0xef2a[_0x4539ac];return _0x547d11;};'use strict';var Sequelize=require(_0xaef2('0x0'));module[_0xaef2('0x1')]={'name':{'type':Sequelize[_0xaef2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xaef2('0x2')]},'write':{'type':Sequelize[_0xaef2('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2bb6=['STRING','BOOLEAN'];(function(_0x179d19,_0x3f63fc){var _0x1ca47f=function(_0x42ef71){while(--_0x42ef71){_0x179d19['push'](_0x179d19['shift']());}};_0x1ca47f(++_0x3f63fc);}(_0x2bb6,0x146));var _0x62bb=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0x2bb6[_0x354164];return _0x5db9a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x62bb('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x62bb('0x1')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 62e60e8..7949474 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 _0x0ffc=['removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','show','params','options','find','catch','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User'];(function(_0x8904d4,_0x4caecf){var _0x1f90a4=function(_0x4fae06){while(--_0x4fae06){_0x8904d4['push'](_0x8904d4['shift']());}};_0x1f90a4(++_0x4caecf);}(_0x0ffc,0x198));var _0xc0ff=function(_0x35293e,_0x4197ed){_0x35293e=_0x35293e-0x0;var _0x5709b3=_0x0ffc[_0x35293e];return _0x5709b3;};'use strict';var emlformat=require(_0xc0ff('0x0'));var rimraf=require(_0xc0ff('0x1'));var zipdir=require(_0xc0ff('0x2'));var jsonpatch=require(_0xc0ff('0x3'));var rp=require(_0xc0ff('0x4'));var moment=require('moment');var BPromise=require(_0xc0ff('0x5'));var Mustache=require(_0xc0ff('0x6'));var util=require(_0xc0ff('0x7'));var path=require('path');var sox=require(_0xc0ff('0x8'));var csv=require(_0xc0ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0ff('0xa'));var _=require('lodash');var squel=require(_0xc0ff('0xb'));var crypto=require(_0xc0ff('0xc'));var jsforce=require(_0xc0ff('0xd'));var deskjs=require(_0xc0ff('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc0ff('0xf'));var Papa=require(_0xc0ff('0x10'));var Redis=require('ioredis');var authService=require(_0xc0ff('0x11'));var qs=require(_0xc0ff('0x12'));var as=require(_0xc0ff('0x13'));var hardwareService=require(_0xc0ff('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc0ff('0x15'));var config=require(_0xc0ff('0x16'));var licenseUtil=require(_0xc0ff('0x17'));var db=require(_0xc0ff('0x18'))['db'];config[_0xc0ff('0x19')]=_[_0xc0ff('0x1a')](config[_0xc0ff('0x19')],{'host':_0xc0ff('0x1b'),'port':0x18eb});var socket=require(_0xc0ff('0x1c'))(new Redis(config[_0xc0ff('0x19')]));require('./chatGroup.socket')[_0xc0ff('0x1d')](socket);function respondWithStatusCode(_0x2d373a,_0x58bca5){_0x58bca5=_0x58bca5||0xcc;return function(_0x12923c){if(_0x12923c){return _0x2d373a[_0xc0ff('0x1e')](_0x58bca5);}return _0x2d373a['status'](_0x58bca5)[_0xc0ff('0x1f')]();};}function respondWithResult(_0x2fd48f,_0x50e263){_0x50e263=_0x50e263||0xc8;return function(_0x1f5b8f){if(_0x1f5b8f){return _0x2fd48f[_0xc0ff('0x20')](_0x50e263)[_0xc0ff('0x21')](_0x1f5b8f);}};}function respondWithFilteredResult(_0x34d500,_0x116394){return function(_0x170d4f){if(_0x170d4f){var _0x2b4457=typeof _0x116394[_0xc0ff('0x22')]===_0xc0ff('0x23')&&typeof _0x116394[_0xc0ff('0x24')]===_0xc0ff('0x23');var _0x8bf309=_0x170d4f[_0xc0ff('0x25')];var _0x385793=_0x2b4457?0x0:_0x116394['offset'];var _0x30a54d=_0x2b4457?_0x170d4f[_0xc0ff('0x25')]:_0x116394['offset']+_0x116394[_0xc0ff('0x24')];var _0x1e3188;if(_0x30a54d>=_0x8bf309){_0x30a54d=_0x8bf309;_0x1e3188=0xc8;}else{_0x1e3188=0xce;}_0x34d500[_0xc0ff('0x20')](_0x1e3188);return _0x34d500[_0xc0ff('0x26')](_0xc0ff('0x27'),_0x385793+'-'+_0x30a54d+'/'+_0x8bf309)[_0xc0ff('0x21')](_0x170d4f);}return null;};}function patchUpdates(_0x51a79c){return function(_0x5ca030){try{jsonpatch[_0xc0ff('0x28')](_0x5ca030,_0x51a79c,!![]);}catch(_0x4d7668){return BPromise[_0xc0ff('0x29')](_0x4d7668);}return _0x5ca030[_0xc0ff('0x2a')]();};}function saveUpdates(_0x44f00b,_0x5b9229){return function(_0x4bdbf8){if(_0x4bdbf8){return _0x4bdbf8[_0xc0ff('0x2b')](_0x44f00b)[_0xc0ff('0x2c')](function(_0x237063){return _0x237063;});}return null;};}function removeEntity(_0x2dbc86,_0x5f775){return function(_0x54ceab){if(_0x54ceab){return _0x54ceab[_0xc0ff('0x2d')]()[_0xc0ff('0x2c')](function(){_0x2dbc86[_0xc0ff('0x20')](0xcc)[_0xc0ff('0x1f')]();});}};}function handleEntityNotFound(_0x4e741b,_0x45f099){return function(_0x1c1e96){if(!_0x1c1e96){_0x4e741b[_0xc0ff('0x1e')](0x194);}return _0x1c1e96;};}function handleError(_0x126a0a,_0x41f3c3){_0x41f3c3=_0x41f3c3||0x1f4;return function(_0x32f2c5){logger[_0xc0ff('0x2e')](_0x32f2c5[_0xc0ff('0x2f')]);if(_0x32f2c5['name']){delete _0x32f2c5[_0xc0ff('0x30')];}_0x126a0a[_0xc0ff('0x20')](_0x41f3c3)[_0xc0ff('0x31')](_0x32f2c5);};}exports['index']=function(_0x32b259,_0x1cefbd){var _0x3b50f9={},_0x6e283b={},_0x2c6d66={'count':0x0,'rows':[]};var _0x5a265f=_[_0xc0ff('0x32')](db[_0xc0ff('0x33')][_0xc0ff('0x34')],function(_0x396b94){return{'name':_0x396b94[_0xc0ff('0x35')],'type':_0x396b94[_0xc0ff('0x36')][_0xc0ff('0x37')]};});_0x6e283b[_0xc0ff('0x38')]=_[_0xc0ff('0x32')](_0x5a265f,_0xc0ff('0x30'));_0x6e283b[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0x32b259[_0xc0ff('0x39')]);_0x6e283b[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0x6e283b['model'],_0x6e283b[_0xc0ff('0x39')]);_0x3b50f9[_0xc0ff('0x3d')]=_[_0xc0ff('0x3c')](_0x6e283b[_0xc0ff('0x38')],qs['fields'](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x3e')]));_0x3b50f9[_0xc0ff('0x3d')]=_0x3b50f9[_0xc0ff('0x3d')][_0xc0ff('0x3f')]?_0x3b50f9[_0xc0ff('0x3d')]:_0x6e283b['model'];if(!_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x40')](_0xc0ff('0x41'))){_0x3b50f9[_0xc0ff('0x24')]=qs['limit'](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x24')]);_0x3b50f9[_0xc0ff('0x22')]=qs[_0xc0ff('0x22')](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x22')]);}_0x3b50f9[_0xc0ff('0x42')]=qs[_0xc0ff('0x43')](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x43')]);_0x3b50f9[_0xc0ff('0x44')]=qs[_0xc0ff('0x3b')](_[_0xc0ff('0x45')](_0x32b259[_0xc0ff('0x39')],_0x6e283b[_0xc0ff('0x3b')]),_0x5a265f);if(_0x32b259[_0xc0ff('0x39')]['filter']){_0x3b50f9[_0xc0ff('0x44')]=_[_0xc0ff('0x46')](_0x3b50f9[_0xc0ff('0x44')],{'$or':_[_0xc0ff('0x32')](_0x5a265f,function(_0x12762f){if(_0x12762f[_0xc0ff('0x36')]!==_0xc0ff('0x47')){var _0x449588={};_0x449588[_0x12762f[_0xc0ff('0x30')]]={'$like':'%'+_0x32b259['query'][_0xc0ff('0x48')]+'%'};return _0x449588;}})});}_0x3b50f9=_['merge']({},_0x3b50f9,_0x32b259['options']);var _0x5904c6={'where':_0x3b50f9[_0xc0ff('0x44')]};return db['ChatGroup'][_0xc0ff('0x25')](_0x5904c6)['then'](function(_0x512bba){_0x2c6d66[_0xc0ff('0x25')]=_0x512bba;if(_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x49')]){_0x3b50f9[_0xc0ff('0x4a')]=[{'all':!![]}];}return db[_0xc0ff('0x33')]['findAll'](_0x3b50f9);})[_0xc0ff('0x2c')](function(_0x346fd3){_0x2c6d66['rows']=_0x346fd3;return _0x2c6d66;})[_0xc0ff('0x2c')](respondWithFilteredResult(_0x1cefbd,_0x3b50f9))['catch'](handleError(_0x1cefbd,null));};exports[_0xc0ff('0x4b')]=function(_0xc4e082,_0x38e059){var _0xc08011={'raw':!![],'where':{'id':_0xc4e082[_0xc0ff('0x4c')]['id']}},_0xae3478={};_0xae3478['model']=_[_0xc0ff('0x3a')](db[_0xc0ff('0x33')][_0xc0ff('0x34')]);_0xae3478[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0xc4e082['query']);_0xae3478[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0xae3478[_0xc0ff('0x38')],_0xae3478[_0xc0ff('0x39')]);_0xc08011[_0xc0ff('0x3d')]=_['intersection'](_0xae3478[_0xc0ff('0x38')],qs[_0xc0ff('0x3e')](_0xc4e082['query'][_0xc0ff('0x3e')]));_0xc08011['attributes']=_0xc08011['attributes'][_0xc0ff('0x3f')]?_0xc08011[_0xc0ff('0x3d')]:_0xae3478[_0xc0ff('0x38')];if(_0xc4e082[_0xc0ff('0x39')][_0xc0ff('0x49')]){_0xc08011[_0xc0ff('0x4a')]=[{'all':!![]}];}_0xc08011=_[_0xc0ff('0x46')]({},_0xc08011,_0xc4e082[_0xc0ff('0x4d')]);return db['ChatGroup'][_0xc0ff('0x4e')](_0xc08011)[_0xc0ff('0x2c')](handleEntityNotFound(_0x38e059,null))[_0xc0ff('0x2c')](respondWithResult(_0x38e059,null))[_0xc0ff('0x4f')](handleError(_0x38e059,null));};exports[_0xc0ff('0x50')]=function(_0x4521ce,_0x353d70){return db[_0xc0ff('0x33')]['create'](_0x4521ce[_0xc0ff('0x51')],{})[_0xc0ff('0x2c')](respondWithResult(_0x353d70,0xc9))[_0xc0ff('0x4f')](handleError(_0x353d70,null));};exports[_0xc0ff('0x2b')]=function(_0x5c319a,_0x13edda){if(_0x5c319a[_0xc0ff('0x51')]['id']){delete _0x5c319a[_0xc0ff('0x51')]['id'];}return db[_0xc0ff('0x33')][_0xc0ff('0x4e')]({'where':{'id':_0x5c319a['params']['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x13edda,null))[_0xc0ff('0x2c')](saveUpdates(_0x5c319a[_0xc0ff('0x51')],null))[_0xc0ff('0x2c')](respondWithResult(_0x13edda,null))[_0xc0ff('0x4f')](handleError(_0x13edda,null));};exports[_0xc0ff('0x2d')]=function(_0x27107b,_0x2c9586){return db[_0xc0ff('0x33')]['find']({'where':{'id':_0x27107b[_0xc0ff('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c9586,null))[_0xc0ff('0x2c')](removeEntity(_0x2c9586,null))[_0xc0ff('0x4f')](handleError(_0x2c9586,null));};exports[_0xc0ff('0x52')]=function(_0x11aa14,_0x5ef485){return db['ChatGroup'][_0xc0ff('0x52')]()['then'](respondWithResult(_0x5ef485,null))[_0xc0ff('0x4f')](handleError(_0x5ef485,null));};exports['getUnread']=function(_0x3253bd,_0x1f6599,_0x3f3acf){return db[_0xc0ff('0x53')][_0xc0ff('0x25')]({'where':{'ChatGroupId':_0x3253bd[_0xc0ff('0x4c')]['id'],'ToId':_0x3253bd[_0xc0ff('0x54')]['id'],'read':![]}})[_0xc0ff('0x2c')](function(_0x594a93){return{'id':_[_0xc0ff('0x55')](_0x3253bd[_0xc0ff('0x4c')]['id']),'count':_0x594a93};})[_0xc0ff('0x2c')](respondWithResult(_0x1f6599,null))['catch'](handleError(_0x1f6599,null));};exports[_0xc0ff('0x56')]=function(_0x583b5f,_0x538628,_0x494f96){return db[_0xc0ff('0x33')][_0xc0ff('0x4e')]({'where':{'id':_0x583b5f[_0xc0ff('0x4c')]['id']}})['then'](handleEntityNotFound(_0x538628,null))['then'](function(_0xef5dd3){if(_0xef5dd3){return _0xef5dd3[_0xc0ff('0x56')](_0x583b5f[_0xc0ff('0x51')][_0xc0ff('0x57')],_[_0xc0ff('0x58')](_0x583b5f[_0xc0ff('0x51')],[_0xc0ff('0x57'),'id'])||{});}})[_0xc0ff('0x2c')](respondWithResult(_0x538628,null))[_0xc0ff('0x4f')](handleError(_0x538628,null));};exports[_0xc0ff('0x59')]=function(_0x13768f,_0x189f25,_0x5a396e){var _0x4fb8eb={};var _0x49fbe2={};var _0x5add53;var _0x6825bd;return db[_0xc0ff('0x33')][_0xc0ff('0x5a')]({'where':{'id':_0x13768f['params']['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x189f25,null))['then'](function(_0x3a5e83){if(_0x3a5e83){_0x5add53=_0x3a5e83;_0x49fbe2[_0xc0ff('0x38')]=_['keys'](db[_0xc0ff('0x5b')][_0xc0ff('0x34')]);_0x49fbe2[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0x13768f[_0xc0ff('0x39')]);_0x49fbe2[_0xc0ff('0x3b')]=_['intersection'](_0x49fbe2[_0xc0ff('0x38')],_0x49fbe2[_0xc0ff('0x39')]);_0x4fb8eb[_0xc0ff('0x3d')]=_['intersection'](_0x49fbe2['model'],qs['fields'](_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x3e')]));_0x4fb8eb['attributes']=_0x4fb8eb['attributes'][_0xc0ff('0x3f')]?_0x4fb8eb[_0xc0ff('0x3d')]:_0x49fbe2[_0xc0ff('0x38')];_0x4fb8eb['order']=qs[_0xc0ff('0x43')](_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x43')]);_0x4fb8eb[_0xc0ff('0x44')]=qs[_0xc0ff('0x3b')](_[_0xc0ff('0x45')](_0x13768f[_0xc0ff('0x39')],_0x49fbe2[_0xc0ff('0x3b')]));if(_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x48')]){_0x4fb8eb[_0xc0ff('0x44')]=_[_0xc0ff('0x46')](_0x4fb8eb[_0xc0ff('0x44')],{'$or':_['map'](_0x4fb8eb['attributes'],function(_0x46b339){var _0xd59441={};_0xd59441[_0x46b339]={'$like':'%'+_0x13768f['query'][_0xc0ff('0x48')]+'%'};return _0xd59441;})});}_0x4fb8eb=_[_0xc0ff('0x46')]({},_0x4fb8eb,_0x13768f[_0xc0ff('0x4d')]);return _0x5add53[_0xc0ff('0x59')](_0x4fb8eb);}})[_0xc0ff('0x2c')](function(_0x3b1c96){if(_0x3b1c96){_0x6825bd=_0x3b1c96[_0xc0ff('0x3f')];if(!_0x13768f[_0xc0ff('0x39')]['hasOwnProperty'](_0xc0ff('0x41'))){_0x4fb8eb[_0xc0ff('0x24')]=qs[_0xc0ff('0x24')](_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x24')]);_0x4fb8eb[_0xc0ff('0x22')]=qs[_0xc0ff('0x22')](_0x13768f['query'][_0xc0ff('0x22')]);}return _0x5add53[_0xc0ff('0x59')](_0x4fb8eb);}})['then'](function(_0x314d55){if(_0x314d55){return _0x314d55?{'count':_0x6825bd,'rows':_0x314d55}:null;}})[_0xc0ff('0x2c')](respondWithResult(_0x189f25,null))[_0xc0ff('0x4f')](handleError(_0x189f25,null));};exports[_0xc0ff('0x5c')]=function(_0x1f2a7b,_0x45e448,_0x1b8378){return db['ChatGroup'][_0xc0ff('0x4e')]({'where':{'id':_0x1f2a7b[_0xc0ff('0x4c')]['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x45e448,null))[_0xc0ff('0x2c')](function(_0x46ce38){if(_0x46ce38){return _0x46ce38[_0xc0ff('0x5c')](_0x1f2a7b[_0xc0ff('0x39')][_0xc0ff('0x57')]);}})[_0xc0ff('0x2c')](respondWithStatusCode(_0x45e448,null))[_0xc0ff('0x4f')](handleError(_0x45e448,null));};exports[_0xc0ff('0x5d')]=function(_0x1a6c9,_0x47ee79,_0x486afa){if(_0x1a6c9['body']['id']){delete _0x1a6c9[_0xc0ff('0x51')]['id'];}return db[_0xc0ff('0x33')][_0xc0ff('0x4e')]({'where':{'id':_0x1a6c9[_0xc0ff('0x4c')]['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x47ee79,null))[_0xc0ff('0x2c')](function(_0x2f4ff0){if(_0x2f4ff0){_0x1a6c9[_0xc0ff('0x51')][_0xc0ff('0x5e')]=_0x2f4ff0['id'];return db[_0xc0ff('0x53')][_0xc0ff('0x50')](_0x1a6c9[_0xc0ff('0x51')]);}})[_0xc0ff('0x2c')](respondWithResult(_0x47ee79,null))[_0xc0ff('0x4f')](handleError(_0x47ee79,null));};exports[_0xc0ff('0x5f')]=function(_0xec8b51,_0x85a3fd,_0x1035ab){var _0x4501ce={};var _0x5ecaa7={};var _0x3c9e42;var _0x20606a;return db[_0xc0ff('0x33')]['findOne']({'where':{'id':_0xec8b51[_0xc0ff('0x4c')]['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x85a3fd,null))[_0xc0ff('0x2c')](function(_0x328298){if(_0x328298){_0x3c9e42=_0x328298;_0x5ecaa7[_0xc0ff('0x38')]=_['keys'](db[_0xc0ff('0x53')][_0xc0ff('0x34')]);_0x5ecaa7[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0xec8b51[_0xc0ff('0x39')]);_0x5ecaa7[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0x5ecaa7[_0xc0ff('0x38')],_0x5ecaa7[_0xc0ff('0x39')]);_0x4501ce['attributes']=_[_0xc0ff('0x3c')](_0x5ecaa7[_0xc0ff('0x38')],qs['fields'](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x3e')]));_0x4501ce[_0xc0ff('0x3d')]=_0x4501ce[_0xc0ff('0x3d')][_0xc0ff('0x3f')]?_0x4501ce[_0xc0ff('0x3d')]:_0x5ecaa7['model'];_0x4501ce[_0xc0ff('0x42')]=qs[_0xc0ff('0x43')](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x43')]);_0x4501ce['where']=qs[_0xc0ff('0x3b')](_[_0xc0ff('0x45')](_0xec8b51[_0xc0ff('0x39')],_0x5ecaa7[_0xc0ff('0x3b')]));if(_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x48')]){_0x4501ce[_0xc0ff('0x44')]=_[_0xc0ff('0x46')](_0x4501ce[_0xc0ff('0x44')],{'$or':_[_0xc0ff('0x32')](_0x4501ce['attributes'],function(_0xcb2e22){var _0x4dc473={};_0x4dc473[_0xcb2e22]={'$like':'%'+_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x48')]+'%'};return _0x4dc473;})});}if(_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x60')]){var _0x376c61=_0xec8b51['query'][_0xc0ff('0x60')][_0xc0ff('0x61')](',');var _0x19688c={};_0x19688c[_0x376c61[0x0]]={'$gte':moment(_0x376c61[0x1])[_0xc0ff('0x62')](_0xc0ff('0x63'))};_0x4501ce['where']=_[_0xc0ff('0x46')](_0x4501ce[_0xc0ff('0x44')],_0x19688c);}_0x4501ce=_[_0xc0ff('0x46')]({},_0x4501ce,_0xec8b51['options']);return _0x3c9e42[_0xc0ff('0x5f')](_0x4501ce);}})[_0xc0ff('0x2c')](function(_0x4b87fa){if(_0x4b87fa){_0x20606a=_0x4b87fa[_0xc0ff('0x3f')];if(!_0xec8b51['query'][_0xc0ff('0x40')]('nolimit')){_0x4501ce['limit']=qs[_0xc0ff('0x24')](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x24')]);_0x4501ce[_0xc0ff('0x22')]=qs['offset'](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x22')]);}return _0x3c9e42[_0xc0ff('0x5f')](_0x4501ce);}})[_0xc0ff('0x2c')](function(_0x555218){if(_0x555218){return _0x555218?{'count':_0x20606a,'rows':_0x555218}:null;}})['then'](respondWithResult(_0x85a3fd,null))['catch'](handleError(_0x85a3fd,null));};
\ No newline at end of file
+var _0xce15=['getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','pick','length','removeMembers','addMessage','ChatGroupId'];(function(_0x351b27,_0x2763b5){var _0x50457b=function(_0x10bab4){while(--_0x10bab4){_0x351b27['push'](_0x351b27['shift']());}};_0x50457b(++_0x2763b5);}(_0xce15,0x1d6));var _0x5ce1=function(_0x234459,_0x8da0cc){_0x234459=_0x234459-0x0;var _0x2a73fb=_0xce15[_0x234459];return _0x2a73fb;};'use strict';var emlformat=require(_0x5ce1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ce1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ce1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5ce1('0x3'));var util=require(_0x5ce1('0x4'));var path=require(_0x5ce1('0x5'));var sox=require('sox');var csv=require(_0x5ce1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ce1('0x7'));var _=require(_0x5ce1('0x8'));var squel=require(_0x5ce1('0x9'));var crypto=require('crypto');var jsforce=require(_0x5ce1('0xa'));var deskjs=require(_0x5ce1('0xb'));var toCsv=require(_0x5ce1('0x6'));var querystring=require(_0x5ce1('0xc'));var Papa=require('papaparse');var Redis=require(_0x5ce1('0xd'));var authService=require(_0x5ce1('0xe'));var qs=require(_0x5ce1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ce1('0x10'))(_0x5ce1('0x11'));var utils=require(_0x5ce1('0x12'));var config=require(_0x5ce1('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ce1('0x14'))['db'];config[_0x5ce1('0x15')]=_[_0x5ce1('0x16')](config[_0x5ce1('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ce1('0x17'))(new Redis(config[_0x5ce1('0x15')]));require(_0x5ce1('0x18'))[_0x5ce1('0x19')](socket);function respondWithStatusCode(_0x3308be,_0x1fd94b){_0x1fd94b=_0x1fd94b||0xcc;return function(_0x2cf62a){if(_0x2cf62a){return _0x3308be[_0x5ce1('0x1a')](_0x1fd94b);}return _0x3308be[_0x5ce1('0x1b')](_0x1fd94b)['end']();};}function respondWithResult(_0x398554,_0x337358){_0x337358=_0x337358||0xc8;return function(_0x1e1398){if(_0x1e1398){return _0x398554[_0x5ce1('0x1b')](_0x337358)[_0x5ce1('0x1c')](_0x1e1398);}};}function respondWithFilteredResult(_0x2a7b3c,_0x56cc1d){return function(_0xd41287){if(_0xd41287){var _0x1fd248=typeof _0x56cc1d[_0x5ce1('0x1d')]===_0x5ce1('0x1e')&&typeof _0x56cc1d[_0x5ce1('0x1f')]===_0x5ce1('0x1e');var _0x1488d1=_0xd41287[_0x5ce1('0x20')];var _0x251881=_0x1fd248?0x0:_0x56cc1d[_0x5ce1('0x1d')];var _0x5d2d41=_0x1fd248?_0xd41287[_0x5ce1('0x20')]:_0x56cc1d[_0x5ce1('0x1d')]+_0x56cc1d['limit'];var _0xdd7dd4;if(_0x5d2d41>=_0x1488d1){_0x5d2d41=_0x1488d1;_0xdd7dd4=0xc8;}else{_0xdd7dd4=0xce;}_0x2a7b3c[_0x5ce1('0x1b')](_0xdd7dd4);return _0x2a7b3c[_0x5ce1('0x21')](_0x5ce1('0x22'),_0x251881+'-'+_0x5d2d41+'/'+_0x1488d1)[_0x5ce1('0x1c')](_0xd41287);}return null;};}function patchUpdates(_0x5d066d){return function(_0x17c86b){try{jsonpatch[_0x5ce1('0x23')](_0x17c86b,_0x5d066d,!![]);}catch(_0x3ef028){return BPromise[_0x5ce1('0x24')](_0x3ef028);}return _0x17c86b[_0x5ce1('0x25')]();};}function saveUpdates(_0x202ffe,_0x10e462){return function(_0xdd5bf2){if(_0xdd5bf2){return _0xdd5bf2['update'](_0x202ffe)[_0x5ce1('0x26')](function(_0x1389bb){return _0x1389bb;});}return null;};}function removeEntity(_0x571b1e,_0x5257c1){return function(_0xfac949){if(_0xfac949){return _0xfac949[_0x5ce1('0x27')]()['then'](function(){_0x571b1e[_0x5ce1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cb162,_0x186282){return function(_0x1bed46){if(!_0x1bed46){_0x4cb162[_0x5ce1('0x1a')](0x194);}return _0x1bed46;};}function handleError(_0x4b4839,_0x4f697f){_0x4f697f=_0x4f697f||0x1f4;return function(_0x587701){logger['error'](_0x587701[_0x5ce1('0x28')]);if(_0x587701[_0x5ce1('0x29')]){delete _0x587701[_0x5ce1('0x29')];}_0x4b4839[_0x5ce1('0x1b')](_0x4f697f)['send'](_0x587701);};}exports[_0x5ce1('0x2a')]=function(_0x2ec785,_0x22a47e){var _0x3ed6ca={},_0x1d9bae={},_0x4cc443={'count':0x0,'rows':[]};var _0xd46306=_[_0x5ce1('0x2b')](db[_0x5ce1('0x2c')][_0x5ce1('0x2d')],function(_0x544744){return{'name':_0x544744[_0x5ce1('0x2e')],'type':_0x544744[_0x5ce1('0x2f')][_0x5ce1('0x30')]};});_0x1d9bae['model']=_[_0x5ce1('0x2b')](_0xd46306,_0x5ce1('0x29'));_0x1d9bae[_0x5ce1('0x31')]=_[_0x5ce1('0x32')](_0x2ec785[_0x5ce1('0x31')]);_0x1d9bae[_0x5ce1('0x33')]=_['intersection'](_0x1d9bae[_0x5ce1('0x34')],_0x1d9bae[_0x5ce1('0x31')]);_0x3ed6ca[_0x5ce1('0x35')]=_['intersection'](_0x1d9bae['model'],qs[_0x5ce1('0x36')](_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x36')]));_0x3ed6ca[_0x5ce1('0x35')]=_0x3ed6ca[_0x5ce1('0x35')]['length']?_0x3ed6ca[_0x5ce1('0x35')]:_0x1d9bae['model'];if(!_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x37')](_0x5ce1('0x38'))){_0x3ed6ca[_0x5ce1('0x1f')]=qs['limit'](_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x1f')]);_0x3ed6ca[_0x5ce1('0x1d')]=qs[_0x5ce1('0x1d')](_0x2ec785['query'][_0x5ce1('0x1d')]);}_0x3ed6ca[_0x5ce1('0x39')]=qs['sort'](_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x3a')]);_0x3ed6ca[_0x5ce1('0x3b')]=qs['filters'](_['pick'](_0x2ec785[_0x5ce1('0x31')],_0x1d9bae[_0x5ce1('0x33')]),_0xd46306);if(_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x3c')]){_0x3ed6ca[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x3ed6ca[_0x5ce1('0x3b')],{'$or':_[_0x5ce1('0x2b')](_0xd46306,function(_0x3ee878){if(_0x3ee878['type']!==_0x5ce1('0x3e')){var _0x55ca74={};_0x55ca74[_0x3ee878[_0x5ce1('0x29')]]={'$like':'%'+_0x2ec785[_0x5ce1('0x31')][_0x5ce1('0x3c')]+'%'};return _0x55ca74;}})});}_0x3ed6ca=_[_0x5ce1('0x3d')]({},_0x3ed6ca,_0x2ec785['options']);var _0x8d6d10={'where':_0x3ed6ca[_0x5ce1('0x3b')]};return db['ChatGroup'][_0x5ce1('0x20')](_0x8d6d10)[_0x5ce1('0x26')](function(_0x400ccf){_0x4cc443[_0x5ce1('0x20')]=_0x400ccf;if(_0x2ec785[_0x5ce1('0x31')]['includeAll']){_0x3ed6ca[_0x5ce1('0x3f')]=[{'all':!![]}];}return db[_0x5ce1('0x2c')][_0x5ce1('0x40')](_0x3ed6ca);})[_0x5ce1('0x26')](function(_0x289545){_0x4cc443[_0x5ce1('0x41')]=_0x289545;return _0x4cc443;})['then'](respondWithFilteredResult(_0x22a47e,_0x3ed6ca))[_0x5ce1('0x42')](handleError(_0x22a47e,null));};exports[_0x5ce1('0x43')]=function(_0x4e513f,_0x1f4429){var _0x477194={'raw':!![],'where':{'id':_0x4e513f[_0x5ce1('0x44')]['id']}},_0x41b56b={};_0x41b56b[_0x5ce1('0x34')]=_[_0x5ce1('0x32')](db[_0x5ce1('0x2c')]['rawAttributes']);_0x41b56b[_0x5ce1('0x31')]=_[_0x5ce1('0x32')](_0x4e513f[_0x5ce1('0x31')]);_0x41b56b[_0x5ce1('0x33')]=_[_0x5ce1('0x45')](_0x41b56b[_0x5ce1('0x34')],_0x41b56b[_0x5ce1('0x31')]);_0x477194['attributes']=_[_0x5ce1('0x45')](_0x41b56b['model'],qs[_0x5ce1('0x36')](_0x4e513f[_0x5ce1('0x31')]['fields']));_0x477194[_0x5ce1('0x35')]=_0x477194[_0x5ce1('0x35')]['length']?_0x477194[_0x5ce1('0x35')]:_0x41b56b[_0x5ce1('0x34')];if(_0x4e513f[_0x5ce1('0x31')][_0x5ce1('0x46')]){_0x477194['include']=[{'all':!![]}];}_0x477194=_[_0x5ce1('0x3d')]({},_0x477194,_0x4e513f[_0x5ce1('0x47')]);return db[_0x5ce1('0x2c')][_0x5ce1('0x48')](_0x477194)[_0x5ce1('0x26')](handleEntityNotFound(_0x1f4429,null))['then'](respondWithResult(_0x1f4429,null))[_0x5ce1('0x42')](handleError(_0x1f4429,null));};exports[_0x5ce1('0x49')]=function(_0x20eb4b,_0x1ec47b){return db[_0x5ce1('0x2c')][_0x5ce1('0x49')](_0x20eb4b[_0x5ce1('0x4a')],{})[_0x5ce1('0x26')](respondWithResult(_0x1ec47b,0xc9))[_0x5ce1('0x42')](handleError(_0x1ec47b,null));};exports['update']=function(_0x3d74b0,_0x52fca2){if(_0x3d74b0['body']['id']){delete _0x3d74b0[_0x5ce1('0x4a')]['id'];}return db['ChatGroup'][_0x5ce1('0x48')]({'where':{'id':_0x3d74b0['params']['id']}})['then'](handleEntityNotFound(_0x52fca2,null))[_0x5ce1('0x26')](saveUpdates(_0x3d74b0[_0x5ce1('0x4a')],null))[_0x5ce1('0x26')](respondWithResult(_0x52fca2,null))[_0x5ce1('0x42')](handleError(_0x52fca2,null));};exports[_0x5ce1('0x27')]=function(_0x269acf,_0x3a7bba){return db[_0x5ce1('0x2c')]['find']({'where':{'id':_0x269acf[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x3a7bba,null))['then'](removeEntity(_0x3a7bba,null))['catch'](handleError(_0x3a7bba,null));};exports['describe']=function(_0x5c8e5b,_0x521e41){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x521e41,null))[_0x5ce1('0x42')](handleError(_0x521e41,null));};exports[_0x5ce1('0x4b')]=function(_0x253092,_0x54c333,_0x2035ba){return db[_0x5ce1('0x4c')]['count']({'where':{'ChatGroupId':_0x253092[_0x5ce1('0x44')]['id'],'ToId':_0x253092['user']['id'],'read':![]}})['then'](function(_0x534345){return{'id':_[_0x5ce1('0x4d')](_0x253092[_0x5ce1('0x44')]['id']),'count':_0x534345};})[_0x5ce1('0x26')](respondWithResult(_0x54c333,null))[_0x5ce1('0x42')](handleError(_0x54c333,null));};exports[_0x5ce1('0x4e')]=function(_0x13f05f,_0x4d18ac,_0x29871d){return db[_0x5ce1('0x2c')][_0x5ce1('0x48')]({'where':{'id':_0x13f05f['params']['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x4d18ac,null))[_0x5ce1('0x26')](function(_0x4d7222){if(_0x4d7222){return _0x4d7222[_0x5ce1('0x4e')](_0x13f05f[_0x5ce1('0x4a')][_0x5ce1('0x4f')],_['omit'](_0x13f05f[_0x5ce1('0x4a')],['ids','id'])||{});}})[_0x5ce1('0x26')](respondWithResult(_0x4d18ac,null))['catch'](handleError(_0x4d18ac,null));};exports[_0x5ce1('0x50')]=function(_0x2bddcf,_0x3e7c10,_0x43a06f){var _0x9cf6bd={};var _0x516ccc={};var _0x61ff52;var _0x16e18b;return db['ChatGroup'][_0x5ce1('0x51')]({'where':{'id':_0x2bddcf[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x3e7c10,null))[_0x5ce1('0x26')](function(_0x351066){if(_0x351066){_0x61ff52=_0x351066;_0x516ccc[_0x5ce1('0x34')]=_['keys'](db[_0x5ce1('0x52')][_0x5ce1('0x2d')]);_0x516ccc['query']=_[_0x5ce1('0x32')](_0x2bddcf['query']);_0x516ccc[_0x5ce1('0x33')]=_[_0x5ce1('0x45')](_0x516ccc['model'],_0x516ccc['query']);_0x9cf6bd[_0x5ce1('0x35')]=_['intersection'](_0x516ccc['model'],qs['fields'](_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x36')]));_0x9cf6bd[_0x5ce1('0x35')]=_0x9cf6bd['attributes']['length']?_0x9cf6bd[_0x5ce1('0x35')]:_0x516ccc['model'];_0x9cf6bd[_0x5ce1('0x39')]=qs[_0x5ce1('0x3a')](_0x2bddcf[_0x5ce1('0x31')]['sort']);_0x9cf6bd['where']=qs[_0x5ce1('0x33')](_[_0x5ce1('0x53')](_0x2bddcf['query'],_0x516ccc[_0x5ce1('0x33')]));if(_0x2bddcf['query'][_0x5ce1('0x3c')]){_0x9cf6bd[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x9cf6bd[_0x5ce1('0x3b')],{'$or':_[_0x5ce1('0x2b')](_0x9cf6bd['attributes'],function(_0x149440){var _0x5acdb5={};_0x5acdb5[_0x149440]={'$like':'%'+_0x2bddcf['query']['filter']+'%'};return _0x5acdb5;})});}_0x9cf6bd=_[_0x5ce1('0x3d')]({},_0x9cf6bd,_0x2bddcf[_0x5ce1('0x47')]);return _0x61ff52[_0x5ce1('0x50')](_0x9cf6bd);}})['then'](function(_0x56103f){if(_0x56103f){_0x16e18b=_0x56103f[_0x5ce1('0x54')];if(!_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x37')](_0x5ce1('0x38'))){_0x9cf6bd['limit']=qs[_0x5ce1('0x1f')](_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x1f')]);_0x9cf6bd['offset']=qs[_0x5ce1('0x1d')](_0x2bddcf[_0x5ce1('0x31')][_0x5ce1('0x1d')]);}return _0x61ff52['getMembers'](_0x9cf6bd);}})['then'](function(_0x2c302b){if(_0x2c302b){return _0x2c302b?{'count':_0x16e18b,'rows':_0x2c302b}:null;}})[_0x5ce1('0x26')](respondWithResult(_0x3e7c10,null))[_0x5ce1('0x42')](handleError(_0x3e7c10,null));};exports[_0x5ce1('0x55')]=function(_0x2a776d,_0x3225d0,_0x5d55cc){return db[_0x5ce1('0x2c')][_0x5ce1('0x48')]({'where':{'id':_0x2a776d[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x3225d0,null))[_0x5ce1('0x26')](function(_0x5bdbb9){if(_0x5bdbb9){return _0x5bdbb9[_0x5ce1('0x55')](_0x2a776d['query'][_0x5ce1('0x4f')]);}})[_0x5ce1('0x26')](respondWithStatusCode(_0x3225d0,null))[_0x5ce1('0x42')](handleError(_0x3225d0,null));};exports[_0x5ce1('0x56')]=function(_0xc2798c,_0x1e952e,_0x5a3bbc){if(_0xc2798c[_0x5ce1('0x4a')]['id']){delete _0xc2798c[_0x5ce1('0x4a')]['id'];}return db[_0x5ce1('0x2c')][_0x5ce1('0x48')]({'where':{'id':_0xc2798c['params']['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0x1e952e,null))['then'](function(_0x54443c){if(_0x54443c){_0xc2798c['body'][_0x5ce1('0x57')]=_0x54443c['id'];return db[_0x5ce1('0x4c')][_0x5ce1('0x49')](_0xc2798c['body']);}})[_0x5ce1('0x26')](respondWithResult(_0x1e952e,null))['catch'](handleError(_0x1e952e,null));};exports[_0x5ce1('0x58')]=function(_0x30afba,_0xef0841,_0x36bd9e){var _0x20b144={};var _0x2aecb8={};var _0x4a48af;var _0x598142;return db[_0x5ce1('0x2c')][_0x5ce1('0x51')]({'where':{'id':_0x30afba[_0x5ce1('0x44')]['id']}})[_0x5ce1('0x26')](handleEntityNotFound(_0xef0841,null))[_0x5ce1('0x26')](function(_0x18cc5d){if(_0x18cc5d){_0x4a48af=_0x18cc5d;_0x2aecb8['model']=_[_0x5ce1('0x32')](db[_0x5ce1('0x4c')][_0x5ce1('0x2d')]);_0x2aecb8['query']=_[_0x5ce1('0x32')](_0x30afba[_0x5ce1('0x31')]);_0x2aecb8[_0x5ce1('0x33')]=_[_0x5ce1('0x45')](_0x2aecb8[_0x5ce1('0x34')],_0x2aecb8[_0x5ce1('0x31')]);_0x20b144['attributes']=_[_0x5ce1('0x45')](_0x2aecb8[_0x5ce1('0x34')],qs['fields'](_0x30afba['query'][_0x5ce1('0x36')]));_0x20b144[_0x5ce1('0x35')]=_0x20b144[_0x5ce1('0x35')][_0x5ce1('0x54')]?_0x20b144[_0x5ce1('0x35')]:_0x2aecb8['model'];_0x20b144[_0x5ce1('0x39')]=qs[_0x5ce1('0x3a')](_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x3a')]);_0x20b144[_0x5ce1('0x3b')]=qs[_0x5ce1('0x33')](_[_0x5ce1('0x53')](_0x30afba['query'],_0x2aecb8[_0x5ce1('0x33')]));if(_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x3c')]){_0x20b144[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x20b144['where'],{'$or':_['map'](_0x20b144[_0x5ce1('0x35')],function(_0x38e771){var _0x40586d={};_0x40586d[_0x38e771]={'$like':'%'+_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x3c')]+'%'};return _0x40586d;})});}if(_0x30afba[_0x5ce1('0x31')]['$gte']){var _0x287120=_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x59')][_0x5ce1('0x5a')](',');var _0xf260ff={};_0xf260ff[_0x287120[0x0]]={'$gte':moment(_0x287120[0x1])[_0x5ce1('0x5b')](_0x5ce1('0x5c'))};_0x20b144[_0x5ce1('0x3b')]=_[_0x5ce1('0x3d')](_0x20b144[_0x5ce1('0x3b')],_0xf260ff);}_0x20b144=_['merge']({},_0x20b144,_0x30afba['options']);return _0x4a48af[_0x5ce1('0x58')](_0x20b144);}})['then'](function(_0x1a3348){if(_0x1a3348){_0x598142=_0x1a3348['length'];if(!_0x30afba[_0x5ce1('0x31')][_0x5ce1('0x37')](_0x5ce1('0x38'))){_0x20b144[_0x5ce1('0x1f')]=qs[_0x5ce1('0x1f')](_0x30afba[_0x5ce1('0x31')]['limit']);_0x20b144[_0x5ce1('0x1d')]=qs['offset'](_0x30afba[_0x5ce1('0x31')]['offset']);}return _0x4a48af[_0x5ce1('0x58')](_0x20b144);}})[_0x5ce1('0x26')](function(_0x5947dd){if(_0x5947dd){return _0x5947dd?{'count':_0x598142,'rows':_0x5947dd}:null;}})['then'](respondWithResult(_0xef0841,null))[_0x5ce1('0x42')](handleError(_0xef0841,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index d72337c..86aa216 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 _0x85e6=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x42f8fb,_0x326d5b){var _0x3e3df9=function(_0xdbaea4){while(--_0xdbaea4){_0x42f8fb['push'](_0x42f8fb['shift']());}};_0x3e3df9(++_0x326d5b);}(_0x85e6,0x1a5));var _0x685e=function(_0x2d4176,_0xa2a1b2){_0x2d4176=_0x2d4176-0x0;var _0x4ef7d9=_0x85e6[_0x2d4176];return _0x4ef7d9;};'use strict';var EventEmitter=require(_0x685e('0x0'));var ChatGroup=require(_0x685e('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x685e('0x2')](0x0);var events={'afterCreate':_0x685e('0x3'),'afterUpdate':'update','afterDestroy':_0x685e('0x4')};function emitEvent(_0xe95f5d){return function(_0x438489,_0x53630e,_0x1cdf9d){ChatGroupEvents['emit'](_0xe95f5d+':'+_0x438489['id'],_0x438489);ChatGroupEvents[_0x685e('0x5')](_0xe95f5d,_0x438489);_0x1cdf9d(null);};}for(var e in events){if(events[_0x685e('0x6')](e)){var event=events[e];ChatGroup[_0x685e('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xb2ea=['remove','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0xe6c7e4,_0x5c40c4){var _0x109c83=function(_0x54870b){while(--_0x54870b){_0xe6c7e4['push'](_0xe6c7e4['shift']());}};_0x109c83(++_0x5c40c4);}(_0xb2ea,0x1eb));var _0xab2e=function(_0x101842,_0x4db31b){_0x101842=_0x101842-0x0;var _0x45ce04=_0xb2ea[_0x101842];return _0x45ce04;};'use strict';var EventEmitter=require(_0xab2e('0x0'));var ChatGroup=require(_0xab2e('0x1'))['db'][_0xab2e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xab2e('0x3')](0x0);var events={'afterCreate':_0xab2e('0x4'),'afterUpdate':'update','afterDestroy':_0xab2e('0x5')};function emitEvent(_0x2cebed){return function(_0x42ca08,_0x1dfdc5,_0x5cef90){ChatGroupEvents['emit'](_0x2cebed+':'+_0x42ca08['id'],_0x42ca08);ChatGroupEvents[_0xab2e('0x6')](_0x2cebed,_0x42ca08);_0x5cef90(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xab2e('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index c58f9f0..e4afe1d 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 _0x2a7b=['util','../../config/logger','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash'];(function(_0x1ee5ef,_0x38d42b){var _0x448ab8=function(_0x508932){while(--_0x508932){_0x1ee5ef['push'](_0x1ee5ef['shift']());}};_0x448ab8(++_0x38d42b);}(_0x2a7b,0x1a1));var _0xb2a7=function(_0x4132b5,_0x2c5d9d){_0x4132b5=_0x4132b5-0x0;var _0x47b4db=_0x2a7b[_0x4132b5];return _0x47b4db;};'use strict';var _=require(_0xb2a7('0x0'));var util=require(_0xb2a7('0x1'));var logger=require(_0xb2a7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb2a7('0x3'));var rp=require(_0xb2a7('0x4'));var fs=require('fs');var path=require(_0xb2a7('0x5'));var rimraf=require(_0xb2a7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb2a7('0x7'));module['exports']=function(_0x660743,_0x5a52cf){return _0x660743[_0xb2a7('0x8')](_0xb2a7('0x9'),attributes,{'tableName':_0xb2a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8610=['moment','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','api'];(function(_0x5a2b15,_0x459103){var _0x497e16=function(_0x244aa8){while(--_0x244aa8){_0x5a2b15['push'](_0x5a2b15['shift']());}};_0x497e16(++_0x459103);}(_0x8610,0xae));var _0x0861=function(_0x3064e2,_0x2a3f50){_0x3064e2=_0x3064e2-0x0;var _0x390154=_0x8610[_0x3064e2];return _0x390154;};'use strict';var _=require('lodash');var util=require(_0x0861('0x0'));var logger=require('../../config/logger')(_0x0861('0x1'));var moment=require(_0x0861('0x2'));var BPromise=require('bluebird');var rp=require(_0x0861('0x3'));var fs=require('fs');var path=require(_0x0861('0x4'));var rimraf=require(_0x0861('0x5'));var config=require(_0x0861('0x6'));var attributes=require(_0x0861('0x7'));module[_0x0861('0x8')]=function(_0x2ec4a8,_0x3996f1){return _0x2ec4a8[_0x0861('0x9')](_0x0861('0xa'),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 a1be960..ed9d93c 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 _0x2cbe=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3d4e2f,_0x416ced){var _0x2023d3=function(_0x37abbf){while(--_0x37abbf){_0x3d4e2f['push'](_0x3d4e2f['shift']());}};_0x2023d3(++_0x416ced);}(_0x2cbe,0x110));var _0xe2cb=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x2cbe[_0x5ef905];return _0x367808;};'use strict';var _=require('lodash');var util=require(_0xe2cb('0x0'));var moment=require(_0xe2cb('0x1'));var BPromise=require(_0xe2cb('0x2'));var rs=require(_0xe2cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe2cb('0x4'))(_0xe2cb('0x5'));var config=require(_0xe2cb('0x6'));var jayson=require(_0xe2cb('0x7'));var client=jayson[_0xe2cb('0x8')]['http']({'port':0x232a});config[_0xe2cb('0x9')]=_['defaults'](config['redis'],{'host':_0xe2cb('0xa'),'port':0x18eb});var socket=require(_0xe2cb('0xb'))(new Redis(config[_0xe2cb('0x9')]));require('./chatGroup.socket')[_0xe2cb('0xc')](socket);function respondWithRpcPromise(_0x1887b9,_0x1466a3,_0x4c66af){return new BPromise(function(_0xb161fc,_0x2b3357){return client[_0xe2cb('0xd')](_0x1887b9,_0x4c66af)['then'](function(_0x105190){logger[_0xe2cb('0xe')]('ChatGroup,\x20%s,\x20%s',_0x1466a3,'request\x20sent');logger['debug'](_0xe2cb('0xf'),_0x1466a3,_0xe2cb('0x10'),JSON['stringify'](_0x105190));if(_0x105190['error']){if(_0x105190[_0xe2cb('0x11')][_0xe2cb('0x12')]===0x1f4){logger['error'](_0xe2cb('0x13'),_0x1466a3,_0x105190['error'][_0xe2cb('0x14')]);return _0x2b3357(_0x105190[_0xe2cb('0x11')][_0xe2cb('0x14')]);}logger[_0xe2cb('0x11')](_0xe2cb('0x13'),_0x1466a3,_0x105190[_0xe2cb('0x11')][_0xe2cb('0x14')]);return _0xb161fc(_0x105190[_0xe2cb('0x11')][_0xe2cb('0x14')]);}else{logger[_0xe2cb('0xe')](_0xe2cb('0x13'),_0x1466a3,_0xe2cb('0x10'));_0xb161fc(_0x105190[_0xe2cb('0x15')]['message']);}})[_0xe2cb('0x16')](function(_0x136bab){logger[_0xe2cb('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1466a3,_0x136bab);_0x2b3357(_0x136bab);});});}
\ No newline at end of file
+var _0x3dc1=['then','info','request\x20sent','debug','error','code','ChatGroup,\x20%s,\x20%s','message','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','./chatGroup.socket','register'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x3dc1,0x127));var _0x13dc=function(_0x40fa11,_0xb9cdd){_0x40fa11=_0x40fa11-0x0;var _0xf527c7=_0x3dc1[_0x40fa11];return _0xf527c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13dc('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13dc('0x1'));var db=require(_0x13dc('0x2'))['db'];var utils=require(_0x13dc('0x3'));var logger=require(_0x13dc('0x4'))(_0x13dc('0x5'));var config=require('../../config/environment');var jayson=require(_0x13dc('0x6'));var client=jayson[_0x13dc('0x7')]['http']({'port':0x232a});config['redis']=_[_0x13dc('0x8')](config['redis'],{'host':_0x13dc('0x9'),'port':0x18eb});var socket=require(_0x13dc('0xa'))(new Redis(config['redis']));require(_0x13dc('0xb'))[_0x13dc('0xc')](socket);function respondWithRpcPromise(_0x386e43,_0x7b132c,_0x5c1b24){return new BPromise(function(_0x1533de,_0x46d4f){return client['request'](_0x386e43,_0x5c1b24)[_0x13dc('0xd')](function(_0x835a16){logger[_0x13dc('0xe')]('ChatGroup,\x20%s,\x20%s',_0x7b132c,_0x13dc('0xf'));logger[_0x13dc('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x7b132c,_0x13dc('0xf'),JSON['stringify'](_0x835a16));if(_0x835a16[_0x13dc('0x11')]){if(_0x835a16[_0x13dc('0x11')][_0x13dc('0x12')]===0x1f4){logger[_0x13dc('0x11')](_0x13dc('0x13'),_0x7b132c,_0x835a16['error'][_0x13dc('0x14')]);return _0x46d4f(_0x835a16[_0x13dc('0x11')][_0x13dc('0x14')]);}logger[_0x13dc('0x11')](_0x13dc('0x13'),_0x7b132c,_0x835a16[_0x13dc('0x11')][_0x13dc('0x14')]);return _0x1533de(_0x835a16[_0x13dc('0x11')][_0x13dc('0x14')]);}else{logger[_0x13dc('0xe')](_0x13dc('0x13'),_0x7b132c,_0x13dc('0xf'));_0x1533de(_0x835a16[_0x13dc('0x15')]['message']);}})['catch'](function(_0x4c495e){logger[_0x13dc('0x11')]('ChatGroup,\x20%s,\x20%s',_0x7b132c,_0x4c495e);_0x46d4f(_0x4c495e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 41f7c24..b348ecf 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 _0xf03c=['emit','removeListener','register','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf03c,0x1bc));var _0xcf03=function(_0x3e54a6,_0x1733a8){_0x3e54a6=_0x3e54a6-0x0;var _0x180b03=_0xf03c[_0x3e54a6];return _0x180b03;};'use strict';var ChatGroupEvents=require(_0xcf03('0x0'));var events=[_0xcf03('0x1'),_0xcf03('0x2'),_0xcf03('0x3')];function createListener(_0xebd906,_0x475eb9){return function(_0x2d55a5){_0x475eb9[_0xcf03('0x4')](_0xebd906,_0x2d55a5);};}function removeListener(_0x11f565,_0x13a510){return function(){ChatGroupEvents[_0xcf03('0x5')](_0x11f565,_0x13a510);};}exports[_0xcf03('0x6')]=function(_0x6ced06){for(var _0x1df041=0x0,_0x16c2b6=events['length'];_0x1df041<_0x16c2b6;_0x1df041++){var _0x5983af=events[_0x1df041];var _0x516426=createListener(_0xcf03('0x7')+_0x5983af,_0x6ced06);ChatGroupEvents['on'](_0x5983af,_0x516426);}};
\ No newline at end of file
+var _0xd147=['register','length','chatGroup:','./chatGroup.events','emit','removeListener'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd147,0xed));var _0x7d14=function(_0x1c4d19,_0x1500e8){_0x1c4d19=_0x1c4d19-0x0;var _0x1b539c=_0xd147[_0x1c4d19];return _0x1b539c;};'use strict';var ChatGroupEvents=require(_0x7d14('0x0'));var events=['save','remove','update'];function createListener(_0x51aca8,_0x473275){return function(_0x3aed43){_0x473275[_0x7d14('0x1')](_0x51aca8,_0x3aed43);};}function removeListener(_0x561986,_0x412909){return function(){ChatGroupEvents[_0x7d14('0x2')](_0x561986,_0x412909);};}exports[_0x7d14('0x3')]=function(_0x3f977c){for(var _0x437153=0x0,_0x24e1d5=events[_0x7d14('0x4')];_0x437153<_0x24e1d5;_0x437153++){var _0x30afd6=events[_0x437153];var _0x15727d=createListener(_0x7d14('0x5')+_0x30afd6,_0x3f977c);ChatGroupEvents['on'](_0x30afd6,_0x15727d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 77b2cd8..b17cf64 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 _0x7b93=['getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','removeMembers','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','show','/:id/unread','getUnread','/:id/members'];(function(_0x33d17c,_0x5aa51c){var _0x1e5980=function(_0xd75367){while(--_0xd75367){_0x33d17c['push'](_0x33d17c['shift']());}};_0x1e5980(++_0x5aa51c);}(_0x7b93,0xd8));var _0x37b9=function(_0x3dcabf,_0x3af156){_0x3dcabf=_0x3dcabf-0x0;var _0x4ad179=_0x7b93[_0x3dcabf];return _0x4ad179;};'use strict';var multer=require(_0x37b9('0x0'));var util=require(_0x37b9('0x1'));var path=require('path');var timeout=require(_0x37b9('0x2'));var express=require(_0x37b9('0x3'));var router=express[_0x37b9('0x4')]();var fs_extra=require(_0x37b9('0x5'));var auth=require(_0x37b9('0x6'));var interaction=require(_0x37b9('0x7'));var config=require(_0x37b9('0x8'));var controller=require(_0x37b9('0x9'));router[_0x37b9('0xa')]('/',auth[_0x37b9('0xb')](),controller['index']);router[_0x37b9('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x37b9('0xb')](),controller[_0x37b9('0xc')]);router[_0x37b9('0xa')](_0x37b9('0xd'),auth[_0x37b9('0xb')](),controller[_0x37b9('0xe')]);router[_0x37b9('0xa')](_0x37b9('0xf'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x10')]);router['get'](_0x37b9('0x11'),auth['isAuthenticated'](),controller[_0x37b9('0x12')]);router[_0x37b9('0x13')]('/',auth[_0x37b9('0xb')](),controller[_0x37b9('0x14')]);router['post']('/:id/members',auth[_0x37b9('0xb')](),controller[_0x37b9('0x15')]);router[_0x37b9('0x13')](_0x37b9('0x11'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x16')]);router[_0x37b9('0x17')](_0x37b9('0x18'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x19')]);router[_0x37b9('0x1a')](_0x37b9('0x18'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x1b')]);router[_0x37b9('0x1a')](_0x37b9('0xf'),auth['isAuthenticated'](),controller[_0x37b9('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xb084=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','addMessage','put','update','delete','exports','util','path'];(function(_0x5043f6,_0x327737){var _0x2f0adf=function(_0x53af5b){while(--_0x53af5b){_0x5043f6['push'](_0x5043f6['shift']());}};_0x2f0adf(++_0x327737);}(_0xb084,0x178));var _0x4b08=function(_0x4d2819,_0x477b2a){_0x4d2819=_0x4d2819-0x0;var _0x78d15f=_0xb084[_0x4d2819];return _0x78d15f;};'use strict';var multer=require('multer');var util=require(_0x4b08('0x0'));var path=require(_0x4b08('0x1'));var timeout=require(_0x4b08('0x2'));var express=require(_0x4b08('0x3'));var router=express['Router']();var fs_extra=require(_0x4b08('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4b08('0x5'));var config=require(_0x4b08('0x6'));var controller=require(_0x4b08('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4b08('0x8')](_0x4b08('0x9'),auth[_0x4b08('0xa')](),controller[_0x4b08('0xb')]);router[_0x4b08('0x8')](_0x4b08('0xc'),auth['isAuthenticated'](),controller[_0x4b08('0xd')]);router[_0x4b08('0x8')]('/:id/unread',auth[_0x4b08('0xa')](),controller[_0x4b08('0xe')]);router['get'](_0x4b08('0xf'),auth[_0x4b08('0xa')](),controller[_0x4b08('0x10')]);router[_0x4b08('0x8')]('/:id/messages',auth[_0x4b08('0xa')](),controller[_0x4b08('0x11')]);router[_0x4b08('0x12')]('/',auth[_0x4b08('0xa')](),controller[_0x4b08('0x13')]);router[_0x4b08('0x12')](_0x4b08('0xf'),auth['isAuthenticated'](),controller[_0x4b08('0x14')]);router[_0x4b08('0x12')](_0x4b08('0x15'),auth[_0x4b08('0xa')](),controller[_0x4b08('0x16')]);router[_0x4b08('0x17')](_0x4b08('0xc'),auth[_0x4b08('0xa')](),controller[_0x4b08('0x18')]);router[_0x4b08('0x19')](_0x4b08('0xc'),auth[_0x4b08('0xa')](),controller['destroy']);router[_0x4b08('0x19')](_0x4b08('0xf'),auth[_0x4b08('0xa')](),controller['removeMembers']);module[_0x4b08('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 78198ce..4c87b00 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 _0x02a7=['STRING','long','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x4045ff,_0x46cbcd){var _0x5797ac=function(_0x32003f){while(--_0x32003f){_0x4045ff['push'](_0x4045ff['shift']());}};_0x5797ac(++_0x46cbcd);}(_0x02a7,0x1a6));var _0x702a=function(_0x1166a0,_0x343907){_0x1166a0=_0x1166a0-0x0;var _0x5b8a2a=_0x02a7[_0x1166a0];return _0x5b8a2a;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'closed':{'type':Sequelize[_0x702a('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x702a('0x2')]},'ratingType':{'type':Sequelize[_0x702a('0x3')](_0x702a('0x4'),_0x702a('0x5')),'defaultValue':_0x702a('0x4')},'ratingMessage':{'type':Sequelize[_0x702a('0x6')]},'pathTranscript':{'type':Sequelize[_0x702a('0x6')]},'mailTranscript':{'type':Sequelize[_0x702a('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x702a('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x702a('0x7')]},'browserName':{'type':Sequelize[_0x702a('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x702a('0x7')]},'deviceType':{'type':Sequelize[_0x702a('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x702a('0x7')]},'formData':{'type':Sequelize[_0x702a('0x6')](_0x702a('0x8'))},'read1stAt':{'type':Sequelize[_0x702a('0x9')]},'lastMsgAt':{'type':Sequelize[_0x702a('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x702a('0x3')]('in',_0x702a('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x702a('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x702a('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x702a('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb78e=['BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0xb78e,0x1c9));var _0xeb78=function(_0x275f94,_0x2b723a){_0x275f94=_0x275f94-0x0;var _0x302f39=_0xb78e[_0x275f94];return _0x302f39;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb78('0x2')]},'ratingType':{'type':Sequelize[_0xeb78('0x3')](_0xeb78('0x4'),_0xeb78('0x5')),'defaultValue':_0xeb78('0x4')},'ratingMessage':{'type':Sequelize[_0xeb78('0x6')]},'pathTranscript':{'type':Sequelize[_0xeb78('0x6')]},'mailTranscript':{'type':Sequelize[_0xeb78('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb78('0x7')]},'secondDisposition':{'type':Sequelize[_0xeb78('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeb78('0x7')]},'note':{'type':Sequelize[_0xeb78('0x7')]},'browserName':{'type':Sequelize[_0xeb78('0x7')]},'browserVersion':{'type':Sequelize[_0xeb78('0x7')]},'osName':{'type':Sequelize[_0xeb78('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xeb78('0x7')]},'deviceVendor':{'type':Sequelize[_0xeb78('0x7')]},'deviceType':{'type':Sequelize[_0xeb78('0x7')]},'referer':{'type':Sequelize[_0xeb78('0x6')]},'customerIp':{'type':Sequelize[_0xeb78('0x7')]},'formData':{'type':Sequelize[_0xeb78('0x6')](_0xeb78('0x8'))},'read1stAt':{'type':Sequelize[_0xeb78('0x9')]},'lastMsgAt':{'type':Sequelize[_0xeb78('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xeb78('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb78('0x7')]},'customerPort':{'type':Sequelize[_0xeb78('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xeb78('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeb78('0xb')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index ae44eda..8d3d7ac 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 _0x36ee=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','UserId','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20=\x20?','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','includeAll','options','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','POST','email','vidaooNote','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','mailTranscript','transcript-%s.txt','Messages','format','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','getMessages','include','findAll','rows','getMyMessages','includeAgent','spread','emit','chatInteractionTags:save','removeTags','unix','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','direction','secret','read','Owner','get','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','osName','referer','customerIp','createReadStream','pipe','createWriteStream','out','server','views','downloadInteraction.ejs','log','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','limit','undefined','offset','count','set','apply','reject','save','update','then','end','sendStatus','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','fullname','TagIds','Tags','split','forEach','push','index','map','ChatInteraction','rawAttributes','type','key','model','query','keys'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var pdf=require(_0xe36e('0x12'));var hardwareService=require(_0xe36e('0x13'));var logger=require(_0xe36e('0x14'))(_0xe36e('0x15'));var utils=require(_0xe36e('0x16'));var config=require(_0xe36e('0x17'));var licenseUtil=require(_0xe36e('0x18'));var db=require('../../mysqldb')['db'];config[_0xe36e('0x19')]=_[_0xe36e('0x1a')](config[_0xe36e('0x19')],{'host':_0xe36e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0x19')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xe36e('0x1c'));var client=jayson[_0xe36e('0x1d')][_0xe36e('0x1e')]({'port':0x232b});var client9004=jayson[_0xe36e('0x1d')][_0xe36e('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x924cd5,_0x2096f6,_0x39bae8,_0x387c37){return new BPromise(function(_0x428d34,_0x5792e8){var _0x333554=_0x387c37||client;return _0x333554[_0xe36e('0x1f')](_0x924cd5,_0x39bae8)['then'](function(_0x21d9a3){logger['info'](_0xe36e('0x20'),_0x2096f6,_0xe36e('0x21'));logger['debug'](_0xe36e('0x22'),_0x2096f6,_0xe36e('0x21'),JSON[_0xe36e('0x23')](_0x21d9a3));if(_0x21d9a3['error']){if(_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x25')]===0x1f4){logger[_0xe36e('0x24')](_0xe36e('0x20'),_0x2096f6,_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x26')]);return _0x5792e8(_0x21d9a3['error'][_0xe36e('0x26')]);}logger[_0xe36e('0x24')](_0xe36e('0x20'),_0x2096f6,_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x26')]);return _0x428d34(_0x21d9a3['error']['message']);}else{logger[_0xe36e('0x27')](_0xe36e('0x20'),_0x2096f6,_0xe36e('0x21'));_0x428d34(_0x21d9a3[_0xe36e('0x28')][_0xe36e('0x26')]);}})[_0xe36e('0x29')](function(_0x1a045c){logger['error'](_0xe36e('0x20'),_0x2096f6,_0x1a045c);_0x5792e8(_0x1a045c);});});}function respondWithStatusCode(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0xcc;return function(_0x262caa){if(_0x262caa){return _0x35f9e7['sendStatus'](_0x10597f);}return _0x35f9e7[_0xe36e('0x2a')](_0x10597f)['end']();};}function respondWithResult(_0xf7b02e,_0x5993de){_0x5993de=_0x5993de||0xc8;return function(_0x19f001){if(_0x19f001){return _0xf7b02e['status'](_0x5993de)[_0xe36e('0x2b')](_0x19f001);}};}function respondWithFilteredResult(_0x4c5d98,_0x3b1045){return function(_0x59548b){if(_0x59548b){var _0x4bb75b=typeof _0x3b1045['offset']==='undefined'&&typeof _0x3b1045[_0xe36e('0x2c')]===_0xe36e('0x2d');var _0x4cf185=_0x59548b['count'];var _0x1fa1ec=_0x4bb75b?0x0:_0x3b1045[_0xe36e('0x2e')];var _0x259e19=_0x4bb75b?_0x59548b[_0xe36e('0x2f')]:_0x3b1045[_0xe36e('0x2e')]+_0x3b1045[_0xe36e('0x2c')];var _0x57bb9b;if(_0x259e19>=_0x4cf185){_0x259e19=_0x4cf185;_0x57bb9b=0xc8;}else{_0x57bb9b=0xce;}_0x4c5d98[_0xe36e('0x2a')](_0x57bb9b);return _0x4c5d98[_0xe36e('0x30')]('Content-Range',_0x1fa1ec+'-'+_0x259e19+'/'+_0x4cf185)[_0xe36e('0x2b')](_0x59548b);}return null;};}function patchUpdates(_0xa06f61){return function(_0xba4869){try{jsonpatch[_0xe36e('0x31')](_0xba4869,_0xa06f61,!![]);}catch(_0x21623e){return BPromise[_0xe36e('0x32')](_0x21623e);}return _0xba4869[_0xe36e('0x33')]();};}function saveUpdates(_0x127807,_0x36cee2){return function(_0x1cc329){if(_0x1cc329){return _0x1cc329[_0xe36e('0x34')](_0x127807)['then'](function(_0x4507b9){return _0x4507b9;});}return null;};}function removeEntity(_0x59231e,_0x4a717e){return function(_0x81cf9a){if(_0x81cf9a){return _0x81cf9a['destroy']()[_0xe36e('0x35')](function(){_0x59231e[_0xe36e('0x2a')](0xcc)[_0xe36e('0x36')]();});}};}function handleEntityNotFound(_0x235437,_0x4a6a2b){return function(_0x56135c){if(!_0x56135c){_0x235437[_0xe36e('0x37')](0x194);}return _0x56135c;};}function handleError(_0x222c65,_0x19a53f){_0x19a53f=_0x19a53f||0x1f4;return function(_0x243338){logger['error'](_0x243338[_0xe36e('0x38')]);if(_0x243338[_0xe36e('0x39')]){delete _0x243338[_0xe36e('0x39')];}_0x222c65['status'](_0x19a53f)[_0xe36e('0x3a')](_0x243338);};}function getMustacheRender(_0x2ff8f4,_0x5d9f64){return Mustache[_0xe36e('0x3b')](_0x2ff8f4,_[_0xe36e('0x3c')](_0x5d9f64[_0xe36e('0x3d')],{'contact':_0x5d9f64[_0xe36e('0x3e')],'message':_0x5d9f64[_0xe36e('0x26')],'agent':_0x5d9f64[_0xe36e('0x3f')],'interaction':_0x5d9f64[_0xe36e('0x40')],'account':_0x5d9f64[_0xe36e('0x41')]}))||'';}function getInteractionUsers(_0x458a4e,_0x23da09){return new BPromise(function(_0x2f1933,_0x39dd9b){try{if(_0x23da09[_0x458a4e['id']]){_0x458a4e[_0xe36e('0x42')]=_['map'](_0x23da09[_0x458a4e['id']],function(_0x23d36e){return{'id':_0x23d36e['id'],'fullname':_0x23d36e[_0xe36e('0x43')]};});}}catch(_0xd45bb3){_0x39dd9b(_0xd45bb3);}_0x2f1933(_0x458a4e);});}function getInteractionTags(_0x11ee1d,_0x295feb){return new BPromise(function(_0x4d133b,_0x591e33){try{if(_0x11ee1d[_0xe36e('0x44')]){_0x11ee1d[_0xe36e('0x45')]=[];_0x11ee1d[_0xe36e('0x44')][_0xe36e('0x46')](',')[_0xe36e('0x47')](function(_0x34a1ba){_0x11ee1d[_0xe36e('0x45')][_0xe36e('0x48')](_0x295feb[_0x34a1ba]);});}delete _0x11ee1d['TagIds'];}catch(_0x198a40){_0x591e33(_0x198a40);}_0x4d133b(_0x11ee1d);});}function updateChatInteraction(_0x2d392c,_0x4788a0,_0x21dc35){return new BPromise(function(_0x5ef3e4,_0x23e344){return getInteractionUsers(_0x2d392c,_0x21dc35)[_0xe36e('0x35')](function(_0x1d45a4){return getInteractionTags(_0x1d45a4,_0x4788a0);})[_0xe36e('0x35')](function(_0x3b1269){_0x5ef3e4(_0x3b1269);})['catch'](function(_0x2ffc34){_0x23e344(_0x2ffc34);});});}exports[_0xe36e('0x49')]=function(_0x2265c4,_0x1dddfe){var _0x2e57f4={},_0x31760e={},_0x569809={'count':0x0,'rows':[]};var _0x122704=_[_0xe36e('0x4a')](db[_0xe36e('0x4b')][_0xe36e('0x4c')],function(_0x1cbb7d){return{'name':_0x1cbb7d['fieldName'],'type':_0x1cbb7d[_0xe36e('0x4d')][_0xe36e('0x4e')]};});_0x31760e[_0xe36e('0x4f')]=_[_0xe36e('0x4a')](_0x122704,_0xe36e('0x39'));_0x31760e[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x2265c4[_0xe36e('0x50')]);_0x31760e[_0xe36e('0x52')]=_['intersection'](_0x31760e['model'],_0x31760e[_0xe36e('0x50')]);_0x2e57f4['attributes']=_[_0xe36e('0x53')](_0x31760e[_0xe36e('0x4f')],qs[_0xe36e('0x54')](_0x2265c4[_0xe36e('0x50')]['fields']));_0x2e57f4[_0xe36e('0x55')]=_0x2e57f4[_0xe36e('0x55')]['length']?_0x2e57f4[_0xe36e('0x55')]:_0x31760e[_0xe36e('0x4f')];if(!_0x2265c4[_0xe36e('0x50')][_0xe36e('0x56')](_0xe36e('0x57'))){_0x2e57f4[_0xe36e('0x2c')]=qs[_0xe36e('0x2c')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x2c')]);_0x2e57f4[_0xe36e('0x2e')]=qs[_0xe36e('0x2e')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x2e57f4[_0xe36e('0x58')]=qs[_0xe36e('0x59')](_0x2265c4['query'][_0xe36e('0x59')]);_0x2e57f4['where']=qs['filters'](_[_0xe36e('0x5a')](_0x2265c4[_0xe36e('0x50')],_0x31760e['filters']),_0x122704);var _0x3ec864=[];var _0x3814eb=squel[_0xe36e('0x5b')]()[_0xe36e('0x5c')]('id')[_0xe36e('0x5c')](_0xe36e('0x39'))[_0xe36e('0x5c')](_0xe36e('0x5d'))[_0xe36e('0x5e')]('tools_tags');var _0x22117e=squel[_0xe36e('0x5b')]()['field'](_0xe36e('0x5f'))[_0xe36e('0x5c')](_0xe36e('0x60'))[_0xe36e('0x5c')](_0xe36e('0x61'))['from']('user_has_chat_interactions','ui')['left_join']('users','u',_0xe36e('0x62'));var _0x2fab4c=squel[_0xe36e('0x5b')]()[_0xe36e('0x5e')](_0xe36e('0x63'),'i')[_0xe36e('0x64')](_0xe36e('0x65'),'c',_0xe36e('0x66'))[_0xe36e('0x64')]('users','o',_0xe36e('0x67'))[_0xe36e('0x64')]('chat_websites','a',_0xe36e('0x68'))[_0xe36e('0x64')](_0xe36e('0x69'),'me',_0xe36e('0x6a'))[_0xe36e('0x64')](_0xe36e('0x6b'),'it',_0xe36e('0x6c'))[_0xe36e('0x64')](_0xe36e('0x6d'),'t',_0xe36e('0x6e'));var _0x56718a=squel[_0xe36e('0x6f')]();var _0x389e91=[];var _0x6f979f=squel[_0xe36e('0x6f')]();var _0x3e4860;if(_0x2265c4[_0xe36e('0x50')][_0xe36e('0x70')]){_0x3e4860=as[_0xe36e('0x71')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x70')]);var _0x432584=_0x3e4860[_0xe36e('0x72')];for(var _0x434d88=0x0;_0x434d88<_0x3e4860[_0xe36e('0x73')]['length'];_0x434d88++){var _0x429a01=_0x3e4860[_0xe36e('0x73')][_0x434d88];var _0x49336b='i';var _0xce5583=_[_0xe36e('0x74')](_0x122704,[_0xe36e('0x39'),_0x429a01[_0xe36e('0x5c')]]);if(!_0xce5583){switch(_0x429a01[_0xe36e('0x5c')]){case _0xe36e('0x75'):if(_0x429a01['value']==0x1){_0x2fab4c[_0xe36e('0x76')]('`'+_0x429a01['field']+_0xe36e('0x77'));}else{_0x2fab4c[_0xe36e('0x76')]('`'+_0x429a01[_0xe36e('0x5c')]+_0xe36e('0x78'));}break;case _0xe36e('0x79'):if(_0x429a01[_0xe36e('0x7a')]===_0xe36e('0x7b')){if(_0x429a01[_0xe36e('0x7c')]['split']('\x20')[_0xe36e('0x7d')]>0x1){_0x56718a[_0x432584](_0xe36e('0x7e'),qs['getFullTextValue'](_0x429a01[_0xe36e('0x7c')]),null);}else{var _0x2bf9ac='%'+_0x429a01[_0xe36e('0x7c')]+'%';_0x56718a[_0x432584](_0xe36e('0x7f'),_0x2bf9ac,_0x2bf9ac,_0x2bf9ac);}}else{_0xce5583=_[_0xe36e('0x74')](_0x122704,[_0xe36e('0x39'),_0xe36e('0x80')]);_0x429a01['field']=_0xe36e('0x80');_0x483e06=as[_0xe36e('0x81')](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);}break;case _0xe36e('0x84'):var _0xeab452=_0x429a01[_0xe36e('0x7c')]['split'](',')[_0xe36e('0x4a')](function(_0x9a77de){return Number(_0x9a77de);});_0xeab452[_0xe36e('0x47')](function(_0x2f05f5){_0x6f979f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2f05f5+',%');});_0x389e91=_['union'](_0x389e91,_0xeab452);break;case _0xe36e('0x85'):if(_0x429a01['operator']==='$substring'){_0x56718a[_0x432584]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x429a01[_0xe36e('0x7c')]+'%',null);}else{_0xce5583=_['find'](_0x122704,[_0xe36e('0x39'),_0xe36e('0x86')]);_0x429a01[_0xe36e('0x5c')]=_0xe36e('0x86');_0x483e06=as[_0xe36e('0x81')](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06['value'][_0xe36e('0x36')]);}break;case'body':_0x483e06=as[_0xe36e('0x81')]('me',null,_0x429a01);_0x56718a[_0x432584](_0x483e06['text'],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);break;}}else{var _0x483e06=as['buildExpression'](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);}}}else{var _0x57ae0d=_(_0x2265c4[_0xe36e('0x50')])[_0xe36e('0x51')]()['map'](function(_0xb83ea7){return _['some'](_0x122704,[_0xe36e('0x39'),_0xb83ea7])?_0xb83ea7:undefined;})[_0xe36e('0x87')]()[_0xe36e('0x7c')]();if(!_[_0xe36e('0x88')](_0x57ae0d)){_0x57ae0d['forEach'](function(_0x2d920e){if(_0x2d920e==='ChatWebsiteId'){_0x2fab4c['where'](_0xe36e('0x89'),[][_0xe36e('0x8a')](_0x2265c4['query'][_0x2d920e]));}else if(_0x2d920e==='createdAt'){var _0x460cc9=JSON['parse'](_0x2265c4[_0xe36e('0x50')][_0x2d920e])[_0xe36e('0x8b')];var _0x2c0ed5=JSON[_0xe36e('0x8c')](_0x2265c4[_0xe36e('0x50')][_0x2d920e])[_0xe36e('0x8d')];_0x2fab4c['where'](_0xe36e('0x8e'),_0x460cc9,_0x2c0ed5);}else{if(_0x2265c4[_0xe36e('0x50')][_0x2d920e]===_0xe36e('0x8f')){_0x2fab4c[_0xe36e('0x90')]('i.'+_0x2d920e+'\x20IS\x20NULL');}else{_0x2fab4c[_0xe36e('0x90')]('i.'+_0x2d920e+_0xe36e('0x91'),_0x2265c4[_0xe36e('0x50')][_0x2d920e]);}}});}if(_0x2265c4[_0xe36e('0x50')]['read']){if(_0x2265c4[_0xe36e('0x50')]['read']==0x1){_0x2fab4c[_0xe36e('0x76')]('`unreadMessages`\x20=\x200');}else{_0x2fab4c[_0xe36e('0x76')]('`unreadMessages`\x20>\x200');}}if(_0x2265c4['query'][_0xe36e('0x92')]){_0x389e91=_[_0xe36e('0x93')](_0x2265c4[_0xe36e('0x50')]['tag'])?_0x2265c4[_0xe36e('0x50')][_0xe36e('0x92')]:new Array(_0x2265c4['query'][_0xe36e('0x92')]);_0x389e91[_0xe36e('0x47')](function(_0x156e7f){_0x6f979f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x156e7f+',%');});}if(_0x2265c4['query'][_0xe36e('0x94')]){var _0x2ba37a=_0x2265c4[_0xe36e('0x50')][_0xe36e('0x94')][_0xe36e('0x95')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe36e('0x96')](_0x2ba37a)){_0x56718a['or'](_0xe36e('0x97'),_0x2ba37a+'%');}else{_0x56718a['or'](_0xe36e('0x98'),qs[_0xe36e('0x99')](_0x2ba37a))['or'](_0xe36e('0x9a'),_0x2ba37a+'%');}}}_0x2fab4c['where'](_0x56718a);_0x2fab4c[_0xe36e('0x9b')](_0xe36e('0x9c'));var _0x188dc9={'type':db['Sequelize'][_0xe36e('0x9d')]['SELECT'],'raw':!![]};var _0x2ee394=_0x2fab4c['clone']();_0x2ee394[_0xe36e('0x5c')](_0xe36e('0x9c'));_0x2ee394['field'](_0xe36e('0x9e'),'unreadMessages');if(_0x2e57f4[_0xe36e('0x58')]){_0x2e57f4[_0xe36e('0x58')][_0xe36e('0x47')](function(_0x201212){var _0x431aac=_0x201212[0x0]==='contactName'?_0x201212[0x0]:'i.'+_0x201212[0x0];_0x2fab4c[_0xe36e('0x58')](_0x431aac,_0x201212[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe36e('0x88')](_0x389e91)){_0x2fab4c[_0xe36e('0x76')](_0x6f979f);_0x2ee394[_0xe36e('0x90')](_0xe36e('0x9f'),_0x389e91);}BPromise[_0xe36e('0xa0')]()[_0xe36e('0x35')](function(){if(!_0x3e4860){if(_0x2265c4['query'][_0xe36e('0xa1')])return;_0x2ee394[_0xe36e('0x90')](_0xe36e('0xa2'));_0x2fab4c['where'](_0xe36e('0xa2'));return;}if(_0x2265c4[_0xe36e('0xa3')][_0xe36e('0xa4')]!==_0xe36e('0x3f'))return;return _0x2265c4['user'][_0xe36e('0xa5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x11ebdd){if(_['isEmpty'](_0x11ebdd)){_0x2ee394[_0xe36e('0x90')](_0xe36e('0xa6'));_0x2fab4c[_0xe36e('0x90')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x2ee394[_0xe36e('0x90')](_0xe36e('0x89'),_['map'](_0x11ebdd,'id'));_0x2fab4c[_0xe36e('0x90')](_0xe36e('0x89'),_[_0xe36e('0x4a')](_0x11ebdd,'id'));}});})['then'](function(){if(_0x2265c4['user'][_0xe36e('0xa4')]===_0xe36e('0x3f')&&!_0x3e4860&&!_0x2265c4[_0xe36e('0x50')][_0xe36e('0xa1')])return[];return db[_0xe36e('0xa7')]['query'](_0x2ee394[_0xe36e('0xa8')](),_0x188dc9);})[_0xe36e('0x35')](function(_0x2c923b){_0x569809[_0xe36e('0x2f')]=_0x2c923b['length'];if(_0x569809[_0xe36e('0x2f')]===0x0)return[];return db[_0xe36e('0xa7')]['query'](_0x3814eb['toString'](),_0x188dc9)['then'](function(_0x1acffb){_0x3ec864=_['keyBy'](_0x1acffb,'id');_0x188dc9=_['merge'](_0x188dc9,{'model':db[_0xe36e('0x4b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2265c4[_0xe36e('0x50')][_0xe36e('0x54')]){_0x2e57f4[_0xe36e('0x55')][_0xe36e('0x47')](function(_0x378126){_0x2fab4c['field']('i.'+_0x378126);});}else{_0x2fab4c[_0xe36e('0x5c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xa9'),_0xe36e('0xaa'));_0x2fab4c[_0xe36e('0x5c')]('a.mandatoryDisposition',_0xe36e('0xab'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xac'),_0xe36e('0xad'));_0x2fab4c['field'](_0xe36e('0xae'));_0x2fab4c['field'](_0xe36e('0xaf'),_0xe36e('0xb0'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb1'),_0xe36e('0xb2'));_0x2fab4c['field'](_0xe36e('0xb3'),_0xe36e('0xb4'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb5'),_0xe36e('0xb6'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb7'),_0xe36e('0xb8'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb9'),_0xe36e('0xba'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xbb'),'Owner.fullname');_0x2fab4c['field']('o.internal',_0xe36e('0xbc'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xbd'),_0xe36e('0x44'));}if(_0x2e57f4['limit'])_0x2fab4c[_0xe36e('0x2c')](_0x2e57f4[_0xe36e('0x2c')]);if(_0x2e57f4[_0xe36e('0x2e')])_0x2fab4c[_0xe36e('0x2e')](_0x2e57f4['offset']);return db[_0xe36e('0xa7')][_0xe36e('0x50')](_0x2fab4c[_0xe36e('0xa8')](),_0x188dc9);})[_0xe36e('0x35')](function(_0x515a79){if(_0x515a79['length']>0x0)_0x22117e[_0xe36e('0x90')](_0xe36e('0xbe'),_['map'](_0x515a79,'id'));return db['sequelize']['query'](_0x22117e[_0xe36e('0xa8')](),_0x188dc9)[_0xe36e('0x35')](function(_0xd57a9e){var _0x4d7f1a=_[_0xe36e('0xbf')](_0xd57a9e,_0xe36e('0xc0'));var _0x280812=[];_0x515a79[_0xe36e('0x47')](function(_0x5250c9){_0x280812[_0xe36e('0x48')](updateChatInteraction(_0x5250c9,_0x3ec864,_0x4d7f1a));});return BPromise[_0xe36e('0xc1')](_0x280812);});});})[_0xe36e('0x35')](function(_0x3b4152){_0x569809['rows']=_0x3b4152;return _0x569809;})[_0xe36e('0x35')](respondWithFilteredResult(_0x1dddfe,_0x2e57f4))['catch'](handleError(_0x1dddfe,null));};exports[_0xe36e('0xc2')]=function(_0x4c169c,_0x1c95cd){var _0x2b3e81={'raw':![],'where':{'id':_0x4c169c[_0xe36e('0xc3')]['id']}},_0x498822={};_0x498822[_0xe36e('0x4f')]=_['keys'](db[_0xe36e('0x4b')][_0xe36e('0x4c')]);_0x498822[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x4c169c[_0xe36e('0x50')]);_0x498822[_0xe36e('0x52')]=_['intersection'](_0x498822[_0xe36e('0x4f')],_0x498822[_0xe36e('0x50')]);_0x2b3e81['attributes']=_[_0xe36e('0x53')](_0x498822['model'],qs[_0xe36e('0x54')](_0x4c169c[_0xe36e('0x50')][_0xe36e('0x54')]));_0x2b3e81[_0xe36e('0x55')]=_0x2b3e81['attributes'][_0xe36e('0x7d')]?_0x2b3e81[_0xe36e('0x55')]:_0x498822[_0xe36e('0x4f')];if(_0x4c169c[_0xe36e('0x50')][_0xe36e('0xc4')]){_0x2b3e81['include']=[{'all':!![]}];}_0x2b3e81=_[_0xe36e('0x3c')]({},_0x2b3e81,_0x4c169c[_0xe36e('0xc5')]);return db['ChatInteraction']['find'](_0x2b3e81)[_0xe36e('0x35')](handleEntityNotFound(_0x1c95cd,null))['then'](respondWithResult(_0x1c95cd,null))[_0xe36e('0x29')](handleError(_0x1c95cd,null));};exports[_0xe36e('0xc6')]=function(_0x23dfd7,_0x3f9c84){return db[_0xe36e('0x4b')][_0xe36e('0xc6')](_0x23dfd7[_0xe36e('0x3d')],{})[_0xe36e('0x35')](respondWithResult(_0x3f9c84,0xc9))[_0xe36e('0x29')](handleError(_0x3f9c84,null));};exports[_0xe36e('0x34')]=function(_0x4ca2cc,_0xab0e50){if(_0x4ca2cc['body']['id']){delete _0x4ca2cc[_0xe36e('0x3d')]['id'];}return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x4ca2cc['params']['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0xab0e50,null))[_0xe36e('0x35')](saveUpdates(_0x4ca2cc['body'],null))[_0xe36e('0x35')](respondWithResult(_0xab0e50,null))['catch'](handleError(_0xab0e50,null));};exports[_0xe36e('0xc7')]=function(_0x3d14b1,_0x3246c6){return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x3d14b1[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x3246c6,null))[_0xe36e('0x35')](removeEntity(_0x3246c6,null))[_0xe36e('0x29')](handleError(_0x3246c6,null));};exports[_0xe36e('0xc8')]=function(_0x166c22,_0x47b082){return db['ChatInteraction'][_0xe36e('0xc8')]()[_0xe36e('0x35')](respondWithResult(_0x47b082,null))[_0xe36e('0x29')](handleError(_0x47b082,null));};exports[_0xe36e('0xc9')]=function(_0x5b3f98,_0xf38a08){var _0x24a0f6=_0x5b3f98['params']['id'];var _0x281519;var _0x4d12f6;var _0x260fff;return db[_0xe36e('0x4b')][_0xe36e('0xca')]({'where':{'id':_0x24a0f6}})['then'](function(_0x142caa){_0x281519=_0x142caa;return db[_0xe36e('0xcb')][_0xe36e('0xca')]({'where':{'id':_0x142caa[_0xe36e('0xa1')]},'attributes':['id',_0xe36e('0xcc'),_0xe36e('0xcd'),_0xe36e('0xce'),'vidaooNote',_0xe36e('0xcf')],'raw':!![]});})[_0xe36e('0x35')](function(_0x2d890a){if(_0x2d890a&&_0x2d890a[_0xe36e('0xcc')]&&_0x2d890a[_0xe36e('0xcd')]){_0x4d12f6=_0x2d890a;var _0x165372={'interaction':{'id':_0x24a0f6},'agent':{'id':_0x5b3f98[_0xe36e('0xa3')]['id'],'name':_0x5b3f98[_0xe36e('0xa3')][_0xe36e('0x39')],'fullname':_0x5b3f98['user'][_0xe36e('0x43')],'email':_0x5b3f98[_0xe36e('0xa3')]['email']},'contact':_0x5b3f98['body']['contact'],'account':_0x5b3f98[_0xe36e('0x3d')][_0xe36e('0x41')]};var _0x4ed60e={'rejectUnauthorized':![],'method':_0xe36e('0xd0'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2d890a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5b3f98['user'][_0xe36e('0xd1')]],'buttons':null,'topic':_0x4d12f6[_0xe36e('0xce')],'note':_['isNull'](_0x4d12f6[_0xe36e('0xd2')])?null:getMustacheRender(_0x4d12f6[_0xe36e('0xd2')],_0x165372),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe36e('0xd3')](_0x4d12f6[_0xe36e('0xcf')])){var _0x493407=getMustacheRender(_0x4d12f6[_0xe36e('0xcf')],_0x165372);var _0x3d451f=JSON['parse'](_0x493407);_0x4ed60e['body'][_0xe36e('0xd4')]=_0x3d451f;}}catch(_0x1e018b){throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xd7'));}return rp(_0x4ed60e);}else{throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xd8'));}})['then'](function(_0x44cf3d){_0x260fff=_0x44cf3d;if(_0x260fff['id']){var _0x7b1e8f={'body':_0x260fff[_0xe36e('0xd9')],'ChatWebsiteId':_0x4d12f6['id'],'ChatInteractionId':_0x281519['id'],'direction':'out','UserId':_0x5b3f98[_0xe36e('0xa3')]['id']};return db[_0xe36e('0xda')][_0xe36e('0xc6')](_0x7b1e8f,{});}else{throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xdb'));}})['then'](function(){return _0x281519[_0xe36e('0xdc')]({'vidaooSessionId':_0x260fff['id']});})[_0xe36e('0x35')](respondWithResult(_0xf38a08,null))['catch'](handleError(_0xf38a08,null));};exports['customUpdate']=function(_0x33f382,_0x4a6986){if(_0x33f382[_0xe36e('0x3d')]['id']){delete _0x33f382[_0xe36e('0x3d')]['id'];}return db['ChatInteraction'][_0xe36e('0x74')]({'where':{'id':_0x33f382[_0xe36e('0xc3')]['id']},'include':[{'model':db[_0xe36e('0xdd')],'as':_0xe36e('0x79')}]})['then'](handleEntityNotFound(_0x4a6986,null))['then'](saveUpdates(_0x33f382[_0xe36e('0x3d')],null))[_0xe36e('0x35')](respondWithResult(_0x4a6986,null))[_0xe36e('0x29')](handleError(_0x4a6986,null));};exports[_0xe36e('0xde')]=function(_0x15bf65,_0x2c2f12,_0x1ec6c5){if(_0x15bf65['body']['id']){delete _0x15bf65[_0xe36e('0x3d')]['id'];}return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x15bf65[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](function(_0x322fc4){if(!_0x322fc4){logger[_0xe36e('0x24')](_0xe36e('0xdf'),_0xe36e('0xde'),0x194,_0xe36e('0xe0'));_0x2c2f12[_0xe36e('0x37')](0x194);}else{if(_0x322fc4['UserId']){throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xe1'));}}return _0x322fc4;})[_0xe36e('0x35')](function(_0x478cc9){if(_0x478cc9){return _0x478cc9['update']({'closed':_0x15bf65[_0xe36e('0x3d')]['closed'],'disposition':_0x15bf65[_0xe36e('0x3d')]['disposition']})[_0xe36e('0x35')](function(_0x52de0f){return _0x52de0f;});}})[_0xe36e('0x35')](function(_0x30928a){return respondWithRpcPromise(_0xe36e('0xe2'),_0xe36e('0xde'),_0x15bf65[_0xe36e('0x3d')],client9004);})['then'](respondWithResult(_0x2c2f12,null))[_0xe36e('0x29')](handleError(_0x2c2f12,null));};exports[_0xe36e('0xe3')]=function(_0x3b8631,_0x5bf046,_0x4fc846){_0x3b8631[_0xe36e('0x3d')][_0xe36e('0x39')]=_0x3b8631['file'][_0xe36e('0xe4')];_0x3b8631['body'][_0xe36e('0xe5')]=_0x3b8631[_0xe36e('0xe6')][_0xe36e('0xe7')];_0x3b8631[_0xe36e('0x3d')][_0xe36e('0x4d')]=_0x3b8631[_0xe36e('0xe6')][_0xe36e('0xe8')];return db[_0xe36e('0xe9')][_0xe36e('0xc6')](_0x3b8631[_0xe36e('0x3d')])[_0xe36e('0x35')](respondWithResult(_0x5bf046,0xc9))[_0xe36e('0x29')](handleError(_0x5bf046,null));};exports[_0xe36e('0xea')]=function(_0x50cc85,_0x2ad011,_0x5466b8){return db[_0xe36e('0x4b')][_0xe36e('0xca')]({'where':{'id':_0x50cc85[_0xe36e('0xc3')]['id']},'raw':!![]})[_0xe36e('0x35')](handleEntityNotFound(_0x2ad011,null))[_0xe36e('0x35')](function(_0x57456d){if(_0x57456d){if(_0x57456d[_0xe36e('0xeb')]){return _0x2ad011[_0xe36e('0x2a')](0x193)[_0xe36e('0x2b')]({'status':0x193,'message':_0xe36e('0xec')});}return db[_0xe36e('0xe9')][_0xe36e('0xca')]({'where':{'id':_0x50cc85[_0xe36e('0x50')][_0xe36e('0xed')]},'raw':!![]})[_0xe36e('0x35')](handleEntityNotFound(_0x2ad011,null));}})[_0xe36e('0x35')](function(_0x1a380e){if(_0x1a380e){var _0xd786b8=_0x1a380e[_0xe36e('0xee')]!==null;var _0x38d16c=path['join'](config[_0xe36e('0xef')],_0xe36e('0xf0'));if(_0xd786b8){_0x38d16c=path['join'](_0x38d16c,_0xe36e('0xf1'));}var _0x512a19=path[_0xe36e('0xf2')](_0x38d16c,_0x1a380e['basename']);return _0x2ad011[_0xe36e('0xf3')](_0x512a19);}})[_0xe36e('0x29')](handleError(_0x2ad011,null));};exports[_0xe36e('0xf4')]=function(_0x153b4f,_0x5d2afc){var _0xeb0eb3=null;var _0x67afa3=null;var _0x2e0f59=null;var _0x2644c7=null;if(_0x153b4f[_0xe36e('0x3d')]['id']){delete _0x153b4f[_0xe36e('0x3d')]['id'];}if(_0x153b4f['body'][_0xe36e('0xf5')]){_0x2644c7=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server/files/chat/upload/',util['format'](_0xe36e('0xf6'),Date['now']()));_0x153b4f[_0xe36e('0x3d')]['pathTranscript']=_0x2644c7;}return db[_0xe36e('0x4b')]['find']({'where':{'id':_0x153b4f[_0xe36e('0xc3')]['id']},'include':[{'model':db[_0xe36e('0xda')],'as':_0xe36e('0xf7'),'include':[{'model':db[_0xe36e('0x85')],'as':_0xe36e('0x85')}]}]})[_0xe36e('0x35')](handleEntityNotFound(_0x5d2afc,null))['then'](saveUpdates(_0x153b4f['body'],null))[_0xe36e('0x35')](function(_0x26031e){if(_0x26031e){_0xeb0eb3=_0x26031e;return db[_0xe36e('0xcb')]['find']({'where':{'id':_0xeb0eb3[_0xe36e('0xa1')]}});}})[_0xe36e('0x35')](function(_0xc1d0bd){if(_0xc1d0bd){_0x2e0f59=_0xc1d0bd;return db[_0xe36e('0xdd')][_0xe36e('0x74')]({'where':{'id':_0xeb0eb3[_0xe36e('0x80')]}});}})[_0xe36e('0x35')](function(_0x518d30){if(_0x518d30){_0x67afa3=_0x518d30;if(_0x2644c7){var _0xfb015e=null;for(var _0xd2176=0x1;_0xd2176<_0xeb0eb3[_0xe36e('0xf7')]['length'];++_0xd2176){_0xfb015e=_0xeb0eb3[_0xe36e('0xf7')][_0xd2176];var _0x4727cd=_0xfb015e['UserId']?util[_0xe36e('0xf8')]('%s%d',_0x2e0f59['agentAlias'],_0xfb015e[_0xe36e('0x86')]):'System';var _0x3ac919=_0x153b4f[_0xe36e('0x3d')][_0xe36e('0xf9')]||util['format'](_0xe36e('0xfa'),_0xe36e('0xfb'),_0xfb015e[_0xe36e('0x80')]);switch(_0x2e0f59[_0xe36e('0xfc')]){case _0xe36e('0xfd'):_0x4727cd=_0xfb015e[_0xe36e('0x86')]?util[_0xe36e('0xf8')](_0xe36e('0xfa'),_0x2e0f59[_0xe36e('0xfe')],_0xfb015e[_0xe36e('0x86')]):_0xe36e('0xff');break;case _0xe36e('0x100'):_0x4727cd=_0xfb015e['UserId']?_0xfb015e[_0xe36e('0x85')][_0xe36e('0x101')]||_0xfb015e['User'][_0xe36e('0x43')]:_0xe36e('0xff');break;case'agent_fullname':_0x4727cd=_0xfb015e[_0xe36e('0x86')]?_0xfb015e[_0xe36e('0x85')]['fullname']:_0xe36e('0xff');break;default:_0x4727cd=_0xfb015e[_0xe36e('0x86')]?util[_0xe36e('0xf8')](_0xe36e('0xfa'),_0x2e0f59[_0xe36e('0xfe')],_0xfb015e[_0xe36e('0x86')]):_0xe36e('0xff');}var _0x332cd8=util[_0xe36e('0xf8')](_0xe36e('0x102'),moment(_0xfb015e['createdAt'])[_0xe36e('0xf8')](_0xe36e('0x103')),_0xfb015e['direction']==='in'?_0x3ac919:_0x4727cd,_0xfb015e[_0xe36e('0x3d')]);if(!_0xfb015e['secret']){fs['appendFileSync'](_0x2644c7,_0x332cd8);}}return db['MailAccount'][_0xe36e('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0xe36e('0x104')],'as':_0xe36e('0x105'),'raw':!![]}]});}}})[_0xe36e('0x35')](function(_0x154f52){if(_0x154f52&&_0x154f52['Smtp']&&_0x153b4f[_0xe36e('0x3d')]){var _0x34523d={'tls':{'rejectUnauthorized':![]}};if(_0x154f52['Smtp']['service']){_0x34523d[_0xe36e('0x106')]=_0x154f52[_0xe36e('0x105')][_0xe36e('0x106')];}else{_0x34523d[_0xe36e('0x107')]=_0x154f52['Smtp'][_0xe36e('0x107')];_0x34523d['port']=_0x154f52[_0xe36e('0x105')][_0xe36e('0x108')];_0x34523d[_0xe36e('0x109')]=_0x154f52['Smtp'][_0xe36e('0x109')];}if(_0x154f52['Smtp'][_0xe36e('0x10a')]){_0x34523d[_0xe36e('0x10b')]={'user':_0x154f52[_0xe36e('0x105')][_0xe36e('0xa3')],'pass':_0x154f52[_0xe36e('0x105')][_0xe36e('0x10c')]};}return respondWithRpcPromise(_0xe36e('0x10d'),'sendMail',{'account':_0x34523d,'message':{'from':util[_0xe36e('0xf8')](_0xe36e('0x10e'),_0x154f52['name'],_0x154f52[_0xe36e('0xd1')]||_0x154f52['Smtp'][_0xe36e('0xa3')]),'to':_0x153b4f['body'][_0xe36e('0xf5')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x153b4f[_0xe36e('0x3d')][_0xe36e('0xf5')]),'attachments':[{'path':_0x2644c7}]}})[_0xe36e('0x35')](function(){return _0xeb0eb3;})[_0xe36e('0x29')](function(_0x65e8ae){console[_0xe36e('0x24')](_0x65e8ae);});}else{return _0xeb0eb3;}})[_0xe36e('0x35')](respondWithStatusCode(_0x5d2afc,0xc8))[_0xe36e('0x29')](handleError(_0x5d2afc,null));};exports[_0xe36e('0x10f')]=function(_0x49225b,_0x214f23,_0x29883e){return db[_0xe36e('0xda')][_0xe36e('0x74')]({'where':{'id':_0x49225b[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x214f23,null))[_0xe36e('0x35')](function(_0xeb88eb){if(_0xeb88eb){return _0xeb88eb[_0xe36e('0x10f')](_0x49225b[_0xe36e('0x3d')]['ids'],_[_0xe36e('0x110')](_0x49225b['body'],[_0xe36e('0x111'),'id'])||{});}})[_0xe36e('0x35')](respondWithResult(_0x214f23,null))[_0xe36e('0x29')](handleError(_0x214f23,null));};exports[_0xe36e('0x112')]=function(_0x37282a,_0x5e7360,_0x4b4e4f){var _0x5583d8={'raw':![],'where':{}};var _0x542ae6={};var _0x2291e7={'count':0x0,'rows':[]};return db[_0xe36e('0x4b')]['findOne']({'where':{'id':_0x37282a[_0xe36e('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5e7360,null))['then'](function(_0x12e580){if(_0x12e580){_0x542ae6['model']=_[_0xe36e('0x51')](db[_0xe36e('0xda')]['rawAttributes']);_0x542ae6[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x37282a['query']);_0x542ae6[_0xe36e('0x52')]=_[_0xe36e('0x53')](_0x542ae6[_0xe36e('0x4f')],_0x542ae6[_0xe36e('0x50')]);_0x5583d8[_0xe36e('0x55')]=_[_0xe36e('0x53')](_0x542ae6[_0xe36e('0x4f')],qs['fields'](_0x37282a[_0xe36e('0x50')][_0xe36e('0x54')]));_0x5583d8['attributes']=_0x5583d8['attributes'][_0xe36e('0x7d')]?_0x5583d8[_0xe36e('0x55')]:_0x542ae6['model'];if(!_0x37282a[_0xe36e('0x50')][_0xe36e('0x56')](_0xe36e('0x57'))){_0x5583d8[_0xe36e('0x2c')]=qs[_0xe36e('0x2c')](_0x37282a[_0xe36e('0x50')]['limit']);_0x5583d8['offset']=qs['offset'](_0x37282a[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x5583d8['order']=qs[_0xe36e('0x59')](_0x37282a['query'][_0xe36e('0x59')]);_0x5583d8[_0xe36e('0x90')]=qs['filters'](_[_0xe36e('0x5a')](_0x37282a[_0xe36e('0x50')],_0x542ae6[_0xe36e('0x52')]));_0x5583d8[_0xe36e('0x90')]['ChatInteractionId']=_0x12e580['id'];if(_0x37282a[_0xe36e('0x50')][_0xe36e('0x94')]){_0x5583d8[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x5583d8[_0xe36e('0x90')],{'$or':_['map'](_0x5583d8['attributes'],function(_0xb40daf){var _0x584f19={};_0x584f19[_0xb40daf]={'$like':'%'+_0x37282a['query'][_0xe36e('0x94')]+'%'};return _0x584f19;})});}if(_0x37282a[_0xe36e('0x50')][_0xe36e('0x8b')]){var _0x2ee22b=_0x37282a[_0xe36e('0x50')][_0xe36e('0x8b')][_0xe36e('0x46')](',');var _0x2cfaee={};_0x2cfaee[_0x2ee22b[0x0]]={'$gte':moment(_0x2ee22b[0x1])[_0xe36e('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5583d8[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x5583d8[_0xe36e('0x90')],_0x2cfaee);}_0x5583d8=_[_0xe36e('0x3c')]({},_0x5583d8,_0x37282a[_0xe36e('0xc5')]);return db[_0xe36e('0xda')][_0xe36e('0x2f')]({'where':_0x5583d8['where']})[_0xe36e('0x35')](function(_0x3f0fd2){_0x2291e7[_0xe36e('0x2f')]=_0x3f0fd2;if(_0x37282a[_0xe36e('0x50')][_0xe36e('0xc4')]){_0x5583d8[_0xe36e('0x113')]=[{'all':!![]}];}return db[_0xe36e('0xda')][_0xe36e('0x114')](_0x5583d8);})[_0xe36e('0x35')](function(_0x2c85c5){_0x2291e7[_0xe36e('0x115')]=_0x2c85c5;return _0x2291e7;});}})[_0xe36e('0x35')](respondWithFilteredResult(_0x5e7360,_0x5583d8))[_0xe36e('0x29')](handleError(_0x5e7360,null));};exports[_0xe36e('0x116')]=function(_0x545f90,_0x2291d1,_0x3ccaa5){var _0x19f952={'where':{}},_0x3e706e={},_0x51cea0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe36e('0xca')]({'where':{'id':_0x545f90['params']['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x2291d1,null))['then'](function(_0x21ffc7){if(_0x21ffc7){_0x3e706e[_0xe36e('0x4f')]=_['keys'](db[_0xe36e('0xda')][_0xe36e('0x4c')]);_0x3e706e[_0xe36e('0x50')]=_['keys'](_0x545f90[_0xe36e('0x50')]);_0x3e706e[_0xe36e('0x52')]=_[_0xe36e('0x53')](_0x3e706e[_0xe36e('0x4f')],_0x3e706e[_0xe36e('0x50')]);_0x19f952['attributes']=_[_0xe36e('0x53')](_0x3e706e[_0xe36e('0x4f')],qs[_0xe36e('0x54')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x54')]));_0x19f952['attributes']=_0x19f952[_0xe36e('0x55')][_0xe36e('0x7d')]?_0x19f952[_0xe36e('0x55')]:_0x3e706e[_0xe36e('0x4f')];if(!_0x545f90[_0xe36e('0x50')]['hasOwnProperty'](_0xe36e('0x57'))){_0x19f952['limit']=qs[_0xe36e('0x2c')](_0x545f90['query'][_0xe36e('0x2c')]);_0x19f952[_0xe36e('0x2e')]=qs[_0xe36e('0x2e')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x19f952[_0xe36e('0x58')]=qs[_0xe36e('0x59')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x59')]);_0x19f952[_0xe36e('0x90')]=qs[_0xe36e('0x52')](_[_0xe36e('0x5a')](_0x545f90[_0xe36e('0x50')],_0x3e706e['filters']));_0x19f952['where'][_0xe36e('0xc0')]=_0x21ffc7['id'];if(_0x545f90[_0xe36e('0x50')][_0xe36e('0x94')]){_0x19f952[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x19f952[_0xe36e('0x90')],{'$or':_[_0xe36e('0x4a')](_0x19f952[_0xe36e('0x55')],function(_0x82c1ae){var _0x5f22b7={};_0x5f22b7[_0x82c1ae]={'$like':'%'+_0x545f90[_0xe36e('0x50')][_0xe36e('0x94')]+'%'};return _0x5f22b7;})});}_0x19f952['where']['secret']=![];if(_0x545f90[_0xe36e('0x50')]['id']){_0x19f952[_0xe36e('0x90')]['id']={'$gt':_0x545f90[_0xe36e('0x50')]['id']};}_0x19f952=_[_0xe36e('0x3c')]({},_0x19f952,_0x545f90['options']);return db[_0xe36e('0xda')]['count']({'where':_0x19f952[_0xe36e('0x90')]})[_0xe36e('0x35')](function(_0x150c17){_0x51cea0[_0xe36e('0x2f')]=_0x150c17;_0x19f952[_0xe36e('0x113')]=[];if(_0x545f90[_0xe36e('0x50')][_0xe36e('0x117')]){_0x19f952['include'][_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':'User','attributes':['id',_0xe36e('0x43'),_0xe36e('0x101')]});}if(_0x545f90[_0xe36e('0x50')]['includeAll']){_0x19f952[_0xe36e('0x113')]=[{'all':!![]}];}return db[_0xe36e('0xda')][_0xe36e('0x114')](_0x19f952);})['then'](function(_0x4553ac){_0x51cea0[_0xe36e('0x115')]=_0x4553ac;return _0x51cea0;});}})['then'](respondWithFilteredResult(_0x2291d1,_0x19f952))[_0xe36e('0x29')](handleError(_0x2291d1,null));};exports['addTags']=function(_0x2cba34,_0x1e7118,_0x4b8d01){return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x2cba34['params']['id']}})['then'](handleEntityNotFound(_0x1e7118,null))[_0xe36e('0x35')](function(_0x4284aa){if(_0x4284aa){return _0x4284aa['setTags'](_0x2cba34['body'][_0xe36e('0x111')],_[_0xe36e('0x110')](_0x2cba34[_0xe36e('0x3d')],[_0xe36e('0x111'),'id'])||{})[_0xe36e('0x118')](function(){return db[_0xe36e('0x84')][_0xe36e('0x114')]({'attributes':['id','name',_0xe36e('0x5d')],'where':{'id':_0x2cba34[_0xe36e('0x3d')][_0xe36e('0x111')]}});})[_0xe36e('0x35')](function(_0x464128){socket[_0xe36e('0x119')](_0xe36e('0x11a'),{'id':Number(_0x2cba34[_0xe36e('0xc3')]['id']),'tags':_0x464128||[]});return{'id':Number(_0x2cba34['params']['id']),'tags':_0x464128||[]};});}})['then'](respondWithResult(_0x1e7118,null))[_0xe36e('0x29')](handleError(_0x1e7118,null));};exports[_0xe36e('0x11b')]=function(_0x262797,_0x40f9f1,_0x457c8e){return db[_0xe36e('0x4b')]['find']({'where':{'id':_0x262797[_0xe36e('0xc3')]['id']}})['then'](handleEntityNotFound(_0x40f9f1,null))['then'](function(_0x31fb7a){if(_0x31fb7a){return _0x31fb7a['removeTags'](_0x262797[_0xe36e('0x50')][_0xe36e('0x111')]);}})[_0xe36e('0x35')](respondWithStatusCode(_0x40f9f1,null))[_0xe36e('0x29')](handleError(_0x40f9f1,null));};exports[_0xe36e('0xf3')]=function(_0x20a347,_0x2c1324){var _0xa7ef59=moment()[_0xe36e('0x11c')]()[_0xe36e('0xa8')]();var _0x3a4701=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server',_0xe36e('0x11d'),'tmp');var _0x1cab01=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server',_0xe36e('0x11d'),_0xe36e('0x11e'));var _0x6c8c82=path[_0xe36e('0xf2')](_0x3a4701,_0xa7ef59);var _0x71c885=util['format'](_0xe36e('0x11f'),_0x20a347[_0xe36e('0xc3')]['id'],_0xa7ef59);var _0x29393a=path[_0xe36e('0xf2')](_0x3a4701,_0x71c885);var _0x4e7b14=[];_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':_0xe36e('0x85'),'attributes':['id',_0xe36e('0x43')],'raw':!![]});_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0xdd')],'as':_0xe36e('0x79'),'attributes':['id',_0xe36e('0x120'),_0xe36e('0x121')],'raw':!![]});if(_0x20a347[_0xe36e('0x50')]['attachments']){_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0xe9')],'as':'Attachment','raw':!![]});}var _0xecb02b=[{'model':db[_0xe36e('0xda')],'as':_0xe36e('0xf7'),'attributes':['id',_0xe36e('0x3d'),_0xe36e('0x122'),_0xe36e('0x123'),_0xe36e('0x124'),_0xe36e('0x125')],'include':_0x4e7b14}];_0xecb02b[_0xe36e('0x48')]({'model':db[_0xe36e('0xcb')],'as':'Account','attributes':['id',_0xe36e('0x39')]});_0xecb02b[_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':_0xe36e('0x126'),'attributes':['id',_0xe36e('0x43')]});return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x20a347[_0xe36e('0xc3')]['id']},'include':_0xecb02b})[_0xe36e('0x35')](handleEntityNotFound(_0x2c1324,null))[_0xe36e('0x35')](function(_0x4197e9){if(_0x4197e9){var _0x35c442=_0x4197e9[_0xe36e('0x127')]({'plain':!![]});fs['mkdirSync'](_0x6c8c82);var _0x343ad8={'channel':'Chat','account':_0x35c442[_0xe36e('0x128')][_0xe36e('0x39')],'agent':_0x35c442[_0xe36e('0x126')]?_0x35c442[_0xe36e('0x126')]['fullname']:_0xe36e('0x129'),'createdAt':moment(_0x35c442[_0xe36e('0x122')])['format'](_0xe36e('0x12a'))[_0xe36e('0xa8')](),'closedAt':_0x35c442[_0xe36e('0xeb')]?moment(_0x35c442[_0xe36e('0x12b')])[_0xe36e('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe36e('0xa8')]():'','disposition':_0x35c442[_0xe36e('0x12c')],'chatInfo':{'browser':_0x35c442['browserName'],'os':_0x35c442[_0xe36e('0x12d')],'referer':_0x35c442[_0xe36e('0x12e')],'customerIp':_0x35c442[_0xe36e('0x12f')],'customerPort':_0x35c442['customerPort']?_0x35c442['customerPort']:'N.A.'},'messages':_(_0x35c442[_0xe36e('0xf7')])['tail']()[_0xe36e('0x94')]({'secret':![]})['map'](function(_0x59156b){if(_0x59156b[_0xe36e('0xe9')]){var _0x52719b=path[_0xe36e('0xf2')](_0x1cab01,_0x59156b['Attachment'][_0xe36e('0xe5')]);if(fs['existsSync'](_0x52719b)){fs[_0xe36e('0x130')](_0x52719b)[_0xe36e('0x131')](fs[_0xe36e('0x132')](path[_0xe36e('0xf2')](_0x6c8c82,_0x59156b[_0xe36e('0xe9')][_0xe36e('0xe5')])));}}return{'date':moment(_0x59156b[_0xe36e('0x122')])[_0xe36e('0xf8')](_0xe36e('0x12a'))[_0xe36e('0xa8')](),'sender':_0x59156b[_0xe36e('0x123')]===_0xe36e('0x133')?_0x59156b['User']?_0x59156b[_0xe36e('0x85')][_0xe36e('0x43')]:_0xe36e('0xff'):_0x59156b[_0xe36e('0x79')]['firstName']+(_0x59156b[_0xe36e('0x79')][_0xe36e('0x121')]?'\x20'+_0x59156b[_0xe36e('0x79')]['lastName']:''),'body':_0x59156b['Attachment']?_0x59156b[_0xe36e('0xe9')][_0xe36e('0xe5')]:_0x59156b['body'],'direction':_0x59156b[_0xe36e('0x123')]===_0xe36e('0x133')?'A':'C','secret':_0x59156b['secret'],'read':_0x59156b[_0xe36e('0x125')],'attachment':_0x59156b[_0xe36e('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xe36e('0xf2')](config[_0xe36e('0xef')],_0xe36e('0x134'),_0xe36e('0x135'),_0xe36e('0x136')),{'interaction':_0x343ad8})[_0xe36e('0x35')](function(_0x340915){var _0x5370b9=path['join'](_0x6c8c82,'transcript-'+_0x35c442['id']+'-'+_0xa7ef59+'.pdf');var _0x16b769={'path':_0x5370b9,'channel':'Chat','interactionId':_0x35c442['id']};return pdf['createPdfFromHTML'](_0x340915,_0x16b769);})[_0xe36e('0x35')](function(){return new BPromise(function(_0x36706c,_0x5e7f24){zipdir(_0x6c8c82,{'saveTo':_0x29393a},function(_0x5e19e2,_0x2a89b0){if(_0x5e19e2)return _0x5e7f24(_0x5e19e2);return _0x36706c(_0x2a89b0);});})[_0xe36e('0x35')](function(){return new BPromise(function(_0xf70d66,_0x2c0371){rimraf(_0x6c8c82,function(_0x59de53){if(_0x59de53)_0x2c0371(_0x59de53);return _0xf70d66();});});})[_0xe36e('0x35')](function(){return _0x2c1324['download'](_0x29393a,_0x71c885,function(_0x47e24c){if(_0x47e24c){console[_0xe36e('0x137')](_0xe36e('0x138'),_0x47e24c);}else{fs[_0xe36e('0x139')](_0x29393a);}});});});}else{return _0x2c1324[_0xe36e('0x37')](0xc8);}})[_0xe36e('0x29')](handleError(_0x2c1324,null));};
\ No newline at end of file
+var _0xd943=['Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','server','views','downloadInteraction.ejs','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','Content-Range','reject','save','update','destroy','stack','name','send','render','body','contact','agent','account','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','authentication','auth','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript'];(function(_0x2d3a8c,_0x5f4f76){var _0x95bfa9=function(_0x30be22){while(--_0x30be22){_0x2d3a8c['push'](_0x2d3a8c['shift']());}};_0x95bfa9(++_0x5f4f76);}(_0xd943,0x15d));var _0x3d94=function(_0x4666d8,_0x4b7be9){_0x4666d8=_0x4666d8-0x0;var _0x39cc49=_0xd943[_0x4666d8];return _0x39cc49;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3d94('0x10'));var hardwareService=require(_0x3d94('0x11'));var logger=require('../../config/logger')(_0x3d94('0x12'));var utils=require(_0x3d94('0x13'));var config=require(_0x3d94('0x14'));var licenseUtil=require(_0x3d94('0x15'));var db=require(_0x3d94('0x16'))['db'];config['redis']=_[_0x3d94('0x17')](config[_0x3d94('0x18')],{'host':_0x3d94('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d94('0x18')]));require(_0x3d94('0x1a'))[_0x3d94('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232b});var client9004=jayson[_0x3d94('0x1c')][_0x3d94('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xaf939a,_0xd8efaa,_0x31c6e8,_0x9893cb){return new BPromise(function(_0x540658,_0x22676a){var _0x1a9315=_0x9893cb||client;return _0x1a9315[_0x3d94('0x1e')](_0xaf939a,_0x31c6e8)[_0x3d94('0x1f')](function(_0x4afc92){logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,'request\x20sent');logger[_0x3d94('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd8efaa,_0x3d94('0x23'),JSON[_0x3d94('0x24')](_0x4afc92));if(_0x4afc92[_0x3d94('0x25')]){if(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x26')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x22676a(_0x4afc92[_0x3d94('0x25')]['message']);}logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);return _0x540658(_0x4afc92[_0x3d94('0x25')][_0x3d94('0x27')]);}else{logger[_0x3d94('0x20')](_0x3d94('0x21'),_0xd8efaa,_0x3d94('0x23'));_0x540658(_0x4afc92[_0x3d94('0x28')][_0x3d94('0x27')]);}})[_0x3d94('0x29')](function(_0x292976){logger[_0x3d94('0x25')](_0x3d94('0x21'),_0xd8efaa,_0x292976);_0x22676a(_0x292976);});});}function respondWithStatusCode(_0x5b3b31,_0x123183){_0x123183=_0x123183||0xcc;return function(_0x558fd2){if(_0x558fd2){return _0x5b3b31[_0x3d94('0x2a')](_0x123183);}return _0x5b3b31[_0x3d94('0x2b')](_0x123183)[_0x3d94('0x2c')]();};}function respondWithResult(_0x439173,_0x13254f){_0x13254f=_0x13254f||0xc8;return function(_0x82b568){if(_0x82b568){return _0x439173[_0x3d94('0x2b')](_0x13254f)['json'](_0x82b568);}};}function respondWithFilteredResult(_0x584c4a,_0x362642){return function(_0x4813e1){if(_0x4813e1){var _0x4dd410=typeof _0x362642[_0x3d94('0x2d')]==='undefined'&&typeof _0x362642[_0x3d94('0x2e')]===_0x3d94('0x2f');var _0x32403a=_0x4813e1['count'];var _0x2a07b4=_0x4dd410?0x0:_0x362642['offset'];var _0x3d4994=_0x4dd410?_0x4813e1['count']:_0x362642[_0x3d94('0x2d')]+_0x362642[_0x3d94('0x2e')];var _0x29b1ff;if(_0x3d4994>=_0x32403a){_0x3d4994=_0x32403a;_0x29b1ff=0xc8;}else{_0x29b1ff=0xce;}_0x584c4a[_0x3d94('0x2b')](_0x29b1ff);return _0x584c4a['set'](_0x3d94('0x30'),_0x2a07b4+'-'+_0x3d4994+'/'+_0x32403a)['json'](_0x4813e1);}return null;};}function patchUpdates(_0x1f9559){return function(_0xd294fd){try{jsonpatch['apply'](_0xd294fd,_0x1f9559,!![]);}catch(_0x5288da){return BPromise[_0x3d94('0x31')](_0x5288da);}return _0xd294fd[_0x3d94('0x32')]();};}function saveUpdates(_0x273337,_0x5cdb2e){return function(_0x1e6dbc){if(_0x1e6dbc){return _0x1e6dbc[_0x3d94('0x33')](_0x273337)['then'](function(_0x242500){return _0x242500;});}return null;};}function removeEntity(_0x23f3fe,_0x35947b){return function(_0xbda334){if(_0xbda334){return _0xbda334[_0x3d94('0x34')]()['then'](function(){_0x23f3fe[_0x3d94('0x2b')](0xcc)[_0x3d94('0x2c')]();});}};}function handleEntityNotFound(_0x41579e,_0x52bdb9){return function(_0xb493f1){if(!_0xb493f1){_0x41579e[_0x3d94('0x2a')](0x194);}return _0xb493f1;};}function handleError(_0x546658,_0x555ec5){_0x555ec5=_0x555ec5||0x1f4;return function(_0xfe58eb){logger[_0x3d94('0x25')](_0xfe58eb[_0x3d94('0x35')]);if(_0xfe58eb[_0x3d94('0x36')]){delete _0xfe58eb[_0x3d94('0x36')];}_0x546658[_0x3d94('0x2b')](_0x555ec5)[_0x3d94('0x37')](_0xfe58eb);};}function getMustacheRender(_0x12c01a,_0x2e7b97){return Mustache[_0x3d94('0x38')](_0x12c01a,_['merge'](_0x2e7b97[_0x3d94('0x39')],{'contact':_0x2e7b97[_0x3d94('0x3a')],'message':_0x2e7b97[_0x3d94('0x27')],'agent':_0x2e7b97[_0x3d94('0x3b')],'interaction':_0x2e7b97['interaction'],'account':_0x2e7b97[_0x3d94('0x3c')]}))||'';}function getInteractionUsers(_0x2bf3b2,_0x35e0e6){return new BPromise(function(_0x29eaa4,_0x22b7d2){try{if(_0x35e0e6[_0x2bf3b2['id']]){_0x2bf3b2['Users']=_[_0x3d94('0x3d')](_0x35e0e6[_0x2bf3b2['id']],function(_0x462ab6){return{'id':_0x462ab6['id'],'fullname':_0x462ab6[_0x3d94('0x3e')]};});}}catch(_0x485066){_0x22b7d2(_0x485066);}_0x29eaa4(_0x2bf3b2);});}function getInteractionTags(_0x4eee4d,_0x4d8a8f){return new BPromise(function(_0x47905e,_0x3b3550){try{if(_0x4eee4d[_0x3d94('0x3f')]){_0x4eee4d[_0x3d94('0x40')]=[];_0x4eee4d[_0x3d94('0x3f')][_0x3d94('0x41')](',')[_0x3d94('0x42')](function(_0x3a3898){_0x4eee4d['Tags']['push'](_0x4d8a8f[_0x3a3898]);});}delete _0x4eee4d[_0x3d94('0x3f')];}catch(_0x3ced26){_0x3b3550(_0x3ced26);}_0x47905e(_0x4eee4d);});}function updateChatInteraction(_0x512cef,_0x2d0aa2,_0x4af4b6){return new BPromise(function(_0x1361fb,_0x411b5b){return getInteractionUsers(_0x512cef,_0x4af4b6)[_0x3d94('0x1f')](function(_0xacfc44){return getInteractionTags(_0xacfc44,_0x2d0aa2);})[_0x3d94('0x1f')](function(_0x5a9263){_0x1361fb(_0x5a9263);})[_0x3d94('0x29')](function(_0x168771){_0x411b5b(_0x168771);});});}exports[_0x3d94('0x43')]=function(_0x5d5c66,_0x2910ea){var _0x555366={},_0x4bad90={},_0x3f4b32={'count':0x0,'rows':[]};var _0x402132=_[_0x3d94('0x3d')](db[_0x3d94('0x44')]['rawAttributes'],function(_0x323d58){return{'name':_0x323d58['fieldName'],'type':_0x323d58[_0x3d94('0x45')][_0x3d94('0x46')]};});_0x4bad90[_0x3d94('0x47')]=_[_0x3d94('0x3d')](_0x402132,_0x3d94('0x36'));_0x4bad90[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x5d5c66['query']);_0x4bad90[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4bad90['model'],_0x4bad90['query']);_0x555366[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4bad90['model'],qs[_0x3d94('0x4d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x555366[_0x3d94('0x4c')]=_0x555366[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x555366[_0x3d94('0x4c')]:_0x4bad90[_0x3d94('0x47')];if(!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x555366[_0x3d94('0x2e')]=qs[_0x3d94('0x2e')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x555366['offset']=qs[_0x3d94('0x2d')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x555366[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x52')]);_0x555366[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_['pick'](_0x5d5c66[_0x3d94('0x48')],_0x4bad90['filters']),_0x402132);var _0x174eb3=[];var _0x3a7eb0=squel['select']()[_0x3d94('0x54')]('id')['field']('name')[_0x3d94('0x54')]('color')[_0x3d94('0x55')](_0x3d94('0x56'));var _0x5b6061=squel[_0x3d94('0x57')]()['field']('u.id')[_0x3d94('0x54')](_0x3d94('0x58'))[_0x3d94('0x54')](_0x3d94('0x59'))[_0x3d94('0x55')](_0x3d94('0x5a'),'ui')[_0x3d94('0x5b')](_0x3d94('0x5c'),'u',_0x3d94('0x5d'));var _0x584e1d=squel[_0x3d94('0x57')]()[_0x3d94('0x55')](_0x3d94('0x5e'),'i')[_0x3d94('0x5b')](_0x3d94('0x5f'),'c',_0x3d94('0x60'))[_0x3d94('0x5b')](_0x3d94('0x5c'),'o',_0x3d94('0x61'))[_0x3d94('0x5b')](_0x3d94('0x62'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3d94('0x5b')]('chat_messages','me',_0x3d94('0x63'))[_0x3d94('0x5b')](_0x3d94('0x64'),'it',_0x3d94('0x65'))[_0x3d94('0x5b')](_0x3d94('0x56'),'t',_0x3d94('0x66'));var _0x169aa1=squel[_0x3d94('0x67')]();var _0x5da38c=[];var _0x519ada=squel[_0x3d94('0x67')]();var _0x4bd97c;if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]){_0x4bd97c=as['parseSearch'](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x68')]);var _0x3cb8f4=_0x4bd97c[_0x3d94('0x69')];for(var _0xcefff5=0x0;_0xcefff5<_0x4bd97c[_0x3d94('0x6a')][_0x3d94('0x4e')];_0xcefff5++){var _0x4b023e=_0x4bd97c[_0x3d94('0x6a')][_0xcefff5];var _0x351ea6='i';var _0x368581=_['find'](_0x402132,[_0x3d94('0x36'),_0x4b023e[_0x3d94('0x54')]]);if(!_0x368581){switch(_0x4b023e[_0x3d94('0x54')]){case _0x3d94('0x6b'):if(_0x4b023e['value']==0x1){_0x584e1d['having']('`'+_0x4b023e[_0x3d94('0x54')]+_0x3d94('0x6c'));}else{_0x584e1d[_0x3d94('0x6d')]('`'+_0x4b023e[_0x3d94('0x54')]+'`\x20>\x200');}break;case _0x3d94('0x6e'):if(_0x4b023e[_0x3d94('0x6f')]==='$substring'){if(_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')]('\x20')[_0x3d94('0x4e')]>0x1){_0x169aa1[_0x3cb8f4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3d94('0x71')](_0x4b023e[_0x3d94('0x70')]),null);}else{var _0x585531='%'+_0x4b023e['value']+'%';_0x169aa1[_0x3cb8f4](_0x3d94('0x72'),_0x585531,_0x585531,_0x585531);}}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','ContactId']);_0x4b023e['field']=_0x3d94('0x74');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')]['start'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case _0x3d94('0x77'):var _0x1e8e3d=_0x4b023e[_0x3d94('0x70')][_0x3d94('0x41')](',')['map'](function(_0x30673a){return Number(_0x30673a);});_0x1e8e3d['forEach'](function(_0x1f3551){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x1f3551+',%');});_0x5da38c=_[_0x3d94('0x79')](_0x5da38c,_0x1e8e3d);break;case _0x3d94('0x7a'):if(_0x4b023e[_0x3d94('0x6f')]===_0x3d94('0x7b')){_0x169aa1[_0x3cb8f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4b023e['value']+'%',null);}else{_0x368581=_[_0x3d94('0x73')](_0x402132,['name','UserId']);_0x4b023e['field']=_0x3d94('0x7c');_0x55084e=as[_0x3d94('0x75')](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x2c')]);}break;case'body':_0x55084e=as[_0x3d94('0x75')]('me',null,_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e['text'],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);break;}}else{var _0x55084e=as['buildExpression'](_0x351ea6,_0x368581[_0x3d94('0x45')],_0x4b023e);_0x169aa1[_0x3cb8f4](_0x55084e[_0x3d94('0x76')],_0x55084e[_0x3d94('0x70')][_0x3d94('0x7d')],_0x55084e[_0x3d94('0x70')]['end']);}}}else{var _0x5b7316=_(_0x5d5c66[_0x3d94('0x48')])[_0x3d94('0x49')]()[_0x3d94('0x3d')](function(_0x57a4df){return _[_0x3d94('0x7e')](_0x402132,['name',_0x57a4df])?_0x57a4df:undefined;})[_0x3d94('0x7f')]()[_0x3d94('0x70')]();if(!_[_0x3d94('0x80')](_0x5b7316)){_0x5b7316[_0x3d94('0x42')](function(_0x3b42c8){if(_0x3b42c8===_0x3d94('0x81')){_0x584e1d[_0x3d94('0x53')](_0x3d94('0x82'),[][_0x3d94('0x83')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]));}else if(_0x3b42c8===_0x3d94('0x84')){var _0xe6cfd1=JSON[_0x3d94('0x85')](_0x5d5c66['query'][_0x3b42c8])[_0x3d94('0x86')];var _0x2819e2=JSON[_0x3d94('0x85')](_0x5d5c66[_0x3d94('0x48')][_0x3b42c8])['$lte'];_0x584e1d[_0x3d94('0x53')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xe6cfd1,_0x2819e2);}else{if(_0x5d5c66['query'][_0x3b42c8]===_0x3d94('0x87')){_0x584e1d['where']('i.'+_0x3b42c8+_0x3d94('0x88'));}else{_0x584e1d[_0x3d94('0x53')]('i.'+_0x3b42c8+'\x20=\x20?',_0x5d5c66[_0x3d94('0x48')][_0x3b42c8]);}}});}if(_0x5d5c66['query'][_0x3d94('0x89')]){if(_0x5d5c66[_0x3d94('0x48')]['read']==0x1){_0x584e1d['having']('`unreadMessages`\x20=\x200');}else{_0x584e1d[_0x3d94('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5d5c66['query'][_0x3d94('0x8a')]){_0x5da38c=_[_0x3d94('0x8b')](_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')])?_0x5d5c66['query'][_0x3d94('0x8a')]:new Array(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8a')]);_0x5da38c[_0x3d94('0x42')](function(_0x38b411){_0x519ada['or'](_0x3d94('0x78'),'%,'+_0x38b411+',%');});}if(_0x5d5c66['query'][_0x3d94('0x8c')]){var _0x6cfc19=_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x8c')][_0x3d94('0x8d')]('\x5c','\x5c\x5c')[_0x3d94('0x8d')](/'/g,'\x27\x27');if(qs[_0x3d94('0x8e')](_0x6cfc19)){_0x169aa1['or'](_0x3d94('0x8f'),_0x6cfc19+'%');}else{_0x169aa1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6cfc19))['or'](_0x3d94('0x90'),_0x6cfc19+'%');}}}_0x584e1d[_0x3d94('0x53')](_0x169aa1);_0x584e1d[_0x3d94('0x91')]('i.id');var _0x43a00e={'type':db[_0x3d94('0x92')][_0x3d94('0x93')][_0x3d94('0x94')],'raw':!![]};var _0x860ee5=_0x584e1d['clone']();_0x860ee5['field'](_0x3d94('0x95'));_0x860ee5[_0x3d94('0x54')](_0x3d94('0x96'),_0x3d94('0x6b'));if(_0x555366[_0x3d94('0x51')]){_0x555366[_0x3d94('0x51')][_0x3d94('0x42')](function(_0x3bcc86){var _0x462e88=_0x3bcc86[0x0]===_0x3d94('0x97')?_0x3bcc86[0x0]:'i.'+_0x3bcc86[0x0];_0x584e1d[_0x3d94('0x51')](_0x462e88,_0x3bcc86[0x1]===_0x3d94('0x98')?![]:!![]);});}if(!_[_0x3d94('0x80')](_0x5da38c)){_0x584e1d['having'](_0x519ada);_0x860ee5[_0x3d94('0x53')](_0x3d94('0x99'),_0x5da38c);}BPromise['resolve']()['then'](function(){if(!_0x4bd97c){if(_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return;_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9a'));_0x584e1d['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9c')]!==_0x3d94('0x3b'))return;return _0x5d5c66[_0x3d94('0x9b')][_0x3d94('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38975f){if(_['isEmpty'](_0x38975f)){_0x860ee5[_0x3d94('0x53')](_0x3d94('0x9e'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x860ee5[_0x3d94('0x53')](_0x3d94('0x82'),_['map'](_0x38975f,'id'));_0x584e1d[_0x3d94('0x53')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3d94('0x3d')](_0x38975f,'id'));}});})[_0x3d94('0x1f')](function(){if(_0x5d5c66[_0x3d94('0x9b')]['role']===_0x3d94('0x3b')&&!_0x4bd97c&&!_0x5d5c66[_0x3d94('0x48')][_0x3d94('0x81')])return[];return db['sequelize'][_0x3d94('0x48')](_0x860ee5[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1f0f6f){_0x3f4b32[_0x3d94('0xa0')]=_0x1f0f6f[_0x3d94('0x4e')];if(_0x3f4b32[_0x3d94('0xa0')]===0x0)return[];return db[_0x3d94('0xa1')]['query'](_0x3a7eb0[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x227d15){_0x174eb3=_[_0x3d94('0xa2')](_0x227d15,'id');_0x43a00e=_[_0x3d94('0xa3')](_0x43a00e,{'model':db[_0x3d94('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d5c66['query'][_0x3d94('0x4d')]){_0x555366[_0x3d94('0x4c')][_0x3d94('0x42')](function(_0x59b62b){_0x584e1d[_0x3d94('0x54')]('i.'+_0x59b62b);});}else{_0x584e1d['field'](_0x3d94('0x96'),_0x3d94('0x6b'));_0x584e1d['field'](_0x3d94('0xa4'),_0x3d94('0xa5'));_0x584e1d['field']('a.mandatoryDisposition',_0x3d94('0xa6'));_0x584e1d[_0x3d94('0x54')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x584e1d['field'](_0x3d94('0xa7'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xa8'),_0x3d94('0xa9'));_0x584e1d[_0x3d94('0x54')]('c.lastName',_0x3d94('0xaa'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xab'),'Contact.email');_0x584e1d[_0x3d94('0x54')]('c.phone',_0x3d94('0xac'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xad'),_0x3d94('0xae'));_0x584e1d[_0x3d94('0x54')]('c.fax','Contact.fax');_0x584e1d[_0x3d94('0x54')](_0x3d94('0xaf'),'Owner.fullname');_0x584e1d[_0x3d94('0x54')]('o.internal',_0x3d94('0xb0'));_0x584e1d[_0x3d94('0x54')](_0x3d94('0xb1'),'TagIds');}if(_0x555366[_0x3d94('0x2e')])_0x584e1d['limit'](_0x555366[_0x3d94('0x2e')]);if(_0x555366[_0x3d94('0x2d')])_0x584e1d[_0x3d94('0x2d')](_0x555366[_0x3d94('0x2d')]);return db['sequelize']['query'](_0x584e1d[_0x3d94('0x9f')](),_0x43a00e);})[_0x3d94('0x1f')](function(_0x1c2092){if(_0x1c2092[_0x3d94('0x4e')]>0x0)_0x5b6061['where'](_0x3d94('0xb2'),_['map'](_0x1c2092,'id'));return db['sequelize']['query'](_0x5b6061[_0x3d94('0x9f')](),_0x43a00e)[_0x3d94('0x1f')](function(_0x3706ea){var _0xcd36ab=_[_0x3d94('0xb3')](_0x3706ea,_0x3d94('0xb4'));var _0x33af12=[];_0x1c2092[_0x3d94('0x42')](function(_0x2e2f9f){_0x33af12[_0x3d94('0xb5')](updateChatInteraction(_0x2e2f9f,_0x174eb3,_0xcd36ab));});return BPromise[_0x3d94('0xb6')](_0x33af12);});});})[_0x3d94('0x1f')](function(_0x42c91f){_0x3f4b32[_0x3d94('0xb7')]=_0x42c91f;return _0x3f4b32;})[_0x3d94('0x1f')](respondWithFilteredResult(_0x2910ea,_0x555366))['catch'](handleError(_0x2910ea,null));};exports['show']=function(_0x14ec29,_0x3ff668){var _0x1837c9={'raw':![],'where':{'id':_0x14ec29[_0x3d94('0xb8')]['id']}},_0x41251d={};_0x41251d[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatInteraction'][_0x3d94('0xb9')]);_0x41251d[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0x14ec29[_0x3d94('0x48')]);_0x41251d[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x41251d['model'],_0x41251d['query']);_0x1837c9[_0x3d94('0x4c')]=_['intersection'](_0x41251d[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0x14ec29[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x1837c9[_0x3d94('0x4c')]=_0x1837c9[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x1837c9[_0x3d94('0x4c')]:_0x41251d['model'];if(_0x14ec29[_0x3d94('0x48')][_0x3d94('0xba')]){_0x1837c9[_0x3d94('0xbb')]=[{'all':!![]}];}_0x1837c9=_[_0x3d94('0xa3')]({},_0x1837c9,_0x14ec29[_0x3d94('0xbc')]);return db[_0x3d94('0x44')][_0x3d94('0x73')](_0x1837c9)[_0x3d94('0x1f')](handleEntityNotFound(_0x3ff668,null))[_0x3d94('0x1f')](respondWithResult(_0x3ff668,null))[_0x3d94('0x29')](handleError(_0x3ff668,null));};exports[_0x3d94('0xbd')]=function(_0x26c8ef,_0x17b789){return db[_0x3d94('0x44')][_0x3d94('0xbd')](_0x26c8ef[_0x3d94('0x39')],{})[_0x3d94('0x1f')](respondWithResult(_0x17b789,0xc9))[_0x3d94('0x29')](handleError(_0x17b789,null));};exports[_0x3d94('0x33')]=function(_0xe5f109,_0xb55889){if(_0xe5f109['body']['id']){delete _0xe5f109[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xe5f109[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0xb55889,null))[_0x3d94('0x1f')](saveUpdates(_0xe5f109['body'],null))[_0x3d94('0x1f')](respondWithResult(_0xb55889,null))[_0x3d94('0x29')](handleError(_0xb55889,null));};exports[_0x3d94('0x34')]=function(_0x3242ea,_0x17a478){return db[_0x3d94('0x44')]['find']({'where':{'id':_0x3242ea[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x17a478,null))['then'](removeEntity(_0x17a478,null))['catch'](handleError(_0x17a478,null));};exports['describe']=function(_0x3e1139,_0x77b79d){return db[_0x3d94('0x44')][_0x3d94('0xbe')]()[_0x3d94('0x1f')](respondWithResult(_0x77b79d,null))['catch'](handleError(_0x77b79d,null));};exports[_0x3d94('0xbf')]=function(_0x36499a,_0xd8488f){var _0x669d83=_0x36499a[_0x3d94('0xb8')]['id'];var _0x2c004f;var _0x5d10af;var _0x167d4c;return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x669d83}})[_0x3d94('0x1f')](function(_0x34e156){_0x2c004f=_0x34e156;return db[_0x3d94('0xc1')]['findOne']({'where':{'id':_0x34e156[_0x3d94('0x81')]},'attributes':['id',_0x3d94('0xc2'),_0x3d94('0xc3'),_0x3d94('0xc4'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x3d94('0x1f')](function(_0x24d10c){if(_0x24d10c&&_0x24d10c[_0x3d94('0xc2')]&&_0x24d10c['vidaooEscalation']){_0x5d10af=_0x24d10c;var _0x2fac35={'interaction':{'id':_0x669d83},'agent':{'id':_0x36499a['user']['id'],'name':_0x36499a['user'][_0x3d94('0x36')],'fullname':_0x36499a[_0x3d94('0x9b')]['fullname'],'email':_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]},'contact':_0x36499a[_0x3d94('0x39')]['contact'],'account':_0x36499a[_0x3d94('0x39')][_0x3d94('0x3c')]};var _0x579998={'rejectUnauthorized':![],'method':'POST','url':_0x3d94('0xc6'),'headers':{'X-APIKEY':_0x24d10c[_0x3d94('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36499a[_0x3d94('0x9b')][_0x3d94('0xc5')]],'buttons':null,'topic':_0x5d10af[_0x3d94('0xc4')],'note':_[_0x3d94('0xc7')](_0x5d10af['vidaooNote'])?null:getMustacheRender(_0x5d10af['vidaooNote'],_0x2fac35),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x5d10af[_0x3d94('0xc8')])){var _0x3950d1=getMustacheRender(_0x5d10af[_0x3d94('0xc8')],_0x2fac35);var _0x1073d3=JSON[_0x3d94('0x85')](_0x3950d1);_0x579998[_0x3d94('0x39')][_0x3d94('0xc9')]=_0x1073d3;}}catch(_0x23c9d4){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xcb'));}return rp(_0x579998);}else{throw new db['Sequelize'][(_0x3d94('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x3d94('0x1f')](function(_0x149fab){_0x167d4c=_0x149fab;if(_0x167d4c['id']){var _0x15cda1={'body':_0x167d4c[_0x3d94('0xcc')],'ChatWebsiteId':_0x5d10af['id'],'ChatInteractionId':_0x2c004f['id'],'direction':_0x3d94('0xcd'),'UserId':_0x36499a[_0x3d94('0x9b')]['id']};return db[_0x3d94('0xce')][_0x3d94('0xbd')](_0x15cda1,{});}else{throw new db['Sequelize'][(_0x3d94('0xca'))](_0x3d94('0xcf'));}})[_0x3d94('0x1f')](function(){return _0x2c004f[_0x3d94('0xd0')]({'vidaooSessionId':_0x167d4c['id']});})[_0x3d94('0x1f')](respondWithResult(_0xd8488f,null))[_0x3d94('0x29')](handleError(_0xd8488f,null));};exports[_0x3d94('0xd1')]=function(_0x1b7ad4,_0x483e7a){if(_0x1b7ad4[_0x3d94('0x39')]['id']){delete _0x1b7ad4[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x1b7ad4[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xd2')],'as':_0x3d94('0x6e')}]})[_0x3d94('0x1f')](handleEntityNotFound(_0x483e7a,null))['then'](saveUpdates(_0x1b7ad4[_0x3d94('0x39')],null))[_0x3d94('0x1f')](respondWithResult(_0x483e7a,null))['catch'](handleError(_0x483e7a,null));};exports[_0x3d94('0xd3')]=function(_0x11378e,_0x24e1c8,_0xaedee0){if(_0x11378e[_0x3d94('0x39')]['id']){delete _0x11378e[_0x3d94('0x39')]['id'];}return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x11378e[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](function(_0xf982a2){if(!_0xf982a2){logger[_0x3d94('0x25')](_0x3d94('0xd4'),_0x3d94('0xd3'),0x194,_0x3d94('0xd5'));_0x24e1c8[_0x3d94('0x2a')](0x194);}else{if(_0xf982a2[_0x3d94('0x7c')]){throw new db[(_0x3d94('0x92'))][(_0x3d94('0xca'))](_0x3d94('0xd6'));}}return _0xf982a2;})[_0x3d94('0x1f')](function(_0x4353ca){if(_0x4353ca){return _0x4353ca[_0x3d94('0x33')]({'closed':_0x11378e[_0x3d94('0x39')][_0x3d94('0xd7')],'disposition':_0x11378e['body']['disposition']})[_0x3d94('0x1f')](function(_0x54f366){return _0x54f366;});}})['then'](function(_0x199fa0){return respondWithRpcPromise(_0x3d94('0xd8'),_0x3d94('0xd3'),_0x11378e[_0x3d94('0x39')],client9004);})[_0x3d94('0x1f')](respondWithResult(_0x24e1c8,null))['catch'](handleError(_0x24e1c8,null));};exports[_0x3d94('0xd9')]=function(_0x5c0138,_0x41fd2c,_0x3b5b04){_0x5c0138[_0x3d94('0x39')][_0x3d94('0x36')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdb')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0xdc')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xdd')];_0x5c0138[_0x3d94('0x39')][_0x3d94('0x45')]=_0x5c0138[_0x3d94('0xda')][_0x3d94('0xde')];return db[_0x3d94('0xdf')]['create'](_0x5c0138['body'])['then'](respondWithResult(_0x41fd2c,0xc9))[_0x3d94('0x29')](handleError(_0x41fd2c,null));};exports[_0x3d94('0xe0')]=function(_0x59118c,_0x2105c2,_0x380071){return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0xb8')]['id']},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null))[_0x3d94('0x1f')](function(_0x3d96c5){if(_0x3d96c5){if(_0x3d96c5['closed']){return _0x2105c2[_0x3d94('0x2b')](0x193)[_0x3d94('0xe1')]({'status':0x193,'message':_0x3d94('0xe2')});}return db[_0x3d94('0xdf')][_0x3d94('0xc0')]({'where':{'id':_0x59118c[_0x3d94('0x48')][_0x3d94('0xe3')]},'raw':!![]})[_0x3d94('0x1f')](handleEntityNotFound(_0x2105c2,null));}})[_0x3d94('0x1f')](function(_0x4d54e7){if(_0x4d54e7){var _0x26bf00=_0x4d54e7[_0x3d94('0xe4')]!==null;var _0x23bf47=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xe7'));if(_0x26bf00){_0x23bf47=path['join'](_0x23bf47,'offline-chat/');}var _0x336a7d=path[_0x3d94('0xe5')](_0x23bf47,_0x4d54e7['basename']);return _0x2105c2[_0x3d94('0xe8')](_0x336a7d);}})[_0x3d94('0x29')](handleError(_0x2105c2,null));};exports[_0x3d94('0xe9')]=function(_0x37680e,_0x397e85){var _0x5c192c=null;var _0x180595=null;var _0x4a7185=null;var _0x3b0395=null;if(_0x37680e['body']['id']){delete _0x37680e['body']['id'];}if(_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]){_0x3b0395=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0xeb'),util['format'](_0x3d94('0xec'),Date['now']()));_0x37680e['body']['pathTranscript']=_0x3b0395;}return db[_0x3d94('0x44')]['find']({'where':{'id':_0x37680e[_0x3d94('0xb8')]['id']},'include':[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'include':[{'model':db[_0x3d94('0x7a')],'as':_0x3d94('0x7a')}]}]})['then'](handleEntityNotFound(_0x397e85,null))[_0x3d94('0x1f')](saveUpdates(_0x37680e[_0x3d94('0x39')],null))[_0x3d94('0x1f')](function(_0x283758){if(_0x283758){_0x5c192c=_0x283758;return db[_0x3d94('0xc1')][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ChatWebsiteId']}});}})[_0x3d94('0x1f')](function(_0x593683){if(_0x593683){_0x4a7185=_0x593683;return db['CmContact'][_0x3d94('0x73')]({'where':{'id':_0x5c192c['ContactId']}});}})[_0x3d94('0x1f')](function(_0xc61003){if(_0xc61003){_0x180595=_0xc61003;if(_0x3b0395){var _0x40b159=null;for(var _0x5262af=0x1;_0x5262af<_0x5c192c['Messages'][_0x3d94('0x4e')];++_0x5262af){_0x40b159=_0x5c192c['Messages'][_0x5262af];var _0x289577=_0x40b159[_0x3d94('0x7c')]?util['format'](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):_0x3d94('0xf0');var _0x4282b3=_0x37680e[_0x3d94('0x39')][_0x3d94('0xf1')]||util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x3d94('0xf3'),_0x40b159[_0x3d94('0x74')]);switch(_0x4a7185[_0x3d94('0xf4')]){case _0x3d94('0xf5'):_0x289577=_0x40b159[_0x3d94('0x7c')]?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159['UserId']):_0x3d94('0xf0');break;case _0x3d94('0xf6'):_0x289577=_0x40b159[_0x3d94('0x7c')]?_0x40b159[_0x3d94('0x7a')][_0x3d94('0xf7')]||_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;case'agent_fullname':_0x289577=_0x40b159['UserId']?_0x40b159[_0x3d94('0x7a')][_0x3d94('0x3e')]:'System';break;default:_0x289577=_0x40b159['UserId']?util[_0x3d94('0xf2')](_0x3d94('0xee'),_0x4a7185[_0x3d94('0xef')],_0x40b159[_0x3d94('0x7c')]):'System';}var _0x5ac9db=util['format'](_0x3d94('0xf8'),moment(_0x40b159['createdAt'])['format'](_0x3d94('0xf9')),_0x40b159[_0x3d94('0xfa')]==='in'?_0x4282b3:_0x289577,_0x40b159[_0x3d94('0x39')]);if(!_0x40b159[_0x3d94('0xfb')]){fs[_0x3d94('0xfc')](_0x3b0395,_0x5ac9db);}}return db[_0x3d94('0xfd')][_0x3d94('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3d94('0x1f')](function(_0x29a79a){if(_0x29a79a&&_0x29a79a[_0x3d94('0xfe')]&&_0x37680e[_0x3d94('0x39')]){var _0x1be31a={'tls':{'rejectUnauthorized':![]}};if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0xff')]){_0x1be31a['service']=_0x29a79a[_0x3d94('0xfe')]['service'];}else{_0x1be31a['host']=_0x29a79a['Smtp'][_0x3d94('0x100')];_0x1be31a[_0x3d94('0x101')]=_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x101')];_0x1be31a['secure']=_0x29a79a[_0x3d94('0xfe')]['secure'];}if(_0x29a79a[_0x3d94('0xfe')][_0x3d94('0x102')]){_0x1be31a[_0x3d94('0x103')]={'user':_0x29a79a['Smtp'][_0x3d94('0x9b')],'pass':_0x29a79a[_0x3d94('0xfe')]['pass']};}return respondWithRpcPromise('SendMail',_0x3d94('0x104'),{'account':_0x1be31a,'message':{'from':util[_0x3d94('0xf2')](_0x3d94('0x105'),_0x29a79a[_0x3d94('0x36')],_0x29a79a['email']||_0x29a79a['Smtp']['user']),'to':_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')],'subject':_0x3d94('0x106'),'text':util[_0x3d94('0xf2')](_0x3d94('0x107'),_0x37680e[_0x3d94('0x39')][_0x3d94('0xea')]),'attachments':[{'path':_0x3b0395}]}})['then'](function(){return _0x5c192c;})['catch'](function(_0xcd4f10){console[_0x3d94('0x25')](_0xcd4f10);});}else{return _0x5c192c;}})[_0x3d94('0x1f')](respondWithStatusCode(_0x397e85,0xc8))[_0x3d94('0x29')](handleError(_0x397e85,null));};exports[_0x3d94('0x108')]=function(_0x4d9b7a,_0x4514fa,_0x29fd6b){return db[_0x3d94('0xce')][_0x3d94('0x73')]({'where':{'id':_0x4d9b7a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x4514fa,null))['then'](function(_0xaa7525){if(_0xaa7525){return _0xaa7525[_0x3d94('0x108')](_0x4d9b7a['body'][_0x3d94('0x109')],_[_0x3d94('0x10a')](_0x4d9b7a['body'],[_0x3d94('0x109'),'id'])||{});}})['then'](respondWithResult(_0x4514fa,null))[_0x3d94('0x29')](handleError(_0x4514fa,null));};exports[_0x3d94('0x10b')]=function(_0xabb45a,_0x381b5a,_0x5e935e){var _0x317583={'raw':![],'where':{}};var _0x4733ad={};var _0x5e7388={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0xabb45a[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x381b5a,null))[_0x3d94('0x1f')](function(_0x5e3823){if(_0x5e3823){_0x4733ad[_0x3d94('0x47')]=_[_0x3d94('0x49')](db['ChatMessage'][_0x3d94('0xb9')]);_0x4733ad[_0x3d94('0x48')]=_[_0x3d94('0x49')](_0xabb45a[_0x3d94('0x48')]);_0x4733ad[_0x3d94('0x4a')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],_0x4733ad[_0x3d94('0x48')]);_0x317583[_0x3d94('0x4c')]=_[_0x3d94('0x4b')](_0x4733ad[_0x3d94('0x47')],qs[_0x3d94('0x4d')](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4d')]));_0x317583[_0x3d94('0x4c')]=_0x317583[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0x317583['attributes']:_0x4733ad['model'];if(!_0xabb45a[_0x3d94('0x48')][_0x3d94('0x4f')](_0x3d94('0x50'))){_0x317583['limit']=qs['limit'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2e')]);_0x317583[_0x3d94('0x2d')]=qs['offset'](_0xabb45a[_0x3d94('0x48')][_0x3d94('0x2d')]);}_0x317583[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0xabb45a['query'][_0x3d94('0x52')]);_0x317583[_0x3d94('0x53')]=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0xabb45a[_0x3d94('0x48')],_0x4733ad[_0x3d94('0x4a')]));_0x317583['where'][_0x3d94('0xb4')]=_0x5e3823['id'];if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x8c')]){_0x317583['where']=_[_0x3d94('0xa3')](_0x317583[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0x317583[_0x3d94('0x4c')],function(_0x4bd3fd){var _0x4279a6={};_0x4279a6[_0x4bd3fd]={'$like':'%'+_0xabb45a[_0x3d94('0x48')]['filter']+'%'};return _0x4279a6;})});}if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0x86')]){var _0x32f992=_0xabb45a['query'][_0x3d94('0x86')]['split'](',');var _0x4ae7d9={};_0x4ae7d9[_0x32f992[0x0]]={'$gte':moment(_0x32f992[0x1])[_0x3d94('0xf2')](_0x3d94('0x10d'))};_0x317583['where']=_['merge'](_0x317583[_0x3d94('0x53')],_0x4ae7d9);}_0x317583=_['merge']({},_0x317583,_0xabb45a[_0x3d94('0xbc')]);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0x317583[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x249f16){_0x5e7388[_0x3d94('0xa0')]=_0x249f16;if(_0xabb45a[_0x3d94('0x48')][_0x3d94('0xba')]){_0x317583['include']=[{'all':!![]}];}return db[_0x3d94('0xce')][_0x3d94('0x10e')](_0x317583);})['then'](function(_0x3e6878){_0x5e7388['rows']=_0x3e6878;return _0x5e7388;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x381b5a,_0x317583))[_0x3d94('0x29')](handleError(_0x381b5a,null));};exports['getMyMessages']=function(_0x1e3d22,_0x562c3f,_0x5ebe77){var _0xf8f4e7={'where':{}},_0x3fd9a9={},_0x1606b6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3d94('0xc0')]({'where':{'id':_0x1e3d22[_0x3d94('0xb8')]['id']}})[_0x3d94('0x1f')](handleEntityNotFound(_0x562c3f,null))[_0x3d94('0x1f')](function(_0x4c76f3){if(_0x4c76f3){_0x3fd9a9[_0x3d94('0x47')]=_[_0x3d94('0x49')](db[_0x3d94('0xce')][_0x3d94('0xb9')]);_0x3fd9a9[_0x3d94('0x48')]=_['keys'](_0x1e3d22['query']);_0x3fd9a9['filters']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],_0x3fd9a9[_0x3d94('0x48')]);_0xf8f4e7['attributes']=_[_0x3d94('0x4b')](_0x3fd9a9[_0x3d94('0x47')],qs['fields'](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x4d')]));_0xf8f4e7[_0x3d94('0x4c')]=_0xf8f4e7[_0x3d94('0x4c')][_0x3d94('0x4e')]?_0xf8f4e7[_0x3d94('0x4c')]:_0x3fd9a9['model'];if(!_0x1e3d22['query'][_0x3d94('0x4f')](_0x3d94('0x50'))){_0xf8f4e7['limit']=qs[_0x3d94('0x2e')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x2e')]);_0xf8f4e7[_0x3d94('0x2d')]=qs[_0x3d94('0x2d')](_0x1e3d22[_0x3d94('0x48')]['offset']);}_0xf8f4e7[_0x3d94('0x51')]=qs[_0x3d94('0x52')](_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x52')]);_0xf8f4e7['where']=qs[_0x3d94('0x4a')](_[_0x3d94('0x10c')](_0x1e3d22['query'],_0x3fd9a9[_0x3d94('0x4a')]));_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xb4')]=_0x4c76f3['id'];if(_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]){_0xf8f4e7[_0x3d94('0x53')]=_[_0x3d94('0xa3')](_0xf8f4e7[_0x3d94('0x53')],{'$or':_[_0x3d94('0x3d')](_0xf8f4e7[_0x3d94('0x4c')],function(_0x5829be){var _0x56894f={};_0x56894f[_0x5829be]={'$like':'%'+_0x1e3d22[_0x3d94('0x48')][_0x3d94('0x8c')]+'%'};return _0x56894f;})});}_0xf8f4e7[_0x3d94('0x53')][_0x3d94('0xfb')]=![];if(_0x1e3d22['query']['id']){_0xf8f4e7[_0x3d94('0x53')]['id']={'$gt':_0x1e3d22[_0x3d94('0x48')]['id']};}_0xf8f4e7=_[_0x3d94('0xa3')]({},_0xf8f4e7,_0x1e3d22['options']);return db[_0x3d94('0xce')][_0x3d94('0xa0')]({'where':_0xf8f4e7[_0x3d94('0x53')]})[_0x3d94('0x1f')](function(_0x289380){_0x1606b6[_0x3d94('0xa0')]=_0x289380;_0xf8f4e7[_0x3d94('0xbb')]=[];if(_0x1e3d22['query'][_0x3d94('0x10f')]){_0xf8f4e7['include'][_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x7a'),'attributes':['id',_0x3d94('0x3e'),'alias']});}if(_0x1e3d22[_0x3d94('0x48')]['includeAll']){_0xf8f4e7[_0x3d94('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf8f4e7);})[_0x3d94('0x1f')](function(_0x436e01){_0x1606b6[_0x3d94('0xb7')]=_0x436e01;return _0x1606b6;});}})[_0x3d94('0x1f')](respondWithFilteredResult(_0x562c3f,_0xf8f4e7))[_0x3d94('0x29')](handleError(_0x562c3f,null));};exports[_0x3d94('0x110')]=function(_0xfb94d4,_0x1ef614,_0x137d04){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0xfb94d4[_0x3d94('0xb8')]['id']}})['then'](handleEntityNotFound(_0x1ef614,null))[_0x3d94('0x1f')](function(_0x28aad1){if(_0x28aad1){return _0x28aad1[_0x3d94('0x111')](_0xfb94d4[_0x3d94('0x39')]['ids'],_['omit'](_0xfb94d4[_0x3d94('0x39')],[_0x3d94('0x109'),'id'])||{})[_0x3d94('0x112')](function(){return db[_0x3d94('0x77')][_0x3d94('0x10e')]({'attributes':['id','name','color'],'where':{'id':_0xfb94d4[_0x3d94('0x39')]['ids']}});})[_0x3d94('0x1f')](function(_0xc1537){socket[_0x3d94('0x113')](_0x3d94('0x114'),{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]});return{'id':Number(_0xfb94d4[_0x3d94('0xb8')]['id']),'tags':_0xc1537||[]};});}})['then'](respondWithResult(_0x1ef614,null))[_0x3d94('0x29')](handleError(_0x1ef614,null));};exports[_0x3d94('0x115')]=function(_0x4aa6e6,_0x18f2db,_0x16082f){return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4aa6e6['params']['id']}})['then'](handleEntityNotFound(_0x18f2db,null))[_0x3d94('0x1f')](function(_0x1e480b){if(_0x1e480b){return _0x1e480b[_0x3d94('0x115')](_0x4aa6e6[_0x3d94('0x48')][_0x3d94('0x109')]);}})[_0x3d94('0x1f')](respondWithStatusCode(_0x18f2db,null))[_0x3d94('0x29')](handleError(_0x18f2db,null));};exports[_0x3d94('0xe8')]=function(_0x4147d5,_0x54d72a){var _0x31ec36=moment()[_0x3d94('0x116')]()['toString']();var _0x4897f6=path[_0x3d94('0xe5')](config['root'],'server',_0x3d94('0x117'),_0x3d94('0x118'));var _0x17f392=path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],'server',_0x3d94('0x117'),_0x3d94('0x119'));var _0xceded9=path[_0x3d94('0xe5')](_0x4897f6,_0x31ec36);var _0x77078d=util[_0x3d94('0xf2')](_0x3d94('0x11a'),_0x4147d5[_0x3d94('0xb8')]['id'],_0x31ec36);var _0x27008c=path[_0x3d94('0xe5')](_0x4897f6,_0x77078d);var _0x464735=[];_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0x7a')],'as':'User','attributes':['id',_0x3d94('0x3e')],'raw':!![]});_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xd2')],'as':'Contact','attributes':['id',_0x3d94('0x11b'),_0x3d94('0x11c')],'raw':!![]});if(_0x4147d5[_0x3d94('0x48')][_0x3d94('0x119')]){_0x464735[_0x3d94('0xb5')]({'model':db[_0x3d94('0xdf')],'as':_0x3d94('0xdf'),'raw':!![]});}var _0x554203=[{'model':db[_0x3d94('0xce')],'as':_0x3d94('0xed'),'attributes':['id',_0x3d94('0x39'),_0x3d94('0x84'),_0x3d94('0xfa'),_0x3d94('0xfb'),'read'],'include':_0x464735}];_0x554203['push']({'model':db[_0x3d94('0xc1')],'as':_0x3d94('0x11d'),'attributes':['id',_0x3d94('0x36')]});_0x554203[_0x3d94('0xb5')]({'model':db['User'],'as':_0x3d94('0x11e'),'attributes':['id','fullname']});return db[_0x3d94('0x44')][_0x3d94('0x73')]({'where':{'id':_0x4147d5['params']['id']},'include':_0x554203})['then'](handleEntityNotFound(_0x54d72a,null))['then'](function(_0x1da500){if(_0x1da500){var _0x2eb637=_0x1da500['get']({'plain':!![]});fs[_0x3d94('0x11f')](_0xceded9);var _0x4f572c={'channel':_0x3d94('0x120'),'account':_0x2eb637[_0x3d94('0x11d')][_0x3d94('0x36')],'agent':_0x2eb637[_0x3d94('0x11e')]?_0x2eb637[_0x3d94('0x11e')][_0x3d94('0x3e')]:'N.A.','createdAt':moment(_0x2eb637['createdAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'closedAt':_0x2eb637[_0x3d94('0xd7')]?moment(_0x2eb637['closedAt'])[_0x3d94('0xf2')](_0x3d94('0x10d'))[_0x3d94('0x9f')]():'','disposition':_0x2eb637[_0x3d94('0x121')],'chatInfo':{'browser':_0x2eb637[_0x3d94('0x122')],'os':_0x2eb637[_0x3d94('0x123')],'referer':_0x2eb637[_0x3d94('0x124')],'customerIp':_0x2eb637[_0x3d94('0x125')],'customerPort':_0x2eb637['customerPort']?_0x2eb637[_0x3d94('0x126')]:'N.A.'},'messages':_(_0x2eb637['Messages'])[_0x3d94('0x127')]()[_0x3d94('0x8c')]({'secret':![]})[_0x3d94('0x3d')](function(_0x10fdf2){if(_0x10fdf2[_0x3d94('0xdf')]){var _0x70202c=path[_0x3d94('0xe5')](_0x17f392,_0x10fdf2[_0x3d94('0xdf')]['basename']);if(fs[_0x3d94('0x128')](_0x70202c)){fs['createReadStream'](_0x70202c)[_0x3d94('0x129')](fs[_0x3d94('0x12a')](path[_0x3d94('0xe5')](_0xceded9,_0x10fdf2[_0x3d94('0xdf')][_0x3d94('0xdc')])));}}return{'date':moment(_0x10fdf2[_0x3d94('0x84')])['format'](_0x3d94('0x10d'))[_0x3d94('0x9f')](),'sender':_0x10fdf2[_0x3d94('0xfa')]===_0x3d94('0xcd')?_0x10fdf2['User']?_0x10fdf2['User'][_0x3d94('0x3e')]:_0x3d94('0xf0'):_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11b')]+(_0x10fdf2[_0x3d94('0x6e')]['lastName']?'\x20'+_0x10fdf2[_0x3d94('0x6e')][_0x3d94('0x11c')]:''),'body':_0x10fdf2[_0x3d94('0xdf')]?_0x10fdf2[_0x3d94('0xdf')]['basename']:_0x10fdf2[_0x3d94('0x39')],'direction':_0x10fdf2['direction']===_0x3d94('0xcd')?'A':'C','secret':_0x10fdf2[_0x3d94('0xfb')],'read':_0x10fdf2['read'],'attachment':_0x10fdf2[_0x3d94('0xdf')]};})[_0x3d94('0x70')]()};return ejs[_0x3d94('0x12b')](path[_0x3d94('0xe5')](config[_0x3d94('0xe6')],_0x3d94('0x12c'),_0x3d94('0x12d'),_0x3d94('0x12e')),{'interaction':_0x4f572c})[_0x3d94('0x1f')](function(_0x244770){var _0x4e0383=path['join'](_0xceded9,_0x3d94('0x12f')+_0x2eb637['id']+'-'+_0x31ec36+'.pdf');var _0x57a739={'path':_0x4e0383,'channel':_0x3d94('0x120'),'interactionId':_0x2eb637['id']};return pdf['createPdfFromHTML'](_0x244770,_0x57a739);})[_0x3d94('0x1f')](function(){return new BPromise(function(_0x46ddad,_0x3063e9){zipdir(_0xceded9,{'saveTo':_0x27008c},function(_0x36c9be,_0x316c31){if(_0x36c9be)return _0x3063e9(_0x36c9be);return _0x46ddad(_0x316c31);});})['then'](function(){return new BPromise(function(_0x4e42e3,_0xeee55f){rimraf(_0xceded9,function(_0x2be870){if(_0x2be870)_0xeee55f(_0x2be870);return _0x4e42e3();});});})[_0x3d94('0x1f')](function(){return _0x54d72a['download'](_0x27008c,_0x77078d,function(_0x3330df){if(_0x3330df){console[_0x3d94('0x130')](_0x3d94('0x131'),_0x3330df);}else{fs['unlinkSync'](_0x27008c);}});});});}else{return _0x54d72a[_0x3d94('0x2a')](0xc8);}})[_0x3d94('0x29')](handleError(_0x54d72a,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 3b12da7..faca05b 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 _0x9765=['ChatMessage','setMaxListeners','save','update','then','setDataValue','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x19eb42,_0xca1520){var _0x4f78e8=function(_0x5b31dc){while(--_0x5b31dc){_0x19eb42['push'](_0x19eb42['shift']());}};_0x4f78e8(++_0xca1520);}(_0x9765,0x85));var _0x5976=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9765[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require(_0x5976('0x0'));var ChatInteraction=require(_0x5976('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x5976('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5976('0x3')](0x0);var events={'afterCreate':_0x5976('0x4'),'afterUpdate':_0x5976('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3a5125){return function(_0xaacd56,_0x4bc222,_0xf37cb3){_0xaacd56['getUsers']({'attributes':['id'],'raw':!![]})[_0x5976('0x6')](function(_0x3fe1f8){_0xaacd56[_0x5976('0x7')]('Users',_0x3fe1f8[_0x5976('0x8')](function(_0x49f42d){return{'id':_0x49f42d['id']};}));return ChatMessage[_0x5976('0x9')]({'where':{'ChatInteractionId':_0xaacd56['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5976('0x6')](function(_0xab6119){_0xaacd56[_0x5976('0x7')](_0x5976('0xa'),_0xab6119['length']);ChatInteractionEvents[_0x5976('0xb')](_0x3a5125+':'+_0xaacd56['id'],_0xaacd56);ChatInteractionEvents[_0x5976('0xb')](_0x3a5125,_0xaacd56);_0xf37cb3(null);})[_0x5976('0xc')](_0xf37cb3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5976('0xd')](e,emitEvent(event));}}module[_0x5976('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc71c=['map','findAll','length','emit','catch','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','setDataValue','Users'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc71c,0xe6));var _0xcc71=function(_0x4e5c37,_0x170d7b){_0x4e5c37=_0x4e5c37-0x0;var _0x2a80d1=_0xc71c[_0x4e5c37];return _0x2a80d1;};'use strict';var EventEmitter=require(_0xcc71('0x0'));var ChatInteraction=require(_0xcc71('0x1'))['db'][_0xcc71('0x2')];var ChatMessage=require(_0xcc71('0x1'))['db'][_0xcc71('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc71('0x4'),'afterUpdate':'update','afterDestroy':_0xcc71('0x5')};function emitEvent(_0x57b0cf){return function(_0x3a1a6c,_0x42ca8a,_0x44688b){_0x3a1a6c[_0xcc71('0x6')]({'attributes':['id'],'raw':!![]})[_0xcc71('0x7')](function(_0x1d7ea6){_0x3a1a6c[_0xcc71('0x8')](_0xcc71('0x9'),_0x1d7ea6[_0xcc71('0xa')](function(_0x2b7e57){return{'id':_0x2b7e57['id']};}));return ChatMessage[_0xcc71('0xb')]({'where':{'ChatInteractionId':_0x3a1a6c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcc71('0x7')](function(_0x3f16c9){_0x3a1a6c[_0xcc71('0x8')]('unreadMessages',_0x3f16c9[_0xcc71('0xc')]);ChatInteractionEvents[_0xcc71('0xd')](_0x57b0cf+':'+_0x3a1a6c['id'],_0x3a1a6c);ChatInteractionEvents[_0xcc71('0xd')](_0x57b0cf,_0x3a1a6c);_0x44688b(null);})[_0xcc71('0xe')](_0x44688b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xcc71('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 9a1140c..f54c36a 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 _0x6f16=['changed','closed','closedAt','format','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','chat_interactions'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6f16,0x75));var _0x66f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f16[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x66f1('0x0'));var logger=require(_0x66f1('0x1'))(_0x66f1('0x2'));var moment=require(_0x66f1('0x3'));var BPromise=require(_0x66f1('0x4'));var rp=require(_0x66f1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66f1('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x66f1('0x7')]=function(_0x2b6173,_0x38f5a6){return _0x2b6173['define']('ChatInteraction',attributes,{'tableName':_0x66f1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15854e,_0x598458,_0x112b56){if(_0x15854e[_0x66f1('0x9')](_0x66f1('0xa'))){_0x15854e[_0x66f1('0xb')]=moment()[_0x66f1('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x112b56(null,_0x15854e);}},'charset':_0x66f1('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb8ee=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb8ee,0x1a3));var _0xeb8e=function(_0x1e24b1,_0x14ab30){_0x1e24b1=_0x1e24b1-0x0;var _0x212baf=_0xb8ee[_0x1e24b1];return _0x212baf;};'use strict';var _=require(_0xeb8e('0x0'));var util=require('util');var logger=require(_0xeb8e('0x1'))(_0xeb8e('0x2'));var moment=require(_0xeb8e('0x3'));var BPromise=require(_0xeb8e('0x4'));var rp=require(_0xeb8e('0x5'));var fs=require('fs');var path=require(_0xeb8e('0x6'));var rimraf=require('rimraf');var config=require(_0xeb8e('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xeb8e('0x8')]=function(_0x43214b,_0x203858){return _0x43214b['define'](_0xeb8e('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d9058,_0x39c4fc,_0x3ec499){if(_0x4d9058['changed']('closed')){_0x4d9058[_0xeb8e('0xa')]=moment()['format'](_0xeb8e('0xb'));}_0x3ec499(null,_0x4d9058);}},'charset':'utf8mb4','collate':_0xeb8e('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index fa54117..8e7415a 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 _0x087d=['addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','ChatInteraction'];(function(_0x3d7e04,_0x2eb376){var _0x2e559c=function(_0x3aea9e){while(--_0x3aea9e){_0x3d7e04['push'](_0x3d7e04['shift']());}};_0x2e559c(++_0x2eb376);}(_0x087d,0x17f));var _0xd087=function(_0x38bd73,_0x20810f){_0x38bd73=_0x38bd73-0x0;var _0x57562f=_0x087d[_0x38bd73];return _0x57562f;};'use strict';var _=require('lodash');var util=require(_0xd087('0x0'));var moment=require(_0xd087('0x1'));var BPromise=require(_0xd087('0x2'));var rs=require(_0xd087('0x3'));var fs=require('fs');var Redis=require(_0xd087('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd087('0x5'))(_0xd087('0x6'));var config=require(_0xd087('0x7'));var jayson=require(_0xd087('0x8'));var client=jayson[_0xd087('0x9')][_0xd087('0xa')]({'port':0x232a});config[_0xd087('0xb')]=_[_0xd087('0xc')](config['redis'],{'host':_0xd087('0xd'),'port':0x18eb});var socket=require(_0xd087('0xe'))(new Redis(config[_0xd087('0xb')]));require(_0xd087('0xf'))[_0xd087('0x10')](socket);function respondWithRpcPromise(_0x1a5187,_0x4f8611,_0x3535c0){return new BPromise(function(_0x52d4ba,_0x4b4e42){return client[_0xd087('0x11')](_0x1a5187,_0x3535c0)[_0xd087('0x12')](function(_0x35144d){logger[_0xd087('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x4f8611,'request\x20sent');logger[_0xd087('0x14')](_0xd087('0x15'),_0x4f8611,_0xd087('0x16'),JSON[_0xd087('0x17')](_0x35144d));if(_0x35144d[_0xd087('0x18')]){if(_0x35144d['error'][_0xd087('0x19')]===0x1f4){logger[_0xd087('0x18')](_0xd087('0x1a'),_0x4f8611,_0x35144d['error'][_0xd087('0x1b')]);return _0x4b4e42(_0x35144d[_0xd087('0x18')]['message']);}logger[_0xd087('0x18')](_0xd087('0x1a'),_0x4f8611,_0x35144d['error']['message']);return _0x52d4ba(_0x35144d['error'][_0xd087('0x1b')]);}else{logger[_0xd087('0x13')](_0xd087('0x1a'),_0x4f8611,_0xd087('0x16'));_0x52d4ba(_0x35144d['result'][_0xd087('0x1b')]);}})[_0xd087('0x1c')](function(_0x29e381){logger[_0xd087('0x18')](_0xd087('0x1a'),_0x4f8611,_0x29e381);_0x4b4e42(_0x29e381);});});}exports[_0xd087('0x1d')]=function(_0x3e853f){var _0x21c498=this;return new Promise(function(_0x57cff4,_0x4242d5){return db['ChatInteraction'][_0xd087('0x1e')](_0x3e853f[_0xd087('0x1f')],{'raw':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')][_0xd087('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')][_0xd087('0x22')]||null:null,'attributes':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')][_0xd087('0x23')]||null:null,'limit':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')]['limit']||null:null})[_0xd087('0x12')](function(_0x433f48){logger[_0xd087('0x13')](_0xd087('0x1d'),_0x3e853f);logger[_0xd087('0x14')](_0xd087('0x1d'),_0x3e853f,JSON['stringify'](_0x433f48));_0x57cff4(_0x433f48);})[_0xd087('0x1c')](function(_0x314647){logger['error'](_0xd087('0x1d'),_0x314647['message'],_0x3e853f);_0x4242d5(_0x21c498[_0xd087('0x18')](0x1f4,_0x314647[_0xd087('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x414707){return new Promise(function(_0x146d20,_0x4de383){return db[_0xd087('0x24')]['find']({'where':_0x414707[_0xd087('0x20')]?_0x414707[_0xd087('0x20')][_0xd087('0x22')]||null:null})[_0xd087('0x12')](function(_0x42d559){if(_0x42d559){return _0x42d559[_0xd087('0x25')](_0x414707[_0xd087('0x1f')][_0xd087('0x26')],_[_0xd087('0x27')](_0x414707['body'],['ids','id'])||{});}})[_0xd087('0x28')](function(_0x14311a){logger[_0xd087('0x13')](_0xd087('0x29'),_0x414707);logger[_0xd087('0x14')](_0xd087('0x29'),_0x414707,JSON['stringify'](_0x14311a));_0x146d20(_0x14311a);})[_0xd087('0x1c')](function(_0x522507){logger[_0xd087('0x18')]('AddTags',_0x522507['message'],_0x414707);_0x4de383(_this[_0xd087('0x18')](0x1f4,_0x522507[_0xd087('0x1b')]));});});};
\ No newline at end of file
+var _0x3527=['UpdateChatInteraction','ChatInteraction','body','raw','options','where','attributes','stringify','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x904f36,_0x1f2eac){var _0xc2645c=function(_0x40e08b){while(--_0x40e08b){_0x904f36['push'](_0x904f36['shift']());}};_0xc2645c(++_0x1f2eac);}(_0x3527,0x1b1));var _0x7352=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x3527[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0x7352('0x0'));var util=require(_0x7352('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7352('0x2'));var fs=require('fs');var Redis=require(_0x7352('0x3'));var db=require(_0x7352('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7352('0x5'))(_0x7352('0x6'));var config=require(_0x7352('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7352('0x8')]['http']({'port':0x232a});config[_0x7352('0x9')]=_[_0x7352('0xa')](config[_0x7352('0x9')],{'host':_0x7352('0xb'),'port':0x18eb});var socket=require(_0x7352('0xc'))(new Redis(config[_0x7352('0x9')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x58d38c,_0x4afe3e,_0x387a66){return new BPromise(function(_0x336574,_0x3ebbe3){return client[_0x7352('0xd')](_0x58d38c,_0x387a66)[_0x7352('0xe')](function(_0x5720fc){logger[_0x7352('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x4afe3e,_0x7352('0x10'));logger[_0x7352('0x11')](_0x7352('0x12'),_0x4afe3e,'request\x20sent',JSON['stringify'](_0x5720fc));if(_0x5720fc[_0x7352('0x13')]){if(_0x5720fc[_0x7352('0x13')][_0x7352('0x14')]===0x1f4){logger['error'](_0x7352('0x15'),_0x4afe3e,_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);return _0x3ebbe3(_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);}logger['error'](_0x7352('0x15'),_0x4afe3e,_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);return _0x336574(_0x5720fc[_0x7352('0x13')][_0x7352('0x16')]);}else{logger['info'](_0x7352('0x15'),_0x4afe3e,'request\x20sent');_0x336574(_0x5720fc['result']['message']);}})['catch'](function(_0x53350e){logger[_0x7352('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x4afe3e,_0x53350e);_0x3ebbe3(_0x53350e);});});}exports[_0x7352('0x17')]=function(_0x14c033){var _0x1d2dff=this;return new Promise(function(_0x92d848,_0x2d920d){return db[_0x7352('0x18')]['update'](_0x14c033[_0x7352('0x19')],{'raw':_0x14c033['options']?_0x14c033['options'][_0x7352('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14c033['options']?_0x14c033[_0x7352('0x1b')][_0x7352('0x1c')]||null:null,'attributes':_0x14c033[_0x7352('0x1b')]?_0x14c033[_0x7352('0x1b')][_0x7352('0x1d')]||null:null,'limit':_0x14c033['options']?_0x14c033[_0x7352('0x1b')]['limit']||null:null})['then'](function(_0x443d46){logger['info'](_0x7352('0x17'),_0x14c033);logger['debug'](_0x7352('0x17'),_0x14c033,JSON[_0x7352('0x1e')](_0x443d46));_0x92d848(_0x443d46);})['catch'](function(_0x4e666e){logger[_0x7352('0x13')]('UpdateChatInteraction',_0x4e666e['message'],_0x14c033);_0x2d920d(_0x1d2dff[_0x7352('0x13')](0x1f4,_0x4e666e['message']));});});};exports[_0x7352('0x1f')]=function(_0x207780){return new Promise(function(_0x5cfe75,_0x2444ce){return db[_0x7352('0x18')][_0x7352('0x20')]({'where':_0x207780[_0x7352('0x1b')]?_0x207780[_0x7352('0x1b')][_0x7352('0x1c')]||null:null})[_0x7352('0xe')](function(_0x74cd47){if(_0x74cd47){return _0x74cd47[_0x7352('0x21')](_0x207780[_0x7352('0x19')][_0x7352('0x22')],_['omit'](_0x207780['body'],['ids','id'])||{});}})[_0x7352('0x23')](function(_0x436dc7){logger['info'](_0x7352('0x24'),_0x207780);logger['debug']('AddTags',_0x207780,JSON[_0x7352('0x1e')](_0x436dc7));_0x5cfe75(_0x436dc7);})[_0x7352('0x25')](function(_0x311849){logger[_0x7352('0x13')](_0x7352('0x24'),_0x311849[_0x7352('0x16')],_0x207780);_0x2444ce(_this[_0x7352('0x13')](0x1f4,_0x311849[_0x7352('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f7d6215..951a18e 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 _0xb16e=['save','remove','update','removeListener','register','./chatInteraction.events'];(function(_0x5e397f,_0x54d25c){var _0x2bec53=function(_0x1f8a4d){while(--_0x1f8a4d){_0x5e397f['push'](_0x5e397f['shift']());}};_0x2bec53(++_0x54d25c);}(_0xb16e,0x101));var _0xeb16=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0xb16e[_0x3186aa];return _0x2d8c36;};'use strict';var ChatInteractionEvents=require(_0xeb16('0x0'));var events=[_0xeb16('0x1'),_0xeb16('0x2'),_0xeb16('0x3')];function createListener(_0x1f26b7,_0x43c9e1){return function(_0x23a124){_0x43c9e1['emit'](_0x1f26b7,_0x23a124);};}function removeListener(_0xb658bb,_0xafb33b){return function(){ChatInteractionEvents[_0xeb16('0x4')](_0xb658bb,_0xafb33b);};}exports[_0xeb16('0x5')]=function(_0x492dc2){for(var _0x426de6=0x0,_0x16add3=events['length'];_0x426de6<_0x16add3;_0x426de6++){var _0x534aa9=events[_0x426de6];var _0x584eec=createListener('chatInteraction:'+_0x534aa9,_0x492dc2);ChatInteractionEvents['on'](_0x534aa9,_0x584eec);}};
\ No newline at end of file
+var _0xe630=['./chatInteraction.events','save','update','emit','register','length','chatInteraction:'];(function(_0x3ec521,_0x5deda3){var _0x25dfe9=function(_0x19948e){while(--_0x19948e){_0x3ec521['push'](_0x3ec521['shift']());}};_0x25dfe9(++_0x5deda3);}(_0xe630,0x149));var _0x0e63=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xe630[_0x31eb67];return _0x2a8cb8;};'use strict';var ChatInteractionEvents=require(_0x0e63('0x0'));var events=[_0x0e63('0x1'),'remove',_0x0e63('0x2')];function createListener(_0x294aee,_0x45c680){return function(_0x500458){_0x45c680[_0x0e63('0x3')](_0x294aee,_0x500458);};}function removeListener(_0x219cbe,_0x42c141){return function(){ChatInteractionEvents['removeListener'](_0x219cbe,_0x42c141);};}exports[_0x0e63('0x4')]=function(_0x308039){for(var _0x356abb=0x0,_0x3e461b=events[_0x0e63('0x5')];_0x356abb<_0x3e461b;_0x356abb++){var _0x563ad9=events[_0x356abb];var _0x35e304=createListener(_0x0e63('0x6')+_0x563ad9,_0x308039);ChatInteractionEvents['on'](_0x563ad9,_0x35e304);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index e18fd43..22637f8 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 _0x85d8=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','now','replace','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download'];(function(_0x54f419,_0x56a63f){var _0x3e81b5=function(_0x5b6f0f){while(--_0x5b6f0f){_0x54f419['push'](_0x54f419['shift']());}};_0x3e81b5(++_0x56a63f);}(_0x85d8,0x155));var _0x885d=function(_0x553d7e,_0x1c7ff8){_0x553d7e=_0x553d7e-0x0;var _0x498ce7=_0x85d8[_0x553d7e];return _0x498ce7;};'use strict';var multer=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var path=require(_0x885d('0x2'));var timeout=require(_0x885d('0x3'));var express=require(_0x885d('0x4'));var router=express[_0x885d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x885d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x885d('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x885d('0x8')](),controller[_0x885d('0x9')]);router[_0x885d('0xa')](_0x885d('0xb'),auth[_0x885d('0x8')](),controller[_0x885d('0xc')]);router[_0x885d('0xa')]('/:id',auth[_0x885d('0xd')](),controller[_0x885d('0xe')]);router[_0x885d('0xa')](_0x885d('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x885d('0x10')]);router[_0x885d('0xa')](_0x885d('0x11'),auth[_0x885d('0x8')](),controller[_0x885d('0x12')]);router['get'](_0x885d('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x885d('0x14')]);router['get'](_0x885d('0x15'),auth[_0x885d('0x8')](),controller['download']);router[_0x885d('0x16')]('/',auth[_0x885d('0x8')](),controller[_0x885d('0x17')]);router[_0x885d('0x16')](_0x885d('0x18'),auth[_0x885d('0x8')](),controller[_0x885d('0x19')]);var upload=multer({'storage':multer[_0x885d('0x1a')]({'destination':function(_0x4ce4b2,_0x57da68,_0x50ab86){_0x50ab86(null,path['join'](config[_0x885d('0x1b')],'server/files/attachments/'));},'filename':function(_0x5b0032,_0x3663f7,_0x198568){_0x198568(null,util[_0x885d('0x1c')](_0x885d('0x1d'),Date[_0x885d('0x1e')](),_0x3663f7['originalname'][_0x885d('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x885d('0x16')](_0x885d('0x20'),upload[_0x885d('0x21')]('file'),controller['attachmentUpload']);router[_0x885d('0x16')](_0x885d('0x11'),auth[_0x885d('0xd')](),controller[_0x885d('0x22')]);router['post'](_0x885d('0x23'),auth['isAuthenticated'](),interaction[_0x885d('0x24')](_0x885d('0x25'),_0x885d('0x26')),controller[_0x885d('0x27')]);router[_0x885d('0x28')](_0x885d('0x29'),auth[_0x885d('0x8')](),interaction[_0x885d('0x24')](_0x885d('0x25'),_0x885d('0x2a')),controller[_0x885d('0x2b')]);router[_0x885d('0x28')](_0x885d('0x2c'),controller['customUpdate']);router[_0x885d('0x28')](_0x885d('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x885d('0x2e')]);router[_0x885d('0x28')](_0x885d('0x2f'),controller['close']);router['delete'](_0x885d('0x29'),auth[_0x885d('0x8')](),interaction[_0x885d('0x24')](_0x885d('0x25'),_0x885d('0x30')),controller[_0x885d('0x31')]);router['delete'](_0x885d('0x23'),auth['isAuthenticated'](),controller[_0x885d('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0x4691=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','addTags','put','/:id','tracked','chat','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','util','path','connect-timeout','express'];(function(_0x47fa7c,_0x30a43f){var _0x11767b=function(_0x1a6db5){while(--_0x1a6db5){_0x47fa7c['push'](_0x47fa7c['shift']());}};_0x11767b(++_0x30a43f);}(_0x4691,0x13a));var _0x1469=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x4691[_0x1f36bb];return _0xaf97fa;};'use strict';var multer=require('multer');var util=require(_0x1469('0x0'));var path=require(_0x1469('0x1'));var timeout=require(_0x1469('0x2'));var express=require(_0x1469('0x3'));var router=express['Router']();var fs_extra=require(_0x1469('0x4'));var auth=require(_0x1469('0x5'));var interaction=require(_0x1469('0x6'));var config=require('../../config/environment');var controller=require(_0x1469('0x7'));router[_0x1469('0x8')]('/',auth[_0x1469('0x9')](),controller[_0x1469('0xa')]);router[_0x1469('0x8')](_0x1469('0xb'),auth['isAuthenticated'](),controller[_0x1469('0xc')]);router[_0x1469('0x8')]('/:id',auth[_0x1469('0xd')](),controller['show']);router[_0x1469('0x8')]('/:id/attachment_download',auth[_0x1469('0xd')](),controller[_0x1469('0xe')]);router[_0x1469('0x8')](_0x1469('0xf'),auth[_0x1469('0x9')](),controller[_0x1469('0x10')]);router['get'](_0x1469('0x11'),auth[_0x1469('0xd')](),controller[_0x1469('0x12')]);router[_0x1469('0x8')](_0x1469('0x13'),auth[_0x1469('0x9')](),controller['download']);router[_0x1469('0x14')]('/',auth[_0x1469('0x9')](),controller[_0x1469('0x15')]);router['post'](_0x1469('0x16'),auth[_0x1469('0x9')](),controller[_0x1469('0x17')]);var upload=multer({'storage':multer[_0x1469('0x18')]({'destination':function(_0x31d223,_0x126f45,_0x181ec0){_0x181ec0(null,path['join'](config[_0x1469('0x19')],_0x1469('0x1a')));},'filename':function(_0x49489d,_0x58b693,_0x499e46){_0x499e46(null,util[_0x1469('0x1b')](_0x1469('0x1c'),Date[_0x1469('0x1d')](),_0x58b693['originalname'][_0x1469('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1469('0x14')](_0x1469('0x1f'),upload[_0x1469('0x20')](_0x1469('0x21')),controller[_0x1469('0x22')]);router[_0x1469('0x14')](_0x1469('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x1469('0x23')]);router[_0x1469('0x14')]('/:id/tags',auth[_0x1469('0x9')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x1469('0x24')]);router[_0x1469('0x25')](_0x1469('0x26'),auth[_0x1469('0x9')](),interaction[_0x1469('0x27')](_0x1469('0x28'),_0x1469('0x29')),controller[_0x1469('0x2a')]);router['put']('/:id/custom_update',controller[_0x1469('0x2b')]);router[_0x1469('0x25')](_0x1469('0x2c'),auth[_0x1469('0xd')](),controller[_0x1469('0x2d')]);router['put'](_0x1469('0x2e'),controller[_0x1469('0x2f')]);router[_0x1469('0x30')](_0x1469('0x26'),auth[_0x1469('0x9')](),interaction[_0x1469('0x27')](_0x1469('0x28'),_0x1469('0x31')),controller[_0x1469('0x32')]);router[_0x1469('0x30')](_0x1469('0x33'),auth[_0x1469('0x9')](),controller['removeTags']);module[_0x1469('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index b37307a..ff6447d 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 _0xcd62=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x43b9a2,_0x3cfbb4){var _0x157744=function(_0x2bfc79){while(--_0x2bfc79){_0x43b9a2['push'](_0x43b9a2['shift']());}};_0x157744(++_0x3cfbb4);}(_0xcd62,0x130));var _0x2cd6=function(_0x280d9e,_0xb4cbfe){_0x280d9e=_0x280d9e-0x0;var _0xc24e98=_0xcd62[_0x280d9e];return _0xc24e98;};'use strict';var Sequelize=require('sequelize');module[_0x2cd6('0x0')]={'body':{'type':Sequelize[_0x2cd6('0x1')](_0x2cd6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2cd6('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2cd6('0x4')]}};
\ No newline at end of file
+var _0x3798=['TEXT','medium','INTEGER','sequelize'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x3798,0x1c7));var _0x8379=function(_0x16fe4c,_0x2421e8){_0x16fe4c=_0x16fe4c-0x0;var _0x9999d=_0x3798[_0x16fe4c];return _0x9999d;};'use strict';var Sequelize=require(_0x8379('0x0'));module['exports']={'body':{'type':Sequelize[_0x8379('0x1')](_0x8379('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8379('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index a9e2081..b5eb3c5 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 _0x18e9=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','send','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','ChatInternalMessage','rawAttributes','find','create','body','destroy','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x147c64,_0x3b5a32){var _0x3bcb18=function(_0x2c327e){while(--_0x2c327e){_0x147c64['push'](_0x147c64['shift']());}};_0x3bcb18(++_0x3b5a32);}(_0x18e9,0x1b5));var _0x918e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x18e9[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0x918e('0x0'));var rimraf=require(_0x918e('0x1'));var zipdir=require(_0x918e('0x2'));var jsonpatch=require(_0x918e('0x3'));var rp=require(_0x918e('0x4'));var moment=require(_0x918e('0x5'));var BPromise=require(_0x918e('0x6'));var Mustache=require(_0x918e('0x7'));var util=require(_0x918e('0x8'));var path=require(_0x918e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x918e('0xa'));var _=require('lodash');var squel=require(_0x918e('0xb'));var crypto=require(_0x918e('0xc'));var jsforce=require(_0x918e('0xd'));var deskjs=require(_0x918e('0xe'));var toCsv=require(_0x918e('0xf'));var querystring=require(_0x918e('0x10'));var Papa=require(_0x918e('0x11'));var Redis=require('ioredis');var authService=require(_0x918e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x918e('0x13'));var hardwareService=require(_0x918e('0x14'));var logger=require(_0x918e('0x15'))(_0x918e('0x16'));var utils=require(_0x918e('0x17'));var config=require(_0x918e('0x18'));var licenseUtil=require(_0x918e('0x19'));var db=require(_0x918e('0x1a'))['db'];config[_0x918e('0x1b')]=_[_0x918e('0x1c')](config['redis'],{'host':_0x918e('0x1d'),'port':0x18eb});var socket=require(_0x918e('0x1e'))(new Redis(config[_0x918e('0x1b')]));require(_0x918e('0x1f'))[_0x918e('0x20')](socket);function respondWithStatusCode(_0x15a188,_0x4f1d4a){_0x4f1d4a=_0x4f1d4a||0xcc;return function(_0x1610bc){if(_0x1610bc){return _0x15a188[_0x918e('0x21')](_0x4f1d4a);}return _0x15a188[_0x918e('0x22')](_0x4f1d4a)[_0x918e('0x23')]();};}function respondWithResult(_0x4cf943,_0x41afa8){_0x41afa8=_0x41afa8||0xc8;return function(_0x101051){if(_0x101051){return _0x4cf943['status'](_0x41afa8)['json'](_0x101051);}};}function respondWithFilteredResult(_0x752aa9,_0x25d3ed){return function(_0x429668){if(_0x429668){var _0xfed1b8=typeof _0x25d3ed[_0x918e('0x24')]===_0x918e('0x25')&&typeof _0x25d3ed[_0x918e('0x26')]===_0x918e('0x25');var _0x27ce16=_0x429668[_0x918e('0x27')];var _0x316277=_0xfed1b8?0x0:_0x25d3ed[_0x918e('0x24')];var _0x1c16fe=_0xfed1b8?_0x429668[_0x918e('0x27')]:_0x25d3ed[_0x918e('0x24')]+_0x25d3ed['limit'];var _0x568921;if(_0x1c16fe>=_0x27ce16){_0x1c16fe=_0x27ce16;_0x568921=0xc8;}else{_0x568921=0xce;}_0x752aa9['status'](_0x568921);return _0x752aa9[_0x918e('0x28')]('Content-Range',_0x316277+'-'+_0x1c16fe+'/'+_0x27ce16)['json'](_0x429668);}return null;};}function patchUpdates(_0x171a71){return function(_0x3b570d){try{jsonpatch[_0x918e('0x29')](_0x3b570d,_0x171a71,!![]);}catch(_0x43895b){return BPromise[_0x918e('0x2a')](_0x43895b);}return _0x3b570d['save']();};}function saveUpdates(_0x336e7b,_0x157144){return function(_0x17c16f){if(_0x17c16f){return _0x17c16f[_0x918e('0x2b')](_0x336e7b)[_0x918e('0x2c')](function(_0xe11e47){return _0xe11e47;});}return null;};}function removeEntity(_0x437497,_0x478181){return function(_0x57a15b){if(_0x57a15b){return _0x57a15b['destroy']()[_0x918e('0x2c')](function(){_0x437497['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5648ae,_0xb6c0f7){return function(_0x2d0ca9){if(!_0x2d0ca9){_0x5648ae[_0x918e('0x21')](0x194);}return _0x2d0ca9;};}function handleError(_0x4576c3,_0x1af58c){_0x1af58c=_0x1af58c||0x1f4;return function(_0x217ee0){logger[_0x918e('0x2d')](_0x217ee0[_0x918e('0x2e')]);if(_0x217ee0['name']){delete _0x217ee0[_0x918e('0x2f')];}_0x4576c3[_0x918e('0x22')](_0x1af58c)[_0x918e('0x30')](_0x217ee0);};}exports['index']=function(_0x37c39f,_0x5e10ae){var _0x43498d={},_0x12ec88={},_0x348002={'count':0x0,'rows':[]};var _0x1e2966=_[_0x918e('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x2a0e42){return{'name':_0x2a0e42[_0x918e('0x32')],'type':_0x2a0e42['type'][_0x918e('0x33')]};});_0x12ec88[_0x918e('0x34')]=_[_0x918e('0x31')](_0x1e2966,_0x918e('0x2f'));_0x12ec88['query']=_[_0x918e('0x35')](_0x37c39f[_0x918e('0x36')]);_0x12ec88[_0x918e('0x37')]=_[_0x918e('0x38')](_0x12ec88['model'],_0x12ec88[_0x918e('0x36')]);_0x43498d[_0x918e('0x39')]=_[_0x918e('0x38')](_0x12ec88[_0x918e('0x34')],qs[_0x918e('0x3a')](_0x37c39f[_0x918e('0x36')][_0x918e('0x3a')]));_0x43498d[_0x918e('0x39')]=_0x43498d['attributes'][_0x918e('0x3b')]?_0x43498d[_0x918e('0x39')]:_0x12ec88[_0x918e('0x34')];if(!_0x37c39f[_0x918e('0x36')][_0x918e('0x3c')](_0x918e('0x3d'))){_0x43498d[_0x918e('0x26')]=qs['limit'](_0x37c39f[_0x918e('0x36')][_0x918e('0x26')]);_0x43498d[_0x918e('0x24')]=qs[_0x918e('0x24')](_0x37c39f[_0x918e('0x36')][_0x918e('0x24')]);}_0x43498d[_0x918e('0x3e')]=qs['sort'](_0x37c39f['query'][_0x918e('0x3f')]);_0x43498d['where']=qs[_0x918e('0x37')](_['pick'](_0x37c39f[_0x918e('0x36')],_0x12ec88[_0x918e('0x37')]),_0x1e2966);if(_0x37c39f[_0x918e('0x36')][_0x918e('0x40')]){_0x43498d['where']=_['merge'](_0x43498d[_0x918e('0x41')],{'$or':_[_0x918e('0x31')](_0x1e2966,function(_0x39eebe){if(_0x39eebe[_0x918e('0x42')]!==_0x918e('0x43')){var _0x160aee={};_0x160aee[_0x39eebe['name']]={'$like':'%'+_0x37c39f[_0x918e('0x36')][_0x918e('0x40')]+'%'};return _0x160aee;}})});}_0x43498d=_[_0x918e('0x44')]({},_0x43498d,_0x37c39f[_0x918e('0x45')]);var _0x3ea3c7={'where':_0x43498d[_0x918e('0x41')]};return db['ChatInternalMessage'][_0x918e('0x27')](_0x3ea3c7)[_0x918e('0x2c')](function(_0x4eb8be){_0x348002[_0x918e('0x27')]=_0x4eb8be;if(_0x37c39f[_0x918e('0x36')][_0x918e('0x46')]){_0x43498d[_0x918e('0x47')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x918e('0x48')](_0x43498d);})['then'](function(_0xf67e08){_0x348002['rows']=_0xf67e08;return _0x348002;})['then'](respondWithFilteredResult(_0x5e10ae,_0x43498d))[_0x918e('0x49')](handleError(_0x5e10ae,null));};exports['show']=function(_0x2d25e2,_0x5ebdd4){var _0x4e9007={'raw':!![],'where':{'id':_0x2d25e2[_0x918e('0x4a')]['id']}},_0x1a0769={};_0x1a0769[_0x918e('0x34')]=_[_0x918e('0x35')](db[_0x918e('0x4b')][_0x918e('0x4c')]);_0x1a0769[_0x918e('0x36')]=_[_0x918e('0x35')](_0x2d25e2[_0x918e('0x36')]);_0x1a0769['filters']=_[_0x918e('0x38')](_0x1a0769[_0x918e('0x34')],_0x1a0769['query']);_0x4e9007[_0x918e('0x39')]=_['intersection'](_0x1a0769[_0x918e('0x34')],qs['fields'](_0x2d25e2[_0x918e('0x36')][_0x918e('0x3a')]));_0x4e9007[_0x918e('0x39')]=_0x4e9007[_0x918e('0x39')][_0x918e('0x3b')]?_0x4e9007[_0x918e('0x39')]:_0x1a0769[_0x918e('0x34')];if(_0x2d25e2['query'][_0x918e('0x46')]){_0x4e9007[_0x918e('0x47')]=[{'all':!![]}];}_0x4e9007=_[_0x918e('0x44')]({},_0x4e9007,_0x2d25e2[_0x918e('0x45')]);return db[_0x918e('0x4b')][_0x918e('0x4d')](_0x4e9007)[_0x918e('0x2c')](handleEntityNotFound(_0x5ebdd4,null))[_0x918e('0x2c')](respondWithResult(_0x5ebdd4,null))[_0x918e('0x49')](handleError(_0x5ebdd4,null));};exports[_0x918e('0x4e')]=function(_0x3a9828,_0x192e63){return db['ChatInternalMessage'][_0x918e('0x4e')](_0x3a9828[_0x918e('0x4f')],{})[_0x918e('0x2c')](respondWithResult(_0x192e63,0xc9))[_0x918e('0x49')](handleError(_0x192e63,null));};exports[_0x918e('0x2b')]=function(_0x456d3b,_0x1ffd0a){if(_0x456d3b['body']['id']){delete _0x456d3b['body']['id'];}return db[_0x918e('0x4b')][_0x918e('0x4d')]({'where':{'id':_0x456d3b[_0x918e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ffd0a,null))[_0x918e('0x2c')](saveUpdates(_0x456d3b[_0x918e('0x4f')],null))[_0x918e('0x2c')](respondWithResult(_0x1ffd0a,null))[_0x918e('0x49')](handleError(_0x1ffd0a,null));};exports[_0x918e('0x50')]=function(_0x36be42,_0xa04da5){return db['ChatInternalMessage'][_0x918e('0x4d')]({'where':{'id':_0x36be42['params']['id']}})['then'](handleEntityNotFound(_0xa04da5,null))[_0x918e('0x2c')](removeEntity(_0xa04da5,null))[_0x918e('0x49')](handleError(_0xa04da5,null));};exports[_0x918e('0x51')]=function(_0x4b0ce3,_0x394878){return db[_0x918e('0x4b')][_0x918e('0x51')]()[_0x918e('0x2c')](respondWithResult(_0x394878,null))[_0x918e('0x49')](handleError(_0x394878,null));};function wrapUser(_0x5634f1){return function(_0x18abdd){var _0x3d8b20=_0x5634f1['get']({'plain':!![]});_0x3d8b20[_0x918e('0x52')]=[];if(_0x18abdd){_0x3d8b20[_0x918e('0x53')]=_0x18abdd[_0x918e('0x54')];_0x3d8b20[_0x918e('0x55')]=_0x18abdd;}else{_0x3d8b20[_0x918e('0x53')]=moment(0x0)[_0x918e('0x56')](_0x918e('0x57'));_0x3d8b20[_0x918e('0x55')]={};}return _0x3d8b20;};}exports[_0x918e('0x58')]=function(_0x7e2b95,_0x500f73,_0xe5caba){var _0x188e3c=[];return db[_0x918e('0x59')]['findAll']({'where':{'role':[_0x918e('0x5a'),_0x918e('0x5b'),_0x918e('0x5c')]},'attributes':['id','fullname',_0x918e('0x2f'),_0x918e('0x5d'),_0x918e('0x5e'),_0x918e('0x5f'),_0x918e('0x60'),'lastLoginAt',_0x918e('0x61'),_0x918e('0x62')],'order':qs[_0x918e('0x3f')](_0x918e('0x63')),'include':[{'model':db[_0x918e('0x64')],'as':_0x918e('0x65'),'attributes':['id',_0x918e('0x2f'),_0x918e('0x42')],'through':{'attributes':[]}}]})[_0x918e('0x2c')](function(_0x445ab3){if(_0x445ab3){var _0x51b31b=_0x7e2b95[_0x918e('0x5c')][_0x918e('0x66')]({'plain':!![]});if(!_0x51b31b)throw new Error(_0x918e('0x67'));if(_0x51b31b[_0x918e('0x5d')]==='user'){return db[_0x918e('0x68')][_0x918e('0x4d')]({'where':{'name':_0x918e('0x69'),'userProfileId':_0x51b31b[_0x918e('0x6a')]},'raw':!![]})[_0x918e('0x2c')](function(_0x44ad07){if(_0x44ad07){if(_0x44ad07[_0x918e('0x6b')]===0x0){return db[_0x918e('0x6c')][_0x918e('0x48')]({'where':{'sectionId':_0x44ad07['id']},'raw':!![]})[_0x918e('0x2c')](function(_0x1e9fd0){var _0x5745ea=[];if(_[_0x918e('0x6d')](_0x1e9fd0)){_0x5745ea=_[_0x918e('0x40')](_0x445ab3,function(_0x1af41a){if(_0x1af41a[_0x918e('0x5d')]!==_0x918e('0x5a')){return _0x1af41a;}});return _0x5745ea;}else{for(var _0x29971f=0x0;_0x29971f<_0x445ab3['length'];_0x29971f++){var _0x1a18f7=_0x445ab3[_0x29971f];if(_0x1a18f7[_0x918e('0x5d')]==='agent'){var _0x10fa98=_[_0x918e('0x4d')](_0x1e9fd0,function(_0x1e75fc){return _0x1e75fc[_0x918e('0x6e')]===_0x1a18f7['id'];});if(_0x10fa98)_0x5745ea[_0x918e('0x6f')](_0x1a18f7);}else{_0x5745ea['push'](_0x1a18f7);}}return _0x5745ea;}});}else{return _0x445ab3;}}else{var _0x1cef92=_[_0x918e('0x40')](_0x445ab3,function(_0x5be992){if(_0x5be992[_0x918e('0x5d')]!=='agent'){return _0x5be992;}});return _0x1cef92;}});}else{return _0x445ab3;}}})[_0x918e('0x2c')](function(_0x46f75a){var _0x2fdaf8=[];if(_0x46f75a){_0x188e3c=_0x46f75a;for(var _0x3a140b=0x0;_0x3a140b<_0x46f75a[_0x918e('0x3b')];_0x3a140b+=0x1){_0x188e3c[_0x3a140b][_0x918e('0x52')]=[];_0x2fdaf8[_0x918e('0x6f')](db['ChatInternalMessage'][_0x918e('0x4d')]({'where':{'FromId':[_0x7e2b95[_0x918e('0x5c')]['id'],_0x46f75a[_0x3a140b]['id']],'ToId':[_0x7e2b95[_0x918e('0x5c')]['id'],_0x46f75a[_0x3a140b]['id']],'ChatGroupId':null},'attributes':['id',_0x918e('0x54'),'FromId',_0x918e('0x70'),_0x918e('0x71'),'body'],'order':qs[_0x918e('0x3f')](_0x918e('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x918e('0x2c')](wrapUser(_0x46f75a[_0x3a140b])));}return BPromise['all'](_0x2fdaf8);}return[];})[_0x918e('0x2c')](function(_0x55cc5b){return{'rows':_0x55cc5b,'count':_0x55cc5b[_0x918e('0x3b')]};})[_0x918e('0x2c')](respondWithResult(_0x500f73,null))['catch'](handleError(_0x500f73,null));};
\ No newline at end of file
+var _0x724a=['end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','get','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','agent','admin','user','fullname','role','userpic','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','filter','resourceId','push','FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status'];(function(_0x127b2d,_0x109548){var _0x576ce2=function(_0x52900a){while(--_0x52900a){_0x127b2d['push'](_0x127b2d['shift']());}};_0x576ce2(++_0x109548);}(_0x724a,0x132));var _0xa724=function(_0x57fa12,_0x4b82fe){_0x57fa12=_0x57fa12-0x0;var _0x5dae05=_0x724a[_0x57fa12];return _0x5dae05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa724('0x0'));var zipdir=require(_0xa724('0x1'));var jsonpatch=require(_0xa724('0x2'));var rp=require(_0xa724('0x3'));var moment=require(_0xa724('0x4'));var BPromise=require(_0xa724('0x5'));var Mustache=require(_0xa724('0x6'));var util=require(_0xa724('0x7'));var path=require(_0xa724('0x8'));var sox=require(_0xa724('0x9'));var csv=require(_0xa724('0xa'));var ejs=require(_0xa724('0xb'));var fs=require('fs');var fs_extra=require(_0xa724('0xc'));var _=require(_0xa724('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa724('0xe'));var deskjs=require(_0xa724('0xf'));var toCsv=require(_0xa724('0xa'));var querystring=require(_0xa724('0x10'));var Papa=require(_0xa724('0x11'));var Redis=require(_0xa724('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa724('0x13'));var as=require(_0xa724('0x14'));var hardwareService=require(_0xa724('0x15'));var logger=require(_0xa724('0x16'))(_0xa724('0x17'));var utils=require('../../config/utils');var config=require(_0xa724('0x18'));var licenseUtil=require(_0xa724('0x19'));var db=require(_0xa724('0x1a'))['db'];config[_0xa724('0x1b')]=_['defaults'](config['redis'],{'host':_0xa724('0x1c'),'port':0x18eb});var socket=require(_0xa724('0x1d'))(new Redis(config[_0xa724('0x1b')]));require(_0xa724('0x1e'))[_0xa724('0x1f')](socket);function respondWithStatusCode(_0x2383e4,_0x4bb51f){_0x4bb51f=_0x4bb51f||0xcc;return function(_0x1ae7d1){if(_0x1ae7d1){return _0x2383e4['sendStatus'](_0x4bb51f);}return _0x2383e4[_0xa724('0x20')](_0x4bb51f)[_0xa724('0x21')]();};}function respondWithResult(_0x5ac2df,_0x3304e0){_0x3304e0=_0x3304e0||0xc8;return function(_0x47eff5){if(_0x47eff5){return _0x5ac2df[_0xa724('0x20')](_0x3304e0)[_0xa724('0x22')](_0x47eff5);}};}function respondWithFilteredResult(_0x1b6b49,_0xb394d){return function(_0x2f14e2){if(_0x2f14e2){var _0x26e5a2=typeof _0xb394d[_0xa724('0x23')]===_0xa724('0x24')&&typeof _0xb394d[_0xa724('0x25')]==='undefined';var _0x2c5adf=_0x2f14e2[_0xa724('0x26')];var _0x563fa3=_0x26e5a2?0x0:_0xb394d[_0xa724('0x23')];var _0x2f7760=_0x26e5a2?_0x2f14e2[_0xa724('0x26')]:_0xb394d[_0xa724('0x23')]+_0xb394d[_0xa724('0x25')];var _0xbe4c63;if(_0x2f7760>=_0x2c5adf){_0x2f7760=_0x2c5adf;_0xbe4c63=0xc8;}else{_0xbe4c63=0xce;}_0x1b6b49[_0xa724('0x20')](_0xbe4c63);return _0x1b6b49[_0xa724('0x27')](_0xa724('0x28'),_0x563fa3+'-'+_0x2f7760+'/'+_0x2c5adf)[_0xa724('0x22')](_0x2f14e2);}return null;};}function patchUpdates(_0x300ed0){return function(_0x283118){try{jsonpatch[_0xa724('0x29')](_0x283118,_0x300ed0,!![]);}catch(_0x22dfab){return BPromise['reject'](_0x22dfab);}return _0x283118[_0xa724('0x2a')]();};}function saveUpdates(_0x32404f,_0x1f19d2){return function(_0x559851){if(_0x559851){return _0x559851[_0xa724('0x2b')](_0x32404f)['then'](function(_0x15390f){return _0x15390f;});}return null;};}function removeEntity(_0x22ec0d,_0x206add){return function(_0x10b808){if(_0x10b808){return _0x10b808[_0xa724('0x2c')]()['then'](function(){_0x22ec0d[_0xa724('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5fe4,_0x13c93e){return function(_0x48816c){if(!_0x48816c){_0x3e5fe4[_0xa724('0x2d')](0x194);}return _0x48816c;};}function handleError(_0x55d9fa,_0x1b5fc2){_0x1b5fc2=_0x1b5fc2||0x1f4;return function(_0x13dc99){logger[_0xa724('0x2e')](_0x13dc99[_0xa724('0x2f')]);if(_0x13dc99[_0xa724('0x30')]){delete _0x13dc99[_0xa724('0x30')];}_0x55d9fa['status'](_0x1b5fc2)[_0xa724('0x31')](_0x13dc99);};}exports[_0xa724('0x32')]=function(_0x2712dc,_0x530232){var _0x2cf1f7={},_0x442a51={},_0x228023={'count':0x0,'rows':[]};var _0x172979=_[_0xa724('0x33')](db[_0xa724('0x34')][_0xa724('0x35')],function(_0x10bc32){return{'name':_0x10bc32[_0xa724('0x36')],'type':_0x10bc32[_0xa724('0x37')][_0xa724('0x38')]};});_0x442a51[_0xa724('0x39')]=_[_0xa724('0x33')](_0x172979,_0xa724('0x30'));_0x442a51[_0xa724('0x3a')]=_['keys'](_0x2712dc['query']);_0x442a51[_0xa724('0x3b')]=_[_0xa724('0x3c')](_0x442a51['model'],_0x442a51[_0xa724('0x3a')]);_0x2cf1f7['attributes']=_[_0xa724('0x3c')](_0x442a51[_0xa724('0x39')],qs[_0xa724('0x3d')](_0x2712dc[_0xa724('0x3a')][_0xa724('0x3d')]));_0x2cf1f7[_0xa724('0x3e')]=_0x2cf1f7[_0xa724('0x3e')][_0xa724('0x3f')]?_0x2cf1f7[_0xa724('0x3e')]:_0x442a51[_0xa724('0x39')];if(!_0x2712dc[_0xa724('0x3a')]['hasOwnProperty'](_0xa724('0x40'))){_0x2cf1f7[_0xa724('0x25')]=qs[_0xa724('0x25')](_0x2712dc[_0xa724('0x3a')][_0xa724('0x25')]);_0x2cf1f7['offset']=qs['offset'](_0x2712dc[_0xa724('0x3a')]['offset']);}_0x2cf1f7[_0xa724('0x41')]=qs[_0xa724('0x42')](_0x2712dc['query'][_0xa724('0x42')]);_0x2cf1f7['where']=qs[_0xa724('0x3b')](_['pick'](_0x2712dc[_0xa724('0x3a')],_0x442a51[_0xa724('0x3b')]),_0x172979);if(_0x2712dc[_0xa724('0x3a')]['filter']){_0x2cf1f7[_0xa724('0x43')]=_[_0xa724('0x44')](_0x2cf1f7[_0xa724('0x43')],{'$or':_['map'](_0x172979,function(_0x2b71f1){if(_0x2b71f1[_0xa724('0x37')]!==_0xa724('0x45')){var _0x11055e={};_0x11055e[_0x2b71f1[_0xa724('0x30')]]={'$like':'%'+_0x2712dc['query']['filter']+'%'};return _0x11055e;}})});}_0x2cf1f7=_['merge']({},_0x2cf1f7,_0x2712dc['options']);var _0x4711b9={'where':_0x2cf1f7[_0xa724('0x43')]};return db['ChatInternalMessage'][_0xa724('0x26')](_0x4711b9)[_0xa724('0x46')](function(_0x523d99){_0x228023[_0xa724('0x26')]=_0x523d99;if(_0x2712dc[_0xa724('0x3a')][_0xa724('0x47')]){_0x2cf1f7[_0xa724('0x48')]=[{'all':!![]}];}return db[_0xa724('0x34')][_0xa724('0x49')](_0x2cf1f7);})[_0xa724('0x46')](function(_0x1b9097){_0x228023[_0xa724('0x4a')]=_0x1b9097;return _0x228023;})[_0xa724('0x46')](respondWithFilteredResult(_0x530232,_0x2cf1f7))[_0xa724('0x4b')](handleError(_0x530232,null));};exports[_0xa724('0x4c')]=function(_0x1af9c3,_0x1f60db){var _0x2fe028={'raw':!![],'where':{'id':_0x1af9c3['params']['id']}},_0x4d8a24={};_0x4d8a24[_0xa724('0x39')]=_[_0xa724('0x4d')](db['ChatInternalMessage'][_0xa724('0x35')]);_0x4d8a24[_0xa724('0x3a')]=_['keys'](_0x1af9c3[_0xa724('0x3a')]);_0x4d8a24[_0xa724('0x3b')]=_[_0xa724('0x3c')](_0x4d8a24[_0xa724('0x39')],_0x4d8a24['query']);_0x2fe028['attributes']=_[_0xa724('0x3c')](_0x4d8a24['model'],qs[_0xa724('0x3d')](_0x1af9c3[_0xa724('0x3a')][_0xa724('0x3d')]));_0x2fe028[_0xa724('0x3e')]=_0x2fe028[_0xa724('0x3e')][_0xa724('0x3f')]?_0x2fe028['attributes']:_0x4d8a24[_0xa724('0x39')];if(_0x1af9c3[_0xa724('0x3a')][_0xa724('0x47')]){_0x2fe028[_0xa724('0x48')]=[{'all':!![]}];}_0x2fe028=_[_0xa724('0x44')]({},_0x2fe028,_0x1af9c3[_0xa724('0x4e')]);return db[_0xa724('0x34')][_0xa724('0x4f')](_0x2fe028)['then'](handleEntityNotFound(_0x1f60db,null))[_0xa724('0x46')](respondWithResult(_0x1f60db,null))[_0xa724('0x4b')](handleError(_0x1f60db,null));};exports['create']=function(_0x7d8897,_0x44fc5f){return db[_0xa724('0x34')][_0xa724('0x50')](_0x7d8897[_0xa724('0x51')],{})['then'](respondWithResult(_0x44fc5f,0xc9))[_0xa724('0x4b')](handleError(_0x44fc5f,null));};exports[_0xa724('0x2b')]=function(_0x4e6632,_0x294668){if(_0x4e6632['body']['id']){delete _0x4e6632[_0xa724('0x51')]['id'];}return db[_0xa724('0x34')]['find']({'where':{'id':_0x4e6632['params']['id']}})[_0xa724('0x46')](handleEntityNotFound(_0x294668,null))['then'](saveUpdates(_0x4e6632[_0xa724('0x51')],null))[_0xa724('0x46')](respondWithResult(_0x294668,null))[_0xa724('0x4b')](handleError(_0x294668,null));};exports[_0xa724('0x2c')]=function(_0x2d00eb,_0x45bf6a){return db[_0xa724('0x34')][_0xa724('0x4f')]({'where':{'id':_0x2d00eb[_0xa724('0x52')]['id']}})['then'](handleEntityNotFound(_0x45bf6a,null))['then'](removeEntity(_0x45bf6a,null))[_0xa724('0x4b')](handleError(_0x45bf6a,null));};exports[_0xa724('0x53')]=function(_0x2d206d,_0x49a838){return db['ChatInternalMessage'][_0xa724('0x53')]()[_0xa724('0x46')](respondWithResult(_0x49a838,null))['catch'](handleError(_0x49a838,null));};function wrapUser(_0x280b6c){return function(_0x2e1512){var _0x119aac=_0x280b6c[_0xa724('0x54')]({'plain':!![]});_0x119aac[_0xa724('0x55')]=[];if(_0x2e1512){_0x119aac['lastMessageAt']=_0x2e1512[_0xa724('0x56')];_0x119aac['lastMessage']=_0x2e1512;}else{_0x119aac['lastMessageAt']=moment(0x0)[_0xa724('0x57')](_0xa724('0x58'));_0x119aac[_0xa724('0x59')]={};}return _0x119aac;};}exports['getUsers']=function(_0x499bd9,_0x47c5fa,_0x31c2c6){var _0x106754=[];return db['User']['findAll']({'where':{'role':[_0xa724('0x5a'),_0xa724('0x5b'),_0xa724('0x5c')]},'attributes':['id',_0xa724('0x5d'),_0xa724('0x30'),_0xa724('0x5e'),_0xa724('0x5f'),'internal',_0xa724('0x60'),_0xa724('0x61'),'allowmessenger',_0xa724('0x62')],'order':qs[_0xa724('0x42')](_0xa724('0x63')),'include':[{'model':db[_0xa724('0x64')],'as':_0xa724('0x65'),'attributes':['id',_0xa724('0x30'),_0xa724('0x37')],'through':{'attributes':[]}}]})[_0xa724('0x46')](function(_0x47f805){if(_0x47f805){var _0x5eeda4=_0x499bd9[_0xa724('0x5c')][_0xa724('0x54')]({'plain':!![]});if(!_0x5eeda4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5eeda4[_0xa724('0x5e')]===_0xa724('0x5c')){return db[_0xa724('0x66')][_0xa724('0x4f')]({'where':{'name':_0xa724('0x67'),'userProfileId':_0x5eeda4['userProfileId']},'raw':!![]})[_0xa724('0x46')](function(_0x21cb7c){if(_0x21cb7c){if(_0x21cb7c[_0xa724('0x68')]===0x0){return db[_0xa724('0x69')][_0xa724('0x49')]({'where':{'sectionId':_0x21cb7c['id']},'raw':!![]})[_0xa724('0x46')](function(_0x4e9ace){var _0x186914=[];if(_['isEmpty'](_0x4e9ace)){_0x186914=_[_0xa724('0x6a')](_0x47f805,function(_0x14b64a){if(_0x14b64a[_0xa724('0x5e')]!=='agent'){return _0x14b64a;}});return _0x186914;}else{for(var _0x1c251a=0x0;_0x1c251a<_0x47f805['length'];_0x1c251a++){var _0x1494f7=_0x47f805[_0x1c251a];if(_0x1494f7[_0xa724('0x5e')]==='agent'){var _0x38dceb=_[_0xa724('0x4f')](_0x4e9ace,function(_0x533888){return _0x533888[_0xa724('0x6b')]===_0x1494f7['id'];});if(_0x38dceb)_0x186914[_0xa724('0x6c')](_0x1494f7);}else{_0x186914[_0xa724('0x6c')](_0x1494f7);}}return _0x186914;}});}else{return _0x47f805;}}else{var _0x359a72=_[_0xa724('0x6a')](_0x47f805,function(_0x154d46){if(_0x154d46[_0xa724('0x5e')]!==_0xa724('0x5a')){return _0x154d46;}});return _0x359a72;}});}else{return _0x47f805;}}})[_0xa724('0x46')](function(_0x36ba6f){var _0x22bb8d=[];if(_0x36ba6f){_0x106754=_0x36ba6f;for(var _0x145a23=0x0;_0x145a23<_0x36ba6f[_0xa724('0x3f')];_0x145a23+=0x1){_0x106754[_0x145a23][_0xa724('0x55')]=[];_0x22bb8d['push'](db['ChatInternalMessage'][_0xa724('0x4f')]({'where':{'FromId':[_0x499bd9[_0xa724('0x5c')]['id'],_0x36ba6f[_0x145a23]['id']],'ToId':[_0x499bd9[_0xa724('0x5c')]['id'],_0x36ba6f[_0x145a23]['id']],'ChatGroupId':null},'attributes':['id',_0xa724('0x56'),_0xa724('0x6d'),'ToId',_0xa724('0x6e'),_0xa724('0x51')],'order':qs[_0xa724('0x42')](_0xa724('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x36ba6f[_0x145a23])));}return BPromise[_0xa724('0x70')](_0x22bb8d);}return[];})['then'](function(_0x5c6b2b){return{'rows':_0x5c6b2b,'count':_0x5c6b2b[_0xa724('0x3f')]};})[_0xa724('0x46')](respondWithResult(_0x47c5fa,null))[_0xa724('0x4b')](handleError(_0x47c5fa,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index de9dc3c..b8f5553 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 _0x3feb=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x1b515f,_0x52aa6b){var _0x66ff73=function(_0x2cc081){while(--_0x2cc081){_0x1b515f['push'](_0x1b515f['shift']());}};_0x66ff73(++_0x52aa6b);}(_0x3feb,0x192));var _0xb3fe=function(_0x209f89,_0x262e13){_0x209f89=_0x209f89-0x0;var _0x2ab03b=_0x3feb[_0x209f89];return _0x2ab03b;};'use strict';var EventEmitter=require(_0xb3fe('0x0'));var ChatInternalMessage=require(_0xb3fe('0x1'))['db'][_0xb3fe('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb3fe('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb3fe('0x4'),'afterDestroy':_0xb3fe('0x5')};function emitEvent(_0x2081a5){return function(_0x5dcd60,_0x399a43,_0x9e46a7){ChatInternalMessageEvents[_0xb3fe('0x6')](_0x2081a5+':'+_0x5dcd60['id'],_0x5dcd60);ChatInternalMessageEvents[_0xb3fe('0x6')](_0x2081a5,_0x5dcd60);_0x9e46a7(null);};}for(var e in events){if(events[_0xb3fe('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb3fe('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x2143=['events','../../mysqldb','ChatInternalMessage','save','update','emit','hasOwnProperty','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2143,0xf0));var _0x3214=function(_0x25d895,_0x455c2e){_0x25d895=_0x25d895-0x0;var _0x10a795=_0x2143[_0x25d895];return _0x10a795;};'use strict';var EventEmitter=require(_0x3214('0x0'));var ChatInternalMessage=require(_0x3214('0x1'))['db'][_0x3214('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3214('0x3'),'afterUpdate':_0x3214('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f46cf){return function(_0x3539a2,_0x481fd1,_0x18373c){ChatInternalMessageEvents[_0x3214('0x5')](_0x3f46cf+':'+_0x3539a2['id'],_0x3539a2);ChatInternalMessageEvents['emit'](_0x3f46cf,_0x3539a2);_0x18373c(null);};}for(var e in events){if(events[_0x3214('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3214('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 05ab22d..ed3cd96 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 _0x0776=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42cf3e,_0x50abbe){var _0x184386=function(_0x35abf4){while(--_0x35abf4){_0x42cf3e['push'](_0x42cf3e['shift']());}};_0x184386(++_0x50abbe);}(_0x0776,0x10f));var _0x6077=function(_0x7ff9d2,_0x24174f){_0x7ff9d2=_0x7ff9d2-0x0;var _0x518d33=_0x0776[_0x7ff9d2];return _0x518d33;};'use strict';var _=require(_0x6077('0x0'));var util=require('util');var logger=require(_0x6077('0x1'))(_0x6077('0x2'));var moment=require(_0x6077('0x3'));var BPromise=require(_0x6077('0x4'));var rp=require(_0x6077('0x5'));var fs=require('fs');var path=require(_0x6077('0x6'));var rimraf=require(_0x6077('0x7'));var config=require(_0x6077('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x6077('0x9')]=function(_0x3aeee3,_0x36f3e1){return _0x3aeee3[_0x6077('0xa')](_0x6077('0xb'),attributes,{'tableName':_0x6077('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6077('0xd')});};
\ No newline at end of file
+var _0x64b5=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','api','bluebird'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0x64b5,0x15a));var _0x564b=function(_0x220c72,_0xa3b034){_0x220c72=_0x220c72-0x0;var _0x178cae=_0x64b5[_0x220c72];return _0x178cae;};'use strict';var _=require(_0x564b('0x0'));var util=require(_0x564b('0x1'));var logger=require('../../config/logger')(_0x564b('0x2'));var moment=require('moment');var BPromise=require(_0x564b('0x3'));var rp=require(_0x564b('0x4'));var fs=require('fs');var path=require(_0x564b('0x5'));var rimraf=require(_0x564b('0x6'));var config=require(_0x564b('0x7'));var attributes=require(_0x564b('0x8'));module[_0x564b('0x9')]=function(_0x529f1b,_0x1bb61a){return _0x529f1b[_0x564b('0xa')](_0x564b('0xb'),attributes,{'tableName':_0x564b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x564b('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index a0c53cc..76cc7a0 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 _0xadb2=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x596565,_0x1258ad){var _0x474b1b=function(_0x2bbf2d){while(--_0x2bbf2d){_0x596565['push'](_0x596565['shift']());}};_0x474b1b(++_0x1258ad);}(_0xadb2,0x80));var _0x2adb=function(_0x11b4e6,_0x124b6c){_0x11b4e6=_0x11b4e6-0x0;var _0x284a2f=_0xadb2[_0x11b4e6];return _0x284a2f;};'use strict';var _=require(_0x2adb('0x0'));var util=require(_0x2adb('0x1'));var moment=require(_0x2adb('0x2'));var BPromise=require(_0x2adb('0x3'));var rs=require(_0x2adb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2adb('0x5'))['db'];var utils=require(_0x2adb('0x6'));var logger=require(_0x2adb('0x7'))(_0x2adb('0x8'));var config=require('../../config/environment');var jayson=require(_0x2adb('0x9'));var client=jayson['client'][_0x2adb('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2adb('0xb')],{'host':_0x2adb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2adb('0xb')]));require(_0x2adb('0xd'))[_0x2adb('0xe')](socket);function respondWithRpcPromise(_0x31097b,_0x426747,_0x434e5a){return new BPromise(function(_0x11565a,_0x30a2b9){return client[_0x2adb('0xf')](_0x31097b,_0x434e5a)['then'](function(_0x24d2fe){logger[_0x2adb('0x10')](_0x2adb('0x11'),_0x426747,_0x2adb('0x12'));logger[_0x2adb('0x13')](_0x2adb('0x14'),_0x426747,_0x2adb('0x12'),JSON[_0x2adb('0x15')](_0x24d2fe));if(_0x24d2fe[_0x2adb('0x16')]){if(_0x24d2fe['error']['code']===0x1f4){logger[_0x2adb('0x16')](_0x2adb('0x11'),_0x426747,_0x24d2fe[_0x2adb('0x16')][_0x2adb('0x17')]);return _0x30a2b9(_0x24d2fe['error'][_0x2adb('0x17')]);}logger[_0x2adb('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x426747,_0x24d2fe['error'][_0x2adb('0x17')]);return _0x11565a(_0x24d2fe['error'][_0x2adb('0x17')]);}else{logger[_0x2adb('0x10')](_0x2adb('0x11'),_0x426747,_0x2adb('0x12'));_0x11565a(_0x24d2fe[_0x2adb('0x18')][_0x2adb('0x17')]);}})[_0x2adb('0x19')](function(_0x5696a4){logger[_0x2adb('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x426747,_0x5696a4);_0x30a2b9(_0x5696a4);});});}
\ No newline at end of file
+var _0xf3c6=['socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x40c76b,_0x4d33ae){var _0x393722=function(_0x18d8d1){while(--_0x18d8d1){_0x40c76b['push'](_0x40c76b['shift']());}};_0x393722(++_0x4d33ae);}(_0xf3c6,0xc3));var _0x6f3c=function(_0x81a333,_0x120401){_0x81a333=_0x81a333-0x0;var _0x5068cb=_0xf3c6[_0x81a333];return _0x5068cb;};'use strict';var _=require(_0x6f3c('0x0'));var util=require(_0x6f3c('0x1'));var moment=require(_0x6f3c('0x2'));var BPromise=require(_0x6f3c('0x3'));var rs=require(_0x6f3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f3c('0x5'))['db'];var utils=require(_0x6f3c('0x6'));var logger=require(_0x6f3c('0x7'))(_0x6f3c('0x8'));var config=require(_0x6f3c('0x9'));var jayson=require(_0x6f3c('0xa'));var client=jayson[_0x6f3c('0xb')]['http']({'port':0x232a});config[_0x6f3c('0xc')]=_[_0x6f3c('0xd')](config[_0x6f3c('0xc')],{'host':_0x6f3c('0xe'),'port':0x18eb});var socket=require(_0x6f3c('0xf'))(new Redis(config[_0x6f3c('0xc')]));require('./chatInternalMessage.socket')[_0x6f3c('0x10')](socket);function respondWithRpcPromise(_0x4999f9,_0x1b6a19,_0x43c5b0){return new BPromise(function(_0x56787e,_0x6daf26){return client[_0x6f3c('0x11')](_0x4999f9,_0x43c5b0)[_0x6f3c('0x12')](function(_0x29b7e6){logger[_0x6f3c('0x13')](_0x6f3c('0x14'),_0x1b6a19,_0x6f3c('0x15'));logger[_0x6f3c('0x16')](_0x6f3c('0x17'),_0x1b6a19,'request\x20sent',JSON[_0x6f3c('0x18')](_0x29b7e6));if(_0x29b7e6['error']){if(_0x29b7e6[_0x6f3c('0x19')][_0x6f3c('0x1a')]===0x1f4){logger[_0x6f3c('0x19')](_0x6f3c('0x14'),_0x1b6a19,_0x29b7e6['error'][_0x6f3c('0x1b')]);return _0x6daf26(_0x29b7e6['error'][_0x6f3c('0x1b')]);}logger[_0x6f3c('0x19')](_0x6f3c('0x14'),_0x1b6a19,_0x29b7e6[_0x6f3c('0x19')][_0x6f3c('0x1b')]);return _0x56787e(_0x29b7e6[_0x6f3c('0x19')][_0x6f3c('0x1b')]);}else{logger[_0x6f3c('0x13')](_0x6f3c('0x14'),_0x1b6a19,_0x6f3c('0x15'));_0x56787e(_0x29b7e6[_0x6f3c('0x1c')]['message']);}})[_0x6f3c('0x1d')](function(_0x57941e){logger['error'](_0x6f3c('0x14'),_0x1b6a19,_0x57941e);_0x6daf26(_0x57941e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 85a0eb5..fa94ccd 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 _0x9963=['removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0xbd469f,_0x380646){var _0x461b9f=function(_0x2717f7){while(--_0x2717f7){_0xbd469f['push'](_0xbd469f['shift']());}};_0x461b9f(++_0x380646);}(_0x9963,0x83));var _0x3996=function(_0x39479f,_0x822ae4){_0x39479f=_0x39479f-0x0;var _0x4a6d96=_0x9963[_0x39479f];return _0x4a6d96;};'use strict';var ChatInternalMessageEvents=require(_0x3996('0x0'));var events=[_0x3996('0x1'),_0x3996('0x2'),_0x3996('0x3')];function createListener(_0x37e7d1,_0x867633){return function(_0x849576){_0x867633[_0x3996('0x4')](_0x37e7d1,_0x849576);};}function removeListener(_0xbc393d,_0x138404){return function(){ChatInternalMessageEvents[_0x3996('0x5')](_0xbc393d,_0x138404);};}exports[_0x3996('0x6')]=function(_0x1f6f5f){for(var _0x397979=0x0,_0x51224d=events['length'];_0x397979<_0x51224d;_0x397979++){var _0x1cc774=events[_0x397979];var _0x1a1595=createListener(_0x3996('0x7')+_0x1cc774,_0x1f6f5f);ChatInternalMessageEvents['on'](_0x1cc774,_0x1a1595);}};
\ No newline at end of file
+var _0x20cf=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20cf,0x14e));var _0xf20c=function(_0xa13f71,_0x3fd65e){_0xa13f71=_0xa13f71-0x0;var _0x369283=_0x20cf[_0xa13f71];return _0x369283;};'use strict';var ChatInternalMessageEvents=require(_0xf20c('0x0'));var events=['save',_0xf20c('0x1'),_0xf20c('0x2')];function createListener(_0x13be4f,_0x3fbc24){return function(_0x52a235){_0x3fbc24[_0xf20c('0x3')](_0x13be4f,_0x52a235);};}function removeListener(_0x1fbb89,_0x2648a9){return function(){ChatInternalMessageEvents[_0xf20c('0x4')](_0x1fbb89,_0x2648a9);};}exports[_0xf20c('0x5')]=function(_0x3f6315){for(var _0x27833b=0x0,_0x529f77=events['length'];_0x27833b<_0x529f77;_0x27833b++){var _0x2bb24d=events[_0x27833b];var _0x5e34f6=createListener(_0xf20c('0x6')+_0x2bb24d,_0x3f6315);ChatInternalMessageEvents['on'](_0x2bb24d,_0x5e34f6);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index f3b05d7..2317901 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 _0xfb13=['/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','getUsers','show','create','put'];(function(_0x2b8ead,_0x4ac69b){var _0x2faa50=function(_0x18b467){while(--_0x18b467){_0x2b8ead['push'](_0x2b8ead['shift']());}};_0x2faa50(++_0x4ac69b);}(_0xfb13,0xb8));var _0x3fb1=function(_0x507251,_0x8939b9){_0x507251=_0x507251-0x0;var _0x70df28=_0xfb13[_0x507251];return _0x70df28;};'use strict';var multer=require(_0x3fb1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3fb1('0x1'));var express=require(_0x3fb1('0x2'));var router=express[_0x3fb1('0x3')]();var fs_extra=require(_0x3fb1('0x4'));var auth=require(_0x3fb1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3fb1('0x6'));var controller=require(_0x3fb1('0x7'));router[_0x3fb1('0x8')]('/',auth[_0x3fb1('0x9')](),controller['index']);router[_0x3fb1('0x8')](_0x3fb1('0xa'),auth[_0x3fb1('0x9')](),controller['describe']);router[_0x3fb1('0x8')](_0x3fb1('0xb'),auth['isAuthenticated'](),controller[_0x3fb1('0xc')]);router[_0x3fb1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3fb1('0xd')]);router['post']('/',auth[_0x3fb1('0x9')](),controller[_0x3fb1('0xe')]);router[_0x3fb1('0xf')](_0x3fb1('0x10'),controller[_0x3fb1('0x11')]);router[_0x3fb1('0x12')](_0x3fb1('0x10'),auth[_0x3fb1('0x9')](),controller[_0x3fb1('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xbc7c=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','put','update','delete'];(function(_0x206adf,_0x2ba1a3){var _0x171caa=function(_0x43abe7){while(--_0x43abe7){_0x206adf['push'](_0x206adf['shift']());}};_0x171caa(++_0x2ba1a3);}(_0xbc7c,0x1a4));var _0xcbc7=function(_0x3f9d5d,_0x4ee8dd){_0x3f9d5d=_0x3f9d5d-0x0;var _0x1b2cd7=_0xbc7c[_0x3f9d5d];return _0x1b2cd7;};'use strict';var multer=require('multer');var util=require(_0xcbc7('0x0'));var path=require('path');var timeout=require(_0xcbc7('0x1'));var express=require(_0xcbc7('0x2'));var router=express[_0xcbc7('0x3')]();var fs_extra=require(_0xcbc7('0x4'));var auth=require(_0xcbc7('0x5'));var interaction=require(_0xcbc7('0x6'));var config=require(_0xcbc7('0x7'));var controller=require(_0xcbc7('0x8'));router[_0xcbc7('0x9')]('/',auth[_0xcbc7('0xa')](),controller[_0xcbc7('0xb')]);router[_0xcbc7('0x9')](_0xcbc7('0xc'),auth[_0xcbc7('0xa')](),controller['describe']);router[_0xcbc7('0x9')](_0xcbc7('0xd'),auth[_0xcbc7('0xa')](),controller[_0xcbc7('0xe')]);router[_0xcbc7('0x9')](_0xcbc7('0xf'),auth[_0xcbc7('0xa')](),controller[_0xcbc7('0x10')]);router['post']('/',auth[_0xcbc7('0xa')](),controller['create']);router[_0xcbc7('0x11')]('/:id',controller[_0xcbc7('0x12')]);router[_0xcbc7('0x13')](_0xcbc7('0xf'),auth[_0xcbc7('0xa')](),controller[_0xcbc7('0x14')]);module[_0xcbc7('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 239c6ac..b66f46e 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 _0x2032=['STRING','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x2c842e,_0x53eb06){var _0x1fd985=function(_0x2cf21a){while(--_0x2cf21a){_0x2c842e['push'](_0x2c842e['shift']());}};_0x1fd985(++_0x53eb06);}(_0x2032,0xd9));var _0x2203=function(_0x314889,_0x46fd40){_0x314889=_0x314889-0x0;var _0x29859a=_0x2032[_0x314889];return _0x29859a;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2203('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2203('0x4')]('in','out'),'defaultValue':_0x2203('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2203('0x6')]},'providerName':{'type':Sequelize[_0x2203('0x7')]},'providerResponse':{'type':Sequelize[_0x2203('0x1')]}};
\ No newline at end of file
+var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x179b7b,_0x57b44d){var _0x5eea20=function(_0x5582aa){while(--_0x5582aa){_0x179b7b['push'](_0x179b7b['shift']());}};_0x5eea20(++_0x57b44d);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x4081a5,_0x27e9e2){_0x4081a5=_0x4081a5-0x0;var _0x59f5d9=_0xe2ab[_0x4081a5];return _0x59f5d9;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 9592f60..0b874b8 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 _0x462d=['findAll','rows','show','params','rawAttributes','keys','length','find','create','body','describe','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','interface','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','ChatMessage','fieldName','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x462d,0xbc));var _0xd462=function(_0x19e73e,_0x5e6abd){_0x19e73e=_0x19e73e-0x0;var _0x3af71a=_0x462d[_0x19e73e];return _0x3af71a;};'use strict';var emlformat=require(_0xd462('0x0'));var rimraf=require(_0xd462('0x1'));var zipdir=require(_0xd462('0x2'));var jsonpatch=require(_0xd462('0x3'));var rp=require(_0xd462('0x4'));var moment=require(_0xd462('0x5'));var BPromise=require(_0xd462('0x6'));var Mustache=require(_0xd462('0x7'));var util=require(_0xd462('0x8'));var path=require(_0xd462('0x9'));var sox=require(_0xd462('0xa'));var csv=require(_0xd462('0xb'));var ejs=require(_0xd462('0xc'));var fs=require('fs');var fs_extra=require(_0xd462('0xd'));var _=require(_0xd462('0xe'));var squel=require(_0xd462('0xf'));var crypto=require(_0xd462('0x10'));var jsforce=require(_0xd462('0x11'));var deskjs=require(_0xd462('0x12'));var toCsv=require(_0xd462('0xb'));var querystring=require(_0xd462('0x13'));var Papa=require('papaparse');var Redis=require(_0xd462('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd462('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd462('0x16'))(_0xd462('0x17'));var utils=require(_0xd462('0x18'));var config=require(_0xd462('0x19'));var licenseUtil=require(_0xd462('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd462('0x1b')]=_['defaults'](config[_0xd462('0x1b')],{'host':_0xd462('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd462('0x1b')]));require(_0xd462('0x1d'))[_0xd462('0x1e')](socket);var jayson=require(_0xd462('0x1f'));var client=jayson['client'][_0xd462('0x20')]({'port':0x232c});var client9002=jayson[_0xd462('0x21')][_0xd462('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xecc467,_0x4728fc,_0x4e44e0,_0x289314){return new BPromise(function(_0x1f5b20,_0x342d74){var _0x586c6f=_0x289314||client;return _0x586c6f[_0xd462('0x22')](_0xecc467,_0x4e44e0)[_0xd462('0x23')](function(_0x578e37){logger[_0xd462('0x24')](_0xd462('0x25'),_0x4728fc,_0xd462('0x26'));logger[_0xd462('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4728fc,_0xd462('0x26'),JSON[_0xd462('0x28')](_0x578e37));if(_0x578e37[_0xd462('0x29')]){if(_0x578e37[_0xd462('0x29')][_0xd462('0x2a')]===0x1f4){logger[_0xd462('0x29')]('ChatMessage,\x20%s,\x20%s',_0x4728fc,_0x578e37[_0xd462('0x29')][_0xd462('0x2b')]);return _0x342d74(_0x578e37[_0xd462('0x29')]['message']);}logger[_0xd462('0x29')](_0xd462('0x25'),_0x4728fc,_0x578e37[_0xd462('0x29')]['message']);return _0x1f5b20(_0x578e37[_0xd462('0x29')][_0xd462('0x2b')]);}else{logger['info'](_0xd462('0x25'),_0x4728fc,_0xd462('0x26'));_0x1f5b20(_0x578e37[_0xd462('0x2c')]['message']);}})[_0xd462('0x2d')](function(_0x4bb145){logger[_0xd462('0x29')](_0xd462('0x25'),_0x4728fc,_0x4bb145);_0x342d74(_0x4bb145);});});}function respondWithStatusCode(_0x54883a,_0x5f456b){_0x5f456b=_0x5f456b||0xcc;return function(_0x3f589a){if(_0x3f589a){return _0x54883a[_0xd462('0x2e')](_0x5f456b);}return _0x54883a['status'](_0x5f456b)[_0xd462('0x2f')]();};}function respondWithResult(_0x4466d7,_0x5485bb){_0x5485bb=_0x5485bb||0xc8;return function(_0x38fe3c){if(_0x38fe3c){return _0x4466d7[_0xd462('0x30')](_0x5485bb)['json'](_0x38fe3c);}};}function respondWithFilteredResult(_0x404e8a,_0x2b21c3){return function(_0x25cc4c){if(_0x25cc4c){var _0x575ee5=typeof _0x2b21c3[_0xd462('0x31')]===_0xd462('0x32')&&typeof _0x2b21c3[_0xd462('0x33')]===_0xd462('0x32');var _0x2ba2a4=_0x25cc4c['count'];var _0x1610cd=_0x575ee5?0x0:_0x2b21c3[_0xd462('0x31')];var _0x4ed251=_0x575ee5?_0x25cc4c[_0xd462('0x34')]:_0x2b21c3['offset']+_0x2b21c3[_0xd462('0x33')];var _0x52cc80;if(_0x4ed251>=_0x2ba2a4){_0x4ed251=_0x2ba2a4;_0x52cc80=0xc8;}else{_0x52cc80=0xce;}_0x404e8a[_0xd462('0x30')](_0x52cc80);return _0x404e8a[_0xd462('0x35')](_0xd462('0x36'),_0x1610cd+'-'+_0x4ed251+'/'+_0x2ba2a4)['json'](_0x25cc4c);}return null;};}function patchUpdates(_0x2b8c0d){return function(_0x5611c3){try{jsonpatch[_0xd462('0x37')](_0x5611c3,_0x2b8c0d,!![]);}catch(_0x65131){return BPromise[_0xd462('0x38')](_0x65131);}return _0x5611c3[_0xd462('0x39')]();};}function saveUpdates(_0x53af71,_0x26c617){return function(_0x1a5a16){if(_0x1a5a16){return _0x1a5a16[_0xd462('0x3a')](_0x53af71)[_0xd462('0x23')](function(_0x4007e2){return _0x4007e2;});}return null;};}function removeEntity(_0x18805a,_0x4649a1){return function(_0x5246e2){if(_0x5246e2){return _0x5246e2[_0xd462('0x3b')]()[_0xd462('0x23')](function(){_0x18805a[_0xd462('0x30')](0xcc)[_0xd462('0x2f')]();});}};}function handleEntityNotFound(_0x4b740f,_0x33e19a){return function(_0x1ee2ba){if(!_0x1ee2ba){_0x4b740f[_0xd462('0x2e')](0x194);}return _0x1ee2ba;};}function handleError(_0x4448bd,_0x2c834a){_0x2c834a=_0x2c834a||0x1f4;return function(_0x418ccb){logger[_0xd462('0x29')](_0x418ccb[_0xd462('0x3c')]);if(_0x418ccb[_0xd462('0x3d')]){delete _0x418ccb['name'];}_0x4448bd[_0xd462('0x30')](_0x2c834a)['send'](_0x418ccb);};}exports[_0xd462('0x3e')]=function(_0x1d9e34,_0x54320d){var _0x328b5b={},_0x2fbaa1={},_0x43ec5f={'count':0x0,'rows':[]};var _0x4c4479=_[_0xd462('0x3f')](db[_0xd462('0x40')]['rawAttributes'],function(_0x4afa36){return{'name':_0x4afa36[_0xd462('0x41')],'type':_0x4afa36['type'][_0xd462('0x42')]};});_0x2fbaa1['model']=_['map'](_0x4c4479,'name');_0x2fbaa1[_0xd462('0x43')]=_['keys'](_0x1d9e34[_0xd462('0x43')]);_0x2fbaa1[_0xd462('0x44')]=_['intersection'](_0x2fbaa1['model'],_0x2fbaa1[_0xd462('0x43')]);_0x328b5b[_0xd462('0x45')]=_[_0xd462('0x46')](_0x2fbaa1[_0xd462('0x47')],qs[_0xd462('0x48')](_0x1d9e34['query'][_0xd462('0x48')]));_0x328b5b[_0xd462('0x45')]=_0x328b5b[_0xd462('0x45')]['length']?_0x328b5b[_0xd462('0x45')]:_0x2fbaa1[_0xd462('0x47')];if(!_0x1d9e34['query'][_0xd462('0x49')](_0xd462('0x4a'))){_0x328b5b[_0xd462('0x33')]=qs[_0xd462('0x33')](_0x1d9e34['query']['limit']);_0x328b5b[_0xd462('0x31')]=qs['offset'](_0x1d9e34[_0xd462('0x43')]['offset']);}_0x328b5b[_0xd462('0x4b')]=qs[_0xd462('0x4c')](_0x1d9e34[_0xd462('0x43')][_0xd462('0x4c')]);_0x328b5b['where']=qs[_0xd462('0x44')](_[_0xd462('0x4d')](_0x1d9e34['query'],_0x2fbaa1[_0xd462('0x44')]),_0x4c4479);if(_0x1d9e34['query'][_0xd462('0x4e')]){_0x328b5b[_0xd462('0x4f')]=_[_0xd462('0x50')](_0x328b5b[_0xd462('0x4f')],{'$or':_[_0xd462('0x3f')](_0x4c4479,function(_0x1d1d7a){if(_0x1d1d7a[_0xd462('0x51')]!==_0xd462('0x52')){var _0x11f8c6={};_0x11f8c6[_0x1d1d7a[_0xd462('0x3d')]]={'$like':'%'+_0x1d9e34['query'][_0xd462('0x4e')]+'%'};return _0x11f8c6;}})});}_0x328b5b=_[_0xd462('0x50')]({},_0x328b5b,_0x1d9e34[_0xd462('0x53')]);var _0x405476={'where':_0x328b5b[_0xd462('0x4f')]};return db['ChatMessage'][_0xd462('0x34')](_0x405476)[_0xd462('0x23')](function(_0x9c8147){_0x43ec5f[_0xd462('0x34')]=_0x9c8147;if(_0x1d9e34['query'][_0xd462('0x54')]){_0x328b5b[_0xd462('0x55')]=[{'all':!![]}];}return db[_0xd462('0x40')][_0xd462('0x56')](_0x328b5b);})[_0xd462('0x23')](function(_0x555b63){_0x43ec5f[_0xd462('0x57')]=_0x555b63;return _0x43ec5f;})['then'](respondWithFilteredResult(_0x54320d,_0x328b5b))[_0xd462('0x2d')](handleError(_0x54320d,null));};exports[_0xd462('0x58')]=function(_0x13edf2,_0x41a519){var _0x5d5830={'raw':!![],'where':{'id':_0x13edf2[_0xd462('0x59')]['id']}},_0x3ca12c={};_0x3ca12c[_0xd462('0x47')]=_['keys'](db[_0xd462('0x40')][_0xd462('0x5a')]);_0x3ca12c[_0xd462('0x43')]=_[_0xd462('0x5b')](_0x13edf2[_0xd462('0x43')]);_0x3ca12c[_0xd462('0x44')]=_[_0xd462('0x46')](_0x3ca12c[_0xd462('0x47')],_0x3ca12c['query']);_0x5d5830[_0xd462('0x45')]=_[_0xd462('0x46')](_0x3ca12c['model'],qs[_0xd462('0x48')](_0x13edf2[_0xd462('0x43')][_0xd462('0x48')]));_0x5d5830[_0xd462('0x45')]=_0x5d5830[_0xd462('0x45')][_0xd462('0x5c')]?_0x5d5830[_0xd462('0x45')]:_0x3ca12c[_0xd462('0x47')];if(_0x13edf2[_0xd462('0x43')][_0xd462('0x54')]){_0x5d5830[_0xd462('0x55')]=[{'all':!![]}];}_0x5d5830=_['merge']({},_0x5d5830,_0x13edf2[_0xd462('0x53')]);return db[_0xd462('0x40')][_0xd462('0x5d')](_0x5d5830)[_0xd462('0x23')](handleEntityNotFound(_0x41a519,null))['then'](respondWithResult(_0x41a519,null))[_0xd462('0x2d')](handleError(_0x41a519,null));};exports[_0xd462('0x5e')]=function(_0x282c50,_0x107e3b){return db[_0xd462('0x40')][_0xd462('0x5e')](_0x282c50[_0xd462('0x5f')],{})[_0xd462('0x23')](respondWithResult(_0x107e3b,0xc9))[_0xd462('0x2d')](handleError(_0x107e3b,null));};exports[_0xd462('0x3a')]=function(_0x54cfd2,_0x1e8b38){if(_0x54cfd2['body']['id']){delete _0x54cfd2[_0xd462('0x5f')]['id'];}return db[_0xd462('0x40')][_0xd462('0x5d')]({'where':{'id':_0x54cfd2[_0xd462('0x59')]['id']}})[_0xd462('0x23')](handleEntityNotFound(_0x1e8b38,null))[_0xd462('0x23')](saveUpdates(_0x54cfd2['body'],null))['then'](respondWithResult(_0x1e8b38,null))[_0xd462('0x2d')](handleError(_0x1e8b38,null));};exports[_0xd462('0x3b')]=function(_0x1db167,_0x2da2b9){return db[_0xd462('0x40')][_0xd462('0x5d')]({'where':{'id':_0x1db167[_0xd462('0x59')]['id']}})[_0xd462('0x23')](handleEntityNotFound(_0x2da2b9,null))['then'](removeEntity(_0x2da2b9,null))['catch'](handleError(_0x2da2b9,null));};exports[_0xd462('0x60')]=function(_0x12bab5,_0x2d25cd){return db[_0xd462('0x40')][_0xd462('0x60')]()[_0xd462('0x23')](respondWithResult(_0x2d25cd,null))['catch'](handleError(_0x2d25cd,null));};var interaction_log=require(_0xd462('0x16'))(_0xd462('0x61'));exports[_0xd462('0x62')]=function(_0x6007c3,_0x486733,_0x7b2171){var _0x5d69a0={'agent':{},'channel':_0xd462('0x63')};if(_0x6007c3['body']['id']){delete _0x6007c3[_0xd462('0x5f')]['id'];}_0x6007c3[_0xd462('0x5f')]['read']=!![];_0x6007c3[_0xd462('0x5f')]['readAt']=moment()[_0xd462('0x64')](_0xd462('0x65'));_0x6007c3[_0xd462('0x5f')][_0xd462('0x66')]=_0x6007c3[_0xd462('0x5f')]['UserId']||_0x6007c3[_0xd462('0x67')]['id'];_0x5d69a0[_0xd462('0x68')]['id']=_0x6007c3[_0xd462('0x5f')][_0xd462('0x66')];return db['ChatMessage'][_0xd462('0x5d')]({'where':{'id':_0x6007c3[_0xd462('0x59')]['id'],'UserId':null}})[_0xd462('0x23')](handleEntityNotFound(_0x486733,null))[_0xd462('0x23')](saveUpdates(_0x6007c3[_0xd462('0x5f')],null))[_0xd462('0x23')](function(_0x22e27e){if(_0x22e27e){_0x5d69a0[_0xd462('0x2b')]=_0x22e27e['get']({'plain':!![]});return db[_0xd462('0x69')][_0xd462('0x5d')]({'where':{'id':_0x22e27e[_0xd462('0x6a')]}});}return null;})[_0xd462('0x23')](handleEntityNotFound(_0x486733,null))[_0xd462('0x23')](function(_0x349173){if(_0x349173){return _0x349173[_0xd462('0x3a')]({'UserId':_0x6007c3[_0xd462('0x5f')][_0xd462('0x66')],'read1stAt':_[_0xd462('0x6b')](_0x349173['read1stAt'])?moment()[_0xd462('0x64')](_0xd462('0x65')):undefined});}return null;})['then'](function(_0x5d3d00){if(_0x5d3d00){_0x5d69a0[_0xd462('0x6c')]=_0x5d3d00[_0xd462('0x6d')]({'plain':!![]});interaction_log['info'](_0xd462('0x6e'),_0x6007c3['user']['id'],_0x6007c3[_0xd462('0x67')]['name'],_0x6007c3[_0xd462('0x67')][_0xd462('0x6f')],_0x5d69a0[_0xd462('0x6c')]['id'],_0x6007c3[_0xd462('0x5f')]?JSON[_0xd462('0x28')](_0x6007c3[_0xd462('0x5f')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5d69a0);}return null;})[_0xd462('0x23')](function(_0x5f7d64){var _0x5650b8=_0xd462('0x70')+_0x5f7d64[_0xd462('0x2b')]['ContactId'];return db[_0xd462('0x71')]['query'](_0x5650b8,{'type':db[_0xd462('0x72')]['QueryTypes'][_0xd462('0x73')],'raw':!![]})[_0xd462('0x23')](function(_0x5c1705){return _0x5c1705;});})[_0xd462('0x23')](function(_0x4b0095){if(_0x4b0095){_0x5d69a0[_0xd462('0x2b')][_0xd462('0x74')]=_0x4b0095[0x0];if(!_0x6007c3[_0xd462('0x5f')]['UserId'])return;return db[_0xd462('0x75')][_0xd462('0x5d')]({'where':{'id':_0x6007c3[_0xd462('0x5f')]['UserId'],'role':_0xd462('0x68')},'attributes':['id','name',_0xd462('0x76'),_0xd462('0x77'),_0xd462('0x78')],'raw':!![]});}return null;})[_0xd462('0x23')](function(_0x54de72){if(!_0x54de72)return null;_0x5d69a0['message'][_0xd462('0x68')]=_0x54de72;return _0x5d69a0;})[_0xd462('0x23')](function(_0x1330b2){if(_0x1330b2){if(_0x6007c3[_0xd462('0x5f')][_0xd462('0x79')]){_0x5d69a0[_0xd462('0x2b')]['interface']=util['format'](_0xd462('0x7a'),_0x6007c3[_0xd462('0x67')][_0xd462('0x3d')]);_0x5d69a0['message'][_0xd462('0x7b')]=_0x5d69a0[_0xd462('0x7b')];_0x5d69a0['message'][_0xd462('0x7c')]=_0x5d69a0[_0xd462('0x7b')];_0x5d69a0['message'][_0xd462('0x7d')]=_0xd462('0x62');return respondWithRpcPromise(_0xd462('0x7e'),_0xd462('0x7e'),{'event':_0xd462('0x7f'),'message':_[_0xd462('0x50')](_0x5d69a0[_0xd462('0x2b')],JSON[_0xd462('0x80')](_0x5d69a0[_0xd462('0x6c')][_0xd462('0x81')]))},client9002)[_0xd462('0x23')](function(){return _0x5d69a0;});}return _0x5d69a0;}return null;})['then'](respondWithResult(_0x486733,null))[_0xd462('0x2d')](handleError(_0x486733,null));};var interaction_log=require(_0xd462('0x16'))(_0xd462('0x61'));exports['reject']=function(_0x4c0370,_0x42994a,_0x1303ee){var _0x10d7fe={'agent':{},'channel':_0xd462('0x63')};if(_0x4c0370[_0xd462('0x5f')]['id']){delete _0x4c0370[_0xd462('0x5f')]['id'];}_0x4c0370['body'][_0xd462('0x66')]=_0x4c0370[_0xd462('0x5f')][_0xd462('0x66')]||_0x4c0370[_0xd462('0x67')]['id'];_0x10d7fe[_0xd462('0x68')]['id']=_0x4c0370[_0xd462('0x5f')][_0xd462('0x66')];return db[_0xd462('0x40')][_0xd462('0x5d')]({'where':{'id':_0x4c0370[_0xd462('0x59')]['id'],'UserId':null}})[_0xd462('0x23')](handleEntityNotFound(_0x42994a,null))[_0xd462('0x23')](function(_0x315a80){if(_0x315a80){_0x10d7fe[_0xd462('0x2b')]=_0x315a80[_0xd462('0x6d')]({'plain':!![]});return db[_0xd462('0x69')]['find']({'where':{'id':_0x315a80['ChatInteractionId']}});}return null;})[_0xd462('0x23')](handleEntityNotFound(_0x42994a,null))['then'](function(_0x253d78){if(_0x253d78){_0x10d7fe[_0xd462('0x6c')]=_0x253d78[_0xd462('0x6d')]({'plain':!![]});interaction_log['info'](_0xd462('0x82'),_0x4c0370['user']['id'],_0x4c0370[_0xd462('0x67')][_0xd462('0x3d')],_0x4c0370[_0xd462('0x67')][_0xd462('0x6f')],_0x10d7fe[_0xd462('0x6c')]['id'],_0x4c0370[_0xd462('0x5f')]?JSON['stringify'](_0x4c0370[_0xd462('0x5f')]):_0xd462('0x83'));return respondWithRpcPromise(_0xd462('0x84'),_0xd462('0x85'),_0x10d7fe);}return null;})[_0xd462('0x23')](function(_0x2f4a9c){var _0x4c4e41=_0xd462('0x70')+_0x2f4a9c[_0xd462('0x2b')]['ContactId'];return db[_0xd462('0x71')][_0xd462('0x43')](_0x4c4e41,{'type':db[_0xd462('0x72')][_0xd462('0x86')][_0xd462('0x73')],'raw':!![]})[_0xd462('0x23')](function(_0x1033cc){return _0x1033cc;});})[_0xd462('0x23')](function(_0x3b040e){if(_0x3b040e){_0x10d7fe[_0xd462('0x2b')][_0xd462('0x74')]=_0x3b040e[0x0];if(!_0x4c0370[_0xd462('0x5f')]['UserId'])return;return db['User'][_0xd462('0x5d')]({'where':{'id':_0x4c0370[_0xd462('0x5f')][_0xd462('0x66')],'role':_0xd462('0x68')},'attributes':['id',_0xd462('0x3d'),_0xd462('0x76'),_0xd462('0x77'),_0xd462('0x78')],'raw':!![]});}return null;})[_0xd462('0x23')](function(_0x3f42b4){if(!_0x3f42b4)return null;_0x10d7fe[_0xd462('0x2b')]['agent']=_0x3f42b4;return _0x10d7fe;})[_0xd462('0x23')](function(_0x284127){if(_0x284127){_0x284127['message'][_0xd462('0x87')]=util[_0xd462('0x64')](_0xd462('0x7a'),_0x4c0370[_0xd462('0x67')]['name']);_0x284127[_0xd462('0x2b')][_0xd462('0x7b')]=_0x10d7fe[_0xd462('0x7b')];_0x284127['message'][_0xd462('0x7c')]=_0x10d7fe[_0xd462('0x7b')];_0x284127['message'][_0xd462('0x7d')]=_0xd462('0x38');respondWithRpcPromise(_0xd462('0x7e'),_0xd462('0x7e'),{'event':_0xd462('0x88'),'message':_['merge'](_0x10d7fe[_0xd462('0x2b')],JSON[_0xd462('0x80')](_0x10d7fe[_0xd462('0x6c')][_0xd462('0x81')]))},client9002);return _0x10d7fe;}return null;})[_0xd462('0x23')](respondWithResult(_0x42994a,null))[_0xd462('0x2d')](handleError(_0x42994a,null));};
\ No newline at end of file
+var _0x7dc4=['pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','filters','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','RejectMessage','rejectMessage','Sequelize','QueryTypes','User','rejectmessage','formData','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x17ea4a,_0x4ed55f){var _0x4bddd1=function(_0x3d8366){while(--_0x3d8366){_0x17ea4a['push'](_0x17ea4a['shift']());}};_0x4bddd1(++_0x4ed55f);}(_0x7dc4,0xc6));var _0x47dc=function(_0x5a36a4,_0x2458ee){_0x5a36a4=_0x5a36a4-0x0;var _0x42c736=_0x7dc4[_0x5a36a4];return _0x42c736;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47dc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x47dc('0x1'));var moment=require(_0x47dc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x47dc('0x3'));var util=require(_0x47dc('0x4'));var path=require(_0x47dc('0x5'));var sox=require(_0x47dc('0x6'));var csv=require(_0x47dc('0x7'));var ejs=require(_0x47dc('0x8'));var fs=require('fs');var fs_extra=require(_0x47dc('0x9'));var _=require(_0x47dc('0xa'));var squel=require(_0x47dc('0xb'));var crypto=require(_0x47dc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47dc('0xd'));var toCsv=require(_0x47dc('0x7'));var querystring=require(_0x47dc('0xe'));var Papa=require(_0x47dc('0xf'));var Redis=require(_0x47dc('0x10'));var authService=require(_0x47dc('0x11'));var qs=require(_0x47dc('0x12'));var as=require(_0x47dc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x47dc('0x14'))(_0x47dc('0x15'));var utils=require('../../config/utils');var config=require(_0x47dc('0x16'));var licenseUtil=require(_0x47dc('0x17'));var db=require(_0x47dc('0x18'))['db'];config[_0x47dc('0x19')]=_[_0x47dc('0x1a')](config['redis'],{'host':_0x47dc('0x1b'),'port':0x18eb});var socket=require(_0x47dc('0x1c'))(new Redis(config[_0x47dc('0x19')]));require(_0x47dc('0x1d'))['register'](socket);var jayson=require(_0x47dc('0x1e'));var client=jayson[_0x47dc('0x1f')][_0x47dc('0x20')]({'port':0x232c});var client9002=jayson[_0x47dc('0x1f')][_0x47dc('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3fa03f,_0x269920,_0x3a7eb5,_0x4a8bfa){return new BPromise(function(_0x5349bc,_0x4a4461){var _0x684eb1=_0x4a8bfa||client;return _0x684eb1[_0x47dc('0x21')](_0x3fa03f,_0x3a7eb5)['then'](function(_0x44502e){logger[_0x47dc('0x22')](_0x47dc('0x23'),_0x269920,_0x47dc('0x24'));logger['debug'](_0x47dc('0x25'),_0x269920,_0x47dc('0x24'),JSON[_0x47dc('0x26')](_0x44502e));if(_0x44502e['error']){if(_0x44502e[_0x47dc('0x27')][_0x47dc('0x28')]===0x1f4){logger[_0x47dc('0x27')]('ChatMessage,\x20%s,\x20%s',_0x269920,_0x44502e[_0x47dc('0x27')][_0x47dc('0x29')]);return _0x4a4461(_0x44502e[_0x47dc('0x27')][_0x47dc('0x29')]);}logger['error'](_0x47dc('0x23'),_0x269920,_0x44502e[_0x47dc('0x27')]['message']);return _0x5349bc(_0x44502e[_0x47dc('0x27')]['message']);}else{logger[_0x47dc('0x22')](_0x47dc('0x23'),_0x269920,_0x47dc('0x24'));_0x5349bc(_0x44502e[_0x47dc('0x2a')][_0x47dc('0x29')]);}})[_0x47dc('0x2b')](function(_0x3084bf){logger[_0x47dc('0x27')](_0x47dc('0x23'),_0x269920,_0x3084bf);_0x4a4461(_0x3084bf);});});}function respondWithStatusCode(_0x264fd2,_0x522fa1){_0x522fa1=_0x522fa1||0xcc;return function(_0x38a25e){if(_0x38a25e){return _0x264fd2[_0x47dc('0x2c')](_0x522fa1);}return _0x264fd2[_0x47dc('0x2d')](_0x522fa1)[_0x47dc('0x2e')]();};}function respondWithResult(_0x1ba81a,_0x4f156a){_0x4f156a=_0x4f156a||0xc8;return function(_0x4d4b11){if(_0x4d4b11){return _0x1ba81a[_0x47dc('0x2d')](_0x4f156a)[_0x47dc('0x2f')](_0x4d4b11);}};}function respondWithFilteredResult(_0x271125,_0x5a2755){return function(_0x280fa4){if(_0x280fa4){var _0x2ecbcb=typeof _0x5a2755[_0x47dc('0x30')]===_0x47dc('0x31')&&typeof _0x5a2755[_0x47dc('0x32')]===_0x47dc('0x31');var _0x2eaf64=_0x280fa4[_0x47dc('0x33')];var _0x50fdab=_0x2ecbcb?0x0:_0x5a2755[_0x47dc('0x30')];var _0x1c2db2=_0x2ecbcb?_0x280fa4[_0x47dc('0x33')]:_0x5a2755[_0x47dc('0x30')]+_0x5a2755['limit'];var _0x4ab4ac;if(_0x1c2db2>=_0x2eaf64){_0x1c2db2=_0x2eaf64;_0x4ab4ac=0xc8;}else{_0x4ab4ac=0xce;}_0x271125[_0x47dc('0x2d')](_0x4ab4ac);return _0x271125[_0x47dc('0x34')]('Content-Range',_0x50fdab+'-'+_0x1c2db2+'/'+_0x2eaf64)[_0x47dc('0x2f')](_0x280fa4);}return null;};}function patchUpdates(_0x7b99a4){return function(_0x24518b){try{jsonpatch[_0x47dc('0x35')](_0x24518b,_0x7b99a4,!![]);}catch(_0x5d42b2){return BPromise[_0x47dc('0x36')](_0x5d42b2);}return _0x24518b[_0x47dc('0x37')]();};}function saveUpdates(_0xb18998,_0x4ab2f0){return function(_0x2098e2){if(_0x2098e2){return _0x2098e2['update'](_0xb18998)['then'](function(_0x957aac){return _0x957aac;});}return null;};}function removeEntity(_0x147183,_0xccf155){return function(_0x458987){if(_0x458987){return _0x458987[_0x47dc('0x38')]()[_0x47dc('0x39')](function(){_0x147183[_0x47dc('0x2d')](0xcc)[_0x47dc('0x2e')]();});}};}function handleEntityNotFound(_0x18cd39,_0x5724fb){return function(_0x215181){if(!_0x215181){_0x18cd39[_0x47dc('0x2c')](0x194);}return _0x215181;};}function handleError(_0x490925,_0x1fb21d){_0x1fb21d=_0x1fb21d||0x1f4;return function(_0x4176bb){logger[_0x47dc('0x27')](_0x4176bb[_0x47dc('0x3a')]);if(_0x4176bb[_0x47dc('0x3b')]){delete _0x4176bb[_0x47dc('0x3b')];}_0x490925[_0x47dc('0x2d')](_0x1fb21d)[_0x47dc('0x3c')](_0x4176bb);};}exports[_0x47dc('0x3d')]=function(_0x6383fe,_0x41fe35){var _0x4e7ad7={},_0x5f0409={},_0x52206e={'count':0x0,'rows':[]};var _0x2949e2=_[_0x47dc('0x3e')](db[_0x47dc('0x3f')][_0x47dc('0x40')],function(_0x31fec8){return{'name':_0x31fec8[_0x47dc('0x41')],'type':_0x31fec8[_0x47dc('0x42')][_0x47dc('0x43')]};});_0x5f0409[_0x47dc('0x44')]=_[_0x47dc('0x3e')](_0x2949e2,_0x47dc('0x3b'));_0x5f0409['query']=_[_0x47dc('0x45')](_0x6383fe['query']);_0x5f0409['filters']=_['intersection'](_0x5f0409[_0x47dc('0x44')],_0x5f0409[_0x47dc('0x46')]);_0x4e7ad7[_0x47dc('0x47')]=_[_0x47dc('0x48')](_0x5f0409['model'],qs[_0x47dc('0x49')](_0x6383fe[_0x47dc('0x46')][_0x47dc('0x49')]));_0x4e7ad7[_0x47dc('0x47')]=_0x4e7ad7[_0x47dc('0x47')][_0x47dc('0x4a')]?_0x4e7ad7[_0x47dc('0x47')]:_0x5f0409['model'];if(!_0x6383fe[_0x47dc('0x46')][_0x47dc('0x4b')](_0x47dc('0x4c'))){_0x4e7ad7[_0x47dc('0x32')]=qs[_0x47dc('0x32')](_0x6383fe['query'][_0x47dc('0x32')]);_0x4e7ad7[_0x47dc('0x30')]=qs[_0x47dc('0x30')](_0x6383fe[_0x47dc('0x46')][_0x47dc('0x30')]);}_0x4e7ad7[_0x47dc('0x4d')]=qs[_0x47dc('0x4e')](_0x6383fe[_0x47dc('0x46')][_0x47dc('0x4e')]);_0x4e7ad7[_0x47dc('0x4f')]=qs['filters'](_[_0x47dc('0x50')](_0x6383fe[_0x47dc('0x46')],_0x5f0409['filters']),_0x2949e2);if(_0x6383fe[_0x47dc('0x46')]['filter']){_0x4e7ad7[_0x47dc('0x4f')]=_[_0x47dc('0x51')](_0x4e7ad7[_0x47dc('0x4f')],{'$or':_[_0x47dc('0x3e')](_0x2949e2,function(_0x58a6aa){if(_0x58a6aa[_0x47dc('0x42')]!==_0x47dc('0x52')){var _0x441c56={};_0x441c56[_0x58a6aa[_0x47dc('0x3b')]]={'$like':'%'+_0x6383fe[_0x47dc('0x46')][_0x47dc('0x53')]+'%'};return _0x441c56;}})});}_0x4e7ad7=_[_0x47dc('0x51')]({},_0x4e7ad7,_0x6383fe['options']);var _0x2c6d45={'where':_0x4e7ad7[_0x47dc('0x4f')]};return db[_0x47dc('0x3f')][_0x47dc('0x33')](_0x2c6d45)['then'](function(_0x5e193c){_0x52206e[_0x47dc('0x33')]=_0x5e193c;if(_0x6383fe[_0x47dc('0x46')][_0x47dc('0x54')]){_0x4e7ad7[_0x47dc('0x55')]=[{'all':!![]}];}return db[_0x47dc('0x3f')][_0x47dc('0x56')](_0x4e7ad7);})[_0x47dc('0x39')](function(_0x16b542){_0x52206e[_0x47dc('0x57')]=_0x16b542;return _0x52206e;})[_0x47dc('0x39')](respondWithFilteredResult(_0x41fe35,_0x4e7ad7))[_0x47dc('0x2b')](handleError(_0x41fe35,null));};exports['show']=function(_0x41a2a8,_0x1764c5){var _0x149097={'raw':!![],'where':{'id':_0x41a2a8[_0x47dc('0x58')]['id']}},_0x1e9be4={};_0x1e9be4[_0x47dc('0x44')]=_[_0x47dc('0x45')](db['ChatMessage'][_0x47dc('0x40')]);_0x1e9be4['query']=_['keys'](_0x41a2a8[_0x47dc('0x46')]);_0x1e9be4[_0x47dc('0x59')]=_[_0x47dc('0x48')](_0x1e9be4[_0x47dc('0x44')],_0x1e9be4['query']);_0x149097[_0x47dc('0x47')]=_[_0x47dc('0x48')](_0x1e9be4[_0x47dc('0x44')],qs[_0x47dc('0x49')](_0x41a2a8[_0x47dc('0x46')][_0x47dc('0x49')]));_0x149097['attributes']=_0x149097[_0x47dc('0x47')]['length']?_0x149097[_0x47dc('0x47')]:_0x1e9be4['model'];if(_0x41a2a8[_0x47dc('0x46')][_0x47dc('0x54')]){_0x149097['include']=[{'all':!![]}];}_0x149097=_[_0x47dc('0x51')]({},_0x149097,_0x41a2a8[_0x47dc('0x5a')]);return db[_0x47dc('0x3f')][_0x47dc('0x5b')](_0x149097)[_0x47dc('0x39')](handleEntityNotFound(_0x1764c5,null))[_0x47dc('0x39')](respondWithResult(_0x1764c5,null))[_0x47dc('0x2b')](handleError(_0x1764c5,null));};exports[_0x47dc('0x5c')]=function(_0x20cae8,_0x4fbfba){return db[_0x47dc('0x3f')][_0x47dc('0x5c')](_0x20cae8[_0x47dc('0x5d')],{})['then'](respondWithResult(_0x4fbfba,0xc9))[_0x47dc('0x2b')](handleError(_0x4fbfba,null));};exports['update']=function(_0x47ad5f,_0x442e5b){if(_0x47ad5f[_0x47dc('0x5d')]['id']){delete _0x47ad5f[_0x47dc('0x5d')]['id'];}return db[_0x47dc('0x3f')][_0x47dc('0x5b')]({'where':{'id':_0x47ad5f[_0x47dc('0x58')]['id']}})[_0x47dc('0x39')](handleEntityNotFound(_0x442e5b,null))[_0x47dc('0x39')](saveUpdates(_0x47ad5f['body'],null))[_0x47dc('0x39')](respondWithResult(_0x442e5b,null))[_0x47dc('0x2b')](handleError(_0x442e5b,null));};exports['destroy']=function(_0x1b3e5f,_0x392859){return db['ChatMessage']['find']({'where':{'id':_0x1b3e5f[_0x47dc('0x58')]['id']}})['then'](handleEntityNotFound(_0x392859,null))[_0x47dc('0x39')](removeEntity(_0x392859,null))[_0x47dc('0x2b')](handleError(_0x392859,null));};exports[_0x47dc('0x5e')]=function(_0x132539,_0x16ee97){return db['ChatMessage'][_0x47dc('0x5e')]()[_0x47dc('0x39')](respondWithResult(_0x16ee97,null))[_0x47dc('0x2b')](handleError(_0x16ee97,null));};var interaction_log=require('../../config/logger')(_0x47dc('0x5f'));exports[_0x47dc('0x60')]=function(_0x38c8e1,_0x181337,_0x57fa75){var _0x118f8a={'agent':{},'channel':_0x47dc('0x61')};if(_0x38c8e1[_0x47dc('0x5d')]['id']){delete _0x38c8e1[_0x47dc('0x5d')]['id'];}_0x38c8e1['body'][_0x47dc('0x62')]=!![];_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x63')]=moment()[_0x47dc('0x64')](_0x47dc('0x65'));_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')]=_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')]||_0x38c8e1[_0x47dc('0x67')]['id'];_0x118f8a[_0x47dc('0x68')]['id']=_0x38c8e1['body'][_0x47dc('0x66')];return db['ChatMessage'][_0x47dc('0x5b')]({'where':{'id':_0x38c8e1[_0x47dc('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x181337,null))['then'](saveUpdates(_0x38c8e1[_0x47dc('0x5d')],null))[_0x47dc('0x39')](function(_0x5e5613){if(_0x5e5613){_0x118f8a[_0x47dc('0x29')]=_0x5e5613[_0x47dc('0x69')]({'plain':!![]});return db[_0x47dc('0x6a')][_0x47dc('0x5b')]({'where':{'id':_0x5e5613[_0x47dc('0x6b')]}});}return null;})[_0x47dc('0x39')](handleEntityNotFound(_0x181337,null))[_0x47dc('0x39')](function(_0x593b42){if(_0x593b42){return _0x593b42[_0x47dc('0x6c')]({'UserId':_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')],'read1stAt':_[_0x47dc('0x6d')](_0x593b42[_0x47dc('0x6e')])?moment()[_0x47dc('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x47dc('0x39')](function(_0x40d1b5){if(_0x40d1b5){_0x118f8a[_0x47dc('0x6f')]=_0x40d1b5[_0x47dc('0x69')]({'plain':!![]});interaction_log[_0x47dc('0x22')](_0x47dc('0x70'),_0x38c8e1['user']['id'],_0x38c8e1[_0x47dc('0x67')][_0x47dc('0x3b')],_0x38c8e1[_0x47dc('0x67')][_0x47dc('0x71')],_0x118f8a[_0x47dc('0x6f')]['id'],_0x38c8e1['body']?JSON['stringify'](_0x38c8e1['body']):_0x47dc('0x72'));return respondWithRpcPromise(_0x47dc('0x73'),'acceptMessage',_0x118f8a);}return null;})[_0x47dc('0x39')](function(_0x24971a){var _0x3b0e4a=_0x47dc('0x74')+_0x24971a[_0x47dc('0x29')][_0x47dc('0x75')];return db[_0x47dc('0x76')]['query'](_0x3b0e4a,{'type':db['Sequelize']['QueryTypes'][_0x47dc('0x77')],'raw':!![]})[_0x47dc('0x39')](function(_0x5c06c7){return _0x5c06c7;});})[_0x47dc('0x39')](function(_0x2a05a4){if(_0x2a05a4){_0x118f8a[_0x47dc('0x29')][_0x47dc('0x78')]=_0x2a05a4[0x0];if(!_0x38c8e1[_0x47dc('0x5d')][_0x47dc('0x66')])return;return db['User']['find']({'where':{'id':_0x38c8e1['body']['UserId'],'role':_0x47dc('0x68')},'attributes':['id','name',_0x47dc('0x79'),_0x47dc('0x7a'),_0x47dc('0x7b')],'raw':!![]});}return null;})['then'](function(_0x9cfb91){if(!_0x9cfb91)return null;_0x118f8a['message'][_0x47dc('0x68')]=_0x9cfb91;return _0x118f8a;})['then'](function(_0x4209d8){if(_0x4209d8){if(_0x38c8e1[_0x47dc('0x5d')]['manual']){_0x118f8a['message'][_0x47dc('0x7c')]=util[_0x47dc('0x64')](_0x47dc('0x7d'),_0x38c8e1[_0x47dc('0x67')][_0x47dc('0x3b')]);_0x118f8a['message']['channel']=_0x118f8a[_0x47dc('0x7e')];_0x118f8a[_0x47dc('0x29')][_0x47dc('0x7f')]=_0x118f8a[_0x47dc('0x7e')];_0x118f8a[_0x47dc('0x29')][_0x47dc('0x80')]=_0x47dc('0x60');return respondWithRpcPromise(_0x47dc('0x81'),'EventManager',{'event':_0x47dc('0x82'),'message':_[_0x47dc('0x51')](_0x118f8a[_0x47dc('0x29')],JSON[_0x47dc('0x83')](_0x118f8a[_0x47dc('0x6f')]['formData']))},client9002)[_0x47dc('0x39')](function(){return _0x118f8a;});}return _0x118f8a;}return null;})[_0x47dc('0x39')](respondWithResult(_0x181337,null))[_0x47dc('0x2b')](handleError(_0x181337,null));};var interaction_log=require(_0x47dc('0x14'))(_0x47dc('0x5f'));exports[_0x47dc('0x36')]=function(_0x3f7143,_0x21fddf,_0x1cc529){var _0x1a1a6e={'agent':{},'channel':_0x47dc('0x61')};if(_0x3f7143[_0x47dc('0x5d')]['id']){delete _0x3f7143[_0x47dc('0x5d')]['id'];}_0x3f7143[_0x47dc('0x5d')][_0x47dc('0x66')]=_0x3f7143['body'][_0x47dc('0x66')]||_0x3f7143[_0x47dc('0x67')]['id'];_0x1a1a6e[_0x47dc('0x68')]['id']=_0x3f7143['body'][_0x47dc('0x66')];return db[_0x47dc('0x3f')]['find']({'where':{'id':_0x3f7143[_0x47dc('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21fddf,null))[_0x47dc('0x39')](function(_0x38cb0f){if(_0x38cb0f){_0x1a1a6e['message']=_0x38cb0f[_0x47dc('0x69')]({'plain':!![]});return db[_0x47dc('0x6a')]['find']({'where':{'id':_0x38cb0f[_0x47dc('0x6b')]}});}return null;})[_0x47dc('0x39')](handleEntityNotFound(_0x21fddf,null))[_0x47dc('0x39')](function(_0x2d2d86){if(_0x2d2d86){_0x1a1a6e[_0x47dc('0x6f')]=_0x2d2d86[_0x47dc('0x69')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3f7143[_0x47dc('0x67')]['id'],_0x3f7143[_0x47dc('0x67')][_0x47dc('0x3b')],_0x3f7143[_0x47dc('0x67')][_0x47dc('0x71')],_0x1a1a6e[_0x47dc('0x6f')]['id'],_0x3f7143[_0x47dc('0x5d')]?JSON[_0x47dc('0x26')](_0x3f7143[_0x47dc('0x5d')]):_0x47dc('0x72'));return respondWithRpcPromise(_0x47dc('0x84'),_0x47dc('0x85'),_0x1a1a6e);}return null;})[_0x47dc('0x39')](function(_0x2f5bab){var _0x1dd4db=_0x47dc('0x74')+_0x2f5bab['message'][_0x47dc('0x75')];return db[_0x47dc('0x76')][_0x47dc('0x46')](_0x1dd4db,{'type':db[_0x47dc('0x86')][_0x47dc('0x87')]['SELECT'],'raw':!![]})['then'](function(_0x1db391){return _0x1db391;});})[_0x47dc('0x39')](function(_0x414d64){if(_0x414d64){_0x1a1a6e[_0x47dc('0x29')][_0x47dc('0x78')]=_0x414d64[0x0];if(!_0x3f7143[_0x47dc('0x5d')]['UserId'])return;return db[_0x47dc('0x88')][_0x47dc('0x5b')]({'where':{'id':_0x3f7143[_0x47dc('0x5d')][_0x47dc('0x66')],'role':_0x47dc('0x68')},'attributes':['id','name','fullname','email',_0x47dc('0x7b')],'raw':!![]});}return null;})[_0x47dc('0x39')](function(_0x20c37e){if(!_0x20c37e)return null;_0x1a1a6e[_0x47dc('0x29')]['agent']=_0x20c37e;return _0x1a1a6e;})['then'](function(_0x15f739){if(_0x15f739){_0x15f739['message'][_0x47dc('0x7c')]=util[_0x47dc('0x64')](_0x47dc('0x7d'),_0x3f7143['user'][_0x47dc('0x3b')]);_0x15f739[_0x47dc('0x29')][_0x47dc('0x7e')]=_0x1a1a6e['channel'];_0x15f739[_0x47dc('0x29')][_0x47dc('0x7f')]=_0x1a1a6e[_0x47dc('0x7e')];_0x15f739[_0x47dc('0x29')][_0x47dc('0x80')]=_0x47dc('0x36');respondWithRpcPromise(_0x47dc('0x81'),_0x47dc('0x81'),{'event':_0x47dc('0x89'),'message':_[_0x47dc('0x51')](_0x1a1a6e[_0x47dc('0x29')],JSON['parse'](_0x1a1a6e[_0x47dc('0x6f')][_0x47dc('0x8a')]))},client9002);return _0x1a1a6e;}return null;})[_0x47dc('0x39')](respondWithResult(_0x21fddf,null))[_0x47dc('0x2b')](handleError(_0x21fddf,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 902a0b5..74ccdfc 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 _0x8bfd=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3fbe23,_0x445f21){var _0x52adf6=function(_0x274f9a){while(--_0x274f9a){_0x3fbe23['push'](_0x3fbe23['shift']());}};_0x52adf6(++_0x445f21);}(_0x8bfd,0xb9));var _0xd8bf=function(_0x4557a4,_0x36f89c){_0x4557a4=_0x4557a4-0x0;var _0x4ceb15=_0x8bfd[_0x4557a4];return _0x4ceb15;};'use strict';var EventEmitter=require(_0xd8bf('0x0'));var ChatMessage=require(_0xd8bf('0x1'))['db'][_0xd8bf('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd8bf('0x3')](0x0);var events={'afterCreate':_0xd8bf('0x4'),'afterUpdate':_0xd8bf('0x5'),'afterDestroy':_0xd8bf('0x6')};function emitEvent(_0x54d6b6){return function(_0x21465c,_0x500933,_0x139a0b){ChatMessageEvents[_0xd8bf('0x7')](_0x54d6b6+':'+_0x21465c['id'],_0x21465c);ChatMessageEvents[_0xd8bf('0x7')](_0x54d6b6,_0x21465c);_0x139a0b(null);};}for(var e in events){if(events[_0xd8bf('0x8')](e)){var event=events[e];ChatMessage[_0xd8bf('0x9')](e,emitEvent(event));}}module[_0xd8bf('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3229=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x2c7341,_0x293a18){var _0x23f3fc=function(_0x5ca3f1){while(--_0x5ca3f1){_0x2c7341['push'](_0x2c7341['shift']());}};_0x23f3fc(++_0x293a18);}(_0x3229,0x1d8));var _0x9322=function(_0x3c6882,_0x29c499){_0x3c6882=_0x3c6882-0x0;var _0x153e94=_0x3229[_0x3c6882];return _0x153e94;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x9322('0x0'))['db'][_0x9322('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9322('0x2')](0x0);var events={'afterCreate':_0x9322('0x3'),'afterUpdate':_0x9322('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1245d8){return function(_0x7ec496,_0x2ca41e,_0x40ed8e){ChatMessageEvents['emit'](_0x1245d8+':'+_0x7ec496['id'],_0x7ec496);ChatMessageEvents[_0x9322('0x5')](_0x1245d8,_0x7ec496);_0x40ed8e(null);};}for(var e in events){if(events[_0x9322('0x6')](e)){var event=events[e];ChatMessage[_0x9322('0x7')](e,emitEvent(event));}}module[_0x9322('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 8ec096b..2305c40 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 _0x7991=['createdAt','toLowerCase','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','direction','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7991,0x171));var _0x1799=function(_0x70d9b3,_0x33bb56){_0x70d9b3=_0x70d9b3-0x0;var _0x4d6eda=_0x7991[_0x70d9b3];return _0x4d6eda;};'use strict';var _=require('lodash');var util=require(_0x1799('0x0'));var logger=require(_0x1799('0x1'))(_0x1799('0x2'));var moment=require('moment');var BPromise=require(_0x1799('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1799('0x4'));var config=require(_0x1799('0x5'));var attributes=require(_0x1799('0x6'));module[_0x1799('0x7')]=function(_0x5472e8,_0x363b37){return _0x5472e8[_0x1799('0x8')](_0x1799('0x9'),attributes,{'tableName':_0x1799('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1799('0xb')],'type':_0x1799('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36bc09,_0x21f500,_0x32d3fe){var _0x2ff4ef=_0x5472e8[_0x1799('0xd')];var _0x36ccdb=_0x36bc09['get']({'plain':!![]});if(_0x36ccdb[_0x1799('0xe')]['toLowerCase']()==='in'||_0x36ccdb[_0x1799('0xe')]['toLowerCase']()===_0x1799('0xf')&&!_0x36ccdb[_0x1799('0x10')]&&!_[_0x1799('0x11')](_0x36ccdb[_0x1799('0x12')])){_0x2ff4ef['ChatInteraction'][_0x1799('0x13')]({'where':{'id':_0x36ccdb[_0x1799('0x14')]}})[_0x1799('0x15')](function(_0x55f3df){if(_0x55f3df){_0x55f3df[_0x1799('0x16')]({'lastMsgAt':_0x36ccdb[_0x1799('0x17')],'lastMsgDirection':_0x36ccdb['direction'][_0x1799('0x18')]()});}})[_0x1799('0x19')](function(_0x14e5fa){console[_0x1799('0x1a')](_0x14e5fa);});}_0x32d3fe();}},'charset':'utf8mb4','collate':_0x1799('0x1b')});};
\ No newline at end of file
+var _0x8ff5=['findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','toLowerCase','direction','out','secret','isNil'];(function(_0x193615,_0x270fc5){var _0x27f1ee=function(_0x1c4b99){while(--_0x1c4b99){_0x193615['push'](_0x193615['shift']());}};_0x27f1ee(++_0x270fc5);}(_0x8ff5,0x78));var _0x58ff=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8ff5[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x58ff('0x0'));var util=require(_0x58ff('0x1'));var logger=require(_0x58ff('0x2'))(_0x58ff('0x3'));var moment=require(_0x58ff('0x4'));var BPromise=require(_0x58ff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58ff('0x6'));var rimraf=require(_0x58ff('0x7'));var config=require('../../config/environment');var attributes=require(_0x58ff('0x8'));module[_0x58ff('0x9')]=function(_0x52ff98,_0x425959){return _0x52ff98[_0x58ff('0xa')](_0x58ff('0xb'),attributes,{'tableName':_0x58ff('0xc'),'paranoid':![],'indexes':[{'name':_0x58ff('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd5ad15,_0xe0c97e,_0x3fa63d){var _0x59ecbd=_0x52ff98[_0x58ff('0xe')];var _0x5945eb=_0xd5ad15['get']({'plain':!![]});if(_0x5945eb['direction'][_0x58ff('0xf')]()==='in'||_0x5945eb[_0x58ff('0x10')][_0x58ff('0xf')]()===_0x58ff('0x11')&&!_0x5945eb[_0x58ff('0x12')]&&!_[_0x58ff('0x13')](_0x5945eb['UserId'])){_0x59ecbd['ChatInteraction'][_0x58ff('0x14')]({'where':{'id':_0x5945eb[_0x58ff('0x15')]}})[_0x58ff('0x16')](function(_0x5c0d4f){if(_0x5c0d4f){_0x5c0d4f[_0x58ff('0x17')]({'lastMsgAt':_0x5945eb[_0x58ff('0x18')],'lastMsgDirection':_0x5945eb[_0x58ff('0x10')][_0x58ff('0xf')]()});}})[_0x58ff('0x19')](function(_0x1e4c13){console['error'](_0x1e4c13);});}_0x3fa63d();}},'charset':_0x58ff('0x1a'),'collate':_0x58ff('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 6eaf602..035a1ee 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 _0xd626=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33d7df,_0x4959cd){var _0x59c9e6=function(_0x358f93){while(--_0x358f93){_0x33d7df['push'](_0x33d7df['shift']());}};_0x59c9e6(++_0x4959cd);}(_0xd626,0x102));var _0x6d62=function(_0x514359,_0xb51f1b){_0x514359=_0x514359-0x0;var _0x31198c=_0xd626[_0x514359];return _0x31198c;};'use strict';var _=require(_0x6d62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d62('0x1'));var fs=require('fs');var Redis=require(_0x6d62('0x2'));var db=require(_0x6d62('0x3'))['db'];var utils=require(_0x6d62('0x4'));var logger=require(_0x6d62('0x5'))(_0x6d62('0x6'));var config=require(_0x6d62('0x7'));var jayson=require(_0x6d62('0x8'));var client=jayson[_0x6d62('0x9')][_0x6d62('0xa')]({'port':0x232a});config[_0x6d62('0xb')]=_[_0x6d62('0xc')](config[_0x6d62('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d62('0xd'))(new Redis(config[_0x6d62('0xb')]));require(_0x6d62('0xe'))[_0x6d62('0xf')](socket);function respondWithRpcPromise(_0x2a956d,_0xd873c3,_0x44a3e3){return new BPromise(function(_0x38ed92,_0x289ce9){return client['request'](_0x2a956d,_0x44a3e3)['then'](function(_0x2a07b9){logger[_0x6d62('0x10')](_0x6d62('0x11'),_0xd873c3,_0x6d62('0x12'));logger[_0x6d62('0x13')](_0x6d62('0x14'),_0xd873c3,_0x6d62('0x12'),JSON[_0x6d62('0x15')](_0x2a07b9));if(_0x2a07b9[_0x6d62('0x16')]){if(_0x2a07b9[_0x6d62('0x16')][_0x6d62('0x17')]===0x1f4){logger[_0x6d62('0x16')](_0x6d62('0x11'),_0xd873c3,_0x2a07b9[_0x6d62('0x16')][_0x6d62('0x18')]);return _0x289ce9(_0x2a07b9[_0x6d62('0x16')]['message']);}logger[_0x6d62('0x16')]('ChatMessage,\x20%s,\x20%s',_0xd873c3,_0x2a07b9[_0x6d62('0x16')][_0x6d62('0x18')]);return _0x38ed92(_0x2a07b9[_0x6d62('0x16')]['message']);}else{logger[_0x6d62('0x10')](_0x6d62('0x11'),_0xd873c3,_0x6d62('0x12'));_0x38ed92(_0x2a07b9[_0x6d62('0x19')][_0x6d62('0x18')]);}})[_0x6d62('0x1a')](function(_0x4542a8){logger['error'](_0x6d62('0x11'),_0xd873c3,_0x4542a8);_0x289ce9(_0x4542a8);});});}exports[_0x6d62('0x1b')]=function(_0x53be72){var _0x1933c4=this;return new Promise(function(_0x52a9e8,_0x4fc437){return db[_0x6d62('0x1c')][_0x6d62('0x1d')](_0x53be72['body'],{'raw':_0x53be72[_0x6d62('0x1e')]?_0x53be72['options'][_0x6d62('0x1f')]===undefined?!![]:![]:!![]})[_0x6d62('0x20')](function(_0x30374f){logger[_0x6d62('0x10')](_0x6d62('0x1b'),_0x53be72);logger[_0x6d62('0x13')](_0x6d62('0x1b'),_0x53be72,JSON['stringify'](_0x30374f));_0x52a9e8(_0x30374f);})[_0x6d62('0x1a')](function(_0x19b35b){logger['error']('CreateChatMessage',_0x19b35b[_0x6d62('0x18')],_0x53be72);_0x4fc437(_0x1933c4[_0x6d62('0x16')](0x1f4,_0x19b35b[_0x6d62('0x18')]));});});};
\ No newline at end of file
+var _0x2f9b=['defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','create','body','options','raw','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x4456c9,_0x29aff0){var _0x3a9e5d=function(_0x316ae8){while(--_0x316ae8){_0x4456c9['push'](_0x4456c9['shift']());}};_0x3a9e5d(++_0x29aff0);}(_0x2f9b,0x1b8));var _0xb2f9=function(_0x104e85,_0x5c9b9e){_0x104e85=_0x104e85-0x0;var _0x9e137b=_0x2f9b[_0x104e85];return _0x9e137b;};'use strict';var _=require(_0xb2f9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb2f9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2f9('0x2'))['db'];var utils=require(_0xb2f9('0x3'));var logger=require(_0xb2f9('0x4'))(_0xb2f9('0x5'));var config=require(_0xb2f9('0x6'));var jayson=require(_0xb2f9('0x7'));var client=jayson[_0xb2f9('0x8')]['http']({'port':0x232a});config[_0xb2f9('0x9')]=_[_0xb2f9('0xa')](config[_0xb2f9('0x9')],{'host':_0xb2f9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb2f9('0xc'))[_0xb2f9('0xd')](socket);function respondWithRpcPromise(_0x42eaff,_0x5a2604,_0x11af68){return new BPromise(function(_0x589b2c,_0x9bad5a){return client[_0xb2f9('0xe')](_0x42eaff,_0x11af68)[_0xb2f9('0xf')](function(_0x454206){logger[_0xb2f9('0x10')](_0xb2f9('0x11'),_0x5a2604,_0xb2f9('0x12'));logger[_0xb2f9('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5a2604,'request\x20sent',JSON[_0xb2f9('0x14')](_0x454206));if(_0x454206[_0xb2f9('0x15')]){if(_0x454206[_0xb2f9('0x15')]['code']===0x1f4){logger[_0xb2f9('0x15')](_0xb2f9('0x11'),_0x5a2604,_0x454206[_0xb2f9('0x15')][_0xb2f9('0x16')]);return _0x9bad5a(_0x454206[_0xb2f9('0x15')]['message']);}logger[_0xb2f9('0x15')](_0xb2f9('0x11'),_0x5a2604,_0x454206['error'][_0xb2f9('0x16')]);return _0x589b2c(_0x454206[_0xb2f9('0x15')][_0xb2f9('0x16')]);}else{logger['info'](_0xb2f9('0x11'),_0x5a2604,_0xb2f9('0x12'));_0x589b2c(_0x454206[_0xb2f9('0x17')][_0xb2f9('0x16')]);}})[_0xb2f9('0x18')](function(_0x14c46e){logger[_0xb2f9('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5a2604,_0x14c46e);_0x9bad5a(_0x14c46e);});});}exports[_0xb2f9('0x19')]=function(_0x25630a){var _0x52084f=this;return new Promise(function(_0x42cd7c,_0x112853){return db['ChatMessage'][_0xb2f9('0x1a')](_0x25630a[_0xb2f9('0x1b')],{'raw':_0x25630a[_0xb2f9('0x1c')]?_0x25630a['options'][_0xb2f9('0x1d')]===undefined?!![]:![]:!![]})[_0xb2f9('0xf')](function(_0x28de41){logger[_0xb2f9('0x10')](_0xb2f9('0x19'),_0x25630a);logger['debug']('CreateChatMessage',_0x25630a,JSON[_0xb2f9('0x14')](_0x28de41));_0x42cd7c(_0x28de41);})['catch'](function(_0x1808e3){logger[_0xb2f9('0x15')](_0xb2f9('0x19'),_0x1808e3[_0xb2f9('0x16')],_0x25630a);_0x112853(_0x52084f[_0xb2f9('0x15')](0x1f4,_0x1808e3[_0xb2f9('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index eef90bd..dc1d7fc 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 _0x08d9=['length','chatMessage:','./chatMessage.events','remove','removeListener','register'];(function(_0x103c42,_0x4c4efb){var _0x56ec80=function(_0x38092e){while(--_0x38092e){_0x103c42['push'](_0x103c42['shift']());}};_0x56ec80(++_0x4c4efb);}(_0x08d9,0xc2));var _0x908d=function(_0x1f356c,_0x313364){_0x1f356c=_0x1f356c-0x0;var _0x2674dc=_0x08d9[_0x1f356c];return _0x2674dc;};'use strict';var ChatMessageEvents=require(_0x908d('0x0'));var events=['save',_0x908d('0x1'),'update'];function createListener(_0x1557c3,_0x739218){return function(_0x38a571){_0x739218['emit'](_0x1557c3,_0x38a571);};}function removeListener(_0x53cef4,_0x15dfb3){return function(){ChatMessageEvents[_0x908d('0x2')](_0x53cef4,_0x15dfb3);};}exports[_0x908d('0x3')]=function(_0xe780e0){for(var _0xb63409=0x0,_0x5d67d6=events[_0x908d('0x4')];_0xb63409<_0x5d67d6;_0xb63409++){var _0x12ce59=events[_0xb63409];var _0x388e9c=createListener(_0x908d('0x5')+_0x12ce59,_0xe780e0);ChatMessageEvents['on'](_0x12ce59,_0x388e9c);}};
\ No newline at end of file
+var _0x425d=['./chatMessage.events','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x425d,0x1e0));var _0xd425=function(_0x25f26c,_0x16a416){_0x25f26c=_0x25f26c-0x0;var _0x5db63d=_0x425d[_0x25f26c];return _0x5db63d;};'use strict';var ChatMessageEvents=require(_0xd425('0x0'));var events=['save',_0xd425('0x1'),_0xd425('0x2')];function createListener(_0x314a2b,_0x97e370){return function(_0x183caa){_0x97e370[_0xd425('0x3')](_0x314a2b,_0x183caa);};}function removeListener(_0x47043f,_0x596be7){return function(){ChatMessageEvents[_0xd425('0x4')](_0x47043f,_0x596be7);};}exports[_0xd425('0x5')]=function(_0xc4e080){for(var _0x36866e=0x0,_0x1d97d9=events[_0xd425('0x6')];_0x36866e<_0x1d97d9;_0x36866e++){var _0x50b061=events[_0x36866e];var _0xb6ba8e=createListener(_0xd425('0x7')+_0x50b061,_0xc4e080);ChatMessageEvents['on'](_0x50b061,_0xb6ba8e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 3e40d1b..54b17d8 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 _0x230a=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','chat','put','update','/:id/accept','/:id/reject','delete','exports','multer','util'];(function(_0xbba35e,_0x5580af){var _0x24f451=function(_0x5e1f4d){while(--_0x5e1f4d){_0xbba35e['push'](_0xbba35e['shift']());}};_0x24f451(++_0x5580af);}(_0x230a,0x124));var _0xa230=function(_0x387820,_0x430012){_0x387820=_0x387820-0x0;var _0x1353e0=_0x230a[_0x387820];return _0x1353e0;};'use strict';var multer=require(_0xa230('0x0'));var util=require(_0xa230('0x1'));var path=require('path');var timeout=require(_0xa230('0x2'));var express=require(_0xa230('0x3'));var router=express['Router']();var fs_extra=require(_0xa230('0x4'));var auth=require(_0xa230('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa230('0x6'));var controller=require(_0xa230('0x7'));router[_0xa230('0x8')]('/',auth[_0xa230('0x9')](),controller[_0xa230('0xa')]);router[_0xa230('0x8')](_0xa230('0xb'),auth['isAuthenticated'](),controller[_0xa230('0xc')]);router[_0xa230('0x8')](_0xa230('0xd'),auth[_0xa230('0x9')](),controller['show']);router['post']('/',auth[_0xa230('0x9')](),interaction['tracked'](_0xa230('0xe'),'chatmessage:create'),controller['create']);router[_0xa230('0xf')](_0xa230('0xd'),controller[_0xa230('0x10')]);router['put'](_0xa230('0x11'),auth[_0xa230('0x9')](),controller['accept']);router[_0xa230('0xf')](_0xa230('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0xa230('0x13')](_0xa230('0xd'),auth[_0xa230('0x9')](),controller['destroy']);module[_0xa230('0x14')]=router;
\ No newline at end of file
+var _0x04bd=['../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','fs-extra'];(function(_0x17d8a1,_0x54e6be){var _0x3ceab1=function(_0x479187){while(--_0x479187){_0x17d8a1['push'](_0x17d8a1['shift']());}};_0x3ceab1(++_0x54e6be);}(_0x04bd,0x15a));var _0xd04b=function(_0x398958,_0x27152c){_0x398958=_0x398958-0x0;var _0xdc7c70=_0x04bd[_0x398958];return _0xdc7c70;};'use strict';var multer=require(_0xd04b('0x0'));var util=require(_0xd04b('0x1'));var path=require('path');var timeout=require(_0xd04b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd04b('0x3'));var auth=require(_0xd04b('0x4'));var interaction=require(_0xd04b('0x5'));var config=require('../../config/environment');var controller=require(_0xd04b('0x6'));router[_0xd04b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd04b('0x7')](_0xd04b('0x8'),auth[_0xd04b('0x9')](),controller[_0xd04b('0xa')]);router[_0xd04b('0x7')](_0xd04b('0xb'),auth[_0xd04b('0x9')](),controller[_0xd04b('0xc')]);router[_0xd04b('0xd')]('/',auth[_0xd04b('0x9')](),interaction[_0xd04b('0xe')](_0xd04b('0xf'),'chatmessage:create'),controller[_0xd04b('0x10')]);router[_0xd04b('0x11')]('/:id',controller[_0xd04b('0x12')]);router['put'](_0xd04b('0x13'),auth[_0xd04b('0x9')](),controller[_0xd04b('0x14')]);router[_0xd04b('0x11')](_0xd04b('0x15'),auth[_0xd04b('0x9')](),controller[_0xd04b('0x16')]);router[_0xd04b('0x17')](_0xd04b('0xb'),auth['isAuthenticated'](),controller[_0xd04b('0x18')]);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 bfa1d29..efbd8f8 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 _0x2abb=['exports','medium'];(function(_0x13d0fc,_0x391eba){var _0x124453=function(_0x956eba){while(--_0x956eba){_0x13d0fc['push'](_0x13d0fc['shift']());}};_0x124453(++_0x391eba);}(_0x2abb,0x194));var _0xb2ab=function(_0x344502,_0x196f55){_0x344502=_0x344502-0x0;var _0x58e840=_0x2abb[_0x344502];return _0x58e840;};'use strict';var Sequelize=require('sequelize');module[_0xb2ab('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb2ab('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xbf3f=['sequelize'];(function(_0x36db79,_0xcae976){var _0x2da19a=function(_0x761b07){while(--_0x761b07){_0x36db79['push'](_0x36db79['shift']());}};_0x2da19a(++_0xcae976);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfbf3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index d38d983..81bac30 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x39c753,_0x183f32){var _0x8a925c=function(_0x179ba9){while(--_0x179ba9){_0x39c753['push'](_0x39c753['shift']());}};_0x8a925c(++_0x183f32);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x87e2dc,_0xf40092){_0x87e2dc=_0x87e2dc-0x0;var _0x1d8350=_0x7a54[_0x87e2dc];return _0x1d8350;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 4c62bc4..694cdfc 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 _0x7ffb=['utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0xce0f2e,_0x43a96d){var _0x584a44=function(_0x332d78){while(--_0x332d78){_0xce0f2e['push'](_0xce0f2e['shift']());}};_0x584a44(++_0x43a96d);}(_0x7ffb,0x151));var _0xb7ff=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x7ffb[_0x333714];return _0x4c211e;};'use strict';var _=require(_0xb7ff('0x0'));var util=require(_0xb7ff('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb7ff('0x2'));var rp=require(_0xb7ff('0x3'));var fs=require('fs');var path=require(_0xb7ff('0x4'));var rimraf=require(_0xb7ff('0x5'));var config=require(_0xb7ff('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0xb7ff('0x7')]=function(_0x37e13c,_0x16ae16){return _0x37e13c[_0xb7ff('0x8')](_0xb7ff('0x9'),attributes,{'tableName':_0xb7ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb7ff('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4e5d=['utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x4e5d,0x195));var _0xd4e5=function(_0x55e4e1,_0x352a79){_0x55e4e1=_0x55e4e1-0x0;var _0x1644e8=_0x4e5d[_0x55e4e1];return _0x1644e8;};'use strict';var _=require(_0xd4e5('0x0'));var util=require(_0xd4e5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd4e5('0x2'));var BPromise=require('bluebird');var rp=require(_0xd4e5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4e5('0x4'));var config=require(_0xd4e5('0x5'));var attributes=require(_0xd4e5('0x6'));module[_0xd4e5('0x7')]=function(_0x3d8502,_0x318199){return _0x3d8502[_0xd4e5('0x8')](_0xd4e5('0x9'),attributes,{'tableName':_0xd4e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd4e5('0xb'),'collate':_0xd4e5('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index ec81658..f93cc55 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 _0x5282=['ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2f87f4,_0x5c4c){var _0x45284c=function(_0x26f308){while(--_0x26f308){_0x2f87f4['push'](_0x2f87f4['shift']());}};_0x45284c(++_0x5c4c);}(_0x5282,0x111));var _0x2528=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x5282[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0x2528('0x0'));var util=require('util');var moment=require(_0x2528('0x1'));var BPromise=require(_0x2528('0x2'));var rs=require(_0x2528('0x3'));var fs=require('fs');var Redis=require(_0x2528('0x4'));var db=require(_0x2528('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2528('0x6'))(_0x2528('0x7'));var config=require(_0x2528('0x8'));var jayson=require(_0x2528('0x9'));var client=jayson[_0x2528('0xa')][_0x2528('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fb31c,_0x21be35,_0x49f9d6){return new BPromise(function(_0x14fcd2,_0x186a10){return client[_0x2528('0xc')](_0x2fb31c,_0x49f9d6)[_0x2528('0xd')](function(_0x20db97){logger[_0x2528('0xe')](_0x2528('0xf'),_0x21be35,'request\x20sent');logger[_0x2528('0x10')](_0x2528('0x11'),_0x21be35,'request\x20sent',JSON['stringify'](_0x20db97));if(_0x20db97[_0x2528('0x12')]){if(_0x20db97[_0x2528('0x12')][_0x2528('0x13')]===0x1f4){logger[_0x2528('0x12')](_0x2528('0xf'),_0x21be35,_0x20db97[_0x2528('0x12')][_0x2528('0x14')]);return _0x186a10(_0x20db97['error']['message']);}logger[_0x2528('0x12')](_0x2528('0xf'),_0x21be35,_0x20db97[_0x2528('0x12')][_0x2528('0x14')]);return _0x14fcd2(_0x20db97[_0x2528('0x12')]['message']);}else{logger[_0x2528('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x21be35,_0x2528('0x15'));_0x14fcd2(_0x20db97[_0x2528('0x16')][_0x2528('0x14')]);}})[_0x2528('0x17')](function(_0x1076d8){logger[_0x2528('0x12')](_0x2528('0xf'),_0x21be35,_0x1076d8);_0x186a10(_0x1076d8);});});}
\ No newline at end of file
+var _0xc123=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','info'];(function(_0x51065c,_0x12e389){var _0x3575d7=function(_0x3858b2){while(--_0x3858b2){_0x51065c['push'](_0x51065c['shift']());}};_0x3575d7(++_0x12e389);}(_0xc123,0x193));var _0x3c12=function(_0x2a8862,_0x1ce5bb){_0x2a8862=_0x2a8862-0x0;var _0x56fc9d=_0xc123[_0x2a8862];return _0x56fc9d;};'use strict';var _=require('lodash');var util=require(_0x3c12('0x0'));var moment=require(_0x3c12('0x1'));var BPromise=require(_0x3c12('0x2'));var rs=require(_0x3c12('0x3'));var fs=require('fs');var Redis=require(_0x3c12('0x4'));var db=require(_0x3c12('0x5'))['db'];var utils=require(_0x3c12('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c12('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b1e8,_0x361fb5,_0x5b8e3f){return new BPromise(function(_0x585ac5,_0x527053){return client[_0x3c12('0x8')](_0x10b1e8,_0x5b8e3f)[_0x3c12('0x9')](function(_0x11f3a4){logger[_0x3c12('0xa')](_0x3c12('0xb'),_0x361fb5,_0x3c12('0xc'));logger[_0x3c12('0xd')](_0x3c12('0xe'),_0x361fb5,_0x3c12('0xc'),JSON['stringify'](_0x11f3a4));if(_0x11f3a4['error']){if(_0x11f3a4[_0x3c12('0xf')][_0x3c12('0x10')]===0x1f4){logger[_0x3c12('0xf')](_0x3c12('0xb'),_0x361fb5,_0x11f3a4[_0x3c12('0xf')]['message']);return _0x527053(_0x11f3a4[_0x3c12('0xf')][_0x3c12('0x11')]);}logger[_0x3c12('0xf')](_0x3c12('0xb'),_0x361fb5,_0x11f3a4[_0x3c12('0xf')]['message']);return _0x585ac5(_0x11f3a4[_0x3c12('0xf')][_0x3c12('0x11')]);}else{logger[_0x3c12('0xa')](_0x3c12('0xb'),_0x361fb5,'request\x20sent');_0x585ac5(_0x11f3a4['result'][_0x3c12('0x11')]);}})['catch'](function(_0x4c5234){logger[_0x3c12('0xf')](_0x3c12('0xb'),_0x361fb5,_0x4c5234);_0x527053(_0x4c5234);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 0117d42..8c994a6 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 _0x0f3e=['/:id','update','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0f3e,0x1f3));var _0xe0f3=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0x0f3e[_0x550e29];return _0x3515b6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe0f3('0x0'));var express=require('express');var router=express[_0xe0f3('0x1')]();var fs_extra=require(_0xe0f3('0x2'));var auth=require(_0xe0f3('0x3'));var interaction=require(_0xe0f3('0x4'));var config=require(_0xe0f3('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xe0f3('0x6')]('/',auth['isAuthenticated'](),controller[_0xe0f3('0x7')]);router[_0xe0f3('0x6')]('/describe',auth[_0xe0f3('0x8')](),controller[_0xe0f3('0x9')]);router[_0xe0f3('0x6')]('/:id',auth[_0xe0f3('0x8')](),controller[_0xe0f3('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe0f3('0xb'),auth[_0xe0f3('0x8')](),controller[_0xe0f3('0xc')]);router[_0xe0f3('0xd')](_0xe0f3('0xb'),auth['isAuthenticated'](),controller[_0xe0f3('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x61ed=['get','isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0xa3f42f,_0x1fe568){var _0x403be2=function(_0x3737d3){while(--_0x3737d3){_0xa3f42f['push'](_0xa3f42f['shift']());}};_0x403be2(++_0x1fe568);}(_0x61ed,0x1df));var _0xd61e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61ed[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xd61e('0x0'));var util=require(_0xd61e('0x1'));var path=require('path');var timeout=require(_0xd61e('0x2'));var express=require(_0xd61e('0x3'));var router=express[_0xd61e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd61e('0x5'));var config=require(_0xd61e('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xd61e('0x7')]('/',auth[_0xd61e('0x8')](),controller[_0xd61e('0x9')]);router[_0xd61e('0x7')](_0xd61e('0xa'),auth[_0xd61e('0x8')](),controller['describe']);router[_0xd61e('0x7')](_0xd61e('0xb'),auth[_0xd61e('0x8')](),controller[_0xd61e('0xc')]);router['post']('/',auth[_0xd61e('0x8')](),controller[_0xd61e('0xd')]);router['put'](_0xd61e('0xb'),auth['isAuthenticated'](),controller[_0xd61e('0xe')]);router[_0xd61e('0xf')](_0xd61e('0xb'),auth[_0xd61e('0x8')](),controller[_0xd61e('0x10')]);module[_0xd61e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index ff99e7b..12d8a15 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 _0x5240=['exports','STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0x6daf53,_0x1bb4b5){var _0x5b944c=function(_0x231d79){while(--_0x231d79){_0x6daf53['push'](_0x6daf53['shift']());}};_0x5b944c(++_0x1bb4b5);}(_0x5240,0x101));var _0x0524=function(_0x2c8f05,_0x3b5b37){_0x2c8f05=_0x2c8f05-0x0;var _0x3a48fd=_0x5240[_0x2c8f05];return _0x3a48fd;};'use strict';var Sequelize=require(_0x0524('0x0'));module[_0x0524('0x1')]={'name':{'type':Sequelize[_0x0524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0524('0x3')]('mouseOver','timeout'),'defaultValue':_0x0524('0x4')},'selector':{'type':Sequelize[_0x0524('0x2')]},'timeout':{'type':Sequelize[_0x0524('0x5')]}};
\ No newline at end of file
+var _0xa0bd=['mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x1d4f6d,_0x7cca5a){var _0x106756=function(_0x5186b0){while(--_0x5186b0){_0x1d4f6d['push'](_0x1d4f6d['shift']());}};_0x106756(++_0x7cca5a);}(_0xa0bd,0xd0));var _0xda0b=function(_0xba7f9a,_0xbee956){_0xba7f9a=_0xba7f9a-0x0;var _0x3c598a=_0xa0bd[_0xba7f9a];return _0x3c598a;};'use strict';var Sequelize=require(_0xda0b('0x0'));module['exports']={'name':{'type':Sequelize[_0xda0b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xda0b('0x2'),_0xda0b('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xda0b('0x1')]},'timeout':{'type':Sequelize[_0xda0b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 29ffb6d..23e51f2 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 _0xad36=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x932a6c,_0x6b9e07){var _0x2252be=function(_0x288d63){while(--_0x288d63){_0x932a6c['push'](_0x932a6c['shift']());}};_0x2252be(++_0x6b9e07);}(_0xad36,0x11c));var _0x6ad3=function(_0x1493d3,_0x57dccc){_0x1493d3=_0x1493d3-0x0;var _0x172951=_0xad36[_0x1493d3];return _0x172951;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ad3('0x0'));var zipdir=require(_0x6ad3('0x1'));var jsonpatch=require(_0x6ad3('0x2'));var rp=require(_0x6ad3('0x3'));var moment=require(_0x6ad3('0x4'));var BPromise=require(_0x6ad3('0x5'));var Mustache=require(_0x6ad3('0x6'));var util=require(_0x6ad3('0x7'));var path=require(_0x6ad3('0x8'));var sox=require('sox');var csv=require(_0x6ad3('0x9'));var ejs=require(_0x6ad3('0xa'));var fs=require('fs');var fs_extra=require(_0x6ad3('0xb'));var _=require(_0x6ad3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ad3('0x9'));var querystring=require(_0x6ad3('0xd'));var Papa=require(_0x6ad3('0xe'));var Redis=require(_0x6ad3('0xf'));var authService=require(_0x6ad3('0x10'));var qs=require(_0x6ad3('0x11'));var as=require(_0x6ad3('0x12'));var hardwareService=require(_0x6ad3('0x13'));var logger=require(_0x6ad3('0x14'))('api');var utils=require(_0x6ad3('0x15'));var config=require(_0x6ad3('0x16'));var licenseUtil=require(_0x6ad3('0x17'));var db=require(_0x6ad3('0x18'))['db'];function respondWithStatusCode(_0x439b9b,_0x27d865){_0x27d865=_0x27d865||0xcc;return function(_0x3132b7){if(_0x3132b7){return _0x439b9b[_0x6ad3('0x19')](_0x27d865);}return _0x439b9b['status'](_0x27d865)[_0x6ad3('0x1a')]();};}function respondWithResult(_0x4883a1,_0x14418f){_0x14418f=_0x14418f||0xc8;return function(_0x2541fa){if(_0x2541fa){return _0x4883a1[_0x6ad3('0x1b')](_0x14418f)[_0x6ad3('0x1c')](_0x2541fa);}};}function respondWithFilteredResult(_0x2e1ba0,_0x52bb9d){return function(_0x2d406b){if(_0x2d406b){var _0x45aa65=typeof _0x52bb9d[_0x6ad3('0x1d')]==='undefined'&&typeof _0x52bb9d['limit']==='undefined';var _0x4ea840=_0x2d406b[_0x6ad3('0x1e')];var _0x4d031b=_0x45aa65?0x0:_0x52bb9d[_0x6ad3('0x1d')];var _0x52d10c=_0x45aa65?_0x2d406b[_0x6ad3('0x1e')]:_0x52bb9d[_0x6ad3('0x1d')]+_0x52bb9d[_0x6ad3('0x1f')];var _0x3f8ce2;if(_0x52d10c>=_0x4ea840){_0x52d10c=_0x4ea840;_0x3f8ce2=0xc8;}else{_0x3f8ce2=0xce;}_0x2e1ba0['status'](_0x3f8ce2);return _0x2e1ba0['set'](_0x6ad3('0x20'),_0x4d031b+'-'+_0x52d10c+'/'+_0x4ea840)[_0x6ad3('0x1c')](_0x2d406b);}return null;};}function patchUpdates(_0x1fad6e){return function(_0x3050aa){try{jsonpatch[_0x6ad3('0x21')](_0x3050aa,_0x1fad6e,!![]);}catch(_0xc75a57){return BPromise[_0x6ad3('0x22')](_0xc75a57);}return _0x3050aa[_0x6ad3('0x23')]();};}function saveUpdates(_0xe5b2ad,_0x4cb79d){return function(_0x33e11b){if(_0x33e11b){return _0x33e11b[_0x6ad3('0x24')](_0xe5b2ad)[_0x6ad3('0x25')](function(_0x1fcdf9){return _0x1fcdf9;});}return null;};}function removeEntity(_0x220887,_0x244064){return function(_0x4887ba){if(_0x4887ba){return _0x4887ba[_0x6ad3('0x26')]()[_0x6ad3('0x25')](function(){_0x220887[_0x6ad3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50dbec,_0xec24c5){return function(_0x13bff5){if(!_0x13bff5){_0x50dbec['sendStatus'](0x194);}return _0x13bff5;};}function handleError(_0x5523d1,_0x28debd){_0x28debd=_0x28debd||0x1f4;return function(_0x1892fd){logger[_0x6ad3('0x27')](_0x1892fd[_0x6ad3('0x28')]);if(_0x1892fd[_0x6ad3('0x29')]){delete _0x1892fd[_0x6ad3('0x29')];}_0x5523d1['status'](_0x28debd)['send'](_0x1892fd);};}exports[_0x6ad3('0x2a')]=function(_0x3e8d2a,_0x3f1351){var _0x2c4dda={'raw':!![],'where':{'id':_0x3e8d2a[_0x6ad3('0x2b')]['id']}},_0x4ee707={};_0x4ee707[_0x6ad3('0x2c')]=_[_0x6ad3('0x2d')](db[_0x6ad3('0x2e')][_0x6ad3('0x2f')]);_0x4ee707[_0x6ad3('0x30')]=_[_0x6ad3('0x2d')](_0x3e8d2a[_0x6ad3('0x30')]);_0x4ee707[_0x6ad3('0x31')]=_['intersection'](_0x4ee707[_0x6ad3('0x2c')],_0x4ee707[_0x6ad3('0x30')]);_0x2c4dda['attributes']=_[_0x6ad3('0x32')](_0x4ee707[_0x6ad3('0x2c')],qs[_0x6ad3('0x33')](_0x3e8d2a[_0x6ad3('0x30')]['fields']));_0x2c4dda[_0x6ad3('0x34')]=_0x2c4dda['attributes'][_0x6ad3('0x35')]?_0x2c4dda[_0x6ad3('0x34')]:_0x4ee707[_0x6ad3('0x2c')];if(_0x3e8d2a[_0x6ad3('0x30')][_0x6ad3('0x36')]){_0x2c4dda[_0x6ad3('0x37')]=[{'all':!![]}];}_0x2c4dda=_['merge']({},_0x2c4dda,_0x3e8d2a[_0x6ad3('0x38')]);return db[_0x6ad3('0x2e')][_0x6ad3('0x39')](_0x2c4dda)[_0x6ad3('0x25')](handleEntityNotFound(_0x3f1351,null))[_0x6ad3('0x25')](respondWithResult(_0x3f1351,null))['catch'](handleError(_0x3f1351,null));};exports[_0x6ad3('0x3a')]=function(_0x5ab890,_0x19b4cb){return db[_0x6ad3('0x2e')][_0x6ad3('0x3a')](_0x5ab890[_0x6ad3('0x3b')],{})[_0x6ad3('0x25')](respondWithResult(_0x19b4cb,0xc9))[_0x6ad3('0x3c')](handleError(_0x19b4cb,null));};exports[_0x6ad3('0x24')]=function(_0x1c3f74,_0x23617f){if(_0x1c3f74['body']['id']){delete _0x1c3f74[_0x6ad3('0x3b')]['id'];}return db[_0x6ad3('0x2e')][_0x6ad3('0x39')]({'where':{'id':_0x1c3f74[_0x6ad3('0x2b')]['id']}})[_0x6ad3('0x25')](handleEntityNotFound(_0x23617f,null))[_0x6ad3('0x25')](saveUpdates(_0x1c3f74[_0x6ad3('0x3b')],null))['then'](respondWithResult(_0x23617f,null))['catch'](handleError(_0x23617f,null));};exports[_0x6ad3('0x26')]=function(_0x3bae8a,_0x37b4c2){return db[_0x6ad3('0x2e')][_0x6ad3('0x39')]({'where':{'id':_0x3bae8a[_0x6ad3('0x2b')]['id']}})[_0x6ad3('0x25')](handleEntityNotFound(_0x37b4c2,null))['then'](removeEntity(_0x37b4c2,null))[_0x6ad3('0x3c')](handleError(_0x37b4c2,null));};
\ No newline at end of file
+var _0xe5e0=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','save','update','destroy','then','error','stack','name','send','show','model','keys','rawAttributes','query','intersection','attributes','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto'];(function(_0x38f350,_0x55f3bd){var _0x270724=function(_0xc7e184){while(--_0xc7e184){_0x38f350['push'](_0x38f350['shift']());}};_0x270724(++_0x55f3bd);}(_0xe5e0,0x123));var _0x0e5e=function(_0x273055,_0x159846){_0x273055=_0x273055-0x0;var _0x7256d1=_0xe5e0[_0x273055];return _0x7256d1;};'use strict';var emlformat=require(_0x0e5e('0x0'));var rimraf=require(_0x0e5e('0x1'));var zipdir=require(_0x0e5e('0x2'));var jsonpatch=require(_0x0e5e('0x3'));var rp=require(_0x0e5e('0x4'));var moment=require(_0x0e5e('0x5'));var BPromise=require(_0x0e5e('0x6'));var Mustache=require(_0x0e5e('0x7'));var util=require(_0x0e5e('0x8'));var path=require(_0x0e5e('0x9'));var sox=require('sox');var csv=require(_0x0e5e('0xa'));var ejs=require(_0x0e5e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e5e('0xc'));var squel=require('squel');var crypto=require(_0x0e5e('0xd'));var jsforce=require(_0x0e5e('0xe'));var deskjs=require(_0x0e5e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0e5e('0x10'));var Papa=require(_0x0e5e('0x11'));var Redis=require(_0x0e5e('0x12'));var authService=require(_0x0e5e('0x13'));var qs=require(_0x0e5e('0x14'));var as=require(_0x0e5e('0x15'));var hardwareService=require(_0x0e5e('0x16'));var logger=require(_0x0e5e('0x17'))(_0x0e5e('0x18'));var utils=require('../../config/utils');var config=require(_0x0e5e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e5e('0x1a'))['db'];function respondWithStatusCode(_0x57f4c6,_0x78ae6b){_0x78ae6b=_0x78ae6b||0xcc;return function(_0x3fb885){if(_0x3fb885){return _0x57f4c6[_0x0e5e('0x1b')](_0x78ae6b);}return _0x57f4c6[_0x0e5e('0x1c')](_0x78ae6b)[_0x0e5e('0x1d')]();};}function respondWithResult(_0x39abe5,_0x3a3b25){_0x3a3b25=_0x3a3b25||0xc8;return function(_0x4a9b48){if(_0x4a9b48){return _0x39abe5[_0x0e5e('0x1c')](_0x3a3b25)[_0x0e5e('0x1e')](_0x4a9b48);}};}function respondWithFilteredResult(_0x58fbd0,_0xa59fa4){return function(_0x26a904){if(_0x26a904){var _0x4dfd37=typeof _0xa59fa4[_0x0e5e('0x1f')]===_0x0e5e('0x20')&&typeof _0xa59fa4['limit']==='undefined';var _0x52a685=_0x26a904['count'];var _0x2467ea=_0x4dfd37?0x0:_0xa59fa4[_0x0e5e('0x1f')];var _0xb851a3=_0x4dfd37?_0x26a904[_0x0e5e('0x21')]:_0xa59fa4[_0x0e5e('0x1f')]+_0xa59fa4['limit'];var _0x134d7b;if(_0xb851a3>=_0x52a685){_0xb851a3=_0x52a685;_0x134d7b=0xc8;}else{_0x134d7b=0xce;}_0x58fbd0[_0x0e5e('0x1c')](_0x134d7b);return _0x58fbd0[_0x0e5e('0x22')]('Content-Range',_0x2467ea+'-'+_0xb851a3+'/'+_0x52a685)['json'](_0x26a904);}return null;};}function patchUpdates(_0x1237de){return function(_0x194dac){try{jsonpatch['apply'](_0x194dac,_0x1237de,!![]);}catch(_0x133356){return BPromise['reject'](_0x133356);}return _0x194dac[_0x0e5e('0x23')]();};}function saveUpdates(_0x15836e,_0x8163bc){return function(_0x365820){if(_0x365820){return _0x365820[_0x0e5e('0x24')](_0x15836e)['then'](function(_0x5533d9){return _0x5533d9;});}return null;};}function removeEntity(_0x1aabd1,_0x4759d9){return function(_0x4a9505){if(_0x4a9505){return _0x4a9505[_0x0e5e('0x25')]()[_0x0e5e('0x26')](function(){_0x1aabd1[_0x0e5e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d516b,_0x699304){return function(_0x2b3afc){if(!_0x2b3afc){_0x1d516b['sendStatus'](0x194);}return _0x2b3afc;};}function handleError(_0x3e91b5,_0x34dbf5){_0x34dbf5=_0x34dbf5||0x1f4;return function(_0x5e5349){logger[_0x0e5e('0x27')](_0x5e5349[_0x0e5e('0x28')]);if(_0x5e5349[_0x0e5e('0x29')]){delete _0x5e5349['name'];}_0x3e91b5[_0x0e5e('0x1c')](_0x34dbf5)[_0x0e5e('0x2a')](_0x5e5349);};}exports[_0x0e5e('0x2b')]=function(_0x106dc3,_0x49a401){var _0x58b734={'raw':!![],'where':{'id':_0x106dc3['params']['id']}},_0x2803c3={};_0x2803c3[_0x0e5e('0x2c')]=_[_0x0e5e('0x2d')](db['ChatProactiveAction'][_0x0e5e('0x2e')]);_0x2803c3[_0x0e5e('0x2f')]=_['keys'](_0x106dc3[_0x0e5e('0x2f')]);_0x2803c3['filters']=_[_0x0e5e('0x30')](_0x2803c3[_0x0e5e('0x2c')],_0x2803c3[_0x0e5e('0x2f')]);_0x58b734[_0x0e5e('0x31')]=_[_0x0e5e('0x30')](_0x2803c3[_0x0e5e('0x2c')],qs['fields'](_0x106dc3[_0x0e5e('0x2f')]['fields']));_0x58b734['attributes']=_0x58b734['attributes'][_0x0e5e('0x32')]?_0x58b734[_0x0e5e('0x31')]:_0x2803c3[_0x0e5e('0x2c')];if(_0x106dc3[_0x0e5e('0x2f')][_0x0e5e('0x33')]){_0x58b734[_0x0e5e('0x34')]=[{'all':!![]}];}_0x58b734=_[_0x0e5e('0x35')]({},_0x58b734,_0x106dc3[_0x0e5e('0x36')]);return db[_0x0e5e('0x37')][_0x0e5e('0x38')](_0x58b734)[_0x0e5e('0x26')](handleEntityNotFound(_0x49a401,null))[_0x0e5e('0x26')](respondWithResult(_0x49a401,null))[_0x0e5e('0x39')](handleError(_0x49a401,null));};exports[_0x0e5e('0x3a')]=function(_0x4562a5,_0x1f9876){return db['ChatProactiveAction'][_0x0e5e('0x3a')](_0x4562a5[_0x0e5e('0x3b')],{})[_0x0e5e('0x26')](respondWithResult(_0x1f9876,0xc9))[_0x0e5e('0x39')](handleError(_0x1f9876,null));};exports[_0x0e5e('0x24')]=function(_0x2237a4,_0x490075){if(_0x2237a4[_0x0e5e('0x3b')]['id']){delete _0x2237a4['body']['id'];}return db[_0x0e5e('0x37')][_0x0e5e('0x38')]({'where':{'id':_0x2237a4[_0x0e5e('0x3c')]['id']}})[_0x0e5e('0x26')](handleEntityNotFound(_0x490075,null))[_0x0e5e('0x26')](saveUpdates(_0x2237a4[_0x0e5e('0x3b')],null))[_0x0e5e('0x26')](respondWithResult(_0x490075,null))['catch'](handleError(_0x490075,null));};exports['destroy']=function(_0x4732c3,_0x47e6a7){return db[_0x0e5e('0x37')][_0x0e5e('0x38')]({'where':{'id':_0x4732c3['params']['id']}})[_0x0e5e('0x26')](handleEntityNotFound(_0x47e6a7,null))['then'](removeEntity(_0x47e6a7,null))['catch'](handleError(_0x47e6a7,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index aff0b86..fc19d49 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 _0xc8a9=['../../config/logger','api','moment','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc8a9,0x149));var _0x9c8a=function(_0x35d035,_0x56f190){_0x35d035=_0x35d035-0x0;var _0x4ef2ab=_0xc8a9[_0x35d035];return _0x4ef2ab;};'use strict';var _=require(_0x9c8a('0x0'));var util=require('util');var logger=require(_0x9c8a('0x1'))(_0x9c8a('0x2'));var moment=require(_0x9c8a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c8a('0x4'));var rimraf=require(_0x9c8a('0x5'));var config=require('../../config/environment');var attributes=require(_0x9c8a('0x6'));module[_0x9c8a('0x7')]=function(_0x23bc9a,_0x5dc01a){return _0x23bc9a[_0x9c8a('0x8')](_0x9c8a('0x9'),attributes,{'tableName':_0x9c8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb504=['../../config/environment','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x17224a,_0x561257){var _0x43fb11=function(_0x53e807){while(--_0x53e807){_0x17224a['push'](_0x17224a['shift']());}};_0x43fb11(++_0x561257);}(_0xb504,0x16a));var _0x4b50=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb504[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4b50('0x0'));var util=require(_0x4b50('0x1'));var logger=require(_0x4b50('0x2'))(_0x4b50('0x3'));var moment=require(_0x4b50('0x4'));var BPromise=require(_0x4b50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b50('0x6'));var rimraf=require(_0x4b50('0x7'));var config=require(_0x4b50('0x8'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x2dda72,_0x428fc6){return _0x2dda72['define']('ChatProactiveAction',attributes,{'tableName':_0x4b50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index fb334cc..ebbf623 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 _0x5bb3=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x149f79,_0x57be9b){var _0x318abe=function(_0x39c22a){while(--_0x39c22a){_0x149f79['push'](_0x149f79['shift']());}};_0x318abe(++_0x57be9b);}(_0x5bb3,0x116));var _0x35bb=function(_0x18f34c,_0x2a293e){_0x18f34c=_0x18f34c-0x0;var _0x3ef4a8=_0x5bb3[_0x18f34c];return _0x3ef4a8;};'use strict';var _=require(_0x35bb('0x0'));var util=require(_0x35bb('0x1'));var moment=require(_0x35bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x35bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35bb('0x4'))['db'];var utils=require(_0x35bb('0x5'));var logger=require(_0x35bb('0x6'))(_0x35bb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x35bb('0x8')][_0x35bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0275,_0x35c023,_0x1d075b){return new BPromise(function(_0x3697ee,_0x56b58f){return client[_0x35bb('0xa')](_0x5e0275,_0x1d075b)[_0x35bb('0xb')](function(_0x257b70){logger[_0x35bb('0xc')](_0x35bb('0xd'),_0x35c023,_0x35bb('0xe'));logger['debug'](_0x35bb('0xf'),_0x35c023,'request\x20sent',JSON[_0x35bb('0x10')](_0x257b70));if(_0x257b70[_0x35bb('0x11')]){if(_0x257b70['error'][_0x35bb('0x12')]===0x1f4){logger[_0x35bb('0x11')](_0x35bb('0xd'),_0x35c023,_0x257b70[_0x35bb('0x11')][_0x35bb('0x13')]);return _0x56b58f(_0x257b70[_0x35bb('0x11')]['message']);}logger[_0x35bb('0x11')](_0x35bb('0xd'),_0x35c023,_0x257b70['error'][_0x35bb('0x13')]);return _0x3697ee(_0x257b70[_0x35bb('0x11')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x35c023,_0x35bb('0xe'));_0x3697ee(_0x257b70[_0x35bb('0x14')][_0x35bb('0x13')]);}})[_0x35bb('0x15')](function(_0x3d9383){logger['error'](_0x35bb('0xd'),_0x35c023,_0x3d9383);_0x56b58f(_0x3d9383);});});}
\ No newline at end of file
+var _0x6f75=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x38918c,_0x246fd1){var _0x5a5831=function(_0x1dfa83){while(--_0x1dfa83){_0x38918c['push'](_0x38918c['shift']());}};_0x5a5831(++_0x246fd1);}(_0x6f75,0x103));var _0x56f7=function(_0x4641d5,_0x4770e8){_0x4641d5=_0x4641d5-0x0;var _0x59e631=_0x6f75[_0x4641d5];return _0x59e631;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x56f7('0x0'));var BPromise=require(_0x56f7('0x1'));var rs=require(_0x56f7('0x2'));var fs=require('fs');var Redis=require(_0x56f7('0x3'));var db=require(_0x56f7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x5'))('rpc');var config=require(_0x56f7('0x6'));var jayson=require(_0x56f7('0x7'));var client=jayson[_0x56f7('0x8')][_0x56f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x928e30,_0x2cce21,_0x44edea){return new BPromise(function(_0x9ac1be,_0x1eafb4){return client[_0x56f7('0xa')](_0x928e30,_0x44edea)['then'](function(_0x35abbb){logger['info'](_0x56f7('0xb'),_0x2cce21,_0x56f7('0xc'));logger[_0x56f7('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2cce21,'request\x20sent',JSON['stringify'](_0x35abbb));if(_0x35abbb[_0x56f7('0xe')]){if(_0x35abbb[_0x56f7('0xe')]['code']===0x1f4){logger['error'](_0x56f7('0xb'),_0x2cce21,_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);return _0x1eafb4(_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);}logger[_0x56f7('0xe')](_0x56f7('0xb'),_0x2cce21,_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);return _0x9ac1be(_0x35abbb[_0x56f7('0xe')][_0x56f7('0xf')]);}else{logger[_0x56f7('0x10')](_0x56f7('0xb'),_0x2cce21,_0x56f7('0xc'));_0x9ac1be(_0x35abbb['result']['message']);}})[_0x56f7('0x11')](function(_0x34b306){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x2cce21,_0x34b306);_0x1eafb4(_0x34b306);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index f8b5dc3..02e42c5 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x3d16d2,_0x3c6bd2){var _0x147f21=function(_0x17701f){while(--_0x17701f){_0x3d16d2['push'](_0x3d16d2['shift']());}};_0x147f21(++_0x3c6bd2);}(_0xa630,0xbe));var _0x0a63=function(_0x554a9b,_0x40dba9){_0x554a9b=_0x554a9b-0x0;var _0x2f502d=_0xa630[_0x554a9b];return _0x2f502d;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
+var _0x5075=['show','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated'];(function(_0x42e726,_0xf42a58){var _0x4c9629=function(_0x3b2703){while(--_0x3b2703){_0x42e726['push'](_0x42e726['shift']());}};_0x4c9629(++_0xf42a58);}(_0x5075,0x73));var _0x5507=function(_0x3fd750,_0x120661){_0x3fd750=_0x3fd750-0x0;var _0x4f15d9=_0x5075[_0x3fd750];return _0x4f15d9;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/:id',auth[_0x5507('0xa')](),controller[_0x5507('0xb')]);router['post']('/',auth[_0x5507('0xa')](),controller[_0x5507('0xc')]);router[_0x5507('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')](_0x5507('0x10'),auth[_0x5507('0xa')](),controller['destroy']);module[_0x5507('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d155859..125f723 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 _0xa4db=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','name'];(function(_0x346a52,_0x30f4f5){var _0x50f30d=function(_0x5417e7){while(--_0x5417e7){_0x346a52['push'](_0x346a52['shift']());}};_0x50f30d(++_0x30f4f5);}(_0xa4db,0xc9));var _0xba4d=function(_0x9b9c94,_0x20b461){_0x9b9c94=_0x9b9c94-0x0;var _0x1dcd36=_0xa4db[_0x9b9c94];return _0x1dcd36;};'use strict';var Sequelize=require(_0xba4d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xba4d('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xba4d('0x2')]},'timeout':{'type':Sequelize[_0xba4d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xba4d('0x4')](_0xba4d('0x5'),'beepall',_0xba4d('0x6'))}};
\ No newline at end of file
+var _0xe2f9=['STRING','name','ENUM','rrmemory','roundrobin','exports'];(function(_0x78ca37,_0x3f9cb4){var _0x41f231=function(_0x4221ea){while(--_0x4221ea){_0x78ca37['push'](_0x78ca37['shift']());}};_0x41f231(++_0x3f9cb4);}(_0xe2f9,0x167));var _0x9e2f=function(_0x8860ef,_0x3bff8c){_0x8860ef=_0x8860ef-0x0;var _0x293f72=_0xe2f9[_0x8860ef];return _0x293f72;};'use strict';var Sequelize=require('sequelize');module[_0x9e2f('0x0')]={'name':{'type':Sequelize[_0x9e2f('0x1')],'unique':_0x9e2f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9e2f('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9e2f('0x3')](_0x9e2f('0x4'),'beepall',_0x9e2f('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 87bea6b..55d91d7 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 _0xd0b0=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','keys','length','include','find','create','body','user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','params','describe','findOne','UserChatQueue','hasOwnProperty','order','ChatQueueId','findAll','User','UserId','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x27daab,_0x44e180){var _0x37a477=function(_0x4f762a){while(--_0x4f762a){_0x27daab['push'](_0x27daab['shift']());}};_0x37a477(++_0x44e180);}(_0xd0b0,0x12d));var _0x0d0b=function(_0x280c2c,_0x2a589f){_0x280c2c=_0x280c2c-0x0;var _0x41e0ef=_0xd0b0[_0x280c2c];return _0x41e0ef;};'use strict';var emlformat=require(_0x0d0b('0x0'));var rimraf=require(_0x0d0b('0x1'));var zipdir=require(_0x0d0b('0x2'));var jsonpatch=require(_0x0d0b('0x3'));var rp=require('request-promise');var moment=require(_0x0d0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0d0b('0x5'));var util=require(_0x0d0b('0x6'));var path=require(_0x0d0b('0x7'));var sox=require(_0x0d0b('0x8'));var csv=require(_0x0d0b('0x9'));var ejs=require(_0x0d0b('0xa'));var fs=require('fs');var fs_extra=require(_0x0d0b('0xb'));var _=require(_0x0d0b('0xc'));var squel=require(_0x0d0b('0xd'));var crypto=require(_0x0d0b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0d0b('0xf'));var toCsv=require(_0x0d0b('0x9'));var querystring=require(_0x0d0b('0x10'));var Papa=require(_0x0d0b('0x11'));var Redis=require(_0x0d0b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0d0b('0x13'));var as=require(_0x0d0b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d0b('0x15'))(_0x0d0b('0x16'));var utils=require(_0x0d0b('0x17'));var config=require(_0x0d0b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0d0b('0x19')]=_[_0x0d0b('0x1a')](config[_0x0d0b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d0b('0x1b'))(new Redis(config[_0x0d0b('0x19')]));require(_0x0d0b('0x1c'))['register'](socket);var jayson=require(_0x0d0b('0x1d'));var client=jayson[_0x0d0b('0x1e')][_0x0d0b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xf5511f,_0x5c10dc,_0x575ae6,_0x3b2f6e){return new BPromise(function(_0x467e69,_0x1463be){var _0x1df654=_0x3b2f6e||client;return _0x1df654[_0x0d0b('0x20')](_0xf5511f,_0x575ae6)[_0x0d0b('0x21')](function(_0x2a9f78){logger[_0x0d0b('0x22')](_0x0d0b('0x23'),_0x5c10dc,'request\x20sent');logger[_0x0d0b('0x24')](_0x0d0b('0x25'),_0x5c10dc,_0x0d0b('0x26'),JSON['stringify'](_0x2a9f78));if(_0x2a9f78[_0x0d0b('0x27')]){if(_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x28')]===0x1f4){logger[_0x0d0b('0x27')](_0x0d0b('0x23'),_0x5c10dc,_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);return _0x1463be(_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);}logger['error'](_0x0d0b('0x23'),_0x5c10dc,_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);return _0x467e69(_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5c10dc,_0x0d0b('0x26'));_0x467e69(_0x2a9f78[_0x0d0b('0x2a')][_0x0d0b('0x29')]);}})['catch'](function(_0x340f8f){logger[_0x0d0b('0x27')](_0x0d0b('0x23'),_0x5c10dc,_0x340f8f);_0x1463be(_0x340f8f);});});}function respondWithStatusCode(_0x2fb097,_0x44a1ea){_0x44a1ea=_0x44a1ea||0xcc;return function(_0x303e43){if(_0x303e43){return _0x2fb097[_0x0d0b('0x2b')](_0x44a1ea);}return _0x2fb097[_0x0d0b('0x2c')](_0x44a1ea)[_0x0d0b('0x2d')]();};}function respondWithResult(_0x4712be,_0x38db3f){_0x38db3f=_0x38db3f||0xc8;return function(_0xe7d286){if(_0xe7d286){return _0x4712be[_0x0d0b('0x2c')](_0x38db3f)[_0x0d0b('0x2e')](_0xe7d286);}};}function respondWithFilteredResult(_0xd09306,_0x3f406a){return function(_0x5a306c){if(_0x5a306c){var _0x1dc90c=typeof _0x3f406a[_0x0d0b('0x2f')]===_0x0d0b('0x30')&&typeof _0x3f406a[_0x0d0b('0x31')]===_0x0d0b('0x30');var _0xdefcf4=_0x5a306c[_0x0d0b('0x32')];var _0x59430f=_0x1dc90c?0x0:_0x3f406a[_0x0d0b('0x2f')];var _0x3538d4=_0x1dc90c?_0x5a306c['count']:_0x3f406a['offset']+_0x3f406a[_0x0d0b('0x31')];var _0x55138e;if(_0x3538d4>=_0xdefcf4){_0x3538d4=_0xdefcf4;_0x55138e=0xc8;}else{_0x55138e=0xce;}_0xd09306['status'](_0x55138e);return _0xd09306[_0x0d0b('0x33')](_0x0d0b('0x34'),_0x59430f+'-'+_0x3538d4+'/'+_0xdefcf4)[_0x0d0b('0x2e')](_0x5a306c);}return null;};}function patchUpdates(_0x926606){return function(_0x1b4e9f){try{jsonpatch[_0x0d0b('0x35')](_0x1b4e9f,_0x926606,!![]);}catch(_0x2905a1){return BPromise[_0x0d0b('0x36')](_0x2905a1);}return _0x1b4e9f[_0x0d0b('0x37')]();};}function saveUpdates(_0x259e5c,_0x43fd1e){return function(_0x2ec9ae){if(_0x2ec9ae){return _0x2ec9ae[_0x0d0b('0x38')](_0x259e5c)[_0x0d0b('0x21')](function(_0x21a405){return _0x21a405;});}return null;};}function removeEntity(_0x149d74,_0x165e7c){return function(_0x10c01c){if(_0x10c01c){return _0x10c01c[_0x0d0b('0x39')]()[_0x0d0b('0x21')](function(){var _0x4ec8bd=_0x10c01c[_0x0d0b('0x3a')]({'plain':!![]});var _0x1dc79d='ChatQueues';return db[_0x0d0b('0x3b')][_0x0d0b('0x39')]({'where':{'type':_0x1dc79d,'resourceId':_0x4ec8bd['id']}})[_0x0d0b('0x21')](function(){return _0x10c01c;});})[_0x0d0b('0x21')](function(){_0x149d74[_0x0d0b('0x2c')](0xcc)[_0x0d0b('0x2d')]();});}};}function handleEntityNotFound(_0x2bf90d,_0xb96273){return function(_0x45e468){if(!_0x45e468){_0x2bf90d[_0x0d0b('0x2b')](0x194);}return _0x45e468;};}function handleError(_0x508ee6,_0x2b498c){_0x2b498c=_0x2b498c||0x1f4;return function(_0x4b854a){logger[_0x0d0b('0x27')](_0x4b854a[_0x0d0b('0x3c')]);if(_0x4b854a[_0x0d0b('0x3d')]){delete _0x4b854a[_0x0d0b('0x3d')];}_0x508ee6[_0x0d0b('0x2c')](_0x2b498c)[_0x0d0b('0x3e')](_0x4b854a);};}exports[_0x0d0b('0x3f')]=function(_0x3211d3,_0x522b0c){var _0x1ad146={},_0x3cef12={},_0x49b5e4={'count':0x0,'rows':[]};var _0x189aaa=_[_0x0d0b('0x40')](db[_0x0d0b('0x41')][_0x0d0b('0x42')],function(_0x597426){return{'name':_0x597426[_0x0d0b('0x43')],'type':_0x597426[_0x0d0b('0x44')][_0x0d0b('0x45')]};});_0x3cef12[_0x0d0b('0x46')]=_['map'](_0x189aaa,'name');_0x3cef12[_0x0d0b('0x47')]=_['keys'](_0x3211d3[_0x0d0b('0x47')]);_0x3cef12[_0x0d0b('0x48')]=_[_0x0d0b('0x49')](_0x3cef12['model'],_0x3cef12[_0x0d0b('0x47')]);_0x1ad146[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x3cef12['model'],qs[_0x0d0b('0x4b')](_0x3211d3['query'][_0x0d0b('0x4b')]));_0x1ad146['attributes']=_0x1ad146[_0x0d0b('0x4a')]['length']?_0x1ad146[_0x0d0b('0x4a')]:_0x3cef12[_0x0d0b('0x46')];if(!_0x3211d3['query']['hasOwnProperty'](_0x0d0b('0x4c'))){_0x1ad146['limit']=qs['limit'](_0x3211d3['query'][_0x0d0b('0x31')]);_0x1ad146[_0x0d0b('0x2f')]=qs[_0x0d0b('0x2f')](_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}_0x1ad146['order']=qs[_0x0d0b('0x4d')](_0x3211d3[_0x0d0b('0x47')]['sort']);_0x1ad146[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x3211d3[_0x0d0b('0x47')],_0x3cef12[_0x0d0b('0x48')]),_0x189aaa);if(_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x1ad146[_0x0d0b('0x4e')]=_[_0x0d0b('0x51')](_0x1ad146[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x189aaa,function(_0x25b190){if(_0x25b190[_0x0d0b('0x44')]!==_0x0d0b('0x52')){var _0x2e259d={};_0x2e259d[_0x25b190[_0x0d0b('0x3d')]]={'$like':'%'+_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x2e259d;}})});}_0x1ad146=_[_0x0d0b('0x51')]({},_0x1ad146,_0x3211d3[_0x0d0b('0x53')]);var _0x420338={'where':_0x1ad146[_0x0d0b('0x4e')]};return db['ChatQueue'][_0x0d0b('0x32')](_0x420338)[_0x0d0b('0x21')](function(_0x332100){_0x49b5e4[_0x0d0b('0x32')]=_0x332100;if(_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x54')]){_0x1ad146['include']=[{'all':!![]}];}return db[_0x0d0b('0x41')]['findAll'](_0x1ad146);})[_0x0d0b('0x21')](function(_0xd1c59d){_0x49b5e4[_0x0d0b('0x55')]=_0xd1c59d;return _0x49b5e4;})[_0x0d0b('0x21')](respondWithFilteredResult(_0x522b0c,_0x1ad146))[_0x0d0b('0x56')](handleError(_0x522b0c,null));};exports[_0x0d0b('0x57')]=function(_0x33ad7f,_0x575eb7){var _0x373d84={'raw':!![],'where':{'id':_0x33ad7f['params']['id']}},_0x484c65={};_0x484c65[_0x0d0b('0x46')]=_['keys'](db[_0x0d0b('0x41')][_0x0d0b('0x42')]);_0x484c65[_0x0d0b('0x47')]=_[_0x0d0b('0x58')](_0x33ad7f[_0x0d0b('0x47')]);_0x484c65[_0x0d0b('0x48')]=_[_0x0d0b('0x49')](_0x484c65[_0x0d0b('0x46')],_0x484c65['query']);_0x373d84[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x484c65[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x33ad7f['query']['fields']));_0x373d84[_0x0d0b('0x4a')]=_0x373d84[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x373d84[_0x0d0b('0x4a')]:_0x484c65[_0x0d0b('0x46')];if(_0x33ad7f['query'][_0x0d0b('0x54')]){_0x373d84[_0x0d0b('0x5a')]=[{'all':!![]}];}_0x373d84=_[_0x0d0b('0x51')]({},_0x373d84,_0x33ad7f[_0x0d0b('0x53')]);return db[_0x0d0b('0x41')][_0x0d0b('0x5b')](_0x373d84)[_0x0d0b('0x21')](handleEntityNotFound(_0x575eb7,null))[_0x0d0b('0x21')](respondWithResult(_0x575eb7,null))[_0x0d0b('0x56')](handleError(_0x575eb7,null));};exports['create']=function(_0x592e44,_0x2614f6){return db['ChatQueue'][_0x0d0b('0x5c')](_0x592e44[_0x0d0b('0x5d')],{})[_0x0d0b('0x21')](function(_0x5255af){var _0x4d7ad9=_0x592e44[_0x0d0b('0x5e')][_0x0d0b('0x3a')]({'plain':!![]});if(!_0x4d7ad9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d7ad9[_0x0d0b('0x5f')]===_0x0d0b('0x5e')){var _0x1b27bf=_0x5255af[_0x0d0b('0x3a')]({'plain':!![]});var _0x3f8b13=_0x0d0b('0x60');return db[_0x0d0b('0x61')][_0x0d0b('0x5b')]({'where':{'name':_0x3f8b13,'userProfileId':_0x4d7ad9[_0x0d0b('0x62')]},'raw':!![]})[_0x0d0b('0x21')](function(_0x4662e9){if(_0x4662e9&&_0x4662e9[_0x0d0b('0x63')]===0x0){return db[_0x0d0b('0x3b')][_0x0d0b('0x5c')]({'name':_0x1b27bf[_0x0d0b('0x3d')],'resourceId':_0x1b27bf['id'],'type':_0x4662e9[_0x0d0b('0x3d')],'sectionId':_0x4662e9['id']},{})[_0x0d0b('0x21')](function(){return _0x5255af;});}else{return _0x5255af;}})[_0x0d0b('0x56')](function(_0x449452){logger[_0x0d0b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x449452);throw _0x449452;});}return _0x5255af;})[_0x0d0b('0x21')](respondWithResult(_0x2614f6,0xc9))[_0x0d0b('0x56')](handleError(_0x2614f6,null));};exports[_0x0d0b('0x38')]=function(_0x364369,_0x5ddf34){if(_0x364369[_0x0d0b('0x5d')]['id']){delete _0x364369[_0x0d0b('0x5d')]['id'];}return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x364369[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](handleEntityNotFound(_0x5ddf34,null))['then'](saveUpdates(_0x364369[_0x0d0b('0x5d')],null))[_0x0d0b('0x21')](respondWithResult(_0x5ddf34,null))[_0x0d0b('0x56')](handleError(_0x5ddf34,null));};exports[_0x0d0b('0x39')]=function(_0x4fae0d,_0xc21141){return db['ChatQueue'][_0x0d0b('0x5b')]({'where':{'id':_0x4fae0d['params']['id']}})['then'](handleEntityNotFound(_0xc21141,null))[_0x0d0b('0x21')](removeEntity(_0xc21141,null))[_0x0d0b('0x56')](handleError(_0xc21141,null));};exports[_0x0d0b('0x65')]=function(_0x2bd355,_0x3c506d){return db[_0x0d0b('0x41')][_0x0d0b('0x65')]()[_0x0d0b('0x21')](respondWithResult(_0x3c506d,null))[_0x0d0b('0x56')](handleError(_0x3c506d,null));};exports['getMembers']=function(_0x10ac51,_0x541776,_0x17764d){var _0x510552={'raw':!![],'where':{}},_0x2b98e9={},_0x31b5e1;return db[_0x0d0b('0x41')][_0x0d0b('0x66')]({'where':{'id':_0x10ac51[_0x0d0b('0x64')]['id']}})['then'](handleEntityNotFound(_0x541776,null))[_0x0d0b('0x21')](function(_0x59cc1c){if(_0x59cc1c){_0x31b5e1=_0x59cc1c[_0x0d0b('0x3a')]({'plain':!![]});_0x2b98e9[_0x0d0b('0x46')]=_[_0x0d0b('0x58')](db[_0x0d0b('0x67')][_0x0d0b('0x42')]);_0x2b98e9[_0x0d0b('0x47')]=_[_0x0d0b('0x58')](_0x10ac51['query']);_0x2b98e9['filters']=_[_0x0d0b('0x49')](_0x2b98e9[_0x0d0b('0x46')],_0x2b98e9[_0x0d0b('0x47')]);_0x510552[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x2b98e9[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x10ac51['query'][_0x0d0b('0x4b')]));_0x510552[_0x0d0b('0x4a')]=_0x510552[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x510552[_0x0d0b('0x4a')]:_0x2b98e9['model'];if(!_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x68')](_0x0d0b('0x4c'))){_0x510552['limit']=qs['limit'](_0x10ac51['query'][_0x0d0b('0x31')]);_0x510552['offset']=qs[_0x0d0b('0x2f')](_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}_0x510552[_0x0d0b('0x69')]=qs[_0x0d0b('0x4d')](_0x10ac51[_0x0d0b('0x47')]['sort']);_0x510552[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x10ac51[_0x0d0b('0x47')],_0x2b98e9[_0x0d0b('0x48')]));_0x510552[_0x0d0b('0x4e')][_0x0d0b('0x6a')]=_0x59cc1c['id'];if(_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x510552[_0x0d0b('0x4e')]=_[_0x0d0b('0x51')](_0x510552[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x510552[_0x0d0b('0x4a')],function(_0x5ef796){var _0x44930a={};_0x44930a[_0x5ef796]={'$like':'%'+_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x44930a;})});}_0x510552=_[_0x0d0b('0x51')]({},_0x510552,_0x10ac51['options']);return db['UserChatQueue'][_0x0d0b('0x6b')](_0x510552);}})[_0x0d0b('0x21')](function(_0x213f69){if(_0x213f69){return db[_0x0d0b('0x6c')]['findAndCountAll']({'where':{'id':_[_0x0d0b('0x40')](_0x213f69,_0x0d0b('0x6d')),'role':_0x0d0b('0x6e')},'attributes':['id',_0x0d0b('0x3d'),'chatPause',_0x0d0b('0x6f'),_0x0d0b('0x70')]});}})[_0x0d0b('0x21')](function(_0x9aabf0){if(_0x9aabf0){return{'count':_0x9aabf0[_0x0d0b('0x32')],'rows':_['map'](_0x9aabf0[_0x0d0b('0x55')],function(_0x45e36a){return{'membername':_0x45e36a[_0x0d0b('0x3d')],'UserId':_0x45e36a['id'],'queue_name':_0x31b5e1[_0x0d0b('0x3d')],'ChatQueueId':_0x31b5e1['id'],'interface':util[_0x0d0b('0x71')](_0x0d0b('0x72'),'SIP',_0x45e36a[_0x0d0b('0x3d')]),'penalty':0x0,'paused':_0x45e36a[_0x0d0b('0x73')],'createdAt':_0x45e36a[_0x0d0b('0x70')],'updatedAt':_0x45e36a[_0x0d0b('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d0b('0x21')](respondWithFilteredResult(_0x541776,_0x510552))['catch'](handleError(_0x541776,null));};exports[_0x0d0b('0x74')]=function(_0x1fec4f,_0x5ec083,_0x55fb72){var _0x44b51f={};var _0x4ea481={};var _0x6aaedb;var _0x2e6f86;return db[_0x0d0b('0x41')]['findOne']({'where':{'id':_0x1fec4f[_0x0d0b('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ec083,null))[_0x0d0b('0x21')](function(_0x2439e5){if(_0x2439e5){_0x6aaedb=_0x2439e5;_0x4ea481[_0x0d0b('0x46')]=_['keys'](db[_0x0d0b('0x75')]['rawAttributes']);_0x4ea481['query']=_[_0x0d0b('0x58')](_0x1fec4f[_0x0d0b('0x47')]);_0x4ea481[_0x0d0b('0x48')]=_[_0x0d0b('0x49')](_0x4ea481[_0x0d0b('0x46')],_0x4ea481[_0x0d0b('0x47')]);_0x44b51f[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x4ea481[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x4b')]));_0x44b51f[_0x0d0b('0x4a')]=_0x44b51f[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x44b51f[_0x0d0b('0x4a')]:_0x4ea481[_0x0d0b('0x46')];_0x44b51f[_0x0d0b('0x69')]=qs[_0x0d0b('0x4d')](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x4d')]);_0x44b51f[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x1fec4f[_0x0d0b('0x47')],_0x4ea481[_0x0d0b('0x48')]));if(_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x44b51f[_0x0d0b('0x4e')]=_['merge'](_0x44b51f[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x44b51f[_0x0d0b('0x4a')],function(_0x1b5c4b){var _0x45869c={};_0x45869c[_0x1b5c4b]={'$like':'%'+_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x45869c;})});}_0x44b51f=_['merge']({},_0x44b51f,_0x1fec4f[_0x0d0b('0x53')]);return _0x6aaedb[_0x0d0b('0x74')](_0x44b51f);}})[_0x0d0b('0x21')](function(_0x6fa8b0){if(_0x6fa8b0){_0x2e6f86=_0x6fa8b0[_0x0d0b('0x59')];if(!_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x68')]('nolimit')){_0x44b51f[_0x0d0b('0x31')]=qs['limit'](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x31')]);_0x44b51f[_0x0d0b('0x2f')]=qs[_0x0d0b('0x2f')](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}return _0x6aaedb[_0x0d0b('0x74')](_0x44b51f);}})[_0x0d0b('0x21')](function(_0x2a9fe8){if(_0x2a9fe8){return _0x2a9fe8?{'count':_0x2e6f86,'rows':_0x2a9fe8}:null;}})[_0x0d0b('0x21')](respondWithResult(_0x5ec083,null))[_0x0d0b('0x56')](handleError(_0x5ec083,null));};exports[_0x0d0b('0x76')]=function(_0x1f8592,_0x2d4150,_0x13a94e){var _0x1d3ef6=_0x1f8592['body'][_0x0d0b('0x77')];return db[_0x0d0b('0x75')][_0x0d0b('0x6b')]({'where':{'id':_0x1d3ef6},'attributes':['id'],'include':[{'model':db[_0x0d0b('0x6c')],'as':_0x0d0b('0x78'),'attributes':['id','name',_0x0d0b('0x79'),_0x0d0b('0x7a'),_0x0d0b('0x7b')],'raw':!![]}]})[_0x0d0b('0x21')](function(_0x425246){if(_0x425246){var _0x35f9a1=_[_0x0d0b('0x7c')](_0x425246,function(_0x54c434){var _0x579300=_0x54c434[_0x0d0b('0x3a')]({'plain':!![]});return _0x579300[_0x0d0b('0x78')];});return db['ChatQueue'][_0x0d0b('0x5b')]({'where':{'id':_0x1f8592[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](function(_0x22b659){return db[_0x0d0b('0x7d')][_0x0d0b('0x7e')](function(_0x59a21e){return _0x22b659[_0x0d0b('0x76')](_0x1d3ef6,{'transaction':_0x59a21e})['then'](function(){return BPromise[_0x0d0b('0x7f')](_0x35f9a1,function(_0x1928a4){return db[_0x0d0b('0x67')][_0x0d0b('0x80')]({'where':{'UserId':_0x1928a4['id'],'ChatQueueId':_0x1f8592[_0x0d0b('0x64')]['id']},'transaction':_0x59a21e});});})[_0x0d0b('0x21')](function(){_0x35f9a1[_0x0d0b('0x81')](function(_0x510a3d){socket[_0x0d0b('0x82')](_0x0d0b('0x83'),{'UserId':_0x510a3d['id'],'ChatQueueId':_0x22b659['id']});});});});});}})[_0x0d0b('0x21')](respondWithStatusCode(_0x2d4150,null))[_0x0d0b('0x56')](handleError(_0x2d4150,null));};exports['removeTeams']=function(_0x179fd5,_0x2d36c5,_0xf6280e){return db['Team'][_0x0d0b('0x6b')]({'where':{'id':_0x179fd5[_0x0d0b('0x47')][_0x0d0b('0x77')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0d0b('0x78'),'attributes':['id'],'raw':!![]}]})[_0x0d0b('0x21')](handleEntityNotFound(_0x2d36c5,null))[_0x0d0b('0x21')](function(_0x57e6fe){var _0x58f43a=_[_0x0d0b('0x40')](_0x57e6fe,'id');var _0x53b78d=[];var _0x583e67=[];var _0x31ba2d=squel[_0x0d0b('0x84')]();_0x31ba2d[_0x0d0b('0x85')](_0x0d0b('0x86'))['from'](_0x0d0b('0x87'),'tq')[_0x0d0b('0x88')](_0x0d0b('0x89'),'ut',_0x0d0b('0x8a'))[_0x0d0b('0x4e')](_0x0d0b('0x8b'),_0x179fd5[_0x0d0b('0x64')]['id']);for(var _0x777dbf=0x0;_0x777dbf<_0x57e6fe[_0x0d0b('0x59')];_0x777dbf+=0x1){let _0x4260c4=_0x57e6fe[_0x777dbf];for(var _0x17be9e=0x0;_0x17be9e<_0x4260c4[_0x0d0b('0x78')][_0x0d0b('0x59')];_0x17be9e+=0x1){let _0x2ede09=_0x4260c4['Agents'][_0x17be9e];var _0x4936d6=_0x31ba2d[_0x0d0b('0x8c')]();_0x4936d6['where'](_0x0d0b('0x8d'),_0x2ede09['id']);_0x583e67[_0x0d0b('0x8e')](db[_0x0d0b('0x7d')][_0x0d0b('0x47')](_0x4936d6[_0x0d0b('0x8f')](),{'type':db[_0x0d0b('0x7d')][_0x0d0b('0x90')][_0x0d0b('0x91')]})[_0x0d0b('0x21')](function(_0x408dff){if(_0x408dff['length']===0x1){return _0x2ede09['id'];}else{var _0x24f6b9=_[_0x0d0b('0x92')](_[_0x0d0b('0x40')](_0x408dff,_0x0d0b('0x93')),function(_0x201f2e){return _['includes'](_0x58f43a,_0x201f2e);});if(_0x24f6b9){return _0x2ede09['id'];}}}));}}return BPromise[_0x0d0b('0x94')](_0x583e67)['then'](function(_0x56779f){_0x53b78d=_(_0x53b78d)[_0x0d0b('0x95')](_0x56779f)['compact']()[_0x0d0b('0x96')]();return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x179fd5[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](function(_0x8b63c4){return db[_0x0d0b('0x7d')][_0x0d0b('0x7e')](function(_0x52bba9){return _0x8b63c4[_0x0d0b('0x97')](_0x179fd5[_0x0d0b('0x47')][_0x0d0b('0x77')],{'transaction':_0x52bba9})['then'](function(){if(!_['isEmpty'](_0x53b78d)){return _0x8b63c4[_0x0d0b('0x98')](_0x53b78d,{'transaction':_0x52bba9});}})[_0x0d0b('0x21')](function(){_0x53b78d['forEach'](function(_0x2c447c){socket[_0x0d0b('0x82')](_0x0d0b('0x99'),{'UserId':_0x2c447c,'ChatQueueId':_0x8b63c4['id']});});});});});});})[_0x0d0b('0x21')](respondWithStatusCode(_0x2d36c5,null))['catch'](handleError(_0x2d36c5,null));};exports[_0x0d0b('0x9a')]=function(_0x3cee3d,_0x2fedd5,_0x2e18b3){return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x3cee3d[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](handleEntityNotFound(_0x2fedd5,null))[_0x0d0b('0x21')](function(_0x3793ce){if(_0x3793ce){return _0x3793ce[_0x0d0b('0x9a')](_0x3cee3d[_0x0d0b('0x5d')][_0x0d0b('0x77')],_[_0x0d0b('0x9b')](_0x3cee3d[_0x0d0b('0x5d')],['ids','id'])||{})[_0x0d0b('0x9c')](function(_0x1c594e){for(var _0x4ff3d8=0x0;_0x4ff3d8<_0x3cee3d['body'][_0x0d0b('0x77')][_0x0d0b('0x59')];_0x4ff3d8+=0x1){socket[_0x0d0b('0x82')](_0x0d0b('0x83'),{'UserId':Number(_0x3cee3d['body'][_0x0d0b('0x77')][_0x4ff3d8]),'ChatQueueId':Number(_0x3cee3d[_0x0d0b('0x64')]['id'])});}return _0x1c594e;});}})['then'](respondWithResult(_0x2fedd5,null))[_0x0d0b('0x56')](handleError(_0x2fedd5,null));};exports['removeAgents']=function(_0x145c0b,_0x49286d,_0x2e63d1){return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x145c0b[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](handleEntityNotFound(_0x49286d,null))['then'](function(_0x15ab80){if(_0x15ab80){return _0x15ab80[_0x0d0b('0x98')](_0x145c0b[_0x0d0b('0x47')]['ids'])['then'](function(){if(_[_0x0d0b('0x9d')](_0x145c0b[_0x0d0b('0x47')][_0x0d0b('0x77')])){for(var _0x6986ed=0x0;_0x6986ed<_0x145c0b['query'][_0x0d0b('0x77')][_0x0d0b('0x59')];_0x6986ed+=0x1){socket['emit'](_0x0d0b('0x99'),{'UserId':Number(_0x145c0b['query'][_0x0d0b('0x77')][_0x6986ed]),'ChatQueueId':Number(_0x145c0b[_0x0d0b('0x64')]['id'])});}}else{socket[_0x0d0b('0x82')](_0x0d0b('0x99'),{'UserId':Number(_0x145c0b[_0x0d0b('0x47')]['ids']),'ChatQueueId':Number(_0x145c0b[_0x0d0b('0x64')]['id'])});}});}})[_0x0d0b('0x21')](respondWithStatusCode(_0x49286d,null))[_0x0d0b('0x56')](handleError(_0x49286d,null));};exports['getAgents']=function(_0x2f0250,_0xe6f5ca,_0x536c6f){var _0x1704ba={};var _0x1a3135={};var _0x5aca9d;var _0x4ae30a;return db['ChatQueue'][_0x0d0b('0x66')]({'where':{'id':_0x2f0250[_0x0d0b('0x64')]['id']}})['then'](handleEntityNotFound(_0xe6f5ca,null))['then'](function(_0x350376){if(_0x350376){_0x5aca9d=_0x350376;_0x1a3135[_0x0d0b('0x46')]=_[_0x0d0b('0x58')](db[_0x0d0b('0x6c')][_0x0d0b('0x42')]);_0x1a3135[_0x0d0b('0x47')]=_[_0x0d0b('0x58')](_0x2f0250[_0x0d0b('0x47')]);_0x1a3135['filters']=_[_0x0d0b('0x49')](_0x1a3135[_0x0d0b('0x46')],_0x1a3135[_0x0d0b('0x47')]);_0x1704ba[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x1a3135[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x4b')]));_0x1704ba[_0x0d0b('0x4a')]=_0x1704ba[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x1704ba[_0x0d0b('0x4a')]:_0x1a3135[_0x0d0b('0x46')];_0x1704ba[_0x0d0b('0x69')]=qs['sort'](_0x2f0250[_0x0d0b('0x47')]['sort']);_0x1704ba[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x2f0250[_0x0d0b('0x47')],_0x1a3135[_0x0d0b('0x48')]));if(_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x1704ba[_0x0d0b('0x4e')]=_[_0x0d0b('0x51')](_0x1704ba[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x1704ba[_0x0d0b('0x4a')],function(_0x306178){var _0x1d8b35={};_0x1d8b35[_0x306178]={'$like':'%'+_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x1d8b35;})});}_0x1704ba=_['merge']({},_0x1704ba,_0x2f0250[_0x0d0b('0x53')]);return _0x5aca9d[_0x0d0b('0x9e')](_0x1704ba);}})[_0x0d0b('0x21')](function(_0x3bad61){if(_0x3bad61){_0x4ae30a=_0x3bad61[_0x0d0b('0x59')];if(!_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x68')]('nolimit')){_0x1704ba[_0x0d0b('0x31')]=qs['limit'](_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x31')]);_0x1704ba[_0x0d0b('0x2f')]=qs[_0x0d0b('0x2f')](_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}return _0x5aca9d[_0x0d0b('0x9e')](_0x1704ba);}})[_0x0d0b('0x21')](function(_0x40064e){if(_0x40064e){return _0x40064e?{'count':_0x4ae30a,'rows':_0x40064e}:null;}})[_0x0d0b('0x21')](respondWithResult(_0xe6f5ca,null))[_0x0d0b('0x56')](handleError(_0xe6f5ca,null));};
\ No newline at end of file
+var _0x86ab=['getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','update','destroy','get','UserProfileResource','name','send','index','ChatQueue','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','chatPause','getTeams','Team','Agents','voicePause','sequelize','transaction','addTeams','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','removeAgents','userChatQueue:remove','addAgents','spread'];(function(_0x41bd72,_0x447a5f){var _0x194925=function(_0x3261b2){while(--_0x3261b2){_0x41bd72['push'](_0x41bd72['shift']());}};_0x194925(++_0x447a5f);}(_0x86ab,0x1b4));var _0xb86a=function(_0x5b6807,_0x5b28af){_0x5b6807=_0x5b6807-0x0;var _0x2e5cdb=_0x86ab[_0x5b6807];return _0x2e5cdb;};'use strict';var emlformat=require(_0xb86a('0x0'));var rimraf=require(_0xb86a('0x1'));var zipdir=require(_0xb86a('0x2'));var jsonpatch=require(_0xb86a('0x3'));var rp=require(_0xb86a('0x4'));var moment=require(_0xb86a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb86a('0x6'));var util=require('util');var path=require(_0xb86a('0x7'));var sox=require(_0xb86a('0x8'));var csv=require(_0xb86a('0x9'));var ejs=require(_0xb86a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb86a('0xb'));var squel=require(_0xb86a('0xc'));var crypto=require(_0xb86a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb86a('0xe'));var toCsv=require(_0xb86a('0x9'));var querystring=require('querystring');var Papa=require(_0xb86a('0xf'));var Redis=require(_0xb86a('0x10'));var authService=require(_0xb86a('0x11'));var qs=require(_0xb86a('0x12'));var as=require(_0xb86a('0x13'));var hardwareService=require(_0xb86a('0x14'));var logger=require('../../config/logger')(_0xb86a('0x15'));var utils=require(_0xb86a('0x16'));var config=require(_0xb86a('0x17'));var licenseUtil=require(_0xb86a('0x18'));var db=require('../../mysqldb')['db'];config[_0xb86a('0x19')]=_[_0xb86a('0x1a')](config['redis'],{'host':_0xb86a('0x1b'),'port':0x18eb});var socket=require(_0xb86a('0x1c'))(new Redis(config[_0xb86a('0x19')]));require(_0xb86a('0x1d'))['register'](socket);var jayson=require(_0xb86a('0x1e'));var client=jayson[_0xb86a('0x1f')][_0xb86a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5d3369,_0x247bcd,_0x41cf1e,_0x583233){return new BPromise(function(_0x3bbc07,_0x1e3506){var _0x49a27a=_0x583233||client;return _0x49a27a[_0xb86a('0x21')](_0x5d3369,_0x41cf1e)[_0xb86a('0x22')](function(_0x275f89){logger[_0xb86a('0x23')](_0xb86a('0x24'),_0x247bcd,_0xb86a('0x25'));logger[_0xb86a('0x26')](_0xb86a('0x27'),_0x247bcd,_0xb86a('0x25'),JSON[_0xb86a('0x28')](_0x275f89));if(_0x275f89[_0xb86a('0x29')]){if(_0x275f89['error']['code']===0x1f4){logger['error'](_0xb86a('0x24'),_0x247bcd,_0x275f89['error'][_0xb86a('0x2a')]);return _0x1e3506(_0x275f89[_0xb86a('0x29')][_0xb86a('0x2a')]);}logger[_0xb86a('0x29')](_0xb86a('0x24'),_0x247bcd,_0x275f89[_0xb86a('0x29')][_0xb86a('0x2a')]);return _0x3bbc07(_0x275f89['error'][_0xb86a('0x2a')]);}else{logger[_0xb86a('0x23')](_0xb86a('0x24'),_0x247bcd,'request\x20sent');_0x3bbc07(_0x275f89[_0xb86a('0x2b')]['message']);}})['catch'](function(_0x805bd8){logger['error'](_0xb86a('0x24'),_0x247bcd,_0x805bd8);_0x1e3506(_0x805bd8);});});}function respondWithStatusCode(_0x173f52,_0x5bd31c){_0x5bd31c=_0x5bd31c||0xcc;return function(_0x136a59){if(_0x136a59){return _0x173f52[_0xb86a('0x2c')](_0x5bd31c);}return _0x173f52[_0xb86a('0x2d')](_0x5bd31c)[_0xb86a('0x2e')]();};}function respondWithResult(_0x3fb7ad,_0x223f3b){_0x223f3b=_0x223f3b||0xc8;return function(_0x4c313c){if(_0x4c313c){return _0x3fb7ad[_0xb86a('0x2d')](_0x223f3b)['json'](_0x4c313c);}};}function respondWithFilteredResult(_0x2c3bf7,_0x43a63f){return function(_0x2694e4){if(_0x2694e4){var _0x2960f6=typeof _0x43a63f['offset']===_0xb86a('0x2f')&&typeof _0x43a63f[_0xb86a('0x30')]===_0xb86a('0x2f');var _0x2b564a=_0x2694e4[_0xb86a('0x31')];var _0x4f3851=_0x2960f6?0x0:_0x43a63f['offset'];var _0x71272b=_0x2960f6?_0x2694e4['count']:_0x43a63f[_0xb86a('0x32')]+_0x43a63f[_0xb86a('0x30')];var _0x2b9496;if(_0x71272b>=_0x2b564a){_0x71272b=_0x2b564a;_0x2b9496=0xc8;}else{_0x2b9496=0xce;}_0x2c3bf7[_0xb86a('0x2d')](_0x2b9496);return _0x2c3bf7[_0xb86a('0x33')]('Content-Range',_0x4f3851+'-'+_0x71272b+'/'+_0x2b564a)[_0xb86a('0x34')](_0x2694e4);}return null;};}function patchUpdates(_0x4999ff){return function(_0x26efd3){try{jsonpatch[_0xb86a('0x35')](_0x26efd3,_0x4999ff,!![]);}catch(_0x549881){return BPromise['reject'](_0x549881);}return _0x26efd3['save']();};}function saveUpdates(_0x2e7fb0,_0x452b6b){return function(_0x1d17a9){if(_0x1d17a9){return _0x1d17a9[_0xb86a('0x36')](_0x2e7fb0)[_0xb86a('0x22')](function(_0x50103c){return _0x50103c;});}return null;};}function removeEntity(_0x590446,_0x2591b4){return function(_0x1e07b2){if(_0x1e07b2){return _0x1e07b2[_0xb86a('0x37')]()[_0xb86a('0x22')](function(){var _0x231516=_0x1e07b2[_0xb86a('0x38')]({'plain':!![]});var _0x69be3='ChatQueues';return db[_0xb86a('0x39')][_0xb86a('0x37')]({'where':{'type':_0x69be3,'resourceId':_0x231516['id']}})[_0xb86a('0x22')](function(){return _0x1e07b2;});})[_0xb86a('0x22')](function(){_0x590446['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eb0b3,_0x474c59){return function(_0x1d80f6){if(!_0x1d80f6){_0x4eb0b3[_0xb86a('0x2c')](0x194);}return _0x1d80f6;};}function handleError(_0x55e2fd,_0x3c5784){_0x3c5784=_0x3c5784||0x1f4;return function(_0x4bbf90){logger['error'](_0x4bbf90['stack']);if(_0x4bbf90['name']){delete _0x4bbf90[_0xb86a('0x3a')];}_0x55e2fd[_0xb86a('0x2d')](_0x3c5784)[_0xb86a('0x3b')](_0x4bbf90);};}exports[_0xb86a('0x3c')]=function(_0x33ed98,_0x171013){var _0x57bb92={},_0x490569={},_0x2f81bd={'count':0x0,'rows':[]};var _0x19cd88=_['map'](db[_0xb86a('0x3d')][_0xb86a('0x3e')],function(_0x11edf6){return{'name':_0x11edf6['fieldName'],'type':_0x11edf6[_0xb86a('0x3f')]['key']};});_0x490569[_0xb86a('0x40')]=_['map'](_0x19cd88,_0xb86a('0x3a'));_0x490569[_0xb86a('0x41')]=_[_0xb86a('0x42')](_0x33ed98[_0xb86a('0x41')]);_0x490569[_0xb86a('0x43')]=_[_0xb86a('0x44')](_0x490569[_0xb86a('0x40')],_0x490569[_0xb86a('0x41')]);_0x57bb92['attributes']=_[_0xb86a('0x44')](_0x490569[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x33ed98['query']['fields']));_0x57bb92[_0xb86a('0x46')]=_0x57bb92[_0xb86a('0x46')][_0xb86a('0x47')]?_0x57bb92[_0xb86a('0x46')]:_0x490569['model'];if(!_0x33ed98[_0xb86a('0x41')][_0xb86a('0x48')](_0xb86a('0x49'))){_0x57bb92[_0xb86a('0x30')]=qs[_0xb86a('0x30')](_0x33ed98[_0xb86a('0x41')]['limit']);_0x57bb92[_0xb86a('0x32')]=qs[_0xb86a('0x32')](_0x33ed98[_0xb86a('0x41')][_0xb86a('0x32')]);}_0x57bb92[_0xb86a('0x4a')]=qs[_0xb86a('0x4b')](_0x33ed98['query']['sort']);_0x57bb92['where']=qs[_0xb86a('0x43')](_[_0xb86a('0x4c')](_0x33ed98[_0xb86a('0x41')],_0x490569['filters']),_0x19cd88);if(_0x33ed98[_0xb86a('0x41')][_0xb86a('0x4d')]){_0x57bb92[_0xb86a('0x4e')]=_[_0xb86a('0x4f')](_0x57bb92[_0xb86a('0x4e')],{'$or':_[_0xb86a('0x50')](_0x19cd88,function(_0xa4369b){if(_0xa4369b[_0xb86a('0x3f')]!=='VIRTUAL'){var _0xc5839a={};_0xc5839a[_0xa4369b[_0xb86a('0x3a')]]={'$like':'%'+_0x33ed98[_0xb86a('0x41')]['filter']+'%'};return _0xc5839a;}})});}_0x57bb92=_[_0xb86a('0x4f')]({},_0x57bb92,_0x33ed98[_0xb86a('0x51')]);var _0x225590={'where':_0x57bb92['where']};return db[_0xb86a('0x3d')][_0xb86a('0x31')](_0x225590)[_0xb86a('0x22')](function(_0x3f6502){_0x2f81bd[_0xb86a('0x31')]=_0x3f6502;if(_0x33ed98[_0xb86a('0x41')][_0xb86a('0x52')]){_0x57bb92[_0xb86a('0x53')]=[{'all':!![]}];}return db[_0xb86a('0x3d')][_0xb86a('0x54')](_0x57bb92);})[_0xb86a('0x22')](function(_0x1ca41b){_0x2f81bd['rows']=_0x1ca41b;return _0x2f81bd;})[_0xb86a('0x22')](respondWithFilteredResult(_0x171013,_0x57bb92))[_0xb86a('0x55')](handleError(_0x171013,null));};exports[_0xb86a('0x56')]=function(_0x59984d,_0x5e659e){var _0x3a40f2={'raw':!![],'where':{'id':_0x59984d[_0xb86a('0x57')]['id']}},_0x2bc98e={};_0x2bc98e[_0xb86a('0x40')]=_['keys'](db[_0xb86a('0x3d')][_0xb86a('0x3e')]);_0x2bc98e[_0xb86a('0x41')]=_['keys'](_0x59984d[_0xb86a('0x41')]);_0x2bc98e['filters']=_[_0xb86a('0x44')](_0x2bc98e['model'],_0x2bc98e[_0xb86a('0x41')]);_0x3a40f2['attributes']=_[_0xb86a('0x44')](_0x2bc98e[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x59984d[_0xb86a('0x41')][_0xb86a('0x45')]));_0x3a40f2[_0xb86a('0x46')]=_0x3a40f2[_0xb86a('0x46')][_0xb86a('0x47')]?_0x3a40f2['attributes']:_0x2bc98e[_0xb86a('0x40')];if(_0x59984d[_0xb86a('0x41')]['includeAll']){_0x3a40f2['include']=[{'all':!![]}];}_0x3a40f2=_['merge']({},_0x3a40f2,_0x59984d[_0xb86a('0x51')]);return db[_0xb86a('0x3d')][_0xb86a('0x58')](_0x3a40f2)[_0xb86a('0x22')](handleEntityNotFound(_0x5e659e,null))[_0xb86a('0x22')](respondWithResult(_0x5e659e,null))[_0xb86a('0x55')](handleError(_0x5e659e,null));};exports[_0xb86a('0x59')]=function(_0x4c67b1,_0x2a764e){return db[_0xb86a('0x3d')]['create'](_0x4c67b1['body'],{})[_0xb86a('0x22')](function(_0x5a4416){var _0x2da0f2=_0x4c67b1['user'][_0xb86a('0x38')]({'plain':!![]});if(!_0x2da0f2)throw new Error(_0xb86a('0x5a'));if(_0x2da0f2['role']===_0xb86a('0x5b')){var _0x48997c=_0x5a4416[_0xb86a('0x38')]({'plain':!![]});var _0x4644cc=_0xb86a('0x5c');return db[_0xb86a('0x5d')]['find']({'where':{'name':_0x4644cc,'userProfileId':_0x2da0f2[_0xb86a('0x5e')]},'raw':!![]})[_0xb86a('0x22')](function(_0x172e27){if(_0x172e27&&_0x172e27[_0xb86a('0x5f')]===0x0){return db['UserProfileResource'][_0xb86a('0x59')]({'name':_0x48997c['name'],'resourceId':_0x48997c['id'],'type':_0x172e27[_0xb86a('0x3a')],'sectionId':_0x172e27['id']},{})[_0xb86a('0x22')](function(){return _0x5a4416;});}else{return _0x5a4416;}})['catch'](function(_0x134311){logger[_0xb86a('0x29')](_0xb86a('0x60'),_0x134311);throw _0x134311;});}return _0x5a4416;})['then'](respondWithResult(_0x2a764e,0xc9))[_0xb86a('0x55')](handleError(_0x2a764e,null));};exports[_0xb86a('0x36')]=function(_0x193e63,_0x19e60e){if(_0x193e63[_0xb86a('0x61')]['id']){delete _0x193e63[_0xb86a('0x61')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x193e63[_0xb86a('0x57')]['id']}})['then'](handleEntityNotFound(_0x19e60e,null))['then'](saveUpdates(_0x193e63['body'],null))[_0xb86a('0x22')](respondWithResult(_0x19e60e,null))[_0xb86a('0x55')](handleError(_0x19e60e,null));};exports[_0xb86a('0x37')]=function(_0x257166,_0x358abe){return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x257166[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x358abe,null))[_0xb86a('0x22')](removeEntity(_0x358abe,null))[_0xb86a('0x55')](handleError(_0x358abe,null));};exports[_0xb86a('0x62')]=function(_0x4b3e75,_0x3b9242){return db['ChatQueue'][_0xb86a('0x62')]()[_0xb86a('0x22')](respondWithResult(_0x3b9242,null))[_0xb86a('0x55')](handleError(_0x3b9242,null));};exports['getMembers']=function(_0x16597d,_0x372cae,_0x4296b0){var _0x5b7fa9={'raw':!![],'where':{}},_0x456c0f={},_0x4286a8;return db[_0xb86a('0x3d')][_0xb86a('0x63')]({'where':{'id':_0x16597d[_0xb86a('0x57')]['id']}})['then'](handleEntityNotFound(_0x372cae,null))[_0xb86a('0x22')](function(_0x4b82a6){if(_0x4b82a6){_0x4286a8=_0x4b82a6[_0xb86a('0x38')]({'plain':!![]});_0x456c0f[_0xb86a('0x40')]=_[_0xb86a('0x42')](db[_0xb86a('0x64')][_0xb86a('0x3e')]);_0x456c0f[_0xb86a('0x41')]=_[_0xb86a('0x42')](_0x16597d['query']);_0x456c0f[_0xb86a('0x43')]=_[_0xb86a('0x44')](_0x456c0f[_0xb86a('0x40')],_0x456c0f[_0xb86a('0x41')]);_0x5b7fa9[_0xb86a('0x46')]=_[_0xb86a('0x44')](_0x456c0f['model'],qs[_0xb86a('0x45')](_0x16597d[_0xb86a('0x41')]['fields']));_0x5b7fa9[_0xb86a('0x46')]=_0x5b7fa9[_0xb86a('0x46')][_0xb86a('0x47')]?_0x5b7fa9[_0xb86a('0x46')]:_0x456c0f['model'];if(!_0x16597d[_0xb86a('0x41')][_0xb86a('0x48')](_0xb86a('0x49'))){_0x5b7fa9[_0xb86a('0x30')]=qs[_0xb86a('0x30')](_0x16597d[_0xb86a('0x41')][_0xb86a('0x30')]);_0x5b7fa9[_0xb86a('0x32')]=qs[_0xb86a('0x32')](_0x16597d['query']['offset']);}_0x5b7fa9['order']=qs[_0xb86a('0x4b')](_0x16597d[_0xb86a('0x41')]['sort']);_0x5b7fa9[_0xb86a('0x4e')]=qs['filters'](_['pick'](_0x16597d[_0xb86a('0x41')],_0x456c0f[_0xb86a('0x43')]));_0x5b7fa9[_0xb86a('0x4e')][_0xb86a('0x65')]=_0x4b82a6['id'];if(_0x16597d[_0xb86a('0x41')][_0xb86a('0x4d')]){_0x5b7fa9[_0xb86a('0x4e')]=_[_0xb86a('0x4f')](_0x5b7fa9[_0xb86a('0x4e')],{'$or':_[_0xb86a('0x50')](_0x5b7fa9[_0xb86a('0x46')],function(_0xd00415){var _0x2458aa={};_0x2458aa[_0xd00415]={'$like':'%'+_0x16597d[_0xb86a('0x41')][_0xb86a('0x4d')]+'%'};return _0x2458aa;})});}_0x5b7fa9=_[_0xb86a('0x4f')]({},_0x5b7fa9,_0x16597d['options']);return db[_0xb86a('0x64')][_0xb86a('0x54')](_0x5b7fa9);}})[_0xb86a('0x22')](function(_0x293e19){if(_0x293e19){return db[_0xb86a('0x66')][_0xb86a('0x67')]({'where':{'id':_[_0xb86a('0x50')](_0x293e19,_0xb86a('0x68')),'role':_0xb86a('0x69')},'attributes':['id','name','chatPause',_0xb86a('0x6a'),_0xb86a('0x6b')]});}})['then'](function(_0xca09){if(_0xca09){return{'count':_0xca09[_0xb86a('0x31')],'rows':_['map'](_0xca09[_0xb86a('0x6c')],function(_0x1ea582){return{'membername':_0x1ea582[_0xb86a('0x3a')],'UserId':_0x1ea582['id'],'queue_name':_0x4286a8[_0xb86a('0x3a')],'ChatQueueId':_0x4286a8['id'],'interface':util[_0xb86a('0x6d')](_0xb86a('0x6e'),_0xb86a('0x6f'),_0x1ea582[_0xb86a('0x3a')]),'penalty':0x0,'paused':_0x1ea582[_0xb86a('0x70')],'createdAt':_0x1ea582['createdAt'],'updatedAt':_0x1ea582['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb86a('0x22')](respondWithFilteredResult(_0x372cae,_0x5b7fa9))[_0xb86a('0x55')](handleError(_0x372cae,null));};exports['getTeams']=function(_0x18464a,_0x126010,_0x3e2108){var _0x5422d4={};var _0x54017a={};var _0x4b6ed6;var _0x1f680b;return db[_0xb86a('0x3d')][_0xb86a('0x63')]({'where':{'id':_0x18464a['params']['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x126010,null))['then'](function(_0x4ee031){if(_0x4ee031){_0x4b6ed6=_0x4ee031;_0x54017a[_0xb86a('0x40')]=_[_0xb86a('0x42')](db['Team'][_0xb86a('0x3e')]);_0x54017a[_0xb86a('0x41')]=_[_0xb86a('0x42')](_0x18464a[_0xb86a('0x41')]);_0x54017a[_0xb86a('0x43')]=_[_0xb86a('0x44')](_0x54017a['model'],_0x54017a['query']);_0x5422d4[_0xb86a('0x46')]=_[_0xb86a('0x44')](_0x54017a[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x18464a[_0xb86a('0x41')][_0xb86a('0x45')]));_0x5422d4[_0xb86a('0x46')]=_0x5422d4['attributes'][_0xb86a('0x47')]?_0x5422d4[_0xb86a('0x46')]:_0x54017a[_0xb86a('0x40')];_0x5422d4[_0xb86a('0x4a')]=qs[_0xb86a('0x4b')](_0x18464a[_0xb86a('0x41')][_0xb86a('0x4b')]);_0x5422d4[_0xb86a('0x4e')]=qs[_0xb86a('0x43')](_['pick'](_0x18464a[_0xb86a('0x41')],_0x54017a[_0xb86a('0x43')]));if(_0x18464a['query'][_0xb86a('0x4d')]){_0x5422d4['where']=_[_0xb86a('0x4f')](_0x5422d4[_0xb86a('0x4e')],{'$or':_['map'](_0x5422d4['attributes'],function(_0x194d3c){var _0x38419d={};_0x38419d[_0x194d3c]={'$like':'%'+_0x18464a[_0xb86a('0x41')]['filter']+'%'};return _0x38419d;})});}_0x5422d4=_[_0xb86a('0x4f')]({},_0x5422d4,_0x18464a[_0xb86a('0x51')]);return _0x4b6ed6[_0xb86a('0x71')](_0x5422d4);}})[_0xb86a('0x22')](function(_0x3acc79){if(_0x3acc79){_0x1f680b=_0x3acc79[_0xb86a('0x47')];if(!_0x18464a[_0xb86a('0x41')][_0xb86a('0x48')]('nolimit')){_0x5422d4[_0xb86a('0x30')]=qs['limit'](_0x18464a[_0xb86a('0x41')]['limit']);_0x5422d4[_0xb86a('0x32')]=qs[_0xb86a('0x32')](_0x18464a[_0xb86a('0x41')][_0xb86a('0x32')]);}return _0x4b6ed6['getTeams'](_0x5422d4);}})[_0xb86a('0x22')](function(_0x1931f5){if(_0x1931f5){return _0x1931f5?{'count':_0x1f680b,'rows':_0x1931f5}:null;}})[_0xb86a('0x22')](respondWithResult(_0x126010,null))[_0xb86a('0x55')](handleError(_0x126010,null));};exports['addTeams']=function(_0x465758,_0x154a21,_0x94ddae){var _0x3c5066=_0x465758[_0xb86a('0x61')]['ids'];return db[_0xb86a('0x72')]['findAll']({'where':{'id':_0x3c5066},'attributes':['id'],'include':[{'model':db[_0xb86a('0x66')],'as':_0xb86a('0x73'),'attributes':['id',_0xb86a('0x3a'),'online',_0xb86a('0x74'),'interface'],'raw':!![]}]})[_0xb86a('0x22')](function(_0x13aa1e){if(_0x13aa1e){var _0xe6e606=_['flatMap'](_0x13aa1e,function(_0x26e8dd){var _0x3b35d1=_0x26e8dd['get']({'plain':!![]});return _0x3b35d1['Agents'];});return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x465758[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](function(_0x1ceedc){return db[_0xb86a('0x75')][_0xb86a('0x76')](function(_0x13bd04){return _0x1ceedc[_0xb86a('0x77')](_0x3c5066,{'transaction':_0x13bd04})[_0xb86a('0x22')](function(){return BPromise['each'](_0xe6e606,function(_0x48e0a4){return db[_0xb86a('0x64')]['findOrCreate']({'where':{'UserId':_0x48e0a4['id'],'ChatQueueId':_0x465758['params']['id']},'transaction':_0x13bd04});});})[_0xb86a('0x22')](function(){_0xe6e606[_0xb86a('0x78')](function(_0x29c52c){socket[_0xb86a('0x79')](_0xb86a('0x7a'),{'UserId':_0x29c52c['id'],'ChatQueueId':_0x1ceedc['id']});});});});});}})[_0xb86a('0x22')](respondWithStatusCode(_0x154a21,null))[_0xb86a('0x55')](handleError(_0x154a21,null));};exports[_0xb86a('0x7b')]=function(_0x26c487,_0x1f2a86,_0x49563e){return db[_0xb86a('0x72')]['findAll']({'where':{'id':_0x26c487[_0xb86a('0x41')][_0xb86a('0x7c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb86a('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb86a('0x22')](handleEntityNotFound(_0x1f2a86,null))[_0xb86a('0x22')](function(_0x525223){var _0x1feb35=_['map'](_0x525223,'id');var _0x3a4468=[];var _0x288231=[];var _0x4985c0=squel[_0xb86a('0x7d')]();_0x4985c0[_0xb86a('0x7e')](_0xb86a('0x7f'))['from']('team_has_chat_queues','tq')[_0xb86a('0x80')](_0xb86a('0x81'),'ut',_0xb86a('0x82'))[_0xb86a('0x4e')](_0xb86a('0x83'),_0x26c487[_0xb86a('0x57')]['id']);for(var _0x4d16ef=0x0;_0x4d16ef<_0x525223[_0xb86a('0x47')];_0x4d16ef+=0x1){let _0xb13aa4=_0x525223[_0x4d16ef];for(var _0x234e93=0x0;_0x234e93<_0xb13aa4[_0xb86a('0x73')][_0xb86a('0x47')];_0x234e93+=0x1){let _0x5d3066=_0xb13aa4['Agents'][_0x234e93];var _0x23d464=_0x4985c0['clone']();_0x23d464[_0xb86a('0x4e')](_0xb86a('0x84'),_0x5d3066['id']);_0x288231[_0xb86a('0x85')](db[_0xb86a('0x75')][_0xb86a('0x41')](_0x23d464[_0xb86a('0x86')](),{'type':db[_0xb86a('0x75')][_0xb86a('0x87')][_0xb86a('0x88')]})['then'](function(_0xf06191){if(_0xf06191[_0xb86a('0x47')]===0x1){return _0x5d3066['id'];}else{var _0x271d3e=_[_0xb86a('0x89')](_[_0xb86a('0x50')](_0xf06191,_0xb86a('0x8a')),function(_0x3b3754){return _['includes'](_0x1feb35,_0x3b3754);});if(_0x271d3e){return _0x5d3066['id'];}}}));}}return BPromise[_0xb86a('0x8b')](_0x288231)[_0xb86a('0x22')](function(_0x375ede){_0x3a4468=_(_0x3a4468)['union'](_0x375ede)['compact']()['value']();return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x26c487['params']['id']}})[_0xb86a('0x22')](function(_0x27a173){return db['sequelize'][_0xb86a('0x76')](function(_0x17bcee){return _0x27a173[_0xb86a('0x7b')](_0x26c487[_0xb86a('0x41')]['ids'],{'transaction':_0x17bcee})[_0xb86a('0x22')](function(){if(!_['isEmpty'](_0x3a4468)){return _0x27a173[_0xb86a('0x8c')](_0x3a4468,{'transaction':_0x17bcee});}})[_0xb86a('0x22')](function(){_0x3a4468[_0xb86a('0x78')](function(_0x3467e6){socket[_0xb86a('0x79')](_0xb86a('0x8d'),{'UserId':_0x3467e6,'ChatQueueId':_0x27a173['id']});});});});});});})['then'](respondWithStatusCode(_0x1f2a86,null))[_0xb86a('0x55')](handleError(_0x1f2a86,null));};exports['addAgents']=function(_0x1af456,_0x4fca8a,_0x3c7b3d){return db[_0xb86a('0x3d')]['find']({'where':{'id':_0x1af456[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x4fca8a,null))[_0xb86a('0x22')](function(_0x17e9e8){if(_0x17e9e8){return _0x17e9e8[_0xb86a('0x8e')](_0x1af456[_0xb86a('0x61')]['ids'],_['omit'](_0x1af456[_0xb86a('0x61')],['ids','id'])||{})[_0xb86a('0x8f')](function(_0x569b76){for(var _0x51e78d=0x0;_0x51e78d<_0x1af456['body'][_0xb86a('0x7c')][_0xb86a('0x47')];_0x51e78d+=0x1){socket[_0xb86a('0x79')](_0xb86a('0x7a'),{'UserId':Number(_0x1af456[_0xb86a('0x61')][_0xb86a('0x7c')][_0x51e78d]),'ChatQueueId':Number(_0x1af456[_0xb86a('0x57')]['id'])});}return _0x569b76;});}})[_0xb86a('0x22')](respondWithResult(_0x4fca8a,null))[_0xb86a('0x55')](handleError(_0x4fca8a,null));};exports[_0xb86a('0x8c')]=function(_0x2a7be9,_0x42ee25,_0x376f45){return db[_0xb86a('0x3d')][_0xb86a('0x58')]({'where':{'id':_0x2a7be9[_0xb86a('0x57')]['id']}})['then'](handleEntityNotFound(_0x42ee25,null))[_0xb86a('0x22')](function(_0x17fc1a){if(_0x17fc1a){return _0x17fc1a['removeAgents'](_0x2a7be9[_0xb86a('0x41')][_0xb86a('0x7c')])[_0xb86a('0x22')](function(){if(_['isArray'](_0x2a7be9[_0xb86a('0x41')]['ids'])){for(var _0x502f0d=0x0;_0x502f0d<_0x2a7be9['query'][_0xb86a('0x7c')][_0xb86a('0x47')];_0x502f0d+=0x1){socket[_0xb86a('0x79')](_0xb86a('0x8d'),{'UserId':Number(_0x2a7be9[_0xb86a('0x41')]['ids'][_0x502f0d]),'ChatQueueId':Number(_0x2a7be9[_0xb86a('0x57')]['id'])});}}else{socket[_0xb86a('0x79')](_0xb86a('0x8d'),{'UserId':Number(_0x2a7be9[_0xb86a('0x41')][_0xb86a('0x7c')]),'ChatQueueId':Number(_0x2a7be9[_0xb86a('0x57')]['id'])});}});}})[_0xb86a('0x22')](respondWithStatusCode(_0x42ee25,null))[_0xb86a('0x55')](handleError(_0x42ee25,null));};exports[_0xb86a('0x90')]=function(_0x15f156,_0x463517,_0x3aaac7){var _0x3b7338={};var _0xdc36d9={};var _0x2bf7d0;var _0x36399e;return db['ChatQueue'][_0xb86a('0x63')]({'where':{'id':_0x15f156[_0xb86a('0x57')]['id']}})[_0xb86a('0x22')](handleEntityNotFound(_0x463517,null))[_0xb86a('0x22')](function(_0xbd6f29){if(_0xbd6f29){_0x2bf7d0=_0xbd6f29;_0xdc36d9[_0xb86a('0x40')]=_['keys'](db[_0xb86a('0x66')][_0xb86a('0x3e')]);_0xdc36d9[_0xb86a('0x41')]=_['keys'](_0x15f156['query']);_0xdc36d9[_0xb86a('0x43')]=_['intersection'](_0xdc36d9[_0xb86a('0x40')],_0xdc36d9[_0xb86a('0x41')]);_0x3b7338[_0xb86a('0x46')]=_[_0xb86a('0x44')](_0xdc36d9[_0xb86a('0x40')],qs[_0xb86a('0x45')](_0x15f156[_0xb86a('0x41')]['fields']));_0x3b7338[_0xb86a('0x46')]=_0x3b7338[_0xb86a('0x46')][_0xb86a('0x47')]?_0x3b7338[_0xb86a('0x46')]:_0xdc36d9['model'];_0x3b7338['order']=qs['sort'](_0x15f156[_0xb86a('0x41')][_0xb86a('0x4b')]);_0x3b7338[_0xb86a('0x4e')]=qs[_0xb86a('0x43')](_[_0xb86a('0x4c')](_0x15f156['query'],_0xdc36d9[_0xb86a('0x43')]));if(_0x15f156[_0xb86a('0x41')][_0xb86a('0x4d')]){_0x3b7338[_0xb86a('0x4e')]=_[_0xb86a('0x4f')](_0x3b7338[_0xb86a('0x4e')],{'$or':_[_0xb86a('0x50')](_0x3b7338[_0xb86a('0x46')],function(_0x107cb9){var _0x3ca438={};_0x3ca438[_0x107cb9]={'$like':'%'+_0x15f156[_0xb86a('0x41')]['filter']+'%'};return _0x3ca438;})});}_0x3b7338=_['merge']({},_0x3b7338,_0x15f156['options']);return _0x2bf7d0[_0xb86a('0x90')](_0x3b7338);}})[_0xb86a('0x22')](function(_0xf1807f){if(_0xf1807f){_0x36399e=_0xf1807f[_0xb86a('0x47')];if(!_0x15f156[_0xb86a('0x41')][_0xb86a('0x48')](_0xb86a('0x49'))){_0x3b7338[_0xb86a('0x30')]=qs[_0xb86a('0x30')](_0x15f156['query']['limit']);_0x3b7338['offset']=qs['offset'](_0x15f156[_0xb86a('0x41')][_0xb86a('0x32')]);}return _0x2bf7d0[_0xb86a('0x90')](_0x3b7338);}})[_0xb86a('0x22')](function(_0x3bd713){if(_0x3bd713){return _0x3bd713?{'count':_0x36399e,'rows':_0x3bd713}:null;}})[_0xb86a('0x22')](respondWithResult(_0x463517,null))[_0xb86a('0x55')](handleError(_0x463517,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 323ce5a..b76b8ab 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 _0xb1ee=['update','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x5e60d4,_0x136e3b){var _0x468399=function(_0x1d99d2){while(--_0x1d99d2){_0x5e60d4['push'](_0x5e60d4['shift']());}};_0x468399(++_0x136e3b);}(_0xb1ee,0x16d));var _0xeb1e=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0xb1ee[_0x43c8b8];return _0x413be3;};'use strict';var EventEmitter=require(_0xeb1e('0x0'));var ChatQueue=require(_0xeb1e('0x1'))['db'][_0xeb1e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xeb1e('0x3')](0x0);var events={'afterCreate':_0xeb1e('0x4'),'afterUpdate':_0xeb1e('0x5'),'afterDestroy':_0xeb1e('0x6')};function emitEvent(_0x27665b){return function(_0x5cf351,_0x5af22e,_0x1618c9){ChatQueueEvents[_0xeb1e('0x7')](_0x27665b+':'+_0x5cf351['id'],_0x5cf351);ChatQueueEvents[_0xeb1e('0x7')](_0x27665b,_0x5cf351);_0x1618c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xeb1e('0x8')](e,emitEvent(event));}}module[_0xeb1e('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x92bc=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x185ecf,_0x32c66c){var _0x541319=function(_0x126bd2){while(--_0x126bd2){_0x185ecf['push'](_0x185ecf['shift']());}};_0x541319(++_0x32c66c);}(_0x92bc,0x128));var _0xc92b=function(_0x1b6cf4,_0x4df4b7){_0x1b6cf4=_0x1b6cf4-0x0;var _0x438fa5=_0x92bc[_0x1b6cf4];return _0x438fa5;};'use strict';var EventEmitter=require(_0xc92b('0x0'));var ChatQueue=require(_0xc92b('0x1'))['db'][_0xc92b('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc92b('0x3')](0x0);var events={'afterCreate':_0xc92b('0x4'),'afterUpdate':_0xc92b('0x5'),'afterDestroy':_0xc92b('0x6')};function emitEvent(_0x1193a4){return function(_0x16f9e9,_0x36df59,_0x3be06a){ChatQueueEvents[_0xc92b('0x7')](_0x1193a4+':'+_0x16f9e9['id'],_0x16f9e9);ChatQueueEvents[_0xc92b('0x7')](_0x1193a4,_0x16f9e9);_0x3be06a(null);};}for(var e in events){if(events[_0xc92b('0x8')](e)){var event=events[e];ChatQueue[_0xc92b('0x9')](e,emitEvent(event));}}module[_0xc92b('0xa')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 9808fe3..07fbd39 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 _0x1b3f=['chat_queues','lodash','util','api','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b3f,0xb5));var _0xf1b3=function(_0x35434d,_0x328955){_0x35434d=_0x35434d-0x0;var _0x208d6c=_0x1b3f[_0x35434d];return _0x208d6c;};'use strict';var _=require(_0xf1b3('0x0'));var util=require(_0xf1b3('0x1'));var logger=require('../../config/logger')(_0xf1b3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf1b3('0x3'));var attributes=require(_0xf1b3('0x4'));module[_0xf1b3('0x5')]=function(_0x13af7b,_0x1c6dfe){return _0x13af7b[_0xf1b3('0x6')](_0xf1b3('0x7'),attributes,{'tableName':_0xf1b3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3166=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3166,0x109));var _0x6316=function(_0x232d51,_0x4a3cb3){_0x232d51=_0x232d51-0x0;var _0x71a7=_0x3166[_0x232d51];return _0x71a7;};'use strict';var _=require(_0x6316('0x0'));var util=require(_0x6316('0x1'));var logger=require('../../config/logger')(_0x6316('0x2'));var moment=require(_0x6316('0x3'));var BPromise=require(_0x6316('0x4'));var rp=require(_0x6316('0x5'));var fs=require('fs');var path=require(_0x6316('0x6'));var rimraf=require(_0x6316('0x7'));var config=require(_0x6316('0x8'));var attributes=require(_0x6316('0x9'));module[_0x6316('0xa')]=function(_0x28debe,_0x22a42c){return _0x28debe[_0x6316('0xb')](_0x6316('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 95c8de7..5a63ea4 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 _0xe0dd=['info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','raw','options','where','limit','include','map','model','attributes','GetChatQueue','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','then'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xe0dd,0x163));var _0xde0d=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0xe0dd[_0xf48cce];return _0x2a5c38;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});config[_0xde0d('0xa')]=_[_0xde0d('0xb')](config[_0xde0d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xde0d('0xc'))(new Redis(config['redis']));require(_0xde0d('0xd'))['register'](socket);function respondWithRpcPromise(_0x36d631,_0x29119d,_0x10db06){return new BPromise(function(_0x4eeb64,_0x5cc8ca){return client['request'](_0x36d631,_0x10db06)[_0xde0d('0xe')](function(_0xcd25ec){logger[_0xde0d('0xf')]('ChatQueue,\x20%s,\x20%s',_0x29119d,_0xde0d('0x10'));logger[_0xde0d('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x29119d,_0xde0d('0x10'),JSON[_0xde0d('0x12')](_0xcd25ec));if(_0xcd25ec[_0xde0d('0x13')]){if(_0xcd25ec[_0xde0d('0x13')][_0xde0d('0x14')]===0x1f4){logger['error'](_0xde0d('0x15'),_0x29119d,_0xcd25ec['error'][_0xde0d('0x16')]);return _0x5cc8ca(_0xcd25ec['error'][_0xde0d('0x16')]);}logger['error'](_0xde0d('0x15'),_0x29119d,_0xcd25ec[_0xde0d('0x13')][_0xde0d('0x16')]);return _0x4eeb64(_0xcd25ec[_0xde0d('0x13')][_0xde0d('0x16')]);}else{logger[_0xde0d('0xf')](_0xde0d('0x15'),_0x29119d,'request\x20sent');_0x4eeb64(_0xcd25ec[_0xde0d('0x17')][_0xde0d('0x16')]);}})[_0xde0d('0x18')](function(_0x5803ae){logger[_0xde0d('0x13')](_0xde0d('0x15'),_0x29119d,_0x5803ae);_0x5cc8ca(_0x5803ae);});});}exports['GetChatQueue']=function(_0x5acec2){var _0x32af88=this;return new Promise(function(_0x16800a,_0x11437e){return db[_0xde0d('0x19')][_0xde0d('0x1a')]({'raw':_0x5acec2['options']?_0x5acec2['options'][_0xde0d('0x1b')]===undefined?!![]:![]:!![],'where':_0x5acec2['options']?_0x5acec2[_0xde0d('0x1c')][_0xde0d('0x1d')]||null:null,'attributes':_0x5acec2[_0xde0d('0x1c')]?_0x5acec2['options']['attributes']||null:null,'limit':_0x5acec2['options']?_0x5acec2[_0xde0d('0x1c')][_0xde0d('0x1e')]||null:null,'include':_0x5acec2['options']?_0x5acec2[_0xde0d('0x1c')][_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x5acec2[_0xde0d('0x1c')]['include'],function(_0x2e1d92){return{'model':db[_0x2e1d92[_0xde0d('0x21')]],'as':_0x2e1d92['as'],'attributes':_0x2e1d92[_0xde0d('0x22')],'include':_0x2e1d92[_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x2e1d92[_0xde0d('0x1f')],function(_0x10f114){return{'model':db[_0x10f114[_0xde0d('0x21')]],'as':_0x10f114['as'],'attributes':_0x10f114[_0xde0d('0x22')],'include':_0x10f114['include']?_[_0xde0d('0x20')](_0x10f114[_0xde0d('0x1f')],function(_0x32f65c){return{'model':db[_0x32f65c[_0xde0d('0x21')]],'as':_0x32f65c['as'],'attributes':_0x32f65c[_0xde0d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xde0d('0xe')](function(_0x24f93b){logger[_0xde0d('0xf')](_0xde0d('0x23'),_0x5acec2);logger['debug']('GetChatQueue',_0x5acec2,JSON['stringify'](_0x24f93b));_0x16800a(_0x24f93b);})['catch'](function(_0x5f3ea3){logger[_0xde0d('0x13')](_0xde0d('0x23'),_0x5f3ea3[_0xde0d('0x16')],_0x5acec2);_0x11437e(_0x32af88[_0xde0d('0x13')](0x1f4,_0x5f3ea3['message']));});});};exports[_0xde0d('0x24')]=function(_0x1a7fe3){var _0x3aa9a6=this;return new Promise(function(_0x5d5cb1,_0x3809f5){return db[_0xde0d('0x19')]['find']({'raw':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3[_0xde0d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3['options'][_0xde0d('0x1d')]||null:null,'attributes':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3[_0xde0d('0x1c')][_0xde0d('0x22')]||null:null,'include':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3[_0xde0d('0x1c')][_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x1a7fe3[_0xde0d('0x1c')][_0xde0d('0x1f')],function(_0x5e0f1d){return{'model':db[_0x5e0f1d[_0xde0d('0x21')]],'as':_0x5e0f1d['as'],'attributes':_0x5e0f1d[_0xde0d('0x22')],'include':_0x5e0f1d[_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x5e0f1d[_0xde0d('0x1f')],function(_0x1652f1){return{'model':db[_0x1652f1[_0xde0d('0x21')]],'as':_0x1652f1['as'],'attributes':_0x1652f1[_0xde0d('0x22')],'include':_0x1652f1['include']?_['map'](_0x1652f1[_0xde0d('0x1f')],function(_0x5c0a52){return{'model':db[_0x5c0a52['model']],'as':_0x5c0a52['as'],'attributes':_0x5c0a52['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xab0df0){logger[_0xde0d('0xf')]('ShowChatQueue',_0x1a7fe3);logger[_0xde0d('0x11')]('ShowChatQueue',_0x1a7fe3,JSON[_0xde0d('0x12')](_0xab0df0));_0x5d5cb1(_0xab0df0);})['catch'](function(_0xa5e09f){logger['error']('ShowChatQueue',_0xa5e09f[_0xde0d('0x16')],_0x1a7fe3);_0x3809f5(_0x3aa9a6['error'](0x1f4,_0xa5e09f[_0xde0d('0x16')]));});});};
\ No newline at end of file
+var _0x80ed=['request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map','model','find','ShowChatQueue','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register'];(function(_0x57235c,_0x53e379){var _0x3b6d0b=function(_0x5f12c1){while(--_0x5f12c1){_0x57235c['push'](_0x57235c['shift']());}};_0x3b6d0b(++_0x53e379);}(_0x80ed,0x11c));var _0xd80e=function(_0x4c24da,_0x4b0451){_0x4c24da=_0x4c24da-0x0;var _0x15225e=_0x80ed[_0x4c24da];return _0x15225e;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var moment=require(_0xd80e('0x1'));var BPromise=require(_0xd80e('0x2'));var rs=require(_0xd80e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd80e('0x4'))['db'];var utils=require(_0xd80e('0x5'));var logger=require(_0xd80e('0x6'))(_0xd80e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd80e('0x8'));var client=jayson[_0xd80e('0x9')][_0xd80e('0xa')]({'port':0x232a});config['redis']=_[_0xd80e('0xb')](config[_0xd80e('0xc')],{'host':_0xd80e('0xd'),'port':0x18eb});var socket=require(_0xd80e('0xe'))(new Redis(config[_0xd80e('0xc')]));require(_0xd80e('0xf'))[_0xd80e('0x10')](socket);function respondWithRpcPromise(_0x2457f5,_0x68625,_0x7f93b4){return new BPromise(function(_0x4eee08,_0x450b44){return client[_0xd80e('0x11')](_0x2457f5,_0x7f93b4)[_0xd80e('0x12')](function(_0x30c9d0){logger[_0xd80e('0x13')](_0xd80e('0x14'),_0x68625,_0xd80e('0x15'));logger[_0xd80e('0x16')](_0xd80e('0x17'),_0x68625,'request\x20sent',JSON['stringify'](_0x30c9d0));if(_0x30c9d0['error']){if(_0x30c9d0['error'][_0xd80e('0x18')]===0x1f4){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x450b44(_0x30c9d0['error'][_0xd80e('0x1a')]);}logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);return _0x4eee08(_0x30c9d0[_0xd80e('0x19')][_0xd80e('0x1a')]);}else{logger[_0xd80e('0x13')]('ChatQueue,\x20%s,\x20%s',_0x68625,_0xd80e('0x15'));_0x4eee08(_0x30c9d0[_0xd80e('0x1b')][_0xd80e('0x1a')]);}})[_0xd80e('0x1c')](function(_0x593af6){logger[_0xd80e('0x19')](_0xd80e('0x14'),_0x68625,_0x593af6);_0x450b44(_0x593af6);});});}exports[_0xd80e('0x1d')]=function(_0x527237){var _0x41417d=this;return new Promise(function(_0x2ef8a1,_0x2765ea){return db[_0xd80e('0x1e')][_0xd80e('0x1f')]({'raw':_0x527237['options']?_0x527237['options'][_0xd80e('0x20')]===undefined?!![]:![]:!![],'where':_0x527237[_0xd80e('0x21')]?_0x527237[_0xd80e('0x21')][_0xd80e('0x22')]||null:null,'attributes':_0x527237[_0xd80e('0x21')]?_0x527237[_0xd80e('0x21')][_0xd80e('0x23')]||null:null,'limit':_0x527237['options']?_0x527237[_0xd80e('0x21')][_0xd80e('0x24')]||null:null,'include':_0x527237[_0xd80e('0x21')]?_0x527237['options'][_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x527237[_0xd80e('0x21')]['include'],function(_0x521aa4){return{'model':db[_0x521aa4['model']],'as':_0x521aa4['as'],'attributes':_0x521aa4[_0xd80e('0x23')],'include':_0x521aa4['include']?_[_0xd80e('0x26')](_0x521aa4[_0xd80e('0x25')],function(_0x4e8ed9){return{'model':db[_0x4e8ed9[_0xd80e('0x27')]],'as':_0x4e8ed9['as'],'attributes':_0x4e8ed9[_0xd80e('0x23')],'include':_0x4e8ed9[_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x4e8ed9['include'],function(_0x15f317){return{'model':db[_0x15f317[_0xd80e('0x27')]],'as':_0x15f317['as'],'attributes':_0x15f317[_0xd80e('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd80e('0x12')](function(_0x2b1aaf){logger[_0xd80e('0x13')](_0xd80e('0x1d'),_0x527237);logger[_0xd80e('0x16')]('GetChatQueue',_0x527237,JSON['stringify'](_0x2b1aaf));_0x2ef8a1(_0x2b1aaf);})[_0xd80e('0x1c')](function(_0x1303eb){logger[_0xd80e('0x19')](_0xd80e('0x1d'),_0x1303eb[_0xd80e('0x1a')],_0x527237);_0x2765ea(_0x41417d[_0xd80e('0x19')](0x1f4,_0x1303eb['message']));});});};exports['ShowChatQueue']=function(_0x39c124){var _0x2d6ae5=this;return new Promise(function(_0x380f4f,_0x122a72){return db[_0xd80e('0x1e')][_0xd80e('0x28')]({'raw':_0x39c124[_0xd80e('0x21')]?_0x39c124[_0xd80e('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x39c124['options']?_0x39c124[_0xd80e('0x21')][_0xd80e('0x22')]||null:null,'attributes':_0x39c124[_0xd80e('0x21')]?_0x39c124[_0xd80e('0x21')][_0xd80e('0x23')]||null:null,'include':_0x39c124[_0xd80e('0x21')]?_0x39c124[_0xd80e('0x21')][_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x39c124[_0xd80e('0x21')]['include'],function(_0x36efc2){return{'model':db[_0x36efc2['model']],'as':_0x36efc2['as'],'attributes':_0x36efc2[_0xd80e('0x23')],'include':_0x36efc2[_0xd80e('0x25')]?_[_0xd80e('0x26')](_0x36efc2[_0xd80e('0x25')],function(_0x5a1fda){return{'model':db[_0x5a1fda[_0xd80e('0x27')]],'as':_0x5a1fda['as'],'attributes':_0x5a1fda['attributes'],'include':_0x5a1fda[_0xd80e('0x25')]?_['map'](_0x5a1fda[_0xd80e('0x25')],function(_0x3da220){return{'model':db[_0x3da220['model']],'as':_0x3da220['as'],'attributes':_0x3da220[_0xd80e('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd80e('0x12')](function(_0x2fbb7a){logger['info'](_0xd80e('0x29'),_0x39c124);logger[_0xd80e('0x16')](_0xd80e('0x29'),_0x39c124,JSON[_0xd80e('0x2a')](_0x2fbb7a));_0x380f4f(_0x2fbb7a);})[_0xd80e('0x1c')](function(_0x34b8e9){logger[_0xd80e('0x19')](_0xd80e('0x29'),_0x34b8e9[_0xd80e('0x1a')],_0x39c124);_0x122a72(_0x2d6ae5['error'](0x1f4,_0x34b8e9['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 3b5861e..d64af46 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 _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x3d07a2,_0x14e189){var _0x209397=function(_0x4a35af){while(--_0x4a35af){_0x3d07a2['push'](_0x3d07a2['shift']());}};_0x209397(++_0x14e189);}(_0x9b67,0xf6));var _0x79b6=function(_0x57b63b,_0x216568){_0x57b63b=_0x57b63b-0x0;var _0x332a97=_0x9b67[_0x57b63b];return _0x332a97;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}};
\ No newline at end of file
+var _0xc978=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x4446ac,_0x5d261c){var _0x1ba7a1=function(_0x7c5aad){while(--_0x7c5aad){_0x4446ac['push'](_0x4446ac['shift']());}};_0x1ba7a1(++_0x5d261c);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var ChatQueueEvents=require(_0x8c97('0x0'));var events=[_0x8c97('0x1'),_0x8c97('0x2'),_0x8c97('0x3')];function createListener(_0x371c48,_0x44d4ea){return function(_0x5ef47d){_0x44d4ea[_0x8c97('0x4')](_0x371c48,_0x5ef47d);};}function removeListener(_0x23c28d,_0x3ad972){return function(){ChatQueueEvents[_0x8c97('0x5')](_0x23c28d,_0x3ad972);};}exports[_0x8c97('0x6')]=function(_0x2a9434){for(var _0xabd146=0x0,_0x524196=events[_0x8c97('0x7')];_0xabd146<_0x524196;_0xabd146++){var _0x1b5864=events[_0xabd146];var _0x332cd1=createListener(_0x8c97('0x8')+_0x1b5864,_0x2a9434);ChatQueueEvents['on'](_0x1b5864,_0x332cd1);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index cacac5c..aab9cc9 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3d61a9,_0x145147){var _0x5b3607=function(_0x5aca29){while(--_0x5aca29){_0x3d61a9['push'](_0x3d61a9['shift']());}};_0x5b3607(++_0x145147);}(_0x814b,0x1a2));var _0xb814=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0x814b[_0xa5d9f9];return _0x40e9f6;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2962fa,_0x28ca02){var _0x127c56=function(_0x36bde4){while(--_0x36bde4){_0x2962fa['push'](_0x2962fa['shift']());}};_0x127c56(++_0x28ca02);}(_0x008c,0x188));var _0xc008=function(_0x173f79,_0x3b2224){_0x173f79=_0x173f79-0x0;var _0x59ce8c=_0x008c[_0x173f79];return _0x59ce8c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),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 b18377d..96963ad 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 _0x3dc7=['STRING','DATE','moment','sequelize','exports'];(function(_0x182623,_0x510040){var _0x3404d5=function(_0x2ff4b1){while(--_0x2ff4b1){_0x182623['push'](_0x182623['shift']());}};_0x3404d5(++_0x510040);}(_0x3dc7,0x138));var _0x73dc=function(_0x50791c,_0x3466eb){_0x50791c=_0x50791c-0x0;var _0x2d9192=_0x3dc7[_0x50791c];return _0x2d9192;};'use strict';var moment=require(_0x73dc('0x0'));var Sequelize=require(_0x73dc('0x1'));module[_0x73dc('0x2')]={'uniqueid':{'type':Sequelize[_0x73dc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x73dc('0x3')]},'joinAt':{'type':Sequelize[_0x73dc('0x4')]},'leaveAt':{'type':Sequelize[_0x73dc('0x4')]},'acceptAt':{'type':Sequelize[_0x73dc('0x4')]},'exitAt':{'type':Sequelize[_0x73dc('0x4')]},'reason':{'type':Sequelize[_0x73dc('0x3')]}};
\ No newline at end of file
+var _0x2630=['STRING','DATE','sequelize','exports'];(function(_0xf7ccca,_0x1a5b80){var _0x2f6b9a=function(_0x3d9b52){while(--_0x3d9b52){_0xf7ccca['push'](_0xf7ccca['shift']());}};_0x2f6b9a(++_0x1a5b80);}(_0x2630,0xca));var _0x0263=function(_0x1b458b,_0x7ed77d){_0x1b458b=_0x1b458b-0x0;var _0x1918ce=_0x2630[_0x1b458b];return _0x1918ce;};'use strict';var moment=require('moment');var Sequelize=require(_0x0263('0x0'));module[_0x0263('0x1')]={'uniqueid':{'type':Sequelize[_0x0263('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0263('0x2')]},'joinAt':{'type':Sequelize[_0x0263('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x0263('0x3')]},'exitAt':{'type':Sequelize[_0x0263('0x3')]},'reason':{'type':Sequelize[_0x0263('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c301c37..a99585a 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 _0xbd10=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','map','ChatQueueReport','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','show','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis'];(function(_0x3cbbf3,_0x47fa64){var _0x5794db=function(_0x2b1d7d){while(--_0x2b1d7d){_0x3cbbf3['push'](_0x3cbbf3['shift']());}};_0x5794db(++_0x47fa64);}(_0xbd10,0x85));var _0x0bd1=function(_0x2c58ab,_0x2b5755){_0x2c58ab=_0x2c58ab-0x0;var _0x3eff87=_0xbd10[_0x2c58ab];return _0x3eff87;};'use strict';var emlformat=require(_0x0bd1('0x0'));var rimraf=require(_0x0bd1('0x1'));var zipdir=require(_0x0bd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd1('0x3'));var moment=require(_0x0bd1('0x4'));var BPromise=require(_0x0bd1('0x5'));var Mustache=require('mustache');var util=require(_0x0bd1('0x6'));var path=require(_0x0bd1('0x7'));var sox=require(_0x0bd1('0x8'));var csv=require(_0x0bd1('0x9'));var ejs=require(_0x0bd1('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd1('0xb'));var _=require('lodash');var squel=require(_0x0bd1('0xc'));var crypto=require('crypto');var jsforce=require(_0x0bd1('0xd'));var deskjs=require(_0x0bd1('0xe'));var toCsv=require(_0x0bd1('0x9'));var querystring=require(_0x0bd1('0xf'));var Papa=require('papaparse');var Redis=require(_0x0bd1('0x10'));var authService=require(_0x0bd1('0x11'));var qs=require(_0x0bd1('0x12'));var as=require(_0x0bd1('0x13'));var hardwareService=require(_0x0bd1('0x14'));var logger=require(_0x0bd1('0x15'))('api');var utils=require(_0x0bd1('0x16'));var config=require(_0x0bd1('0x17'));var licenseUtil=require(_0x0bd1('0x18'));var db=require(_0x0bd1('0x19'))['db'];function respondWithStatusCode(_0x4009e4,_0x1f441f){_0x1f441f=_0x1f441f||0xcc;return function(_0x57fd1d){if(_0x57fd1d){return _0x4009e4[_0x0bd1('0x1a')](_0x1f441f);}return _0x4009e4[_0x0bd1('0x1b')](_0x1f441f)[_0x0bd1('0x1c')]();};}function respondWithResult(_0x5025e1,_0x51f988){_0x51f988=_0x51f988||0xc8;return function(_0x3e2f49){if(_0x3e2f49){return _0x5025e1[_0x0bd1('0x1b')](_0x51f988)[_0x0bd1('0x1d')](_0x3e2f49);}};}function respondWithFilteredResult(_0x56055b,_0x5ab8a5){return function(_0x180809){if(_0x180809){var _0x88e088=typeof _0x5ab8a5[_0x0bd1('0x1e')]==='undefined'&&typeof _0x5ab8a5[_0x0bd1('0x1f')]===_0x0bd1('0x20');var _0x2f2969=_0x180809[_0x0bd1('0x21')];var _0x4790eb=_0x88e088?0x0:_0x5ab8a5[_0x0bd1('0x1e')];var _0x3d1170=_0x88e088?_0x180809['count']:_0x5ab8a5[_0x0bd1('0x1e')]+_0x5ab8a5[_0x0bd1('0x1f')];var _0x59d106;if(_0x3d1170>=_0x2f2969){_0x3d1170=_0x2f2969;_0x59d106=0xc8;}else{_0x59d106=0xce;}_0x56055b['status'](_0x59d106);return _0x56055b[_0x0bd1('0x22')](_0x0bd1('0x23'),_0x4790eb+'-'+_0x3d1170+'/'+_0x2f2969)[_0x0bd1('0x1d')](_0x180809);}return null;};}function patchUpdates(_0x6959b7){return function(_0x1f8536){try{jsonpatch[_0x0bd1('0x24')](_0x1f8536,_0x6959b7,!![]);}catch(_0xc5ece1){return BPromise[_0x0bd1('0x25')](_0xc5ece1);}return _0x1f8536['save']();};}function saveUpdates(_0x2d5861,_0x44095f){return function(_0x31eaf5){if(_0x31eaf5){return _0x31eaf5[_0x0bd1('0x26')](_0x2d5861)[_0x0bd1('0x27')](function(_0x569b09){return _0x569b09;});}return null;};}function removeEntity(_0x35a8ca,_0x4d6828){return function(_0x5f0742){if(_0x5f0742){return _0x5f0742[_0x0bd1('0x28')]()[_0x0bd1('0x27')](function(){_0x35a8ca[_0x0bd1('0x1b')](0xcc)[_0x0bd1('0x1c')]();});}};}function handleEntityNotFound(_0x237f4a,_0x16eb7b){return function(_0x3e0c07){if(!_0x3e0c07){_0x237f4a[_0x0bd1('0x1a')](0x194);}return _0x3e0c07;};}function handleError(_0x2cacfc,_0x58a565){_0x58a565=_0x58a565||0x1f4;return function(_0x5cb236){logger[_0x0bd1('0x29')](_0x5cb236['stack']);if(_0x5cb236[_0x0bd1('0x2a')]){delete _0x5cb236[_0x0bd1('0x2a')];}_0x2cacfc['status'](_0x58a565)['send'](_0x5cb236);};}exports['index']=function(_0x4b64cb,_0x551fcd){var _0x4616b9={},_0x2ac8bb={},_0x38e655={'count':0x0,'rows':[]};var _0x5b07cd=_[_0x0bd1('0x2b')](db[_0x0bd1('0x2c')]['rawAttributes'],function(_0x49debf){return{'name':_0x49debf[_0x0bd1('0x2d')],'type':_0x49debf['type']['key']};});_0x2ac8bb['model']=_[_0x0bd1('0x2b')](_0x5b07cd,_0x0bd1('0x2a'));_0x2ac8bb[_0x0bd1('0x2e')]=_['keys'](_0x4b64cb[_0x0bd1('0x2e')]);_0x2ac8bb[_0x0bd1('0x2f')]=_['intersection'](_0x2ac8bb['model'],_0x2ac8bb[_0x0bd1('0x2e')]);_0x4616b9['attributes']=_[_0x0bd1('0x30')](_0x2ac8bb[_0x0bd1('0x31')],qs['fields'](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x32')]));_0x4616b9[_0x0bd1('0x33')]=_0x4616b9['attributes'][_0x0bd1('0x34')]?_0x4616b9['attributes']:_0x2ac8bb[_0x0bd1('0x31')];if(!_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x35')](_0x0bd1('0x36'))){_0x4616b9['limit']=qs[_0x0bd1('0x1f')](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x1f')]);_0x4616b9[_0x0bd1('0x1e')]=qs[_0x0bd1('0x1e')](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x1e')]);}_0x4616b9['order']=qs[_0x0bd1('0x37')](_0x4b64cb[_0x0bd1('0x2e')]['sort']);_0x4616b9[_0x0bd1('0x38')]=qs[_0x0bd1('0x2f')](_[_0x0bd1('0x39')](_0x4b64cb[_0x0bd1('0x2e')],_0x2ac8bb[_0x0bd1('0x2f')]),_0x5b07cd);if(_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x3a')]){_0x4616b9[_0x0bd1('0x38')]=_[_0x0bd1('0x3b')](_0x4616b9[_0x0bd1('0x38')],{'$or':_[_0x0bd1('0x2b')](_0x5b07cd,function(_0x3715f6){if(_0x3715f6[_0x0bd1('0x3c')]!==_0x0bd1('0x3d')){var _0x28b835={};_0x28b835[_0x3715f6[_0x0bd1('0x2a')]]={'$like':'%'+_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x3a')]+'%'};return _0x28b835;}})});}_0x4616b9=_['merge']({},_0x4616b9,_0x4b64cb['options']);var _0x2fe9da={'where':_0x4616b9[_0x0bd1('0x38')]};return db[_0x0bd1('0x2c')][_0x0bd1('0x21')](_0x2fe9da)[_0x0bd1('0x27')](function(_0x5fcd17){_0x38e655['count']=_0x5fcd17;if(_0x4b64cb['query'][_0x0bd1('0x3e')]){_0x4616b9[_0x0bd1('0x3f')]=[{'all':!![]}];}return db[_0x0bd1('0x2c')][_0x0bd1('0x40')](_0x4616b9);})['then'](function(_0x12c010){_0x38e655['rows']=_0x12c010;return _0x38e655;})[_0x0bd1('0x27')](respondWithFilteredResult(_0x551fcd,_0x4616b9))['catch'](handleError(_0x551fcd,null));};exports[_0x0bd1('0x41')]=function(_0x3b7677,_0x32cff5){var _0xd4217c={'raw':!![],'where':{'id':_0x3b7677[_0x0bd1('0x42')]['id']}},_0x5894f4={};_0x5894f4[_0x0bd1('0x31')]=_[_0x0bd1('0x43')](db['ChatQueueReport'][_0x0bd1('0x44')]);_0x5894f4[_0x0bd1('0x2e')]=_[_0x0bd1('0x43')](_0x3b7677[_0x0bd1('0x2e')]);_0x5894f4[_0x0bd1('0x2f')]=_[_0x0bd1('0x30')](_0x5894f4[_0x0bd1('0x31')],_0x5894f4[_0x0bd1('0x2e')]);_0xd4217c[_0x0bd1('0x33')]=_[_0x0bd1('0x30')](_0x5894f4[_0x0bd1('0x31')],qs['fields'](_0x3b7677['query'][_0x0bd1('0x32')]));_0xd4217c['attributes']=_0xd4217c[_0x0bd1('0x33')]['length']?_0xd4217c[_0x0bd1('0x33')]:_0x5894f4[_0x0bd1('0x31')];if(_0x3b7677[_0x0bd1('0x2e')][_0x0bd1('0x3e')]){_0xd4217c[_0x0bd1('0x3f')]=[{'all':!![]}];}_0xd4217c=_[_0x0bd1('0x3b')]({},_0xd4217c,_0x3b7677[_0x0bd1('0x45')]);return db[_0x0bd1('0x2c')][_0x0bd1('0x46')](_0xd4217c)[_0x0bd1('0x27')](handleEntityNotFound(_0x32cff5,null))['then'](respondWithResult(_0x32cff5,null))[_0x0bd1('0x47')](handleError(_0x32cff5,null));};exports[_0x0bd1('0x48')]=function(_0x34a20d,_0x1ef213){return db['ChatQueueReport']['create'](_0x34a20d[_0x0bd1('0x49')],{})[_0x0bd1('0x27')](respondWithResult(_0x1ef213,0xc9))[_0x0bd1('0x47')](handleError(_0x1ef213,null));};exports['update']=function(_0x3cc311,_0x2cf6cb){if(_0x3cc311[_0x0bd1('0x49')]['id']){delete _0x3cc311[_0x0bd1('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3cc311[_0x0bd1('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cf6cb,null))[_0x0bd1('0x27')](saveUpdates(_0x3cc311['body'],null))[_0x0bd1('0x27')](respondWithResult(_0x2cf6cb,null))['catch'](handleError(_0x2cf6cb,null));};exports[_0x0bd1('0x28')]=function(_0x43ecb5,_0x53b563){return db['ChatQueueReport'][_0x0bd1('0x46')]({'where':{'id':_0x43ecb5[_0x0bd1('0x42')]['id']}})['then'](handleEntityNotFound(_0x53b563,null))['then'](removeEntity(_0x53b563,null))[_0x0bd1('0x47')](handleError(_0x53b563,null));};exports[_0x0bd1('0x4a')]=function(_0x1adf77,_0x4ca2e8){return db['ChatQueueReport'][_0x0bd1('0x4a')]()[_0x0bd1('0x27')](respondWithResult(_0x4ca2e8,null))[_0x0bd1('0x47')](handleError(_0x4ca2e8,null));};
\ No newline at end of file
+var _0x853e=['set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','show','params','includeAll','create','body','catch','find','describe','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x853e,0x1ea));var _0xe853=function(_0x292bd3,_0x4070ae){_0x292bd3=_0x292bd3-0x0;var _0x33150d=_0x853e[_0x292bd3];return _0x33150d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe853('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe853('0x1'));var rp=require('request-promise');var moment=require(_0xe853('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe853('0x3'));var util=require(_0xe853('0x4'));var path=require(_0xe853('0x5'));var sox=require(_0xe853('0x6'));var csv=require(_0xe853('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe853('0x8'));var _=require(_0xe853('0x9'));var squel=require(_0xe853('0xa'));var crypto=require(_0xe853('0xb'));var jsforce=require(_0xe853('0xc'));var deskjs=require(_0xe853('0xd'));var toCsv=require(_0xe853('0x7'));var querystring=require(_0xe853('0xe'));var Papa=require(_0xe853('0xf'));var Redis=require(_0xe853('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe853('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe853('0x12'));var config=require(_0xe853('0x13'));var licenseUtil=require(_0xe853('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x88883f,_0x476f20){_0x476f20=_0x476f20||0xcc;return function(_0x43c64b){if(_0x43c64b){return _0x88883f[_0xe853('0x15')](_0x476f20);}return _0x88883f[_0xe853('0x16')](_0x476f20)[_0xe853('0x17')]();};}function respondWithResult(_0x1ebf13,_0x4c92c6){_0x4c92c6=_0x4c92c6||0xc8;return function(_0x4b8e2c){if(_0x4b8e2c){return _0x1ebf13['status'](_0x4c92c6)['json'](_0x4b8e2c);}};}function respondWithFilteredResult(_0x156940,_0x3840b5){return function(_0x41c489){if(_0x41c489){var _0x11e4a0=typeof _0x3840b5[_0xe853('0x18')]===_0xe853('0x19')&&typeof _0x3840b5[_0xe853('0x1a')]===_0xe853('0x19');var _0x2a98fa=_0x41c489[_0xe853('0x1b')];var _0x30d868=_0x11e4a0?0x0:_0x3840b5[_0xe853('0x18')];var _0x459007=_0x11e4a0?_0x41c489[_0xe853('0x1b')]:_0x3840b5[_0xe853('0x18')]+_0x3840b5[_0xe853('0x1a')];var _0x5f45cf;if(_0x459007>=_0x2a98fa){_0x459007=_0x2a98fa;_0x5f45cf=0xc8;}else{_0x5f45cf=0xce;}_0x156940[_0xe853('0x16')](_0x5f45cf);return _0x156940[_0xe853('0x1c')](_0xe853('0x1d'),_0x30d868+'-'+_0x459007+'/'+_0x2a98fa)[_0xe853('0x1e')](_0x41c489);}return null;};}function patchUpdates(_0x3cd77f){return function(_0x1ade8a){try{jsonpatch[_0xe853('0x1f')](_0x1ade8a,_0x3cd77f,!![]);}catch(_0x3d9e77){return BPromise[_0xe853('0x20')](_0x3d9e77);}return _0x1ade8a[_0xe853('0x21')]();};}function saveUpdates(_0x163b62,_0x4d895e){return function(_0x110362){if(_0x110362){return _0x110362[_0xe853('0x22')](_0x163b62)[_0xe853('0x23')](function(_0x209049){return _0x209049;});}return null;};}function removeEntity(_0x1af209,_0xc875b2){return function(_0x3fa0e3){if(_0x3fa0e3){return _0x3fa0e3[_0xe853('0x24')]()['then'](function(){_0x1af209[_0xe853('0x16')](0xcc)[_0xe853('0x17')]();});}};}function handleEntityNotFound(_0x198895,_0x2cb2f1){return function(_0x105ce2){if(!_0x105ce2){_0x198895['sendStatus'](0x194);}return _0x105ce2;};}function handleError(_0x1fdaaf,_0x33e0b0){_0x33e0b0=_0x33e0b0||0x1f4;return function(_0x49d8ed){logger[_0xe853('0x25')](_0x49d8ed['stack']);if(_0x49d8ed[_0xe853('0x26')]){delete _0x49d8ed['name'];}_0x1fdaaf['status'](_0x33e0b0)[_0xe853('0x27')](_0x49d8ed);};}exports[_0xe853('0x28')]=function(_0x438b5b,_0x5d268f){var _0x397301={},_0x1e99c8={},_0x15db55={'count':0x0,'rows':[]};var _0x7f858c=_[_0xe853('0x29')](db[_0xe853('0x2a')][_0xe853('0x2b')],function(_0x5d4876){return{'name':_0x5d4876[_0xe853('0x2c')],'type':_0x5d4876[_0xe853('0x2d')]['key']};});_0x1e99c8[_0xe853('0x2e')]=_['map'](_0x7f858c,_0xe853('0x26'));_0x1e99c8[_0xe853('0x2f')]=_[_0xe853('0x30')](_0x438b5b['query']);_0x1e99c8[_0xe853('0x31')]=_[_0xe853('0x32')](_0x1e99c8[_0xe853('0x2e')],_0x1e99c8[_0xe853('0x2f')]);_0x397301[_0xe853('0x33')]=_[_0xe853('0x32')](_0x1e99c8[_0xe853('0x2e')],qs[_0xe853('0x34')](_0x438b5b[_0xe853('0x2f')][_0xe853('0x34')]));_0x397301[_0xe853('0x33')]=_0x397301['attributes'][_0xe853('0x35')]?_0x397301['attributes']:_0x1e99c8[_0xe853('0x2e')];if(!_0x438b5b[_0xe853('0x2f')][_0xe853('0x36')](_0xe853('0x37'))){_0x397301['limit']=qs[_0xe853('0x1a')](_0x438b5b[_0xe853('0x2f')][_0xe853('0x1a')]);_0x397301[_0xe853('0x18')]=qs[_0xe853('0x18')](_0x438b5b[_0xe853('0x2f')]['offset']);}_0x397301[_0xe853('0x38')]=qs[_0xe853('0x39')](_0x438b5b[_0xe853('0x2f')][_0xe853('0x39')]);_0x397301[_0xe853('0x3a')]=qs[_0xe853('0x31')](_[_0xe853('0x3b')](_0x438b5b[_0xe853('0x2f')],_0x1e99c8[_0xe853('0x31')]),_0x7f858c);if(_0x438b5b['query']['filter']){_0x397301[_0xe853('0x3a')]=_[_0xe853('0x3c')](_0x397301[_0xe853('0x3a')],{'$or':_['map'](_0x7f858c,function(_0x1ed61e){if(_0x1ed61e['type']!=='VIRTUAL'){var _0x4af4fc={};_0x4af4fc[_0x1ed61e[_0xe853('0x26')]]={'$like':'%'+_0x438b5b[_0xe853('0x2f')][_0xe853('0x3d')]+'%'};return _0x4af4fc;}})});}_0x397301=_['merge']({},_0x397301,_0x438b5b[_0xe853('0x3e')]);var _0x1c0696={'where':_0x397301[_0xe853('0x3a')]};return db[_0xe853('0x2a')][_0xe853('0x1b')](_0x1c0696)[_0xe853('0x23')](function(_0x54884d){_0x15db55['count']=_0x54884d;if(_0x438b5b[_0xe853('0x2f')]['includeAll']){_0x397301[_0xe853('0x3f')]=[{'all':!![]}];}return db[_0xe853('0x2a')][_0xe853('0x40')](_0x397301);})[_0xe853('0x23')](function(_0x1c6cc2){_0x15db55[_0xe853('0x41')]=_0x1c6cc2;return _0x15db55;})[_0xe853('0x23')](respondWithFilteredResult(_0x5d268f,_0x397301))['catch'](handleError(_0x5d268f,null));};exports[_0xe853('0x42')]=function(_0x2f97fe,_0x17662e){var _0x4c50d5={'raw':!![],'where':{'id':_0x2f97fe[_0xe853('0x43')]['id']}},_0x14fa6a={};_0x14fa6a['model']=_[_0xe853('0x30')](db[_0xe853('0x2a')]['rawAttributes']);_0x14fa6a[_0xe853('0x2f')]=_[_0xe853('0x30')](_0x2f97fe[_0xe853('0x2f')]);_0x14fa6a[_0xe853('0x31')]=_['intersection'](_0x14fa6a[_0xe853('0x2e')],_0x14fa6a['query']);_0x4c50d5[_0xe853('0x33')]=_[_0xe853('0x32')](_0x14fa6a[_0xe853('0x2e')],qs['fields'](_0x2f97fe[_0xe853('0x2f')][_0xe853('0x34')]));_0x4c50d5['attributes']=_0x4c50d5[_0xe853('0x33')]['length']?_0x4c50d5[_0xe853('0x33')]:_0x14fa6a[_0xe853('0x2e')];if(_0x2f97fe[_0xe853('0x2f')][_0xe853('0x44')]){_0x4c50d5['include']=[{'all':!![]}];}_0x4c50d5=_['merge']({},_0x4c50d5,_0x2f97fe[_0xe853('0x3e')]);return db[_0xe853('0x2a')]['find'](_0x4c50d5)[_0xe853('0x23')](handleEntityNotFound(_0x17662e,null))[_0xe853('0x23')](respondWithResult(_0x17662e,null))['catch'](handleError(_0x17662e,null));};exports['create']=function(_0x230d53,_0x21f5e4){return db[_0xe853('0x2a')][_0xe853('0x45')](_0x230d53[_0xe853('0x46')],{})[_0xe853('0x23')](respondWithResult(_0x21f5e4,0xc9))[_0xe853('0x47')](handleError(_0x21f5e4,null));};exports[_0xe853('0x22')]=function(_0x1f07f6,_0x276c62){if(_0x1f07f6['body']['id']){delete _0x1f07f6['body']['id'];}return db[_0xe853('0x2a')][_0xe853('0x48')]({'where':{'id':_0x1f07f6['params']['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x276c62,null))[_0xe853('0x23')](saveUpdates(_0x1f07f6['body'],null))[_0xe853('0x23')](respondWithResult(_0x276c62,null))[_0xe853('0x47')](handleError(_0x276c62,null));};exports[_0xe853('0x24')]=function(_0x5eeb43,_0x42f38a){return db[_0xe853('0x2a')]['find']({'where':{'id':_0x5eeb43[_0xe853('0x43')]['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x42f38a,null))[_0xe853('0x23')](removeEntity(_0x42f38a,null))[_0xe853('0x47')](handleError(_0x42f38a,null));};exports[_0xe853('0x49')]=function(_0x29933f,_0x6a23ad){return db[_0xe853('0x2a')]['describe']()[_0xe853('0x23')](respondWithResult(_0x6a23ad,null))[_0xe853('0x47')](handleError(_0x6a23ad,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 8dfe834..131c0be 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3e1a10,_0x6aeaf2){var _0x2fb8ee=function(_0x473aa3){while(--_0x473aa3){_0x3e1a10['push'](_0x3e1a10['shift']());}};_0x2fb8ee(++_0x6aeaf2);}(_0xe706,0xa3));var _0x6e70=function(_0x28ad6c,_0x599a96){_0x28ad6c=_0x28ad6c-0x0;var _0x597de8=_0xe706[_0x28ad6c];return _0x597de8;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x58e582,_0x41b688){var _0x27f1cd=function(_0x530c74){while(--_0x530c74){_0x58e582['push'](_0x58e582['shift']());}};_0x27f1cd(++_0x41b688);}(_0xe706,0xa3));var _0x6e70=function(_0x487cb0,_0x339d3e){_0x487cb0=_0x487cb0-0x0;var _0x5a8047=_0xe706[_0x487cb0];return _0x5a8047;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index fdf902e..20e5488 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 _0xb65b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','attributes','limit','util','moment'];(function(_0x88018c,_0x1d1448){var _0xd21877=function(_0x3183fb){while(--_0x3183fb){_0x88018c['push'](_0x88018c['shift']());}};_0xd21877(++_0x1d1448);}(_0xb65b,0x139));var _0xbb65=function(_0x116633,_0x30ca02){_0x116633=_0x116633-0x0;var _0x3f688e=_0xb65b[_0x116633];return _0x3f688e;};'use strict';var _=require('lodash');var util=require(_0xbb65('0x0'));var moment=require(_0xbb65('0x1'));var BPromise=require(_0xbb65('0x2'));var rs=require(_0xbb65('0x3'));var fs=require('fs');var Redis=require(_0xbb65('0x4'));var db=require(_0xbb65('0x5'))['db'];var utils=require(_0xbb65('0x6'));var logger=require(_0xbb65('0x7'))(_0xbb65('0x8'));var config=require(_0xbb65('0x9'));var jayson=require(_0xbb65('0xa'));var client=jayson[_0xbb65('0xb')][_0xbb65('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x342934,_0x4aec73,_0x32ccd8){return new BPromise(function(_0x13860a,_0xbead3){return client['request'](_0x342934,_0x32ccd8)[_0xbb65('0xd')](function(_0x583aad){logger[_0xbb65('0xe')](_0xbb65('0xf'),_0x4aec73,_0xbb65('0x10'));logger[_0xbb65('0x11')](_0xbb65('0x12'),_0x4aec73,_0xbb65('0x10'),JSON['stringify'](_0x583aad));if(_0x583aad['error']){if(_0x583aad['error'][_0xbb65('0x13')]===0x1f4){logger[_0xbb65('0x14')](_0xbb65('0xf'),_0x4aec73,_0x583aad['error'][_0xbb65('0x15')]);return _0xbead3(_0x583aad['error'][_0xbb65('0x15')]);}logger['error'](_0xbb65('0xf'),_0x4aec73,_0x583aad[_0xbb65('0x14')][_0xbb65('0x15')]);return _0x13860a(_0x583aad[_0xbb65('0x14')][_0xbb65('0x15')]);}else{logger[_0xbb65('0xe')](_0xbb65('0xf'),_0x4aec73,_0xbb65('0x10'));_0x13860a(_0x583aad[_0xbb65('0x16')][_0xbb65('0x15')]);}})[_0xbb65('0x17')](function(_0x3fe5a0){logger[_0xbb65('0x14')](_0xbb65('0xf'),_0x4aec73,_0x3fe5a0);_0xbead3(_0x3fe5a0);});});}exports[_0xbb65('0x18')]=function(_0x56a183){var _0x2ff328=this;return new Promise(function(_0x16f230,_0x5ce84f){return db[_0xbb65('0x19')][_0xbb65('0x1a')](_0x56a183[_0xbb65('0x1b')],{'raw':_0x56a183[_0xbb65('0x1c')]?_0x56a183[_0xbb65('0x1c')][_0xbb65('0x1d')]===undefined?!![]:![]:!![]})[_0xbb65('0xd')](function(_0x2684ad){logger[_0xbb65('0xe')](_0xbb65('0x18'),_0x56a183);logger[_0xbb65('0x11')](_0xbb65('0x18'),_0x56a183,JSON[_0xbb65('0x1e')](_0x2684ad));_0x16f230(_0x2684ad);})['catch'](function(_0x43f9b5){logger[_0xbb65('0x14')](_0xbb65('0x18'),_0x43f9b5[_0xbb65('0x15')],_0x56a183);_0x5ce84f(_0x2ff328[_0xbb65('0x14')](0x1f4,_0x43f9b5['message']));});});};exports[_0xbb65('0x1f')]=function(_0x4563c5){var _0xa05364=this;return new Promise(function(_0x422721,_0x55876f){return db[_0xbb65('0x19')][_0xbb65('0x20')](_0x4563c5[_0xbb65('0x1b')],{'raw':_0x4563c5[_0xbb65('0x1c')]?_0x4563c5['options'][_0xbb65('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4563c5['options']?_0x4563c5['options']['where']||null:null,'attributes':_0x4563c5[_0xbb65('0x1c')]?_0x4563c5[_0xbb65('0x1c')][_0xbb65('0x21')]||null:null,'limit':_0x4563c5[_0xbb65('0x1c')]?_0x4563c5[_0xbb65('0x1c')][_0xbb65('0x22')]||null:null})[_0xbb65('0xd')](function(_0x265e61){logger[_0xbb65('0xe')](_0xbb65('0x1f'),_0x4563c5);logger[_0xbb65('0x11')](_0xbb65('0x1f'),_0x4563c5,JSON[_0xbb65('0x1e')](_0x265e61));_0x422721(_0x265e61);})[_0xbb65('0x17')](function(_0x5f2e59){logger['error'](_0xbb65('0x1f'),_0x5f2e59[_0xbb65('0x15')],_0x4563c5);_0x55876f(_0xa05364['error'](0x1f4,_0x5f2e59[_0xbb65('0x15')]));});});};
\ No newline at end of file
+var _0x27d6=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','then','info','CreateChatQueueReport','debug','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x354aa2,_0x31b042){var _0x66c5d=function(_0x5d6d9f){while(--_0x5d6d9f){_0x354aa2['push'](_0x354aa2['shift']());}};_0x66c5d(++_0x31b042);}(_0x27d6,0x11b));var _0x627d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x27d6[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x627d('0x0'));var util=require(_0x627d('0x1'));var moment=require(_0x627d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x627d('0x3'));var db=require(_0x627d('0x4'))['db'];var utils=require(_0x627d('0x5'));var logger=require(_0x627d('0x6'))(_0x627d('0x7'));var config=require(_0x627d('0x8'));var jayson=require(_0x627d('0x9'));var client=jayson[_0x627d('0xa')][_0x627d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x69bb15,_0x69f035,_0x1a366a){return new BPromise(function(_0x487d21,_0x917a5f){return client[_0x627d('0xc')](_0x69bb15,_0x1a366a)['then'](function(_0x3e818f){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x69f035,_0x627d('0xd'));logger['debug'](_0x627d('0xe'),_0x69f035,_0x627d('0xd'),JSON[_0x627d('0xf')](_0x3e818f));if(_0x3e818f['error']){if(_0x3e818f[_0x627d('0x10')][_0x627d('0x11')]===0x1f4){logger[_0x627d('0x10')](_0x627d('0x12'),_0x69f035,_0x3e818f['error'][_0x627d('0x13')]);return _0x917a5f(_0x3e818f[_0x627d('0x10')]['message']);}logger[_0x627d('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x69f035,_0x3e818f[_0x627d('0x10')]['message']);return _0x487d21(_0x3e818f['error'][_0x627d('0x13')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x69f035,'request\x20sent');_0x487d21(_0x3e818f[_0x627d('0x14')][_0x627d('0x13')]);}})[_0x627d('0x15')](function(_0x20bbe8){logger[_0x627d('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x69f035,_0x20bbe8);_0x917a5f(_0x20bbe8);});});}exports['CreateChatQueueReport']=function(_0x4695c8){var _0x5b3594=this;return new Promise(function(_0x36fd7f,_0x37f43d){return db[_0x627d('0x16')][_0x627d('0x17')](_0x4695c8[_0x627d('0x18')],{'raw':_0x4695c8[_0x627d('0x19')]?_0x4695c8[_0x627d('0x19')][_0x627d('0x1a')]===undefined?!![]:![]:!![]})[_0x627d('0x1b')](function(_0x531bfa){logger[_0x627d('0x1c')](_0x627d('0x1d'),_0x4695c8);logger[_0x627d('0x1e')]('CreateChatQueueReport',_0x4695c8,JSON['stringify'](_0x531bfa));_0x36fd7f(_0x531bfa);})[_0x627d('0x15')](function(_0x59bcd1){logger[_0x627d('0x10')](_0x627d('0x1d'),_0x59bcd1[_0x627d('0x13')],_0x4695c8);_0x37f43d(_0x5b3594[_0x627d('0x10')](0x1f4,_0x59bcd1['message']));});});};exports[_0x627d('0x1f')]=function(_0x66a133){var _0x4ad564=this;return new Promise(function(_0x385c1f,_0x107fab){return db[_0x627d('0x16')][_0x627d('0x20')](_0x66a133[_0x627d('0x18')],{'raw':_0x66a133[_0x627d('0x19')]?_0x66a133[_0x627d('0x19')][_0x627d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66a133['options']?_0x66a133['options'][_0x627d('0x21')]||null:null,'attributes':_0x66a133[_0x627d('0x19')]?_0x66a133['options'][_0x627d('0x22')]||null:null,'limit':_0x66a133[_0x627d('0x19')]?_0x66a133[_0x627d('0x19')][_0x627d('0x23')]||null:null})['then'](function(_0x524be5){logger[_0x627d('0x1c')](_0x627d('0x1f'),_0x66a133);logger['debug'](_0x627d('0x1f'),_0x66a133,JSON['stringify'](_0x524be5));_0x385c1f(_0x524be5);})[_0x627d('0x15')](function(_0x452336){logger[_0x627d('0x10')](_0x627d('0x1f'),_0x452336[_0x627d('0x13')],_0x66a133);_0x107fab(_0x4ad564[_0x627d('0x10')](0x1f4,_0x452336['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 5c09a59..acab003 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca93=['/:id','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','create','put','update','delete'];(function(_0x1c6cd6,_0x3ecf9e){var _0x104fef=function(_0x23e985){while(--_0x23e985){_0x1c6cd6['push'](_0x1c6cd6['shift']());}};_0x104fef(++_0x3ecf9e);}(_0xca93,0x158));var _0x3ca9=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xca93[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x3ca9('0x0'));var util=require(_0x3ca9('0x1'));var path=require(_0x3ca9('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ca9('0x3'));var router=express[_0x3ca9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3ca9('0x5'));var config=require(_0x3ca9('0x6'));var controller=require(_0x3ca9('0x7'));router[_0x3ca9('0x8')]('/',auth[_0x3ca9('0x9')](),controller['index']);router['get'](_0x3ca9('0xa'),auth[_0x3ca9('0x9')](),controller[_0x3ca9('0xb')]);router[_0x3ca9('0x8')]('/:id',auth[_0x3ca9('0x9')](),controller[_0x3ca9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3ca9('0xd')]);router[_0x3ca9('0xe')]('/:id',auth[_0x3ca9('0x9')](),controller[_0x3ca9('0xf')]);router[_0x3ca9('0x10')](_0x3ca9('0x11'),auth[_0x3ca9('0x9')](),controller[_0x3ca9('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x837c=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','show','post','create','update','delete','destroy','exports','multer'];(function(_0x2a9584,_0x15ead9){var _0x2e6ed6=function(_0x493e62){while(--_0x493e62){_0x2a9584['push'](_0x2a9584['shift']());}};_0x2e6ed6(++_0x15ead9);}(_0x837c,0x12f));var _0xc837=function(_0x39cb2d,_0x1b4cd0){_0x39cb2d=_0x39cb2d-0x0;var _0x257c98=_0x837c[_0x39cb2d];return _0x257c98;};'use strict';var multer=require(_0xc837('0x0'));var util=require(_0xc837('0x1'));var path=require(_0xc837('0x2'));var timeout=require(_0xc837('0x3'));var express=require(_0xc837('0x4'));var router=express['Router']();var fs_extra=require(_0xc837('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc837('0x6'));var config=require(_0xc837('0x7'));var controller=require(_0xc837('0x8'));router[_0xc837('0x9')]('/',auth[_0xc837('0xa')](),controller['index']);router[_0xc837('0x9')]('/describe',auth[_0xc837('0xa')](),controller[_0xc837('0xb')]);router[_0xc837('0x9')]('/:id',auth[_0xc837('0xa')](),controller[_0xc837('0xc')]);router[_0xc837('0xd')]('/',auth['isAuthenticated'](),controller[_0xc837('0xe')]);router['put']('/:id',auth[_0xc837('0xa')](),controller[_0xc837('0xf')]);router[_0xc837('0x10')]('/:id',auth[_0xc837('0xa')](),controller[_0xc837('0x11')]);module[_0xc837('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 99f1eb8..24435ef 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xcf8d3a,_0x35575a){var _0x206211=function(_0x5c3bd3){while(--_0x5c3bd3){_0xcf8d3a['push'](_0xcf8d3a['shift']());}};_0x206211(++_0x35575a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xcb91[_0x2ac4af];return _0x3a36df;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4fe67e,_0x1c69df){var _0x4581d6=function(_0xf1d9cc){while(--_0xf1d9cc){_0x4fe67e['push'](_0x4fe67e['shift']());}};_0x4581d6(++_0x1c69df);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0xcb91[_0x36436d];return _0x34615d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 7059c54..bc37e57 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 _0xbfe1=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','ChatTransferReport','rows','catch','show','fields','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0xbfe1,0xc9));var _0x1bfe=function(_0x90652c,_0x1f9a91){_0x90652c=_0x90652c-0x0;var _0x37c89c=_0xbfe1[_0x90652c];return _0x37c89c;};'use strict';var emlformat=require(_0x1bfe('0x0'));var rimraf=require(_0x1bfe('0x1'));var zipdir=require(_0x1bfe('0x2'));var jsonpatch=require(_0x1bfe('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1bfe('0x4'));var Mustache=require(_0x1bfe('0x5'));var util=require(_0x1bfe('0x6'));var path=require(_0x1bfe('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1bfe('0x8'));var fs=require('fs');var fs_extra=require(_0x1bfe('0x9'));var _=require(_0x1bfe('0xa'));var squel=require(_0x1bfe('0xb'));var crypto=require(_0x1bfe('0xc'));var jsforce=require(_0x1bfe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1bfe('0xe'));var querystring=require(_0x1bfe('0xf'));var Papa=require(_0x1bfe('0x10'));var Redis=require(_0x1bfe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1bfe('0x12'));var as=require(_0x1bfe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1bfe('0x14'));var utils=require(_0x1bfe('0x15'));var config=require(_0x1bfe('0x16'));var licenseUtil=require(_0x1bfe('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x398bf8,_0x236579){_0x236579=_0x236579||0xcc;return function(_0x272cb4){if(_0x272cb4){return _0x398bf8[_0x1bfe('0x18')](_0x236579);}return _0x398bf8[_0x1bfe('0x19')](_0x236579)[_0x1bfe('0x1a')]();};}function respondWithResult(_0xf53c0c,_0x3c292e){_0x3c292e=_0x3c292e||0xc8;return function(_0x44a8b6){if(_0x44a8b6){return _0xf53c0c['status'](_0x3c292e)[_0x1bfe('0x1b')](_0x44a8b6);}};}function respondWithFilteredResult(_0x2bac45,_0x546acc){return function(_0x54ff37){if(_0x54ff37){var _0x3e4ffc=typeof _0x546acc[_0x1bfe('0x1c')]==='undefined'&&typeof _0x546acc['limit']===_0x1bfe('0x1d');var _0x3dd8cb=_0x54ff37[_0x1bfe('0x1e')];var _0x2df974=_0x3e4ffc?0x0:_0x546acc[_0x1bfe('0x1c')];var _0x4d12d0=_0x3e4ffc?_0x54ff37[_0x1bfe('0x1e')]:_0x546acc['offset']+_0x546acc['limit'];var _0x1943e5;if(_0x4d12d0>=_0x3dd8cb){_0x4d12d0=_0x3dd8cb;_0x1943e5=0xc8;}else{_0x1943e5=0xce;}_0x2bac45['status'](_0x1943e5);return _0x2bac45['set'](_0x1bfe('0x1f'),_0x2df974+'-'+_0x4d12d0+'/'+_0x3dd8cb)[_0x1bfe('0x1b')](_0x54ff37);}return null;};}function patchUpdates(_0x3f9d85){return function(_0x3f5311){try{jsonpatch['apply'](_0x3f5311,_0x3f9d85,!![]);}catch(_0xbcb2ee){return BPromise[_0x1bfe('0x20')](_0xbcb2ee);}return _0x3f5311[_0x1bfe('0x21')]();};}function saveUpdates(_0x744112,_0x5bc630){return function(_0x401d92){if(_0x401d92){return _0x401d92[_0x1bfe('0x22')](_0x744112)['then'](function(_0x1f21f2){return _0x1f21f2;});}return null;};}function removeEntity(_0x34f9c5,_0x930c14){return function(_0x26fc55){if(_0x26fc55){return _0x26fc55['destroy']()['then'](function(){_0x34f9c5['status'](0xcc)[_0x1bfe('0x1a')]();});}};}function handleEntityNotFound(_0x508432,_0x453e2d){return function(_0x5d6c29){if(!_0x5d6c29){_0x508432[_0x1bfe('0x18')](0x194);}return _0x5d6c29;};}function handleError(_0x34d5f7,_0x388290){_0x388290=_0x388290||0x1f4;return function(_0x159251){logger['error'](_0x159251[_0x1bfe('0x23')]);if(_0x159251[_0x1bfe('0x24')]){delete _0x159251[_0x1bfe('0x24')];}_0x34d5f7[_0x1bfe('0x19')](_0x388290)[_0x1bfe('0x25')](_0x159251);};}exports[_0x1bfe('0x26')]=function(_0x4295d3,_0x5e77e6){var _0x5c62f2={},_0x599aa8={},_0x8cd4f5={'count':0x0,'rows':[]};var _0x265e94=_[_0x1bfe('0x27')](db['ChatTransferReport'][_0x1bfe('0x28')],function(_0x4ec435){return{'name':_0x4ec435['fieldName'],'type':_0x4ec435[_0x1bfe('0x29')]['key']};});_0x599aa8[_0x1bfe('0x2a')]=_['map'](_0x265e94,_0x1bfe('0x24'));_0x599aa8[_0x1bfe('0x2b')]=_[_0x1bfe('0x2c')](_0x4295d3[_0x1bfe('0x2b')]);_0x599aa8[_0x1bfe('0x2d')]=_[_0x1bfe('0x2e')](_0x599aa8['model'],_0x599aa8['query']);_0x5c62f2[_0x1bfe('0x2f')]=_[_0x1bfe('0x2e')](_0x599aa8[_0x1bfe('0x2a')],qs['fields'](_0x4295d3[_0x1bfe('0x2b')]['fields']));_0x5c62f2[_0x1bfe('0x2f')]=_0x5c62f2[_0x1bfe('0x2f')][_0x1bfe('0x30')]?_0x5c62f2[_0x1bfe('0x2f')]:_0x599aa8[_0x1bfe('0x2a')];if(!_0x4295d3['query']['hasOwnProperty']('nolimit')){_0x5c62f2[_0x1bfe('0x31')]=qs[_0x1bfe('0x31')](_0x4295d3['query'][_0x1bfe('0x31')]);_0x5c62f2[_0x1bfe('0x1c')]=qs[_0x1bfe('0x1c')](_0x4295d3[_0x1bfe('0x2b')]['offset']);}_0x5c62f2[_0x1bfe('0x32')]=qs['sort'](_0x4295d3['query'][_0x1bfe('0x33')]);_0x5c62f2[_0x1bfe('0x34')]=qs['filters'](_[_0x1bfe('0x35')](_0x4295d3['query'],_0x599aa8['filters']),_0x265e94);if(_0x4295d3[_0x1bfe('0x2b')][_0x1bfe('0x36')]){_0x5c62f2[_0x1bfe('0x34')]=_[_0x1bfe('0x37')](_0x5c62f2[_0x1bfe('0x34')],{'$or':_['map'](_0x265e94,function(_0x4ea208){if(_0x4ea208[_0x1bfe('0x29')]!==_0x1bfe('0x38')){var _0xc104fc={};_0xc104fc[_0x4ea208[_0x1bfe('0x24')]]={'$like':'%'+_0x4295d3[_0x1bfe('0x2b')][_0x1bfe('0x36')]+'%'};return _0xc104fc;}})});}_0x5c62f2=_[_0x1bfe('0x37')]({},_0x5c62f2,_0x4295d3[_0x1bfe('0x39')]);var _0x32726f={'where':_0x5c62f2[_0x1bfe('0x34')]};return db['ChatTransferReport']['count'](_0x32726f)[_0x1bfe('0x3a')](function(_0x3888cf){_0x8cd4f5['count']=_0x3888cf;if(_0x4295d3[_0x1bfe('0x2b')][_0x1bfe('0x3b')]){_0x5c62f2['include']=[{'all':!![]}];}return db[_0x1bfe('0x3c')]['findAll'](_0x5c62f2);})[_0x1bfe('0x3a')](function(_0xc7d843){_0x8cd4f5[_0x1bfe('0x3d')]=_0xc7d843;return _0x8cd4f5;})[_0x1bfe('0x3a')](respondWithFilteredResult(_0x5e77e6,_0x5c62f2))[_0x1bfe('0x3e')](handleError(_0x5e77e6,null));};exports[_0x1bfe('0x3f')]=function(_0x1be477,_0x4263bc){var _0x2853ec={'raw':!![],'where':{'id':_0x1be477['params']['id']}},_0x30bbcd={};_0x30bbcd['model']=_[_0x1bfe('0x2c')](db['ChatTransferReport'][_0x1bfe('0x28')]);_0x30bbcd[_0x1bfe('0x2b')]=_[_0x1bfe('0x2c')](_0x1be477[_0x1bfe('0x2b')]);_0x30bbcd[_0x1bfe('0x2d')]=_[_0x1bfe('0x2e')](_0x30bbcd[_0x1bfe('0x2a')],_0x30bbcd['query']);_0x2853ec['attributes']=_[_0x1bfe('0x2e')](_0x30bbcd[_0x1bfe('0x2a')],qs[_0x1bfe('0x40')](_0x1be477['query']['fields']));_0x2853ec[_0x1bfe('0x2f')]=_0x2853ec[_0x1bfe('0x2f')][_0x1bfe('0x30')]?_0x2853ec[_0x1bfe('0x2f')]:_0x30bbcd[_0x1bfe('0x2a')];if(_0x1be477[_0x1bfe('0x2b')][_0x1bfe('0x3b')]){_0x2853ec[_0x1bfe('0x41')]=[{'all':!![]}];}_0x2853ec=_[_0x1bfe('0x37')]({},_0x2853ec,_0x1be477[_0x1bfe('0x39')]);return db[_0x1bfe('0x3c')]['find'](_0x2853ec)['then'](handleEntityNotFound(_0x4263bc,null))['then'](respondWithResult(_0x4263bc,null))[_0x1bfe('0x3e')](handleError(_0x4263bc,null));};exports['create']=function(_0x6e5065,_0x42aca2){return db[_0x1bfe('0x3c')][_0x1bfe('0x42')](_0x6e5065['body'],{})[_0x1bfe('0x3a')](respondWithResult(_0x42aca2,0xc9))[_0x1bfe('0x3e')](handleError(_0x42aca2,null));};exports[_0x1bfe('0x22')]=function(_0x3b7f95,_0x47811c){if(_0x3b7f95['body']['id']){delete _0x3b7f95[_0x1bfe('0x43')]['id'];}return db[_0x1bfe('0x3c')][_0x1bfe('0x44')]({'where':{'id':_0x3b7f95[_0x1bfe('0x45')]['id']}})[_0x1bfe('0x3a')](handleEntityNotFound(_0x47811c,null))[_0x1bfe('0x3a')](saveUpdates(_0x3b7f95['body'],null))['then'](respondWithResult(_0x47811c,null))[_0x1bfe('0x3e')](handleError(_0x47811c,null));};exports['destroy']=function(_0x2a8674,_0x1029e5){return db[_0x1bfe('0x3c')][_0x1bfe('0x44')]({'where':{'id':_0x2a8674[_0x1bfe('0x45')]['id']}})[_0x1bfe('0x3a')](handleEntityNotFound(_0x1029e5,null))['then'](removeEntity(_0x1029e5,null))[_0x1bfe('0x3e')](handleError(_0x1029e5,null));};exports[_0x1bfe('0x46')]=function(_0x2d3d10,_0x47c27a){return db[_0x1bfe('0x3c')]['describe']()[_0x1bfe('0x3a')](respondWithResult(_0x47c27a,null))[_0x1bfe('0x3e')](handleError(_0x47c27a,null));};
\ No newline at end of file
+var _0xba3f=['update','then','destroy','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','ChatTransferReport','includeAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save'];(function(_0xc578c,_0x38811e){var _0x5d5138=function(_0x293452){while(--_0x293452){_0xc578c['push'](_0xc578c['shift']());}};_0x5d5138(++_0x38811e);}(_0xba3f,0x1b1));var _0xfba3=function(_0x2a9b7a,_0x4ef939){_0x2a9b7a=_0x2a9b7a-0x0;var _0x6284d8=_0xba3f[_0x2a9b7a];return _0x6284d8;};'use strict';var emlformat=require(_0xfba3('0x0'));var rimraf=require(_0xfba3('0x1'));var zipdir=require(_0xfba3('0x2'));var jsonpatch=require(_0xfba3('0x3'));var rp=require(_0xfba3('0x4'));var moment=require(_0xfba3('0x5'));var BPromise=require(_0xfba3('0x6'));var Mustache=require(_0xfba3('0x7'));var util=require(_0xfba3('0x8'));var path=require(_0xfba3('0x9'));var sox=require(_0xfba3('0xa'));var csv=require(_0xfba3('0xb'));var ejs=require(_0xfba3('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfba3('0xd'));var crypto=require(_0xfba3('0xe'));var jsforce=require(_0xfba3('0xf'));var deskjs=require(_0xfba3('0x10'));var toCsv=require(_0xfba3('0xb'));var querystring=require(_0xfba3('0x11'));var Papa=require('papaparse');var Redis=require(_0xfba3('0x12'));var authService=require(_0xfba3('0x13'));var qs=require(_0xfba3('0x14'));var as=require(_0xfba3('0x15'));var hardwareService=require(_0xfba3('0x16'));var logger=require(_0xfba3('0x17'))(_0xfba3('0x18'));var utils=require('../../config/utils');var config=require(_0xfba3('0x19'));var licenseUtil=require(_0xfba3('0x1a'));var db=require(_0xfba3('0x1b'))['db'];function respondWithStatusCode(_0x39341e,_0x378ee8){_0x378ee8=_0x378ee8||0xcc;return function(_0x1ded02){if(_0x1ded02){return _0x39341e[_0xfba3('0x1c')](_0x378ee8);}return _0x39341e[_0xfba3('0x1d')](_0x378ee8)[_0xfba3('0x1e')]();};}function respondWithResult(_0x189193,_0x4bf699){_0x4bf699=_0x4bf699||0xc8;return function(_0x52d9be){if(_0x52d9be){return _0x189193[_0xfba3('0x1d')](_0x4bf699)['json'](_0x52d9be);}};}function respondWithFilteredResult(_0x6db07a,_0x5962aa){return function(_0x230027){if(_0x230027){var _0x243351=typeof _0x5962aa['offset']===_0xfba3('0x1f')&&typeof _0x5962aa[_0xfba3('0x20')]===_0xfba3('0x1f');var _0x34e76d=_0x230027[_0xfba3('0x21')];var _0x6edfba=_0x243351?0x0:_0x5962aa[_0xfba3('0x22')];var _0x49aa44=_0x243351?_0x230027[_0xfba3('0x21')]:_0x5962aa['offset']+_0x5962aa['limit'];var _0x273c14;if(_0x49aa44>=_0x34e76d){_0x49aa44=_0x34e76d;_0x273c14=0xc8;}else{_0x273c14=0xce;}_0x6db07a[_0xfba3('0x1d')](_0x273c14);return _0x6db07a[_0xfba3('0x23')](_0xfba3('0x24'),_0x6edfba+'-'+_0x49aa44+'/'+_0x34e76d)[_0xfba3('0x25')](_0x230027);}return null;};}function patchUpdates(_0x46a926){return function(_0x4939be){try{jsonpatch[_0xfba3('0x26')](_0x4939be,_0x46a926,!![]);}catch(_0x32895f){return BPromise[_0xfba3('0x27')](_0x32895f);}return _0x4939be[_0xfba3('0x28')]();};}function saveUpdates(_0x6816e4,_0xee5bdc){return function(_0x571367){if(_0x571367){return _0x571367[_0xfba3('0x29')](_0x6816e4)[_0xfba3('0x2a')](function(_0x14e400){return _0x14e400;});}return null;};}function removeEntity(_0x1cdc7a,_0x2f698c){return function(_0xd53651){if(_0xd53651){return _0xd53651[_0xfba3('0x2b')]()['then'](function(){_0x1cdc7a[_0xfba3('0x1d')](0xcc)[_0xfba3('0x1e')]();});}};}function handleEntityNotFound(_0x4c258f,_0x1402ef){return function(_0x49a13e){if(!_0x49a13e){_0x4c258f[_0xfba3('0x1c')](0x194);}return _0x49a13e;};}function handleError(_0x3cc79d,_0x547b2c){_0x547b2c=_0x547b2c||0x1f4;return function(_0x4034aa){logger['error'](_0x4034aa[_0xfba3('0x2c')]);if(_0x4034aa[_0xfba3('0x2d')]){delete _0x4034aa[_0xfba3('0x2d')];}_0x3cc79d['status'](_0x547b2c)[_0xfba3('0x2e')](_0x4034aa);};}exports['index']=function(_0x226815,_0x5d227d){var _0x2c616d={},_0x50fe36={},_0x1d5cc7={'count':0x0,'rows':[]};var _0x5ddb22=_[_0xfba3('0x2f')](db['ChatTransferReport'][_0xfba3('0x30')],function(_0x1e210f){return{'name':_0x1e210f['fieldName'],'type':_0x1e210f[_0xfba3('0x31')][_0xfba3('0x32')]};});_0x50fe36['model']=_[_0xfba3('0x2f')](_0x5ddb22,_0xfba3('0x2d'));_0x50fe36[_0xfba3('0x33')]=_[_0xfba3('0x34')](_0x226815[_0xfba3('0x33')]);_0x50fe36[_0xfba3('0x35')]=_[_0xfba3('0x36')](_0x50fe36[_0xfba3('0x37')],_0x50fe36[_0xfba3('0x33')]);_0x2c616d[_0xfba3('0x38')]=_['intersection'](_0x50fe36[_0xfba3('0x37')],qs[_0xfba3('0x39')](_0x226815[_0xfba3('0x33')]['fields']));_0x2c616d[_0xfba3('0x38')]=_0x2c616d[_0xfba3('0x38')][_0xfba3('0x3a')]?_0x2c616d[_0xfba3('0x38')]:_0x50fe36['model'];if(!_0x226815[_0xfba3('0x33')][_0xfba3('0x3b')](_0xfba3('0x3c'))){_0x2c616d[_0xfba3('0x20')]=qs['limit'](_0x226815[_0xfba3('0x33')][_0xfba3('0x20')]);_0x2c616d['offset']=qs[_0xfba3('0x22')](_0x226815[_0xfba3('0x33')][_0xfba3('0x22')]);}_0x2c616d[_0xfba3('0x3d')]=qs['sort'](_0x226815['query'][_0xfba3('0x3e')]);_0x2c616d['where']=qs[_0xfba3('0x35')](_['pick'](_0x226815[_0xfba3('0x33')],_0x50fe36[_0xfba3('0x35')]),_0x5ddb22);if(_0x226815[_0xfba3('0x33')][_0xfba3('0x3f')]){_0x2c616d[_0xfba3('0x40')]=_[_0xfba3('0x41')](_0x2c616d[_0xfba3('0x40')],{'$or':_['map'](_0x5ddb22,function(_0x194004){if(_0x194004[_0xfba3('0x31')]!==_0xfba3('0x42')){var _0x2338a9={};_0x2338a9[_0x194004[_0xfba3('0x2d')]]={'$like':'%'+_0x226815['query']['filter']+'%'};return _0x2338a9;}})});}_0x2c616d=_[_0xfba3('0x41')]({},_0x2c616d,_0x226815['options']);var _0x58ba35={'where':_0x2c616d[_0xfba3('0x40')]};return db[_0xfba3('0x43')][_0xfba3('0x21')](_0x58ba35)['then'](function(_0x1dc6a9){_0x1d5cc7['count']=_0x1dc6a9;if(_0x226815['query'][_0xfba3('0x44')]){_0x2c616d['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2c616d);})[_0xfba3('0x2a')](function(_0x1b57cc){_0x1d5cc7[_0xfba3('0x45')]=_0x1b57cc;return _0x1d5cc7;})['then'](respondWithFilteredResult(_0x5d227d,_0x2c616d))[_0xfba3('0x46')](handleError(_0x5d227d,null));};exports[_0xfba3('0x47')]=function(_0x3f8729,_0x1d37cb){var _0x371026={'raw':!![],'where':{'id':_0x3f8729[_0xfba3('0x48')]['id']}},_0x3fcea8={};_0x3fcea8[_0xfba3('0x37')]=_[_0xfba3('0x34')](db[_0xfba3('0x43')][_0xfba3('0x30')]);_0x3fcea8['query']=_[_0xfba3('0x34')](_0x3f8729['query']);_0x3fcea8['filters']=_[_0xfba3('0x36')](_0x3fcea8[_0xfba3('0x37')],_0x3fcea8['query']);_0x371026['attributes']=_[_0xfba3('0x36')](_0x3fcea8[_0xfba3('0x37')],qs[_0xfba3('0x39')](_0x3f8729[_0xfba3('0x33')][_0xfba3('0x39')]));_0x371026[_0xfba3('0x38')]=_0x371026[_0xfba3('0x38')][_0xfba3('0x3a')]?_0x371026[_0xfba3('0x38')]:_0x3fcea8['model'];if(_0x3f8729['query']['includeAll']){_0x371026[_0xfba3('0x49')]=[{'all':!![]}];}_0x371026=_[_0xfba3('0x41')]({},_0x371026,_0x3f8729[_0xfba3('0x4a')]);return db[_0xfba3('0x43')][_0xfba3('0x4b')](_0x371026)[_0xfba3('0x2a')](handleEntityNotFound(_0x1d37cb,null))[_0xfba3('0x2a')](respondWithResult(_0x1d37cb,null))[_0xfba3('0x46')](handleError(_0x1d37cb,null));};exports[_0xfba3('0x4c')]=function(_0xda8e97,_0x72798d){return db['ChatTransferReport'][_0xfba3('0x4c')](_0xda8e97[_0xfba3('0x4d')],{})[_0xfba3('0x2a')](respondWithResult(_0x72798d,0xc9))[_0xfba3('0x46')](handleError(_0x72798d,null));};exports[_0xfba3('0x29')]=function(_0x3da874,_0x3eaf29){if(_0x3da874[_0xfba3('0x4d')]['id']){delete _0x3da874['body']['id'];}return db[_0xfba3('0x43')][_0xfba3('0x4b')]({'where':{'id':_0x3da874[_0xfba3('0x48')]['id']}})[_0xfba3('0x2a')](handleEntityNotFound(_0x3eaf29,null))[_0xfba3('0x2a')](saveUpdates(_0x3da874[_0xfba3('0x4d')],null))['then'](respondWithResult(_0x3eaf29,null))[_0xfba3('0x46')](handleError(_0x3eaf29,null));};exports[_0xfba3('0x2b')]=function(_0x36cb65,_0xad9269){return db['ChatTransferReport'][_0xfba3('0x4b')]({'where':{'id':_0x36cb65['params']['id']}})[_0xfba3('0x2a')](handleEntityNotFound(_0xad9269,null))[_0xfba3('0x2a')](removeEntity(_0xad9269,null))[_0xfba3('0x46')](handleError(_0xad9269,null));};exports['describe']=function(_0x1c1272,_0xf57125){return db[_0xfba3('0x43')][_0xfba3('0x4e')]()[_0xfba3('0x2a')](respondWithResult(_0xf57125,null))[_0xfba3('0x46')](handleError(_0xf57125,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 4c3bff3..b65ef8f 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 _0xac23=['path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','lodash','util','api','moment','request-promise'];(function(_0x242460,_0x236a05){var _0x3c5d7a=function(_0x52a030){while(--_0x52a030){_0x242460['push'](_0x242460['shift']());}};_0x3c5d7a(++_0x236a05);}(_0xac23,0x1be));var _0x3ac2=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xac23[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x3ac2('0x0'));var util=require(_0x3ac2('0x1'));var logger=require('../../config/logger')(_0x3ac2('0x2'));var moment=require(_0x3ac2('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ac2('0x4'));var fs=require('fs');var path=require(_0x3ac2('0x5'));var rimraf=require(_0x3ac2('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ac2('0x7'));module[_0x3ac2('0x8')]=function(_0x1ce000,_0x37fa03){return _0x1ce000['define'](_0x3ac2('0x9'),attributes,{'tableName':_0x3ac2('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf94e=['path','rimraf','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x230b70,_0x5b3c8c){var _0x36164e=function(_0x28a4b2){while(--_0x28a4b2){_0x230b70['push'](_0x230b70['shift']());}};_0x36164e(++_0x5b3c8c);}(_0xf94e,0x1dc));var _0xef94=function(_0x28b034,_0x5ca737){_0x28b034=_0x28b034-0x0;var _0x146c73=_0xf94e[_0x28b034];return _0x146c73;};'use strict';var _=require(_0xef94('0x0'));var util=require(_0xef94('0x1'));var logger=require(_0xef94('0x2'))(_0xef94('0x3'));var moment=require('moment');var BPromise=require(_0xef94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef94('0x5'));var rimraf=require(_0xef94('0x6'));var config=require(_0xef94('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xef94('0x8')]=function(_0x557ea2,_0x4b7d5){return _0x557ea2[_0xef94('0x9')](_0xef94('0xa'),attributes,{'tableName':_0xef94('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xef94('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index b5a6acb..f6b5f75 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 _0x5bf8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x34fb63,_0x37056e){var _0x31dec3=function(_0x5b37f1){while(--_0x5b37f1){_0x34fb63['push'](_0x34fb63['shift']());}};_0x31dec3(++_0x37056e);}(_0x5bf8,0x84));var _0x85bf=function(_0x7eee7,_0x3779a1){_0x7eee7=_0x7eee7-0x0;var _0x469f62=_0x5bf8[_0x7eee7];return _0x469f62;};'use strict';var _=require(_0x85bf('0x0'));var util=require(_0x85bf('0x1'));var moment=require(_0x85bf('0x2'));var BPromise=require(_0x85bf('0x3'));var rs=require(_0x85bf('0x4'));var fs=require('fs');var Redis=require(_0x85bf('0x5'));var db=require(_0x85bf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x85bf('0x7'))(_0x85bf('0x8'));var config=require(_0x85bf('0x9'));var jayson=require(_0x85bf('0xa'));var client=jayson[_0x85bf('0xb')][_0x85bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x556347,_0x2d8d60,_0x175d4c){return new BPromise(function(_0x121229,_0x5ec41c){return client[_0x85bf('0xd')](_0x556347,_0x175d4c)[_0x85bf('0xe')](function(_0x1e4d4a){logger[_0x85bf('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2d8d60,_0x85bf('0x10'));logger[_0x85bf('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2d8d60,'request\x20sent',JSON[_0x85bf('0x12')](_0x1e4d4a));if(_0x1e4d4a[_0x85bf('0x13')]){if(_0x1e4d4a[_0x85bf('0x13')][_0x85bf('0x14')]===0x1f4){logger[_0x85bf('0x13')](_0x85bf('0x15'),_0x2d8d60,_0x1e4d4a['error'][_0x85bf('0x16')]);return _0x5ec41c(_0x1e4d4a['error'][_0x85bf('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2d8d60,_0x1e4d4a[_0x85bf('0x13')]['message']);return _0x121229(_0x1e4d4a[_0x85bf('0x13')][_0x85bf('0x16')]);}else{logger[_0x85bf('0xf')](_0x85bf('0x15'),_0x2d8d60,'request\x20sent');_0x121229(_0x1e4d4a['result'][_0x85bf('0x16')]);}})['catch'](function(_0x2fbd83){logger[_0x85bf('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x2d8d60,_0x2fbd83);_0x5ec41c(_0x2fbd83);});});}
\ No newline at end of file
+var _0x469f=['request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5b62df,_0x235c6f){var _0x5692f2=function(_0x10bf6c){while(--_0x10bf6c){_0x5b62df['push'](_0x5b62df['shift']());}};_0x5692f2(++_0x235c6f);}(_0x469f,0x1ae));var _0xf469=function(_0x34b14d,_0x3064aa){_0x34b14d=_0x34b14d-0x0;var _0x1593ea=_0x469f[_0x34b14d];return _0x1593ea;};'use strict';var _=require(_0xf469('0x0'));var util=require(_0xf469('0x1'));var moment=require(_0xf469('0x2'));var BPromise=require('bluebird');var rs=require(_0xf469('0x3'));var fs=require('fs');var Redis=require(_0xf469('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf469('0x5'));var logger=require(_0xf469('0x6'))(_0xf469('0x7'));var config=require(_0xf469('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf469('0x9')][_0xf469('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd73aba,_0x34de56,_0x1b6fb5){return new BPromise(function(_0x1a94a3,_0xfacadf){return client[_0xf469('0xb')](_0xd73aba,_0x1b6fb5)['then'](function(_0x19d4aa){logger['info'](_0xf469('0xc'),_0x34de56,_0xf469('0xd'));logger[_0xf469('0xe')](_0xf469('0xf'),_0x34de56,_0xf469('0xd'),JSON[_0xf469('0x10')](_0x19d4aa));if(_0x19d4aa[_0xf469('0x11')]){if(_0x19d4aa['error']['code']===0x1f4){logger[_0xf469('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x34de56,_0x19d4aa['error'][_0xf469('0x12')]);return _0xfacadf(_0x19d4aa[_0xf469('0x11')][_0xf469('0x12')]);}logger[_0xf469('0x11')](_0xf469('0xc'),_0x34de56,_0x19d4aa['error'][_0xf469('0x12')]);return _0x1a94a3(_0x19d4aa['error'][_0xf469('0x12')]);}else{logger[_0xf469('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x34de56,_0xf469('0xd'));_0x1a94a3(_0x19d4aa[_0xf469('0x14')]['message']);}})['catch'](function(_0x20bab0){logger['error'](_0xf469('0xc'),_0x34de56,_0x20bab0);_0xfacadf(_0x20bab0);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9879727..54d93d8 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 _0x3281=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','update','delete','/:id','exports','multer','util'];(function(_0x35f9dc,_0x20569c){var _0x6502dd=function(_0x5f0740){while(--_0x5f0740){_0x35f9dc['push'](_0x35f9dc['shift']());}};_0x6502dd(++_0x20569c);}(_0x3281,0x185));var _0x1328=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3281[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x1328('0x0'));var util=require(_0x1328('0x1'));var path=require('path');var timeout=require(_0x1328('0x2'));var express=require(_0x1328('0x3'));var router=express[_0x1328('0x4')]();var fs_extra=require(_0x1328('0x5'));var auth=require(_0x1328('0x6'));var interaction=require(_0x1328('0x7'));var config=require(_0x1328('0x8'));var controller=require(_0x1328('0x9'));router[_0x1328('0xa')]('/',auth['isAuthenticated'](),controller[_0x1328('0xb')]);router[_0x1328('0xa')](_0x1328('0xc'),auth[_0x1328('0xd')](),controller[_0x1328('0xe')]);router[_0x1328('0xa')]('/:id',auth[_0x1328('0xd')](),controller[_0x1328('0xf')]);router[_0x1328('0x10')]('/',auth[_0x1328('0xd')](),controller[_0x1328('0x11')]);router[_0x1328('0x12')]('/:id',auth[_0x1328('0xd')](),controller[_0x1328('0x13')]);router[_0x1328('0x14')](_0x1328('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x1328('0x16')]=router;
\ No newline at end of file
+var _0xc407=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xc407,0x17e));var _0x7c40=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0xc407[_0x1db481];return _0x3db95b;};'use strict';var multer=require(_0x7c40('0x0'));var util=require('util');var path=require(_0x7c40('0x1'));var timeout=require(_0x7c40('0x2'));var express=require(_0x7c40('0x3'));var router=express[_0x7c40('0x4')]();var fs_extra=require(_0x7c40('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7c40('0x6'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7c40('0x7'),auth[_0x7c40('0x8')](),controller[_0x7c40('0x9')]);router[_0x7c40('0xa')](_0x7c40('0xb'),auth[_0x7c40('0x8')](),controller[_0x7c40('0xc')]);router[_0x7c40('0xd')]('/',auth[_0x7c40('0x8')](),controller[_0x7c40('0xe')]);router[_0x7c40('0xf')](_0x7c40('0xb'),auth[_0x7c40('0x8')](),controller[_0x7c40('0x10')]);router[_0x7c40('0x11')]('/:id',auth[_0x7c40('0x8')](),controller[_0x7c40('0x12')]);module[_0x7c40('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index f7a3dfd..3756e57 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 _0x9fd4=['name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','thumb','star','input'];(function(_0x39d980,_0x15c127){var _0x33fcbc=function(_0x32548a){while(--_0x32548a){_0x39d980['push'](_0x39d980['shift']());}};_0x33fcbc(++_0x15c127);}(_0x9fd4,0xd6));var _0x49fd=function(_0x29d34a,_0x3632d9){_0x29d34a=_0x29d34a-0x0;var _0x4baaa8=_0x9fd4[_0x29d34a];return _0x4baaa8;};'use strict';var Sequelize=require(_0x49fd('0x0'));var rs=require(_0x49fd('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'unique':_0x49fd('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x4')},'mapKeyOffline':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x4')},'key':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x5')},'customerAlias':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49fd('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x49fd('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x49fd('0x2')]},'animation':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x49fd('0x9'),_0x49fd('0xa')),'defaultValue':_0x49fd('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x49fd('0xb')},'start_chat_button':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xc')},'offline_chat_button':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xd')},'header_offline':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x49fd('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x11')},'noteTitle':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x12')},'placeholderMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x13')},'closingMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xd')},'skipMessageButton':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x14')},'conditionAgreement':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x15')},'ratingType':{'type':Sequelize[_0x49fd('0x16')]('star',_0x49fd('0x17')),'defaultValue':_0x49fd('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x49fd('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x49fd('0x19'),'variable':null,'config':{'placeholder':_0x49fd('0x1a'),'type':_0x49fd('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x49fd('0x19'),'props':{'title':_0x49fd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x49fd('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x49fd('0x1c')](_0x49fd('0x1d'))?JSON[_0x49fd('0x1e')](this[_0x49fd('0x1c')](_0x49fd('0x1d'))):{};},'set':function(_0x44a808){return this[_0x49fd('0x1f')](_0x49fd('0x1d'),JSON[_0x49fd('0x20')](_0x44a808));}},'offlineForm':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':function(){return JSON[_0x49fd('0x20')]({'items':[{'type':'input','props':{'title':_0x49fd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x49fd('0x4'),'type':_0x49fd('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x49fd('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x49fd('0x1c')]('offlineForm')?JSON[_0x49fd('0x1e')](this[_0x49fd('0x1c')](_0x49fd('0x22'))):{};},'set':function(_0x3853ee){return this[_0x49fd('0x1f')](_0x49fd('0x22'),JSON[_0x49fd('0x20')](_0x3853ee));}},'token':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':function(){return rs[_0x49fd('0x23')]();}},'autoclose':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x49fd('0x2')]},'forwardOffline':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x49fd('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x24')},'offlineMessageBody':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x49fd('0x14')},'sendUnmanaged':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x49fd('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x49fd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':function(){return _0x49fd('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x49fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x49fd('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x49fd('0x2')]},'customerAvatar':{'type':Sequelize[_0x49fd('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x49fd('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'defaultValue':_0x49fd('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x49fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x49fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x2b')},'systemAvatar':{'type':Sequelize[_0x49fd('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x49fd('0x7')],'comment':_0x49fd('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![],'comment':_0x49fd('0x2d'),'set':function(_0x41c35b){if(!_0x41c35b)this[_0x49fd('0x1f')]('mandatoryDispositionPauseId',null);this[_0x49fd('0x1f')](_0x49fd('0x2e'),_0x41c35b);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x49fd('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49fd('0x2f')},'vidaooNote':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x49fd('0xf')]}};
\ No newline at end of file
+var _0xd108=['Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#ffffff','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','BOOLEAN','Feedback','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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'];(function(_0x4e71df,_0x33c491){var _0x300c14=function(_0x426530){while(--_0x426530){_0x4e71df['push'](_0x4e71df['shift']());}};_0x300c14(++_0x33c491);}(_0xd108,0x71));var _0x8d10=function(_0x2f48e9,_0x1bd1b4){_0x2f48e9=_0x2f48e9-0x0;var _0x34d5bb=_0xd108[_0x2f48e9];return _0x34d5bb;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x8d10('0x0')]={'name':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![],'unique':_0x8d10('0x2')},'description':{'type':Sequelize[_0x8d10('0x1')]},'mapKey':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x3')},'key':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x4')},'customerAlias':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![],'defaultValue':_0x8d10('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8d10('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8d10('0x6')](_0x8d10('0x7'),_0x8d10('0x8')),'defaultValue':_0x8d10('0x7')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x9')},'start_chat_button':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0xb')},'header_offline':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x8d10('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8d10('0xf')]},'closingQuestion':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x13')},'closingMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8d10('0x14')},'conditionAgreement':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x16')},'ratingType':{'type':Sequelize[_0x8d10('0x6')](_0x8d10('0x17'),_0x8d10('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':function(){return JSON[_0x8d10('0x19')]({'items':[{'type':_0x8d10('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0x8d10('0x1b'),'required':!![]},'props':{'title':_0x8d10('0x1c'),'helpText':''}},{'type':_0x8d10('0x1a'),'props':{'title':_0x8d10('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x8d10('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8d10('0x1d')](_0x8d10('0x1e'))?JSON[_0x8d10('0x1f')](this[_0x8d10('0x1d')](_0x8d10('0x1e'))):{};},'set':function(_0x49c188){return this[_0x8d10('0x20')]('onlineForm',JSON[_0x8d10('0x19')](_0x49c188));}},'offlineForm':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':function(){return JSON[_0x8d10('0x19')]({'items':[{'type':_0x8d10('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8d10('0x3'),'type':_0x8d10('0x3')},'variable':null},{'type':_0x8d10('0x21'),'config':{'placeholder':_0x8d10('0x22')},'props':{'title':_0x8d10('0x22'),'helpText':_0x8d10('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x8d10('0x1f')](this[_0x8d10('0x1d')](_0x8d10('0x24'))):{};},'set':function(_0x431bdf){return this['setDataValue'](_0x8d10('0x24'),JSON['stringify'](_0x431bdf));}},'token':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8d10('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8d10('0x1')]},'waitingTitle':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x25')},'waitingMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x27')},'offlineMessageBody':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x28')},'skipUnmanaged':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x8d10('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':function(){return _0x8d10('0x29');}},'notificationSound':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8d10('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x2b')},'verticalAlignment':{'type':Sequelize[_0x8d10('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':_0x8d10('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x8d10('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8d10('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8d10('0x1')],'allowNull':![],'defaultValue':_0x8d10('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8d10('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x8d10('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8d10('0xd')],'comment':_0x8d10('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![],'comment':_0x8d10('0x2f'),'set':function(_0x377f9f){if(!_0x377f9f)this[_0x8d10('0x20')](_0x8d10('0x30'),null);this[_0x8d10('0x20')](_0x8d10('0x31'),_0x377f9f);}},'vidaooEscalation':{'type':Sequelize[_0x8d10('0x15')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8d10('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x8d10('0x1')],'defaultValue':function(){return _0x8d10('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x8d10('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 8d139c5..593f11e 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 _0x606d=['status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','addLogo','sitepic','file','addAvatar','agentAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','files','send','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','ONLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','textColor','backgroundColor','addApplications','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus'];(function(_0xa0cd21,_0x2be706){var _0x34a84e=function(_0x3cbf1b){while(--_0x3cbf1b){_0xa0cd21['push'](_0xa0cd21['shift']());}};_0x34a84e(++_0x2be706);}(_0x606d,0x107));var _0xd606=function(_0x4f9691,_0x1f484d){_0x4f9691=_0x4f9691-0x0;var _0x57db23=_0x606d[_0x4f9691];return _0x57db23;};'use strict';var emlformat=require(_0xd606('0x0'));var rimraf=require(_0xd606('0x1'));var zipdir=require(_0xd606('0x2'));var jsonpatch=require(_0xd606('0x3'));var rp=require(_0xd606('0x4'));var moment=require('moment');var BPromise=require(_0xd606('0x5'));var Mustache=require('mustache');var util=require(_0xd606('0x6'));var path=require(_0xd606('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd606('0x8'));var fs=require('fs');var fs_extra=require(_0xd606('0x9'));var _=require(_0xd606('0xa'));var squel=require(_0xd606('0xb'));var crypto=require(_0xd606('0xc'));var jsforce=require(_0xd606('0xd'));var deskjs=require(_0xd606('0xe'));var toCsv=require(_0xd606('0xf'));var querystring=require(_0xd606('0x10'));var Papa=require('papaparse');var Redis=require(_0xd606('0x11'));var authService=require(_0xd606('0x12'));var qs=require(_0xd606('0x13'));var as=require(_0xd606('0x14'));var hardwareService=require(_0xd606('0x15'));var logger=require(_0xd606('0x16'))(_0xd606('0x17'));var utils=require(_0xd606('0x18'));var config=require(_0xd606('0x19'));var licenseUtil=require(_0xd606('0x1a'));var db=require(_0xd606('0x1b'))['db'];config[_0xd606('0x1c')]=_['defaults'](config[_0xd606('0x1c')],{'host':_0xd606('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd606('0x1e'))[_0xd606('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd606('0x20')][_0xd606('0x21')]({'port':0x232c});var client9002=jayson[_0xd606('0x20')][_0xd606('0x21')]({'port':0x232a});var client9003=jayson[_0xd606('0x20')]['http']({'port':0x232b});var client9001=jayson['client'][_0xd606('0x21')]({'port':0x2329});function respondWithRpcPromise(_0xe6cde1,_0x5d0634,_0x410340,_0x2432c1){return new BPromise(function(_0x4ed9e3,_0x1a1486){var _0xa93e86=_0x2432c1||client;return _0xa93e86[_0xd606('0x22')](_0xe6cde1,_0x410340)[_0xd606('0x23')](function(_0x16efc4){logger[_0xd606('0x24')](_0xd606('0x25'),_0x5d0634,_0xd606('0x26'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5d0634,_0xd606('0x26'),JSON[_0xd606('0x27')](_0x16efc4));if(_0x16efc4[_0xd606('0x28')]){if(_0x16efc4[_0xd606('0x28')][_0xd606('0x29')]===0x1f4){logger[_0xd606('0x28')](_0xd606('0x25'),_0x5d0634,_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);return _0x1a1486(_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);}logger['error'](_0xd606('0x25'),_0x5d0634,_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);return _0x4ed9e3(_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);}else{logger['info'](_0xd606('0x25'),_0x5d0634,'request\x20sent');_0x4ed9e3(_0x16efc4[_0xd606('0x2b')]['message']);}})[_0xd606('0x2c')](function(_0x4ac1e2){logger[_0xd606('0x28')](_0xd606('0x25'),_0x5d0634,_0x4ac1e2);_0x1a1486(_0x4ac1e2);});});}function respondWithStatusCode(_0x40ee07,_0x8bd17f){_0x8bd17f=_0x8bd17f||0xcc;return function(_0x3e5f7d){if(_0x3e5f7d){return _0x40ee07[_0xd606('0x2d')](_0x8bd17f);}return _0x40ee07[_0xd606('0x2e')](_0x8bd17f)[_0xd606('0x2f')]();};}function respondWithResult(_0x3a0c75,_0x293bdb){_0x293bdb=_0x293bdb||0xc8;return function(_0x3321c5){if(_0x3321c5){return _0x3a0c75[_0xd606('0x2e')](_0x293bdb)[_0xd606('0x30')](_0x3321c5);}};}function respondWithFilteredResult(_0x548525,_0x36bc88){return function(_0x4f8081){if(_0x4f8081){var _0x429602=typeof _0x36bc88[_0xd606('0x31')]==='undefined'&&typeof _0x36bc88[_0xd606('0x32')]===_0xd606('0x33');var _0x4c665b=_0x4f8081[_0xd606('0x34')];var _0x3d71ce=_0x429602?0x0:_0x36bc88['offset'];var _0x12ea61=_0x429602?_0x4f8081[_0xd606('0x34')]:_0x36bc88['offset']+_0x36bc88[_0xd606('0x32')];var _0x5440f9;if(_0x12ea61>=_0x4c665b){_0x12ea61=_0x4c665b;_0x5440f9=0xc8;}else{_0x5440f9=0xce;}_0x548525[_0xd606('0x2e')](_0x5440f9);return _0x548525['set'](_0xd606('0x35'),_0x3d71ce+'-'+_0x12ea61+'/'+_0x4c665b)['json'](_0x4f8081);}return null;};}function patchUpdates(_0x4a01a7){return function(_0x4d81f9){try{jsonpatch[_0xd606('0x36')](_0x4d81f9,_0x4a01a7,!![]);}catch(_0x1db1e8){return BPromise[_0xd606('0x37')](_0x1db1e8);}return _0x4d81f9[_0xd606('0x38')]();};}function saveUpdates(_0x229fa7,_0x4daead){return function(_0x5dcdf8){if(_0x5dcdf8){return _0x5dcdf8[_0xd606('0x39')](_0x229fa7)[_0xd606('0x23')](function(_0x1e8c1e){return _0x1e8c1e;});}return null;};}function removeEntity(_0x56ec00,_0x34a97d){return function(_0x377cd6){if(_0x377cd6){return _0x377cd6[_0xd606('0x3a')]()['then'](function(){var _0x386d09=_0x377cd6['get']({'plain':!![]});var _0xa8a808=_0xd606('0x3b');return db[_0xd606('0x3c')][_0xd606('0x3a')]({'where':{'type':_0xa8a808,'resourceId':_0x386d09['id']}})[_0xd606('0x23')](function(){return _0x377cd6;});})['then'](function(){_0x56ec00['status'](0xcc)[_0xd606('0x2f')]();});}};}function handleEntityNotFound(_0xfc807e,_0x39e356){return function(_0x4f89ab){if(!_0x4f89ab){_0xfc807e[_0xd606('0x2d')](0x194);}return _0x4f89ab;};}function handleError(_0x270646,_0x339d65){_0x339d65=_0x339d65||0x1f4;return function(_0x184bfc){logger[_0xd606('0x28')](_0x184bfc['stack']);if(_0x184bfc['name']){delete _0x184bfc[_0xd606('0x3d')];}_0x270646[_0xd606('0x2e')](_0x339d65)['send'](_0x184bfc);};}exports[_0xd606('0x3e')]=function(_0x4800f5,_0x559716){var _0x2e3ecc={'include':[{'model':db[_0xd606('0x3f')],'as':_0xd606('0x40')}]},_0x558148={},_0xfac3b1={'count':0x0,'rows':[]};var _0x903811=_[_0xd606('0x41')](db[_0xd606('0x42')][_0xd606('0x43')],function(_0x3690c3){return{'name':_0x3690c3[_0xd606('0x44')],'type':_0x3690c3[_0xd606('0x45')][_0xd606('0x46')]};});_0x558148['model']=_[_0xd606('0x41')](_0x903811,_0xd606('0x3d'));_0x558148[_0xd606('0x47')]=_[_0xd606('0x48')](_0x4800f5[_0xd606('0x47')]);_0x558148[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x558148['model'],_0x558148[_0xd606('0x47')]);_0x2e3ecc[_0xd606('0x4b')]=_[_0xd606('0x4a')](_0x558148[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x4800f5[_0xd606('0x47')][_0xd606('0x4d')]));_0x2e3ecc['attributes']=_0x2e3ecc[_0xd606('0x4b')][_0xd606('0x4e')]?_0x2e3ecc[_0xd606('0x4b')]:_0x558148[_0xd606('0x4c')];if(!_0x4800f5[_0xd606('0x47')][_0xd606('0x4f')](_0xd606('0x50'))){_0x2e3ecc[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x4800f5['query'][_0xd606('0x32')]);_0x2e3ecc[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x4800f5[_0xd606('0x47')][_0xd606('0x31')]);}_0x2e3ecc[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x4800f5['query']['sort']);_0x2e3ecc[_0xd606('0x53')]=qs[_0xd606('0x49')](_['pick'](_0x4800f5['query'],_0x558148[_0xd606('0x49')]),_0x903811);if(_0x4800f5[_0xd606('0x47')][_0xd606('0x54')]){_0x2e3ecc[_0xd606('0x53')]=_[_0xd606('0x55')](_0x2e3ecc[_0xd606('0x53')],{'$or':_['map'](_0x903811,function(_0x2648c0){if(_0x2648c0['type']!==_0xd606('0x56')){var _0x2efefe={};_0x2efefe[_0x2648c0[_0xd606('0x3d')]]={'$like':'%'+_0x4800f5[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x2efefe;}})});}_0x2e3ecc=_[_0xd606('0x55')]({},_0x2e3ecc,_0x4800f5[_0xd606('0x57')]);var _0x1cf9b4={'where':_0x2e3ecc[_0xd606('0x53')]};return db[_0xd606('0x42')][_0xd606('0x34')](_0x1cf9b4)[_0xd606('0x23')](function(_0x19ef69){_0xfac3b1[_0xd606('0x34')]=_0x19ef69;if(_0x4800f5[_0xd606('0x47')][_0xd606('0x58')]){_0x2e3ecc[_0xd606('0x59')]=[{'all':!![]}];}return db[_0xd606('0x42')][_0xd606('0x5a')](_0x2e3ecc);})['then'](function(_0x1e9654){_0xfac3b1[_0xd606('0x5b')]=_0x1e9654;return _0xfac3b1;})[_0xd606('0x23')](respondWithFilteredResult(_0x559716,_0x2e3ecc))[_0xd606('0x2c')](handleError(_0x559716,null));};exports['show']=function(_0x25ab59,_0x258c7d){var _0x6d1798={'raw':![],'where':{'id':_0x25ab59[_0xd606('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1328fa={};_0x1328fa[_0xd606('0x4c')]=_['keys'](db[_0xd606('0x42')][_0xd606('0x43')]);_0x1328fa[_0xd606('0x47')]=_[_0xd606('0x48')](_0x25ab59['query']);_0x1328fa[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x1328fa['model'],_0x1328fa[_0xd606('0x47')]);_0x6d1798[_0xd606('0x4b')]=_['intersection'](_0x1328fa[_0xd606('0x4c')],qs['fields'](_0x25ab59[_0xd606('0x47')][_0xd606('0x4d')]));_0x6d1798[_0xd606('0x4b')]=_0x6d1798[_0xd606('0x4b')][_0xd606('0x4e')]?_0x6d1798[_0xd606('0x4b')]:_0x1328fa['model'];if(_0x25ab59['query'][_0xd606('0x58')]){_0x6d1798[_0xd606('0x59')]=[{'all':!![]}];}_0x6d1798=_[_0xd606('0x55')]({},_0x6d1798,_0x25ab59[_0xd606('0x57')]);return db[_0xd606('0x42')][_0xd606('0x5d')](_0x6d1798)[_0xd606('0x23')](handleEntityNotFound(_0x258c7d,null))[_0xd606('0x23')](respondWithResult(_0x258c7d,null))[_0xd606('0x2c')](handleError(_0x258c7d,null));};exports[_0xd606('0x5e')]=function(_0x2818f5,_0x1476e6){return db[_0xd606('0x42')][_0xd606('0x5e')](_0x2818f5[_0xd606('0x5f')],{})['then'](function(_0x30a6e7){var _0x33546d=_0x2818f5[_0xd606('0x60')][_0xd606('0x61')]({'plain':!![]});if(!_0x33546d)throw new Error(_0xd606('0x62'));if(_0x33546d[_0xd606('0x63')]===_0xd606('0x60')){var _0x25d72b=_0x30a6e7[_0xd606('0x61')]({'plain':!![]});var _0x129bb1=_0xd606('0x3b');return db[_0xd606('0x64')][_0xd606('0x5d')]({'where':{'name':_0x129bb1,'userProfileId':_0x33546d[_0xd606('0x65')]},'raw':!![]})['then'](function(_0x3549ef){if(_0x3549ef&&_0x3549ef[_0xd606('0x66')]===0x0){return db[_0xd606('0x3c')]['create']({'name':_0x25d72b[_0xd606('0x3d')],'resourceId':_0x25d72b['id'],'type':_0x3549ef[_0xd606('0x3d')],'sectionId':_0x3549ef['id']},{})[_0xd606('0x23')](function(){return _0x30a6e7;});}else{return _0x30a6e7;}})['catch'](function(_0x559802){logger['error'](_0xd606('0x67'),_0x559802);throw _0x559802;});}return _0x30a6e7;})['then'](respondWithResult(_0x1476e6,0xc9))[_0xd606('0x2c')](handleError(_0x1476e6,null));};exports['update']=function(_0x2cc9f8,_0x14ba36){if(_0x2cc9f8[_0xd606('0x5f')]['id']){delete _0x2cc9f8[_0xd606('0x5f')]['id'];}return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x2cc9f8['params']['id']},'include':[{'model':db['Pause'],'as':_0xd606('0x40')}]})[_0xd606('0x23')](handleEntityNotFound(_0x14ba36,null))[_0xd606('0x23')](saveUpdates(_0x2cc9f8[_0xd606('0x5f')],null))[_0xd606('0x23')](respondWithResult(_0x14ba36,null))['catch'](handleError(_0x14ba36,null));};exports[_0xd606('0x3a')]=function(_0x2be070,_0x221283){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x2be070[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x221283,null))[_0xd606('0x23')](removeEntity(_0x221283,null))[_0xd606('0x2c')](handleError(_0x221283,null));};exports['describe']=function(_0x202fe7,_0x5cc24b){return db[_0xd606('0x42')][_0xd606('0x68')]()['then'](respondWithResult(_0x5cc24b,null))['catch'](handleError(_0x5cc24b,null));};exports[_0xd606('0x69')]=function(_0x310343,_0x57b667,_0x20b3e1){if(_0x310343['body']['id']){delete _0x310343['body']['id'];}return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x310343[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x57b667,null))[_0xd606('0x23')](function(_0x5d0b48){if(_0x5d0b48){_0x310343[_0xd606('0x5f')][_0xd606('0x6a')]=_0x5d0b48['id'];return db[_0xd606('0x6b')][_0xd606('0x5e')](_0x310343['body']);}})[_0xd606('0x23')](respondWithResult(_0x57b667,null))[_0xd606('0x2c')](handleError(_0x57b667,null));};exports[_0xd606('0x6c')]=function(_0x43ab3f,_0x4a551e,_0x5d4d34){var _0x38a1f4={'raw':![],'where':{}};var _0x21f355={};var _0x159242={'count':0x0,'rows':[]};return db[_0xd606('0x42')]['findOne']({'where':{'id':_0x43ab3f[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x4a551e,null))['then'](function(_0xcf3d62){if(_0xcf3d62){_0x21f355['model']=_[_0xd606('0x48')](db[_0xd606('0x6b')][_0xd606('0x43')]);_0x21f355[_0xd606('0x47')]=_[_0xd606('0x48')](_0x43ab3f[_0xd606('0x47')]);_0x21f355[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x21f355[_0xd606('0x4c')],_0x21f355[_0xd606('0x47')]);_0x38a1f4['attributes']=_[_0xd606('0x4a')](_0x21f355[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x43ab3f['query'][_0xd606('0x4d')]));_0x38a1f4[_0xd606('0x4b')]=_0x38a1f4[_0xd606('0x4b')][_0xd606('0x4e')]?_0x38a1f4[_0xd606('0x4b')]:_0x21f355[_0xd606('0x4c')];if(!_0x43ab3f['query']['hasOwnProperty'](_0xd606('0x50'))){_0x38a1f4[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x43ab3f[_0xd606('0x47')][_0xd606('0x32')]);_0x38a1f4[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x43ab3f[_0xd606('0x47')][_0xd606('0x31')]);}_0x38a1f4[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x43ab3f[_0xd606('0x47')][_0xd606('0x52')]);_0x38a1f4['where']=qs[_0xd606('0x49')](_[_0xd606('0x6d')](_0x43ab3f['query'],_0x21f355['filters']));_0x38a1f4[_0xd606('0x53')][_0xd606('0x6a')]=_0xcf3d62['id'];if(_0x43ab3f[_0xd606('0x47')][_0xd606('0x54')]){_0x38a1f4[_0xd606('0x53')]=_['merge'](_0x38a1f4[_0xd606('0x53')],{'$or':_[_0xd606('0x41')](_0x38a1f4[_0xd606('0x4b')],function(_0x555f62){var _0x3735e9={};_0x3735e9[_0x555f62]={'$like':'%'+_0x43ab3f[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x3735e9;})});}_0x38a1f4=_[_0xd606('0x55')]({},_0x38a1f4,_0x43ab3f[_0xd606('0x57')]);return db[_0xd606('0x6b')]['count']({'where':_0x38a1f4[_0xd606('0x53')]})[_0xd606('0x23')](function(_0x499a32){_0x159242[_0xd606('0x34')]=_0x499a32;if(_0x43ab3f[_0xd606('0x47')]['includeAll']){_0x38a1f4['include']=[{'all':!![]}];}return db[_0xd606('0x6b')][_0xd606('0x5a')](_0x38a1f4);})[_0xd606('0x23')](function(_0x4017db){_0x159242['rows']=_0x4017db;return _0x159242;});}})['then'](respondWithFilteredResult(_0x4a551e,_0x38a1f4))[_0xd606('0x2c')](handleError(_0x4a551e,null));};exports[_0xd606('0x6e')]=function(_0x42580d,_0x428738,_0x1ae93e){return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x42580d[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x428738,null))[_0xd606('0x23')](function(_0x33203f){if(_0x33203f){return _0x33203f[_0xd606('0x6e')](_0x42580d[_0xd606('0x47')][_0xd606('0x6f')]);}})[_0xd606('0x23')](respondWithStatusCode(_0x428738,null))[_0xd606('0x2c')](handleError(_0x428738,null));};exports[_0xd606('0x70')]=function(_0x61d4d9,_0x56c398,_0x5d9456){if(_0x61d4d9[_0xd606('0x5f')]['id']){delete _0x61d4d9[_0xd606('0x5f')]['id'];}return db[_0xd606('0x42')]['find']({'where':{'id':_0x61d4d9['params']['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x56c398,null))['then'](function(_0x4997f7){if(_0x4997f7){_0x61d4d9[_0xd606('0x5f')]['ChatWebsiteId']=_0x4997f7['id'];return db['CannedAnswer']['create'](_0x61d4d9[_0xd606('0x5f')]);}})[_0xd606('0x23')](respondWithResult(_0x56c398,null))[_0xd606('0x2c')](handleError(_0x56c398,null));};exports[_0xd606('0x71')]=function(_0x322f1a,_0x55e1b2,_0x21e753){var _0x551f2e={'raw':![],'where':{}};var _0x48ecf6={};var _0x2db95b={'count':0x0,'rows':[]};return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x322f1a[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x55e1b2,null))[_0xd606('0x23')](function(_0xd614c5){if(_0xd614c5){_0x48ecf6[_0xd606('0x4c')]=_['keys'](db[_0xd606('0x73')][_0xd606('0x43')]);_0x48ecf6['query']=_[_0xd606('0x48')](_0x322f1a['query']);_0x48ecf6[_0xd606('0x49')]=_['intersection'](_0x48ecf6[_0xd606('0x4c')],_0x48ecf6['query']);_0x551f2e['attributes']=_['intersection'](_0x48ecf6['model'],qs['fields'](_0x322f1a[_0xd606('0x47')][_0xd606('0x4d')]));_0x551f2e[_0xd606('0x4b')]=_0x551f2e['attributes'][_0xd606('0x4e')]?_0x551f2e[_0xd606('0x4b')]:_0x48ecf6[_0xd606('0x4c')];if(!_0x322f1a[_0xd606('0x47')][_0xd606('0x4f')](_0xd606('0x50'))){_0x551f2e[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x322f1a[_0xd606('0x47')][_0xd606('0x32')]);_0x551f2e[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x322f1a[_0xd606('0x47')]['offset']);}_0x551f2e[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x322f1a[_0xd606('0x47')][_0xd606('0x52')]);_0x551f2e[_0xd606('0x53')]=qs['filters'](_[_0xd606('0x6d')](_0x322f1a[_0xd606('0x47')],_0x48ecf6[_0xd606('0x49')]));_0x551f2e[_0xd606('0x53')]['ChatWebsiteId']=_0xd614c5['id'];if(_0x322f1a[_0xd606('0x47')][_0xd606('0x54')]){_0x551f2e[_0xd606('0x53')]=_[_0xd606('0x55')](_0x551f2e[_0xd606('0x53')],{'$or':_[_0xd606('0x41')](_0x551f2e[_0xd606('0x4b')],function(_0x222eca){var _0x3f97a5={};_0x3f97a5[_0x222eca]={'$like':'%'+_0x322f1a[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x3f97a5;})});}_0x551f2e=_[_0xd606('0x55')]({},_0x551f2e,_0x322f1a[_0xd606('0x57')]);return db['CannedAnswer'][_0xd606('0x34')]({'where':_0x551f2e['where']})['then'](function(_0x302916){_0x2db95b['count']=_0x302916;if(_0x322f1a[_0xd606('0x47')][_0xd606('0x58')]){_0x551f2e[_0xd606('0x59')]=[{'all':!![]}];}return db[_0xd606('0x73')][_0xd606('0x5a')](_0x551f2e);})[_0xd606('0x23')](function(_0x17453d){_0x2db95b[_0xd606('0x5b')]=_0x17453d;return _0x2db95b;});}})[_0xd606('0x23')](respondWithFilteredResult(_0x55e1b2,_0x551f2e))[_0xd606('0x2c')](handleError(_0x55e1b2,null));};exports['removeAnswers']=function(_0x49a450,_0x59e360,_0x247d0a){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x49a450[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x59e360,null))[_0xd606('0x23')](function(_0x3366ab){if(_0x3366ab){return _0x3366ab['removeAnswers'](_0x49a450[_0xd606('0x47')][_0xd606('0x6f')]);}})[_0xd606('0x23')](respondWithStatusCode(_0x59e360,null))[_0xd606('0x2c')](handleError(_0x59e360,null));};exports[_0xd606('0x74')]=function(_0x5259d2,_0x3b4313,_0x5bf49b){_0x5259d2['body'][_0xd606('0x75')]=_0x5259d2[_0xd606('0x76')]['filename'];return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x5259d2[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x3b4313,null))[_0xd606('0x23')](saveUpdates(_0x5259d2[_0xd606('0x5f')],null))[_0xd606('0x23')](respondWithResult(_0x3b4313,null))[_0xd606('0x2c')](handleError(_0x3b4313,null));};exports[_0xd606('0x77')]=function(_0x23a263,_0x776466,_0x49060d){_0x23a263[_0xd606('0x5f')][_0xd606('0x78')]=_0x23a263[_0xd606('0x76')]['filename'];return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x23a263[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x776466,null))[_0xd606('0x23')](saveUpdates(_0x23a263['body'],null))[_0xd606('0x23')](respondWithResult(_0x776466,null))[_0xd606('0x2c')](handleError(_0x776466,null));};exports['addCustomerAvatar']=function(_0x56a40b,_0x20db30,_0x4b7938){_0x56a40b['body'][_0xd606('0x79')]=_0x56a40b['file'][_0xd606('0x7a')];return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x56a40b[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x20db30,null))['then'](saveUpdates(_0x56a40b[_0xd606('0x5f')],null))[_0xd606('0x23')](respondWithResult(_0x20db30,null))['catch'](handleError(_0x20db30,null));};exports[_0xd606('0x7b')]=function(_0x5bca0a,_0x2ff16c,_0x3bb213){_0x5bca0a[_0xd606('0x5f')][_0xd606('0x7c')]=_0x5bca0a[_0xd606('0x76')][_0xd606('0x7a')];return db[_0xd606('0x42')]['find']({'where':{'id':_0x5bca0a[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x2ff16c,null))['then'](saveUpdates(_0x5bca0a[_0xd606('0x5f')],null))['then'](respondWithResult(_0x2ff16c,null))[_0xd606('0x2c')](handleError(_0x2ff16c,null));};exports['getLogo']=function(_0x367290,_0x2f4807,_0x49e024){var _0x52a7dc=path[_0xd606('0x7d')](config['root'],_0xd606('0x7e'));var _0x556ccf={'where':{'id':_0x367290['params']['id']},'attributes':['id',_0xd606('0x75')],'raw':!![]};var _0x892a9d=![];return require(_0xd606('0x1a'))[_0xd606('0x7f')]()[_0xd606('0x23')](function(_0x5a4c64){if(_0x5a4c64){_0x892a9d=_0x5a4c64[_0xd606('0x80')];}})['then'](function(){return db[_0xd606('0x42')][_0xd606('0x5d')](_0x556ccf);})[_0xd606('0x23')](handleEntityNotFound(_0x2f4807,null))[_0xd606('0x23')](function(_0x5253a8){if(_0x5253a8){if(!_[_0xd606('0x81')](_0x5253a8[_0xd606('0x75')])){if(fs[_0xd606('0x82')](path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x84'),_0x5253a8[_0xd606('0x75')]))&&_0x892a9d){_0x52a7dc=path['join'](config['root'],_0xd606('0x84'),_0x5253a8[_0xd606('0x75')]);}}return _0x2f4807['download'](_0x52a7dc);}})[_0xd606('0x2c')](handleError(_0x2f4807,null));};exports[_0xd606('0x85')]=function(_0x3547c4,_0x28a30a,_0x107cb5){var _0xecc595=path[_0xd606('0x7d')](config[_0xd606('0x83')],'server/files/images/avatars/default_avatar.png');var _0x349210={'where':{'id':_0x3547c4[_0xd606('0x5c')]['id']},'attributes':['id',_0xd606('0x78')],'raw':!![]};return db[_0xd606('0x42')][_0xd606('0x5d')](_0x349210)[_0xd606('0x23')](handleEntityNotFound(_0x28a30a,null))[_0xd606('0x23')](function(_0x4dc3c4){if(_0x4dc3c4){if(!_[_0xd606('0x81')](_0x4dc3c4[_0xd606('0x78')])){if(fs[_0xd606('0x82')](path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x86'),_0x4dc3c4[_0xd606('0x78')]))){_0xecc595=path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x86'),_0x4dc3c4[_0xd606('0x78')]);}}return _0x28a30a[_0xd606('0x87')](_0xecc595);}})['catch'](handleError(_0x28a30a,null));};exports['getCustomerAvatar']=function(_0x1fdc5e,_0x5d2a74,_0x1e12e5){var _0x2d9bfc=path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x88'));var _0x560328={'where':{'id':_0x1fdc5e['params']['id']},'attributes':['id',_0xd606('0x79'),_0xd606('0x89')],'raw':!![]};return db[_0xd606('0x42')]['find'](_0x560328)[_0xd606('0x23')](handleEntityNotFound(_0x5d2a74,null))[_0xd606('0x23')](function(_0x41f58c){if(_0x41f58c){if(!_[_0xd606('0x81')](_0x41f58c[_0xd606('0x79')])){if(fs['existsSync'](path[_0xd606('0x7d')](config['root'],_0xd606('0x86'),_0x41f58c[_0xd606('0x79')]))&&_0x41f58c[_0xd606('0x89')]){_0x2d9bfc=path[_0xd606('0x7d')](config[_0xd606('0x83')],'server/files/images/avatars/',_0x41f58c[_0xd606('0x79')]);}}return _0x5d2a74['download'](_0x2d9bfc);}})[_0xd606('0x2c')](handleError(_0x5d2a74,null));};exports['getSystemAvatar']=function(_0x4f89a6,_0x220cf0,_0x52d2ce){var _0x324c07=path['join'](config[_0xd606('0x83')],_0xd606('0x8a'));var _0x3fbf88={'where':{'id':_0x4f89a6['params']['id']},'attributes':['id',_0xd606('0x7c')],'raw':!![]};return db[_0xd606('0x42')][_0xd606('0x5d')](_0x3fbf88)['then'](handleEntityNotFound(_0x220cf0,null))['then'](function(_0x1c7f94){if(_0x1c7f94){if(!_[_0xd606('0x81')](_0x1c7f94[_0xd606('0x7c')])){if(fs[_0xd606('0x82')](path['join'](config[_0xd606('0x83')],'server/files/images/avatars/',_0x1c7f94[_0xd606('0x7c')]))){_0x324c07=path['join'](config[_0xd606('0x83')],_0xd606('0x86'),_0x1c7f94[_0xd606('0x7c')]);}}return _0x220cf0[_0xd606('0x87')](_0x324c07);}})[_0xd606('0x2c')](handleError(_0x220cf0,null));};exports[_0xd606('0x8b')]=function(_0x283f05,_0x384683,_0x1b17c3){var _0x4adbd7=require(_0xd606('0x8c'));var _0x16a2dd=new _0x4adbd7();var _0x3547f3=_0x16a2dd[_0xd606('0x8d')](_0x283f05[_0xd606('0x8e')][_0xd606('0x8f')])[_0xd606('0x90')]();var _0x3c2389={'body':_0x283f05[_0xd606('0x5f')],'channel':_0xd606('0x91')};var _0x28117e=[];var _0x379963=[];var _0xc8b4a5={};var _0x567617=![];return db[_0xd606('0x92')][_0xd606('0x68')]()['then'](function(_0x134fee){if(!_0x134fee){throw new db[(_0xd606('0x93'))]['ValidationError'](_0xd606('0x94'));}_0x28117e=_[_0xd606('0x95')](_['keys'](_0x134fee),['createdAt',_0xd606('0x96')]);_0x379963=_[_0xd606('0x95')](_[_0xd606('0x48')](_0x134fee),[_0xd606('0x97'),_0xd606('0x96'),_0xd606('0x98'),_0xd606('0x99')]);if(_0x283f05['body']['id']){delete _0x283f05[_0xd606('0x5f')]['id'];}if(_['isNil'](_0x283f05[_0xd606('0x5f')][_0xd606('0x9a')])){throw new db['Sequelize'][(_0xd606('0x9b'))]('from\x20is\x20mandatory');}if(_[_0xd606('0x81')](_0x283f05[_0xd606('0x5f')]['body'])||_0x283f05[_0xd606('0x5f')][_0xd606('0x5f')]===''){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x9c'));}if(_[_0xd606('0x81')](_0x283f05['body'][_0xd606('0x9d')])){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x9e')+_0x379963);}if(!_['includes'](_0x379963,_0x283f05[_0xd606('0x5f')][_0xd606('0x9d')])){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x379963);}_0xc8b4a5[_0x283f05[_0xd606('0x5f')][_0xd606('0x9d')]]=_0x283f05[_0xd606('0x5f')][_0xd606('0x9a')];})[_0xd606('0x23')](function(){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x283f05[_0xd606('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xd606('0x9f'),'include':[{'model':db[_0xd606('0x92')],'as':_0xd606('0xa0'),'where':_0xc8b4a5,'limit':0x1,'order':[['updatedAt',_0xd606('0xa1')]]}]},{'model':db[_0xd606('0xa2')],'as':_0xd606('0xa3')}]});})[_0xd606('0x23')](handleEntityNotFound(_0x384683,null))[_0xd606('0x23')](function(_0x3e628b){if(_0x3e628b&&_0x3e628b[_0xd606('0x9f')]){_0x3c2389[_0xd606('0xa4')]=_0x3e628b;_0x3c2389[_0xd606('0xa5')]=_0x3e628b[_0xd606('0xa3')];_0x3c2389[_0xd606('0xa6')]=_0x3e628b[_0xd606('0x9f')];_0x3c2389['applications']=_['orderBy'](_0x3c2389[_0xd606('0xa5')],['priority'],[_0xd606('0xa7')]);if(_0x3c2389['account'][_0xd606('0xa3')]){delete _0x3c2389[_0xd606('0xa4')][_0xd606('0xa3')];}if(_0x3c2389['account'][_0xd606('0x9f')]&&_0x3c2389[_0xd606('0xa4')][_0xd606('0x9f')][_0xd606('0xa0')]['length']){return _0x3c2389[_0xd606('0xa4')]['List'][_0xd606('0xa0')][0x0];}var _0x58c7e0=_[_0xd606('0xa8')](_0x283f05[_0xd606('0x5f')],{'firstName':_0x283f05[_0xd606('0x5f')][_0xd606('0x9a')],'ListId':_0x3e628b[_0xd606('0x99')]});_0x58c7e0[_0x283f05[_0xd606('0x5f')][_0xd606('0x9d')]]=_0x283f05['body'][_0xd606('0x9a')];return db[_0xd606('0x92')]['create'](_0x58c7e0,{'fields':_0x28117e,'raw':!![]});}})[_0xd606('0x23')](handleEntityNotFound(_0x384683,null))[_0xd606('0x23')](function(_0x4c9437){_0x3c2389[_0xd606('0xa9')]=_0x4c9437;var _0x4fed08=_0x283f05[_0xd606('0x5f')][_0xd606('0xaa')];if(_0x283f05[_0xd606('0x8e')][_0xd606('0xab')]){_0x4fed08=_0x283f05[_0xd606('0x8e')][_0xd606('0xab')];}else if(_0x283f05[_0xd606('0x8e')][_0xd606('0xac')]){_0x4fed08=_[_0xd606('0xad')](_0x283f05[_0xd606('0x8e')][_0xd606('0xac')]['split'](','));}if(_0x4c9437){var _0x3bcca5={'ContactId':_0x4c9437['id'],'ChatWebsiteId':_0x283f05[_0xd606('0x5c')]['id'],'from':(_0x4c9437[_0xd606('0xae')]||'')+'\x20'+(_0x4c9437[_0xd606('0xaf')]||''),'customerIp':_0x4fed08,'customerPort':_0x283f05['headers']['x-real-port']?_0x283f05[_0xd606('0x8e')][_0xd606('0xb0')]:null,'referer':_0x283f05[_0xd606('0x5f')][_0xd606('0xb1')],'browserName':_0x3547f3[_0xd606('0xb2')]['name']&&_0x3547f3[_0xd606('0xb2')]['version']?util[_0xd606('0xb3')](_0xd606('0xb4'),_0x3547f3['browser'][_0xd606('0x3d')],_0x3547f3[_0xd606('0xb2')][_0xd606('0xb5')]):_0xd606('0xb6'),'browserVersion':_0x3547f3[_0xd606('0xb2')]['version']||'unknown','osName':util[_0xd606('0xb3')]('%s\x20%s',_0x3547f3['os']['name'],_0x3547f3['os'][_0xd606('0xb5')]),'osVersion':_0x3547f3['os'][_0xd606('0xb5')],'deviceModel':_0x3547f3[_0xd606('0xb7')]['model']&&_0x3547f3[_0xd606('0xb7')][_0xd606('0xb8')]?util[_0xd606('0xb3')]('%s\x20%s\x20%s',_0x3547f3[_0xd606('0xb7')][_0xd606('0x4c')],_0x3547f3[_0xd606('0xb7')]['vendor'],_0x3547f3[_0xd606('0xb7')]['type']):null,'deviceVendor':_0x3547f3[_0xd606('0xb7')][_0xd606('0xb8')],'deviceType':_0x3547f3[_0xd606('0xb7')][_0xd606('0x45')],'formData':JSON[_0xd606('0x27')](_0x283f05[_0xd606('0x5f')])};var _0x3be120={'ChatWebsiteId':_0x283f05[_0xd606('0x5c')]['id'],'closed':![]};if(_0x283f05['body']['threadId']){_0x3be120[_0xd606('0xb9')]=_0x283f05[_0xd606('0x5f')]['threadId'];return db['ChatInteraction'][_0xd606('0x5d')]({'where':_0x3be120})[_0xd606('0x23')](function(_0x40cdf2){if(_0x40cdf2){return[_0x40cdf2,![]];}_0x3bcca5[_0xd606('0xb9')]=_0x283f05[_0xd606('0x5f')][_0xd606('0xb9')];_0x3bcca5[_0xd606('0xba')]=_0x283f05['body']['externalUrl'];return db[_0xd606('0xbb')]['create'](_0x3bcca5)[_0xd606('0x23')](function(_0x471b14){return[_0x471b14,!![]];});});}_0x3be120[_0xd606('0xbc')]=_0x4c9437['id'];if(_0x283f05[_0xd606('0x5f')][_0xd606('0xbd')]&&_0x283f05[_0xd606('0x5f')][_0xd606('0xbd')]['id']){_0x3be120['id']=_0x283f05['body']['interaction']['id'];return db[_0xd606('0xbb')]['find']({'where':_0x3be120})[_0xd606('0x23')](function(_0x4e78ca){if(_0x4e78ca){return[_0x4e78ca,![]];}return db[_0xd606('0xbb')][_0xd606('0x5e')](_0x3bcca5)[_0xd606('0x23')](function(_0x1b39d1){return[_0x1b39d1,!![]];});});}return db[_0xd606('0xbb')]['create'](_0x3bcca5)[_0xd606('0x23')](function(_0x5146b0){return[_0x5146b0,!![]];});}})[_0xd606('0xbe')](function(_0x3c266e,_0x26f970){if(_0x3c266e){_0x567617=_0x26f970;if(!_0x26f970){var _0x2aa702={'from':(_0x3c2389[_0xd606('0xa9')]['firstName']||'')+'\x20'+(_0x3c2389[_0xd606('0xa9')][_0xd606('0xaf')]||'')};if(_0x283f05[_0xd606('0x5f')][_0xd606('0xb9')]&&_0x283f05[_0xd606('0x5f')]['messageId']&&_0x283f05[_0xd606('0x5f')]['threadId']!=_0x283f05[_0xd606('0x5f')][_0xd606('0xbf')]){_0x2aa702[_0xd606('0xb9')]=_0x283f05['body']['messageId'];}return _0x3c266e['update'](_0x2aa702);}else{return _0x3c266e;}}})[_0xd606('0x23')](function(_0x94bc52){_0x3c2389[_0xd606('0xbd')]=_0x94bc52[_0xd606('0x61')]({'plain':!![]});_0x3c2389['interaction'][_0xd606('0xc0')]=_0x567617;if(_0x3c2389['interaction'][_0xd606('0xc0')]){if(_0x3c2389['account'][_0xd606('0xc1')]){_0x3c2389[_0xd606('0xa5')]['push']({'id':0x0,'priority':_0x3c2389[_0xd606('0xa5')][_0xd606('0x4e')]+0x1,'app':_0xd606('0xc2'),'appdata':_0xd606('0xc3'),'interval':_0xd606('0xc4')});}}return db[_0xd606('0xc5')][_0xd606('0x5e')]({'body':_0x283f05[_0xd606('0x5f')]['body'],'ChatWebsiteId':_0x283f05[_0xd606('0x5c')]['id'],'ChatInteractionId':_0x94bc52['id'],'direction':'in','ContactId':_0x3c2389[_0xd606('0xa9')]['id'],'AttachmentId':_0x283f05[_0xd606('0x5f')][_0xd606('0xc6')]});})[_0xd606('0x23')](function(_0x330e27){_0x3c2389['message']=_0x330e27;if(_0x3c2389[_0xd606('0xbd')][_0xd606('0xc7')]){return db[_0xd606('0xc8')][_0xd606('0x5d')]({'attributes':['id','name'],'where':{'id':_0x3c2389[_0xd606('0xbd')]['UserId']}})[_0xd606('0x23')](function(_0x8b8996){if(_0x8b8996){_0x3c2389[_0xd606('0xa5')][_0xd606('0xc9')]({'id':0x0,'priority':0x0,'app':_0xd606('0xca'),'appdata':_0x8b8996['name']+','+(_0x3c2389[_0xd606('0xa4')]['waitForTheAssignedAgent']||0xa),'interval':_0xd606('0xc4')});_0x3c2389['forcedOwnership']=!![];}return respondWithRpcPromise(_0xd606('0xcb'),_0xd606('0xcc'),_0x3c2389);});}return respondWithRpcPromise('Start',_0xd606('0xcc'),_0x3c2389);})[_0xd606('0x23')](function(_0x3f3ee0){respondWithRpcPromise('EventManager',_0xd606('0xcd'),{'event':'notify','message':_0x3f3ee0},client9002);return _0x3f3ee0;})[_0xd606('0x23')](respondWithResult(_0x384683,null))[_0xd606('0x2c')](handleError(_0x384683,null));};exports['offline']=function(_0x1bfc46,_0x372686,_0xc0fb35){var _0x1cb886,_0x43ae95,_0x148005;var _0xf3505b=[];var _0x40a6fd=[];var _0x270db1={};var _0x5d0813=_0x1bfc46[_0xd606('0xce')]||[];var _0x26e49c=[];var _0x142c79;return db['CmContact'][_0xd606('0x68')]()[_0xd606('0x23')](function(_0x14cde9){if(!_0x14cde9){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x94'));}_0x40a6fd=_['difference'](_[_0xd606('0x48')](_0x14cde9),[_0xd606('0x97'),_0xd606('0x96')]);_0xf3505b=_['difference'](_[_0xd606('0x48')](_0x14cde9),['createdAt',_0xd606('0x96'),'CompanyId',_0xd606('0x99')]);if(_0x1bfc46[_0xd606('0x5f')]['id']){delete _0x1bfc46['body']['id'];}if(_[_0xd606('0x81')](_0x1bfc46['body']['from'])){throw _0x372686[_0xd606('0x2e')](0x1f4)[_0xd606('0xcf')](new db['Sequelize'][(_0xd606('0x9b'))](_0xd606('0xd0')));}if(_['isNil'](_0x1bfc46[_0xd606('0x5f')][_0xd606('0x5f')])||_0x1bfc46[_0xd606('0x5f')][_0xd606('0x5f')]===''){throw _0x372686[_0xd606('0x2e')](0x1f4)['send'](new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x9c')));}if(_[_0xd606('0x81')](_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')])){throw _0x372686[_0xd606('0x2e')](0x1f4)[_0xd606('0xcf')](new db[(_0xd606('0x93'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf3505b));}if(!_[_0xd606('0xd2')](_0xf3505b,_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')])){throw _0x372686[_0xd606('0x2e')](0x1f4)[_0xd606('0xcf')](new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0xd3')+_0xf3505b));}_0x270db1[_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')]]=_0x1bfc46['body'][_0xd606('0x9a')];})[_0xd606('0x23')](function(){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x1bfc46[_0xd606('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xd606('0x9f')},{'model':db[_0xd606('0xd4')],'as':_0xd606('0xd4')}]});})[_0xd606('0x23')](handleEntityNotFound(_0x372686,null))[_0xd606('0x23')](function(_0x54ff78){if(_0x54ff78&&_0x54ff78[_0xd606('0x9f')]){_0x43ae95=_0x54ff78;var _0x2664f2=_[_0xd606('0xa8')](_0x1bfc46[_0xd606('0x5f')],{'firstName':_0x1bfc46[_0xd606('0x5f')]['from'],'phone':_0x1bfc46[_0xd606('0x5f')][_0xd606('0x9a')],'ListId':_0x54ff78['ListId']});_0x2664f2[_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')]]=_0x1bfc46[_0xd606('0x5f')]['from'];return db[_0xd606('0x92')][_0xd606('0xd5')]({'where':_0x270db1,'defaults':_0x2664f2});}})['spread'](function(_0x175d64){if(_0x175d64){_0x148005=_0x175d64;var _0x2ec6c5=fs[_0xd606('0xd6')](path['join'](config[_0xd606('0x83')],_0xd606('0xd7')),_0xd606('0xd8'));var _0x4b7d80=ejs[_0xd606('0xd9')](_0x2ec6c5,{'body':_[_0xd606('0xda')](_0x1bfc46[_0xd606('0x5f')][_0xd606('0x5f')]),'bodyTitle':_0x43ae95['offlineMessageBody']});return db[_0xd606('0xdb')][_0xd606('0x5e')]({'body':_0x4b7d80,'ContactId':_0x175d64['id'],'ChatWebsiteId':_0x43ae95['id']});}})['then'](function(_0x1ba3f5){_0x142c79=_0x1ba3f5;if(_0x5d0813[_0xd606('0x4e')]){var _0x2be5c0=_0x5d0813['map'](function(_0x12007c){return{'name':_0x12007c[_0xd606('0xdc')],'basename':_0x12007c['filename'],'type':_0x12007c[_0xd606('0xdd')],'ChatOfflineMessageId':_0x1ba3f5['id']};});_0x26e49c=_0x2be5c0['map'](_0x5aa318=>{var _0xbb0a92={'filename':_0x5aa318[_0xd606('0x3d')],'path':path[_0xd606('0x7d')](config[_0xd606('0x83')],'server',_0xd606('0xce'),_0xd606('0xde'),_0xd606('0xdf'),_0x5aa318[_0xd606('0xe0')])};return _0xbb0a92;});if(!_0x43ae95[_0xd606('0xe1')]){return db[_0xd606('0xe2')][_0xd606('0xe3')](function(_0x2f5450){return db[_0xd606('0xe4')][_0xd606('0xe5')](_0x2be5c0,{'transaction':_0x2f5450});});}}})[_0xd606('0x23')](function(){if(_0x142c79){_0x1cb886=_0x142c79;return db[_0xd606('0xd4')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd606('0xe6'),'raw':!![]}]});}})['then'](function(_0x397fa0){if(_0x397fa0&&_0x397fa0[_0xd606('0xe6')]&&_0x43ae95[_0xd606('0xe7')]&&_0x43ae95[_0xd606('0xe8')]){var _0x6fdf7b={'tls':{'rejectUnauthorized':![]}};if(_0x397fa0[_0xd606('0xe6')][_0xd606('0xe9')]){_0x6fdf7b[_0xd606('0xe9')]=_0x397fa0[_0xd606('0xe6')][_0xd606('0xe9')];}else{_0x6fdf7b[_0xd606('0xea')]=_0x397fa0[_0xd606('0xe6')][_0xd606('0xea')];_0x6fdf7b[_0xd606('0xeb')]=_0x397fa0[_0xd606('0xe6')][_0xd606('0xeb')];_0x6fdf7b[_0xd606('0xec')]=_0x397fa0[_0xd606('0xe6')]['secure'];}if(_0x397fa0[_0xd606('0xe6')]['authentication']){_0x6fdf7b['auth']={'user':_0x397fa0[_0xd606('0xe6')][_0xd606('0x60')],'pass':_0x397fa0['Smtp'][_0xd606('0xed')]};}return respondWithRpcPromise('SendMail',_0xd606('0xee'),{'account':_0x6fdf7b,'message':{'from':util[_0xd606('0xb3')](_0xd606('0xef'),_0x397fa0[_0xd606('0x3d')],_0x397fa0[_0xd606('0xf0')]||_0x397fa0['Smtp']['user']),'to':_0x43ae95[_0xd606('0xe8')],'subject':_0x43ae95[_0xd606('0xf1')],'html':_0x1cb886[_0xd606('0x5f')],'attachments':_0x26e49c}},client9003)['then'](function(){return _0x1cb886;})['catch'](function(_0x1b7743){console[_0xd606('0x28')](_0x1b7743);});}})[_0xd606('0x23')](function(){if(_0x43ae95&&_0x43ae95[_0xd606('0xe1')]&&_0x43ae95[_0xd606('0xf2')]){var _0x1b352a=[];if(_0x5d0813[_0xd606('0x4e')]){_0x1b352a=_0x5d0813[_0xd606('0x41')](function(_0x54f700){return{'name':_0x54f700[_0xd606('0xdc')],'basename':_0x54f700[_0xd606('0x7a')],'type':_0x54f700['mimetype'],'ChatOfflineMessageId':_0x142c79['id']};});}var _0x3ecba1;if(!_[_0xd606('0x81')](_0x43ae95[_0xd606('0xf3')])){var _0x42fe4a=_[_0xd606('0x41')](_0x1bfc46[_0xd606('0x5f')],function(_0x5b2fe0){return _0x5b2fe0;});var _0x1a256a=_['toPairsIn'](_0x42fe4a)[0x0];var _0x11dbb3=_[_0xd606('0xf4')](_0x1a256a,function(_0x355cb0){return _0x355cb0;});_0x3ecba1=_0x11dbb3[0x1][_0x43ae95['subjectOffline']];}var _0x31e818={'from':_0x148005[_0xd606('0xf0')],'firstName':_0x148005[_0xd606('0xae')],'lastName':_0x148005[_0xd606('0xaf')],'mapKey':_0xd606('0xf0'),'message':{'from':_0x148005[_0xd606('0xf0')],'to':_0x43ae95[_0xd606('0xd4')]['email'],'cc':'','subject':_[_0xd606('0x81')](_0x3ecba1)?_0x43ae95[_0xd606('0xf1')]:_0x3ecba1,'messageId':'','sentAt':new Date(),'attach':_0x1b352a['length'],'attachments':_0x1b352a,'originChannel':_0xd606('0xf5'),'ChatWebsiteId':_0x43ae95['id'],'ChatOfflineMessageId':_0x1cb886['id'],'originTo':_0x43ae95[_0xd606('0xd4')][_0xd606('0xf0')]},'body':_0x1cb886[_0xd606('0x5f')]};var _0x1caf17={'account':{'id':_0x43ae95[_0xd606('0xf2')]},'body':_0x31e818,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xd606('0xf6'),_0xd606('0xf7'),_0x1caf17,client9001)[_0xd606('0x23')](function(){return _0x1cb886;})[_0xd606('0x2c')](function(_0x3fee9b){console['error'](_0x3fee9b);});}return;})[_0xd606('0x23')](function(){if(_0x1cb886){return _0x1cb886;}})[_0xd606('0x23')](respondWithResult(_0x372686,null))[_0xd606('0x2c')](function(_0x1e4e79){console[_0xd606('0x28')](_0xd606('0x2c'),_0x1e4e79);for(var _0x59ab87 of _0x5d0813){var _0x22dcc7=path['join'](config['root'],_0xd606('0xf8'),'files',_0xd606('0xde'),_0xd606('0xdf'),_0x59ab87[_0xd606('0x7a')]);fs_extra[_0xd606('0xf9')](_0x22dcc7)[_0xd606('0x2c')](function(_0x1e23e1){console[_0xd606('0x28')](_0xd606('0xfa'),_0x22dcc7,_0x1e23e1);});}});};exports[_0xd606('0xfb')]=function(_0x2a28e0,_0x2b3a60,_0x1316f3){return db[_0xd606('0xbb')][_0xd606('0x5d')]({'where':{'id':_0x2a28e0[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x2b3a60,null))['then'](function(_0x353adf){if(_0x353adf){return _0x353adf[_0xd606('0xfb')](_0x2a28e0['body'][_0xd606('0x6f')],_['omit'](_0x2a28e0[_0xd606('0x5f')],[_0xd606('0x6f'),'id'])||{});}})[_0xd606('0x23')](respondWithResult(_0x2b3a60,null))[_0xd606('0x2c')](handleError(_0x2b3a60,null));};exports['getInteractions']=function(_0x410a02,_0x3306fe,_0x334d07){var _0x88a7e7={'raw':![],'where':{}};var _0x5aa3a3={};var _0x3c2940={'count':0x0,'rows':[]};return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x410a02['params']['id']}})['then'](handleEntityNotFound(_0x3306fe,null))[_0xd606('0x23')](function(_0x3622af){if(_0x3622af){_0x5aa3a3[_0xd606('0x4c')]=_[_0xd606('0x48')](db[_0xd606('0xbb')][_0xd606('0x43')]);_0x5aa3a3[_0xd606('0x47')]=_[_0xd606('0x48')](_0x410a02['query']);_0x5aa3a3[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x5aa3a3[_0xd606('0x4c')],_0x5aa3a3[_0xd606('0x47')]);_0x88a7e7[_0xd606('0x4b')]=_[_0xd606('0x4a')](_0x5aa3a3['model'],qs['fields'](_0x410a02[_0xd606('0x47')][_0xd606('0x4d')]));_0x88a7e7['attributes']=_0x88a7e7[_0xd606('0x4b')][_0xd606('0x4e')]?_0x88a7e7[_0xd606('0x4b')]:_0x5aa3a3['model'];if(!_0x410a02[_0xd606('0x47')][_0xd606('0x4f')](_0xd606('0x50'))){_0x88a7e7[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x410a02[_0xd606('0x47')][_0xd606('0x32')]);_0x88a7e7[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x410a02[_0xd606('0x47')][_0xd606('0x31')]);}_0x88a7e7[_0xd606('0x51')]=qs['sort'](_0x410a02[_0xd606('0x47')][_0xd606('0x52')]);_0x88a7e7[_0xd606('0x53')]=qs['filters'](_[_0xd606('0x6d')](_0x410a02[_0xd606('0x47')],_0x5aa3a3[_0xd606('0x49')]));_0x88a7e7[_0xd606('0x53')][_0xd606('0x6a')]=_0x3622af['id'];if(_0x410a02[_0xd606('0x47')][_0xd606('0x54')]){_0x88a7e7[_0xd606('0x53')]=_[_0xd606('0x55')](_0x88a7e7['where'],{'$or':_[_0xd606('0x41')](_0x88a7e7[_0xd606('0x4b')],function(_0x217bea){var _0x2ba7de={};_0x2ba7de[_0x217bea]={'$like':'%'+_0x410a02[_0xd606('0x47')]['filter']+'%'};return _0x2ba7de;})});}_0x88a7e7=_[_0xd606('0x55')]({},_0x88a7e7,_0x410a02[_0xd606('0x57')]);return db[_0xd606('0xbb')][_0xd606('0x34')]({'where':_0x88a7e7[_0xd606('0x53')]})['then'](function(_0x6d97d4){_0x3c2940[_0xd606('0x34')]=_0x6d97d4;if(_0x410a02[_0xd606('0x47')]['includeAll']){_0x88a7e7[_0xd606('0x59')]=[{'model':db[_0xd606('0x92')],'as':'Contact','required':![]},{'model':db[_0xd606('0xc8')],'as':_0xd606('0xfc'),'attributes':[_0xd606('0x3d'),_0xd606('0xfd'),'internal'],'required':![]},{'model':db[_0xd606('0xfe')],'as':_0xd606('0xff'),'attributes':['id','name',_0xd606('0x100')],'where':_0x410a02['query'][_0xd606('0x101')]?{'id':_0x410a02[_0xd606('0x47')][_0xd606('0x101')]}:undefined,'required':_0x410a02[_0xd606('0x47')]['tag']?!![]:![]}];}return db[_0xd606('0xbb')]['findAll'](_0x88a7e7);})['then'](function(_0x38cb4a){_0x3c2940[_0xd606('0x5b')]=_0x38cb4a;return _0x3c2940;});}})['then'](respondWithFilteredResult(_0x3306fe,_0x88a7e7))[_0xd606('0x2c')](handleError(_0x3306fe,null));};function iftimePromise(_0x60bed4,_0x4541c3){return respondWithRpcPromise(_0xd606('0x102'),_0xd606('0x103'),{'command':_0x4541c3[_0xd606('0x104')]?util[_0xd606('0xb3')](_0xd606('0x105'),_0x60bed4[_0xd606('0x106')],_0x4541c3[_0xd606('0x104')]):util[_0xd606('0xb3')]('iftime\x20%s',_0x60bed4[_0xd606('0x106')])},client9002)[_0xd606('0x23')](function(_0x1372d4){var _0x15fa66=_0x1372d4&&_0x1372d4[_0xd606('0x107')](_0xd606('0x108'))>=0x0?!![]:![];logger[_0xd606('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4541c3['id'],_0x60bed4['id'],_0x60bed4[_0xd606('0x106')],_0x15fa66?_0xd606('0x109'):'OFFLINE',_0x4541c3[_0xd606('0x104')]?_0x4541c3[_0xd606('0x104')]:'No\x20timezone');return _0x15fa66;})[_0xd606('0x2c')](function(_0x546549){logger[_0xd606('0x28')](_0xd606('0x10a'),_0x4541c3['id'],_0x60bed4['id'],_0x60bed4['interval'],util[_0xd606('0x10b')](_0x546549,{'showHidden':![],'depth':null}),_0x4541c3[_0xd606('0x104')]?_0x4541c3[_0xd606('0x104')]:_0xd606('0x10c'));return![];});}exports[_0xd606('0x103')]=function(_0x233486,_0x23bc7a,_0x2eda4e){var _0x5cded1=0x0;var _0x280102=0x0;var _0x457a38=![];var _0x2c79fc;var _0x273fea;return db[_0xd606('0x42')]['find']({'where':{'id':_0x233486[_0xd606('0x5c')]['id']},'include':[{'model':db[_0xd606('0x10d')],'as':_0xd606('0x10d'),'include':[{'model':db[_0xd606('0x10d')],'as':_0xd606('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xd606('0x23')](handleEntityNotFound(_0x23bc7a,null))[_0xd606('0x23')](function(_0x55c18a){if(_0x55c18a){_0x2c79fc=_0x55c18a;return _0x55c18a['getProactiveActions']({'raw':!![]});}})[_0xd606('0x23')](function(_0x2d0fb9){if(_0x2c79fc){if(_0x2d0fb9){_0x273fea=_0x2d0fb9;}}return require(_0xd606('0x1a'))[_0xd606('0x7f')]();})[_0xd606('0x23')](function(_0x33205a){if(_0x33205a){_0x280102=_0x33205a[_0xd606('0x10f')];_0x457a38=_0x33205a['custom'];}})[_0xd606('0x23')](function(){return db['ChatInteraction'][_0xd606('0x34')]({'where':{'closed':![]}});})['then'](function(_0x22a244){_0x5cded1=_0x22a244;if(_0x280102&&_0x22a244>_0x280102){return db[_0xd606('0x110')][_0xd606('0x72')]({'where':{'id':0x1}})[_0xd606('0x23')](function(_0x1f24bf){if(_0x1f24bf){_0x1f24bf[_0xd606('0x111')](_0xd606('0x112'));}});}})[_0xd606('0x23')](function(){if(_0x2c79fc['Interval']&&_0x2c79fc[_0xd606('0x10d')][_0xd606('0x10e')]){var _0x3f13be=[];for(var _0x6a41a8=0x0;_0x6a41a8<_0x2c79fc[_0xd606('0x10d')][_0xd606('0x10e')][_0xd606('0x4e')];_0x6a41a8++){var _0x4b2b09=_0x2c79fc['Interval']['Intervals'][_0x6a41a8][_0xd606('0x61')]({'plain':!![]});_0x3f13be[_0xd606('0x113')](iftimePromise(_0x4b2b09,_0x2c79fc));}return BPromise[_0xd606('0x114')](_0x3f13be)[_0xd606('0x23')](function(_0xb380d6){return _[_0xd606('0x115')](_0xb380d6);});}else{return!![];}})['then'](function(_0x54dbb7){var _0x2a2efa=fs['readFileSync'](path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x116')),_0xd606('0xd8'));var _0xd6c356={'remote':_0x2c79fc[_0xd606('0x117')],'query':querystring[_0xd606('0x27')](_[_0xd606('0x55')](_0x2c79fc['get']({'plain':!![]}),{'customerIp':_0x233486[_0xd606('0x8e')][_0xd606('0xac')]||_0x233486[_0xd606('0x8e')][_0xd606('0x118')]||_0x233486[_0xd606('0x119')][_0xd606('0x11a')]||_0x233486['ip'],'referer':_0x233486[_0xd606('0x8e')][_0xd606('0xb1')],'openedInteractions':_0x5cded1,'maxInteractions':_0x280102,'virtual':_0x457a38[_0xd606('0x10f')],'online':_0x54dbb7,'custom':_0x457a38}))[_0xd606('0x11b')](/'/g,'\x5c\x27')};_0x23bc7a['send'](ejs['render'](Mustache[_0xd606('0xd9')](_0x2a2efa,_0xd6c356),{'proactiveActions':_0x273fea,'alignment':_0x2c79fc['alignment'],'verticalAlignment':_0x2c79fc[_0xd606('0x11c')],'div_color':_0x2c79fc[_0xd606('0x100')],'text_color':_0x2c79fc[_0xd606('0x11d')],'button_color':_0x2c79fc['color_button'],'background_color':_0x2c79fc[_0xd606('0x11e')]}));})[_0xd606('0x2c')](handleError(_0x23bc7a,null));};exports[_0xd606('0x11f')]=function(_0x28c124,_0x86f910,_0x750986){return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x28c124[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x86f910,null))['then'](function(_0x3eed95){if(_0x3eed95){return db[_0xd606('0xe2')][_0xd606('0xe3')](function(_0x197a4b){return db[_0xd606('0xa2')][_0xd606('0x3a')]({'where':{'ChatWebsiteId':_0x28c124[_0xd606('0x5c')]['id']},'transaction':_0x197a4b})[_0xd606('0x23')](function(_0x29a810){var _0x4168b4=_[_0xd606('0x41')](_0x28c124[_0xd606('0x5f')],function(_0x3306ea){_0x3306ea['ChatWebsiteId']=_0x28c124[_0xd606('0x5c')]['id'];return _0x3306ea;});return db[_0xd606('0xa2')][_0xd606('0xe5')](_0x4168b4,{'transaction':_0x197a4b});});})[_0xd606('0x23')](function(){return db[_0xd606('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x28c124[_0xd606('0x5c')]['id']},'order':'priority'});});}})[_0xd606('0x23')](respondWithResult(_0x86f910,null))[_0xd606('0x2c')](handleError(_0x86f910,null));};exports['getApplications']=function(_0x186c61,_0x5f1599,_0x4320c0){var _0x692e54={};var _0x1eecc0={};var _0x413251;var _0x22f5c6;return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x186c61[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x5f1599,null))[_0xd606('0x23')](function(_0xb06042){if(_0xb06042){_0x413251=_0xb06042;_0x1eecc0[_0xd606('0x4c')]=_[_0xd606('0x48')](db[_0xd606('0xa2')]['rawAttributes']);_0x1eecc0[_0xd606('0x47')]=_[_0xd606('0x48')](_0x186c61['query']);_0x1eecc0[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x1eecc0[_0xd606('0x4c')],_0x1eecc0['query']);_0x692e54[_0xd606('0x4b')]=_['intersection'](_0x1eecc0[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x186c61[_0xd606('0x47')][_0xd606('0x4d')]));_0x692e54[_0xd606('0x4b')]=_0x692e54['attributes'][_0xd606('0x4e')]?_0x692e54[_0xd606('0x4b')]:_0x1eecc0[_0xd606('0x4c')];_0x692e54[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x186c61[_0xd606('0x47')][_0xd606('0x52')]);_0x692e54[_0xd606('0x53')]=qs[_0xd606('0x49')](_['pick'](_0x186c61[_0xd606('0x47')],_0x1eecc0['filters']));if(_0x186c61[_0xd606('0x47')][_0xd606('0x54')]){_0x692e54['where']=_[_0xd606('0x55')](_0x692e54['where'],{'$or':_[_0xd606('0x41')](_0x692e54[_0xd606('0x4b')],function(_0x362122){var _0x406322={};_0x406322[_0x362122]={'$like':'%'+_0x186c61[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x406322;})});}_0x692e54=_['merge']({},_0x692e54,_0x186c61['options']);return _0x413251['getApplications'](_0x692e54);}})[_0xd606('0x23')](function(_0x4cdac0){if(_0x4cdac0){_0x22f5c6=_0x4cdac0[_0xd606('0x4e')];if(!_0x186c61[_0xd606('0x47')]['hasOwnProperty'](_0xd606('0x50'))){_0x692e54[_0xd606('0x32')]=qs['limit'](_0x186c61[_0xd606('0x47')]['limit']);_0x692e54['offset']=qs[_0xd606('0x31')](_0x186c61[_0xd606('0x47')][_0xd606('0x31')]);}return _0x413251[_0xd606('0x120')](_0x692e54);}})[_0xd606('0x23')](function(_0xdabebc){if(_0xdabebc){return _0xdabebc?{'count':_0x22f5c6,'rows':_0xdabebc}:null;}})[_0xd606('0x23')](respondWithResult(_0x5f1599,null))[_0xd606('0x2c')](handleError(_0x5f1599,null));};exports[_0xd606('0x121')]=function(_0x156e75,_0x27e2f4,_0x12ed7c){return db[_0xd606('0x122')]['find']({'where':{'id':_0x156e75[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x27e2f4,null))[_0xd606('0x23')](function(_0x366500){if(_0x366500){return _0x366500[_0xd606('0x121')](_0x156e75[_0xd606('0x5f')]['ids'],_['omit'](_0x156e75[_0xd606('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x27e2f4,null))[_0xd606('0x2c')](handleError(_0x27e2f4,null));};exports['getProactiveActions']=function(_0x20f572,_0x40ae24,_0xbb2b6e){var _0x4209be={};var _0x2ef6e8={};var _0x27374b;var _0x3331ab;return db[_0xd606('0x42')]['findOne']({'where':{'id':_0x20f572[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x40ae24,null))[_0xd606('0x23')](function(_0x463da8){if(_0x463da8){_0x27374b=_0x463da8;_0x2ef6e8['model']=_[_0xd606('0x48')](db[_0xd606('0x123')][_0xd606('0x43')]);_0x2ef6e8[_0xd606('0x47')]=_[_0xd606('0x48')](_0x20f572[_0xd606('0x47')]);_0x2ef6e8[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x2ef6e8[_0xd606('0x4c')],_0x2ef6e8[_0xd606('0x47')]);_0x4209be['attributes']=_['intersection'](_0x2ef6e8['model'],qs[_0xd606('0x4d')](_0x20f572[_0xd606('0x47')][_0xd606('0x4d')]));_0x4209be[_0xd606('0x4b')]=_0x4209be[_0xd606('0x4b')][_0xd606('0x4e')]?_0x4209be[_0xd606('0x4b')]:_0x2ef6e8[_0xd606('0x4c')];_0x4209be[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x20f572[_0xd606('0x47')][_0xd606('0x52')]);_0x4209be['where']=qs['filters'](_[_0xd606('0x6d')](_0x20f572[_0xd606('0x47')],_0x2ef6e8[_0xd606('0x49')]));if(_0x20f572[_0xd606('0x47')][_0xd606('0x54')]){_0x4209be[_0xd606('0x53')]=_[_0xd606('0x55')](_0x4209be[_0xd606('0x53')],{'$or':_['map'](_0x4209be[_0xd606('0x4b')],function(_0x3a147f){var _0x5047fd={};_0x5047fd[_0x3a147f]={'$like':'%'+_0x20f572[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x5047fd;})});}_0x4209be=_[_0xd606('0x55')]({},_0x4209be,_0x20f572[_0xd606('0x57')]);return _0x27374b[_0xd606('0x124')](_0x4209be);}})[_0xd606('0x23')](function(_0x5f56ee){if(_0x5f56ee){_0x3331ab=_0x5f56ee[_0xd606('0x4e')];if(!_0x20f572['query'][_0xd606('0x4f')](_0xd606('0x50'))){_0x4209be[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x20f572[_0xd606('0x47')][_0xd606('0x32')]);_0x4209be[_0xd606('0x31')]=qs['offset'](_0x20f572[_0xd606('0x47')][_0xd606('0x31')]);}return _0x27374b[_0xd606('0x124')](_0x4209be);}})[_0xd606('0x23')](function(_0x584ef5){if(_0x584ef5){return _0x584ef5?{'count':_0x3331ab,'rows':_0x584ef5}:null;}})['then'](respondWithResult(_0x40ae24,null))[_0xd606('0x2c')](handleError(_0x40ae24,null));};exports[_0xd606('0x125')]=function(_0x556597,_0xa17a57,_0x254ef5){var _0x12b239=_0x556597['query'][_0xd606('0x126')]===_0xd606('0x127')?_0xd606('0x128'):_0xd606('0x129');return db['ChatWebsite'][_0xd606('0x5d')]({'attributes':['id',_0x12b239],'where':{'id':_0x556597[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0xa17a57,null))[_0xd606('0x23')](function(_0x3a0120){if(_0x3a0120){var _0x4db45d=_0x3a0120[_0x12b239];var _0x593551=_0x4db45d&&_0x4db45d[_0xd606('0x12a')]?_0x4db45d[_0xd606('0x12a')]:[];_0xa17a57['send']({'fromKey':_[_0xd606('0x81')](_0x4db45d['fromKey'])?undefined:_0x4db45d[_0xd606('0x12b')],'count':_0x593551[_0xd606('0x4e')],'rows':_0x593551});}})['catch'](handleError(_0xa17a57,null));};exports[_0xd606('0x12c')]=function(_0x4e1929,_0x232210,_0xe7b1cb){var _0x53f8da={'raw':![],'where':{}};var _0xb6945c={};var _0x1140cc={'count':0x0,'rows':[]};return db[_0xd606('0x42')]['findOne']({'where':{'id':_0x4e1929[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x232210,null))[_0xd606('0x23')](function(_0x42948f){if(_0x42948f){_0xb6945c[_0xd606('0x4c')]=_[_0xd606('0x48')](db['ChatOfflineMessage'][_0xd606('0x43')]);_0xb6945c['query']=_[_0xd606('0x48')](_0x4e1929[_0xd606('0x47')]);_0xb6945c[_0xd606('0x49')]=_['intersection'](_0xb6945c[_0xd606('0x4c')],_0xb6945c[_0xd606('0x47')]);_0x53f8da[_0xd606('0x4b')]=_[_0xd606('0x4a')](_0xb6945c['model'],qs[_0xd606('0x4d')](_0x4e1929['query'][_0xd606('0x4d')]));_0x53f8da[_0xd606('0x4b')]=_0x53f8da[_0xd606('0x4b')][_0xd606('0x4e')]?_0x53f8da['attributes']:_0xb6945c[_0xd606('0x4c')];if(!_0x4e1929[_0xd606('0x47')]['hasOwnProperty'](_0xd606('0x50'))){_0x53f8da[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x4e1929[_0xd606('0x47')][_0xd606('0x32')]);_0x53f8da['offset']=qs[_0xd606('0x31')](_0x4e1929[_0xd606('0x47')][_0xd606('0x31')]);}_0x53f8da[_0xd606('0x51')]=qs['sort'](_0x4e1929['query'][_0xd606('0x52')]);_0x53f8da[_0xd606('0x53')]=qs[_0xd606('0x49')](_[_0xd606('0x6d')](_0x4e1929[_0xd606('0x47')],_0xb6945c[_0xd606('0x49')]));_0x53f8da[_0xd606('0x53')][_0xd606('0x6a')]=_0x42948f['id'];if(_0x4e1929['query']['filter']){_0x53f8da['where']=_[_0xd606('0x55')](_0x53f8da[_0xd606('0x53')],{'$or':_['map'](_0x53f8da[_0xd606('0x4b')],function(_0x3318d5){var _0xca43ea={};_0xca43ea[_0x3318d5]={'$like':'%'+_0x4e1929[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0xca43ea;})});}_0x53f8da=_[_0xd606('0x55')]({},_0x53f8da,_0x4e1929['options']);return db[_0xd606('0xdb')][_0xd606('0x34')]({'where':_0x53f8da[_0xd606('0x53')]})[_0xd606('0x23')](function(_0xffeebc){_0x1140cc['count']=_0xffeebc;if(_0x4e1929[_0xd606('0x47')][_0xd606('0x58')]){_0x53f8da['include']=[{'all':!![]}];}else{_0x53f8da[_0xd606('0x59')]=[{'model':db['CmContact'],'as':_0xd606('0x12d'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xd606('0xdb')][_0xd606('0x5a')](_0x53f8da);})[_0xd606('0x23')](function(_0x26701a){_0x1140cc[_0xd606('0x5b')]=_0x26701a;return _0x1140cc;});}})['then'](respondWithFilteredResult(_0x232210,_0x53f8da))['catch'](handleError(_0x232210,null));};exports['addAgents']=function(_0x36c2ce,_0x411966,_0x252ddf){return db['ChatWebsite']['find']({'where':{'id':_0x36c2ce['params']['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x411966,null))[_0xd606('0x23')](function(_0x10f1c9){if(_0x10f1c9){return _0x10f1c9[_0xd606('0x12e')](_0x36c2ce[_0xd606('0x5f')][_0xd606('0x6f')],_['omit'](_0x36c2ce['body'],['ids','id'])||{})[_0xd606('0xbe')](function(_0x1dace7){for(var _0x3c2fc4=0x0;_0x3c2fc4<_0x36c2ce['body'][_0xd606('0x6f')][_0xd606('0x4e')];_0x3c2fc4+=0x1){socket[_0xd606('0x12f')](_0xd606('0x130'),{'UserId':Number(_0x36c2ce[_0xd606('0x5f')][_0xd606('0x6f')][_0x3c2fc4]),'ChatWebsiteId':Number(_0x36c2ce[_0xd606('0x5c')]['id'])});}return _0x1dace7;});}})['then'](respondWithResult(_0x411966,null))['catch'](handleError(_0x411966,null));};exports[_0xd606('0x131')]=function(_0x14b257,_0x31c9c2,_0x1c0580){return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x14b257[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x31c9c2,null))[_0xd606('0x23')](function(_0x2d0831){if(_0x2d0831){return _0x2d0831[_0xd606('0x131')](_0x14b257[_0xd606('0x47')][_0xd606('0x6f')])[_0xd606('0x23')](function(){if(_[_0xd606('0x132')](_0x14b257[_0xd606('0x47')][_0xd606('0x6f')])){for(var _0x590c2f=0x0;_0x590c2f<_0x14b257['query'][_0xd606('0x6f')]['length'];_0x590c2f+=0x1){socket[_0xd606('0x12f')](_0xd606('0x133'),{'UserId':Number(_0x14b257['query'][_0xd606('0x6f')][_0x590c2f]),'ChatWebsiteId':Number(_0x14b257['params']['id'])});}}else{socket[_0xd606('0x12f')](_0xd606('0x133'),{'UserId':Number(_0x14b257['query'][_0xd606('0x6f')]),'ChatWebsiteId':Number(_0x14b257[_0xd606('0x5c')]['id'])});}});}})[_0xd606('0x23')](respondWithStatusCode(_0x31c9c2,null))[_0xd606('0x2c')](handleError(_0x31c9c2,null));};exports[_0xd606('0x134')]=function(_0x3d5415,_0x4ff46e,_0x590615){var _0x44cc88={};var _0x5041fb={};var _0x5b2c3f;var _0x4cd634;return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x3d5415[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x4ff46e,null))[_0xd606('0x23')](function(_0x1deccc){if(_0x1deccc){_0x5b2c3f=_0x1deccc;_0x5041fb[_0xd606('0x4c')]=_[_0xd606('0x48')](db[_0xd606('0xc8')]['rawAttributes']);_0x5041fb['query']=_['keys'](_0x3d5415[_0xd606('0x47')]);_0x5041fb['filters']=_[_0xd606('0x4a')](_0x5041fb['model'],_0x5041fb['query']);_0x44cc88[_0xd606('0x4b')]=_['intersection'](_0x5041fb[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x3d5415['query']['fields']));_0x44cc88[_0xd606('0x4b')]=_0x44cc88[_0xd606('0x4b')][_0xd606('0x4e')]?_0x44cc88['attributes']:_0x5041fb[_0xd606('0x4c')];_0x44cc88['order']=qs['sort'](_0x3d5415[_0xd606('0x47')][_0xd606('0x52')]);_0x44cc88[_0xd606('0x53')]=qs[_0xd606('0x49')](_[_0xd606('0x6d')](_0x3d5415['query'],_0x5041fb[_0xd606('0x49')]));if(_0x3d5415[_0xd606('0x47')][_0xd606('0x54')]){_0x44cc88['where']=_['merge'](_0x44cc88[_0xd606('0x53')],{'$or':_[_0xd606('0x41')](_0x44cc88[_0xd606('0x4b')],function(_0x354432){var _0x3dfd25={};_0x3dfd25[_0x354432]={'$like':'%'+_0x3d5415[_0xd606('0x47')]['filter']+'%'};return _0x3dfd25;})});}_0x44cc88=_[_0xd606('0x55')]({},_0x44cc88,_0x3d5415[_0xd606('0x57')]);return _0x5b2c3f[_0xd606('0x134')](_0x44cc88);}})['then'](function(_0x5394e1){if(_0x5394e1){_0x4cd634=_0x5394e1[_0xd606('0x4e')];if(!_0x3d5415['query']['hasOwnProperty']('nolimit')){_0x44cc88[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x3d5415[_0xd606('0x47')][_0xd606('0x32')]);_0x44cc88[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x3d5415[_0xd606('0x47')]['offset']);}return _0x5b2c3f[_0xd606('0x134')](_0x44cc88);}})[_0xd606('0x23')](function(_0x5f0221){if(_0x5f0221){return _0x5f0221?{'count':_0x4cd634,'rows':_0x5f0221}:null;}})[_0xd606('0x23')](respondWithResult(_0x4ff46e,null))[_0xd606('0x2c')](handleError(_0x4ff46e,null));};
\ No newline at end of file
+var _0x5bc7=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','interaction','ChatInteraction','spread','messageId','created','unmanaged','*,*,*,*','ChatMessage','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','push','all','some','remote','connection','remoteAddress','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','sequelize','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','order','sort','options','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','server/files/images/logos/','root','download','getAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','user-agent-parser','setUA','headers','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x5bc7,0x95));var _0x75bc=function(_0x3cc5fd,_0x569445){_0x3cc5fd=_0x3cc5fd-0x0;var _0x31c92e=_0x5bc7[_0x3cc5fd];return _0x31c92e;};'use strict';var emlformat=require(_0x75bc('0x0'));var rimraf=require(_0x75bc('0x1'));var zipdir=require(_0x75bc('0x2'));var jsonpatch=require(_0x75bc('0x3'));var rp=require('request-promise');var moment=require(_0x75bc('0x4'));var BPromise=require(_0x75bc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x75bc('0x6'));var sox=require(_0x75bc('0x7'));var csv=require(_0x75bc('0x8'));var ejs=require(_0x75bc('0x9'));var fs=require('fs');var fs_extra=require(_0x75bc('0xa'));var _=require(_0x75bc('0xb'));var squel=require(_0x75bc('0xc'));var crypto=require(_0x75bc('0xd'));var jsforce=require(_0x75bc('0xe'));var deskjs=require(_0x75bc('0xf'));var toCsv=require(_0x75bc('0x8'));var querystring=require('querystring');var Papa=require(_0x75bc('0x10'));var Redis=require('ioredis');var authService=require(_0x75bc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x75bc('0x12'))(_0x75bc('0x13'));var utils=require(_0x75bc('0x14'));var config=require(_0x75bc('0x15'));var licenseUtil=require(_0x75bc('0x16'));var db=require(_0x75bc('0x17'))['db'];config['redis']=_[_0x75bc('0x18')](config[_0x75bc('0x19')],{'host':_0x75bc('0x1a'),'port':0x18eb});var socket=require(_0x75bc('0x1b'))(new Redis(config[_0x75bc('0x19')]));require(_0x75bc('0x1c'))[_0x75bc('0x1d')](socket);var jayson=require(_0x75bc('0x1e'));var client=jayson[_0x75bc('0x1f')][_0x75bc('0x20')]({'port':0x232c});var client9002=jayson[_0x75bc('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0x75bc('0x1f')][_0x75bc('0x20')]({'port':0x232b});var client9001=jayson[_0x75bc('0x1f')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4dbbcf,_0xe14dea,_0x1f1afd,_0x1e4391){return new BPromise(function(_0x3e9e5e,_0x4a6e7a){var _0x3dfe28=_0x1e4391||client;return _0x3dfe28[_0x75bc('0x21')](_0x4dbbcf,_0x1f1afd)['then'](function(_0x49a2e0){logger[_0x75bc('0x22')](_0x75bc('0x23'),_0xe14dea,_0x75bc('0x24'));logger[_0x75bc('0x25')](_0x75bc('0x26'),_0xe14dea,'request\x20sent',JSON[_0x75bc('0x27')](_0x49a2e0));if(_0x49a2e0[_0x75bc('0x28')]){if(_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x29')]===0x1f4){logger[_0x75bc('0x28')]('ChatWebsite,\x20%s,\x20%s',_0xe14dea,_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x2a')]);return _0x4a6e7a(_0x49a2e0[_0x75bc('0x28')]['message']);}logger['error'](_0x75bc('0x23'),_0xe14dea,_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x2a')]);return _0x3e9e5e(_0x49a2e0[_0x75bc('0x28')][_0x75bc('0x2a')]);}else{logger[_0x75bc('0x22')](_0x75bc('0x23'),_0xe14dea,_0x75bc('0x24'));_0x3e9e5e(_0x49a2e0[_0x75bc('0x2b')][_0x75bc('0x2a')]);}})[_0x75bc('0x2c')](function(_0x25fba2){logger['error'](_0x75bc('0x23'),_0xe14dea,_0x25fba2);_0x4a6e7a(_0x25fba2);});});}function respondWithStatusCode(_0x57474e,_0x2e9470){_0x2e9470=_0x2e9470||0xcc;return function(_0x1ba9d5){if(_0x1ba9d5){return _0x57474e[_0x75bc('0x2d')](_0x2e9470);}return _0x57474e[_0x75bc('0x2e')](_0x2e9470)['end']();};}function respondWithResult(_0x4b8987,_0x4deecd){_0x4deecd=_0x4deecd||0xc8;return function(_0x2dc23a){if(_0x2dc23a){return _0x4b8987[_0x75bc('0x2e')](_0x4deecd)[_0x75bc('0x2f')](_0x2dc23a);}};}function respondWithFilteredResult(_0x523ab7,_0x246e97){return function(_0x2d1ef7){if(_0x2d1ef7){var _0x3f2cf4=typeof _0x246e97['offset']===_0x75bc('0x30')&&typeof _0x246e97[_0x75bc('0x31')]===_0x75bc('0x30');var _0x48eeed=_0x2d1ef7[_0x75bc('0x32')];var _0x7bc4a5=_0x3f2cf4?0x0:_0x246e97[_0x75bc('0x33')];var _0x49e885=_0x3f2cf4?_0x2d1ef7[_0x75bc('0x32')]:_0x246e97['offset']+_0x246e97[_0x75bc('0x31')];var _0x575a70;if(_0x49e885>=_0x48eeed){_0x49e885=_0x48eeed;_0x575a70=0xc8;}else{_0x575a70=0xce;}_0x523ab7[_0x75bc('0x2e')](_0x575a70);return _0x523ab7[_0x75bc('0x34')](_0x75bc('0x35'),_0x7bc4a5+'-'+_0x49e885+'/'+_0x48eeed)[_0x75bc('0x2f')](_0x2d1ef7);}return null;};}function patchUpdates(_0x438508){return function(_0x1bae9e){try{jsonpatch[_0x75bc('0x36')](_0x1bae9e,_0x438508,!![]);}catch(_0x16c14d){return BPromise[_0x75bc('0x37')](_0x16c14d);}return _0x1bae9e[_0x75bc('0x38')]();};}function saveUpdates(_0xdc5878,_0x57b06e){return function(_0x495e85){if(_0x495e85){return _0x495e85[_0x75bc('0x39')](_0xdc5878)[_0x75bc('0x3a')](function(_0x1f9825){return _0x1f9825;});}return null;};}function removeEntity(_0x4fe482,_0x56d63d){return function(_0x1c1f15){if(_0x1c1f15){return _0x1c1f15[_0x75bc('0x3b')]()[_0x75bc('0x3a')](function(){var _0x3531d8=_0x1c1f15[_0x75bc('0x3c')]({'plain':!![]});var _0x7ed08f=_0x75bc('0x3d');return db[_0x75bc('0x3e')][_0x75bc('0x3b')]({'where':{'type':_0x7ed08f,'resourceId':_0x3531d8['id']}})[_0x75bc('0x3a')](function(){return _0x1c1f15;});})[_0x75bc('0x3a')](function(){_0x4fe482[_0x75bc('0x2e')](0xcc)[_0x75bc('0x3f')]();});}};}function handleEntityNotFound(_0x195c93,_0x2e3433){return function(_0x396a3c){if(!_0x396a3c){_0x195c93[_0x75bc('0x2d')](0x194);}return _0x396a3c;};}function handleError(_0x32354c,_0x385a34){_0x385a34=_0x385a34||0x1f4;return function(_0x25700a){logger[_0x75bc('0x28')](_0x25700a[_0x75bc('0x40')]);if(_0x25700a['name']){delete _0x25700a[_0x75bc('0x41')];}_0x32354c[_0x75bc('0x2e')](_0x385a34)[_0x75bc('0x42')](_0x25700a);};}exports[_0x75bc('0x43')]=function(_0x1e2449,_0x5a6acf){var _0xa2f0fd={'include':[{'model':db[_0x75bc('0x44')],'as':'mandatoryDispositionPause'}]},_0x23260b={},_0x27f22d={'count':0x0,'rows':[]};var _0x4df58c=_[_0x75bc('0x45')](db[_0x75bc('0x46')][_0x75bc('0x47')],function(_0xfcf3a7){return{'name':_0xfcf3a7[_0x75bc('0x48')],'type':_0xfcf3a7[_0x75bc('0x49')][_0x75bc('0x4a')]};});_0x23260b[_0x75bc('0x4b')]=_[_0x75bc('0x45')](_0x4df58c,'name');_0x23260b[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x1e2449['query']);_0x23260b['filters']=_[_0x75bc('0x4e')](_0x23260b[_0x75bc('0x4b')],_0x23260b['query']);_0xa2f0fd[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x23260b[_0x75bc('0x4b')],qs['fields'](_0x1e2449['query']['fields']));_0xa2f0fd['attributes']=_0xa2f0fd[_0x75bc('0x4f')][_0x75bc('0x50')]?_0xa2f0fd[_0x75bc('0x4f')]:_0x23260b['model'];if(!_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x51')](_0x75bc('0x52'))){_0xa2f0fd[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x31')]);_0xa2f0fd[_0x75bc('0x33')]=qs['offset'](_0x1e2449[_0x75bc('0x4c')]['offset']);}_0xa2f0fd['order']=qs['sort'](_0x1e2449[_0x75bc('0x4c')]['sort']);_0xa2f0fd[_0x75bc('0x53')]=qs['filters'](_[_0x75bc('0x54')](_0x1e2449[_0x75bc('0x4c')],_0x23260b[_0x75bc('0x55')]),_0x4df58c);if(_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x56')]){_0xa2f0fd['where']=_[_0x75bc('0x57')](_0xa2f0fd[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x4df58c,function(_0x588aae){if(_0x588aae[_0x75bc('0x49')]!=='VIRTUAL'){var _0x505402={};_0x505402[_0x588aae[_0x75bc('0x41')]]={'$like':'%'+_0x1e2449[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x505402;}})});}_0xa2f0fd=_[_0x75bc('0x57')]({},_0xa2f0fd,_0x1e2449['options']);var _0x56da52={'where':_0xa2f0fd['where']};return db[_0x75bc('0x46')]['count'](_0x56da52)['then'](function(_0x2c15e7){_0x27f22d[_0x75bc('0x32')]=_0x2c15e7;if(_0x1e2449['query'][_0x75bc('0x58')]){_0xa2f0fd[_0x75bc('0x59')]=[{'all':!![]}];}return db[_0x75bc('0x46')][_0x75bc('0x5a')](_0xa2f0fd);})[_0x75bc('0x3a')](function(_0x5a69d2){_0x27f22d[_0x75bc('0x5b')]=_0x5a69d2;return _0x27f22d;})[_0x75bc('0x3a')](respondWithFilteredResult(_0x5a6acf,_0xa2f0fd))[_0x75bc('0x2c')](handleError(_0x5a6acf,null));};exports[_0x75bc('0x5c')]=function(_0x468954,_0x152ba3){var _0x5169b0={'raw':![],'where':{'id':_0x468954[_0x75bc('0x5d')]['id']},'include':[{'model':db[_0x75bc('0x44')],'as':_0x75bc('0x5e')}]},_0x205d62={};_0x205d62[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0x46')]['rawAttributes']);_0x205d62[_0x75bc('0x4c')]=_['keys'](_0x468954[_0x75bc('0x4c')]);_0x205d62[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x205d62[_0x75bc('0x4b')],_0x205d62[_0x75bc('0x4c')]);_0x5169b0[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x205d62['model'],qs['fields'](_0x468954[_0x75bc('0x4c')][_0x75bc('0x5f')]));_0x5169b0[_0x75bc('0x4f')]=_0x5169b0[_0x75bc('0x4f')]['length']?_0x5169b0[_0x75bc('0x4f')]:_0x205d62[_0x75bc('0x4b')];if(_0x468954['query']['includeAll']){_0x5169b0['include']=[{'all':!![]}];}_0x5169b0=_[_0x75bc('0x57')]({},_0x5169b0,_0x468954['options']);return db['ChatWebsite']['find'](_0x5169b0)[_0x75bc('0x3a')](handleEntityNotFound(_0x152ba3,null))[_0x75bc('0x3a')](respondWithResult(_0x152ba3,null))['catch'](handleError(_0x152ba3,null));};exports[_0x75bc('0x60')]=function(_0x49332a,_0x41731a){return db['ChatWebsite'][_0x75bc('0x60')](_0x49332a[_0x75bc('0x61')],{})['then'](function(_0x424964){var _0x11ee50=_0x49332a[_0x75bc('0x62')][_0x75bc('0x3c')]({'plain':!![]});if(!_0x11ee50)throw new Error(_0x75bc('0x63'));if(_0x11ee50[_0x75bc('0x64')]==='user'){var _0x59b701=_0x424964[_0x75bc('0x3c')]({'plain':!![]});var _0x136b5e=_0x75bc('0x3d');return db[_0x75bc('0x65')]['find']({'where':{'name':_0x136b5e,'userProfileId':_0x11ee50[_0x75bc('0x66')]},'raw':!![]})['then'](function(_0x4395a2){if(_0x4395a2&&_0x4395a2['autoAssociation']===0x0){return db[_0x75bc('0x3e')][_0x75bc('0x60')]({'name':_0x59b701[_0x75bc('0x41')],'resourceId':_0x59b701['id'],'type':_0x4395a2[_0x75bc('0x41')],'sectionId':_0x4395a2['id']},{})[_0x75bc('0x3a')](function(){return _0x424964;});}else{return _0x424964;}})[_0x75bc('0x2c')](function(_0x592dce){logger[_0x75bc('0x28')](_0x75bc('0x67'),_0x592dce);throw _0x592dce;});}return _0x424964;})[_0x75bc('0x3a')](respondWithResult(_0x41731a,0xc9))[_0x75bc('0x2c')](handleError(_0x41731a,null));};exports[_0x75bc('0x39')]=function(_0x32ddba,_0x2ed005){if(_0x32ddba[_0x75bc('0x61')]['id']){delete _0x32ddba[_0x75bc('0x61')]['id'];}return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x32ddba[_0x75bc('0x5d')]['id']},'include':[{'model':db[_0x75bc('0x44')],'as':_0x75bc('0x5e')}]})['then'](handleEntityNotFound(_0x2ed005,null))['then'](saveUpdates(_0x32ddba[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x2ed005,null))['catch'](handleError(_0x2ed005,null));};exports[_0x75bc('0x3b')]=function(_0xf2db6f,_0x46ecd4){return db['ChatWebsite']['find']({'where':{'id':_0xf2db6f[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x46ecd4,null))['then'](removeEntity(_0x46ecd4,null))[_0x75bc('0x2c')](handleError(_0x46ecd4,null));};exports['describe']=function(_0x15c6e6,_0x506c82){return db['ChatWebsite'][_0x75bc('0x69')]()['then'](respondWithResult(_0x506c82,null))['catch'](handleError(_0x506c82,null));};exports[_0x75bc('0x6a')]=function(_0x35cd74,_0x43846b,_0x51b401){if(_0x35cd74[_0x75bc('0x61')]['id']){delete _0x35cd74[_0x75bc('0x61')]['id'];}return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x35cd74[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x43846b,null))[_0x75bc('0x3a')](function(_0x16fd3f){if(_0x16fd3f){_0x35cd74[_0x75bc('0x61')][_0x75bc('0x6b')]=_0x16fd3f['id'];return db['Disposition'][_0x75bc('0x60')](_0x35cd74['body']);}})[_0x75bc('0x3a')](respondWithResult(_0x43846b,null))[_0x75bc('0x2c')](handleError(_0x43846b,null));};exports[_0x75bc('0x6c')]=function(_0x33e44f,_0x5046a6,_0x380317){var _0x25815d={'raw':![],'where':{}};var _0x3564c6={};var _0x43abee={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x33e44f[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x5046a6,null))['then'](function(_0x236af0){if(_0x236af0){_0x3564c6[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0x6e')][_0x75bc('0x47')]);_0x3564c6[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x33e44f['query']);_0x3564c6['filters']=_[_0x75bc('0x4e')](_0x3564c6[_0x75bc('0x4b')],_0x3564c6[_0x75bc('0x4c')]);_0x25815d[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x3564c6['model'],qs['fields'](_0x33e44f['query'][_0x75bc('0x5f')]));_0x25815d[_0x75bc('0x4f')]=_0x25815d[_0x75bc('0x4f')][_0x75bc('0x50')]?_0x25815d[_0x75bc('0x4f')]:_0x3564c6[_0x75bc('0x4b')];if(!_0x33e44f[_0x75bc('0x4c')]['hasOwnProperty'](_0x75bc('0x52'))){_0x25815d[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x25815d['offset']=qs[_0x75bc('0x33')](_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x33')]);}_0x25815d[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0x33e44f['query'][_0x75bc('0x70')]);_0x25815d['where']=qs['filters'](_['pick'](_0x33e44f[_0x75bc('0x4c')],_0x3564c6[_0x75bc('0x55')]));_0x25815d[_0x75bc('0x53')][_0x75bc('0x6b')]=_0x236af0['id'];if(_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x56')]){_0x25815d[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x25815d[_0x75bc('0x53')],{'$or':_['map'](_0x25815d[_0x75bc('0x4f')],function(_0x487df5){var _0xbd7259={};_0xbd7259[_0x487df5]={'$like':'%'+_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0xbd7259;})});}_0x25815d=_[_0x75bc('0x57')]({},_0x25815d,_0x33e44f[_0x75bc('0x71')]);return db[_0x75bc('0x6e')][_0x75bc('0x32')]({'where':_0x25815d[_0x75bc('0x53')]})['then'](function(_0x5788da){_0x43abee[_0x75bc('0x32')]=_0x5788da;if(_0x33e44f[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x25815d[_0x75bc('0x59')]=[{'all':!![]}];}return db[_0x75bc('0x6e')][_0x75bc('0x5a')](_0x25815d);})[_0x75bc('0x3a')](function(_0x1f2844){_0x43abee[_0x75bc('0x5b')]=_0x1f2844;return _0x43abee;});}})[_0x75bc('0x3a')](respondWithFilteredResult(_0x5046a6,_0x25815d))['catch'](handleError(_0x5046a6,null));};exports[_0x75bc('0x72')]=function(_0x2831b,_0x5461a5,_0x128e69){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x2831b[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x5461a5,null))[_0x75bc('0x3a')](function(_0x89e881){if(_0x89e881){return _0x89e881[_0x75bc('0x72')](_0x2831b[_0x75bc('0x4c')]['ids']);}})[_0x75bc('0x3a')](respondWithStatusCode(_0x5461a5,null))[_0x75bc('0x2c')](handleError(_0x5461a5,null));};exports[_0x75bc('0x73')]=function(_0x65c0a0,_0x440473,_0xe681fc){if(_0x65c0a0[_0x75bc('0x61')]['id']){delete _0x65c0a0['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x65c0a0[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x440473,null))[_0x75bc('0x3a')](function(_0x1efda4){if(_0x1efda4){_0x65c0a0[_0x75bc('0x61')][_0x75bc('0x6b')]=_0x1efda4['id'];return db['CannedAnswer'][_0x75bc('0x60')](_0x65c0a0[_0x75bc('0x61')]);}})[_0x75bc('0x3a')](respondWithResult(_0x440473,null))[_0x75bc('0x2c')](handleError(_0x440473,null));};exports['getAnswers']=function(_0x2c35b6,_0x581d4d,_0x5ac697){var _0x567452={'raw':![],'where':{}};var _0x45545b={};var _0x30135b={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x2c35b6['params']['id']}})['then'](handleEntityNotFound(_0x581d4d,null))[_0x75bc('0x3a')](function(_0xd7cc8d){if(_0xd7cc8d){_0x45545b[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db['CannedAnswer'][_0x75bc('0x47')]);_0x45545b[_0x75bc('0x4c')]=_['keys'](_0x2c35b6['query']);_0x45545b[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x45545b[_0x75bc('0x4b')],_0x45545b['query']);_0x567452[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x45545b[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x5f')]));_0x567452['attributes']=_0x567452[_0x75bc('0x4f')]['length']?_0x567452[_0x75bc('0x4f')]:_0x45545b['model'];if(!_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x51')](_0x75bc('0x52'))){_0x567452['limit']=qs[_0x75bc('0x31')](_0x2c35b6[_0x75bc('0x4c')]['limit']);_0x567452[_0x75bc('0x33')]=qs['offset'](_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x33')]);}_0x567452[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x567452[_0x75bc('0x53')]=qs[_0x75bc('0x55')](_[_0x75bc('0x54')](_0x2c35b6[_0x75bc('0x4c')],_0x45545b[_0x75bc('0x55')]));_0x567452['where'][_0x75bc('0x6b')]=_0xd7cc8d['id'];if(_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x56')]){_0x567452[_0x75bc('0x53')]=_['merge'](_0x567452[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x567452[_0x75bc('0x4f')],function(_0xfc1108){var _0x4f2de5={};_0x4f2de5[_0xfc1108]={'$like':'%'+_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x4f2de5;})});}_0x567452=_[_0x75bc('0x57')]({},_0x567452,_0x2c35b6['options']);return db[_0x75bc('0x74')][_0x75bc('0x32')]({'where':_0x567452[_0x75bc('0x53')]})['then'](function(_0x3732e1){_0x30135b[_0x75bc('0x32')]=_0x3732e1;if(_0x2c35b6[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x567452[_0x75bc('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x75bc('0x5a')](_0x567452);})[_0x75bc('0x3a')](function(_0x2e1f74){_0x30135b[_0x75bc('0x5b')]=_0x2e1f74;return _0x30135b;});}})['then'](respondWithFilteredResult(_0x581d4d,_0x567452))[_0x75bc('0x2c')](handleError(_0x581d4d,null));};exports[_0x75bc('0x75')]=function(_0x5c2bf1,_0x18cff0,_0x531548){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x5c2bf1['params']['id']}})['then'](handleEntityNotFound(_0x18cff0,null))[_0x75bc('0x3a')](function(_0x3c2e4a){if(_0x3c2e4a){return _0x3c2e4a[_0x75bc('0x75')](_0x5c2bf1['query'][_0x75bc('0x76')]);}})[_0x75bc('0x3a')](respondWithStatusCode(_0x18cff0,null))[_0x75bc('0x2c')](handleError(_0x18cff0,null));};exports['addLogo']=function(_0x2aed68,_0x3b2488,_0x1a8fe3){_0x2aed68[_0x75bc('0x61')]['sitepic']=_0x2aed68[_0x75bc('0x77')][_0x75bc('0x78')];return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x2aed68[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x3b2488,null))[_0x75bc('0x3a')](saveUpdates(_0x2aed68[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x3b2488,null))[_0x75bc('0x2c')](handleError(_0x3b2488,null));};exports[_0x75bc('0x79')]=function(_0x4b2927,_0x56b174,_0x564424){_0x4b2927['body'][_0x75bc('0x7a')]=_0x4b2927[_0x75bc('0x77')][_0x75bc('0x78')];return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x4b2927['params']['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x56b174,null))[_0x75bc('0x3a')](saveUpdates(_0x4b2927[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x56b174,null))[_0x75bc('0x2c')](handleError(_0x56b174,null));};exports[_0x75bc('0x7b')]=function(_0x574d8e,_0x38fa0c,_0x5dd5fa){_0x574d8e[_0x75bc('0x61')][_0x75bc('0x7c')]=_0x574d8e[_0x75bc('0x77')]['filename'];return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x574d8e['params']['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x38fa0c,null))[_0x75bc('0x3a')](saveUpdates(_0x574d8e[_0x75bc('0x61')],null))['then'](respondWithResult(_0x38fa0c,null))[_0x75bc('0x2c')](handleError(_0x38fa0c,null));};exports[_0x75bc('0x7d')]=function(_0x39e626,_0x3cbd96,_0x213101){_0x39e626['body'][_0x75bc('0x7e')]=_0x39e626[_0x75bc('0x77')][_0x75bc('0x78')];return db[_0x75bc('0x46')]['find']({'where':{'id':_0x39e626[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x3cbd96,null))[_0x75bc('0x3a')](saveUpdates(_0x39e626[_0x75bc('0x61')],null))[_0x75bc('0x3a')](respondWithResult(_0x3cbd96,null))[_0x75bc('0x2c')](handleError(_0x3cbd96,null));};exports[_0x75bc('0x7f')]=function(_0x23932c,_0x5ef05a,_0x59b2d6){var _0x354f2e=path[_0x75bc('0x80')](config['root'],_0x75bc('0x81'));var _0x273652={'where':{'id':_0x23932c[_0x75bc('0x5d')]['id']},'attributes':['id',_0x75bc('0x82')],'raw':!![]};var _0x14db7c=![];return require(_0x75bc('0x16'))[_0x75bc('0x83')]()[_0x75bc('0x3a')](function(_0xe1fc91){if(_0xe1fc91){_0x14db7c=_0xe1fc91['custom'];}})[_0x75bc('0x3a')](function(){return db[_0x75bc('0x46')][_0x75bc('0x68')](_0x273652);})[_0x75bc('0x3a')](handleEntityNotFound(_0x5ef05a,null))[_0x75bc('0x3a')](function(_0x2e3b84){if(_0x2e3b84){if(!_[_0x75bc('0x84')](_0x2e3b84[_0x75bc('0x82')])){if(fs['existsSync'](path[_0x75bc('0x80')](config['root'],_0x75bc('0x85'),_0x2e3b84['sitepic']))&&_0x14db7c){_0x354f2e=path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x85'),_0x2e3b84[_0x75bc('0x82')]);}}return _0x5ef05a[_0x75bc('0x87')](_0x354f2e);}})[_0x75bc('0x2c')](handleError(_0x5ef05a,null));};exports[_0x75bc('0x88')]=function(_0x2c6fea,_0x193fa8,_0x133b7f){var _0x3b519b=path[_0x75bc('0x80')](config[_0x75bc('0x86')],'server/files/images/avatars/default_avatar.png');var _0xa55ab5={'where':{'id':_0x2c6fea[_0x75bc('0x5d')]['id']},'attributes':['id',_0x75bc('0x7a')],'raw':!![]};return db[_0x75bc('0x46')][_0x75bc('0x68')](_0xa55ab5)['then'](handleEntityNotFound(_0x193fa8,null))['then'](function(_0x173d89){if(_0x173d89){if(!_[_0x75bc('0x84')](_0x173d89[_0x75bc('0x7a')])){if(fs['existsSync'](path[_0x75bc('0x80')](config['root'],_0x75bc('0x89'),_0x173d89['agentAvatar']))){_0x3b519b=path[_0x75bc('0x80')](config['root'],_0x75bc('0x89'),_0x173d89[_0x75bc('0x7a')]);}}return _0x193fa8[_0x75bc('0x87')](_0x3b519b);}})['catch'](handleError(_0x193fa8,null));};exports['getCustomerAvatar']=function(_0xb51e6c,_0x250722,_0x514bec){var _0x53c269=path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x8a'));var _0x5cb0f0={'where':{'id':_0xb51e6c['params']['id']},'attributes':['id','customerAvatar',_0x75bc('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x75bc('0x68')](_0x5cb0f0)[_0x75bc('0x3a')](handleEntityNotFound(_0x250722,null))[_0x75bc('0x3a')](function(_0x182b3f){if(_0x182b3f){if(!_[_0x75bc('0x84')](_0x182b3f[_0x75bc('0x7c')])){if(fs[_0x75bc('0x8c')](path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x89'),_0x182b3f[_0x75bc('0x7c')]))&&_0x182b3f[_0x75bc('0x8b')]){_0x53c269=path[_0x75bc('0x80')](config['root'],_0x75bc('0x89'),_0x182b3f[_0x75bc('0x7c')]);}}return _0x250722[_0x75bc('0x87')](_0x53c269);}})[_0x75bc('0x2c')](handleError(_0x250722,null));};exports['getSystemAvatar']=function(_0x3a05d9,_0x55e8f8,_0x212f7a){var _0x2f0fd4=path[_0x75bc('0x80')](config[_0x75bc('0x86')],'server/files/images/avatars/system_avatar.png');var _0x544041={'where':{'id':_0x3a05d9['params']['id']},'attributes':['id',_0x75bc('0x7e')],'raw':!![]};return db[_0x75bc('0x46')][_0x75bc('0x68')](_0x544041)['then'](handleEntityNotFound(_0x55e8f8,null))[_0x75bc('0x3a')](function(_0x4a3275){if(_0x4a3275){if(!_[_0x75bc('0x84')](_0x4a3275[_0x75bc('0x7e')])){if(fs[_0x75bc('0x8c')](path['join'](config['root'],_0x75bc('0x89'),_0x4a3275[_0x75bc('0x7e')]))){_0x2f0fd4=path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0x89'),_0x4a3275['systemAvatar']);}}return _0x55e8f8[_0x75bc('0x87')](_0x2f0fd4);}})[_0x75bc('0x2c')](handleError(_0x55e8f8,null));};exports['notify']=function(_0x11ae6b,_0x3e7e9f,_0x4e5c1b){var _0x15d737=require(_0x75bc('0x8d'));var _0x9e1c9b=new _0x15d737();var _0x55a58e=_0x9e1c9b[_0x75bc('0x8e')](_0x11ae6b[_0x75bc('0x8f')]['user-agent'])[_0x75bc('0x90')]();var _0x58ce32={'body':_0x11ae6b[_0x75bc('0x61')],'channel':'chat'};var _0x55c409=[];var _0x2db6a8=[];var _0x23bfee={};var _0x813b96=![];return db[_0x75bc('0x91')][_0x75bc('0x69')]()[_0x75bc('0x3a')](function(_0x4c8a06){if(!_0x4c8a06){throw new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x94'));}_0x55c409=_[_0x75bc('0x95')](_[_0x75bc('0x4d')](_0x4c8a06),['createdAt',_0x75bc('0x96')]);_0x2db6a8=_[_0x75bc('0x95')](_['keys'](_0x4c8a06),[_0x75bc('0x97'),_0x75bc('0x96'),_0x75bc('0x98'),_0x75bc('0x99')]);if(_0x11ae6b['body']['id']){delete _0x11ae6b[_0x75bc('0x61')]['id'];}if(_['isNil'](_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9a')])){throw new db['Sequelize'][(_0x75bc('0x93'))](_0x75bc('0x9b'));}if(_['isNil'](_0x11ae6b['body'][_0x75bc('0x61')])||_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x61')]===''){throw new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x9c'));}if(_[_0x75bc('0x84')](_0x11ae6b['body'][_0x75bc('0x9d')])){throw new db['Sequelize'][(_0x75bc('0x93'))](_0x75bc('0x9e')+_0x2db6a8);}if(!_[_0x75bc('0x9f')](_0x2db6a8,_0x11ae6b['body'][_0x75bc('0x9d')])){throw new db[(_0x75bc('0x92'))]['ValidationError'](_0x75bc('0xa0')+_0x2db6a8);}_0x23bfee[_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9d')]]=_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9a')];})[_0x75bc('0x3a')](function(){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x11ae6b['params']['id']},'include':[{'model':db[_0x75bc('0xa1')],'as':_0x75bc('0xa2'),'include':[{'model':db[_0x75bc('0x91')],'as':_0x75bc('0xa3'),'where':_0x23bfee,'limit':0x1,'order':[[_0x75bc('0x96'),'DESC']]}]},{'model':db[_0x75bc('0xa4')],'as':_0x75bc('0xa5')}]});})[_0x75bc('0x3a')](handleEntityNotFound(_0x3e7e9f,null))[_0x75bc('0x3a')](function(_0x2c5176){if(_0x2c5176&&_0x2c5176[_0x75bc('0xa2')]){_0x58ce32[_0x75bc('0xa6')]=_0x2c5176;_0x58ce32[_0x75bc('0xa7')]=_0x2c5176['Applications'];_0x58ce32[_0x75bc('0xa8')]=_0x2c5176[_0x75bc('0xa2')];_0x58ce32[_0x75bc('0xa7')]=_[_0x75bc('0xa9')](_0x58ce32[_0x75bc('0xa7')],[_0x75bc('0xaa')],[_0x75bc('0xab')]);if(_0x58ce32['account']['Applications']){delete _0x58ce32[_0x75bc('0xa6')][_0x75bc('0xa5')];}if(_0x58ce32['account'][_0x75bc('0xa2')]&&_0x58ce32[_0x75bc('0xa6')][_0x75bc('0xa2')][_0x75bc('0xa3')]['length']){return _0x58ce32[_0x75bc('0xa6')][_0x75bc('0xa2')]['Contacts'][0x0];}var _0x4f56bb=_[_0x75bc('0x18')](_0x11ae6b['body'],{'firstName':_0x11ae6b[_0x75bc('0x61')]['from'],'ListId':_0x2c5176[_0x75bc('0x99')]});_0x4f56bb[_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9d')]]=_0x11ae6b[_0x75bc('0x61')][_0x75bc('0x9a')];return db[_0x75bc('0x91')][_0x75bc('0x60')](_0x4f56bb,{'fields':_0x55c409,'raw':!![]});}})[_0x75bc('0x3a')](handleEntityNotFound(_0x3e7e9f,null))['then'](function(_0x1f5c66){_0x58ce32[_0x75bc('0xac')]=_0x1f5c66;var _0x3939f5=_0x11ae6b['body'][_0x75bc('0xad')];if(_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xae')]){_0x3939f5=_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xae')];}else if(_0x11ae6b['headers']['x-forwarded-for']){_0x3939f5=_['first'](_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xaf')][_0x75bc('0xb0')](','));}if(_0x1f5c66){var _0xdd01c5={'ContactId':_0x1f5c66['id'],'ChatWebsiteId':_0x11ae6b['params']['id'],'from':(_0x1f5c66[_0x75bc('0xb1')]||'')+'\x20'+(_0x1f5c66[_0x75bc('0xb2')]||''),'customerIp':_0x3939f5,'customerPort':_0x11ae6b['headers'][_0x75bc('0xb3')]?_0x11ae6b[_0x75bc('0x8f')][_0x75bc('0xb3')]:null,'referer':_0x11ae6b['body'][_0x75bc('0xb4')],'browserName':_0x55a58e[_0x75bc('0xb5')]['name']&&_0x55a58e['browser'][_0x75bc('0xb6')]?util[_0x75bc('0xb7')](_0x75bc('0xb8'),_0x55a58e['browser'][_0x75bc('0x41')],_0x55a58e[_0x75bc('0xb5')][_0x75bc('0xb6')]):_0x75bc('0xb9'),'browserVersion':_0x55a58e[_0x75bc('0xb5')][_0x75bc('0xb6')]||'unknown','osName':util[_0x75bc('0xb7')](_0x75bc('0xb8'),_0x55a58e['os'][_0x75bc('0x41')],_0x55a58e['os'][_0x75bc('0xb6')]),'osVersion':_0x55a58e['os'][_0x75bc('0xb6')],'deviceModel':_0x55a58e['device'][_0x75bc('0x4b')]&&_0x55a58e[_0x75bc('0xba')][_0x75bc('0xbb')]?util[_0x75bc('0xb7')]('%s\x20%s\x20%s',_0x55a58e[_0x75bc('0xba')][_0x75bc('0x4b')],_0x55a58e[_0x75bc('0xba')][_0x75bc('0xbb')],_0x55a58e[_0x75bc('0xba')][_0x75bc('0x49')]):null,'deviceVendor':_0x55a58e['device'][_0x75bc('0xbb')],'deviceType':_0x55a58e[_0x75bc('0xba')]['type'],'formData':JSON[_0x75bc('0x27')](_0x11ae6b[_0x75bc('0x61')])};var _0x1d7cb4={'ChatWebsiteId':_0x11ae6b[_0x75bc('0x5d')]['id'],'closed':![]};if(_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')]){_0x1d7cb4[_0x75bc('0xbc')]=_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')];return db['ChatInteraction'][_0x75bc('0x68')]({'where':_0x1d7cb4})[_0x75bc('0x3a')](function(_0x14c515){if(_0x14c515){return[_0x14c515,![]];}_0xdd01c5[_0x75bc('0xbc')]=_0x11ae6b[_0x75bc('0x61')]['threadId'];_0xdd01c5['externalUrl']=_0x11ae6b['body'][_0x75bc('0xbd')];return db['ChatInteraction'][_0x75bc('0x60')](_0xdd01c5)['then'](function(_0x294e77){return[_0x294e77,!![]];});});}_0x1d7cb4['ContactId']=_0x1f5c66['id'];if(_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbe')]&&_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbe')]['id']){_0x1d7cb4['id']=_0x11ae6b[_0x75bc('0x61')]['interaction']['id'];return db['ChatInteraction'][_0x75bc('0x68')]({'where':_0x1d7cb4})[_0x75bc('0x3a')](function(_0x24638a){if(_0x24638a){return[_0x24638a,![]];}return db[_0x75bc('0xbf')][_0x75bc('0x60')](_0xdd01c5)[_0x75bc('0x3a')](function(_0x3f393f){return[_0x3f393f,!![]];});});}return db[_0x75bc('0xbf')]['create'](_0xdd01c5)['then'](function(_0x1666a0){return[_0x1666a0,!![]];});}})[_0x75bc('0xc0')](function(_0x40ad4d,_0x4926c3){if(_0x40ad4d){_0x813b96=_0x4926c3;if(!_0x4926c3){var _0x3655a3={'from':(_0x58ce32[_0x75bc('0xac')][_0x75bc('0xb1')]||'')+'\x20'+(_0x58ce32['contact']['lastName']||'')};if(_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')]&&_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xc1')]&&_0x11ae6b[_0x75bc('0x61')][_0x75bc('0xbc')]!=_0x11ae6b[_0x75bc('0x61')]['messageId']){_0x3655a3[_0x75bc('0xbc')]=_0x11ae6b['body'][_0x75bc('0xc1')];}return _0x40ad4d['update'](_0x3655a3);}else{return _0x40ad4d;}}})['then'](function(_0x703dc2){_0x58ce32[_0x75bc('0xbe')]=_0x703dc2[_0x75bc('0x3c')]({'plain':!![]});_0x58ce32[_0x75bc('0xbe')]['created']=_0x813b96;if(_0x58ce32[_0x75bc('0xbe')][_0x75bc('0xc2')]){if(_0x58ce32[_0x75bc('0xa6')]['autoclose']){_0x58ce32[_0x75bc('0xa7')]['push']({'id':0x0,'priority':_0x58ce32['applications']['length']+0x1,'app':'close','appdata':_0x75bc('0xc3'),'interval':_0x75bc('0xc4')});}}return db[_0x75bc('0xc5')][_0x75bc('0x60')]({'body':_0x11ae6b['body'][_0x75bc('0x61')],'ChatWebsiteId':_0x11ae6b['params']['id'],'ChatInteractionId':_0x703dc2['id'],'direction':'in','ContactId':_0x58ce32[_0x75bc('0xac')]['id'],'AttachmentId':_0x11ae6b[_0x75bc('0x61')]['AttachmentId']});})[_0x75bc('0x3a')](function(_0x44310f){_0x58ce32['message']=_0x44310f;if(_0x58ce32[_0x75bc('0xbe')]['UserId']){return db[_0x75bc('0xc6')][_0x75bc('0x68')]({'attributes':['id',_0x75bc('0x41')],'where':{'id':_0x58ce32[_0x75bc('0xbe')]['UserId']}})[_0x75bc('0x3a')](function(_0x2097e4){if(_0x2097e4){_0x58ce32[_0x75bc('0xa7')][_0x75bc('0xc7')]({'id':0x0,'priority':0x0,'app':_0x75bc('0xc8'),'appdata':_0x2097e4[_0x75bc('0x41')]+','+(_0x58ce32[_0x75bc('0xa6')][_0x75bc('0xc9')]||0xa),'interval':_0x75bc('0xc4')});_0x58ce32[_0x75bc('0xca')]=!![];}return respondWithRpcPromise(_0x75bc('0xcb'),_0x75bc('0xcc'),_0x58ce32);});}return respondWithRpcPromise(_0x75bc('0xcb'),_0x75bc('0xcc'),_0x58ce32);})[_0x75bc('0x3a')](function(_0x158cac){respondWithRpcPromise(_0x75bc('0xcd'),_0x75bc('0xcd'),{'event':_0x75bc('0xce'),'message':_0x158cac},client9002);return _0x158cac;})[_0x75bc('0x3a')](respondWithResult(_0x3e7e9f,null))[_0x75bc('0x2c')](handleError(_0x3e7e9f,null));};exports[_0x75bc('0xcf')]=function(_0x1c8f15,_0x30de25,_0x184bdd){var _0x248f48,_0x4f62d9,_0x331d26;var _0xb1429c=[];var _0x381646=[];var _0x11295e={};var _0x8827ef=_0x1c8f15[_0x75bc('0xd0')]||[];var _0x1e1989=[];var _0x3eec48;return db[_0x75bc('0x91')][_0x75bc('0x69')]()[_0x75bc('0x3a')](function(_0xd89b55){if(!_0xd89b55){throw new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x94'));}_0x381646=_['difference'](_[_0x75bc('0x4d')](_0xd89b55),[_0x75bc('0x97'),_0x75bc('0x96')]);_0xb1429c=_[_0x75bc('0x95')](_[_0x75bc('0x4d')](_0xd89b55),[_0x75bc('0x97'),'updatedAt',_0x75bc('0x98'),_0x75bc('0x99')]);if(_0x1c8f15[_0x75bc('0x61')]['id']){delete _0x1c8f15['body']['id'];}if(_['isNil'](_0x1c8f15['body']['from'])){throw _0x30de25[_0x75bc('0x2e')](0x1f4)['send'](new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x9b')));}if(_[_0x75bc('0x84')](_0x1c8f15[_0x75bc('0x61')][_0x75bc('0x61')])||_0x1c8f15[_0x75bc('0x61')][_0x75bc('0x61')]===''){throw _0x30de25['status'](0x1f4)[_0x75bc('0x42')](new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0x9c')));}if(_[_0x75bc('0x84')](_0x1c8f15['body'][_0x75bc('0xd1')])){throw _0x30de25[_0x75bc('0x2e')](0x1f4)[_0x75bc('0x42')](new db[(_0x75bc('0x92'))][(_0x75bc('0x93'))](_0x75bc('0xd2')+_0xb1429c));}if(!_[_0x75bc('0x9f')](_0xb1429c,_0x1c8f15[_0x75bc('0x61')][_0x75bc('0xd1')])){throw _0x30de25['status'](0x1f4)['send'](new db[(_0x75bc('0x92'))]['ValidationError'](_0x75bc('0xd3')+_0xb1429c));}_0x11295e[_0x1c8f15[_0x75bc('0x61')][_0x75bc('0xd1')]]=_0x1c8f15['body'][_0x75bc('0x9a')];})['then'](function(){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x1c8f15[_0x75bc('0x5d')]['id']},'include':[{'model':db[_0x75bc('0xa1')],'as':'List'},{'model':db[_0x75bc('0xd4')],'as':_0x75bc('0xd4')}]});})[_0x75bc('0x3a')](handleEntityNotFound(_0x30de25,null))[_0x75bc('0x3a')](function(_0xe5d059){if(_0xe5d059&&_0xe5d059[_0x75bc('0xa2')]){_0x4f62d9=_0xe5d059;var _0x1a1da3=_['defaults'](_0x1c8f15['body'],{'firstName':_0x1c8f15[_0x75bc('0x61')]['from'],'phone':_0x1c8f15[_0x75bc('0x61')][_0x75bc('0x9a')],'ListId':_0xe5d059[_0x75bc('0x99')]});_0x1a1da3[_0x1c8f15[_0x75bc('0x61')][_0x75bc('0xd1')]]=_0x1c8f15['body'][_0x75bc('0x9a')];return db[_0x75bc('0x91')][_0x75bc('0xd5')]({'where':_0x11295e,'defaults':_0x1a1da3});}})[_0x75bc('0xc0')](function(_0x201ba1){if(_0x201ba1){_0x331d26=_0x201ba1;var _0x3a4fa7=fs[_0x75bc('0xd6')](path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0xd7')),_0x75bc('0xd8'));var _0x1fd704=ejs['render'](_0x3a4fa7,{'body':_['toPairs'](_0x1c8f15['body'][_0x75bc('0x61')]),'bodyTitle':_0x4f62d9[_0x75bc('0xd9')]});return db[_0x75bc('0xda')][_0x75bc('0x60')]({'body':_0x1fd704,'ContactId':_0x201ba1['id'],'ChatWebsiteId':_0x4f62d9['id']});}})[_0x75bc('0x3a')](function(_0x4282f0){_0x3eec48=_0x4282f0;if(_0x8827ef[_0x75bc('0x50')]){var _0x273c51=_0x8827ef[_0x75bc('0x45')](function(_0x4749b0){return{'name':_0x4749b0[_0x75bc('0xdb')],'basename':_0x4749b0['filename'],'type':_0x4749b0[_0x75bc('0xdc')],'ChatOfflineMessageId':_0x4282f0['id']};});_0x1e1989=_0x273c51['map'](_0x522a43=>{var _0x18e08c={'filename':_0x522a43[_0x75bc('0x41')],'path':path[_0x75bc('0x80')](config[_0x75bc('0x86')],_0x75bc('0xdd'),'files',_0x75bc('0xde'),'offline-chat',_0x522a43[_0x75bc('0xdf')])};return _0x18e08c;});if(!_0x4f62d9[_0x75bc('0xe0')]){return db['sequelize'][_0x75bc('0xe1')](function(_0x30e61a){return db[_0x75bc('0xe2')][_0x75bc('0xe3')](_0x273c51,{'transaction':_0x30e61a});});}}})[_0x75bc('0x3a')](function(){if(_0x3eec48){_0x248f48=_0x3eec48;return db[_0x75bc('0xd4')][_0x75bc('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x75bc('0xe4')],'as':_0x75bc('0xe5'),'raw':!![]}]});}})['then'](function(_0x2f8eb9){if(_0x2f8eb9&&_0x2f8eb9['Smtp']&&_0x4f62d9['forwardOffline']&&_0x4f62d9[_0x75bc('0xe6')]){var _0x37cff2={'tls':{'rejectUnauthorized':![]}};if(_0x2f8eb9[_0x75bc('0xe5')]['service']){_0x37cff2[_0x75bc('0xe7')]=_0x2f8eb9[_0x75bc('0xe5')]['service'];}else{_0x37cff2['host']=_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0xe8')];_0x37cff2[_0x75bc('0xe9')]=_0x2f8eb9['Smtp'][_0x75bc('0xe9')];_0x37cff2[_0x75bc('0xea')]=_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0xea')];}if(_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0xeb')]){_0x37cff2[_0x75bc('0xec')]={'user':_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0x62')],'pass':_0x2f8eb9['Smtp'][_0x75bc('0xed')]};}return respondWithRpcPromise(_0x75bc('0xee'),_0x75bc('0xef'),{'account':_0x37cff2,'message':{'from':util[_0x75bc('0xb7')](_0x75bc('0xf0'),_0x2f8eb9['name'],_0x2f8eb9[_0x75bc('0xf1')]||_0x2f8eb9[_0x75bc('0xe5')][_0x75bc('0x62')]),'to':_0x4f62d9[_0x75bc('0xe6')],'subject':_0x4f62d9[_0x75bc('0xf2')],'html':_0x248f48[_0x75bc('0x61')],'attachments':_0x1e1989}},client9003)[_0x75bc('0x3a')](function(){return _0x248f48;})[_0x75bc('0x2c')](function(_0x5c4eb9){console[_0x75bc('0x28')](_0x5c4eb9);});}})[_0x75bc('0x3a')](function(){if(_0x4f62d9&&_0x4f62d9[_0x75bc('0xe0')]&&_0x4f62d9[_0x75bc('0xf3')]){var _0x132f04=[];if(_0x8827ef[_0x75bc('0x50')]){_0x132f04=_0x8827ef['map'](function(_0x251788){return{'name':_0x251788[_0x75bc('0xdb')],'basename':_0x251788[_0x75bc('0x78')],'type':_0x251788[_0x75bc('0xdc')],'ChatOfflineMessageId':_0x3eec48['id']};});}var _0x351598;if(!_[_0x75bc('0x84')](_0x4f62d9['subjectOffline'])){var _0x2eb455=_[_0x75bc('0x45')](_0x1c8f15[_0x75bc('0x61')],function(_0x16dbbf){return _0x16dbbf;});var _0x36cc1d=_[_0x75bc('0xf4')](_0x2eb455)[0x0];var _0x4077f4=_[_0x75bc('0xf5')](_0x36cc1d,function(_0x4cfd32){return _0x4cfd32;});_0x351598=_0x4077f4[0x1][_0x4f62d9[_0x75bc('0xf6')]];}var _0x45356c={'from':_0x331d26[_0x75bc('0xf1')],'firstName':_0x331d26['firstName'],'lastName':_0x331d26[_0x75bc('0xb2')],'mapKey':'email','message':{'from':_0x331d26[_0x75bc('0xf1')],'to':_0x4f62d9[_0x75bc('0xd4')][_0x75bc('0xf1')],'cc':'','subject':_['isNil'](_0x351598)?_0x4f62d9[_0x75bc('0xf2')]:_0x351598,'messageId':'','sentAt':new Date(),'attach':_0x132f04[_0x75bc('0x50')],'attachments':_0x132f04,'originChannel':_0x75bc('0xf7'),'ChatWebsiteId':_0x4f62d9['id'],'ChatOfflineMessageId':_0x248f48['id'],'originTo':_0x4f62d9[_0x75bc('0xd4')][_0x75bc('0xf1')]},'body':_0x248f48[_0x75bc('0x61')]};var _0x5295a5={'account':{'id':_0x4f62d9['MailAccountId']},'body':_0x45356c,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x75bc('0xf8'),_0x5295a5,client9001)['then'](function(){return _0x248f48;})[_0x75bc('0x2c')](function(_0x5ba8df){console[_0x75bc('0x28')](_0x5ba8df);});}return;})[_0x75bc('0x3a')](function(){if(_0x248f48){return _0x248f48;}})['then'](respondWithResult(_0x30de25,null))[_0x75bc('0x2c')](function(_0x2b1440){console[_0x75bc('0x28')](_0x75bc('0x2c'),_0x2b1440);for(var _0xacea54 of _0x8827ef){var _0x4b6e75=path[_0x75bc('0x80')](config['root'],'server',_0x75bc('0xd0'),_0x75bc('0xde'),'offline-chat',_0xacea54[_0x75bc('0x78')]);fs_extra['remove'](_0x4b6e75)[_0x75bc('0x2c')](function(_0x496eb6){console[_0x75bc('0x28')](_0x75bc('0xf9'),_0x4b6e75,_0x496eb6);});}});};exports[_0x75bc('0xfa')]=function(_0x665540,_0x19d03e,_0x3ae1c6){return db[_0x75bc('0xbf')][_0x75bc('0x68')]({'where':{'id':_0x665540[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19d03e,null))[_0x75bc('0x3a')](function(_0x3a9a04){if(_0x3a9a04){return _0x3a9a04[_0x75bc('0xfa')](_0x665540['body'][_0x75bc('0x76')],_['omit'](_0x665540['body'],[_0x75bc('0x76'),'id'])||{});}})[_0x75bc('0x3a')](respondWithResult(_0x19d03e,null))[_0x75bc('0x2c')](handleError(_0x19d03e,null));};exports[_0x75bc('0xfb')]=function(_0x351f15,_0x18a86b,_0x3517fe){var _0x3bbde4={'raw':![],'where':{}};var _0x3bdeb7={};var _0x5acb09={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x351f15[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x18a86b,null))['then'](function(_0x2c2c51){if(_0x2c2c51){_0x3bdeb7[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0xbf')][_0x75bc('0x47')]);_0x3bdeb7[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x351f15[_0x75bc('0x4c')]);_0x3bdeb7[_0x75bc('0x55')]=_['intersection'](_0x3bdeb7[_0x75bc('0x4b')],_0x3bdeb7['query']);_0x3bbde4[_0x75bc('0x4f')]=_['intersection'](_0x3bdeb7[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0x351f15[_0x75bc('0x4c')]['fields']));_0x3bbde4[_0x75bc('0x4f')]=_0x3bbde4[_0x75bc('0x4f')][_0x75bc('0x50')]?_0x3bbde4[_0x75bc('0x4f')]:_0x3bdeb7[_0x75bc('0x4b')];if(!_0x351f15[_0x75bc('0x4c')]['hasOwnProperty'](_0x75bc('0x52'))){_0x3bbde4[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x351f15[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x3bbde4[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0x351f15[_0x75bc('0x4c')][_0x75bc('0x33')]);}_0x3bbde4[_0x75bc('0x6f')]=qs['sort'](_0x351f15['query']['sort']);_0x3bbde4[_0x75bc('0x53')]=qs['filters'](_[_0x75bc('0x54')](_0x351f15[_0x75bc('0x4c')],_0x3bdeb7['filters']));_0x3bbde4[_0x75bc('0x53')][_0x75bc('0x6b')]=_0x2c2c51['id'];if(_0x351f15[_0x75bc('0x4c')]['filter']){_0x3bbde4[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x3bbde4[_0x75bc('0x53')],{'$or':_['map'](_0x3bbde4[_0x75bc('0x4f')],function(_0x5606b2){var _0x537344={};_0x537344[_0x5606b2]={'$like':'%'+_0x351f15[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x537344;})});}_0x3bbde4=_[_0x75bc('0x57')]({},_0x3bbde4,_0x351f15[_0x75bc('0x71')]);return db[_0x75bc('0xbf')]['count']({'where':_0x3bbde4['where']})[_0x75bc('0x3a')](function(_0x396a77){_0x5acb09['count']=_0x396a77;if(_0x351f15[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x3bbde4[_0x75bc('0x59')]=[{'model':db[_0x75bc('0x91')],'as':_0x75bc('0xfc'),'required':![]},{'model':db[_0x75bc('0xc6')],'as':_0x75bc('0xfd'),'attributes':[_0x75bc('0x41'),'fullname',_0x75bc('0xfe')],'required':![]},{'model':db[_0x75bc('0xff')],'as':'Tags','attributes':['id',_0x75bc('0x41'),_0x75bc('0x100')],'where':_0x351f15[_0x75bc('0x4c')]['tag']?{'id':_0x351f15[_0x75bc('0x4c')][_0x75bc('0x101')]}:undefined,'required':_0x351f15['query'][_0x75bc('0x101')]?!![]:![]}];}return db['ChatInteraction'][_0x75bc('0x5a')](_0x3bbde4);})[_0x75bc('0x3a')](function(_0x48e6f5){_0x5acb09[_0x75bc('0x5b')]=_0x48e6f5;return _0x5acb09;});}})[_0x75bc('0x3a')](respondWithFilteredResult(_0x18a86b,_0x3bbde4))['catch'](handleError(_0x18a86b,null));};function iftimePromise(_0x7425c5,_0xe78805){return respondWithRpcPromise('Command',_0x75bc('0x102'),{'command':_0xe78805[_0x75bc('0x103')]?util[_0x75bc('0xb7')](_0x75bc('0x104'),_0x7425c5[_0x75bc('0x105')],_0xe78805[_0x75bc('0x103')]):util[_0x75bc('0xb7')]('iftime\x20%s',_0x7425c5[_0x75bc('0x105')])},client9002)[_0x75bc('0x3a')](function(_0x54eb8c){var _0x230b8f=_0x54eb8c&&_0x54eb8c['indexOf'](_0x75bc('0x106'))>=0x0?!![]:![];logger[_0x75bc('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xe78805['id'],_0x7425c5['id'],_0x7425c5[_0x75bc('0x105')],_0x230b8f?_0x75bc('0x107'):_0x75bc('0x108'),_0xe78805[_0x75bc('0x103')]?_0xe78805['timezone']:_0x75bc('0x109'));return _0x230b8f;})[_0x75bc('0x2c')](function(_0x306c87){logger[_0x75bc('0x28')](_0x75bc('0x10a'),_0xe78805['id'],_0x7425c5['id'],_0x7425c5[_0x75bc('0x105')],util[_0x75bc('0x10b')](_0x306c87,{'showHidden':![],'depth':null}),_0xe78805[_0x75bc('0x103')]?_0xe78805[_0x75bc('0x103')]:_0x75bc('0x109'));return![];});}exports[_0x75bc('0x102')]=function(_0x380096,_0x252384,_0xeb484d){var _0x534bf6=0x0;var _0x2e836e=0x0;var _0x546eb7=![];var _0x5cc784;var _0x2ebef8;return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x380096[_0x75bc('0x5d')]['id']},'include':[{'model':db['Interval'],'as':_0x75bc('0x10c'),'include':[{'model':db[_0x75bc('0x10c')],'as':_0x75bc('0x10d'),'attributes':['id',_0x75bc('0x105')],'raw':!![]}]}]})[_0x75bc('0x3a')](handleEntityNotFound(_0x252384,null))[_0x75bc('0x3a')](function(_0x51181b){if(_0x51181b){_0x5cc784=_0x51181b;return _0x51181b[_0x75bc('0x10e')]({'raw':!![]});}})[_0x75bc('0x3a')](function(_0xfeb939){if(_0x5cc784){if(_0xfeb939){_0x2ebef8=_0xfeb939;}}return require(_0x75bc('0x16'))[_0x75bc('0x83')]();})['then'](function(_0x200bb2){if(_0x200bb2){_0x2e836e=_0x200bb2[_0x75bc('0x10f')];_0x546eb7=_0x200bb2[_0x75bc('0x110')];}})[_0x75bc('0x3a')](function(){return db[_0x75bc('0xbf')][_0x75bc('0x32')]({'where':{'closed':![]}});})['then'](function(_0x12717c){_0x534bf6=_0x12717c;if(_0x2e836e&&_0x12717c>_0x2e836e){return db[_0x75bc('0x111')][_0x75bc('0x6d')]({'where':{'id':0x1}})[_0x75bc('0x3a')](function(_0x5a05ec){if(_0x5a05ec){_0x5a05ec[_0x75bc('0x112')](_0x75bc('0x113'));}});}})[_0x75bc('0x3a')](function(){if(_0x5cc784[_0x75bc('0x10c')]&&_0x5cc784[_0x75bc('0x10c')][_0x75bc('0x10d')]){var _0x2b2297=[];for(var _0x2f7e86=0x0;_0x2f7e86<_0x5cc784[_0x75bc('0x10c')]['Intervals'][_0x75bc('0x50')];_0x2f7e86++){var _0xb9eca2=_0x5cc784[_0x75bc('0x10c')][_0x75bc('0x10d')][_0x2f7e86][_0x75bc('0x3c')]({'plain':!![]});_0x2b2297[_0x75bc('0x114')](iftimePromise(_0xb9eca2,_0x5cc784));}return BPromise[_0x75bc('0x115')](_0x2b2297)[_0x75bc('0x3a')](function(_0x364a78){return _[_0x75bc('0x116')](_0x364a78);});}else{return!![];}})[_0x75bc('0x3a')](function(_0xf0d289){var _0x323c4b=fs[_0x75bc('0xd6')](path[_0x75bc('0x80')](config['root'],'server/files/chat/iframe.ejs'),_0x75bc('0xd8'));var _0x3c259c={'remote':_0x5cc784[_0x75bc('0x117')],'query':querystring[_0x75bc('0x27')](_[_0x75bc('0x57')](_0x5cc784[_0x75bc('0x3c')]({'plain':!![]}),{'customerIp':_0x380096[_0x75bc('0x8f')][_0x75bc('0xaf')]||_0x380096[_0x75bc('0x8f')]['x-real-ip']||_0x380096[_0x75bc('0x118')][_0x75bc('0x119')]||_0x380096['ip'],'referer':_0x380096[_0x75bc('0x8f')]['referer'],'openedInteractions':_0x534bf6,'maxInteractions':_0x2e836e,'virtual':_0x546eb7['virtual'],'online':_0xf0d289,'custom':_0x546eb7}))[_0x75bc('0x11a')](/'/g,'\x5c\x27')};_0x252384[_0x75bc('0x42')](ejs[_0x75bc('0x11b')](Mustache[_0x75bc('0x11b')](_0x323c4b,_0x3c259c),{'proactiveActions':_0x2ebef8,'alignment':_0x5cc784[_0x75bc('0x11c')],'verticalAlignment':_0x5cc784[_0x75bc('0x11d')],'div_color':_0x5cc784[_0x75bc('0x100')],'text_color':_0x5cc784[_0x75bc('0x11e')],'button_color':_0x5cc784[_0x75bc('0x11f')],'background_color':_0x5cc784[_0x75bc('0x120')]}));})[_0x75bc('0x2c')](handleError(_0x252384,null));};exports['addApplications']=function(_0x4a9368,_0x7e7be0,_0x1c8ff1){return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x4a9368[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x7e7be0,null))[_0x75bc('0x3a')](function(_0x16e4d0){if(_0x16e4d0){return db[_0x75bc('0x121')][_0x75bc('0xe1')](function(_0x3cf754){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x4a9368[_0x75bc('0x5d')]['id']},'transaction':_0x3cf754})[_0x75bc('0x3a')](function(_0x4bc3e2){var _0x5740c2=_[_0x75bc('0x45')](_0x4a9368[_0x75bc('0x61')],function(_0x354521){_0x354521['ChatWebsiteId']=_0x4a9368[_0x75bc('0x5d')]['id'];return _0x354521;});return db[_0x75bc('0xa4')][_0x75bc('0xe3')](_0x5740c2,{'transaction':_0x3cf754});});})[_0x75bc('0x3a')](function(){return db[_0x75bc('0xa4')][_0x75bc('0x122')]({'where':{'ChatWebsiteId':_0x4a9368[_0x75bc('0x5d')]['id']},'order':_0x75bc('0xaa')});});}})[_0x75bc('0x3a')](respondWithResult(_0x7e7be0,null))['catch'](handleError(_0x7e7be0,null));};exports[_0x75bc('0x123')]=function(_0xaa70ef,_0x31ae89,_0x107c3b){var _0x191fcb={};var _0x21b835={};var _0x20f365;var _0x149d6d;return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0xaa70ef[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x31ae89,null))[_0x75bc('0x3a')](function(_0x1b4383){if(_0x1b4383){_0x20f365=_0x1b4383;_0x21b835[_0x75bc('0x4b')]=_[_0x75bc('0x4d')](db[_0x75bc('0xa4')][_0x75bc('0x47')]);_0x21b835['query']=_[_0x75bc('0x4d')](_0xaa70ef[_0x75bc('0x4c')]);_0x21b835[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x21b835['model'],_0x21b835[_0x75bc('0x4c')]);_0x191fcb[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x21b835[_0x75bc('0x4b')],qs['fields'](_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x5f')]));_0x191fcb[_0x75bc('0x4f')]=_0x191fcb['attributes']['length']?_0x191fcb[_0x75bc('0x4f')]:_0x21b835[_0x75bc('0x4b')];_0x191fcb[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x191fcb[_0x75bc('0x53')]=qs[_0x75bc('0x55')](_[_0x75bc('0x54')](_0xaa70ef[_0x75bc('0x4c')],_0x21b835[_0x75bc('0x55')]));if(_0xaa70ef['query'][_0x75bc('0x56')]){_0x191fcb[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x191fcb[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x191fcb['attributes'],function(_0xcf42e0){var _0x12707c={};_0x12707c[_0xcf42e0]={'$like':'%'+_0xaa70ef['query'][_0x75bc('0x56')]+'%'};return _0x12707c;})});}_0x191fcb=_[_0x75bc('0x57')]({},_0x191fcb,_0xaa70ef[_0x75bc('0x71')]);return _0x20f365[_0x75bc('0x123')](_0x191fcb);}})['then'](function(_0x2e86db){if(_0x2e86db){_0x149d6d=_0x2e86db['length'];if(!_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x51')]('nolimit')){_0x191fcb[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0xaa70ef[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x191fcb[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0xaa70ef[_0x75bc('0x4c')]['offset']);}return _0x20f365['getApplications'](_0x191fcb);}})[_0x75bc('0x3a')](function(_0x494e8a){if(_0x494e8a){return _0x494e8a?{'count':_0x149d6d,'rows':_0x494e8a}:null;}})[_0x75bc('0x3a')](respondWithResult(_0x31ae89,null))[_0x75bc('0x2c')](handleError(_0x31ae89,null));};exports[_0x75bc('0x124')]=function(_0x2e5e0d,_0x4cfe33,_0x2800fc){return db[_0x75bc('0x125')][_0x75bc('0x68')]({'where':{'id':_0x2e5e0d[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4cfe33,null))[_0x75bc('0x3a')](function(_0x8e3685){if(_0x8e3685){return _0x8e3685['addProactiveActions'](_0x2e5e0d['body']['ids'],_['omit'](_0x2e5e0d['body'],[_0x75bc('0x76'),'id'])||{});}})[_0x75bc('0x3a')](respondWithResult(_0x4cfe33,null))[_0x75bc('0x2c')](handleError(_0x4cfe33,null));};exports[_0x75bc('0x10e')]=function(_0x5543ce,_0x44d5d4,_0x525e06){var _0x138cb6={};var _0xb20305={};var _0x4b5bbb;var _0x4ed7f1;return db[_0x75bc('0x46')]['findOne']({'where':{'id':_0x5543ce[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x44d5d4,null))[_0x75bc('0x3a')](function(_0x35c076){if(_0x35c076){_0x4b5bbb=_0x35c076;_0xb20305['model']=_[_0x75bc('0x4d')](db[_0x75bc('0x126')][_0x75bc('0x47')]);_0xb20305[_0x75bc('0x4c')]=_['keys'](_0x5543ce[_0x75bc('0x4c')]);_0xb20305['filters']=_[_0x75bc('0x4e')](_0xb20305[_0x75bc('0x4b')],_0xb20305[_0x75bc('0x4c')]);_0x138cb6[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0xb20305['model'],qs[_0x75bc('0x5f')](_0x5543ce[_0x75bc('0x4c')]['fields']));_0x138cb6['attributes']=_0x138cb6['attributes'][_0x75bc('0x50')]?_0x138cb6[_0x75bc('0x4f')]:_0xb20305['model'];_0x138cb6['order']=qs[_0x75bc('0x70')](_0x5543ce[_0x75bc('0x4c')]['sort']);_0x138cb6['where']=qs[_0x75bc('0x55')](_[_0x75bc('0x54')](_0x5543ce[_0x75bc('0x4c')],_0xb20305[_0x75bc('0x55')]));if(_0x5543ce[_0x75bc('0x4c')]['filter']){_0x138cb6['where']=_[_0x75bc('0x57')](_0x138cb6[_0x75bc('0x53')],{'$or':_['map'](_0x138cb6[_0x75bc('0x4f')],function(_0x207fdc){var _0x2a4666={};_0x2a4666[_0x207fdc]={'$like':'%'+_0x5543ce[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x2a4666;})});}_0x138cb6=_[_0x75bc('0x57')]({},_0x138cb6,_0x5543ce['options']);return _0x4b5bbb[_0x75bc('0x10e')](_0x138cb6);}})[_0x75bc('0x3a')](function(_0x5f1931){if(_0x5f1931){_0x4ed7f1=_0x5f1931[_0x75bc('0x50')];if(!_0x5543ce[_0x75bc('0x4c')]['hasOwnProperty']('nolimit')){_0x138cb6['limit']=qs[_0x75bc('0x31')](_0x5543ce[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x138cb6[_0x75bc('0x33')]=qs['offset'](_0x5543ce[_0x75bc('0x4c')][_0x75bc('0x33')]);}return _0x4b5bbb[_0x75bc('0x10e')](_0x138cb6);}})[_0x75bc('0x3a')](function(_0xe88e02){if(_0xe88e02){return _0xe88e02?{'count':_0x4ed7f1,'rows':_0xe88e02}:null;}})['then'](respondWithResult(_0x44d5d4,null))[_0x75bc('0x2c')](handleError(_0x44d5d4,null));};exports[_0x75bc('0x127')]=function(_0x362cbb,_0x4ffcb2,_0x41aed7){var _0x2e292c=_0x362cbb[_0x75bc('0x4c')][_0x75bc('0x128')]===_0x75bc('0x129')?_0x75bc('0x12a'):'onlineForm';return db[_0x75bc('0x46')][_0x75bc('0x68')]({'attributes':['id',_0x2e292c],'where':{'id':_0x362cbb['params']['id']}})['then'](handleEntityNotFound(_0x4ffcb2,null))[_0x75bc('0x3a')](function(_0x44e02d){if(_0x44e02d){var _0x2fc4ad=_0x44e02d[_0x2e292c];var _0x8ccba0=_0x2fc4ad&&_0x2fc4ad[_0x75bc('0x12b')]?_0x2fc4ad[_0x75bc('0x12b')]:[];_0x4ffcb2[_0x75bc('0x42')]({'fromKey':_['isNil'](_0x2fc4ad[_0x75bc('0x12c')])?undefined:_0x2fc4ad[_0x75bc('0x12c')],'count':_0x8ccba0['length'],'rows':_0x8ccba0});}})['catch'](handleError(_0x4ffcb2,null));};exports[_0x75bc('0x12d')]=function(_0x4e7347,_0x126f49,_0x1f827e){var _0x53a449={'raw':![],'where':{}};var _0x50ed3e={};var _0x3c9675={'count':0x0,'rows':[]};return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0x4e7347[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x126f49,null))[_0x75bc('0x3a')](function(_0x5b66cc){if(_0x5b66cc){_0x50ed3e['model']=_[_0x75bc('0x4d')](db[_0x75bc('0xda')]['rawAttributes']);_0x50ed3e[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0x4e7347[_0x75bc('0x4c')]);_0x50ed3e[_0x75bc('0x55')]=_[_0x75bc('0x4e')](_0x50ed3e['model'],_0x50ed3e[_0x75bc('0x4c')]);_0x53a449[_0x75bc('0x4f')]=_[_0x75bc('0x4e')](_0x50ed3e[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0x4e7347['query'][_0x75bc('0x5f')]));_0x53a449[_0x75bc('0x4f')]=_0x53a449['attributes']['length']?_0x53a449[_0x75bc('0x4f')]:_0x50ed3e[_0x75bc('0x4b')];if(!_0x4e7347[_0x75bc('0x4c')]['hasOwnProperty']('nolimit')){_0x53a449[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x53a449[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0x4e7347['query'][_0x75bc('0x33')]);}_0x53a449[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x53a449['where']=qs['filters'](_[_0x75bc('0x54')](_0x4e7347[_0x75bc('0x4c')],_0x50ed3e['filters']));_0x53a449[_0x75bc('0x53')]['ChatWebsiteId']=_0x5b66cc['id'];if(_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x56')]){_0x53a449[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x53a449['where'],{'$or':_[_0x75bc('0x45')](_0x53a449[_0x75bc('0x4f')],function(_0x185887){var _0x4a90ff={};_0x4a90ff[_0x185887]={'$like':'%'+_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x56')]+'%'};return _0x4a90ff;})});}_0x53a449=_[_0x75bc('0x57')]({},_0x53a449,_0x4e7347['options']);return db[_0x75bc('0xda')][_0x75bc('0x32')]({'where':_0x53a449[_0x75bc('0x53')]})[_0x75bc('0x3a')](function(_0x2a1f2c){_0x3c9675[_0x75bc('0x32')]=_0x2a1f2c;if(_0x4e7347[_0x75bc('0x4c')][_0x75bc('0x58')]){_0x53a449[_0x75bc('0x59')]=[{'all':!![]}];}else{_0x53a449[_0x75bc('0x59')]=[{'model':db[_0x75bc('0x91')],'as':_0x75bc('0xfc'),'required':![]},{'model':db[_0x75bc('0xe2')],'as':_0x75bc('0x12e'),'required':![]}];}return db[_0x75bc('0xda')][_0x75bc('0x5a')](_0x53a449);})[_0x75bc('0x3a')](function(_0x4aa1cf){_0x3c9675[_0x75bc('0x5b')]=_0x4aa1cf;return _0x3c9675;});}})[_0x75bc('0x3a')](respondWithFilteredResult(_0x126f49,_0x53a449))[_0x75bc('0x2c')](handleError(_0x126f49,null));};exports[_0x75bc('0x12f')]=function(_0x1e2302,_0x30747f,_0x17abb9){return db['ChatWebsite'][_0x75bc('0x68')]({'where':{'id':_0x1e2302[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x30747f,null))[_0x75bc('0x3a')](function(_0x2562d4){if(_0x2562d4){return _0x2562d4[_0x75bc('0x12f')](_0x1e2302[_0x75bc('0x61')]['ids'],_['omit'](_0x1e2302[_0x75bc('0x61')],['ids','id'])||{})[_0x75bc('0xc0')](function(_0x20daad){for(var _0x4ac0f6=0x0;_0x4ac0f6<_0x1e2302[_0x75bc('0x61')]['ids'][_0x75bc('0x50')];_0x4ac0f6+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x1e2302['body'][_0x75bc('0x76')][_0x4ac0f6]),'ChatWebsiteId':Number(_0x1e2302[_0x75bc('0x5d')]['id'])});}return _0x20daad;});}})[_0x75bc('0x3a')](respondWithResult(_0x30747f,null))[_0x75bc('0x2c')](handleError(_0x30747f,null));};exports[_0x75bc('0x130')]=function(_0x4d2986,_0x2a764a,_0x59b043){return db[_0x75bc('0x46')][_0x75bc('0x68')]({'where':{'id':_0x4d2986[_0x75bc('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2a764a,null))[_0x75bc('0x3a')](function(_0x333207){if(_0x333207){return _0x333207[_0x75bc('0x130')](_0x4d2986[_0x75bc('0x4c')][_0x75bc('0x76')])[_0x75bc('0x3a')](function(){if(_[_0x75bc('0x131')](_0x4d2986['query'][_0x75bc('0x76')])){for(var _0x37fede=0x0;_0x37fede<_0x4d2986[_0x75bc('0x4c')]['ids'][_0x75bc('0x50')];_0x37fede+=0x1){socket[_0x75bc('0x132')](_0x75bc('0x133'),{'UserId':Number(_0x4d2986[_0x75bc('0x4c')][_0x75bc('0x76')][_0x37fede]),'ChatWebsiteId':Number(_0x4d2986[_0x75bc('0x5d')]['id'])});}}else{socket[_0x75bc('0x132')]('userChatWebsite:remove',{'UserId':Number(_0x4d2986[_0x75bc('0x4c')][_0x75bc('0x76')]),'ChatWebsiteId':Number(_0x4d2986[_0x75bc('0x5d')]['id'])});}});}})[_0x75bc('0x3a')](respondWithStatusCode(_0x2a764a,null))[_0x75bc('0x2c')](handleError(_0x2a764a,null));};exports[_0x75bc('0x134')]=function(_0xfc03e4,_0x932134,_0xed3019){var _0x3ff4a1={};var _0x53a2c3={};var _0x33495e;var _0x119b4d;return db[_0x75bc('0x46')][_0x75bc('0x6d')]({'where':{'id':_0xfc03e4[_0x75bc('0x5d')]['id']}})[_0x75bc('0x3a')](handleEntityNotFound(_0x932134,null))[_0x75bc('0x3a')](function(_0x4e2497){if(_0x4e2497){_0x33495e=_0x4e2497;_0x53a2c3['model']=_[_0x75bc('0x4d')](db['User'][_0x75bc('0x47')]);_0x53a2c3[_0x75bc('0x4c')]=_[_0x75bc('0x4d')](_0xfc03e4[_0x75bc('0x4c')]);_0x53a2c3['filters']=_[_0x75bc('0x4e')](_0x53a2c3[_0x75bc('0x4b')],_0x53a2c3[_0x75bc('0x4c')]);_0x3ff4a1['attributes']=_[_0x75bc('0x4e')](_0x53a2c3[_0x75bc('0x4b')],qs[_0x75bc('0x5f')](_0xfc03e4['query']['fields']));_0x3ff4a1[_0x75bc('0x4f')]=_0x3ff4a1[_0x75bc('0x4f')][_0x75bc('0x50')]?_0x3ff4a1[_0x75bc('0x4f')]:_0x53a2c3[_0x75bc('0x4b')];_0x3ff4a1[_0x75bc('0x6f')]=qs[_0x75bc('0x70')](_0xfc03e4[_0x75bc('0x4c')][_0x75bc('0x70')]);_0x3ff4a1[_0x75bc('0x53')]=qs[_0x75bc('0x55')](_['pick'](_0xfc03e4[_0x75bc('0x4c')],_0x53a2c3[_0x75bc('0x55')]));if(_0xfc03e4[_0x75bc('0x4c')]['filter']){_0x3ff4a1[_0x75bc('0x53')]=_[_0x75bc('0x57')](_0x3ff4a1[_0x75bc('0x53')],{'$or':_[_0x75bc('0x45')](_0x3ff4a1[_0x75bc('0x4f')],function(_0x583a92){var _0x32ebc8={};_0x32ebc8[_0x583a92]={'$like':'%'+_0xfc03e4[_0x75bc('0x4c')]['filter']+'%'};return _0x32ebc8;})});}_0x3ff4a1=_['merge']({},_0x3ff4a1,_0xfc03e4[_0x75bc('0x71')]);return _0x33495e['getAgents'](_0x3ff4a1);}})[_0x75bc('0x3a')](function(_0x496660){if(_0x496660){_0x119b4d=_0x496660[_0x75bc('0x50')];if(!_0xfc03e4['query'][_0x75bc('0x51')](_0x75bc('0x52'))){_0x3ff4a1[_0x75bc('0x31')]=qs[_0x75bc('0x31')](_0xfc03e4[_0x75bc('0x4c')][_0x75bc('0x31')]);_0x3ff4a1[_0x75bc('0x33')]=qs[_0x75bc('0x33')](_0xfc03e4[_0x75bc('0x4c')][_0x75bc('0x33')]);}return _0x33495e[_0x75bc('0x134')](_0x3ff4a1);}})[_0x75bc('0x3a')](function(_0x1b7eff){if(_0x1b7eff){return _0x1b7eff?{'count':_0x119b4d,'rows':_0x1b7eff}:null;}})[_0x75bc('0x3a')](respondWithResult(_0x932134,null))[_0x75bc('0x2c')](handleError(_0x932134,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index d998e71..9c565d4 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 _0xc4f5=['hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x9d679d,_0x4dd38a){_0x9d679d=_0x9d679d-0x0;var _0x3ce1dc=_0xc4f5[_0x9d679d];return _0x3ce1dc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5c4f('0x0'))['db'][_0x5c4f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5c4f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c4f('0x3'),'afterDestroy':_0x5c4f('0x4')};function emitEvent(_0x24c5b6){return function(_0xfd69b2,_0x2676f7,_0x56e601){ChatWebsiteEvents[_0x5c4f('0x5')](_0x24c5b6+':'+_0xfd69b2['id'],_0xfd69b2);ChatWebsiteEvents[_0x5c4f('0x5')](_0x24c5b6,_0xfd69b2);_0x56e601(null);};}for(var e in events){if(events[_0x5c4f('0x6')](e)){var event=events[e];ChatWebsite[_0x5c4f('0x7')](e,emitEvent(event));}}module[_0x5c4f('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x9ef8=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x28a8d0,_0x257510){var _0x87bd45=function(_0x2eecc0){while(--_0x2eecc0){_0x28a8d0['push'](_0x28a8d0['shift']());}};_0x87bd45(++_0x257510);}(_0x9ef8,0x17f));var _0x89ef=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x9ef8[_0x35885a];return _0xe86249;};'use strict';var EventEmitter=require(_0x89ef('0x0'));var ChatWebsite=require(_0x89ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x89ef('0x2')](0x0);var events={'afterCreate':_0x89ef('0x3'),'afterUpdate':_0x89ef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c43bc){return function(_0x3797b4,_0x552626,_0x51dada){ChatWebsiteEvents['emit'](_0x1c43bc+':'+_0x3797b4['id'],_0x3797b4);ChatWebsiteEvents[_0x89ef('0x5')](_0x1c43bc,_0x3797b4);_0x51dada(null);};}for(var e in events){if(events[_0x89ef('0x6')](e)){var event=events[e];ChatWebsite[_0x89ef('0x7')](e,emitEvent(event));}}module[_0x89ef('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 5403d60..159481e 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 _0x8326=['define','ChatWebsite','lodash','api','bluebird','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4daa89,_0xa8f6c1){var _0x725a84=function(_0x538d15){while(--_0x538d15){_0x4daa89['push'](_0x4daa89['shift']());}};_0x725a84(++_0xa8f6c1);}(_0x8326,0xf5));var _0x6832=function(_0x20a590,_0x1e8a6d){_0x20a590=_0x20a590-0x0;var _0x2e1b41=_0x8326[_0x20a590];return _0x2e1b41;};'use strict';var _=require(_0x6832('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6832('0x1'));var moment=require('moment');var BPromise=require(_0x6832('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6832('0x3'));var rimraf=require('rimraf');var config=require(_0x6832('0x4'));var attributes=require(_0x6832('0x5'));module[_0x6832('0x6')]=function(_0x36d9c9,_0x39a9a7){return _0x36d9c9[_0x6832('0x7')](_0x6832('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39f2=['util','../../config/logger','moment','request-promise','path','../../config/environment','define','ChatWebsite','chat_websites','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39f2,0x15d));var _0x239f=function(_0x235fae,_0xea3869){_0x235fae=_0x235fae-0x0;var _0x221dc8=_0x39f2[_0x235fae];return _0x221dc8;};'use strict';var _=require(_0x239f('0x0'));var util=require(_0x239f('0x1'));var logger=require(_0x239f('0x2'))('api');var moment=require(_0x239f('0x3'));var BPromise=require('bluebird');var rp=require(_0x239f('0x4'));var fs=require('fs');var path=require(_0x239f('0x5'));var rimraf=require('rimraf');var config=require(_0x239f('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x39f0aa,_0x362c9a){return _0x39f0aa[_0x239f('0x7')](_0x239f('0x8'),attributes,{'tableName':_0x239f('0x9'),'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 ab56c5d..d387646 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb87f=['redis','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','client','http'];(function(_0x4831d7,_0x6964bc){var _0x4c7816=function(_0x5c3202){while(--_0x5c3202){_0x4831d7['push'](_0x4831d7['shift']());}};_0x4c7816(++_0x6964bc);}(_0xb87f,0x1f2));var _0xfb87=function(_0x104354,_0x1d5cdc){_0x104354=_0x104354-0x0;var _0x5ce198=_0xb87f[_0x104354];return _0x5ce198;};'use strict';var _=require(_0xfb87('0x0'));var util=require(_0xfb87('0x1'));var moment=require(_0xfb87('0x2'));var BPromise=require(_0xfb87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb87('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfb87('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfb87('0x6')][_0xfb87('0x7')]({'port':0x232a});config[_0xfb87('0x8')]=_['defaults'](config[_0xfb87('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb87('0x9'))(new Redis(config[_0xfb87('0x8')]));require(_0xfb87('0xa'))[_0xfb87('0xb')](socket);function respondWithRpcPromise(_0x5b7d67,_0x2109ee,_0x408019){return new BPromise(function(_0x129843,_0x32d027){return client[_0xfb87('0xc')](_0x5b7d67,_0x408019)['then'](function(_0x5cbaed){logger[_0xfb87('0xd')](_0xfb87('0xe'),_0x2109ee,_0xfb87('0xf'));logger[_0xfb87('0x10')](_0xfb87('0x11'),_0x2109ee,_0xfb87('0xf'),JSON[_0xfb87('0x12')](_0x5cbaed));if(_0x5cbaed[_0xfb87('0x13')]){if(_0x5cbaed[_0xfb87('0x13')][_0xfb87('0x14')]===0x1f4){logger[_0xfb87('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2109ee,_0x5cbaed[_0xfb87('0x13')]['message']);return _0x32d027(_0x5cbaed['error']['message']);}logger[_0xfb87('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2109ee,_0x5cbaed[_0xfb87('0x13')]['message']);return _0x129843(_0x5cbaed[_0xfb87('0x13')][_0xfb87('0x15')]);}else{logger['info'](_0xfb87('0xe'),_0x2109ee,_0xfb87('0xf'));_0x129843(_0x5cbaed['result'][_0xfb87('0x15')]);}})[_0xfb87('0x16')](function(_0x11ae04){logger[_0xfb87('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2109ee,_0x11ae04);_0x32d027(_0x11ae04);});});}
\ No newline at end of file
+var _0x5584=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5584,0x1c7));var _0x4558=function(_0x57f0a9,_0xcd6730){_0x57f0a9=_0x57f0a9-0x0;var _0x1f229a=_0x5584[_0x57f0a9];return _0x1f229a;};'use strict';var _=require(_0x4558('0x0'));var util=require(_0x4558('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4558('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4558('0x3'))['db'];var utils=require(_0x4558('0x4'));var logger=require(_0x4558('0x5'))(_0x4558('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4558('0x7')]['http']({'port':0x232a});config[_0x4558('0x8')]=_[_0x4558('0x9')](config[_0x4558('0x8')],{'host':_0x4558('0xa'),'port':0x18eb});var socket=require(_0x4558('0xb'))(new Redis(config['redis']));require(_0x4558('0xc'))['register'](socket);function respondWithRpcPromise(_0x28e455,_0x5b5c3c,_0x275aad){return new BPromise(function(_0x559d2e,_0x4c53e2){return client[_0x4558('0xd')](_0x28e455,_0x275aad)[_0x4558('0xe')](function(_0x364887){logger[_0x4558('0xf')](_0x4558('0x10'),_0x5b5c3c,_0x4558('0x11'));logger[_0x4558('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5b5c3c,_0x4558('0x11'),JSON[_0x4558('0x13')](_0x364887));if(_0x364887['error']){if(_0x364887[_0x4558('0x14')][_0x4558('0x15')]===0x1f4){logger[_0x4558('0x14')](_0x4558('0x10'),_0x5b5c3c,_0x364887[_0x4558('0x14')][_0x4558('0x16')]);return _0x4c53e2(_0x364887[_0x4558('0x14')][_0x4558('0x16')]);}logger[_0x4558('0x14')](_0x4558('0x10'),_0x5b5c3c,_0x364887[_0x4558('0x14')]['message']);return _0x559d2e(_0x364887[_0x4558('0x14')][_0x4558('0x16')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5b5c3c,_0x4558('0x11'));_0x559d2e(_0x364887[_0x4558('0x17')][_0x4558('0x16')]);}})[_0x4558('0x18')](function(_0x3cbd6b){logger[_0x4558('0x14')](_0x4558('0x10'),_0x5b5c3c,_0x3cbd6b);_0x4c53e2(_0x3cbd6b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8adc5eb..f6ec9e3 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 _0x0a04=['length','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a04,0x1d2));var _0x40a0=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x0a04[_0xaa0309];return _0x5de7ce;};'use strict';var ChatWebsiteEvents=require(_0x40a0('0x0'));var events=[_0x40a0('0x1'),_0x40a0('0x2'),'update'];function createListener(_0x302002,_0x8495a6){return function(_0x23a3e8){_0x8495a6[_0x40a0('0x3')](_0x302002,_0x23a3e8);};}function removeListener(_0x2582c4,_0x49667b){return function(){ChatWebsiteEvents[_0x40a0('0x4')](_0x2582c4,_0x49667b);};}exports[_0x40a0('0x5')]=function(_0x57a3b0){for(var _0x1442a7=0x0,_0x265c8e=events[_0x40a0('0x6')];_0x1442a7<_0x265c8e;_0x1442a7++){var _0x2e9007=events[_0x1442a7];var _0x3ae0c4=createListener(_0x40a0('0x7')+_0x2e9007,_0x57a3b0);ChatWebsiteEvents['on'](_0x2e9007,_0x3ae0c4);}};
\ No newline at end of file
+var _0x5360=['remove','update','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x362bf8,_0x306082){var _0x5818e1=function(_0x28c82a){while(--_0x28c82a){_0x362bf8['push'](_0x362bf8['shift']());}};_0x5818e1(++_0x306082);}(_0x5360,0x195));var _0x0536=function(_0x24b82f,_0x3750e0){_0x24b82f=_0x24b82f-0x0;var _0x112a28=_0x5360[_0x24b82f];return _0x112a28;};'use strict';var ChatWebsiteEvents=require(_0x0536('0x0'));var events=['save',_0x0536('0x1'),_0x0536('0x2')];function createListener(_0x2e6d7b,_0x58b952){return function(_0x270ccb){_0x58b952['emit'](_0x2e6d7b,_0x270ccb);};}function removeListener(_0x580d98,_0x4ee940){return function(){ChatWebsiteEvents[_0x0536('0x3')](_0x580d98,_0x4ee940);};}exports[_0x0536('0x4')]=function(_0x31a965){for(var _0x3badfd=0x0,_0x44468c=events[_0x0536('0x5')];_0x3badfd<_0x44468c;_0x3badfd++){var _0xf3e797=events[_0x3badfd];var _0x115b4e=createListener(_0x0536('0x6')+_0xf3e797,_0x31a965);ChatWebsiteEvents['on'](_0xf3e797,_0x115b4e);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 8ecde8e..d85f4a6 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 _0xcee7=['attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','post','addAnswer','diskStorage','join','server/files/images/logos/','originalname','single','file','addLogo','root','format','%s-%s','now','/:id/avatar','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files'];(function(_0x314bb5,_0x476e6a){var _0x32c85e=function(_0x52673d){while(--_0x52673d){_0x314bb5['push'](_0x314bb5['shift']());}};_0x32c85e(++_0x476e6a);}(_0xcee7,0x1bd));var _0x7cee=function(_0xdbad07,_0x22af65){_0xdbad07=_0xdbad07-0x0;var _0x4109f8=_0xcee7[_0xdbad07];return _0x4109f8;};'use strict';var multer=require(_0x7cee('0x0'));var util=require(_0x7cee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7cee('0x2'));var router=express[_0x7cee('0x3')]();var fs_extra=require(_0x7cee('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7cee('0x5'));var controller=require(_0x7cee('0x6'));router[_0x7cee('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7cee('0x7')](_0x7cee('0x8'),auth['isAuthenticated'](),controller[_0x7cee('0x9')]);router[_0x7cee('0x7')](_0x7cee('0xa'),auth[_0x7cee('0xb')](),controller[_0x7cee('0xc')]);router['get'](_0x7cee('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x7cee('0x7')](_0x7cee('0xe'),auth['isAuthenticated'](),controller[_0x7cee('0xf')]);router[_0x7cee('0x7')](_0x7cee('0x10'),controller[_0x7cee('0x11')]);router['get']('/:id/avatar',controller[_0x7cee('0x12')]);router[_0x7cee('0x7')]('/:id/customer_avatar',controller[_0x7cee('0x13')]);router['get']('/:id/system_avatar',controller[_0x7cee('0x14')]);router['get'](_0x7cee('0x15'),auth['isAuthenticated'](),controller[_0x7cee('0x16')]);router[_0x7cee('0x7')](_0x7cee('0x17'),controller[_0x7cee('0x18')]);router[_0x7cee('0x7')]('/:id/applications',auth[_0x7cee('0xb')](),controller[_0x7cee('0x19')]);router[_0x7cee('0x7')](_0x7cee('0x1a'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x1b')]);router[_0x7cee('0x7')](_0x7cee('0x1c'),controller['getFields']);router['get'](_0x7cee('0x1d'),auth['isAuthenticated'](),controller[_0x7cee('0x1e')]);router['get']('/:id/users',auth[_0x7cee('0xb')](),controller['getAgents']);router[_0x7cee('0x1f')]('/',auth[_0x7cee('0xb')](),controller['create']);router[_0x7cee('0x1f')](_0x7cee('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x7cee('0x1f')]('/:id/canned_answers',auth[_0x7cee('0xb')](),controller[_0x7cee('0x20')]);var upload=multer({'storage':multer[_0x7cee('0x21')]({'destination':function(_0x103141,_0x504a1d,_0x2f098b){_0x2f098b(null,path[_0x7cee('0x22')](config['root'],_0x7cee('0x23')));},'filename':function(_0x2fefe6,_0x11a9e0,_0x2a7cb4){_0x2a7cb4(null,util['format']('%s-%s',Date['now'](),_0x11a9e0[_0x7cee('0x24')]));}})});router['post'](_0x7cee('0x10'),upload[_0x7cee('0x25')](_0x7cee('0x26')),controller[_0x7cee('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22a28d,_0x20717a,_0x3f306a){_0x3f306a(null,path['join'](config[_0x7cee('0x28')],'server/files/images/avatars/'));},'filename':function(_0x4f0704,_0x5a818c,_0x550fbe){_0x550fbe(null,util[_0x7cee('0x29')](_0x7cee('0x2a'),Date[_0x7cee('0x2b')](),_0x5a818c[_0x7cee('0x24')]));}})});router['post'](_0x7cee('0x2c'),upload[_0x7cee('0x25')](_0x7cee('0x26')),controller[_0x7cee('0x2d')]);var upload=multer({'storage':multer[_0x7cee('0x21')]({'destination':function(_0x3d70ca,_0x4fa76c,_0x4e868e){_0x4e868e(null,path[_0x7cee('0x22')](config[_0x7cee('0x28')],_0x7cee('0x2e')));},'filename':function(_0x458e02,_0x39394d,_0x2e3753){_0x2e3753(null,util[_0x7cee('0x29')](_0x7cee('0x2a'),Date[_0x7cee('0x2b')](),_0x39394d[_0x7cee('0x24')]));}})});router[_0x7cee('0x1f')](_0x7cee('0x2f'),upload[_0x7cee('0x25')](_0x7cee('0x26')),controller[_0x7cee('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5382d1,_0x434c6e,_0x3141c8){_0x3141c8(null,path[_0x7cee('0x22')](config[_0x7cee('0x28')],_0x7cee('0x2e')));},'filename':function(_0x5d3553,_0x15066e,_0x3199fe){_0x3199fe(null,util[_0x7cee('0x29')]('%s-%s',Date[_0x7cee('0x2b')](),_0x15066e['originalname']));}})});router[_0x7cee('0x1f')]('/:id/system_avatar',upload['single'](_0x7cee('0x26')),controller[_0x7cee('0x31')]);router['post'](_0x7cee('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x7cee('0x21')]({'destination':function(_0x10b05b,_0x2049d3,_0x332c8f){const _0xedbfbd=path['join'](config[_0x7cee('0x28')],_0x7cee('0x33'),_0x7cee('0x34'),_0x7cee('0x35'));fs_extra[_0x7cee('0x36')](_0xedbfbd,function(){_0x332c8f(null,_0xedbfbd);});},'filename':function(_0x16c5be,_0x595912,_0x3b2d5f){const _0xe2c9b2=_0x595912[_0x7cee('0x24')][_0x7cee('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a8095=path['extname'](_0xe2c9b2);const _0x468772=Date[_0x7cee('0x2b')]()+'-'+_0xe2c9b2['replace'](_0x4a8095,'')+_0x4a8095;_0x3b2d5f(null,_0x468772);}})});router[_0x7cee('0x1f')]('/:id/offline',offlineUploadMulter[_0x7cee('0x38')](),controller[_0x7cee('0x39')]);router[_0x7cee('0x1f')](_0x7cee('0x15'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x3a')]);router[_0x7cee('0x1f')](_0x7cee('0x3b'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x3c')]);router[_0x7cee('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x7cee('0x3d')]);router[_0x7cee('0x1f')](_0x7cee('0x3e'),auth['isAuthenticated'](),controller[_0x7cee('0x3f')]);router[_0x7cee('0x40')]('/:id',auth[_0x7cee('0xb')](),controller[_0x7cee('0x41')]);router[_0x7cee('0x42')](_0x7cee('0xa'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x43')]);router[_0x7cee('0x42')](_0x7cee('0xd'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x44')]);router[_0x7cee('0x42')](_0x7cee('0xe'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x45')]);router['delete'](_0x7cee('0x3e'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x46')]);module['exports']=router;
\ No newline at end of file
+var _0xef55=['getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','diskStorage','join','server/files/images/avatars/','%s-%s','/:id/avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','/:id/users','put','update','delete','removeDispositions','removeAgents','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar'];(function(_0x4af0db,_0x134ec5){var _0x5ad5d2=function(_0x28aa52){while(--_0x28aa52){_0x4af0db['push'](_0x4af0db['shift']());}};_0x5ad5d2(++_0x134ec5);}(_0xef55,0x14a));var _0x5ef5=function(_0x44af5f,_0x222091){_0x44af5f=_0x44af5f-0x0;var _0x19bf78=_0xef55[_0x44af5f];return _0x19bf78;};'use strict';var multer=require(_0x5ef5('0x0'));var util=require(_0x5ef5('0x1'));var path=require(_0x5ef5('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ef5('0x3'));var router=express[_0x5ef5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ef5('0x5'));var config=require(_0x5ef5('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x5ef5('0x7')](),controller['index']);router['get'](_0x5ef5('0x8'),auth['isAuthenticated'](),controller[_0x5ef5('0x9')]);router[_0x5ef5('0xa')](_0x5ef5('0xb'),auth['isAuthenticated'](),controller[_0x5ef5('0xc')]);router[_0x5ef5('0xa')](_0x5ef5('0xd'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0xe')]);router['get'](_0x5ef5('0xf'),auth['isAuthenticated'](),controller[_0x5ef5('0x10')]);router[_0x5ef5('0xa')](_0x5ef5('0x11'),controller[_0x5ef5('0x12')]);router[_0x5ef5('0xa')]('/:id/avatar',controller[_0x5ef5('0x13')]);router[_0x5ef5('0xa')]('/:id/customer_avatar',controller[_0x5ef5('0x14')]);router[_0x5ef5('0xa')](_0x5ef5('0x15'),controller['getSystemAvatar']);router[_0x5ef5('0xa')](_0x5ef5('0x16'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x5ef5('0x17'),controller[_0x5ef5('0x18')]);router[_0x5ef5('0xa')](_0x5ef5('0x19'),auth[_0x5ef5('0x7')](),controller['getApplications']);router['get'](_0x5ef5('0x1a'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x1b')]);router[_0x5ef5('0xa')](_0x5ef5('0x1c'),controller[_0x5ef5('0x1d')]);router[_0x5ef5('0xa')]('/:id/offline_messages',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x1e')]);router[_0x5ef5('0xa')]('/:id/users',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x1f')]);router[_0x5ef5('0x20')]('/',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x21')]);router[_0x5ef5('0x20')](_0x5ef5('0xd'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x22')]);router[_0x5ef5('0x20')](_0x5ef5('0xf'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38e5e3,_0x570f6e,_0x2b03fd){_0x2b03fd(null,path['join'](config[_0x5ef5('0x24')],_0x5ef5('0x25')));},'filename':function(_0x5d8a25,_0x34311e,_0x21274e){_0x21274e(null,util[_0x5ef5('0x26')]('%s-%s',Date[_0x5ef5('0x27')](),_0x34311e[_0x5ef5('0x28')]));}})});router[_0x5ef5('0x20')](_0x5ef5('0x11'),upload[_0x5ef5('0x29')](_0x5ef5('0x2a')),controller[_0x5ef5('0x2b')]);var upload=multer({'storage':multer[_0x5ef5('0x2c')]({'destination':function(_0x363d96,_0x43c4e7,_0x3907d6){_0x3907d6(null,path[_0x5ef5('0x2d')](config['root'],_0x5ef5('0x2e')));},'filename':function(_0x4580a4,_0x21fb4b,_0x335c5e){_0x335c5e(null,util[_0x5ef5('0x26')](_0x5ef5('0x2f'),Date[_0x5ef5('0x27')](),_0x21fb4b[_0x5ef5('0x28')]));}})});router[_0x5ef5('0x20')](_0x5ef5('0x30'),upload[_0x5ef5('0x29')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49238c,_0x48c5b3,_0x529b83){_0x529b83(null,path[_0x5ef5('0x2d')](config[_0x5ef5('0x24')],_0x5ef5('0x2e')));},'filename':function(_0x144f9c,_0x34a176,_0x2400d1){_0x2400d1(null,util[_0x5ef5('0x26')](_0x5ef5('0x2f'),Date[_0x5ef5('0x27')](),_0x34a176[_0x5ef5('0x28')]));}})});router['post']('/:id/customer_avatar',upload[_0x5ef5('0x29')]('file'),controller[_0x5ef5('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x506eb2,_0x50440b,_0x25da0a){_0x25da0a(null,path[_0x5ef5('0x2d')](config[_0x5ef5('0x24')],_0x5ef5('0x2e')));},'filename':function(_0x5e17ed,_0x2db2a8,_0x1316b4){_0x1316b4(null,util['format'](_0x5ef5('0x2f'),Date[_0x5ef5('0x27')](),_0x2db2a8[_0x5ef5('0x28')]));}})});router['post'](_0x5ef5('0x15'),upload[_0x5ef5('0x29')]('file'),controller[_0x5ef5('0x32')]);router['post'](_0x5ef5('0x33'),controller[_0x5ef5('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x5ef5('0x2c')]({'destination':function(_0x35cece,_0xf144de,_0x2731e5){const _0x5e3fac=path[_0x5ef5('0x2d')](config[_0x5ef5('0x24')],_0x5ef5('0x35'),_0x5ef5('0x36'),_0x5ef5('0x37'));fs_extra[_0x5ef5('0x38')](_0x5e3fac,function(){_0x2731e5(null,_0x5e3fac);});},'filename':function(_0x3510a8,_0x43e8af,_0x204b65){const _0x3e7e89=_0x43e8af[_0x5ef5('0x28')][_0x5ef5('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1009f6=path[_0x5ef5('0x3a')](_0x3e7e89);const _0x5df918=Date['now']()+'-'+_0x3e7e89['replace'](_0x1009f6,'')+_0x1009f6;_0x204b65(null,_0x5df918);}})});router[_0x5ef5('0x20')](_0x5ef5('0x3b'),offlineUploadMulter[_0x5ef5('0x3c')](),controller[_0x5ef5('0x3d')]);router[_0x5ef5('0x20')](_0x5ef5('0x16'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x3e')]);router[_0x5ef5('0x20')](_0x5ef5('0x19'),auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x3f')]);router[_0x5ef5('0x20')](_0x5ef5('0x1a'),auth[_0x5ef5('0x7')](),controller['addProactiveActions']);router['post'](_0x5ef5('0x40'),auth[_0x5ef5('0x7')](),controller['addAgents']);router[_0x5ef5('0x41')](_0x5ef5('0xb'),auth['isAuthenticated'](),controller[_0x5ef5('0x42')]);router[_0x5ef5('0x43')](_0x5ef5('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x5ef5('0x43')]('/:id/dispositions',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x44')]);router['delete'](_0x5ef5('0xf'),auth[_0x5ef5('0x7')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x5ef5('0x7')](),controller[_0x5ef5('0x45')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index e7070b1..ce5657c 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecb2=['sequelize','ENUM','STRING'];(function(_0x402085,_0x143dba){var _0x42992e=function(_0x33861f){while(--_0x33861f){_0x402085['push'](_0x402085['shift']());}};_0x42992e(++_0x143dba);}(_0xecb2,0xf6));var _0x2ecb=function(_0x2b326b,_0x1156dd){_0x2b326b=_0x2b326b-0x0;var _0x1e3509=_0xecb2[_0x2b326b];return _0x1e3509;};'use strict';var Sequelize=require(_0x2ecb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2ecb('0x1')]('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2ecb('0x2')]},'data2':{'type':Sequelize[_0x2ecb('0x2')]}};
\ No newline at end of file
+var _0x9f5a=['exports','STRING','ENUM','Google','sequelize'];(function(_0x159641,_0x292389){var _0x41c53a=function(_0x21dd62){while(--_0x21dd62){_0x159641['push'](_0x159641['shift']());}};_0x41c53a(++_0x292389);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x50cfc7,_0x3b19f9){_0x50cfc7=_0x50cfc7-0x0;var _0x2324b8=_0x9f5a[_0x50cfc7];return _0x2324b8;};'use strict';var Sequelize=require(_0xa9f5('0x0'));module[_0xa9f5('0x1')]={'name':{'type':Sequelize[_0xa9f5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa9f5('0x3')]('AmazonAWS',_0xa9f5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa9f5('0x2')]},'data2':{'type':Sequelize[_0xa9f5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 845ddd4..6fcb023 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x10e19a,_0x2915c4){var _0x50b26d=function(_0x1278a8){while(--_0x1278a8){_0x10e19a['push'](_0x10e19a['shift']());}};_0x50b26d(++_0x2915c4);}(_0x2ef3,0xba));var _0x32ef=function(_0x4eae98,_0x239918){_0x4eae98=_0x4eae98-0x0;var _0x1bce9d=_0x2ef3[_0x4eae98];return _0x1bce9d;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x5c7972,_0x21b1a2){var _0x23a1da=function(_0x2fc6f2){while(--_0x2fc6f2){_0x5c7972['push'](_0x5c7972['shift']());}};_0x23a1da(++_0x21b1a2);}(_0x7a54,0x106));var _0x47a5=function(_0x54786e,_0x5b3430){_0x54786e=_0x54786e-0x0;var _0x4bdeb5=_0x7a54[_0x54786e];return _0x4bdeb5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 73242d7..c638353 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ce6=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ce6,0xbb));var _0x64ce=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x4ce6[_0x4b6830];return _0x239e4a;};'use strict';var _=require(_0x64ce('0x0'));var util=require(_0x64ce('0x1'));var logger=require(_0x64ce('0x2'))('api');var moment=require(_0x64ce('0x3'));var BPromise=require(_0x64ce('0x4'));var rp=require(_0x64ce('0x5'));var fs=require('fs');var path=require(_0x64ce('0x6'));var rimraf=require(_0x64ce('0x7'));var config=require(_0x64ce('0x8'));var attributes=require(_0x64ce('0x9'));module['exports']=function(_0x4e139c,_0xc5a802){return _0x4e139c[_0x64ce('0xa')]('CloudProvider',attributes,{'tableName':_0x64ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2fd=['./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xf2fd,0xf4));var _0xdf2f=function(_0xd6054f,_0x5eaa24){_0xd6054f=_0xd6054f-0x0;var _0x5d7631=_0xf2fd[_0xd6054f];return _0x5d7631;};'use strict';var _=require(_0xdf2f('0x0'));var util=require(_0xdf2f('0x1'));var logger=require(_0xdf2f('0x2'))(_0xdf2f('0x3'));var moment=require('moment');var BPromise=require(_0xdf2f('0x4'));var rp=require(_0xdf2f('0x5'));var fs=require('fs');var path=require(_0xdf2f('0x6'));var rimraf=require(_0xdf2f('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf2f('0x8'));module[_0xdf2f('0x9')]=function(_0x8d1799,_0x11cbd5){return _0x8d1799[_0xdf2f('0xa')]('CloudProvider',attributes,{'tableName':_0xdf2f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 7f1deb4..ec64b2b 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment'];(function(_0x2189e9,_0x2ca219){var _0x32fe6a=function(_0x4951b1){while(--_0x4951b1){_0x2189e9['push'](_0x2189e9['shift']());}};_0x32fe6a(++_0x2ca219);}(_0x7334,0x184));var _0x4733=function(_0x3deb86,_0x1ad6f3){_0x3deb86=_0x3deb86-0x0;var _0x1d3c40=_0x7334[_0x3deb86];return _0x1d3c40;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});}
\ No newline at end of file
+var _0x3419=['then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3bfb3e,_0x23995e){var _0x2a0578=function(_0x174299){while(--_0x174299){_0x3bfb3e['push'](_0x3bfb3e['shift']());}};_0x2a0578(++_0x23995e);}(_0x3419,0xb3));var _0x9341=function(_0x455bbf,_0x487eb1){_0x455bbf=_0x455bbf-0x0;var _0x31cc6a=_0x3419[_0x455bbf];return _0x31cc6a;};'use strict';var _=require(_0x9341('0x0'));var util=require(_0x9341('0x1'));var moment=require(_0x9341('0x2'));var BPromise=require(_0x9341('0x3'));var rs=require(_0x9341('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9341('0x5'))['db'];var utils=require(_0x9341('0x6'));var logger=require(_0x9341('0x7'))(_0x9341('0x8'));var config=require(_0x9341('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9341('0xa')][_0x9341('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e3e79,_0x2efc5a,_0x1c30cf){return new BPromise(function(_0x188d3b,_0x3b736e){return client[_0x9341('0xc')](_0x5e3e79,_0x1c30cf)[_0x9341('0xd')](function(_0x51826c){logger[_0x9341('0xe')]('CloudProvider,\x20%s,\x20%s',_0x2efc5a,_0x9341('0xf'));logger[_0x9341('0x10')](_0x9341('0x11'),_0x2efc5a,'request\x20sent',JSON[_0x9341('0x12')](_0x51826c));if(_0x51826c['error']){if(_0x51826c[_0x9341('0x13')][_0x9341('0x14')]===0x1f4){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x3b736e(_0x51826c['error']['message']);}logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x51826c['error'][_0x9341('0x16')]);return _0x188d3b(_0x51826c[_0x9341('0x13')]['message']);}else{logger[_0x9341('0xe')](_0x9341('0x15'),_0x2efc5a,_0x9341('0xf'));_0x188d3b(_0x51826c['result'][_0x9341('0x16')]);}})[_0x9341('0x17')](function(_0x256b0f){logger[_0x9341('0x13')](_0x9341('0x15'),_0x2efc5a,_0x256b0f);_0x3b736e(_0x256b0f);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 5b9ae91..22225a6 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8475=['path','Router','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x8475,0x64));var _0x5847=function(_0x446677,_0x3fa33b){_0x446677=_0x446677-0x0;var _0x3295c8=_0x8475[_0x446677];return _0x3295c8;};'use strict';var multer=require(_0x5847('0x0'));var util=require(_0x5847('0x1'));var path=require(_0x5847('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5847('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5847('0x4'));var interaction=require(_0x5847('0x5'));var config=require('../../config/environment');var controller=require(_0x5847('0x6'));router[_0x5847('0x7')]('/',auth[_0x5847('0x8')](),controller[_0x5847('0x9')]);router[_0x5847('0x7')](_0x5847('0xa'),auth[_0x5847('0x8')](),controller[_0x5847('0xb')]);router[_0x5847('0xc')]('/',auth[_0x5847('0x8')](),controller[_0x5847('0xd')]);router['put'](_0x5847('0xa'),auth['isAuthenticated'](),controller[_0x5847('0xe')]);router[_0x5847('0xf')](_0x5847('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5847('0x10')]=router;
\ No newline at end of file
+var _0xab00=['./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5701e0,_0x257720){var _0x1c7aa0=function(_0x55d3fb){while(--_0x55d3fb){_0x5701e0['push'](_0x5701e0['shift']());}};_0x1c7aa0(++_0x257720);}(_0xab00,0x1b9));var _0x0ab0=function(_0x38b88d,_0x3e065e){_0x38b88d=_0x38b88d-0x0;var _0x338fad=_0xab00[_0x38b88d];return _0x338fad;};'use strict';var multer=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var path=require(_0x0ab0('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ab0('0x3'));var router=express[_0x0ab0('0x4')]();var fs_extra=require(_0x0ab0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ab0('0x6'));var config=require('../../config/environment');var controller=require(_0x0ab0('0x7'));router[_0x0ab0('0x8')]('/',auth[_0x0ab0('0x9')](),controller[_0x0ab0('0xa')]);router[_0x0ab0('0x8')](_0x0ab0('0xb'),auth['isAuthenticated'](),controller[_0x0ab0('0xc')]);router[_0x0ab0('0xd')]('/',auth['isAuthenticated'](),controller[_0x0ab0('0xe')]);router['put'](_0x0ab0('0xb'),auth[_0x0ab0('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0ab0('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 4317982..c2128f4 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 _0x68fc=['sequelize','exports','STRING'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x68fc,0xa5));var _0xc68f=function(_0x327755,_0x5f4fcb){_0x327755=_0x327755-0x0;var _0x4a2edb=_0x68fc[_0x327755];return _0x4a2edb;};'use strict';var Sequelize=require(_0xc68f('0x0'));module[_0xc68f('0x1')]={'name':{'type':Sequelize[_0xc68f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xc68f('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc68f('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc68f('0x2')]},'postalCode':{'type':Sequelize[_0xc68f('0x2')]},'city':{'type':Sequelize[_0xc68f('0x2')]},'country':{'type':Sequelize[_0xc68f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xc68f('0x2')]},'sPostalCode':{'type':Sequelize[_0xc68f('0x2')]},'sCity':{'type':Sequelize[_0xc68f('0x2')]},'sCountry':{'type':Sequelize[_0xc68f('0x2')]},'description':{'type':Sequelize[_0xc68f('0x2')]}};
\ No newline at end of file
+var _0xfb10=['sequelize','exports','STRING','name'];(function(_0x1dbd7c,_0x45a20f){var _0x43cdfd=function(_0x13d7d8){while(--_0x13d7d8){_0x1dbd7c['push'](_0x1dbd7c['shift']());}};_0x43cdfd(++_0x45a20f);}(_0xfb10,0x13c));var _0x0fb1=function(_0x5c76f3,_0x25a281){_0x5c76f3=_0x5c76f3-0x0;var _0x41efba=_0xfb10[_0x5c76f3];return _0x41efba;};'use strict';var Sequelize=require(_0x0fb1('0x0'));module[_0x0fb1('0x1')]={'name':{'type':Sequelize[_0x0fb1('0x2')],'unique':_0x0fb1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0fb1('0x2')]},'companyId':{'type':Sequelize[_0x0fb1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0fb1('0x2')]},'fax':{'type':Sequelize[_0x0fb1('0x2')]},'type':{'type':Sequelize[_0x0fb1('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0fb1('0x2')]},'city':{'type':Sequelize[_0x0fb1('0x2')]},'country':{'type':Sequelize[_0x0fb1('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0fb1('0x2')]},'sStreet':{'type':Sequelize[_0x0fb1('0x2')]},'sPostalCode':{'type':Sequelize[_0x0fb1('0x2')]},'sCity':{'type':Sequelize[_0x0fb1('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0fb1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 010e970..d7b07d0 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 _0x48fa=['hasOwnProperty','order','sort','filters','pick','filter','where','merge','map','options','includeAll','findAll','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x48fa,0x127));var _0xa48f=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x48fa[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0xa48f('0x0'));var rimraf=require(_0xa48f('0x1'));var zipdir=require(_0xa48f('0x2'));var jsonpatch=require(_0xa48f('0x3'));var rp=require(_0xa48f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa48f('0x5'));var path=require(_0xa48f('0x6'));var sox=require(_0xa48f('0x7'));var csv=require('to-csv');var ejs=require(_0xa48f('0x8'));var fs=require('fs');var fs_extra=require(_0xa48f('0x9'));var _=require(_0xa48f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa48f('0xb'));var deskjs=require(_0xa48f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa48f('0xd'));var Papa=require(_0xa48f('0xe'));var Redis=require(_0xa48f('0xf'));var authService=require(_0xa48f('0x10'));var qs=require(_0xa48f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa48f('0x12'));var logger=require(_0xa48f('0x13'))(_0xa48f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa48f('0x15'));var db=require(_0xa48f('0x16'))['db'];function respondWithStatusCode(_0x196153,_0xe15e6c){_0xe15e6c=_0xe15e6c||0xcc;return function(_0x286686){if(_0x286686){return _0x196153[_0xa48f('0x17')](_0xe15e6c);}return _0x196153[_0xa48f('0x18')](_0xe15e6c)[_0xa48f('0x19')]();};}function respondWithResult(_0x1e9f8f,_0x58c52f){_0x58c52f=_0x58c52f||0xc8;return function(_0x226e4a){if(_0x226e4a){return _0x1e9f8f[_0xa48f('0x18')](_0x58c52f)[_0xa48f('0x1a')](_0x226e4a);}};}function respondWithFilteredResult(_0x49e7a8,_0x478edc){return function(_0x8d838b){if(_0x8d838b){var _0x1bc047=typeof _0x478edc[_0xa48f('0x1b')]==='undefined'&&typeof _0x478edc[_0xa48f('0x1c')]===_0xa48f('0x1d');var _0x25595d=_0x8d838b[_0xa48f('0x1e')];var _0x5c3bc6=_0x1bc047?0x0:_0x478edc[_0xa48f('0x1b')];var _0x173ed2=_0x1bc047?_0x8d838b['count']:_0x478edc['offset']+_0x478edc[_0xa48f('0x1c')];var _0x1a2ae5;if(_0x173ed2>=_0x25595d){_0x173ed2=_0x25595d;_0x1a2ae5=0xc8;}else{_0x1a2ae5=0xce;}_0x49e7a8['status'](_0x1a2ae5);return _0x49e7a8[_0xa48f('0x1f')](_0xa48f('0x20'),_0x5c3bc6+'-'+_0x173ed2+'/'+_0x25595d)[_0xa48f('0x1a')](_0x8d838b);}return null;};}function patchUpdates(_0x2e5626){return function(_0x924f13){try{jsonpatch[_0xa48f('0x21')](_0x924f13,_0x2e5626,!![]);}catch(_0x1ad180){return BPromise['reject'](_0x1ad180);}return _0x924f13[_0xa48f('0x22')]();};}function saveUpdates(_0x243595,_0x21743c){return function(_0x5b825e){if(_0x5b825e){return _0x5b825e[_0xa48f('0x23')](_0x243595)[_0xa48f('0x24')](function(_0x3a298a){return _0x3a298a;});}return null;};}function removeEntity(_0x1d65b6,_0x9aba62){return function(_0x318fb9){if(_0x318fb9){return _0x318fb9[_0xa48f('0x25')]()[_0xa48f('0x24')](function(){var _0x5d9275=_0x318fb9[_0xa48f('0x26')]({'plain':!![]});var _0x914590=_0xa48f('0x27');return db[_0xa48f('0x28')][_0xa48f('0x25')]({'where':{'type':_0x914590,'resourceId':_0x5d9275['id']}})[_0xa48f('0x24')](function(){return _0x318fb9;});})[_0xa48f('0x24')](function(){_0x1d65b6['status'](0xcc)[_0xa48f('0x19')]();});}};}function handleEntityNotFound(_0x46a98e,_0x525bae){return function(_0xa70c4b){if(!_0xa70c4b){_0x46a98e[_0xa48f('0x17')](0x194);}return _0xa70c4b;};}function handleError(_0x58b264,_0x370906){_0x370906=_0x370906||0x1f4;return function(_0x3377ff){logger['error'](_0x3377ff[_0xa48f('0x29')]);if(_0x3377ff[_0xa48f('0x2a')]){delete _0x3377ff[_0xa48f('0x2a')];}_0x58b264['status'](_0x370906)[_0xa48f('0x2b')](_0x3377ff);};}exports[_0xa48f('0x2c')]=function(_0x506e31,_0x5be2bb){var _0x578735={},_0x1486d8={},_0x5ecef8={'count':0x0,'rows':[]};return db[_0xa48f('0x2d')][_0xa48f('0x2e')]()['then'](function(_0x506a7d){_0x1486d8[_0xa48f('0x2f')]=_[_0xa48f('0x30')](_0x506a7d);_0x1486d8[_0xa48f('0x31')]=_[_0xa48f('0x30')](_0x506e31[_0xa48f('0x31')]);_0x1486d8['filters']=_[_0xa48f('0x32')](_0x1486d8[_0xa48f('0x2f')],_0x1486d8['query']);_0x578735[_0xa48f('0x33')]=_[_0xa48f('0x32')](_0x1486d8['model'],qs[_0xa48f('0x34')](_0x506e31[_0xa48f('0x31')]['fields']));_0x578735[_0xa48f('0x33')]=_0x578735[_0xa48f('0x33')]['length']?_0x578735[_0xa48f('0x33')]:_0x1486d8[_0xa48f('0x2f')];if(!_0x506e31['query'][_0xa48f('0x35')]('nolimit')){_0x578735[_0xa48f('0x1c')]=qs[_0xa48f('0x1c')](_0x506e31[_0xa48f('0x31')][_0xa48f('0x1c')]);_0x578735[_0xa48f('0x1b')]=qs[_0xa48f('0x1b')](_0x506e31['query'][_0xa48f('0x1b')]);}_0x578735[_0xa48f('0x36')]=qs['sort'](_0x506e31[_0xa48f('0x31')][_0xa48f('0x37')]);_0x578735['where']=qs[_0xa48f('0x38')](_[_0xa48f('0x39')](_0x506e31[_0xa48f('0x31')],_0x1486d8[_0xa48f('0x38')]),_0x506a7d);if(_0x506e31[_0xa48f('0x31')][_0xa48f('0x3a')]){_0x578735[_0xa48f('0x3b')]=_[_0xa48f('0x3c')](_0x578735[_0xa48f('0x3b')],{'$or':_[_0xa48f('0x3d')](_0x578735[_0xa48f('0x33')],function(_0x3cce53){var _0x25c82c={};_0x25c82c[_0x3cce53]={'$like':'%'+_0x506e31['query'][_0xa48f('0x3a')]+'%'};return _0x25c82c;})});}_0x578735=_['merge']({},_0x578735,_0x506e31[_0xa48f('0x3e')]);var _0x123fde={'where':_0x578735[_0xa48f('0x3b')]};return db[_0xa48f('0x2d')][_0xa48f('0x1e')](_0x123fde)[_0xa48f('0x24')](function(_0x57ee16){_0x5ecef8[_0xa48f('0x1e')]=_0x57ee16;if(_0x506e31['query'][_0xa48f('0x3f')]){_0x578735['include']=[{'all':!![]}];}return db[_0xa48f('0x2d')][_0xa48f('0x40')](_0x578735);})[_0xa48f('0x24')](function(_0x3c1c1f){_0x5ecef8['rows']=_0x3c1c1f;return _0x5ecef8;})[_0xa48f('0x24')](respondWithFilteredResult(_0x5be2bb,_0x578735))['catch'](handleError(_0x5be2bb,null));})[_0xa48f('0x41')](handleError(_0x5be2bb,null));};exports[_0xa48f('0x42')]=function(_0x47eb3b,_0x421081){var _0x5104cc={'raw':![],'where':{'id':_0x47eb3b[_0xa48f('0x43')]['id']}},_0xace2a1={};_0xace2a1['model']=_[_0xa48f('0x30')](db['CmCompany'][_0xa48f('0x44')]);_0xace2a1[_0xa48f('0x31')]=_[_0xa48f('0x30')](_0x47eb3b[_0xa48f('0x31')]);_0xace2a1['filters']=_[_0xa48f('0x32')](_0xace2a1[_0xa48f('0x2f')],_0xace2a1[_0xa48f('0x31')]);_0x5104cc[_0xa48f('0x33')]=_['intersection'](_0xace2a1['model'],qs[_0xa48f('0x34')](_0x47eb3b[_0xa48f('0x31')]['fields']));_0x5104cc[_0xa48f('0x33')]=_0x5104cc['attributes'][_0xa48f('0x45')]?_0x5104cc[_0xa48f('0x33')]:_0xace2a1['model'];if(_0x47eb3b['query']['includeAll']){_0x5104cc['include']=[{'all':!![]}];}_0x5104cc=_[_0xa48f('0x3c')]({},_0x5104cc,_0x47eb3b['options']);return db['CmCompany'][_0xa48f('0x46')](_0x5104cc)[_0xa48f('0x24')](handleEntityNotFound(_0x421081,null))['then'](respondWithResult(_0x421081,null))['catch'](handleError(_0x421081,null));};exports[_0xa48f('0x47')]=function(_0x23ab79,_0x2b45b3){return db['CmCompany'][_0xa48f('0x47')](_0x23ab79[_0xa48f('0x48')],{})['then'](function(_0xa418e0){var _0x2c1b3b=_0x23ab79['user'][_0xa48f('0x26')]({'plain':!![]});if(!_0x2c1b3b)throw new Error(_0xa48f('0x49'));if(_0x2c1b3b[_0xa48f('0x4a')]===_0xa48f('0x4b')){var _0x314dbb=_0xa418e0[_0xa48f('0x26')]({'plain':!![]});var _0xe881d0=_0xa48f('0x27');return db[_0xa48f('0x4c')]['find']({'where':{'name':_0xe881d0,'userProfileId':_0x2c1b3b[_0xa48f('0x4d')]},'raw':!![]})['then'](function(_0x58166a){if(_0x58166a&&_0x58166a['autoAssociation']===0x0){return db[_0xa48f('0x28')]['create']({'name':_0x314dbb[_0xa48f('0x2a')],'resourceId':_0x314dbb['id'],'type':_0x58166a[_0xa48f('0x2a')],'sectionId':_0x58166a['id']},{})[_0xa48f('0x24')](function(){return _0xa418e0;});}else{return _0xa418e0;}})[_0xa48f('0x41')](function(_0x138c9a){logger[_0xa48f('0x4e')](_0xa48f('0x4f'),_0x138c9a);throw _0x138c9a;});}return _0xa418e0;})['then'](respondWithResult(_0x2b45b3,0xc9))['catch'](handleError(_0x2b45b3,null));};exports[_0xa48f('0x23')]=function(_0x4f031e,_0x573e4f){if(_0x4f031e['body']['id']){delete _0x4f031e['body']['id'];}return db[_0xa48f('0x2d')][_0xa48f('0x46')]({'where':{'id':_0x4f031e[_0xa48f('0x43')]['id']}})['then'](handleEntityNotFound(_0x573e4f,null))[_0xa48f('0x24')](saveUpdates(_0x4f031e[_0xa48f('0x48')],null))[_0xa48f('0x24')](respondWithResult(_0x573e4f,null))['catch'](handleError(_0x573e4f,null));};exports[_0xa48f('0x25')]=function(_0x21793a,_0x57fcb0){return db[_0xa48f('0x2d')]['find']({'where':{'id':_0x21793a[_0xa48f('0x43')]['id']}})[_0xa48f('0x24')](handleEntityNotFound(_0x57fcb0,null))[_0xa48f('0x24')](removeEntity(_0x57fcb0,null))[_0xa48f('0x41')](handleError(_0x57fcb0,null));};exports[_0xa48f('0x2e')]=function(_0x1e523f,_0x28bdba){return db[_0xa48f('0x2d')]['describe']()['then'](respondWithResult(_0x28bdba,null))[_0xa48f('0x41')](handleError(_0x28bdba,null));};exports[_0xa48f('0x50')]=function(_0x5b26ef,_0x41a54a,_0x3480c2){return db[_0xa48f('0x51')][_0xa48f('0x46')]({'where':{'id':_0x5b26ef[_0xa48f('0x43')]['id']}})['then'](handleEntityNotFound(_0x41a54a,null))[_0xa48f('0x24')](function(_0x49d438){if(_0x49d438){return _0x49d438[_0xa48f('0x50')](_0x5b26ef[_0xa48f('0x48')][_0xa48f('0x52')],_[_0xa48f('0x53')](_0x5b26ef[_0xa48f('0x48')],[_0xa48f('0x52'),'id'])||{});}})[_0xa48f('0x24')](respondWithResult(_0x41a54a,null))[_0xa48f('0x41')](handleError(_0x41a54a,null));};exports[_0xa48f('0x54')]=function(_0x42a3ee,_0x594249,_0x3cf829){var _0x13eb0f={};var _0x1490dd={};var _0x509880;var _0x5e5182;return db['CmCompany'][_0xa48f('0x55')]({'where':{'id':_0x42a3ee[_0xa48f('0x43')]['id']}})[_0xa48f('0x24')](handleEntityNotFound(_0x594249,null))[_0xa48f('0x24')](function(_0xfbf607){if(_0xfbf607){_0x509880=_0xfbf607;_0x1490dd[_0xa48f('0x2f')]=_['keys'](db[_0xa48f('0x51')][_0xa48f('0x44')]);_0x1490dd['query']=_[_0xa48f('0x30')](_0x42a3ee[_0xa48f('0x31')]);_0x1490dd[_0xa48f('0x38')]=_[_0xa48f('0x32')](_0x1490dd[_0xa48f('0x2f')],_0x1490dd['query']);_0x13eb0f[_0xa48f('0x33')]=_[_0xa48f('0x32')](_0x1490dd[_0xa48f('0x2f')],qs[_0xa48f('0x34')](_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x34')]));_0x13eb0f[_0xa48f('0x33')]=_0x13eb0f[_0xa48f('0x33')]['length']?_0x13eb0f['attributes']:_0x1490dd[_0xa48f('0x2f')];_0x13eb0f[_0xa48f('0x36')]=qs[_0xa48f('0x37')](_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x37')]);_0x13eb0f[_0xa48f('0x3b')]=qs['filters'](_[_0xa48f('0x39')](_0x42a3ee[_0xa48f('0x31')],_0x1490dd[_0xa48f('0x38')]));if(_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x3a')]){_0x13eb0f[_0xa48f('0x3b')]=_['merge'](_0x13eb0f[_0xa48f('0x3b')],{'$or':_[_0xa48f('0x3d')](_0x13eb0f[_0xa48f('0x33')],function(_0x44a810){var _0x5acbe1={};_0x5acbe1[_0x44a810]={'$like':'%'+_0x42a3ee[_0xa48f('0x31')]['filter']+'%'};return _0x5acbe1;})});}_0x13eb0f=_[_0xa48f('0x3c')]({},_0x13eb0f,_0x42a3ee[_0xa48f('0x3e')]);return _0x509880[_0xa48f('0x54')](_0x13eb0f);}})[_0xa48f('0x24')](function(_0x575545){if(_0x575545){_0x5e5182=_0x575545['length'];if(!_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x35')](_0xa48f('0x56'))){_0x13eb0f[_0xa48f('0x1c')]=qs[_0xa48f('0x1c')](_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x1c')]);_0x13eb0f[_0xa48f('0x1b')]=qs[_0xa48f('0x1b')](_0x42a3ee['query']['offset']);}return _0x509880[_0xa48f('0x54')](_0x13eb0f);}})[_0xa48f('0x24')](function(_0x163eaf){if(_0x163eaf){return _0x163eaf?{'count':_0x5e5182,'rows':_0x163eaf}:null;}})[_0xa48f('0x24')](respondWithResult(_0x594249,null))[_0xa48f('0x41')](handleError(_0x594249,null));};
\ No newline at end of file
+var _0x4d07=['Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','map','options','findAll','catch','includeAll','include','merge','find','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','ids','omit','getContacts','CmContact','rawAttributes','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','get'];(function(_0x3618bf,_0x942164){var _0x497db1=function(_0x4fe210){while(--_0x4fe210){_0x3618bf['push'](_0x3618bf['shift']());}};_0x497db1(++_0x942164);}(_0x4d07,0x127));var _0x74d0=function(_0x586a05,_0x213f1d){_0x586a05=_0x586a05-0x0;var _0x536a90=_0x4d07[_0x586a05];return _0x536a90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74d0('0x0'));var zipdir=require(_0x74d0('0x1'));var jsonpatch=require(_0x74d0('0x2'));var rp=require(_0x74d0('0x3'));var moment=require('moment');var BPromise=require(_0x74d0('0x4'));var Mustache=require(_0x74d0('0x5'));var util=require(_0x74d0('0x6'));var path=require(_0x74d0('0x7'));var sox=require(_0x74d0('0x8'));var csv=require(_0x74d0('0x9'));var ejs=require(_0x74d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x74d0('0xb'));var crypto=require(_0x74d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x74d0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x74d0('0xe'));var Papa=require('papaparse');var Redis=require(_0x74d0('0xf'));var authService=require(_0x74d0('0x10'));var qs=require(_0x74d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x74d0('0x12'))(_0x74d0('0x13'));var utils=require(_0x74d0('0x14'));var config=require(_0x74d0('0x15'));var licenseUtil=require(_0x74d0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd0617b,_0x4f5ac1){_0x4f5ac1=_0x4f5ac1||0xcc;return function(_0x29f04e){if(_0x29f04e){return _0xd0617b[_0x74d0('0x17')](_0x4f5ac1);}return _0xd0617b[_0x74d0('0x18')](_0x4f5ac1)[_0x74d0('0x19')]();};}function respondWithResult(_0x31f23a,_0x3e34f2){_0x3e34f2=_0x3e34f2||0xc8;return function(_0x377749){if(_0x377749){return _0x31f23a[_0x74d0('0x18')](_0x3e34f2)[_0x74d0('0x1a')](_0x377749);}};}function respondWithFilteredResult(_0x89edac,_0xebbd16){return function(_0x298566){if(_0x298566){var _0x767631=typeof _0xebbd16[_0x74d0('0x1b')]===_0x74d0('0x1c')&&typeof _0xebbd16['limit']===_0x74d0('0x1c');var _0x4426f8=_0x298566[_0x74d0('0x1d')];var _0x45216a=_0x767631?0x0:_0xebbd16['offset'];var _0x36487d=_0x767631?_0x298566['count']:_0xebbd16[_0x74d0('0x1b')]+_0xebbd16[_0x74d0('0x1e')];var _0x58b3c7;if(_0x36487d>=_0x4426f8){_0x36487d=_0x4426f8;_0x58b3c7=0xc8;}else{_0x58b3c7=0xce;}_0x89edac[_0x74d0('0x18')](_0x58b3c7);return _0x89edac['set'](_0x74d0('0x1f'),_0x45216a+'-'+_0x36487d+'/'+_0x4426f8)[_0x74d0('0x1a')](_0x298566);}return null;};}function patchUpdates(_0x3a1cc4){return function(_0x53b940){try{jsonpatch[_0x74d0('0x20')](_0x53b940,_0x3a1cc4,!![]);}catch(_0x3c3b79){return BPromise['reject'](_0x3c3b79);}return _0x53b940[_0x74d0('0x21')]();};}function saveUpdates(_0x21c386,_0x307589){return function(_0x240843){if(_0x240843){return _0x240843['update'](_0x21c386)[_0x74d0('0x22')](function(_0x105ee7){return _0x105ee7;});}return null;};}function removeEntity(_0x574faf,_0x575cde){return function(_0x54b154){if(_0x54b154){return _0x54b154[_0x74d0('0x23')]()['then'](function(){var _0xf271de=_0x54b154[_0x74d0('0x24')]({'plain':!![]});var _0x4f3a9d=_0x74d0('0x25');return db[_0x74d0('0x26')][_0x74d0('0x23')]({'where':{'type':_0x4f3a9d,'resourceId':_0xf271de['id']}})[_0x74d0('0x22')](function(){return _0x54b154;});})[_0x74d0('0x22')](function(){_0x574faf[_0x74d0('0x18')](0xcc)[_0x74d0('0x19')]();});}};}function handleEntityNotFound(_0xf5c024,_0x300307){return function(_0x289de6){if(!_0x289de6){_0xf5c024[_0x74d0('0x17')](0x194);}return _0x289de6;};}function handleError(_0x19e005,_0xbc3575){_0xbc3575=_0xbc3575||0x1f4;return function(_0x164398){logger[_0x74d0('0x27')](_0x164398['stack']);if(_0x164398[_0x74d0('0x28')]){delete _0x164398[_0x74d0('0x28')];}_0x19e005['status'](_0xbc3575)[_0x74d0('0x29')](_0x164398);};}exports[_0x74d0('0x2a')]=function(_0x50b3b4,_0x37aa7a){var _0x3301a9={},_0x39a899={},_0x46b70e={'count':0x0,'rows':[]};return db[_0x74d0('0x2b')]['describe']()['then'](function(_0x15277c){_0x39a899[_0x74d0('0x2c')]=_[_0x74d0('0x2d')](_0x15277c);_0x39a899['query']=_['keys'](_0x50b3b4[_0x74d0('0x2e')]);_0x39a899['filters']=_[_0x74d0('0x2f')](_0x39a899[_0x74d0('0x2c')],_0x39a899['query']);_0x3301a9[_0x74d0('0x30')]=_[_0x74d0('0x2f')](_0x39a899[_0x74d0('0x2c')],qs[_0x74d0('0x31')](_0x50b3b4['query'][_0x74d0('0x31')]));_0x3301a9[_0x74d0('0x30')]=_0x3301a9[_0x74d0('0x30')][_0x74d0('0x32')]?_0x3301a9[_0x74d0('0x30')]:_0x39a899['model'];if(!_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x33')](_0x74d0('0x34'))){_0x3301a9[_0x74d0('0x1e')]=qs[_0x74d0('0x1e')](_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x1e')]);_0x3301a9[_0x74d0('0x1b')]=qs[_0x74d0('0x1b')](_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x1b')]);}_0x3301a9['order']=qs[_0x74d0('0x35')](_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x35')]);_0x3301a9[_0x74d0('0x36')]=qs['filters'](_[_0x74d0('0x37')](_0x50b3b4[_0x74d0('0x2e')],_0x39a899[_0x74d0('0x38')]),_0x15277c);if(_0x50b3b4[_0x74d0('0x2e')][_0x74d0('0x39')]){_0x3301a9['where']=_['merge'](_0x3301a9[_0x74d0('0x36')],{'$or':_[_0x74d0('0x3a')](_0x3301a9['attributes'],function(_0xbe488){var _0x4cc0e1={};_0x4cc0e1[_0xbe488]={'$like':'%'+_0x50b3b4['query']['filter']+'%'};return _0x4cc0e1;})});}_0x3301a9=_['merge']({},_0x3301a9,_0x50b3b4[_0x74d0('0x3b')]);var _0x5e043a={'where':_0x3301a9['where']};return db[_0x74d0('0x2b')][_0x74d0('0x1d')](_0x5e043a)[_0x74d0('0x22')](function(_0x4e5a16){_0x46b70e[_0x74d0('0x1d')]=_0x4e5a16;if(_0x50b3b4[_0x74d0('0x2e')]['includeAll']){_0x3301a9['include']=[{'all':!![]}];}return db[_0x74d0('0x2b')][_0x74d0('0x3c')](_0x3301a9);})[_0x74d0('0x22')](function(_0x1d0902){_0x46b70e['rows']=_0x1d0902;return _0x46b70e;})[_0x74d0('0x22')](respondWithFilteredResult(_0x37aa7a,_0x3301a9))['catch'](handleError(_0x37aa7a,null));})[_0x74d0('0x3d')](handleError(_0x37aa7a,null));};exports['show']=function(_0x53fb72,_0x4b8417){var _0x59c858={'raw':![],'where':{'id':_0x53fb72['params']['id']}},_0x16091={};_0x16091[_0x74d0('0x2c')]=_['keys'](db[_0x74d0('0x2b')]['rawAttributes']);_0x16091[_0x74d0('0x2e')]=_[_0x74d0('0x2d')](_0x53fb72[_0x74d0('0x2e')]);_0x16091[_0x74d0('0x38')]=_[_0x74d0('0x2f')](_0x16091['model'],_0x16091['query']);_0x59c858['attributes']=_[_0x74d0('0x2f')](_0x16091[_0x74d0('0x2c')],qs[_0x74d0('0x31')](_0x53fb72[_0x74d0('0x2e')][_0x74d0('0x31')]));_0x59c858[_0x74d0('0x30')]=_0x59c858['attributes']['length']?_0x59c858[_0x74d0('0x30')]:_0x16091['model'];if(_0x53fb72[_0x74d0('0x2e')][_0x74d0('0x3e')]){_0x59c858[_0x74d0('0x3f')]=[{'all':!![]}];}_0x59c858=_[_0x74d0('0x40')]({},_0x59c858,_0x53fb72[_0x74d0('0x3b')]);return db['CmCompany'][_0x74d0('0x41')](_0x59c858)[_0x74d0('0x22')](handleEntityNotFound(_0x4b8417,null))[_0x74d0('0x22')](respondWithResult(_0x4b8417,null))['catch'](handleError(_0x4b8417,null));};exports['create']=function(_0x206d11,_0x102950){return db[_0x74d0('0x2b')]['create'](_0x206d11['body'],{})['then'](function(_0x4cb514){var _0x1b2fdc=_0x206d11[_0x74d0('0x42')][_0x74d0('0x24')]({'plain':!![]});if(!_0x1b2fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b2fdc[_0x74d0('0x43')]==='user'){var _0x5c04bb=_0x4cb514[_0x74d0('0x24')]({'plain':!![]});var _0x5cad79=_0x74d0('0x25');return db[_0x74d0('0x44')]['find']({'where':{'name':_0x5cad79,'userProfileId':_0x1b2fdc[_0x74d0('0x45')]},'raw':!![]})[_0x74d0('0x22')](function(_0x58c810){if(_0x58c810&&_0x58c810[_0x74d0('0x46')]===0x0){return db[_0x74d0('0x26')][_0x74d0('0x47')]({'name':_0x5c04bb[_0x74d0('0x28')],'resourceId':_0x5c04bb['id'],'type':_0x58c810[_0x74d0('0x28')],'sectionId':_0x58c810['id']},{})['then'](function(){return _0x4cb514;});}else{return _0x4cb514;}})[_0x74d0('0x3d')](function(_0x1904fb){logger[_0x74d0('0x27')](_0x74d0('0x48'),_0x1904fb);throw _0x1904fb;});}return _0x4cb514;})[_0x74d0('0x22')](respondWithResult(_0x102950,0xc9))[_0x74d0('0x3d')](handleError(_0x102950,null));};exports[_0x74d0('0x49')]=function(_0x425879,_0x1ca439){if(_0x425879[_0x74d0('0x4a')]['id']){delete _0x425879[_0x74d0('0x4a')]['id'];}return db['CmCompany'][_0x74d0('0x41')]({'where':{'id':_0x425879[_0x74d0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ca439,null))[_0x74d0('0x22')](saveUpdates(_0x425879[_0x74d0('0x4a')],null))[_0x74d0('0x22')](respondWithResult(_0x1ca439,null))[_0x74d0('0x3d')](handleError(_0x1ca439,null));};exports[_0x74d0('0x23')]=function(_0x43eb69,_0x3612d5){return db[_0x74d0('0x2b')][_0x74d0('0x41')]({'where':{'id':_0x43eb69[_0x74d0('0x4b')]['id']}})[_0x74d0('0x22')](handleEntityNotFound(_0x3612d5,null))['then'](removeEntity(_0x3612d5,null))[_0x74d0('0x3d')](handleError(_0x3612d5,null));};exports['describe']=function(_0x58eb95,_0x39fe9f){return db[_0x74d0('0x2b')][_0x74d0('0x4c')]()[_0x74d0('0x22')](respondWithResult(_0x39fe9f,null))['catch'](handleError(_0x39fe9f,null));};exports[_0x74d0('0x4d')]=function(_0x3552ff,_0x1bd168,_0x3fce45){return db['CmContact'][_0x74d0('0x41')]({'where':{'id':_0x3552ff[_0x74d0('0x4b')]['id']}})[_0x74d0('0x22')](handleEntityNotFound(_0x1bd168,null))[_0x74d0('0x22')](function(_0x42580b){if(_0x42580b){return _0x42580b[_0x74d0('0x4d')](_0x3552ff[_0x74d0('0x4a')][_0x74d0('0x4e')],_[_0x74d0('0x4f')](_0x3552ff[_0x74d0('0x4a')],[_0x74d0('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x1bd168,null))[_0x74d0('0x3d')](handleError(_0x1bd168,null));};exports[_0x74d0('0x50')]=function(_0x479bc5,_0x39c287,_0x5b2bbe){var _0x378426={};var _0x113171={};var _0x15c94a;var _0x51f00d;return db[_0x74d0('0x2b')]['findOne']({'where':{'id':_0x479bc5[_0x74d0('0x4b')]['id']}})[_0x74d0('0x22')](handleEntityNotFound(_0x39c287,null))[_0x74d0('0x22')](function(_0xa572c8){if(_0xa572c8){_0x15c94a=_0xa572c8;_0x113171[_0x74d0('0x2c')]=_[_0x74d0('0x2d')](db[_0x74d0('0x51')][_0x74d0('0x52')]);_0x113171[_0x74d0('0x2e')]=_[_0x74d0('0x2d')](_0x479bc5[_0x74d0('0x2e')]);_0x113171[_0x74d0('0x38')]=_[_0x74d0('0x2f')](_0x113171[_0x74d0('0x2c')],_0x113171[_0x74d0('0x2e')]);_0x378426[_0x74d0('0x30')]=_[_0x74d0('0x2f')](_0x113171[_0x74d0('0x2c')],qs['fields'](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x31')]));_0x378426[_0x74d0('0x30')]=_0x378426[_0x74d0('0x30')][_0x74d0('0x32')]?_0x378426[_0x74d0('0x30')]:_0x113171[_0x74d0('0x2c')];_0x378426['order']=qs[_0x74d0('0x35')](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x35')]);_0x378426[_0x74d0('0x36')]=qs['filters'](_[_0x74d0('0x37')](_0x479bc5[_0x74d0('0x2e')],_0x113171[_0x74d0('0x38')]));if(_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x39')]){_0x378426['where']=_['merge'](_0x378426['where'],{'$or':_[_0x74d0('0x3a')](_0x378426[_0x74d0('0x30')],function(_0x270b23){var _0x118e52={};_0x118e52[_0x270b23]={'$like':'%'+_0x479bc5['query']['filter']+'%'};return _0x118e52;})});}_0x378426=_['merge']({},_0x378426,_0x479bc5[_0x74d0('0x3b')]);return _0x15c94a['getContacts'](_0x378426);}})[_0x74d0('0x22')](function(_0x596995){if(_0x596995){_0x51f00d=_0x596995[_0x74d0('0x32')];if(!_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x33')](_0x74d0('0x34'))){_0x378426['limit']=qs['limit'](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x1e')]);_0x378426[_0x74d0('0x1b')]=qs['offset'](_0x479bc5[_0x74d0('0x2e')][_0x74d0('0x1b')]);}return _0x15c94a['getContacts'](_0x378426);}})[_0x74d0('0x22')](function(_0x443286){if(_0x443286){return _0x443286?{'count':_0x51f00d,'rows':_0x443286}:null;}})[_0x74d0('0x22')](respondWithResult(_0x39c287,null))['catch'](handleError(_0x39c287,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 12d4ff2..cbc6cb4 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 _0x2e88=['define','CmCompany','cm_companies','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x2e88,0xdf));var _0x82e8=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x2e88[_0x213518];return _0x1baf75;};'use strict';var _=require(_0x82e8('0x0'));var util=require('util');var logger=require(_0x82e8('0x1'))(_0x82e8('0x2'));var moment=require('moment');var BPromise=require(_0x82e8('0x3'));var rp=require(_0x82e8('0x4'));var fs=require('fs');var path=require(_0x82e8('0x5'));var rimraf=require('rimraf');var config=require(_0x82e8('0x6'));var attributes=require('./cmCompany.attributes');module[_0x82e8('0x7')]=function(_0xab2455,_0x2210d8){return _0xab2455[_0x82e8('0x8')](_0x82e8('0x9'),attributes,{'tableName':_0x82e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e8d=['request-promise','rimraf','../../config/environment','exports','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x30b94b,_0x5c8835){var _0x18e929=function(_0x3789ca){while(--_0x3789ca){_0x30b94b['push'](_0x30b94b['shift']());}};_0x18e929(++_0x5c8835);}(_0x7e8d,0x17a));var _0xd7e8=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x7e8d[_0x3b5049];return _0x12454e;};'use strict';var _=require(_0xd7e8('0x0'));var util=require(_0xd7e8('0x1'));var logger=require(_0xd7e8('0x2'))(_0xd7e8('0x3'));var moment=require(_0xd7e8('0x4'));var BPromise=require(_0xd7e8('0x5'));var rp=require(_0xd7e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7e8('0x7'));var config=require(_0xd7e8('0x8'));var attributes=require('./cmCompany.attributes');module[_0xd7e8('0x9')]=function(_0x1dd36d,_0x3c8a04){return _0x1dd36d[_0xd7e8('0xa')](_0xd7e8('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 51c7e7b..05eb7c5 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 _0xdc99=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xdc99,0x1d4));var _0x9dc9=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xdc99[_0x279d37];return _0x530173;};'use strict';var _=require(_0x9dc9('0x0'));var util=require(_0x9dc9('0x1'));var moment=require(_0x9dc9('0x2'));var BPromise=require(_0x9dc9('0x3'));var rs=require(_0x9dc9('0x4'));var fs=require('fs');var Redis=require(_0x9dc9('0x5'));var db=require(_0x9dc9('0x6'))['db'];var utils=require(_0x9dc9('0x7'));var logger=require(_0x9dc9('0x8'))(_0x9dc9('0x9'));var config=require(_0x9dc9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9dc9('0xb')][_0x9dc9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x199d80,_0x90ffa1,_0x3f8fd1){return new BPromise(function(_0x33da5a,_0x5cd875){return client[_0x9dc9('0xd')](_0x199d80,_0x3f8fd1)[_0x9dc9('0xe')](function(_0x46a0be){logger['info'](_0x9dc9('0xf'),_0x90ffa1,_0x9dc9('0x10'));logger[_0x9dc9('0x11')](_0x9dc9('0x12'),_0x90ffa1,_0x9dc9('0x10'),JSON[_0x9dc9('0x13')](_0x46a0be));if(_0x46a0be[_0x9dc9('0x14')]){if(_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x15')]===0x1f4){logger['error'](_0x9dc9('0xf'),_0x90ffa1,_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x16')]);return _0x5cd875(_0x46a0be['error']['message']);}logger['error'](_0x9dc9('0xf'),_0x90ffa1,_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x16')]);return _0x33da5a(_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x16')]);}else{logger[_0x9dc9('0x17')](_0x9dc9('0xf'),_0x90ffa1,_0x9dc9('0x10'));_0x33da5a(_0x46a0be['result'][_0x9dc9('0x16')]);}})[_0x9dc9('0x18')](function(_0x2e01cd){logger['error']('CmCompany,\x20%s,\x20%s',_0x90ffa1,_0x2e01cd);_0x5cd875(_0x2e01cd);});});}
\ No newline at end of file
+var _0x84e0=['client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x84e0,0x19b));var _0x084e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x084e('0x0'));var util=require('util');var moment=require(_0x084e('0x1'));var BPromise=require('bluebird');var rs=require(_0x084e('0x2'));var fs=require('fs');var Redis=require(_0x084e('0x3'));var db=require(_0x084e('0x4'))['db'];var utils=require(_0x084e('0x5'));var logger=require(_0x084e('0x6'))('rpc');var config=require(_0x084e('0x7'));var jayson=require(_0x084e('0x8'));var client=jayson[_0x084e('0x9')][_0x084e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28b80c,_0x16e229,_0x4d9f96){return new BPromise(function(_0x451b21,_0x165764){return client['request'](_0x28b80c,_0x4d9f96)[_0x084e('0xb')](function(_0x52929f){logger['info'](_0x084e('0xc'),_0x16e229,_0x084e('0xd'));logger['debug'](_0x084e('0xe'),_0x16e229,_0x084e('0xd'),JSON[_0x084e('0xf')](_0x52929f));if(_0x52929f['error']){if(_0x52929f[_0x084e('0x10')]['code']===0x1f4){logger['error'](_0x084e('0xc'),_0x16e229,_0x52929f['error'][_0x084e('0x11')]);return _0x165764(_0x52929f[_0x084e('0x10')]['message']);}logger[_0x084e('0x10')](_0x084e('0xc'),_0x16e229,_0x52929f['error'][_0x084e('0x11')]);return _0x451b21(_0x52929f['error']['message']);}else{logger[_0x084e('0x12')]('CmCompany,\x20%s,\x20%s',_0x16e229,_0x084e('0xd'));_0x451b21(_0x52929f[_0x084e('0x13')]['message']);}})['catch'](function(_0x579e2f){logger['error'](_0x084e('0xc'),_0x16e229,_0x579e2f);_0x165764(_0x579e2f);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 95203c1..75b52ba 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 _0xc5f8=['destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0xc5f8,0x109));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8c5f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8c5f('0x1'));var express=require(_0x8c5f('0x2'));var router=express['Router']();var fs_extra=require(_0x8c5f('0x3'));var auth=require(_0x8c5f('0x4'));var interaction=require(_0x8c5f('0x5'));var config=require(_0x8c5f('0x6'));var controller=require(_0x8c5f('0x7'));router['get']('/',auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x9')]);router[_0x8c5f('0xa')](_0x8c5f('0xb'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0xc')]);router['get'](_0x8c5f('0xd'),auth['isAuthenticated'](),controller[_0x8c5f('0xe')]);router[_0x8c5f('0xa')](_0x8c5f('0xf'),auth['isAuthenticated'](),controller[_0x8c5f('0x10')]);router[_0x8c5f('0x11')]('/',auth['isAuthenticated'](),controller[_0x8c5f('0x12')]);router['post'](_0x8c5f('0xf'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x13')]);router[_0x8c5f('0x14')](_0x8c5f('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8c5f('0xd'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xebd7=['get','/describe','/:id','/:id/contacts','getContacts','post','addContacts','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x562531,_0x199718){var _0x557f79=function(_0x5e5cb7){while(--_0x5e5cb7){_0x562531['push'](_0x562531['shift']());}};_0x557f79(++_0x199718);}(_0xebd7,0x108));var _0x7ebd=function(_0x4d6311,_0x1134be){_0x4d6311=_0x4d6311-0x0;var _0x465d14=_0xebd7[_0x4d6311];return _0x465d14;};'use strict';var multer=require(_0x7ebd('0x0'));var util=require(_0x7ebd('0x1'));var path=require(_0x7ebd('0x2'));var timeout=require(_0x7ebd('0x3'));var express=require(_0x7ebd('0x4'));var router=express[_0x7ebd('0x5')]();var fs_extra=require(_0x7ebd('0x6'));var auth=require(_0x7ebd('0x7'));var interaction=require(_0x7ebd('0x8'));var config=require(_0x7ebd('0x9'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x7ebd('0xa')](),controller[_0x7ebd('0xb')]);router[_0x7ebd('0xc')](_0x7ebd('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x7ebd('0xc')](_0x7ebd('0xe'),auth[_0x7ebd('0xa')](),controller['show']);router[_0x7ebd('0xc')](_0x7ebd('0xf'),auth[_0x7ebd('0xa')](),controller[_0x7ebd('0x10')]);router[_0x7ebd('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7ebd('0x11')](_0x7ebd('0xf'),auth[_0x7ebd('0xa')](),controller[_0x7ebd('0x12')]);router['put'](_0x7ebd('0xe'),auth['isAuthenticated'](),controller[_0x7ebd('0x13')]);router[_0x7ebd('0x14')](_0x7ebd('0xe'),auth[_0x7ebd('0xa')](),controller[_0x7ebd('0x15')]);module[_0x7ebd('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index b6ec87a..2d9d11f 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 _0x0e24=['UNSIGNED','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x333349,_0x15b189){var _0x135978=function(_0x2cc6ce){while(--_0x2cc6ce){_0x333349['push'](_0x333349['shift']());}};_0x135978(++_0x15b189);}(_0x0e24,0xc6));var _0x40e2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x0e24[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x40e2('0x0'));var Sequelize=require('sequelize');module[_0x40e2('0x1')]={'firstName':{'type':Sequelize[_0x40e2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x40e2('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x40e2('0x2')]},'city':{'type':Sequelize[_0x40e2('0x2')]},'country':{'type':Sequelize[_0x40e2('0x2')]},'dateOfBirth':{'type':Sequelize[_0x40e2('0x2')]},'description':{'type':Sequelize[_0x40e2('0x3')]},'phone':{'type':Sequelize[_0x40e2('0x2')]},'mobile':{'type':Sequelize[_0x40e2('0x2')]},'fax':{'type':Sequelize[_0x40e2('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x40e2('0x2')]},'facebook':{'type':Sequelize[_0x40e2('0x2')]},'fb_data':{'type':Sequelize[_0x40e2('0x2')]},'twitter':{'type':Sequelize[_0x40e2('0x2')]},'skype':{'type':Sequelize[_0x40e2('0x2')]},'teams':{'type':Sequelize[_0x40e2('0x2')]},'viber':{'type':Sequelize[_0x40e2('0x2')]},'line':{'type':Sequelize[_0x40e2('0x2')]},'wechat':{'type':Sequelize[_0x40e2('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x40e2('0x4')]},'priority':{'type':Sequelize[_0x40e2('0x4')](0x2)[_0x40e2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x40e2('0x6')]}};
\ No newline at end of file
+var _0x1ddc=['TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING'];(function(_0xe81227,_0x3f6100){var _0x1461b1=function(_0x27f643){while(--_0x27f643){_0xe81227['push'](_0xe81227['shift']());}};_0x1461b1(++_0x3f6100);}(_0x1ddc,0x1eb));var _0xc1dd=function(_0x452ad6,_0x29f44a){_0x452ad6=_0x452ad6-0x0;var _0x4592e8=_0x1ddc[_0x452ad6];return _0x4592e8;};'use strict';var _=require(_0xc1dd('0x0'));var Sequelize=require(_0xc1dd('0x1'));module[_0xc1dd('0x2')]={'firstName':{'type':Sequelize[_0xc1dd('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc1dd('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc1dd('0x3')]},'city':{'type':Sequelize[_0xc1dd('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xc1dd('0x3')]},'description':{'type':Sequelize[_0xc1dd('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xc1dd('0x3')]},'fax':{'type':Sequelize[_0xc1dd('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xc1dd('0x3')]},'facebook':{'type':Sequelize[_0xc1dd('0x3')]},'fb_data':{'type':Sequelize[_0xc1dd('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc1dd('0x3')]},'viber':{'type':Sequelize[_0xc1dd('0x3')]},'line':{'type':Sequelize[_0xc1dd('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xc1dd('0x5')](0x2)[_0xc1dd('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc1dd('0x7')],'defaultValue':Sequelize[_0xc1dd('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a5a3668..d7395b5 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 _0x1722=['getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','parse','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','note','userDisposition','userThirdDisposition','UserId','alias','createdAt','DESC','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','Owner','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','Interaction','all','flatten','sortBy','slice','moment','bluebird','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','status','json','undefined','limit','offset','set','update','destroy','then','end','sendStatus','stack','name','send','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','fieldType','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','buildExpression','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','count','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','startsWith','displayName','findAll','columnName','custom','values','merge','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','Tag','omit','format','cf_%d','$and','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','filters','setTags','ids','getHoppers','CmHopper','options','include','ContactId','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','root','filename','chmodSync','0777','fork','pid','upload','createReadStream','file','meta','import','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1722,0x152));var _0x2172=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1722[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x2172('0x0'));var BPromise=require(_0x2172('0x1'));var util=require('util');var path=require(_0x2172('0x2'));var fs=require('fs');var _=require(_0x2172('0x3'));var squel=require(_0x2172('0x4'));var Papa=require(_0x2172('0x5'));var Redis=require(_0x2172('0x6'));var qs=require(_0x2172('0x7'));var as=require(_0x2172('0x8'));var logger=require(_0x2172('0x9'))(_0x2172('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2172('0xb')]=_[_0x2172('0xc')](config['redis'],{'host':_0x2172('0xd'),'port':0x18eb});var socket=require(_0x2172('0xe'))(new Redis(config[_0x2172('0xb')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x152ed2,_0x162e6d){_0x162e6d=_0x162e6d||0xc8;return function(_0x2c89d2){if(_0x2c89d2){return _0x152ed2[_0x2172('0xf')](_0x162e6d)[_0x2172('0x10')](_0x2c89d2);}};}function respondWithFilteredResult(_0xc9cac0,_0x2f314c){return function(_0x198431){if(_0x198431){var _0x4cf9f6=typeof _0x2f314c['offset']===_0x2172('0x11')&&typeof _0x2f314c[_0x2172('0x12')]===_0x2172('0x11');var _0x59962d=_0x198431['count'];var _0x27f6cd=_0x4cf9f6?0x0:_0x2f314c[_0x2172('0x13')];var _0x5884b5=_0x4cf9f6?_0x198431['count']:_0x2f314c[_0x2172('0x13')]+_0x2f314c[_0x2172('0x12')];var _0x309532;if(_0x5884b5>=_0x59962d){_0x5884b5=_0x59962d;_0x309532=0xc8;}else{_0x309532=0xce;}_0xc9cac0[_0x2172('0xf')](_0x309532);return _0xc9cac0[_0x2172('0x14')]('Content-Range',_0x27f6cd+'-'+_0x5884b5+'/'+_0x59962d)[_0x2172('0x10')](_0x198431);}return null;};}function saveUpdates(_0xa897fc){return function(_0x13bce3){if(_0x13bce3){return _0x13bce3[_0x2172('0x15')](_0xa897fc)['then'](function(_0x20c71d){return _0x20c71d;});}return null;};}function removeEntity(_0x583125){return function(_0x2c4d02){if(_0x2c4d02){return _0x2c4d02[_0x2172('0x16')]()[_0x2172('0x17')](function(){_0x583125['status'](0xcc)[_0x2172('0x18')]();});}};}function handleEntityNotFound(_0x55e42f){return function(_0x2e368a){if(!_0x2e368a){_0x55e42f[_0x2172('0x19')](0x194);}return _0x2e368a;};}function handleError(_0x24644b,_0x1ff79b){_0x1ff79b=_0x1ff79b||0x1f4;return function(_0x41e612){logger['error'](_0x41e612[_0x2172('0x1a')]);if(_0x41e612[_0x2172('0x1b')]){delete _0x41e612[_0x2172('0x1b')];}_0x24644b['status'](_0x1ff79b)[_0x2172('0x1c')](_0x41e612);};}exports[_0x2172('0x1d')]=function(_0x387632,_0x3feda3){var _0x1e1615={},_0x3ac581={},_0x3d0888={'count':0x0,'rows':[]};return db[_0x2172('0x1e')][_0x2172('0x1f')]()[_0x2172('0x17')](function(_0x2979b7){var _0x6e27c=[];for(var _0x36a535=0x0;_0x36a535
','Attachments','Title','Data','getHost','imap.gmail.com','yahoo'];(function(_0x454b7e,_0x39b2aa){var _0x4e466e=function(_0x5af331){while(--_0x5af331){_0x454b7e['push'](_0x454b7e['shift']());}};_0x4e466e(++_0x39b2aa);}(_0x6337,0x18a));var _0x7633=function(_0x32f2eb,_0x5cbe90){_0x32f2eb=_0x32f2eb-0x0;var _0x278e76=_0x6337[_0x32f2eb];return _0x278e76;};'use strict';var _=require('lodash');var moment=require(_0x7633('0x0'));var random=require(_0x7633('0x1'));var fs=require('fs');var path=require(_0x7633('0x2'));var util=require(_0x7633('0x3'));var tnef=require(_0x7633('0x4'));var logger=require(_0x7633('0x5'))(_0x7633('0x6'));var config=require(_0x7633('0x7'));function getAddress(_0x2ccc60){var _0x56f3ba=_[_0x7633('0x8')](_0x2ccc60[_0x7633('0x9')]);return _0x56f3ba&&_0x56f3ba[_0x7633('0xa')]?_0x56f3ba['address']:_0x7633('0xb')+random['generate'](0x6)+_0x7633('0xc');}function getFirstName(_0x14742c){var _0x54cc0e=_[_0x7633('0x8')](_0x14742c['value']);if(_0x54cc0e&&_0x54cc0e[_0x7633('0xd')]){if(_0x54cc0e['name']==_0x54cc0e[_0x7633('0xa')]){return _0x54cc0e[_0x7633('0xd')]['substring'](0x0,_0x54cc0e[_0x7633('0xd')][_0x7633('0xe')]('@'));}var _0x332283=_0x54cc0e['name'][_0x7633('0xf')](/\s+/);return _0x332283[_0x7633('0x10')]>0x1?_0x332283[_0x7633('0x11')](0x0,-0x1)['join']('\x20'):_0x54cc0e[_0x7633('0xd')];}return _0x7633('0x12');}function getLastName(_0x304a67){var _0x5ce87a=_['head'](_0x304a67['value']);if(_0x5ce87a&&_0x5ce87a[_0x7633('0xd')]){var _0x1be0ab=_0x5ce87a[_0x7633('0xd')][_0x7633('0xf')](/\s+/);return _0x1be0ab[_0x7633('0x10')]>0x1?_0x1be0ab[_0x7633('0x13')]():'';}return'';}function getMails(_0x47e212,_0x45ded1){var _0x1528b4='';for(var _0x5cbd62=0x0;_0x5cbd62<_0x45ded1[_0x7633('0x9')][_0x7633('0x10')];_0x5cbd62+=0x1){if(_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]!==_0x47e212){if(!_[_0x7633('0x14')](_0x1528b4)){_0x1528b4+=',';}_0x1528b4+=_0x45ded1['value'][_0x5cbd62][_0x7633('0xd')]||_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]||'';_0x1528b4+='\x20<';_0x1528b4+=_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]?_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]:_0x7633('0xb')+random[_0x7633('0x15')](0x6)+'@xcally.com';_0x1528b4+='>';}}return _0x1528b4;}function parseEmail(_0xdb0809,_0x1140cd,_0x1eb32e){if(_0x1140cd[_0x7633('0x16')]){var _0x1c8efc=/