From 4175bfa50e8b676ba160ec2a5d8f461c9ddb8476 Mon Sep 17 00:00:00 2001
From: Andrea Bianco
Date: Sat, 28 Aug 2021 11:52:29 +0200
Subject: [PATCH] Built motion from commit 13fdd181.|2.5.34
---
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.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 +-
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 +-
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/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/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 +-
1147 files changed, 1147 insertions(+), 1147 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 264b85f..101dac9 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-08-28T08:13:14.590Z",
+ "time": "2021-08-28T09:43:58.937Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index e545d27..4d80ed5 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-08-28T08:13:14.590Z",
+ "time": "2021-08-28T09:43:58.937Z",
"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 1ea8577..cb5335f 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 _0x1645=['integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script'];(function(_0x502c77,_0x2863a0){var _0x2f0447=function(_0x4152bd){while(--_0x4152bd){_0x502c77['push'](_0x502c77['shift']());}};_0x2f0447(++_0x2863a0);}(_0x1645,0x113));var _0x5164=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1645[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5164('0x0'));module[_0x5164('0x1')]={'name':{'type':Sequelize[_0x5164('0x2')],'get':function(_0x48f275){return this['getDataValue'](_0x5164('0x3'));}},'action':{'type':Sequelize[_0x5164('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5164('0x5'),_0x5164('0x6'),_0x5164('0x7'),_0x5164('0x8'),_0x5164('0x9'),_0x5164('0xa'),_0x5164('0xb'),_0x5164('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5164('0x4')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x5164('0x4')](0x1000),'comment':_0x5164('0xd')},'data3':{'type':Sequelize[_0x5164('0x4')](0x1000),'comment':_0x5164('0xe')},'data4':{'type':Sequelize[_0x5164('0x4')](0x1000)},'data5':{'type':Sequelize[_0x5164('0x4')](0x1000)},'data6':{'type':Sequelize[_0x5164('0x4')]},'data7':{'type':Sequelize[_0x5164('0xf')]}};
\ No newline at end of file
+var _0x4fb5=['getDataValue','action','contactManager','integration','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL'];(function(_0x14eafa,_0x1f47c7){var _0x20cbd3=function(_0xf05716){while(--_0xf05716){_0x14eafa['push'](_0x14eafa['shift']());}};_0x20cbd3(++_0x1f47c7);}(_0x4fb5,0x139));var _0x54fb=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x4fb5[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x54fb('0x0'));module['exports']={'name':{'type':Sequelize[_0x54fb('0x1')],'get':function(_0x578009){return this[_0x54fb('0x2')](_0x54fb('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x54fb('0x4'),_0x54fb('0x5'),'motionbar',_0x54fb('0x6'),_0x54fb('0x7'),'browser',_0x54fb('0x8'),_0x54fb('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x54fb('0xa')},'data1':{'type':Sequelize[_0x54fb('0xb')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x54fb('0xc')},'data3':{'type':Sequelize[_0x54fb('0xb')](0x1000),'comment':_0x54fb('0xd')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x54fb('0xb')]},'data7':{'type':Sequelize[_0x54fb('0xe')]}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index a818c46..1507c8d 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 _0x360c=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','update','Action','find','params','body','catch','eml-format','rimraf','fast-json-patch','request-promise','util','sox'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x360c,0x1e9));var _0xc360=function(_0x49ef27,_0x1e89e3){_0x49ef27=_0x49ef27-0x0;var _0x151c39=_0x360c[_0x49ef27];return _0x151c39;};'use strict';var emlformat=require(_0xc360('0x0'));var rimraf=require(_0xc360('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc360('0x2'));var rp=require(_0xc360('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc360('0x4'));var path=require('path');var sox=require(_0xc360('0x5'));var csv=require(_0xc360('0x6'));var ejs=require(_0xc360('0x7'));var fs=require('fs');var fs_extra=require(_0xc360('0x8'));var _=require(_0xc360('0x9'));var squel=require(_0xc360('0xa'));var crypto=require('crypto');var jsforce=require(_0xc360('0xb'));var deskjs=require(_0xc360('0xc'));var toCsv=require(_0xc360('0x6'));var querystring=require(_0xc360('0xd'));var Papa=require(_0xc360('0xe'));var Redis=require(_0xc360('0xf'));var authService=require(_0xc360('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc360('0x11'));var hardwareService=require(_0xc360('0x12'));var logger=require('../../config/logger')(_0xc360('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc360('0x14'))['db'];function respondWithStatusCode(_0x5dc823,_0x388b98){_0x388b98=_0x388b98||0xcc;return function(_0x134efb){if(_0x134efb){return _0x5dc823[_0xc360('0x15')](_0x388b98);}return _0x5dc823['status'](_0x388b98)[_0xc360('0x16')]();};}function respondWithResult(_0x5267a4,_0x7b4592){_0x7b4592=_0x7b4592||0xc8;return function(_0x13c552){if(_0x13c552){return _0x5267a4[_0xc360('0x17')](_0x7b4592)['json'](_0x13c552);}};}function respondWithFilteredResult(_0x272219,_0x3a60bb){return function(_0x33b539){if(_0x33b539){var _0x691bdd=typeof _0x3a60bb[_0xc360('0x18')]===_0xc360('0x19')&&typeof _0x3a60bb[_0xc360('0x1a')]==='undefined';var _0x92965b=_0x33b539[_0xc360('0x1b')];var _0x43637c=_0x691bdd?0x0:_0x3a60bb[_0xc360('0x18')];var _0xcf277=_0x691bdd?_0x33b539[_0xc360('0x1b')]:_0x3a60bb[_0xc360('0x18')]+_0x3a60bb[_0xc360('0x1a')];var _0x3bddc1;if(_0xcf277>=_0x92965b){_0xcf277=_0x92965b;_0x3bddc1=0xc8;}else{_0x3bddc1=0xce;}_0x272219['status'](_0x3bddc1);return _0x272219[_0xc360('0x1c')](_0xc360('0x1d'),_0x43637c+'-'+_0xcf277+'/'+_0x92965b)[_0xc360('0x1e')](_0x33b539);}return null;};}function patchUpdates(_0x1a34ba){return function(_0x2d4f3b){try{jsonpatch[_0xc360('0x1f')](_0x2d4f3b,_0x1a34ba,!![]);}catch(_0x2c1641){return BPromise[_0xc360('0x20')](_0x2c1641);}return _0x2d4f3b[_0xc360('0x21')]();};}function saveUpdates(_0x5f177d,_0x3956a2){return function(_0x2a57b8){if(_0x2a57b8){return _0x2a57b8['update'](_0x5f177d)[_0xc360('0x22')](function(_0x349fc2){return _0x349fc2;});}return null;};}function removeEntity(_0x291c16,_0x17284f){return function(_0x122bcc){if(_0x122bcc){return _0x122bcc[_0xc360('0x23')]()[_0xc360('0x22')](function(){_0x291c16['status'](0xcc)[_0xc360('0x16')]();});}};}function handleEntityNotFound(_0x33e569,_0x25294d){return function(_0x582652){if(!_0x582652){_0x33e569[_0xc360('0x15')](0x194);}return _0x582652;};}function handleError(_0x4f3c38,_0x225083){_0x225083=_0x225083||0x1f4;return function(_0x1b34b9){logger[_0xc360('0x24')](_0x1b34b9['stack']);if(_0x1b34b9['name']){delete _0x1b34b9[_0xc360('0x25')];}_0x4f3c38['status'](_0x225083)[_0xc360('0x26')](_0x1b34b9);};}exports[_0xc360('0x27')]=function(_0x2cb151,_0x381d66){if(_0x2cb151['body']['id']){delete _0x2cb151['body']['id'];}return db[_0xc360('0x28')][_0xc360('0x29')]({'where':{'id':_0x2cb151[_0xc360('0x2a')]['id']}})[_0xc360('0x22')](handleEntityNotFound(_0x381d66,null))[_0xc360('0x22')](saveUpdates(_0x2cb151[_0xc360('0x2b')],null))[_0xc360('0x22')](respondWithResult(_0x381d66,null))[_0xc360('0x2c')](handleError(_0x381d66,null));};exports[_0xc360('0x23')]=function(_0x33bc52,_0x3bb87d){return db[_0xc360('0x28')][_0xc360('0x29')]({'where':{'id':_0x33bc52[_0xc360('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3bb87d,null))[_0xc360('0x22')](removeEntity(_0x3bb87d,null))[_0xc360('0x2c')](handleError(_0x3bb87d,null));};
\ No newline at end of file
+var _0xeabe=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','rimraf','fast-json-patch','request-promise','moment','util','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x4e28a3,_0x4d0f64){var _0x367cd3=function(_0x579e80){while(--_0x579e80){_0x4e28a3['push'](_0x4e28a3['shift']());}};_0x367cd3(++_0x4d0f64);}(_0xeabe,0x71));var _0xeeab=function(_0x3a96b9,_0x1c1881){_0x3a96b9=_0x3a96b9-0x0;var _0x175e80=_0xeabe[_0x3a96b9];return _0x175e80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeeab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeeab('0x1'));var rp=require(_0xeeab('0x2'));var moment=require(_0xeeab('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeeab('0x4'));var path=require(_0xeeab('0x5'));var sox=require(_0xeeab('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeeab('0x7'));var squel=require(_0xeeab('0x8'));var crypto=require(_0xeeab('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xeeab('0xa'));var toCsv=require('to-csv');var querystring=require(_0xeeab('0xb'));var Papa=require(_0xeeab('0xc'));var Redis=require(_0xeeab('0xd'));var authService=require(_0xeeab('0xe'));var qs=require(_0xeeab('0xf'));var as=require(_0xeeab('0x10'));var hardwareService=require(_0xeeab('0x11'));var logger=require('../../config/logger')(_0xeeab('0x12'));var utils=require(_0xeeab('0x13'));var config=require(_0xeeab('0x14'));var licenseUtil=require(_0xeeab('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x227066,_0x4c6037){_0x4c6037=_0x4c6037||0xcc;return function(_0x20a9ad){if(_0x20a9ad){return _0x227066[_0xeeab('0x16')](_0x4c6037);}return _0x227066[_0xeeab('0x17')](_0x4c6037)[_0xeeab('0x18')]();};}function respondWithResult(_0x41cce0,_0x1c50c2){_0x1c50c2=_0x1c50c2||0xc8;return function(_0x51af7a){if(_0x51af7a){return _0x41cce0[_0xeeab('0x17')](_0x1c50c2)[_0xeeab('0x19')](_0x51af7a);}};}function respondWithFilteredResult(_0x1d6122,_0x46c382){return function(_0x13ef70){if(_0x13ef70){var _0x965167=typeof _0x46c382[_0xeeab('0x1a')]===_0xeeab('0x1b')&&typeof _0x46c382[_0xeeab('0x1c')]===_0xeeab('0x1b');var _0x171449=_0x13ef70[_0xeeab('0x1d')];var _0x41ec98=_0x965167?0x0:_0x46c382[_0xeeab('0x1a')];var _0xacbc5b=_0x965167?_0x13ef70[_0xeeab('0x1d')]:_0x46c382[_0xeeab('0x1a')]+_0x46c382[_0xeeab('0x1c')];var _0x5cecc4;if(_0xacbc5b>=_0x171449){_0xacbc5b=_0x171449;_0x5cecc4=0xc8;}else{_0x5cecc4=0xce;}_0x1d6122[_0xeeab('0x17')](_0x5cecc4);return _0x1d6122[_0xeeab('0x1e')](_0xeeab('0x1f'),_0x41ec98+'-'+_0xacbc5b+'/'+_0x171449)[_0xeeab('0x19')](_0x13ef70);}return null;};}function patchUpdates(_0x2f1304){return function(_0x395cec){try{jsonpatch[_0xeeab('0x20')](_0x395cec,_0x2f1304,!![]);}catch(_0x1bb1e2){return BPromise[_0xeeab('0x21')](_0x1bb1e2);}return _0x395cec[_0xeeab('0x22')]();};}function saveUpdates(_0x57ef53,_0xfd7fef){return function(_0x338c22){if(_0x338c22){return _0x338c22[_0xeeab('0x23')](_0x57ef53)[_0xeeab('0x24')](function(_0x5b353e){return _0x5b353e;});}return null;};}function removeEntity(_0x4dbcd5,_0x17b057){return function(_0x8076fb){if(_0x8076fb){return _0x8076fb[_0xeeab('0x25')]()[_0xeeab('0x24')](function(){_0x4dbcd5[_0xeeab('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c4828,_0x59616e){return function(_0x4e9f0a){if(!_0x4e9f0a){_0x5c4828[_0xeeab('0x16')](0x194);}return _0x4e9f0a;};}function handleError(_0x434cfd,_0x3f73ec){_0x3f73ec=_0x3f73ec||0x1f4;return function(_0x231170){logger['error'](_0x231170[_0xeeab('0x26')]);if(_0x231170[_0xeeab('0x27')]){delete _0x231170[_0xeeab('0x27')];}_0x434cfd[_0xeeab('0x17')](_0x3f73ec)[_0xeeab('0x28')](_0x231170);};}exports[_0xeeab('0x23')]=function(_0x59c393,_0xb0c0f5){if(_0x59c393[_0xeeab('0x29')]['id']){delete _0x59c393['body']['id'];}return db[_0xeeab('0x2a')][_0xeeab('0x2b')]({'where':{'id':_0x59c393[_0xeeab('0x2c')]['id']}})[_0xeeab('0x24')](handleEntityNotFound(_0xb0c0f5,null))[_0xeeab('0x24')](saveUpdates(_0x59c393['body'],null))['then'](respondWithResult(_0xb0c0f5,null))[_0xeeab('0x2d')](handleError(_0xb0c0f5,null));};exports[_0xeeab('0x25')]=function(_0x47d810,_0x258aff){return db['Action'][_0xeeab('0x2b')]({'where':{'id':_0x47d810[_0xeeab('0x2c')]['id']}})[_0xeeab('0x24')](handleEntityNotFound(_0x258aff,null))[_0xeeab('0x24')](removeEntity(_0x258aff,null))[_0xeeab('0x2d')](handleError(_0x258aff,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 4151017..8ebcafa 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 _0xba91=['tools_actions','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x3fd0d4,_0x4bb3d1){var _0x9e1776=function(_0x477ea8){while(--_0x477ea8){_0x3fd0d4['push'](_0x3fd0d4['shift']());}};_0x9e1776(++_0x4bb3d1);}(_0xba91,0xaa));var _0x1ba9=function(_0x4f0fbc,_0x10512b){_0x4f0fbc=_0x4f0fbc-0x0;var _0x51fecb=_0xba91[_0x4f0fbc];return _0x51fecb;};'use strict';var _=require('lodash');var util=require(_0x1ba9('0x0'));var logger=require(_0x1ba9('0x1'))(_0x1ba9('0x2'));var moment=require(_0x1ba9('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ba9('0x4'));var fs=require('fs');var path=require(_0x1ba9('0x5'));var rimraf=require(_0x1ba9('0x6'));var config=require(_0x1ba9('0x7'));var attributes=require(_0x1ba9('0x8'));module[_0x1ba9('0x9')]=function(_0x3c95fd,_0x228ca7){return _0x3c95fd[_0x1ba9('0xa')](_0x1ba9('0xb'),attributes,{'tableName':_0x1ba9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee29=['path','../../config/environment','exports','define','Action','tools_actions','lodash','util','moment','bluebird'];(function(_0x449fd9,_0xce7c3d){var _0x180251=function(_0x50041f){while(--_0x50041f){_0x449fd9['push'](_0x449fd9['shift']());}};_0x180251(++_0xce7c3d);}(_0xee29,0x150));var _0x9ee2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee29[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9ee2('0x0'));var util=require(_0x9ee2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9ee2('0x2'));var BPromise=require(_0x9ee2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ee2('0x4'));var rimraf=require('rimraf');var config=require(_0x9ee2('0x5'));var attributes=require('./action.attributes');module[_0x9ee2('0x6')]=function(_0x447014,_0x2d40ea){return _0x447014[_0x9ee2('0x7')](_0x9ee2('0x8'),attributes,{'tableName':_0x9ee2('0x9'),'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 7c0130a..f41286e 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x18b0dd,_0x203bd2){var _0x2c802f=function(_0x1d5c70){while(--_0x1d5c70){_0x18b0dd['push'](_0x18b0dd['shift']());}};_0x2c802f(++_0x203bd2);}(_0x8ef6,0xf2));var _0x68ef=function(_0x41df60,_0x80bb3f){_0x41df60=_0x41df60-0x0;var _0x3c10c2=_0x8ef6[_0x41df60];return _0x3c10c2;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Action,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Action,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4a3b02,_0x3f5b31){var _0x40d53c=function(_0x792cc7){while(--_0x792cc7){_0x4a3b02['push'](_0x4a3b02['shift']());}};_0x40d53c(++_0x3f5b31);}(_0x5fab,0x177));var _0xb5fa=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x5fab[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 0a45748..d69b3f1 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 _0xf731=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete'];(function(_0x4f130f,_0x305446){var _0x39f00d=function(_0x59b0f6){while(--_0x59b0f6){_0x4f130f['push'](_0x4f130f['shift']());}};_0x39f00d(++_0x305446);}(_0xf731,0xfe));var _0x1f73=function(_0x50cd30,_0x5c80e4){_0x50cd30=_0x50cd30-0x0;var _0x429652=_0xf731[_0x50cd30];return _0x429652;};'use strict';var multer=require(_0x1f73('0x0'));var util=require(_0x1f73('0x1'));var path=require('path');var timeout=require(_0x1f73('0x2'));var express=require('express');var router=express[_0x1f73('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f73('0x4'));var interaction=require(_0x1f73('0x5'));var config=require(_0x1f73('0x6'));var controller=require(_0x1f73('0x7'));router['put'](_0x1f73('0x8'),auth[_0x1f73('0x9')](),controller[_0x1f73('0xa')]);router[_0x1f73('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x1f73('0xc')]);module[_0x1f73('0xd')]=router;
\ No newline at end of file
+var _0x83fc=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','isAuthenticated'];(function(_0x1862f5,_0x52b69c){var _0x3e3161=function(_0x4c47d5){while(--_0x4c47d5){_0x1862f5['push'](_0x1862f5['shift']());}};_0x3e3161(++_0x52b69c);}(_0x83fc,0xb8));var _0xc83f=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x83fc[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require(_0xc83f('0x0'));var path=require(_0xc83f('0x1'));var timeout=require(_0xc83f('0x2'));var express=require(_0xc83f('0x3'));var router=express['Router']();var fs_extra=require(_0xc83f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc83f('0x5'));var config=require(_0xc83f('0x6'));var controller=require(_0xc83f('0x7'));router[_0xc83f('0x8')](_0xc83f('0x9'),auth['isAuthenticated'](),controller[_0xc83f('0xa')]);router['delete']('/:id',auth[_0xc83f('0xb')](),controller[_0xc83f('0xc')]);module[_0xc83f('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index e923f54..bd08a32 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x397f04,_0x2d9ef5){var _0x249786=function(_0xcb369e){while(--_0xcb369e){_0x397f04['push'](_0x397f04['shift']());}};_0x249786(++_0x2d9ef5);}(_0x5fab,0x177));var _0xb5fa=function(_0x2fcadf,_0x401da6){_0x2fcadf=_0x2fcadf-0x0;var _0x2a2c05=_0x5fab[_0x2fcadf];return _0x2a2c05;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}};
\ No newline at end of file
+var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x143a99,_0x34266e){var _0x202a6e=function(_0x155d66){while(--_0x155d66){_0x143a99['push'](_0x143a99['shift']());}};_0x202a6e(++_0x34266e);}(_0xb138,0x1dd));var _0x8b13=function(_0x51bf2d,_0x2f87ec){_0x51bf2d=_0x51bf2d-0x0;var _0x474e06=_0xb138[_0x51bf2d];return _0x474e06;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 1bc3f71..cd27ed1 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 _0x6e43=['select','MetricId','metric','function','replace','format','orderBy','order','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','MIN(%s)','IS\x20NULL','from','groupBy','table','clone','output','web','randomstring','generate','csv','custom','cdr','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','right_join','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','DESC','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','then','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','UserProfileResource','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','AnalyticMetric','keyBy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e43,0x172));var _0x36e4=function(_0x561e2c,_0x33a6cd){_0x561e2c=_0x561e2c-0x0;var _0x34972e=_0x6e43[_0x561e2c];return _0x34972e;};'use strict';var emlformat=require(_0x36e4('0x0'));var rimraf=require(_0x36e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x36e4('0x2'));var moment=require(_0x36e4('0x3'));var BPromise=require(_0x36e4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x36e4('0x5'));var sox=require(_0x36e4('0x6'));var csv=require(_0x36e4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36e4('0x8'));var squel=require(_0x36e4('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x36e4('0xa'));var toCsv=require(_0x36e4('0x7'));var querystring=require(_0x36e4('0xb'));var Papa=require(_0x36e4('0xc'));var Redis=require(_0x36e4('0xd'));var authService=require(_0x36e4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x36e4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x36e4('0x10'));var utils=require(_0x36e4('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x36e4('0x12'))['dbH'];function respondWithStatusCode(_0x548a24,_0x1006cc){_0x1006cc=_0x1006cc||0xcc;return function(_0xd8693e){if(_0xd8693e){return _0x548a24[_0x36e4('0x13')](_0x1006cc);}return _0x548a24['status'](_0x1006cc)[_0x36e4('0x14')]();};}function respondWithResult(_0xd00873,_0x29674a){_0x29674a=_0x29674a||0xc8;return function(_0x3e7d20){if(_0x3e7d20){return _0xd00873[_0x36e4('0x15')](_0x29674a)[_0x36e4('0x16')](_0x3e7d20);}};}function respondWithFilteredResult(_0x4d79ab,_0x33fc9b){return function(_0x55b6c5){if(_0x55b6c5){var _0x1f0b86=typeof _0x33fc9b[_0x36e4('0x17')]===_0x36e4('0x18')&&typeof _0x33fc9b[_0x36e4('0x19')]===_0x36e4('0x18');var _0x5e925d=_0x55b6c5[_0x36e4('0x1a')];var _0x2225b7=_0x1f0b86?0x0:_0x33fc9b[_0x36e4('0x17')];var _0x1c95a5=_0x1f0b86?_0x55b6c5['count']:_0x33fc9b[_0x36e4('0x17')]+_0x33fc9b[_0x36e4('0x19')];var _0x33a68c;if(_0x1c95a5>=_0x5e925d){_0x1c95a5=_0x5e925d;_0x33a68c=0xc8;}else{_0x33a68c=0xce;}_0x4d79ab[_0x36e4('0x15')](_0x33a68c);return _0x4d79ab[_0x36e4('0x1b')](_0x36e4('0x1c'),_0x2225b7+'-'+_0x1c95a5+'/'+_0x5e925d)[_0x36e4('0x16')](_0x55b6c5);}return null;};}function patchUpdates(_0x5da534){return function(_0x523cef){try{jsonpatch[_0x36e4('0x1d')](_0x523cef,_0x5da534,!![]);}catch(_0x599eb8){return BPromise[_0x36e4('0x1e')](_0x599eb8);}return _0x523cef[_0x36e4('0x1f')]();};}function saveUpdates(_0x1d2900,_0x5e1694){return function(_0x538e2e){if(_0x538e2e){return _0x538e2e['update'](_0x1d2900)['then'](function(_0x37f838){return _0x37f838;});}return null;};}function removeEntity(_0x1db326,_0x1be3ef){return function(_0x310968){if(_0x310968){return _0x310968[_0x36e4('0x20')]()['then'](function(){var _0x1b99b5=_0x310968[_0x36e4('0x21')]({'plain':!![]});var _0x43ece9='CustomReports';return db['UserProfileResource'][_0x36e4('0x20')]({'where':{'type':_0x43ece9,'resourceId':_0x1b99b5['id']}})[_0x36e4('0x22')](function(){return _0x310968;});})['then'](function(){_0x1db326[_0x36e4('0x15')](0xcc)[_0x36e4('0x14')]();});}};}function handleEntityNotFound(_0x111be6,_0x26ebdb){return function(_0x5df1e7){if(!_0x5df1e7){_0x111be6[_0x36e4('0x13')](0x194);}return _0x5df1e7;};}function handleError(_0x1c7636,_0x2e2917){_0x2e2917=_0x2e2917||0x1f4;return function(_0x1f0821){logger['error'](_0x1f0821['stack']);if(_0x1f0821[_0x36e4('0x23')]){delete _0x1f0821[_0x36e4('0x23')];}_0x1c7636[_0x36e4('0x15')](_0x2e2917)[_0x36e4('0x24')](_0x1f0821);};}exports[_0x36e4('0x25')]=function(_0x4a3442,_0x33b4d1){var _0x244c73={},_0x1f88ab={},_0x241c14={'count':0x0,'rows':[]};var _0x3da4f6=_[_0x36e4('0x26')](db[_0x36e4('0x27')][_0x36e4('0x28')],function(_0x523539){return{'name':_0x523539[_0x36e4('0x29')],'type':_0x523539[_0x36e4('0x2a')][_0x36e4('0x2b')]};});_0x1f88ab[_0x36e4('0x2c')]=_[_0x36e4('0x26')](_0x3da4f6,_0x36e4('0x23'));_0x1f88ab['query']=_[_0x36e4('0x2d')](_0x4a3442[_0x36e4('0x2e')]);_0x1f88ab[_0x36e4('0x2f')]=_['intersection'](_0x1f88ab['model'],_0x1f88ab[_0x36e4('0x2e')]);_0x244c73[_0x36e4('0x30')]=_[_0x36e4('0x31')](_0x1f88ab[_0x36e4('0x2c')],qs['fields'](_0x4a3442[_0x36e4('0x2e')][_0x36e4('0x32')]));_0x244c73[_0x36e4('0x30')]=_0x244c73['attributes'][_0x36e4('0x33')]?_0x244c73[_0x36e4('0x30')]:_0x1f88ab[_0x36e4('0x2c')];if(!_0x4a3442['query'][_0x36e4('0x34')](_0x36e4('0x35'))){_0x244c73[_0x36e4('0x19')]=qs[_0x36e4('0x19')](_0x4a3442[_0x36e4('0x2e')][_0x36e4('0x19')]);_0x244c73[_0x36e4('0x17')]=qs[_0x36e4('0x17')](_0x4a3442['query'][_0x36e4('0x17')]);}_0x244c73['order']=qs[_0x36e4('0x36')](_0x4a3442[_0x36e4('0x2e')]['sort']);_0x244c73[_0x36e4('0x37')]=qs['filters'](_[_0x36e4('0x38')](_0x4a3442[_0x36e4('0x2e')],_0x1f88ab[_0x36e4('0x2f')]),_0x3da4f6);if(_0x4a3442['query'][_0x36e4('0x39')]){_0x244c73[_0x36e4('0x37')]=_[_0x36e4('0x3a')](_0x244c73[_0x36e4('0x37')],{'$or':_[_0x36e4('0x26')](_0x3da4f6,function(_0x36fd78){if(_0x36fd78[_0x36e4('0x2a')]!==_0x36e4('0x3b')){var _0x235111={};_0x235111[_0x36fd78[_0x36e4('0x23')]]={'$like':'%'+_0x4a3442[_0x36e4('0x2e')][_0x36e4('0x39')]+'%'};return _0x235111;}})});}_0x244c73=_[_0x36e4('0x3a')]({},_0x244c73,_0x4a3442[_0x36e4('0x3c')]);var _0x174357={'where':_0x244c73['where']};return db[_0x36e4('0x27')]['count'](_0x174357)[_0x36e4('0x22')](function(_0x22c2e3){_0x241c14[_0x36e4('0x1a')]=_0x22c2e3;if(_0x4a3442[_0x36e4('0x2e')][_0x36e4('0x3d')]){_0x244c73['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x36e4('0x3e')](_0x244c73);})[_0x36e4('0x22')](function(_0x5a71f2){_0x241c14[_0x36e4('0x3f')]=_0x5a71f2;return _0x241c14;})[_0x36e4('0x22')](respondWithFilteredResult(_0x33b4d1,_0x244c73))[_0x36e4('0x40')](handleError(_0x33b4d1,null));};exports['show']=function(_0x132f5d,_0x1f3b0f){var _0x9b3a73={'raw':![],'where':{'id':_0x132f5d[_0x36e4('0x41')]['id']}},_0x4c28c5={};_0x4c28c5[_0x36e4('0x2c')]=_[_0x36e4('0x2d')](db[_0x36e4('0x27')][_0x36e4('0x28')]);_0x4c28c5[_0x36e4('0x2e')]=_[_0x36e4('0x2d')](_0x132f5d['query']);_0x4c28c5[_0x36e4('0x2f')]=_[_0x36e4('0x31')](_0x4c28c5[_0x36e4('0x2c')],_0x4c28c5[_0x36e4('0x2e')]);_0x9b3a73[_0x36e4('0x30')]=_['intersection'](_0x4c28c5[_0x36e4('0x2c')],qs['fields'](_0x132f5d[_0x36e4('0x2e')][_0x36e4('0x32')]));_0x9b3a73['attributes']=_0x9b3a73[_0x36e4('0x30')][_0x36e4('0x33')]?_0x9b3a73[_0x36e4('0x30')]:_0x4c28c5[_0x36e4('0x2c')];if(_0x132f5d[_0x36e4('0x2e')][_0x36e4('0x3d')]){_0x9b3a73[_0x36e4('0x42')]=[{'all':!![]}];}_0x9b3a73=_[_0x36e4('0x3a')]({},_0x9b3a73,_0x132f5d[_0x36e4('0x3c')]);return db[_0x36e4('0x27')][_0x36e4('0x43')](_0x9b3a73)['then'](handleEntityNotFound(_0x1f3b0f,null))[_0x36e4('0x22')](respondWithResult(_0x1f3b0f,null))[_0x36e4('0x40')](handleError(_0x1f3b0f,null));};exports[_0x36e4('0x44')]=function(_0x2b0ecd,_0x5a3751){return db['AnalyticCustomReport']['create'](_0x2b0ecd[_0x36e4('0x45')],{})[_0x36e4('0x22')](function(_0x329ef0){var _0x492743=_0x2b0ecd[_0x36e4('0x46')][_0x36e4('0x21')]({'plain':!![]});if(!_0x492743)throw new Error(_0x36e4('0x47'));if(_0x492743['role']===_0x36e4('0x46')){var _0xd7a85=_0x329ef0[_0x36e4('0x21')]({'plain':!![]});var _0x351bf0=_0x36e4('0x48');return db[_0x36e4('0x49')][_0x36e4('0x43')]({'where':{'name':_0x351bf0,'userProfileId':_0x492743['userProfileId']},'raw':!![]})[_0x36e4('0x22')](function(_0x189a68){if(_0x189a68&&_0x189a68[_0x36e4('0x4a')]===0x0){return db[_0x36e4('0x4b')][_0x36e4('0x44')]({'name':_0xd7a85[_0x36e4('0x23')],'resourceId':_0xd7a85['id'],'type':_0x36e4('0x4c'),'sectionId':_0x189a68['id']},{})[_0x36e4('0x22')](function(){return _0x329ef0;});}else{return _0x329ef0;}})[_0x36e4('0x40')](function(_0x2c8f18){logger[_0x36e4('0x4d')](_0x36e4('0x4e'),_0x2c8f18);throw _0x2c8f18;});}return _0x329ef0;})[_0x36e4('0x22')](respondWithResult(_0x5a3751,0xc9))[_0x36e4('0x40')](handleError(_0x5a3751,null));};exports[_0x36e4('0x4f')]=function(_0x40068a,_0x43fc97){if(_0x40068a[_0x36e4('0x45')]['id']){delete _0x40068a[_0x36e4('0x45')]['id'];}return db[_0x36e4('0x27')][_0x36e4('0x43')]({'where':{'id':_0x40068a[_0x36e4('0x41')]['id']}})[_0x36e4('0x22')](handleEntityNotFound(_0x43fc97,null))['then'](saveUpdates(_0x40068a[_0x36e4('0x45')],null))[_0x36e4('0x22')](respondWithResult(_0x43fc97,null))[_0x36e4('0x40')](handleError(_0x43fc97,null));};exports['destroy']=function(_0x5eb433,_0x615fde){return db[_0x36e4('0x27')][_0x36e4('0x43')]({'where':{'id':_0x5eb433[_0x36e4('0x41')]['id']}})[_0x36e4('0x22')](handleEntityNotFound(_0x615fde,null))[_0x36e4('0x22')](removeEntity(_0x615fde,null))[_0x36e4('0x40')](handleError(_0x615fde,null));};exports[_0x36e4('0x50')]=function(_0x553e89,_0x220c78){var _0x39dd47=0xa;var _0x279e19=[_0x36e4('0x51'),_0x36e4('0x52'),'right_join',_0x36e4('0x53')];var _0x4f582b={'SUM':_0x36e4('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x36e4('0x55'),'MAX':_0x36e4('0x56'),'MIN':'MIN(%s)','AVG':_0x36e4('0x57'),'GROUP_CONCAT':_0x36e4('0x58'),'GROUP_CONCAT ASC':_0x36e4('0x59'),'GROUP_CONCAT DESC':_0x36e4('0x5a')};var _0x1b2594={'SEC_TO_TIME':_0x36e4('0x5b'),'DATE':_0x36e4('0x5c'),'HOUR':_0x36e4('0x5d'),'ROUND':_0x36e4('0x5e'),'UNIX_TIMESTAMP':_0x36e4('0x5f')};var _0x145e1c=function(_0x1b6859){return!_[_0x36e4('0x60')](['IS\x20NULL',_0x36e4('0x61'),_0x36e4('0x62'),_0x36e4('0x63')],_0x1b6859);};var _0x1fd3a2=function(_0x232ad3){if(!_0x232ad3||!_0x232ad3['rules']['length']){return'';}for(var _0x289861='(',_0xb1035a=0x0;_0xb1035a<_0x232ad3[_0x36e4('0x64')][_0x36e4('0x33')];_0xb1035a+=0x1){_0xb1035a>0x0&&(_0x289861+='\x20'+_0x232ad3[_0x36e4('0x65')]+'\x20');_0x289861+=_0x232ad3[_0x36e4('0x64')][_0xb1035a][_0x36e4('0x66')]?_0x1fd3a2(_0x232ad3['rules'][_0xb1035a][_0x36e4('0x66')]):_0x232ad3[_0x36e4('0x64')][_0xb1035a][_0x36e4('0x67')]+'\x20'+_0x232ad3[_0x36e4('0x64')][_0xb1035a][_0x36e4('0x68')]+(_0x145e1c(_0x232ad3['rules'][_0xb1035a][_0x36e4('0x68')])?'\x20'+_0x232ad3['rules'][_0xb1035a][_0x36e4('0x69')]:'');}return _0x289861+')';};var _0x417284={'where':{'id':_0x553e89['params']['id']}},_0x39eb65,_0x46288d,_0x42ec6a,_0x725602,_0x2145ad;_0x417284=_[_0x36e4('0x3a')]({},_0x417284,_0x553e89[_0x36e4('0x3c')]);return db[_0x36e4('0x27')][_0x36e4('0x43')](_0x417284)[_0x36e4('0x22')](function(_0x4330db){if(_0x4330db){_0x39eb65=_0x4330db;return _0x4330db[_0x36e4('0x6a')]();}return null;})[_0x36e4('0x22')](function(_0x159f39){if(_0x159f39){if(!_0x159f39[_0x36e4('0x33')]){throw new db[(_0x36e4('0x6b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x46288d=_0x159f39;return db[_0x36e4('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x36e4('0x22')](function(_0x2d359a){if(_0x2d359a){_0x42ec6a=_[_0x36e4('0x6d')](_0x2d359a,'id');var _0x313ee8;var _0x51d02d=squel[_0x36e4('0x6e')]();_0x51d02d['from'](_0x39eb65['table']);for(var _0x2088a3=0x0;_0x2088a3<_0x46288d[_0x36e4('0x33')];_0x2088a3+=0x1){_0x313ee8=_0x46288d[_0x2088a3][_0x36e4('0x6f')]?_0x42ec6a[_0x46288d[_0x2088a3][_0x36e4('0x6f')]][_0x36e4('0x70')]:_0x46288d[_0x2088a3][_0x36e4('0x67')];_0x313ee8=_0x46288d[_0x2088a3][_0x36e4('0x71')]?_[_0x36e4('0x72')](_0x4f582b[_0x46288d[_0x2088a3][_0x36e4('0x71')]],'%s',_0x313ee8):_0x313ee8;_0x313ee8=_0x46288d[_0x2088a3][_0x36e4('0x73')]?_[_0x36e4('0x72')](_0x1b2594[_0x46288d[_0x2088a3][_0x36e4('0x73')]],'%s',_0x313ee8):_0x313ee8;if(_0x46288d[_0x2088a3]['groupBy']){_0x51d02d[_0x36e4('0x66')](_0x313ee8);}_0x46288d[_0x2088a3][_0x36e4('0x74')]&&_0x51d02d[_0x36e4('0x75')](_0x313ee8,_0x46288d[_0x2088a3][_0x36e4('0x74')]==='DESC'?![]:!![]);_0x51d02d[_0x36e4('0x67')](_0x313ee8,_0x46288d[_0x2088a3][_0x36e4('0x76')]||_0x313ee8);}if(_0x39eb65[_0x36e4('0x77')]){_0x39eb65['joins']=JSON['parse'](_0x39eb65['joins']);for(var _0x59102d=0x0;_0x59102d<_0x39eb65[_0x36e4('0x77')]['length'];_0x59102d+=0x1){if(_0x39eb65['joins'][_0x59102d]['type']&&_['includes'](_0x279e19,_0x39eb65['joins'][_0x59102d][_0x36e4('0x2a')])&&_0x39eb65[_0x36e4('0x77')][_0x59102d][_0x36e4('0x78')]&&_0x39eb65[_0x36e4('0x77')][_0x59102d][_0x36e4('0x79')]&&_0x39eb65['joins'][_0x59102d][_0x36e4('0x7a')]){_0x51d02d[_0x39eb65[_0x36e4('0x77')][_0x59102d][_0x36e4('0x2a')]](_0x39eb65[_0x36e4('0x77')][_0x59102d]['foreignTable'],null,util[_0x36e4('0x73')](_0x36e4('0x7b'),_0x39eb65['table'],_0x39eb65[_0x36e4('0x77')][_0x59102d][_0x36e4('0x78')],_0x39eb65['joins'][_0x59102d][_0x36e4('0x79')],_0x39eb65[_0x36e4('0x77')][_0x59102d][_0x36e4('0x7a')]));}}}if(_0x39eb65['conditions']){_0x39eb65[_0x36e4('0x7c')]=JSON[_0x36e4('0x7d')](_0x39eb65[_0x36e4('0x7c')]);_0x51d02d[_0x36e4('0x37')](_0x1fd3a2(_0x39eb65[_0x36e4('0x7c')][_0x36e4('0x66')]));}_0x2145ad=_0x51d02d['clone']();_0x51d02d[_0x36e4('0x19')](_0x39dd47);_0x51d02d[_0x36e4('0x17')](0x0);logger[_0x36e4('0x7e')](_0x36e4('0x7f'),_0x51d02d['toString']());return dbH[_0x36e4('0x80')][_0x36e4('0x2e')](_0x51d02d[_0x36e4('0x81')](),{'type':dbH[_0x36e4('0x80')][_0x36e4('0x82')][_0x36e4('0x83')]});}})[_0x36e4('0x22')](respondWithResult(_0x220c78,null))[_0x36e4('0x40')](handleError(_0x220c78,null));};function runReport(_0x4a10c0,_0x15ed88,_0x32966d){var _0x518387=_0x15ed88[_0x36e4('0x23')];var _0x5f4cda=0xa;var _0x3ad654=[_0x36e4('0x51'),'left_join','right_join',_0x36e4('0x53')];var _0xb50ee7={'SUM':_0x36e4('0x54'),'COUNT':_0x36e4('0x84'),'COUNT DISTINCT':_0x36e4('0x55'),'MAX':_0x36e4('0x56'),'MIN':_0x36e4('0x85'),'AVG':_0x36e4('0x57'),'GROUP_CONCAT':_0x36e4('0x58'),'GROUP_CONCAT ASC':_0x36e4('0x59'),'GROUP_CONCAT DESC':_0x36e4('0x5a')};var _0x39abff={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x36e4('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x36e4('0x5e'),'UNIX_TIMESTAMP':_0x36e4('0x5f')};var _0x161fbe=function(_0x5cbb85){return!_[_0x36e4('0x60')]([_0x36e4('0x86'),_0x36e4('0x61'),_0x36e4('0x62'),'IS\x20NOT\x20EMPTY'],_0x5cbb85);};var _0x229870=function(_0x483145){if(!_0x483145||!_0x483145[_0x36e4('0x64')][_0x36e4('0x33')]){return'';}for(var _0x48e41c='(',_0x44b24c=0x0;_0x44b24c<_0x483145['rules'][_0x36e4('0x33')];_0x44b24c+=0x1){_0x44b24c>0x0&&(_0x48e41c+='\x20'+_0x483145[_0x36e4('0x65')]+'\x20');_0x48e41c+=_0x483145['rules'][_0x44b24c][_0x36e4('0x66')]?_0x229870(_0x483145[_0x36e4('0x64')][_0x44b24c][_0x36e4('0x66')]):_0x483145[_0x36e4('0x64')][_0x44b24c]['field']+'\x20'+_0x483145[_0x36e4('0x64')][_0x44b24c]['condition']+(_0x161fbe(_0x483145[_0x36e4('0x64')][_0x44b24c][_0x36e4('0x68')])?'\x20'+_0x483145[_0x36e4('0x64')][_0x44b24c][_0x36e4('0x69')]:'');}return _0x48e41c+')';};var _0x3766fd={'where':{'id':_0x4a10c0['id']}},_0x4feb61,_0x189c55,_0x1f3f26,_0x47d84d,_0x5c0933;_0x3766fd=_[_0x36e4('0x3a')]({},_0x3766fd,_0x32966d);return db[_0x36e4('0x27')][_0x36e4('0x43')](_0x3766fd)[_0x36e4('0x22')](function(_0xfb41ae){if(_0xfb41ae){_0x4feb61=_0xfb41ae;return _0xfb41ae[_0x36e4('0x6a')]();}return null;})['then'](function(_0x25f9d2){if(_0x25f9d2){if(!_0x25f9d2[_0x36e4('0x33')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x189c55=_0x25f9d2;return db['AnalyticMetric'][_0x36e4('0x3e')]({'raw':!![]});}return null;})[_0x36e4('0x22')](function(_0x43eb2a){if(_0x43eb2a){_0x1f3f26=_['keyBy'](_0x43eb2a,'id');var _0x735d91;var _0xffc49e=squel[_0x36e4('0x6e')]();_0xffc49e[_0x36e4('0x87')](_0x4feb61['table']);for(var _0x438972=0x0;_0x438972<_0x189c55['length'];_0x438972+=0x1){_0x735d91=_0x189c55[_0x438972][_0x36e4('0x6f')]?_0x1f3f26[_0x189c55[_0x438972]['MetricId']]['metric']:_0x189c55[_0x438972]['field'];_0x735d91=_0x189c55[_0x438972][_0x36e4('0x71')]?_[_0x36e4('0x72')](_0xb50ee7[_0x189c55[_0x438972][_0x36e4('0x71')]],'%s',_0x735d91):_0x735d91;_0x735d91=_0x189c55[_0x438972][_0x36e4('0x73')]?_['replace'](_0x39abff[_0x189c55[_0x438972][_0x36e4('0x73')]],'%s',_0x735d91):_0x735d91;if(_0x189c55[_0x438972][_0x36e4('0x88')]){_0xffc49e[_0x36e4('0x66')](_0x735d91);}_0x189c55[_0x438972][_0x36e4('0x74')]&&_0xffc49e[_0x36e4('0x75')](_0x735d91,_0x189c55[_0x438972][_0x36e4('0x74')]==='DESC'?![]:!![]);_0xffc49e[_0x36e4('0x67')](_0x735d91,_0x189c55[_0x438972][_0x36e4('0x76')]||_0x735d91);}if(_0x4feb61[_0x36e4('0x77')]){_0x4feb61[_0x36e4('0x77')]=JSON[_0x36e4('0x7d')](_0x4feb61[_0x36e4('0x77')]);for(var _0x5e71d6=0x0;_0x5e71d6<_0x4feb61[_0x36e4('0x77')][_0x36e4('0x33')];_0x5e71d6+=0x1){if(_0x4feb61[_0x36e4('0x77')][_0x5e71d6]['type']&&_[_0x36e4('0x60')](_0x3ad654,_0x4feb61[_0x36e4('0x77')][_0x5e71d6][_0x36e4('0x2a')])&&_0x4feb61[_0x36e4('0x77')][_0x5e71d6][_0x36e4('0x78')]&&_0x4feb61[_0x36e4('0x77')][_0x5e71d6][_0x36e4('0x79')]&&_0x4feb61[_0x36e4('0x77')][_0x5e71d6][_0x36e4('0x7a')]){_0xffc49e[_0x4feb61[_0x36e4('0x77')][_0x5e71d6]['type']](_0x4feb61['joins'][_0x5e71d6][_0x36e4('0x79')],null,util[_0x36e4('0x73')](_0x36e4('0x7b'),_0x4feb61[_0x36e4('0x89')],_0x4feb61[_0x36e4('0x77')][_0x5e71d6][_0x36e4('0x78')],_0x4feb61[_0x36e4('0x77')][_0x5e71d6]['foreignTable'],_0x4feb61['joins'][_0x5e71d6][_0x36e4('0x7a')]));}}}if(_0x4feb61[_0x36e4('0x7c')]){_0x4feb61[_0x36e4('0x7c')]=JSON['parse'](_0x4feb61[_0x36e4('0x7c')]);_0xffc49e['where'](_0x229870(_0x4feb61[_0x36e4('0x7c')][_0x36e4('0x66')]));}_0x5c0933=_0xffc49e[_0x36e4('0x8a')]();_0xffc49e[_0x36e4('0x19')](_0x5f4cda);_0xffc49e[_0x36e4('0x17')](0x0);return;}})[_0x36e4('0x22')](function(){if(_0x15ed88[_0x36e4('0x8b')]===_0x36e4('0x8c')){return null;}var _0x5198c8=_[_0x36e4('0x3a')](_0x15ed88,{'name':_0x15ed88['fullPath']||_0x15ed88[_0x36e4('0x23')]||_0x4feb61[_0x36e4('0x23')],'basename':_0x518387,'savename':util[_0x36e4('0x73')]('%s-%s.%s',_0x15ed88[_0x36e4('0x23')]||_0x4feb61[_0x36e4('0x23')],require(_0x36e4('0x8d'))[_0x36e4('0x8e')](0x4),_0x15ed88[_0x36e4('0x8b')]||_0x36e4('0x8f')),'reportId':_0x4feb61['id'],'reportType':_0x36e4('0x90')});return db['AnalyticExtractedReport'][_0x36e4('0x44')](_0x5198c8,{'raw':!![]});})[_0x36e4('0x22')](function(_0x17b1bc){if(_0x4feb61[_0x36e4('0x89')]===_0x36e4('0x91')){_0x5c0933[_0x36e4('0x37')](_0x4feb61[_0x36e4('0x89')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x15ed88['startDate'],_0x15ed88['endDate']);}else{_0x5c0933[_0x36e4('0x37')](_0x4feb61[_0x36e4('0x89')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x15ed88['startDate'],_0x15ed88[_0x36e4('0x92')]);}if(_0x17b1bc){logger[_0x36e4('0x93')](_0x36e4('0x94'),_0x5c0933[_0x36e4('0x81')]());require(_0x36e4('0x95'))[_0x36e4('0x96')](path[_0x36e4('0x51')](__dirname,_0x36e4('0x97'),_0x17b1bc[_0x36e4('0x8b')]),[_0x17b1bc['id'],_0x5c0933[_0x36e4('0x81')](),path[_0x36e4('0x51')](__dirname,_0x36e4('0x98'),_0x17b1bc['savename']),_0x518387]);return _0x17b1bc;}else{var _0x30ca4d=squel[_0x36e4('0x6e')]();_0x30ca4d[_0x36e4('0x87')]('('+_0x5c0933[_0x36e4('0x81')]()+')',_0x36e4('0x99'));_0x30ca4d[_0x36e4('0x67')](_0x36e4('0x9a'),'count');_0x5c0933['limit'](_0x15ed88[_0x36e4('0x19')]||_0x5f4cda);_0x5c0933['offset'](_0x15ed88[_0x36e4('0x17')]||0x0);return dbH[_0x36e4('0x80')][_0x36e4('0x2e')](_0x30ca4d[_0x36e4('0x81')](),{'type':dbH[_0x36e4('0x80')]['QueryTypes'][_0x36e4('0x83')]})[_0x36e4('0x22')](function(_0x2cb82b){if(!_0x2cb82b['length']){_0x47d84d=0x0;}else{_0x47d84d=_0x2cb82b[0x0][_0x36e4('0x1a')]||0x0;}return dbH[_0x36e4('0x80')][_0x36e4('0x2e')](_0x5c0933[_0x36e4('0x81')](),{'type':dbH[_0x36e4('0x80')][_0x36e4('0x82')][_0x36e4('0x83')]});})[_0x36e4('0x22')](function(_0x575212){return{'rows':_0x575212||[],'count':_0x47d84d};});}});}exports['run']=function(_0x34b8ce,_0x5ce12b){return runReport(_0x34b8ce[_0x36e4('0x41')],_0x34b8ce[_0x36e4('0x2e')],_0x34b8ce[_0x36e4('0x3c')])['then'](respondWithResult(_0x5ce12b,null))['catch'](handleError(_0x5ce12b,null));};exports[_0x36e4('0x9b')]=runReport;exports[_0x36e4('0x2e')]=function(_0x1f29d9,_0x1a8a7a){var _0x29925a=0xa;var _0x1c7320=[_0x36e4('0x51'),_0x36e4('0x52'),_0x36e4('0x9c'),_0x36e4('0x53')];var _0x1fa9ac={'SUM':_0x36e4('0x54'),'COUNT':_0x36e4('0x84'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x36e4('0x56'),'MIN':_0x36e4('0x85'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x36e4('0x58'),'GROUP_CONCAT ASC':_0x36e4('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x20887c={'SEC_TO_TIME':_0x36e4('0x5b'),'DATE':_0x36e4('0x5c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x36e4('0x5f')};var _0x4daa62=function(_0x2251b7){return!_[_0x36e4('0x60')]([_0x36e4('0x86'),_0x36e4('0x61'),_0x36e4('0x62'),_0x36e4('0x63')],_0x2251b7);};var _0x17bf4b=function(_0x1c91c2){if(!_0x1c91c2||!_0x1c91c2[_0x36e4('0x64')][_0x36e4('0x33')]){return'';}for(var _0x7e74fc='(',_0x1c8df1=0x0;_0x1c8df1<_0x1c91c2[_0x36e4('0x64')][_0x36e4('0x33')];_0x1c8df1+=0x1){_0x1c8df1>0x0&&(_0x7e74fc+='\x20'+_0x1c91c2['operator']+'\x20');_0x7e74fc+=_0x1c91c2[_0x36e4('0x64')][_0x1c8df1][_0x36e4('0x66')]?_0x17bf4b(_0x1c91c2[_0x36e4('0x64')][_0x1c8df1][_0x36e4('0x66')]):_0x1c91c2['rules'][_0x1c8df1][_0x36e4('0x67')]+'\x20'+_0x1c91c2[_0x36e4('0x64')][_0x1c8df1][_0x36e4('0x68')]+(_0x4daa62(_0x1c91c2[_0x36e4('0x64')][_0x1c8df1]['condition'])?'\x20'+_0x1c91c2['rules'][_0x1c8df1]['value']:'');}return _0x7e74fc+')';};var _0x38be45={'where':{'id':_0x1f29d9['params']['id']}},_0x1a08ad,_0xe794fe,_0x469c35,_0x15c99f,_0x5e7451;_0x38be45=_[_0x36e4('0x3a')]({},_0x38be45,_0x1f29d9[_0x36e4('0x3c')]);return db[_0x36e4('0x27')]['find'](_0x38be45)['then'](function(_0x1e4861){if(_0x1e4861){_0x1a08ad=_0x1e4861;return _0x1e4861['getFields']();}return null;})[_0x36e4('0x22')](function(_0x5b1727){if(_0x5b1727){if(!_0x5b1727[_0x36e4('0x33')]){throw new db[(_0x36e4('0x6b'))][(_0x36e4('0x9d'))](_0x36e4('0x9e'),0x193);}_0xe794fe=_0x5b1727;return db[_0x36e4('0x6c')][_0x36e4('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x1a3f34){if(_0x1a3f34){_0x469c35=_[_0x36e4('0x6d')](_0x1a3f34,'id');var _0x588242;var _0x56a881=squel[_0x36e4('0x6e')]();_0x56a881[_0x36e4('0x87')](_0x1a08ad[_0x36e4('0x89')]);for(var _0x3ee5f2=0x0;_0x3ee5f2<_0xe794fe['length'];_0x3ee5f2+=0x1){_0x588242=_0xe794fe[_0x3ee5f2]['MetricId']?_0x469c35[_0xe794fe[_0x3ee5f2]['MetricId']]['metric']:_0xe794fe[_0x3ee5f2][_0x36e4('0x67')];_0x588242=_0xe794fe[_0x3ee5f2]['function']?_[_0x36e4('0x72')](_0x1fa9ac[_0xe794fe[_0x3ee5f2][_0x36e4('0x71')]],'%s',_0x588242):_0x588242;_0x588242=_0xe794fe[_0x3ee5f2][_0x36e4('0x73')]?_[_0x36e4('0x72')](_0x20887c[_0xe794fe[_0x3ee5f2]['format']],'%s',_0x588242):_0x588242;if(_0xe794fe[_0x3ee5f2]['groupBy']){_0x56a881[_0x36e4('0x66')](_0x588242);}_0xe794fe[_0x3ee5f2][_0x36e4('0x74')]&&_0x56a881[_0x36e4('0x75')](_0x588242,_0xe794fe[_0x3ee5f2][_0x36e4('0x74')]===_0x36e4('0x9f')?![]:!![]);_0x56a881[_0x36e4('0x67')](_0x588242,_0xe794fe[_0x3ee5f2][_0x36e4('0x76')]||_0x588242);}if(_0x1a08ad[_0x36e4('0x77')]){_0x1a08ad[_0x36e4('0x77')]=JSON['parse'](_0x1a08ad[_0x36e4('0x77')]);for(var _0x1a6d05=0x0;_0x1a6d05<_0x1a08ad[_0x36e4('0x77')][_0x36e4('0x33')];_0x1a6d05+=0x1){if(_0x1a08ad[_0x36e4('0x77')][_0x1a6d05][_0x36e4('0x2a')]&&_['includes'](_0x1c7320,_0x1a08ad[_0x36e4('0x77')][_0x1a6d05]['type'])&&_0x1a08ad[_0x36e4('0x77')][_0x1a6d05][_0x36e4('0x78')]&&_0x1a08ad[_0x36e4('0x77')][_0x1a6d05][_0x36e4('0x79')]&&_0x1a08ad[_0x36e4('0x77')][_0x1a6d05][_0x36e4('0x7a')]){_0x56a881[_0x1a08ad['joins'][_0x1a6d05]['type']](_0x1a08ad[_0x36e4('0x77')][_0x1a6d05][_0x36e4('0x79')],null,util['format'](_0x36e4('0x7b'),_0x1a08ad['table'],_0x1a08ad[_0x36e4('0x77')][_0x1a6d05][_0x36e4('0x78')],_0x1a08ad['joins'][_0x1a6d05][_0x36e4('0x79')],_0x1a08ad[_0x36e4('0x77')][_0x1a6d05]['foreignKey']));}}}if(_0x1a08ad['conditions']){_0x1a08ad[_0x36e4('0x7c')]=JSON['parse'](_0x1a08ad[_0x36e4('0x7c')]);_0x56a881[_0x36e4('0x37')](_0x17bf4b(_0x1a08ad['conditions'][_0x36e4('0x66')]));}_0x5e7451=_0x56a881[_0x36e4('0x8a')]();_0x56a881[_0x36e4('0x19')](_0x29925a);_0x56a881[_0x36e4('0x17')](0x0);logger[_0x36e4('0x7e')](_0x36e4('0x7f'),_0x56a881[_0x36e4('0x81')]());return dbH[_0x36e4('0x80')][_0x36e4('0x2e')](_0x56a881[_0x36e4('0x81')](),{'type':dbH[_0x36e4('0x80')][_0x36e4('0x82')][_0x36e4('0x83')]});}})[_0x36e4('0x22')](function(){return{'sql':_0x5e7451[_0x36e4('0x81')]()};})[_0x36e4('0x22')](respondWithResult(_0x1a8a7a,null))[_0x36e4('0x40')](handleError(_0x1a8a7a,null));};
\ No newline at end of file
+var _0x9815=['json','offset','undefined','count','limit','set','Content-Range','reject','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','map','AnalyticCustomReport','fieldName','type','key','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','update','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','replace','groupBy','order','DESC','alias','joins','parentKey','foreignTable','format','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','operator','Sequelize','from','orderBy','parse','clone','output','web','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','savename','COUNT(*)','run','runReport','SUM(%s)','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','end','status'];(function(_0x462d4b,_0x597689){var _0x606afe=function(_0x2ca5bc){while(--_0x2ca5bc){_0x462d4b['push'](_0x462d4b['shift']());}};_0x606afe(++_0x597689);}(_0x9815,0x1cb));var _0x5981=function(_0x1a0411,_0x59a9cd){_0x1a0411=_0x1a0411-0x0;var _0x2be39e=_0x9815[_0x1a0411];return _0x2be39e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5981('0x0'));var zipdir=require(_0x5981('0x1'));var jsonpatch=require(_0x5981('0x2'));var rp=require('request-promise');var moment=require(_0x5981('0x3'));var BPromise=require(_0x5981('0x4'));var Mustache=require(_0x5981('0x5'));var util=require('util');var path=require(_0x5981('0x6'));var sox=require(_0x5981('0x7'));var csv=require(_0x5981('0x8'));var ejs=require(_0x5981('0x9'));var fs=require('fs');var fs_extra=require(_0x5981('0xa'));var _=require('lodash');var squel=require(_0x5981('0xb'));var crypto=require(_0x5981('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5981('0xd'));var toCsv=require(_0x5981('0x8'));var querystring=require(_0x5981('0xe'));var Papa=require(_0x5981('0xf'));var Redis=require('ioredis');var authService=require(_0x5981('0x10'));var qs=require(_0x5981('0x11'));var as=require(_0x5981('0x12'));var hardwareService=require(_0x5981('0x13'));var logger=require(_0x5981('0x14'))('api');var utils=require(_0x5981('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5981('0x16'));var db=require(_0x5981('0x17'))['db'];var dbH=require(_0x5981('0x17'))[_0x5981('0x18')];function respondWithStatusCode(_0x1ea305,_0x3de040){_0x3de040=_0x3de040||0xcc;return function(_0x198a00){if(_0x198a00){return _0x1ea305['sendStatus'](_0x3de040);}return _0x1ea305['status'](_0x3de040)[_0x5981('0x19')]();};}function respondWithResult(_0x283049,_0x3363ec){_0x3363ec=_0x3363ec||0xc8;return function(_0x49eed4){if(_0x49eed4){return _0x283049[_0x5981('0x1a')](_0x3363ec)[_0x5981('0x1b')](_0x49eed4);}};}function respondWithFilteredResult(_0x2bc531,_0x5c593d){return function(_0x399e46){if(_0x399e46){var _0x412524=typeof _0x5c593d[_0x5981('0x1c')]===_0x5981('0x1d')&&typeof _0x5c593d['limit']===_0x5981('0x1d');var _0x186325=_0x399e46[_0x5981('0x1e')];var _0x5bda1d=_0x412524?0x0:_0x5c593d[_0x5981('0x1c')];var _0x7228c8=_0x412524?_0x399e46[_0x5981('0x1e')]:_0x5c593d[_0x5981('0x1c')]+_0x5c593d[_0x5981('0x1f')];var _0x44760d;if(_0x7228c8>=_0x186325){_0x7228c8=_0x186325;_0x44760d=0xc8;}else{_0x44760d=0xce;}_0x2bc531[_0x5981('0x1a')](_0x44760d);return _0x2bc531[_0x5981('0x20')](_0x5981('0x21'),_0x5bda1d+'-'+_0x7228c8+'/'+_0x186325)['json'](_0x399e46);}return null;};}function patchUpdates(_0x359ca3){return function(_0x23d2c3){try{jsonpatch['apply'](_0x23d2c3,_0x359ca3,!![]);}catch(_0x4df9e1){return BPromise[_0x5981('0x22')](_0x4df9e1);}return _0x23d2c3['save']();};}function saveUpdates(_0x362795,_0x2fdb0e){return function(_0x1fc0f2){if(_0x1fc0f2){return _0x1fc0f2['update'](_0x362795)[_0x5981('0x23')](function(_0x29ccab){return _0x29ccab;});}return null;};}function removeEntity(_0xa7bbf6,_0x37bbb4){return function(_0x3a9116){if(_0x3a9116){return _0x3a9116['destroy']()[_0x5981('0x23')](function(){var _0x1a23ed=_0x3a9116[_0x5981('0x24')]({'plain':!![]});var _0x34dac4=_0x5981('0x25');return db[_0x5981('0x26')][_0x5981('0x27')]({'where':{'type':_0x34dac4,'resourceId':_0x1a23ed['id']}})[_0x5981('0x23')](function(){return _0x3a9116;});})['then'](function(){_0xa7bbf6[_0x5981('0x1a')](0xcc)[_0x5981('0x19')]();});}};}function handleEntityNotFound(_0x3bf37f,_0x2648ec){return function(_0x1ea0b1){if(!_0x1ea0b1){_0x3bf37f['sendStatus'](0x194);}return _0x1ea0b1;};}function handleError(_0x2d826c,_0x11e8e8){_0x11e8e8=_0x11e8e8||0x1f4;return function(_0x2953a4){logger[_0x5981('0x28')](_0x2953a4[_0x5981('0x29')]);if(_0x2953a4[_0x5981('0x2a')]){delete _0x2953a4[_0x5981('0x2a')];}_0x2d826c[_0x5981('0x1a')](_0x11e8e8)['send'](_0x2953a4);};}exports['index']=function(_0x121333,_0x56ce55){var _0x20ef24={},_0x44e86f={},_0x219838={'count':0x0,'rows':[]};var _0x5d7cf0=_[_0x5981('0x2b')](db[_0x5981('0x2c')]['rawAttributes'],function(_0x235e9d){return{'name':_0x235e9d[_0x5981('0x2d')],'type':_0x235e9d[_0x5981('0x2e')][_0x5981('0x2f')]};});_0x44e86f['model']=_[_0x5981('0x2b')](_0x5d7cf0,_0x5981('0x2a'));_0x44e86f['query']=_[_0x5981('0x30')](_0x121333['query']);_0x44e86f['filters']=_[_0x5981('0x31')](_0x44e86f['model'],_0x44e86f[_0x5981('0x32')]);_0x20ef24[_0x5981('0x33')]=_[_0x5981('0x31')](_0x44e86f[_0x5981('0x34')],qs[_0x5981('0x35')](_0x121333['query'][_0x5981('0x35')]));_0x20ef24[_0x5981('0x33')]=_0x20ef24[_0x5981('0x33')][_0x5981('0x36')]?_0x20ef24[_0x5981('0x33')]:_0x44e86f[_0x5981('0x34')];if(!_0x121333['query'][_0x5981('0x37')]('nolimit')){_0x20ef24[_0x5981('0x1f')]=qs[_0x5981('0x1f')](_0x121333[_0x5981('0x32')][_0x5981('0x1f')]);_0x20ef24[_0x5981('0x1c')]=qs[_0x5981('0x1c')](_0x121333[_0x5981('0x32')][_0x5981('0x1c')]);}_0x20ef24['order']=qs[_0x5981('0x38')](_0x121333[_0x5981('0x32')]['sort']);_0x20ef24[_0x5981('0x39')]=qs['filters'](_[_0x5981('0x3a')](_0x121333[_0x5981('0x32')],_0x44e86f['filters']),_0x5d7cf0);if(_0x121333['query'][_0x5981('0x3b')]){_0x20ef24['where']=_[_0x5981('0x3c')](_0x20ef24['where'],{'$or':_['map'](_0x5d7cf0,function(_0x209097){if(_0x209097[_0x5981('0x2e')]!==_0x5981('0x3d')){var _0x5d7048={};_0x5d7048[_0x209097[_0x5981('0x2a')]]={'$like':'%'+_0x121333[_0x5981('0x32')][_0x5981('0x3b')]+'%'};return _0x5d7048;}})});}_0x20ef24=_[_0x5981('0x3c')]({},_0x20ef24,_0x121333[_0x5981('0x3e')]);var _0x217755={'where':_0x20ef24[_0x5981('0x39')]};return db[_0x5981('0x2c')][_0x5981('0x1e')](_0x217755)[_0x5981('0x23')](function(_0x405f20){_0x219838[_0x5981('0x1e')]=_0x405f20;if(_0x121333[_0x5981('0x32')][_0x5981('0x3f')]){_0x20ef24[_0x5981('0x40')]=[{'all':!![]}];}return db[_0x5981('0x2c')][_0x5981('0x41')](_0x20ef24);})['then'](function(_0x2999af){_0x219838[_0x5981('0x42')]=_0x2999af;return _0x219838;})[_0x5981('0x23')](respondWithFilteredResult(_0x56ce55,_0x20ef24))[_0x5981('0x43')](handleError(_0x56ce55,null));};exports[_0x5981('0x44')]=function(_0x62f847,_0xff5374){var _0x258685={'raw':![],'where':{'id':_0x62f847[_0x5981('0x45')]['id']}},_0x267031={};_0x267031['model']=_[_0x5981('0x30')](db['AnalyticCustomReport'][_0x5981('0x46')]);_0x267031[_0x5981('0x32')]=_[_0x5981('0x30')](_0x62f847[_0x5981('0x32')]);_0x267031[_0x5981('0x47')]=_['intersection'](_0x267031[_0x5981('0x34')],_0x267031['query']);_0x258685[_0x5981('0x33')]=_[_0x5981('0x31')](_0x267031[_0x5981('0x34')],qs[_0x5981('0x35')](_0x62f847[_0x5981('0x32')][_0x5981('0x35')]));_0x258685[_0x5981('0x33')]=_0x258685[_0x5981('0x33')]['length']?_0x258685[_0x5981('0x33')]:_0x267031['model'];if(_0x62f847[_0x5981('0x32')][_0x5981('0x3f')]){_0x258685[_0x5981('0x40')]=[{'all':!![]}];}_0x258685=_[_0x5981('0x3c')]({},_0x258685,_0x62f847[_0x5981('0x3e')]);return db[_0x5981('0x2c')][_0x5981('0x48')](_0x258685)[_0x5981('0x23')](handleEntityNotFound(_0xff5374,null))[_0x5981('0x23')](respondWithResult(_0xff5374,null))[_0x5981('0x43')](handleError(_0xff5374,null));};exports[_0x5981('0x49')]=function(_0x4633b4,_0x378724){return db[_0x5981('0x2c')][_0x5981('0x49')](_0x4633b4[_0x5981('0x4a')],{})['then'](function(_0x5459ab){var _0x15e57e=_0x4633b4['user'][_0x5981('0x24')]({'plain':!![]});if(!_0x15e57e)throw new Error(_0x5981('0x4b'));if(_0x15e57e[_0x5981('0x4c')]===_0x5981('0x4d')){var _0x5a4011=_0x5459ab[_0x5981('0x24')]({'plain':!![]});var _0x819047=_0x5981('0x4e');return db['UserProfileSection'][_0x5981('0x48')]({'where':{'name':_0x819047,'userProfileId':_0x15e57e[_0x5981('0x4f')]},'raw':!![]})['then'](function(_0x20a9a9){if(_0x20a9a9&&_0x20a9a9[_0x5981('0x50')]===0x0){return db[_0x5981('0x26')][_0x5981('0x49')]({'name':_0x5a4011[_0x5981('0x2a')],'resourceId':_0x5a4011['id'],'type':_0x5981('0x25'),'sectionId':_0x20a9a9['id']},{})[_0x5981('0x23')](function(){return _0x5459ab;});}else{return _0x5459ab;}})['catch'](function(_0xf948f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf948f);throw _0xf948f;});}return _0x5459ab;})[_0x5981('0x23')](respondWithResult(_0x378724,0xc9))[_0x5981('0x43')](handleError(_0x378724,null));};exports[_0x5981('0x51')]=function(_0x2e8752,_0x1b8a40){if(_0x2e8752[_0x5981('0x4a')]['id']){delete _0x2e8752[_0x5981('0x4a')]['id'];}return db[_0x5981('0x2c')][_0x5981('0x48')]({'where':{'id':_0x2e8752[_0x5981('0x45')]['id']}})[_0x5981('0x23')](handleEntityNotFound(_0x1b8a40,null))['then'](saveUpdates(_0x2e8752[_0x5981('0x4a')],null))[_0x5981('0x23')](respondWithResult(_0x1b8a40,null))[_0x5981('0x43')](handleError(_0x1b8a40,null));};exports['destroy']=function(_0x383704,_0x52b677){return db[_0x5981('0x2c')][_0x5981('0x48')]({'where':{'id':_0x383704[_0x5981('0x45')]['id']}})[_0x5981('0x23')](handleEntityNotFound(_0x52b677,null))['then'](removeEntity(_0x52b677,null))[_0x5981('0x43')](handleError(_0x52b677,null));};exports['preview']=function(_0x7b9d12,_0x12abe0){var _0x1daf3a=0xa;var _0x552575=[_0x5981('0x52'),_0x5981('0x53'),_0x5981('0x54'),_0x5981('0x55')];var _0x2e0367={'SUM':'SUM(%s)','COUNT':_0x5981('0x56'),'COUNT DISTINCT':_0x5981('0x57'),'MAX':'MAX(%s)','MIN':_0x5981('0x58'),'AVG':_0x5981('0x59'),'GROUP_CONCAT':_0x5981('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xd5dfe8={'SEC_TO_TIME':_0x5981('0x5b'),'DATE':_0x5981('0x5c'),'HOUR':_0x5981('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5981('0x5e')};var _0x50b64b=function(_0x24f2f6){return!_[_0x5981('0x5f')]([_0x5981('0x60'),_0x5981('0x61'),_0x5981('0x62'),'IS\x20NOT\x20EMPTY'],_0x24f2f6);};var _0x4ed60d=function(_0x412cb6){if(!_0x412cb6||!_0x412cb6[_0x5981('0x63')][_0x5981('0x36')]){return'';}for(var _0x33849a='(',_0x3d34a6=0x0;_0x3d34a6<_0x412cb6['rules'][_0x5981('0x36')];_0x3d34a6+=0x1){_0x3d34a6>0x0&&(_0x33849a+='\x20'+_0x412cb6['operator']+'\x20');_0x33849a+=_0x412cb6[_0x5981('0x63')][_0x3d34a6][_0x5981('0x64')]?_0x4ed60d(_0x412cb6[_0x5981('0x63')][_0x3d34a6][_0x5981('0x64')]):_0x412cb6[_0x5981('0x63')][_0x3d34a6]['field']+'\x20'+_0x412cb6[_0x5981('0x63')][_0x3d34a6][_0x5981('0x65')]+(_0x50b64b(_0x412cb6[_0x5981('0x63')][_0x3d34a6][_0x5981('0x65')])?'\x20'+_0x412cb6['rules'][_0x3d34a6][_0x5981('0x66')]:'');}return _0x33849a+')';};var _0x2ae5f0={'where':{'id':_0x7b9d12[_0x5981('0x45')]['id']}},_0x9f45e2,_0x4d76a8,_0x12985f,_0x4213c2,_0x4983a2;_0x2ae5f0=_[_0x5981('0x3c')]({},_0x2ae5f0,_0x7b9d12[_0x5981('0x3e')]);return db[_0x5981('0x2c')]['find'](_0x2ae5f0)[_0x5981('0x23')](function(_0x185bce){if(_0x185bce){_0x9f45e2=_0x185bce;return _0x185bce[_0x5981('0x67')]();}return null;})[_0x5981('0x23')](function(_0x48ffc6){if(_0x48ffc6){if(!_0x48ffc6[_0x5981('0x36')]){throw new db['Sequelize'][(_0x5981('0x68'))](_0x5981('0x69'),0x193);}_0x4d76a8=_0x48ffc6;return db[_0x5981('0x6a')][_0x5981('0x41')]({'raw':!![]});}return null;})['then'](function(_0x2b744a){if(_0x2b744a){_0x12985f=_[_0x5981('0x6b')](_0x2b744a,'id');var _0x394e22;var _0x14daca=squel[_0x5981('0x6c')]();_0x14daca['from'](_0x9f45e2[_0x5981('0x6d')]);for(var _0x320a8a=0x0;_0x320a8a<_0x4d76a8[_0x5981('0x36')];_0x320a8a+=0x1){_0x394e22=_0x4d76a8[_0x320a8a][_0x5981('0x6e')]?_0x12985f[_0x4d76a8[_0x320a8a][_0x5981('0x6e')]][_0x5981('0x6f')]:_0x4d76a8[_0x320a8a][_0x5981('0x70')];_0x394e22=_0x4d76a8[_0x320a8a][_0x5981('0x71')]?_[_0x5981('0x72')](_0x2e0367[_0x4d76a8[_0x320a8a][_0x5981('0x71')]],'%s',_0x394e22):_0x394e22;_0x394e22=_0x4d76a8[_0x320a8a]['format']?_[_0x5981('0x72')](_0xd5dfe8[_0x4d76a8[_0x320a8a]['format']],'%s',_0x394e22):_0x394e22;if(_0x4d76a8[_0x320a8a][_0x5981('0x73')]){_0x14daca[_0x5981('0x64')](_0x394e22);}_0x4d76a8[_0x320a8a]['orderBy']&&_0x14daca[_0x5981('0x74')](_0x394e22,_0x4d76a8[_0x320a8a]['orderBy']===_0x5981('0x75')?![]:!![]);_0x14daca[_0x5981('0x70')](_0x394e22,_0x4d76a8[_0x320a8a][_0x5981('0x76')]||_0x394e22);}if(_0x9f45e2[_0x5981('0x77')]){_0x9f45e2[_0x5981('0x77')]=JSON['parse'](_0x9f45e2[_0x5981('0x77')]);for(var _0x4db41c=0x0;_0x4db41c<_0x9f45e2[_0x5981('0x77')][_0x5981('0x36')];_0x4db41c+=0x1){if(_0x9f45e2['joins'][_0x4db41c][_0x5981('0x2e')]&&_[_0x5981('0x5f')](_0x552575,_0x9f45e2['joins'][_0x4db41c][_0x5981('0x2e')])&&_0x9f45e2[_0x5981('0x77')][_0x4db41c][_0x5981('0x78')]&&_0x9f45e2[_0x5981('0x77')][_0x4db41c][_0x5981('0x79')]&&_0x9f45e2[_0x5981('0x77')][_0x4db41c]['foreignKey']){_0x14daca[_0x9f45e2[_0x5981('0x77')][_0x4db41c][_0x5981('0x2e')]](_0x9f45e2[_0x5981('0x77')][_0x4db41c][_0x5981('0x79')],null,util[_0x5981('0x7a')](_0x5981('0x7b'),_0x9f45e2[_0x5981('0x6d')],_0x9f45e2['joins'][_0x4db41c][_0x5981('0x78')],_0x9f45e2[_0x5981('0x77')][_0x4db41c][_0x5981('0x79')],_0x9f45e2[_0x5981('0x77')][_0x4db41c][_0x5981('0x7c')]));}}}if(_0x9f45e2['conditions']){_0x9f45e2[_0x5981('0x7d')]=JSON['parse'](_0x9f45e2[_0x5981('0x7d')]);_0x14daca[_0x5981('0x39')](_0x4ed60d(_0x9f45e2[_0x5981('0x7d')][_0x5981('0x64')]));}_0x4983a2=_0x14daca['clone']();_0x14daca[_0x5981('0x1f')](_0x1daf3a);_0x14daca[_0x5981('0x1c')](0x0);logger[_0x5981('0x7e')](_0x5981('0x7f'),_0x14daca[_0x5981('0x80')]());return dbH[_0x5981('0x81')][_0x5981('0x32')](_0x14daca[_0x5981('0x80')](),{'type':dbH[_0x5981('0x81')][_0x5981('0x82')][_0x5981('0x83')]});}})['then'](respondWithResult(_0x12abe0,null))[_0x5981('0x43')](handleError(_0x12abe0,null));};function runReport(_0x3e078f,_0x13868d,_0x49f8c4){var _0x3e14af=_0x13868d[_0x5981('0x2a')];var _0x2679fb=0xa;var _0x9af89=[_0x5981('0x52'),_0x5981('0x53'),'right_join','cross_join'];var _0x5c794e={'SUM':'SUM(%s)','COUNT':_0x5981('0x56'),'COUNT DISTINCT':_0x5981('0x57'),'MAX':_0x5981('0x84'),'MIN':_0x5981('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5981('0x5a'),'GROUP_CONCAT ASC':_0x5981('0x85'),'GROUP_CONCAT DESC':_0x5981('0x86')};var _0x947e55={'SEC_TO_TIME':_0x5981('0x5b'),'DATE':'DATE(%s)','HOUR':_0x5981('0x5d'),'ROUND':_0x5981('0x87'),'UNIX_TIMESTAMP':_0x5981('0x5e')};var _0x2b74c9=function(_0x41a827){return!_[_0x5981('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5981('0x62'),'IS\x20NOT\x20EMPTY'],_0x41a827);};var _0x21bca1=function(_0x4409d6){if(!_0x4409d6||!_0x4409d6[_0x5981('0x63')]['length']){return'';}for(var _0x2fe3c4='(',_0x38c8d2=0x0;_0x38c8d2<_0x4409d6[_0x5981('0x63')]['length'];_0x38c8d2+=0x1){_0x38c8d2>0x0&&(_0x2fe3c4+='\x20'+_0x4409d6[_0x5981('0x88')]+'\x20');_0x2fe3c4+=_0x4409d6['rules'][_0x38c8d2]['group']?_0x21bca1(_0x4409d6[_0x5981('0x63')][_0x38c8d2][_0x5981('0x64')]):_0x4409d6['rules'][_0x38c8d2]['field']+'\x20'+_0x4409d6[_0x5981('0x63')][_0x38c8d2]['condition']+(_0x2b74c9(_0x4409d6[_0x5981('0x63')][_0x38c8d2]['condition'])?'\x20'+_0x4409d6[_0x5981('0x63')][_0x38c8d2][_0x5981('0x66')]:'');}return _0x2fe3c4+')';};var _0x381239={'where':{'id':_0x3e078f['id']}},_0x3c5437,_0x385560,_0x187a73,_0x1dc28a,_0x1a90e1;_0x381239=_['merge']({},_0x381239,_0x49f8c4);return db[_0x5981('0x2c')][_0x5981('0x48')](_0x381239)[_0x5981('0x23')](function(_0x3b92db){if(_0x3b92db){_0x3c5437=_0x3b92db;return _0x3b92db['getFields']();}return null;})[_0x5981('0x23')](function(_0x23b045){if(_0x23b045){if(!_0x23b045[_0x5981('0x36')]){throw new db[(_0x5981('0x89'))][(_0x5981('0x68'))](_0x5981('0x69'),0x193);}_0x385560=_0x23b045;return db['AnalyticMetric'][_0x5981('0x41')]({'raw':!![]});}return null;})[_0x5981('0x23')](function(_0x27fa1a){if(_0x27fa1a){_0x187a73=_[_0x5981('0x6b')](_0x27fa1a,'id');var _0x4fef0b;var _0x2fec4d=squel['select']();_0x2fec4d[_0x5981('0x8a')](_0x3c5437[_0x5981('0x6d')]);for(var _0x40c73b=0x0;_0x40c73b<_0x385560[_0x5981('0x36')];_0x40c73b+=0x1){_0x4fef0b=_0x385560[_0x40c73b]['MetricId']?_0x187a73[_0x385560[_0x40c73b][_0x5981('0x6e')]][_0x5981('0x6f')]:_0x385560[_0x40c73b][_0x5981('0x70')];_0x4fef0b=_0x385560[_0x40c73b][_0x5981('0x71')]?_['replace'](_0x5c794e[_0x385560[_0x40c73b][_0x5981('0x71')]],'%s',_0x4fef0b):_0x4fef0b;_0x4fef0b=_0x385560[_0x40c73b][_0x5981('0x7a')]?_[_0x5981('0x72')](_0x947e55[_0x385560[_0x40c73b]['format']],'%s',_0x4fef0b):_0x4fef0b;if(_0x385560[_0x40c73b][_0x5981('0x73')]){_0x2fec4d['group'](_0x4fef0b);}_0x385560[_0x40c73b][_0x5981('0x8b')]&&_0x2fec4d[_0x5981('0x74')](_0x4fef0b,_0x385560[_0x40c73b][_0x5981('0x8b')]===_0x5981('0x75')?![]:!![]);_0x2fec4d[_0x5981('0x70')](_0x4fef0b,_0x385560[_0x40c73b][_0x5981('0x76')]||_0x4fef0b);}if(_0x3c5437[_0x5981('0x77')]){_0x3c5437[_0x5981('0x77')]=JSON['parse'](_0x3c5437[_0x5981('0x77')]);for(var _0x2b0ee4=0x0;_0x2b0ee4<_0x3c5437[_0x5981('0x77')][_0x5981('0x36')];_0x2b0ee4+=0x1){if(_0x3c5437['joins'][_0x2b0ee4][_0x5981('0x2e')]&&_[_0x5981('0x5f')](_0x9af89,_0x3c5437[_0x5981('0x77')][_0x2b0ee4][_0x5981('0x2e')])&&_0x3c5437[_0x5981('0x77')][_0x2b0ee4][_0x5981('0x78')]&&_0x3c5437['joins'][_0x2b0ee4]['foreignTable']&&_0x3c5437['joins'][_0x2b0ee4][_0x5981('0x7c')]){_0x2fec4d[_0x3c5437[_0x5981('0x77')][_0x2b0ee4]['type']](_0x3c5437[_0x5981('0x77')][_0x2b0ee4][_0x5981('0x79')],null,util[_0x5981('0x7a')](_0x5981('0x7b'),_0x3c5437[_0x5981('0x6d')],_0x3c5437[_0x5981('0x77')][_0x2b0ee4][_0x5981('0x78')],_0x3c5437['joins'][_0x2b0ee4][_0x5981('0x79')],_0x3c5437['joins'][_0x2b0ee4][_0x5981('0x7c')]));}}}if(_0x3c5437['conditions']){_0x3c5437[_0x5981('0x7d')]=JSON[_0x5981('0x8c')](_0x3c5437['conditions']);_0x2fec4d[_0x5981('0x39')](_0x21bca1(_0x3c5437[_0x5981('0x7d')]['group']));}_0x1a90e1=_0x2fec4d[_0x5981('0x8d')]();_0x2fec4d[_0x5981('0x1f')](_0x2679fb);_0x2fec4d['offset'](0x0);return;}})[_0x5981('0x23')](function(){if(_0x13868d[_0x5981('0x8e')]===_0x5981('0x8f')){return null;}var _0x566eef=_[_0x5981('0x3c')](_0x13868d,{'name':_0x13868d[_0x5981('0x90')]||_0x13868d[_0x5981('0x2a')]||_0x3c5437[_0x5981('0x2a')],'basename':_0x3e14af,'savename':util[_0x5981('0x7a')]('%s-%s.%s',_0x13868d[_0x5981('0x2a')]||_0x3c5437[_0x5981('0x2a')],require('randomstring')[_0x5981('0x91')](0x4),_0x13868d['output']||_0x5981('0x92')),'reportId':_0x3c5437['id'],'reportType':_0x5981('0x93')});return db[_0x5981('0x94')]['create'](_0x566eef,{'raw':!![]});})['then'](function(_0x5b1754){if(_0x3c5437[_0x5981('0x6d')]===_0x5981('0x95')){_0x1a90e1[_0x5981('0x39')](_0x3c5437[_0x5981('0x6d')]+_0x5981('0x96'),_0x13868d['startDate'],_0x13868d[_0x5981('0x97')]);}else{_0x1a90e1[_0x5981('0x39')](_0x3c5437[_0x5981('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x13868d[_0x5981('0x98')],_0x13868d[_0x5981('0x97')]);}if(_0x5b1754){logger[_0x5981('0x99')](_0x5981('0x9a'),_0x1a90e1['toString']());require(_0x5981('0x9b'))[_0x5981('0x9c')](path[_0x5981('0x52')](__dirname,'../../components/export/',_0x5b1754[_0x5981('0x8e')]),[_0x5b1754['id'],_0x1a90e1['toString'](),path['join'](__dirname,'../../files/reports',_0x5b1754[_0x5981('0x9d')]),_0x3e14af]);return _0x5b1754;}else{var _0x5b52d5=squel[_0x5981('0x6c')]();_0x5b52d5[_0x5981('0x8a')]('('+_0x1a90e1[_0x5981('0x80')]()+')','countTable');_0x5b52d5[_0x5981('0x70')](_0x5981('0x9e'),'count');_0x1a90e1[_0x5981('0x1f')](_0x13868d[_0x5981('0x1f')]||_0x2679fb);_0x1a90e1['offset'](_0x13868d['offset']||0x0);return dbH['sequelize'][_0x5981('0x32')](_0x5b52d5[_0x5981('0x80')](),{'type':dbH[_0x5981('0x81')]['QueryTypes'][_0x5981('0x83')]})[_0x5981('0x23')](function(_0x394df1){if(!_0x394df1['length']){_0x1dc28a=0x0;}else{_0x1dc28a=_0x394df1[0x0][_0x5981('0x1e')]||0x0;}return dbH[_0x5981('0x81')][_0x5981('0x32')](_0x1a90e1[_0x5981('0x80')](),{'type':dbH[_0x5981('0x81')][_0x5981('0x82')][_0x5981('0x83')]});})[_0x5981('0x23')](function(_0x6bc5aa){return{'rows':_0x6bc5aa||[],'count':_0x1dc28a};});}});}exports[_0x5981('0x9f')]=function(_0x42f864,_0x23f7cd){return runReport(_0x42f864['params'],_0x42f864[_0x5981('0x32')],_0x42f864[_0x5981('0x3e')])[_0x5981('0x23')](respondWithResult(_0x23f7cd,null))[_0x5981('0x43')](handleError(_0x23f7cd,null));};exports[_0x5981('0xa0')]=runReport;exports[_0x5981('0x32')]=function(_0x4a8ee3,_0xb182d6){var _0x912a5c=0xa;var _0x363a6b=[_0x5981('0x52'),_0x5981('0x53'),_0x5981('0x54'),_0x5981('0x55')];var _0x237889={'SUM':_0x5981('0xa1'),'COUNT':_0x5981('0x56'),'COUNT DISTINCT':_0x5981('0x57'),'MAX':_0x5981('0x84'),'MIN':_0x5981('0x58'),'AVG':_0x5981('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5981('0x86')};var _0x34bd17={'SEC_TO_TIME':_0x5981('0x5b'),'DATE':'DATE(%s)','HOUR':_0x5981('0x5d'),'ROUND':_0x5981('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4c8943=function(_0x5aeabd){return!_[_0x5981('0x5f')]([_0x5981('0x60'),_0x5981('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5aeabd);};var _0x355e72=function(_0x5475c5){if(!_0x5475c5||!_0x5475c5[_0x5981('0x63')]['length']){return'';}for(var _0x401c49='(',_0x4a87f3=0x0;_0x4a87f3<_0x5475c5[_0x5981('0x63')][_0x5981('0x36')];_0x4a87f3+=0x1){_0x4a87f3>0x0&&(_0x401c49+='\x20'+_0x5475c5['operator']+'\x20');_0x401c49+=_0x5475c5[_0x5981('0x63')][_0x4a87f3][_0x5981('0x64')]?_0x355e72(_0x5475c5['rules'][_0x4a87f3][_0x5981('0x64')]):_0x5475c5[_0x5981('0x63')][_0x4a87f3][_0x5981('0x70')]+'\x20'+_0x5475c5[_0x5981('0x63')][_0x4a87f3]['condition']+(_0x4c8943(_0x5475c5[_0x5981('0x63')][_0x4a87f3][_0x5981('0x65')])?'\x20'+_0x5475c5['rules'][_0x4a87f3]['value']:'');}return _0x401c49+')';};var _0x59e3d1={'where':{'id':_0x4a8ee3[_0x5981('0x45')]['id']}},_0x5c5809,_0x47dce0,_0x19c89d,_0x58422e,_0xfeae9e;_0x59e3d1=_[_0x5981('0x3c')]({},_0x59e3d1,_0x4a8ee3['options']);return db[_0x5981('0x2c')][_0x5981('0x48')](_0x59e3d1)[_0x5981('0x23')](function(_0x244366){if(_0x244366){_0x5c5809=_0x244366;return _0x244366['getFields']();}return null;})[_0x5981('0x23')](function(_0x1382fd){if(_0x1382fd){if(!_0x1382fd[_0x5981('0x36')]){throw new db[(_0x5981('0x89'))][(_0x5981('0x68'))](_0x5981('0x69'),0x193);}_0x47dce0=_0x1382fd;return db[_0x5981('0x6a')][_0x5981('0x41')]({'raw':!![]});}return null;})[_0x5981('0x23')](function(_0x4ba069){if(_0x4ba069){_0x19c89d=_[_0x5981('0x6b')](_0x4ba069,'id');var _0x2c164c;var _0x12466e=squel['select']();_0x12466e[_0x5981('0x8a')](_0x5c5809['table']);for(var _0x2c079c=0x0;_0x2c079c<_0x47dce0[_0x5981('0x36')];_0x2c079c+=0x1){_0x2c164c=_0x47dce0[_0x2c079c][_0x5981('0x6e')]?_0x19c89d[_0x47dce0[_0x2c079c][_0x5981('0x6e')]][_0x5981('0x6f')]:_0x47dce0[_0x2c079c][_0x5981('0x70')];_0x2c164c=_0x47dce0[_0x2c079c]['function']?_['replace'](_0x237889[_0x47dce0[_0x2c079c][_0x5981('0x71')]],'%s',_0x2c164c):_0x2c164c;_0x2c164c=_0x47dce0[_0x2c079c]['format']?_[_0x5981('0x72')](_0x34bd17[_0x47dce0[_0x2c079c][_0x5981('0x7a')]],'%s',_0x2c164c):_0x2c164c;if(_0x47dce0[_0x2c079c][_0x5981('0x73')]){_0x12466e[_0x5981('0x64')](_0x2c164c);}_0x47dce0[_0x2c079c][_0x5981('0x8b')]&&_0x12466e[_0x5981('0x74')](_0x2c164c,_0x47dce0[_0x2c079c][_0x5981('0x8b')]===_0x5981('0x75')?![]:!![]);_0x12466e['field'](_0x2c164c,_0x47dce0[_0x2c079c]['alias']||_0x2c164c);}if(_0x5c5809[_0x5981('0x77')]){_0x5c5809['joins']=JSON[_0x5981('0x8c')](_0x5c5809['joins']);for(var _0x47e423=0x0;_0x47e423<_0x5c5809['joins'][_0x5981('0x36')];_0x47e423+=0x1){if(_0x5c5809[_0x5981('0x77')][_0x47e423][_0x5981('0x2e')]&&_[_0x5981('0x5f')](_0x363a6b,_0x5c5809[_0x5981('0x77')][_0x47e423][_0x5981('0x2e')])&&_0x5c5809[_0x5981('0x77')][_0x47e423][_0x5981('0x78')]&&_0x5c5809['joins'][_0x47e423][_0x5981('0x79')]&&_0x5c5809[_0x5981('0x77')][_0x47e423][_0x5981('0x7c')]){_0x12466e[_0x5c5809['joins'][_0x47e423][_0x5981('0x2e')]](_0x5c5809['joins'][_0x47e423][_0x5981('0x79')],null,util[_0x5981('0x7a')](_0x5981('0x7b'),_0x5c5809[_0x5981('0x6d')],_0x5c5809[_0x5981('0x77')][_0x47e423][_0x5981('0x78')],_0x5c5809['joins'][_0x47e423][_0x5981('0x79')],_0x5c5809['joins'][_0x47e423][_0x5981('0x7c')]));}}}if(_0x5c5809[_0x5981('0x7d')]){_0x5c5809[_0x5981('0x7d')]=JSON['parse'](_0x5c5809['conditions']);_0x12466e[_0x5981('0x39')](_0x355e72(_0x5c5809['conditions'][_0x5981('0x64')]));}_0xfeae9e=_0x12466e['clone']();_0x12466e[_0x5981('0x1f')](_0x912a5c);_0x12466e['offset'](0x0);logger['debug']('Limited\x20Query:',_0x12466e[_0x5981('0x80')]());return dbH[_0x5981('0x81')][_0x5981('0x32')](_0x12466e[_0x5981('0x80')](),{'type':dbH['sequelize'][_0x5981('0x82')]['SELECT']});}})[_0x5981('0x23')](function(){return{'sql':_0xfeae9e[_0x5981('0x80')]()};})[_0x5981('0x23')](respondWithResult(_0xb182d6,null))[_0x5981('0x43')](handleError(_0xb182d6,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index d05b6dd..8bb8ab7 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 _0x3284=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x29f4aa,_0x16db81){var _0x4d12ab=function(_0x346435){while(--_0x346435){_0x29f4aa['push'](_0x29f4aa['shift']());}};_0x4d12ab(++_0x16db81);}(_0x3284,0x87));var _0x4328=function(_0x4cb3ef,_0x4bcb7d){_0x4cb3ef=_0x4cb3ef-0x0;var _0x27702b=_0x3284[_0x4cb3ef];return _0x27702b;};'use strict';var _=require(_0x4328('0x0'));var util=require(_0x4328('0x1'));var logger=require(_0x4328('0x2'))(_0x4328('0x3'));var moment=require(_0x4328('0x4'));var BPromise=require(_0x4328('0x5'));var rp=require(_0x4328('0x6'));var fs=require('fs');var path=require(_0x4328('0x7'));var rimraf=require(_0x4328('0x8'));var config=require(_0x4328('0x9'));var attributes=require(_0x4328('0xa'));module['exports']=function(_0x59307e,_0x595a21){return _0x59307e[_0x4328('0xb')](_0x4328('0xc'),attributes,{'tableName':_0x4328('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x058e=['api','moment','path','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x2aaa8b,_0x164942){var _0x4c2c9c=function(_0x23e823){while(--_0x23e823){_0x2aaa8b['push'](_0x2aaa8b['shift']());}};_0x4c2c9c(++_0x164942);}(_0x058e,0x19f));var _0xe058=function(_0x2be5a4,_0x97d5a0){_0x2be5a4=_0x2be5a4-0x0;var _0x59a420=_0x058e[_0x2be5a4];return _0x59a420;};'use strict';var _=require(_0xe058('0x0'));var util=require(_0xe058('0x1'));var logger=require(_0xe058('0x2'))(_0xe058('0x3'));var moment=require(_0xe058('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe058('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe058('0x6'));module[_0xe058('0x7')]=function(_0x350bd1,_0x1d1183){return _0x350bd1[_0xe058('0x8')](_0xe058('0x9'),attributes,{'tableName':_0xe058('0xa'),'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 b683d95..0cbaa8b 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 _0x8117=['moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x3be02d,_0x160a99){var _0x3a6e0c=function(_0x59dd27){while(--_0x59dd27){_0x3be02d['push'](_0x3be02d['shift']());}};_0x3a6e0c(++_0x160a99);}(_0x8117,0xda));var _0x7811=function(_0xf1b51e,_0x389d79){_0xf1b51e=_0xf1b51e-0x0;var _0x3f836d=_0x8117[_0xf1b51e];return _0x3f836d;};'use strict';var _=require(_0x7811('0x0'));var util=require(_0x7811('0x1'));var moment=require(_0x7811('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7811('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7811('0x4'))(_0x7811('0x5'));var config=require(_0x7811('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7811('0x7')][_0x7811('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x104b94,_0x3673d8,_0x57fded){return new BPromise(function(_0x59fc4c,_0x373706){return client['request'](_0x104b94,_0x57fded)[_0x7811('0x9')](function(_0x2aff0f){logger[_0x7811('0xa')](_0x7811('0xb'),_0x3673d8,_0x7811('0xc'));logger[_0x7811('0xd')](_0x7811('0xe'),_0x3673d8,'request\x20sent',JSON[_0x7811('0xf')](_0x2aff0f));if(_0x2aff0f[_0x7811('0x10')]){if(_0x2aff0f[_0x7811('0x10')][_0x7811('0x11')]===0x1f4){logger[_0x7811('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3673d8,_0x2aff0f[_0x7811('0x10')]['message']);return _0x373706(_0x2aff0f['error'][_0x7811('0x12')]);}logger[_0x7811('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3673d8,_0x2aff0f['error'][_0x7811('0x12')]);return _0x59fc4c(_0x2aff0f[_0x7811('0x10')][_0x7811('0x12')]);}else{logger[_0x7811('0xa')](_0x7811('0xb'),_0x3673d8,'request\x20sent');_0x59fc4c(_0x2aff0f[_0x7811('0x13')][_0x7811('0x12')]);}})['catch'](function(_0x2f0c4a){logger[_0x7811('0x10')](_0x7811('0xb'),_0x3673d8,_0x2f0c4a);_0x373706(_0x2f0c4a);});});}
\ No newline at end of file
+var _0xe8de=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0xe8de,0x107));var _0xee8d=function(_0x4d8712,_0x14a613){_0x4d8712=_0x4d8712-0x0;var _0x154fae=_0xe8de[_0x4d8712];return _0x154fae;};'use strict';var _=require(_0xee8d('0x0'));var util=require(_0xee8d('0x1'));var moment=require('moment');var BPromise=require(_0xee8d('0x2'));var rs=require(_0xee8d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee8d('0x4'));var logger=require(_0xee8d('0x5'))(_0xee8d('0x6'));var config=require(_0xee8d('0x7'));var jayson=require(_0xee8d('0x8'));var client=jayson[_0xee8d('0x9')][_0xee8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x226576,_0x2751ff,_0x13377b){return new BPromise(function(_0x287a73,_0x1031f9){return client[_0xee8d('0xb')](_0x226576,_0x13377b)[_0xee8d('0xc')](function(_0x4384ba){logger['info'](_0xee8d('0xd'),_0x2751ff,_0xee8d('0xe'));logger[_0xee8d('0xf')](_0xee8d('0x10'),_0x2751ff,_0xee8d('0xe'),JSON[_0xee8d('0x11')](_0x4384ba));if(_0x4384ba[_0xee8d('0x12')]){if(_0x4384ba[_0xee8d('0x12')][_0xee8d('0x13')]===0x1f4){logger[_0xee8d('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2751ff,_0x4384ba['error'][_0xee8d('0x14')]);return _0x1031f9(_0x4384ba[_0xee8d('0x12')][_0xee8d('0x14')]);}logger[_0xee8d('0x12')](_0xee8d('0xd'),_0x2751ff,_0x4384ba[_0xee8d('0x12')]['message']);return _0x287a73(_0x4384ba['error'][_0xee8d('0x14')]);}else{logger[_0xee8d('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2751ff,_0xee8d('0xe'));_0x287a73(_0x4384ba[_0xee8d('0x16')][_0xee8d('0x14')]);}})[_0xee8d('0x17')](function(_0x5d46fb){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x2751ff,_0x5d46fb);_0x1031f9(_0x5d46fb);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index f9d4a4e..5bdeb7b 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 _0xac1b=['isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x22d4ca,_0x3bc7af){var _0x35e2cb=function(_0x19d423){while(--_0x19d423){_0x22d4ca['push'](_0x22d4ca['shift']());}};_0x35e2cb(++_0x3bc7af);}(_0xac1b,0x146));var _0xbac1=function(_0x3042d1,_0x213e3e){_0x3042d1=_0x3042d1-0x0;var _0x3e22c5=_0xac1b[_0x3042d1];return _0x3e22c5;};'use strict';var multer=require(_0xbac1('0x0'));var util=require(_0xbac1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbac1('0x2'));var router=express[_0xbac1('0x3')]();var fs_extra=require(_0xbac1('0x4'));var auth=require(_0xbac1('0x5'));var interaction=require(_0xbac1('0x6'));var config=require(_0xbac1('0x7'));var controller=require(_0xbac1('0x8'));router[_0xbac1('0x9')]('/',auth[_0xbac1('0xa')](),controller[_0xbac1('0xb')]);router[_0xbac1('0x9')](_0xbac1('0xc'),auth[_0xbac1('0xa')](),controller[_0xbac1('0xd')]);router['get'](_0xbac1('0xe'),auth[_0xbac1('0xa')](),controller[_0xbac1('0xf')]);router[_0xbac1('0x9')](_0xbac1('0x10'),auth[_0xbac1('0xa')](),controller['run']);router['get'](_0xbac1('0x11'),auth[_0xbac1('0xa')](),controller[_0xbac1('0x12')]);router['post']('/',auth[_0xbac1('0xa')](),controller['create']);router[_0xbac1('0x13')](_0xbac1('0xc'),auth[_0xbac1('0xa')](),controller[_0xbac1('0x14')]);router[_0xbac1('0x15')]('/:id',auth[_0xbac1('0xa')](),controller[_0xbac1('0x16')]);module[_0xbac1('0x17')]=router;
\ No newline at end of file
+var _0xc62d=['util','path','connect-timeout','express','Router','fs-extra','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','/:id/query','query','create','put','update','delete','exports','multer'];(function(_0x36f37b,_0x36ea03){var _0x249634=function(_0x1cde21){while(--_0x1cde21){_0x36f37b['push'](_0x36f37b['shift']());}};_0x249634(++_0x36ea03);}(_0xc62d,0x175));var _0xdc62=function(_0x2b2c32,_0x330535){_0x2b2c32=_0x2b2c32-0x0;var _0x1e5f99=_0xc62d[_0x2b2c32];return _0x1e5f99;};'use strict';var multer=require(_0xdc62('0x0'));var util=require(_0xdc62('0x1'));var path=require(_0xdc62('0x2'));var timeout=require(_0xdc62('0x3'));var express=require(_0xdc62('0x4'));var router=express[_0xdc62('0x5')]();var fs_extra=require(_0xdc62('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdc62('0x7'));router[_0xdc62('0x8')]('/',auth['isAuthenticated'](),controller[_0xdc62('0x9')]);router[_0xdc62('0x8')](_0xdc62('0xa'),auth[_0xdc62('0xb')](),controller[_0xdc62('0xc')]);router[_0xdc62('0x8')](_0xdc62('0xd'),auth[_0xdc62('0xb')](),controller['preview']);router[_0xdc62('0x8')](_0xdc62('0xe'),auth[_0xdc62('0xb')](),controller['run']);router[_0xdc62('0x8')](_0xdc62('0xf'),auth[_0xdc62('0xb')](),controller[_0xdc62('0x10')]);router['post']('/',auth[_0xdc62('0xb')](),controller[_0xdc62('0x11')]);router[_0xdc62('0x12')](_0xdc62('0xa'),auth[_0xdc62('0xb')](),controller[_0xdc62('0x13')]);router[_0xdc62('0x14')](_0xdc62('0xa'),auth[_0xdc62('0xb')](),controller['destroy']);module[_0xdc62('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 820783a..2a2b9ed 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 _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x102ac6,_0x54c4b5){var _0x155da=function(_0x26178a){while(--_0x26178a){_0x102ac6['push'](_0x102ac6['shift']());}};_0x155da(++_0x54c4b5);}(_0xabce,0x103));var _0xeabc=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xabce[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x34dc84,_0x260330){var _0x574d42=function(_0xeb25eb){while(--_0xeb25eb){_0x34dc84['push'](_0x34dc84['shift']());}};_0x574d42(++_0x260330);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0xfe2e05,_0x21d317){_0xfe2e05=_0xfe2e05-0x0;var _0x322f62=_0x3f8a[_0xfe2e05];return _0x322f62;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6411be5..ebcb818 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x148b06,_0x375597){var _0x222dbf=function(_0x5e8b5d){while(--_0x5e8b5d){_0x148b06['push'](_0x148b06['shift']());}};_0x222dbf(++_0x375597);}(_0x7a54,0x106));var _0x47a5=function(_0x3d4afc,_0x389f9d){_0x3d4afc=_0x3d4afc-0x0;var _0x572d77=_0x7a54[_0x3d4afc];return _0x572d77;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));};
\ No newline at end of file
+var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','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','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x1fb61a,_0x37dee1){var _0x429a35=function(_0x4334e5){while(--_0x4334e5){_0x1fb61a['push'](_0x1fb61a['shift']());}};_0x429a35(++_0x37dee1);}(_0x1cb9,0x14e));var _0x91cb=function(_0x26dd58,_0x5d42b2){_0x26dd58=_0x26dd58-0x0;var _0x196dc9=_0x1cb9[_0x26dd58];return _0x196dc9;};'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'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index fa5b079..684250c 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 _0xd6f9=['bluebird','request-promise','path','rimraf','../../config/environment','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment'];(function(_0x3d94fc,_0x5e08e5){var _0x20d02c=function(_0x5225e3){while(--_0x5225e3){_0x3d94fc['push'](_0x3d94fc['shift']());}};_0x20d02c(++_0x5e08e5);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xd6f9[_0x43b584];return _0x48f27b;};'use strict';var _=require(_0x9d6f('0x0'));var util=require(_0x9d6f('0x1'));var logger=require(_0x9d6f('0x2'))('api');var moment=require(_0x9d6f('0x3'));var BPromise=require(_0x9d6f('0x4'));var rp=require(_0x9d6f('0x5'));var fs=require('fs');var path=require(_0x9d6f('0x6'));var rimraf=require(_0x9d6f('0x7'));var config=require(_0x9d6f('0x8'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x4dc4c1,_0x2b253a){return _0x4dc4c1['define'](_0x9d6f('0x9'),attributes,{'tableName':_0x9d6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0808=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0x0808,0x171));var _0x8080=function(_0x3f4d7d,_0x1fc5d2){_0x3f4d7d=_0x3f4d7d-0x0;var _0x2e26ba=_0x0808[_0x3f4d7d];return _0x2e26ba;};'use strict';var _=require('lodash');var util=require(_0x8080('0x0'));var logger=require(_0x8080('0x1'))(_0x8080('0x2'));var moment=require(_0x8080('0x3'));var BPromise=require(_0x8080('0x4'));var rp=require(_0x8080('0x5'));var fs=require('fs');var path=require(_0x8080('0x6'));var rimraf=require(_0x8080('0x7'));var config=require(_0x8080('0x8'));var attributes=require(_0x8080('0x9'));module[_0x8080('0xa')]=function(_0x35357d,_0x135bc3){return _0x35357d[_0x8080('0xb')](_0x8080('0xc'),attributes,{'tableName':_0x8080('0xd'),'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 9f48104..90d05dc 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 _0xddef=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xddef,0x1ac));var _0xfdde=function(_0x362ab7,_0x5d18e8){_0x362ab7=_0x362ab7-0x0;var _0x2532d1=_0xddef[_0x362ab7];return _0x2532d1;};'use strict';var _=require('lodash');var util=require(_0xfdde('0x0'));var moment=require('moment');var BPromise=require(_0xfdde('0x1'));var rs=require(_0xfdde('0x2'));var fs=require('fs');var Redis=require(_0xfdde('0x3'));var db=require(_0xfdde('0x4'))['db'];var utils=require(_0xfdde('0x5'));var logger=require(_0xfdde('0x6'))(_0xfdde('0x7'));var config=require(_0xfdde('0x8'));var jayson=require(_0xfdde('0x9'));var client=jayson[_0xfdde('0xa')][_0xfdde('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17002c,_0x40831a,_0x26c0b2){return new BPromise(function(_0x180cd5,_0x360614){return client[_0xfdde('0xc')](_0x17002c,_0x26c0b2)[_0xfdde('0xd')](function(_0x562365){logger[_0xfdde('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x40831a,_0xfdde('0xf'));logger['debug'](_0xfdde('0x10'),_0x40831a,_0xfdde('0xf'),JSON[_0xfdde('0x11')](_0x562365));if(_0x562365[_0xfdde('0x12')]){if(_0x562365[_0xfdde('0x12')][_0xfdde('0x13')]===0x1f4){logger[_0xfdde('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x40831a,_0x562365['error']['message']);return _0x360614(_0x562365[_0xfdde('0x12')][_0xfdde('0x14')]);}logger['error'](_0xfdde('0x15'),_0x40831a,_0x562365['error']['message']);return _0x180cd5(_0x562365[_0xfdde('0x12')][_0xfdde('0x14')]);}else{logger[_0xfdde('0xe')](_0xfdde('0x15'),_0x40831a,_0xfdde('0xf'));_0x180cd5(_0x562365[_0xfdde('0x16')]['message']);}})[_0xfdde('0x17')](function(_0x3251d2){logger[_0xfdde('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x40831a,_0x3251d2);_0x360614(_0x3251d2);});});}
\ No newline at end of file
+var _0x1a59=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x14e780,_0x3b07c6){var _0x5f884c=function(_0x2daf57){while(--_0x2daf57){_0x14e780['push'](_0x14e780['shift']());}};_0x5f884c(++_0x3b07c6);}(_0x1a59,0xa2));var _0x91a5=function(_0x582a04,_0x1ff37e){_0x582a04=_0x582a04-0x0;var _0x546e7a=_0x1a59[_0x582a04];return _0x546e7a;};'use strict';var _=require(_0x91a5('0x0'));var util=require(_0x91a5('0x1'));var moment=require(_0x91a5('0x2'));var BPromise=require(_0x91a5('0x3'));var rs=require(_0x91a5('0x4'));var fs=require('fs');var Redis=require(_0x91a5('0x5'));var db=require(_0x91a5('0x6'))['db'];var utils=require(_0x91a5('0x7'));var logger=require('../../config/logger')(_0x91a5('0x8'));var config=require(_0x91a5('0x9'));var jayson=require(_0x91a5('0xa'));var client=jayson[_0x91a5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf096e2,_0x53dfa7,_0x37bc4f){return new BPromise(function(_0x17d2ef,_0x5484bd){return client[_0x91a5('0xc')](_0xf096e2,_0x37bc4f)[_0x91a5('0xd')](function(_0x2cdfae){logger[_0x91a5('0xe')](_0x91a5('0xf'),_0x53dfa7,'request\x20sent');logger[_0x91a5('0x10')](_0x91a5('0x11'),_0x53dfa7,'request\x20sent',JSON['stringify'](_0x2cdfae));if(_0x2cdfae[_0x91a5('0x12')]){if(_0x2cdfae['error'][_0x91a5('0x13')]===0x1f4){logger['error'](_0x91a5('0xf'),_0x53dfa7,_0x2cdfae['error']['message']);return _0x5484bd(_0x2cdfae['error'][_0x91a5('0x14')]);}logger[_0x91a5('0x12')](_0x91a5('0xf'),_0x53dfa7,_0x2cdfae['error'][_0x91a5('0x14')]);return _0x17d2ef(_0x2cdfae[_0x91a5('0x12')][_0x91a5('0x14')]);}else{logger[_0x91a5('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53dfa7,_0x91a5('0x15'));_0x17d2ef(_0x2cdfae[_0x91a5('0x16')]['message']);}})[_0x91a5('0x17')](function(_0x577660){logger[_0x91a5('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53dfa7,_0x577660);_0x5484bd(_0x577660);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index a4e8fb7..807a703 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 _0x88a1=['get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x88a1,0x1c7));var _0x188a=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0x88a1[_0xf5d71c];return _0x5af672;};'use strict';var multer=require(_0x188a('0x0'));var util=require('util');var path=require(_0x188a('0x1'));var timeout=require('connect-timeout');var express=require(_0x188a('0x2'));var router=express[_0x188a('0x3')]();var fs_extra=require(_0x188a('0x4'));var auth=require(_0x188a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x188a('0x6'));router[_0x188a('0x7')]('/',auth[_0x188a('0x8')](),controller['index']);router[_0x188a('0x7')](_0x188a('0x9'),auth['isAuthenticated'](),controller[_0x188a('0xa')]);router['get'](_0x188a('0xb'),auth[_0x188a('0x8')](),controller[_0x188a('0xc')]);router[_0x188a('0x7')](_0x188a('0xd'),auth[_0x188a('0x8')](),controller[_0x188a('0xe')]);router['get'](_0x188a('0xf'),auth[_0x188a('0x8')](),controller[_0x188a('0x10')]);router[_0x188a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x188a('0x12')](_0x188a('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x188a('0x13')](_0x188a('0x9'),auth[_0x188a('0x8')](),controller[_0x188a('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x4aa2=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','/:id','destroy'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x4aa2,0x78));var _0x24aa=function(_0x19f161,_0x3b5999){_0x19f161=_0x19f161-0x0;var _0x17fa27=_0x4aa2[_0x19f161];return _0x17fa27;};'use strict';var multer=require(_0x24aa('0x0'));var util=require('util');var path=require(_0x24aa('0x1'));var timeout=require(_0x24aa('0x2'));var express=require(_0x24aa('0x3'));var router=express[_0x24aa('0x4')]();var fs_extra=require(_0x24aa('0x5'));var auth=require(_0x24aa('0x6'));var interaction=require(_0x24aa('0x7'));var config=require(_0x24aa('0x8'));var controller=require(_0x24aa('0x9'));router[_0x24aa('0xa')]('/',auth['isAuthenticated'](),controller[_0x24aa('0xb')]);router[_0x24aa('0xa')]('/:id',auth[_0x24aa('0xc')](),controller['show']);router[_0x24aa('0xa')](_0x24aa('0xd'),auth[_0x24aa('0xc')](),controller[_0x24aa('0xe')]);router[_0x24aa('0xa')](_0x24aa('0xf'),auth[_0x24aa('0xc')](),controller['run']);router['get'](_0x24aa('0x10'),auth[_0x24aa('0xc')](),controller[_0x24aa('0x11')]);router[_0x24aa('0x12')]('/',auth[_0x24aa('0xc')](),controller[_0x24aa('0x13')]);router[_0x24aa('0x14')]('/:id',auth[_0x24aa('0xc')](),controller['update']);router[_0x24aa('0x15')](_0x24aa('0x16'),auth[_0x24aa('0xc')](),controller[_0x24aa('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index c3e4901..1d22c88 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 _0x078e=['manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','pdf','xlsx','csv','DATE','Loading'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x078e,0x93));var _0xe078=function(_0x1b9073,_0x2f3795){_0x1b9073=_0x1b9073-0x0;var _0x585eeb=_0x078e[_0x1b9073];return _0x585eeb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe078('0x0'));module[_0xe078('0x1')]={'name':{'type':Sequelize[_0xe078('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe078('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xe078('0x3')]('csv',_0xe078('0x4'),_0xe078('0x5')),'allowNull':![],'defaultValue':_0xe078('0x6')},'savename':{'type':Sequelize[_0xe078('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe078('0x7')]},'endDate':{'type':Sequelize[_0xe078('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xe078('0x8')},'type':{'type':Sequelize[_0xe078('0x3')](_0xe078('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xe078('0x9')},'reportId':{'type':Sequelize[_0xe078('0xa')](0xb)[_0xe078('0xb')]},'reportType':{'type':Sequelize[_0xe078('0x2')]}};
\ No newline at end of file
+var _0xf01f=['moment','exports','STRING','csv','pdf','xlsx','DATE','Loading','ENUM','scheduled','INTEGER','sequelize'];(function(_0x16bc92,_0x1b0935){var _0x27a2d2=function(_0x334beb){while(--_0x334beb){_0x16bc92['push'](_0x16bc92['shift']());}};_0x27a2d2(++_0x1b0935);}(_0xf01f,0x137));var _0xff01=function(_0x2b61bb,_0x435222){_0x2b61bb=_0x2b61bb-0x0;var _0x55cbe6=_0xf01f[_0x2b61bb];return _0x55cbe6;};'use strict';var Sequelize=require(_0xff01('0x0'));var moment=require(_0xff01('0x1'));module[_0xff01('0x2')]={'name':{'type':Sequelize[_0xff01('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xff01('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xff01('0x4'),_0xff01('0x5'),_0xff01('0x6')),'allowNull':![],'defaultValue':_0xff01('0x4')},'savename':{'type':Sequelize[_0xff01('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xff01('0x7')]},'endDate':{'type':Sequelize[_0xff01('0x7')]},'status':{'type':Sequelize[_0xff01('0x3')],'defaultValue':_0xff01('0x8')},'type':{'type':Sequelize[_0xff01('0x9')]('manual',_0xff01('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xff01('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xff01('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 5280586..4065bf3 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 _0xe69e=['show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','download','basename','savename','output','existsSync','join','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x105c51,_0x412d34){var _0x1f727d=function(_0x536704){while(--_0x536704){_0x105c51['push'](_0x105c51['shift']());}};_0x1f727d(++_0x412d34);}(_0xe69e,0x139));var _0xee69=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xe69e[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0xee69('0x0'));var rimraf=require(_0xee69('0x1'));var zipdir=require(_0xee69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee69('0x3'));var moment=require(_0xee69('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xee69('0x5'));var path=require(_0xee69('0x6'));var sox=require(_0xee69('0x7'));var csv=require(_0xee69('0x8'));var ejs=require(_0xee69('0x9'));var fs=require('fs');var fs_extra=require(_0xee69('0xa'));var _=require(_0xee69('0xb'));var squel=require('squel');var crypto=require(_0xee69('0xc'));var jsforce=require(_0xee69('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xee69('0x8'));var querystring=require('querystring');var Papa=require(_0xee69('0xe'));var Redis=require('ioredis');var authService=require(_0xee69('0xf'));var qs=require(_0xee69('0x10'));var as=require(_0xee69('0x11'));var hardwareService=require(_0xee69('0x12'));var logger=require('../../config/logger')(_0xee69('0x13'));var utils=require(_0xee69('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xee69('0x15'));var db=require(_0xee69('0x16'))['db'];function respondWithStatusCode(_0x441d6e,_0x300b1e){_0x300b1e=_0x300b1e||0xcc;return function(_0x40bb5a){if(_0x40bb5a){return _0x441d6e[_0xee69('0x17')](_0x300b1e);}return _0x441d6e[_0xee69('0x18')](_0x300b1e)[_0xee69('0x19')]();};}function respondWithResult(_0x5772a8,_0x4ba33a){_0x4ba33a=_0x4ba33a||0xc8;return function(_0x38d668){if(_0x38d668){return _0x5772a8['status'](_0x4ba33a)[_0xee69('0x1a')](_0x38d668);}};}function respondWithFilteredResult(_0x4314fc,_0x19eef4){return function(_0xdcfa07){if(_0xdcfa07){var _0x251e73=typeof _0x19eef4[_0xee69('0x1b')]===_0xee69('0x1c')&&typeof _0x19eef4[_0xee69('0x1d')]===_0xee69('0x1c');var _0x28bb57=_0xdcfa07[_0xee69('0x1e')];var _0x36cc93=_0x251e73?0x0:_0x19eef4[_0xee69('0x1b')];var _0x5bc6f6=_0x251e73?_0xdcfa07[_0xee69('0x1e')]:_0x19eef4[_0xee69('0x1b')]+_0x19eef4[_0xee69('0x1d')];var _0x4fa61a;if(_0x5bc6f6>=_0x28bb57){_0x5bc6f6=_0x28bb57;_0x4fa61a=0xc8;}else{_0x4fa61a=0xce;}_0x4314fc[_0xee69('0x18')](_0x4fa61a);return _0x4314fc[_0xee69('0x1f')](_0xee69('0x20'),_0x36cc93+'-'+_0x5bc6f6+'/'+_0x28bb57)[_0xee69('0x1a')](_0xdcfa07);}return null;};}function patchUpdates(_0x4e0009){return function(_0x15a2a1){try{jsonpatch[_0xee69('0x21')](_0x15a2a1,_0x4e0009,!![]);}catch(_0x2fdfa5){return BPromise[_0xee69('0x22')](_0x2fdfa5);}return _0x15a2a1[_0xee69('0x23')]();};}function saveUpdates(_0x542f55,_0x533f16){return function(_0x318c47){if(_0x318c47){return _0x318c47['update'](_0x542f55)[_0xee69('0x24')](function(_0x182b55){return _0x182b55;});}return null;};}function removeEntity(_0x1f6543,_0x42a85b){return function(_0x7669a2){if(_0x7669a2){return _0x7669a2[_0xee69('0x25')]()['then'](function(){var _0x19e61=_0x7669a2[_0xee69('0x26')]({'plain':!![]});var _0x632d52=_0xee69('0x27');return db[_0xee69('0x28')][_0xee69('0x25')]({'where':{'type':_0x632d52,'resourceId':_0x19e61['id']}})['then'](function(){return _0x7669a2;});})[_0xee69('0x24')](function(){_0x1f6543[_0xee69('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fe473,_0x5516cc){return function(_0x3ad69a){if(!_0x3ad69a){_0x1fe473['sendStatus'](0x194);}return _0x3ad69a;};}function handleError(_0x652988,_0x1d5c0c){_0x1d5c0c=_0x1d5c0c||0x1f4;return function(_0x11014d){logger['error'](_0x11014d[_0xee69('0x29')]);if(_0x11014d[_0xee69('0x2a')]){delete _0x11014d[_0xee69('0x2a')];}_0x652988[_0xee69('0x18')](_0x1d5c0c)[_0xee69('0x2b')](_0x11014d);};}exports[_0xee69('0x2c')]=function(_0x44a007,_0x36c62d){var _0x37f8fd={},_0x5d2f30={},_0x217068={'count':0x0,'rows':[]};var _0x3a5e97=_[_0xee69('0x2d')](db[_0xee69('0x2e')][_0xee69('0x2f')],function(_0x5efd21){return{'name':_0x5efd21['fieldName'],'type':_0x5efd21[_0xee69('0x30')][_0xee69('0x31')]};});_0x5d2f30[_0xee69('0x32')]=_[_0xee69('0x2d')](_0x3a5e97,_0xee69('0x2a'));_0x5d2f30[_0xee69('0x33')]=_['keys'](_0x44a007[_0xee69('0x33')]);_0x5d2f30['filters']=_[_0xee69('0x34')](_0x5d2f30[_0xee69('0x32')],_0x5d2f30[_0xee69('0x33')]);_0x37f8fd[_0xee69('0x35')]=_[_0xee69('0x34')](_0x5d2f30[_0xee69('0x32')],qs['fields'](_0x44a007[_0xee69('0x33')][_0xee69('0x36')]));_0x37f8fd['attributes']=_0x37f8fd[_0xee69('0x35')][_0xee69('0x37')]?_0x37f8fd[_0xee69('0x35')]:_0x5d2f30[_0xee69('0x32')];if(!_0x44a007[_0xee69('0x33')][_0xee69('0x38')](_0xee69('0x39'))){_0x37f8fd[_0xee69('0x1d')]=qs[_0xee69('0x1d')](_0x44a007[_0xee69('0x33')][_0xee69('0x1d')]);_0x37f8fd[_0xee69('0x1b')]=qs[_0xee69('0x1b')](_0x44a007[_0xee69('0x33')]['offset']);}_0x37f8fd[_0xee69('0x3a')]=qs[_0xee69('0x3b')](_0x44a007['query']['sort']);_0x37f8fd[_0xee69('0x3c')]=qs[_0xee69('0x3d')](_[_0xee69('0x3e')](_0x44a007[_0xee69('0x33')],_0x5d2f30[_0xee69('0x3d')]),_0x3a5e97);if(_0x44a007[_0xee69('0x33')][_0xee69('0x3f')]){_0x37f8fd['where']=_[_0xee69('0x40')](_0x37f8fd[_0xee69('0x3c')],{'$or':_['map'](_0x3a5e97,function(_0x491bc1){if(_0x491bc1['type']!==_0xee69('0x41')){var _0x1e94d3={};_0x1e94d3[_0x491bc1['name']]={'$like':'%'+_0x44a007[_0xee69('0x33')][_0xee69('0x3f')]+'%'};return _0x1e94d3;}})});}_0x37f8fd=_[_0xee69('0x40')]({},_0x37f8fd,_0x44a007[_0xee69('0x42')]);var _0x4b13ad={'where':_0x37f8fd['where']};return db[_0xee69('0x2e')][_0xee69('0x1e')](_0x4b13ad)[_0xee69('0x24')](function(_0x393d69){_0x217068[_0xee69('0x1e')]=_0x393d69;if(_0x44a007[_0xee69('0x33')][_0xee69('0x43')]){_0x37f8fd['include']=[{'all':!![]}];}return db[_0xee69('0x2e')][_0xee69('0x44')](_0x37f8fd);})[_0xee69('0x24')](function(_0xefdc8f){_0x217068[_0xee69('0x45')]=_0xefdc8f;return _0x217068;})['then'](respondWithFilteredResult(_0x36c62d,_0x37f8fd))[_0xee69('0x46')](handleError(_0x36c62d,null));};exports[_0xee69('0x47')]=function(_0x53c442,_0x15313c){var _0x101edb={'raw':!![],'where':{'id':_0x53c442['params']['id']}},_0x26ec7b={};_0x26ec7b['model']=_[_0xee69('0x48')](db['AnalyticExtractedReport']['rawAttributes']);_0x26ec7b[_0xee69('0x33')]=_['keys'](_0x53c442[_0xee69('0x33')]);_0x26ec7b[_0xee69('0x3d')]=_[_0xee69('0x34')](_0x26ec7b['model'],_0x26ec7b[_0xee69('0x33')]);_0x101edb[_0xee69('0x35')]=_['intersection'](_0x26ec7b[_0xee69('0x32')],qs[_0xee69('0x36')](_0x53c442['query'][_0xee69('0x36')]));_0x101edb['attributes']=_0x101edb[_0xee69('0x35')][_0xee69('0x37')]?_0x101edb[_0xee69('0x35')]:_0x26ec7b[_0xee69('0x32')];if(_0x53c442[_0xee69('0x33')][_0xee69('0x43')]){_0x101edb['include']=[{'all':!![]}];}_0x101edb=_[_0xee69('0x40')]({},_0x101edb,_0x53c442[_0xee69('0x42')]);return db[_0xee69('0x2e')][_0xee69('0x49')](_0x101edb)[_0xee69('0x24')](handleEntityNotFound(_0x15313c,null))[_0xee69('0x24')](respondWithResult(_0x15313c,null))['catch'](handleError(_0x15313c,null));};exports[_0xee69('0x4a')]=function(_0x15cb1d,_0x50b6f7){return db[_0xee69('0x2e')][_0xee69('0x4a')](_0x15cb1d['body'],{})[_0xee69('0x24')](function(_0x3955a9){var _0x3c4ccf=_0x15cb1d[_0xee69('0x4b')][_0xee69('0x26')]({'plain':!![]});if(!_0x3c4ccf)throw new Error(_0xee69('0x4c'));if(_0x3c4ccf[_0xee69('0x4d')]==='user'){var _0x18c90d=_0x3955a9['get']({'plain':!![]});var _0x3e4bc0=_0xee69('0x27');return db[_0xee69('0x4e')][_0xee69('0x49')]({'where':{'name':_0x3e4bc0,'userProfileId':_0x3c4ccf[_0xee69('0x4f')]},'raw':!![]})[_0xee69('0x24')](function(_0x19d30c){if(_0x19d30c&&_0x19d30c['autoAssociation']===0x0){return db[_0xee69('0x28')][_0xee69('0x4a')]({'name':_0x18c90d[_0xee69('0x2a')],'resourceId':_0x18c90d['id'],'type':_0x19d30c['name'],'sectionId':_0x19d30c['id']},{})[_0xee69('0x24')](function(){return _0x3955a9;});}else{return _0x3955a9;}})[_0xee69('0x46')](function(_0x123286){logger[_0xee69('0x50')](_0xee69('0x51'),_0x123286);throw _0x123286;});}return _0x3955a9;})[_0xee69('0x24')](respondWithResult(_0x50b6f7,0xc9))[_0xee69('0x46')](handleError(_0x50b6f7,null));};exports[_0xee69('0x52')]=function(_0x17eebf,_0x44237e){if(_0x17eebf['body']['id']){delete _0x17eebf[_0xee69('0x53')]['id'];}return db['AnalyticExtractedReport'][_0xee69('0x49')]({'where':{'id':_0x17eebf['params']['id']}})['then'](handleEntityNotFound(_0x44237e,null))['then'](saveUpdates(_0x17eebf['body'],null))[_0xee69('0x24')](respondWithResult(_0x44237e,null))[_0xee69('0x46')](handleError(_0x44237e,null));};exports[_0xee69('0x25')]=function(_0x587626,_0x254b3e){return db['AnalyticExtractedReport'][_0xee69('0x49')]({'where':{'id':_0x587626[_0xee69('0x54')]['id']}})['then'](handleEntityNotFound(_0x254b3e,null))['then'](removeEntity(_0x254b3e,null))[_0xee69('0x46')](handleError(_0x254b3e,null));};exports[_0xee69('0x55')]=function(_0x344800,_0x1dbdf1,_0x9882c7){return db[_0xee69('0x2e')]['find']({'where':{'id':_0x344800[_0xee69('0x54')]['id']},'attributes':[_0xee69('0x2a'),_0xee69('0x56'),_0xee69('0x57'),_0xee69('0x58')],'raw':!![]})[_0xee69('0x24')](handleEntityNotFound(_0x1dbdf1,null))[_0xee69('0x24')](function(_0x1d6956){if(_0x1d6956){if(!fs[_0xee69('0x59')](path[_0xee69('0x5a')](config['root'],_0xee69('0x5b'),_0x1d6956['savename']))){throw new db['Sequelize']['ValidationError'](_0xee69('0x5c'));}if(_0x344800[_0xee69('0x33')][_0xee69('0x5d')]){return _0x1dbdf1[_0xee69('0x17')](0xc8);}return _0x1dbdf1['download'](path[_0xee69('0x5a')](config['root'],'server/files/reports',_0x1d6956[_0xee69('0x57')]),util['format'](_0xee69('0x5e'),_0x1d6956[_0xee69('0x56')]||_0x1d6956[_0xee69('0x2a')],_0x1d6956[_0xee69('0x58')][_0xee69('0x5f')]()));}})[_0xee69('0x46')](handleError(_0x1dbdf1,null));};
\ No newline at end of file
+var _0x5651=['toLowerCase','rimraf','zip-dir','moment','mustache','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/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','update','then','destroy','ExtractedReports','UserProfileResource','end','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','includeAll','findAll','rows','params','length','include','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','format'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x5651,0x1d2));var _0x1565=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5651[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1565('0x0'));var zipdir=require(_0x1565('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1565('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1565('0x3'));var util=require('util');var path=require(_0x1565('0x4'));var sox=require(_0x1565('0x5'));var csv=require(_0x1565('0x6'));var ejs=require(_0x1565('0x7'));var fs=require('fs');var fs_extra=require(_0x1565('0x8'));var _=require(_0x1565('0x9'));var squel=require(_0x1565('0xa'));var crypto=require(_0x1565('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1565('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1565('0xd'));var Papa=require(_0x1565('0xe'));var Redis=require(_0x1565('0xf'));var authService=require(_0x1565('0x10'));var qs=require(_0x1565('0x11'));var as=require(_0x1565('0x12'));var hardwareService=require(_0x1565('0x13'));var logger=require(_0x1565('0x14'))(_0x1565('0x15'));var utils=require('../../config/utils');var config=require(_0x1565('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1565('0x17'))['db'];function respondWithStatusCode(_0x2b9c99,_0x26da87){_0x26da87=_0x26da87||0xcc;return function(_0x29ec8a){if(_0x29ec8a){return _0x2b9c99[_0x1565('0x18')](_0x26da87);}return _0x2b9c99[_0x1565('0x19')](_0x26da87)['end']();};}function respondWithResult(_0x2f4383,_0x56e5e0){_0x56e5e0=_0x56e5e0||0xc8;return function(_0x5b6256){if(_0x5b6256){return _0x2f4383['status'](_0x56e5e0)[_0x1565('0x1a')](_0x5b6256);}};}function respondWithFilteredResult(_0x4c106e,_0x250e2c){return function(_0x47de24){if(_0x47de24){var _0x336737=typeof _0x250e2c['offset']===_0x1565('0x1b')&&typeof _0x250e2c[_0x1565('0x1c')]===_0x1565('0x1b');var _0x36e110=_0x47de24['count'];var _0x50bfa1=_0x336737?0x0:_0x250e2c[_0x1565('0x1d')];var _0x4a82aa=_0x336737?_0x47de24[_0x1565('0x1e')]:_0x250e2c[_0x1565('0x1d')]+_0x250e2c[_0x1565('0x1c')];var _0x23bf15;if(_0x4a82aa>=_0x36e110){_0x4a82aa=_0x36e110;_0x23bf15=0xc8;}else{_0x23bf15=0xce;}_0x4c106e[_0x1565('0x19')](_0x23bf15);return _0x4c106e[_0x1565('0x1f')]('Content-Range',_0x50bfa1+'-'+_0x4a82aa+'/'+_0x36e110)[_0x1565('0x1a')](_0x47de24);}return null;};}function patchUpdates(_0x279b2d){return function(_0x2f7797){try{jsonpatch[_0x1565('0x20')](_0x2f7797,_0x279b2d,!![]);}catch(_0x45b276){return BPromise[_0x1565('0x21')](_0x45b276);}return _0x2f7797['save']();};}function saveUpdates(_0x480ad3,_0x2da061){return function(_0x410b4c){if(_0x410b4c){return _0x410b4c[_0x1565('0x22')](_0x480ad3)[_0x1565('0x23')](function(_0x3591af){return _0x3591af;});}return null;};}function removeEntity(_0x4f5d9a,_0x302681){return function(_0x5cc509){if(_0x5cc509){return _0x5cc509[_0x1565('0x24')]()[_0x1565('0x23')](function(){var _0x3f44a1=_0x5cc509['get']({'plain':!![]});var _0x325863=_0x1565('0x25');return db[_0x1565('0x26')][_0x1565('0x24')]({'where':{'type':_0x325863,'resourceId':_0x3f44a1['id']}})['then'](function(){return _0x5cc509;});})['then'](function(){_0x4f5d9a['status'](0xcc)[_0x1565('0x27')]();});}};}function handleEntityNotFound(_0x32ebc3,_0x524c3d){return function(_0x5d2f15){if(!_0x5d2f15){_0x32ebc3[_0x1565('0x18')](0x194);}return _0x5d2f15;};}function handleError(_0x15611c,_0x3c2a46){_0x3c2a46=_0x3c2a46||0x1f4;return function(_0x30a5c2){logger[_0x1565('0x28')](_0x30a5c2['stack']);if(_0x30a5c2[_0x1565('0x29')]){delete _0x30a5c2[_0x1565('0x29')];}_0x15611c[_0x1565('0x19')](_0x3c2a46)[_0x1565('0x2a')](_0x30a5c2);};}exports[_0x1565('0x2b')]=function(_0x336835,_0x178a67){var _0x4a32f1={},_0x1ca969={},_0x2543c1={'count':0x0,'rows':[]};var _0x40ec8d=_[_0x1565('0x2c')](db[_0x1565('0x2d')][_0x1565('0x2e')],function(_0x4a69b5){return{'name':_0x4a69b5['fieldName'],'type':_0x4a69b5[_0x1565('0x2f')][_0x1565('0x30')]};});_0x1ca969[_0x1565('0x31')]=_[_0x1565('0x2c')](_0x40ec8d,'name');_0x1ca969[_0x1565('0x32')]=_[_0x1565('0x33')](_0x336835[_0x1565('0x32')]);_0x1ca969[_0x1565('0x34')]=_[_0x1565('0x35')](_0x1ca969['model'],_0x1ca969[_0x1565('0x32')]);_0x4a32f1[_0x1565('0x36')]=_[_0x1565('0x35')](_0x1ca969[_0x1565('0x31')],qs['fields'](_0x336835[_0x1565('0x32')][_0x1565('0x37')]));_0x4a32f1[_0x1565('0x36')]=_0x4a32f1[_0x1565('0x36')]['length']?_0x4a32f1[_0x1565('0x36')]:_0x1ca969[_0x1565('0x31')];if(!_0x336835[_0x1565('0x32')][_0x1565('0x38')](_0x1565('0x39'))){_0x4a32f1[_0x1565('0x1c')]=qs['limit'](_0x336835['query'][_0x1565('0x1c')]);_0x4a32f1['offset']=qs[_0x1565('0x1d')](_0x336835[_0x1565('0x32')][_0x1565('0x1d')]);}_0x4a32f1[_0x1565('0x3a')]=qs[_0x1565('0x3b')](_0x336835['query'][_0x1565('0x3b')]);_0x4a32f1['where']=qs[_0x1565('0x34')](_[_0x1565('0x3c')](_0x336835[_0x1565('0x32')],_0x1ca969[_0x1565('0x34')]),_0x40ec8d);if(_0x336835['query'][_0x1565('0x3d')]){_0x4a32f1[_0x1565('0x3e')]=_['merge'](_0x4a32f1[_0x1565('0x3e')],{'$or':_[_0x1565('0x2c')](_0x40ec8d,function(_0x2811d9){if(_0x2811d9['type']!=='VIRTUAL'){var _0xcc55c4={};_0xcc55c4[_0x2811d9[_0x1565('0x29')]]={'$like':'%'+_0x336835[_0x1565('0x32')][_0x1565('0x3d')]+'%'};return _0xcc55c4;}})});}_0x4a32f1=_['merge']({},_0x4a32f1,_0x336835[_0x1565('0x3f')]);var _0x20dda2={'where':_0x4a32f1['where']};return db['AnalyticExtractedReport'][_0x1565('0x1e')](_0x20dda2)['then'](function(_0x44c342){_0x2543c1['count']=_0x44c342;if(_0x336835[_0x1565('0x32')][_0x1565('0x40')]){_0x4a32f1['include']=[{'all':!![]}];}return db[_0x1565('0x2d')][_0x1565('0x41')](_0x4a32f1);})[_0x1565('0x23')](function(_0x3757c4){_0x2543c1[_0x1565('0x42')]=_0x3757c4;return _0x2543c1;})[_0x1565('0x23')](respondWithFilteredResult(_0x178a67,_0x4a32f1))['catch'](handleError(_0x178a67,null));};exports['show']=function(_0x4e2355,_0x13ebbb){var _0x40a5c9={'raw':!![],'where':{'id':_0x4e2355[_0x1565('0x43')]['id']}},_0x13c610={};_0x13c610[_0x1565('0x31')]=_[_0x1565('0x33')](db[_0x1565('0x2d')]['rawAttributes']);_0x13c610[_0x1565('0x32')]=_[_0x1565('0x33')](_0x4e2355[_0x1565('0x32')]);_0x13c610[_0x1565('0x34')]=_[_0x1565('0x35')](_0x13c610[_0x1565('0x31')],_0x13c610[_0x1565('0x32')]);_0x40a5c9[_0x1565('0x36')]=_[_0x1565('0x35')](_0x13c610[_0x1565('0x31')],qs[_0x1565('0x37')](_0x4e2355['query'][_0x1565('0x37')]));_0x40a5c9['attributes']=_0x40a5c9[_0x1565('0x36')][_0x1565('0x44')]?_0x40a5c9[_0x1565('0x36')]:_0x13c610['model'];if(_0x4e2355[_0x1565('0x32')][_0x1565('0x40')]){_0x40a5c9[_0x1565('0x45')]=[{'all':!![]}];}_0x40a5c9=_[_0x1565('0x46')]({},_0x40a5c9,_0x4e2355[_0x1565('0x3f')]);return db[_0x1565('0x2d')][_0x1565('0x47')](_0x40a5c9)[_0x1565('0x23')](handleEntityNotFound(_0x13ebbb,null))[_0x1565('0x23')](respondWithResult(_0x13ebbb,null))[_0x1565('0x48')](handleError(_0x13ebbb,null));};exports[_0x1565('0x49')]=function(_0x4ed937,_0x5f2e00){return db['AnalyticExtractedReport'][_0x1565('0x49')](_0x4ed937[_0x1565('0x4a')],{})[_0x1565('0x23')](function(_0x49a0f7){var _0x2b14a5=_0x4ed937[_0x1565('0x4b')][_0x1565('0x4c')]({'plain':!![]});if(!_0x2b14a5)throw new Error(_0x1565('0x4d'));if(_0x2b14a5[_0x1565('0x4e')]==='user'){var _0x1cca39=_0x49a0f7[_0x1565('0x4c')]({'plain':!![]});var _0x4e83bf=_0x1565('0x25');return db[_0x1565('0x4f')][_0x1565('0x47')]({'where':{'name':_0x4e83bf,'userProfileId':_0x2b14a5['userProfileId']},'raw':!![]})[_0x1565('0x23')](function(_0xbf9004){if(_0xbf9004&&_0xbf9004['autoAssociation']===0x0){return db[_0x1565('0x26')]['create']({'name':_0x1cca39[_0x1565('0x29')],'resourceId':_0x1cca39['id'],'type':_0xbf9004['name'],'sectionId':_0xbf9004['id']},{})[_0x1565('0x23')](function(){return _0x49a0f7;});}else{return _0x49a0f7;}})[_0x1565('0x48')](function(_0x219a50){logger[_0x1565('0x28')](_0x1565('0x50'),_0x219a50);throw _0x219a50;});}return _0x49a0f7;})[_0x1565('0x23')](respondWithResult(_0x5f2e00,0xc9))['catch'](handleError(_0x5f2e00,null));};exports[_0x1565('0x22')]=function(_0xefba65,_0x35c8c1){if(_0xefba65[_0x1565('0x4a')]['id']){delete _0xefba65[_0x1565('0x4a')]['id'];}return db[_0x1565('0x2d')]['find']({'where':{'id':_0xefba65[_0x1565('0x43')]['id']}})[_0x1565('0x23')](handleEntityNotFound(_0x35c8c1,null))[_0x1565('0x23')](saveUpdates(_0xefba65[_0x1565('0x4a')],null))['then'](respondWithResult(_0x35c8c1,null))[_0x1565('0x48')](handleError(_0x35c8c1,null));};exports['destroy']=function(_0x3ff460,_0x4e1c98){return db[_0x1565('0x2d')][_0x1565('0x47')]({'where':{'id':_0x3ff460[_0x1565('0x43')]['id']}})[_0x1565('0x23')](handleEntityNotFound(_0x4e1c98,null))[_0x1565('0x23')](removeEntity(_0x4e1c98,null))[_0x1565('0x48')](handleError(_0x4e1c98,null));};exports[_0x1565('0x51')]=function(_0x30b8c6,_0x287c3d,_0x562303){return db[_0x1565('0x2d')][_0x1565('0x47')]({'where':{'id':_0x30b8c6['params']['id']},'attributes':[_0x1565('0x29'),_0x1565('0x52'),'savename',_0x1565('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x287c3d,null))['then'](function(_0x41fe84){if(_0x41fe84){if(!fs[_0x1565('0x54')](path[_0x1565('0x55')](config[_0x1565('0x56')],_0x1565('0x57'),_0x41fe84[_0x1565('0x58')]))){throw new db[(_0x1565('0x59'))][(_0x1565('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x30b8c6[_0x1565('0x32')]['exists']){return _0x287c3d['sendStatus'](0xc8);}return _0x287c3d['download'](path['join'](config[_0x1565('0x56')],_0x1565('0x57'),_0x41fe84[_0x1565('0x58')]),util[_0x1565('0x5b')]('%s.%s',_0x41fe84['basename']||_0x41fe84['name'],_0x41fe84[_0x1565('0x53')][_0x1565('0x5c')]()));}})[_0x1565('0x48')](handleError(_0x287c3d,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 994e2bb..8c8280e 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 _0xc2a0=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes'];(function(_0x2d454f,_0x175085){var _0x37aaba=function(_0x2efe84){while(--_0x2efe84){_0x2d454f['push'](_0x2d454f['shift']());}};_0x37aaba(++_0x175085);}(_0xc2a0,0x154));var _0x0c2a=function(_0x9ffba8,_0x3f44ff){_0x9ffba8=_0x9ffba8-0x0;var _0x498ea9=_0xc2a0[_0x9ffba8];return _0x498ea9;};'use strict';var _=require(_0x0c2a('0x0'));var util=require(_0x0c2a('0x1'));var logger=require(_0x0c2a('0x2'))(_0x0c2a('0x3'));var moment=require(_0x0c2a('0x4'));var BPromise=require(_0x0c2a('0x5'));var rp=require(_0x0c2a('0x6'));var fs=require('fs');var path=require(_0x0c2a('0x7'));var rimraf=require(_0x0c2a('0x8'));var config=require('../../config/environment');var attributes=require(_0x0c2a('0x9'));module[_0x0c2a('0xa')]=function(_0x59fc6f,_0x4d0534){return _0x59fc6f[_0x0c2a('0xb')](_0x0c2a('0xc'),attributes,{'tableName':_0x0c2a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x471d=['./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x42ab5c,_0x31aa88){var _0xe24492=function(_0xc2815f){while(--_0xc2815f){_0x42ab5c['push'](_0x42ab5c['shift']());}};_0xe24492(++_0x31aa88);}(_0x471d,0x158));var _0xd471=function(_0x17baf6,_0x119c06){_0x17baf6=_0x17baf6-0x0;var _0x4b2cb3=_0x471d[_0x17baf6];return _0x4b2cb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd471('0x0'))('api');var moment=require(_0xd471('0x1'));var BPromise=require(_0xd471('0x2'));var rp=require(_0xd471('0x3'));var fs=require('fs');var path=require(_0xd471('0x4'));var rimraf=require('rimraf');var config=require(_0xd471('0x5'));var attributes=require(_0xd471('0x6'));module[_0xd471('0x7')]=function(_0x39c303,_0x224906){return _0x39c303[_0xd471('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0xd471('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 c4517c0..1c6af19 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 _0xb067=['code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x34ff1f,_0x2363b2){var _0x26f1fe=function(_0x451812){while(--_0x451812){_0x34ff1f['push'](_0x34ff1f['shift']());}};_0x26f1fe(++_0x2363b2);}(_0xb067,0x13d));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7b06('0x0'));var util=require('util');var moment=require(_0x7b06('0x1'));var BPromise=require(_0x7b06('0x2'));var rs=require(_0x7b06('0x3'));var fs=require('fs');var Redis=require(_0x7b06('0x4'));var db=require(_0x7b06('0x5'))['db'];var utils=require(_0x7b06('0x6'));var logger=require(_0x7b06('0x7'))(_0x7b06('0x8'));var config=require(_0x7b06('0x9'));var jayson=require(_0x7b06('0xa'));var client=jayson[_0x7b06('0xb')][_0x7b06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52f91e,_0x28fcac,_0x2122c6){return new BPromise(function(_0xb1b161,_0x274003){return client[_0x7b06('0xd')](_0x52f91e,_0x2122c6)[_0x7b06('0xe')](function(_0x4e84a4){logger[_0x7b06('0xf')](_0x7b06('0x10'),_0x28fcac,'request\x20sent');logger[_0x7b06('0x11')](_0x7b06('0x12'),_0x28fcac,'request\x20sent',JSON[_0x7b06('0x13')](_0x4e84a4));if(_0x4e84a4[_0x7b06('0x14')]){if(_0x4e84a4[_0x7b06('0x14')][_0x7b06('0x15')]===0x1f4){logger[_0x7b06('0x14')](_0x7b06('0x10'),_0x28fcac,_0x4e84a4[_0x7b06('0x14')]['message']);return _0x274003(_0x4e84a4[_0x7b06('0x14')][_0x7b06('0x16')]);}logger[_0x7b06('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x28fcac,_0x4e84a4[_0x7b06('0x14')][_0x7b06('0x16')]);return _0xb1b161(_0x4e84a4[_0x7b06('0x14')][_0x7b06('0x16')]);}else{logger[_0x7b06('0xf')](_0x7b06('0x10'),_0x28fcac,_0x7b06('0x17'));_0xb1b161(_0x4e84a4[_0x7b06('0x18')][_0x7b06('0x16')]);}})[_0x7b06('0x19')](function(_0x246a58){logger[_0x7b06('0x14')](_0x7b06('0x10'),_0x28fcac,_0x246a58);_0x274003(_0x246a58);});});}
\ No newline at end of file
+var _0x7420=['AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x596f90,_0x499ddb){var _0x1f2e8d=function(_0x551ca5){while(--_0x551ca5){_0x596f90['push'](_0x596f90['shift']());}};_0x1f2e8d(++_0x499ddb);}(_0x7420,0x122));var _0x0742=function(_0x3651d8,_0x4025b0){_0x3651d8=_0x3651d8-0x0;var _0x42aa89=_0x7420[_0x3651d8];return _0x42aa89;};'use strict';var _=require(_0x0742('0x0'));var util=require(_0x0742('0x1'));var moment=require(_0x0742('0x2'));var BPromise=require(_0x0742('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0742('0x4'));var db=require(_0x0742('0x5'))['db'];var utils=require(_0x0742('0x6'));var logger=require(_0x0742('0x7'))('rpc');var config=require(_0x0742('0x8'));var jayson=require(_0x0742('0x9'));var client=jayson[_0x0742('0xa')][_0x0742('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e510,_0x445acc,_0xd7900e){return new BPromise(function(_0x20ad6f,_0x529ab5){return client[_0x0742('0xc')](_0x30e510,_0xd7900e)['then'](function(_0x1c0eb8){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x445acc,'request\x20sent');logger[_0x0742('0xd')](_0x0742('0xe'),_0x445acc,_0x0742('0xf'),JSON[_0x0742('0x10')](_0x1c0eb8));if(_0x1c0eb8[_0x0742('0x11')]){if(_0x1c0eb8['error']['code']===0x1f4){logger[_0x0742('0x11')](_0x0742('0x12'),_0x445acc,_0x1c0eb8['error'][_0x0742('0x13')]);return _0x529ab5(_0x1c0eb8['error']['message']);}logger[_0x0742('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x445acc,_0x1c0eb8[_0x0742('0x11')][_0x0742('0x13')]);return _0x20ad6f(_0x1c0eb8[_0x0742('0x11')]['message']);}else{logger[_0x0742('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x445acc,_0x0742('0xf'));_0x20ad6f(_0x1c0eb8[_0x0742('0x15')][_0x0742('0x13')]);}})['catch'](function(_0x22323f){logger[_0x0742('0x11')](_0x0742('0x12'),_0x445acc,_0x22323f);_0x529ab5(_0x22323f);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a97f2d3..4dc7e04 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 _0x950e=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','isAuthenticated','/:id/download','post','create','/:id','update','destroy','exports','util','path','connect-timeout'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x950e,0x12f));var _0xe950=function(_0x49d931,_0x121258){_0x49d931=_0x49d931-0x0;var _0x491a2a=_0x950e[_0x49d931];return _0x491a2a;};'use strict';var multer=require('multer');var util=require(_0xe950('0x0'));var path=require(_0xe950('0x1'));var timeout=require(_0xe950('0x2'));var express=require('express');var router=express[_0xe950('0x3')]();var fs_extra=require(_0xe950('0x4'));var auth=require(_0xe950('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe950('0x6'));var controller=require(_0xe950('0x7'));router[_0xe950('0x8')]('/',auth['isAuthenticated'](),controller[_0xe950('0x9')]);router[_0xe950('0x8')]('/:id',auth[_0xe950('0xa')](),controller['show']);router[_0xe950('0x8')](_0xe950('0xb'),auth[_0xe950('0xa')](),controller['download']);router[_0xe950('0xc')]('/',auth['isAuthenticated'](),controller[_0xe950('0xd')]);router['put'](_0xe950('0xe'),auth[_0xe950('0xa')](),controller[_0xe950('0xf')]);router['delete'](_0xe950('0xe'),auth[_0xe950('0xa')](),controller[_0xe950('0x10')]);module[_0xe950('0x11')]=router;
\ No newline at end of file
+var _0x405f=['express','../../components/interaction/service','./analyticExtractedReport.controller','get','index','isAuthenticated','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x405f,0x151));var _0xf405=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x405f[_0x38ced4];return _0x547c07;};'use strict';var multer=require(_0xf405('0x0'));var util=require(_0xf405('0x1'));var path=require(_0xf405('0x2'));var timeout=require('connect-timeout');var express=require(_0xf405('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf405('0x4'));var config=require('../../config/environment');var controller=require(_0xf405('0x5'));router[_0xf405('0x6')]('/',auth['isAuthenticated'](),controller[_0xf405('0x7')]);router[_0xf405('0x6')]('/:id',auth[_0xf405('0x8')](),controller[_0xf405('0x9')]);router[_0xf405('0x6')](_0xf405('0xa'),auth[_0xf405('0x8')](),controller[_0xf405('0xb')]);router[_0xf405('0xc')]('/',auth[_0xf405('0x8')](),controller[_0xf405('0xd')]);router[_0xf405('0xe')](_0xf405('0xf'),auth['isAuthenticated'](),controller[_0xf405('0x10')]);router[_0xf405('0x11')](_0xf405('0xf'),auth['isAuthenticated'](),controller[_0xf405('0x12')]);module[_0xf405('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e832162..2ba2ee5 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 _0x39fe=['STRING','BOOLEAN','exports','TEXT'];(function(_0x46cb5d,_0x21c4cd){var _0x23feaf=function(_0x218eba){while(--_0x218eba){_0x46cb5d['push'](_0x46cb5d['shift']());}};_0x23feaf(++_0x21c4cd);}(_0x39fe,0x1ea));var _0xe39f=function(_0x2a3367,_0x25913a){_0x2a3367=_0x2a3367-0x0;var _0x230264=_0x39fe[_0x2a3367];return _0x230264;};'use strict';var Sequelize=require('sequelize');module[_0xe39f('0x0')]={'field':{'type':Sequelize[_0xe39f('0x1')]},'alias':{'type':Sequelize[_0xe39f('0x2')]},'function':{'type':Sequelize[_0xe39f('0x2')]},'format':{'type':Sequelize[_0xe39f('0x2')]},'groupBy':{'type':Sequelize[_0xe39f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xe39f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x933b=['exports','STRING','BOOLEAN','sequelize'];(function(_0xea33fb,_0x55d33a){var _0x4ef04a=function(_0x1ed2af){while(--_0x1ed2af){_0xea33fb['push'](_0xea33fb['shift']());}};_0x4ef04a(++_0x55d33a);}(_0x933b,0x123));var _0xb933=function(_0xe99af0,_0x192f03){_0xe99af0=_0xe99af0-0x0;var _0x3279b5=_0x933b[_0xe99af0];return _0x3279b5;};'use strict';var Sequelize=require(_0xb933('0x0'));module[_0xb933('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb933('0x2')]},'format':{'type':Sequelize[_0xb933('0x2')]},'groupBy':{'type':Sequelize[_0xb933('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb933('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index f3805e8..75f1933 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 _0x5a12=['mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','create','body','bulkCreate','find','params','ids','AnalyticCustomReport','findOne','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xe6f0ec,_0x263b0f){var _0x1beb99=function(_0x5e4bf5){while(--_0x5e4bf5){_0xe6f0ec['push'](_0xe6f0ec['shift']());}};_0x1beb99(++_0x263b0f);}(_0x5a12,0x18a));var _0x25a1=function(_0x19d683,_0x361812){_0x19d683=_0x19d683-0x0;var _0x52d1f9=_0x5a12[_0x19d683];return _0x52d1f9;};'use strict';var emlformat=require(_0x25a1('0x0'));var rimraf=require(_0x25a1('0x1'));var zipdir=require(_0x25a1('0x2'));var jsonpatch=require(_0x25a1('0x3'));var rp=require(_0x25a1('0x4'));var moment=require(_0x25a1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x25a1('0x6'));var util=require(_0x25a1('0x7'));var path=require(_0x25a1('0x8'));var sox=require('sox');var csv=require(_0x25a1('0x9'));var ejs=require(_0x25a1('0xa'));var fs=require('fs');var fs_extra=require(_0x25a1('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x25a1('0xc'));var jsforce=require(_0x25a1('0xd'));var deskjs=require(_0x25a1('0xe'));var toCsv=require(_0x25a1('0x9'));var querystring=require(_0x25a1('0xf'));var Papa=require('papaparse');var Redis=require(_0x25a1('0x10'));var authService=require(_0x25a1('0x11'));var qs=require(_0x25a1('0x12'));var as=require(_0x25a1('0x13'));var hardwareService=require(_0x25a1('0x14'));var logger=require(_0x25a1('0x15'))('api');var utils=require(_0x25a1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x25a1('0x17'));var db=require(_0x25a1('0x18'))['db'];function respondWithStatusCode(_0x9fe551,_0x3cdb51){_0x3cdb51=_0x3cdb51||0xcc;return function(_0xbed503){if(_0xbed503){return _0x9fe551[_0x25a1('0x19')](_0x3cdb51);}return _0x9fe551['status'](_0x3cdb51)[_0x25a1('0x1a')]();};}function respondWithResult(_0x4cda30,_0x28b081){_0x28b081=_0x28b081||0xc8;return function(_0x52c0aa){if(_0x52c0aa){return _0x4cda30[_0x25a1('0x1b')](_0x28b081)[_0x25a1('0x1c')](_0x52c0aa);}};}function respondWithFilteredResult(_0x272234,_0x4c8f8f){return function(_0xe41df5){if(_0xe41df5){var _0x127d98=typeof _0x4c8f8f['offset']===_0x25a1('0x1d')&&typeof _0x4c8f8f[_0x25a1('0x1e')]===_0x25a1('0x1d');var _0x38814e=_0xe41df5['count'];var _0xb06ff9=_0x127d98?0x0:_0x4c8f8f[_0x25a1('0x1f')];var _0x2ab84c=_0x127d98?_0xe41df5[_0x25a1('0x20')]:_0x4c8f8f[_0x25a1('0x1f')]+_0x4c8f8f[_0x25a1('0x1e')];var _0x27b133;if(_0x2ab84c>=_0x38814e){_0x2ab84c=_0x38814e;_0x27b133=0xc8;}else{_0x27b133=0xce;}_0x272234['status'](_0x27b133);return _0x272234[_0x25a1('0x21')](_0x25a1('0x22'),_0xb06ff9+'-'+_0x2ab84c+'/'+_0x38814e)[_0x25a1('0x1c')](_0xe41df5);}return null;};}function patchUpdates(_0x42b586){return function(_0x15d8c5){try{jsonpatch[_0x25a1('0x23')](_0x15d8c5,_0x42b586,!![]);}catch(_0x49318a){return BPromise[_0x25a1('0x24')](_0x49318a);}return _0x15d8c5['save']();};}function saveUpdates(_0x1fbb0a,_0x26860d){return function(_0x70e9fc){if(_0x70e9fc){return _0x70e9fc[_0x25a1('0x25')](_0x1fbb0a)['then'](function(_0x503037){return _0x503037;});}return null;};}function removeEntity(_0x49e8e5,_0x1d10aa){return function(_0x77d166){if(_0x77d166){return _0x77d166[_0x25a1('0x26')]()[_0x25a1('0x27')](function(){_0x49e8e5[_0x25a1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58849a,_0x25ad34){return function(_0x3eddd4){if(!_0x3eddd4){_0x58849a['sendStatus'](0x194);}return _0x3eddd4;};}function handleError(_0x2c7e83,_0x2432bf){_0x2432bf=_0x2432bf||0x1f4;return function(_0x9d2b2f){logger[_0x25a1('0x28')](_0x9d2b2f[_0x25a1('0x29')]);if(_0x9d2b2f[_0x25a1('0x2a')]){delete _0x9d2b2f['name'];}_0x2c7e83[_0x25a1('0x1b')](_0x2432bf)['send'](_0x9d2b2f);};}exports[_0x25a1('0x2b')]=function(_0x149f16,_0x19448e){var _0x5c7839={},_0x56fa1b={},_0x2e1132={'count':0x0,'rows':[]};var _0x52d015=_[_0x25a1('0x2c')](db[_0x25a1('0x2d')][_0x25a1('0x2e')],function(_0xb933b5){return{'name':_0xb933b5[_0x25a1('0x2f')],'type':_0xb933b5[_0x25a1('0x30')][_0x25a1('0x31')]};});_0x56fa1b[_0x25a1('0x32')]=_[_0x25a1('0x2c')](_0x52d015,'name');_0x56fa1b['query']=_[_0x25a1('0x33')](_0x149f16[_0x25a1('0x34')]);_0x56fa1b[_0x25a1('0x35')]=_[_0x25a1('0x36')](_0x56fa1b['model'],_0x56fa1b[_0x25a1('0x34')]);_0x5c7839['attributes']=_[_0x25a1('0x36')](_0x56fa1b['model'],qs['fields'](_0x149f16[_0x25a1('0x34')][_0x25a1('0x37')]));_0x5c7839[_0x25a1('0x38')]=_0x5c7839['attributes'][_0x25a1('0x39')]?_0x5c7839[_0x25a1('0x38')]:_0x56fa1b[_0x25a1('0x32')];if(!_0x149f16['query'][_0x25a1('0x3a')](_0x25a1('0x3b'))){_0x5c7839[_0x25a1('0x1e')]=qs[_0x25a1('0x1e')](_0x149f16[_0x25a1('0x34')][_0x25a1('0x1e')]);_0x5c7839[_0x25a1('0x1f')]=qs[_0x25a1('0x1f')](_0x149f16[_0x25a1('0x34')][_0x25a1('0x1f')]);}_0x5c7839['order']=qs['sort'](_0x149f16[_0x25a1('0x34')][_0x25a1('0x3c')]);_0x5c7839[_0x25a1('0x3d')]=qs[_0x25a1('0x35')](_[_0x25a1('0x3e')](_0x149f16[_0x25a1('0x34')],_0x56fa1b[_0x25a1('0x35')]),_0x52d015);if(_0x149f16[_0x25a1('0x34')][_0x25a1('0x3f')]){_0x5c7839['where']=_['merge'](_0x5c7839[_0x25a1('0x3d')],{'$or':_[_0x25a1('0x2c')](_0x52d015,function(_0x3281c4){if(_0x3281c4['type']!==_0x25a1('0x40')){var _0x208429={};_0x208429[_0x3281c4[_0x25a1('0x2a')]]={'$like':'%'+_0x149f16[_0x25a1('0x34')]['filter']+'%'};return _0x208429;}})});}_0x5c7839=_[_0x25a1('0x41')]({},_0x5c7839,_0x149f16[_0x25a1('0x42')]);var _0x15882d={'where':_0x5c7839[_0x25a1('0x3d')]};return db[_0x25a1('0x2d')][_0x25a1('0x20')](_0x15882d)[_0x25a1('0x27')](function(_0x2647c0){_0x2e1132[_0x25a1('0x20')]=_0x2647c0;if(_0x149f16[_0x25a1('0x34')]['includeAll']){_0x5c7839[_0x25a1('0x43')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x25a1('0x44')](_0x5c7839);})[_0x25a1('0x27')](function(_0x11b4bc){_0x2e1132[_0x25a1('0x45')]=_0x11b4bc;return _0x2e1132;})['then'](respondWithFilteredResult(_0x19448e,_0x5c7839))[_0x25a1('0x46')](handleError(_0x19448e,null));};exports['show']=function(_0x3a6431,_0x4a6e46){var _0x31fee1={'raw':![],'where':{'id':_0x3a6431['params']['id']}},_0x97e1e2={};_0x97e1e2[_0x25a1('0x32')]=_[_0x25a1('0x33')](db[_0x25a1('0x2d')][_0x25a1('0x2e')]);_0x97e1e2[_0x25a1('0x34')]=_[_0x25a1('0x33')](_0x3a6431[_0x25a1('0x34')]);_0x97e1e2[_0x25a1('0x35')]=_[_0x25a1('0x36')](_0x97e1e2[_0x25a1('0x32')],_0x97e1e2['query']);_0x31fee1[_0x25a1('0x38')]=_[_0x25a1('0x36')](_0x97e1e2[_0x25a1('0x32')],qs['fields'](_0x3a6431['query'][_0x25a1('0x37')]));_0x31fee1[_0x25a1('0x38')]=_0x31fee1[_0x25a1('0x38')][_0x25a1('0x39')]?_0x31fee1[_0x25a1('0x38')]:_0x97e1e2[_0x25a1('0x32')];if(_0x3a6431[_0x25a1('0x34')]['includeAll']){_0x31fee1[_0x25a1('0x43')]=[{'all':!![]}];}_0x31fee1=_['merge']({},_0x31fee1,_0x3a6431[_0x25a1('0x42')]);return db[_0x25a1('0x2d')]['find'](_0x31fee1)[_0x25a1('0x27')](handleEntityNotFound(_0x4a6e46,null))[_0x25a1('0x27')](respondWithResult(_0x4a6e46,null))[_0x25a1('0x46')](handleError(_0x4a6e46,null));};exports[_0x25a1('0x47')]=function(_0x41b598,_0x42b4ec){return db['AnalyticFieldReport'][_0x25a1('0x47')](_0x41b598[_0x25a1('0x48')],{})['then'](respondWithResult(_0x42b4ec,0xc9))[_0x25a1('0x46')](handleError(_0x42b4ec,null));};exports[_0x25a1('0x49')]=function(_0x542fee,_0x248242){return db[_0x25a1('0x2d')]['bulkCreate'](_0x542fee['body'],{'raw':![],'individualHooks':!![]})[_0x25a1('0x27')](respondWithResult(_0x248242,0xc9))[_0x25a1('0x46')](handleError(_0x248242,null));};exports[_0x25a1('0x25')]=function(_0x17625d,_0x3ab5c5){if(_0x17625d[_0x25a1('0x48')]['id']){delete _0x17625d[_0x25a1('0x48')]['id'];}return db[_0x25a1('0x2d')][_0x25a1('0x4a')]({'where':{'id':_0x17625d[_0x25a1('0x4b')]['id']}})[_0x25a1('0x27')](handleEntityNotFound(_0x3ab5c5,null))[_0x25a1('0x27')](saveUpdates(_0x17625d[_0x25a1('0x48')],null))[_0x25a1('0x27')](respondWithResult(_0x3ab5c5,null))['catch'](handleError(_0x3ab5c5,null));};exports[_0x25a1('0x26')]=function(_0x836293,_0x4adf09){return db['AnalyticFieldReport']['find']({'where':{'id':_0x836293['params']['id']}})[_0x25a1('0x27')](handleEntityNotFound(_0x4adf09,null))[_0x25a1('0x27')](removeEntity(_0x4adf09,null))[_0x25a1('0x46')](handleError(_0x4adf09,null));};exports['bulkDestroy']=function(_0x4f160f,_0x54defe){return db[_0x25a1('0x2d')]['destroy']({'where':{'id':_0x4f160f[_0x25a1('0x34')][_0x25a1('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x25a1('0x27')](respondWithResult(_0x54defe,0xcc))['catch'](handleError(_0x54defe,null));};exports['addFields']=function(_0x9655d4,_0x14c129,_0x496e6e){return db[_0x25a1('0x4d')][_0x25a1('0x4e')]({'where':{'id':_0x9655d4['params']['id']}})[_0x25a1('0x27')](handleEntityNotFound(_0x14c129,null))[_0x25a1('0x27')](function(_0x56c82c){if(_0x56c82c){return db['sequelize']['transaction'](function(_0x2a3c0f){return db[_0x25a1('0x2d')]['destroy']({'where':{'CustomReportId':_0x9655d4[_0x25a1('0x4b')]['id']},'transaction':_0x2a3c0f})[_0x25a1('0x27')](function(_0x146534){var _0x19048a=_['map'](_0x9655d4[_0x25a1('0x48')],function(_0x5a2b43){delete _0x5a2b43['id'];_0x5a2b43[_0x25a1('0x4f')]=_0x9655d4[_0x25a1('0x4b')]['id'];return _0x5a2b43;});return db['AnalyticFieldReport']['bulkCreate'](_0x19048a,{'transaction':_0x2a3c0f});});})[_0x25a1('0x27')](function(){return db[_0x25a1('0x2d')][_0x25a1('0x44')]({'where':{'CustomReportId':_0x9655d4[_0x25a1('0x4b')]['id']}});});}})[_0x25a1('0x27')](respondWithResult(_0x14c129,null))[_0x25a1('0x46')](handleError(_0x14c129,null));};
\ No newline at end of file
+var _0xab62=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','findAll','rows','catch','show','include','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x1f0e25,_0x1dc15d){var _0x4810e6=function(_0x193327){while(--_0x193327){_0x1f0e25['push'](_0x1f0e25['shift']());}};_0x4810e6(++_0x1dc15d);}(_0xab62,0xdf));var _0x2ab6=function(_0x22e108,_0x534a11){_0x22e108=_0x22e108-0x0;var _0x2fd054=_0xab62[_0x22e108];return _0x2fd054;};'use strict';var emlformat=require(_0x2ab6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ab6('0x1'));var rp=require('request-promise');var moment=require(_0x2ab6('0x2'));var BPromise=require(_0x2ab6('0x3'));var Mustache=require(_0x2ab6('0x4'));var util=require(_0x2ab6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2ab6('0x6'));var ejs=require(_0x2ab6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2ab6('0x8'));var crypto=require(_0x2ab6('0x9'));var jsforce=require(_0x2ab6('0xa'));var deskjs=require(_0x2ab6('0xb'));var toCsv=require(_0x2ab6('0x6'));var querystring=require(_0x2ab6('0xc'));var Papa=require('papaparse');var Redis=require(_0x2ab6('0xd'));var authService=require(_0x2ab6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2ab6('0xf'));var hardwareService=require(_0x2ab6('0x10'));var logger=require(_0x2ab6('0x11'))(_0x2ab6('0x12'));var utils=require('../../config/utils');var config=require(_0x2ab6('0x13'));var licenseUtil=require(_0x2ab6('0x14'));var db=require(_0x2ab6('0x15'))['db'];function respondWithStatusCode(_0x48ed90,_0x1dc417){_0x1dc417=_0x1dc417||0xcc;return function(_0x352663){if(_0x352663){return _0x48ed90[_0x2ab6('0x16')](_0x1dc417);}return _0x48ed90[_0x2ab6('0x17')](_0x1dc417)['end']();};}function respondWithResult(_0x41b432,_0x4c5210){_0x4c5210=_0x4c5210||0xc8;return function(_0x9e4c2d){if(_0x9e4c2d){return _0x41b432[_0x2ab6('0x17')](_0x4c5210)[_0x2ab6('0x18')](_0x9e4c2d);}};}function respondWithFilteredResult(_0x38a3b1,_0x14508b){return function(_0x3bf8b1){if(_0x3bf8b1){var _0x57b011=typeof _0x14508b['offset']==='undefined'&&typeof _0x14508b['limit']===_0x2ab6('0x19');var _0x6fb55=_0x3bf8b1[_0x2ab6('0x1a')];var _0x5e493f=_0x57b011?0x0:_0x14508b['offset'];var _0x30529c=_0x57b011?_0x3bf8b1[_0x2ab6('0x1a')]:_0x14508b[_0x2ab6('0x1b')]+_0x14508b['limit'];var _0x125f04;if(_0x30529c>=_0x6fb55){_0x30529c=_0x6fb55;_0x125f04=0xc8;}else{_0x125f04=0xce;}_0x38a3b1[_0x2ab6('0x17')](_0x125f04);return _0x38a3b1['set'](_0x2ab6('0x1c'),_0x5e493f+'-'+_0x30529c+'/'+_0x6fb55)[_0x2ab6('0x18')](_0x3bf8b1);}return null;};}function patchUpdates(_0x317aed){return function(_0x118069){try{jsonpatch['apply'](_0x118069,_0x317aed,!![]);}catch(_0x5a15a9){return BPromise[_0x2ab6('0x1d')](_0x5a15a9);}return _0x118069[_0x2ab6('0x1e')]();};}function saveUpdates(_0x4baecd,_0x2323e0){return function(_0x499b9e){if(_0x499b9e){return _0x499b9e[_0x2ab6('0x1f')](_0x4baecd)[_0x2ab6('0x20')](function(_0x52a7d6){return _0x52a7d6;});}return null;};}function removeEntity(_0xd28798,_0x580c68){return function(_0xa1d17c){if(_0xa1d17c){return _0xa1d17c[_0x2ab6('0x21')]()['then'](function(){_0xd28798[_0x2ab6('0x17')](0xcc)[_0x2ab6('0x22')]();});}};}function handleEntityNotFound(_0x37872d,_0x33a0d8){return function(_0x4a00a0){if(!_0x4a00a0){_0x37872d[_0x2ab6('0x16')](0x194);}return _0x4a00a0;};}function handleError(_0x108d25,_0x45d2fc){_0x45d2fc=_0x45d2fc||0x1f4;return function(_0x4cdacf){logger[_0x2ab6('0x23')](_0x4cdacf[_0x2ab6('0x24')]);if(_0x4cdacf[_0x2ab6('0x25')]){delete _0x4cdacf[_0x2ab6('0x25')];}_0x108d25[_0x2ab6('0x17')](_0x45d2fc)[_0x2ab6('0x26')](_0x4cdacf);};}exports[_0x2ab6('0x27')]=function(_0x4fb1ed,_0x48359a){var _0x2a491f={},_0x8e389c={},_0x4c7267={'count':0x0,'rows':[]};var _0x59dc14=_['map'](db['AnalyticFieldReport'][_0x2ab6('0x28')],function(_0x205460){return{'name':_0x205460[_0x2ab6('0x29')],'type':_0x205460[_0x2ab6('0x2a')]['key']};});_0x8e389c[_0x2ab6('0x2b')]=_[_0x2ab6('0x2c')](_0x59dc14,_0x2ab6('0x25'));_0x8e389c[_0x2ab6('0x2d')]=_[_0x2ab6('0x2e')](_0x4fb1ed[_0x2ab6('0x2d')]);_0x8e389c['filters']=_[_0x2ab6('0x2f')](_0x8e389c['model'],_0x8e389c['query']);_0x2a491f[_0x2ab6('0x30')]=_[_0x2ab6('0x2f')](_0x8e389c['model'],qs[_0x2ab6('0x31')](_0x4fb1ed[_0x2ab6('0x2d')][_0x2ab6('0x31')]));_0x2a491f[_0x2ab6('0x30')]=_0x2a491f[_0x2ab6('0x30')][_0x2ab6('0x32')]?_0x2a491f[_0x2ab6('0x30')]:_0x8e389c['model'];if(!_0x4fb1ed[_0x2ab6('0x2d')][_0x2ab6('0x33')]('nolimit')){_0x2a491f[_0x2ab6('0x34')]=qs['limit'](_0x4fb1ed['query'][_0x2ab6('0x34')]);_0x2a491f[_0x2ab6('0x1b')]=qs[_0x2ab6('0x1b')](_0x4fb1ed[_0x2ab6('0x2d')]['offset']);}_0x2a491f[_0x2ab6('0x35')]=qs[_0x2ab6('0x36')](_0x4fb1ed[_0x2ab6('0x2d')][_0x2ab6('0x36')]);_0x2a491f[_0x2ab6('0x37')]=qs[_0x2ab6('0x38')](_[_0x2ab6('0x39')](_0x4fb1ed[_0x2ab6('0x2d')],_0x8e389c[_0x2ab6('0x38')]),_0x59dc14);if(_0x4fb1ed['query'][_0x2ab6('0x3a')]){_0x2a491f[_0x2ab6('0x37')]=_['merge'](_0x2a491f['where'],{'$or':_[_0x2ab6('0x2c')](_0x59dc14,function(_0x38d0a2){if(_0x38d0a2[_0x2ab6('0x2a')]!==_0x2ab6('0x3b')){var _0x46cee3={};_0x46cee3[_0x38d0a2[_0x2ab6('0x25')]]={'$like':'%'+_0x4fb1ed['query'][_0x2ab6('0x3a')]+'%'};return _0x46cee3;}})});}_0x2a491f=_[_0x2ab6('0x3c')]({},_0x2a491f,_0x4fb1ed[_0x2ab6('0x3d')]);var _0x38d5e4={'where':_0x2a491f['where']};return db[_0x2ab6('0x3e')]['count'](_0x38d5e4)['then'](function(_0x3692fd){_0x4c7267['count']=_0x3692fd;if(_0x4fb1ed[_0x2ab6('0x2d')][_0x2ab6('0x3f')]){_0x2a491f['include']=[{'all':!![]}];}return db[_0x2ab6('0x3e')][_0x2ab6('0x40')](_0x2a491f);})[_0x2ab6('0x20')](function(_0x3ff220){_0x4c7267[_0x2ab6('0x41')]=_0x3ff220;return _0x4c7267;})[_0x2ab6('0x20')](respondWithFilteredResult(_0x48359a,_0x2a491f))[_0x2ab6('0x42')](handleError(_0x48359a,null));};exports[_0x2ab6('0x43')]=function(_0x3d92ff,_0x2ac5f6){var _0x3e1329={'raw':![],'where':{'id':_0x3d92ff['params']['id']}},_0x390939={};_0x390939[_0x2ab6('0x2b')]=_[_0x2ab6('0x2e')](db['AnalyticFieldReport']['rawAttributes']);_0x390939[_0x2ab6('0x2d')]=_[_0x2ab6('0x2e')](_0x3d92ff[_0x2ab6('0x2d')]);_0x390939[_0x2ab6('0x38')]=_['intersection'](_0x390939[_0x2ab6('0x2b')],_0x390939[_0x2ab6('0x2d')]);_0x3e1329[_0x2ab6('0x30')]=_[_0x2ab6('0x2f')](_0x390939[_0x2ab6('0x2b')],qs['fields'](_0x3d92ff[_0x2ab6('0x2d')][_0x2ab6('0x31')]));_0x3e1329[_0x2ab6('0x30')]=_0x3e1329['attributes'][_0x2ab6('0x32')]?_0x3e1329[_0x2ab6('0x30')]:_0x390939[_0x2ab6('0x2b')];if(_0x3d92ff['query']['includeAll']){_0x3e1329[_0x2ab6('0x44')]=[{'all':!![]}];}_0x3e1329=_[_0x2ab6('0x3c')]({},_0x3e1329,_0x3d92ff[_0x2ab6('0x3d')]);return db[_0x2ab6('0x3e')][_0x2ab6('0x45')](_0x3e1329)[_0x2ab6('0x20')](handleEntityNotFound(_0x2ac5f6,null))[_0x2ab6('0x20')](respondWithResult(_0x2ac5f6,null))['catch'](handleError(_0x2ac5f6,null));};exports['create']=function(_0x2657e5,_0x12e75c){return db[_0x2ab6('0x3e')][_0x2ab6('0x46')](_0x2657e5[_0x2ab6('0x47')],{})[_0x2ab6('0x20')](respondWithResult(_0x12e75c,0xc9))[_0x2ab6('0x42')](handleError(_0x12e75c,null));};exports['bulkCreate']=function(_0x3d0189,_0x3a22c9){return db[_0x2ab6('0x3e')][_0x2ab6('0x48')](_0x3d0189[_0x2ab6('0x47')],{'raw':![],'individualHooks':!![]})[_0x2ab6('0x20')](respondWithResult(_0x3a22c9,0xc9))[_0x2ab6('0x42')](handleError(_0x3a22c9,null));};exports[_0x2ab6('0x1f')]=function(_0x5e5f88,_0x47e96c){if(_0x5e5f88['body']['id']){delete _0x5e5f88[_0x2ab6('0x47')]['id'];}return db[_0x2ab6('0x3e')][_0x2ab6('0x45')]({'where':{'id':_0x5e5f88[_0x2ab6('0x49')]['id']}})[_0x2ab6('0x20')](handleEntityNotFound(_0x47e96c,null))[_0x2ab6('0x20')](saveUpdates(_0x5e5f88['body'],null))[_0x2ab6('0x20')](respondWithResult(_0x47e96c,null))[_0x2ab6('0x42')](handleError(_0x47e96c,null));};exports[_0x2ab6('0x21')]=function(_0x1a63ec,_0x5c60f0){return db[_0x2ab6('0x3e')][_0x2ab6('0x45')]({'where':{'id':_0x1a63ec[_0x2ab6('0x49')]['id']}})[_0x2ab6('0x20')](handleEntityNotFound(_0x5c60f0,null))[_0x2ab6('0x20')](removeEntity(_0x5c60f0,null))[_0x2ab6('0x42')](handleError(_0x5c60f0,null));};exports[_0x2ab6('0x4a')]=function(_0x315de6,_0x3e871d){return db['AnalyticFieldReport'][_0x2ab6('0x21')]({'where':{'id':_0x315de6[_0x2ab6('0x2d')][_0x2ab6('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x2ab6('0x20')](respondWithResult(_0x3e871d,0xcc))[_0x2ab6('0x42')](handleError(_0x3e871d,null));};exports[_0x2ab6('0x4c')]=function(_0x2518d4,_0x282d1f,_0x589e28){return db[_0x2ab6('0x4d')][_0x2ab6('0x4e')]({'where':{'id':_0x2518d4[_0x2ab6('0x49')]['id']}})['then'](handleEntityNotFound(_0x282d1f,null))['then'](function(_0x2d7593){if(_0x2d7593){return db['sequelize'][_0x2ab6('0x4f')](function(_0x312f18){return db[_0x2ab6('0x3e')][_0x2ab6('0x21')]({'where':{'CustomReportId':_0x2518d4['params']['id']},'transaction':_0x312f18})['then'](function(_0x2d72e4){var _0x4ddd11=_['map'](_0x2518d4[_0x2ab6('0x47')],function(_0x1f6477){delete _0x1f6477['id'];_0x1f6477[_0x2ab6('0x50')]=_0x2518d4['params']['id'];return _0x1f6477;});return db[_0x2ab6('0x3e')][_0x2ab6('0x48')](_0x4ddd11,{'transaction':_0x312f18});});})[_0x2ab6('0x20')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x2518d4[_0x2ab6('0x49')]['id']}});});}})[_0x2ab6('0x20')](respondWithResult(_0x282d1f,null))[_0x2ab6('0x42')](handleError(_0x282d1f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 8064b6c..ca96e49 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 _0xd344=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x31dbed,_0x47b167){var _0x54148b=function(_0x6ac029){while(--_0x6ac029){_0x31dbed['push'](_0x31dbed['shift']());}};_0x54148b(++_0x47b167);}(_0xd344,0x8f));var _0x4d34=function(_0x53a492,_0x119555){_0x53a492=_0x53a492-0x0;var _0x91feff=_0xd344[_0x53a492];return _0x91feff;};'use strict';var _=require(_0x4d34('0x0'));var util=require('util');var logger=require(_0x4d34('0x1'))(_0x4d34('0x2'));var moment=require('moment');var BPromise=require(_0x4d34('0x3'));var rp=require(_0x4d34('0x4'));var fs=require('fs');var path=require(_0x4d34('0x5'));var rimraf=require('rimraf');var config=require(_0x4d34('0x6'));var attributes=require(_0x4d34('0x7'));module[_0x4d34('0x8')]=function(_0x4ac066,_0x5ef3e4){return _0x4ac066[_0x4d34('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x4d34('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4852=['define','../../config/logger','bluebird','path','exports'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x4852,0xce));var _0x2485=function(_0x22e8cd,_0x258ced){_0x22e8cd=_0x22e8cd-0x0;var _0x236c4d=_0x4852[_0x22e8cd];return _0x236c4d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2485('0x0'))('api');var moment=require('moment');var BPromise=require(_0x2485('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2485('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x2485('0x3')]=function(_0x50f5e3,_0x137983){return _0x50f5e3[_0x2485('0x4')]('AnalyticFieldReport',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 185b26f..205b765 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 _0x01bb=['message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x557b11,_0x38f8d9){var _0x3ce335=function(_0x36ae4a){while(--_0x36ae4a){_0x557b11['push'](_0x557b11['shift']());}};_0x3ce335(++_0x38f8d9);}(_0x01bb,0xf2));var _0xb01b=function(_0x58b7ac,_0xab25f9){_0x58b7ac=_0x58b7ac-0x0;var _0x4382ee=_0x01bb[_0x58b7ac];return _0x4382ee;};'use strict';var _=require(_0xb01b('0x0'));var util=require('util');var moment=require(_0xb01b('0x1'));var BPromise=require(_0xb01b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb01b('0x3'));var db=require(_0xb01b('0x4'))['db'];var utils=require(_0xb01b('0x5'));var logger=require(_0xb01b('0x6'))(_0xb01b('0x7'));var config=require(_0xb01b('0x8'));var jayson=require(_0xb01b('0x9'));var client=jayson[_0xb01b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x400d0b,_0x213f60,_0x587d69){return new BPromise(function(_0x495c14,_0x2bf003){return client[_0xb01b('0xb')](_0x400d0b,_0x587d69)[_0xb01b('0xc')](function(_0x20ead8){logger['info'](_0xb01b('0xd'),_0x213f60,_0xb01b('0xe'));logger['debug'](_0xb01b('0xf'),_0x213f60,_0xb01b('0xe'),JSON[_0xb01b('0x10')](_0x20ead8));if(_0x20ead8['error']){if(_0x20ead8['error']['code']===0x1f4){logger[_0xb01b('0x11')](_0xb01b('0xd'),_0x213f60,_0x20ead8[_0xb01b('0x11')][_0xb01b('0x12')]);return _0x2bf003(_0x20ead8[_0xb01b('0x11')][_0xb01b('0x12')]);}logger[_0xb01b('0x11')](_0xb01b('0xd'),_0x213f60,_0x20ead8['error'][_0xb01b('0x12')]);return _0x495c14(_0x20ead8[_0xb01b('0x11')][_0xb01b('0x12')]);}else{logger['info'](_0xb01b('0xd'),_0x213f60,'request\x20sent');_0x495c14(_0x20ead8['result'][_0xb01b('0x12')]);}})[_0xb01b('0x13')](function(_0xfc83f0){logger[_0xb01b('0x11')](_0xb01b('0xd'),_0x213f60,_0xfc83f0);_0x2bf003(_0xfc83f0);});});}
\ No newline at end of file
+var _0xa1b3=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x598efc,_0x5e971c){var _0x435e4f=function(_0x3e0596){while(--_0x3e0596){_0x598efc['push'](_0x598efc['shift']());}};_0x435e4f(++_0x5e971c);}(_0xa1b3,0x6c));var _0x3a1b=function(_0x1a9586,_0x4797da){_0x1a9586=_0x1a9586-0x0;var _0x36333b=_0xa1b3[_0x1a9586];return _0x36333b;};'use strict';var _=require(_0x3a1b('0x0'));var util=require(_0x3a1b('0x1'));var moment=require(_0x3a1b('0x2'));var BPromise=require('bluebird');var rs=require(_0x3a1b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a1b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a1b('0x5'))('rpc');var config=require(_0x3a1b('0x6'));var jayson=require(_0x3a1b('0x7'));var client=jayson[_0x3a1b('0x8')][_0x3a1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x416ddf,_0x1d50ac,_0x15cc73){return new BPromise(function(_0x579012,_0x47506c){return client[_0x3a1b('0xa')](_0x416ddf,_0x15cc73)[_0x3a1b('0xb')](function(_0x25b246){logger[_0x3a1b('0xc')](_0x3a1b('0xd'),_0x1d50ac,_0x3a1b('0xe'));logger[_0x3a1b('0xf')](_0x3a1b('0x10'),_0x1d50ac,'request\x20sent',JSON['stringify'](_0x25b246));if(_0x25b246['error']){if(_0x25b246[_0x3a1b('0x11')]['code']===0x1f4){logger[_0x3a1b('0x11')](_0x3a1b('0xd'),_0x1d50ac,_0x25b246[_0x3a1b('0x11')]['message']);return _0x47506c(_0x25b246['error'][_0x3a1b('0x12')]);}logger[_0x3a1b('0x11')](_0x3a1b('0xd'),_0x1d50ac,_0x25b246[_0x3a1b('0x11')][_0x3a1b('0x12')]);return _0x579012(_0x25b246[_0x3a1b('0x11')][_0x3a1b('0x12')]);}else{logger['info'](_0x3a1b('0xd'),_0x1d50ac,_0x3a1b('0xe'));_0x579012(_0x25b246[_0x3a1b('0x13')]['message']);}})[_0x3a1b('0x14')](function(_0xd35cab){logger[_0x3a1b('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1d50ac,_0xd35cab);_0x47506c(_0xd35cab);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 10b52ed..60fad13 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(_0xa7d350,_0x1f40ba){var _0x31008b=function(_0x5070ac){while(--_0x5070ac){_0xa7d350['push'](_0xa7d350['shift']());}};_0x31008b(++_0x1f40ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x194adf,_0x220258){var _0x2242e3=function(_0x42afcd){while(--_0x42afcd){_0x194adf['push'](_0x194adf['shift']());}};_0x2242e3(++_0x220258);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 5e1d663..91e0bab 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 _0x8cc8=['sequelize','exports','STRING','name','TEXT'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8cc8,0x177));var _0x88cc=function(_0x2ec413,_0x19d47f){_0x2ec413=_0x2ec413-0x0;var _0x485d5b=_0x8cc8[_0x2ec413];return _0x485d5b;};'use strict';var Sequelize=require(_0x88cc('0x0'));module[_0x88cc('0x1')]={'name':{'type':Sequelize[_0x88cc('0x2')],'allowNull':![],'unique':_0x88cc('0x3')},'table':{'type':Sequelize[_0x88cc('0x2')]},'metric':{'type':Sequelize[_0x88cc('0x4')]},'description':{'type':Sequelize[_0x88cc('0x2')]}};
\ No newline at end of file
+var _0xab23=['exports','STRING','name','TEXT','sequelize'];(function(_0x591c2b,_0x234b79){var _0x354fea=function(_0x594c4f){while(--_0x594c4f){_0x591c2b['push'](_0x591c2b['shift']());}};_0x354fea(++_0x234b79);}(_0xab23,0x1bc));var _0x3ab2=function(_0x9e17a3,_0x378dd4){_0x9e17a3=_0x9e17a3-0x0;var _0x2d877a=_0xab23[_0x9e17a3];return _0x2d877a;};'use strict';var Sequelize=require(_0x3ab2('0x0'));module[_0x3ab2('0x1')]={'name':{'type':Sequelize[_0x3ab2('0x2')],'allowNull':![],'unique':_0x3ab2('0x3')},'table':{'type':Sequelize[_0x3ab2('0x2')]},'metric':{'type':Sequelize[_0x3ab2('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 5144c41..454ef96 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x34d5b6,_0x14c587){var _0x36a1ac=function(_0x12045c){while(--_0x12045c){_0x34d5b6['push'](_0x34d5b6['shift']());}};_0x36a1ac(++_0x14c587);}(_0xe14b,0x93));var _0xbe14=function(_0xf34e0c,_0x53751a){_0xf34e0c=_0xf34e0c-0x0;var _0x4a581d=_0xe14b[_0xf34e0c];return _0x4a581d;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
+var _0x34e8=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','catch','params','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','Metrics','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x359377,_0x1a63ef){var _0x8be18a=function(_0x246390){while(--_0x246390){_0x359377['push'](_0x359377['shift']());}};_0x8be18a(++_0x1a63ef);}(_0x34e8,0x12c));var _0x834e=function(_0x54139c,_0x256d67){_0x54139c=_0x54139c-0x0;var _0x3a68fd=_0x34e8[_0x54139c];return _0x3a68fd;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){var _0x338636=_0x58f4fd['get']({'plain':!![]});var _0x24fcf7=_0x834e('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x24fcf7,'resourceId':_0x338636['id']}})[_0x834e('0x2a')](function(){return _0x58f4fd;});})['then'](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3db026,_0x2cc2eb){return function(_0x3cd928){if(!_0x3cd928){_0x3db026[_0x834e('0x1c')](0x194);}return _0x3cd928;};}function handleError(_0x491919,_0x510780){_0x510780=_0x510780||0x1f4;return function(_0x4dc64a){logger['error'](_0x4dc64a[_0x834e('0x2d')]);if(_0x4dc64a[_0x834e('0x2e')]){delete _0x4dc64a[_0x834e('0x2e')];}_0x491919['status'](_0x510780)[_0x834e('0x2f')](_0x4dc64a);};}exports[_0x834e('0x30')]=function(_0x1f3671,_0x1e026a){var _0x4551f5={},_0x390119={},_0x3d149d={'count':0x0,'rows':[]};var _0xfaf716=_[_0x834e('0x31')](db['AnalyticMetric'][_0x834e('0x32')],function(_0x5cad11){return{'name':_0x5cad11[_0x834e('0x33')],'type':_0x5cad11[_0x834e('0x34')][_0x834e('0x35')]};});_0x390119[_0x834e('0x36')]=_[_0x834e('0x31')](_0xfaf716,_0x834e('0x2e'));_0x390119[_0x834e('0x37')]=_[_0x834e('0x38')](_0x1f3671[_0x834e('0x37')]);_0x390119[_0x834e('0x39')]=_['intersection'](_0x390119[_0x834e('0x36')],_0x390119[_0x834e('0x37')]);_0x4551f5[_0x834e('0x3a')]=_[_0x834e('0x3b')](_0x390119['model'],qs[_0x834e('0x3c')](_0x1f3671[_0x834e('0x37')]['fields']));_0x4551f5['attributes']=_0x4551f5['attributes'][_0x834e('0x3d')]?_0x4551f5[_0x834e('0x3a')]:_0x390119[_0x834e('0x36')];if(!_0x1f3671[_0x834e('0x37')][_0x834e('0x3e')](_0x834e('0x3f'))){_0x4551f5['limit']=qs[_0x834e('0x20')](_0x1f3671['query'][_0x834e('0x20')]);_0x4551f5[_0x834e('0x22')]=qs['offset'](_0x1f3671[_0x834e('0x37')][_0x834e('0x22')]);}_0x4551f5['order']=qs['sort'](_0x1f3671[_0x834e('0x37')][_0x834e('0x40')]);_0x4551f5[_0x834e('0x41')]=qs[_0x834e('0x39')](_[_0x834e('0x42')](_0x1f3671['query'],_0x390119[_0x834e('0x39')]),_0xfaf716);if(_0x1f3671['query']['filter']){_0x4551f5[_0x834e('0x41')]=_['merge'](_0x4551f5[_0x834e('0x41')],{'$or':_[_0x834e('0x31')](_0xfaf716,function(_0x16aea6){if(_0x16aea6[_0x834e('0x34')]!==_0x834e('0x43')){var _0x574ea8={};_0x574ea8[_0x16aea6[_0x834e('0x2e')]]={'$like':'%'+_0x1f3671[_0x834e('0x37')][_0x834e('0x44')]+'%'};return _0x574ea8;}})});}_0x4551f5=_['merge']({},_0x4551f5,_0x1f3671[_0x834e('0x45')]);var _0x16ac45={'where':_0x4551f5['where']};return db[_0x834e('0x46')]['count'](_0x16ac45)[_0x834e('0x2a')](function(_0x585335){_0x3d149d['count']=_0x585335;if(_0x1f3671['query'][_0x834e('0x47')]){_0x4551f5[_0x834e('0x48')]=[{'all':!![]}];}return db[_0x834e('0x46')][_0x834e('0x49')](_0x4551f5);})[_0x834e('0x2a')](function(_0x23feea){_0x3d149d[_0x834e('0x4a')]=_0x23feea;return _0x3d149d;})['then'](respondWithFilteredResult(_0x1e026a,_0x4551f5))[_0x834e('0x4b')](handleError(_0x1e026a,null));};exports['show']=function(_0x321efa,_0x540685){var _0x1df5b0={'raw':!![],'where':{'id':_0x321efa[_0x834e('0x4c')]['id']}},_0x5a5807={};_0x5a5807[_0x834e('0x36')]=_['keys'](db[_0x834e('0x46')][_0x834e('0x32')]);_0x5a5807[_0x834e('0x37')]=_[_0x834e('0x38')](_0x321efa[_0x834e('0x37')]);_0x5a5807[_0x834e('0x39')]=_[_0x834e('0x3b')](_0x5a5807[_0x834e('0x36')],_0x5a5807[_0x834e('0x37')]);_0x1df5b0[_0x834e('0x3a')]=_['intersection'](_0x5a5807[_0x834e('0x36')],qs[_0x834e('0x3c')](_0x321efa['query'][_0x834e('0x3c')]));_0x1df5b0[_0x834e('0x3a')]=_0x1df5b0[_0x834e('0x3a')][_0x834e('0x3d')]?_0x1df5b0[_0x834e('0x3a')]:_0x5a5807[_0x834e('0x36')];if(_0x321efa['query']['includeAll']){_0x1df5b0[_0x834e('0x48')]=[{'all':!![]}];}_0x1df5b0=_[_0x834e('0x4d')]({},_0x1df5b0,_0x321efa[_0x834e('0x45')]);return db[_0x834e('0x46')][_0x834e('0x4e')](_0x1df5b0)[_0x834e('0x2a')](handleEntityNotFound(_0x540685,null))[_0x834e('0x2a')](respondWithResult(_0x540685,null))[_0x834e('0x4b')](handleError(_0x540685,null));};exports[_0x834e('0x4f')]=function(_0x390c45,_0xf02f0d){return db[_0x834e('0x46')][_0x834e('0x4f')](_0x390c45[_0x834e('0x50')],{})[_0x834e('0x2a')](function(_0x1a3855){var _0x3df078=_0x390c45[_0x834e('0x51')][_0x834e('0x52')]({'plain':!![]});if(!_0x3df078)throw new Error(_0x834e('0x53'));if(_0x3df078['role']===_0x834e('0x51')){var _0x1f08b9=_0x1a3855['get']({'plain':!![]});var _0x3c00a3=_0x834e('0x2c');return db['UserProfileSection'][_0x834e('0x4e')]({'where':{'name':_0x3c00a3,'userProfileId':_0x3df078[_0x834e('0x54')]},'raw':!![]})[_0x834e('0x2a')](function(_0x35636e){if(_0x35636e&&_0x35636e[_0x834e('0x55')]===0x0){return db[_0x834e('0x56')][_0x834e('0x4f')]({'name':_0x1f08b9['name'],'resourceId':_0x1f08b9['id'],'type':_0x35636e[_0x834e('0x2e')],'sectionId':_0x35636e['id']},{})[_0x834e('0x2a')](function(){return _0x1a3855;});}else{return _0x1a3855;}})[_0x834e('0x4b')](function(_0x363675){logger[_0x834e('0x57')](_0x834e('0x58'),_0x363675);throw _0x363675;});}return _0x1a3855;})[_0x834e('0x2a')](respondWithResult(_0xf02f0d,0xc9))[_0x834e('0x4b')](handleError(_0xf02f0d,null));};exports['update']=function(_0x11778e,_0x4dc104){if(_0x11778e[_0x834e('0x50')]['id']){delete _0x11778e['body']['id'];}return db[_0x834e('0x46')]['find']({'where':{'id':_0x11778e['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4dc104,null))[_0x834e('0x2a')](saveUpdates(_0x11778e['body'],null))['then'](respondWithResult(_0x4dc104,null))[_0x834e('0x4b')](handleError(_0x4dc104,null));};exports[_0x834e('0x2b')]=function(_0x138ed2,_0x387365){return db[_0x834e('0x46')][_0x834e('0x4e')]({'where':{'id':_0x138ed2[_0x834e('0x4c')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x387365,null))['then'](removeEntity(_0x387365,null))[_0x834e('0x4b')](handleError(_0x387365,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 5f27c7e..df0998b 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 _0xbea5=['moment','bluebird','request-promise','path','./analyticMetric.attributes','AnalyticMetric','lodash','util','api'];(function(_0x54a77b,_0x55a9f8){var _0x2e717b=function(_0x1cca54){while(--_0x1cca54){_0x54a77b['push'](_0x54a77b['shift']());}};_0x2e717b(++_0x55a9f8);}(_0xbea5,0x177));var _0x5bea=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0xbea5[_0x1ee9a1];return _0x21270f;};'use strict';var _=require(_0x5bea('0x0'));var util=require(_0x5bea('0x1'));var logger=require('../../config/logger')(_0x5bea('0x2'));var moment=require(_0x5bea('0x3'));var BPromise=require(_0x5bea('0x4'));var rp=require(_0x5bea('0x5'));var fs=require('fs');var path=require(_0x5bea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5bea('0x7'));module['exports']=function(_0x156737,_0x51ac31){return _0x156737['define'](_0x5bea('0x8'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39c7=['../../config/environment','./analyticMetric.attributes','define','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3ee768,_0x11af44){var _0x26ddae=function(_0x43f17e){while(--_0x43f17e){_0x3ee768['push'](_0x3ee768['shift']());}};_0x26ddae(++_0x11af44);}(_0x39c7,0x85));var _0x739c=function(_0x58ac5b,_0x2b3fcb){_0x58ac5b=_0x58ac5b-0x0;var _0x47f26a=_0x39c7[_0x58ac5b];return _0x47f26a;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var logger=require(_0x739c('0x1'))(_0x739c('0x2'));var moment=require(_0x739c('0x3'));var BPromise=require(_0x739c('0x4'));var rp=require(_0x739c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x739c('0x6'));var config=require(_0x739c('0x7'));var attributes=require(_0x739c('0x8'));module['exports']=function(_0x4c5030,_0x1923d9){return _0x4c5030[_0x739c('0x9')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 4f1ced0..a7d86f6 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 _0x80e3=['jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x311724,_0x2930d9){var _0x5b9727=function(_0x558c51){while(--_0x558c51){_0x311724['push'](_0x311724['shift']());}};_0x5b9727(++_0x2930d9);}(_0x80e3,0x121));var _0x380e=function(_0x31d720,_0x21d696){_0x31d720=_0x31d720-0x0;var _0x1f361d=_0x80e3[_0x31d720];return _0x1f361d;};'use strict';var _=require(_0x380e('0x0'));var util=require('util');var moment=require(_0x380e('0x1'));var BPromise=require(_0x380e('0x2'));var rs=require(_0x380e('0x3'));var fs=require('fs');var Redis=require(_0x380e('0x4'));var db=require(_0x380e('0x5'))['db'];var utils=require(_0x380e('0x6'));var logger=require(_0x380e('0x7'))(_0x380e('0x8'));var config=require(_0x380e('0x9'));var jayson=require(_0x380e('0xa'));var client=jayson[_0x380e('0xb')][_0x380e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b19a9,_0x474791,_0x118793){return new BPromise(function(_0x40ad64,_0x3adfc6){return client['request'](_0x2b19a9,_0x118793)[_0x380e('0xd')](function(_0x16a6c){logger['info'](_0x380e('0xe'),_0x474791,_0x380e('0xf'));logger[_0x380e('0x10')](_0x380e('0x11'),_0x474791,_0x380e('0xf'),JSON[_0x380e('0x12')](_0x16a6c));if(_0x16a6c[_0x380e('0x13')]){if(_0x16a6c[_0x380e('0x13')][_0x380e('0x14')]===0x1f4){logger[_0x380e('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x474791,_0x16a6c[_0x380e('0x13')][_0x380e('0x15')]);return _0x3adfc6(_0x16a6c[_0x380e('0x13')][_0x380e('0x15')]);}logger[_0x380e('0x13')](_0x380e('0xe'),_0x474791,_0x16a6c[_0x380e('0x13')][_0x380e('0x15')]);return _0x40ad64(_0x16a6c['error'][_0x380e('0x15')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x474791,_0x380e('0xf'));_0x40ad64(_0x16a6c['result'][_0x380e('0x15')]);}})[_0x380e('0x16')](function(_0x3c6844){logger[_0x380e('0x13')](_0x380e('0xe'),_0x474791,_0x3c6844);_0x3adfc6(_0x3c6844);});});}
\ No newline at end of file
+var _0xb9e2=['code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','stringify','error'];(function(_0x2acffe,_0x57bc65){var _0x5734ea=function(_0x5babda){while(--_0x5babda){_0x2acffe['push'](_0x2acffe['shift']());}};_0x5734ea(++_0x57bc65);}(_0xb9e2,0x10f));var _0x2b9e=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xb9e2[_0x234ae1];return _0x227ba0;};'use strict';var _=require(_0x2b9e('0x0'));var util=require('util');var moment=require(_0x2b9e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b9e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b9e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b9e('0x4'))(_0x2b9e('0x5'));var config=require(_0x2b9e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2b9e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x483546,_0x373946,_0x53869f){return new BPromise(function(_0x2b39a5,_0xd12a73){return client['request'](_0x483546,_0x53869f)[_0x2b9e('0x8')](function(_0x298ecf){logger[_0x2b9e('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x373946,_0x2b9e('0xa'));logger[_0x2b9e('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x373946,_0x2b9e('0xa'),JSON[_0x2b9e('0xc')](_0x298ecf));if(_0x298ecf[_0x2b9e('0xd')]){if(_0x298ecf['error'][_0x2b9e('0xe')]===0x1f4){logger[_0x2b9e('0xd')](_0x2b9e('0xf'),_0x373946,_0x298ecf[_0x2b9e('0xd')][_0x2b9e('0x10')]);return _0xd12a73(_0x298ecf[_0x2b9e('0xd')][_0x2b9e('0x10')]);}logger['error'](_0x2b9e('0xf'),_0x373946,_0x298ecf['error'][_0x2b9e('0x10')]);return _0x2b39a5(_0x298ecf['error']['message']);}else{logger[_0x2b9e('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x373946,'request\x20sent');_0x2b39a5(_0x298ecf[_0x2b9e('0x11')]['message']);}})[_0x2b9e('0x12')](function(_0x30c49c){logger[_0x2b9e('0xd')](_0x2b9e('0xf'),_0x373946,_0x30c49c);_0xd12a73(_0x30c49c);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index b72c770..fe70989 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 _0x8781=['fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x57cb4f,_0x29cd98){var _0x5852a5=function(_0x32975a){while(--_0x32975a){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x5852a5(++_0x29cd98);}(_0x8781,0x1c8));var _0x1878=function(_0x48c5f5,_0x343c88){_0x48c5f5=_0x48c5f5-0x0;var _0x24056e=_0x8781[_0x48c5f5];return _0x24056e;};'use strict';var multer=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var path=require(_0x1878('0x2'));var timeout=require(_0x1878('0x3'));var express=require(_0x1878('0x4'));var router=express[_0x1878('0x5')]();var fs_extra=require(_0x1878('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1878('0x7'));var config=require(_0x1878('0x8'));var controller=require(_0x1878('0x9'));router[_0x1878('0xa')]('/',auth[_0x1878('0xb')](),controller[_0x1878('0xc')]);router['get'](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0xe')]);router[_0x1878('0xf')]('/',auth[_0x1878('0xb')](),controller[_0x1878('0x10')]);router[_0x1878('0x11')](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0x12')]);router[_0x1878('0x13')]('/:id',auth[_0x1878('0xb')](),controller[_0x1878('0x14')]);module[_0x1878('0x15')]=router;
\ No newline at end of file
+var _0xc03e=['update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x4a47bf,_0x1b2dfe){var _0xec31a4=function(_0x21bb9e){while(--_0x21bb9e){_0x4a47bf['push'](_0x4a47bf['shift']());}};_0xec31a4(++_0x1b2dfe);}(_0xc03e,0x15a));var _0xec03=function(_0x317e30,_0x32ad66){_0x317e30=_0x317e30-0x0;var _0x203788=_0xc03e[_0x317e30];return _0x203788;};'use strict';var multer=require(_0xec03('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec03('0x1'));var express=require('express');var router=express[_0xec03('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xec03('0x3'));var interaction=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var controller=require(_0xec03('0x6'));router[_0xec03('0x7')]('/',auth[_0xec03('0x8')](),controller[_0xec03('0x9')]);router[_0xec03('0x7')](_0xec03('0xa'),auth['isAuthenticated'](),controller[_0xec03('0xb')]);router[_0xec03('0xc')]('/',auth[_0xec03('0x8')](),controller[_0xec03('0xd')]);router['put'](_0xec03('0xa'),auth[_0xec03('0x8')](),controller[_0xec03('0xe')]);router[_0xec03('0xf')](_0xec03('0xa'),auth[_0xec03('0x8')](),controller[_0xec03('0x10')]);module[_0xec03('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 1493f84..d0d191c 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 _0x0b13=['sequelize','exports','TEXT'];(function(_0x52a7b5,_0x26c95c){var _0x32d6d2=function(_0xff339a){while(--_0xff339a){_0x52a7b5['push'](_0x52a7b5['shift']());}};_0x32d6d2(++_0x26c95c);}(_0x0b13,0x150));var _0x30b1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0b13[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x30b1('0x0'));module[_0x30b1('0x1')]={'tree':{'type':Sequelize[_0x30b1('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x0e35=['exports','TEXT','sequelize'];(function(_0x44b7c8,_0x341f8d){var _0x2471ce=function(_0x646988){while(--_0x646988){_0x44b7c8['push'](_0x44b7c8['shift']());}};_0x2471ce(++_0x341f8d);}(_0x0e35,0xc2));var _0x50e3=function(_0x11aa63,_0x4a4c16){_0x11aa63=_0x11aa63-0x0;var _0x3e5710=_0x0e35[_0x11aa63];return _0x3e5710;};'use strict';var Sequelize=require(_0x50e3('0x0'));module[_0x50e3('0x1')]={'tree':{'type':Sequelize[_0x50e3('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 7b91a87..f229f7f 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 _0xd2f8=['map','AnalyticTreeReport','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd2f8,0x1ee));var _0x8d2f=function(_0x2072d4,_0x29e371){_0x2072d4=_0x2072d4-0x0;var _0x3ffab1=_0xd2f8[_0x2072d4];return _0x3ffab1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d2f('0x0'));var zipdir=require(_0x8d2f('0x1'));var jsonpatch=require(_0x8d2f('0x2'));var rp=require(_0x8d2f('0x3'));var moment=require(_0x8d2f('0x4'));var BPromise=require(_0x8d2f('0x5'));var Mustache=require(_0x8d2f('0x6'));var util=require('util');var path=require(_0x8d2f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8d2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d2f('0x9'));var squel=require(_0x8d2f('0xa'));var crypto=require('crypto');var jsforce=require(_0x8d2f('0xb'));var deskjs=require(_0x8d2f('0xc'));var toCsv=require(_0x8d2f('0xd'));var querystring=require('querystring');var Papa=require(_0x8d2f('0xe'));var Redis=require(_0x8d2f('0xf'));var authService=require(_0x8d2f('0x10'));var qs=require(_0x8d2f('0x11'));var as=require(_0x8d2f('0x12'));var hardwareService=require(_0x8d2f('0x13'));var logger=require(_0x8d2f('0x14'))(_0x8d2f('0x15'));var utils=require(_0x8d2f('0x16'));var config=require(_0x8d2f('0x17'));var licenseUtil=require(_0x8d2f('0x18'));var db=require(_0x8d2f('0x19'))['db'];function respondWithStatusCode(_0x1a9499,_0x442b03){_0x442b03=_0x442b03||0xcc;return function(_0xf60098){if(_0xf60098){return _0x1a9499[_0x8d2f('0x1a')](_0x442b03);}return _0x1a9499[_0x8d2f('0x1b')](_0x442b03)[_0x8d2f('0x1c')]();};}function respondWithResult(_0x483d6e,_0x4f31cd){_0x4f31cd=_0x4f31cd||0xc8;return function(_0xce76f2){if(_0xce76f2){return _0x483d6e[_0x8d2f('0x1b')](_0x4f31cd)['json'](_0xce76f2);}};}function respondWithFilteredResult(_0x2b9dc5,_0x4d1301){return function(_0x2fa9d4){if(_0x2fa9d4){var _0x4327b3=typeof _0x4d1301['offset']===_0x8d2f('0x1d')&&typeof _0x4d1301['limit']===_0x8d2f('0x1d');var _0x138ae3=_0x2fa9d4['count'];var _0x48b08c=_0x4327b3?0x0:_0x4d1301[_0x8d2f('0x1e')];var _0x27966f=_0x4327b3?_0x2fa9d4[_0x8d2f('0x1f')]:_0x4d1301[_0x8d2f('0x1e')]+_0x4d1301['limit'];var _0x5db7a9;if(_0x27966f>=_0x138ae3){_0x27966f=_0x138ae3;_0x5db7a9=0xc8;}else{_0x5db7a9=0xce;}_0x2b9dc5['status'](_0x5db7a9);return _0x2b9dc5[_0x8d2f('0x20')](_0x8d2f('0x21'),_0x48b08c+'-'+_0x27966f+'/'+_0x138ae3)[_0x8d2f('0x22')](_0x2fa9d4);}return null;};}function patchUpdates(_0x206725){return function(_0x39f3c4){try{jsonpatch[_0x8d2f('0x23')](_0x39f3c4,_0x206725,!![]);}catch(_0xb65c8d){return BPromise[_0x8d2f('0x24')](_0xb65c8d);}return _0x39f3c4[_0x8d2f('0x25')]();};}function saveUpdates(_0x2baf65,_0x2bf9b0){return function(_0x3756bd){if(_0x3756bd){return _0x3756bd[_0x8d2f('0x26')](_0x2baf65)[_0x8d2f('0x27')](function(_0x305ac4){return _0x305ac4;});}return null;};}function removeEntity(_0x4cb12e,_0x363dec){return function(_0x19fad7){if(_0x19fad7){return _0x19fad7[_0x8d2f('0x28')]()[_0x8d2f('0x27')](function(){_0x4cb12e[_0x8d2f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8ccf,_0x416fc0){return function(_0x43e137){if(!_0x43e137){_0x3a8ccf['sendStatus'](0x194);}return _0x43e137;};}function handleError(_0x2042d6,_0x259ec1){_0x259ec1=_0x259ec1||0x1f4;return function(_0x305486){logger['error'](_0x305486[_0x8d2f('0x29')]);if(_0x305486[_0x8d2f('0x2a')]){delete _0x305486[_0x8d2f('0x2a')];}_0x2042d6[_0x8d2f('0x1b')](_0x259ec1)[_0x8d2f('0x2b')](_0x305486);};}exports[_0x8d2f('0x2c')]=function(_0x5afc12,_0x51f1b6){var _0x4aa5ed={},_0x55e1b0={},_0x847a94={'count':0x0,'rows':[]};var _0x3e6063=_[_0x8d2f('0x2d')](db[_0x8d2f('0x2e')][_0x8d2f('0x2f')],function(_0x34e193){return{'name':_0x34e193['fieldName'],'type':_0x34e193[_0x8d2f('0x30')]['key']};});_0x55e1b0[_0x8d2f('0x31')]=_[_0x8d2f('0x2d')](_0x3e6063,_0x8d2f('0x2a'));_0x55e1b0['query']=_['keys'](_0x5afc12[_0x8d2f('0x32')]);_0x55e1b0[_0x8d2f('0x33')]=_[_0x8d2f('0x34')](_0x55e1b0[_0x8d2f('0x31')],_0x55e1b0['query']);_0x4aa5ed[_0x8d2f('0x35')]=_[_0x8d2f('0x34')](_0x55e1b0[_0x8d2f('0x31')],qs[_0x8d2f('0x36')](_0x5afc12['query'][_0x8d2f('0x36')]));_0x4aa5ed[_0x8d2f('0x35')]=_0x4aa5ed['attributes'][_0x8d2f('0x37')]?_0x4aa5ed[_0x8d2f('0x35')]:_0x55e1b0['model'];if(!_0x5afc12[_0x8d2f('0x32')][_0x8d2f('0x38')](_0x8d2f('0x39'))){_0x4aa5ed['limit']=qs[_0x8d2f('0x3a')](_0x5afc12[_0x8d2f('0x32')][_0x8d2f('0x3a')]);_0x4aa5ed[_0x8d2f('0x1e')]=qs[_0x8d2f('0x1e')](_0x5afc12[_0x8d2f('0x32')][_0x8d2f('0x1e')]);}_0x4aa5ed['order']=qs[_0x8d2f('0x3b')](_0x5afc12[_0x8d2f('0x32')][_0x8d2f('0x3b')]);_0x4aa5ed[_0x8d2f('0x3c')]=qs[_0x8d2f('0x33')](_[_0x8d2f('0x3d')](_0x5afc12[_0x8d2f('0x32')],_0x55e1b0[_0x8d2f('0x33')]),_0x3e6063);if(_0x5afc12[_0x8d2f('0x32')][_0x8d2f('0x3e')]){_0x4aa5ed[_0x8d2f('0x3c')]=_[_0x8d2f('0x3f')](_0x4aa5ed['where'],{'$or':_['map'](_0x3e6063,function(_0x255764){if(_0x255764[_0x8d2f('0x30')]!==_0x8d2f('0x40')){var _0x48bc76={};_0x48bc76[_0x255764[_0x8d2f('0x2a')]]={'$like':'%'+_0x5afc12[_0x8d2f('0x32')][_0x8d2f('0x3e')]+'%'};return _0x48bc76;}})});}_0x4aa5ed=_[_0x8d2f('0x3f')]({},_0x4aa5ed,_0x5afc12[_0x8d2f('0x41')]);var _0x5c7876={'where':_0x4aa5ed[_0x8d2f('0x3c')]};return db[_0x8d2f('0x2e')][_0x8d2f('0x1f')](_0x5c7876)[_0x8d2f('0x27')](function(_0x3fc1d6){_0x847a94[_0x8d2f('0x1f')]=_0x3fc1d6;if(_0x5afc12['query'][_0x8d2f('0x42')]){_0x4aa5ed[_0x8d2f('0x43')]=[{'all':!![]}];}return db[_0x8d2f('0x2e')][_0x8d2f('0x44')](_0x4aa5ed);})[_0x8d2f('0x27')](function(_0x56d358){_0x847a94[_0x8d2f('0x45')]=_0x56d358;return _0x847a94;})[_0x8d2f('0x27')](respondWithFilteredResult(_0x51f1b6,_0x4aa5ed))[_0x8d2f('0x46')](handleError(_0x51f1b6,null));};exports[_0x8d2f('0x47')]=function(_0x368c3e,_0x22c7a2){var _0x1c63d4={'raw':!![],'where':{'id':_0x368c3e[_0x8d2f('0x48')]['id']}},_0x5ac958={};_0x5ac958[_0x8d2f('0x31')]=_[_0x8d2f('0x49')](db['AnalyticTreeReport'][_0x8d2f('0x2f')]);_0x5ac958[_0x8d2f('0x32')]=_['keys'](_0x368c3e[_0x8d2f('0x32')]);_0x5ac958[_0x8d2f('0x33')]=_['intersection'](_0x5ac958[_0x8d2f('0x31')],_0x5ac958[_0x8d2f('0x32')]);_0x1c63d4['attributes']=_[_0x8d2f('0x34')](_0x5ac958[_0x8d2f('0x31')],qs[_0x8d2f('0x36')](_0x368c3e[_0x8d2f('0x32')]['fields']));_0x1c63d4[_0x8d2f('0x35')]=_0x1c63d4[_0x8d2f('0x35')][_0x8d2f('0x37')]?_0x1c63d4[_0x8d2f('0x35')]:_0x5ac958[_0x8d2f('0x31')];if(_0x368c3e['query']['includeAll']){_0x1c63d4[_0x8d2f('0x43')]=[{'all':!![]}];}_0x1c63d4=_[_0x8d2f('0x3f')]({},_0x1c63d4,_0x368c3e[_0x8d2f('0x41')]);return db['AnalyticTreeReport']['find'](_0x1c63d4)[_0x8d2f('0x27')](handleEntityNotFound(_0x22c7a2,null))['then'](respondWithResult(_0x22c7a2,null))[_0x8d2f('0x46')](handleError(_0x22c7a2,null));};exports[_0x8d2f('0x4a')]=function(_0x52063f,_0x29b3e3){return db[_0x8d2f('0x2e')][_0x8d2f('0x4a')](_0x52063f[_0x8d2f('0x4b')],{})[_0x8d2f('0x27')](respondWithResult(_0x29b3e3,0xc9))['catch'](handleError(_0x29b3e3,null));};exports['update']=function(_0x532832,_0x5560ba){if(_0x532832[_0x8d2f('0x4b')]['id']){delete _0x532832[_0x8d2f('0x4b')]['id'];}return db[_0x8d2f('0x2e')][_0x8d2f('0x4c')]({'where':{'id':_0x532832['params']['id']}})['then'](handleEntityNotFound(_0x5560ba,null))[_0x8d2f('0x27')](saveUpdates(_0x532832[_0x8d2f('0x4b')],null))[_0x8d2f('0x27')](respondWithResult(_0x5560ba,null))[_0x8d2f('0x46')](handleError(_0x5560ba,null));};exports['destroy']=function(_0x22e747,_0x2ccc5f){return db[_0x8d2f('0x2e')][_0x8d2f('0x4c')]({'where':{'id':_0x22e747[_0x8d2f('0x48')]['id']}})[_0x8d2f('0x27')](handleEntityNotFound(_0x2ccc5f,null))['then'](removeEntity(_0x2ccc5f,null))['catch'](handleError(_0x2ccc5f,null));};
\ No newline at end of file
+var _0x6a66=['ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','find','body','catch','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x5a3450,_0x4301ce){var _0x14c155=function(_0x5ea090){while(--_0x5ea090){_0x5a3450['push'](_0x5a3450['shift']());}};_0x14c155(++_0x4301ce);}(_0x6a66,0x8a));var _0x66a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a66[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x66a6('0x0'));var rp=require(_0x66a6('0x1'));var moment=require('moment');var BPromise=require(_0x66a6('0x2'));var Mustache=require(_0x66a6('0x3'));var util=require(_0x66a6('0x4'));var path=require(_0x66a6('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x66a6('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x66a6('0x7'));var crypto=require(_0x66a6('0x8'));var jsforce=require(_0x66a6('0x9'));var deskjs=require(_0x66a6('0xa'));var toCsv=require('to-csv');var querystring=require(_0x66a6('0xb'));var Papa=require(_0x66a6('0xc'));var Redis=require(_0x66a6('0xd'));var authService=require(_0x66a6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x66a6('0xf'));var hardwareService=require(_0x66a6('0x10'));var logger=require(_0x66a6('0x11'))(_0x66a6('0x12'));var utils=require(_0x66a6('0x13'));var config=require(_0x66a6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x66a6('0x15'))['db'];function respondWithStatusCode(_0x3190b8,_0x26cc30){_0x26cc30=_0x26cc30||0xcc;return function(_0x2a4d76){if(_0x2a4d76){return _0x3190b8[_0x66a6('0x16')](_0x26cc30);}return _0x3190b8['status'](_0x26cc30)['end']();};}function respondWithResult(_0x2d4e15,_0x29f5da){_0x29f5da=_0x29f5da||0xc8;return function(_0x2bc11c){if(_0x2bc11c){return _0x2d4e15['status'](_0x29f5da)[_0x66a6('0x17')](_0x2bc11c);}};}function respondWithFilteredResult(_0x46f070,_0x4d22ab){return function(_0x3fc0eb){if(_0x3fc0eb){var _0x179a2b=typeof _0x4d22ab[_0x66a6('0x18')]===_0x66a6('0x19')&&typeof _0x4d22ab[_0x66a6('0x1a')]===_0x66a6('0x19');var _0x1fb583=_0x3fc0eb[_0x66a6('0x1b')];var _0x4cddc9=_0x179a2b?0x0:_0x4d22ab[_0x66a6('0x18')];var _0x45aa8e=_0x179a2b?_0x3fc0eb[_0x66a6('0x1b')]:_0x4d22ab[_0x66a6('0x18')]+_0x4d22ab[_0x66a6('0x1a')];var _0x2722fe;if(_0x45aa8e>=_0x1fb583){_0x45aa8e=_0x1fb583;_0x2722fe=0xc8;}else{_0x2722fe=0xce;}_0x46f070[_0x66a6('0x1c')](_0x2722fe);return _0x46f070[_0x66a6('0x1d')](_0x66a6('0x1e'),_0x4cddc9+'-'+_0x45aa8e+'/'+_0x1fb583)[_0x66a6('0x17')](_0x3fc0eb);}return null;};}function patchUpdates(_0x22a8f6){return function(_0x23a639){try{jsonpatch[_0x66a6('0x1f')](_0x23a639,_0x22a8f6,!![]);}catch(_0x522340){return BPromise[_0x66a6('0x20')](_0x522340);}return _0x23a639[_0x66a6('0x21')]();};}function saveUpdates(_0xd8f79c,_0x4b12d7){return function(_0x3d9755){if(_0x3d9755){return _0x3d9755[_0x66a6('0x22')](_0xd8f79c)['then'](function(_0xc7b71c){return _0xc7b71c;});}return null;};}function removeEntity(_0x347880,_0x1a24b2){return function(_0x45605c){if(_0x45605c){return _0x45605c['destroy']()[_0x66a6('0x23')](function(){_0x347880[_0x66a6('0x1c')](0xcc)[_0x66a6('0x24')]();});}};}function handleEntityNotFound(_0x54b840,_0x6e03f1){return function(_0x338f6e){if(!_0x338f6e){_0x54b840['sendStatus'](0x194);}return _0x338f6e;};}function handleError(_0x389238,_0x5c0e7b){_0x5c0e7b=_0x5c0e7b||0x1f4;return function(_0x5d4c4e){logger['error'](_0x5d4c4e[_0x66a6('0x25')]);if(_0x5d4c4e[_0x66a6('0x26')]){delete _0x5d4c4e[_0x66a6('0x26')];}_0x389238['status'](_0x5c0e7b)[_0x66a6('0x27')](_0x5d4c4e);};}exports['index']=function(_0x37a14e,_0x287fa8){var _0x4816d6={},_0xf3a464={},_0x17edf3={'count':0x0,'rows':[]};var _0x135c8d=_['map'](db[_0x66a6('0x28')][_0x66a6('0x29')],function(_0x37b818){return{'name':_0x37b818[_0x66a6('0x2a')],'type':_0x37b818[_0x66a6('0x2b')][_0x66a6('0x2c')]};});_0xf3a464[_0x66a6('0x2d')]=_['map'](_0x135c8d,_0x66a6('0x26'));_0xf3a464[_0x66a6('0x2e')]=_[_0x66a6('0x2f')](_0x37a14e['query']);_0xf3a464[_0x66a6('0x30')]=_[_0x66a6('0x31')](_0xf3a464[_0x66a6('0x2d')],_0xf3a464[_0x66a6('0x2e')]);_0x4816d6[_0x66a6('0x32')]=_['intersection'](_0xf3a464['model'],qs[_0x66a6('0x33')](_0x37a14e['query']['fields']));_0x4816d6[_0x66a6('0x32')]=_0x4816d6[_0x66a6('0x32')][_0x66a6('0x34')]?_0x4816d6[_0x66a6('0x32')]:_0xf3a464[_0x66a6('0x2d')];if(!_0x37a14e[_0x66a6('0x2e')][_0x66a6('0x35')](_0x66a6('0x36'))){_0x4816d6[_0x66a6('0x1a')]=qs[_0x66a6('0x1a')](_0x37a14e[_0x66a6('0x2e')][_0x66a6('0x1a')]);_0x4816d6[_0x66a6('0x18')]=qs[_0x66a6('0x18')](_0x37a14e['query'][_0x66a6('0x18')]);}_0x4816d6[_0x66a6('0x37')]=qs[_0x66a6('0x38')](_0x37a14e[_0x66a6('0x2e')][_0x66a6('0x38')]);_0x4816d6[_0x66a6('0x39')]=qs[_0x66a6('0x30')](_[_0x66a6('0x3a')](_0x37a14e[_0x66a6('0x2e')],_0xf3a464[_0x66a6('0x30')]),_0x135c8d);if(_0x37a14e[_0x66a6('0x2e')][_0x66a6('0x3b')]){_0x4816d6[_0x66a6('0x39')]=_['merge'](_0x4816d6[_0x66a6('0x39')],{'$or':_[_0x66a6('0x3c')](_0x135c8d,function(_0x58ac56){if(_0x58ac56['type']!==_0x66a6('0x3d')){var _0x24cbbc={};_0x24cbbc[_0x58ac56[_0x66a6('0x26')]]={'$like':'%'+_0x37a14e['query'][_0x66a6('0x3b')]+'%'};return _0x24cbbc;}})});}_0x4816d6=_[_0x66a6('0x3e')]({},_0x4816d6,_0x37a14e['options']);var _0x4ee385={'where':_0x4816d6[_0x66a6('0x39')]};return db['AnalyticTreeReport'][_0x66a6('0x1b')](_0x4ee385)[_0x66a6('0x23')](function(_0x1aea6b){_0x17edf3[_0x66a6('0x1b')]=_0x1aea6b;if(_0x37a14e[_0x66a6('0x2e')][_0x66a6('0x3f')]){_0x4816d6[_0x66a6('0x40')]=[{'all':!![]}];}return db[_0x66a6('0x28')][_0x66a6('0x41')](_0x4816d6);})[_0x66a6('0x23')](function(_0x5762fc){_0x17edf3[_0x66a6('0x42')]=_0x5762fc;return _0x17edf3;})['then'](respondWithFilteredResult(_0x287fa8,_0x4816d6))['catch'](handleError(_0x287fa8,null));};exports[_0x66a6('0x43')]=function(_0x234343,_0xb2ea2f){var _0x4df1d2={'raw':!![],'where':{'id':_0x234343[_0x66a6('0x44')]['id']}},_0x285e1f={};_0x285e1f['model']=_[_0x66a6('0x2f')](db['AnalyticTreeReport'][_0x66a6('0x29')]);_0x285e1f['query']=_[_0x66a6('0x2f')](_0x234343['query']);_0x285e1f[_0x66a6('0x30')]=_[_0x66a6('0x31')](_0x285e1f[_0x66a6('0x2d')],_0x285e1f['query']);_0x4df1d2['attributes']=_[_0x66a6('0x31')](_0x285e1f[_0x66a6('0x2d')],qs[_0x66a6('0x33')](_0x234343[_0x66a6('0x2e')]['fields']));_0x4df1d2[_0x66a6('0x32')]=_0x4df1d2[_0x66a6('0x32')]['length']?_0x4df1d2[_0x66a6('0x32')]:_0x285e1f[_0x66a6('0x2d')];if(_0x234343[_0x66a6('0x2e')][_0x66a6('0x3f')]){_0x4df1d2[_0x66a6('0x40')]=[{'all':!![]}];}_0x4df1d2=_[_0x66a6('0x3e')]({},_0x4df1d2,_0x234343['options']);return db[_0x66a6('0x28')][_0x66a6('0x45')](_0x4df1d2)[_0x66a6('0x23')](handleEntityNotFound(_0xb2ea2f,null))['then'](respondWithResult(_0xb2ea2f,null))['catch'](handleError(_0xb2ea2f,null));};exports['create']=function(_0x1f26d1,_0x3a646b){return db[_0x66a6('0x28')]['create'](_0x1f26d1[_0x66a6('0x46')],{})[_0x66a6('0x23')](respondWithResult(_0x3a646b,0xc9))['catch'](handleError(_0x3a646b,null));};exports[_0x66a6('0x22')]=function(_0xeae67c,_0x2cffbd){if(_0xeae67c[_0x66a6('0x46')]['id']){delete _0xeae67c[_0x66a6('0x46')]['id'];}return db[_0x66a6('0x28')][_0x66a6('0x45')]({'where':{'id':_0xeae67c[_0x66a6('0x44')]['id']}})[_0x66a6('0x23')](handleEntityNotFound(_0x2cffbd,null))[_0x66a6('0x23')](saveUpdates(_0xeae67c[_0x66a6('0x46')],null))['then'](respondWithResult(_0x2cffbd,null))[_0x66a6('0x47')](handleError(_0x2cffbd,null));};exports['destroy']=function(_0x55a108,_0x30f992){return db[_0x66a6('0x28')][_0x66a6('0x45')]({'where':{'id':_0x55a108[_0x66a6('0x44')]['id']}})[_0x66a6('0x23')](handleEntityNotFound(_0x30f992,null))['then'](removeEntity(_0x30f992,null))[_0x66a6('0x47')](handleError(_0x30f992,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 8200691..893e9c8 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 _0xfb94=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfb94,0x1b8));var _0x4fb9=function(_0x9ae3d0,_0x121f9f){_0x9ae3d0=_0x9ae3d0-0x0;var _0x4e26f2=_0xfb94[_0x9ae3d0];return _0x4e26f2;};'use strict';var _=require(_0x4fb9('0x0'));var util=require(_0x4fb9('0x1'));var logger=require(_0x4fb9('0x2'))(_0x4fb9('0x3'));var moment=require('moment');var BPromise=require(_0x4fb9('0x4'));var rp=require(_0x4fb9('0x5'));var fs=require('fs');var path=require(_0x4fb9('0x6'));var rimraf=require('rimraf');var config=require(_0x4fb9('0x7'));var attributes=require(_0x4fb9('0x8'));module[_0x4fb9('0x9')]=function(_0xeab65f,_0x2a1f60){return _0xeab65f['define'](_0x4fb9('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38cb=['request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1327fb,_0x62b273){var _0x549624=function(_0x46b502){while(--_0x46b502){_0x1327fb['push'](_0x1327fb['shift']());}};_0x549624(++_0x62b273);}(_0x38cb,0xbe));var _0xb38c=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x38cb[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xb38c('0x0'));var util=require(_0xb38c('0x1'));var logger=require(_0xb38c('0x2'))(_0xb38c('0x3'));var moment=require(_0xb38c('0x4'));var BPromise=require(_0xb38c('0x5'));var rp=require(_0xb38c('0x6'));var fs=require('fs');var path=require(_0xb38c('0x7'));var rimraf=require(_0xb38c('0x8'));var config=require('../../config/environment');var attributes=require(_0xb38c('0x9'));module[_0xb38c('0xa')]=function(_0x313703,_0xb7e754){return _0x313703[_0xb38c('0xb')](_0xb38c('0xc'),attributes,{'tableName':_0xb38c('0xd'),'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 0ac0db3..7dff198 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0xadb5,0xad));var _0x5adb=function(_0x31e65d,_0x29cf21){_0x31e65d=_0x31e65d-0x0;var _0x4e9041=_0xadb5[_0x31e65d];return _0x4e9041;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x11403a,_0x1e1aaa){var _0x2a37d7=function(_0x2d3751){while(--_0x2d3751){_0x11403a['push'](_0x11403a['shift']());}};_0x2a37d7(++_0x1e1aaa);}(_0x1261,0x144));var _0x1126=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x1261[_0x29e0eb];return _0x597d2d;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 41d28f5..8318e8c 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 _0x894c=['./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c23c2,_0x470751){var _0x53ed0c=function(_0x1ea5e6){while(--_0x1ea5e6){_0x5c23c2['push'](_0x5c23c2['shift']());}};_0x53ed0c(++_0x470751);}(_0x894c,0x114));var _0xc894=function(_0x56f96f,_0x361a6c){_0x56f96f=_0x56f96f-0x0;var _0x27d5fe=_0x894c[_0x56f96f];return _0x27d5fe;};'use strict';var multer=require(_0xc894('0x0'));var util=require(_0xc894('0x1'));var path=require(_0xc894('0x2'));var timeout=require(_0xc894('0x3'));var express=require(_0xc894('0x4'));var router=express[_0xc894('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc894('0x6'));var interaction=require(_0xc894('0x7'));var config=require(_0xc894('0x8'));var controller=require(_0xc894('0x9'));router[_0xc894('0xa')]('/',auth[_0xc894('0xb')](),controller['index']);router[_0xc894('0xa')](_0xc894('0xc'),auth[_0xc894('0xb')](),controller[_0xc894('0xd')]);router[_0xc894('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc894('0xf')]('/:id',auth[_0xc894('0xb')](),controller[_0xc894('0x10')]);router['delete'](_0xc894('0xc'),auth[_0xc894('0xb')](),controller[_0xc894('0x11')]);module[_0xc894('0x12')]=router;
\ No newline at end of file
+var _0x1553=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','put','update','delete','destroy','multer'];(function(_0x2ec14c,_0x45f699){var _0x578960=function(_0x5bea3e){while(--_0x5bea3e){_0x2ec14c['push'](_0x2ec14c['shift']());}};_0x578960(++_0x45f699);}(_0x1553,0x120));var _0x3155=function(_0x3ebcab,_0x482df2){_0x3ebcab=_0x3ebcab-0x0;var _0x4074d3=_0x1553[_0x3ebcab];return _0x4074d3;};'use strict';var multer=require(_0x3155('0x0'));var util=require('util');var path=require(_0x3155('0x1'));var timeout=require(_0x3155('0x2'));var express=require(_0x3155('0x3'));var router=express[_0x3155('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3155('0x5'));var interaction=require(_0x3155('0x6'));var config=require(_0x3155('0x7'));var controller=require(_0x3155('0x8'));router[_0x3155('0x9')]('/',auth[_0x3155('0xa')](),controller['index']);router[_0x3155('0x9')](_0x3155('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3155('0xc')]('/',auth[_0x3155('0xa')](),controller['create']);router[_0x3155('0xd')](_0x3155('0xb'),auth['isAuthenticated'](),controller[_0x3155('0xe')]);router[_0x3155('0xf')](_0x3155('0xb'),auth['isAuthenticated'](),controller[_0x3155('0x10')]);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 ff2c1ee..e67a353 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 _0x3299=['exports','STRING'];(function(_0x44f411,_0x50ec93){var _0xa827d3=function(_0x425861){while(--_0x425861){_0x44f411['push'](_0x44f411['shift']());}};_0xa827d3(++_0x50ec93);}(_0x3299,0x1bc));var _0x9329=function(_0x23f581,_0x25a955){_0x23f581=_0x23f581-0x0;var _0x50e39a=_0x3299[_0x23f581];return _0x50e39a;};'use strict';var Sequelize=require('sequelize');module[_0x9329('0x0')]={'name':{'type':Sequelize[_0x9329('0x1')]},'basename':{'type':Sequelize[_0x9329('0x1')]},'type':{'type':Sequelize[_0x9329('0x1')]}};
\ No newline at end of file
+var _0xcb81=['STRING','sequelize','exports'];(function(_0x4c9be7,_0x538b4d){var _0x5250a7=function(_0x4a71a0){while(--_0x4a71a0){_0x4c9be7['push'](_0x4c9be7['shift']());}};_0x5250a7(++_0x538b4d);}(_0xcb81,0x154));var _0x1cb8=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0xcb81[_0x55ff79];return _0x579067;};'use strict';var Sequelize=require(_0x1cb8('0x0'));module[_0x1cb8('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x1cb8('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 2e72082..e041a7e 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 _0xe19a=['then','destroy','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','limit','sort','where','map','options','Attachment','includeAll','include','findAll','rows','catch','show','params','fields','length','find','clone','omit','createdAt','updatedAt','body','create','merge','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update'];(function(_0x3eb6d8,_0x5dbf7b){var _0x5e3ff2=function(_0x254a23){while(--_0x254a23){_0x3eb6d8['push'](_0x3eb6d8['shift']());}};_0x5e3ff2(++_0x5dbf7b);}(_0xe19a,0x1e5));var _0xae19=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0xe19a[_0x8ae98b];return _0xc30bd4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae19('0x0'));var zipdir=require(_0xae19('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae19('0x2'));var moment=require(_0xae19('0x3'));var BPromise=require(_0xae19('0x4'));var Mustache=require(_0xae19('0x5'));var util=require(_0xae19('0x6'));var path=require(_0xae19('0x7'));var sox=require(_0xae19('0x8'));var csv=require('to-csv');var ejs=require(_0xae19('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae19('0xa'));var squel=require(_0xae19('0xb'));var crypto=require(_0xae19('0xc'));var jsforce=require(_0xae19('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xae19('0xe'));var querystring=require(_0xae19('0xf'));var Papa=require('papaparse');var Redis=require(_0xae19('0x10'));var authService=require(_0xae19('0x11'));var qs=require(_0xae19('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae19('0x13'));var logger=require('../../config/logger')(_0xae19('0x14'));var utils=require(_0xae19('0x15'));var config=require(_0xae19('0x16'));var licenseUtil=require(_0xae19('0x17'));var db=require(_0xae19('0x18'))['db'];function respondWithStatusCode(_0x186518,_0x402774){_0x402774=_0x402774||0xcc;return function(_0x3a3fbe){if(_0x3a3fbe){return _0x186518[_0xae19('0x19')](_0x402774);}return _0x186518[_0xae19('0x1a')](_0x402774)[_0xae19('0x1b')]();};}function respondWithResult(_0x416171,_0x6f28a0){_0x6f28a0=_0x6f28a0||0xc8;return function(_0x18e0d9){if(_0x18e0d9){return _0x416171[_0xae19('0x1a')](_0x6f28a0)[_0xae19('0x1c')](_0x18e0d9);}};}function respondWithFilteredResult(_0xeeb3c9,_0xac8434){return function(_0x3d0e69){if(_0x3d0e69){var _0x5290c0=typeof _0xac8434[_0xae19('0x1d')]===_0xae19('0x1e')&&typeof _0xac8434['limit']===_0xae19('0x1e');var _0x3a78ba=_0x3d0e69['count'];var _0x529bc6=_0x5290c0?0x0:_0xac8434[_0xae19('0x1d')];var _0x7f045e=_0x5290c0?_0x3d0e69[_0xae19('0x1f')]:_0xac8434[_0xae19('0x1d')]+_0xac8434['limit'];var _0x4bdf74;if(_0x7f045e>=_0x3a78ba){_0x7f045e=_0x3a78ba;_0x4bdf74=0xc8;}else{_0x4bdf74=0xce;}_0xeeb3c9[_0xae19('0x1a')](_0x4bdf74);return _0xeeb3c9[_0xae19('0x20')](_0xae19('0x21'),_0x529bc6+'-'+_0x7f045e+'/'+_0x3a78ba)['json'](_0x3d0e69);}return null;};}function patchUpdates(_0x4679d5){return function(_0x59bb1a){try{jsonpatch[_0xae19('0x22')](_0x59bb1a,_0x4679d5,!![]);}catch(_0x203b93){return BPromise['reject'](_0x203b93);}return _0x59bb1a[_0xae19('0x23')]();};}function saveUpdates(_0x5656cc,_0x231853){return function(_0x22ca99){if(_0x22ca99){return _0x22ca99[_0xae19('0x24')](_0x5656cc)[_0xae19('0x25')](function(_0x4aa06c){return _0x4aa06c;});}return null;};}function removeEntity(_0x489097,_0x4c1aa9){return function(_0x40309b){if(_0x40309b){return _0x40309b[_0xae19('0x26')]()[_0xae19('0x25')](function(){_0x489097[_0xae19('0x1a')](0xcc)[_0xae19('0x1b')]();});}};}function handleEntityNotFound(_0x5b7d60,_0x2ee0e6){return function(_0x1f4a27){if(!_0x1f4a27){_0x5b7d60['sendStatus'](0x194);}return _0x1f4a27;};}function handleError(_0x4a60e4,_0x37e042){_0x37e042=_0x37e042||0x1f4;return function(_0x1803b0){logger['error'](_0x1803b0['stack']);if(_0x1803b0[_0xae19('0x27')]){delete _0x1803b0[_0xae19('0x27')];}_0x4a60e4['status'](_0x37e042)[_0xae19('0x28')](_0x1803b0);};}exports[_0xae19('0x29')]=function(_0x39a1a9,_0x3fecb6){var _0x5b3228={},_0x123306={},_0xb38c75={'count':0x0,'rows':[]};var _0x220b48=_['map'](db['Attachment'][_0xae19('0x2a')],function(_0x4e695){return{'name':_0x4e695[_0xae19('0x2b')],'type':_0x4e695[_0xae19('0x2c')]['key']};});_0x123306[_0xae19('0x2d')]=_['map'](_0x220b48,'name');_0x123306[_0xae19('0x2e')]=_[_0xae19('0x2f')](_0x39a1a9['query']);_0x123306[_0xae19('0x30')]=_[_0xae19('0x31')](_0x123306[_0xae19('0x2d')],_0x123306[_0xae19('0x2e')]);_0x5b3228[_0xae19('0x32')]=_[_0xae19('0x31')](_0x123306[_0xae19('0x2d')],qs['fields'](_0x39a1a9['query']['fields']));_0x5b3228['attributes']=_0x5b3228[_0xae19('0x32')]['length']?_0x5b3228[_0xae19('0x32')]:_0x123306[_0xae19('0x2d')];if(!_0x39a1a9['query'][_0xae19('0x33')]('nolimit')){_0x5b3228[_0xae19('0x34')]=qs['limit'](_0x39a1a9[_0xae19('0x2e')][_0xae19('0x34')]);_0x5b3228[_0xae19('0x1d')]=qs[_0xae19('0x1d')](_0x39a1a9[_0xae19('0x2e')][_0xae19('0x1d')]);}_0x5b3228['order']=qs[_0xae19('0x35')](_0x39a1a9[_0xae19('0x2e')][_0xae19('0x35')]);_0x5b3228[_0xae19('0x36')]=qs[_0xae19('0x30')](_['pick'](_0x39a1a9[_0xae19('0x2e')],_0x123306[_0xae19('0x30')]),_0x220b48);if(_0x39a1a9[_0xae19('0x2e')]['filter']){_0x5b3228[_0xae19('0x36')]=_['merge'](_0x5b3228[_0xae19('0x36')],{'$or':_[_0xae19('0x37')](_0x220b48,function(_0x190f85){if(_0x190f85[_0xae19('0x2c')]!=='VIRTUAL'){var _0x24864b={};_0x24864b[_0x190f85[_0xae19('0x27')]]={'$like':'%'+_0x39a1a9['query']['filter']+'%'};return _0x24864b;}})});}_0x5b3228=_['merge']({},_0x5b3228,_0x39a1a9[_0xae19('0x38')]);var _0x21e6c2={'where':_0x5b3228[_0xae19('0x36')]};return db[_0xae19('0x39')][_0xae19('0x1f')](_0x21e6c2)[_0xae19('0x25')](function(_0x22e883){_0xb38c75[_0xae19('0x1f')]=_0x22e883;if(_0x39a1a9[_0xae19('0x2e')][_0xae19('0x3a')]){_0x5b3228[_0xae19('0x3b')]=[{'all':!![]}];}return db[_0xae19('0x39')][_0xae19('0x3c')](_0x5b3228);})[_0xae19('0x25')](function(_0x187ebf){_0xb38c75[_0xae19('0x3d')]=_0x187ebf;return _0xb38c75;})[_0xae19('0x25')](respondWithFilteredResult(_0x3fecb6,_0x5b3228))[_0xae19('0x3e')](handleError(_0x3fecb6,null));};exports[_0xae19('0x3f')]=function(_0x3b5086,_0x4bd3d0){var _0x33940c={'raw':!![],'where':{'id':_0x3b5086[_0xae19('0x40')]['id']}},_0x516613={};_0x516613['model']=_[_0xae19('0x2f')](db[_0xae19('0x39')][_0xae19('0x2a')]);_0x516613[_0xae19('0x2e')]=_['keys'](_0x3b5086[_0xae19('0x2e')]);_0x516613['filters']=_[_0xae19('0x31')](_0x516613[_0xae19('0x2d')],_0x516613[_0xae19('0x2e')]);_0x33940c[_0xae19('0x32')]=_[_0xae19('0x31')](_0x516613[_0xae19('0x2d')],qs[_0xae19('0x41')](_0x3b5086[_0xae19('0x2e')][_0xae19('0x41')]));_0x33940c['attributes']=_0x33940c[_0xae19('0x32')][_0xae19('0x42')]?_0x33940c['attributes']:_0x516613['model'];if(_0x3b5086['query'][_0xae19('0x3a')]){_0x33940c['include']=[{'all':!![]}];}_0x33940c=_['merge']({},_0x33940c,_0x3b5086[_0xae19('0x38')]);return db[_0xae19('0x39')][_0xae19('0x43')](_0x33940c)['then'](handleEntityNotFound(_0x4bd3d0,null))['then'](respondWithResult(_0x4bd3d0,null))[_0xae19('0x3e')](handleError(_0x4bd3d0,null));};exports[_0xae19('0x44')]=function(_0x2a0331,_0x2bc6c7){var _0x55560d={'where':{'id':_0x2a0331['params']['id']}},_0x13e13e={};_0x13e13e[_0xae19('0x2d')]=_[_0xae19('0x2f')](db['Attachment'][_0xae19('0x2a')]);_0x55560d[_0xae19('0x32')]=_[_0xae19('0x31')](_0x13e13e['model'],qs[_0xae19('0x41')](_0x2a0331[_0xae19('0x2e')][_0xae19('0x41')]));_0x55560d['attributes']=_0x55560d[_0xae19('0x32')][_0xae19('0x42')]?_0x55560d[_0xae19('0x32')]:_0x13e13e[_0xae19('0x2d')];if(_0x2a0331[_0xae19('0x2e')]['includeAll']){_0x55560d['include']=[{'all':!![]}];}_0x55560d=_['merge']({},_0x55560d,_0x2a0331['options']);return db[_0xae19('0x39')][_0xae19('0x43')](_0x55560d)['then'](handleEntityNotFound(_0x2bc6c7,null))[_0xae19('0x25')](function(_0x571230){if(_0x571230){var _0x2a7e74=_0x571230['get']({'plain':!![]});_0x2a7e74=qs[_0xae19('0x45')](_0x2a7e74,['id',_0xae19('0x46'),_0xae19('0x47')]);_0x2a0331[_0xae19('0x48')]=_[_0xae19('0x45')](_0x2a0331[_0xae19('0x48')],['id',_0xae19('0x46'),_0xae19('0x47')]);return db[_0xae19('0x39')][_0xae19('0x49')](_[_0xae19('0x4a')](_0x2a7e74,_0x2a0331['body']),{'include':_0x2a0331[_0xae19('0x2e')][_0xae19('0x3a')]?[{'all':!![]}]:undefined});}})[_0xae19('0x25')](respondWithResult(_0x2bc6c7,0xc9))[_0xae19('0x3e')](handleError(_0x2bc6c7,null));};exports[_0xae19('0x24')]=function(_0x5147c9,_0x1628c3){if(_0x5147c9[_0xae19('0x48')]['id']){delete _0x5147c9['body']['id'];}return db[_0xae19('0x39')]['find']({'where':{'id':_0x5147c9['params']['id']}})[_0xae19('0x25')](handleEntityNotFound(_0x1628c3,null))[_0xae19('0x25')](saveUpdates(_0x5147c9['body'],null))[_0xae19('0x25')](respondWithResult(_0x1628c3,null))[_0xae19('0x3e')](handleError(_0x1628c3,null));};exports['destroy']=function(_0x2a8c30,_0x584ce6){return db[_0xae19('0x39')]['find']({'where':{'id':_0x2a8c30[_0xae19('0x40')]['id']}})[_0xae19('0x25')](handleEntityNotFound(_0x584ce6,null))['then'](removeEntity(_0x584ce6,null))[_0xae19('0x3e')](handleError(_0x584ce6,null));};exports[_0xae19('0x49')]=function(_0x564c5e,_0x366dd6,_0x1ba9bf){_0x564c5e[_0xae19('0x48')]['name']=_0x564c5e[_0xae19('0x4b')][_0xae19('0x4c')];_0x564c5e[_0xae19('0x48')][_0xae19('0x4d')]=_0x564c5e[_0xae19('0x4b')][_0xae19('0x4e')];_0x564c5e['body'][_0xae19('0x2c')]=_0x564c5e[_0xae19('0x4b')][_0xae19('0x4f')];return db[_0xae19('0x39')]['create'](_0x564c5e[_0xae19('0x48')])[_0xae19('0x25')](respondWithResult(_0x366dd6,0xc9))[_0xae19('0x3e')](handleError(_0x366dd6,null));};exports[_0xae19('0x50')]=function(_0x289c9d,_0x1be02f,_0x23889a){return db[_0xae19('0x39')][_0xae19('0x51')]({'where':{'id':_0x289c9d[_0xae19('0x40')]['id']},'raw':!![]})[_0xae19('0x25')](handleEntityNotFound(_0x1be02f,null))[_0xae19('0x25')](function(_0x23a2bf){if(_0x23a2bf){var _0x10bff2=_0x23a2bf[_0xae19('0x52')]!==null;var _0xff037=path['join'](config[_0xae19('0x53')],_0xae19('0x54'));if(_0x10bff2){_0xff037=path[_0xae19('0x55')](_0xff037,_0xae19('0x56'));}var _0x47e058=path[_0xae19('0x55')](_0xff037,_0x23a2bf[_0xae19('0x4d')]);return _0x1be02f[_0xae19('0x50')](_0x47e058);}})['catch'](handleError(_0x1be02f,null));};
\ No newline at end of file
+var _0x2c50=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','name','send','index','map','Attachment','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','rawAttributes','find','clone','includeAll','get','omit','updatedAt','body','createdAt','create','originalname','basename','file','filename','type','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra'];(function(_0x3260b0,_0x5affce){var _0x1bf312=function(_0x60e569){while(--_0x60e569){_0x3260b0['push'](_0x3260b0['shift']());}};_0x1bf312(++_0x5affce);}(_0x2c50,0x1ad));var _0x02c5=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x2c50[_0x207d2f];return _0x3c3498;};'use strict';var emlformat=require(_0x02c5('0x0'));var rimraf=require(_0x02c5('0x1'));var zipdir=require(_0x02c5('0x2'));var jsonpatch=require(_0x02c5('0x3'));var rp=require(_0x02c5('0x4'));var moment=require('moment');var BPromise=require(_0x02c5('0x5'));var Mustache=require(_0x02c5('0x6'));var util=require(_0x02c5('0x7'));var path=require('path');var sox=require(_0x02c5('0x8'));var csv=require(_0x02c5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x02c5('0xa'));var _=require(_0x02c5('0xb'));var squel=require(_0x02c5('0xc'));var crypto=require(_0x02c5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x02c5('0xe'));var toCsv=require(_0x02c5('0x9'));var querystring=require(_0x02c5('0xf'));var Papa=require(_0x02c5('0x10'));var Redis=require(_0x02c5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x02c5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02c5('0x13'));var logger=require('../../config/logger')(_0x02c5('0x14'));var utils=require(_0x02c5('0x15'));var config=require(_0x02c5('0x16'));var licenseUtil=require(_0x02c5('0x17'));var db=require(_0x02c5('0x18'))['db'];function respondWithStatusCode(_0x1c7746,_0x5e54dd){_0x5e54dd=_0x5e54dd||0xcc;return function(_0x570328){if(_0x570328){return _0x1c7746[_0x02c5('0x19')](_0x5e54dd);}return _0x1c7746['status'](_0x5e54dd)[_0x02c5('0x1a')]();};}function respondWithResult(_0x489b71,_0x39b3f3){_0x39b3f3=_0x39b3f3||0xc8;return function(_0x2bfa00){if(_0x2bfa00){return _0x489b71[_0x02c5('0x1b')](_0x39b3f3)[_0x02c5('0x1c')](_0x2bfa00);}};}function respondWithFilteredResult(_0x4bd8ef,_0x44431e){return function(_0x1ff8a5){if(_0x1ff8a5){var _0x343b9a=typeof _0x44431e[_0x02c5('0x1d')]===_0x02c5('0x1e')&&typeof _0x44431e[_0x02c5('0x1f')]===_0x02c5('0x1e');var _0x3dc155=_0x1ff8a5[_0x02c5('0x20')];var _0x316200=_0x343b9a?0x0:_0x44431e[_0x02c5('0x1d')];var _0x3d9329=_0x343b9a?_0x1ff8a5[_0x02c5('0x20')]:_0x44431e['offset']+_0x44431e['limit'];var _0x1fea78;if(_0x3d9329>=_0x3dc155){_0x3d9329=_0x3dc155;_0x1fea78=0xc8;}else{_0x1fea78=0xce;}_0x4bd8ef[_0x02c5('0x1b')](_0x1fea78);return _0x4bd8ef['set'](_0x02c5('0x21'),_0x316200+'-'+_0x3d9329+'/'+_0x3dc155)['json'](_0x1ff8a5);}return null;};}function patchUpdates(_0x257867){return function(_0x37cfb3){try{jsonpatch[_0x02c5('0x22')](_0x37cfb3,_0x257867,!![]);}catch(_0x2f1213){return BPromise[_0x02c5('0x23')](_0x2f1213);}return _0x37cfb3['save']();};}function saveUpdates(_0x9f665c,_0x2419d3){return function(_0x3845ae){if(_0x3845ae){return _0x3845ae[_0x02c5('0x24')](_0x9f665c)[_0x02c5('0x25')](function(_0x4f4860){return _0x4f4860;});}return null;};}function removeEntity(_0x1afe23,_0x2dc5b2){return function(_0x5b1742){if(_0x5b1742){return _0x5b1742[_0x02c5('0x26')]()[_0x02c5('0x25')](function(){_0x1afe23['status'](0xcc)[_0x02c5('0x1a')]();});}};}function handleEntityNotFound(_0x22a42e,_0x146b45){return function(_0x476680){if(!_0x476680){_0x22a42e[_0x02c5('0x19')](0x194);}return _0x476680;};}function handleError(_0x1d6507,_0x583f27){_0x583f27=_0x583f27||0x1f4;return function(_0x5e40cd){logger['error'](_0x5e40cd['stack']);if(_0x5e40cd[_0x02c5('0x27')]){delete _0x5e40cd[_0x02c5('0x27')];}_0x1d6507[_0x02c5('0x1b')](_0x583f27)[_0x02c5('0x28')](_0x5e40cd);};}exports[_0x02c5('0x29')]=function(_0x520e56,_0x372621){var _0x49bc15={},_0x5384e2={},_0x478041={'count':0x0,'rows':[]};var _0x46648c=_[_0x02c5('0x2a')](db[_0x02c5('0x2b')]['rawAttributes'],function(_0x48b9a7){return{'name':_0x48b9a7[_0x02c5('0x2c')],'type':_0x48b9a7['type'][_0x02c5('0x2d')]};});_0x5384e2['model']=_[_0x02c5('0x2a')](_0x46648c,'name');_0x5384e2[_0x02c5('0x2e')]=_[_0x02c5('0x2f')](_0x520e56['query']);_0x5384e2[_0x02c5('0x30')]=_[_0x02c5('0x31')](_0x5384e2[_0x02c5('0x32')],_0x5384e2[_0x02c5('0x2e')]);_0x49bc15[_0x02c5('0x33')]=_[_0x02c5('0x31')](_0x5384e2[_0x02c5('0x32')],qs['fields'](_0x520e56[_0x02c5('0x2e')][_0x02c5('0x34')]));_0x49bc15[_0x02c5('0x33')]=_0x49bc15[_0x02c5('0x33')][_0x02c5('0x35')]?_0x49bc15[_0x02c5('0x33')]:_0x5384e2[_0x02c5('0x32')];if(!_0x520e56[_0x02c5('0x2e')][_0x02c5('0x36')]('nolimit')){_0x49bc15[_0x02c5('0x1f')]=qs['limit'](_0x520e56[_0x02c5('0x2e')][_0x02c5('0x1f')]);_0x49bc15[_0x02c5('0x1d')]=qs[_0x02c5('0x1d')](_0x520e56[_0x02c5('0x2e')][_0x02c5('0x1d')]);}_0x49bc15['order']=qs[_0x02c5('0x37')](_0x520e56[_0x02c5('0x2e')]['sort']);_0x49bc15[_0x02c5('0x38')]=qs[_0x02c5('0x30')](_['pick'](_0x520e56[_0x02c5('0x2e')],_0x5384e2['filters']),_0x46648c);if(_0x520e56[_0x02c5('0x2e')][_0x02c5('0x39')]){_0x49bc15[_0x02c5('0x38')]=_['merge'](_0x49bc15[_0x02c5('0x38')],{'$or':_[_0x02c5('0x2a')](_0x46648c,function(_0x23f9b4){if(_0x23f9b4['type']!==_0x02c5('0x3a')){var _0x4f0fe4={};_0x4f0fe4[_0x23f9b4[_0x02c5('0x27')]]={'$like':'%'+_0x520e56[_0x02c5('0x2e')][_0x02c5('0x39')]+'%'};return _0x4f0fe4;}})});}_0x49bc15=_[_0x02c5('0x3b')]({},_0x49bc15,_0x520e56[_0x02c5('0x3c')]);var _0x189379={'where':_0x49bc15['where']};return db[_0x02c5('0x2b')][_0x02c5('0x20')](_0x189379)[_0x02c5('0x25')](function(_0x571bb5){_0x478041[_0x02c5('0x20')]=_0x571bb5;if(_0x520e56[_0x02c5('0x2e')]['includeAll']){_0x49bc15[_0x02c5('0x3d')]=[{'all':!![]}];}return db[_0x02c5('0x2b')][_0x02c5('0x3e')](_0x49bc15);})[_0x02c5('0x25')](function(_0x489e41){_0x478041['rows']=_0x489e41;return _0x478041;})['then'](respondWithFilteredResult(_0x372621,_0x49bc15))[_0x02c5('0x3f')](handleError(_0x372621,null));};exports[_0x02c5('0x40')]=function(_0x244815,_0x59bd66){var _0x23c80a={'raw':!![],'where':{'id':_0x244815[_0x02c5('0x41')]['id']}},_0x2f7ae2={};_0x2f7ae2['model']=_['keys'](db[_0x02c5('0x2b')][_0x02c5('0x42')]);_0x2f7ae2['query']=_['keys'](_0x244815['query']);_0x2f7ae2[_0x02c5('0x30')]=_[_0x02c5('0x31')](_0x2f7ae2['model'],_0x2f7ae2[_0x02c5('0x2e')]);_0x23c80a[_0x02c5('0x33')]=_[_0x02c5('0x31')](_0x2f7ae2[_0x02c5('0x32')],qs[_0x02c5('0x34')](_0x244815[_0x02c5('0x2e')][_0x02c5('0x34')]));_0x23c80a[_0x02c5('0x33')]=_0x23c80a[_0x02c5('0x33')][_0x02c5('0x35')]?_0x23c80a[_0x02c5('0x33')]:_0x2f7ae2[_0x02c5('0x32')];if(_0x244815[_0x02c5('0x2e')]['includeAll']){_0x23c80a[_0x02c5('0x3d')]=[{'all':!![]}];}_0x23c80a=_[_0x02c5('0x3b')]({},_0x23c80a,_0x244815[_0x02c5('0x3c')]);return db['Attachment'][_0x02c5('0x43')](_0x23c80a)[_0x02c5('0x25')](handleEntityNotFound(_0x59bd66,null))[_0x02c5('0x25')](respondWithResult(_0x59bd66,null))['catch'](handleError(_0x59bd66,null));};exports[_0x02c5('0x44')]=function(_0x3f40e1,_0x579e86){var _0x3dde7c={'where':{'id':_0x3f40e1[_0x02c5('0x41')]['id']}},_0x21e956={};_0x21e956['model']=_[_0x02c5('0x2f')](db[_0x02c5('0x2b')]['rawAttributes']);_0x3dde7c['attributes']=_['intersection'](_0x21e956['model'],qs[_0x02c5('0x34')](_0x3f40e1[_0x02c5('0x2e')]['fields']));_0x3dde7c['attributes']=_0x3dde7c[_0x02c5('0x33')][_0x02c5('0x35')]?_0x3dde7c[_0x02c5('0x33')]:_0x21e956['model'];if(_0x3f40e1[_0x02c5('0x2e')][_0x02c5('0x45')]){_0x3dde7c[_0x02c5('0x3d')]=[{'all':!![]}];}_0x3dde7c=_[_0x02c5('0x3b')]({},_0x3dde7c,_0x3f40e1['options']);return db[_0x02c5('0x2b')][_0x02c5('0x43')](_0x3dde7c)[_0x02c5('0x25')](handleEntityNotFound(_0x579e86,null))[_0x02c5('0x25')](function(_0x48c878){if(_0x48c878){var _0x477711=_0x48c878[_0x02c5('0x46')]({'plain':!![]});_0x477711=qs[_0x02c5('0x47')](_0x477711,['id','createdAt',_0x02c5('0x48')]);_0x3f40e1[_0x02c5('0x49')]=_['omit'](_0x3f40e1[_0x02c5('0x49')],['id',_0x02c5('0x4a'),'updatedAt']);return db[_0x02c5('0x2b')][_0x02c5('0x4b')](_[_0x02c5('0x3b')](_0x477711,_0x3f40e1[_0x02c5('0x49')]),{'include':_0x3f40e1[_0x02c5('0x2e')][_0x02c5('0x45')]?[{'all':!![]}]:undefined});}})[_0x02c5('0x25')](respondWithResult(_0x579e86,0xc9))[_0x02c5('0x3f')](handleError(_0x579e86,null));};exports[_0x02c5('0x24')]=function(_0x5de1db,_0x35adcc){if(_0x5de1db['body']['id']){delete _0x5de1db[_0x02c5('0x49')]['id'];}return db[_0x02c5('0x2b')][_0x02c5('0x43')]({'where':{'id':_0x5de1db['params']['id']}})[_0x02c5('0x25')](handleEntityNotFound(_0x35adcc,null))[_0x02c5('0x25')](saveUpdates(_0x5de1db[_0x02c5('0x49')],null))[_0x02c5('0x25')](respondWithResult(_0x35adcc,null))['catch'](handleError(_0x35adcc,null));};exports[_0x02c5('0x26')]=function(_0x1997e7,_0x50d906){return db[_0x02c5('0x2b')][_0x02c5('0x43')]({'where':{'id':_0x1997e7[_0x02c5('0x41')]['id']}})[_0x02c5('0x25')](handleEntityNotFound(_0x50d906,null))[_0x02c5('0x25')](removeEntity(_0x50d906,null))[_0x02c5('0x3f')](handleError(_0x50d906,null));};exports[_0x02c5('0x4b')]=function(_0x5419cd,_0x32718f,_0x2ca295){_0x5419cd['body'][_0x02c5('0x27')]=_0x5419cd['file'][_0x02c5('0x4c')];_0x5419cd[_0x02c5('0x49')][_0x02c5('0x4d')]=_0x5419cd[_0x02c5('0x4e')][_0x02c5('0x4f')];_0x5419cd['body'][_0x02c5('0x50')]=_0x5419cd[_0x02c5('0x4e')][_0x02c5('0x51')];return db[_0x02c5('0x2b')][_0x02c5('0x4b')](_0x5419cd['body'])[_0x02c5('0x25')](respondWithResult(_0x32718f,0xc9))[_0x02c5('0x3f')](handleError(_0x32718f,null));};exports[_0x02c5('0x52')]=function(_0x441bab,_0x431fe6,_0x7fcf9c){return db[_0x02c5('0x2b')][_0x02c5('0x53')]({'where':{'id':_0x441bab[_0x02c5('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x431fe6,null))[_0x02c5('0x25')](function(_0x4869bf){if(_0x4869bf){var _0x2e57a3=_0x4869bf[_0x02c5('0x54')]!==null;var _0x3fea1e=path[_0x02c5('0x55')](config['root'],_0x02c5('0x56'));if(_0x2e57a3){_0x3fea1e=path[_0x02c5('0x55')](_0x3fea1e,_0x02c5('0x57'));}var _0xd8df08=path[_0x02c5('0x55')](_0x3fea1e,_0x4869bf['basename']);return _0x431fe6[_0x02c5('0x52')](_0xd8df08);}})['catch'](handleError(_0x431fe6,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 77573b5..2cbdb00 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 _0xf0c4=['lodash','util','bluebird','path','rimraf','./attachment.attributes','exports','define','attachments'];(function(_0x3b722d,_0x37df87){var _0xc4e19f=function(_0x2a904f){while(--_0x2a904f){_0x3b722d['push'](_0x3b722d['shift']());}};_0xc4e19f(++_0x37df87);}(_0xf0c4,0x19e));var _0x4f0c=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0xf0c4[_0x1cc961];return _0x471d86;};'use strict';var _=require(_0x4f0c('0x0'));var util=require(_0x4f0c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4f0c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f0c('0x3'));var rimraf=require(_0x4f0c('0x4'));var config=require('../../config/environment');var attributes=require(_0x4f0c('0x5'));module[_0x4f0c('0x6')]=function(_0x487d21,_0x57520b){return _0x487d21[_0x4f0c('0x7')]('Attachment',attributes,{'tableName':_0x4f0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x65a2=['attachments','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x65a2,0x175));var _0x265a=function(_0x392865,_0x587872){_0x392865=_0x392865-0x0;var _0x5dd852=_0x65a2[_0x392865];return _0x5dd852;};'use strict';var _=require('lodash');var util=require(_0x265a('0x0'));var logger=require(_0x265a('0x1'))(_0x265a('0x2'));var moment=require(_0x265a('0x3'));var BPromise=require(_0x265a('0x4'));var rp=require(_0x265a('0x5'));var fs=require('fs');var path=require(_0x265a('0x6'));var rimraf=require(_0x265a('0x7'));var config=require(_0x265a('0x8'));var attributes=require(_0x265a('0x9'));module['exports']=function(_0x55398,_0x7d14a4){return _0x55398[_0x265a('0xa')]('Attachment',attributes,{'tableName':_0x265a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index fc0870b..523be5e 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 _0x94dc=['raw','CreateAttachment','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','body','options'];(function(_0x4e9e0d,_0xd86384){var _0x514622=function(_0xe6b57b){while(--_0xe6b57b){_0x4e9e0d['push'](_0x4e9e0d['shift']());}};_0x514622(++_0xd86384);}(_0x94dc,0xb1));var _0xc94d=function(_0x1dd6f0,_0x59e8cf){_0x1dd6f0=_0x1dd6f0-0x0;var _0x21e871=_0x94dc[_0x1dd6f0];return _0x21e871;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('Attachment,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('Attachment,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['CreateAttachment']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['Attachment'][_0xc94d('0x17')](_0x48b879[_0xc94d('0x18')],{'raw':_0x48b879['options']?_0x48b879[_0xc94d('0x19')][_0xc94d('0x1a')]===undefined?!![]:![]:!![]})[_0xc94d('0xc')](function(_0xb5c1fd){logger[_0xc94d('0xd')](_0xc94d('0x1b'),_0x48b879);logger[_0xc94d('0x10')](_0xc94d('0x1b'),_0x48b879,JSON[_0xc94d('0x1c')](_0xb5c1fd));_0x4784a2(_0xb5c1fd);})[_0xc94d('0x16')](function(_0x5f2820){logger[_0xc94d('0x12')](_0xc94d('0x1b'),_0x5f2820[_0xc94d('0x14')],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x5f2820[_0xc94d('0x14')]));});});};
\ No newline at end of file
+var _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','lodash'];(function(_0xe80a76,_0x4a226b){var _0x51803b=function(_0x421fca){while(--_0x421fca){_0xe80a76['push'](_0xe80a76['shift']());}};_0x51803b(++_0x4a226b);}(_0x20ce,0x10d));var _0xe20c=function(_0xea5fd7,_0x494826){_0xea5fd7=_0xea5fd7-0x0;var _0x28fd19=_0x20ce[_0xea5fd7];return _0x28fd19;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x893e48,_0x26b9be,_0x2d88b5){return new BPromise(function(_0x8f79ad,_0x290fb5){return client[_0xe20c('0xd')](_0x893e48,_0x2d88b5)[_0xe20c('0xe')](function(_0x385d61){logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,_0xe20c('0x11'));logger[_0xe20c('0x12')](_0xe20c('0x13'),_0x26b9be,_0xe20c('0x11'),JSON['stringify'](_0x385d61));if(_0x385d61[_0xe20c('0x14')]){if(_0x385d61[_0xe20c('0x14')][_0xe20c('0x15')]===0x1f4){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61['error'][_0xe20c('0x16')]);return _0x290fb5(_0x385d61[_0xe20c('0x14')]['message']);}logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61[_0xe20c('0x14')]['message']);return _0x8f79ad(_0x385d61[_0xe20c('0x14')][_0xe20c('0x16')]);}else{logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,'request\x20sent');_0x8f79ad(_0x385d61[_0xe20c('0x17')]['message']);}})[_0xe20c('0x18')](function(_0x4061ed){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x4061ed);_0x290fb5(_0x4061ed);});});}exports[_0xe20c('0x19')]=function(_0x2d58a7){var _0x2a4292=this;return new Promise(function(_0x3d8df5,_0x305f2f){return db[_0xe20c('0x1a')]['create'](_0x2d58a7[_0xe20c('0x1b')],{'raw':_0x2d58a7[_0xe20c('0x1c')]?_0x2d58a7[_0xe20c('0x1c')][_0xe20c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x563070){logger[_0xe20c('0xf')](_0xe20c('0x19'),_0x2d58a7);logger[_0xe20c('0x12')]('CreateAttachment',_0x2d58a7,JSON['stringify'](_0x563070));_0x3d8df5(_0x563070);})[_0xe20c('0x18')](function(_0x281449){logger[_0xe20c('0x14')](_0xe20c('0x19'),_0x281449['message'],_0x2d58a7);_0x305f2f(_0x2a4292[_0xe20c('0x14')](0x1f4,_0x281449['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 5360310..598d863 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x636402,_0x2bb3ac){var _0x584106=function(_0x14a69c){while(--_0x14a69c){_0x636402['push'](_0x636402['shift']());}};_0x584106(++_0x2bb3ac);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53a258,_0x5b1010){_0x53a258=_0x53a258-0x0;var _0x1d0d59=_0x5f2f[_0x53a258];return _0x1d0d59;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x280d00,_0xf8a9f7){var _0x5b227f=function(_0x3643b2){while(--_0x3643b2){_0x280d00['push'](_0x280d00['shift']());}};_0x5b227f(++_0xf8a9f7);}(_0xadb5,0xad));var _0x5adb=function(_0x345a16,_0x13cfc1){_0x345a16=_0x345a16-0x0;var _0x3880d2=_0xadb5[_0x345a16];return _0x3880d2;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 9af9fdf..e91f953 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 _0x4570=['disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','callback','use','clientSecret','secret','callbackURL','blockDuration','then','User','find','map','emails','value','admin','agent'];(function(_0x34cae9,_0x361b8a){var _0x3d05f0=function(_0x3f16e9){while(--_0x3f16e9){_0x34cae9['push'](_0x34cae9['shift']());}};_0x3d05f0(++_0x361b8a);}(_0x4570,0x1b8));var _0x0457=function(_0x318f95,_0x568d3d){_0x318f95=_0x318f95-0x0;var _0xc79b90=_0x4570[_0x318f95];return _0xc79b90;};'use strict';var _=require(_0x0457('0x0'));var passport=require(_0x0457('0x1'));var GoogleStrategy=require(_0x0457('0x2'))['Strategy'];var moment=require(_0x0457('0x3'));var db=require(_0x0457('0x4'))['db'];var config=require(_0x0457('0x5'));var signToken=require(_0x0457('0x6'))[_0x0457('0x7')];var utils=require(_0x0457('0x8'));exports[_0x0457('0x9')]=passport[_0x0457('0xa')](_0x0457('0xb'),{'failureRedirect':_0x0457('0xc'),'scope':[_0x0457('0xd'),'email'],'session':![]});exports[_0x0457('0xe')]=passport[_0x0457('0xa')]('google',{'failureRedirect':_0x0457('0xc'),'session':![]});passport[_0x0457('0xf')](new GoogleStrategy({'clientID':config[_0x0457('0xb')]?config[_0x0457('0xb')]['clientID']:'id','clientSecret':config[_0x0457('0xb')]?config[_0x0457('0xb')][_0x0457('0x10')]:_0x0457('0x11'),'callbackURL':config[_0x0457('0xb')]?config[_0x0457('0xb')][_0x0457('0x12')]:''},function(_0x47b8da,_0x214eec,_0x2fd67e,_0x5c7278){var _0x515215,_0x5359cc;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0457('0x13')],'raw':!![]})[_0x0457('0x14')](function(_0x51e770){_0x515215=_0x51e770;return db[_0x0457('0x15')][_0x0457('0x16')]({'where':{'email':_[_0x0457('0x17')](_0x2fd67e[_0x0457('0x18')],_0x0457('0x19')),'role':{'$or':[_0x0457('0x1a'),'user',_0x0457('0x1b')]}}});})[_0x0457('0x14')](function(_0x1dec1b){_0x5359cc=_0x1dec1b;if(_0x5359cc){if(_0x5359cc[_0x0457('0x1c')]){return _0x5c7278(_0x0457('0x1d'));}else if(_0x515215['blockDuration']>0x0){if(_0x5359cc[_0x0457('0x1e')]){if(moment(_0x5359cc[_0x0457('0x1f')])['add'](_0x515215[_0x0457('0x13')],_0x0457('0x20'))>moment()){return _0x5c7278(_0x0457('0x1d'));}else{return utils[_0x0457('0x21')](_0x5359cc,0x0,![],null)[_0x0457('0x14')](function(){return utils[_0x0457('0x22')](_0x5359cc);})[_0x0457('0x14')](function(){return _0x5c7278(null,_0x5359cc);});}}else{return utils[_0x0457('0x22')](_0x5359cc)[_0x0457('0x14')](function(){return _0x5c7278(null,_0x5359cc);});}}else{return utils[_0x0457('0x22')](_0x5359cc)[_0x0457('0x14')](function(){return _0x5c7278(null,_0x5359cc);});}}return _0x5c7278(_0x0457('0x1d'));})[_0x0457('0x23')](function(_0x23b64b){_0x5c7278(_0x23b64b);});}));
\ No newline at end of file
+var _0x7b76=['find','map','emails','value','admin','user','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blockedAt','minutes','clearBlockUser','getLicense','passport-google-oauth20','Strategy','moment','../../config/environment','signToken','login','authenticate','google','/login','email','callback','clientID','clientSecret','secret','Setting','findOne','User'];(function(_0x183355,_0x4c15fc){var _0x3a7bd1=function(_0x58005e){while(--_0x58005e){_0x183355['push'](_0x183355['shift']());}};_0x3a7bd1(++_0x4c15fc);}(_0x7b76,0x1cf));var _0x67b7=function(_0x156da9,_0x15a41b){_0x156da9=_0x156da9-0x0;var _0x4759ca=_0x7b76[_0x156da9];return _0x4759ca;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x67b7('0x0'))[_0x67b7('0x1')];var moment=require(_0x67b7('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x67b7('0x3'));var signToken=require('../../components/auth/service')[_0x67b7('0x4')];var utils=require('../../config/utils');exports[_0x67b7('0x5')]=passport[_0x67b7('0x6')](_0x67b7('0x7'),{'failureRedirect':_0x67b7('0x8'),'scope':['profile',_0x67b7('0x9')],'session':![]});exports[_0x67b7('0xa')]=passport[_0x67b7('0x6')](_0x67b7('0x7'),{'failureRedirect':_0x67b7('0x8'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x67b7('0x7')]?config['google'][_0x67b7('0xb')]:'id','clientSecret':config[_0x67b7('0x7')]?config[_0x67b7('0x7')][_0x67b7('0xc')]:_0x67b7('0xd'),'callbackURL':config['google']?config['google']['callbackURL']:''},function(_0x3f9fcc,_0x3a86c3,_0x9cc50,_0xe43c81){var _0x7009df,_0x40209b;return db[_0x67b7('0xe')][_0x67b7('0xf')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x224f46){_0x7009df=_0x224f46;return db[_0x67b7('0x10')][_0x67b7('0x11')]({'where':{'email':_[_0x67b7('0x12')](_0x9cc50[_0x67b7('0x13')],_0x67b7('0x14')),'role':{'$or':[_0x67b7('0x15'),_0x67b7('0x16'),_0x67b7('0x17')]}}});})[_0x67b7('0x18')](function(_0xfca5df){_0x40209b=_0xfca5df;if(_0x40209b){if(_0x40209b[_0x67b7('0x19')]){return _0xe43c81(_0x67b7('0x1a'));}else if(_0x7009df[_0x67b7('0x1b')]>0x0){if(_0x40209b['blocked']){if(moment(_0x40209b[_0x67b7('0x1c')])['add'](_0x7009df[_0x67b7('0x1b')],_0x67b7('0x1d'))>moment()){return _0xe43c81(_0x67b7('0x1a'));}else{return utils[_0x67b7('0x1e')](_0x40209b,0x0,![],null)[_0x67b7('0x18')](function(){return utils[_0x67b7('0x1f')](_0x40209b);})[_0x67b7('0x18')](function(){return _0xe43c81(null,_0x40209b);});}}else{return utils[_0x67b7('0x1f')](_0x40209b)[_0x67b7('0x18')](function(){return _0xe43c81(null,_0x40209b);});}}else{return utils[_0x67b7('0x1f')](_0x40209b)['then'](function(){return _0xe43c81(null,_0x40209b);});}}return _0xe43c81(_0x67b7('0x1a'));})['catch'](function(_0x207a51){_0xe43c81(_0x207a51);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 7bac039..48908b9 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 _0xaf50=['passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x1bfab8,_0x3cfaec){var _0x423f85=function(_0x2108c2){while(--_0x2108c2){_0x1bfab8['push'](_0x1bfab8['shift']());}};_0x423f85(++_0x3cfaec);}(_0xaf50,0x186));var _0x0af5=function(_0x2a86b1,_0x101e45){_0x2a86b1=_0x2a86b1-0x0;var _0x207fe8=_0xaf50[_0x2a86b1];return _0x207fe8;};'use strict';var express=require('express');var passport=require(_0x0af5('0x0'));var router=express['Router']();var controller=require(_0x0af5('0x1'));var userController=require(_0x0af5('0x2'));var authService=require(_0x0af5('0x3'));router[_0x0af5('0x4')]('/',controller[_0x0af5('0x5')]);router[_0x0af5('0x4')](_0x0af5('0x6'),controller[_0x0af5('0x7')],authService[_0x0af5('0x8')],userController['login'],authService[_0x0af5('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0xd4ca=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x523403,_0x5c9446){var _0x664e80=function(_0x873dc0){while(--_0x873dc0){_0x523403['push'](_0x523403['shift']());}};_0x664e80(++_0x5c9446);}(_0xd4ca,0x1c0));var _0xad4c=function(_0x52d8cd,_0x170f4c){_0x52d8cd=_0x52d8cd-0x0;var _0x475d12=_0xd4ca[_0x52d8cd];return _0x475d12;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xad4c('0x0'));router[_0xad4c('0x1')]('/',controller[_0xad4c('0x2')]);router[_0xad4c('0x1')](_0xad4c('0x3'),controller[_0xad4c('0x4')],authService[_0xad4c('0x5')],userController[_0xad4c('0x2')],authService[_0xad4c('0x6')]);module[_0xad4c('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 32192d0..5734e15 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 _0x3299=['now','save','xCally\x20Motion\x20Password\x20Reset','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','getLicense','catch','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','authentication','user','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','authenticate','local','role','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x3299,0x1bc));var _0x9329=function(_0x424a08,_0x56197c){_0x424a08=_0x424a08-0x0;var _0x23914c=_0x3299[_0x424a08];return _0x23914c;};'use strict';var util=require('util');var passport=require(_0x9329('0x0'));var LocalStrategy=require(_0x9329('0x1'))[_0x9329('0x2')];var jayson=require(_0x9329('0x3'));var _=require(_0x9329('0x4'));var rs=require(_0x9329('0x5'));var moment=require(_0x9329('0x6'));var db=require(_0x9329('0x7'))['db'];var authService=require(_0x9329('0x8'));var utils=require(_0x9329('0x9'));var client=jayson[_0x9329('0xa')][_0x9329('0xb')]({'port':0x232b});function localAuthenticate(_0x2238fc,_0x14bc45,_0x1fa6c4,_0x218cf3){var _0x182d15,_0x531cf1;return db[_0x9329('0xc')][_0x9329('0xd')]({'where':{'id':0x1},'attributes':[_0x9329('0xe'),_0x9329('0xf')],'raw':!![]})[_0x9329('0x10')](function(_0x53d176){_0x182d15=_0x53d176;return _0x2238fc[_0x9329('0xd')]({'attributes':['id',_0x9329('0x11'),'password','salt','role',_0x9329('0x12'),_0x9329('0x13'),_0x9329('0x14'),_0x9329('0x15')],'where':{'name':_0x14bc45,'role':{'$or':[_0x9329('0x16'),'user',_0x9329('0x17')]}}});})[_0x9329('0x10')](function(_0x10658d){if(!_0x10658d||_0x10658d&&_0x10658d['name']!==_0x14bc45){throw new Error(_0x9329('0x18'));}else{_0x531cf1=_0x10658d;return _0x531cf1;}})[_0x9329('0x10')](function(){_0x531cf1['authenticate'](_0x1fa6c4,function(_0x342e47,_0x1b2b98){var _0x4adc7e=_0x531cf1[_0x9329('0x15')]+0x1;if(_0x342e47){return _0x218cf3(_0x342e47);}else if(!_0x1b2b98){if(_0x531cf1[_0x9329('0x12')]){return _0x218cf3(null,![],{'message':_0x9329('0x18')});}else if(_0x182d15[_0x9329('0xe')]>0x0){if(_0x531cf1['blocked']){if(_0x182d15[_0x9329('0xf')]>0x0){if(moment(_0x531cf1['blockedAt'])[_0x9329('0x19')](_0x182d15[_0x9329('0xf')],'minutes')>moment()){return _0x218cf3(null,![],{'message':_0x9329('0x18')});}else{return utils[_0x9329('0x1a')](_0x531cf1,_0x4adc7e,![],null)['then'](function(){return _0x218cf3(null,![],{'message':_0x9329('0x18')});});}}else{return _0x218cf3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4adc7e>=_0x182d15[_0x9329('0xe')]){return utils['clearBlockUser'](_0x531cf1,0x0,!![],moment())[_0x9329('0x10')](function(){return _0x218cf3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x9329('0x1a')](_0x531cf1,_0x4adc7e,![],null)[_0x9329('0x10')](function(){return _0x218cf3(null,![],{'message':_0x9329('0x18')});});}}}else{return _0x218cf3(null,![],{'message':_0x9329('0x18')});}}else{if(_0x531cf1[_0x9329('0x12')]){return _0x218cf3(null,![],{'message':_0x9329('0x18')});}else if(_0x182d15['allowedLoginAttempts']>0x0){if(_0x531cf1[_0x9329('0x13')]){if(_0x182d15[_0x9329('0xf')]>0x0){if(moment(_0x531cf1[_0x9329('0x14')])[_0x9329('0x19')](_0x182d15[_0x9329('0xf')],'minutes')>moment()){return _0x218cf3(null,![],{'message':_0x9329('0x18')});}else{return utils[_0x9329('0x1a')](_0x531cf1,0x0,![],null)['then'](function(){return utils[_0x9329('0x1b')](_0x531cf1);})[_0x9329('0x10')](function(){return _0x218cf3(null,_0x531cf1);});}}else{return _0x218cf3(null,![],{'message':_0x9329('0x18')});}}else{return utils[_0x9329('0x1a')](_0x531cf1,0x0,![],null)['then'](function(){return utils['getLicense'](_0x531cf1);})[_0x9329('0x10')](function(){return _0x218cf3(null,_0x531cf1);})[_0x9329('0x1c')](function(_0x4419fc){return _0x218cf3(null,![],_0x4419fc);});}}else{if(_0x531cf1['blocked']){return _0x218cf3(null,![],{'message':_0x9329('0x18')});}else{return utils['getLicense'](_0x531cf1)[_0x9329('0x10')](function(){return _0x218cf3(null,_0x531cf1);});}}}});})[_0x9329('0x1c')](function(_0x40a0ce){return _0x218cf3(null,![],_0x40a0ce);});}function sendServiceMail(_0x573209){return db['MailAccount'][_0x9329('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x9329('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x9329('0x1f')}]})['then'](function(_0x46fb80){if(!_0x46fb80){throw new Error(_0x9329('0x20'));}var _0x5cd7db={'tls':{'rejectUnauthorized':![]}};if(_0x46fb80[_0x9329('0x1f')][_0x9329('0x21')]){_0x5cd7db['service']=_0x46fb80[_0x9329('0x1f')][_0x9329('0x21')];}else{_0x5cd7db[_0x9329('0x22')]=_0x46fb80[_0x9329('0x1f')]['host'];_0x5cd7db['port']=_0x46fb80['Smtp'][_0x9329('0x23')];_0x5cd7db['secure']=_0x46fb80[_0x9329('0x1f')]['secure'];}if(_0x46fb80[_0x9329('0x1f')][_0x9329('0x24')]){_0x5cd7db['auth']={'user':_0x46fb80[_0x9329('0x1f')][_0x9329('0x25')],'pass':_0x46fb80[_0x9329('0x1f')][_0x9329('0x26')]};}var _0x5da06a={'account':_0x5cd7db,'message':_[_0x9329('0x27')]({'from':util[_0x9329('0x28')](_0x9329('0x29'),_0x46fb80[_0x9329('0x11')],_0x46fb80[_0x9329('0x1e')]||_0x46fb80[_0x9329('0x1f')]['user'])},_0x573209)};return client[_0x9329('0x2a')](_0x9329('0x2b'),_0x5da06a);})[_0x9329('0x10')](function(_0x3ae0a5){if(_0x3ae0a5[_0x9329('0x2c')]){throw new Error(util[_0x9329('0x28')](_0x9329('0x2d'),_0x3ae0a5[_0x9329('0x2c')]['message']||JSON[_0x9329('0x2e')](_0x3ae0a5['error'])));}return!![];});}function handleError(_0x11dc44,_0x22086e,_0x37475b){return _0x11dc44[_0x9329('0x2f')](_0x22086e||0x1f4)[_0x9329('0x30')]({'message':_0x37475b?_0x37475b[_0x9329('0x31')]||_0x37475b:''});}exports['login']=function(_0x5e8cb3,_0xec9ed4,_0x14afc8){passport[_0x9329('0x32')](_0x9329('0x33'),function(_0x45ed79,_0x329f95,_0x3a9e91){var _0x428287=_0x45ed79||_0x3a9e91;if(_0x428287){return handleError(_0xec9ed4,0x191,_0x428287);}if(!_0x329f95){return handleError(_0xec9ed4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x397941={'payload':{'id':_0x329f95['id'],'role':_0x329f95[_0x9329('0x34')]},'options':{'expiresIn':0x15180}};return authService[_0x9329('0x35')](_0x397941)[_0x9329('0x10')](function(_0x5e459c){_0xec9ed4[_0x9329('0x36')]({'id':_0x329f95['id'],'token':_0x5e459c,'statusCall':'','isAlreadyLogged':_0x329f95['online']});});}})(_0x5e8cb3,_0xec9ed4,_0x14afc8);};exports[_0x9329('0x37')]=function(_0x52bdeb,_0x1a6009,_0x5d6e72){if(!_0x52bdeb[_0x9329('0x38')][_0x9329('0x1e')]){return handleError(_0x1a6009,0x1f4,{'message':_0x9329('0x39')});}var _0x222e33=rs['generate']();_0x52bdeb[_0x9329('0x38')][_0x9329('0x1e')]=_0x52bdeb[_0x9329('0x38')][_0x9329('0x1e')][_0x9329('0x3a')]()[_0x9329('0x3b')]();var _0x44aa65;return db['Setting'][_0x9329('0xd')]({'where':{'id':0x1},'attributes':[_0x9329('0xe'),_0x9329('0xf')],'raw':!![]})[_0x9329('0x10')](function(_0x5de63){_0x44aa65=_0x5de63;return db['User'][_0x9329('0x1d')]({'where':{'email':_0x52bdeb[_0x9329('0x38')][_0x9329('0x1e')]}});})[_0x9329('0x10')](function(_0x44303c){if(!_0x44303c){throw new Error(_0x9329('0x3c'));}if(_0x44303c[_0x9329('0x12')]){throw new Error(_0x9329('0x3d'));}if(_0x44303c['blocked']){if(moment(_0x44303c['blockedAt'])[_0x9329('0x19')](_0x44aa65['blockDuration'],_0x9329('0x3e'))>moment()){throw new Error(_0x9329('0x3f'));}else{_0x44303c[_0x9329('0x13')]=![];_0x44303c[_0x9329('0x14')]=null;}}_0x44303c[_0x9329('0x40')]=_0x222e33;_0x44303c[_0x9329('0x41')]=Date[_0x9329('0x42')]()+0x36ee80;return _0x44303c[_0x9329('0x43')]();})[_0x9329('0x10')](function(){return sendServiceMail({'to':_0x52bdeb[_0x9329('0x38')][_0x9329('0x1e')],'subject':_0x9329('0x44'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x9329('0x45')+_0x52bdeb['headers'][_0x9329('0x22')]+_0x9329('0x46')+_0x222e33+'\x0a\x0a'+_0x9329('0x47')});})[_0x9329('0x10')](function(){_0x1a6009[_0x9329('0x2f')](0xc8)[_0x9329('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x9329('0x1c')](function(_0x281d9b){return handleError(_0x1a6009,0x1f4,_0x281d9b);});};exports[_0x9329('0x48')]=function(_0x5a4adb,_0x45237e,_0x30f04a){return db[_0x9329('0x49')]['find']({'where':{'resetPasswordToken':_0x5a4adb[_0x9329('0x4a')][_0x9329('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x9329('0x42')]()}}})[_0x9329('0x10')](function(_0xc8de8){if(!_0xc8de8){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x9329('0xc')][_0x9329('0xd')]({'attributes':['id',_0x9329('0x4c'),_0x9329('0x4d'),_0x9329('0x4e')]})[_0x9329('0x10')](function(_0x312e4b){if(_0x312e4b[_0x9329('0x4c')])authService[_0x9329('0x4f')](_0x5a4adb['body'][_0x9329('0x50')]);if(!_0x312e4b[_0x9329('0x4d')]||!_0xc8de8[_0x9329('0x51')])return _0xc8de8;authService[_0x9329('0x52')](_0x5a4adb[_0x9329('0x38')][_0x9329('0x50')],_0xc8de8[_0x9329('0x51')],_0x312e4b['passwordHistoryLimit']);return _0xc8de8;})[_0x9329('0x10')](function(){_0xc8de8[_0x9329('0x50')]=_0x5a4adb[_0x9329('0x38')][_0x9329('0x50')];_0xc8de8[_0x9329('0x40')]=null;_0xc8de8[_0x9329('0x41')]=null;return _0xc8de8[_0x9329('0x43')]();});})[_0x9329('0x10')](function(){_0x45237e[_0x9329('0x2f')](0xc8)[_0x9329('0x30')]({'message':_0x9329('0x53')});})[_0x9329('0x1c')](function(_0x416baf){return handleError(_0x45237e,0x1f4,_0x416baf);});};passport[_0x9329('0x54')](new LocalStrategy({'usernameField':_0x9329('0x11'),'passwordField':_0x9329('0x50')},function(_0x4ac39c,_0x4ec675,_0x3d0c07){return localAuthenticate(db[_0x9329('0x49')],_0x4ac39c,_0x4ec675,_0x3d0c07);}));
\ No newline at end of file
+var _0x552c=['email','MailServerOut','Smtp','service','host','port','secure','authentication','user','pass','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find'];(function(_0x3e7cbd,_0x5a4a69){var _0x1c69b4=function(_0x115c6e){while(--_0x115c6e){_0x3e7cbd['push'](_0x3e7cbd['shift']());}};_0x1c69b4(++_0x5a4a69);}(_0x552c,0xd2));var _0xc552=function(_0x332740,_0x267c85){_0x332740=_0x332740-0x0;var _0x2681ed=_0x552c[_0x332740];return _0x2681ed;};'use strict';var util=require(_0xc552('0x0'));var passport=require(_0xc552('0x1'));var LocalStrategy=require(_0xc552('0x2'))[_0xc552('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xc552('0x4'));var moment=require('moment');var db=require(_0xc552('0x5'))['db'];var authService=require(_0xc552('0x6'));var utils=require(_0xc552('0x7'));var client=jayson[_0xc552('0x8')][_0xc552('0x9')]({'port':0x232b});function localAuthenticate(_0x5067ff,_0x1196c5,_0x3c96ac,_0xccf6ba){var _0x3e2a13,_0x2d92a8;return db[_0xc552('0xa')][_0xc552('0xb')]({'where':{'id':0x1},'attributes':[_0xc552('0xc'),_0xc552('0xd')],'raw':!![]})[_0xc552('0xe')](function(_0xcee291){_0x3e2a13=_0xcee291;return _0x5067ff[_0xc552('0xb')]({'attributes':['id',_0xc552('0xf'),_0xc552('0x10'),_0xc552('0x11'),_0xc552('0x12'),_0xc552('0x13'),'blocked',_0xc552('0x14'),_0xc552('0x15')],'where':{'name':_0x1196c5,'role':{'$or':['admin','user',_0xc552('0x16')]}}});})[_0xc552('0xe')](function(_0x3a5cfd){if(!_0x3a5cfd||_0x3a5cfd&&_0x3a5cfd[_0xc552('0xf')]!==_0x1196c5){throw new Error(_0xc552('0x17'));}else{_0x2d92a8=_0x3a5cfd;return _0x2d92a8;}})[_0xc552('0xe')](function(){_0x2d92a8[_0xc552('0x18')](_0x3c96ac,function(_0x13f781,_0x10c19a){var _0xa4f006=_0x2d92a8[_0xc552('0x15')]+0x1;if(_0x13f781){return _0xccf6ba(_0x13f781);}else if(!_0x10c19a){if(_0x2d92a8[_0xc552('0x13')]){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}else if(_0x3e2a13[_0xc552('0xc')]>0x0){if(_0x2d92a8[_0xc552('0x19')]){if(_0x3e2a13[_0xc552('0xd')]>0x0){if(moment(_0x2d92a8['blockedAt'])['add'](_0x3e2a13[_0xc552('0xd')],_0xc552('0x1a'))>moment()){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}else{return utils[_0xc552('0x1b')](_0x2d92a8,_0xa4f006,![],null)[_0xc552('0xe')](function(){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});});}}else{return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}}else{if(_0xa4f006>=_0x3e2a13[_0xc552('0xc')]){return utils['clearBlockUser'](_0x2d92a8,0x0,!![],moment())[_0xc552('0xe')](function(){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});});}else{return utils[_0xc552('0x1b')](_0x2d92a8,_0xa4f006,![],null)[_0xc552('0xe')](function(){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});});}}}else{return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}}else{if(_0x2d92a8[_0xc552('0x13')]){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}else if(_0x3e2a13[_0xc552('0xc')]>0x0){if(_0x2d92a8[_0xc552('0x19')]){if(_0x3e2a13[_0xc552('0xd')]>0x0){if(moment(_0x2d92a8[_0xc552('0x14')])[_0xc552('0x1c')](_0x3e2a13[_0xc552('0xd')],_0xc552('0x1a'))>moment()){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}else{return utils[_0xc552('0x1b')](_0x2d92a8,0x0,![],null)[_0xc552('0xe')](function(){return utils['getLicense'](_0x2d92a8);})[_0xc552('0xe')](function(){return _0xccf6ba(null,_0x2d92a8);});}}else{return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}}else{return utils['clearBlockUser'](_0x2d92a8,0x0,![],null)[_0xc552('0xe')](function(){return utils[_0xc552('0x1d')](_0x2d92a8);})[_0xc552('0xe')](function(){return _0xccf6ba(null,_0x2d92a8);})[_0xc552('0x1e')](function(_0x27533e){return _0xccf6ba(null,![],_0x27533e);});}}else{if(_0x2d92a8[_0xc552('0x19')]){return _0xccf6ba(null,![],{'message':_0xc552('0x17')});}else{return utils[_0xc552('0x1d')](_0x2d92a8)[_0xc552('0xe')](function(){return _0xccf6ba(null,_0x2d92a8);});}}}});})[_0xc552('0x1e')](function(_0x2e47ff){return _0xccf6ba(null,![],_0x2e47ff);});}function sendServiceMail(_0xbe9b2){return db[_0xc552('0x1f')][_0xc552('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc552('0xf'),_0xc552('0x21')],'include':[{'model':db[_0xc552('0x22')],'as':_0xc552('0x23')}]})[_0xc552('0xe')](function(_0x2f8a1b){if(!_0x2f8a1b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3f421f={'tls':{'rejectUnauthorized':![]}};if(_0x2f8a1b['Smtp'][_0xc552('0x24')]){_0x3f421f[_0xc552('0x24')]=_0x2f8a1b[_0xc552('0x23')][_0xc552('0x24')];}else{_0x3f421f[_0xc552('0x25')]=_0x2f8a1b[_0xc552('0x23')][_0xc552('0x25')];_0x3f421f[_0xc552('0x26')]=_0x2f8a1b[_0xc552('0x23')][_0xc552('0x26')];_0x3f421f['secure']=_0x2f8a1b[_0xc552('0x23')][_0xc552('0x27')];}if(_0x2f8a1b[_0xc552('0x23')][_0xc552('0x28')]){_0x3f421f['auth']={'user':_0x2f8a1b[_0xc552('0x23')][_0xc552('0x29')],'pass':_0x2f8a1b['Smtp'][_0xc552('0x2a')]};}var _0x3752a1={'account':_0x3f421f,'message':_['merge']({'from':util[_0xc552('0x2b')]('\x22%s\x22\x20<%s>',_0x2f8a1b[_0xc552('0xf')],_0x2f8a1b[_0xc552('0x21')]||_0x2f8a1b[_0xc552('0x23')][_0xc552('0x29')])},_0xbe9b2)};return client[_0xc552('0x2c')](_0xc552('0x2d'),_0x3752a1);})['then'](function(_0x3bb5bd){if(_0x3bb5bd[_0xc552('0x2e')]){throw new Error(util['format'](_0xc552('0x2f'),_0x3bb5bd[_0xc552('0x2e')][_0xc552('0x30')]||JSON[_0xc552('0x31')](_0x3bb5bd[_0xc552('0x2e')])));}return!![];});}function handleError(_0x793a61,_0x8796c0,_0x1fd509){return _0x793a61[_0xc552('0x32')](_0x8796c0||0x1f4)[_0xc552('0x33')]({'message':_0x1fd509?_0x1fd509[_0xc552('0x30')]||_0x1fd509:''});}exports['login']=function(_0x21f48b,_0x1b7bc8,_0x44b578){passport[_0xc552('0x18')](_0xc552('0x34'),function(_0x3a0921,_0x261a08,_0x5adfb5){var _0x3eb366=_0x3a0921||_0x5adfb5;if(_0x3eb366){return handleError(_0x1b7bc8,0x191,_0x3eb366);}if(!_0x261a08){return handleError(_0x1b7bc8,0x194,{'message':_0xc552('0x35')});}else{var _0x4fb51e={'payload':{'id':_0x261a08['id'],'role':_0x261a08[_0xc552('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xc552('0x36')](_0x4fb51e)[_0xc552('0xe')](function(_0x4d941f){_0x1b7bc8[_0xc552('0x37')]({'id':_0x261a08['id'],'token':_0x4d941f,'statusCall':'','isAlreadyLogged':_0x261a08['online']});});}})(_0x21f48b,_0x1b7bc8,_0x44b578);};exports[_0xc552('0x38')]=function(_0x40c1e9,_0x67229,_0xedd976){if(!_0x40c1e9[_0xc552('0x39')]['email']){return handleError(_0x67229,0x1f4,{'message':_0xc552('0x3a')});}var _0x220f7d=rs[_0xc552('0x3b')]();_0x40c1e9[_0xc552('0x39')][_0xc552('0x21')]=_0x40c1e9[_0xc552('0x39')]['email'][_0xc552('0x3c')]()[_0xc552('0x3d')]();var _0x262874;return db[_0xc552('0xa')][_0xc552('0xb')]({'where':{'id':0x1},'attributes':[_0xc552('0xc'),_0xc552('0xd')],'raw':!![]})[_0xc552('0xe')](function(_0x3c0d27){_0x262874=_0x3c0d27;return db[_0xc552('0x3e')][_0xc552('0x20')]({'where':{'email':_0x40c1e9[_0xc552('0x39')][_0xc552('0x21')]}});})[_0xc552('0xe')](function(_0x26872a){if(!_0x26872a){throw new Error(_0xc552('0x3f'));}if(_0x26872a[_0xc552('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x26872a['blocked']){if(moment(_0x26872a['blockedAt'])['add'](_0x262874[_0xc552('0xd')],_0xc552('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x26872a[_0xc552('0x19')]=![];_0x26872a[_0xc552('0x14')]=null;}}_0x26872a['resetPasswordToken']=_0x220f7d;_0x26872a[_0xc552('0x40')]=Date[_0xc552('0x41')]()+0x36ee80;return _0x26872a[_0xc552('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x40c1e9[_0xc552('0x39')]['email'],'subject':_0xc552('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x40c1e9['headers'][_0xc552('0x25')]+_0xc552('0x44')+_0x220f7d+'\x0a\x0a'+_0xc552('0x45')});})['then'](function(){_0x67229[_0xc552('0x32')](0xc8)[_0xc552('0x33')]({'message':'Reset\x20Email\x20sent!'});})[_0xc552('0x1e')](function(_0x3e0555){return handleError(_0x67229,0x1f4,_0x3e0555);});};exports[_0xc552('0x46')]=function(_0x2b67f0,_0x4440ea,_0x58c662){return db[_0xc552('0x3e')][_0xc552('0x20')]({'where':{'resetPasswordToken':_0x2b67f0['params'][_0xc552('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xc552('0xe')](function(_0x36773a){if(!_0x36773a){throw new Error(_0xc552('0x48'));}return db['Setting'][_0xc552('0xb')]({'attributes':['id',_0xc552('0x49'),_0xc552('0x4a'),_0xc552('0x4b')]})['then'](function(_0x526228){if(_0x526228[_0xc552('0x49')])authService[_0xc552('0x4c')](_0x2b67f0[_0xc552('0x39')][_0xc552('0x10')]);if(!_0x526228['enforcePasswordHistory']||!_0x36773a[_0xc552('0x4d')])return _0x36773a;authService[_0xc552('0x4e')](_0x2b67f0[_0xc552('0x39')][_0xc552('0x10')],_0x36773a['previousPasswords'],_0x526228[_0xc552('0x4b')]);return _0x36773a;})[_0xc552('0xe')](function(){_0x36773a[_0xc552('0x10')]=_0x2b67f0[_0xc552('0x39')][_0xc552('0x10')];_0x36773a['resetPasswordToken']=null;_0x36773a[_0xc552('0x40')]=null;return _0x36773a[_0xc552('0x42')]();});})[_0xc552('0xe')](function(){_0x4440ea[_0xc552('0x32')](0xc8)['send']({'message':_0xc552('0x4f')});})['catch'](function(_0x3538c5){return handleError(_0x4440ea,0x1f4,_0x3538c5);});};passport[_0xc552('0x50')](new LocalStrategy({'usernameField':_0xc552('0xf'),'passwordField':'password'},function(_0x517831,_0x1f7151,_0x1172f3){return localAuthenticate(db['User'],_0x517831,_0x1f7151,_0x1172f3);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 3116327..a7eb934 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 _0x7b7f=['post','exports','express','./authLocal.controller','login'];(function(_0x4a9331,_0x361ba8){var _0x484b3c=function(_0x1ceed6){while(--_0x1ceed6){_0x4a9331['push'](_0x4a9331['shift']());}};_0x484b3c(++_0x361ba8);}(_0x7b7f,0x174));var _0xf7b7=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x7b7f[_0x555b2f];return _0x81c0a6;};'use strict';var express=require(_0xf7b7('0x0'));var router=express['Router']();var controller=require(_0xf7b7('0x1'));router['post']('/',controller[_0xf7b7('0x2')]);router[_0xf7b7('0x3')]('/forgot',controller['forgot']);router[_0xf7b7('0x3')]('/reset/:token',controller['reset']);module[_0xf7b7('0x4')]=router;
\ No newline at end of file
+var _0xbc5f=['exports','express','./authLocal.controller','post','login','/forgot','forgot','reset'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbc5f,0x169));var _0xfbc5=function(_0x1c4929,_0xb85eeb){_0x1c4929=_0x1c4929-0x0;var _0x876963=_0xbc5f[_0x1c4929];return _0x876963;};'use strict';var express=require(_0xfbc5('0x0'));var router=express['Router']();var controller=require(_0xfbc5('0x1'));router[_0xfbc5('0x2')]('/',controller[_0xfbc5('0x3')]);router[_0xfbc5('0x2')](_0xfbc5('0x4'),controller[_0xfbc5('0x5')]);router[_0xfbc5('0x2')]('/reset/:token',controller[_0xfbc5('0x6')]);module[_0xfbc5('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 99c59d0..dd38f87 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 _0xed08=['INTEGER','sequelize','exports','STRING'];(function(_0x24e7b0,_0x23104f){var _0x1b09a1=function(_0xf17972){while(--_0xf17972){_0x24e7b0['push'](_0x24e7b0['shift']());}};_0x1b09a1(++_0x23104f);}(_0xed08,0xe1));var _0x8ed0=function(_0x11785a,_0x45a03e){_0x11785a=_0x11785a-0x0;var _0x2dec59=_0xed08[_0x11785a];return _0x2dec59;};'use strict';var Sequelize=require(_0x8ed0('0x0'));module[_0x8ed0('0x1')]={'name':{'type':Sequelize[_0x8ed0('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8ed0('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8ed0('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x903f=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x28b5ad,_0x3986c5){var _0x2c9eb3=function(_0xeaabdd){while(--_0xeaabdd){_0x28b5ad['push'](_0x28b5ad['shift']());}};_0x2c9eb3(++_0x3986c5);}(_0x903f,0x16c));var _0xf903=function(_0x1bbb45,_0x3148ae){_0x1bbb45=_0x1bbb45-0x0;var _0x4ebc57=_0x903f[_0x1bbb45];return _0x4ebc57;};'use strict';var Sequelize=require(_0xf903('0x0'));module['exports']={'name':{'type':Sequelize[_0xf903('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf903('0x1')]},'status':{'type':Sequelize[_0xf903('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf903('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index c613370..623119e 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 _0x0643=['to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Automation','includeAll','include','rows','catch','show','params','create','body','addConditions','find','ids','omit','Condition','hasOwnProperty','getConditions','addActions','Action','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0643,0x19b));var _0x3064=function(_0x488ebf,_0x4ba59a){_0x488ebf=_0x488ebf-0x0;var _0x1d3276=_0x0643[_0x488ebf];return _0x1d3276;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3064('0x0'));var zipdir=require(_0x3064('0x1'));var jsonpatch=require(_0x3064('0x2'));var rp=require(_0x3064('0x3'));var moment=require(_0x3064('0x4'));var BPromise=require(_0x3064('0x5'));var Mustache=require(_0x3064('0x6'));var util=require(_0x3064('0x7'));var path=require(_0x3064('0x8'));var sox=require('sox');var csv=require(_0x3064('0x9'));var ejs=require(_0x3064('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3064('0xb'));var squel=require(_0x3064('0xc'));var crypto=require(_0x3064('0xd'));var jsforce=require(_0x3064('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3064('0x9'));var querystring=require(_0x3064('0xf'));var Papa=require('papaparse');var Redis=require(_0x3064('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3064('0x11'));var as=require(_0x3064('0x12'));var hardwareService=require(_0x3064('0x13'));var logger=require(_0x3064('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3064('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3064('0x16'))['db'];function respondWithStatusCode(_0x18a295,_0x328590){_0x328590=_0x328590||0xcc;return function(_0x37e3e6){if(_0x37e3e6){return _0x18a295[_0x3064('0x17')](_0x328590);}return _0x18a295[_0x3064('0x18')](_0x328590)[_0x3064('0x19')]();};}function respondWithResult(_0x49fa13,_0x56ea60){_0x56ea60=_0x56ea60||0xc8;return function(_0x1e423f){if(_0x1e423f){return _0x49fa13[_0x3064('0x18')](_0x56ea60)[_0x3064('0x1a')](_0x1e423f);}};}function respondWithFilteredResult(_0x50f262,_0x240560){return function(_0x3ac421){if(_0x3ac421){var _0x3c0c28=typeof _0x240560[_0x3064('0x1b')]===_0x3064('0x1c')&&typeof _0x240560[_0x3064('0x1d')]===_0x3064('0x1c');var _0x35a88a=_0x3ac421[_0x3064('0x1e')];var _0x181958=_0x3c0c28?0x0:_0x240560['offset'];var _0x19a1b8=_0x3c0c28?_0x3ac421['count']:_0x240560[_0x3064('0x1b')]+_0x240560[_0x3064('0x1d')];var _0x57cfc7;if(_0x19a1b8>=_0x35a88a){_0x19a1b8=_0x35a88a;_0x57cfc7=0xc8;}else{_0x57cfc7=0xce;}_0x50f262[_0x3064('0x18')](_0x57cfc7);return _0x50f262[_0x3064('0x1f')](_0x3064('0x20'),_0x181958+'-'+_0x19a1b8+'/'+_0x35a88a)['json'](_0x3ac421);}return null;};}function patchUpdates(_0x324c02){return function(_0x286c55){try{jsonpatch['apply'](_0x286c55,_0x324c02,!![]);}catch(_0x1978cf){return BPromise[_0x3064('0x21')](_0x1978cf);}return _0x286c55[_0x3064('0x22')]();};}function saveUpdates(_0x5a1acb,_0x28f68d){return function(_0x444ede){if(_0x444ede){return _0x444ede[_0x3064('0x23')](_0x5a1acb)[_0x3064('0x24')](function(_0xa27d94){return _0xa27d94;});}return null;};}function removeEntity(_0x46c587,_0x51324b){return function(_0x1849ad){if(_0x1849ad){return _0x1849ad[_0x3064('0x25')]()['then'](function(){_0x46c587['status'](0xcc)[_0x3064('0x19')]();});}};}function handleEntityNotFound(_0x36f1eb,_0x18e31a){return function(_0x507f3a){if(!_0x507f3a){_0x36f1eb[_0x3064('0x17')](0x194);}return _0x507f3a;};}function handleError(_0x4afe82,_0x4d8ab0){_0x4d8ab0=_0x4d8ab0||0x1f4;return function(_0x2048a4){logger[_0x3064('0x26')](_0x2048a4['stack']);if(_0x2048a4[_0x3064('0x27')]){delete _0x2048a4[_0x3064('0x27')];}_0x4afe82[_0x3064('0x18')](_0x4d8ab0)[_0x3064('0x28')](_0x2048a4);};}exports[_0x3064('0x29')]=function(_0x3cd7df,_0x6660f4){var _0x1c53b3={},_0x296cea={},_0x5bbd12={'count':0x0,'rows':[]};var _0x5e5a46=_[_0x3064('0x2a')](db['Automation'][_0x3064('0x2b')],function(_0x4e7253){return{'name':_0x4e7253[_0x3064('0x2c')],'type':_0x4e7253[_0x3064('0x2d')][_0x3064('0x2e')]};});_0x296cea['model']=_['map'](_0x5e5a46,_0x3064('0x27'));_0x296cea['query']=_[_0x3064('0x2f')](_0x3cd7df[_0x3064('0x30')]);_0x296cea[_0x3064('0x31')]=_[_0x3064('0x32')](_0x296cea[_0x3064('0x33')],_0x296cea[_0x3064('0x30')]);_0x1c53b3[_0x3064('0x34')]=_[_0x3064('0x32')](_0x296cea['model'],qs[_0x3064('0x35')](_0x3cd7df['query'][_0x3064('0x35')]));_0x1c53b3[_0x3064('0x34')]=_0x1c53b3[_0x3064('0x34')][_0x3064('0x36')]?_0x1c53b3[_0x3064('0x34')]:_0x296cea[_0x3064('0x33')];if(!_0x3cd7df[_0x3064('0x30')]['hasOwnProperty'](_0x3064('0x37'))){_0x1c53b3[_0x3064('0x1d')]=qs[_0x3064('0x1d')](_0x3cd7df[_0x3064('0x30')][_0x3064('0x1d')]);_0x1c53b3['offset']=qs[_0x3064('0x1b')](_0x3cd7df['query']['offset']);}_0x1c53b3[_0x3064('0x38')]=qs[_0x3064('0x39')](_0x3cd7df['query'][_0x3064('0x39')]);_0x1c53b3['where']=qs[_0x3064('0x31')](_[_0x3064('0x3a')](_0x3cd7df[_0x3064('0x30')],_0x296cea[_0x3064('0x31')]),_0x5e5a46);if(_0x3cd7df[_0x3064('0x30')]['filter']){_0x1c53b3[_0x3064('0x3b')]=_[_0x3064('0x3c')](_0x1c53b3[_0x3064('0x3b')],{'$or':_[_0x3064('0x2a')](_0x5e5a46,function(_0x4cfc95){if(_0x4cfc95[_0x3064('0x2d')]!==_0x3064('0x3d')){var _0x44ce00={};_0x44ce00[_0x4cfc95['name']]={'$like':'%'+_0x3cd7df[_0x3064('0x30')][_0x3064('0x3e')]+'%'};return _0x44ce00;}})});}_0x1c53b3=_['merge']({},_0x1c53b3,_0x3cd7df[_0x3064('0x3f')]);var _0x492e12={'where':_0x1c53b3[_0x3064('0x3b')]};return db[_0x3064('0x40')][_0x3064('0x1e')](_0x492e12)[_0x3064('0x24')](function(_0x35aeb6){_0x5bbd12['count']=_0x35aeb6;if(_0x3cd7df[_0x3064('0x30')][_0x3064('0x41')]){_0x1c53b3[_0x3064('0x42')]=[{'all':!![]}];}return db[_0x3064('0x40')]['findAll'](_0x1c53b3);})[_0x3064('0x24')](function(_0x45035e){_0x5bbd12[_0x3064('0x43')]=_0x45035e;return _0x5bbd12;})['then'](respondWithFilteredResult(_0x6660f4,_0x1c53b3))[_0x3064('0x44')](handleError(_0x6660f4,null));};exports[_0x3064('0x45')]=function(_0x48767b,_0x2bd9be){var _0x40161e={'raw':![],'where':{'id':_0x48767b[_0x3064('0x46')]['id']}},_0x5e1c3f={};_0x5e1c3f[_0x3064('0x33')]=_[_0x3064('0x2f')](db[_0x3064('0x40')][_0x3064('0x2b')]);_0x5e1c3f[_0x3064('0x30')]=_[_0x3064('0x2f')](_0x48767b[_0x3064('0x30')]);_0x5e1c3f[_0x3064('0x31')]=_[_0x3064('0x32')](_0x5e1c3f[_0x3064('0x33')],_0x5e1c3f['query']);_0x40161e['attributes']=_[_0x3064('0x32')](_0x5e1c3f['model'],qs[_0x3064('0x35')](_0x48767b[_0x3064('0x30')][_0x3064('0x35')]));_0x40161e[_0x3064('0x34')]=_0x40161e['attributes'][_0x3064('0x36')]?_0x40161e[_0x3064('0x34')]:_0x5e1c3f[_0x3064('0x33')];if(_0x48767b[_0x3064('0x30')][_0x3064('0x41')]){_0x40161e['include']=[{'all':!![]}];}_0x40161e=_['merge']({},_0x40161e,_0x48767b[_0x3064('0x3f')]);return db[_0x3064('0x40')]['find'](_0x40161e)[_0x3064('0x24')](handleEntityNotFound(_0x2bd9be,null))[_0x3064('0x24')](respondWithResult(_0x2bd9be,null))['catch'](handleError(_0x2bd9be,null));};exports[_0x3064('0x47')]=function(_0x549a48,_0x4698dd){return db[_0x3064('0x40')][_0x3064('0x47')](_0x549a48[_0x3064('0x48')],{})[_0x3064('0x24')](respondWithResult(_0x4698dd,0xc9))['catch'](handleError(_0x4698dd,null));};exports['update']=function(_0x3d238f,_0x79529d){if(_0x3d238f[_0x3064('0x48')]['id']){delete _0x3d238f[_0x3064('0x48')]['id'];}return db[_0x3064('0x40')]['find']({'where':{'id':_0x3d238f[_0x3064('0x46')]['id']}})['then'](handleEntityNotFound(_0x79529d,null))[_0x3064('0x24')](saveUpdates(_0x3d238f[_0x3064('0x48')],null))[_0x3064('0x24')](respondWithResult(_0x79529d,null))[_0x3064('0x44')](handleError(_0x79529d,null));};exports['destroy']=function(_0x3b4278,_0x493c23){return db[_0x3064('0x40')]['find']({'where':{'id':_0x3b4278[_0x3064('0x46')]['id']}})[_0x3064('0x24')](handleEntityNotFound(_0x493c23,null))[_0x3064('0x24')](removeEntity(_0x493c23,null))[_0x3064('0x44')](handleError(_0x493c23,null));};exports[_0x3064('0x49')]=function(_0x121a49,_0x1f39ef,_0x26af7d){return db['Condition'][_0x3064('0x4a')]({'where':{'id':_0x121a49[_0x3064('0x46')]['id']}})[_0x3064('0x24')](handleEntityNotFound(_0x1f39ef,null))[_0x3064('0x24')](function(_0x10f28d){if(_0x10f28d){return _0x10f28d[_0x3064('0x49')](_0x121a49['body'][_0x3064('0x4b')],_[_0x3064('0x4c')](_0x121a49[_0x3064('0x48')],[_0x3064('0x4b'),'id'])||{});}})[_0x3064('0x24')](respondWithResult(_0x1f39ef,null))[_0x3064('0x44')](handleError(_0x1f39ef,null));};exports['getConditions']=function(_0xe697c1,_0x474fb3,_0xeab094){var _0x117bd6={};var _0x1406a0={};var _0x8a893a;var _0x5d3eee;return db[_0x3064('0x40')]['findOne']({'where':{'id':_0xe697c1[_0x3064('0x46')]['id']}})[_0x3064('0x24')](handleEntityNotFound(_0x474fb3,null))[_0x3064('0x24')](function(_0x26a6a0){if(_0x26a6a0){_0x8a893a=_0x26a6a0;_0x1406a0['model']=_[_0x3064('0x2f')](db[_0x3064('0x4d')][_0x3064('0x2b')]);_0x1406a0[_0x3064('0x30')]=_[_0x3064('0x2f')](_0xe697c1['query']);_0x1406a0[_0x3064('0x31')]=_['intersection'](_0x1406a0[_0x3064('0x33')],_0x1406a0[_0x3064('0x30')]);_0x117bd6['attributes']=_[_0x3064('0x32')](_0x1406a0[_0x3064('0x33')],qs['fields'](_0xe697c1[_0x3064('0x30')]['fields']));_0x117bd6[_0x3064('0x34')]=_0x117bd6['attributes']['length']?_0x117bd6['attributes']:_0x1406a0['model'];_0x117bd6[_0x3064('0x38')]=qs[_0x3064('0x39')](_0xe697c1[_0x3064('0x30')][_0x3064('0x39')]);_0x117bd6[_0x3064('0x3b')]=qs[_0x3064('0x31')](_[_0x3064('0x3a')](_0xe697c1[_0x3064('0x30')],_0x1406a0[_0x3064('0x31')]));if(_0xe697c1['query'][_0x3064('0x3e')]){_0x117bd6[_0x3064('0x3b')]=_['merge'](_0x117bd6[_0x3064('0x3b')],{'$or':_[_0x3064('0x2a')](_0x117bd6['attributes'],function(_0x162133){var _0x16701e={};_0x16701e[_0x162133]={'$like':'%'+_0xe697c1[_0x3064('0x30')][_0x3064('0x3e')]+'%'};return _0x16701e;})});}_0x117bd6=_[_0x3064('0x3c')]({},_0x117bd6,_0xe697c1['options']);return _0x8a893a['getConditions'](_0x117bd6);}})['then'](function(_0x4d5083){if(_0x4d5083){_0x5d3eee=_0x4d5083['length'];if(!_0xe697c1['query'][_0x3064('0x4e')](_0x3064('0x37'))){_0x117bd6[_0x3064('0x1d')]=qs[_0x3064('0x1d')](_0xe697c1[_0x3064('0x30')]['limit']);_0x117bd6[_0x3064('0x1b')]=qs[_0x3064('0x1b')](_0xe697c1[_0x3064('0x30')][_0x3064('0x1b')]);}return _0x8a893a[_0x3064('0x4f')](_0x117bd6);}})[_0x3064('0x24')](function(_0x4f6737){if(_0x4f6737){return _0x4f6737?{'count':_0x5d3eee,'rows':_0x4f6737}:null;}})[_0x3064('0x24')](respondWithResult(_0x474fb3,null))[_0x3064('0x44')](handleError(_0x474fb3,null));};exports[_0x3064('0x50')]=function(_0x529e59,_0x4147ae,_0x5f0b66){return db[_0x3064('0x51')][_0x3064('0x4a')]({'where':{'id':_0x529e59['params']['id']}})[_0x3064('0x24')](handleEntityNotFound(_0x4147ae,null))[_0x3064('0x24')](function(_0x27e40a){if(_0x27e40a){return _0x27e40a[_0x3064('0x50')](_0x529e59[_0x3064('0x48')][_0x3064('0x4b')],_[_0x3064('0x4c')](_0x529e59[_0x3064('0x48')],[_0x3064('0x4b'),'id'])||{});}})[_0x3064('0x24')](respondWithResult(_0x4147ae,null))[_0x3064('0x44')](handleError(_0x4147ae,null));};exports[_0x3064('0x52')]=function(_0x24eab9,_0x36721c,_0x261b5a){var _0x2e5253={};var _0x1c6df4={};var _0x58c3af;var _0x1b16c0;return db[_0x3064('0x40')][_0x3064('0x53')]({'where':{'id':_0x24eab9[_0x3064('0x46')]['id']}})[_0x3064('0x24')](handleEntityNotFound(_0x36721c,null))[_0x3064('0x24')](function(_0x3b9729){if(_0x3b9729){_0x58c3af=_0x3b9729;_0x1c6df4[_0x3064('0x33')]=_[_0x3064('0x2f')](db[_0x3064('0x51')]['rawAttributes']);_0x1c6df4[_0x3064('0x30')]=_[_0x3064('0x2f')](_0x24eab9[_0x3064('0x30')]);_0x1c6df4[_0x3064('0x31')]=_[_0x3064('0x32')](_0x1c6df4[_0x3064('0x33')],_0x1c6df4['query']);_0x2e5253[_0x3064('0x34')]=_[_0x3064('0x32')](_0x1c6df4[_0x3064('0x33')],qs['fields'](_0x24eab9['query'][_0x3064('0x35')]));_0x2e5253[_0x3064('0x34')]=_0x2e5253[_0x3064('0x34')]['length']?_0x2e5253[_0x3064('0x34')]:_0x1c6df4[_0x3064('0x33')];_0x2e5253[_0x3064('0x38')]=qs[_0x3064('0x39')](_0x24eab9['query'][_0x3064('0x39')]);_0x2e5253[_0x3064('0x3b')]=qs[_0x3064('0x31')](_['pick'](_0x24eab9[_0x3064('0x30')],_0x1c6df4['filters']));if(_0x24eab9[_0x3064('0x30')][_0x3064('0x3e')]){_0x2e5253['where']=_['merge'](_0x2e5253[_0x3064('0x3b')],{'$or':_['map'](_0x2e5253[_0x3064('0x34')],function(_0x5d75aa){var _0x9c89a={};_0x9c89a[_0x5d75aa]={'$like':'%'+_0x24eab9['query']['filter']+'%'};return _0x9c89a;})});}_0x2e5253=_[_0x3064('0x3c')]({},_0x2e5253,_0x24eab9[_0x3064('0x3f')]);return _0x58c3af[_0x3064('0x52')](_0x2e5253);}})['then'](function(_0x4441c){if(_0x4441c){_0x1b16c0=_0x4441c['length'];if(!_0x24eab9['query'][_0x3064('0x4e')](_0x3064('0x37'))){_0x2e5253[_0x3064('0x1d')]=qs[_0x3064('0x1d')](_0x24eab9[_0x3064('0x30')]['limit']);_0x2e5253[_0x3064('0x1b')]=qs[_0x3064('0x1b')](_0x24eab9['query']['offset']);}return _0x58c3af[_0x3064('0x52')](_0x2e5253);}})[_0x3064('0x24')](function(_0x41a02d){if(_0x41a02d){return _0x41a02d?{'count':_0x1b16c0,'rows':_0x41a02d}:null;}})[_0x3064('0x24')](respondWithResult(_0x36721c,null))[_0x3064('0x44')](handleError(_0x36721c,null));};
\ No newline at end of file
+var _0x294a=['filter','options','Automation','include','findAll','catch','show','params','rawAttributes','length','includeAll','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','hasOwnProperty','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','filters','pick','where','merge','VIRTUAL'];(function(_0x56819f,_0x2f03fa){var _0xf69016=function(_0x2e52b2){while(--_0x2e52b2){_0x56819f['push'](_0x56819f['shift']());}};_0xf69016(++_0x2f03fa);}(_0x294a,0xc3));var _0xa294=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x294a[_0x491cbe];return _0x59449d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa294('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa294('0x1'));var moment=require(_0xa294('0x2'));var BPromise=require(_0xa294('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa294('0x4'));var sox=require(_0xa294('0x5'));var csv=require(_0xa294('0x6'));var ejs=require(_0xa294('0x7'));var fs=require('fs');var fs_extra=require(_0xa294('0x8'));var _=require(_0xa294('0x9'));var squel=require(_0xa294('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa294('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa294('0xc'));var Papa=require(_0xa294('0xd'));var Redis=require('ioredis');var authService=require(_0xa294('0xe'));var qs=require(_0xa294('0xf'));var as=require(_0xa294('0x10'));var hardwareService=require(_0xa294('0x11'));var logger=require(_0xa294('0x12'))(_0xa294('0x13'));var utils=require(_0xa294('0x14'));var config=require(_0xa294('0x15'));var licenseUtil=require(_0xa294('0x16'));var db=require(_0xa294('0x17'))['db'];function respondWithStatusCode(_0x34b9c9,_0x66b0ff){_0x66b0ff=_0x66b0ff||0xcc;return function(_0x505e6e){if(_0x505e6e){return _0x34b9c9[_0xa294('0x18')](_0x66b0ff);}return _0x34b9c9[_0xa294('0x19')](_0x66b0ff)['end']();};}function respondWithResult(_0x4b17d5,_0x18da16){_0x18da16=_0x18da16||0xc8;return function(_0x380749){if(_0x380749){return _0x4b17d5['status'](_0x18da16)[_0xa294('0x1a')](_0x380749);}};}function respondWithFilteredResult(_0x3e1207,_0x2980f0){return function(_0x53c57b){if(_0x53c57b){var _0x2519b7=typeof _0x2980f0[_0xa294('0x1b')]==='undefined'&&typeof _0x2980f0[_0xa294('0x1c')]===_0xa294('0x1d');var _0x4cdd5e=_0x53c57b[_0xa294('0x1e')];var _0x403f62=_0x2519b7?0x0:_0x2980f0[_0xa294('0x1b')];var _0xda0db4=_0x2519b7?_0x53c57b[_0xa294('0x1e')]:_0x2980f0[_0xa294('0x1b')]+_0x2980f0[_0xa294('0x1c')];var _0x587843;if(_0xda0db4>=_0x4cdd5e){_0xda0db4=_0x4cdd5e;_0x587843=0xc8;}else{_0x587843=0xce;}_0x3e1207['status'](_0x587843);return _0x3e1207[_0xa294('0x1f')](_0xa294('0x20'),_0x403f62+'-'+_0xda0db4+'/'+_0x4cdd5e)['json'](_0x53c57b);}return null;};}function patchUpdates(_0x61334b){return function(_0x4c41af){try{jsonpatch[_0xa294('0x21')](_0x4c41af,_0x61334b,!![]);}catch(_0x5a3f4d){return BPromise[_0xa294('0x22')](_0x5a3f4d);}return _0x4c41af[_0xa294('0x23')]();};}function saveUpdates(_0x9b6ae6,_0x4615c9){return function(_0x52b667){if(_0x52b667){return _0x52b667[_0xa294('0x24')](_0x9b6ae6)[_0xa294('0x25')](function(_0x547fde){return _0x547fde;});}return null;};}function removeEntity(_0x253be6,_0x34c4bf){return function(_0x2b29d1){if(_0x2b29d1){return _0x2b29d1['destroy']()['then'](function(){_0x253be6[_0xa294('0x19')](0xcc)[_0xa294('0x26')]();});}};}function handleEntityNotFound(_0x577795,_0x24d9f6){return function(_0x2341eb){if(!_0x2341eb){_0x577795[_0xa294('0x18')](0x194);}return _0x2341eb;};}function handleError(_0x3b7545,_0x5ba5df){_0x5ba5df=_0x5ba5df||0x1f4;return function(_0x42b0cd){logger[_0xa294('0x27')](_0x42b0cd['stack']);if(_0x42b0cd[_0xa294('0x28')]){delete _0x42b0cd['name'];}_0x3b7545[_0xa294('0x19')](_0x5ba5df)[_0xa294('0x29')](_0x42b0cd);};}exports['index']=function(_0x53d2a9,_0x4ff09a){var _0x170e22={},_0x480f0d={},_0x248df9={'count':0x0,'rows':[]};var _0x1790b3=_[_0xa294('0x2a')](db['Automation']['rawAttributes'],function(_0x1825a6){return{'name':_0x1825a6[_0xa294('0x2b')],'type':_0x1825a6[_0xa294('0x2c')][_0xa294('0x2d')]};});_0x480f0d[_0xa294('0x2e')]=_[_0xa294('0x2a')](_0x1790b3,_0xa294('0x28'));_0x480f0d[_0xa294('0x2f')]=_[_0xa294('0x30')](_0x53d2a9[_0xa294('0x2f')]);_0x480f0d['filters']=_[_0xa294('0x31')](_0x480f0d[_0xa294('0x2e')],_0x480f0d[_0xa294('0x2f')]);_0x170e22['attributes']=_[_0xa294('0x31')](_0x480f0d[_0xa294('0x2e')],qs[_0xa294('0x32')](_0x53d2a9[_0xa294('0x2f')][_0xa294('0x32')]));_0x170e22[_0xa294('0x33')]=_0x170e22['attributes']['length']?_0x170e22[_0xa294('0x33')]:_0x480f0d[_0xa294('0x2e')];if(!_0x53d2a9[_0xa294('0x2f')]['hasOwnProperty'](_0xa294('0x34'))){_0x170e22[_0xa294('0x1c')]=qs[_0xa294('0x1c')](_0x53d2a9['query'][_0xa294('0x1c')]);_0x170e22[_0xa294('0x1b')]=qs[_0xa294('0x1b')](_0x53d2a9[_0xa294('0x2f')]['offset']);}_0x170e22[_0xa294('0x35')]=qs[_0xa294('0x36')](_0x53d2a9[_0xa294('0x2f')][_0xa294('0x36')]);_0x170e22['where']=qs[_0xa294('0x37')](_[_0xa294('0x38')](_0x53d2a9['query'],_0x480f0d['filters']),_0x1790b3);if(_0x53d2a9[_0xa294('0x2f')]['filter']){_0x170e22[_0xa294('0x39')]=_[_0xa294('0x3a')](_0x170e22[_0xa294('0x39')],{'$or':_['map'](_0x1790b3,function(_0x4caa31){if(_0x4caa31[_0xa294('0x2c')]!==_0xa294('0x3b')){var _0x50155a={};_0x50155a[_0x4caa31['name']]={'$like':'%'+_0x53d2a9[_0xa294('0x2f')][_0xa294('0x3c')]+'%'};return _0x50155a;}})});}_0x170e22=_['merge']({},_0x170e22,_0x53d2a9[_0xa294('0x3d')]);var _0x17a68c={'where':_0x170e22[_0xa294('0x39')]};return db[_0xa294('0x3e')][_0xa294('0x1e')](_0x17a68c)['then'](function(_0x3ac203){_0x248df9[_0xa294('0x1e')]=_0x3ac203;if(_0x53d2a9[_0xa294('0x2f')]['includeAll']){_0x170e22[_0xa294('0x3f')]=[{'all':!![]}];}return db['Automation'][_0xa294('0x40')](_0x170e22);})[_0xa294('0x25')](function(_0x36de5f){_0x248df9['rows']=_0x36de5f;return _0x248df9;})['then'](respondWithFilteredResult(_0x4ff09a,_0x170e22))[_0xa294('0x41')](handleError(_0x4ff09a,null));};exports[_0xa294('0x42')]=function(_0x432047,_0x4a247c){var _0x17dd2c={'raw':![],'where':{'id':_0x432047[_0xa294('0x43')]['id']}},_0x5d29aa={};_0x5d29aa[_0xa294('0x2e')]=_[_0xa294('0x30')](db[_0xa294('0x3e')][_0xa294('0x44')]);_0x5d29aa['query']=_['keys'](_0x432047['query']);_0x5d29aa[_0xa294('0x37')]=_[_0xa294('0x31')](_0x5d29aa[_0xa294('0x2e')],_0x5d29aa['query']);_0x17dd2c[_0xa294('0x33')]=_[_0xa294('0x31')](_0x5d29aa[_0xa294('0x2e')],qs[_0xa294('0x32')](_0x432047['query']['fields']));_0x17dd2c[_0xa294('0x33')]=_0x17dd2c[_0xa294('0x33')][_0xa294('0x45')]?_0x17dd2c['attributes']:_0x5d29aa[_0xa294('0x2e')];if(_0x432047[_0xa294('0x2f')][_0xa294('0x46')]){_0x17dd2c['include']=[{'all':!![]}];}_0x17dd2c=_[_0xa294('0x3a')]({},_0x17dd2c,_0x432047[_0xa294('0x3d')]);return db[_0xa294('0x3e')][_0xa294('0x47')](_0x17dd2c)[_0xa294('0x25')](handleEntityNotFound(_0x4a247c,null))[_0xa294('0x25')](respondWithResult(_0x4a247c,null))[_0xa294('0x41')](handleError(_0x4a247c,null));};exports[_0xa294('0x48')]=function(_0x39fe9b,_0x5dc90c){return db['Automation']['create'](_0x39fe9b['body'],{})['then'](respondWithResult(_0x5dc90c,0xc9))[_0xa294('0x41')](handleError(_0x5dc90c,null));};exports[_0xa294('0x24')]=function(_0x406427,_0x130759){if(_0x406427[_0xa294('0x49')]['id']){delete _0x406427['body']['id'];}return db[_0xa294('0x3e')][_0xa294('0x47')]({'where':{'id':_0x406427['params']['id']}})[_0xa294('0x25')](handleEntityNotFound(_0x130759,null))[_0xa294('0x25')](saveUpdates(_0x406427[_0xa294('0x49')],null))[_0xa294('0x25')](respondWithResult(_0x130759,null))['catch'](handleError(_0x130759,null));};exports[_0xa294('0x4a')]=function(_0x1e045b,_0x69e456){return db[_0xa294('0x3e')]['find']({'where':{'id':_0x1e045b['params']['id']}})['then'](handleEntityNotFound(_0x69e456,null))[_0xa294('0x25')](removeEntity(_0x69e456,null))[_0xa294('0x41')](handleError(_0x69e456,null));};exports[_0xa294('0x4b')]=function(_0x54ea90,_0x52aeeb,_0x3189af){return db[_0xa294('0x4c')][_0xa294('0x47')]({'where':{'id':_0x54ea90[_0xa294('0x43')]['id']}})[_0xa294('0x25')](handleEntityNotFound(_0x52aeeb,null))[_0xa294('0x25')](function(_0xd50f32){if(_0xd50f32){return _0xd50f32['addConditions'](_0x54ea90[_0xa294('0x49')][_0xa294('0x4d')],_[_0xa294('0x4e')](_0x54ea90['body'],[_0xa294('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x52aeeb,null))[_0xa294('0x41')](handleError(_0x52aeeb,null));};exports[_0xa294('0x4f')]=function(_0x43b0fb,_0x4518fb,_0xf05b91){var _0x3c7b43={};var _0x2a2e47={};var _0x3fba4b;var _0x19e9ac;return db[_0xa294('0x3e')]['findOne']({'where':{'id':_0x43b0fb[_0xa294('0x43')]['id']}})[_0xa294('0x25')](handleEntityNotFound(_0x4518fb,null))[_0xa294('0x25')](function(_0x1c275e){if(_0x1c275e){_0x3fba4b=_0x1c275e;_0x2a2e47[_0xa294('0x2e')]=_['keys'](db[_0xa294('0x4c')]['rawAttributes']);_0x2a2e47[_0xa294('0x2f')]=_[_0xa294('0x30')](_0x43b0fb['query']);_0x2a2e47['filters']=_[_0xa294('0x31')](_0x2a2e47['model'],_0x2a2e47[_0xa294('0x2f')]);_0x3c7b43['attributes']=_['intersection'](_0x2a2e47['model'],qs['fields'](_0x43b0fb[_0xa294('0x2f')][_0xa294('0x32')]));_0x3c7b43[_0xa294('0x33')]=_0x3c7b43[_0xa294('0x33')][_0xa294('0x45')]?_0x3c7b43['attributes']:_0x2a2e47[_0xa294('0x2e')];_0x3c7b43[_0xa294('0x35')]=qs[_0xa294('0x36')](_0x43b0fb[_0xa294('0x2f')]['sort']);_0x3c7b43['where']=qs[_0xa294('0x37')](_[_0xa294('0x38')](_0x43b0fb['query'],_0x2a2e47['filters']));if(_0x43b0fb[_0xa294('0x2f')][_0xa294('0x3c')]){_0x3c7b43[_0xa294('0x39')]=_[_0xa294('0x3a')](_0x3c7b43['where'],{'$or':_[_0xa294('0x2a')](_0x3c7b43['attributes'],function(_0x33dbd4){var _0x31a9c4={};_0x31a9c4[_0x33dbd4]={'$like':'%'+_0x43b0fb['query']['filter']+'%'};return _0x31a9c4;})});}_0x3c7b43=_[_0xa294('0x3a')]({},_0x3c7b43,_0x43b0fb[_0xa294('0x3d')]);return _0x3fba4b[_0xa294('0x4f')](_0x3c7b43);}})['then'](function(_0x5e0875){if(_0x5e0875){_0x19e9ac=_0x5e0875['length'];if(!_0x43b0fb[_0xa294('0x2f')]['hasOwnProperty'](_0xa294('0x34'))){_0x3c7b43['limit']=qs[_0xa294('0x1c')](_0x43b0fb[_0xa294('0x2f')][_0xa294('0x1c')]);_0x3c7b43[_0xa294('0x1b')]=qs[_0xa294('0x1b')](_0x43b0fb[_0xa294('0x2f')][_0xa294('0x1b')]);}return _0x3fba4b[_0xa294('0x4f')](_0x3c7b43);}})['then'](function(_0x56090b){if(_0x56090b){return _0x56090b?{'count':_0x19e9ac,'rows':_0x56090b}:null;}})[_0xa294('0x25')](respondWithResult(_0x4518fb,null))[_0xa294('0x41')](handleError(_0x4518fb,null));};exports[_0xa294('0x50')]=function(_0x14b02e,_0x4197ad,_0x581477){return db[_0xa294('0x51')][_0xa294('0x47')]({'where':{'id':_0x14b02e[_0xa294('0x43')]['id']}})[_0xa294('0x25')](handleEntityNotFound(_0x4197ad,null))[_0xa294('0x25')](function(_0x2672d4){if(_0x2672d4){return _0x2672d4[_0xa294('0x50')](_0x14b02e[_0xa294('0x49')][_0xa294('0x4d')],_['omit'](_0x14b02e[_0xa294('0x49')],[_0xa294('0x4d'),'id'])||{});}})[_0xa294('0x25')](respondWithResult(_0x4197ad,null))['catch'](handleError(_0x4197ad,null));};exports[_0xa294('0x52')]=function(_0x3dd88e,_0x3a1546,_0x281c0f){var _0x2de72c={};var _0x37f6a5={};var _0x552bef;var _0x4638a4;return db[_0xa294('0x3e')][_0xa294('0x53')]({'where':{'id':_0x3dd88e['params']['id']}})['then'](handleEntityNotFound(_0x3a1546,null))['then'](function(_0x452ab7){if(_0x452ab7){_0x552bef=_0x452ab7;_0x37f6a5['model']=_[_0xa294('0x30')](db[_0xa294('0x51')][_0xa294('0x44')]);_0x37f6a5[_0xa294('0x2f')]=_[_0xa294('0x30')](_0x3dd88e[_0xa294('0x2f')]);_0x37f6a5[_0xa294('0x37')]=_[_0xa294('0x31')](_0x37f6a5[_0xa294('0x2e')],_0x37f6a5['query']);_0x2de72c['attributes']=_[_0xa294('0x31')](_0x37f6a5[_0xa294('0x2e')],qs[_0xa294('0x32')](_0x3dd88e[_0xa294('0x2f')][_0xa294('0x32')]));_0x2de72c['attributes']=_0x2de72c['attributes'][_0xa294('0x45')]?_0x2de72c[_0xa294('0x33')]:_0x37f6a5[_0xa294('0x2e')];_0x2de72c[_0xa294('0x35')]=qs[_0xa294('0x36')](_0x3dd88e[_0xa294('0x2f')][_0xa294('0x36')]);_0x2de72c[_0xa294('0x39')]=qs['filters'](_['pick'](_0x3dd88e[_0xa294('0x2f')],_0x37f6a5[_0xa294('0x37')]));if(_0x3dd88e[_0xa294('0x2f')][_0xa294('0x3c')]){_0x2de72c[_0xa294('0x39')]=_[_0xa294('0x3a')](_0x2de72c['where'],{'$or':_['map'](_0x2de72c['attributes'],function(_0x32f736){var _0x4428c2={};_0x4428c2[_0x32f736]={'$like':'%'+_0x3dd88e[_0xa294('0x2f')][_0xa294('0x3c')]+'%'};return _0x4428c2;})});}_0x2de72c=_[_0xa294('0x3a')]({},_0x2de72c,_0x3dd88e[_0xa294('0x3d')]);return _0x552bef['getActions'](_0x2de72c);}})[_0xa294('0x25')](function(_0x2742b7){if(_0x2742b7){_0x4638a4=_0x2742b7[_0xa294('0x45')];if(!_0x3dd88e[_0xa294('0x2f')][_0xa294('0x54')]('nolimit')){_0x2de72c[_0xa294('0x1c')]=qs[_0xa294('0x1c')](_0x3dd88e[_0xa294('0x2f')][_0xa294('0x1c')]);_0x2de72c[_0xa294('0x1b')]=qs[_0xa294('0x1b')](_0x3dd88e[_0xa294('0x2f')]['offset']);}return _0x552bef[_0xa294('0x52')](_0x2de72c);}})[_0xa294('0x25')](function(_0xd22260){if(_0xd22260){return _0xd22260?{'count':_0x4638a4,'rows':_0xd22260}:null;}})['then'](respondWithResult(_0x3a1546,null))[_0xa294('0x41')](handleError(_0x3a1546,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 1bd5ad3..adb4d6f 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 _0x161d=['bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','Automation','tools_automations','util','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x161d,0xf8));var _0xd161=function(_0x79c523,_0x472ff9){_0x79c523=_0x79c523-0x0;var _0x42a0b5=_0x161d[_0x79c523];return _0x42a0b5;};'use strict';var _=require('lodash');var util=require(_0xd161('0x0'));var logger=require('../../config/logger')(_0xd161('0x1'));var moment=require('moment');var BPromise=require(_0xd161('0x2'));var rp=require(_0xd161('0x3'));var fs=require('fs');var path=require(_0xd161('0x4'));var rimraf=require('rimraf');var config=require(_0xd161('0x5'));var attributes=require(_0xd161('0x6'));module[_0xd161('0x7')]=function(_0x1790ac,_0x1bf38b){return _0x1790ac['define'](_0xd161('0x8'),attributes,{'tableName':_0xd161('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5dd=['../../config/environment','./automation.attributes','define','tools_automations','lodash','api','moment','path','rimraf'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0xa5dd,0x1cf));var _0xda5d=function(_0x4a5802,_0xcd0d3d){_0x4a5802=_0x4a5802-0x0;var _0x39ca8b=_0xa5dd[_0x4a5802];return _0x39ca8b;};'use strict';var _=require(_0xda5d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xda5d('0x1'));var moment=require(_0xda5d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xda5d('0x3'));var rimraf=require(_0xda5d('0x4'));var config=require(_0xda5d('0x5'));var attributes=require(_0xda5d('0x6'));module['exports']=function(_0x1eb57c,_0x1e68ab){return _0x1eb57c[_0xda5d('0x7')]('Automation',attributes,{'tableName':_0xda5d('0x8'),'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 b7a976b..272c0cf 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 _0xfd58=['info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','Automation,\x20%s,\x20%s','message'];(function(_0x414cb9,_0x46f345){var _0x4e8abc=function(_0x8d8f13){while(--_0x8d8f13){_0x414cb9['push'](_0x414cb9['shift']());}};_0x4e8abc(++_0x46f345);}(_0xfd58,0xb3));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8fd5('0x0'));var util=require(_0x8fd5('0x1'));var moment=require('moment');var BPromise=require(_0x8fd5('0x2'));var rs=require(_0x8fd5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd5('0x4'))['db'];var utils=require(_0x8fd5('0x5'));var logger=require(_0x8fd5('0x6'))(_0x8fd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x8fd5('0x8'));var client=jayson[_0x8fd5('0x9')][_0x8fd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e10e4,_0x16ac3f,_0x32bad9){return new BPromise(function(_0x273344,_0x1042a1){return client[_0x8fd5('0xb')](_0x4e10e4,_0x32bad9)['then'](function(_0x462ac4){logger['info']('Automation,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'));logger[_0x8fd5('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'),JSON[_0x8fd5('0xe')](_0x462ac4));if(_0x462ac4['error']){if(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x10')]===0x1f4){logger['error'](_0x8fd5('0x11'),_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x1042a1(_0x462ac4[_0x8fd5('0xf')]['message']);}logger['error']('Automation,\x20%s,\x20%s',_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x273344(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);}else{logger[_0x8fd5('0x13')](_0x8fd5('0x11'),_0x16ac3f,_0x8fd5('0xc'));_0x273344(_0x462ac4[_0x8fd5('0x14')][_0x8fd5('0x12')]);}})[_0x8fd5('0x15')](function(_0x53b2dd){logger[_0x8fd5('0xf')](_0x8fd5('0x11'),_0x16ac3f,_0x53b2dd);_0x1042a1(_0x53b2dd);});});}
\ No newline at end of file
+var _0xc5b3=['client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x44c5c1,_0x4d9d55){var _0x467172=function(_0x584e24){while(--_0x584e24){_0x44c5c1['push'](_0x44c5c1['shift']());}};_0x467172(++_0x4d9d55);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0xc5b3[_0x2786ea];return _0x5c38e5;};'use strict';var _=require(_0x3c5b('0x0'));var util=require(_0x3c5b('0x1'));var moment=require(_0x3c5b('0x2'));var BPromise=require(_0x3c5b('0x3'));var rs=require(_0x3c5b('0x4'));var fs=require('fs');var Redis=require(_0x3c5b('0x5'));var db=require(_0x3c5b('0x6'))['db'];var utils=require(_0x3c5b('0x7'));var logger=require('../../config/logger')(_0x3c5b('0x8'));var config=require(_0x3c5b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3c5b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7a363e,_0x4730e9,_0x894f97){return new BPromise(function(_0xae86a0,_0x32586d){return client[_0x3c5b('0xb')](_0x7a363e,_0x894f97)[_0x3c5b('0xc')](function(_0x5f5df9){logger[_0x3c5b('0xd')](_0x3c5b('0xe'),_0x4730e9,_0x3c5b('0xf'));logger[_0x3c5b('0x10')](_0x3c5b('0x11'),_0x4730e9,'request\x20sent',JSON[_0x3c5b('0x12')](_0x5f5df9));if(_0x5f5df9[_0x3c5b('0x13')]){if(_0x5f5df9[_0x3c5b('0x13')][_0x3c5b('0x14')]===0x1f4){logger[_0x3c5b('0x13')](_0x3c5b('0xe'),_0x4730e9,_0x5f5df9[_0x3c5b('0x13')]['message']);return _0x32586d(_0x5f5df9[_0x3c5b('0x13')][_0x3c5b('0x15')]);}logger[_0x3c5b('0x13')](_0x3c5b('0xe'),_0x4730e9,_0x5f5df9['error'][_0x3c5b('0x15')]);return _0xae86a0(_0x5f5df9['error'][_0x3c5b('0x15')]);}else{logger[_0x3c5b('0xd')]('Automation,\x20%s,\x20%s',_0x4730e9,_0x3c5b('0xf'));_0xae86a0(_0x5f5df9[_0x3c5b('0x16')]['message']);}})[_0x3c5b('0x17')](function(_0x1cbe52){logger[_0x3c5b('0x13')]('Automation,\x20%s,\x20%s',_0x4730e9,_0x1cbe52);_0x32586d(_0x1cbe52);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index cc41b4d..4868a51 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 _0xf097=['update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','/:id'];(function(_0x423d89,_0x440a2d){var _0x417221=function(_0x2eda1a){while(--_0x2eda1a){_0x423d89['push'](_0x423d89['shift']());}};_0x417221(++_0x440a2d);}(_0xf097,0x1b2));var _0x7f09=function(_0x2c7b9b,_0x418263){_0x2c7b9b=_0x2c7b9b-0x0;var _0x169383=_0xf097[_0x2c7b9b];return _0x169383;};'use strict';var multer=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var path=require(_0x7f09('0x2'));var timeout=require(_0x7f09('0x3'));var express=require(_0x7f09('0x4'));var router=express[_0x7f09('0x5')]();var fs_extra=require(_0x7f09('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f09('0x7'));router[_0x7f09('0x8')]('/',auth[_0x7f09('0x9')](),controller[_0x7f09('0xa')]);router[_0x7f09('0x8')]('/:id',auth[_0x7f09('0x9')](),controller[_0x7f09('0xb')]);router['get'](_0x7f09('0xc'),auth[_0x7f09('0x9')](),controller[_0x7f09('0xd')]);router[_0x7f09('0x8')]('/:id/actions',auth[_0x7f09('0x9')](),controller[_0x7f09('0xe')]);router[_0x7f09('0xf')]('/',auth[_0x7f09('0x9')](),controller[_0x7f09('0x10')]);router[_0x7f09('0xf')](_0x7f09('0xc'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x11')]);router[_0x7f09('0xf')](_0x7f09('0x12'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x13')]);router[_0x7f09('0x14')](_0x7f09('0x15'),auth['isAuthenticated'](),controller[_0x7f09('0x16')]);router['delete'](_0x7f09('0x15'),auth['isAuthenticated'](),controller[_0x7f09('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xe18e=['/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','addActions','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index'];(function(_0x112076,_0x152414){var _0x5dbca4=function(_0x203bf2){while(--_0x203bf2){_0x112076['push'](_0x112076['shift']());}};_0x5dbca4(++_0x152414);}(_0xe18e,0xe5));var _0xee18=function(_0x4fcbe6,_0x2f02e7){_0x4fcbe6=_0x4fcbe6-0x0;var _0x4e1cd2=_0xe18e[_0x4fcbe6];return _0x4e1cd2;};'use strict';var multer=require(_0xee18('0x0'));var util=require(_0xee18('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xee18('0x2'));var router=express[_0xee18('0x3')]();var fs_extra=require(_0xee18('0x4'));var auth=require(_0xee18('0x5'));var interaction=require(_0xee18('0x6'));var config=require('../../config/environment');var controller=require(_0xee18('0x7'));router[_0xee18('0x8')]('/',auth[_0xee18('0x9')](),controller[_0xee18('0xa')]);router[_0xee18('0x8')](_0xee18('0xb'),auth[_0xee18('0x9')](),controller[_0xee18('0xc')]);router[_0xee18('0x8')](_0xee18('0xd'),auth['isAuthenticated'](),controller[_0xee18('0xe')]);router['get']('/:id/actions',auth[_0xee18('0x9')](),controller[_0xee18('0xf')]);router[_0xee18('0x10')]('/',auth[_0xee18('0x9')](),controller[_0xee18('0x11')]);router[_0xee18('0x10')](_0xee18('0xd'),auth[_0xee18('0x9')](),controller[_0xee18('0x12')]);router[_0xee18('0x10')]('/:id/actions',auth[_0xee18('0x9')](),controller[_0xee18('0x13')]);router[_0xee18('0x14')](_0xee18('0xb'),auth[_0xee18('0x9')](),controller[_0xee18('0x15')]);router['delete'](_0xee18('0xb'),auth['isAuthenticated'](),controller[_0xee18('0x16')]);module[_0xee18('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5078126..a213287 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 _0x6c98=['#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x5492ce,_0x129ad1){var _0x3082ca=function(_0x1b1d74){while(--_0x1b1d74){_0x5492ce['push'](_0x5492ce['shift']());}};_0x3082ca(++_0x129ad1);}(_0x6c98,0x7c));var _0x86c9=function(_0x271ebd,_0x25dc7b){_0x271ebd=_0x271ebd-0x0;var _0x1d11f5=_0x6c98[_0x271ebd];return _0x1d11f5;};'use strict';var Sequelize=require(_0x86c9('0x0'));module[_0x86c9('0x1')]={'name':{'type':Sequelize[_0x86c9('0x2')],'unique':_0x86c9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x86c9('0x4')](_0x86c9('0x5')),'allowNull':![],'defaultValue':_0x86c9('0x5')},'description':{'type':Sequelize[_0x86c9('0x2')]},'active':{'type':Sequelize[_0x86c9('0x6')],'defaultValue':0x0,'comment':_0x86c9('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x86c9('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x86c9('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x86c9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x86c9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x86c9('0xa')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86c9('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x86c9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86c9('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x86c9('0xa')](0x5)[_0x86c9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86c9('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x86c9('0xa')](0x3)[_0x86c9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86c9('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x86c9('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86c9('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x86c9('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x86c9('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x86c9('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x86c9('0x10')},'dialTimezone':{'type':Sequelize[_0x86c9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x86c9('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x86c9('0x4')](_0x86c9('0x11'),_0x86c9('0x12'),_0x86c9('0x13')),'defaultValue':_0x86c9('0x11')},'dialAMDActive':{'type':Sequelize[_0x86c9('0x6')],'defaultValue':0x0,'comment':_0x86c9('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x86c9('0xa')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x86c9('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x86c9('0xa')](0x9)[_0x86c9('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x86c9('0xa')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x86c9('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x86c9('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x86c9('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x86c9('0xa')](0x9)[_0x86c9('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x86c9('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x86c9('0xa')](0x9)[_0x86c9('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x86c9('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x86c9('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x86c9('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x86c9('0xa')](0x5)[_0x86c9('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x86c9('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x86c9('0xa')](0x9)[_0x86c9('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x86c9('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x86c9('0x4')]('DESC','ASC'),'defaultValue':_0x86c9('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x86c9('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x86c9('0x1e')},'dialCutDigit':{'type':Sequelize[_0x86c9('0xa')](0x3)[_0x86c9('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x86c9('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x86c9('0xa')](0x3)[_0x86c9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x86c9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86c9('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x86c9('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86c9('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x86c9('0xa')](0x5)[_0x86c9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x86c9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x86c9('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x86c9('0xa')](0x5)[_0x86c9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86c9('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x86c9('0xa')](0x5)[_0x86c9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86c9('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x86c9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x86c9('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x86c9('0x25')}};
\ No newline at end of file
+var _0xe51d=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','STRING','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','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)'];(function(_0x11aee5,_0x27fa94){var _0x2e8c9d=function(_0x33ff83){while(--_0x33ff83){_0x11aee5['push'](_0x11aee5['shift']());}};_0x2e8c9d(++_0x27fa94);}(_0xe51d,0x9c));var _0xde51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe51d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xde51('0x0'));module[_0xde51('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xde51('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xde51('0x3')](_0xde51('0x4')),'allowNull':![],'defaultValue':_0xde51('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xde51('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xde51('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xde51('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xde51('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde51('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xde51('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde51('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xde51('0x9')](0x5)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'defaultValue':0x3,'comment':_0xde51('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xde51('0x9')](0x5)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde51('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xde51('0xe')},'dialTimezone':{'type':Sequelize[_0xde51('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xde51('0x8')],'defaultValue':_0xde51('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xde51('0x10'),_0xde51('0x11'),_0xde51('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xde51('0x5')],'defaultValue':0x0,'comment':_0xde51('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xde51('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xde51('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xde51('0x9')](0x9)[_0xde51('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xde51('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xde51('0x9')](0x9)[_0xde51('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xde51('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xde51('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xde51('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xde51('0x9')](0x9)[_0xde51('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xde51('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xde51('0x9')](0x9)[_0xde51('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xde51('0x9')](0x9)[_0xde51('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xde51('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xde51('0x9')](0x5)[_0xde51('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xde51('0x9')](0x9)[_0xde51('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xde51('0x3')](_0xde51('0x1a'),_0xde51('0x1b')),'defaultValue':_0xde51('0x1a')},'dialPrefix':{'type':Sequelize[_0xde51('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde51('0x1c')},'dialCutDigit':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde51('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde51('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xde51('0x9')](0x5)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde51('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde51('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde51('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde51('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xde51('0x9')](0x5)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde51('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)[_0xde51('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde51('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xde51('0x9')](0x5)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xde51('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde51('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xde51('0x9')](0x5)[_0xde51('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5af0a2f..a240cf8 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 _0x314b=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','order','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ListId','field','ContactId','CmListId','toString','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','json','offset','undefined','limit','count','status','set','Content-Range','save','update','then','destroy','get','IvrCampaigns','end','sendStatus','error','name','send','index','map','Campaign','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','options','includeAll','include','rows','show','params','rawAttributes','fields','merge','find','create'];(function(_0xaa5d96,_0x2854eb){var _0x33e21e=function(_0x3bc2b9){while(--_0x3bc2b9){_0xaa5d96['push'](_0xaa5d96['shift']());}};_0x33e21e(++_0x2854eb);}(_0x314b,0x154));var _0xb314=function(_0x4c8232,_0x4e0dea){_0x4c8232=_0x4c8232-0x0;var _0x3cc8e5=_0x314b[_0x4c8232];return _0x3cc8e5;};'use strict';var emlformat=require(_0xb314('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb314('0x1'));var jsonpatch=require(_0xb314('0x2'));var rp=require(_0xb314('0x3'));var moment=require(_0xb314('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb314('0x5'));var util=require(_0xb314('0x6'));var path=require(_0xb314('0x7'));var sox=require(_0xb314('0x8'));var csv=require(_0xb314('0x9'));var ejs=require(_0xb314('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb314('0xb'));var squel=require(_0xb314('0xc'));var crypto=require(_0xb314('0xd'));var jsforce=require(_0xb314('0xe'));var deskjs=require(_0xb314('0xf'));var toCsv=require(_0xb314('0x9'));var querystring=require(_0xb314('0x10'));var Papa=require(_0xb314('0x11'));var Redis=require(_0xb314('0x12'));var authService=require(_0xb314('0x13'));var qs=require(_0xb314('0x14'));var as=require(_0xb314('0x15'));var hardwareService=require(_0xb314('0x16'));var logger=require(_0xb314('0x17'))(_0xb314('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb314('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e4d5,_0xf17697){_0xf17697=_0xf17697||0xcc;return function(_0x264d4d){if(_0x264d4d){return _0x48e4d5['sendStatus'](_0xf17697);}return _0x48e4d5['status'](_0xf17697)['end']();};}function respondWithResult(_0x314e6c,_0x18bc13){_0x18bc13=_0x18bc13||0xc8;return function(_0x56e3c8){if(_0x56e3c8){return _0x314e6c['status'](_0x18bc13)[_0xb314('0x1a')](_0x56e3c8);}};}function respondWithFilteredResult(_0x89cc00,_0x49a69d){return function(_0x3c4e7a){if(_0x3c4e7a){var _0x47bc93=typeof _0x49a69d[_0xb314('0x1b')]===_0xb314('0x1c')&&typeof _0x49a69d[_0xb314('0x1d')]==='undefined';var _0x3961b3=_0x3c4e7a[_0xb314('0x1e')];var _0x3bbb9f=_0x47bc93?0x0:_0x49a69d[_0xb314('0x1b')];var _0x30e6b7=_0x47bc93?_0x3c4e7a['count']:_0x49a69d[_0xb314('0x1b')]+_0x49a69d['limit'];var _0xf3a125;if(_0x30e6b7>=_0x3961b3){_0x30e6b7=_0x3961b3;_0xf3a125=0xc8;}else{_0xf3a125=0xce;}_0x89cc00[_0xb314('0x1f')](_0xf3a125);return _0x89cc00[_0xb314('0x20')](_0xb314('0x21'),_0x3bbb9f+'-'+_0x30e6b7+'/'+_0x3961b3)[_0xb314('0x1a')](_0x3c4e7a);}return null;};}function patchUpdates(_0x27f614){return function(_0x273383){try{jsonpatch['apply'](_0x273383,_0x27f614,!![]);}catch(_0x40c941){return BPromise['reject'](_0x40c941);}return _0x273383[_0xb314('0x22')]();};}function saveUpdates(_0x54b463,_0x3eea7d){return function(_0x3e76fe){if(_0x3e76fe){return _0x3e76fe[_0xb314('0x23')](_0x54b463)[_0xb314('0x24')](function(_0x4f62c0){return _0x4f62c0;});}return null;};}function removeEntity(_0x412a1b,_0x5a6a96){return function(_0x2c3aa3){if(_0x2c3aa3){return _0x2c3aa3[_0xb314('0x25')]()['then'](function(){var _0x397bd5=_0x2c3aa3[_0xb314('0x26')]({'plain':!![]});var _0x4d51c6=_0xb314('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4d51c6,'resourceId':_0x397bd5['id']}})['then'](function(){return _0x2c3aa3;});})[_0xb314('0x24')](function(){_0x412a1b['status'](0xcc)[_0xb314('0x28')]();});}};}function handleEntityNotFound(_0x1d678f,_0x67916f){return function(_0x597786){if(!_0x597786){_0x1d678f[_0xb314('0x29')](0x194);}return _0x597786;};}function handleError(_0x42af57,_0x3dec11){_0x3dec11=_0x3dec11||0x1f4;return function(_0x3f9582){logger[_0xb314('0x2a')](_0x3f9582['stack']);if(_0x3f9582['name']){delete _0x3f9582[_0xb314('0x2b')];}_0x42af57[_0xb314('0x1f')](_0x3dec11)[_0xb314('0x2c')](_0x3f9582);};}exports[_0xb314('0x2d')]=function(_0x344c4f,_0x2d688b){var _0x12a79e={},_0x5cfb5b={},_0x299d0e={'count':0x0,'rows':[]};var _0x122867=_[_0xb314('0x2e')](db[_0xb314('0x2f')]['rawAttributes'],function(_0x25e875){return{'name':_0x25e875[_0xb314('0x30')],'type':_0x25e875[_0xb314('0x31')][_0xb314('0x32')]};});_0x5cfb5b[_0xb314('0x33')]=_['map'](_0x122867,'name');_0x5cfb5b['query']=_[_0xb314('0x34')](_0x344c4f[_0xb314('0x35')]);_0x5cfb5b[_0xb314('0x36')]=_[_0xb314('0x37')](_0x5cfb5b[_0xb314('0x33')],_0x5cfb5b[_0xb314('0x35')]);_0x12a79e['attributes']=_[_0xb314('0x37')](_0x5cfb5b[_0xb314('0x33')],qs['fields'](_0x344c4f[_0xb314('0x35')]['fields']));_0x12a79e[_0xb314('0x38')]=_0x12a79e[_0xb314('0x38')][_0xb314('0x39')]?_0x12a79e[_0xb314('0x38')]:_0x5cfb5b[_0xb314('0x33')];if(!_0x344c4f[_0xb314('0x35')]['hasOwnProperty'](_0xb314('0x3a'))){_0x12a79e['limit']=qs[_0xb314('0x1d')](_0x344c4f[_0xb314('0x35')][_0xb314('0x1d')]);_0x12a79e[_0xb314('0x1b')]=qs['offset'](_0x344c4f[_0xb314('0x35')]['offset']);}_0x12a79e['order']=qs[_0xb314('0x3b')](_0x344c4f[_0xb314('0x35')][_0xb314('0x3b')]);_0x12a79e[_0xb314('0x3c')]=qs[_0xb314('0x36')](_[_0xb314('0x3d')](_0x344c4f[_0xb314('0x35')],_0x5cfb5b[_0xb314('0x36')]),_0x122867);if(_0x344c4f[_0xb314('0x35')][_0xb314('0x3e')]){_0x12a79e['where']=_['merge'](_0x12a79e[_0xb314('0x3c')],{'$or':_[_0xb314('0x2e')](_0x122867,function(_0x57249a){if(_0x57249a[_0xb314('0x31')]!=='VIRTUAL'){var _0x163c2c={};_0x163c2c[_0x57249a['name']]={'$like':'%'+_0x344c4f[_0xb314('0x35')][_0xb314('0x3e')]+'%'};return _0x163c2c;}})});}_0x12a79e=_['merge']({},_0x12a79e,_0x344c4f[_0xb314('0x3f')]);var _0x1dd52e={'where':_0x12a79e[_0xb314('0x3c')]};return db['Campaign']['count'](_0x1dd52e)[_0xb314('0x24')](function(_0x14f368){_0x299d0e[_0xb314('0x1e')]=_0x14f368;if(_0x344c4f['query'][_0xb314('0x40')]){_0x12a79e[_0xb314('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x12a79e);})[_0xb314('0x24')](function(_0x3f1504){_0x299d0e[_0xb314('0x42')]=_0x3f1504;return _0x299d0e;})[_0xb314('0x24')](respondWithFilteredResult(_0x2d688b,_0x12a79e))['catch'](handleError(_0x2d688b,null));};exports[_0xb314('0x43')]=function(_0x208ed3,_0x1a3922){var _0x501d26={'raw':![],'where':{'id':_0x208ed3[_0xb314('0x44')]['id']}},_0x2fe237={};_0x2fe237['model']=_['keys'](db['Campaign'][_0xb314('0x45')]);_0x2fe237[_0xb314('0x35')]=_[_0xb314('0x34')](_0x208ed3[_0xb314('0x35')]);_0x2fe237[_0xb314('0x36')]=_[_0xb314('0x37')](_0x2fe237[_0xb314('0x33')],_0x2fe237[_0xb314('0x35')]);_0x501d26[_0xb314('0x38')]=_[_0xb314('0x37')](_0x2fe237[_0xb314('0x33')],qs[_0xb314('0x46')](_0x208ed3[_0xb314('0x35')][_0xb314('0x46')]));_0x501d26[_0xb314('0x38')]=_0x501d26[_0xb314('0x38')]['length']?_0x501d26[_0xb314('0x38')]:_0x2fe237[_0xb314('0x33')];if(_0x208ed3[_0xb314('0x35')][_0xb314('0x40')]){_0x501d26['include']=[{'all':!![]}];}_0x501d26=_[_0xb314('0x47')]({},_0x501d26,_0x208ed3[_0xb314('0x3f')]);return db[_0xb314('0x2f')][_0xb314('0x48')](_0x501d26)[_0xb314('0x24')](handleEntityNotFound(_0x1a3922,null))['then'](respondWithResult(_0x1a3922,null))['catch'](handleError(_0x1a3922,null));};exports[_0xb314('0x49')]=function(_0xfddbe3,_0x64e230){return db[_0xb314('0x2f')]['create'](_0xfddbe3[_0xb314('0x4a')],{})[_0xb314('0x24')](function(_0x485346){var _0x59e917=_0xfddbe3['user'][_0xb314('0x26')]({'plain':!![]});if(!_0x59e917)throw new Error(_0xb314('0x4b'));if(_0x59e917['role']==='user'){var _0x380da2=_0x485346[_0xb314('0x26')]({'plain':!![]});var _0x1dc758='IvrCampaigns';return db[_0xb314('0x4c')][_0xb314('0x48')]({'where':{'name':_0x1dc758,'userProfileId':_0x59e917[_0xb314('0x4d')]},'raw':!![]})[_0xb314('0x24')](function(_0x129987){if(_0x129987&&_0x129987['autoAssociation']===0x0){return db[_0xb314('0x4e')]['create']({'name':_0x380da2[_0xb314('0x2b')],'resourceId':_0x380da2['id'],'type':_0x129987[_0xb314('0x2b')],'sectionId':_0x129987['id']},{})[_0xb314('0x24')](function(){return _0x485346;});}else{return _0x485346;}})[_0xb314('0x4f')](function(_0x226abb){logger['error'](_0xb314('0x50'),_0x226abb);throw _0x226abb;});}return _0x485346;})[_0xb314('0x24')](respondWithResult(_0x64e230,0xc9))['catch'](handleError(_0x64e230,null));};exports[_0xb314('0x51')]=function(_0x4ecdae,_0x3d6e47){var _0x4f3da9={'where':{'id':_0x4ecdae[_0xb314('0x44')]['id']}},_0x182bb0={};_0x182bb0['model']=_['keys'](db[_0xb314('0x2f')][_0xb314('0x45')]);_0x4f3da9[_0xb314('0x38')]=_[_0xb314('0x37')](_0x182bb0[_0xb314('0x33')],qs['fields'](_0x4ecdae[_0xb314('0x35')]['fields']));_0x4f3da9['attributes']=_0x4f3da9[_0xb314('0x38')]['length']?_0x4f3da9['attributes']:_0x182bb0['model'];if(_0x4ecdae[_0xb314('0x35')][_0xb314('0x40')]){_0x4f3da9[_0xb314('0x41')]=[{'all':!![]}];}_0x4f3da9=_[_0xb314('0x47')]({},_0x4f3da9,_0x4ecdae[_0xb314('0x3f')]);return db[_0xb314('0x2f')]['find'](_0x4f3da9)[_0xb314('0x24')](handleEntityNotFound(_0x3d6e47,null))[_0xb314('0x24')](function(_0x40d736){if(_0x40d736){var _0x5b406d=_0x40d736[_0xb314('0x26')]({'plain':!![]});_0x5b406d=qs['omit'](_0x5b406d,['id',_0xb314('0x52'),'updatedAt']);_0x4ecdae[_0xb314('0x4a')]=_[_0xb314('0x53')](_0x4ecdae[_0xb314('0x4a')],['id',_0xb314('0x52'),_0xb314('0x54')]);return db[_0xb314('0x2f')]['create'](_[_0xb314('0x47')](_0x5b406d,_0x4ecdae[_0xb314('0x4a')]),{'include':_0x4ecdae[_0xb314('0x35')][_0xb314('0x40')]?[{'all':!![]}]:undefined})[_0xb314('0x24')](function(_0x346030){var _0x1a272b=_0x4ecdae['user']['get']({'plain':!![]});if(!_0x1a272b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a272b['role']==='user'){var _0x2d04cb=_0x346030['get']({'plain':!![]});var _0x14aa47='IvrCampaigns';return db['UserProfileSection'][_0xb314('0x48')]({'where':{'name':_0x14aa47,'userProfileId':_0x1a272b['userProfileId']},'raw':!![]})[_0xb314('0x24')](function(_0x367765){if(_0x367765&&_0x367765[_0xb314('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d04cb[_0xb314('0x2b')],'resourceId':_0x2d04cb['id'],'type':_0x367765[_0xb314('0x2b')],'sectionId':_0x367765['id']},{})[_0xb314('0x24')](function(){return _0x346030;});}else{return _0x346030;}})['catch'](function(_0x2c69f6){logger['error'](_0xb314('0x50'),_0x2c69f6);throw _0x2c69f6;});}return _0x346030;});}})[_0xb314('0x24')](respondWithResult(_0x3d6e47,0xc9))[_0xb314('0x4f')](handleError(_0x3d6e47,null));};exports[_0xb314('0x23')]=function(_0x19683c,_0x262f43){if(_0x19683c['body']['id']){delete _0x19683c[_0xb314('0x4a')]['id'];}return db[_0xb314('0x2f')][_0xb314('0x48')]({'where':{'id':_0x19683c[_0xb314('0x44')]['id']}})['then'](handleEntityNotFound(_0x262f43,null))[_0xb314('0x24')](saveUpdates(_0x19683c[_0xb314('0x4a')],null))[_0xb314('0x24')](respondWithResult(_0x262f43,null))[_0xb314('0x4f')](handleError(_0x262f43,null));};exports[_0xb314('0x25')]=function(_0x30d854,_0x2dfc64){return db[_0xb314('0x2f')][_0xb314('0x48')]({'where':{'id':_0x30d854[_0xb314('0x44')]['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x2dfc64,null))[_0xb314('0x24')](removeEntity(_0x2dfc64,null))[_0xb314('0x4f')](handleError(_0x2dfc64,null));};exports[_0xb314('0x56')]=function(_0x7e11aa,_0x2ef60b,_0x2396a4){var _0x27b3ea={'raw':!![],'where':{}};var _0x49f8ae={};var _0x503d58={'count':0x0,'rows':[]};return db[_0xb314('0x2f')][_0xb314('0x57')]({'where':{'id':_0x7e11aa[_0xb314('0x44')]['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x2ef60b,null))['then'](function(_0x1c3d48){if(_0x1c3d48){_0x49f8ae[_0xb314('0x33')]=_[_0xb314('0x34')](db[_0xb314('0x58')]['rawAttributes']);_0x49f8ae[_0xb314('0x35')]=_[_0xb314('0x34')](_0x7e11aa['query']);_0x49f8ae[_0xb314('0x36')]=_[_0xb314('0x37')](_0x49f8ae['model'],_0x49f8ae[_0xb314('0x35')]);_0x27b3ea[_0xb314('0x38')]=_[_0xb314('0x37')](_0x49f8ae['model'],qs[_0xb314('0x46')](_0x7e11aa[_0xb314('0x35')][_0xb314('0x46')]));_0x27b3ea[_0xb314('0x38')]=_0x27b3ea['attributes'][_0xb314('0x39')]?_0x27b3ea['attributes']:_0x49f8ae['model'];if(!_0x7e11aa['query'][_0xb314('0x59')](_0xb314('0x3a'))){_0x27b3ea[_0xb314('0x1d')]=qs[_0xb314('0x1d')](_0x7e11aa[_0xb314('0x35')][_0xb314('0x1d')]);_0x27b3ea['offset']=qs[_0xb314('0x1b')](_0x7e11aa[_0xb314('0x35')]['offset']);}_0x27b3ea['order']=qs[_0xb314('0x3b')](_0x7e11aa[_0xb314('0x35')][_0xb314('0x3b')]);_0x27b3ea[_0xb314('0x3c')]=qs[_0xb314('0x36')](_['pick'](_0x7e11aa[_0xb314('0x35')],_0x49f8ae[_0xb314('0x36')]));_0x27b3ea[_0xb314('0x3c')][_0xb314('0x5a')]=_0x1c3d48['id'];if(_0x7e11aa[_0xb314('0x35')][_0xb314('0x3e')]){_0x27b3ea[_0xb314('0x3c')]=_['merge'](_0x27b3ea[_0xb314('0x3c')],{'$or':_[_0xb314('0x2e')](_0x27b3ea[_0xb314('0x38')],function(_0x4e2901){var _0x1d73ad={};_0x1d73ad[_0x4e2901]={'$like':'%'+_0x7e11aa[_0xb314('0x35')][_0xb314('0x3e')]+'%'};return _0x1d73ad;})});}_0x27b3ea=_['merge']({},_0x27b3ea,_0x7e11aa[_0xb314('0x3f')]);return db[_0xb314('0x58')][_0xb314('0x1e')]({'where':_0x27b3ea[_0xb314('0x3c')]})[_0xb314('0x24')](function(_0x44e104){_0x503d58['count']=_0x44e104;if(_0x7e11aa[_0xb314('0x35')]['includeAll']){_0x27b3ea[_0xb314('0x41')]=[{'all':!![]}];}return db['CmHopper'][_0xb314('0x5b')](_0x27b3ea);})['then'](function(_0x3c7802){_0x503d58[_0xb314('0x42')]=_0x3c7802;return _0x503d58;});}})[_0xb314('0x24')](respondWithFilteredResult(_0x2ef60b,_0x27b3ea))[_0xb314('0x4f')](handleError(_0x2ef60b,null));};exports[_0xb314('0x5c')]=function(_0x4e8edd,_0x106426,_0x5550e6){var _0x5baecc={'raw':!![],'where':{}};var _0x1b165b={};var _0x3962e8={'count':0x0,'rows':[]};return db['Campaign'][_0xb314('0x57')]({'where':{'id':_0x4e8edd[_0xb314('0x44')]['id']}})['then'](handleEntityNotFound(_0x106426,null))[_0xb314('0x24')](function(_0x5785a0){if(_0x5785a0){_0x1b165b[_0xb314('0x33')]=_[_0xb314('0x34')](db[_0xb314('0x5d')][_0xb314('0x45')]);_0x1b165b[_0xb314('0x35')]=_['keys'](_0x4e8edd[_0xb314('0x35')]);_0x1b165b[_0xb314('0x36')]=_['intersection'](_0x1b165b[_0xb314('0x33')],_0x1b165b[_0xb314('0x35')]);_0x5baecc[_0xb314('0x38')]=_['intersection'](_0x1b165b[_0xb314('0x33')],qs[_0xb314('0x46')](_0x4e8edd[_0xb314('0x35')][_0xb314('0x46')]));_0x5baecc['attributes']=_0x5baecc[_0xb314('0x38')][_0xb314('0x39')]?_0x5baecc['attributes']:_0x1b165b[_0xb314('0x33')];if(!_0x4e8edd[_0xb314('0x35')][_0xb314('0x59')](_0xb314('0x3a'))){_0x5baecc[_0xb314('0x1d')]=qs[_0xb314('0x1d')](_0x4e8edd['query'][_0xb314('0x1d')]);_0x5baecc[_0xb314('0x1b')]=qs['offset'](_0x4e8edd['query'][_0xb314('0x1b')]);}_0x5baecc['order']=qs[_0xb314('0x3b')](_0x4e8edd[_0xb314('0x35')]['sort']);_0x5baecc[_0xb314('0x3c')]=qs['filters'](_[_0xb314('0x3d')](_0x4e8edd[_0xb314('0x35')],_0x1b165b['filters']));_0x5baecc[_0xb314('0x3c')]['CampaignId']=_0x5785a0['id'];if(_0x4e8edd[_0xb314('0x35')][_0xb314('0x3e')]){_0x5baecc['where']=_[_0xb314('0x47')](_0x5baecc[_0xb314('0x3c')],{'$or':_[_0xb314('0x2e')](_0x5baecc[_0xb314('0x38')],function(_0x540ea3){var _0x4b139e={};_0x4b139e[_0x540ea3]={'$like':'%'+_0x4e8edd[_0xb314('0x35')][_0xb314('0x3e')]+'%'};return _0x4b139e;})});}_0x5baecc=_['merge']({},_0x5baecc,_0x4e8edd[_0xb314('0x3f')]);return db[_0xb314('0x5d')]['count']({'where':_0x5baecc[_0xb314('0x3c')]})['then'](function(_0x508402){_0x3962e8[_0xb314('0x1e')]=_0x508402;if(_0x4e8edd[_0xb314('0x35')][_0xb314('0x40')]){_0x5baecc['include']=[{'all':!![]}];}return db[_0xb314('0x5d')][_0xb314('0x5b')](_0x5baecc);})['then'](function(_0x4c7ffa){_0x3962e8[_0xb314('0x42')]=_0x4c7ffa;return _0x3962e8;});}})[_0xb314('0x24')](respondWithFilteredResult(_0x106426,_0x5baecc))['catch'](handleError(_0x106426,null));};exports[_0xb314('0x5e')]=function(_0xa49c3,_0x36bdfc,_0x36aef7){var _0x560de0={'raw':!![],'where':{}};var _0xaf6c5f={};var _0x44476d={'count':0x0,'rows':[]};return db['Campaign'][_0xb314('0x57')]({'where':{'id':_0xa49c3[_0xb314('0x44')]['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x36bdfc,null))['then'](function(_0x240ff9){if(_0x240ff9){_0xaf6c5f[_0xb314('0x33')]=_[_0xb314('0x34')](db['CmHopperFinal']['rawAttributes']);_0xaf6c5f[_0xb314('0x35')]=_[_0xb314('0x34')](_0xa49c3[_0xb314('0x35')]);_0xaf6c5f['filters']=_[_0xb314('0x37')](_0xaf6c5f[_0xb314('0x33')],_0xaf6c5f[_0xb314('0x35')]);_0x560de0[_0xb314('0x38')]=_[_0xb314('0x37')](_0xaf6c5f[_0xb314('0x33')],qs['fields'](_0xa49c3[_0xb314('0x35')][_0xb314('0x46')]));_0x560de0[_0xb314('0x38')]=_0x560de0[_0xb314('0x38')]['length']?_0x560de0[_0xb314('0x38')]:_0xaf6c5f[_0xb314('0x33')];if(!_0xa49c3[_0xb314('0x35')]['hasOwnProperty'](_0xb314('0x3a'))){_0x560de0[_0xb314('0x1d')]=qs[_0xb314('0x1d')](_0xa49c3[_0xb314('0x35')]['limit']);_0x560de0[_0xb314('0x1b')]=qs[_0xb314('0x1b')](_0xa49c3['query']['offset']);}_0x560de0['order']=qs[_0xb314('0x3b')](_0xa49c3[_0xb314('0x35')][_0xb314('0x3b')]);_0x560de0[_0xb314('0x3c')]=qs[_0xb314('0x36')](_[_0xb314('0x3d')](_0xa49c3[_0xb314('0x35')],_0xaf6c5f[_0xb314('0x36')]));_0x560de0[_0xb314('0x3c')][_0xb314('0x5a')]=_0x240ff9['id'];if(_0xa49c3[_0xb314('0x35')][_0xb314('0x3e')]){_0x560de0[_0xb314('0x3c')]=_[_0xb314('0x47')](_0x560de0[_0xb314('0x3c')],{'$or':_[_0xb314('0x2e')](_0x560de0[_0xb314('0x38')],function(_0x15b775){var _0x3e7712={};_0x3e7712[_0x15b775]={'$like':'%'+_0xa49c3[_0xb314('0x35')][_0xb314('0x3e')]+'%'};return _0x3e7712;})});}_0x560de0=_[_0xb314('0x47')]({},_0x560de0,_0xa49c3[_0xb314('0x3f')]);return db[_0xb314('0x5f')][_0xb314('0x1e')]({'where':_0x560de0[_0xb314('0x3c')]})[_0xb314('0x24')](function(_0x121a67){_0x44476d[_0xb314('0x1e')]=_0x121a67;if(_0xa49c3['query']['includeAll']){_0x560de0['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xb314('0x5b')](_0x560de0);})[_0xb314('0x24')](function(_0x15e33a){_0x44476d['rows']=_0x15e33a;return _0x44476d;});}})[_0xb314('0x24')](respondWithFilteredResult(_0x36bdfc,_0x560de0))[_0xb314('0x4f')](handleError(_0x36bdfc,null));};exports[_0xb314('0x60')]=function(_0x19c764,_0x257f85,_0x2ed3cc){var _0x2e9158={'raw':!![],'where':{}};var _0x4d09e1={};var _0x19f8a7={'count':0x0,'rows':[]};return db[_0xb314('0x2f')][_0xb314('0x57')]({'where':{'id':_0x19c764['params']['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x257f85,null))[_0xb314('0x24')](function(_0x2d0e8b){if(_0x2d0e8b){_0x4d09e1[_0xb314('0x33')]=_[_0xb314('0x34')](db[_0xb314('0x61')][_0xb314('0x45')]);_0x4d09e1[_0xb314('0x35')]=_['keys'](_0x19c764[_0xb314('0x35')]);_0x4d09e1[_0xb314('0x36')]=_[_0xb314('0x37')](_0x4d09e1[_0xb314('0x33')],_0x4d09e1['query']);_0x2e9158['attributes']=_[_0xb314('0x37')](_0x4d09e1['model'],qs['fields'](_0x19c764[_0xb314('0x35')]['fields']));_0x2e9158['attributes']=_0x2e9158[_0xb314('0x38')][_0xb314('0x39')]?_0x2e9158[_0xb314('0x38')]:_0x4d09e1[_0xb314('0x33')];if(!_0x19c764['query'][_0xb314('0x59')](_0xb314('0x3a'))){_0x2e9158['limit']=qs[_0xb314('0x1d')](_0x19c764[_0xb314('0x35')][_0xb314('0x1d')]);_0x2e9158['offset']=qs[_0xb314('0x1b')](_0x19c764[_0xb314('0x35')][_0xb314('0x1b')]);}_0x2e9158[_0xb314('0x62')]=qs[_0xb314('0x3b')](_0x19c764[_0xb314('0x35')]['sort']);_0x2e9158[_0xb314('0x3c')]=qs[_0xb314('0x36')](_[_0xb314('0x3d')](_0x19c764[_0xb314('0x35')],_0x4d09e1[_0xb314('0x36')]));_0x2e9158[_0xb314('0x3c')][_0xb314('0x5a')]=_0x2d0e8b['id'];if(_0x19c764[_0xb314('0x35')][_0xb314('0x3e')]){_0x2e9158[_0xb314('0x3c')]=_['merge'](_0x2e9158[_0xb314('0x3c')],{'$or':_[_0xb314('0x2e')](_0x2e9158[_0xb314('0x38')],function(_0x3266ac){var _0x3b97b5={};_0x3b97b5[_0x3266ac]={'$like':'%'+_0x19c764[_0xb314('0x35')][_0xb314('0x3e')]+'%'};return _0x3b97b5;})});}_0x2e9158=_[_0xb314('0x47')]({},_0x2e9158,_0x19c764[_0xb314('0x3f')]);return db[_0xb314('0x61')][_0xb314('0x1e')]({'where':_0x2e9158[_0xb314('0x3c')]})['then'](function(_0x1e092e){_0x19f8a7['count']=_0x1e092e;if(_0x19c764[_0xb314('0x35')][_0xb314('0x40')]){_0x2e9158['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2e9158);})[_0xb314('0x24')](function(_0x16f132){_0x19f8a7[_0xb314('0x42')]=_0x16f132;return _0x19f8a7;});}})[_0xb314('0x24')](respondWithFilteredResult(_0x257f85,_0x2e9158))[_0xb314('0x4f')](handleError(_0x257f85,null));};exports[_0xb314('0x63')]=function(_0x28a22f,_0x2b7873,_0x51f30d){var _0x5d5bcf={};var _0x54587e={};var _0x26e045;var _0x24df63;return db[_0xb314('0x2f')][_0xb314('0x57')]({'where':{'id':_0x28a22f['params']['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x2b7873,null))['then'](function(_0x378122){if(_0x378122){_0x26e045=_0x378122;_0x54587e['model']=_[_0xb314('0x34')](db['CmList'][_0xb314('0x45')]);_0x54587e['query']=_[_0xb314('0x34')](_0x28a22f[_0xb314('0x35')]);_0x54587e[_0xb314('0x36')]=_[_0xb314('0x37')](_0x54587e['model'],_0x54587e['query']);_0x5d5bcf['attributes']=_[_0xb314('0x37')](_0x54587e[_0xb314('0x33')],qs[_0xb314('0x46')](_0x28a22f[_0xb314('0x35')][_0xb314('0x46')]));_0x5d5bcf[_0xb314('0x38')]=_0x5d5bcf[_0xb314('0x38')]['length']?_0x5d5bcf[_0xb314('0x38')]:_0x54587e[_0xb314('0x33')];_0x5d5bcf[_0xb314('0x62')]=qs[_0xb314('0x3b')](_0x28a22f[_0xb314('0x35')]['sort']);_0x5d5bcf[_0xb314('0x3c')]=qs['filters'](_[_0xb314('0x3d')](_0x28a22f[_0xb314('0x35')],_0x54587e[_0xb314('0x36')]));if(_0x28a22f[_0xb314('0x35')]['filter']){_0x5d5bcf[_0xb314('0x3c')]=_[_0xb314('0x47')](_0x5d5bcf[_0xb314('0x3c')],{'$or':_[_0xb314('0x2e')](_0x5d5bcf['attributes'],function(_0x3e884a){var _0x1fece0={};_0x1fece0[_0x3e884a]={'$like':'%'+_0x28a22f[_0xb314('0x35')][_0xb314('0x3e')]+'%'};return _0x1fece0;})});}_0x5d5bcf=_[_0xb314('0x47')]({},_0x5d5bcf,_0x28a22f[_0xb314('0x3f')]);return _0x26e045[_0xb314('0x63')](_0x5d5bcf);}})['then'](function(_0x1fe946){if(_0x1fe946){_0x24df63=_0x1fe946[_0xb314('0x39')];if(!_0x28a22f[_0xb314('0x35')]['hasOwnProperty'](_0xb314('0x3a'))){_0x5d5bcf[_0xb314('0x1d')]=qs[_0xb314('0x1d')](_0x28a22f[_0xb314('0x35')][_0xb314('0x1d')]);_0x5d5bcf[_0xb314('0x1b')]=qs[_0xb314('0x1b')](_0x28a22f[_0xb314('0x35')][_0xb314('0x1b')]);}return _0x26e045[_0xb314('0x63')](_0x5d5bcf);}})[_0xb314('0x24')](function(_0x265d9d){if(_0x265d9d){return _0x265d9d?{'count':_0x24df63,'rows':_0x265d9d}:null;}})[_0xb314('0x24')](respondWithResult(_0x2b7873,null))[_0xb314('0x4f')](handleError(_0x2b7873,null));};exports[_0xb314('0x64')]=function(_0x52a964,_0x5ddeb,_0x30fa8f){var _0x291a2a,_0x45bed4;return db['Campaign'][_0xb314('0x48')]({'where':{'id':_0x52a964['params']['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x5ddeb,null))[_0xb314('0x24')](function(_0x5a93be){if(_0x5a93be){_0x45bed4=_0x5a93be;return _0x5a93be[_0xb314('0x64')](_0x52a964[_0xb314('0x4a')]['ids'],_[_0xb314('0x53')](_0x52a964[_0xb314('0x4a')],[_0xb314('0x65'),'id'])||{});}return null;})[_0xb314('0x66')](function(_0x3383){var _0x297b3a;_0x291a2a=_0x3383||[];var _0x21a832=[];if(_0x3383){for(var _0x2fd297=0x0;_0x2fd297<_0x3383[_0xb314('0x39')];_0x2fd297+=0x1){var _0x767d7=_0x3383[_0x2fd297][_0xb314('0x26')]({'plain':!![]});_0x45bed4[_0xb314('0x67')]=_0x52a964[_0xb314('0x4a')][_0xb314('0x67')]?_0x52a964['body'][_0xb314('0x67')]:_0x45bed4[_0xb314('0x67')];switch(_0x45bed4[_0xb314('0x67')]){case _0xb314('0x68'):_0x297b3a=squel[_0xb314('0x69')]()[_0xb314('0x6a')]('cm_hopper')['fromQuery']([_0xb314('0x6b'),_0xb314('0x6c'),'ContactId',_0xb314('0x6d'),'CampaignId',_0xb314('0x52'),'updatedAt'],squel['select']()[_0xb314('0x6e')](_0xb314('0x6b'),_0xb314('0x6b'))[_0xb314('0x6e')]('NOW()','scheduledAt')[_0xb314('0x6e')]('id',_0xb314('0x6f'))[_0xb314('0x6e')](_0x767d7[_0xb314('0x70')][_0xb314('0x71')](),_0xb314('0x6d'))[_0xb314('0x6e')](_0x52a964[_0xb314('0x44')]['id']['toString'](),_0xb314('0x5a'))[_0xb314('0x6e')](_0xb314('0x72'),_0xb314('0x52'))['field'](_0xb314('0x72'),_0xb314('0x54'))[_0xb314('0x73')]('cm_contacts')['where'](_0xb314('0x74'))['where'](_0xb314('0x75'),_0x767d7[_0xb314('0x70')][_0xb314('0x71')]())[_0xb314('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0xb314('0x3c')](_0xb314('0x76'),squel[_0xb314('0x77')]()['field'](_0xb314('0x78'))[_0xb314('0x73')](_0xb314('0x79'))[_0xb314('0x3c')]('CampaignId\x20=\x20?',_0x52a964[_0xb314('0x44')]['id'][_0xb314('0x71')]()))['where'](_0xb314('0x76'),squel['select']()['field'](_0xb314('0x7a'))[_0xb314('0x73')](_0xb314('0x7b'))[_0xb314('0x3c')](_0xb314('0x7c'),_0x52a964['params']['id']['toString']())))['toString']();break;case _0xb314('0x7d'):_0x297b3a=squel[_0xb314('0x69')]()[_0xb314('0x6a')](_0xb314('0x7b'))[_0xb314('0x7e')]([_0xb314('0x6b'),_0xb314('0x6c'),_0xb314('0x6f'),_0xb314('0x6d'),_0xb314('0x5a'),_0xb314('0x52'),'updatedAt'],squel['select']()['field']('phone','phone')[_0xb314('0x6e')](_0xb314('0x72'),_0xb314('0x6c'))[_0xb314('0x6e')]('id',_0xb314('0x6f'))[_0xb314('0x6e')](_0x767d7[_0xb314('0x70')][_0xb314('0x71')](),_0xb314('0x6d'))[_0xb314('0x6e')](_0x52a964[_0xb314('0x44')]['id'][_0xb314('0x71')](),_0xb314('0x5a'))[_0xb314('0x6e')]('NOW()',_0xb314('0x52'))[_0xb314('0x6e')](_0xb314('0x72'),_0xb314('0x54'))['from'](_0xb314('0x7f'))['where'](_0xb314('0x74'))[_0xb314('0x3c')](_0xb314('0x75'),_0x767d7[_0xb314('0x70')][_0xb314('0x71')]())[_0xb314('0x3c')](_0xb314('0x80'))[_0xb314('0x3c')](_0xb314('0x76'),squel[_0xb314('0x77')]()[_0xb314('0x6e')](_0xb314('0x7a'))[_0xb314('0x73')]('cm_hopper')[_0xb314('0x3c')](_0xb314('0x7c'),_0x52a964[_0xb314('0x44')]['id'][_0xb314('0x71')]())))[_0xb314('0x71')]();break;default:_0x297b3a=squel[_0xb314('0x69')]()['into'](_0xb314('0x7b'))['fromQuery'](['phone',_0xb314('0x6c'),_0xb314('0x6f'),_0xb314('0x6d'),_0xb314('0x5a'),'createdAt',_0xb314('0x54')],squel[_0xb314('0x77')]()['field'](_0xb314('0x6b'),_0xb314('0x6b'))['field'](_0xb314('0x72'),'scheduledAt')[_0xb314('0x6e')]('id',_0xb314('0x6f'))['field'](_0x767d7['CmListId']['toString'](),'ListId')[_0xb314('0x6e')](_0x52a964[_0xb314('0x44')]['id'][_0xb314('0x71')](),'CampaignId')[_0xb314('0x6e')]('NOW()',_0xb314('0x52'))[_0xb314('0x6e')]('NOW()',_0xb314('0x54'))[_0xb314('0x73')](_0xb314('0x7f'))[_0xb314('0x3c')]('deletedAt\x20IS\x20NULL')[_0xb314('0x3c')](_0xb314('0x75'),_0x767d7[_0xb314('0x70')][_0xb314('0x71')]())[_0xb314('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xb314('0x71')]();}_0x21a832['push'](db[_0xb314('0x81')][_0xb314('0x35')](_0x297b3a));}return BPromise[_0xb314('0x82')](_0x21a832);}})[_0xb314('0x24')](function(){return _0x291a2a;})['then'](respondWithResult(_0x5ddeb,null))[_0xb314('0x4f')](handleError(_0x5ddeb,null));};exports['removeLists']=function(_0x469604,_0x495288,_0x5ecb98){return db[_0xb314('0x2f')][_0xb314('0x48')]({'where':{'id':_0x469604[_0xb314('0x44')]['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x495288,null))['then'](function(_0x90af6b){if(_0x90af6b){return _0x90af6b[_0xb314('0x83')](_0x469604[_0xb314('0x35')][_0xb314('0x65')]);}})[_0xb314('0x24')](function(_0x4c091d){if(_0x4c091d){return db['CmHopper'][_0xb314('0x25')]({'where':{'ListId':_0x469604['query'][_0xb314('0x65')],'CampaignId':_0x469604[_0xb314('0x44')]['id']}})['then'](function(){return _0x4c091d;});}})['then'](respondWithStatusCode(_0x495288,null))['catch'](handleError(_0x495288,null));};exports[_0xb314('0x84')]=function(_0xd07fd4,_0x2f19f3,_0x469fd6){var _0x9563bb={};var _0x45be54={};var _0x5c171f;var _0x3ee97e;return db[_0xb314('0x2f')][_0xb314('0x57')]({'where':{'id':_0xd07fd4[_0xb314('0x44')]['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x2f19f3,null))[_0xb314('0x24')](function(_0xfd47ad){if(_0xfd47ad){_0x5c171f=_0xfd47ad;_0x45be54[_0xb314('0x33')]=_[_0xb314('0x34')](db[_0xb314('0x85')][_0xb314('0x45')]);_0x45be54[_0xb314('0x35')]=_[_0xb314('0x34')](_0xd07fd4[_0xb314('0x35')]);_0x45be54[_0xb314('0x36')]=_[_0xb314('0x37')](_0x45be54[_0xb314('0x33')],_0x45be54[_0xb314('0x35')]);_0x9563bb[_0xb314('0x38')]=_[_0xb314('0x37')](_0x45be54[_0xb314('0x33')],qs[_0xb314('0x46')](_0xd07fd4[_0xb314('0x35')][_0xb314('0x46')]));_0x9563bb[_0xb314('0x38')]=_0x9563bb[_0xb314('0x38')][_0xb314('0x39')]?_0x9563bb[_0xb314('0x38')]:_0x45be54[_0xb314('0x33')];_0x9563bb['order']=qs[_0xb314('0x3b')](_0xd07fd4[_0xb314('0x35')][_0xb314('0x3b')]);_0x9563bb[_0xb314('0x3c')]=qs['filters'](_[_0xb314('0x3d')](_0xd07fd4[_0xb314('0x35')],_0x45be54[_0xb314('0x36')]));if(_0xd07fd4[_0xb314('0x35')][_0xb314('0x3e')]){_0x9563bb[_0xb314('0x3c')]=_[_0xb314('0x47')](_0x9563bb['where'],{'$or':_[_0xb314('0x2e')](_0x9563bb['attributes'],function(_0x1b24d7){var _0x4be784={};_0x4be784[_0x1b24d7]={'$like':'%'+_0xd07fd4[_0xb314('0x35')][_0xb314('0x3e')]+'%'};return _0x4be784;})});}_0x9563bb=_['merge']({},_0x9563bb,_0xd07fd4['options']);return _0x5c171f['getBlackLists'](_0x9563bb);}})['then'](function(_0x24e298){if(_0x24e298){_0x3ee97e=_0x24e298['length'];if(!_0xd07fd4[_0xb314('0x35')][_0xb314('0x59')](_0xb314('0x3a'))){_0x9563bb[_0xb314('0x1d')]=qs[_0xb314('0x1d')](_0xd07fd4[_0xb314('0x35')]['limit']);_0x9563bb['offset']=qs[_0xb314('0x1b')](_0xd07fd4['query'][_0xb314('0x1b')]);}return _0x5c171f['getBlackLists'](_0x9563bb);}})['then'](function(_0x248226){if(_0x248226){return _0x248226?{'count':_0x3ee97e,'rows':_0x248226}:null;}})[_0xb314('0x24')](respondWithResult(_0x2f19f3,null))['catch'](handleError(_0x2f19f3,null));};exports[_0xb314('0x86')]=function(_0x44c85e,_0xf476ce,_0x5f4646){var _0x158b42,_0x3cd32e;return db[_0xb314('0x2f')][_0xb314('0x48')]({'where':{'id':_0x44c85e[_0xb314('0x44')]['id']}})[_0xb314('0x24')](handleEntityNotFound(_0xf476ce,null))[_0xb314('0x24')](function(_0x2e2fca){if(_0x2e2fca){_0x3cd32e=_0x2e2fca;return _0x2e2fca[_0xb314('0x86')](_0x44c85e[_0xb314('0x4a')][_0xb314('0x65')],_[_0xb314('0x53')](_0x44c85e[_0xb314('0x4a')],['ids','id'])||{});}return null;})[_0xb314('0x66')](function(_0x1b9e61){var _0x520d84;_0x158b42=_0x1b9e61||[];var _0x341c96=[];if(_0x1b9e61){for(var _0x5da7a3=0x0;_0x5da7a3<_0x1b9e61[_0xb314('0x39')];_0x5da7a3+=0x1){var _0x3e021a=_0x1b9e61[_0x5da7a3][_0xb314('0x26')]({'plain':!![]});_0x520d84=squel[_0xb314('0x69')]()[_0xb314('0x6a')](_0xb314('0x87'))[_0xb314('0x7e')]([_0xb314('0x6b'),_0xb314('0x6f'),'ListId',_0xb314('0x5a'),'createdAt',_0xb314('0x54')],squel['select']()[_0xb314('0x6e')]('phone',_0xb314('0x6b'))[_0xb314('0x6e')]('id','ContactId')[_0xb314('0x6e')](_0x3e021a[_0xb314('0x70')][_0xb314('0x71')](),_0xb314('0x6d'))['field'](_0x44c85e[_0xb314('0x44')]['id'][_0xb314('0x71')](),_0xb314('0x5a'))[_0xb314('0x6e')]('NOW()','createdAt')[_0xb314('0x6e')](_0xb314('0x72'),'updatedAt')[_0xb314('0x73')]('cm_contacts')['where'](_0xb314('0x74'))[_0xb314('0x3c')](_0xb314('0x75'),_0x3e021a['CmListId'][_0xb314('0x71')]())['where'](_0xb314('0x80')))[_0xb314('0x71')]();_0x341c96[_0xb314('0x88')](db['sequelize']['query'](_0x520d84));}return BPromise[_0xb314('0x82')](_0x341c96);}})[_0xb314('0x24')](function(){return _0x158b42;})[_0xb314('0x24')](respondWithResult(_0xf476ce,null))[_0xb314('0x4f')](handleError(_0xf476ce,null));};exports[_0xb314('0x89')]=function(_0x5d4421,_0x411e5e,_0x24f186){return db[_0xb314('0x2f')][_0xb314('0x48')]({'where':{'id':_0x5d4421[_0xb314('0x44')]['id']}})[_0xb314('0x24')](handleEntityNotFound(_0x411e5e,null))[_0xb314('0x24')](function(_0x20ca3b){if(_0x20ca3b){return _0x20ca3b['removeBlackLists'](_0x5d4421[_0xb314('0x35')]['ids']);}})[_0xb314('0x24')](function(_0x817002){if(_0x817002){return db[_0xb314('0x61')]['destroy']({'where':{'ListId':_0x5d4421['query'][_0xb314('0x65')],'CampaignId':_0x5d4421[_0xb314('0x44')]['id']}})[_0xb314('0x24')](function(){return _0x817002;});}})[_0xb314('0x24')](respondWithStatusCode(_0x411e5e,null))['catch'](handleError(_0x411e5e,null));};
\ No newline at end of file
+var _0x43b3=['merge','includeAll','include','findAll','rows','show','params','intersection','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x194808,_0x2bf290){var _0x3998e1=function(_0x5e13d9){while(--_0x5e13d9){_0x194808['push'](_0x194808['shift']());}};_0x3998e1(++_0x2bf290);}(_0x43b3,0xce));var _0x343b=function(_0x8a1e69,_0x50a21d){_0x8a1e69=_0x8a1e69-0x0;var _0x1b789f=_0x43b3[_0x8a1e69];return _0x1b789f;};'use strict';var emlformat=require(_0x343b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x343b('0x1'));var jsonpatch=require(_0x343b('0x2'));var rp=require(_0x343b('0x3'));var moment=require(_0x343b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x343b('0x5'));var util=require(_0x343b('0x6'));var path=require(_0x343b('0x7'));var sox=require(_0x343b('0x8'));var csv=require('to-csv');var ejs=require(_0x343b('0x9'));var fs=require('fs');var fs_extra=require(_0x343b('0xa'));var _=require(_0x343b('0xb'));var squel=require(_0x343b('0xc'));var crypto=require(_0x343b('0xd'));var jsforce=require(_0x343b('0xe'));var deskjs=require(_0x343b('0xf'));var toCsv=require(_0x343b('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x343b('0x11'));var as=require(_0x343b('0x12'));var hardwareService=require(_0x343b('0x13'));var logger=require('../../config/logger')(_0x343b('0x14'));var utils=require(_0x343b('0x15'));var config=require(_0x343b('0x16'));var licenseUtil=require(_0x343b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d452b,_0x5bad24){_0x5bad24=_0x5bad24||0xcc;return function(_0x1aab74){if(_0x1aab74){return _0x3d452b[_0x343b('0x18')](_0x5bad24);}return _0x3d452b['status'](_0x5bad24)[_0x343b('0x19')]();};}function respondWithResult(_0x499bc5,_0x5afe48){_0x5afe48=_0x5afe48||0xc8;return function(_0x422052){if(_0x422052){return _0x499bc5['status'](_0x5afe48)[_0x343b('0x1a')](_0x422052);}};}function respondWithFilteredResult(_0x160a6d,_0x48ef83){return function(_0x4ad59e){if(_0x4ad59e){var _0x3d06ce=typeof _0x48ef83[_0x343b('0x1b')]==='undefined'&&typeof _0x48ef83[_0x343b('0x1c')]===_0x343b('0x1d');var _0x2f6efe=_0x4ad59e[_0x343b('0x1e')];var _0x275260=_0x3d06ce?0x0:_0x48ef83[_0x343b('0x1b')];var _0x161c60=_0x3d06ce?_0x4ad59e[_0x343b('0x1e')]:_0x48ef83['offset']+_0x48ef83[_0x343b('0x1c')];var _0x4aba69;if(_0x161c60>=_0x2f6efe){_0x161c60=_0x2f6efe;_0x4aba69=0xc8;}else{_0x4aba69=0xce;}_0x160a6d[_0x343b('0x1f')](_0x4aba69);return _0x160a6d[_0x343b('0x20')]('Content-Range',_0x275260+'-'+_0x161c60+'/'+_0x2f6efe)[_0x343b('0x1a')](_0x4ad59e);}return null;};}function patchUpdates(_0x31bd60){return function(_0x536dbe){try{jsonpatch[_0x343b('0x21')](_0x536dbe,_0x31bd60,!![]);}catch(_0x421411){return BPromise[_0x343b('0x22')](_0x421411);}return _0x536dbe['save']();};}function saveUpdates(_0x767a5a,_0x5a39a0){return function(_0x50a18f){if(_0x50a18f){return _0x50a18f[_0x343b('0x23')](_0x767a5a)[_0x343b('0x24')](function(_0x3a176a){return _0x3a176a;});}return null;};}function removeEntity(_0x2e50e2,_0x2f4d31){return function(_0x479d98){if(_0x479d98){return _0x479d98[_0x343b('0x25')]()[_0x343b('0x24')](function(){var _0x348d15=_0x479d98[_0x343b('0x26')]({'plain':!![]});var _0x512d38=_0x343b('0x27');return db[_0x343b('0x28')][_0x343b('0x25')]({'where':{'type':_0x512d38,'resourceId':_0x348d15['id']}})[_0x343b('0x24')](function(){return _0x479d98;});})['then'](function(){_0x2e50e2[_0x343b('0x1f')](0xcc)[_0x343b('0x19')]();});}};}function handleEntityNotFound(_0x48cfa5,_0x191cd5){return function(_0x1f134c){if(!_0x1f134c){_0x48cfa5[_0x343b('0x18')](0x194);}return _0x1f134c;};}function handleError(_0x469285,_0x15bc7f){_0x15bc7f=_0x15bc7f||0x1f4;return function(_0x5b76d6){logger[_0x343b('0x29')](_0x5b76d6[_0x343b('0x2a')]);if(_0x5b76d6[_0x343b('0x2b')]){delete _0x5b76d6[_0x343b('0x2b')];}_0x469285[_0x343b('0x1f')](_0x15bc7f)[_0x343b('0x2c')](_0x5b76d6);};}exports[_0x343b('0x2d')]=function(_0x4282a8,_0x177e71){var _0x101f26={},_0x104006={},_0x3e5e32={'count':0x0,'rows':[]};var _0x1105ba=_[_0x343b('0x2e')](db[_0x343b('0x2f')][_0x343b('0x30')],function(_0x299cc3){return{'name':_0x299cc3[_0x343b('0x31')],'type':_0x299cc3[_0x343b('0x32')][_0x343b('0x33')]};});_0x104006[_0x343b('0x34')]=_['map'](_0x1105ba,_0x343b('0x2b'));_0x104006[_0x343b('0x35')]=_[_0x343b('0x36')](_0x4282a8[_0x343b('0x35')]);_0x104006[_0x343b('0x37')]=_['intersection'](_0x104006[_0x343b('0x34')],_0x104006[_0x343b('0x35')]);_0x101f26[_0x343b('0x38')]=_['intersection'](_0x104006[_0x343b('0x34')],qs[_0x343b('0x39')](_0x4282a8['query'][_0x343b('0x39')]));_0x101f26['attributes']=_0x101f26['attributes'][_0x343b('0x3a')]?_0x101f26['attributes']:_0x104006[_0x343b('0x34')];if(!_0x4282a8[_0x343b('0x35')]['hasOwnProperty'](_0x343b('0x3b'))){_0x101f26[_0x343b('0x1c')]=qs['limit'](_0x4282a8[_0x343b('0x35')][_0x343b('0x1c')]);_0x101f26[_0x343b('0x1b')]=qs[_0x343b('0x1b')](_0x4282a8[_0x343b('0x35')][_0x343b('0x1b')]);}_0x101f26[_0x343b('0x3c')]=qs[_0x343b('0x3d')](_0x4282a8[_0x343b('0x35')]['sort']);_0x101f26[_0x343b('0x3e')]=qs[_0x343b('0x37')](_[_0x343b('0x3f')](_0x4282a8[_0x343b('0x35')],_0x104006[_0x343b('0x37')]),_0x1105ba);if(_0x4282a8['query'][_0x343b('0x40')]){_0x101f26['where']=_['merge'](_0x101f26[_0x343b('0x3e')],{'$or':_[_0x343b('0x2e')](_0x1105ba,function(_0x4f7489){if(_0x4f7489[_0x343b('0x32')]!==_0x343b('0x41')){var _0x4f275f={};_0x4f275f[_0x4f7489[_0x343b('0x2b')]]={'$like':'%'+_0x4282a8[_0x343b('0x35')][_0x343b('0x40')]+'%'};return _0x4f275f;}})});}_0x101f26=_[_0x343b('0x42')]({},_0x101f26,_0x4282a8['options']);var _0xd6f55e={'where':_0x101f26[_0x343b('0x3e')]};return db['Campaign']['count'](_0xd6f55e)['then'](function(_0x18777a){_0x3e5e32[_0x343b('0x1e')]=_0x18777a;if(_0x4282a8[_0x343b('0x35')][_0x343b('0x43')]){_0x101f26[_0x343b('0x44')]=[{'all':!![]}];}return db[_0x343b('0x2f')][_0x343b('0x45')](_0x101f26);})['then'](function(_0x5b79f8){_0x3e5e32[_0x343b('0x46')]=_0x5b79f8;return _0x3e5e32;})['then'](respondWithFilteredResult(_0x177e71,_0x101f26))['catch'](handleError(_0x177e71,null));};exports[_0x343b('0x47')]=function(_0x6c8611,_0x55fcbc){var _0x53f576={'raw':![],'where':{'id':_0x6c8611[_0x343b('0x48')]['id']}},_0x5f5186={};_0x5f5186[_0x343b('0x34')]=_[_0x343b('0x36')](db[_0x343b('0x2f')][_0x343b('0x30')]);_0x5f5186[_0x343b('0x35')]=_[_0x343b('0x36')](_0x6c8611[_0x343b('0x35')]);_0x5f5186[_0x343b('0x37')]=_[_0x343b('0x49')](_0x5f5186[_0x343b('0x34')],_0x5f5186[_0x343b('0x35')]);_0x53f576[_0x343b('0x38')]=_['intersection'](_0x5f5186[_0x343b('0x34')],qs[_0x343b('0x39')](_0x6c8611[_0x343b('0x35')]['fields']));_0x53f576[_0x343b('0x38')]=_0x53f576[_0x343b('0x38')][_0x343b('0x3a')]?_0x53f576[_0x343b('0x38')]:_0x5f5186[_0x343b('0x34')];if(_0x6c8611[_0x343b('0x35')]['includeAll']){_0x53f576[_0x343b('0x44')]=[{'all':!![]}];}_0x53f576=_['merge']({},_0x53f576,_0x6c8611[_0x343b('0x4a')]);return db[_0x343b('0x2f')]['find'](_0x53f576)['then'](handleEntityNotFound(_0x55fcbc,null))[_0x343b('0x24')](respondWithResult(_0x55fcbc,null))[_0x343b('0x4b')](handleError(_0x55fcbc,null));};exports[_0x343b('0x4c')]=function(_0x3cbf48,_0xa8814e){return db[_0x343b('0x2f')][_0x343b('0x4c')](_0x3cbf48['body'],{})[_0x343b('0x24')](function(_0x2646e8){var _0x1d6ee3=_0x3cbf48[_0x343b('0x4d')][_0x343b('0x26')]({'plain':!![]});if(!_0x1d6ee3)throw new Error(_0x343b('0x4e'));if(_0x1d6ee3[_0x343b('0x4f')]===_0x343b('0x4d')){var _0x4ac884=_0x2646e8[_0x343b('0x26')]({'plain':!![]});var _0x576b0a=_0x343b('0x27');return db[_0x343b('0x50')][_0x343b('0x51')]({'where':{'name':_0x576b0a,'userProfileId':_0x1d6ee3[_0x343b('0x52')]},'raw':!![]})[_0x343b('0x24')](function(_0x362247){if(_0x362247&&_0x362247[_0x343b('0x53')]===0x0){return db[_0x343b('0x28')][_0x343b('0x4c')]({'name':_0x4ac884[_0x343b('0x2b')],'resourceId':_0x4ac884['id'],'type':_0x362247[_0x343b('0x2b')],'sectionId':_0x362247['id']},{})[_0x343b('0x24')](function(){return _0x2646e8;});}else{return _0x2646e8;}})['catch'](function(_0x5a19e4){logger[_0x343b('0x29')](_0x343b('0x54'),_0x5a19e4);throw _0x5a19e4;});}return _0x2646e8;})[_0x343b('0x24')](respondWithResult(_0xa8814e,0xc9))[_0x343b('0x4b')](handleError(_0xa8814e,null));};exports[_0x343b('0x55')]=function(_0x3905bb,_0x1c138c){var _0x22a4c6={'where':{'id':_0x3905bb[_0x343b('0x48')]['id']}},_0x8b5bb6={};_0x8b5bb6[_0x343b('0x34')]=_[_0x343b('0x36')](db[_0x343b('0x2f')][_0x343b('0x30')]);_0x22a4c6['attributes']=_[_0x343b('0x49')](_0x8b5bb6['model'],qs[_0x343b('0x39')](_0x3905bb[_0x343b('0x35')][_0x343b('0x39')]));_0x22a4c6[_0x343b('0x38')]=_0x22a4c6[_0x343b('0x38')][_0x343b('0x3a')]?_0x22a4c6['attributes']:_0x8b5bb6[_0x343b('0x34')];if(_0x3905bb['query']['includeAll']){_0x22a4c6[_0x343b('0x44')]=[{'all':!![]}];}_0x22a4c6=_[_0x343b('0x42')]({},_0x22a4c6,_0x3905bb['options']);return db[_0x343b('0x2f')][_0x343b('0x51')](_0x22a4c6)[_0x343b('0x24')](handleEntityNotFound(_0x1c138c,null))[_0x343b('0x24')](function(_0x471db7){if(_0x471db7){var _0x5a918e=_0x471db7[_0x343b('0x26')]({'plain':!![]});_0x5a918e=qs[_0x343b('0x56')](_0x5a918e,['id','createdAt',_0x343b('0x57')]);_0x3905bb[_0x343b('0x58')]=_[_0x343b('0x56')](_0x3905bb[_0x343b('0x58')],['id',_0x343b('0x59'),_0x343b('0x57')]);return db[_0x343b('0x2f')][_0x343b('0x4c')](_[_0x343b('0x42')](_0x5a918e,_0x3905bb['body']),{'include':_0x3905bb[_0x343b('0x35')][_0x343b('0x43')]?[{'all':!![]}]:undefined})[_0x343b('0x24')](function(_0x2aeb00){var _0x50066a=_0x3905bb[_0x343b('0x4d')][_0x343b('0x26')]({'plain':!![]});if(!_0x50066a)throw new Error(_0x343b('0x4e'));if(_0x50066a[_0x343b('0x4f')]==='user'){var _0x172052=_0x2aeb00[_0x343b('0x26')]({'plain':!![]});var _0x243e5e=_0x343b('0x27');return db[_0x343b('0x50')][_0x343b('0x51')]({'where':{'name':_0x243e5e,'userProfileId':_0x50066a[_0x343b('0x52')]},'raw':!![]})['then'](function(_0x2372fc){if(_0x2372fc&&_0x2372fc[_0x343b('0x53')]===0x0){return db[_0x343b('0x28')][_0x343b('0x4c')]({'name':_0x172052[_0x343b('0x2b')],'resourceId':_0x172052['id'],'type':_0x2372fc['name'],'sectionId':_0x2372fc['id']},{})[_0x343b('0x24')](function(){return _0x2aeb00;});}else{return _0x2aeb00;}})[_0x343b('0x4b')](function(_0x184fa9){logger[_0x343b('0x29')](_0x343b('0x54'),_0x184fa9);throw _0x184fa9;});}return _0x2aeb00;});}})[_0x343b('0x24')](respondWithResult(_0x1c138c,0xc9))[_0x343b('0x4b')](handleError(_0x1c138c,null));};exports[_0x343b('0x23')]=function(_0x1873ed,_0x29fcd4){if(_0x1873ed[_0x343b('0x58')]['id']){delete _0x1873ed[_0x343b('0x58')]['id'];}return db[_0x343b('0x2f')][_0x343b('0x51')]({'where':{'id':_0x1873ed[_0x343b('0x48')]['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x29fcd4,null))[_0x343b('0x24')](saveUpdates(_0x1873ed[_0x343b('0x58')],null))[_0x343b('0x24')](respondWithResult(_0x29fcd4,null))[_0x343b('0x4b')](handleError(_0x29fcd4,null));};exports[_0x343b('0x25')]=function(_0x3d4d35,_0x18d701){return db['Campaign'][_0x343b('0x51')]({'where':{'id':_0x3d4d35['params']['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x18d701,null))[_0x343b('0x24')](removeEntity(_0x18d701,null))[_0x343b('0x4b')](handleError(_0x18d701,null));};exports[_0x343b('0x5a')]=function(_0x135ee2,_0x442e96,_0x264784){var _0x242404={'raw':!![],'where':{}};var _0x4b8882={};var _0x3dabf8={'count':0x0,'rows':[]};return db['Campaign'][_0x343b('0x5b')]({'where':{'id':_0x135ee2[_0x343b('0x48')]['id']}})['then'](handleEntityNotFound(_0x442e96,null))[_0x343b('0x24')](function(_0x5b13b8){if(_0x5b13b8){_0x4b8882[_0x343b('0x34')]=_[_0x343b('0x36')](db['CmHopper']['rawAttributes']);_0x4b8882[_0x343b('0x35')]=_['keys'](_0x135ee2[_0x343b('0x35')]);_0x4b8882['filters']=_[_0x343b('0x49')](_0x4b8882[_0x343b('0x34')],_0x4b8882[_0x343b('0x35')]);_0x242404[_0x343b('0x38')]=_['intersection'](_0x4b8882[_0x343b('0x34')],qs['fields'](_0x135ee2[_0x343b('0x35')]['fields']));_0x242404['attributes']=_0x242404['attributes'][_0x343b('0x3a')]?_0x242404[_0x343b('0x38')]:_0x4b8882[_0x343b('0x34')];if(!_0x135ee2[_0x343b('0x35')][_0x343b('0x5c')](_0x343b('0x3b'))){_0x242404[_0x343b('0x1c')]=qs['limit'](_0x135ee2['query'][_0x343b('0x1c')]);_0x242404[_0x343b('0x1b')]=qs[_0x343b('0x1b')](_0x135ee2[_0x343b('0x35')][_0x343b('0x1b')]);}_0x242404[_0x343b('0x3c')]=qs[_0x343b('0x3d')](_0x135ee2[_0x343b('0x35')]['sort']);_0x242404[_0x343b('0x3e')]=qs['filters'](_[_0x343b('0x3f')](_0x135ee2[_0x343b('0x35')],_0x4b8882[_0x343b('0x37')]));_0x242404[_0x343b('0x3e')][_0x343b('0x5d')]=_0x5b13b8['id'];if(_0x135ee2[_0x343b('0x35')][_0x343b('0x40')]){_0x242404[_0x343b('0x3e')]=_['merge'](_0x242404['where'],{'$or':_[_0x343b('0x2e')](_0x242404[_0x343b('0x38')],function(_0x2329b0){var _0x48cbca={};_0x48cbca[_0x2329b0]={'$like':'%'+_0x135ee2[_0x343b('0x35')][_0x343b('0x40')]+'%'};return _0x48cbca;})});}_0x242404=_['merge']({},_0x242404,_0x135ee2['options']);return db['CmHopper']['count']({'where':_0x242404[_0x343b('0x3e')]})['then'](function(_0x1cb2ca){_0x3dabf8[_0x343b('0x1e')]=_0x1cb2ca;if(_0x135ee2[_0x343b('0x35')]['includeAll']){_0x242404['include']=[{'all':!![]}];}return db[_0x343b('0x5e')][_0x343b('0x45')](_0x242404);})[_0x343b('0x24')](function(_0xf5f6){_0x3dabf8['rows']=_0xf5f6;return _0x3dabf8;});}})['then'](respondWithFilteredResult(_0x442e96,_0x242404))['catch'](handleError(_0x442e96,null));};exports[_0x343b('0x5f')]=function(_0x4a084f,_0x385aa2,_0x57122e){var _0x13abe8={'raw':!![],'where':{}};var _0x18db8e={};var _0x4113f7={'count':0x0,'rows':[]};return db[_0x343b('0x2f')][_0x343b('0x5b')]({'where':{'id':_0x4a084f[_0x343b('0x48')]['id']}})['then'](handleEntityNotFound(_0x385aa2,null))[_0x343b('0x24')](function(_0x536126){if(_0x536126){_0x18db8e[_0x343b('0x34')]=_['keys'](db['CmHopperHistory'][_0x343b('0x30')]);_0x18db8e[_0x343b('0x35')]=_[_0x343b('0x36')](_0x4a084f[_0x343b('0x35')]);_0x18db8e[_0x343b('0x37')]=_['intersection'](_0x18db8e[_0x343b('0x34')],_0x18db8e[_0x343b('0x35')]);_0x13abe8[_0x343b('0x38')]=_[_0x343b('0x49')](_0x18db8e[_0x343b('0x34')],qs['fields'](_0x4a084f[_0x343b('0x35')][_0x343b('0x39')]));_0x13abe8[_0x343b('0x38')]=_0x13abe8['attributes'][_0x343b('0x3a')]?_0x13abe8[_0x343b('0x38')]:_0x18db8e[_0x343b('0x34')];if(!_0x4a084f[_0x343b('0x35')]['hasOwnProperty'](_0x343b('0x3b'))){_0x13abe8[_0x343b('0x1c')]=qs['limit'](_0x4a084f[_0x343b('0x35')][_0x343b('0x1c')]);_0x13abe8[_0x343b('0x1b')]=qs[_0x343b('0x1b')](_0x4a084f['query'][_0x343b('0x1b')]);}_0x13abe8[_0x343b('0x3c')]=qs[_0x343b('0x3d')](_0x4a084f[_0x343b('0x35')]['sort']);_0x13abe8[_0x343b('0x3e')]=qs[_0x343b('0x37')](_[_0x343b('0x3f')](_0x4a084f[_0x343b('0x35')],_0x18db8e[_0x343b('0x37')]));_0x13abe8[_0x343b('0x3e')]['CampaignId']=_0x536126['id'];if(_0x4a084f[_0x343b('0x35')]['filter']){_0x13abe8[_0x343b('0x3e')]=_[_0x343b('0x42')](_0x13abe8[_0x343b('0x3e')],{'$or':_[_0x343b('0x2e')](_0x13abe8[_0x343b('0x38')],function(_0x12250f){var _0x48dab4={};_0x48dab4[_0x12250f]={'$like':'%'+_0x4a084f['query'][_0x343b('0x40')]+'%'};return _0x48dab4;})});}_0x13abe8=_[_0x343b('0x42')]({},_0x13abe8,_0x4a084f[_0x343b('0x4a')]);return db[_0x343b('0x60')][_0x343b('0x1e')]({'where':_0x13abe8[_0x343b('0x3e')]})[_0x343b('0x24')](function(_0x3455bc){_0x4113f7['count']=_0x3455bc;if(_0x4a084f['query'][_0x343b('0x43')]){_0x13abe8[_0x343b('0x44')]=[{'all':!![]}];}return db[_0x343b('0x60')]['findAll'](_0x13abe8);})[_0x343b('0x24')](function(_0x2583a8){_0x4113f7[_0x343b('0x46')]=_0x2583a8;return _0x4113f7;});}})[_0x343b('0x24')](respondWithFilteredResult(_0x385aa2,_0x13abe8))[_0x343b('0x4b')](handleError(_0x385aa2,null));};exports[_0x343b('0x61')]=function(_0x355a78,_0x1cb0f3,_0x45a7f9){var _0x13e299={'raw':!![],'where':{}};var _0x1c4e19={};var _0x7ac74b={'count':0x0,'rows':[]};return db['Campaign'][_0x343b('0x5b')]({'where':{'id':_0x355a78['params']['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x1cb0f3,null))['then'](function(_0x20354e){if(_0x20354e){_0x1c4e19[_0x343b('0x34')]=_[_0x343b('0x36')](db['CmHopperFinal'][_0x343b('0x30')]);_0x1c4e19[_0x343b('0x35')]=_[_0x343b('0x36')](_0x355a78[_0x343b('0x35')]);_0x1c4e19[_0x343b('0x37')]=_[_0x343b('0x49')](_0x1c4e19[_0x343b('0x34')],_0x1c4e19['query']);_0x13e299[_0x343b('0x38')]=_[_0x343b('0x49')](_0x1c4e19['model'],qs[_0x343b('0x39')](_0x355a78[_0x343b('0x35')][_0x343b('0x39')]));_0x13e299['attributes']=_0x13e299[_0x343b('0x38')][_0x343b('0x3a')]?_0x13e299['attributes']:_0x1c4e19[_0x343b('0x34')];if(!_0x355a78[_0x343b('0x35')][_0x343b('0x5c')](_0x343b('0x3b'))){_0x13e299[_0x343b('0x1c')]=qs[_0x343b('0x1c')](_0x355a78[_0x343b('0x35')][_0x343b('0x1c')]);_0x13e299[_0x343b('0x1b')]=qs[_0x343b('0x1b')](_0x355a78[_0x343b('0x35')][_0x343b('0x1b')]);}_0x13e299[_0x343b('0x3c')]=qs['sort'](_0x355a78[_0x343b('0x35')][_0x343b('0x3d')]);_0x13e299[_0x343b('0x3e')]=qs[_0x343b('0x37')](_[_0x343b('0x3f')](_0x355a78[_0x343b('0x35')],_0x1c4e19[_0x343b('0x37')]));_0x13e299[_0x343b('0x3e')][_0x343b('0x5d')]=_0x20354e['id'];if(_0x355a78[_0x343b('0x35')][_0x343b('0x40')]){_0x13e299[_0x343b('0x3e')]=_[_0x343b('0x42')](_0x13e299[_0x343b('0x3e')],{'$or':_[_0x343b('0x2e')](_0x13e299[_0x343b('0x38')],function(_0x46f7d6){var _0x283400={};_0x283400[_0x46f7d6]={'$like':'%'+_0x355a78[_0x343b('0x35')]['filter']+'%'};return _0x283400;})});}_0x13e299=_[_0x343b('0x42')]({},_0x13e299,_0x355a78[_0x343b('0x4a')]);return db['CmHopperFinal'][_0x343b('0x1e')]({'where':_0x13e299[_0x343b('0x3e')]})[_0x343b('0x24')](function(_0x1220a7){_0x7ac74b[_0x343b('0x1e')]=_0x1220a7;if(_0x355a78['query'][_0x343b('0x43')]){_0x13e299['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x343b('0x45')](_0x13e299);})[_0x343b('0x24')](function(_0x45ce46){_0x7ac74b[_0x343b('0x46')]=_0x45ce46;return _0x7ac74b;});}})[_0x343b('0x24')](respondWithFilteredResult(_0x1cb0f3,_0x13e299))['catch'](handleError(_0x1cb0f3,null));};exports['getHopperBlacks']=function(_0x31a9c8,_0x5b5c79,_0x18e8ac){var _0x2d7366={'raw':!![],'where':{}};var _0x156ce8={};var _0x38f43b={'count':0x0,'rows':[]};return db[_0x343b('0x2f')][_0x343b('0x5b')]({'where':{'id':_0x31a9c8[_0x343b('0x48')]['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x5b5c79,null))['then'](function(_0x2d20f2){if(_0x2d20f2){_0x156ce8[_0x343b('0x34')]=_[_0x343b('0x36')](db[_0x343b('0x62')]['rawAttributes']);_0x156ce8['query']=_[_0x343b('0x36')](_0x31a9c8[_0x343b('0x35')]);_0x156ce8[_0x343b('0x37')]=_[_0x343b('0x49')](_0x156ce8[_0x343b('0x34')],_0x156ce8[_0x343b('0x35')]);_0x2d7366[_0x343b('0x38')]=_[_0x343b('0x49')](_0x156ce8[_0x343b('0x34')],qs[_0x343b('0x39')](_0x31a9c8['query']['fields']));_0x2d7366[_0x343b('0x38')]=_0x2d7366[_0x343b('0x38')]['length']?_0x2d7366[_0x343b('0x38')]:_0x156ce8[_0x343b('0x34')];if(!_0x31a9c8[_0x343b('0x35')][_0x343b('0x5c')]('nolimit')){_0x2d7366[_0x343b('0x1c')]=qs[_0x343b('0x1c')](_0x31a9c8[_0x343b('0x35')][_0x343b('0x1c')]);_0x2d7366['offset']=qs[_0x343b('0x1b')](_0x31a9c8[_0x343b('0x35')][_0x343b('0x1b')]);}_0x2d7366[_0x343b('0x3c')]=qs['sort'](_0x31a9c8['query']['sort']);_0x2d7366['where']=qs['filters'](_[_0x343b('0x3f')](_0x31a9c8[_0x343b('0x35')],_0x156ce8[_0x343b('0x37')]));_0x2d7366[_0x343b('0x3e')][_0x343b('0x5d')]=_0x2d20f2['id'];if(_0x31a9c8[_0x343b('0x35')][_0x343b('0x40')]){_0x2d7366[_0x343b('0x3e')]=_[_0x343b('0x42')](_0x2d7366[_0x343b('0x3e')],{'$or':_[_0x343b('0x2e')](_0x2d7366[_0x343b('0x38')],function(_0x58765c){var _0x1e5dc7={};_0x1e5dc7[_0x58765c]={'$like':'%'+_0x31a9c8[_0x343b('0x35')][_0x343b('0x40')]+'%'};return _0x1e5dc7;})});}_0x2d7366=_[_0x343b('0x42')]({},_0x2d7366,_0x31a9c8[_0x343b('0x4a')]);return db['CmHopperBlack'][_0x343b('0x1e')]({'where':_0x2d7366['where']})[_0x343b('0x24')](function(_0x42bc28){_0x38f43b[_0x343b('0x1e')]=_0x42bc28;if(_0x31a9c8['query'][_0x343b('0x43')]){_0x2d7366['include']=[{'all':!![]}];}return db[_0x343b('0x62')]['findAll'](_0x2d7366);})[_0x343b('0x24')](function(_0x4ff6ab){_0x38f43b[_0x343b('0x46')]=_0x4ff6ab;return _0x38f43b;});}})[_0x343b('0x24')](respondWithFilteredResult(_0x5b5c79,_0x2d7366))[_0x343b('0x4b')](handleError(_0x5b5c79,null));};exports['getLists']=function(_0x21c764,_0x499350,_0x920002){var _0x3fc527={};var _0x319f2d={};var _0xdd64f6;var _0x4bf9ef;return db[_0x343b('0x2f')][_0x343b('0x5b')]({'where':{'id':_0x21c764['params']['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x499350,null))[_0x343b('0x24')](function(_0x16fb83){if(_0x16fb83){_0xdd64f6=_0x16fb83;_0x319f2d[_0x343b('0x34')]=_[_0x343b('0x36')](db['CmList']['rawAttributes']);_0x319f2d[_0x343b('0x35')]=_[_0x343b('0x36')](_0x21c764[_0x343b('0x35')]);_0x319f2d[_0x343b('0x37')]=_[_0x343b('0x49')](_0x319f2d[_0x343b('0x34')],_0x319f2d[_0x343b('0x35')]);_0x3fc527[_0x343b('0x38')]=_['intersection'](_0x319f2d[_0x343b('0x34')],qs[_0x343b('0x39')](_0x21c764[_0x343b('0x35')][_0x343b('0x39')]));_0x3fc527[_0x343b('0x38')]=_0x3fc527[_0x343b('0x38')][_0x343b('0x3a')]?_0x3fc527['attributes']:_0x319f2d['model'];_0x3fc527[_0x343b('0x3c')]=qs['sort'](_0x21c764[_0x343b('0x35')][_0x343b('0x3d')]);_0x3fc527[_0x343b('0x3e')]=qs[_0x343b('0x37')](_['pick'](_0x21c764['query'],_0x319f2d[_0x343b('0x37')]));if(_0x21c764[_0x343b('0x35')][_0x343b('0x40')]){_0x3fc527[_0x343b('0x3e')]=_[_0x343b('0x42')](_0x3fc527[_0x343b('0x3e')],{'$or':_['map'](_0x3fc527[_0x343b('0x38')],function(_0x653944){var _0x24de6e={};_0x24de6e[_0x653944]={'$like':'%'+_0x21c764[_0x343b('0x35')]['filter']+'%'};return _0x24de6e;})});}_0x3fc527=_['merge']({},_0x3fc527,_0x21c764[_0x343b('0x4a')]);return _0xdd64f6[_0x343b('0x63')](_0x3fc527);}})[_0x343b('0x24')](function(_0x425c20){if(_0x425c20){_0x4bf9ef=_0x425c20[_0x343b('0x3a')];if(!_0x21c764[_0x343b('0x35')][_0x343b('0x5c')](_0x343b('0x3b'))){_0x3fc527[_0x343b('0x1c')]=qs[_0x343b('0x1c')](_0x21c764[_0x343b('0x35')]['limit']);_0x3fc527['offset']=qs['offset'](_0x21c764[_0x343b('0x35')]['offset']);}return _0xdd64f6[_0x343b('0x63')](_0x3fc527);}})[_0x343b('0x24')](function(_0x3d504c){if(_0x3d504c){return _0x3d504c?{'count':_0x4bf9ef,'rows':_0x3d504c}:null;}})[_0x343b('0x24')](respondWithResult(_0x499350,null))[_0x343b('0x4b')](handleError(_0x499350,null));};exports['addLists']=function(_0x5c0e01,_0x47823d,_0x16a196){var _0x18688b,_0xfb1e67;return db[_0x343b('0x2f')][_0x343b('0x51')]({'where':{'id':_0x5c0e01['params']['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x47823d,null))['then'](function(_0x23b91b){if(_0x23b91b){_0xfb1e67=_0x23b91b;return _0x23b91b[_0x343b('0x64')](_0x5c0e01[_0x343b('0x58')][_0x343b('0x65')],_['omit'](_0x5c0e01[_0x343b('0x58')],[_0x343b('0x65'),'id'])||{});}return null;})[_0x343b('0x66')](function(_0x1ddf61){var _0x2cfc95;_0x18688b=_0x1ddf61||[];var _0x48dfd5=[];if(_0x1ddf61){for(var _0x5db459=0x0;_0x5db459<_0x1ddf61[_0x343b('0x3a')];_0x5db459+=0x1){var _0x27fcb1=_0x1ddf61[_0x5db459][_0x343b('0x26')]({'plain':!![]});_0xfb1e67[_0x343b('0x67')]=_0x5c0e01[_0x343b('0x58')][_0x343b('0x67')]?_0x5c0e01[_0x343b('0x58')][_0x343b('0x67')]:_0xfb1e67[_0x343b('0x67')];switch(_0xfb1e67[_0x343b('0x67')]){case'always':_0x2cfc95=squel[_0x343b('0x68')]()[_0x343b('0x69')](_0x343b('0x6a'))[_0x343b('0x6b')]([_0x343b('0x6c'),_0x343b('0x6d'),_0x343b('0x6e'),_0x343b('0x6f'),_0x343b('0x5d'),'createdAt',_0x343b('0x57')],squel[_0x343b('0x70')]()[_0x343b('0x71')](_0x343b('0x6c'),'phone')[_0x343b('0x71')](_0x343b('0x72'),_0x343b('0x6d'))['field']('id',_0x343b('0x6e'))['field'](_0x27fcb1[_0x343b('0x73')]['toString'](),_0x343b('0x6f'))[_0x343b('0x71')](_0x5c0e01[_0x343b('0x48')]['id'][_0x343b('0x74')](),'CampaignId')['field']('NOW()','createdAt')[_0x343b('0x71')]('NOW()','updatedAt')['from'](_0x343b('0x75'))[_0x343b('0x3e')](_0x343b('0x76'))[_0x343b('0x3e')](_0x343b('0x77'),_0x27fcb1[_0x343b('0x73')][_0x343b('0x74')]())[_0x343b('0x3e')](_0x343b('0x78'))[_0x343b('0x3e')](_0x343b('0x79'),squel[_0x343b('0x70')]()[_0x343b('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x343b('0x7a')](_0x343b('0x7b'))['where'](_0x343b('0x7c'),_0x5c0e01[_0x343b('0x48')]['id'][_0x343b('0x74')]()))[_0x343b('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x343b('0x70')]()['field'](_0x343b('0x7d'))['from'](_0x343b('0x6a'))[_0x343b('0x3e')](_0x343b('0x7c'),_0x5c0e01[_0x343b('0x48')]['id'][_0x343b('0x74')]())))[_0x343b('0x74')]();break;case _0x343b('0x7e'):_0x2cfc95=squel[_0x343b('0x68')]()[_0x343b('0x69')](_0x343b('0x6a'))['fromQuery']([_0x343b('0x6c'),_0x343b('0x6d'),_0x343b('0x6e'),_0x343b('0x6f'),'CampaignId',_0x343b('0x59'),_0x343b('0x57')],squel[_0x343b('0x70')]()[_0x343b('0x71')](_0x343b('0x6c'),_0x343b('0x6c'))[_0x343b('0x71')](_0x343b('0x72'),'scheduledAt')[_0x343b('0x71')]('id','ContactId')['field'](_0x27fcb1[_0x343b('0x73')][_0x343b('0x74')](),_0x343b('0x6f'))[_0x343b('0x71')](_0x5c0e01[_0x343b('0x48')]['id'][_0x343b('0x74')](),_0x343b('0x5d'))[_0x343b('0x71')](_0x343b('0x72'),_0x343b('0x59'))[_0x343b('0x71')]('NOW()',_0x343b('0x57'))[_0x343b('0x7a')](_0x343b('0x75'))[_0x343b('0x3e')]('deletedAt\x20IS\x20NULL')[_0x343b('0x3e')](_0x343b('0x77'),_0x27fcb1[_0x343b('0x73')][_0x343b('0x74')]())[_0x343b('0x3e')](_0x343b('0x78'))[_0x343b('0x3e')](_0x343b('0x79'),squel[_0x343b('0x70')]()['field'](_0x343b('0x7d'))[_0x343b('0x7a')](_0x343b('0x6a'))['where']('CampaignId\x20=\x20?',_0x5c0e01[_0x343b('0x48')]['id'][_0x343b('0x74')]())))[_0x343b('0x74')]();break;default:_0x2cfc95=squel['insert']()[_0x343b('0x69')](_0x343b('0x6a'))['fromQuery']([_0x343b('0x6c'),_0x343b('0x6d'),_0x343b('0x6e'),'ListId',_0x343b('0x5d'),_0x343b('0x59'),_0x343b('0x57')],squel[_0x343b('0x70')]()['field'](_0x343b('0x6c'),_0x343b('0x6c'))[_0x343b('0x71')]('NOW()','scheduledAt')[_0x343b('0x71')]('id',_0x343b('0x6e'))['field'](_0x27fcb1['CmListId'][_0x343b('0x74')](),_0x343b('0x6f'))[_0x343b('0x71')](_0x5c0e01[_0x343b('0x48')]['id'][_0x343b('0x74')](),_0x343b('0x5d'))['field']('NOW()','createdAt')[_0x343b('0x71')](_0x343b('0x72'),_0x343b('0x57'))[_0x343b('0x7a')](_0x343b('0x75'))[_0x343b('0x3e')](_0x343b('0x76'))[_0x343b('0x3e')](_0x343b('0x77'),_0x27fcb1[_0x343b('0x73')]['toString']())['where'](_0x343b('0x78')))['toString']();}_0x48dfd5[_0x343b('0x7f')](db[_0x343b('0x80')][_0x343b('0x35')](_0x2cfc95));}return BPromise[_0x343b('0x81')](_0x48dfd5);}})[_0x343b('0x24')](function(){return _0x18688b;})[_0x343b('0x24')](respondWithResult(_0x47823d,null))[_0x343b('0x4b')](handleError(_0x47823d,null));};exports['removeLists']=function(_0x3304cf,_0x3c9dee,_0x897688){return db['Campaign'][_0x343b('0x51')]({'where':{'id':_0x3304cf[_0x343b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c9dee,null))[_0x343b('0x24')](function(_0x5cee79){if(_0x5cee79){return _0x5cee79[_0x343b('0x82')](_0x3304cf['query'][_0x343b('0x65')]);}})[_0x343b('0x24')](function(_0x4de468){if(_0x4de468){return db[_0x343b('0x5e')]['destroy']({'where':{'ListId':_0x3304cf['query']['ids'],'CampaignId':_0x3304cf[_0x343b('0x48')]['id']}})[_0x343b('0x24')](function(){return _0x4de468;});}})['then'](respondWithStatusCode(_0x3c9dee,null))['catch'](handleError(_0x3c9dee,null));};exports[_0x343b('0x83')]=function(_0x1bfaa7,_0x42b22e,_0x4e643e){var _0x513c98={};var _0x95768c={};var _0x2a010d;var _0x2b06c5;return db[_0x343b('0x2f')]['findOne']({'where':{'id':_0x1bfaa7[_0x343b('0x48')]['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x42b22e,null))[_0x343b('0x24')](function(_0x1d551f){if(_0x1d551f){_0x2a010d=_0x1d551f;_0x95768c[_0x343b('0x34')]=_['keys'](db[_0x343b('0x84')][_0x343b('0x30')]);_0x95768c['query']=_[_0x343b('0x36')](_0x1bfaa7[_0x343b('0x35')]);_0x95768c[_0x343b('0x37')]=_[_0x343b('0x49')](_0x95768c[_0x343b('0x34')],_0x95768c[_0x343b('0x35')]);_0x513c98['attributes']=_[_0x343b('0x49')](_0x95768c[_0x343b('0x34')],qs[_0x343b('0x39')](_0x1bfaa7[_0x343b('0x35')]['fields']));_0x513c98[_0x343b('0x38')]=_0x513c98[_0x343b('0x38')][_0x343b('0x3a')]?_0x513c98['attributes']:_0x95768c['model'];_0x513c98[_0x343b('0x3c')]=qs[_0x343b('0x3d')](_0x1bfaa7[_0x343b('0x35')]['sort']);_0x513c98[_0x343b('0x3e')]=qs[_0x343b('0x37')](_[_0x343b('0x3f')](_0x1bfaa7[_0x343b('0x35')],_0x95768c[_0x343b('0x37')]));if(_0x1bfaa7[_0x343b('0x35')][_0x343b('0x40')]){_0x513c98[_0x343b('0x3e')]=_['merge'](_0x513c98[_0x343b('0x3e')],{'$or':_[_0x343b('0x2e')](_0x513c98[_0x343b('0x38')],function(_0x350d1e){var _0x3c7fc0={};_0x3c7fc0[_0x350d1e]={'$like':'%'+_0x1bfaa7[_0x343b('0x35')][_0x343b('0x40')]+'%'};return _0x3c7fc0;})});}_0x513c98=_[_0x343b('0x42')]({},_0x513c98,_0x1bfaa7['options']);return _0x2a010d[_0x343b('0x83')](_0x513c98);}})['then'](function(_0xdfe2d3){if(_0xdfe2d3){_0x2b06c5=_0xdfe2d3[_0x343b('0x3a')];if(!_0x1bfaa7[_0x343b('0x35')]['hasOwnProperty'](_0x343b('0x3b'))){_0x513c98[_0x343b('0x1c')]=qs[_0x343b('0x1c')](_0x1bfaa7[_0x343b('0x35')][_0x343b('0x1c')]);_0x513c98['offset']=qs[_0x343b('0x1b')](_0x1bfaa7[_0x343b('0x35')][_0x343b('0x1b')]);}return _0x2a010d[_0x343b('0x83')](_0x513c98);}})[_0x343b('0x24')](function(_0x5283e4){if(_0x5283e4){return _0x5283e4?{'count':_0x2b06c5,'rows':_0x5283e4}:null;}})[_0x343b('0x24')](respondWithResult(_0x42b22e,null))[_0x343b('0x4b')](handleError(_0x42b22e,null));};exports[_0x343b('0x85')]=function(_0x55d64f,_0x5cdd2f,_0x14a74f){var _0x54b5d1,_0x1f61df;return db[_0x343b('0x2f')][_0x343b('0x51')]({'where':{'id':_0x55d64f['params']['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x5cdd2f,null))['then'](function(_0x2b7f8d){if(_0x2b7f8d){_0x1f61df=_0x2b7f8d;return _0x2b7f8d['addBlackLists'](_0x55d64f[_0x343b('0x58')]['ids'],_['omit'](_0x55d64f[_0x343b('0x58')],[_0x343b('0x65'),'id'])||{});}return null;})[_0x343b('0x66')](function(_0x30d505){var _0x2a6779;_0x54b5d1=_0x30d505||[];var _0x3be0c2=[];if(_0x30d505){for(var _0xc807ed=0x0;_0xc807ed<_0x30d505[_0x343b('0x3a')];_0xc807ed+=0x1){var _0x6b2f=_0x30d505[_0xc807ed]['get']({'plain':!![]});_0x2a6779=squel[_0x343b('0x68')]()[_0x343b('0x69')](_0x343b('0x86'))[_0x343b('0x6b')]([_0x343b('0x6c'),_0x343b('0x6e'),'ListId','CampaignId',_0x343b('0x59'),_0x343b('0x57')],squel[_0x343b('0x70')]()[_0x343b('0x71')](_0x343b('0x6c'),'phone')['field']('id',_0x343b('0x6e'))[_0x343b('0x71')](_0x6b2f[_0x343b('0x73')][_0x343b('0x74')](),_0x343b('0x6f'))['field'](_0x55d64f['params']['id'][_0x343b('0x74')](),_0x343b('0x5d'))[_0x343b('0x71')](_0x343b('0x72'),_0x343b('0x59'))[_0x343b('0x71')]('NOW()',_0x343b('0x57'))['from'](_0x343b('0x75'))['where'](_0x343b('0x76'))[_0x343b('0x3e')]('ListId\x20=\x20?',_0x6b2f[_0x343b('0x73')][_0x343b('0x74')]())[_0x343b('0x3e')](_0x343b('0x78')))[_0x343b('0x74')]();_0x3be0c2[_0x343b('0x7f')](db['sequelize'][_0x343b('0x35')](_0x2a6779));}return BPromise[_0x343b('0x81')](_0x3be0c2);}})[_0x343b('0x24')](function(){return _0x54b5d1;})[_0x343b('0x24')](respondWithResult(_0x5cdd2f,null))['catch'](handleError(_0x5cdd2f,null));};exports[_0x343b('0x87')]=function(_0x4c5217,_0x1b3f46,_0x3122b0){return db[_0x343b('0x2f')][_0x343b('0x51')]({'where':{'id':_0x4c5217[_0x343b('0x48')]['id']}})[_0x343b('0x24')](handleEntityNotFound(_0x1b3f46,null))[_0x343b('0x24')](function(_0x3daba2){if(_0x3daba2){return _0x3daba2[_0x343b('0x87')](_0x4c5217[_0x343b('0x35')][_0x343b('0x65')]);}})[_0x343b('0x24')](function(_0x2ae488){if(_0x2ae488){return db[_0x343b('0x62')][_0x343b('0x25')]({'where':{'ListId':_0x4c5217['query'][_0x343b('0x65')],'CampaignId':_0x4c5217[_0x343b('0x48')]['id']}})[_0x343b('0x24')](function(){return _0x2ae488;});}})[_0x343b('0x24')](respondWithStatusCode(_0x1b3f46,null))[_0x343b('0x4b')](handleError(_0x1b3f46,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index feb1cf2..90d83ff 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x469ac7,_0x38e416){var _0x22f3b0=function(_0x1a1447){while(--_0x1a1447){_0x469ac7['push'](_0x469ac7['shift']());}};_0x22f3b0(++_0x38e416);}(_0x7a54,0x106));var _0x47a5=function(_0x45a4cf,_0x447b68){_0x45a4cf=_0x45a4cf-0x0;var _0x17c90a=_0x7a54[_0x45a4cf];return _0x17c90a;};'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
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 1ae9b4e..d26813e 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 _0xb32d=['result','options','where','limit','include','model','attributes','GetCampaign','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb32d,0x1da));var _0xdb32=function(_0x3d4e74,_0x21b4e5){_0x3d4e74=_0x3d4e74-0x0;var _0x57613d=_0xb32d[_0x3d4e74];return _0x57613d;};'use strict';var _=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var moment=require(_0xdb32('0x2'));var BPromise=require(_0xdb32('0x3'));var rs=require(_0xdb32('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdb32('0x5'));var logger=require(_0xdb32('0x6'))('rpc');var config=require(_0xdb32('0x7'));var jayson=require(_0xdb32('0x8'));var client=jayson[_0xdb32('0x9')][_0xdb32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f4af0,_0x386309,_0x5bb076){return new BPromise(function(_0x3b0995,_0x2686db){return client[_0xdb32('0xb')](_0x6f4af0,_0x5bb076)[_0xdb32('0xc')](function(_0x30e03d){logger[_0xdb32('0xd')](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));logger[_0xdb32('0x10')](_0xdb32('0x11'),_0x386309,_0xdb32('0xf'),JSON[_0xdb32('0x12')](_0x30e03d));if(_0x30e03d[_0xdb32('0x13')]){if(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x14')]===0x1f4){logger[_0xdb32('0x13')](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x2686db(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}logger['error'](_0xdb32('0xe'),_0x386309,_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);return _0x3b0995(_0x30e03d[_0xdb32('0x13')][_0xdb32('0x15')]);}else{logger['info'](_0xdb32('0xe'),_0x386309,_0xdb32('0xf'));_0x3b0995(_0x30e03d[_0xdb32('0x16')]['message']);}})['catch'](function(_0x59a5f8){logger['error'](_0xdb32('0xe'),_0x386309,_0x59a5f8);_0x2686db(_0x59a5f8);});});}exports['GetCampaign']=function(_0x1fd22b){var _0xfab49a=this;return new Promise(function(_0x1ba5f4,_0x301cc3){return db['Campaign']['findAll']({'raw':_0x1fd22b['options']?_0x1fd22b[_0xdb32('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1fd22b[_0xdb32('0x17')]?_0x1fd22b[_0xdb32('0x17')][_0xdb32('0x18')]||null:null,'attributes':_0x1fd22b[_0xdb32('0x17')]?_0x1fd22b[_0xdb32('0x17')]['attributes']||null:null,'limit':_0x1fd22b[_0xdb32('0x17')]?_0x1fd22b[_0xdb32('0x17')][_0xdb32('0x19')]||null:null,'include':_0x1fd22b['options']?_0x1fd22b['options'][_0xdb32('0x1a')]?_['map'](_0x1fd22b['options'][_0xdb32('0x1a')],function(_0x14b5fd){return{'model':db[_0x14b5fd[_0xdb32('0x1b')]],'as':_0x14b5fd['as'],'attributes':_0x14b5fd[_0xdb32('0x1c')],'include':_0x14b5fd['include']?_['map'](_0x14b5fd[_0xdb32('0x1a')],function(_0x2168d9){return{'model':db[_0x2168d9[_0xdb32('0x1b')]],'as':_0x2168d9['as'],'attributes':_0x2168d9['attributes'],'include':_0x2168d9[_0xdb32('0x1a')]?_['map'](_0x2168d9[_0xdb32('0x1a')],function(_0x17f627){return{'model':db[_0x17f627[_0xdb32('0x1b')]],'as':_0x17f627['as'],'attributes':_0x17f627[_0xdb32('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdb32('0xc')](function(_0x5d29da){logger['info'](_0xdb32('0x1d'),_0x1fd22b);logger['debug'](_0xdb32('0x1d'),_0x1fd22b,JSON[_0xdb32('0x12')](_0x5d29da));_0x1ba5f4(_0x5d29da);})[_0xdb32('0x1e')](function(_0x5a6109){logger['error'](_0xdb32('0x1d'),_0x5a6109[_0xdb32('0x15')],_0x1fd22b);_0x301cc3(_0xfab49a[_0xdb32('0x13')](0x1f4,_0x5a6109['message']));});});};
\ No newline at end of file
+var _0x8cfd=['catch','Campaign','findAll','options','raw','where','limit','map','model','include','attributes','GetCampaign','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x8cfd[_0x4f8f3b];return _0x4c250c;};'use strict';var _=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var moment=require(_0xd8cf('0x2'));var BPromise=require(_0xd8cf('0x3'));var rs=require(_0xd8cf('0x4'));var fs=require('fs');var Redis=require(_0xd8cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8cf('0x6'));var logger=require(_0xd8cf('0x7'))(_0xd8cf('0x8'));var config=require(_0xd8cf('0x9'));var jayson=require(_0xd8cf('0xa'));var client=jayson[_0xd8cf('0xb')][_0xd8cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b41b7,_0x5cfd20,_0x3fe2d2){return new BPromise(function(_0xa5b446,_0x37b91b){return client[_0xd8cf('0xd')](_0x4b41b7,_0x3fe2d2)[_0xd8cf('0xe')](function(_0x668d6c){logger['info'](_0xd8cf('0xf'),_0x5cfd20,_0xd8cf('0x10'));logger[_0xd8cf('0x11')](_0xd8cf('0x12'),_0x5cfd20,_0xd8cf('0x10'),JSON[_0xd8cf('0x13')](_0x668d6c));if(_0x668d6c[_0xd8cf('0x14')]){if(_0x668d6c[_0xd8cf('0x14')][_0xd8cf('0x15')]===0x1f4){logger[_0xd8cf('0x14')](_0xd8cf('0xf'),_0x5cfd20,_0x668d6c[_0xd8cf('0x14')]['message']);return _0x37b91b(_0x668d6c[_0xd8cf('0x14')]['message']);}logger[_0xd8cf('0x14')](_0xd8cf('0xf'),_0x5cfd20,_0x668d6c['error'][_0xd8cf('0x16')]);return _0xa5b446(_0x668d6c[_0xd8cf('0x14')][_0xd8cf('0x16')]);}else{logger['info'](_0xd8cf('0xf'),_0x5cfd20,'request\x20sent');_0xa5b446(_0x668d6c[_0xd8cf('0x17')][_0xd8cf('0x16')]);}})[_0xd8cf('0x18')](function(_0x55018c){logger[_0xd8cf('0x14')](_0xd8cf('0xf'),_0x5cfd20,_0x55018c);_0x37b91b(_0x55018c);});});}exports['GetCampaign']=function(_0xecd444){var _0x73e7c3=this;return new Promise(function(_0x3bee85,_0xf8732e){return db[_0xd8cf('0x19')][_0xd8cf('0x1a')]({'raw':_0xecd444[_0xd8cf('0x1b')]?_0xecd444[_0xd8cf('0x1b')][_0xd8cf('0x1c')]===undefined?!![]:![]:!![],'where':_0xecd444[_0xd8cf('0x1b')]?_0xecd444[_0xd8cf('0x1b')][_0xd8cf('0x1d')]||null:null,'attributes':_0xecd444[_0xd8cf('0x1b')]?_0xecd444[_0xd8cf('0x1b')]['attributes']||null:null,'limit':_0xecd444[_0xd8cf('0x1b')]?_0xecd444[_0xd8cf('0x1b')][_0xd8cf('0x1e')]||null:null,'include':_0xecd444[_0xd8cf('0x1b')]?_0xecd444[_0xd8cf('0x1b')]['include']?_[_0xd8cf('0x1f')](_0xecd444['options']['include'],function(_0x4e7d83){return{'model':db[_0x4e7d83[_0xd8cf('0x20')]],'as':_0x4e7d83['as'],'attributes':_0x4e7d83['attributes'],'include':_0x4e7d83[_0xd8cf('0x21')]?_[_0xd8cf('0x1f')](_0x4e7d83[_0xd8cf('0x21')],function(_0x667f44){return{'model':db[_0x667f44['model']],'as':_0x667f44['as'],'attributes':_0x667f44[_0xd8cf('0x22')],'include':_0x667f44[_0xd8cf('0x21')]?_[_0xd8cf('0x1f')](_0x667f44[_0xd8cf('0x21')],function(_0x2f97b1){return{'model':db[_0x2f97b1[_0xd8cf('0x20')]],'as':_0x2f97b1['as'],'attributes':_0x2f97b1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd8cf('0xe')](function(_0x1453d3){logger['info'](_0xd8cf('0x23'),_0xecd444);logger[_0xd8cf('0x11')](_0xd8cf('0x23'),_0xecd444,JSON[_0xd8cf('0x13')](_0x1453d3));_0x3bee85(_0x1453d3);})[_0xd8cf('0x18')](function(_0x48013b){logger[_0xd8cf('0x14')](_0xd8cf('0x23'),_0x48013b[_0xd8cf('0x16')],_0xecd444);_0xf8732e(_0x73e7c3[_0xd8cf('0x14')](0x1f4,_0x48013b[_0xd8cf('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 6837d41..16489c1 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 _0x55da=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','/:id/clone','clone','post','addLists','addBlackLists','delete','destroy','removeLists','/:id/blacklists','removeBlackLists','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4e0a5e,_0x1108ec){var _0x3def35=function(_0x137a03){while(--_0x137a03){_0x4e0a5e['push'](_0x4e0a5e['shift']());}};_0x3def35(++_0x1108ec);}(_0x55da,0x16f));var _0xa55d=function(_0x102654,_0x71d14){_0x102654=_0x102654-0x0;var _0xeb449=_0x55da[_0x102654];return _0xeb449;};'use strict';var multer=require('multer');var util=require(_0xa55d('0x0'));var path=require(_0xa55d('0x1'));var timeout=require(_0xa55d('0x2'));var express=require(_0xa55d('0x3'));var router=express[_0xa55d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa55d('0x5'));var interaction=require(_0xa55d('0x6'));var config=require(_0xa55d('0x7'));var controller=require('./campaign.controller');router[_0xa55d('0x8')]('/',auth[_0xa55d('0x9')](),controller[_0xa55d('0xa')]);router[_0xa55d('0x8')](_0xa55d('0xb'),auth[_0xa55d('0x9')](),controller[_0xa55d('0xc')]);router[_0xa55d('0x8')](_0xa55d('0xd'),auth['isAuthenticated'](),controller[_0xa55d('0xe')]);router[_0xa55d('0x8')](_0xa55d('0xf'),auth[_0xa55d('0x9')](),controller['getHopperHistories']);router[_0xa55d('0x8')](_0xa55d('0x10'),auth[_0xa55d('0x9')](),controller[_0xa55d('0x11')]);router[_0xa55d('0x8')](_0xa55d('0x12'),auth['isAuthenticated'](),controller[_0xa55d('0x13')]);router[_0xa55d('0x8')](_0xa55d('0x14'),auth[_0xa55d('0x9')](),controller[_0xa55d('0x15')]);router[_0xa55d('0x8')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xa55d('0x16')]);router['post']('/',auth[_0xa55d('0x9')](),controller[_0xa55d('0x17')]);router['post'](_0xa55d('0x18'),auth[_0xa55d('0x9')](),controller[_0xa55d('0x19')]);router[_0xa55d('0x1a')]('/:id/lists',auth[_0xa55d('0x9')](),controller[_0xa55d('0x1b')]);router['post']('/:id/blacklists',auth[_0xa55d('0x9')](),controller[_0xa55d('0x1c')]);router['put'](_0xa55d('0xb'),auth[_0xa55d('0x9')](),controller['update']);router[_0xa55d('0x1d')](_0xa55d('0xb'),auth[_0xa55d('0x9')](),controller[_0xa55d('0x1e')]);router[_0xa55d('0x1d')](_0xa55d('0x14'),auth[_0xa55d('0x9')](),controller[_0xa55d('0x1f')]);router[_0xa55d('0x1d')](_0xa55d('0x20'),auth[_0xa55d('0x9')](),controller[_0xa55d('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0x32f6=['addLists','/:id/blacklists','put','destroy','delete','removeBlackLists','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperBlacks','post','/:id/clone','clone','/:id/lists'];(function(_0x264eb4,_0x4f072e){var _0x4c73ad=function(_0x45ec1f){while(--_0x45ec1f){_0x264eb4['push'](_0x264eb4['shift']());}};_0x4c73ad(++_0x4f072e);}(_0x32f6,0xbd));var _0x632f=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x32f6[_0x4d613c];return _0x301fe3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x632f('0x0'));var timeout=require(_0x632f('0x1'));var express=require('express');var router=express[_0x632f('0x2')]();var fs_extra=require(_0x632f('0x3'));var auth=require(_0x632f('0x4'));var interaction=require(_0x632f('0x5'));var config=require(_0x632f('0x6'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x632f('0x7')](_0x632f('0x8'),auth[_0x632f('0x9')](),controller[_0x632f('0xa')]);router[_0x632f('0x7')](_0x632f('0xb'),auth[_0x632f('0x9')](),controller[_0x632f('0xc')]);router[_0x632f('0x7')]('/:id/hopper_histories',auth[_0x632f('0x9')](),controller[_0x632f('0xd')]);router['get']('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x632f('0x7')]('/:id/hopper_black',auth[_0x632f('0x9')](),controller[_0x632f('0xe')]);router[_0x632f('0x7')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0x632f('0xf')]('/',auth[_0x632f('0x9')](),controller['create']);router[_0x632f('0xf')](_0x632f('0x10'),auth[_0x632f('0x9')](),controller[_0x632f('0x11')]);router['post'](_0x632f('0x12'),auth[_0x632f('0x9')](),controller[_0x632f('0x13')]);router[_0x632f('0xf')](_0x632f('0x14'),auth[_0x632f('0x9')](),controller['addBlackLists']);router[_0x632f('0x15')](_0x632f('0x8'),auth[_0x632f('0x9')](),controller['update']);router['delete']('/:id',auth[_0x632f('0x9')](),controller[_0x632f('0x16')]);router[_0x632f('0x17')](_0x632f('0x12'),auth[_0x632f('0x9')](),controller['removeLists']);router[_0x632f('0x17')]('/:id/blacklists',auth[_0x632f('0x9')](),controller[_0x632f('0x18')]);module[_0x632f('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 58d493a..bee5800 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 _0x1273=['STRING','VIRTUAL','getDataValue','exports'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x1273,0x7b));var _0x3127=function(_0xd2c8f3,_0x3cfb97){_0xd2c8f3=_0xd2c8f3-0x0;var _0x34efcf=_0x1273[_0xd2c8f3];return _0x34efcf;};'use strict';var Sequelize=require('sequelize');module[_0x3127('0x0')]={'key':{'type':Sequelize[_0x3127('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x3127('0x1')]},'name':{'type':Sequelize[_0x3127('0x2')],'get':function(){return this[_0x3127('0x3')]('key');}}};
\ No newline at end of file
+var _0x9917=['getDataValue','exports','TEXT','STRING','VIRTUAL'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x9917,0xfb));var _0x7991=function(_0x43a2a1,_0x54430d){_0x43a2a1=_0x43a2a1-0x0;var _0x110d92=_0x9917[_0x43a2a1];return _0x110d92;};'use strict';var Sequelize=require('sequelize');module[_0x7991('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7991('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7991('0x2')]},'name':{'type':Sequelize[_0x7991('0x3')],'get':function(){return this[_0x7991('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index bd9b059..68dcb7c 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 _0x8fb4=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','options','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x8fb4,0x7f));var _0x48fb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fb4[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x48fb('0x0'));var rimraf=require(_0x48fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48fb('0x2'));var rp=require(_0x48fb('0x3'));var moment=require(_0x48fb('0x4'));var BPromise=require(_0x48fb('0x5'));var Mustache=require(_0x48fb('0x6'));var util=require(_0x48fb('0x7'));var path=require(_0x48fb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48fb('0x9'));var _=require(_0x48fb('0xa'));var squel=require(_0x48fb('0xb'));var crypto=require(_0x48fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x48fb('0xd'));var toCsv=require(_0x48fb('0xe'));var querystring=require(_0x48fb('0xf'));var Papa=require(_0x48fb('0x10'));var Redis=require(_0x48fb('0x11'));var authService=require(_0x48fb('0x12'));var qs=require(_0x48fb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x48fb('0x14'));var utils=require('../../config/utils');var config=require(_0x48fb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x48fb('0x16'))['db'];function respondWithStatusCode(_0x597202,_0x175774){_0x175774=_0x175774||0xcc;return function(_0x48f5b3){if(_0x48f5b3){return _0x597202[_0x48fb('0x17')](_0x175774);}return _0x597202[_0x48fb('0x18')](_0x175774)[_0x48fb('0x19')]();};}function respondWithResult(_0x6a3533,_0x21f6ab){_0x21f6ab=_0x21f6ab||0xc8;return function(_0x7f9a6b){if(_0x7f9a6b){return _0x6a3533[_0x48fb('0x18')](_0x21f6ab)[_0x48fb('0x1a')](_0x7f9a6b);}};}function respondWithFilteredResult(_0x47eb86,_0x511237){return function(_0x2c419a){if(_0x2c419a){var _0x14c09a=typeof _0x511237[_0x48fb('0x1b')]===_0x48fb('0x1c')&&typeof _0x511237['limit']===_0x48fb('0x1c');var _0x2ca758=_0x2c419a[_0x48fb('0x1d')];var _0x52c607=_0x14c09a?0x0:_0x511237['offset'];var _0x1d126b=_0x14c09a?_0x2c419a['count']:_0x511237['offset']+_0x511237[_0x48fb('0x1e')];var _0x6ad8dd;if(_0x1d126b>=_0x2ca758){_0x1d126b=_0x2ca758;_0x6ad8dd=0xc8;}else{_0x6ad8dd=0xce;}_0x47eb86[_0x48fb('0x18')](_0x6ad8dd);return _0x47eb86[_0x48fb('0x1f')](_0x48fb('0x20'),_0x52c607+'-'+_0x1d126b+'/'+_0x2ca758)[_0x48fb('0x1a')](_0x2c419a);}return null;};}function patchUpdates(_0x4358f2){return function(_0x4c7aa6){try{jsonpatch[_0x48fb('0x21')](_0x4c7aa6,_0x4358f2,!![]);}catch(_0x96a55d){return BPromise[_0x48fb('0x22')](_0x96a55d);}return _0x4c7aa6[_0x48fb('0x23')]();};}function saveUpdates(_0x4397e6,_0x504068){return function(_0x31b61e){if(_0x31b61e){return _0x31b61e[_0x48fb('0x24')](_0x4397e6)[_0x48fb('0x25')](function(_0x269c3f){return _0x269c3f;});}return null;};}function removeEntity(_0x24b5f0,_0x2facb1){return function(_0x242f9f){if(_0x242f9f){return _0x242f9f[_0x48fb('0x26')]()[_0x48fb('0x25')](function(){var _0x137f7d=_0x242f9f[_0x48fb('0x27')]({'plain':!![]});var _0xab101c=_0x48fb('0x28');return db[_0x48fb('0x29')]['destroy']({'where':{'type':_0xab101c,'resourceId':_0x137f7d['id']}})[_0x48fb('0x25')](function(){return _0x242f9f;});})[_0x48fb('0x25')](function(){_0x24b5f0[_0x48fb('0x18')](0xcc)[_0x48fb('0x19')]();});}};}function handleEntityNotFound(_0x95ab88,_0x248bfe){return function(_0x3854d7){if(!_0x3854d7){_0x95ab88[_0x48fb('0x17')](0x194);}return _0x3854d7;};}function handleError(_0x5eef32,_0x357ab9){_0x357ab9=_0x357ab9||0x1f4;return function(_0x48f3db){logger[_0x48fb('0x2a')](_0x48f3db[_0x48fb('0x2b')]);if(_0x48f3db[_0x48fb('0x2c')]){delete _0x48f3db[_0x48fb('0x2c')];}_0x5eef32[_0x48fb('0x18')](_0x357ab9)[_0x48fb('0x2d')](_0x48f3db);};}exports[_0x48fb('0x2e')]=function(_0x46f78f,_0x4037f0){var _0x3e907a={},_0x366a1c={},_0x3f1ee8={'count':0x0,'rows':[]};var _0x56f217=_[_0x48fb('0x2f')](db[_0x48fb('0x30')][_0x48fb('0x31')],function(_0x584999){return{'name':_0x584999[_0x48fb('0x32')],'type':_0x584999[_0x48fb('0x33')][_0x48fb('0x34')]};});_0x366a1c[_0x48fb('0x35')]=_[_0x48fb('0x2f')](_0x56f217,_0x48fb('0x2c'));_0x366a1c[_0x48fb('0x36')]=_[_0x48fb('0x37')](_0x46f78f[_0x48fb('0x36')]);_0x366a1c[_0x48fb('0x38')]=_[_0x48fb('0x39')](_0x366a1c[_0x48fb('0x35')],_0x366a1c[_0x48fb('0x36')]);_0x3e907a['attributes']=_['intersection'](_0x366a1c[_0x48fb('0x35')],qs['fields'](_0x46f78f['query'][_0x48fb('0x3a')]));_0x3e907a[_0x48fb('0x3b')]=_0x3e907a[_0x48fb('0x3b')][_0x48fb('0x3c')]?_0x3e907a[_0x48fb('0x3b')]:_0x366a1c['model'];if(!_0x46f78f[_0x48fb('0x36')][_0x48fb('0x3d')](_0x48fb('0x3e'))){_0x3e907a[_0x48fb('0x1e')]=qs['limit'](_0x46f78f['query']['limit']);_0x3e907a[_0x48fb('0x1b')]=qs[_0x48fb('0x1b')](_0x46f78f[_0x48fb('0x36')][_0x48fb('0x1b')]);}_0x3e907a[_0x48fb('0x3f')]=qs[_0x48fb('0x40')](_0x46f78f[_0x48fb('0x36')][_0x48fb('0x40')]);_0x3e907a[_0x48fb('0x41')]=qs[_0x48fb('0x38')](_[_0x48fb('0x42')](_0x46f78f[_0x48fb('0x36')],_0x366a1c[_0x48fb('0x38')]),_0x56f217);if(_0x46f78f[_0x48fb('0x36')]['filter']){_0x3e907a[_0x48fb('0x41')]=_['merge'](_0x3e907a[_0x48fb('0x41')],{'$or':[{'key':{'$like':'%'+_0x46f78f[_0x48fb('0x36')][_0x48fb('0x43')]+'%'}},{'value':{'$like':'%'+_0x46f78f[_0x48fb('0x36')][_0x48fb('0x43')]+'%'}}]});}_0x3e907a=_[_0x48fb('0x44')]({},_0x3e907a,_0x46f78f['options']);var _0x3e591f={'where':_0x3e907a[_0x48fb('0x41')]};return db[_0x48fb('0x30')][_0x48fb('0x1d')](_0x3e591f)[_0x48fb('0x25')](function(_0x3ffe59){_0x3f1ee8[_0x48fb('0x1d')]=_0x3ffe59;if(_0x46f78f[_0x48fb('0x36')][_0x48fb('0x45')]){_0x3e907a['include']=[{'all':!![]}];}return db[_0x48fb('0x30')][_0x48fb('0x46')](_0x3e907a);})[_0x48fb('0x25')](function(_0x245c10){_0x3f1ee8[_0x48fb('0x47')]=_0x245c10;return _0x3f1ee8;})[_0x48fb('0x25')](respondWithFilteredResult(_0x4037f0,_0x3e907a))[_0x48fb('0x48')](handleError(_0x4037f0,null));};exports[_0x48fb('0x49')]=function(_0x251fb2,_0xbbbe0a){var _0x59c86e={'raw':!![],'where':{'id':_0x251fb2[_0x48fb('0x4a')]['id']}},_0x3a4213={};_0x3a4213[_0x48fb('0x35')]=_[_0x48fb('0x37')](db['CannedAnswer'][_0x48fb('0x31')]);_0x3a4213[_0x48fb('0x36')]=_[_0x48fb('0x37')](_0x251fb2['query']);_0x3a4213[_0x48fb('0x38')]=_[_0x48fb('0x39')](_0x3a4213[_0x48fb('0x35')],_0x3a4213['query']);_0x59c86e['attributes']=_['intersection'](_0x3a4213['model'],qs[_0x48fb('0x3a')](_0x251fb2['query'][_0x48fb('0x3a')]));_0x59c86e[_0x48fb('0x3b')]=_0x59c86e['attributes'][_0x48fb('0x3c')]?_0x59c86e['attributes']:_0x3a4213['model'];if(_0x251fb2['query']['includeAll']){_0x59c86e['include']=[{'all':!![]}];}_0x59c86e=_[_0x48fb('0x44')]({},_0x59c86e,_0x251fb2[_0x48fb('0x4b')]);return db[_0x48fb('0x30')][_0x48fb('0x4c')](_0x59c86e)[_0x48fb('0x25')](handleEntityNotFound(_0xbbbe0a,null))[_0x48fb('0x25')](respondWithResult(_0xbbbe0a,null))['catch'](handleError(_0xbbbe0a,null));};exports[_0x48fb('0x24')]=function(_0x48b435,_0x3c67c4){if(_0x48b435[_0x48fb('0x4d')]['id']){delete _0x48b435[_0x48fb('0x4d')]['id'];}return db[_0x48fb('0x30')][_0x48fb('0x4c')]({'where':{'id':_0x48b435['params']['id']}})[_0x48fb('0x25')](handleEntityNotFound(_0x3c67c4,null))[_0x48fb('0x25')](saveUpdates(_0x48b435[_0x48fb('0x4d')],null))[_0x48fb('0x25')](respondWithResult(_0x3c67c4,null))[_0x48fb('0x48')](handleError(_0x3c67c4,null));};exports['destroy']=function(_0x7477ef,_0x4a67c8){return db['CannedAnswer'][_0x48fb('0x4c')]({'where':{'id':_0x7477ef[_0x48fb('0x4a')]['id']}})[_0x48fb('0x25')](handleEntityNotFound(_0x4a67c8,null))[_0x48fb('0x25')](removeEntity(_0x4a67c8,null))[_0x48fb('0x48')](handleError(_0x4a67c8,null));};exports['create']=function(_0x559f20,_0x510dd2){var _0x1678dc={'key':_0x559f20[_0x48fb('0x4d')][_0x48fb('0x34')]};if(_0x559f20[_0x48fb('0x4d')][_0x48fb('0x4e')]){_0x1678dc[_0x48fb('0x4e')]=_0x559f20[_0x48fb('0x4d')][_0x48fb('0x4e')];}else if(_0x559f20[_0x48fb('0x4d')][_0x48fb('0x4f')]){_0x1678dc['SmsAccountId']=_0x559f20['body'][_0x48fb('0x4f')];}else if(_0x559f20['body'][_0x48fb('0x50')]){_0x1678dc['OpenchannelAccountId']=_0x559f20['body'][_0x48fb('0x50')];}else if(_0x559f20[_0x48fb('0x4d')][_0x48fb('0x51')]){_0x1678dc['ChatWebsiteId']=_0x559f20['body'][_0x48fb('0x51')];}return db['CannedAnswer'][_0x48fb('0x4c')]({'where':_0x1678dc})[_0x48fb('0x25')](function(_0x4e8c58){if(_0x4e8c58){throw new db['Sequelize'][(_0x48fb('0x52'))](_0x48fb('0x53'));}return db[_0x48fb('0x30')][_0x48fb('0x54')](_0x559f20[_0x48fb('0x4d')]);})['then'](function(_0x2c4a3a){var _0x3b3d94=_0x559f20[_0x48fb('0x55')][_0x48fb('0x27')]({'plain':!![]});if(!_0x3b3d94)throw new Error(_0x48fb('0x56'));if(_0x3b3d94[_0x48fb('0x57')]===_0x48fb('0x55')){var _0x4edfdb=_0x2c4a3a['get']({'plain':!![]});return db[_0x48fb('0x58')][_0x48fb('0x4c')]({'where':{'name':_0x48fb('0x28'),'userProfileId':_0x3b3d94[_0x48fb('0x59')]},'raw':!![]})[_0x48fb('0x25')](function(_0x5db2b4){if(_0x5db2b4&&_0x5db2b4['autoAssociation']===0x0){return db[_0x48fb('0x29')][_0x48fb('0x54')]({'name':_0x4edfdb[_0x48fb('0x2c')],'resourceId':_0x4edfdb['id'],'type':_0x5db2b4['name'],'sectionId':_0x5db2b4['id']},{})['then'](function(){return _0x2c4a3a;});}else{return _0x2c4a3a;}})[_0x48fb('0x48')](function(_0xa5530){logger[_0x48fb('0x2a')](_0x48fb('0x5a'),_0xa5530);throw _0xa5530;});}return _0x2c4a3a;})[_0x48fb('0x25')](respondWithResult(_0x510dd2,0xc9))[_0x48fb('0x48')](handleError(_0x510dd2,null));};
\ No newline at end of file
+var _0x1c56=['include','rows','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','filters','merge','filter','options','includeAll'];(function(_0x284240,_0x555b56){var _0x390667=function(_0x409454){while(--_0x409454){_0x284240['push'](_0x284240['shift']());}};_0x390667(++_0x555b56);}(_0x1c56,0x16c));var _0x61c5=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x1c56[_0x3e2489];return _0x2254ce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x61c5('0x0'));var rp=require(_0x61c5('0x1'));var moment=require(_0x61c5('0x2'));var BPromise=require(_0x61c5('0x3'));var Mustache=require(_0x61c5('0x4'));var util=require(_0x61c5('0x5'));var path=require('path');var sox=require(_0x61c5('0x6'));var csv=require(_0x61c5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61c5('0x8'));var _=require(_0x61c5('0x9'));var squel=require('squel');var crypto=require(_0x61c5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x61c5('0xb'));var toCsv=require(_0x61c5('0x7'));var querystring=require(_0x61c5('0xc'));var Papa=require(_0x61c5('0xd'));var Redis=require(_0x61c5('0xe'));var authService=require(_0x61c5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x61c5('0x10'));var hardwareService=require(_0x61c5('0x11'));var logger=require(_0x61c5('0x12'))(_0x61c5('0x13'));var utils=require(_0x61c5('0x14'));var config=require(_0x61c5('0x15'));var licenseUtil=require(_0x61c5('0x16'));var db=require(_0x61c5('0x17'))['db'];function respondWithStatusCode(_0x876bdb,_0x401f6d){_0x401f6d=_0x401f6d||0xcc;return function(_0xd97963){if(_0xd97963){return _0x876bdb[_0x61c5('0x18')](_0x401f6d);}return _0x876bdb['status'](_0x401f6d)[_0x61c5('0x19')]();};}function respondWithResult(_0x47cf37,_0x268a9f){_0x268a9f=_0x268a9f||0xc8;return function(_0x476a33){if(_0x476a33){return _0x47cf37[_0x61c5('0x1a')](_0x268a9f)[_0x61c5('0x1b')](_0x476a33);}};}function respondWithFilteredResult(_0x3e60ca,_0x517947){return function(_0x3935d8){if(_0x3935d8){var _0x27e6b5=typeof _0x517947[_0x61c5('0x1c')]===_0x61c5('0x1d')&&typeof _0x517947[_0x61c5('0x1e')]===_0x61c5('0x1d');var _0x2d2243=_0x3935d8[_0x61c5('0x1f')];var _0x3f79b5=_0x27e6b5?0x0:_0x517947[_0x61c5('0x1c')];var _0x151e50=_0x27e6b5?_0x3935d8[_0x61c5('0x1f')]:_0x517947['offset']+_0x517947[_0x61c5('0x1e')];var _0x32a9d;if(_0x151e50>=_0x2d2243){_0x151e50=_0x2d2243;_0x32a9d=0xc8;}else{_0x32a9d=0xce;}_0x3e60ca[_0x61c5('0x1a')](_0x32a9d);return _0x3e60ca[_0x61c5('0x20')]('Content-Range',_0x3f79b5+'-'+_0x151e50+'/'+_0x2d2243)['json'](_0x3935d8);}return null;};}function patchUpdates(_0x42348e){return function(_0x5170df){try{jsonpatch[_0x61c5('0x21')](_0x5170df,_0x42348e,!![]);}catch(_0xadb7a4){return BPromise[_0x61c5('0x22')](_0xadb7a4);}return _0x5170df[_0x61c5('0x23')]();};}function saveUpdates(_0x427e64,_0x1b49b9){return function(_0x2b7550){if(_0x2b7550){return _0x2b7550[_0x61c5('0x24')](_0x427e64)[_0x61c5('0x25')](function(_0x4af34e){return _0x4af34e;});}return null;};}function removeEntity(_0x1dc31c,_0x2ce7c6){return function(_0x26660b){if(_0x26660b){return _0x26660b[_0x61c5('0x26')]()['then'](function(){var _0x524696=_0x26660b[_0x61c5('0x27')]({'plain':!![]});var _0x1cae64=_0x61c5('0x28');return db[_0x61c5('0x29')][_0x61c5('0x26')]({'where':{'type':_0x1cae64,'resourceId':_0x524696['id']}})[_0x61c5('0x25')](function(){return _0x26660b;});})[_0x61c5('0x25')](function(){_0x1dc31c[_0x61c5('0x1a')](0xcc)[_0x61c5('0x19')]();});}};}function handleEntityNotFound(_0x426da1,_0x29c44f){return function(_0x395738){if(!_0x395738){_0x426da1[_0x61c5('0x18')](0x194);}return _0x395738;};}function handleError(_0x42f23d,_0xfd44ef){_0xfd44ef=_0xfd44ef||0x1f4;return function(_0x1e0a89){logger[_0x61c5('0x2a')](_0x1e0a89['stack']);if(_0x1e0a89['name']){delete _0x1e0a89[_0x61c5('0x2b')];}_0x42f23d[_0x61c5('0x1a')](_0xfd44ef)[_0x61c5('0x2c')](_0x1e0a89);};}exports[_0x61c5('0x2d')]=function(_0x198946,_0x2778a1){var _0x3a4e14={},_0x1f2a39={},_0x1b056e={'count':0x0,'rows':[]};var _0x26fe77=_[_0x61c5('0x2e')](db[_0x61c5('0x2f')][_0x61c5('0x30')],function(_0x540f50){return{'name':_0x540f50[_0x61c5('0x31')],'type':_0x540f50[_0x61c5('0x32')][_0x61c5('0x33')]};});_0x1f2a39['model']=_['map'](_0x26fe77,_0x61c5('0x2b'));_0x1f2a39[_0x61c5('0x34')]=_['keys'](_0x198946[_0x61c5('0x34')]);_0x1f2a39['filters']=_[_0x61c5('0x35')](_0x1f2a39[_0x61c5('0x36')],_0x1f2a39[_0x61c5('0x34')]);_0x3a4e14['attributes']=_[_0x61c5('0x35')](_0x1f2a39['model'],qs[_0x61c5('0x37')](_0x198946['query'][_0x61c5('0x37')]));_0x3a4e14['attributes']=_0x3a4e14[_0x61c5('0x38')]['length']?_0x3a4e14[_0x61c5('0x38')]:_0x1f2a39[_0x61c5('0x36')];if(!_0x198946[_0x61c5('0x34')][_0x61c5('0x39')]('nolimit')){_0x3a4e14['limit']=qs[_0x61c5('0x1e')](_0x198946[_0x61c5('0x34')]['limit']);_0x3a4e14[_0x61c5('0x1c')]=qs['offset'](_0x198946[_0x61c5('0x34')][_0x61c5('0x1c')]);}_0x3a4e14[_0x61c5('0x3a')]=qs['sort'](_0x198946['query'][_0x61c5('0x3b')]);_0x3a4e14[_0x61c5('0x3c')]=qs[_0x61c5('0x3d')](_['pick'](_0x198946[_0x61c5('0x34')],_0x1f2a39[_0x61c5('0x3d')]),_0x26fe77);if(_0x198946['query']['filter']){_0x3a4e14[_0x61c5('0x3c')]=_[_0x61c5('0x3e')](_0x3a4e14[_0x61c5('0x3c')],{'$or':[{'key':{'$like':'%'+_0x198946[_0x61c5('0x34')][_0x61c5('0x3f')]+'%'}},{'value':{'$like':'%'+_0x198946[_0x61c5('0x34')]['filter']+'%'}}]});}_0x3a4e14=_[_0x61c5('0x3e')]({},_0x3a4e14,_0x198946[_0x61c5('0x40')]);var _0x4186df={'where':_0x3a4e14[_0x61c5('0x3c')]};return db['CannedAnswer'][_0x61c5('0x1f')](_0x4186df)['then'](function(_0x44de16){_0x1b056e['count']=_0x44de16;if(_0x198946['query'][_0x61c5('0x41')]){_0x3a4e14[_0x61c5('0x42')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3a4e14);})[_0x61c5('0x25')](function(_0x392220){_0x1b056e[_0x61c5('0x43')]=_0x392220;return _0x1b056e;})[_0x61c5('0x25')](respondWithFilteredResult(_0x2778a1,_0x3a4e14))['catch'](handleError(_0x2778a1,null));};exports['show']=function(_0x2430f8,_0x43e3d5){var _0x3129e8={'raw':!![],'where':{'id':_0x2430f8[_0x61c5('0x44')]['id']}},_0xb7b0c2={};_0xb7b0c2[_0x61c5('0x36')]=_[_0x61c5('0x45')](db['CannedAnswer']['rawAttributes']);_0xb7b0c2[_0x61c5('0x34')]=_['keys'](_0x2430f8['query']);_0xb7b0c2[_0x61c5('0x3d')]=_[_0x61c5('0x35')](_0xb7b0c2[_0x61c5('0x36')],_0xb7b0c2[_0x61c5('0x34')]);_0x3129e8[_0x61c5('0x38')]=_['intersection'](_0xb7b0c2[_0x61c5('0x36')],qs[_0x61c5('0x37')](_0x2430f8[_0x61c5('0x34')][_0x61c5('0x37')]));_0x3129e8[_0x61c5('0x38')]=_0x3129e8['attributes']['length']?_0x3129e8[_0x61c5('0x38')]:_0xb7b0c2['model'];if(_0x2430f8[_0x61c5('0x34')][_0x61c5('0x41')]){_0x3129e8['include']=[{'all':!![]}];}_0x3129e8=_[_0x61c5('0x3e')]({},_0x3129e8,_0x2430f8[_0x61c5('0x40')]);return db['CannedAnswer'][_0x61c5('0x46')](_0x3129e8)[_0x61c5('0x25')](handleEntityNotFound(_0x43e3d5,null))['then'](respondWithResult(_0x43e3d5,null))['catch'](handleError(_0x43e3d5,null));};exports['update']=function(_0x5446db,_0x4b1ae5){if(_0x5446db[_0x61c5('0x47')]['id']){delete _0x5446db[_0x61c5('0x47')]['id'];}return db['CannedAnswer'][_0x61c5('0x46')]({'where':{'id':_0x5446db[_0x61c5('0x44')]['id']}})[_0x61c5('0x25')](handleEntityNotFound(_0x4b1ae5,null))[_0x61c5('0x25')](saveUpdates(_0x5446db['body'],null))[_0x61c5('0x25')](respondWithResult(_0x4b1ae5,null))['catch'](handleError(_0x4b1ae5,null));};exports[_0x61c5('0x26')]=function(_0x5ecf66,_0x3efa82){return db[_0x61c5('0x2f')][_0x61c5('0x46')]({'where':{'id':_0x5ecf66[_0x61c5('0x44')]['id']}})[_0x61c5('0x25')](handleEntityNotFound(_0x3efa82,null))[_0x61c5('0x25')](removeEntity(_0x3efa82,null))['catch'](handleError(_0x3efa82,null));};exports[_0x61c5('0x48')]=function(_0x20810c,_0xfdd584){var _0x3ff992={'key':_0x20810c['body'][_0x61c5('0x33')]};if(_0x20810c['body'][_0x61c5('0x49')]){_0x3ff992['MailAccountId']=_0x20810c['body'][_0x61c5('0x49')];}else if(_0x20810c[_0x61c5('0x47')][_0x61c5('0x4a')]){_0x3ff992[_0x61c5('0x4a')]=_0x20810c[_0x61c5('0x47')][_0x61c5('0x4a')];}else if(_0x20810c[_0x61c5('0x47')][_0x61c5('0x4b')]){_0x3ff992[_0x61c5('0x4b')]=_0x20810c[_0x61c5('0x47')][_0x61c5('0x4b')];}else if(_0x20810c[_0x61c5('0x47')]['ChatWebsiteId']){_0x3ff992['ChatWebsiteId']=_0x20810c[_0x61c5('0x47')][_0x61c5('0x4c')];}return db[_0x61c5('0x2f')][_0x61c5('0x46')]({'where':_0x3ff992})['then'](function(_0x31f109){if(_0x31f109){throw new db[(_0x61c5('0x4d'))][(_0x61c5('0x4e'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x61c5('0x2f')][_0x61c5('0x48')](_0x20810c[_0x61c5('0x47')]);})[_0x61c5('0x25')](function(_0x59ba8a){var _0x450c3e=_0x20810c['user']['get']({'plain':!![]});if(!_0x450c3e)throw new Error(_0x61c5('0x4f'));if(_0x450c3e[_0x61c5('0x50')]==='user'){var _0x29be1f=_0x59ba8a[_0x61c5('0x27')]({'plain':!![]});return db[_0x61c5('0x51')][_0x61c5('0x46')]({'where':{'name':_0x61c5('0x28'),'userProfileId':_0x450c3e[_0x61c5('0x52')]},'raw':!![]})[_0x61c5('0x25')](function(_0x6dda7e){if(_0x6dda7e&&_0x6dda7e[_0x61c5('0x53')]===0x0){return db[_0x61c5('0x29')][_0x61c5('0x48')]({'name':_0x29be1f[_0x61c5('0x2b')],'resourceId':_0x29be1f['id'],'type':_0x6dda7e['name'],'sectionId':_0x6dda7e['id']},{})['then'](function(){return _0x59ba8a;});}else{return _0x59ba8a;}})[_0x61c5('0x54')](function(_0x40a42d){logger['error'](_0x61c5('0x55'),_0x40a42d);throw _0x40a42d;});}return _0x59ba8a;})[_0x61c5('0x25')](respondWithResult(_0xfdd584,0xc9))[_0x61c5('0x54')](handleError(_0xfdd584,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 93885b7..d7b755b 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 _0x5eff=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0x5eff,0xc8));var _0xf5ef=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x5eff[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xf5ef('0x0'));var util=require(_0xf5ef('0x1'));var logger=require(_0xf5ef('0x2'))(_0xf5ef('0x3'));var moment=require(_0xf5ef('0x4'));var BPromise=require(_0xf5ef('0x5'));var rp=require(_0xf5ef('0x6'));var fs=require('fs');var path=require(_0xf5ef('0x7'));var rimraf=require(_0xf5ef('0x8'));var config=require(_0xf5ef('0x9'));var attributes=require(_0xf5ef('0xa'));module[_0xf5ef('0xb')]=function(_0x4c887e,_0x5ce02d){return _0x4c887e[_0xf5ef('0xc')]('CannedAnswer',attributes,{'tableName':_0xf5ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf5ef('0xe')});};
\ No newline at end of file
+var _0x3258=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3258,0x88));var _0x8325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3258[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8325('0x0'));var util=require(_0x8325('0x1'));var logger=require(_0x8325('0x2'))(_0x8325('0x3'));var moment=require(_0x8325('0x4'));var BPromise=require(_0x8325('0x5'));var rp=require(_0x8325('0x6'));var fs=require('fs');var path=require(_0x8325('0x7'));var rimraf=require(_0x8325('0x8'));var config=require(_0x8325('0x9'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x34f7ed,_0x1842bf){return _0x34f7ed[_0x8325('0xa')](_0x8325('0xb'),attributes,{'tableName':_0x8325('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8325('0xd')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 91af1b7..7228f74 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(_0x5d4904,_0x20f026){var _0x53b6ee=function(_0x586f6b){while(--_0x586f6b){_0x5d4904['push'](_0x5d4904['shift']());}};_0x53b6ee(++_0x20f026);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x540958,_0x208159){var _0x553b1b=function(_0x346cd7){while(--_0x346cd7){_0x540958['push'](_0x540958['shift']());}};_0x553b1b(++_0x208159);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 9390c03..78b105b 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 _0xc149=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy'];(function(_0x371e61,_0x46d926){var _0x1af1dd=function(_0x4516cd){while(--_0x4516cd){_0x371e61['push'](_0x371e61['shift']());}};_0x1af1dd(++_0x46d926);}(_0xc149,0x190));var _0x9c14=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc149[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x9c14('0x0'));var util=require('util');var path=require(_0x9c14('0x1'));var timeout=require(_0x9c14('0x2'));var express=require(_0x9c14('0x3'));var router=express[_0x9c14('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c14('0x5'));var interaction=require(_0x9c14('0x6'));var config=require(_0x9c14('0x7'));var controller=require(_0x9c14('0x8'));router[_0x9c14('0x9')]('/',auth[_0x9c14('0xa')](),controller['index']);router[_0x9c14('0x9')](_0x9c14('0xb'),auth[_0x9c14('0xa')](),controller[_0x9c14('0xc')]);router[_0x9c14('0xd')]('/',auth[_0x9c14('0xa')](),controller[_0x9c14('0xe')]);router[_0x9c14('0xf')](_0x9c14('0xb'),auth['isAuthenticated'](),controller[_0x9c14('0x10')]);router['delete'](_0x9c14('0xb'),auth[_0x9c14('0xa')](),controller[_0x9c14('0x11')]);module[_0x9c14('0x12')]=router;
\ No newline at end of file
+var _0x9889=['create','update','delete','exports','multer','connect-timeout','express','Router','../../config/environment','get','index','/:id','isAuthenticated','show','post'];(function(_0x8a878f,_0xece4ef){var _0x3e61fb=function(_0x366fb){while(--_0x366fb){_0x8a878f['push'](_0x8a878f['shift']());}};_0x3e61fb(++_0xece4ef);}(_0x9889,0x17b));var _0x9988=function(_0x59820d,_0xc8e6ba){_0x59820d=_0x59820d-0x0;var _0x3c72b1=_0x9889[_0x59820d];return _0x3c72b1;};'use strict';var multer=require(_0x9988('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9988('0x1'));var express=require(_0x9988('0x2'));var router=express[_0x9988('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9988('0x4'));var controller=require('./cannedAnswer.controller');router[_0x9988('0x5')]('/',auth['isAuthenticated'](),controller[_0x9988('0x6')]);router[_0x9988('0x5')](_0x9988('0x7'),auth[_0x9988('0x8')](),controller[_0x9988('0x9')]);router[_0x9988('0xa')]('/',auth[_0x9988('0x8')](),controller[_0x9988('0xb')]);router['put'](_0x9988('0x7'),auth[_0x9988('0x8')](),controller[_0x9988('0xc')]);router[_0x9988('0xd')](_0x9988('0x7'),auth[_0x9988('0x8')](),controller['destroy']);module[_0x9988('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index c53f9e0..b82de01 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 _0x1978=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x1978,0x174));var _0x8197=function(_0x1a4176,_0x21a635){_0x1a4176=_0x1a4176-0x0;var _0x3df9c0=_0x1978[_0x1a4176];return _0x3df9c0;};'use strict';var Sequelize=require('sequelize');module[_0x8197('0x0')]={'calldate':{'type':Sequelize[_0x8197('0x1')],'allowNull':![],'defaultValue':_0x8197('0x2')},'clid':{'type':Sequelize[_0x8197('0x3')]},'src':{'type':Sequelize[_0x8197('0x3')]},'dst':{'type':Sequelize[_0x8197('0x3')]},'dcontext':{'type':Sequelize[_0x8197('0x3')]},'channel':{'type':Sequelize[_0x8197('0x3')]},'dstchannel':{'type':Sequelize[_0x8197('0x3')]},'lastapp':{'type':Sequelize[_0x8197('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8197('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8197('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8197('0x3')]},'amaflags':{'type':Sequelize[_0x8197('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8197('0x3')]},'userfield':{'type':Sequelize[_0x8197('0x3')]},'uniqueid':{'type':Sequelize[_0x8197('0x3')]},'linkedid':{'type':Sequelize[_0x8197('0x3')]},'sequence':{'type':Sequelize[_0x8197('0x3')]},'peeraccount':{'type':Sequelize[_0x8197('0x3')]},'type':{'type':Sequelize[_0x8197('0x3')]},'tag':{'type':Sequelize[_0x8197('0x3')]}};
\ No newline at end of file
+var _0xf00e=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x41604c,_0x3fb07c){var _0x1ea71a=function(_0x2c3ec2){while(--_0x2c3ec2){_0x41604c['push'](_0x41604c['shift']());}};_0x1ea71a(++_0x3fb07c);}(_0xf00e,0x12f));var _0xef00=function(_0x5d4fc6,_0x52f8c3){_0x5d4fc6=_0x5d4fc6-0x0;var _0x4d5b86=_0xf00e[_0x5d4fc6];return _0x4d5b86;};'use strict';var Sequelize=require(_0xef00('0x0'));module[_0xef00('0x1')]={'calldate':{'type':Sequelize[_0xef00('0x2')],'allowNull':![],'defaultValue':_0xef00('0x3')},'clid':{'type':Sequelize[_0xef00('0x4')]},'src':{'type':Sequelize[_0xef00('0x4')]},'dst':{'type':Sequelize[_0xef00('0x4')]},'dcontext':{'type':Sequelize[_0xef00('0x4')]},'channel':{'type':Sequelize[_0xef00('0x4')]},'dstchannel':{'type':Sequelize[_0xef00('0x4')]},'lastapp':{'type':Sequelize[_0xef00('0x4')]},'lastdata':{'type':Sequelize[_0xef00('0x4')]},'duration':{'type':Sequelize[_0xef00('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xef00('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xef00('0x4')]},'amaflags':{'type':Sequelize[_0xef00('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xef00('0x4')]},'userfield':{'type':Sequelize[_0xef00('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xef00('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xef00('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 266c28f..aa3bf63 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 _0x1dcc=['then','destroy','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','set','Content-Range','reject','save','update'];(function(_0x24cd43,_0x5e3408){var _0x3bc3ac=function(_0x528fc1){while(--_0x528fc1){_0x24cd43['push'](_0x24cd43['shift']());}};_0x3bc3ac(++_0x5e3408);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x24ed1c,_0x6993c3){_0x24ed1c=_0x24ed1c-0x0;var _0x1516a9=_0x1dcc[_0x24ed1c];return _0x1516a9;};'use strict';var emlformat=require(_0xc1dc('0x0'));var rimraf=require(_0xc1dc('0x1'));var zipdir=require(_0xc1dc('0x2'));var jsonpatch=require(_0xc1dc('0x3'));var rp=require('request-promise');var moment=require(_0xc1dc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1dc('0x5'));var util=require(_0xc1dc('0x6'));var path=require(_0xc1dc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc1dc('0x8'));var fs=require('fs');var fs_extra=require(_0xc1dc('0x9'));var _=require(_0xc1dc('0xa'));var squel=require('squel');var crypto=require(_0xc1dc('0xb'));var jsforce=require(_0xc1dc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1dc('0xd'));var querystring=require('querystring');var Papa=require(_0xc1dc('0xe'));var Redis=require('ioredis');var authService=require(_0xc1dc('0xf'));var qs=require(_0xc1dc('0x10'));var as=require(_0xc1dc('0x11'));var hardwareService=require(_0xc1dc('0x12'));var logger=require(_0xc1dc('0x13'))(_0xc1dc('0x14'));var utils=require(_0xc1dc('0x15'));var config=require(_0xc1dc('0x16'));var licenseUtil=require(_0xc1dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226ba3,_0x2c5f41){_0x2c5f41=_0x2c5f41||0xcc;return function(_0xb7e667){if(_0xb7e667){return _0x226ba3['sendStatus'](_0x2c5f41);}return _0x226ba3[_0xc1dc('0x18')](_0x2c5f41)[_0xc1dc('0x19')]();};}function respondWithResult(_0x299520,_0xd51b1e){_0xd51b1e=_0xd51b1e||0xc8;return function(_0x145708){if(_0x145708){return _0x299520[_0xc1dc('0x18')](_0xd51b1e)[_0xc1dc('0x1a')](_0x145708);}};}function respondWithFilteredResult(_0x21aed1,_0x265929){return function(_0x37b23a){if(_0x37b23a){var _0x1cbbfe=typeof _0x265929['offset']===_0xc1dc('0x1b')&&typeof _0x265929[_0xc1dc('0x1c')]===_0xc1dc('0x1b');var _0x3d3315=_0x37b23a['count'];var _0x332400=_0x1cbbfe?0x0:_0x265929[_0xc1dc('0x1d')];var _0x499a42=_0x1cbbfe?_0x37b23a['count']:_0x265929[_0xc1dc('0x1d')]+_0x265929[_0xc1dc('0x1c')];var _0x197941;if(_0x499a42>=_0x3d3315){_0x499a42=_0x3d3315;_0x197941=0xc8;}else{_0x197941=0xce;}_0x21aed1[_0xc1dc('0x18')](_0x197941);return _0x21aed1[_0xc1dc('0x1e')](_0xc1dc('0x1f'),_0x332400+'-'+_0x499a42+'/'+_0x3d3315)[_0xc1dc('0x1a')](_0x37b23a);}return null;};}function patchUpdates(_0xd5a2e){return function(_0x5762e5){try{jsonpatch['apply'](_0x5762e5,_0xd5a2e,!![]);}catch(_0x4efe0d){return BPromise[_0xc1dc('0x20')](_0x4efe0d);}return _0x5762e5[_0xc1dc('0x21')]();};}function saveUpdates(_0x47af1e,_0x367965){return function(_0x19325f){if(_0x19325f){return _0x19325f[_0xc1dc('0x22')](_0x47af1e)[_0xc1dc('0x23')](function(_0x22b80d){return _0x22b80d;});}return null;};}function removeEntity(_0x2944a2,_0x353bf3){return function(_0x18ba56){if(_0x18ba56){return _0x18ba56[_0xc1dc('0x24')]()[_0xc1dc('0x23')](function(){_0x2944a2['status'](0xcc)[_0xc1dc('0x19')]();});}};}function handleEntityNotFound(_0xfeb0b1,_0x17ce2b){return function(_0x52b0b9){if(!_0x52b0b9){_0xfeb0b1['sendStatus'](0x194);}return _0x52b0b9;};}function handleError(_0x296523,_0x109e88){_0x109e88=_0x109e88||0x1f4;return function(_0xfd3f88){logger[_0xc1dc('0x25')](_0xfd3f88[_0xc1dc('0x26')]);if(_0xfd3f88[_0xc1dc('0x27')]){delete _0xfd3f88[_0xc1dc('0x27')];}_0x296523[_0xc1dc('0x18')](_0x109e88)[_0xc1dc('0x28')](_0xfd3f88);};}exports['index']=function(_0x2d5a57,_0x25b7bf){var _0xd77537={},_0x27e54d={},_0x52b0ff={'count':0x0,'rows':[]};var _0x4750a9=_[_0xc1dc('0x29')](db[_0xc1dc('0x2a')][_0xc1dc('0x2b')],function(_0x1182a4){return{'name':_0x1182a4[_0xc1dc('0x2c')],'type':_0x1182a4['type'][_0xc1dc('0x2d')]};});_0x27e54d[_0xc1dc('0x2e')]=_[_0xc1dc('0x29')](_0x4750a9,_0xc1dc('0x27'));_0x27e54d[_0xc1dc('0x2f')]=_[_0xc1dc('0x30')](_0x2d5a57[_0xc1dc('0x2f')]);_0x27e54d[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x27e54d['model'],_0x27e54d['query']);_0xd77537[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x27e54d[_0xc1dc('0x2e')],qs[_0xc1dc('0x34')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x34')]));_0xd77537['attributes']=_0xd77537[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0xd77537['attributes']:_0x27e54d[_0xc1dc('0x2e')];if(!_0x2d5a57[_0xc1dc('0x2f')]['hasOwnProperty'](_0xc1dc('0x36'))){_0xd77537[_0xc1dc('0x1c')]=qs[_0xc1dc('0x1c')](_0x2d5a57['query'][_0xc1dc('0x1c')]);_0xd77537[_0xc1dc('0x1d')]=qs[_0xc1dc('0x1d')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x1d')]);}_0xd77537[_0xc1dc('0x37')]=qs[_0xc1dc('0x38')](_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x38')]);_0xd77537['where']=qs[_0xc1dc('0x31')](_[_0xc1dc('0x39')](_0x2d5a57[_0xc1dc('0x2f')],_0x27e54d['filters']),_0x4750a9);if(_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]){_0xd77537[_0xc1dc('0x3b')]=_[_0xc1dc('0x3c')](_0xd77537[_0xc1dc('0x3b')],{'$or':_[_0xc1dc('0x29')](_0x4750a9,function(_0x2e8d34){if(_0x2e8d34[_0xc1dc('0x3d')]!=='VIRTUAL'){var _0x16356d={};_0x16356d[_0x2e8d34[_0xc1dc('0x27')]]={'$like':'%'+_0x2d5a57[_0xc1dc('0x2f')][_0xc1dc('0x3a')]+'%'};return _0x16356d;}})});}_0xd77537=_[_0xc1dc('0x3c')]({},_0xd77537,_0x2d5a57[_0xc1dc('0x3e')]);var _0x503ec8={'where':_0xd77537[_0xc1dc('0x3b')]};return db[_0xc1dc('0x2a')][_0xc1dc('0x3f')](_0x503ec8)[_0xc1dc('0x23')](function(_0x1bcf3d){_0x52b0ff['count']=_0x1bcf3d;if(_0x2d5a57['query'][_0xc1dc('0x40')]){_0xd77537[_0xc1dc('0x41')]=[{'all':!![]}];}return db[_0xc1dc('0x2a')][_0xc1dc('0x42')](_0xd77537);})[_0xc1dc('0x23')](function(_0x2b4190){_0x52b0ff[_0xc1dc('0x43')]=_0x2b4190;return _0x52b0ff;})['then'](respondWithFilteredResult(_0x25b7bf,_0xd77537))[_0xc1dc('0x44')](handleError(_0x25b7bf,null));};exports[_0xc1dc('0x45')]=function(_0xe5c170,_0x4f99ea){var _0x402d3a={'raw':!![],'where':{'id':_0xe5c170[_0xc1dc('0x46')]['id']}},_0x2f52f7={};_0x2f52f7[_0xc1dc('0x2e')]=_['keys'](db['Cdr'][_0xc1dc('0x2b')]);_0x2f52f7[_0xc1dc('0x2f')]=_['keys'](_0xe5c170[_0xc1dc('0x2f')]);_0x2f52f7[_0xc1dc('0x31')]=_[_0xc1dc('0x32')](_0x2f52f7[_0xc1dc('0x2e')],_0x2f52f7[_0xc1dc('0x2f')]);_0x402d3a[_0xc1dc('0x33')]=_[_0xc1dc('0x32')](_0x2f52f7['model'],qs['fields'](_0xe5c170[_0xc1dc('0x2f')]['fields']));_0x402d3a[_0xc1dc('0x33')]=_0x402d3a[_0xc1dc('0x33')][_0xc1dc('0x35')]?_0x402d3a[_0xc1dc('0x33')]:_0x2f52f7[_0xc1dc('0x2e')];if(_0xe5c170[_0xc1dc('0x2f')][_0xc1dc('0x40')]){_0x402d3a[_0xc1dc('0x41')]=[{'all':!![]}];}_0x402d3a=_['merge']({},_0x402d3a,_0xe5c170[_0xc1dc('0x3e')]);return db[_0xc1dc('0x2a')][_0xc1dc('0x47')](_0x402d3a)[_0xc1dc('0x23')](handleEntityNotFound(_0x4f99ea,null))[_0xc1dc('0x23')](respondWithResult(_0x4f99ea,null))[_0xc1dc('0x44')](handleError(_0x4f99ea,null));};exports[_0xc1dc('0x48')]=function(_0x9a48b7,_0x2ca7f1){return db[_0xc1dc('0x2a')]['create'](_0x9a48b7['body'],{})['then'](respondWithResult(_0x2ca7f1,0xc9))[_0xc1dc('0x44')](handleError(_0x2ca7f1,null));};exports[_0xc1dc('0x22')]=function(_0x57b792,_0x129e23){if(_0x57b792[_0xc1dc('0x49')]['id']){delete _0x57b792['body']['id'];}return db[_0xc1dc('0x2a')]['find']({'where':{'id':_0x57b792[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x129e23,null))[_0xc1dc('0x23')](saveUpdates(_0x57b792[_0xc1dc('0x49')],null))[_0xc1dc('0x23')](respondWithResult(_0x129e23,null))[_0xc1dc('0x44')](handleError(_0x129e23,null));};exports[_0xc1dc('0x24')]=function(_0x34667b,_0x4d4240){return db[_0xc1dc('0x2a')][_0xc1dc('0x47')]({'where':{'id':_0x34667b[_0xc1dc('0x46')]['id']}})[_0xc1dc('0x23')](handleEntityNotFound(_0x4d4240,null))['then'](removeEntity(_0x4d4240,null))[_0xc1dc('0x44')](handleError(_0x4d4240,null));};exports[_0xc1dc('0x4a')]=function(_0x3e3e6c,_0x1755cb){return db[_0xc1dc('0x2a')][_0xc1dc('0x4a')]()[_0xc1dc('0x23')](respondWithResult(_0x1755cb,null))[_0xc1dc('0x44')](handleError(_0x1755cb,null));};
\ No newline at end of file
+var _0x6596=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','options','findAll','rows','show','params','length','includeAll','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse'];(function(_0x3b8e1d,_0x297f8f){var _0x10bd1e=function(_0x3ed062){while(--_0x3ed062){_0x3b8e1d['push'](_0x3b8e1d['shift']());}};_0x10bd1e(++_0x297f8f);}(_0x6596,0x1d3));var _0x6659=function(_0x2f398e,_0x3cc0f9){_0x2f398e=_0x2f398e-0x0;var _0x5ae0eb=_0x6596[_0x2f398e];return _0x5ae0eb;};'use strict';var emlformat=require(_0x6659('0x0'));var rimraf=require(_0x6659('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6659('0x2'));var rp=require(_0x6659('0x3'));var moment=require(_0x6659('0x4'));var BPromise=require(_0x6659('0x5'));var Mustache=require(_0x6659('0x6'));var util=require(_0x6659('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6659('0x8'));var ejs=require(_0x6659('0x9'));var fs=require('fs');var fs_extra=require(_0x6659('0xa'));var _=require(_0x6659('0xb'));var squel=require(_0x6659('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6659('0xd'));var toCsv=require(_0x6659('0x8'));var querystring=require(_0x6659('0xe'));var Papa=require(_0x6659('0xf'));var Redis=require(_0x6659('0x10'));var authService=require(_0x6659('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6659('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6659('0x13'));var utils=require('../../config/utils');var config=require(_0x6659('0x14'));var licenseUtil=require(_0x6659('0x15'));var db=require(_0x6659('0x16'))['db'];function respondWithStatusCode(_0x438f95,_0x581baa){_0x581baa=_0x581baa||0xcc;return function(_0x3d68c5){if(_0x3d68c5){return _0x438f95[_0x6659('0x17')](_0x581baa);}return _0x438f95['status'](_0x581baa)[_0x6659('0x18')]();};}function respondWithResult(_0x2fd7da,_0x4238a7){_0x4238a7=_0x4238a7||0xc8;return function(_0x346cb6){if(_0x346cb6){return _0x2fd7da[_0x6659('0x19')](_0x4238a7)[_0x6659('0x1a')](_0x346cb6);}};}function respondWithFilteredResult(_0x5b5c16,_0x3246f1){return function(_0x36707c){if(_0x36707c){var _0x1ddce3=typeof _0x3246f1[_0x6659('0x1b')]===_0x6659('0x1c')&&typeof _0x3246f1[_0x6659('0x1d')]==='undefined';var _0x5b7658=_0x36707c[_0x6659('0x1e')];var _0x5e89f1=_0x1ddce3?0x0:_0x3246f1[_0x6659('0x1b')];var _0x38e4d6=_0x1ddce3?_0x36707c['count']:_0x3246f1[_0x6659('0x1b')]+_0x3246f1['limit'];var _0xa5e094;if(_0x38e4d6>=_0x5b7658){_0x38e4d6=_0x5b7658;_0xa5e094=0xc8;}else{_0xa5e094=0xce;}_0x5b5c16[_0x6659('0x19')](_0xa5e094);return _0x5b5c16['set'](_0x6659('0x1f'),_0x5e89f1+'-'+_0x38e4d6+'/'+_0x5b7658)[_0x6659('0x1a')](_0x36707c);}return null;};}function patchUpdates(_0x332d2c){return function(_0x3e139a){try{jsonpatch[_0x6659('0x20')](_0x3e139a,_0x332d2c,!![]);}catch(_0x3e1f83){return BPromise[_0x6659('0x21')](_0x3e1f83);}return _0x3e139a['save']();};}function saveUpdates(_0x2b4cce,_0x3506fd){return function(_0x314e40){if(_0x314e40){return _0x314e40[_0x6659('0x22')](_0x2b4cce)['then'](function(_0x4ce553){return _0x4ce553;});}return null;};}function removeEntity(_0x5a5e04,_0x564357){return function(_0xbad53f){if(_0xbad53f){return _0xbad53f[_0x6659('0x23')]()[_0x6659('0x24')](function(){_0x5a5e04[_0x6659('0x19')](0xcc)[_0x6659('0x18')]();});}};}function handleEntityNotFound(_0x12b218,_0x436691){return function(_0x3cb0dc){if(!_0x3cb0dc){_0x12b218[_0x6659('0x17')](0x194);}return _0x3cb0dc;};}function handleError(_0x5f48d6,_0x187571){_0x187571=_0x187571||0x1f4;return function(_0x373a3d){logger[_0x6659('0x25')](_0x373a3d['stack']);if(_0x373a3d['name']){delete _0x373a3d[_0x6659('0x26')];}_0x5f48d6[_0x6659('0x19')](_0x187571)['send'](_0x373a3d);};}exports[_0x6659('0x27')]=function(_0x2f5a16,_0x36dab5){var _0xcb5a33={},_0x1b721d={},_0x525b57={'count':0x0,'rows':[]};var _0x23ee05=_[_0x6659('0x28')](db[_0x6659('0x29')][_0x6659('0x2a')],function(_0xc9bd6a){return{'name':_0xc9bd6a['fieldName'],'type':_0xc9bd6a[_0x6659('0x2b')][_0x6659('0x2c')]};});_0x1b721d[_0x6659('0x2d')]=_[_0x6659('0x28')](_0x23ee05,_0x6659('0x26'));_0x1b721d[_0x6659('0x2e')]=_[_0x6659('0x2f')](_0x2f5a16['query']);_0x1b721d[_0x6659('0x30')]=_[_0x6659('0x31')](_0x1b721d['model'],_0x1b721d[_0x6659('0x2e')]);_0xcb5a33['attributes']=_[_0x6659('0x31')](_0x1b721d['model'],qs[_0x6659('0x32')](_0x2f5a16[_0x6659('0x2e')]['fields']));_0xcb5a33['attributes']=_0xcb5a33[_0x6659('0x33')]['length']?_0xcb5a33[_0x6659('0x33')]:_0x1b721d['model'];if(!_0x2f5a16[_0x6659('0x2e')]['hasOwnProperty'](_0x6659('0x34'))){_0xcb5a33[_0x6659('0x1d')]=qs['limit'](_0x2f5a16[_0x6659('0x2e')][_0x6659('0x1d')]);_0xcb5a33[_0x6659('0x1b')]=qs[_0x6659('0x1b')](_0x2f5a16[_0x6659('0x2e')]['offset']);}_0xcb5a33[_0x6659('0x35')]=qs['sort'](_0x2f5a16['query'][_0x6659('0x36')]);_0xcb5a33[_0x6659('0x37')]=qs[_0x6659('0x30')](_['pick'](_0x2f5a16[_0x6659('0x2e')],_0x1b721d['filters']),_0x23ee05);if(_0x2f5a16['query'][_0x6659('0x38')]){_0xcb5a33[_0x6659('0x37')]=_[_0x6659('0x39')](_0xcb5a33[_0x6659('0x37')],{'$or':_[_0x6659('0x28')](_0x23ee05,function(_0x90b64e){if(_0x90b64e[_0x6659('0x2b')]!=='VIRTUAL'){var _0x531a19={};_0x531a19[_0x90b64e[_0x6659('0x26')]]={'$like':'%'+_0x2f5a16[_0x6659('0x2e')][_0x6659('0x38')]+'%'};return _0x531a19;}})});}_0xcb5a33=_['merge']({},_0xcb5a33,_0x2f5a16[_0x6659('0x3a')]);var _0x3e4a93={'where':_0xcb5a33['where']};return db[_0x6659('0x29')][_0x6659('0x1e')](_0x3e4a93)[_0x6659('0x24')](function(_0x2924f4){_0x525b57[_0x6659('0x1e')]=_0x2924f4;if(_0x2f5a16['query']['includeAll']){_0xcb5a33['include']=[{'all':!![]}];}return db['Cdr'][_0x6659('0x3b')](_0xcb5a33);})['then'](function(_0x552282){_0x525b57[_0x6659('0x3c')]=_0x552282;return _0x525b57;})[_0x6659('0x24')](respondWithFilteredResult(_0x36dab5,_0xcb5a33))['catch'](handleError(_0x36dab5,null));};exports[_0x6659('0x3d')]=function(_0x4230cf,_0x55cd09){var _0x176516={'raw':!![],'where':{'id':_0x4230cf[_0x6659('0x3e')]['id']}},_0x3551d4={};_0x3551d4[_0x6659('0x2d')]=_['keys'](db[_0x6659('0x29')]['rawAttributes']);_0x3551d4[_0x6659('0x2e')]=_[_0x6659('0x2f')](_0x4230cf[_0x6659('0x2e')]);_0x3551d4[_0x6659('0x30')]=_[_0x6659('0x31')](_0x3551d4[_0x6659('0x2d')],_0x3551d4['query']);_0x176516['attributes']=_[_0x6659('0x31')](_0x3551d4[_0x6659('0x2d')],qs[_0x6659('0x32')](_0x4230cf[_0x6659('0x2e')][_0x6659('0x32')]));_0x176516[_0x6659('0x33')]=_0x176516[_0x6659('0x33')][_0x6659('0x3f')]?_0x176516[_0x6659('0x33')]:_0x3551d4[_0x6659('0x2d')];if(_0x4230cf['query'][_0x6659('0x40')]){_0x176516['include']=[{'all':!![]}];}_0x176516=_[_0x6659('0x39')]({},_0x176516,_0x4230cf[_0x6659('0x3a')]);return db['Cdr'][_0x6659('0x41')](_0x176516)[_0x6659('0x24')](handleEntityNotFound(_0x55cd09,null))['then'](respondWithResult(_0x55cd09,null))[_0x6659('0x42')](handleError(_0x55cd09,null));};exports[_0x6659('0x43')]=function(_0x6e0e41,_0x304733){return db['Cdr']['create'](_0x6e0e41[_0x6659('0x44')],{})[_0x6659('0x24')](respondWithResult(_0x304733,0xc9))[_0x6659('0x42')](handleError(_0x304733,null));};exports[_0x6659('0x22')]=function(_0x442355,_0x3afc78){if(_0x442355['body']['id']){delete _0x442355[_0x6659('0x44')]['id'];}return db[_0x6659('0x29')]['find']({'where':{'id':_0x442355[_0x6659('0x3e')]['id']}})[_0x6659('0x24')](handleEntityNotFound(_0x3afc78,null))['then'](saveUpdates(_0x442355[_0x6659('0x44')],null))[_0x6659('0x24')](respondWithResult(_0x3afc78,null))[_0x6659('0x42')](handleError(_0x3afc78,null));};exports[_0x6659('0x23')]=function(_0x78c901,_0x1bdf74){return db[_0x6659('0x29')][_0x6659('0x41')]({'where':{'id':_0x78c901[_0x6659('0x3e')]['id']}})[_0x6659('0x24')](handleEntityNotFound(_0x1bdf74,null))[_0x6659('0x24')](removeEntity(_0x1bdf74,null))[_0x6659('0x42')](handleError(_0x1bdf74,null));};exports['describe']=function(_0x4c338b,_0x5fe9bd){return db[_0x6659('0x29')]['describe']()[_0x6659('0x24')](respondWithResult(_0x5fe9bd,null))[_0x6659('0x42')](handleError(_0x5fe9bd,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3902e3e..b145ee2 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(_0x410f90,_0x1645a7){var _0x28f315=function(_0x1910e5){while(--_0x1910e5){_0x410f90['push'](_0x410f90['shift']());}};_0x28f315(++_0x1645a7);}(_0x7a54,0x106));var _0x47a5=function(_0x4a9f10,_0x33ab41){_0x4a9f10=_0x4a9f10-0x0;var _0x509f78=_0x7a54[_0x4a9f10];return _0x509f78;};'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(_0x58d94c,_0x5d5109){var _0x278522=function(_0x3260eb){while(--_0x3260eb){_0x58d94c['push'](_0x58d94c['shift']());}};_0x278522(++_0x5d5109);}(_0x7a54,0x106));var _0x47a5=function(_0x558b22,_0x26e91e){_0x558b22=_0x558b22-0x0;var _0x2f119d=_0x7a54[_0x558b22];return _0x2f119d;};'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 69abc9a..0b7f8b3 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 _0x4266=['stringify','error','code','Cdr,\x20%s,\x20%s','message','info','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x16bd94,_0x3792be){var _0x47fac4=function(_0x9ee632){while(--_0x9ee632){_0x16bd94['push'](_0x16bd94['shift']());}};_0x47fac4(++_0x3792be);}(_0x4266,0x1eb));var _0x6426=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x4266[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x6426('0x0'));var moment=require(_0x6426('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6426('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6426('0x3'));var logger=require(_0x6426('0x4'))(_0x6426('0x5'));var config=require(_0x6426('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6426('0x7')][_0x6426('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14f63c,_0x3e32d3,_0x3d946a){return new BPromise(function(_0x41283a,_0x392aa6){return client[_0x6426('0x9')](_0x14f63c,_0x3d946a)['then'](function(_0x3391a5){logger['info']('Cdr,\x20%s,\x20%s',_0x3e32d3,'request\x20sent');logger[_0x6426('0xa')](_0x6426('0xb'),_0x3e32d3,_0x6426('0xc'),JSON[_0x6426('0xd')](_0x3391a5));if(_0x3391a5[_0x6426('0xe')]){if(_0x3391a5[_0x6426('0xe')][_0x6426('0xf')]===0x1f4){logger[_0x6426('0xe')](_0x6426('0x10'),_0x3e32d3,_0x3391a5['error']['message']);return _0x392aa6(_0x3391a5['error'][_0x6426('0x11')]);}logger[_0x6426('0xe')](_0x6426('0x10'),_0x3e32d3,_0x3391a5[_0x6426('0xe')][_0x6426('0x11')]);return _0x41283a(_0x3391a5[_0x6426('0xe')][_0x6426('0x11')]);}else{logger[_0x6426('0x12')](_0x6426('0x10'),_0x3e32d3,_0x6426('0xc'));_0x41283a(_0x3391a5[_0x6426('0x13')][_0x6426('0x11')]);}})[_0x6426('0x14')](function(_0x32ae77){logger[_0x6426('0xe')](_0x6426('0x10'),_0x3e32d3,_0x32ae77);_0x392aa6(_0x32ae77);});});}
\ No newline at end of file
+var _0x3f29=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0x3f29,0x106));var _0x93f2=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x3f29[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x93f2('0x0'));var util=require('util');var moment=require(_0x93f2('0x1'));var BPromise=require(_0x93f2('0x2'));var rs=require(_0x93f2('0x3'));var fs=require('fs');var Redis=require(_0x93f2('0x4'));var db=require(_0x93f2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x93f2('0x6'))('rpc');var config=require(_0x93f2('0x7'));var jayson=require(_0x93f2('0x8'));var client=jayson[_0x93f2('0x9')][_0x93f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51c338,_0x36d248,_0x2b0aac){return new BPromise(function(_0x5dd15b,_0xe4a07d){return client[_0x93f2('0xb')](_0x51c338,_0x2b0aac)[_0x93f2('0xc')](function(_0x3a909c){logger[_0x93f2('0xd')]('Cdr,\x20%s,\x20%s',_0x36d248,_0x93f2('0xe'));logger[_0x93f2('0xf')](_0x93f2('0x10'),_0x36d248,'request\x20sent',JSON[_0x93f2('0x11')](_0x3a909c));if(_0x3a909c['error']){if(_0x3a909c[_0x93f2('0x12')][_0x93f2('0x13')]===0x1f4){logger[_0x93f2('0x12')](_0x93f2('0x14'),_0x36d248,_0x3a909c[_0x93f2('0x12')][_0x93f2('0x15')]);return _0xe4a07d(_0x3a909c['error'][_0x93f2('0x15')]);}logger[_0x93f2('0x12')](_0x93f2('0x14'),_0x36d248,_0x3a909c[_0x93f2('0x12')]['message']);return _0x5dd15b(_0x3a909c[_0x93f2('0x12')][_0x93f2('0x15')]);}else{logger[_0x93f2('0xd')]('Cdr,\x20%s,\x20%s',_0x36d248,_0x93f2('0xe'));_0x5dd15b(_0x3a909c[_0x93f2('0x16')]['message']);}})[_0x93f2('0x17')](function(_0x4cf5a4){logger[_0x93f2('0x12')](_0x93f2('0x14'),_0x36d248,_0x4cf5a4);_0xe4a07d(_0x4cf5a4);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0a60680..1d0ddf1 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(_0x5e1248,_0x42b862){var _0x1b4201=function(_0x534a23){while(--_0x534a23){_0x5e1248['push'](_0x5e1248['shift']());}};_0x1b4201(++_0x42b862);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index b945458..ac08f98 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 _0x72e3=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x72e3,0x1a8));var _0x372e=function(_0x16aca8,_0x566c87){_0x16aca8=_0x16aca8-0x0;var _0x26c9f9=_0x72e3[_0x16aca8];return _0x26c9f9;};'use strict';var Sequelize=require(_0x372e('0x0'));module[_0x372e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x372e('0x2')],'allowNull':![],'defaultValue':_0x372e('0x3')},'appdata':{'type':Sequelize[_0x372e('0x4')]()},'description':{'type':Sequelize[_0x372e('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x372e('0x5')}};
\ No newline at end of file
+var _0x0e06=['INTEGER','noop','TEXT','sequelize','exports'];(function(_0x12e90d,_0x3a73a){var _0x4b8743=function(_0x4ec31b){while(--_0x4ec31b){_0x12e90d['push'](_0x12e90d['shift']());}};_0x4b8743(++_0x3a73a);}(_0x0e06,0x189));var _0x60e0=function(_0x4e16f9,_0x37a14e){_0x4e16f9=_0x4e16f9-0x0;var _0x45d7d2=_0x0e06[_0x4e16f9];return _0x45d7d2;};'use strict';var Sequelize=require(_0x60e0('0x0'));module[_0x60e0('0x1')]={'priority':{'type':Sequelize[_0x60e0('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x60e0('0x3')},'appdata':{'type':Sequelize[_0x60e0('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 1bdeefb..e37e329 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 _0x3402=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','merge','options','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4bff25,_0x32011f){var _0x1505ac=function(_0x59cc79){while(--_0x59cc79){_0x4bff25['push'](_0x4bff25['shift']());}};_0x1505ac(++_0x32011f);}(_0x3402,0x1f0));var _0x2340=function(_0x14ad45,_0x484efa){_0x14ad45=_0x14ad45-0x0;var _0x436809=_0x3402[_0x14ad45];return _0x436809;};'use strict';var emlformat=require(_0x2340('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2340('0x1'));var jsonpatch=require(_0x2340('0x2'));var rp=require(_0x2340('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2340('0x4'));var util=require(_0x2340('0x5'));var path=require(_0x2340('0x6'));var sox=require(_0x2340('0x7'));var csv=require(_0x2340('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2340('0x9'));var squel=require(_0x2340('0xa'));var crypto=require(_0x2340('0xb'));var jsforce=require(_0x2340('0xc'));var deskjs=require(_0x2340('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2340('0xe'));var Papa=require(_0x2340('0xf'));var Redis=require(_0x2340('0x10'));var authService=require(_0x2340('0x11'));var qs=require(_0x2340('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2340('0x13'));var logger=require(_0x2340('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2340('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2340('0x16'))['db'];function respondWithStatusCode(_0x5cc478,_0x35baa8){_0x35baa8=_0x35baa8||0xcc;return function(_0x42c154){if(_0x42c154){return _0x5cc478[_0x2340('0x17')](_0x35baa8);}return _0x5cc478[_0x2340('0x18')](_0x35baa8)[_0x2340('0x19')]();};}function respondWithResult(_0x7e51a5,_0xcab834){_0xcab834=_0xcab834||0xc8;return function(_0x491814){if(_0x491814){return _0x7e51a5[_0x2340('0x18')](_0xcab834)[_0x2340('0x1a')](_0x491814);}};}function respondWithFilteredResult(_0x3642e0,_0x5aff27){return function(_0x173678){if(_0x173678){var _0x119a05=typeof _0x5aff27[_0x2340('0x1b')]===_0x2340('0x1c')&&typeof _0x5aff27['limit']===_0x2340('0x1c');var _0x3ce1fa=_0x173678[_0x2340('0x1d')];var _0x9723dd=_0x119a05?0x0:_0x5aff27[_0x2340('0x1b')];var _0x51524b=_0x119a05?_0x173678['count']:_0x5aff27[_0x2340('0x1b')]+_0x5aff27[_0x2340('0x1e')];var _0x434a59;if(_0x51524b>=_0x3ce1fa){_0x51524b=_0x3ce1fa;_0x434a59=0xc8;}else{_0x434a59=0xce;}_0x3642e0['status'](_0x434a59);return _0x3642e0['set'](_0x2340('0x1f'),_0x9723dd+'-'+_0x51524b+'/'+_0x3ce1fa)[_0x2340('0x1a')](_0x173678);}return null;};}function patchUpdates(_0x1b3822){return function(_0xb2b57a){try{jsonpatch['apply'](_0xb2b57a,_0x1b3822,!![]);}catch(_0x567de5){return BPromise[_0x2340('0x20')](_0x567de5);}return _0xb2b57a['save']();};}function saveUpdates(_0x3f9f54,_0x44622a){return function(_0x28a812){if(_0x28a812){return _0x28a812[_0x2340('0x21')](_0x3f9f54)[_0x2340('0x22')](function(_0x32e08b){return _0x32e08b;});}return null;};}function removeEntity(_0x8f1d89,_0x130944){return function(_0x49c77e){if(_0x49c77e){return _0x49c77e['destroy']()[_0x2340('0x22')](function(){_0x8f1d89[_0x2340('0x18')](0xcc)[_0x2340('0x19')]();});}};}function handleEntityNotFound(_0x44680e,_0x320c1b){return function(_0x27e903){if(!_0x27e903){_0x44680e[_0x2340('0x17')](0x194);}return _0x27e903;};}function handleError(_0x5b61a7,_0x3fe07f){_0x3fe07f=_0x3fe07f||0x1f4;return function(_0x46d5cb){logger[_0x2340('0x23')](_0x46d5cb[_0x2340('0x24')]);if(_0x46d5cb[_0x2340('0x25')]){delete _0x46d5cb[_0x2340('0x25')];}_0x5b61a7[_0x2340('0x18')](_0x3fe07f)[_0x2340('0x26')](_0x46d5cb);};}exports[_0x2340('0x27')]=function(_0x229a00,_0x360d59){var _0x5e697b={'raw':!![],'where':{'id':_0x229a00[_0x2340('0x28')]['id']}},_0x336ffe={};_0x336ffe['model']=_[_0x2340('0x29')](db[_0x2340('0x2a')][_0x2340('0x2b')]);_0x336ffe[_0x2340('0x2c')]=_[_0x2340('0x29')](_0x229a00['query']);_0x336ffe[_0x2340('0x2d')]=_[_0x2340('0x2e')](_0x336ffe[_0x2340('0x2f')],_0x336ffe[_0x2340('0x2c')]);_0x5e697b[_0x2340('0x30')]=_['intersection'](_0x336ffe[_0x2340('0x2f')],qs[_0x2340('0x31')](_0x229a00[_0x2340('0x2c')]['fields']));_0x5e697b[_0x2340('0x30')]=_0x5e697b[_0x2340('0x30')]['length']?_0x5e697b[_0x2340('0x30')]:_0x336ffe[_0x2340('0x2f')];if(_0x229a00['query'][_0x2340('0x32')]){_0x5e697b[_0x2340('0x33')]=[{'all':!![]}];}_0x5e697b=_[_0x2340('0x34')]({},_0x5e697b,_0x229a00[_0x2340('0x35')]);return db[_0x2340('0x2a')][_0x2340('0x36')](_0x5e697b)['then'](handleEntityNotFound(_0x360d59,null))[_0x2340('0x22')](respondWithResult(_0x360d59,null))[_0x2340('0x37')](handleError(_0x360d59,null));};exports[_0x2340('0x21')]=function(_0x48b7dc,_0x1c8ea9){if(_0x48b7dc[_0x2340('0x38')]['id']){delete _0x48b7dc[_0x2340('0x38')]['id'];}return db[_0x2340('0x2a')][_0x2340('0x36')]({'where':{'id':_0x48b7dc[_0x2340('0x28')]['id']}})[_0x2340('0x22')](handleEntityNotFound(_0x1c8ea9,null))[_0x2340('0x22')](saveUpdates(_0x48b7dc[_0x2340('0x38')],null))[_0x2340('0x22')](respondWithResult(_0x1c8ea9,null))[_0x2340('0x37')](handleError(_0x1c8ea9,null));};exports['destroy']=function(_0x14da4a,_0x5b4f71){return db['ChatApplication'][_0x2340('0x36')]({'where':{'id':_0x14da4a['params']['id']}})[_0x2340('0x22')](handleEntityNotFound(_0x5b4f71,null))[_0x2340('0x22')](removeEntity(_0x5b4f71,null))['catch'](handleError(_0x5b4f71,null));};
\ No newline at end of file
+var _0xa62c=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','end','error','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','catch','body','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x513abe,_0xd992d7){var _0x59661f=function(_0x36b052){while(--_0x36b052){_0x513abe['push'](_0x513abe['shift']());}};_0x59661f(++_0xd992d7);}(_0xa62c,0x70));var _0xca62=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0xa62c[_0x1f1e31];return _0x229b56;};'use strict';var emlformat=require(_0xca62('0x0'));var rimraf=require(_0xca62('0x1'));var zipdir=require(_0xca62('0x2'));var jsonpatch=require(_0xca62('0x3'));var rp=require(_0xca62('0x4'));var moment=require(_0xca62('0x5'));var BPromise=require(_0xca62('0x6'));var Mustache=require('mustache');var util=require(_0xca62('0x7'));var path=require(_0xca62('0x8'));var sox=require(_0xca62('0x9'));var csv=require(_0xca62('0xa'));var ejs=require(_0xca62('0xb'));var fs=require('fs');var fs_extra=require(_0xca62('0xc'));var _=require(_0xca62('0xd'));var squel=require(_0xca62('0xe'));var crypto=require('crypto');var jsforce=require(_0xca62('0xf'));var deskjs=require(_0xca62('0x10'));var toCsv=require(_0xca62('0xa'));var querystring=require('querystring');var Papa=require(_0xca62('0x11'));var Redis=require(_0xca62('0x12'));var authService=require(_0xca62('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xca62('0x14'));var hardwareService=require(_0xca62('0x15'));var logger=require(_0xca62('0x16'))(_0xca62('0x17'));var utils=require(_0xca62('0x18'));var config=require(_0xca62('0x19'));var licenseUtil=require(_0xca62('0x1a'));var db=require(_0xca62('0x1b'))['db'];function respondWithStatusCode(_0x2ba621,_0x59cfd8){_0x59cfd8=_0x59cfd8||0xcc;return function(_0x23a20b){if(_0x23a20b){return _0x2ba621[_0xca62('0x1c')](_0x59cfd8);}return _0x2ba621[_0xca62('0x1d')](_0x59cfd8)['end']();};}function respondWithResult(_0x4a0835,_0x5446a3){_0x5446a3=_0x5446a3||0xc8;return function(_0x307a30){if(_0x307a30){return _0x4a0835['status'](_0x5446a3)[_0xca62('0x1e')](_0x307a30);}};}function respondWithFilteredResult(_0x1634b2,_0x539a04){return function(_0x4f93fc){if(_0x4f93fc){var _0x21eae8=typeof _0x539a04[_0xca62('0x1f')]===_0xca62('0x20')&&typeof _0x539a04['limit']===_0xca62('0x20');var _0x98db4c=_0x4f93fc[_0xca62('0x21')];var _0x58d6f6=_0x21eae8?0x0:_0x539a04[_0xca62('0x1f')];var _0x34a370=_0x21eae8?_0x4f93fc[_0xca62('0x21')]:_0x539a04[_0xca62('0x1f')]+_0x539a04[_0xca62('0x22')];var _0x1b62bb;if(_0x34a370>=_0x98db4c){_0x34a370=_0x98db4c;_0x1b62bb=0xc8;}else{_0x1b62bb=0xce;}_0x1634b2[_0xca62('0x1d')](_0x1b62bb);return _0x1634b2[_0xca62('0x23')](_0xca62('0x24'),_0x58d6f6+'-'+_0x34a370+'/'+_0x98db4c)[_0xca62('0x1e')](_0x4f93fc);}return null;};}function patchUpdates(_0x133132){return function(_0x1dff07){try{jsonpatch['apply'](_0x1dff07,_0x133132,!![]);}catch(_0x4c05c2){return BPromise['reject'](_0x4c05c2);}return _0x1dff07[_0xca62('0x25')]();};}function saveUpdates(_0x138177,_0x3f2a52){return function(_0x3d4730){if(_0x3d4730){return _0x3d4730[_0xca62('0x26')](_0x138177)[_0xca62('0x27')](function(_0x364c8d){return _0x364c8d;});}return null;};}function removeEntity(_0x3eb516,_0x4b1c5a){return function(_0x486763){if(_0x486763){return _0x486763[_0xca62('0x28')]()['then'](function(){_0x3eb516[_0xca62('0x1d')](0xcc)[_0xca62('0x29')]();});}};}function handleEntityNotFound(_0x32933c,_0x3e90eb){return function(_0x20e970){if(!_0x20e970){_0x32933c[_0xca62('0x1c')](0x194);}return _0x20e970;};}function handleError(_0x4e05d4,_0x483aae){_0x483aae=_0x483aae||0x1f4;return function(_0xd03a0b){logger[_0xca62('0x2a')](_0xd03a0b['stack']);if(_0xd03a0b['name']){delete _0xd03a0b[_0xca62('0x2b')];}_0x4e05d4['status'](_0x483aae)[_0xca62('0x2c')](_0xd03a0b);};}exports[_0xca62('0x2d')]=function(_0x1ed588,_0x107187){var _0x37dd79={'raw':!![],'where':{'id':_0x1ed588['params']['id']}},_0x4e4c0c={};_0x4e4c0c[_0xca62('0x2e')]=_[_0xca62('0x2f')](db['ChatApplication'][_0xca62('0x30')]);_0x4e4c0c[_0xca62('0x31')]=_[_0xca62('0x2f')](_0x1ed588[_0xca62('0x31')]);_0x4e4c0c[_0xca62('0x32')]=_[_0xca62('0x33')](_0x4e4c0c[_0xca62('0x2e')],_0x4e4c0c[_0xca62('0x31')]);_0x37dd79[_0xca62('0x34')]=_[_0xca62('0x33')](_0x4e4c0c[_0xca62('0x2e')],qs[_0xca62('0x35')](_0x1ed588[_0xca62('0x31')][_0xca62('0x35')]));_0x37dd79[_0xca62('0x34')]=_0x37dd79[_0xca62('0x34')][_0xca62('0x36')]?_0x37dd79[_0xca62('0x34')]:_0x4e4c0c[_0xca62('0x2e')];if(_0x1ed588[_0xca62('0x31')]['includeAll']){_0x37dd79['include']=[{'all':!![]}];}_0x37dd79=_[_0xca62('0x37')]({},_0x37dd79,_0x1ed588[_0xca62('0x38')]);return db['ChatApplication']['find'](_0x37dd79)[_0xca62('0x27')](handleEntityNotFound(_0x107187,null))[_0xca62('0x27')](respondWithResult(_0x107187,null))[_0xca62('0x39')](handleError(_0x107187,null));};exports[_0xca62('0x26')]=function(_0x51bd19,_0x1d22ed){if(_0x51bd19[_0xca62('0x3a')]['id']){delete _0x51bd19['body']['id'];}return db['ChatApplication']['find']({'where':{'id':_0x51bd19[_0xca62('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1d22ed,null))[_0xca62('0x27')](saveUpdates(_0x51bd19[_0xca62('0x3a')],null))[_0xca62('0x27')](respondWithResult(_0x1d22ed,null))[_0xca62('0x39')](handleError(_0x1d22ed,null));};exports[_0xca62('0x28')]=function(_0x14d0e3,_0x2228c1){return db['ChatApplication'][_0xca62('0x3c')]({'where':{'id':_0x14d0e3[_0xca62('0x3b')]['id']}})[_0xca62('0x27')](handleEntityNotFound(_0x2228c1,null))[_0xca62('0x27')](removeEntity(_0x2228c1,null))[_0xca62('0x39')](handleError(_0x2228c1,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 4205143..115b294 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 _0x6ccc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1d82c5,_0x465e70){var _0x3c9e20=function(_0x34172b){while(--_0x34172b){_0x1d82c5['push'](_0x1d82c5['shift']());}};_0x3c9e20(++_0x465e70);}(_0x6ccc,0x14d));var _0xc6cc=function(_0xb08b54,_0x149ec4){_0xb08b54=_0xb08b54-0x0;var _0x353ed9=_0x6ccc[_0xb08b54];return _0x353ed9;};'use strict';var _=require(_0xc6cc('0x0'));var util=require(_0xc6cc('0x1'));var logger=require(_0xc6cc('0x2'))(_0xc6cc('0x3'));var moment=require(_0xc6cc('0x4'));var BPromise=require(_0xc6cc('0x5'));var rp=require(_0xc6cc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6cc('0x7'));var config=require(_0xc6cc('0x8'));var attributes=require('./chatApplication.attributes');module[_0xc6cc('0x9')]=function(_0x506e2f,_0x5f2a10){return _0x506e2f['define'](_0xc6cc('0xa'),attributes,{'tableName':_0xc6cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc6cc('0xc'),'collate':_0xc6cc('0xd')});};
\ No newline at end of file
+var _0x323f=['./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','rimraf'];(function(_0x4ef28a,_0x4b08b8){var _0x1d4e40=function(_0x414254){while(--_0x414254){_0x4ef28a['push'](_0x4ef28a['shift']());}};_0x1d4e40(++_0x4b08b8);}(_0x323f,0xde));var _0xf323=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x323f[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var logger=require('../../config/logger')(_0xf323('0x1'));var moment=require('moment');var BPromise=require(_0xf323('0x2'));var rp=require(_0xf323('0x3'));var fs=require('fs');var path=require(_0xf323('0x4'));var rimraf=require(_0xf323('0x5'));var config=require('../../config/environment');var attributes=require(_0xf323('0x6'));module['exports']=function(_0x3917ae,_0x1d6d5f){return _0x3917ae[_0xf323('0x7')](_0xf323('0x8'),attributes,{'tableName':_0xf323('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf323('0xa'),'collate':_0xf323('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 3d57f4e..62f1f25 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 _0xc692=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0xc692,0x1d2));var _0x2c69=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xc692[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x2c69('0x0'));var moment=require(_0x2c69('0x1'));var BPromise=require(_0x2c69('0x2'));var rs=require(_0x2c69('0x3'));var fs=require('fs');var Redis=require(_0x2c69('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c69('0x5'));var logger=require(_0x2c69('0x6'))(_0x2c69('0x7'));var config=require(_0x2c69('0x8'));var jayson=require(_0x2c69('0x9'));var client=jayson[_0x2c69('0xa')][_0x2c69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x440cb6,_0x18636c,_0x25d2f7){return new BPromise(function(_0x99d779,_0x52885c){return client[_0x2c69('0xc')](_0x440cb6,_0x25d2f7)[_0x2c69('0xd')](function(_0x3bba2a){logger['info'](_0x2c69('0xe'),_0x18636c,_0x2c69('0xf'));logger[_0x2c69('0x10')](_0x2c69('0x11'),_0x18636c,_0x2c69('0xf'),JSON['stringify'](_0x3bba2a));if(_0x3bba2a[_0x2c69('0x12')]){if(_0x3bba2a[_0x2c69('0x12')][_0x2c69('0x13')]===0x1f4){logger[_0x2c69('0x12')](_0x2c69('0xe'),_0x18636c,_0x3bba2a[_0x2c69('0x12')][_0x2c69('0x14')]);return _0x52885c(_0x3bba2a[_0x2c69('0x12')][_0x2c69('0x14')]);}logger[_0x2c69('0x12')]('ChatApplication,\x20%s,\x20%s',_0x18636c,_0x3bba2a['error'][_0x2c69('0x14')]);return _0x99d779(_0x3bba2a[_0x2c69('0x12')][_0x2c69('0x14')]);}else{logger[_0x2c69('0x15')](_0x2c69('0xe'),_0x18636c,'request\x20sent');_0x99d779(_0x3bba2a[_0x2c69('0x16')][_0x2c69('0x14')]);}})[_0x2c69('0x17')](function(_0x1a222d){logger[_0x2c69('0x12')](_0x2c69('0xe'),_0x18636c,_0x1a222d);_0x52885c(_0x1a222d);});});}
\ No newline at end of file
+var _0x488a=['code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0x488a,0x1bd));var _0xa488=function(_0x5e94d5,_0x3b2785){_0x5e94d5=_0x5e94d5-0x0;var _0xce2d7a=_0x488a[_0x5e94d5];return _0xce2d7a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa488('0x0'));var BPromise=require(_0xa488('0x1'));var rs=require(_0xa488('0x2'));var fs=require('fs');var Redis=require(_0xa488('0x3'));var db=require(_0xa488('0x4'))['db'];var utils=require(_0xa488('0x5'));var logger=require('../../config/logger')(_0xa488('0x6'));var config=require(_0xa488('0x7'));var jayson=require(_0xa488('0x8'));var client=jayson[_0xa488('0x9')][_0xa488('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x384d8,_0x1ec0a4,_0x1c5abd){return new BPromise(function(_0x442cd4,_0x4e1504){return client[_0xa488('0xb')](_0x384d8,_0x1c5abd)[_0xa488('0xc')](function(_0x184623){logger['info'](_0xa488('0xd'),_0x1ec0a4,_0xa488('0xe'));logger['debug'](_0xa488('0xf'),_0x1ec0a4,_0xa488('0xe'),JSON['stringify'](_0x184623));if(_0x184623[_0xa488('0x10')]){if(_0x184623['error'][_0xa488('0x11')]===0x1f4){logger[_0xa488('0x10')]('ChatApplication,\x20%s,\x20%s',_0x1ec0a4,_0x184623[_0xa488('0x10')][_0xa488('0x12')]);return _0x4e1504(_0x184623[_0xa488('0x10')][_0xa488('0x12')]);}logger['error'](_0xa488('0xd'),_0x1ec0a4,_0x184623[_0xa488('0x10')][_0xa488('0x12')]);return _0x442cd4(_0x184623[_0xa488('0x10')]['message']);}else{logger[_0xa488('0x13')]('ChatApplication,\x20%s,\x20%s',_0x1ec0a4,_0xa488('0xe'));_0x442cd4(_0x184623[_0xa488('0x14')][_0xa488('0x12')]);}})[_0xa488('0x15')](function(_0xb009d6){logger[_0xa488('0x10')](_0xa488('0xd'),_0x1ec0a4,_0xb009d6);_0x4e1504(_0xb009d6);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 5a6c950..d981014 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 _0x68d6=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x3adde6,_0x308e76){var _0x3c8a4f=function(_0xac4b1d){while(--_0xac4b1d){_0x3adde6['push'](_0x3adde6['shift']());}};_0x3c8a4f(++_0x308e76);}(_0x68d6,0xb8));var _0x668d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x68d6[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x668d('0x0'));var path=require(_0x668d('0x1'));var timeout=require('connect-timeout');var express=require(_0x668d('0x2'));var router=express['Router']();var fs_extra=require(_0x668d('0x3'));var auth=require(_0x668d('0x4'));var interaction=require(_0x668d('0x5'));var config=require(_0x668d('0x6'));var controller=require(_0x668d('0x7'));router['get'](_0x668d('0x8'),auth[_0x668d('0x9')](),controller[_0x668d('0xa')]);router[_0x668d('0xb')](_0x668d('0x8'),auth['isAuthenticated'](),controller[_0x668d('0xc')]);router[_0x668d('0xd')]('/:id',auth[_0x668d('0x9')](),controller[_0x668d('0xe')]);module[_0x668d('0xf')]=router;
\ No newline at end of file
+var _0x9c7e=['get','/:id','show','put','update','delete','isAuthenticated','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42a628,_0x305b30){var _0x367d8e=function(_0x2cfb4){while(--_0x2cfb4){_0x42a628['push'](_0x42a628['shift']());}};_0x367d8e(++_0x305b30);}(_0x9c7e,0x88));var _0xe9c7=function(_0x16774e,_0x30f804){_0x16774e=_0x16774e-0x0;var _0x5031bc=_0x9c7e[_0x16774e];return _0x5031bc;};'use strict';var multer=require(_0xe9c7('0x0'));var util=require('util');var path=require(_0xe9c7('0x1'));var timeout=require(_0xe9c7('0x2'));var express=require(_0xe9c7('0x3'));var router=express['Router']();var fs_extra=require(_0xe9c7('0x4'));var auth=require(_0xe9c7('0x5'));var interaction=require(_0xe9c7('0x6'));var config=require(_0xe9c7('0x7'));var controller=require('./chatApplication.controller');router[_0xe9c7('0x8')](_0xe9c7('0x9'),auth['isAuthenticated'](),controller[_0xe9c7('0xa')]);router[_0xe9c7('0xb')](_0xe9c7('0x9'),auth['isAuthenticated'](),controller[_0xe9c7('0xc')]);router[_0xe9c7('0xd')](_0xe9c7('0x9'),auth[_0xe9c7('0xe')](),controller['destroy']);module[_0xe9c7('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4fee33e..a5729b1 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 _0x46e1=['BOOLEAN','sequelize','exports','STRING'];(function(_0x13eaae,_0x11ec0a){var _0x4493db=function(_0xf9d8b1){while(--_0xf9d8b1){_0x13eaae['push'](_0x13eaae['shift']());}};_0x4493db(++_0x11ec0a);}(_0x46e1,0x155));var _0x146e=function(_0x4e664,_0x3cd9c8){_0x4e664=_0x4e664-0x0;var _0x2e7dd3=_0x46e1[_0x4e664];return _0x2e7dd3;};'use strict';var Sequelize=require(_0x146e('0x0'));module[_0x146e('0x1')]={'name':{'type':Sequelize[_0x146e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x146e('0x2')]},'write':{'type':Sequelize[_0x146e('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xffb1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xffb1,0x93));var _0x1ffb=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0xffb1[_0x1cfe2e];return _0x39233f;};'use strict';var Sequelize=require(_0x1ffb('0x0'));module[_0x1ffb('0x1')]={'name':{'type':Sequelize[_0x1ffb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1ffb('0x2')]},'write':{'type':Sequelize[_0x1ffb('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index b324662..070884f 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 _0xb486=['../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','ChatGroup','rawAttributes','fieldName','type','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','find','create','body','describe','getUnread','ChatInternalMessage','addMembers','omit','getMembers','findOne','User','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util'];(function(_0x5df9ae,_0xd5d635){var _0x377c9a=function(_0x1fa5bc){while(--_0x1fa5bc){_0x5df9ae['push'](_0x5df9ae['shift']());}};_0x377c9a(++_0xd5d635);}(_0xb486,0x1b8));var _0x6b48=function(_0x2f04d1,_0x34cc49){_0x2f04d1=_0x2f04d1-0x0;var _0x1d58e5=_0xb486[_0x2f04d1];return _0x1d58e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b48('0x0'));var zipdir=require(_0x6b48('0x1'));var jsonpatch=require(_0x6b48('0x2'));var rp=require(_0x6b48('0x3'));var moment=require('moment');var BPromise=require(_0x6b48('0x4'));var Mustache=require(_0x6b48('0x5'));var util=require(_0x6b48('0x6'));var path=require(_0x6b48('0x7'));var sox=require(_0x6b48('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b48('0x9'));var _=require(_0x6b48('0xa'));var squel=require(_0x6b48('0xb'));var crypto=require('crypto');var jsforce=require(_0x6b48('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b48('0xd'));var Papa=require(_0x6b48('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6b48('0xf'));var as=require(_0x6b48('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b48('0x11'))(_0x6b48('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b48('0x13'));var db=require(_0x6b48('0x14'))['db'];config[_0x6b48('0x15')]=_[_0x6b48('0x16')](config[_0x6b48('0x15')],{'host':_0x6b48('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6b48('0x18'))[_0x6b48('0x19')](socket);function respondWithStatusCode(_0x6d4995,_0x565a7c){_0x565a7c=_0x565a7c||0xcc;return function(_0x188ba0){if(_0x188ba0){return _0x6d4995[_0x6b48('0x1a')](_0x565a7c);}return _0x6d4995[_0x6b48('0x1b')](_0x565a7c)[_0x6b48('0x1c')]();};}function respondWithResult(_0x44e9fb,_0x3422ba){_0x3422ba=_0x3422ba||0xc8;return function(_0x4485bd){if(_0x4485bd){return _0x44e9fb[_0x6b48('0x1b')](_0x3422ba)[_0x6b48('0x1d')](_0x4485bd);}};}function respondWithFilteredResult(_0x1e58b7,_0x596a08){return function(_0x427035){if(_0x427035){var _0x3fb005=typeof _0x596a08['offset']===_0x6b48('0x1e')&&typeof _0x596a08[_0x6b48('0x1f')]===_0x6b48('0x1e');var _0x2c2a51=_0x427035[_0x6b48('0x20')];var _0x21331a=_0x3fb005?0x0:_0x596a08['offset'];var _0x334966=_0x3fb005?_0x427035[_0x6b48('0x20')]:_0x596a08[_0x6b48('0x21')]+_0x596a08[_0x6b48('0x1f')];var _0x36c991;if(_0x334966>=_0x2c2a51){_0x334966=_0x2c2a51;_0x36c991=0xc8;}else{_0x36c991=0xce;}_0x1e58b7[_0x6b48('0x1b')](_0x36c991);return _0x1e58b7[_0x6b48('0x22')](_0x6b48('0x23'),_0x21331a+'-'+_0x334966+'/'+_0x2c2a51)['json'](_0x427035);}return null;};}function patchUpdates(_0x4979e0){return function(_0x5a7d0f){try{jsonpatch[_0x6b48('0x24')](_0x5a7d0f,_0x4979e0,!![]);}catch(_0x276ce4){return BPromise['reject'](_0x276ce4);}return _0x5a7d0f[_0x6b48('0x25')]();};}function saveUpdates(_0x33d67b,_0x32c29d){return function(_0x50d575){if(_0x50d575){return _0x50d575[_0x6b48('0x26')](_0x33d67b)[_0x6b48('0x27')](function(_0x2dcf92){return _0x2dcf92;});}return null;};}function removeEntity(_0x165ab4,_0x3a7496){return function(_0x77829a){if(_0x77829a){return _0x77829a[_0x6b48('0x28')]()[_0x6b48('0x27')](function(){_0x165ab4[_0x6b48('0x1b')](0xcc)[_0x6b48('0x1c')]();});}};}function handleEntityNotFound(_0x2cc718,_0x452527){return function(_0x570f24){if(!_0x570f24){_0x2cc718['sendStatus'](0x194);}return _0x570f24;};}function handleError(_0x407c55,_0x169bc2){_0x169bc2=_0x169bc2||0x1f4;return function(_0x1aabf1){logger['error'](_0x1aabf1[_0x6b48('0x29')]);if(_0x1aabf1[_0x6b48('0x2a')]){delete _0x1aabf1['name'];}_0x407c55[_0x6b48('0x1b')](_0x169bc2)[_0x6b48('0x2b')](_0x1aabf1);};}exports['index']=function(_0x5d94a0,_0x18ca90){var _0x2d9807={},_0x510f58={},_0x153f77={'count':0x0,'rows':[]};var _0xbcbc4a=_['map'](db[_0x6b48('0x2c')][_0x6b48('0x2d')],function(_0x147231){return{'name':_0x147231[_0x6b48('0x2e')],'type':_0x147231[_0x6b48('0x2f')][_0x6b48('0x30')]};});_0x510f58['model']=_[_0x6b48('0x31')](_0xbcbc4a,_0x6b48('0x2a'));_0x510f58['query']=_['keys'](_0x5d94a0[_0x6b48('0x32')]);_0x510f58['filters']=_[_0x6b48('0x33')](_0x510f58['model'],_0x510f58[_0x6b48('0x32')]);_0x2d9807[_0x6b48('0x34')]=_['intersection'](_0x510f58[_0x6b48('0x35')],qs['fields'](_0x5d94a0[_0x6b48('0x32')][_0x6b48('0x36')]));_0x2d9807[_0x6b48('0x34')]=_0x2d9807[_0x6b48('0x34')][_0x6b48('0x37')]?_0x2d9807[_0x6b48('0x34')]:_0x510f58[_0x6b48('0x35')];if(!_0x5d94a0[_0x6b48('0x32')][_0x6b48('0x38')](_0x6b48('0x39'))){_0x2d9807[_0x6b48('0x1f')]=qs[_0x6b48('0x1f')](_0x5d94a0[_0x6b48('0x32')][_0x6b48('0x1f')]);_0x2d9807[_0x6b48('0x21')]=qs[_0x6b48('0x21')](_0x5d94a0['query'][_0x6b48('0x21')]);}_0x2d9807[_0x6b48('0x3a')]=qs['sort'](_0x5d94a0['query'][_0x6b48('0x3b')]);_0x2d9807[_0x6b48('0x3c')]=qs[_0x6b48('0x3d')](_[_0x6b48('0x3e')](_0x5d94a0['query'],_0x510f58[_0x6b48('0x3d')]),_0xbcbc4a);if(_0x5d94a0[_0x6b48('0x32')]['filter']){_0x2d9807['where']=_[_0x6b48('0x3f')](_0x2d9807['where'],{'$or':_[_0x6b48('0x31')](_0xbcbc4a,function(_0x1cf487){if(_0x1cf487[_0x6b48('0x2f')]!==_0x6b48('0x40')){var _0x24cab6={};_0x24cab6[_0x1cf487[_0x6b48('0x2a')]]={'$like':'%'+_0x5d94a0[_0x6b48('0x32')][_0x6b48('0x41')]+'%'};return _0x24cab6;}})});}_0x2d9807=_['merge']({},_0x2d9807,_0x5d94a0[_0x6b48('0x42')]);var _0x413fa1={'where':_0x2d9807['where']};return db[_0x6b48('0x2c')][_0x6b48('0x20')](_0x413fa1)[_0x6b48('0x27')](function(_0xc05658){_0x153f77[_0x6b48('0x20')]=_0xc05658;if(_0x5d94a0['query'][_0x6b48('0x43')]){_0x2d9807['include']=[{'all':!![]}];}return db['ChatGroup'][_0x6b48('0x44')](_0x2d9807);})[_0x6b48('0x27')](function(_0x9426f5){_0x153f77['rows']=_0x9426f5;return _0x153f77;})[_0x6b48('0x27')](respondWithFilteredResult(_0x18ca90,_0x2d9807))[_0x6b48('0x45')](handleError(_0x18ca90,null));};exports[_0x6b48('0x46')]=function(_0x52e142,_0xb1e228){var _0x3e92f3={'raw':!![],'where':{'id':_0x52e142[_0x6b48('0x47')]['id']}},_0x3f09fe={};_0x3f09fe[_0x6b48('0x35')]=_[_0x6b48('0x48')](db[_0x6b48('0x2c')][_0x6b48('0x2d')]);_0x3f09fe['query']=_[_0x6b48('0x48')](_0x52e142[_0x6b48('0x32')]);_0x3f09fe['filters']=_[_0x6b48('0x33')](_0x3f09fe[_0x6b48('0x35')],_0x3f09fe[_0x6b48('0x32')]);_0x3e92f3[_0x6b48('0x34')]=_['intersection'](_0x3f09fe['model'],qs[_0x6b48('0x36')](_0x52e142[_0x6b48('0x32')][_0x6b48('0x36')]));_0x3e92f3[_0x6b48('0x34')]=_0x3e92f3[_0x6b48('0x34')][_0x6b48('0x37')]?_0x3e92f3[_0x6b48('0x34')]:_0x3f09fe[_0x6b48('0x35')];if(_0x52e142[_0x6b48('0x32')]['includeAll']){_0x3e92f3['include']=[{'all':!![]}];}_0x3e92f3=_['merge']({},_0x3e92f3,_0x52e142[_0x6b48('0x42')]);return db[_0x6b48('0x2c')][_0x6b48('0x49')](_0x3e92f3)[_0x6b48('0x27')](handleEntityNotFound(_0xb1e228,null))[_0x6b48('0x27')](respondWithResult(_0xb1e228,null))[_0x6b48('0x45')](handleError(_0xb1e228,null));};exports[_0x6b48('0x4a')]=function(_0x52b179,_0x5ea905){return db['ChatGroup'][_0x6b48('0x4a')](_0x52b179[_0x6b48('0x4b')],{})['then'](respondWithResult(_0x5ea905,0xc9))[_0x6b48('0x45')](handleError(_0x5ea905,null));};exports[_0x6b48('0x26')]=function(_0x34702f,_0x367f8c){if(_0x34702f['body']['id']){delete _0x34702f['body']['id'];}return db[_0x6b48('0x2c')][_0x6b48('0x49')]({'where':{'id':_0x34702f[_0x6b48('0x47')]['id']}})[_0x6b48('0x27')](handleEntityNotFound(_0x367f8c,null))[_0x6b48('0x27')](saveUpdates(_0x34702f['body'],null))['then'](respondWithResult(_0x367f8c,null))[_0x6b48('0x45')](handleError(_0x367f8c,null));};exports[_0x6b48('0x28')]=function(_0x15c004,_0x5871f3){return db['ChatGroup'][_0x6b48('0x49')]({'where':{'id':_0x15c004[_0x6b48('0x47')]['id']}})['then'](handleEntityNotFound(_0x5871f3,null))['then'](removeEntity(_0x5871f3,null))[_0x6b48('0x45')](handleError(_0x5871f3,null));};exports[_0x6b48('0x4c')]=function(_0x360e6b,_0x545cf4){return db['ChatGroup'][_0x6b48('0x4c')]()['then'](respondWithResult(_0x545cf4,null))[_0x6b48('0x45')](handleError(_0x545cf4,null));};exports[_0x6b48('0x4d')]=function(_0x146814,_0x3aaaec,_0x57d7bd){return db[_0x6b48('0x4e')][_0x6b48('0x20')]({'where':{'ChatGroupId':_0x146814['params']['id'],'ToId':_0x146814['user']['id'],'read':![]}})[_0x6b48('0x27')](function(_0x50fd85){return{'id':_['toInteger'](_0x146814['params']['id']),'count':_0x50fd85};})[_0x6b48('0x27')](respondWithResult(_0x3aaaec,null))[_0x6b48('0x45')](handleError(_0x3aaaec,null));};exports['addMembers']=function(_0x2a6f50,_0x59bfe6,_0x51e0ff){return db['ChatGroup'][_0x6b48('0x49')]({'where':{'id':_0x2a6f50[_0x6b48('0x47')]['id']}})[_0x6b48('0x27')](handleEntityNotFound(_0x59bfe6,null))[_0x6b48('0x27')](function(_0x24ceeb){if(_0x24ceeb){return _0x24ceeb[_0x6b48('0x4f')](_0x2a6f50[_0x6b48('0x4b')]['ids'],_[_0x6b48('0x50')](_0x2a6f50[_0x6b48('0x4b')],['ids','id'])||{});}})[_0x6b48('0x27')](respondWithResult(_0x59bfe6,null))[_0x6b48('0x45')](handleError(_0x59bfe6,null));};exports[_0x6b48('0x51')]=function(_0x3fd5fc,_0x34d1f5,_0x2fa46d){var _0x445ef6={};var _0xec1e8e={};var _0x337f60;var _0xe7563c;return db[_0x6b48('0x2c')][_0x6b48('0x52')]({'where':{'id':_0x3fd5fc[_0x6b48('0x47')]['id']}})[_0x6b48('0x27')](handleEntityNotFound(_0x34d1f5,null))[_0x6b48('0x27')](function(_0x346c54){if(_0x346c54){_0x337f60=_0x346c54;_0xec1e8e[_0x6b48('0x35')]=_[_0x6b48('0x48')](db[_0x6b48('0x53')][_0x6b48('0x2d')]);_0xec1e8e[_0x6b48('0x32')]=_[_0x6b48('0x48')](_0x3fd5fc[_0x6b48('0x32')]);_0xec1e8e[_0x6b48('0x3d')]=_[_0x6b48('0x33')](_0xec1e8e[_0x6b48('0x35')],_0xec1e8e[_0x6b48('0x32')]);_0x445ef6[_0x6b48('0x34')]=_['intersection'](_0xec1e8e[_0x6b48('0x35')],qs[_0x6b48('0x36')](_0x3fd5fc[_0x6b48('0x32')][_0x6b48('0x36')]));_0x445ef6[_0x6b48('0x34')]=_0x445ef6[_0x6b48('0x34')][_0x6b48('0x37')]?_0x445ef6[_0x6b48('0x34')]:_0xec1e8e[_0x6b48('0x35')];_0x445ef6['order']=qs[_0x6b48('0x3b')](_0x3fd5fc[_0x6b48('0x32')]['sort']);_0x445ef6[_0x6b48('0x3c')]=qs[_0x6b48('0x3d')](_[_0x6b48('0x3e')](_0x3fd5fc['query'],_0xec1e8e[_0x6b48('0x3d')]));if(_0x3fd5fc[_0x6b48('0x32')][_0x6b48('0x41')]){_0x445ef6[_0x6b48('0x3c')]=_[_0x6b48('0x3f')](_0x445ef6[_0x6b48('0x3c')],{'$or':_[_0x6b48('0x31')](_0x445ef6[_0x6b48('0x34')],function(_0x1473c6){var _0x38d260={};_0x38d260[_0x1473c6]={'$like':'%'+_0x3fd5fc['query'][_0x6b48('0x41')]+'%'};return _0x38d260;})});}_0x445ef6=_[_0x6b48('0x3f')]({},_0x445ef6,_0x3fd5fc[_0x6b48('0x42')]);return _0x337f60[_0x6b48('0x51')](_0x445ef6);}})['then'](function(_0x2b0a48){if(_0x2b0a48){_0xe7563c=_0x2b0a48[_0x6b48('0x37')];if(!_0x3fd5fc[_0x6b48('0x32')][_0x6b48('0x38')]('nolimit')){_0x445ef6[_0x6b48('0x1f')]=qs['limit'](_0x3fd5fc[_0x6b48('0x32')][_0x6b48('0x1f')]);_0x445ef6['offset']=qs[_0x6b48('0x21')](_0x3fd5fc[_0x6b48('0x32')][_0x6b48('0x21')]);}return _0x337f60[_0x6b48('0x51')](_0x445ef6);}})['then'](function(_0x157c67){if(_0x157c67){return _0x157c67?{'count':_0xe7563c,'rows':_0x157c67}:null;}})['then'](respondWithResult(_0x34d1f5,null))[_0x6b48('0x45')](handleError(_0x34d1f5,null));};exports['removeMembers']=function(_0x3a1f95,_0x370e58,_0x348ad9){return db[_0x6b48('0x2c')][_0x6b48('0x49')]({'where':{'id':_0x3a1f95[_0x6b48('0x47')]['id']}})[_0x6b48('0x27')](handleEntityNotFound(_0x370e58,null))['then'](function(_0x42c8ad){if(_0x42c8ad){return _0x42c8ad[_0x6b48('0x54')](_0x3a1f95[_0x6b48('0x32')][_0x6b48('0x55')]);}})[_0x6b48('0x27')](respondWithStatusCode(_0x370e58,null))[_0x6b48('0x45')](handleError(_0x370e58,null));};exports[_0x6b48('0x56')]=function(_0x2a21e5,_0x5b1865,_0x43e937){if(_0x2a21e5[_0x6b48('0x4b')]['id']){delete _0x2a21e5[_0x6b48('0x4b')]['id'];}return db[_0x6b48('0x2c')][_0x6b48('0x49')]({'where':{'id':_0x2a21e5[_0x6b48('0x47')]['id']}})[_0x6b48('0x27')](handleEntityNotFound(_0x5b1865,null))[_0x6b48('0x27')](function(_0x222239){if(_0x222239){_0x2a21e5[_0x6b48('0x4b')][_0x6b48('0x57')]=_0x222239['id'];return db[_0x6b48('0x4e')]['create'](_0x2a21e5['body']);}})[_0x6b48('0x27')](respondWithResult(_0x5b1865,null))[_0x6b48('0x45')](handleError(_0x5b1865,null));};exports[_0x6b48('0x58')]=function(_0x1a4d0e,_0x52a7ac,_0x1f664e){var _0x5b807e={};var _0x174bcf={};var _0x4f5b58;var _0x45823d;return db[_0x6b48('0x2c')][_0x6b48('0x52')]({'where':{'id':_0x1a4d0e[_0x6b48('0x47')]['id']}})[_0x6b48('0x27')](handleEntityNotFound(_0x52a7ac,null))[_0x6b48('0x27')](function(_0x3eb295){if(_0x3eb295){_0x4f5b58=_0x3eb295;_0x174bcf['model']=_[_0x6b48('0x48')](db[_0x6b48('0x4e')][_0x6b48('0x2d')]);_0x174bcf[_0x6b48('0x32')]=_['keys'](_0x1a4d0e[_0x6b48('0x32')]);_0x174bcf[_0x6b48('0x3d')]=_[_0x6b48('0x33')](_0x174bcf[_0x6b48('0x35')],_0x174bcf[_0x6b48('0x32')]);_0x5b807e[_0x6b48('0x34')]=_[_0x6b48('0x33')](_0x174bcf[_0x6b48('0x35')],qs[_0x6b48('0x36')](_0x1a4d0e[_0x6b48('0x32')][_0x6b48('0x36')]));_0x5b807e[_0x6b48('0x34')]=_0x5b807e[_0x6b48('0x34')][_0x6b48('0x37')]?_0x5b807e[_0x6b48('0x34')]:_0x174bcf[_0x6b48('0x35')];_0x5b807e[_0x6b48('0x3a')]=qs[_0x6b48('0x3b')](_0x1a4d0e['query'][_0x6b48('0x3b')]);_0x5b807e['where']=qs['filters'](_[_0x6b48('0x3e')](_0x1a4d0e[_0x6b48('0x32')],_0x174bcf['filters']));if(_0x1a4d0e[_0x6b48('0x32')]['filter']){_0x5b807e['where']=_[_0x6b48('0x3f')](_0x5b807e['where'],{'$or':_['map'](_0x5b807e[_0x6b48('0x34')],function(_0x1bf60e){var _0xb01c3e={};_0xb01c3e[_0x1bf60e]={'$like':'%'+_0x1a4d0e[_0x6b48('0x32')]['filter']+'%'};return _0xb01c3e;})});}if(_0x1a4d0e[_0x6b48('0x32')][_0x6b48('0x59')]){var _0xf32d16=_0x1a4d0e['query'][_0x6b48('0x59')][_0x6b48('0x5a')](',');var _0x30bd37={};_0x30bd37[_0xf32d16[0x0]]={'$gte':moment(_0xf32d16[0x1])['format'](_0x6b48('0x5b'))};_0x5b807e[_0x6b48('0x3c')]=_[_0x6b48('0x3f')](_0x5b807e['where'],_0x30bd37);}_0x5b807e=_[_0x6b48('0x3f')]({},_0x5b807e,_0x1a4d0e[_0x6b48('0x42')]);return _0x4f5b58[_0x6b48('0x58')](_0x5b807e);}})[_0x6b48('0x27')](function(_0x5d1cc3){if(_0x5d1cc3){_0x45823d=_0x5d1cc3[_0x6b48('0x37')];if(!_0x1a4d0e[_0x6b48('0x32')][_0x6b48('0x38')]('nolimit')){_0x5b807e[_0x6b48('0x1f')]=qs[_0x6b48('0x1f')](_0x1a4d0e[_0x6b48('0x32')]['limit']);_0x5b807e[_0x6b48('0x21')]=qs[_0x6b48('0x21')](_0x1a4d0e[_0x6b48('0x32')]['offset']);}return _0x4f5b58[_0x6b48('0x58')](_0x5b807e);}})[_0x6b48('0x27')](function(_0x464a37){if(_0x464a37){return _0x464a37?{'count':_0x45823d,'rows':_0x464a37}:null;}})[_0x6b48('0x27')](respondWithResult(_0x52a7ac,null))[_0x6b48('0x45')](handleError(_0x52a7ac,null));};
\ No newline at end of file
+var _0xc03a=['ChatGroup','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','error','name','send','index'];(function(_0x333478,_0x15dcb2){var _0x5c48bc=function(_0x27115a){while(--_0x27115a){_0x333478['push'](_0x333478['shift']());}};_0x5c48bc(++_0x15dcb2);}(_0xc03a,0x1a1));var _0xac03=function(_0x5e0758,_0x5d2e35){_0x5e0758=_0x5e0758-0x0;var _0xfc2326=_0xc03a[_0x5e0758];return _0xfc2326;};'use strict';var emlformat=require(_0xac03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac03('0x1'));var jsonpatch=require(_0xac03('0x2'));var rp=require(_0xac03('0x3'));var moment=require(_0xac03('0x4'));var BPromise=require(_0xac03('0x5'));var Mustache=require('mustache');var util=require(_0xac03('0x6'));var path=require(_0xac03('0x7'));var sox=require(_0xac03('0x8'));var csv=require(_0xac03('0x9'));var ejs=require(_0xac03('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xac03('0xb'));var crypto=require(_0xac03('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac03('0x9'));var querystring=require('querystring');var Papa=require(_0xac03('0xd'));var Redis=require('ioredis');var authService=require(_0xac03('0xe'));var qs=require(_0xac03('0xf'));var as=require(_0xac03('0x10'));var hardwareService=require(_0xac03('0x11'));var logger=require('../../config/logger')(_0xac03('0x12'));var utils=require('../../config/utils');var config=require(_0xac03('0x13'));var licenseUtil=require(_0xac03('0x14'));var db=require(_0xac03('0x15'))['db'];config['redis']=_[_0xac03('0x16')](config[_0xac03('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xac03('0x18'))(new Redis(config['redis']));require(_0xac03('0x19'))['register'](socket);function respondWithStatusCode(_0xf9c9fc,_0x9d93f9){_0x9d93f9=_0x9d93f9||0xcc;return function(_0x1ceea2){if(_0x1ceea2){return _0xf9c9fc[_0xac03('0x1a')](_0x9d93f9);}return _0xf9c9fc[_0xac03('0x1b')](_0x9d93f9)[_0xac03('0x1c')]();};}function respondWithResult(_0x5ab44f,_0x49a2e3){_0x49a2e3=_0x49a2e3||0xc8;return function(_0x328299){if(_0x328299){return _0x5ab44f[_0xac03('0x1b')](_0x49a2e3)[_0xac03('0x1d')](_0x328299);}};}function respondWithFilteredResult(_0x1bd96d,_0x2f1ccf){return function(_0x206635){if(_0x206635){var _0x24544b=typeof _0x2f1ccf[_0xac03('0x1e')]===_0xac03('0x1f')&&typeof _0x2f1ccf['limit']===_0xac03('0x1f');var _0x30b892=_0x206635[_0xac03('0x20')];var _0x343bc0=_0x24544b?0x0:_0x2f1ccf[_0xac03('0x1e')];var _0x13040a=_0x24544b?_0x206635[_0xac03('0x20')]:_0x2f1ccf[_0xac03('0x1e')]+_0x2f1ccf[_0xac03('0x21')];var _0x48331f;if(_0x13040a>=_0x30b892){_0x13040a=_0x30b892;_0x48331f=0xc8;}else{_0x48331f=0xce;}_0x1bd96d[_0xac03('0x1b')](_0x48331f);return _0x1bd96d['set'](_0xac03('0x22'),_0x343bc0+'-'+_0x13040a+'/'+_0x30b892)[_0xac03('0x1d')](_0x206635);}return null;};}function patchUpdates(_0x4ff4da){return function(_0x173309){try{jsonpatch[_0xac03('0x23')](_0x173309,_0x4ff4da,!![]);}catch(_0x4a2fbb){return BPromise['reject'](_0x4a2fbb);}return _0x173309['save']();};}function saveUpdates(_0x1f97dd,_0x2fe3db){return function(_0x6894){if(_0x6894){return _0x6894[_0xac03('0x24')](_0x1f97dd)[_0xac03('0x25')](function(_0x4ae070){return _0x4ae070;});}return null;};}function removeEntity(_0x486a71,_0x1716d0){return function(_0x316fbf){if(_0x316fbf){return _0x316fbf[_0xac03('0x26')]()['then'](function(){_0x486a71[_0xac03('0x1b')](0xcc)[_0xac03('0x1c')]();});}};}function handleEntityNotFound(_0x4a1c6e,_0x2ca857){return function(_0x1bd76a){if(!_0x1bd76a){_0x4a1c6e[_0xac03('0x1a')](0x194);}return _0x1bd76a;};}function handleError(_0x4306b9,_0x43a606){_0x43a606=_0x43a606||0x1f4;return function(_0x3302b2){logger[_0xac03('0x27')](_0x3302b2['stack']);if(_0x3302b2[_0xac03('0x28')]){delete _0x3302b2[_0xac03('0x28')];}_0x4306b9['status'](_0x43a606)[_0xac03('0x29')](_0x3302b2);};}exports[_0xac03('0x2a')]=function(_0x40c619,_0x3074bb){var _0x533e86={},_0x17a873={},_0x3acca7={'count':0x0,'rows':[]};var _0x1c378a=_['map'](db[_0xac03('0x2b')][_0xac03('0x2c')],function(_0x302087){return{'name':_0x302087[_0xac03('0x2d')],'type':_0x302087['type'][_0xac03('0x2e')]};});_0x17a873[_0xac03('0x2f')]=_[_0xac03('0x30')](_0x1c378a,'name');_0x17a873[_0xac03('0x31')]=_[_0xac03('0x32')](_0x40c619[_0xac03('0x31')]);_0x17a873[_0xac03('0x33')]=_['intersection'](_0x17a873['model'],_0x17a873['query']);_0x533e86['attributes']=_[_0xac03('0x34')](_0x17a873[_0xac03('0x2f')],qs[_0xac03('0x35')](_0x40c619[_0xac03('0x31')]['fields']));_0x533e86[_0xac03('0x36')]=_0x533e86[_0xac03('0x36')][_0xac03('0x37')]?_0x533e86[_0xac03('0x36')]:_0x17a873[_0xac03('0x2f')];if(!_0x40c619['query'][_0xac03('0x38')](_0xac03('0x39'))){_0x533e86[_0xac03('0x21')]=qs[_0xac03('0x21')](_0x40c619['query'][_0xac03('0x21')]);_0x533e86[_0xac03('0x1e')]=qs[_0xac03('0x1e')](_0x40c619[_0xac03('0x31')][_0xac03('0x1e')]);}_0x533e86[_0xac03('0x3a')]=qs[_0xac03('0x3b')](_0x40c619[_0xac03('0x31')][_0xac03('0x3b')]);_0x533e86[_0xac03('0x3c')]=qs[_0xac03('0x33')](_[_0xac03('0x3d')](_0x40c619[_0xac03('0x31')],_0x17a873['filters']),_0x1c378a);if(_0x40c619[_0xac03('0x31')][_0xac03('0x3e')]){_0x533e86[_0xac03('0x3c')]=_[_0xac03('0x3f')](_0x533e86[_0xac03('0x3c')],{'$or':_[_0xac03('0x30')](_0x1c378a,function(_0x542ca1){if(_0x542ca1[_0xac03('0x40')]!=='VIRTUAL'){var _0x661928={};_0x661928[_0x542ca1[_0xac03('0x28')]]={'$like':'%'+_0x40c619[_0xac03('0x31')][_0xac03('0x3e')]+'%'};return _0x661928;}})});}_0x533e86=_[_0xac03('0x3f')]({},_0x533e86,_0x40c619[_0xac03('0x41')]);var _0x4c0137={'where':_0x533e86[_0xac03('0x3c')]};return db[_0xac03('0x2b')][_0xac03('0x20')](_0x4c0137)[_0xac03('0x25')](function(_0x471315){_0x3acca7[_0xac03('0x20')]=_0x471315;if(_0x40c619[_0xac03('0x31')][_0xac03('0x42')]){_0x533e86[_0xac03('0x43')]=[{'all':!![]}];}return db[_0xac03('0x2b')][_0xac03('0x44')](_0x533e86);})[_0xac03('0x25')](function(_0x30b8ea){_0x3acca7[_0xac03('0x45')]=_0x30b8ea;return _0x3acca7;})[_0xac03('0x25')](respondWithFilteredResult(_0x3074bb,_0x533e86))['catch'](handleError(_0x3074bb,null));};exports[_0xac03('0x46')]=function(_0x2ad300,_0x57c877){var _0x5adb0a={'raw':!![],'where':{'id':_0x2ad300[_0xac03('0x47')]['id']}},_0x1b6cd0={};_0x1b6cd0[_0xac03('0x2f')]=_[_0xac03('0x32')](db[_0xac03('0x2b')][_0xac03('0x2c')]);_0x1b6cd0[_0xac03('0x31')]=_[_0xac03('0x32')](_0x2ad300['query']);_0x1b6cd0['filters']=_[_0xac03('0x34')](_0x1b6cd0[_0xac03('0x2f')],_0x1b6cd0[_0xac03('0x31')]);_0x5adb0a[_0xac03('0x36')]=_[_0xac03('0x34')](_0x1b6cd0[_0xac03('0x2f')],qs[_0xac03('0x35')](_0x2ad300[_0xac03('0x31')][_0xac03('0x35')]));_0x5adb0a['attributes']=_0x5adb0a[_0xac03('0x36')]['length']?_0x5adb0a[_0xac03('0x36')]:_0x1b6cd0['model'];if(_0x2ad300[_0xac03('0x31')]['includeAll']){_0x5adb0a['include']=[{'all':!![]}];}_0x5adb0a=_[_0xac03('0x3f')]({},_0x5adb0a,_0x2ad300[_0xac03('0x41')]);return db[_0xac03('0x2b')][_0xac03('0x48')](_0x5adb0a)[_0xac03('0x25')](handleEntityNotFound(_0x57c877,null))[_0xac03('0x25')](respondWithResult(_0x57c877,null))[_0xac03('0x49')](handleError(_0x57c877,null));};exports[_0xac03('0x4a')]=function(_0xeae4cb,_0x592c24){return db[_0xac03('0x2b')][_0xac03('0x4a')](_0xeae4cb[_0xac03('0x4b')],{})[_0xac03('0x25')](respondWithResult(_0x592c24,0xc9))[_0xac03('0x49')](handleError(_0x592c24,null));};exports['update']=function(_0x30cb35,_0x3eaa06){if(_0x30cb35[_0xac03('0x4b')]['id']){delete _0x30cb35[_0xac03('0x4b')]['id'];}return db[_0xac03('0x2b')]['find']({'where':{'id':_0x30cb35[_0xac03('0x47')]['id']}})[_0xac03('0x25')](handleEntityNotFound(_0x3eaa06,null))[_0xac03('0x25')](saveUpdates(_0x30cb35[_0xac03('0x4b')],null))['then'](respondWithResult(_0x3eaa06,null))['catch'](handleError(_0x3eaa06,null));};exports[_0xac03('0x26')]=function(_0x16619e,_0x15ab1f){return db[_0xac03('0x2b')]['find']({'where':{'id':_0x16619e[_0xac03('0x47')]['id']}})[_0xac03('0x25')](handleEntityNotFound(_0x15ab1f,null))[_0xac03('0x25')](removeEntity(_0x15ab1f,null))[_0xac03('0x49')](handleError(_0x15ab1f,null));};exports[_0xac03('0x4c')]=function(_0x171daf,_0x138e96){return db[_0xac03('0x2b')][_0xac03('0x4c')]()['then'](respondWithResult(_0x138e96,null))[_0xac03('0x49')](handleError(_0x138e96,null));};exports[_0xac03('0x4d')]=function(_0xcce198,_0x52e687,_0x3dc0c4){return db[_0xac03('0x4e')]['count']({'where':{'ChatGroupId':_0xcce198[_0xac03('0x47')]['id'],'ToId':_0xcce198['user']['id'],'read':![]}})[_0xac03('0x25')](function(_0x16ef80){return{'id':_[_0xac03('0x4f')](_0xcce198[_0xac03('0x47')]['id']),'count':_0x16ef80};})[_0xac03('0x25')](respondWithResult(_0x52e687,null))[_0xac03('0x49')](handleError(_0x52e687,null));};exports[_0xac03('0x50')]=function(_0x4b99d8,_0x37578c,_0xc6317c){return db['ChatGroup']['find']({'where':{'id':_0x4b99d8[_0xac03('0x47')]['id']}})[_0xac03('0x25')](handleEntityNotFound(_0x37578c,null))['then'](function(_0xc7a9c7){if(_0xc7a9c7){return _0xc7a9c7[_0xac03('0x50')](_0x4b99d8['body'][_0xac03('0x51')],_[_0xac03('0x52')](_0x4b99d8[_0xac03('0x4b')],['ids','id'])||{});}})[_0xac03('0x25')](respondWithResult(_0x37578c,null))['catch'](handleError(_0x37578c,null));};exports[_0xac03('0x53')]=function(_0x3ecf44,_0x42da7d,_0x4c5079){var _0x1b4658={};var _0x31a393={};var _0x38a313;var _0xadf808;return db[_0xac03('0x2b')][_0xac03('0x54')]({'where':{'id':_0x3ecf44['params']['id']}})[_0xac03('0x25')](handleEntityNotFound(_0x42da7d,null))[_0xac03('0x25')](function(_0xd307){if(_0xd307){_0x38a313=_0xd307;_0x31a393['model']=_[_0xac03('0x32')](db[_0xac03('0x55')][_0xac03('0x2c')]);_0x31a393[_0xac03('0x31')]=_[_0xac03('0x32')](_0x3ecf44[_0xac03('0x31')]);_0x31a393['filters']=_[_0xac03('0x34')](_0x31a393['model'],_0x31a393['query']);_0x1b4658[_0xac03('0x36')]=_[_0xac03('0x34')](_0x31a393[_0xac03('0x2f')],qs[_0xac03('0x35')](_0x3ecf44[_0xac03('0x31')][_0xac03('0x35')]));_0x1b4658[_0xac03('0x36')]=_0x1b4658[_0xac03('0x36')][_0xac03('0x37')]?_0x1b4658['attributes']:_0x31a393[_0xac03('0x2f')];_0x1b4658[_0xac03('0x3a')]=qs[_0xac03('0x3b')](_0x3ecf44[_0xac03('0x31')]['sort']);_0x1b4658['where']=qs[_0xac03('0x33')](_[_0xac03('0x3d')](_0x3ecf44['query'],_0x31a393[_0xac03('0x33')]));if(_0x3ecf44[_0xac03('0x31')][_0xac03('0x3e')]){_0x1b4658['where']=_['merge'](_0x1b4658[_0xac03('0x3c')],{'$or':_[_0xac03('0x30')](_0x1b4658[_0xac03('0x36')],function(_0x518a4c){var _0x22157c={};_0x22157c[_0x518a4c]={'$like':'%'+_0x3ecf44[_0xac03('0x31')]['filter']+'%'};return _0x22157c;})});}_0x1b4658=_[_0xac03('0x3f')]({},_0x1b4658,_0x3ecf44['options']);return _0x38a313['getMembers'](_0x1b4658);}})[_0xac03('0x25')](function(_0x3087a8){if(_0x3087a8){_0xadf808=_0x3087a8['length'];if(!_0x3ecf44[_0xac03('0x31')][_0xac03('0x38')](_0xac03('0x39'))){_0x1b4658[_0xac03('0x21')]=qs[_0xac03('0x21')](_0x3ecf44[_0xac03('0x31')][_0xac03('0x21')]);_0x1b4658[_0xac03('0x1e')]=qs[_0xac03('0x1e')](_0x3ecf44[_0xac03('0x31')][_0xac03('0x1e')]);}return _0x38a313[_0xac03('0x53')](_0x1b4658);}})[_0xac03('0x25')](function(_0xf8291a){if(_0xf8291a){return _0xf8291a?{'count':_0xadf808,'rows':_0xf8291a}:null;}})[_0xac03('0x25')](respondWithResult(_0x42da7d,null))[_0xac03('0x49')](handleError(_0x42da7d,null));};exports['removeMembers']=function(_0x458598,_0x3b8047,_0x50bfd2){return db[_0xac03('0x2b')][_0xac03('0x48')]({'where':{'id':_0x458598['params']['id']}})[_0xac03('0x25')](handleEntityNotFound(_0x3b8047,null))[_0xac03('0x25')](function(_0x554eed){if(_0x554eed){return _0x554eed['removeMembers'](_0x458598['query'][_0xac03('0x51')]);}})[_0xac03('0x25')](respondWithStatusCode(_0x3b8047,null))[_0xac03('0x49')](handleError(_0x3b8047,null));};exports[_0xac03('0x56')]=function(_0x376bc1,_0x4c55e5,_0x45b77b){if(_0x376bc1[_0xac03('0x4b')]['id']){delete _0x376bc1[_0xac03('0x4b')]['id'];}return db['ChatGroup'][_0xac03('0x48')]({'where':{'id':_0x376bc1[_0xac03('0x47')]['id']}})[_0xac03('0x25')](handleEntityNotFound(_0x4c55e5,null))[_0xac03('0x25')](function(_0x46c4a6){if(_0x46c4a6){_0x376bc1['body'][_0xac03('0x57')]=_0x46c4a6['id'];return db[_0xac03('0x4e')][_0xac03('0x4a')](_0x376bc1['body']);}})[_0xac03('0x25')](respondWithResult(_0x4c55e5,null))[_0xac03('0x49')](handleError(_0x4c55e5,null));};exports[_0xac03('0x58')]=function(_0x5b4044,_0x5159a8,_0x15f5bd){var _0x57b436={};var _0x186055={};var _0xb4cabd;var _0x3e0a00;return db[_0xac03('0x2b')][_0xac03('0x54')]({'where':{'id':_0x5b4044[_0xac03('0x47')]['id']}})[_0xac03('0x25')](handleEntityNotFound(_0x5159a8,null))['then'](function(_0x5af065){if(_0x5af065){_0xb4cabd=_0x5af065;_0x186055['model']=_[_0xac03('0x32')](db[_0xac03('0x4e')][_0xac03('0x2c')]);_0x186055[_0xac03('0x31')]=_[_0xac03('0x32')](_0x5b4044[_0xac03('0x31')]);_0x186055['filters']=_[_0xac03('0x34')](_0x186055['model'],_0x186055[_0xac03('0x31')]);_0x57b436[_0xac03('0x36')]=_[_0xac03('0x34')](_0x186055[_0xac03('0x2f')],qs[_0xac03('0x35')](_0x5b4044['query'][_0xac03('0x35')]));_0x57b436['attributes']=_0x57b436[_0xac03('0x36')]['length']?_0x57b436[_0xac03('0x36')]:_0x186055[_0xac03('0x2f')];_0x57b436[_0xac03('0x3a')]=qs[_0xac03('0x3b')](_0x5b4044['query'][_0xac03('0x3b')]);_0x57b436['where']=qs[_0xac03('0x33')](_[_0xac03('0x3d')](_0x5b4044[_0xac03('0x31')],_0x186055[_0xac03('0x33')]));if(_0x5b4044[_0xac03('0x31')]['filter']){_0x57b436['where']=_[_0xac03('0x3f')](_0x57b436[_0xac03('0x3c')],{'$or':_[_0xac03('0x30')](_0x57b436['attributes'],function(_0xcee190){var _0x48a563={};_0x48a563[_0xcee190]={'$like':'%'+_0x5b4044[_0xac03('0x31')]['filter']+'%'};return _0x48a563;})});}if(_0x5b4044[_0xac03('0x31')]['$gte']){var _0x307d95=_0x5b4044[_0xac03('0x31')][_0xac03('0x59')]['split'](',');var _0x61eff7={};_0x61eff7[_0x307d95[0x0]]={'$gte':moment(_0x307d95[0x1])[_0xac03('0x5a')](_0xac03('0x5b'))};_0x57b436[_0xac03('0x3c')]=_[_0xac03('0x3f')](_0x57b436[_0xac03('0x3c')],_0x61eff7);}_0x57b436=_[_0xac03('0x3f')]({},_0x57b436,_0x5b4044[_0xac03('0x41')]);return _0xb4cabd['getMessages'](_0x57b436);}})[_0xac03('0x25')](function(_0x52a754){if(_0x52a754){_0x3e0a00=_0x52a754['length'];if(!_0x5b4044['query'][_0xac03('0x38')]('nolimit')){_0x57b436['limit']=qs[_0xac03('0x21')](_0x5b4044[_0xac03('0x31')][_0xac03('0x21')]);_0x57b436['offset']=qs[_0xac03('0x1e')](_0x5b4044[_0xac03('0x31')]['offset']);}return _0xb4cabd[_0xac03('0x58')](_0x57b436);}})[_0xac03('0x25')](function(_0x292165){if(_0x292165){return _0x292165?{'count':_0x3e0a00,'rows':_0x292165}:null;}})[_0xac03('0x25')](respondWithResult(_0x5159a8,null))[_0xac03('0x49')](handleError(_0x5159a8,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 6f653d2..9005e83 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 _0x7cd3=['events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x7cd3,0x181));var _0x37cd=function(_0x40a8bd,_0x580bfd){_0x40a8bd=_0x40a8bd-0x0;var _0x91a68a=_0x7cd3[_0x40a8bd];return _0x91a68a;};'use strict';var EventEmitter=require(_0x37cd('0x0'));var ChatGroup=require(_0x37cd('0x1'))['db'][_0x37cd('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x37cd('0x3')](0x0);var events={'afterCreate':_0x37cd('0x4'),'afterUpdate':_0x37cd('0x5'),'afterDestroy':_0x37cd('0x6')};function emitEvent(_0x130fa1){return function(_0x495b3d,_0x22dcb0,_0x6d77b2){ChatGroupEvents[_0x37cd('0x7')](_0x130fa1+':'+_0x495b3d['id'],_0x495b3d);ChatGroupEvents[_0x37cd('0x7')](_0x130fa1,_0x495b3d);_0x6d77b2(null);};}for(var e in events){if(events[_0x37cd('0x8')](e)){var event=events[e];ChatGroup[_0x37cd('0x9')](e,emitEvent(event));}}module[_0x37cd('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x3f35=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x3f35,0x1ae));var _0x53f3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3f35[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require(_0x53f3('0x0'));var ChatGroup=require(_0x53f3('0x1'))['db'][_0x53f3('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x53f3('0x3')](0x0);var events={'afterCreate':_0x53f3('0x4'),'afterUpdate':_0x53f3('0x5'),'afterDestroy':_0x53f3('0x6')};function emitEvent(_0x58c9c6){return function(_0x118090,_0x5e8cc8,_0xc0bfc9){ChatGroupEvents['emit'](_0x58c9c6+':'+_0x118090['id'],_0x118090);ChatGroupEvents[_0x53f3('0x7')](_0x58c9c6,_0x118090);_0xc0bfc9(null);};}for(var e in events){if(events[_0x53f3('0x8')](e)){var event=events[e];ChatGroup[_0x53f3('0x9')](e,emitEvent(event));}}module[_0x53f3('0xa')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index e542a6d..d9780d5 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 _0x8e3d=['define','chat_groups','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x28a883,_0x34a99b){var _0x3afd5c=function(_0x28f0ba){while(--_0x28f0ba){_0x28a883['push'](_0x28a883['shift']());}};_0x3afd5c(++_0x34a99b);}(_0x8e3d,0x1f1));var _0xd8e3=function(_0x3fe2c6,_0xe0af43){_0x3fe2c6=_0x3fe2c6-0x0;var _0x3740ec=_0x8e3d[_0x3fe2c6];return _0x3740ec;};'use strict';var _=require(_0xd8e3('0x0'));var util=require(_0xd8e3('0x1'));var logger=require(_0xd8e3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd8e3('0x3'));var fs=require('fs');var path=require(_0xd8e3('0x4'));var rimraf=require(_0xd8e3('0x5'));var config=require(_0xd8e3('0x6'));var attributes=require(_0xd8e3('0x7'));module[_0xd8e3('0x8')]=function(_0x4026c3,_0x5d7f56){return _0x4026c3[_0xd8e3('0x9')]('ChatGroup',attributes,{'tableName':_0xd8e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d35=['./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d35,0x170));var _0x56d3=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x6d35[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x56d3('0x0'));var util=require(_0x56d3('0x1'));var logger=require(_0x56d3('0x2'))(_0x56d3('0x3'));var moment=require(_0x56d3('0x4'));var BPromise=require(_0x56d3('0x5'));var rp=require(_0x56d3('0x6'));var fs=require('fs');var path=require(_0x56d3('0x7'));var rimraf=require(_0x56d3('0x8'));var config=require('../../config/environment');var attributes=require(_0x56d3('0x9'));module[_0x56d3('0xa')]=function(_0xf174e4,_0xde58bc){return _0xf174e4[_0x56d3('0xb')]('ChatGroup',attributes,{'tableName':_0x56d3('0xc'),'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 6da046d..35e6cb1 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 _0x5075=['request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','register'];(function(_0x3771f7,_0xe7929b){var _0x58b25e=function(_0x13dfd7){while(--_0x13dfd7){_0x3771f7['push'](_0x3771f7['shift']());}};_0x58b25e(++_0xe7929b);}(_0x5075,0x73));var _0x5507=function(_0x484bf4,_0x2b975c){_0x484bf4=_0x484bf4-0x0;var _0x31c683=_0x5075[_0x484bf4];return _0x31c683;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var moment=require(_0x5507('0x2'));var BPromise=require(_0x5507('0x3'));var rs=require(_0x5507('0x4'));var fs=require('fs');var Redis=require(_0x5507('0x5'));var db=require(_0x5507('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5507('0x7'))(_0x5507('0x8'));var config=require(_0x5507('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5507('0xa')]({'port':0x232a});config[_0x5507('0xb')]=_['defaults'](config[_0x5507('0xb')],{'host':_0x5507('0xc'),'port':0x18eb});var socket=require(_0x5507('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x5507('0xe')](socket);function respondWithRpcPromise(_0x441bdc,_0xbbb0fc,_0x36c9eb){return new BPromise(function(_0x50d6f5,_0x29be85){return client[_0x5507('0xf')](_0x441bdc,_0x36c9eb)['then'](function(_0x18601c){logger[_0x5507('0x10')]('ChatGroup,\x20%s,\x20%s',_0xbbb0fc,_0x5507('0x11'));logger[_0x5507('0x12')](_0x5507('0x13'),_0xbbb0fc,_0x5507('0x11'),JSON[_0x5507('0x14')](_0x18601c));if(_0x18601c[_0x5507('0x15')]){if(_0x18601c['error'][_0x5507('0x16')]===0x1f4){logger[_0x5507('0x15')](_0x5507('0x17'),_0xbbb0fc,_0x18601c[_0x5507('0x15')]['message']);return _0x29be85(_0x18601c[_0x5507('0x15')][_0x5507('0x18')]);}logger[_0x5507('0x15')](_0x5507('0x17'),_0xbbb0fc,_0x18601c[_0x5507('0x15')][_0x5507('0x18')]);return _0x50d6f5(_0x18601c[_0x5507('0x15')][_0x5507('0x18')]);}else{logger[_0x5507('0x10')](_0x5507('0x17'),_0xbbb0fc,_0x5507('0x11'));_0x50d6f5(_0x18601c[_0x5507('0x19')][_0x5507('0x18')]);}})['catch'](function(_0x14dab0){logger[_0x5507('0x15')](_0x5507('0x17'),_0xbbb0fc,_0x14dab0);_0x29be85(_0x14dab0);});});}
\ No newline at end of file
+var _0x075e=['stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5de949,_0x4f5a1f){var _0x2836b1=function(_0x187fa9){while(--_0x187fa9){_0x5de949['push'](_0x5de949['shift']());}};_0x2836b1(++_0x4f5a1f);}(_0x075e,0x92));var _0xe075=function(_0x538595,_0x324abe){_0x538595=_0x538595-0x0;var _0x2b05d8=_0x075e[_0x538595];return _0x2b05d8;};'use strict';var _=require('lodash');var util=require(_0xe075('0x0'));var moment=require(_0xe075('0x1'));var BPromise=require(_0xe075('0x2'));var rs=require(_0xe075('0x3'));var fs=require('fs');var Redis=require(_0xe075('0x4'));var db=require(_0xe075('0x5'))['db'];var utils=require(_0xe075('0x6'));var logger=require(_0xe075('0x7'))('rpc');var config=require(_0xe075('0x8'));var jayson=require(_0xe075('0x9'));var client=jayson['client'][_0xe075('0xa')]({'port':0x232a});config[_0xe075('0xb')]=_[_0xe075('0xc')](config[_0xe075('0xb')],{'host':_0xe075('0xd'),'port':0x18eb});var socket=require(_0xe075('0xe'))(new Redis(config['redis']));require(_0xe075('0xf'))[_0xe075('0x10')](socket);function respondWithRpcPromise(_0x5814a8,_0x236891,_0x3c7412){return new BPromise(function(_0x4f978b,_0x3f127d){return client[_0xe075('0x11')](_0x5814a8,_0x3c7412)[_0xe075('0x12')](function(_0x1836d1){logger[_0xe075('0x13')]('ChatGroup,\x20%s,\x20%s',_0x236891,'request\x20sent');logger['debug'](_0xe075('0x14'),_0x236891,_0xe075('0x15'),JSON[_0xe075('0x16')](_0x1836d1));if(_0x1836d1[_0xe075('0x17')]){if(_0x1836d1['error'][_0xe075('0x18')]===0x1f4){logger['error'](_0xe075('0x19'),_0x236891,_0x1836d1[_0xe075('0x17')][_0xe075('0x1a')]);return _0x3f127d(_0x1836d1[_0xe075('0x17')][_0xe075('0x1a')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x236891,_0x1836d1[_0xe075('0x17')][_0xe075('0x1a')]);return _0x4f978b(_0x1836d1[_0xe075('0x17')][_0xe075('0x1a')]);}else{logger[_0xe075('0x13')](_0xe075('0x19'),_0x236891,_0xe075('0x15'));_0x4f978b(_0x1836d1['result'][_0xe075('0x1a')]);}})[_0xe075('0x1b')](function(_0x2c3953){logger[_0xe075('0x17')]('ChatGroup,\x20%s,\x20%s',_0x236891,_0x2c3953);_0x3f127d(_0x2c3953);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 33a956a..1e028e2 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 _0xa6e6=['removeListener','register','length','chatGroup:','save','remove'];(function(_0x1e0791,_0x5d0255){var _0x57e691=function(_0x4c9bdf){while(--_0x4c9bdf){_0x1e0791['push'](_0x1e0791['shift']());}};_0x57e691(++_0x5d0255);}(_0xa6e6,0x178));var _0x6a6e=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0xa6e6[_0x1e172a];return _0x96338b;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x6a6e('0x0'),_0x6a6e('0x1'),'update'];function createListener(_0x173fce,_0x52725f){return function(_0x5ec51b){_0x52725f['emit'](_0x173fce,_0x5ec51b);};}function removeListener(_0xbb98bb,_0x27c1ad){return function(){ChatGroupEvents[_0x6a6e('0x2')](_0xbb98bb,_0x27c1ad);};}exports[_0x6a6e('0x3')]=function(_0x34de50){for(var _0x179f83=0x0,_0x5b6690=events[_0x6a6e('0x4')];_0x179f83<_0x5b6690;_0x179f83++){var _0x113106=events[_0x179f83];var _0x34bed1=createListener(_0x6a6e('0x5')+_0x113106,_0x34de50);ChatGroupEvents['on'](_0x113106,_0x34bed1);}};
\ No newline at end of file
+var _0xdf8a=['remove','update','removeListener','register','./chatGroup.events'];(function(_0x1693fc,_0x48b09d){var _0x5bf0e5=function(_0x350c15){while(--_0x350c15){_0x1693fc['push'](_0x1693fc['shift']());}};_0x5bf0e5(++_0x48b09d);}(_0xdf8a,0x1ad));var _0xadf8=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0xdf8a[_0x4bfcbe];return _0x5b65e6;};'use strict';var ChatGroupEvents=require(_0xadf8('0x0'));var events=['save',_0xadf8('0x1'),_0xadf8('0x2')];function createListener(_0x2dc6de,_0xd939f2){return function(_0x561a59){_0xd939f2['emit'](_0x2dc6de,_0x561a59);};}function removeListener(_0x134fcc,_0x58e936){return function(){ChatGroupEvents[_0xadf8('0x3')](_0x134fcc,_0x58e936);};}exports[_0xadf8('0x4')]=function(_0x5e3071){for(var _0xec66ff=0x0,_0x4d107f=events['length'];_0xec66ff<_0x4d107f;_0xec66ff++){var _0x181433=events[_0xec66ff];var _0x1d245f=createListener('chatGroup:'+_0x181433,_0x5e3071);ChatGroupEvents['on'](_0x181433,_0x1d245f);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 5e25a30..23070ab 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 _0xb81a=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','update','destroy','delete','removeMembers'];(function(_0x1894b3,_0x3442a3){var _0x55c05d=function(_0x308eea){while(--_0x308eea){_0x1894b3['push'](_0x1894b3['shift']());}};_0x55c05d(++_0x3442a3);}(_0xb81a,0x140));var _0xab81=function(_0xb4db3c,_0x158e33){_0xb4db3c=_0xb4db3c-0x0;var _0x500d97=_0xb81a[_0xb4db3c];return _0x500d97;};'use strict';var multer=require(_0xab81('0x0'));var util=require(_0xab81('0x1'));var path=require(_0xab81('0x2'));var timeout=require(_0xab81('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xab81('0x4'));var auth=require(_0xab81('0x5'));var interaction=require(_0xab81('0x6'));var config=require(_0xab81('0x7'));var controller=require('./chatGroup.controller');router[_0xab81('0x8')]('/',auth[_0xab81('0x9')](),controller[_0xab81('0xa')]);router[_0xab81('0x8')](_0xab81('0xb'),auth[_0xab81('0x9')](),controller[_0xab81('0xc')]);router[_0xab81('0x8')](_0xab81('0xd'),auth[_0xab81('0x9')](),controller[_0xab81('0xe')]);router[_0xab81('0x8')](_0xab81('0xf'),auth[_0xab81('0x9')](),controller[_0xab81('0x10')]);router['get'](_0xab81('0x11'),auth[_0xab81('0x9')](),controller[_0xab81('0x12')]);router[_0xab81('0x8')](_0xab81('0x13'),auth[_0xab81('0x9')](),controller[_0xab81('0x14')]);router[_0xab81('0x15')]('/',auth[_0xab81('0x9')](),controller['create']);router[_0xab81('0x15')](_0xab81('0x11'),auth['isAuthenticated'](),controller[_0xab81('0x16')]);router[_0xab81('0x15')](_0xab81('0x13'),auth[_0xab81('0x9')](),controller[_0xab81('0x17')]);router['put'](_0xab81('0xd'),auth[_0xab81('0x9')](),controller[_0xab81('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xab81('0x19')]);router[_0xab81('0x1a')]('/:id/members',auth['isAuthenticated'](),controller[_0xab81('0x1b')]);module[_0xab81('0x1c')]=router;
\ No newline at end of file
+var _0x0fa6=['/describe','describe','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','destroy','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x5166c0,_0x11c251){var _0xdce20f=function(_0x26bf74){while(--_0x26bf74){_0x5166c0['push'](_0x5166c0['shift']());}};_0xdce20f(++_0x11c251);}(_0x0fa6,0x18a));var _0x60fa=function(_0x2e0ec8,_0x27c06d){_0x2e0ec8=_0x2e0ec8-0x0;var _0x54f786=_0x0fa6[_0x2e0ec8];return _0x54f786;};'use strict';var multer=require(_0x60fa('0x0'));var util=require('util');var path=require(_0x60fa('0x1'));var timeout=require(_0x60fa('0x2'));var express=require(_0x60fa('0x3'));var router=express[_0x60fa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x60fa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x60fa('0x6'));var controller=require(_0x60fa('0x7'));router[_0x60fa('0x8')]('/',auth[_0x60fa('0x9')](),controller[_0x60fa('0xa')]);router[_0x60fa('0x8')](_0x60fa('0xb'),auth[_0x60fa('0x9')](),controller[_0x60fa('0xc')]);router[_0x60fa('0x8')]('/:id',auth[_0x60fa('0x9')](),controller['show']);router[_0x60fa('0x8')](_0x60fa('0xd'),auth[_0x60fa('0x9')](),controller[_0x60fa('0xe')]);router['get'](_0x60fa('0xf'),auth[_0x60fa('0x9')](),controller[_0x60fa('0x10')]);router[_0x60fa('0x8')](_0x60fa('0x11'),auth['isAuthenticated'](),controller[_0x60fa('0x12')]);router['post']('/',auth[_0x60fa('0x9')](),controller['create']);router[_0x60fa('0x13')](_0x60fa('0xf'),auth[_0x60fa('0x9')](),controller[_0x60fa('0x14')]);router[_0x60fa('0x13')]('/:id/messages',auth[_0x60fa('0x9')](),controller[_0x60fa('0x15')]);router[_0x60fa('0x16')](_0x60fa('0x17'),auth[_0x60fa('0x9')](),controller['update']);router['delete'](_0x60fa('0x17'),auth['isAuthenticated'](),controller[_0x60fa('0x18')]);router[_0x60fa('0x19')]('/:id/members',auth[_0x60fa('0x9')](),controller['removeMembers']);module[_0x60fa('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 3aec8c2..93fe7d0 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 _0x93e6=['INTEGER','star','TEXT','DATE','STRING','out','sequelize'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x93e6,0x11e));var _0x693e=function(_0x3b375e,_0x565734){_0x3b375e=_0x3b375e-0x0;var _0x55419f=_0x93e6[_0x3b375e];return _0x55419f;};'use strict';var Sequelize=require(_0x693e('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x693e('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0x693e('0x2'),'thumb'),'defaultValue':_0x693e('0x2')},'ratingMessage':{'type':Sequelize[_0x693e('0x3')]},'pathTranscript':{'type':Sequelize[_0x693e('0x3')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x693e('0x4')]},'disposition':{'type':Sequelize[_0x693e('0x5')]},'secondDisposition':{'type':Sequelize[_0x693e('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x693e('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x693e('0x5')]},'deviceModel':{'type':Sequelize[_0x693e('0x5')]},'deviceVendor':{'type':Sequelize[_0x693e('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x693e('0x3')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x693e('0x3')]('long')},'read1stAt':{'type':Sequelize[_0x693e('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x693e('0x6')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x693e('0x5')]},'customerPort':{'type':Sequelize[_0x693e('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x693e('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb248=['INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN'];(function(_0x4bc0f7,_0x329c69){var _0x1fa851=function(_0x53173d){while(--_0x53173d){_0x4bc0f7['push'](_0x4bc0f7['shift']());}};_0x1fa851(++_0x329c69);}(_0xb248,0xc6));var _0x8b24=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb248[_0x1694f5];return _0x5b4321;};'use strict';var Sequelize=require(_0x8b24('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8b24('0x2')]},'ratingType':{'type':Sequelize[_0x8b24('0x3')](_0x8b24('0x4'),'thumb'),'defaultValue':_0x8b24('0x4')},'ratingMessage':{'type':Sequelize[_0x8b24('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x8b24('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8b24('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8b24('0x6')]},'thirdDisposition':{'type':Sequelize[_0x8b24('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x8b24('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8b24('0x6')]},'osVersion':{'type':Sequelize[_0x8b24('0x6')]},'deviceModel':{'type':Sequelize[_0x8b24('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x8b24('0x6')]},'referer':{'type':Sequelize[_0x8b24('0x5')]},'customerIp':{'type':Sequelize[_0x8b24('0x6')]},'formData':{'type':Sequelize[_0x8b24('0x5')](_0x8b24('0x8'))},'read1stAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8b24('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8b24('0x3')]('in',_0x8b24('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8b24('0x6')]},'customerPort':{'type':Sequelize[_0x8b24('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x8b24('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x8b24('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 9290133..7f2e669 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 _0x0abf=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','user_has_chat_interactions','users','chat_interactions','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','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','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','params','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','download','mailTranscript','format','transcript-%s.txt','now','User','CmContact','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','reject','update','destroy','end','stack','name','render','merge','body','contact','agent','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model'];(function(_0x537f79,_0x139d0d){var _0x56c812=function(_0x4ae9ef){while(--_0x4ae9ef){_0x537f79['push'](_0x537f79['shift']());}};_0x56c812(++_0x139d0d);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0abf[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf0ab('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0ab('0x12'))(_0xf0ab('0x13'));var utils=require(_0xf0ab('0x14'));var config=require(_0xf0ab('0x15'));var licenseUtil=require(_0xf0ab('0x16'));var db=require(_0xf0ab('0x17'))['db'];config[_0xf0ab('0x18')]=_['defaults'](config[_0xf0ab('0x18')],{'host':_0xf0ab('0x19'),'port':0x18eb});var socket=require(_0xf0ab('0x1a'))(new Redis(config[_0xf0ab('0x18')]));require(_0xf0ab('0x1b'))[_0xf0ab('0x1c')](socket);var jayson=require(_0xf0ab('0x1d'));var client=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232b});var client9004=jayson[_0xf0ab('0x1e')][_0xf0ab('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x221bac,_0x200cf5,_0x2f4618,_0x230f40){return new BPromise(function(_0x54b0ce,_0x457465){var _0x9e3b47=_0x230f40||client;return _0x9e3b47[_0xf0ab('0x20')](_0x221bac,_0x2f4618)[_0xf0ab('0x21')](function(_0x776619){logger[_0xf0ab('0x22')](_0xf0ab('0x23'),_0x200cf5,_0xf0ab('0x24'));logger[_0xf0ab('0x25')](_0xf0ab('0x26'),_0x200cf5,_0xf0ab('0x24'),JSON[_0xf0ab('0x27')](_0x776619));if(_0x776619[_0xf0ab('0x28')]){if(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x29')]===0x1f4){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x457465(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}logger[_0xf0ab('0x28')](_0xf0ab('0x23'),_0x200cf5,_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);return _0x54b0ce(_0x776619[_0xf0ab('0x28')][_0xf0ab('0x2a')]);}else{logger[_0xf0ab('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,'request\x20sent');_0x54b0ce(_0x776619['result'][_0xf0ab('0x2a')]);}})['catch'](function(_0x3eca32){logger[_0xf0ab('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x200cf5,_0x3eca32);_0x457465(_0x3eca32);});});}function respondWithStatusCode(_0x163078,_0x22671e){_0x22671e=_0x22671e||0xcc;return function(_0x10bf5f){if(_0x10bf5f){return _0x163078[_0xf0ab('0x2b')](_0x22671e);}return _0x163078[_0xf0ab('0x2c')](_0x22671e)['end']();};}function respondWithResult(_0x2d0da7,_0x574ce7){_0x574ce7=_0x574ce7||0xc8;return function(_0x55d799){if(_0x55d799){return _0x2d0da7[_0xf0ab('0x2c')](_0x574ce7)[_0xf0ab('0x2d')](_0x55d799);}};}function respondWithFilteredResult(_0x1b223d,_0x445160){return function(_0x43476c){if(_0x43476c){var _0x174052=typeof _0x445160[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&typeof _0x445160[_0xf0ab('0x30')]===_0xf0ab('0x2f');var _0x21e8ac=_0x43476c[_0xf0ab('0x31')];var _0x58cbe1=_0x174052?0x0:_0x445160[_0xf0ab('0x2e')];var _0x35973a=_0x174052?_0x43476c['count']:_0x445160['offset']+_0x445160[_0xf0ab('0x30')];var _0x1dc84e;if(_0x35973a>=_0x21e8ac){_0x35973a=_0x21e8ac;_0x1dc84e=0xc8;}else{_0x1dc84e=0xce;}_0x1b223d[_0xf0ab('0x2c')](_0x1dc84e);return _0x1b223d['set']('Content-Range',_0x58cbe1+'-'+_0x35973a+'/'+_0x21e8ac)[_0xf0ab('0x2d')](_0x43476c);}return null;};}function patchUpdates(_0x58fa03){return function(_0x1cfd52){try{jsonpatch['apply'](_0x1cfd52,_0x58fa03,!![]);}catch(_0x3f66fa){return BPromise[_0xf0ab('0x32')](_0x3f66fa);}return _0x1cfd52['save']();};}function saveUpdates(_0x56e728,_0x469f42){return function(_0x27c6f9){if(_0x27c6f9){return _0x27c6f9[_0xf0ab('0x33')](_0x56e728)[_0xf0ab('0x21')](function(_0x2519c7){return _0x2519c7;});}return null;};}function removeEntity(_0x36195d,_0x17f3b3){return function(_0xf8f0f4){if(_0xf8f0f4){return _0xf8f0f4[_0xf0ab('0x34')]()[_0xf0ab('0x21')](function(){_0x36195d[_0xf0ab('0x2c')](0xcc)[_0xf0ab('0x35')]();});}};}function handleEntityNotFound(_0x22dcfe,_0x437fdb){return function(_0x5d8443){if(!_0x5d8443){_0x22dcfe[_0xf0ab('0x2b')](0x194);}return _0x5d8443;};}function handleError(_0x45c449,_0xc575ed){_0xc575ed=_0xc575ed||0x1f4;return function(_0x5c9192){logger[_0xf0ab('0x28')](_0x5c9192[_0xf0ab('0x36')]);if(_0x5c9192[_0xf0ab('0x37')]){delete _0x5c9192['name'];}_0x45c449[_0xf0ab('0x2c')](_0xc575ed)['send'](_0x5c9192);};}function getMustacheRender(_0xda3971,_0x492d7c){return Mustache[_0xf0ab('0x38')](_0xda3971,_[_0xf0ab('0x39')](_0x492d7c[_0xf0ab('0x3a')],{'contact':_0x492d7c[_0xf0ab('0x3b')],'message':_0x492d7c[_0xf0ab('0x2a')],'agent':_0x492d7c[_0xf0ab('0x3c')],'interaction':_0x492d7c['interaction'],'account':_0x492d7c[_0xf0ab('0x3d')]}))||'';}function getInteractionUsers(_0x683d08,_0x5a6df5){return new BPromise(function(_0x207fbb,_0xce89bc){try{if(_0x5a6df5[_0x683d08['id']]){_0x683d08[_0xf0ab('0x3e')]=_[_0xf0ab('0x3f')](_0x5a6df5[_0x683d08['id']],function(_0x31fa72){return{'id':_0x31fa72['id'],'fullname':_0x31fa72[_0xf0ab('0x40')]};});}}catch(_0x28c20c){_0xce89bc(_0x28c20c);}_0x207fbb(_0x683d08);});}function getInteractionTags(_0x528d4b,_0x406a1d){return new BPromise(function(_0x4f6e93,_0x7c4629){try{if(_0x528d4b['TagIds']){_0x528d4b[_0xf0ab('0x41')]=[];_0x528d4b[_0xf0ab('0x42')][_0xf0ab('0x43')](',')[_0xf0ab('0x44')](function(_0x2b7ed5){_0x528d4b['Tags'][_0xf0ab('0x45')](_0x406a1d[_0x2b7ed5]);});}delete _0x528d4b[_0xf0ab('0x42')];}catch(_0x28e7a4){_0x7c4629(_0x28e7a4);}_0x4f6e93(_0x528d4b);});}function updateChatInteraction(_0x197955,_0x191caf,_0x17a73){return new BPromise(function(_0x45849c,_0x413f5c){return getInteractionUsers(_0x197955,_0x17a73)[_0xf0ab('0x21')](function(_0x3b214a){return getInteractionTags(_0x3b214a,_0x191caf);})[_0xf0ab('0x21')](function(_0x32ec93){_0x45849c(_0x32ec93);})[_0xf0ab('0x46')](function(_0x5e6b6b){_0x413f5c(_0x5e6b6b);});});}exports['index']=function(_0x2fc677,_0x4e6c41){var _0x1fc766={},_0x2d50c0={},_0x4bbdf6={'count':0x0,'rows':[]};var _0x8c2d2c=_[_0xf0ab('0x3f')](db['ChatInteraction'][_0xf0ab('0x47')],function(_0x29cc6a){return{'name':_0x29cc6a[_0xf0ab('0x48')],'type':_0x29cc6a[_0xf0ab('0x49')][_0xf0ab('0x4a')]};});_0x2d50c0[_0xf0ab('0x4b')]=_[_0xf0ab('0x3f')](_0x8c2d2c,_0xf0ab('0x37'));_0x2d50c0[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x2fc677[_0xf0ab('0x4c')]);_0x2d50c0[_0xf0ab('0x4e')]=_[_0xf0ab('0x4f')](_0x2d50c0[_0xf0ab('0x4b')],_0x2d50c0['query']);_0x1fc766['attributes']=_[_0xf0ab('0x4f')](_0x2d50c0['model'],qs['fields'](_0x2fc677['query'][_0xf0ab('0x50')]));_0x1fc766[_0xf0ab('0x51')]=_0x1fc766[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x1fc766[_0xf0ab('0x51')]:_0x2d50c0[_0xf0ab('0x4b')];if(!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x1fc766[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x2fc677[_0xf0ab('0x4c')]['limit']);_0x1fc766[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x1fc766[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x1fc766['where']=qs['filters'](_['pick'](_0x2fc677[_0xf0ab('0x4c')],_0x2d50c0[_0xf0ab('0x4e')]),_0x8c2d2c);var _0x577c85=[];var _0xa1a416=squel[_0xf0ab('0x57')]()['field']('id')[_0xf0ab('0x58')](_0xf0ab('0x37'))[_0xf0ab('0x58')](_0xf0ab('0x59'))[_0xf0ab('0x5a')](_0xf0ab('0x5b'));var _0x26508b=squel['select']()[_0xf0ab('0x58')]('u.id')[_0xf0ab('0x58')]('u.fullname')[_0xf0ab('0x58')]('ui.ChatInteractionId')['from'](_0xf0ab('0x5c'),'ui')['left_join'](_0xf0ab('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x2eff07=squel['select']()[_0xf0ab('0x5a')](_0xf0ab('0x5e'),'i')[_0xf0ab('0x5f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xf0ab('0x5d'),'o',_0xf0ab('0x60'))['left_join']('chat_websites','a',_0xf0ab('0x61'))[_0xf0ab('0x5f')](_0xf0ab('0x62'),'me',_0xf0ab('0x63'))[_0xf0ab('0x5f')](_0xf0ab('0x64'),'it',_0xf0ab('0x65'))[_0xf0ab('0x5f')](_0xf0ab('0x5b'),'t',_0xf0ab('0x66'));var _0x1e6a4e=squel['expr']();var _0x41ed17=[];var _0x5b24e3=squel[_0xf0ab('0x67')]();var _0x61d3db;if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]){_0x61d3db=as[_0xf0ab('0x69')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x68')]);var _0x1f11aa=_0x61d3db[_0xf0ab('0x6a')];for(var _0x180ee6=0x0;_0x180ee6<_0x61d3db['conditions'][_0xf0ab('0x52')];_0x180ee6++){var _0x2266f3=_0x61d3db[_0xf0ab('0x6b')][_0x180ee6];var _0x1d4a72='i';var _0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0x2266f3[_0xf0ab('0x58')]]);if(!_0x2232eb){switch(_0x2266f3[_0xf0ab('0x58')]){case'unreadMessages':if(_0x2266f3['value']==0x1){_0x2eff07[_0xf0ab('0x6d')]('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6e'));}else{_0x2eff07['having']('`'+_0x2266f3[_0xf0ab('0x58')]+_0xf0ab('0x6f'));}break;case _0xf0ab('0x70'):if(_0x2266f3['operator']===_0xf0ab('0x71')){if(_0x2266f3[_0xf0ab('0x72')][_0xf0ab('0x43')]('\x20')[_0xf0ab('0x52')]>0x1){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x73'),qs['getFullTextValue'](_0x2266f3[_0xf0ab('0x72')]),null);}else{var _0x70b02d='%'+_0x2266f3[_0xf0ab('0x72')]+'%';_0x1e6a4e[_0x1f11aa](_0xf0ab('0x74'),_0x70b02d,_0x70b02d,_0x70b02d);}}else{_0x2232eb=_[_0xf0ab('0x6c')](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x75')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x75');_0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')]['start'],_0x5154f5['value'][_0xf0ab('0x35')]);}break;case _0xf0ab('0x78'):var _0x325ad6=_0x2266f3['value'][_0xf0ab('0x43')](',')['map'](function(_0x1a32dc){return Number(_0x1a32dc);});_0x325ad6[_0xf0ab('0x44')](function(_0x1787e2){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1787e2+',%');});_0x41ed17=_[_0xf0ab('0x79')](_0x41ed17,_0x325ad6);break;case'User':if(_0x2266f3['operator']===_0xf0ab('0x71')){_0x1e6a4e[_0x1f11aa](_0xf0ab('0x7a'),'%'+_0x2266f3[_0xf0ab('0x72')]+'%',null);}else{_0x2232eb=_['find'](_0x8c2d2c,[_0xf0ab('0x37'),_0xf0ab('0x7b')]);_0x2266f3[_0xf0ab('0x58')]=_0xf0ab('0x7b');_0x5154f5=as['buildExpression'](_0x1d4a72,_0x2232eb['type'],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5['text'],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}break;case _0xf0ab('0x3a'):_0x5154f5=as[_0xf0ab('0x76')]('me',null,_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);break;}}else{var _0x5154f5=as[_0xf0ab('0x76')](_0x1d4a72,_0x2232eb[_0xf0ab('0x49')],_0x2266f3);_0x1e6a4e[_0x1f11aa](_0x5154f5[_0xf0ab('0x77')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x7c')],_0x5154f5[_0xf0ab('0x72')][_0xf0ab('0x35')]);}}}else{var _0x42f067=_(_0x2fc677['query'])[_0xf0ab('0x4d')]()[_0xf0ab('0x3f')](function(_0x4c8e95){return _['some'](_0x8c2d2c,['name',_0x4c8e95])?_0x4c8e95:undefined;})[_0xf0ab('0x7d')]()[_0xf0ab('0x72')]();if(!_[_0xf0ab('0x7e')](_0x42f067)){_0x42f067[_0xf0ab('0x44')](function(_0x15aa78){if(_0x15aa78===_0xf0ab('0x7f')){_0x2eff07['where'](_0xf0ab('0x80'),[]['concat'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]));}else if(_0x15aa78==='createdAt'){var _0x2978a9=JSON['parse'](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])['$gte'];var _0x58ca28=JSON[_0xf0ab('0x81')](_0x2fc677[_0xf0ab('0x4c')][_0x15aa78])[_0xf0ab('0x82')];_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x84'),_0x2978a9,_0x58ca28);}else{if(_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]===_0xf0ab('0x85')){_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x86'));}else{_0x2eff07[_0xf0ab('0x83')]('i.'+_0x15aa78+_0xf0ab('0x87'),_0x2fc677[_0xf0ab('0x4c')][_0x15aa78]);}}});}if(_0x2fc677[_0xf0ab('0x4c')]['read']){if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x88')]==0x1){_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x89'));}else{_0x2eff07[_0xf0ab('0x6d')](_0xf0ab('0x8a'));}}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]){_0x41ed17=_[_0xf0ab('0x8c')](_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')])?_0x2fc677[_0xf0ab('0x4c')]['tag']:new Array(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8b')]);_0x41ed17[_0xf0ab('0x44')](function(_0x2196a7){_0x5b24e3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2196a7+',%');});}if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]){var _0x4463cc=_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x8d')]['replace']('\x5c','\x5c\x5c')[_0xf0ab('0x8e')](/'/g,'\x27\x27');if(qs[_0xf0ab('0x8f')](_0x4463cc)){_0x1e6a4e['or']('i.id\x20LIKE\x20?',_0x4463cc+'%');}else{_0x1e6a4e['or'](_0xf0ab('0x90'),qs['getFullTextValue'](_0x4463cc))['or'](_0xf0ab('0x91'),_0x4463cc+'%');}}}_0x2eff07[_0xf0ab('0x83')](_0x1e6a4e);_0x2eff07['group'](_0xf0ab('0x92'));var _0x148a72={'type':db['Sequelize']['QueryTypes'][_0xf0ab('0x93')],'raw':!![]};var _0x58140c=_0x2eff07[_0xf0ab('0x94')]();_0x58140c[_0xf0ab('0x58')]('i.id');_0x58140c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf0ab('0x95'));if(_0x1fc766[_0xf0ab('0x55')]){_0x1fc766[_0xf0ab('0x55')][_0xf0ab('0x44')](function(_0x49c89f){var _0x272f9c=_0x49c89f[0x0]===_0xf0ab('0x96')?_0x49c89f[0x0]:'i.'+_0x49c89f[0x0];_0x2eff07[_0xf0ab('0x55')](_0x272f9c,_0x49c89f[0x1]===_0xf0ab('0x97')?![]:!![]);});}if(!_[_0xf0ab('0x7e')](_0x41ed17)){_0x2eff07['having'](_0x5b24e3);_0x58140c['where'](_0xf0ab('0x98'),_0x41ed17);}BPromise[_0xf0ab('0x99')]()['then'](function(){if(!_0x61d3db){if(_0x2fc677['query'][_0xf0ab('0x7f')])return;_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x9a'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9a'));return;}if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]!==_0xf0ab('0x3c'))return;return _0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9d')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x21')](function(_0x52eca9){if(_['isEmpty'](_0x52eca9)){_0x58140c[_0xf0ab('0x83')]('i.ChatWebsiteId\x20IS\x20NULL');_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x9e'));}else{_0x58140c[_0xf0ab('0x83')](_0xf0ab('0x80'),_['map'](_0x52eca9,'id'));_0x2eff07[_0xf0ab('0x83')](_0xf0ab('0x80'),_[_0xf0ab('0x3f')](_0x52eca9,'id'));}});})[_0xf0ab('0x21')](function(){if(_0x2fc677[_0xf0ab('0x9b')][_0xf0ab('0x9c')]===_0xf0ab('0x3c')&&!_0x61d3db&&!_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x7f')])return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x58140c[_0xf0ab('0xa0')](),_0x148a72);})[_0xf0ab('0x21')](function(_0x4211a1){_0x4bbdf6['count']=_0x4211a1[_0xf0ab('0x52')];if(_0x4bbdf6[_0xf0ab('0x31')]===0x0)return[];return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0xa1a416[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x611cf7){_0x577c85=_['keyBy'](_0x611cf7,'id');_0x148a72=_['merge'](_0x148a72,{'model':db[_0xf0ab('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2fc677[_0xf0ab('0x4c')][_0xf0ab('0x50')]){_0x1fc766['attributes'][_0xf0ab('0x44')](function(_0x405b34){_0x2eff07[_0xf0ab('0x58')]('i.'+_0x405b34);});}else{_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa2'),'unreadMessages');_0x2eff07['field'](_0xf0ab('0xa3'),'Account.key');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa4'),'Account.mandatoryDisposition');_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa5'),_0xf0ab('0x96'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa6'));_0x2eff07['field'](_0xf0ab('0xa7'),_0xf0ab('0xa8'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xa9'),_0xf0ab('0xaa'));_0x2eff07['field'](_0xf0ab('0xab'),_0xf0ab('0xac'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xad'),_0xf0ab('0xae'));_0x2eff07['field'](_0xf0ab('0xaf'),_0xf0ab('0xb0'));_0x2eff07[_0xf0ab('0x58')]('c.fax',_0xf0ab('0xb1'));_0x2eff07['field'](_0xf0ab('0xb2'),_0xf0ab('0xb3'));_0x2eff07[_0xf0ab('0x58')](_0xf0ab('0xb4'),'Owner.internal');_0x2eff07[_0xf0ab('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1fc766[_0xf0ab('0x30')])_0x2eff07['limit'](_0x1fc766['limit']);if(_0x1fc766[_0xf0ab('0x2e')])_0x2eff07[_0xf0ab('0x2e')](_0x1fc766['offset']);return db['sequelize']['query'](_0x2eff07['toString'](),_0x148a72);})[_0xf0ab('0x21')](function(_0x12d9b6){if(_0x12d9b6[_0xf0ab('0x52')]>0x0)_0x26508b[_0xf0ab('0x83')](_0xf0ab('0xb5'),_['map'](_0x12d9b6,'id'));return db[_0xf0ab('0x9f')][_0xf0ab('0x4c')](_0x26508b[_0xf0ab('0xa0')](),_0x148a72)[_0xf0ab('0x21')](function(_0x84eab9){var _0x27cd98=_[_0xf0ab('0xb6')](_0x84eab9,'ChatInteractionId');var _0x16dca7=[];_0x12d9b6[_0xf0ab('0x44')](function(_0x39633a){_0x16dca7[_0xf0ab('0x45')](updateChatInteraction(_0x39633a,_0x577c85,_0x27cd98));});return BPromise[_0xf0ab('0xb7')](_0x16dca7);});});})[_0xf0ab('0x21')](function(_0x527a4b){_0x4bbdf6[_0xf0ab('0xb8')]=_0x527a4b;return _0x4bbdf6;})[_0xf0ab('0x21')](respondWithFilteredResult(_0x4e6c41,_0x1fc766))[_0xf0ab('0x46')](handleError(_0x4e6c41,null));};exports[_0xf0ab('0xb9')]=function(_0x4ca7a3,_0x426419){var _0x395bf6={'raw':![],'where':{'id':_0x4ca7a3['params']['id']}},_0x5b7744={};_0x5b7744[_0xf0ab('0x4b')]=_[_0xf0ab('0x4d')](db[_0xf0ab('0xa1')][_0xf0ab('0x47')]);_0x5b7744[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4ca7a3[_0xf0ab('0x4c')]);_0x5b7744[_0xf0ab('0x4e')]=_['intersection'](_0x5b7744[_0xf0ab('0x4b')],_0x5b7744['query']);_0x395bf6['attributes']=_[_0xf0ab('0x4f')](_0x5b7744[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x395bf6[_0xf0ab('0x51')]=_0x395bf6[_0xf0ab('0x51')][_0xf0ab('0x52')]?_0x395bf6['attributes']:_0x5b7744[_0xf0ab('0x4b')];if(_0x4ca7a3[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x395bf6[_0xf0ab('0xbb')]=[{'all':!![]}];}_0x395bf6=_[_0xf0ab('0x39')]({},_0x395bf6,_0x4ca7a3[_0xf0ab('0xbc')]);return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')](_0x395bf6)[_0xf0ab('0x21')](handleEntityNotFound(_0x426419,null))[_0xf0ab('0x21')](respondWithResult(_0x426419,null))['catch'](handleError(_0x426419,null));};exports['create']=function(_0x58946c,_0x2f339d){return db['ChatInteraction']['create'](_0x58946c[_0xf0ab('0x3a')],{})[_0xf0ab('0x21')](respondWithResult(_0x2f339d,0xc9))[_0xf0ab('0x46')](handleError(_0x2f339d,null));};exports[_0xf0ab('0x33')]=function(_0xdf495,_0x55a296){if(_0xdf495[_0xf0ab('0x3a')]['id']){delete _0xdf495[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0xdf495[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x55a296,null))[_0xf0ab('0x21')](saveUpdates(_0xdf495[_0xf0ab('0x3a')],null))['then'](respondWithResult(_0x55a296,null))[_0xf0ab('0x46')](handleError(_0x55a296,null));};exports['destroy']=function(_0x3c1a2c,_0x17a3b6){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3c1a2c[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x17a3b6,null))[_0xf0ab('0x21')](removeEntity(_0x17a3b6,null))[_0xf0ab('0x46')](handleError(_0x17a3b6,null));};exports[_0xf0ab('0xbe')]=function(_0x1f2efa,_0x1d12fb){return db[_0xf0ab('0xa1')]['describe']()[_0xf0ab('0x21')](respondWithResult(_0x1d12fb,null))[_0xf0ab('0x46')](handleError(_0x1d12fb,null));};exports['createVidaooSession']=function(_0x35486d,_0x3f5ade){var _0x135a10=_0x35486d[_0xf0ab('0xbd')]['id'];var _0x48fc7e;var _0x5f55d2;var _0x7c7c3b;return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x135a10}})[_0xf0ab('0x21')](function(_0x2beaaa){_0x48fc7e=_0x2beaaa;return db[_0xf0ab('0xbf')][_0xf0ab('0xc0')]({'where':{'id':_0x2beaaa[_0xf0ab('0x7f')]},'attributes':['id',_0xf0ab('0xc1'),'vidaooEscalation',_0xf0ab('0xc2'),'vidaooNote',_0xf0ab('0xc3')],'raw':!![]});})[_0xf0ab('0x21')](function(_0x354e18){if(_0x354e18&&_0x354e18['vidaooApiKey']&&_0x354e18[_0xf0ab('0xc4')]){_0x5f55d2=_0x354e18;var _0x2068d6={'interaction':{'id':_0x135a10},'agent':{'id':_0x35486d[_0xf0ab('0x9b')]['id'],'name':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x37')],'fullname':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0x40')],'email':_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]},'contact':_0x35486d['body']['contact'],'account':_0x35486d[_0xf0ab('0x3a')][_0xf0ab('0x3d')]};var _0x35b480={'rejectUnauthorized':![],'method':_0xf0ab('0xc6'),'url':_0xf0ab('0xc7'),'headers':{'X-APIKEY':_0x354e18[_0xf0ab('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35486d[_0xf0ab('0x9b')][_0xf0ab('0xc5')]],'buttons':null,'topic':_0x5f55d2[_0xf0ab('0xc2')],'note':_[_0xf0ab('0xc8')](_0x5f55d2['vidaooNote'])?null:getMustacheRender(_0x5f55d2[_0xf0ab('0xc9')],_0x2068d6),'metadata':null},'redirect':_0xf0ab('0xca'),'json':!![]};try{if(!_[_0xf0ab('0xc8')](_0x5f55d2[_0xf0ab('0xc3')])){var _0x41e2d8=getMustacheRender(_0x5f55d2[_0xf0ab('0xc3')],_0x2068d6);var _0x57f44d=JSON[_0xf0ab('0x81')](_0x41e2d8);_0x35b480[_0xf0ab('0x3a')][_0xf0ab('0xcb')]=_0x57f44d;}}catch(_0x533b37){throw new db[(_0xf0ab('0xcc'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x35b480);}else{throw new db[(_0xf0ab('0xcc'))][(_0xf0ab('0xcd'))](_0xf0ab('0xce'));}})['then'](function(_0x1697ca){_0x7c7c3b=_0x1697ca;if(_0x7c7c3b['id']){var _0x15da8a={'body':_0x7c7c3b[_0xf0ab('0xcf')],'ChatWebsiteId':_0x5f55d2['id'],'ChatInteractionId':_0x48fc7e['id'],'direction':'out','UserId':_0x35486d[_0xf0ab('0x9b')]['id']};return db[_0xf0ab('0xd0')][_0xf0ab('0xd1')](_0x15da8a,{});}else{throw new db['Sequelize'][(_0xf0ab('0xcd'))](_0xf0ab('0xd2'));}})[_0xf0ab('0x21')](function(){return _0x48fc7e[_0xf0ab('0xd3')]({'vidaooSessionId':_0x7c7c3b['id']});})[_0xf0ab('0x21')](respondWithResult(_0x3f5ade,null))[_0xf0ab('0x46')](handleError(_0x3f5ade,null));};exports[_0xf0ab('0xd4')]=function(_0x115e3d,_0x2d0f9c){if(_0x115e3d[_0xf0ab('0x3a')]['id']){delete _0x115e3d[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x115e3d[_0xf0ab('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x2d0f9c,null))[_0xf0ab('0x21')](saveUpdates(_0x115e3d['body'],null))[_0xf0ab('0x21')](respondWithResult(_0x2d0f9c,null))['catch'](handleError(_0x2d0f9c,null));};exports[_0xf0ab('0xd5')]=function(_0x1e9768,_0x4398a3,_0x4195d9){if(_0x1e9768[_0xf0ab('0x3a')]['id']){delete _0x1e9768[_0xf0ab('0x3a')]['id'];}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x1e9768[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](function(_0x5f10a5){if(!_0x5f10a5){logger[_0xf0ab('0x28')](_0xf0ab('0xd6'),_0xf0ab('0xd5'),0x194,_0xf0ab('0xd7'));_0x4398a3[_0xf0ab('0x2b')](0x194);}else{if(_0x5f10a5[_0xf0ab('0x7b')]){throw new db['Sequelize']['ValidationError'](_0xf0ab('0xd8'));}}return _0x5f10a5;})[_0xf0ab('0x21')](function(_0x564124){if(_0x564124){return _0x564124[_0xf0ab('0x33')]({'closed':_0x1e9768[_0xf0ab('0x3a')][_0xf0ab('0xd9')],'disposition':_0x1e9768['body'][_0xf0ab('0xda')]})[_0xf0ab('0x21')](function(_0x2d9046){return _0x2d9046;});}})[_0xf0ab('0x21')](function(_0x4e5f1e){return respondWithRpcPromise(_0xf0ab('0xdb'),_0xf0ab('0xd5'),_0x1e9768[_0xf0ab('0x3a')],client9004);})['then'](respondWithResult(_0x4398a3,null))['catch'](handleError(_0x4398a3,null));};exports['attachmentUpload']=function(_0x581cb1,_0x22251d,_0x2b5993){_0x581cb1[_0xf0ab('0x3a')]['name']=_0x581cb1[_0xf0ab('0xdc')]['originalname'];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0xdd')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xde')];_0x581cb1[_0xf0ab('0x3a')][_0xf0ab('0x49')]=_0x581cb1[_0xf0ab('0xdc')][_0xf0ab('0xdf')];return db[_0xf0ab('0xe0')][_0xf0ab('0xd1')](_0x581cb1[_0xf0ab('0x3a')])[_0xf0ab('0x21')](respondWithResult(_0x22251d,0xc9))[_0xf0ab('0x46')](handleError(_0x22251d,null));};exports[_0xf0ab('0xe1')]=function(_0x4d09bf,_0x415b9d,_0x11ed58){return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x4d09bf[_0xf0ab('0xbd')]['id']},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null))[_0xf0ab('0x21')](function(_0x278e32){if(_0x278e32){if(_0x278e32['closed']){return _0x415b9d[_0xf0ab('0x2c')](0x193)[_0xf0ab('0x2d')]({'status':0x193,'message':_0xf0ab('0xe2')});}return db[_0xf0ab('0xe0')][_0xf0ab('0xc0')]({'where':{'id':_0x4d09bf[_0xf0ab('0x4c')][_0xf0ab('0xe3')]},'raw':!![]})[_0xf0ab('0x21')](handleEntityNotFound(_0x415b9d,null));}})['then'](function(_0xadae03){if(_0xadae03){var _0x550b00=_0xadae03[_0xf0ab('0xe4')]!==null;var _0x2bfb6a=path[_0xf0ab('0xe5')](config['root'],_0xf0ab('0xe6'));if(_0x550b00){_0x2bfb6a=path[_0xf0ab('0xe5')](_0x2bfb6a,'offline-chat/');}var _0x5d62e4=path['join'](_0x2bfb6a,_0xadae03['basename']);return _0x415b9d[_0xf0ab('0xe7')](_0x5d62e4);}})['catch'](handleError(_0x415b9d,null));};exports['close']=function(_0x3b8bbe,_0x7e24c4){var _0x2d0ea3=null;var _0x4a18ad=null;var _0x57aaae=null;var _0x2ab0be=null;if(_0x3b8bbe[_0xf0ab('0x3a')]['id']){delete _0x3b8bbe['body']['id'];}if(_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')]){_0x2ab0be=path['join'](config['root'],'server/files/chat/upload/',util[_0xf0ab('0xe9')](_0xf0ab('0xea'),Date[_0xf0ab('0xeb')]()));_0x3b8bbe[_0xf0ab('0x3a')]['pathTranscript']=_0x2ab0be;}return db[_0xf0ab('0xa1')][_0xf0ab('0x6c')]({'where':{'id':_0x3b8bbe['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf0ab('0xec')],'as':'User'}]}]})[_0xf0ab('0x21')](handleEntityNotFound(_0x7e24c4,null))[_0xf0ab('0x21')](saveUpdates(_0x3b8bbe[_0xf0ab('0x3a')],null))[_0xf0ab('0x21')](function(_0x116c84){if(_0x116c84){_0x2d0ea3=_0x116c84;return db[_0xf0ab('0xbf')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3[_0xf0ab('0x7f')]}});}})[_0xf0ab('0x21')](function(_0x1d6e15){if(_0x1d6e15){_0x57aaae=_0x1d6e15;return db[_0xf0ab('0xed')][_0xf0ab('0x6c')]({'where':{'id':_0x2d0ea3['ContactId']}});}})[_0xf0ab('0x21')](function(_0x29427c){if(_0x29427c){_0x4a18ad=_0x29427c;if(_0x2ab0be){var _0x29d4a1=null;for(var _0x50e996=0x1;_0x50e996<_0x2d0ea3['Messages'][_0xf0ab('0x52')];++_0x50e996){_0x29d4a1=_0x2d0ea3[_0xf0ab('0xee')][_0x50e996];var _0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');var _0xc1537e=_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xf2')]||util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0xf0ab('0xf3'),_0x29d4a1[_0xf0ab('0x75')]);switch(_0x57aaae[_0xf0ab('0xf4')]){case _0xf0ab('0xf5'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae['agentAlias'],_0x29d4a1[_0xf0ab('0x7b')]):'System';break;case _0xf0ab('0xf6'):_0x8e04bb=_0x29d4a1[_0xf0ab('0x7b')]?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0xf7')]||_0x29d4a1['User'][_0xf0ab('0x40')]:'System';break;case'agent_fullname':_0x8e04bb=_0x29d4a1['UserId']?_0x29d4a1[_0xf0ab('0xec')][_0xf0ab('0x40')]:_0xf0ab('0xf1');break;default:_0x8e04bb=_0x29d4a1['UserId']?util[_0xf0ab('0xe9')](_0xf0ab('0xef'),_0x57aaae[_0xf0ab('0xf0')],_0x29d4a1[_0xf0ab('0x7b')]):_0xf0ab('0xf1');}var _0x2c39f0=util[_0xf0ab('0xe9')](_0xf0ab('0xf8'),moment(_0x29d4a1[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0xfa')),_0x29d4a1[_0xf0ab('0xfb')]==='in'?_0xc1537e:_0x8e04bb,_0x29d4a1['body']);if(!_0x29d4a1[_0xf0ab('0xfc')]){fs[_0xf0ab('0xfd')](_0x2ab0be,_0x2c39f0);}}return db[_0xf0ab('0xfe')][_0xf0ab('0xc0')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf0ab('0xff'),'raw':!![]}]});}}})['then'](function(_0x21eb2b){if(_0x21eb2b&&_0x21eb2b['Smtp']&&_0x3b8bbe[_0xf0ab('0x3a')]){var _0x262659={'tls':{'rejectUnauthorized':![]}};if(_0x21eb2b['Smtp'][_0xf0ab('0x100')]){_0x262659[_0xf0ab('0x100')]=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x100')];}else{_0x262659[_0xf0ab('0x101')]=_0x21eb2b['Smtp'][_0xf0ab('0x101')];_0x262659[_0xf0ab('0x102')]=_0x21eb2b[_0xf0ab('0xff')]['port'];_0x262659['secure']=_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x103')];}if(_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x104')]){_0x262659['auth']={'user':_0x21eb2b['Smtp'][_0xf0ab('0x9b')],'pass':_0x21eb2b[_0xf0ab('0xff')]['pass']};}return respondWithRpcPromise('SendMail',_0xf0ab('0x105'),{'account':_0x262659,'message':{'from':util['format'](_0xf0ab('0x106'),_0x21eb2b['name'],_0x21eb2b[_0xf0ab('0xc5')]||_0x21eb2b[_0xf0ab('0xff')][_0xf0ab('0x9b')]),'to':_0x3b8bbe[_0xf0ab('0x3a')][_0xf0ab('0xe8')],'subject':_0xf0ab('0x107'),'text':util[_0xf0ab('0xe9')](_0xf0ab('0x108'),_0x3b8bbe['body'][_0xf0ab('0xe8')]),'attachments':[{'path':_0x2ab0be}]}})[_0xf0ab('0x21')](function(){return _0x2d0ea3;})[_0xf0ab('0x46')](function(_0x15f041){console[_0xf0ab('0x28')](_0x15f041);});}else{return _0x2d0ea3;}})['then'](respondWithStatusCode(_0x7e24c4,0xc8))[_0xf0ab('0x46')](handleError(_0x7e24c4,null));};exports[_0xf0ab('0x109')]=function(_0x5eda4b,_0x57a8ab,_0x3cee1d){return db[_0xf0ab('0xd0')][_0xf0ab('0x6c')]({'where':{'id':_0x5eda4b[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x57a8ab,null))[_0xf0ab('0x21')](function(_0x4dff6e){if(_0x4dff6e){return _0x4dff6e[_0xf0ab('0x109')](_0x5eda4b[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_[_0xf0ab('0x10b')](_0x5eda4b[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x57a8ab,null))[_0xf0ab('0x46')](handleError(_0x57a8ab,null));};exports['getMessages']=function(_0x283bf5,_0x1afcea,_0x22a9f8){var _0x33dbfc={'raw':![],'where':{}};var _0x487318={};var _0x546e13={'count':0x0,'rows':[]};return db[_0xf0ab('0xa1')]['findOne']({'where':{'id':_0x283bf5[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x1afcea,null))[_0xf0ab('0x21')](function(_0xa3b903){if(_0xa3b903){_0x487318['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x487318[_0xf0ab('0x4c')]=_['keys'](_0x283bf5[_0xf0ab('0x4c')]);_0x487318[_0xf0ab('0x4e')]=_['intersection'](_0x487318[_0xf0ab('0x4b')],_0x487318[_0xf0ab('0x4c')]);_0x33dbfc[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x487318[_0xf0ab('0x4b')],qs['fields'](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x50')]));_0x33dbfc[_0xf0ab('0x51')]=_0x33dbfc['attributes'][_0xf0ab('0x52')]?_0x33dbfc[_0xf0ab('0x51')]:_0x487318[_0xf0ab('0x4b')];if(!_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x53')](_0xf0ab('0x54'))){_0x33dbfc[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x33dbfc['offset']=qs['offset'](_0x283bf5[_0xf0ab('0x4c')]['offset']);}_0x33dbfc['order']=qs[_0xf0ab('0x56')](_0x283bf5[_0xf0ab('0x4c')]['sort']);_0x33dbfc[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x283bf5['query'],_0x487318[_0xf0ab('0x4e')]));_0x33dbfc['where'][_0xf0ab('0x10d')]=_0xa3b903['id'];if(_0x283bf5['query'][_0xf0ab('0x8d')]){_0x33dbfc[_0xf0ab('0x83')]=_[_0xf0ab('0x39')](_0x33dbfc['where'],{'$or':_[_0xf0ab('0x3f')](_0x33dbfc[_0xf0ab('0x51')],function(_0x2ddc1d){var _0x3cef14={};_0x3cef14[_0x2ddc1d]={'$like':'%'+_0x283bf5['query'][_0xf0ab('0x8d')]+'%'};return _0x3cef14;})});}if(_0x283bf5[_0xf0ab('0x4c')]['$gte']){var _0x38ea18=_0x283bf5[_0xf0ab('0x4c')]['$gte']['split'](',');var _0x7ee6b3={};_0x7ee6b3[_0x38ea18[0x0]]={'$gte':moment(_0x38ea18[0x1])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))};_0x33dbfc['where']=_[_0xf0ab('0x39')](_0x33dbfc['where'],_0x7ee6b3);}_0x33dbfc=_[_0xf0ab('0x39')]({},_0x33dbfc,_0x283bf5['options']);return db[_0xf0ab('0xd0')]['count']({'where':_0x33dbfc['where']})['then'](function(_0x1d1451){_0x546e13['count']=_0x1d1451;if(_0x283bf5[_0xf0ab('0x4c')][_0xf0ab('0xba')]){_0x33dbfc[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x33dbfc);})['then'](function(_0x16a1d2){_0x546e13[_0xf0ab('0xb8')]=_0x16a1d2;return _0x546e13;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x1afcea,_0x33dbfc))[_0xf0ab('0x46')](handleError(_0x1afcea,null));};exports[_0xf0ab('0x110')]=function(_0x4b91de,_0x3a602f,_0x47788a){var _0x3592f1={'where':{}},_0x577f13={},_0x2f99c2={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf0ab('0xc0')]({'where':{'id':_0x4b91de[_0xf0ab('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3a602f,null))['then'](function(_0x43c6b8){if(_0x43c6b8){_0x577f13['model']=_[_0xf0ab('0x4d')](db[_0xf0ab('0xd0')][_0xf0ab('0x47')]);_0x577f13[_0xf0ab('0x4c')]=_[_0xf0ab('0x4d')](_0x4b91de[_0xf0ab('0x4c')]);_0x577f13['filters']=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],_0x577f13[_0xf0ab('0x4c')]);_0x3592f1[_0xf0ab('0x51')]=_[_0xf0ab('0x4f')](_0x577f13[_0xf0ab('0x4b')],qs[_0xf0ab('0x50')](_0x4b91de['query'][_0xf0ab('0x50')]));_0x3592f1[_0xf0ab('0x51')]=_0x3592f1['attributes'][_0xf0ab('0x52')]?_0x3592f1['attributes']:_0x577f13[_0xf0ab('0x4b')];if(!_0x4b91de['query']['hasOwnProperty']('nolimit')){_0x3592f1[_0xf0ab('0x30')]=qs[_0xf0ab('0x30')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x30')]);_0x3592f1[_0xf0ab('0x2e')]=qs[_0xf0ab('0x2e')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x2e')]);}_0x3592f1[_0xf0ab('0x55')]=qs[_0xf0ab('0x56')](_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x56')]);_0x3592f1[_0xf0ab('0x83')]=qs[_0xf0ab('0x4e')](_[_0xf0ab('0x10c')](_0x4b91de[_0xf0ab('0x4c')],_0x577f13[_0xf0ab('0x4e')]));_0x3592f1['where'][_0xf0ab('0x10d')]=_0x43c6b8['id'];if(_0x4b91de['query'][_0xf0ab('0x8d')]){_0x3592f1['where']=_[_0xf0ab('0x39')](_0x3592f1[_0xf0ab('0x83')],{'$or':_[_0xf0ab('0x3f')](_0x3592f1['attributes'],function(_0x58f64c){var _0x5dc7d4={};_0x5dc7d4[_0x58f64c]={'$like':'%'+_0x4b91de[_0xf0ab('0x4c')][_0xf0ab('0x8d')]+'%'};return _0x5dc7d4;})});}_0x3592f1['where'][_0xf0ab('0xfc')]=![];if(_0x4b91de[_0xf0ab('0x4c')]['id']){_0x3592f1[_0xf0ab('0x83')]['id']={'$gt':_0x4b91de[_0xf0ab('0x4c')]['id']};}_0x3592f1=_['merge']({},_0x3592f1,_0x4b91de['options']);return db[_0xf0ab('0xd0')][_0xf0ab('0x31')]({'where':_0x3592f1[_0xf0ab('0x83')]})[_0xf0ab('0x21')](function(_0x2ab983){_0x2f99c2['count']=_0x2ab983;_0x3592f1[_0xf0ab('0xbb')]=[];if(_0x4b91de['query'][_0xf0ab('0x111')]){_0x3592f1[_0xf0ab('0xbb')][_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id',_0xf0ab('0x40'),_0xf0ab('0xf7')]});}if(_0x4b91de[_0xf0ab('0x4c')]['includeAll']){_0x3592f1[_0xf0ab('0xbb')]=[{'all':!![]}];}return db[_0xf0ab('0xd0')][_0xf0ab('0x10f')](_0x3592f1);})[_0xf0ab('0x21')](function(_0x3d70c0){_0x2f99c2[_0xf0ab('0xb8')]=_0x3d70c0;return _0x2f99c2;});}})[_0xf0ab('0x21')](respondWithFilteredResult(_0x3a602f,_0x3592f1))[_0xf0ab('0x46')](handleError(_0x3a602f,null));};exports['addTags']=function(_0x4d10af,_0x5cf4bd,_0x368523){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x4d10af['params']['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x5cf4bd,null))[_0xf0ab('0x21')](function(_0x46a38a){if(_0x46a38a){return _0x46a38a[_0xf0ab('0x112')](_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')],_['omit'](_0x4d10af[_0xf0ab('0x3a')],[_0xf0ab('0x10a'),'id'])||{})[_0xf0ab('0x113')](function(){return db['Tag'][_0xf0ab('0x10f')]({'attributes':['id',_0xf0ab('0x37'),_0xf0ab('0x59')],'where':{'id':_0x4d10af[_0xf0ab('0x3a')][_0xf0ab('0x10a')]}});})[_0xf0ab('0x21')](function(_0x1df97b){socket[_0xf0ab('0x114')](_0xf0ab('0x115'),{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]});return{'id':Number(_0x4d10af[_0xf0ab('0xbd')]['id']),'tags':_0x1df97b||[]};});}})[_0xf0ab('0x21')](respondWithResult(_0x5cf4bd,null))['catch'](handleError(_0x5cf4bd,null));};exports[_0xf0ab('0x116')]=function(_0x3ca465,_0x4e379d,_0x122e66){return db['ChatInteraction'][_0xf0ab('0x6c')]({'where':{'id':_0x3ca465[_0xf0ab('0xbd')]['id']}})[_0xf0ab('0x21')](handleEntityNotFound(_0x4e379d,null))[_0xf0ab('0x21')](function(_0x5c56e0){if(_0x5c56e0){return _0x5c56e0[_0xf0ab('0x116')](_0x3ca465[_0xf0ab('0x4c')][_0xf0ab('0x10a')]);}})['then'](respondWithStatusCode(_0x4e379d,null))[_0xf0ab('0x46')](handleError(_0x4e379d,null));};exports[_0xf0ab('0xe7')]=function(_0x2baa40,_0x4ff52d){var _0x2a2fea=moment()[_0xf0ab('0x117')]()[_0xf0ab('0xa0')]();var _0x4eccbd=path['join'](config['root'],_0xf0ab('0x118'),_0xf0ab('0x119'),_0xf0ab('0x11a'));var _0x5b6475=path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],'server',_0xf0ab('0x119'),_0xf0ab('0x11c'));var _0x595bda=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2a2fea);var _0x2bd3e3=util['format']('transcript-%d-%s.zip',_0x2baa40[_0xf0ab('0xbd')]['id'],_0x2a2fea);var _0x25242e=path[_0xf0ab('0xe5')](_0x4eccbd,_0x2bd3e3);var _0x3d8794=[];_0x3d8794[_0xf0ab('0x45')]({'model':db['User'],'as':_0xf0ab('0xec'),'attributes':['id','fullname'],'raw':!![]});_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xed')],'as':_0xf0ab('0x70'),'attributes':['id','firstName',_0xf0ab('0x11d')],'raw':!![]});if(_0x2baa40[_0xf0ab('0x4c')][_0xf0ab('0x11c')]){_0x3d8794[_0xf0ab('0x45')]({'model':db[_0xf0ab('0xe0')],'as':'Attachment','raw':!![]});}var _0x243763=[{'model':db[_0xf0ab('0xd0')],'as':_0xf0ab('0xee'),'attributes':['id',_0xf0ab('0x3a'),'createdAt',_0xf0ab('0xfb'),_0xf0ab('0xfc'),_0xf0ab('0x88')],'include':_0x3d8794}];_0x243763['push']({'model':db[_0xf0ab('0xbf')],'as':_0xf0ab('0x11e'),'attributes':['id',_0xf0ab('0x37')]});_0x243763['push']({'model':db[_0xf0ab('0xec')],'as':_0xf0ab('0x11f'),'attributes':['id',_0xf0ab('0x40')]});return db[_0xf0ab('0xa1')]['find']({'where':{'id':_0x2baa40[_0xf0ab('0xbd')]['id']},'include':_0x243763})[_0xf0ab('0x21')](handleEntityNotFound(_0x4ff52d,null))[_0xf0ab('0x21')](function(_0x2c2e20){if(_0x2c2e20){var _0x57bd77=_0x2c2e20[_0xf0ab('0x120')]({'plain':!![]});fs[_0xf0ab('0x121')](_0x595bda);var _0x169b02={'channel':_0xf0ab('0x122'),'account':_0x57bd77[_0xf0ab('0x11e')]['name'],'agent':_0x57bd77[_0xf0ab('0x11f')]?_0x57bd77['Owner'][_0xf0ab('0x40')]:_0xf0ab('0x123'),'createdAt':moment(_0x57bd77[_0xf0ab('0xf9')])['format'](_0xf0ab('0x10e'))['toString'](),'closedAt':_0x57bd77['closed']?moment(_0x57bd77['closedAt'])[_0xf0ab('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x57bd77[_0xf0ab('0xda')],'chatInfo':{'browser':_0x57bd77[_0xf0ab('0x124')],'os':_0x57bd77[_0xf0ab('0x125')],'referer':_0x57bd77[_0xf0ab('0x126')],'customerIp':_0x57bd77[_0xf0ab('0x127')],'customerPort':_0x57bd77['customerPort']?_0x57bd77[_0xf0ab('0x128')]:_0xf0ab('0x123')},'messages':_(_0x57bd77['Messages'])[_0xf0ab('0x129')]()[_0xf0ab('0x8d')]({'secret':![]})[_0xf0ab('0x3f')](function(_0x2aa512){if(_0x2aa512['Attachment']){var _0x26009e=path[_0xf0ab('0xe5')](_0x5b6475,_0x2aa512['Attachment'][_0xf0ab('0xdd')]);if(fs[_0xf0ab('0x12a')](_0x26009e)){fs['createReadStream'](_0x26009e)[_0xf0ab('0x12b')](fs[_0xf0ab('0x12c')](path['join'](_0x595bda,_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')])));}}return{'date':moment(_0x2aa512[_0xf0ab('0xf9')])[_0xf0ab('0xe9')](_0xf0ab('0x10e'))['toString'](),'sender':_0x2aa512[_0xf0ab('0xfb')]==='out'?_0x2aa512[_0xf0ab('0xec')]?_0x2aa512['User'][_0xf0ab('0x40')]:_0xf0ab('0xf1'):_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x12d')]+(_0x2aa512[_0xf0ab('0x70')][_0xf0ab('0x11d')]?'\x20'+_0x2aa512[_0xf0ab('0x70')]['lastName']:''),'body':_0x2aa512[_0xf0ab('0xe0')]?_0x2aa512[_0xf0ab('0xe0')][_0xf0ab('0xdd')]:_0x2aa512[_0xf0ab('0x3a')],'direction':_0x2aa512[_0xf0ab('0xfb')]==='out'?'A':'C','secret':_0x2aa512[_0xf0ab('0xfc')],'read':_0x2aa512[_0xf0ab('0x88')],'attachment':_0x2aa512[_0xf0ab('0xe0')]};})[_0xf0ab('0x72')]()};return ejs['renderFile'](path[_0xf0ab('0xe5')](config[_0xf0ab('0x11b')],_0xf0ab('0x118'),_0xf0ab('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x169b02})['then'](function(_0x3ad886){var _0x3df4a2=path['join'](_0x595bda,'transcript-'+_0x57bd77['id']+'-'+_0x2a2fea+_0xf0ab('0x12f'));var _0x378d44={'path':_0x3df4a2,'channel':_0xf0ab('0x122'),'interactionId':_0x57bd77['id']};return pdf[_0xf0ab('0x130')](_0x3ad886,_0x378d44);})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x1e4acb,_0x25a1eb){zipdir(_0x595bda,{'saveTo':_0x25242e},function(_0x406090,_0x414d09){if(_0x406090)return _0x25a1eb(_0x406090);return _0x1e4acb(_0x414d09);});})[_0xf0ab('0x21')](function(){return new BPromise(function(_0x235528,_0x581c80){rimraf(_0x595bda,function(_0x14332a){if(_0x14332a)_0x581c80(_0x14332a);return _0x235528();});});})[_0xf0ab('0x21')](function(){return _0x4ff52d[_0xf0ab('0xe7')](_0x25242e,_0x2bd3e3,function(_0x4f9211){if(_0x4f9211){console[_0xf0ab('0x131')](_0xf0ab('0x132'),_0x4f9211);}else{fs[_0xf0ab('0x133')](_0x25242e);}});});});}else{return _0x4ff52d['sendStatus'](0xc8);}})[_0xf0ab('0x46')](handleError(_0x4ff52d,null));};
\ No newline at end of file
+var _0x087b=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','render','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','show','params','rawAttributes','include','options','catch','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','disposition','file','filename','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','filter','findAll','rows','getMyMessages','includeAll','addTags','setTags','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','firstName','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','lastName','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x568b93,_0xbc5a8e){var _0x4c859b=function(_0x388e32){while(--_0x388e32){_0x568b93['push'](_0x568b93['shift']());}};_0x4c859b(++_0xbc5a8e);}(_0x087b,0x11a));var _0xb087=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x087b[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var pdf=require(_0xb087('0x15'));var hardwareService=require(_0xb087('0x16'));var logger=require(_0xb087('0x17'))(_0xb087('0x18'));var utils=require(_0xb087('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb087('0x1a'));var db=require(_0xb087('0x1b'))['db'];config[_0xb087('0x1c')]=_['defaults'](config[_0xb087('0x1c')],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1c')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);var jayson=require(_0xb087('0x21'));var client=jayson[_0xb087('0x22')][_0xb087('0x23')]({'port':0x232b});var client9004=jayson[_0xb087('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x43e576,_0x412b48,_0x597478,_0xcc4426){return new BPromise(function(_0x2b83b7,_0x2e9e74){var _0x5bb80b=_0xcc4426||client;return _0x5bb80b[_0xb087('0x24')](_0x43e576,_0x597478)[_0xb087('0x25')](function(_0x17200d){logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));logger[_0xb087('0x28')](_0xb087('0x29'),_0x412b48,_0xb087('0x27'),JSON['stringify'](_0x17200d));if(_0x17200d['error']){if(_0x17200d['error']['code']===0x1f4){logger[_0xb087('0x2a')](_0xb087('0x2b'),_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2e9e74(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}logger[_0xb087('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2b83b7(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}else{logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));_0x2b83b7(_0x17200d[_0xb087('0x2d')]['message']);}})['catch'](function(_0x50745a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x50745a);_0x2e9e74(_0x50745a);});});}function respondWithStatusCode(_0x304840,_0x45685d){_0x45685d=_0x45685d||0xcc;return function(_0x1d124f){if(_0x1d124f){return _0x304840[_0xb087('0x2e')](_0x45685d);}return _0x304840[_0xb087('0x2f')](_0x45685d)[_0xb087('0x30')]();};}function respondWithResult(_0xf3f41f,_0x35a52c){_0x35a52c=_0x35a52c||0xc8;return function(_0x6cfb22){if(_0x6cfb22){return _0xf3f41f[_0xb087('0x2f')](_0x35a52c)[_0xb087('0x31')](_0x6cfb22);}};}function respondWithFilteredResult(_0x31e3e6,_0xb0baf6){return function(_0x263259){if(_0x263259){var _0x593b78=typeof _0xb0baf6[_0xb087('0x32')]===_0xb087('0x33')&&typeof _0xb0baf6[_0xb087('0x34')]===_0xb087('0x33');var _0x22d441=_0x263259[_0xb087('0x35')];var _0x2e1c57=_0x593b78?0x0:_0xb0baf6[_0xb087('0x32')];var _0x53a535=_0x593b78?_0x263259['count']:_0xb0baf6[_0xb087('0x32')]+_0xb0baf6[_0xb087('0x34')];var _0x4cb5a8;if(_0x53a535>=_0x22d441){_0x53a535=_0x22d441;_0x4cb5a8=0xc8;}else{_0x4cb5a8=0xce;}_0x31e3e6[_0xb087('0x2f')](_0x4cb5a8);return _0x31e3e6[_0xb087('0x36')](_0xb087('0x37'),_0x2e1c57+'-'+_0x53a535+'/'+_0x22d441)[_0xb087('0x31')](_0x263259);}return null;};}function patchUpdates(_0x3c61c4){return function(_0x427905){try{jsonpatch[_0xb087('0x38')](_0x427905,_0x3c61c4,!![]);}catch(_0x3b7ace){return BPromise[_0xb087('0x39')](_0x3b7ace);}return _0x427905[_0xb087('0x3a')]();};}function saveUpdates(_0x442a5e,_0x3069b5){return function(_0x57ae94){if(_0x57ae94){return _0x57ae94[_0xb087('0x3b')](_0x442a5e)['then'](function(_0x906987){return _0x906987;});}return null;};}function removeEntity(_0x296e9b,_0x738e68){return function(_0xd0659e){if(_0xd0659e){return _0xd0659e[_0xb087('0x3c')]()[_0xb087('0x25')](function(){_0x296e9b[_0xb087('0x2f')](0xcc)[_0xb087('0x30')]();});}};}function handleEntityNotFound(_0x8a4c3c,_0x521c3f){return function(_0x5814c2){if(!_0x5814c2){_0x8a4c3c[_0xb087('0x2e')](0x194);}return _0x5814c2;};}function handleError(_0x3c4f33,_0x1ce1ef){_0x1ce1ef=_0x1ce1ef||0x1f4;return function(_0x2d2902){logger[_0xb087('0x2a')](_0x2d2902['stack']);if(_0x2d2902[_0xb087('0x3d')]){delete _0x2d2902[_0xb087('0x3d')];}_0x3c4f33['status'](_0x1ce1ef)['send'](_0x2d2902);};}function getMustacheRender(_0x1726c2,_0x1c7d90){return Mustache[_0xb087('0x3e')](_0x1726c2,_['merge'](_0x1c7d90[_0xb087('0x3f')],{'contact':_0x1c7d90[_0xb087('0x40')],'message':_0x1c7d90[_0xb087('0x2c')],'agent':_0x1c7d90[_0xb087('0x41')],'interaction':_0x1c7d90[_0xb087('0x42')],'account':_0x1c7d90['account']}))||'';}function getInteractionUsers(_0x7e1315,_0x5bb6bc){return new BPromise(function(_0x18e23f,_0x5a582d){try{if(_0x5bb6bc[_0x7e1315['id']]){_0x7e1315[_0xb087('0x43')]=_[_0xb087('0x44')](_0x5bb6bc[_0x7e1315['id']],function(_0x513332){return{'id':_0x513332['id'],'fullname':_0x513332[_0xb087('0x45')]};});}}catch(_0x5aa11d){_0x5a582d(_0x5aa11d);}_0x18e23f(_0x7e1315);});}function getInteractionTags(_0x46d12a,_0x4a360c){return new BPromise(function(_0x2d2c74,_0x326934){try{if(_0x46d12a[_0xb087('0x46')]){_0x46d12a[_0xb087('0x47')]=[];_0x46d12a[_0xb087('0x46')][_0xb087('0x48')](',')[_0xb087('0x49')](function(_0x5e7690){_0x46d12a[_0xb087('0x47')]['push'](_0x4a360c[_0x5e7690]);});}delete _0x46d12a[_0xb087('0x46')];}catch(_0x2d71c2){_0x326934(_0x2d71c2);}_0x2d2c74(_0x46d12a);});}function updateChatInteraction(_0x5b6924,_0xb662bf,_0x45dc6f){return new BPromise(function(_0x7650c5,_0x4c33cc){return getInteractionUsers(_0x5b6924,_0x45dc6f)[_0xb087('0x25')](function(_0x4a9ccb){return getInteractionTags(_0x4a9ccb,_0xb662bf);})[_0xb087('0x25')](function(_0x32b9d3){_0x7650c5(_0x32b9d3);})['catch'](function(_0x38cb9d){_0x4c33cc(_0x38cb9d);});});}exports[_0xb087('0x4a')]=function(_0x4addbd,_0x2b969a){var _0x171778={},_0x54eb11={},_0x93ada7={'count':0x0,'rows':[]};var _0x46c713=_[_0xb087('0x44')](db[_0xb087('0x4b')]['rawAttributes'],function(_0x47902e){return{'name':_0x47902e[_0xb087('0x4c')],'type':_0x47902e[_0xb087('0x4d')][_0xb087('0x4e')]};});_0x54eb11[_0xb087('0x4f')]=_[_0xb087('0x44')](_0x46c713,_0xb087('0x3d'));_0x54eb11['query']=_['keys'](_0x4addbd[_0xb087('0x50')]);_0x54eb11['filters']=_[_0xb087('0x51')](_0x54eb11[_0xb087('0x4f')],_0x54eb11[_0xb087('0x50')]);_0x171778[_0xb087('0x52')]=_['intersection'](_0x54eb11[_0xb087('0x4f')],qs['fields'](_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]));_0x171778[_0xb087('0x52')]=_0x171778[_0xb087('0x52')][_0xb087('0x54')]?_0x171778['attributes']:_0x54eb11[_0xb087('0x4f')];if(!_0x4addbd[_0xb087('0x50')][_0xb087('0x55')]('nolimit')){_0x171778[_0xb087('0x34')]=qs['limit'](_0x4addbd['query'][_0xb087('0x34')]);_0x171778[_0xb087('0x32')]=qs['offset'](_0x4addbd[_0xb087('0x50')][_0xb087('0x32')]);}_0x171778[_0xb087('0x56')]=qs['sort'](_0x4addbd['query'][_0xb087('0x57')]);_0x171778['where']=qs['filters'](_[_0xb087('0x58')](_0x4addbd[_0xb087('0x50')],_0x54eb11[_0xb087('0x59')]),_0x46c713);var _0x4067cf=[];var _0x2bf92f=squel[_0xb087('0x5a')]()[_0xb087('0x5b')]('id')[_0xb087('0x5b')](_0xb087('0x3d'))[_0xb087('0x5b')](_0xb087('0x5c'))[_0xb087('0x5d')]('tools_tags');var _0x46d570=squel[_0xb087('0x5a')]()['field'](_0xb087('0x5e'))[_0xb087('0x5b')](_0xb087('0x5f'))[_0xb087('0x5b')](_0xb087('0x60'))[_0xb087('0x5d')](_0xb087('0x61'),'ui')[_0xb087('0x62')](_0xb087('0x63'),'u',_0xb087('0x64'));var _0x17c6d0=squel['select']()[_0xb087('0x5d')]('chat_interactions','i')[_0xb087('0x62')]('cm_contacts','c',_0xb087('0x65'))[_0xb087('0x62')](_0xb087('0x63'),'o',_0xb087('0x66'))[_0xb087('0x62')](_0xb087('0x67'),'a',_0xb087('0x68'))[_0xb087('0x62')](_0xb087('0x69'),'me',_0xb087('0x6a'))[_0xb087('0x62')](_0xb087('0x6b'),'it',_0xb087('0x6c'))[_0xb087('0x62')](_0xb087('0x6d'),'t',_0xb087('0x6e'));var _0x217f26=squel[_0xb087('0x6f')]();var _0x40ff74=[];var _0xe3cb2=squel[_0xb087('0x6f')]();var _0x459c5b;if(_0x4addbd['query'][_0xb087('0x70')]){_0x459c5b=as[_0xb087('0x71')](_0x4addbd[_0xb087('0x50')]['search']);var _0x4099cc=_0x459c5b[_0xb087('0x72')];for(var _0x5685b1=0x0;_0x5685b1<_0x459c5b[_0xb087('0x73')][_0xb087('0x54')];_0x5685b1++){var _0x2e3a14=_0x459c5b['conditions'][_0x5685b1];var _0x133c58='i';var _0x257894=_[_0xb087('0x74')](_0x46c713,[_0xb087('0x3d'),_0x2e3a14[_0xb087('0x5b')]]);if(!_0x257894){switch(_0x2e3a14[_0xb087('0x5b')]){case _0xb087('0x75'):if(_0x2e3a14[_0xb087('0x76')]==0x1){_0x17c6d0['having']('`'+_0x2e3a14[_0xb087('0x5b')]+_0xb087('0x77'));}else{_0x17c6d0[_0xb087('0x78')]('`'+_0x2e3a14['field']+_0xb087('0x79'));}break;case'Contact':if(_0x2e3a14['operator']===_0xb087('0x7a')){if(_0x2e3a14[_0xb087('0x76')]['split']('\x20')[_0xb087('0x54')]>0x1){_0x217f26[_0x4099cc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb087('0x7b')](_0x2e3a14[_0xb087('0x76')]),null);}else{var _0x5938ad='%'+_0x2e3a14['value']+'%';_0x217f26[_0x4099cc](_0xb087('0x7c'),_0x5938ad,_0x5938ad,_0x5938ad);}}else{_0x257894=_['find'](_0x46c713,['name',_0xb087('0x7d')]);_0x2e3a14['field']=_0xb087('0x7d');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case'Tag':var _0x200869=_0x2e3a14['value'][_0xb087('0x48')](',')[_0xb087('0x44')](function(_0x1060e1){return Number(_0x1060e1);});_0x200869['forEach'](function(_0x298bbb){_0xe3cb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298bbb+',%');});_0x40ff74=_[_0xb087('0x80')](_0x40ff74,_0x200869);break;case _0xb087('0x81'):if(_0x2e3a14[_0xb087('0x82')]===_0xb087('0x7a')){_0x217f26[_0x4099cc](_0xb087('0x83'),'%'+_0x2e3a14[_0xb087('0x76')]+'%',null);}else{_0x257894=_['find'](_0x46c713,[_0xb087('0x3d'),_0xb087('0x84')]);_0x2e3a14['field']=_0xb087('0x84');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case _0xb087('0x3f'):_0x390309=as[_0xb087('0x85')]('me',null,_0x2e3a14);_0x217f26[_0x4099cc](_0x390309['text'],_0x390309['value']['start'],_0x390309[_0xb087('0x76')]['end']);break;}}else{var _0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309['value'][_0xb087('0x30')]);}}}else{var _0x53f04a=_(_0x4addbd[_0xb087('0x50')])[_0xb087('0x86')]()[_0xb087('0x44')](function(_0x42f4a3){return _['some'](_0x46c713,['name',_0x42f4a3])?_0x42f4a3:undefined;})[_0xb087('0x87')]()['value']();if(!_[_0xb087('0x88')](_0x53f04a)){_0x53f04a[_0xb087('0x49')](function(_0x2ca987){if(_0x2ca987===_0xb087('0x89')){_0x17c6d0['where']('i.ChatWebsiteId\x20IN\x20?',[][_0xb087('0x8a')](_0x4addbd['query'][_0x2ca987]));}else if(_0x2ca987===_0xb087('0x8b')){var _0x1c7cd7=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])[_0xb087('0x8d')];var _0x581ad4=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])['$lte'];_0x17c6d0['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1c7cd7,_0x581ad4);}else{if(_0x4addbd[_0xb087('0x50')][_0x2ca987]===_0xb087('0x8e')){_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x90'));}else{_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x91'),_0x4addbd['query'][_0x2ca987]);}}});}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]==0x1){_0x17c6d0[_0xb087('0x78')](_0xb087('0x93'));}else{_0x17c6d0[_0xb087('0x78')]('`unreadMessages`\x20>\x200');}}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]){_0x40ff74=_[_0xb087('0x95')](_0x4addbd['query'][_0xb087('0x94')])?_0x4addbd['query'][_0xb087('0x94')]:new Array(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]);_0x40ff74[_0xb087('0x49')](function(_0x463791){_0xe3cb2['or'](_0xb087('0x96'),'%,'+_0x463791+',%');});}if(_0x4addbd['query']['filter']){var _0x1e7a22=_0x4addbd[_0xb087('0x50')]['filter'][_0xb087('0x97')]('\x5c','\x5c\x5c')[_0xb087('0x97')](/'/g,'\x27\x27');if(qs[_0xb087('0x98')](_0x1e7a22)){_0x217f26['or'](_0xb087('0x99'),_0x1e7a22+'%');}else{_0x217f26['or'](_0xb087('0x9a'),qs[_0xb087('0x7b')](_0x1e7a22))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1e7a22+'%');}}}_0x17c6d0[_0xb087('0x8f')](_0x217f26);_0x17c6d0[_0xb087('0x9b')](_0xb087('0x9c'));var _0x3114ce={'type':db[_0xb087('0x9d')][_0xb087('0x9e')][_0xb087('0x9f')],'raw':!![]};var _0x1fc613=_0x17c6d0[_0xb087('0xa0')]();_0x1fc613['field'](_0xb087('0x9c'));_0x1fc613['field'](_0xb087('0xa1'),_0xb087('0x75'));if(_0x171778['order']){_0x171778[_0xb087('0x56')][_0xb087('0x49')](function(_0x8b1a5b){var _0x2a076b=_0x8b1a5b[0x0]===_0xb087('0xa2')?_0x8b1a5b[0x0]:'i.'+_0x8b1a5b[0x0];_0x17c6d0[_0xb087('0x56')](_0x2a076b,_0x8b1a5b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb087('0x88')](_0x40ff74)){_0x17c6d0[_0xb087('0x78')](_0xe3cb2);_0x1fc613[_0xb087('0x8f')](_0xb087('0xa3'),_0x40ff74);}BPromise[_0xb087('0xa4')]()['then'](function(){if(!_0x459c5b){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x89')])return;_0x1fc613[_0xb087('0x8f')](_0xb087('0xa5'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa5'));return;}if(_0x4addbd[_0xb087('0xa6')][_0xb087('0xa7')]!==_0xb087('0x41'))return;return _0x4addbd[_0xb087('0xa6')][_0xb087('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59121a){if(_[_0xb087('0x88')](_0x59121a)){_0x1fc613[_0xb087('0x8f')](_0xb087('0xa9'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa9'));}else{_0x1fc613['where'](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));}});})[_0xb087('0x25')](function(){if(_0x4addbd['user'][_0xb087('0xa7')]==='agent'&&!_0x459c5b&&!_0x4addbd['query'][_0xb087('0x89')])return[];return db[_0xb087('0xab')][_0xb087('0x50')](_0x1fc613[_0xb087('0xac')](),_0x3114ce);})['then'](function(_0x313c9b){_0x93ada7[_0xb087('0x35')]=_0x313c9b['length'];if(_0x93ada7[_0xb087('0x35')]===0x0)return[];return db['sequelize']['query'](_0x2bf92f[_0xb087('0xac')](),_0x3114ce)[_0xb087('0x25')](function(_0x414cb4){_0x4067cf=_[_0xb087('0xad')](_0x414cb4,'id');_0x3114ce=_[_0xb087('0xae')](_0x3114ce,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]){_0x171778[_0xb087('0x52')][_0xb087('0x49')](function(_0x48e2c6){_0x17c6d0['field']('i.'+_0x48e2c6);});}else{_0x17c6d0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb087('0x75'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xaf'),_0xb087('0xb0'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb1'),_0xb087('0xb2'));_0x17c6d0['field']('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',_0xb087('0xa2'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb3'));_0x17c6d0[_0xb087('0x5b')]('c.firstName',_0xb087('0xb4'));_0x17c6d0['field'](_0xb087('0xb5'),'Contact.lastName');_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb6'),_0xb087('0xb7'));_0x17c6d0[_0xb087('0x5b')]('c.phone',_0xb087('0xb8'));_0x17c6d0['field']('c.mobile','Contact.mobile');_0x17c6d0[_0xb087('0x5b')]('c.fax',_0xb087('0xb9'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xba'),_0xb087('0xbb'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbc'),_0xb087('0xbd'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbe'),_0xb087('0x46'));}if(_0x171778[_0xb087('0x34')])_0x17c6d0[_0xb087('0x34')](_0x171778[_0xb087('0x34')]);if(_0x171778[_0xb087('0x32')])_0x17c6d0[_0xb087('0x32')](_0x171778[_0xb087('0x32')]);return db[_0xb087('0xab')][_0xb087('0x50')](_0x17c6d0['toString'](),_0x3114ce);})[_0xb087('0x25')](function(_0x5c2a14){if(_0x5c2a14[_0xb087('0x54')]>0x0)_0x46d570[_0xb087('0x8f')](_0xb087('0xbf'),_[_0xb087('0x44')](_0x5c2a14,'id'));return db[_0xb087('0xab')][_0xb087('0x50')](_0x46d570[_0xb087('0xac')](),_0x3114ce)['then'](function(_0x5103ab){var _0x5194f2=_[_0xb087('0xc0')](_0x5103ab,_0xb087('0xc1'));var _0x3a403f=[];_0x5c2a14[_0xb087('0x49')](function(_0x18b90b){_0x3a403f[_0xb087('0xc2')](updateChatInteraction(_0x18b90b,_0x4067cf,_0x5194f2));});return BPromise[_0xb087('0xc3')](_0x3a403f);});});})[_0xb087('0x25')](function(_0x181c56){_0x93ada7['rows']=_0x181c56;return _0x93ada7;})[_0xb087('0x25')](respondWithFilteredResult(_0x2b969a,_0x171778))['catch'](handleError(_0x2b969a,null));};exports[_0xb087('0xc4')]=function(_0x25910a,_0x597d80){var _0x4c3aef={'raw':![],'where':{'id':_0x25910a[_0xb087('0xc5')]['id']}},_0x2f2597={};_0x2f2597[_0xb087('0x4f')]=_[_0xb087('0x86')](db['ChatInteraction'][_0xb087('0xc6')]);_0x2f2597[_0xb087('0x50')]=_['keys'](_0x25910a['query']);_0x2f2597[_0xb087('0x59')]=_['intersection'](_0x2f2597['model'],_0x2f2597[_0xb087('0x50')]);_0x4c3aef['attributes']=_[_0xb087('0x51')](_0x2f2597[_0xb087('0x4f')],qs[_0xb087('0x53')](_0x25910a[_0xb087('0x50')][_0xb087('0x53')]));_0x4c3aef[_0xb087('0x52')]=_0x4c3aef[_0xb087('0x52')][_0xb087('0x54')]?_0x4c3aef['attributes']:_0x2f2597[_0xb087('0x4f')];if(_0x25910a['query']['includeAll']){_0x4c3aef[_0xb087('0xc7')]=[{'all':!![]}];}_0x4c3aef=_[_0xb087('0xae')]({},_0x4c3aef,_0x25910a[_0xb087('0xc8')]);return db['ChatInteraction'][_0xb087('0x74')](_0x4c3aef)[_0xb087('0x25')](handleEntityNotFound(_0x597d80,null))[_0xb087('0x25')](respondWithResult(_0x597d80,null))[_0xb087('0xc9')](handleError(_0x597d80,null));};exports['create']=function(_0x1f3ecb,_0x3e865d){return db[_0xb087('0x4b')][_0xb087('0xca')](_0x1f3ecb[_0xb087('0x3f')],{})[_0xb087('0x25')](respondWithResult(_0x3e865d,0xc9))[_0xb087('0xc9')](handleError(_0x3e865d,null));};exports['update']=function(_0x1de68b,_0xfc3490){if(_0x1de68b[_0xb087('0x3f')]['id']){delete _0x1de68b[_0xb087('0x3f')]['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1de68b['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xfc3490,null))[_0xb087('0x25')](saveUpdates(_0x1de68b[_0xb087('0x3f')],null))['then'](respondWithResult(_0xfc3490,null))['catch'](handleError(_0xfc3490,null));};exports[_0xb087('0x3c')]=function(_0x12c676,_0xee09f5){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x12c676[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xee09f5,null))[_0xb087('0x25')](removeEntity(_0xee09f5,null))[_0xb087('0xc9')](handleError(_0xee09f5,null));};exports[_0xb087('0xcb')]=function(_0x5ef263,_0x1a7486){return db[_0xb087('0x4b')][_0xb087('0xcb')]()[_0xb087('0x25')](respondWithResult(_0x1a7486,null))[_0xb087('0xc9')](handleError(_0x1a7486,null));};exports['createVidaooSession']=function(_0x33756c,_0x2e8eb1){var _0x189e0a=_0x33756c[_0xb087('0xc5')]['id'];var _0x52268a;var _0x259ac0;var _0x547968;return db[_0xb087('0x4b')]['findOne']({'where':{'id':_0x189e0a}})['then'](function(_0x321da9){_0x52268a=_0x321da9;return db[_0xb087('0xcc')][_0xb087('0xcd')]({'where':{'id':_0x321da9['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xb087('0xce'),_0xb087('0xcf'),_0xb087('0xd0'),_0xb087('0xd1')],'raw':!![]});})[_0xb087('0x25')](function(_0x48a94f){if(_0x48a94f&&_0x48a94f[_0xb087('0xd2')]&&_0x48a94f[_0xb087('0xce')]){_0x259ac0=_0x48a94f;var _0x290338={'interaction':{'id':_0x189e0a},'agent':{'id':_0x33756c[_0xb087('0xa6')]['id'],'name':_0x33756c[_0xb087('0xa6')][_0xb087('0x3d')],'fullname':_0x33756c['user']['fullname'],'email':_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]},'contact':_0x33756c['body'][_0xb087('0x40')],'account':_0x33756c['body']['account']};var _0x471c54={'rejectUnauthorized':![],'method':_0xb087('0xd4'),'url':_0xb087('0xd5'),'headers':{'X-APIKEY':_0x48a94f[_0xb087('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]],'buttons':null,'topic':_0x259ac0[_0xb087('0xcf')],'note':_[_0xb087('0xd6')](_0x259ac0[_0xb087('0xd0')])?null:getMustacheRender(_0x259ac0[_0xb087('0xd0')],_0x290338),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x259ac0['vidaooMetadata'])){var _0x2ebe58=getMustacheRender(_0x259ac0['vidaooMetadata'],_0x290338);var _0x173a1b=JSON['parse'](_0x2ebe58);_0x471c54['body'][_0xb087('0xd7')]=_0x173a1b;}}catch(_0x2e3036){throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xd9'));}return rp(_0x471c54);}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xda'));}})[_0xb087('0x25')](function(_0x2fdcee){_0x547968=_0x2fdcee;if(_0x547968['id']){var _0x5ae13d={'body':_0x547968[_0xb087('0xdb')],'ChatWebsiteId':_0x259ac0['id'],'ChatInteractionId':_0x52268a['id'],'direction':'out','UserId':_0x33756c[_0xb087('0xa6')]['id']};return db[_0xb087('0xdc')]['create'](_0x5ae13d,{});}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x52268a[_0xb087('0xdd')]({'vidaooSessionId':_0x547968['id']});})['then'](respondWithResult(_0x2e8eb1,null))[_0xb087('0xc9')](handleError(_0x2e8eb1,null));};exports['customUpdate']=function(_0x1e04ff,_0x1a99a3){if(_0x1e04ff[_0xb087('0x3f')]['id']){delete _0x1e04ff['body']['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1e04ff[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xde')],'as':_0xb087('0xdf')}]})[_0xb087('0x25')](handleEntityNotFound(_0x1a99a3,null))[_0xb087('0x25')](saveUpdates(_0x1e04ff[_0xb087('0x3f')],null))[_0xb087('0x25')](respondWithResult(_0x1a99a3,null))[_0xb087('0xc9')](handleError(_0x1a99a3,null));};exports['abandon']=function(_0x3a5432,_0x520aa9,_0x31d03d){if(_0x3a5432[_0xb087('0x3f')]['id']){delete _0x3a5432[_0xb087('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3a5432['params']['id']}})[_0xb087('0x25')](function(_0xfaa17f){if(!_0xfaa17f){logger[_0xb087('0x2a')](_0xb087('0xe0'),_0xb087('0xe1'),0x194,_0xb087('0xe2'));_0x520aa9[_0xb087('0x2e')](0x194);}else{if(_0xfaa17f['UserId']){throw new db[(_0xb087('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xfaa17f;})['then'](function(_0x4cde01){if(_0x4cde01){return _0x4cde01[_0xb087('0x3b')]({'closed':_0x3a5432[_0xb087('0x3f')]['closed'],'disposition':_0x3a5432[_0xb087('0x3f')][_0xb087('0xe3')]})[_0xb087('0x25')](function(_0x500a2b){return _0x500a2b;});}})[_0xb087('0x25')](function(_0x11a1a5){return respondWithRpcPromise('AbandonInteraction',_0xb087('0xe1'),_0x3a5432[_0xb087('0x3f')],client9004);})[_0xb087('0x25')](respondWithResult(_0x520aa9,null))[_0xb087('0xc9')](handleError(_0x520aa9,null));};exports['attachmentUpload']=function(_0x270e65,_0x10c680,_0x164371){_0x270e65[_0xb087('0x3f')][_0xb087('0x3d')]=_0x270e65[_0xb087('0xe4')]['originalname'];_0x270e65[_0xb087('0x3f')]['basename']=_0x270e65[_0xb087('0xe4')][_0xb087('0xe5')];_0x270e65['body'][_0xb087('0x4d')]=_0x270e65['file']['mimetype'];return db['Attachment'][_0xb087('0xca')](_0x270e65[_0xb087('0x3f')])[_0xb087('0x25')](respondWithResult(_0x10c680,0xc9))[_0xb087('0xc9')](handleError(_0x10c680,null));};exports[_0xb087('0xe6')]=function(_0x1e0751,_0x2831b4,_0x218fe3){return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1e0751['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2831b4,null))[_0xb087('0x25')](function(_0x1babd3){if(_0x1babd3){if(_0x1babd3[_0xb087('0xe7')]){return _0x2831b4['status'](0x193)['json']({'status':0x193,'message':_0xb087('0xe8')});}return db[_0xb087('0xe9')][_0xb087('0xcd')]({'where':{'id':_0x1e0751[_0xb087('0x50')][_0xb087('0xea')]},'raw':!![]})[_0xb087('0x25')](handleEntityNotFound(_0x2831b4,null));}})['then'](function(_0x52341e){if(_0x52341e){var _0x54eed6=_0x52341e[_0xb087('0xeb')]!==null;var _0x12d277=path[_0xb087('0xec')](config[_0xb087('0xed')],'server/files/attachments/');if(_0x54eed6){_0x12d277=path[_0xb087('0xec')](_0x12d277,_0xb087('0xee'));}var _0x1b5422=path[_0xb087('0xec')](_0x12d277,_0x52341e[_0xb087('0xef')]);return _0x2831b4[_0xb087('0xf0')](_0x1b5422);}})[_0xb087('0xc9')](handleError(_0x2831b4,null));};exports[_0xb087('0xf1')]=function(_0x120012,_0x385065){var _0x56e768=null;var _0x5a2142=null;var _0x24171a=null;var _0x39577d=null;if(_0x120012[_0xb087('0x3f')]['id']){delete _0x120012[_0xb087('0x3f')]['id'];}if(_0x120012[_0xb087('0x3f')][_0xb087('0xf2')]){_0x39577d=path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0xf3'),util[_0xb087('0xf4')](_0xb087('0xf5'),Date[_0xb087('0xf6')]()));_0x120012[_0xb087('0x3f')][_0xb087('0xf7')]=_0x39577d;}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x120012[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xdc')],'as':_0xb087('0xf8'),'include':[{'model':db[_0xb087('0x81')],'as':_0xb087('0x81')}]}]})[_0xb087('0x25')](handleEntityNotFound(_0x385065,null))[_0xb087('0x25')](saveUpdates(_0x120012[_0xb087('0x3f')],null))[_0xb087('0x25')](function(_0x365d41){if(_0x365d41){_0x56e768=_0x365d41;return db[_0xb087('0xcc')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x89')]}});}})[_0xb087('0x25')](function(_0x159082){if(_0x159082){_0x24171a=_0x159082;return db[_0xb087('0xde')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x7d')]}});}})[_0xb087('0x25')](function(_0x2d8c34){if(_0x2d8c34){_0x5a2142=_0x2d8c34;if(_0x39577d){var _0x5a50a1=null;for(var _0x57186a=0x1;_0x57186a<_0x56e768['Messages'][_0xb087('0x54')];++_0x57186a){_0x5a50a1=_0x56e768[_0xb087('0xf8')][_0x57186a];var _0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util['format'](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');var _0x39f701=_0x120012[_0xb087('0x3f')][_0xb087('0xfc')]||util[_0xb087('0xf4')](_0xb087('0xf9'),_0xb087('0xfd'),_0x5a50a1[_0xb087('0x7d')]);switch(_0x24171a['agentIdentifier']){case _0xb087('0xfe'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a['agentAlias'],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');break;case _0xb087('0xff'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x100')]||_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;case _0xb087('0x101'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;default:_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1['UserId']):_0xb087('0xfb');}var _0x2c85ed=util[_0xb087('0xf4')](_0xb087('0x102'),moment(_0x5a50a1['createdAt'])[_0xb087('0xf4')](_0xb087('0x103')),_0x5a50a1[_0xb087('0x104')]==='in'?_0x39f701:_0x4cbc90,_0x5a50a1[_0xb087('0x3f')]);if(!_0x5a50a1[_0xb087('0x105')]){fs['appendFileSync'](_0x39577d,_0x2c85ed);}}return db[_0xb087('0x106')][_0xb087('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0xb087('0x107')],'as':_0xb087('0x108'),'raw':!![]}]});}}})[_0xb087('0x25')](function(_0x17ad89){if(_0x17ad89&&_0x17ad89[_0xb087('0x108')]&&_0x120012[_0xb087('0x3f')]){var _0x58a76b={'tls':{'rejectUnauthorized':![]}};if(_0x17ad89[_0xb087('0x108')][_0xb087('0x109')]){_0x58a76b['service']=_0x17ad89[_0xb087('0x108')][_0xb087('0x109')];}else{_0x58a76b['host']=_0x17ad89[_0xb087('0x108')][_0xb087('0x10a')];_0x58a76b[_0xb087('0x10b')]=_0x17ad89[_0xb087('0x108')][_0xb087('0x10b')];_0x58a76b[_0xb087('0x10c')]=_0x17ad89[_0xb087('0x108')]['secure'];}if(_0x17ad89[_0xb087('0x108')][_0xb087('0x10d')]){_0x58a76b[_0xb087('0x10e')]={'user':_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')],'pass':_0x17ad89[_0xb087('0x108')]['pass']};}return respondWithRpcPromise(_0xb087('0x10f'),_0xb087('0x110'),{'account':_0x58a76b,'message':{'from':util[_0xb087('0xf4')](_0xb087('0x111'),_0x17ad89[_0xb087('0x3d')],_0x17ad89['email']||_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')]),'to':_0x120012[_0xb087('0x3f')]['mailTranscript'],'subject':_0xb087('0x112'),'text':util['format'](_0xb087('0x113'),_0x120012['body'][_0xb087('0xf2')]),'attachments':[{'path':_0x39577d}]}})['then'](function(){return _0x56e768;})[_0xb087('0xc9')](function(_0x3d916e){console['error'](_0x3d916e);});}else{return _0x56e768;}})[_0xb087('0x25')](respondWithStatusCode(_0x385065,0xc8))['catch'](handleError(_0x385065,null));};exports['addMessage']=function(_0x5180ad,_0x396660,_0x4b2169){return db[_0xb087('0xdc')]['find']({'where':{'id':_0x5180ad['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x396660,null))[_0xb087('0x25')](function(_0x371655){if(_0x371655){return _0x371655[_0xb087('0x114')](_0x5180ad[_0xb087('0x3f')]['ids'],_[_0xb087('0x115')](_0x5180ad[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{});}})[_0xb087('0x25')](respondWithResult(_0x396660,null))[_0xb087('0xc9')](handleError(_0x396660,null));};exports[_0xb087('0x117')]=function(_0x1ca818,_0x2ec638,_0x57d42a){var _0x451c8a={'raw':![],'where':{}};var _0x3768db={};var _0x1db8ba={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1ca818[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x2ec638,null))['then'](function(_0x4904ea){if(_0x4904ea){_0x3768db[_0xb087('0x4f')]=_[_0xb087('0x86')](db[_0xb087('0xdc')][_0xb087('0xc6')]);_0x3768db['query']=_[_0xb087('0x86')](_0x1ca818[_0xb087('0x50')]);_0x3768db[_0xb087('0x59')]=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],_0x3768db['query']);_0x451c8a['attributes']=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],qs['fields'](_0x1ca818[_0xb087('0x50')][_0xb087('0x53')]));_0x451c8a[_0xb087('0x52')]=_0x451c8a[_0xb087('0x52')][_0xb087('0x54')]?_0x451c8a[_0xb087('0x52')]:_0x3768db[_0xb087('0x4f')];if(!_0x1ca818['query'][_0xb087('0x55')](_0xb087('0x118'))){_0x451c8a[_0xb087('0x34')]=qs['limit'](_0x1ca818['query'][_0xb087('0x34')]);_0x451c8a[_0xb087('0x32')]=qs[_0xb087('0x32')](_0x1ca818[_0xb087('0x50')]['offset']);}_0x451c8a[_0xb087('0x56')]=qs[_0xb087('0x57')](_0x1ca818[_0xb087('0x50')]['sort']);_0x451c8a['where']=qs[_0xb087('0x59')](_['pick'](_0x1ca818[_0xb087('0x50')],_0x3768db[_0xb087('0x59')]));_0x451c8a['where']['ChatInteractionId']=_0x4904ea['id'];if(_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]){_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a['where'],{'$or':_[_0xb087('0x44')](_0x451c8a['attributes'],function(_0x52cc1a){var _0x117552={};_0x117552[_0x52cc1a]={'$like':'%'+_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]+'%'};return _0x117552;})});}if(_0x1ca818[_0xb087('0x50')][_0xb087('0x8d')]){var _0x484bb5=_0x1ca818[_0xb087('0x50')]['$gte']['split'](',');var _0x46f8cf={};_0x46f8cf[_0x484bb5[0x0]]={'$gte':moment(_0x484bb5[0x1])[_0xb087('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a[_0xb087('0x8f')],_0x46f8cf);}_0x451c8a=_[_0xb087('0xae')]({},_0x451c8a,_0x1ca818['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x451c8a[_0xb087('0x8f')]})[_0xb087('0x25')](function(_0x2c3d1b){_0x1db8ba['count']=_0x2c3d1b;if(_0x1ca818['query']['includeAll']){_0x451c8a[_0xb087('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb087('0x11a')](_0x451c8a);})[_0xb087('0x25')](function(_0x4c1577){_0x1db8ba[_0xb087('0x11b')]=_0x4c1577;return _0x1db8ba;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x2ec638,_0x451c8a))[_0xb087('0xc9')](handleError(_0x2ec638,null));};exports[_0xb087('0x11c')]=function(_0xad3eae,_0xb6682a,_0x1dbeb1){var _0x2caa79={'where':{}},_0x521e0c={},_0x1ffbd9={'count':0x0,'rows':[]};return db[_0xb087('0x4b')][_0xb087('0xcd')]({'where':{'id':_0xad3eae['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xb6682a,null))[_0xb087('0x25')](function(_0x3fd51b){if(_0x3fd51b){_0x521e0c[_0xb087('0x4f')]=_['keys'](db['ChatMessage'][_0xb087('0xc6')]);_0x521e0c[_0xb087('0x50')]=_[_0xb087('0x86')](_0xad3eae[_0xb087('0x50')]);_0x521e0c[_0xb087('0x59')]=_[_0xb087('0x51')](_0x521e0c['model'],_0x521e0c['query']);_0x2caa79[_0xb087('0x52')]=_[_0xb087('0x51')](_0x521e0c[_0xb087('0x4f')],qs[_0xb087('0x53')](_0xad3eae['query'][_0xb087('0x53')]));_0x2caa79[_0xb087('0x52')]=_0x2caa79[_0xb087('0x52')][_0xb087('0x54')]?_0x2caa79[_0xb087('0x52')]:_0x521e0c[_0xb087('0x4f')];if(!_0xad3eae[_0xb087('0x50')][_0xb087('0x55')](_0xb087('0x118'))){_0x2caa79[_0xb087('0x34')]=qs[_0xb087('0x34')](_0xad3eae[_0xb087('0x50')][_0xb087('0x34')]);_0x2caa79[_0xb087('0x32')]=qs[_0xb087('0x32')](_0xad3eae[_0xb087('0x50')][_0xb087('0x32')]);}_0x2caa79[_0xb087('0x56')]=qs[_0xb087('0x57')](_0xad3eae[_0xb087('0x50')]['sort']);_0x2caa79[_0xb087('0x8f')]=qs[_0xb087('0x59')](_['pick'](_0xad3eae[_0xb087('0x50')],_0x521e0c[_0xb087('0x59')]));_0x2caa79[_0xb087('0x8f')]['ChatInteractionId']=_0x3fd51b['id'];if(_0xad3eae[_0xb087('0x50')]['filter']){_0x2caa79['where']=_[_0xb087('0xae')](_0x2caa79[_0xb087('0x8f')],{'$or':_[_0xb087('0x44')](_0x2caa79[_0xb087('0x52')],function(_0x4a1749){var _0x300e08={};_0x300e08[_0x4a1749]={'$like':'%'+_0xad3eae['query'][_0xb087('0x119')]+'%'};return _0x300e08;})});}_0x2caa79[_0xb087('0x8f')][_0xb087('0x105')]=![];if(_0xad3eae['query']['id']){_0x2caa79['where']['id']={'$gt':_0xad3eae[_0xb087('0x50')]['id']};}_0x2caa79=_['merge']({},_0x2caa79,_0xad3eae['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x2caa79['where']})[_0xb087('0x25')](function(_0x241c68){_0x1ffbd9[_0xb087('0x35')]=_0x241c68;_0x2caa79[_0xb087('0xc7')]=[];if(_0xad3eae['query']['includeAgent']){_0x2caa79[_0xb087('0xc7')][_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id','fullname',_0xb087('0x100')]});}if(_0xad3eae[_0xb087('0x50')][_0xb087('0x11d')]){_0x2caa79[_0xb087('0xc7')]=[{'all':!![]}];}return db[_0xb087('0xdc')][_0xb087('0x11a')](_0x2caa79);})[_0xb087('0x25')](function(_0x3b5740){_0x1ffbd9['rows']=_0x3b5740;return _0x1ffbd9;});}})[_0xb087('0x25')](respondWithFilteredResult(_0xb6682a,_0x2caa79))[_0xb087('0xc9')](handleError(_0xb6682a,null));};exports[_0xb087('0x11e')]=function(_0x594ddc,_0x30521e,_0x13acd8){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x594ddc[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x30521e,null))['then'](function(_0x528edd){if(_0x528edd){return _0x528edd[_0xb087('0x11f')](_0x594ddc[_0xb087('0x3f')][_0xb087('0x116')],_[_0xb087('0x115')](_0x594ddc[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{})['spread'](function(){return db['Tag'][_0xb087('0x11a')]({'attributes':['id',_0xb087('0x3d'),'color'],'where':{'id':_0x594ddc['body'][_0xb087('0x116')]}});})[_0xb087('0x25')](function(_0x24ae87){socket['emit'](_0xb087('0x120'),{'id':Number(_0x594ddc[_0xb087('0xc5')]['id']),'tags':_0x24ae87||[]});return{'id':Number(_0x594ddc['params']['id']),'tags':_0x24ae87||[]};});}})[_0xb087('0x25')](respondWithResult(_0x30521e,null))['catch'](handleError(_0x30521e,null));};exports['removeTags']=function(_0x592d18,_0x5cbda4,_0x5a182e){return db[_0xb087('0x4b')]['find']({'where':{'id':_0x592d18[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x5cbda4,null))['then'](function(_0x12f2b2){if(_0x12f2b2){return _0x12f2b2[_0xb087('0x121')](_0x592d18[_0xb087('0x50')][_0xb087('0x116')]);}})['then'](respondWithStatusCode(_0x5cbda4,null))[_0xb087('0xc9')](handleError(_0x5cbda4,null));};exports[_0xb087('0xf0')]=function(_0x17d60b,_0x5df18d){var _0x538812=moment()[_0xb087('0x122')]()[_0xb087('0xac')]();var _0x39732b=path[_0xb087('0xec')](config[_0xb087('0xed')],'server',_0xb087('0x123'),'tmp');var _0x1d8582=path[_0xb087('0xec')](config['root'],_0xb087('0x124'),'files',_0xb087('0x125'));var _0x3f2e19=path[_0xb087('0xec')](_0x39732b,_0x538812);var _0x2d500c=util[_0xb087('0xf4')](_0xb087('0x126'),_0x17d60b[_0xb087('0xc5')]['id'],_0x538812);var _0x407837=path['join'](_0x39732b,_0x2d500c);var _0x220896=[];_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id',_0xb087('0x45')],'raw':!![]});_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xde')],'as':_0xb087('0xdf'),'attributes':['id',_0xb087('0x127'),'lastName'],'raw':!![]});if(_0x17d60b[_0xb087('0x50')][_0xb087('0x125')]){_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xe9')],'as':_0xb087('0xe9'),'raw':!![]});}var _0x6fa760=[{'model':db['ChatMessage'],'as':_0xb087('0xf8'),'attributes':['id',_0xb087('0x3f'),_0xb087('0x8b'),'direction',_0xb087('0x105'),_0xb087('0x92')],'include':_0x220896}];_0x6fa760[_0xb087('0xc2')]({'model':db['ChatWebsite'],'as':_0xb087('0x128'),'attributes':['id',_0xb087('0x3d')]});_0x6fa760['push']({'model':db[_0xb087('0x81')],'as':_0xb087('0x129'),'attributes':['id',_0xb087('0x45')]});return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x17d60b['params']['id']},'include':_0x6fa760})[_0xb087('0x25')](handleEntityNotFound(_0x5df18d,null))[_0xb087('0x25')](function(_0x196111){if(_0x196111){var _0x2711ed=_0x196111['get']({'plain':!![]});fs['mkdirSync'](_0x3f2e19);var _0x2aa136={'channel':'Chat','account':_0x2711ed[_0xb087('0x128')][_0xb087('0x3d')],'agent':_0x2711ed['Owner']?_0x2711ed[_0xb087('0x129')][_0xb087('0x45')]:'N.A.','createdAt':moment(_0x2711ed['createdAt'])[_0xb087('0xf4')](_0xb087('0x12a'))[_0xb087('0xac')](),'closedAt':_0x2711ed['closed']?moment(_0x2711ed['closedAt'])['format'](_0xb087('0x12a'))[_0xb087('0xac')]():'','disposition':_0x2711ed[_0xb087('0xe3')],'chatInfo':{'browser':_0x2711ed['browserName'],'os':_0x2711ed['osName'],'referer':_0x2711ed[_0xb087('0x12b')],'customerIp':_0x2711ed[_0xb087('0x12c')],'customerPort':_0x2711ed[_0xb087('0x12d')]?_0x2711ed[_0xb087('0x12d')]:_0xb087('0x12e')},'messages':_(_0x2711ed[_0xb087('0xf8')])[_0xb087('0x12f')]()[_0xb087('0x119')]({'secret':![]})[_0xb087('0x44')](function(_0x4392f7){if(_0x4392f7[_0xb087('0xe9')]){var _0x2ce41b=path[_0xb087('0xec')](_0x1d8582,_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]);if(fs[_0xb087('0x130')](_0x2ce41b)){fs['createReadStream'](_0x2ce41b)[_0xb087('0x131')](fs[_0xb087('0x132')](path['join'](_0x3f2e19,_0x4392f7['Attachment'][_0xb087('0xef')])));}}return{'date':moment(_0x4392f7[_0xb087('0x8b')])[_0xb087('0xf4')](_0xb087('0x12a'))['toString'](),'sender':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?_0x4392f7['User']?_0x4392f7['User'][_0xb087('0x45')]:_0xb087('0xfb'):_0x4392f7[_0xb087('0xdf')]['firstName']+(_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]?'\x20'+_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]:''),'body':_0x4392f7[_0xb087('0xe9')]?_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]:_0x4392f7['body'],'direction':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?'A':'C','secret':_0x4392f7[_0xb087('0x105')],'read':_0x4392f7[_0xb087('0x92')],'attachment':_0x4392f7[_0xb087('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0x124'),'views',_0xb087('0x135')),{'interaction':_0x2aa136})[_0xb087('0x25')](function(_0x3e4bec){var _0x52b038=path[_0xb087('0xec')](_0x3f2e19,_0xb087('0x136')+_0x2711ed['id']+'-'+_0x538812+_0xb087('0x137'));var _0x4e6b9f={'path':_0x52b038,'channel':'Chat','interactionId':_0x2711ed['id']};return pdf['createPdfFromHTML'](_0x3e4bec,_0x4e6b9f);})[_0xb087('0x25')](function(){return new BPromise(function(_0x22dea9,_0x1c9337){zipdir(_0x3f2e19,{'saveTo':_0x407837},function(_0x3d0278,_0x1c8982){if(_0x3d0278)return _0x1c9337(_0x3d0278);return _0x22dea9(_0x1c8982);});})[_0xb087('0x25')](function(){return new BPromise(function(_0x31b3e7,_0x6b8337){rimraf(_0x3f2e19,function(_0x348c92){if(_0x348c92)_0x6b8337(_0x348c92);return _0x31b3e7();});});})[_0xb087('0x25')](function(){return _0x5df18d[_0xb087('0xf0')](_0x407837,_0x2d500c,function(_0x218e1c){if(_0x218e1c){console[_0xb087('0x138')](_0xb087('0x139'),_0x218e1c);}else{fs[_0xb087('0x13a')](_0x407837);}});});});}else{return _0x5df18d[_0xb087('0x2e')](0xc8);}})[_0xb087('0xc9')](handleError(_0x5df18d,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d14cab6..1424377 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 _0xe47b=['setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','exports','events','ChatInteraction','../../mysqldb','ChatMessage'];(function(_0x1376e1,_0x2b7901){var _0x4c9efe=function(_0x2c7f61){while(--_0x2c7f61){_0x1376e1['push'](_0x1376e1['shift']());}};_0x4c9efe(++_0x2b7901);}(_0xe47b,0x12c));var _0xbe47=function(_0x4d4d64,_0x1984e8){_0x4d4d64=_0x4d4d64-0x0;var _0x25cbd8=_0xe47b[_0x4d4d64];return _0x25cbd8;};'use strict';var EventEmitter=require(_0xbe47('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xbe47('0x1')];var ChatMessage=require(_0xbe47('0x2'))['db'][_0xbe47('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbe47('0x4')](0x0);var events={'afterCreate':_0xbe47('0x5'),'afterUpdate':'update','afterDestroy':_0xbe47('0x6')};function emitEvent(_0xb58b0a){return function(_0x885c1,_0x280cb3,_0x9d8f61){_0x885c1[_0xbe47('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x37f405){_0x885c1[_0xbe47('0x8')](_0xbe47('0x9'),_0x37f405['map'](function(_0x58c841){return{'id':_0x58c841['id']};}));return ChatMessage[_0xbe47('0xa')]({'where':{'ChatInteractionId':_0x885c1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbe47('0xb')](function(_0x28f971){_0x885c1['setDataValue'](_0xbe47('0xc'),_0x28f971[_0xbe47('0xd')]);ChatInteractionEvents['emit'](_0xb58b0a+':'+_0x885c1['id'],_0x885c1);ChatInteractionEvents[_0xbe47('0xe')](_0xb58b0a,_0x885c1);_0x9d8f61(null);})['catch'](_0x9d8f61(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xbe47('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9c30=['../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','then','map','unreadMessages','length','emit','catch','hook','exports','events'];(function(_0x1ab740,_0x480e96){var _0x9016a5=function(_0x8b2a9c){while(--_0x8b2a9c){_0x1ab740['push'](_0x1ab740['shift']());}};_0x9016a5(++_0x480e96);}(_0x9c30,0x12b));var _0x09c3=function(_0x1d9731,_0x317bf2){_0x1d9731=_0x1d9731-0x0;var _0x3fbaf3=_0x9c30[_0x1d9731];return _0x3fbaf3;};'use strict';var EventEmitter=require(_0x09c3('0x0'));var ChatInteraction=require(_0x09c3('0x1'))['db'][_0x09c3('0x2')];var ChatMessage=require(_0x09c3('0x1'))['db'][_0x09c3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09c3('0x4'),'afterUpdate':_0x09c3('0x5'),'afterDestroy':_0x09c3('0x6')};function emitEvent(_0x394b69){return function(_0x38f201,_0x196309,_0x550a1c){_0x38f201['getUsers']({'attributes':['id'],'raw':!![]})[_0x09c3('0x7')](function(_0x19bb3e){_0x38f201['setDataValue']('Users',_0x19bb3e[_0x09c3('0x8')](function(_0x5a33f9){return{'id':_0x5a33f9['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x38f201['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x34ebca){_0x38f201['setDataValue'](_0x09c3('0x9'),_0x34ebca[_0x09c3('0xa')]);ChatInteractionEvents[_0x09c3('0xb')](_0x394b69+':'+_0x38f201['id'],_0x38f201);ChatInteractionEvents[_0x09c3('0xb')](_0x394b69,_0x38f201);_0x550a1c(null);})[_0x09c3('0xc')](_0x550a1c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x09c3('0xd')](e,emitEvent(event));}}module[_0x09c3('0xe')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 94853ea..adc1b51 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 _0xdc5d=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0xdc5d,0x16e));var _0xddc5=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0xdc5d[_0x4f0e62];return _0x117ab8;};'use strict';var _=require('lodash');var util=require(_0xddc5('0x0'));var logger=require(_0xddc5('0x1'))(_0xddc5('0x2'));var moment=require(_0xddc5('0x3'));var BPromise=require('bluebird');var rp=require(_0xddc5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddc5('0x5'));var config=require(_0xddc5('0x6'));var attributes=require(_0xddc5('0x7'));module[_0xddc5('0x8')]=function(_0x37ecf7,_0x37d174){return _0x37ecf7[_0xddc5('0x9')](_0xddc5('0xa'),attributes,{'tableName':_0xddc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc72038,_0x482938,_0x5a2644){if(_0xc72038[_0xddc5('0xc')](_0xddc5('0xd'))){_0xc72038[_0xddc5('0xe')]=moment()[_0xddc5('0xf')](_0xddc5('0x10'));}_0x5a2644(null,_0xc72038);}},'charset':_0xddc5('0x11'),'collate':_0xddc5('0x12')});};
\ No newline at end of file
+var _0x2468=['ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x831541,_0x2c79fe){var _0x4ea2b4=function(_0x2f881b){while(--_0x2f881b){_0x831541['push'](_0x831541['shift']());}};_0x4ea2b4(++_0x2c79fe);}(_0x2468,0xb2));var _0x8246=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x2468[_0x43b584];return _0x48f27b;};'use strict';var _=require(_0x8246('0x0'));var util=require(_0x8246('0x1'));var logger=require(_0x8246('0x2'))(_0x8246('0x3'));var moment=require(_0x8246('0x4'));var BPromise=require(_0x8246('0x5'));var rp=require(_0x8246('0x6'));var fs=require('fs');var path=require(_0x8246('0x7'));var rimraf=require('rimraf');var config=require(_0x8246('0x8'));var attributes=require(_0x8246('0x9'));module[_0x8246('0xa')]=function(_0xb86a62,_0xe65630){return _0xb86a62[_0x8246('0xb')](_0x8246('0xc'),attributes,{'tableName':_0x8246('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47f614,_0x174289,_0xd9b5b3){if(_0x47f614[_0x8246('0xe')]('closed')){_0x47f614['closedAt']=moment()[_0x8246('0xf')](_0x8246('0x10'));}_0xd9b5b3(null,_0x47f614);}},'charset':_0x8246('0x11'),'collate':_0x8246('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 67a379e..dfd62d5 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 _0x184b=['message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','ids','omit','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xc70154,_0x18ca26){var _0x487c81=function(_0x467414){while(--_0x467414){_0xc70154['push'](_0xc70154['shift']());}};_0x487c81(++_0x18ca26);}(_0x184b,0x147));var _0xb184=function(_0x3c7310,_0x151024){_0x3c7310=_0x3c7310-0x0;var _0x577187=_0x184b[_0x3c7310];return _0x577187;};'use strict';var _=require(_0xb184('0x0'));var util=require(_0xb184('0x1'));var moment=require(_0xb184('0x2'));var BPromise=require(_0xb184('0x3'));var rs=require(_0xb184('0x4'));var fs=require('fs');var Redis=require(_0xb184('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb184('0x6'));var config=require('../../config/environment');var jayson=require(_0xb184('0x7'));var client=jayson[_0xb184('0x8')][_0xb184('0x9')]({'port':0x232a});config[_0xb184('0xa')]=_[_0xb184('0xb')](config[_0xb184('0xa')],{'host':_0xb184('0xc'),'port':0x18eb});var socket=require(_0xb184('0xd'))(new Redis(config[_0xb184('0xa')]));require(_0xb184('0xe'))[_0xb184('0xf')](socket);function respondWithRpcPromise(_0x28cc96,_0x33dc31,_0x298a74){return new BPromise(function(_0x24e9a1,_0x2b692e){return client[_0xb184('0x10')](_0x28cc96,_0x298a74)[_0xb184('0x11')](function(_0x43f806){logger[_0xb184('0x12')](_0xb184('0x13'),_0x33dc31,_0xb184('0x14'));logger['debug'](_0xb184('0x15'),_0x33dc31,'request\x20sent',JSON[_0xb184('0x16')](_0x43f806));if(_0x43f806[_0xb184('0x17')]){if(_0x43f806[_0xb184('0x17')][_0xb184('0x18')]===0x1f4){logger[_0xb184('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x33dc31,_0x43f806[_0xb184('0x17')][_0xb184('0x19')]);return _0x2b692e(_0x43f806[_0xb184('0x17')]['message']);}logger[_0xb184('0x17')](_0xb184('0x13'),_0x33dc31,_0x43f806['error'][_0xb184('0x19')]);return _0x24e9a1(_0x43f806['error']['message']);}else{logger[_0xb184('0x12')](_0xb184('0x13'),_0x33dc31,_0xb184('0x14'));_0x24e9a1(_0x43f806[_0xb184('0x1a')][_0xb184('0x19')]);}})['catch'](function(_0x59799b){logger[_0xb184('0x17')](_0xb184('0x13'),_0x33dc31,_0x59799b);_0x2b692e(_0x59799b);});});}exports[_0xb184('0x1b')]=function(_0x17a87b){var _0x37b2a8=this;return new Promise(function(_0x161c8a,_0x25a475){return db[_0xb184('0x1c')][_0xb184('0x1d')](_0x17a87b[_0xb184('0x1e')],{'raw':_0x17a87b[_0xb184('0x1f')]?_0x17a87b[_0xb184('0x1f')][_0xb184('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17a87b[_0xb184('0x1f')]?_0x17a87b['options'][_0xb184('0x21')]||null:null,'attributes':_0x17a87b[_0xb184('0x1f')]?_0x17a87b[_0xb184('0x1f')][_0xb184('0x22')]||null:null,'limit':_0x17a87b[_0xb184('0x1f')]?_0x17a87b[_0xb184('0x1f')][_0xb184('0x23')]||null:null})['then'](function(_0x18c8ab){logger[_0xb184('0x12')](_0xb184('0x1b'),_0x17a87b);logger['debug'](_0xb184('0x1b'),_0x17a87b,JSON[_0xb184('0x16')](_0x18c8ab));_0x161c8a(_0x18c8ab);})[_0xb184('0x24')](function(_0x2ac8ba){logger[_0xb184('0x17')](_0xb184('0x1b'),_0x2ac8ba[_0xb184('0x19')],_0x17a87b);_0x25a475(_0x37b2a8['error'](0x1f4,_0x2ac8ba[_0xb184('0x19')]));});});};exports[_0xb184('0x25')]=function(_0x12b7d7){return new Promise(function(_0x364891,_0x593b0b){return db[_0xb184('0x1c')][_0xb184('0x26')]({'where':_0x12b7d7[_0xb184('0x1f')]?_0x12b7d7['options'][_0xb184('0x21')]||null:null})['then'](function(_0x56cc7a){if(_0x56cc7a){return _0x56cc7a['addTags'](_0x12b7d7[_0xb184('0x1e')][_0xb184('0x27')],_[_0xb184('0x28')](_0x12b7d7[_0xb184('0x1e')],[_0xb184('0x27'),'id'])||{});}})[_0xb184('0x29')](function(_0x3cb08){logger[_0xb184('0x12')]('AddTags',_0x12b7d7);logger[_0xb184('0x2a')](_0xb184('0x2b'),_0x12b7d7,JSON['stringify'](_0x3cb08));_0x364891(_0x3cb08);})[_0xb184('0x24')](function(_0x95292d){logger[_0xb184('0x17')](_0xb184('0x2b'),_0x95292d[_0xb184('0x19')],_0x12b7d7);_0x593b0b(_this[_0xb184('0x17')](0x1f4,_0x95292d['message']));});});};
\ No newline at end of file
+var _0x1c4e=['stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','find','where','addTags','ids','omit','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4908cd,_0x36ca82){var _0x4b92ee=function(_0x926f5f){while(--_0x926f5f){_0x4908cd['push'](_0x4908cd['shift']());}};_0x4b92ee(++_0x36ca82);}(_0x1c4e,0x132));var _0xe1c4=function(_0x590455,_0x338a42){_0x590455=_0x590455-0x0;var _0x1b5a98=_0x1c4e[_0x590455];return _0x1b5a98;};'use strict';var _=require('lodash');var util=require(_0xe1c4('0x0'));var moment=require(_0xe1c4('0x1'));var BPromise=require(_0xe1c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1c4('0x3'));var db=require(_0xe1c4('0x4'))['db'];var utils=require(_0xe1c4('0x5'));var logger=require(_0xe1c4('0x6'))(_0xe1c4('0x7'));var config=require(_0xe1c4('0x8'));var jayson=require(_0xe1c4('0x9'));var client=jayson[_0xe1c4('0xa')][_0xe1c4('0xb')]({'port':0x232a});config[_0xe1c4('0xc')]=_[_0xe1c4('0xd')](config[_0xe1c4('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1c4('0xc')]));require('./chatInteraction.socket')[_0xe1c4('0xe')](socket);function respondWithRpcPromise(_0x3b5dbf,_0x4934ef,_0x57cd2b){return new BPromise(function(_0x5ee724,_0x13ac33){return client[_0xe1c4('0xf')](_0x3b5dbf,_0x57cd2b)[_0xe1c4('0x10')](function(_0xc46d2){logger[_0xe1c4('0x11')](_0xe1c4('0x12'),_0x4934ef,_0xe1c4('0x13'));logger[_0xe1c4('0x14')](_0xe1c4('0x15'),_0x4934ef,_0xe1c4('0x13'),JSON[_0xe1c4('0x16')](_0xc46d2));if(_0xc46d2['error']){if(_0xc46d2[_0xe1c4('0x17')][_0xe1c4('0x18')]===0x1f4){logger['error'](_0xe1c4('0x12'),_0x4934ef,_0xc46d2[_0xe1c4('0x17')][_0xe1c4('0x19')]);return _0x13ac33(_0xc46d2['error'][_0xe1c4('0x19')]);}logger[_0xe1c4('0x17')](_0xe1c4('0x12'),_0x4934ef,_0xc46d2[_0xe1c4('0x17')][_0xe1c4('0x19')]);return _0x5ee724(_0xc46d2[_0xe1c4('0x17')][_0xe1c4('0x19')]);}else{logger[_0xe1c4('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x4934ef,_0xe1c4('0x13'));_0x5ee724(_0xc46d2[_0xe1c4('0x1a')]['message']);}})[_0xe1c4('0x1b')](function(_0x48b5da){logger[_0xe1c4('0x17')](_0xe1c4('0x12'),_0x4934ef,_0x48b5da);_0x13ac33(_0x48b5da);});});}exports[_0xe1c4('0x1c')]=function(_0x45b9c9){var _0x137384=this;return new Promise(function(_0x598152,_0x34a3c9){return db[_0xe1c4('0x1d')][_0xe1c4('0x1e')](_0x45b9c9[_0xe1c4('0x1f')],{'raw':_0x45b9c9[_0xe1c4('0x20')]?_0x45b9c9[_0xe1c4('0x20')][_0xe1c4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b9c9[_0xe1c4('0x20')]?_0x45b9c9[_0xe1c4('0x20')]['where']||null:null,'attributes':_0x45b9c9[_0xe1c4('0x20')]?_0x45b9c9['options'][_0xe1c4('0x22')]||null:null,'limit':_0x45b9c9['options']?_0x45b9c9[_0xe1c4('0x20')]['limit']||null:null})['then'](function(_0x29b4d3){logger['info'](_0xe1c4('0x1c'),_0x45b9c9);logger[_0xe1c4('0x14')](_0xe1c4('0x1c'),_0x45b9c9,JSON[_0xe1c4('0x16')](_0x29b4d3));_0x598152(_0x29b4d3);})[_0xe1c4('0x1b')](function(_0x5af203){logger[_0xe1c4('0x17')](_0xe1c4('0x1c'),_0x5af203[_0xe1c4('0x19')],_0x45b9c9);_0x34a3c9(_0x137384[_0xe1c4('0x17')](0x1f4,_0x5af203[_0xe1c4('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x1ef8a8){return new Promise(function(_0x3123d7,_0x595018){return db['ChatInteraction'][_0xe1c4('0x23')]({'where':_0x1ef8a8[_0xe1c4('0x20')]?_0x1ef8a8['options'][_0xe1c4('0x24')]||null:null})[_0xe1c4('0x10')](function(_0x43f6be){if(_0x43f6be){return _0x43f6be[_0xe1c4('0x25')](_0x1ef8a8[_0xe1c4('0x1f')][_0xe1c4('0x26')],_[_0xe1c4('0x27')](_0x1ef8a8['body'],[_0xe1c4('0x26'),'id'])||{});}})['spread'](function(_0x5d584d){logger['info']('AddTags',_0x1ef8a8);logger[_0xe1c4('0x14')](_0xe1c4('0x28'),_0x1ef8a8,JSON[_0xe1c4('0x16')](_0x5d584d));_0x3123d7(_0x5d584d);})[_0xe1c4('0x1b')](function(_0x101197){logger[_0xe1c4('0x17')](_0xe1c4('0x28'),_0x101197[_0xe1c4('0x19')],_0x1ef8a8);_0x595018(_this['error'](0x1f4,_0x101197['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ec59dc2..f0b5aa6 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 _0x0a24=['./chatInteraction.events','save','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x3733eb,_0x2d9450){var _0x4c80e3=function(_0x365bce){while(--_0x365bce){_0x3733eb['push'](_0x3733eb['shift']());}};_0x4c80e3(++_0x2d9450);}(_0x0a24,0xd0));var _0x40a2=function(_0x4b1eda,_0x1ca265){_0x4b1eda=_0x4b1eda-0x0;var _0x520e6b=_0x0a24[_0x4b1eda];return _0x520e6b;};'use strict';var ChatInteractionEvents=require(_0x40a2('0x0'));var events=[_0x40a2('0x1'),'remove',_0x40a2('0x2')];function createListener(_0x557f8b,_0x3665fb){return function(_0x1e56c7){_0x3665fb[_0x40a2('0x3')](_0x557f8b,_0x1e56c7);};}function removeListener(_0x513c2a,_0x465069){return function(){ChatInteractionEvents[_0x40a2('0x4')](_0x513c2a,_0x465069);};}exports[_0x40a2('0x5')]=function(_0x1abd02){for(var _0x535cca=0x0,_0x518597=events[_0x40a2('0x6')];_0x535cca<_0x518597;_0x535cca++){var _0x136c67=events[_0x535cca];var _0x5e62ef=createListener(_0x40a2('0x7')+_0x136c67,_0x1abd02);ChatInteractionEvents['on'](_0x136c67,_0x5e62ef);}};
\ No newline at end of file
+var _0x0821=['update','emit','removeListener','register','chatInteraction:','./chatInteraction.events','remove'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x0821,0x186));var _0x1082=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x0821[_0x543084];return _0x306a57;};'use strict';var ChatInteractionEvents=require(_0x1082('0x0'));var events=['save',_0x1082('0x1'),_0x1082('0x2')];function createListener(_0x2ee75a,_0x163c0d){return function(_0x5bcf8e){_0x163c0d[_0x1082('0x3')](_0x2ee75a,_0x5bcf8e);};}function removeListener(_0x5ca6a7,_0x92e293){return function(){ChatInteractionEvents[_0x1082('0x4')](_0x5ca6a7,_0x92e293);};}exports[_0x1082('0x5')]=function(_0x56eada){for(var _0x580b5b=0x0,_0x16c816=events['length'];_0x580b5b<_0x16c816;_0x580b5b++){var _0x2ae0f7=events[_0x580b5b];var _0x348b88=createListener(_0x1082('0x6')+_0x2ae0f7,_0x56eada);ChatInteractionEvents['on'](_0x2ae0f7,_0x348b88);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index ef9e36d..f108fe8 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 _0x6f1e=['index','get','/describe','isAuthenticated','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/close','chatinteraction:destroy','destroy','delete','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x6f1e,0x190));var _0xe6f1=function(_0x2549b9,_0x5a5e71){_0x2549b9=_0x2549b9-0x0;var _0x36bd12=_0x6f1e[_0x2549b9];return _0x36bd12;};'use strict';var multer=require('multer');var util=require(_0xe6f1('0x0'));var path=require(_0xe6f1('0x1'));var timeout=require('connect-timeout');var express=require(_0xe6f1('0x2'));var router=express[_0xe6f1('0x3')]();var fs_extra=require(_0xe6f1('0x4'));var auth=require(_0xe6f1('0x5'));var interaction=require(_0xe6f1('0x6'));var config=require('../../config/environment');var controller=require(_0xe6f1('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe6f1('0x8')]);router[_0xe6f1('0x9')](_0xe6f1('0xa'),auth[_0xe6f1('0xb')](),controller[_0xe6f1('0xc')]);router['get'](_0xe6f1('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xe6f1('0xe')]);router[_0xe6f1('0x9')]('/:id/attachment_download',auth[_0xe6f1('0xf')](),controller[_0xe6f1('0x10')]);router[_0xe6f1('0x9')](_0xe6f1('0x11'),auth[_0xe6f1('0xb')](),controller[_0xe6f1('0x12')]);router[_0xe6f1('0x9')](_0xe6f1('0x13'),auth[_0xe6f1('0xf')](),controller[_0xe6f1('0x14')]);router[_0xe6f1('0x9')](_0xe6f1('0x15'),auth[_0xe6f1('0xb')](),controller[_0xe6f1('0x16')]);router['post']('/',auth[_0xe6f1('0xb')](),controller[_0xe6f1('0x17')]);router[_0xe6f1('0x18')](_0xe6f1('0x19'),auth[_0xe6f1('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xe6f1('0x1a')]({'destination':function(_0x110ee6,_0x44a2e5,_0x3c8d7f){_0x3c8d7f(null,path[_0xe6f1('0x1b')](config['root'],_0xe6f1('0x1c')));},'filename':function(_0x35d503,_0x4492d8,_0x209c2c){_0x209c2c(null,util[_0xe6f1('0x1d')](_0xe6f1('0x1e'),Date[_0xe6f1('0x1f')](),_0x4492d8['originalname'][_0xe6f1('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe6f1('0x18')](_0xe6f1('0x21'),upload[_0xe6f1('0x22')](_0xe6f1('0x23')),controller['attachmentUpload']);router['post'](_0xe6f1('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe6f1('0x24')]);router['post'](_0xe6f1('0x25'),auth[_0xe6f1('0xb')](),interaction[_0xe6f1('0x26')](_0xe6f1('0x27'),_0xe6f1('0x28')),controller['addTags']);router[_0xe6f1('0x29')]('/:id',auth[_0xe6f1('0xb')](),interaction[_0xe6f1('0x26')](_0xe6f1('0x27'),_0xe6f1('0x2a')),controller['update']);router['put'](_0xe6f1('0x2b'),controller[_0xe6f1('0x2c')]);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xe6f1('0x29')](_0xe6f1('0x2d'),controller['close']);router['delete']('/:id',auth[_0xe6f1('0xb')](),interaction[_0xe6f1('0x26')](_0xe6f1('0x27'),_0xe6f1('0x2e')),controller[_0xe6f1('0x2f')]);router[_0xe6f1('0x30')](_0xe6f1('0x25'),auth[_0xe6f1('0xb')](),controller[_0xe6f1('0x31')]);module[_0xe6f1('0x32')]=router;
\ No newline at end of file
+var _0x603c=['destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','get','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','/:id','chat','chatinteraction:update','/:id/custom_update','put','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x603c,0x18a));var _0xc603=function(_0x5aaadb,_0xeeab51){_0x5aaadb=_0x5aaadb-0x0;var _0x379c74=_0x603c[_0x5aaadb];return _0x379c74;};'use strict';var multer=require(_0xc603('0x0'));var util=require(_0xc603('0x1'));var path=require(_0xc603('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc603('0x3'));var auth=require(_0xc603('0x4'));var interaction=require(_0xc603('0x5'));var config=require(_0xc603('0x6'));var controller=require(_0xc603('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc603('0x8')]);router[_0xc603('0x9')]('/describe',auth[_0xc603('0xa')](),controller[_0xc603('0xb')]);router[_0xc603('0x9')]('/:id',auth[_0xc603('0xc')](),controller[_0xc603('0xd')]);router[_0xc603('0x9')](_0xc603('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xc603('0xf')]);router[_0xc603('0x9')](_0xc603('0x10'),auth['isAuthenticated'](),controller[_0xc603('0x11')]);router[_0xc603('0x9')](_0xc603('0x12'),auth[_0xc603('0xc')](),controller['getMyMessages']);router['get'](_0xc603('0x13'),auth[_0xc603('0xa')](),controller[_0xc603('0x14')]);router[_0xc603('0x15')]('/',auth['isAuthenticated'](),controller[_0xc603('0x16')]);router['post']('/:id/vidaoo',auth[_0xc603('0xa')](),controller[_0xc603('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31e540,_0x49ab7b,_0x2b659e){_0x2b659e(null,path[_0xc603('0x18')](config[_0xc603('0x19')],_0xc603('0x1a')));},'filename':function(_0x504df3,_0x301b85,_0x3f08fb){_0x3f08fb(null,util[_0xc603('0x1b')]('%s-%s',Date[_0xc603('0x1c')](),_0x301b85[_0xc603('0x1d')][_0xc603('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc603('0x15')](_0xc603('0x1f'),upload['single']('file'),controller['attachmentUpload']);router[_0xc603('0x15')](_0xc603('0x10'),auth[_0xc603('0xc')](),controller[_0xc603('0x20')]);router['post'](_0xc603('0x21'),auth[_0xc603('0xa')](),interaction[_0xc603('0x22')]('chat',_0xc603('0x23')),controller[_0xc603('0x24')]);router['put'](_0xc603('0x25'),auth[_0xc603('0xa')](),interaction[_0xc603('0x22')](_0xc603('0x26'),_0xc603('0x27')),controller['update']);router['put'](_0xc603('0x28'),controller['customUpdate']);router[_0xc603('0x29')](_0xc603('0x2a'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xc603('0x29')](_0xc603('0x2b'),controller[_0xc603('0x2c')]);router[_0xc603('0x2d')](_0xc603('0x25'),auth['isAuthenticated'](),interaction['tracked'](_0xc603('0x26'),_0xc603('0x2e')),controller[_0xc603('0x2f')]);router[_0xc603('0x2d')](_0xc603('0x21'),auth[_0xc603('0xa')](),controller['removeTags']);module[_0xc603('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index bfa0890..24798fb 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 _0x88e4=['medium','INTEGER','sequelize','TEXT'];(function(_0x233bd7,_0x1abbe6){var _0xd1cda1=function(_0x54885e){while(--_0x54885e){_0x233bd7['push'](_0x233bd7['shift']());}};_0xd1cda1(++_0x1abbe6);}(_0x88e4,0x6e));var _0x488e=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x88e4[_0x3d4ef1];return _0x409423;};'use strict';var Sequelize=require(_0x488e('0x0'));module['exports']={'body':{'type':Sequelize[_0x488e('0x1')](_0x488e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x488e('0x3')]}};
\ No newline at end of file
+var _0xc36d=['medium','sequelize','exports','TEXT'];(function(_0x34ad5a,_0x3842dc){var _0x215768=function(_0x3d1946){while(--_0x3d1946){_0x34ad5a['push'](_0x34ad5a['shift']());}};_0x215768(++_0x3842dc);}(_0xc36d,0x17d));var _0xdc36=function(_0x26ed29,_0x2288f1){_0x26ed29=_0x26ed29-0x0;var _0x26182c=_0xc36d[_0x26ed29];return _0x26182c;};'use strict';var Sequelize=require(_0xdc36('0x0'));module[_0xdc36('0x1')]={'body':{'type':Sequelize[_0xdc36('0x2')](_0xdc36('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index b9bca13..ac09ede 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 _0x2744=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','intersection','find','body','destroy','describe','get','messages','lastMessageAt','getUsers','User','admin','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','isEmpty','agent','push','createdAt','FromId','ToId','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','map','keys','filters','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x69560,_0x237e9f){var _0x481461=function(_0x6125f4){while(--_0x6125f4){_0x69560['push'](_0x69560['shift']());}};_0x481461(++_0x237e9f);}(_0x2744,0x170));var _0x4274=function(_0x37125c,_0x3f2dc2){_0x37125c=_0x37125c-0x0;var _0x249a4c=_0x2744[_0x37125c];return _0x249a4c;};'use strict';var emlformat=require(_0x4274('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4274('0x1'));var jsonpatch=require(_0x4274('0x2'));var rp=require(_0x4274('0x3'));var moment=require(_0x4274('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4274('0x5'));var util=require(_0x4274('0x6'));var path=require(_0x4274('0x7'));var sox=require(_0x4274('0x8'));var csv=require('to-csv');var ejs=require(_0x4274('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4274('0xa'));var squel=require(_0x4274('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4274('0xc'));var toCsv=require(_0x4274('0xd'));var querystring=require(_0x4274('0xe'));var Papa=require(_0x4274('0xf'));var Redis=require(_0x4274('0x10'));var authService=require(_0x4274('0x11'));var qs=require(_0x4274('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4274('0x13'));var logger=require('../../config/logger')(_0x4274('0x14'));var utils=require(_0x4274('0x15'));var config=require(_0x4274('0x16'));var licenseUtil=require(_0x4274('0x17'));var db=require(_0x4274('0x18'))['db'];config[_0x4274('0x19')]=_[_0x4274('0x1a')](config[_0x4274('0x19')],{'host':_0x4274('0x1b'),'port':0x18eb});var socket=require(_0x4274('0x1c'))(new Redis(config['redis']));require(_0x4274('0x1d'))[_0x4274('0x1e')](socket);function respondWithStatusCode(_0x2a7fb9,_0x499c2a){_0x499c2a=_0x499c2a||0xcc;return function(_0x56efb7){if(_0x56efb7){return _0x2a7fb9['sendStatus'](_0x499c2a);}return _0x2a7fb9[_0x4274('0x1f')](_0x499c2a)[_0x4274('0x20')]();};}function respondWithResult(_0x60e3e9,_0x11fb0b){_0x11fb0b=_0x11fb0b||0xc8;return function(_0x5b4ae0){if(_0x5b4ae0){return _0x60e3e9[_0x4274('0x1f')](_0x11fb0b)[_0x4274('0x21')](_0x5b4ae0);}};}function respondWithFilteredResult(_0x5a383b,_0x3906fd){return function(_0x57f4f9){if(_0x57f4f9){var _0x488f21=typeof _0x3906fd[_0x4274('0x22')]===_0x4274('0x23')&&typeof _0x3906fd['limit']==='undefined';var _0xb6d5db=_0x57f4f9[_0x4274('0x24')];var _0x209a5f=_0x488f21?0x0:_0x3906fd['offset'];var _0x7b597c=_0x488f21?_0x57f4f9[_0x4274('0x24')]:_0x3906fd[_0x4274('0x22')]+_0x3906fd[_0x4274('0x25')];var _0x1f5b2;if(_0x7b597c>=_0xb6d5db){_0x7b597c=_0xb6d5db;_0x1f5b2=0xc8;}else{_0x1f5b2=0xce;}_0x5a383b[_0x4274('0x1f')](_0x1f5b2);return _0x5a383b[_0x4274('0x26')](_0x4274('0x27'),_0x209a5f+'-'+_0x7b597c+'/'+_0xb6d5db)['json'](_0x57f4f9);}return null;};}function patchUpdates(_0x3e98ab){return function(_0x36082a){try{jsonpatch[_0x4274('0x28')](_0x36082a,_0x3e98ab,!![]);}catch(_0x1abe20){return BPromise['reject'](_0x1abe20);}return _0x36082a['save']();};}function saveUpdates(_0x1fb972,_0x5b4665){return function(_0x46d29a){if(_0x46d29a){return _0x46d29a[_0x4274('0x29')](_0x1fb972)['then'](function(_0x3a05d5){return _0x3a05d5;});}return null;};}function removeEntity(_0x464d6d,_0x23e7d2){return function(_0x1d2037){if(_0x1d2037){return _0x1d2037['destroy']()[_0x4274('0x2a')](function(){_0x464d6d[_0x4274('0x1f')](0xcc)[_0x4274('0x20')]();});}};}function handleEntityNotFound(_0x2496d4,_0x891db0){return function(_0x365a67){if(!_0x365a67){_0x2496d4[_0x4274('0x2b')](0x194);}return _0x365a67;};}function handleError(_0x537c8d,_0x2913ee){_0x2913ee=_0x2913ee||0x1f4;return function(_0xda3fb7){logger[_0x4274('0x2c')](_0xda3fb7[_0x4274('0x2d')]);if(_0xda3fb7[_0x4274('0x2e')]){delete _0xda3fb7['name'];}_0x537c8d['status'](_0x2913ee)[_0x4274('0x2f')](_0xda3fb7);};}exports['index']=function(_0x42bf20,_0x4bb1a4){var _0x3c3368={},_0xdf75de={},_0x590091={'count':0x0,'rows':[]};var _0x73f394=_['map'](db[_0x4274('0x30')][_0x4274('0x31')],function(_0x3a598a){return{'name':_0x3a598a[_0x4274('0x32')],'type':_0x3a598a[_0x4274('0x33')]['key']};});_0xdf75de['model']=_[_0x4274('0x34')](_0x73f394,'name');_0xdf75de['query']=_[_0x4274('0x35')](_0x42bf20['query']);_0xdf75de[_0x4274('0x36')]=_['intersection'](_0xdf75de[_0x4274('0x37')],_0xdf75de[_0x4274('0x38')]);_0x3c3368[_0x4274('0x39')]=_['intersection'](_0xdf75de[_0x4274('0x37')],qs[_0x4274('0x3a')](_0x42bf20[_0x4274('0x38')][_0x4274('0x3a')]));_0x3c3368[_0x4274('0x39')]=_0x3c3368['attributes'][_0x4274('0x3b')]?_0x3c3368[_0x4274('0x39')]:_0xdf75de[_0x4274('0x37')];if(!_0x42bf20['query'][_0x4274('0x3c')](_0x4274('0x3d'))){_0x3c3368[_0x4274('0x25')]=qs[_0x4274('0x25')](_0x42bf20['query']['limit']);_0x3c3368[_0x4274('0x22')]=qs['offset'](_0x42bf20[_0x4274('0x38')]['offset']);}_0x3c3368['order']=qs[_0x4274('0x3e')](_0x42bf20[_0x4274('0x38')]['sort']);_0x3c3368[_0x4274('0x3f')]=qs[_0x4274('0x36')](_[_0x4274('0x40')](_0x42bf20['query'],_0xdf75de[_0x4274('0x36')]),_0x73f394);if(_0x42bf20[_0x4274('0x38')]['filter']){_0x3c3368[_0x4274('0x3f')]=_[_0x4274('0x41')](_0x3c3368[_0x4274('0x3f')],{'$or':_[_0x4274('0x34')](_0x73f394,function(_0xeaeba2){if(_0xeaeba2['type']!==_0x4274('0x42')){var _0x32dc8a={};_0x32dc8a[_0xeaeba2[_0x4274('0x2e')]]={'$like':'%'+_0x42bf20[_0x4274('0x38')][_0x4274('0x43')]+'%'};return _0x32dc8a;}})});}_0x3c3368=_[_0x4274('0x41')]({},_0x3c3368,_0x42bf20[_0x4274('0x44')]);var _0x3fa4df={'where':_0x3c3368[_0x4274('0x3f')]};return db['ChatInternalMessage'][_0x4274('0x24')](_0x3fa4df)[_0x4274('0x2a')](function(_0x810b1f){_0x590091[_0x4274('0x24')]=_0x810b1f;if(_0x42bf20['query'][_0x4274('0x45')]){_0x3c3368[_0x4274('0x46')]=[{'all':!![]}];}return db[_0x4274('0x30')][_0x4274('0x47')](_0x3c3368);})[_0x4274('0x2a')](function(_0x8a3301){_0x590091[_0x4274('0x48')]=_0x8a3301;return _0x590091;})[_0x4274('0x2a')](respondWithFilteredResult(_0x4bb1a4,_0x3c3368))[_0x4274('0x49')](handleError(_0x4bb1a4,null));};exports['show']=function(_0x390ebf,_0x5543b1){var _0x2167a1={'raw':!![],'where':{'id':_0x390ebf[_0x4274('0x4a')]['id']}},_0x3c6a99={};_0x3c6a99['model']=_[_0x4274('0x35')](db[_0x4274('0x30')][_0x4274('0x31')]);_0x3c6a99[_0x4274('0x38')]=_[_0x4274('0x35')](_0x390ebf['query']);_0x3c6a99[_0x4274('0x36')]=_['intersection'](_0x3c6a99['model'],_0x3c6a99[_0x4274('0x38')]);_0x2167a1[_0x4274('0x39')]=_[_0x4274('0x4b')](_0x3c6a99[_0x4274('0x37')],qs['fields'](_0x390ebf[_0x4274('0x38')][_0x4274('0x3a')]));_0x2167a1[_0x4274('0x39')]=_0x2167a1[_0x4274('0x39')][_0x4274('0x3b')]?_0x2167a1[_0x4274('0x39')]:_0x3c6a99[_0x4274('0x37')];if(_0x390ebf[_0x4274('0x38')][_0x4274('0x45')]){_0x2167a1[_0x4274('0x46')]=[{'all':!![]}];}_0x2167a1=_[_0x4274('0x41')]({},_0x2167a1,_0x390ebf[_0x4274('0x44')]);return db[_0x4274('0x30')][_0x4274('0x4c')](_0x2167a1)['then'](handleEntityNotFound(_0x5543b1,null))[_0x4274('0x2a')](respondWithResult(_0x5543b1,null))['catch'](handleError(_0x5543b1,null));};exports['create']=function(_0x203382,_0x1b40b3){return db[_0x4274('0x30')]['create'](_0x203382[_0x4274('0x4d')],{})[_0x4274('0x2a')](respondWithResult(_0x1b40b3,0xc9))[_0x4274('0x49')](handleError(_0x1b40b3,null));};exports['update']=function(_0x36861e,_0x5f5bea){if(_0x36861e['body']['id']){delete _0x36861e['body']['id'];}return db[_0x4274('0x30')][_0x4274('0x4c')]({'where':{'id':_0x36861e[_0x4274('0x4a')]['id']}})[_0x4274('0x2a')](handleEntityNotFound(_0x5f5bea,null))[_0x4274('0x2a')](saveUpdates(_0x36861e['body'],null))['then'](respondWithResult(_0x5f5bea,null))['catch'](handleError(_0x5f5bea,null));};exports[_0x4274('0x4e')]=function(_0x10bb23,_0x150a76){return db[_0x4274('0x30')][_0x4274('0x4c')]({'where':{'id':_0x10bb23[_0x4274('0x4a')]['id']}})[_0x4274('0x2a')](handleEntityNotFound(_0x150a76,null))['then'](removeEntity(_0x150a76,null))[_0x4274('0x49')](handleError(_0x150a76,null));};exports[_0x4274('0x4f')]=function(_0x1c0f20,_0x37ea82){return db[_0x4274('0x30')][_0x4274('0x4f')]()['then'](respondWithResult(_0x37ea82,null))[_0x4274('0x49')](handleError(_0x37ea82,null));};function wrapUser(_0x50a982){return function(_0x333613){var _0x35e9bf=_0x50a982[_0x4274('0x50')]({'plain':!![]});_0x35e9bf[_0x4274('0x51')]=[];if(_0x333613){_0x35e9bf['lastMessageAt']=_0x333613['createdAt'];_0x35e9bf['lastMessage']=_0x333613;}else{_0x35e9bf[_0x4274('0x52')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x35e9bf['lastMessage']={};}return _0x35e9bf;};}exports[_0x4274('0x53')]=function(_0x3d739e,_0x5c5fc9,_0x3753d9){var _0x5311e7=[];return db[_0x4274('0x54')]['findAll']({'where':{'role':['agent',_0x4274('0x55'),'user']},'attributes':['id',_0x4274('0x56'),_0x4274('0x2e'),_0x4274('0x57'),'userpic',_0x4274('0x58'),_0x4274('0x59'),_0x4274('0x5a'),_0x4274('0x5b'),_0x4274('0x5c')],'order':qs[_0x4274('0x3e')](_0x4274('0x5d')),'include':[{'model':db[_0x4274('0x5e')],'as':'VoiceQueues','attributes':['id','name',_0x4274('0x33')],'through':{'attributes':[]}}]})['then'](function(_0xd7032f){if(_0xd7032f){var _0x11dd60=_0x3d739e[_0x4274('0x5f')][_0x4274('0x50')]({'plain':!![]});if(!_0x11dd60)throw new Error(_0x4274('0x60'));if(_0x11dd60[_0x4274('0x57')]===_0x4274('0x5f')){return db[_0x4274('0x61')][_0x4274('0x4c')]({'where':{'name':'Agents','userProfileId':_0x11dd60[_0x4274('0x62')]},'raw':!![]})['then'](function(_0x547206){if(_0x547206){if(_0x547206[_0x4274('0x63')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x547206['id']},'raw':!![]})[_0x4274('0x2a')](function(_0x34a137){var _0x255c47=[];if(_[_0x4274('0x64')](_0x34a137)){_0x255c47=_[_0x4274('0x43')](_0xd7032f,function(_0x3e267e){if(_0x3e267e[_0x4274('0x57')]!==_0x4274('0x65')){return _0x3e267e;}});return _0x255c47;}else{for(var _0x362377=0x0;_0x362377<_0xd7032f[_0x4274('0x3b')];_0x362377++){var _0x11b456=_0xd7032f[_0x362377];if(_0x11b456[_0x4274('0x57')]==='agent'){var _0x14209e=_[_0x4274('0x4c')](_0x34a137,function(_0x1952f8){return _0x1952f8['resourceId']===_0x11b456['id'];});if(_0x14209e)_0x255c47[_0x4274('0x66')](_0x11b456);}else{_0x255c47[_0x4274('0x66')](_0x11b456);}}return _0x255c47;}});}else{return _0xd7032f;}}else{var _0x72c4c8=_['filter'](_0xd7032f,function(_0x96e7b5){if(_0x96e7b5['role']!=='agent'){return _0x96e7b5;}});return _0x72c4c8;}});}else{return _0xd7032f;}}})[_0x4274('0x2a')](function(_0x1cdeca){var _0x3a76c8=[];if(_0x1cdeca){_0x5311e7=_0x1cdeca;for(var _0x17bcb9=0x0;_0x17bcb9<_0x1cdeca[_0x4274('0x3b')];_0x17bcb9+=0x1){_0x5311e7[_0x17bcb9][_0x4274('0x51')]=[];_0x3a76c8[_0x4274('0x66')](db[_0x4274('0x30')][_0x4274('0x4c')]({'where':{'FromId':[_0x3d739e['user']['id'],_0x1cdeca[_0x17bcb9]['id']],'ToId':[_0x3d739e[_0x4274('0x5f')]['id'],_0x1cdeca[_0x17bcb9]['id']],'ChatGroupId':null},'attributes':['id',_0x4274('0x67'),_0x4274('0x68'),_0x4274('0x69'),'read',_0x4274('0x4d')],'order':qs['sort'](_0x4274('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4274('0x2a')](wrapUser(_0x1cdeca[_0x17bcb9])));}return BPromise[_0x4274('0x6b')](_0x3a76c8);}return[];})['then'](function(_0x58001b){return{'rows':_0x58001b,'count':_0x58001b[_0x4274('0x3b')]};})[_0x4274('0x2a')](respondWithResult(_0x5c5fc9,null))[_0x4274('0x49')](handleError(_0x5c5fc9,null));};
\ No newline at end of file
+var _0x7802=['UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','crypto','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','destroy','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','online','allowmessenger','VoiceQueue','VoiceQueues','user'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x7802,0x13c));var _0x2780=function(_0x51f5c8,_0x2aa90d){_0x51f5c8=_0x51f5c8-0x0;var _0x30789e=_0x7802[_0x51f5c8];return _0x30789e;};'use strict';var emlformat=require(_0x2780('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2780('0x1'));var jsonpatch=require(_0x2780('0x2'));var rp=require('request-promise');var moment=require(_0x2780('0x3'));var BPromise=require(_0x2780('0x4'));var Mustache=require(_0x2780('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2780('0x6'));var csv=require(_0x2780('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2780('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2780('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2780('0xa'));var Papa=require(_0x2780('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2780('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2780('0xd'));var logger=require(_0x2780('0xe'))(_0x2780('0xf'));var utils=require(_0x2780('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2780('0x11'))['db'];config['redis']=_[_0x2780('0x12')](config[_0x2780('0x13')],{'host':_0x2780('0x14'),'port':0x18eb});var socket=require(_0x2780('0x15'))(new Redis(config[_0x2780('0x13')]));require(_0x2780('0x16'))[_0x2780('0x17')](socket);function respondWithStatusCode(_0x30aa5f,_0x17875f){_0x17875f=_0x17875f||0xcc;return function(_0x47d632){if(_0x47d632){return _0x30aa5f[_0x2780('0x18')](_0x17875f);}return _0x30aa5f[_0x2780('0x19')](_0x17875f)[_0x2780('0x1a')]();};}function respondWithResult(_0x1a37ab,_0x5b96ab){_0x5b96ab=_0x5b96ab||0xc8;return function(_0x41aff2){if(_0x41aff2){return _0x1a37ab[_0x2780('0x19')](_0x5b96ab)[_0x2780('0x1b')](_0x41aff2);}};}function respondWithFilteredResult(_0x94ff6b,_0x3148ba){return function(_0xd3300){if(_0xd3300){var _0x1a738c=typeof _0x3148ba[_0x2780('0x1c')]===_0x2780('0x1d')&&typeof _0x3148ba[_0x2780('0x1e')]===_0x2780('0x1d');var _0x4f8380=_0xd3300['count'];var _0x1acafa=_0x1a738c?0x0:_0x3148ba['offset'];var _0x3b1c61=_0x1a738c?_0xd3300['count']:_0x3148ba['offset']+_0x3148ba[_0x2780('0x1e')];var _0x52c85c;if(_0x3b1c61>=_0x4f8380){_0x3b1c61=_0x4f8380;_0x52c85c=0xc8;}else{_0x52c85c=0xce;}_0x94ff6b[_0x2780('0x19')](_0x52c85c);return _0x94ff6b[_0x2780('0x1f')](_0x2780('0x20'),_0x1acafa+'-'+_0x3b1c61+'/'+_0x4f8380)[_0x2780('0x1b')](_0xd3300);}return null;};}function patchUpdates(_0x574cf2){return function(_0x5cb388){try{jsonpatch[_0x2780('0x21')](_0x5cb388,_0x574cf2,!![]);}catch(_0x5a340f){return BPromise['reject'](_0x5a340f);}return _0x5cb388['save']();};}function saveUpdates(_0x4f6a2d,_0x11b498){return function(_0x5e32b5){if(_0x5e32b5){return _0x5e32b5['update'](_0x4f6a2d)['then'](function(_0x15fb1a){return _0x15fb1a;});}return null;};}function removeEntity(_0x13cb78,_0x48d999){return function(_0x4e0410){if(_0x4e0410){return _0x4e0410[_0x2780('0x22')]()[_0x2780('0x23')](function(){_0x13cb78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4536c1,_0x4a80b6){return function(_0x1e54ec){if(!_0x1e54ec){_0x4536c1['sendStatus'](0x194);}return _0x1e54ec;};}function handleError(_0x2254fa,_0x231050){_0x231050=_0x231050||0x1f4;return function(_0x3a6104){logger[_0x2780('0x24')](_0x3a6104[_0x2780('0x25')]);if(_0x3a6104[_0x2780('0x26')]){delete _0x3a6104[_0x2780('0x26')];}_0x2254fa[_0x2780('0x19')](_0x231050)[_0x2780('0x27')](_0x3a6104);};}exports[_0x2780('0x28')]=function(_0x416236,_0x277104){var _0x3628eb={},_0x52cb91={},_0xf00619={'count':0x0,'rows':[]};var _0x318a57=_[_0x2780('0x29')](db[_0x2780('0x2a')][_0x2780('0x2b')],function(_0x31e5ba){return{'name':_0x31e5ba['fieldName'],'type':_0x31e5ba[_0x2780('0x2c')]['key']};});_0x52cb91[_0x2780('0x2d')]=_[_0x2780('0x29')](_0x318a57,_0x2780('0x26'));_0x52cb91[_0x2780('0x2e')]=_[_0x2780('0x2f')](_0x416236[_0x2780('0x2e')]);_0x52cb91[_0x2780('0x30')]=_[_0x2780('0x31')](_0x52cb91[_0x2780('0x2d')],_0x52cb91['query']);_0x3628eb['attributes']=_[_0x2780('0x31')](_0x52cb91[_0x2780('0x2d')],qs['fields'](_0x416236[_0x2780('0x2e')][_0x2780('0x32')]));_0x3628eb[_0x2780('0x33')]=_0x3628eb[_0x2780('0x33')][_0x2780('0x34')]?_0x3628eb[_0x2780('0x33')]:_0x52cb91['model'];if(!_0x416236[_0x2780('0x2e')][_0x2780('0x35')](_0x2780('0x36'))){_0x3628eb[_0x2780('0x1e')]=qs[_0x2780('0x1e')](_0x416236['query']['limit']);_0x3628eb[_0x2780('0x1c')]=qs['offset'](_0x416236[_0x2780('0x2e')]['offset']);}_0x3628eb[_0x2780('0x37')]=qs['sort'](_0x416236[_0x2780('0x2e')][_0x2780('0x38')]);_0x3628eb['where']=qs[_0x2780('0x30')](_[_0x2780('0x39')](_0x416236[_0x2780('0x2e')],_0x52cb91[_0x2780('0x30')]),_0x318a57);if(_0x416236[_0x2780('0x2e')][_0x2780('0x3a')]){_0x3628eb['where']=_[_0x2780('0x3b')](_0x3628eb[_0x2780('0x3c')],{'$or':_[_0x2780('0x29')](_0x318a57,function(_0x45ed60){if(_0x45ed60[_0x2780('0x2c')]!==_0x2780('0x3d')){var _0x1d9274={};_0x1d9274[_0x45ed60['name']]={'$like':'%'+_0x416236[_0x2780('0x2e')][_0x2780('0x3a')]+'%'};return _0x1d9274;}})});}_0x3628eb=_[_0x2780('0x3b')]({},_0x3628eb,_0x416236['options']);var _0x4bd386={'where':_0x3628eb['where']};return db[_0x2780('0x2a')]['count'](_0x4bd386)['then'](function(_0x30a637){_0xf00619[_0x2780('0x3e')]=_0x30a637;if(_0x416236[_0x2780('0x2e')]['includeAll']){_0x3628eb[_0x2780('0x3f')]=[{'all':!![]}];}return db[_0x2780('0x2a')][_0x2780('0x40')](_0x3628eb);})[_0x2780('0x23')](function(_0x14f4b1){_0xf00619[_0x2780('0x41')]=_0x14f4b1;return _0xf00619;})[_0x2780('0x23')](respondWithFilteredResult(_0x277104,_0x3628eb))[_0x2780('0x42')](handleError(_0x277104,null));};exports[_0x2780('0x43')]=function(_0x24742c,_0x3a8112){var _0x4fe980={'raw':!![],'where':{'id':_0x24742c[_0x2780('0x44')]['id']}},_0x2f91b3={};_0x2f91b3[_0x2780('0x2d')]=_[_0x2780('0x2f')](db[_0x2780('0x2a')]['rawAttributes']);_0x2f91b3['query']=_[_0x2780('0x2f')](_0x24742c['query']);_0x2f91b3[_0x2780('0x30')]=_[_0x2780('0x31')](_0x2f91b3[_0x2780('0x2d')],_0x2f91b3[_0x2780('0x2e')]);_0x4fe980[_0x2780('0x33')]=_['intersection'](_0x2f91b3[_0x2780('0x2d')],qs[_0x2780('0x32')](_0x24742c[_0x2780('0x2e')][_0x2780('0x32')]));_0x4fe980[_0x2780('0x33')]=_0x4fe980['attributes'][_0x2780('0x34')]?_0x4fe980[_0x2780('0x33')]:_0x2f91b3[_0x2780('0x2d')];if(_0x24742c[_0x2780('0x2e')][_0x2780('0x45')]){_0x4fe980[_0x2780('0x3f')]=[{'all':!![]}];}_0x4fe980=_[_0x2780('0x3b')]({},_0x4fe980,_0x24742c['options']);return db[_0x2780('0x2a')][_0x2780('0x46')](_0x4fe980)[_0x2780('0x23')](handleEntityNotFound(_0x3a8112,null))[_0x2780('0x23')](respondWithResult(_0x3a8112,null))['catch'](handleError(_0x3a8112,null));};exports[_0x2780('0x47')]=function(_0x57e035,_0x283b0c){return db[_0x2780('0x2a')][_0x2780('0x47')](_0x57e035[_0x2780('0x48')],{})[_0x2780('0x23')](respondWithResult(_0x283b0c,0xc9))[_0x2780('0x42')](handleError(_0x283b0c,null));};exports[_0x2780('0x49')]=function(_0x407b15,_0x9437b){if(_0x407b15[_0x2780('0x48')]['id']){delete _0x407b15[_0x2780('0x48')]['id'];}return db['ChatInternalMessage'][_0x2780('0x46')]({'where':{'id':_0x407b15[_0x2780('0x44')]['id']}})[_0x2780('0x23')](handleEntityNotFound(_0x9437b,null))['then'](saveUpdates(_0x407b15['body'],null))[_0x2780('0x23')](respondWithResult(_0x9437b,null))[_0x2780('0x42')](handleError(_0x9437b,null));};exports[_0x2780('0x22')]=function(_0x4c3f60,_0x53d1f1){return db[_0x2780('0x2a')][_0x2780('0x46')]({'where':{'id':_0x4c3f60[_0x2780('0x44')]['id']}})[_0x2780('0x23')](handleEntityNotFound(_0x53d1f1,null))[_0x2780('0x23')](removeEntity(_0x53d1f1,null))[_0x2780('0x42')](handleError(_0x53d1f1,null));};exports['describe']=function(_0x2775e0,_0x481b04){return db[_0x2780('0x2a')]['describe']()[_0x2780('0x23')](respondWithResult(_0x481b04,null))[_0x2780('0x42')](handleError(_0x481b04,null));};function wrapUser(_0x329415){return function(_0x2b6c32){var _0x1e4088=_0x329415[_0x2780('0x4a')]({'plain':!![]});_0x1e4088[_0x2780('0x4b')]=[];if(_0x2b6c32){_0x1e4088['lastMessageAt']=_0x2b6c32[_0x2780('0x4c')];_0x1e4088[_0x2780('0x4d')]=_0x2b6c32;}else{_0x1e4088[_0x2780('0x4e')]=moment(0x0)[_0x2780('0x4f')](_0x2780('0x50'));_0x1e4088['lastMessage']={};}return _0x1e4088;};}exports[_0x2780('0x51')]=function(_0xd29856,_0x395b92,_0x4087d7){var _0x3a6940=[];return db['User']['findAll']({'where':{'role':[_0x2780('0x52'),_0x2780('0x53'),'user']},'attributes':['id',_0x2780('0x54'),'name',_0x2780('0x55'),_0x2780('0x56'),'internal',_0x2780('0x57'),'lastLoginAt',_0x2780('0x58'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0x2780('0x59')],'as':_0x2780('0x5a'),'attributes':['id',_0x2780('0x26'),'type'],'through':{'attributes':[]}}]})[_0x2780('0x23')](function(_0x3947ba){if(_0x3947ba){var _0x4344c2=_0xd29856[_0x2780('0x5b')][_0x2780('0x4a')]({'plain':!![]});if(!_0x4344c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4344c2[_0x2780('0x55')]===_0x2780('0x5b')){return db[_0x2780('0x5c')][_0x2780('0x46')]({'where':{'name':'Agents','userProfileId':_0x4344c2[_0x2780('0x5d')]},'raw':!![]})[_0x2780('0x23')](function(_0xd9a192){if(_0xd9a192){if(_0xd9a192[_0x2780('0x5e')]===0x0){return db[_0x2780('0x5f')][_0x2780('0x40')]({'where':{'sectionId':_0xd9a192['id']},'raw':!![]})['then'](function(_0x6f7a28){var _0x57a42b=[];if(_[_0x2780('0x60')](_0x6f7a28)){_0x57a42b=_['filter'](_0x3947ba,function(_0x244fd8){if(_0x244fd8[_0x2780('0x55')]!==_0x2780('0x52')){return _0x244fd8;}});return _0x57a42b;}else{for(var _0x724b22=0x0;_0x724b22<_0x3947ba[_0x2780('0x34')];_0x724b22++){var _0x300037=_0x3947ba[_0x724b22];if(_0x300037[_0x2780('0x55')]===_0x2780('0x52')){var _0xc6f88d=_[_0x2780('0x46')](_0x6f7a28,function(_0x1b1ec1){return _0x1b1ec1['resourceId']===_0x300037['id'];});if(_0xc6f88d)_0x57a42b['push'](_0x300037);}else{_0x57a42b[_0x2780('0x61')](_0x300037);}}return _0x57a42b;}});}else{return _0x3947ba;}}else{var _0xad1754=_['filter'](_0x3947ba,function(_0x678fff){if(_0x678fff[_0x2780('0x55')]!=='agent'){return _0x678fff;}});return _0xad1754;}});}else{return _0x3947ba;}}})[_0x2780('0x23')](function(_0x1cff80){var _0x4b2b6a=[];if(_0x1cff80){_0x3a6940=_0x1cff80;for(var _0x5e20d2=0x0;_0x5e20d2<_0x1cff80[_0x2780('0x34')];_0x5e20d2+=0x1){_0x3a6940[_0x5e20d2][_0x2780('0x4b')]=[];_0x4b2b6a[_0x2780('0x61')](db[_0x2780('0x2a')][_0x2780('0x46')]({'where':{'FromId':[_0xd29856['user']['id'],_0x1cff80[_0x5e20d2]['id']],'ToId':[_0xd29856['user']['id'],_0x1cff80[_0x5e20d2]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x2780('0x62'),'ToId',_0x2780('0x63'),_0x2780('0x48')],'order':qs[_0x2780('0x38')](_0x2780('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2780('0x23')](wrapUser(_0x1cff80[_0x5e20d2])));}return BPromise[_0x2780('0x65')](_0x4b2b6a);}return[];})['then'](function(_0x33aa23){return{'rows':_0x33aa23,'count':_0x33aa23[_0x2780('0x34')]};})[_0x2780('0x23')](respondWithResult(_0x395b92,null))[_0x2780('0x42')](handleError(_0x395b92,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 129ee31..1194aa5 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 _0xc1a2=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xc1a2,0x148));var _0x2c1a=function(_0x3f4fcb,_0x1f826e){_0x3f4fcb=_0x3f4fcb-0x0;var _0x230db5=_0xc1a2[_0x3f4fcb];return _0x230db5;};'use strict';var EventEmitter=require(_0x2c1a('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2c1a('0x1')](0x0);var events={'afterCreate':_0x2c1a('0x2'),'afterUpdate':_0x2c1a('0x3'),'afterDestroy':_0x2c1a('0x4')};function emitEvent(_0x469ca6){return function(_0x18f1fa,_0x478d42,_0xd80381){ChatInternalMessageEvents[_0x2c1a('0x5')](_0x469ca6+':'+_0x18f1fa['id'],_0x18f1fa);ChatInternalMessageEvents[_0x2c1a('0x5')](_0x469ca6,_0x18f1fa);_0xd80381(null);};}for(var e in events){if(events[_0x2c1a('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x2c1a('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xabc1=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xb09d74,_0x4b11ac){var _0x1f5e21=function(_0x40c6b4){while(--_0x40c6b4){_0xb09d74['push'](_0xb09d74['shift']());}};_0x1f5e21(++_0x4b11ac);}(_0xabc1,0x13e));var _0x1abc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabc1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x1abc('0x0'));var ChatInternalMessage=require(_0x1abc('0x1'))['db'][_0x1abc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1abc('0x3')](0x0);var events={'afterCreate':_0x1abc('0x4'),'afterUpdate':_0x1abc('0x5'),'afterDestroy':_0x1abc('0x6')};function emitEvent(_0xc41737){return function(_0x3fb332,_0x5376c6,_0x71e111){ChatInternalMessageEvents[_0x1abc('0x7')](_0xc41737+':'+_0x3fb332['id'],_0x3fb332);ChatInternalMessageEvents['emit'](_0xc41737,_0x3fb332);_0x71e111(null);};}for(var e in events){if(events[_0x1abc('0x8')](e)){var event=events[e];ChatInternalMessage[_0x1abc('0x9')](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 a21d4aa..a3f6f7b 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 _0x309a=['util','../../config/logger','api','moment','bluebird','path','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash'];(function(_0x141665,_0x793f1a){var _0x40f97b=function(_0x4e3ed3){while(--_0x4e3ed3){_0x141665['push'](_0x141665['shift']());}};_0x40f97b(++_0x793f1a);}(_0x309a,0x1c2));var _0xa309=function(_0x471e8e,_0x2faf44){_0x471e8e=_0x471e8e-0x0;var _0x4eef08=_0x309a[_0x471e8e];return _0x4eef08;};'use strict';var _=require(_0xa309('0x0'));var util=require(_0xa309('0x1'));var logger=require(_0xa309('0x2'))(_0xa309('0x3'));var moment=require(_0xa309('0x4'));var BPromise=require(_0xa309('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa309('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa309('0x7'));module['exports']=function(_0x31912f,_0x5f24f6){return _0x31912f[_0xa309('0x8')](_0xa309('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa309('0xa')});};
\ No newline at end of file
+var _0x9bc2=['bluebird','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x9bc2,0x114));var _0x29bc=function(_0x5c12cc,_0xef2a88){_0x5c12cc=_0x5c12cc-0x0;var _0x2ab4d2=_0x9bc2[_0x5c12cc];return _0x2ab4d2;};'use strict';var _=require(_0x29bc('0x0'));var util=require('util');var logger=require(_0x29bc('0x1'))(_0x29bc('0x2'));var moment=require(_0x29bc('0x3'));var BPromise=require(_0x29bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29bc('0x5'));var rimraf=require(_0x29bc('0x6'));var config=require('../../config/environment');var attributes=require(_0x29bc('0x7'));module[_0x29bc('0x8')]=function(_0x4e5ce6,_0x44697d){return _0x4e5ce6[_0x29bc('0x9')](_0x29bc('0xa'),attributes,{'tableName':_0x29bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x29bc('0xc'),'collate':_0x29bc('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e67dee2..67f4117 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 _0xcbe5=['localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x49ebfd,_0x1f9990){var _0x5ca53e=function(_0x3c3467){while(--_0x3c3467){_0x49ebfd['push'](_0x49ebfd['shift']());}};_0x5ca53e(++_0x1f9990);}(_0xcbe5,0xee));var _0x5cbe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcbe5[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5cbe('0x0'));var util=require(_0x5cbe('0x1'));var moment=require(_0x5cbe('0x2'));var BPromise=require('bluebird');var rs=require(_0x5cbe('0x3'));var fs=require('fs');var Redis=require(_0x5cbe('0x4'));var db=require(_0x5cbe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cbe('0x6'))(_0x5cbe('0x7'));var config=require(_0x5cbe('0x8'));var jayson=require(_0x5cbe('0x9'));var client=jayson[_0x5cbe('0xa')][_0x5cbe('0xb')]({'port':0x232a});config[_0x5cbe('0xc')]=_[_0x5cbe('0xd')](config[_0x5cbe('0xc')],{'host':_0x5cbe('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5cbe('0xf'))[_0x5cbe('0x10')](socket);function respondWithRpcPromise(_0x56778b,_0x7546b2,_0x1f86ce){return new BPromise(function(_0x498637,_0x2a14c9){return client[_0x5cbe('0x11')](_0x56778b,_0x1f86ce)[_0x5cbe('0x12')](function(_0x4155e3){logger[_0x5cbe('0x13')](_0x5cbe('0x14'),_0x7546b2,'request\x20sent');logger[_0x5cbe('0x15')](_0x5cbe('0x16'),_0x7546b2,'request\x20sent',JSON[_0x5cbe('0x17')](_0x4155e3));if(_0x4155e3[_0x5cbe('0x18')]){if(_0x4155e3[_0x5cbe('0x18')]['code']===0x1f4){logger[_0x5cbe('0x18')](_0x5cbe('0x14'),_0x7546b2,_0x4155e3[_0x5cbe('0x18')][_0x5cbe('0x19')]);return _0x2a14c9(_0x4155e3[_0x5cbe('0x18')][_0x5cbe('0x19')]);}logger[_0x5cbe('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x7546b2,_0x4155e3[_0x5cbe('0x18')][_0x5cbe('0x19')]);return _0x498637(_0x4155e3[_0x5cbe('0x18')][_0x5cbe('0x19')]);}else{logger[_0x5cbe('0x13')](_0x5cbe('0x14'),_0x7546b2,_0x5cbe('0x1a'));_0x498637(_0x4155e3['result'][_0x5cbe('0x19')]);}})[_0x5cbe('0x1b')](function(_0x1290c0){logger[_0x5cbe('0x18')](_0x5cbe('0x14'),_0x7546b2,_0x1290c0);_0x2a14c9(_0x1290c0);});});}
\ No newline at end of file
+var _0xa9dd=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3c1cb6,_0x7636f7){var _0x3a9fff=function(_0x168742){while(--_0x168742){_0x3c1cb6['push'](_0x3c1cb6['shift']());}};_0x3a9fff(++_0x7636f7);}(_0xa9dd,0x1c2));var _0xda9d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9dd[_0x220dbb];return _0x2b77de;};'use strict';var _=require('lodash');var util=require(_0xda9d('0x0'));var moment=require(_0xda9d('0x1'));var BPromise=require('bluebird');var rs=require(_0xda9d('0x2'));var fs=require('fs');var Redis=require(_0xda9d('0x3'));var db=require(_0xda9d('0x4'))['db'];var utils=require(_0xda9d('0x5'));var logger=require('../../config/logger')(_0xda9d('0x6'));var config=require(_0xda9d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda9d('0x8')][_0xda9d('0x9')]({'port':0x232a});config[_0xda9d('0xa')]=_['defaults'](config[_0xda9d('0xa')],{'host':_0xda9d('0xb'),'port':0x18eb});var socket=require(_0xda9d('0xc'))(new Redis(config[_0xda9d('0xa')]));require(_0xda9d('0xd'))[_0xda9d('0xe')](socket);function respondWithRpcPromise(_0x122ddc,_0x4c298b,_0x4c9f61){return new BPromise(function(_0x344fcd,_0x2d3d5c){return client[_0xda9d('0xf')](_0x122ddc,_0x4c9f61)[_0xda9d('0x10')](function(_0x40c031){logger[_0xda9d('0x11')](_0xda9d('0x12'),_0x4c298b,'request\x20sent');logger[_0xda9d('0x13')](_0xda9d('0x14'),_0x4c298b,_0xda9d('0x15'),JSON[_0xda9d('0x16')](_0x40c031));if(_0x40c031[_0xda9d('0x17')]){if(_0x40c031['error'][_0xda9d('0x18')]===0x1f4){logger[_0xda9d('0x17')](_0xda9d('0x12'),_0x4c298b,_0x40c031[_0xda9d('0x17')][_0xda9d('0x19')]);return _0x2d3d5c(_0x40c031[_0xda9d('0x17')][_0xda9d('0x19')]);}logger[_0xda9d('0x17')](_0xda9d('0x12'),_0x4c298b,_0x40c031[_0xda9d('0x17')][_0xda9d('0x19')]);return _0x344fcd(_0x40c031[_0xda9d('0x17')][_0xda9d('0x19')]);}else{logger[_0xda9d('0x11')](_0xda9d('0x12'),_0x4c298b,_0xda9d('0x15'));_0x344fcd(_0x40c031[_0xda9d('0x1a')]['message']);}})[_0xda9d('0x1b')](function(_0x159a6f){logger[_0xda9d('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c298b,_0x159a6f);_0x2d3d5c(_0x159a6f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index f7b00a9..4507640 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 _0x4b6f=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b6f,0xb0));var _0xf4b6=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x4b6f[_0x3ff085];return _0x2b68c3;};'use strict';var ChatInternalMessageEvents=require(_0xf4b6('0x0'));var events=[_0xf4b6('0x1'),_0xf4b6('0x2'),_0xf4b6('0x3')];function createListener(_0x1bb09f,_0x169d93){return function(_0x16baed){_0x169d93['emit'](_0x1bb09f,_0x16baed);};}function removeListener(_0x39292e,_0xaf1d8){return function(){ChatInternalMessageEvents[_0xf4b6('0x4')](_0x39292e,_0xaf1d8);};}exports[_0xf4b6('0x5')]=function(_0x40c4ce){for(var _0xfdcd1e=0x0,_0x30390a=events['length'];_0xfdcd1e<_0x30390a;_0xfdcd1e++){var _0x41e30f=events[_0xfdcd1e];var _0xa8d630=createListener(_0xf4b6('0x6')+_0x41e30f,_0x40c4ce);ChatInternalMessageEvents['on'](_0x41e30f,_0xa8d630);}};
\ No newline at end of file
+var _0x5384=['save','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5384,0x13e));var _0x4538=function(_0x2a70e7,_0x3c78ff){_0x2a70e7=_0x2a70e7-0x0;var _0x3d06e9=_0x5384[_0x2a70e7];return _0x3d06e9;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x4538('0x0'),_0x4538('0x1'),_0x4538('0x2')];function createListener(_0x153c54,_0x29c7fd){return function(_0x489ebf){_0x29c7fd[_0x4538('0x3')](_0x153c54,_0x489ebf);};}function removeListener(_0x3a1c1b,_0x33df22){return function(){ChatInternalMessageEvents['removeListener'](_0x3a1c1b,_0x33df22);};}exports[_0x4538('0x4')]=function(_0x27507d){for(var _0xed25f2=0x0,_0x7ad8a1=events[_0x4538('0x5')];_0xed25f2<_0x7ad8a1;_0xed25f2++){var _0x32c3bb=events[_0xed25f2];var _0x5b397e=createListener('chatInternalMessage:'+_0x32c3bb,_0x27507d);ChatInternalMessageEvents['on'](_0x32c3bb,_0x5b397e);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2dec95c..d66e2b4 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 _0x19a1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','show','create','put','/:id','destroy'];(function(_0x191c4c,_0x3b7c2b){var _0x2fd037=function(_0x26026a){while(--_0x26026a){_0x191c4c['push'](_0x191c4c['shift']());}};_0x2fd037(++_0x3b7c2b);}(_0x19a1,0x11d));var _0x119a=function(_0x16a496,_0x2380e2){_0x16a496=_0x16a496-0x0;var _0x5d2c35=_0x19a1[_0x16a496];return _0x5d2c35;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x119a('0x0'));var timeout=require(_0x119a('0x1'));var express=require(_0x119a('0x2'));var router=express[_0x119a('0x3')]();var fs_extra=require(_0x119a('0x4'));var auth=require(_0x119a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x119a('0x6'));var controller=require(_0x119a('0x7'));router[_0x119a('0x8')]('/',auth[_0x119a('0x9')](),controller[_0x119a('0xa')]);router[_0x119a('0x8')](_0x119a('0xb'),auth[_0x119a('0x9')](),controller[_0x119a('0xc')]);router[_0x119a('0x8')]('/users',auth[_0x119a('0x9')](),controller[_0x119a('0xd')]);router[_0x119a('0x8')]('/:id',auth[_0x119a('0x9')](),controller[_0x119a('0xe')]);router['post']('/',auth[_0x119a('0x9')](),controller[_0x119a('0xf')]);router[_0x119a('0x10')]('/:id',controller['update']);router['delete'](_0x119a('0x11'),auth[_0x119a('0x9')](),controller[_0x119a('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xda3f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','put','delete','destroy','exports','multer','util','path'];(function(_0x3e18bf,_0x387f5e){var _0x1022e5=function(_0x242ec4){while(--_0x242ec4){_0x3e18bf['push'](_0x3e18bf['shift']());}};_0x1022e5(++_0x387f5e);}(_0xda3f,0x173));var _0xfda3=function(_0x488622,_0x46b90e){_0x488622=_0x488622-0x0;var _0x445246=_0xda3f[_0x488622];return _0x445246;};'use strict';var multer=require(_0xfda3('0x0'));var util=require(_0xfda3('0x1'));var path=require(_0xfda3('0x2'));var timeout=require(_0xfda3('0x3'));var express=require(_0xfda3('0x4'));var router=express[_0xfda3('0x5')]();var fs_extra=require(_0xfda3('0x6'));var auth=require(_0xfda3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfda3('0x8'));router[_0xfda3('0x9')]('/',auth[_0xfda3('0xa')](),controller[_0xfda3('0xb')]);router['get'](_0xfda3('0xc'),auth[_0xfda3('0xa')](),controller['describe']);router['get'](_0xfda3('0xd'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);router[_0xfda3('0x9')](_0xfda3('0xf'),auth[_0xfda3('0xa')](),controller[_0xfda3('0x10')]);router[_0xfda3('0x11')]('/',auth[_0xfda3('0xa')](),controller['create']);router[_0xfda3('0x12')](_0xfda3('0xf'),controller['update']);router[_0xfda3('0x13')](_0xfda3('0xf'),auth[_0xfda3('0xa')](),controller[_0xfda3('0x14')]);module[_0xfda3('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 aff7cf5..9d7ab5f 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 _0x71f4=['ENUM','out','STRING','TEXT','medium','BOOLEAN'];(function(_0x5e03f7,_0x5dc1d9){var _0xdf3b64=function(_0x43742f){while(--_0x43742f){_0x5e03f7['push'](_0x5e03f7['shift']());}};_0xdf3b64(++_0x5dc1d9);}(_0x71f4,0xf9));var _0x471f=function(_0x2569e9,_0x283072){_0x2569e9=_0x2569e9-0x0;var _0x1a19d6=_0x71f4[_0x2569e9];return _0x1a19d6;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x471f('0x0')](_0x471f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x471f('0x3')]('in','out'),'defaultValue':_0x471f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x471f('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x6cb4=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0x6cb4,0xff));var _0x46cb=function(_0x22619f,_0x17c7ac){_0x22619f=_0x22619f-0x0;var _0x42b23a=_0x6cb4[_0x22619f];return _0x42b23a;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'body':{'type':Sequelize[_0x46cb('0x2')](_0x46cb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x46cb('0x5')]('in',_0x46cb('0x6')),'defaultValue':_0x46cb('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x46cb('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 78326a0..b26fee1 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x1c52ab,_0x640d11){var _0x2bb28d=function(_0x5ec210){while(--_0x5ec210){_0x1c52ab['push'](_0x1c52ab['shift']());}};_0x2bb28d(++_0x640d11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x19105d,_0xefa103){var _0x556483=function(_0x40b840){while(--_0x40b840){_0x19105d['push'](_0x19105d['shift']());}};_0x556483(++_0xefa103);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 69e1335..e249345 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 _0x4fe8=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x1a7e2e,_0x304892){var _0x194472=function(_0x26fd24){while(--_0x26fd24){_0x1a7e2e['push'](_0x1a7e2e['shift']());}};_0x194472(++_0x304892);}(_0x4fe8,0x14f));var _0x84fe=function(_0x11c573,_0x1507b5){_0x11c573=_0x11c573-0x0;var _0x320ace=_0x4fe8[_0x11c573];return _0x320ace;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x84fe('0x0'))['db'][_0x84fe('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x84fe('0x2')](0x0);var events={'afterCreate':_0x84fe('0x3'),'afterUpdate':_0x84fe('0x4'),'afterDestroy':_0x84fe('0x5')};function emitEvent(_0x3da56f){return function(_0x2411e8,_0x39f486,_0x32c225){ChatMessageEvents[_0x84fe('0x6')](_0x3da56f+':'+_0x2411e8['id'],_0x2411e8);ChatMessageEvents[_0x84fe('0x6')](_0x3da56f,_0x2411e8);_0x32c225(null);};}for(var e in events){if(events[_0x84fe('0x7')](e)){var event=events[e];ChatMessage[_0x84fe('0x8')](e,emitEvent(event));}}module[_0x84fe('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xc03a=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc03a,0x1ee));var _0xac03=function(_0x212f66,_0x15f43d){_0x212f66=_0x212f66-0x0;var _0x54938e=_0xc03a[_0x212f66];return _0x54938e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xac03('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xac03('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xac03('0x2'),'afterDestroy':_0xac03('0x3')};function emitEvent(_0x5680a3){return function(_0x2e9d57,_0x3c3168,_0x245f8a){ChatMessageEvents[_0xac03('0x4')](_0x5680a3+':'+_0x2e9d57['id'],_0x2e9d57);ChatMessageEvents[_0xac03('0x4')](_0x5680a3,_0x2e9d57);_0x245f8a(null);};}for(var e in events){if(events[_0xac03('0x5')](e)){var event=events[e];ChatMessage[_0xac03('0x6')](e,emitEvent(event));}}module[_0xac03('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 33c8bfc..48f54c2 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 _0x945f=['rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','createdAt','error','utf8mb4','lodash','api','moment','path'];(function(_0x55d8aa,_0x3403c5){var _0x3ad990=function(_0xf19585){while(--_0xf19585){_0x55d8aa['push'](_0x55d8aa['shift']());}};_0x3ad990(++_0x3403c5);}(_0x945f,0x6f));var _0xf945=function(_0x55e7f9,_0x239568){_0x55e7f9=_0x55e7f9-0x0;var _0x48143c=_0x945f[_0x55e7f9];return _0x48143c;};'use strict';var _=require(_0xf945('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf945('0x1'));var moment=require(_0xf945('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf945('0x3'));var rimraf=require(_0xf945('0x4'));var config=require('../../config/environment');var attributes=require(_0xf945('0x5'));module[_0xf945('0x6')]=function(_0x4bcb2d,_0x254708){return _0x4bcb2d[_0xf945('0x7')](_0xf945('0x8'),attributes,{'tableName':_0xf945('0x9'),'paranoid':![],'indexes':[{'name':_0xf945('0xa'),'fields':[_0xf945('0xb')],'type':_0xf945('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1264aa,_0x46145a,_0x10c800){var _0xf1be1f=_0x4bcb2d['models'];var _0x3de729=_0x1264aa[_0xf945('0xd')]({'plain':!![]});if(_0x3de729[_0xf945('0xe')]['toLowerCase']()==='in'||_0x3de729[_0xf945('0xe')][_0xf945('0xf')]()===_0xf945('0x10')&&!_0x3de729[_0xf945('0x11')]&&!_['isNil'](_0x3de729[_0xf945('0x12')])){_0xf1be1f[_0xf945('0x13')]['findOne']({'where':{'id':_0x3de729['ChatInteractionId']}})['then'](function(_0x2e045d){if(_0x2e045d){_0x2e045d['update']({'lastMsgAt':_0x3de729[_0xf945('0x14')],'lastMsgDirection':_0x3de729['direction'][_0xf945('0xf')]()});}})['catch'](function(_0x20bf00){console[_0xf945('0x15')](_0x20bf00);});}_0x10c800();}},'charset':_0xf945('0x16'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xab90=['chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','catch','error','utf8mb4','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','ChatMessage'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0xab90,0xb5));var _0x0ab9=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xab90[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require(_0x0ab9('0x0'));var logger=require(_0x0ab9('0x1'))('api');var moment=require(_0x0ab9('0x2'));var BPromise=require(_0x0ab9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ab9('0x4'));var rimraf=require('rimraf');var config=require(_0x0ab9('0x5'));var attributes=require('./chatMessage.attributes');module[_0x0ab9('0x6')]=function(_0x5cfec7,_0x91b7d4){return _0x5cfec7['define'](_0x0ab9('0x7'),attributes,{'tableName':_0x0ab9('0x8'),'paranoid':![],'indexes':[{'name':_0x0ab9('0x9'),'fields':[_0x0ab9('0xa')],'type':_0x0ab9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x465097,_0x1988ee,_0x3b520c){var _0x6a71a2=_0x5cfec7[_0x0ab9('0xc')];var _0x4528cf=_0x465097[_0x0ab9('0xd')]({'plain':!![]});if(_0x4528cf[_0x0ab9('0xe')][_0x0ab9('0xf')]()==='in'||_0x4528cf[_0x0ab9('0xe')]['toLowerCase']()===_0x0ab9('0x10')&&!_0x4528cf[_0x0ab9('0x11')]&&!_[_0x0ab9('0x12')](_0x4528cf[_0x0ab9('0x13')])){_0x6a71a2[_0x0ab9('0x14')][_0x0ab9('0x15')]({'where':{'id':_0x4528cf[_0x0ab9('0x16')]}})['then'](function(_0xaae4d9){if(_0xaae4d9){_0xaae4d9[_0x0ab9('0x17')]({'lastMsgAt':_0x4528cf['createdAt'],'lastMsgDirection':_0x4528cf[_0x0ab9('0xe')][_0x0ab9('0xf')]()});}})[_0x0ab9('0x18')](function(_0x4231e0){console[_0x0ab9('0x19')](_0x4231e0);});}_0x3b520c();}},'charset':_0x0ab9('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 446607d..ab9290b 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 _0x8feb=['request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateChatMessage','ChatMessage','create','body','options','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','request','then','ChatMessage,\x20%s,\x20%s'];(function(_0x43b22b,_0xea722c){var _0xd4e124=function(_0x271814){while(--_0x271814){_0x43b22b['push'](_0x43b22b['shift']());}};_0xd4e124(++_0xea722c);}(_0x8feb,0xa9));var _0xb8fe=function(_0x4b2b43,_0x2fb809){_0x4b2b43=_0x4b2b43-0x0;var _0x4602cc=_0x8feb[_0x4b2b43];return _0x4602cc;};'use strict';var _=require(_0xb8fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb8fe('0x1'));var rs=require(_0xb8fe('0x2'));var fs=require('fs');var Redis=require(_0xb8fe('0x3'));var db=require(_0xb8fe('0x4'))['db'];var utils=require(_0xb8fe('0x5'));var logger=require(_0xb8fe('0x6'))(_0xb8fe('0x7'));var config=require('../../config/environment');var jayson=require(_0xb8fe('0x8'));var client=jayson[_0xb8fe('0x9')][_0xb8fe('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb8fe('0xb')],{'host':_0xb8fe('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xb8fe('0xd')](socket);function respondWithRpcPromise(_0x1142cf,_0x566d80,_0x2c08f4){return new BPromise(function(_0x5df424,_0x4b9260){return client[_0xb8fe('0xe')](_0x1142cf,_0x2c08f4)[_0xb8fe('0xf')](function(_0x4fcf0a){logger['info'](_0xb8fe('0x10'),_0x566d80,_0xb8fe('0x11'));logger[_0xb8fe('0x12')](_0xb8fe('0x13'),_0x566d80,_0xb8fe('0x11'),JSON[_0xb8fe('0x14')](_0x4fcf0a));if(_0x4fcf0a[_0xb8fe('0x15')]){if(_0x4fcf0a[_0xb8fe('0x15')]['code']===0x1f4){logger['error'](_0xb8fe('0x10'),_0x566d80,_0x4fcf0a['error']['message']);return _0x4b9260(_0x4fcf0a[_0xb8fe('0x15')]['message']);}logger[_0xb8fe('0x15')](_0xb8fe('0x10'),_0x566d80,_0x4fcf0a[_0xb8fe('0x15')][_0xb8fe('0x16')]);return _0x5df424(_0x4fcf0a[_0xb8fe('0x15')][_0xb8fe('0x16')]);}else{logger[_0xb8fe('0x17')](_0xb8fe('0x10'),_0x566d80,'request\x20sent');_0x5df424(_0x4fcf0a[_0xb8fe('0x18')]['message']);}})['catch'](function(_0x42fbc5){logger[_0xb8fe('0x15')](_0xb8fe('0x10'),_0x566d80,_0x42fbc5);_0x4b9260(_0x42fbc5);});});}exports[_0xb8fe('0x19')]=function(_0x220360){var _0x252355=this;return new Promise(function(_0x329601,_0x208db1){return db[_0xb8fe('0x1a')][_0xb8fe('0x1b')](_0x220360[_0xb8fe('0x1c')],{'raw':_0x220360[_0xb8fe('0x1d')]?_0x220360[_0xb8fe('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xb8fe('0xf')](function(_0x580bdc){logger[_0xb8fe('0x17')]('CreateChatMessage',_0x220360);logger[_0xb8fe('0x12')](_0xb8fe('0x19'),_0x220360,JSON['stringify'](_0x580bdc));_0x329601(_0x580bdc);})[_0xb8fe('0x1e')](function(_0x258057){logger[_0xb8fe('0x15')](_0xb8fe('0x19'),_0x258057[_0xb8fe('0x16')],_0x220360);_0x208db1(_0x252355['error'](0x1f4,_0x258057[_0xb8fe('0x16')]));});});};
\ No newline at end of file
+var _0x78c6=['request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket'];(function(_0x29f548,_0x267713){var _0x5c394f=function(_0x297d7d){while(--_0x297d7d){_0x29f548['push'](_0x29f548['shift']());}};_0x5c394f(++_0x267713);}(_0x78c6,0x168));var _0x678c=function(_0x265d48,_0x207343){_0x265d48=_0x265d48-0x0;var _0x94361d=_0x78c6[_0x265d48];return _0x94361d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x678c('0x0'));var rs=require(_0x678c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x678c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x678c('0x3'))(_0x678c('0x4'));var config=require(_0x678c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x678c('0x6')][_0x678c('0x7')]({'port':0x232a});config[_0x678c('0x8')]=_[_0x678c('0x9')](config[_0x678c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x678c('0xa'))(new Redis(config[_0x678c('0x8')]));require(_0x678c('0xb'))['register'](socket);function respondWithRpcPromise(_0x520e76,_0x3f1555,_0x58d555){return new BPromise(function(_0x217eda,_0x26f247){return client[_0x678c('0xc')](_0x520e76,_0x58d555)[_0x678c('0xd')](function(_0x30c0ec){logger['info'](_0x678c('0xe'),_0x3f1555,_0x678c('0xf'));logger[_0x678c('0x10')](_0x678c('0x11'),_0x3f1555,_0x678c('0xf'),JSON[_0x678c('0x12')](_0x30c0ec));if(_0x30c0ec[_0x678c('0x13')]){if(_0x30c0ec[_0x678c('0x13')][_0x678c('0x14')]===0x1f4){logger['error'](_0x678c('0xe'),_0x3f1555,_0x30c0ec[_0x678c('0x13')][_0x678c('0x15')]);return _0x26f247(_0x30c0ec[_0x678c('0x13')][_0x678c('0x15')]);}logger[_0x678c('0x13')](_0x678c('0xe'),_0x3f1555,_0x30c0ec[_0x678c('0x13')][_0x678c('0x15')]);return _0x217eda(_0x30c0ec[_0x678c('0x13')]['message']);}else{logger[_0x678c('0x16')](_0x678c('0xe'),_0x3f1555,_0x678c('0xf'));_0x217eda(_0x30c0ec[_0x678c('0x17')][_0x678c('0x15')]);}})[_0x678c('0x18')](function(_0x42e93b){logger[_0x678c('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3f1555,_0x42e93b);_0x26f247(_0x42e93b);});});}exports[_0x678c('0x19')]=function(_0x698244){var _0xeb152c=this;return new Promise(function(_0x23c6ba,_0x1407be){return db[_0x678c('0x1a')][_0x678c('0x1b')](_0x698244[_0x678c('0x1c')],{'raw':_0x698244[_0x678c('0x1d')]?_0x698244[_0x678c('0x1d')][_0x678c('0x1e')]===undefined?!![]:![]:!![]})[_0x678c('0xd')](function(_0x5c3f9b){logger[_0x678c('0x16')](_0x678c('0x19'),_0x698244);logger[_0x678c('0x10')]('CreateChatMessage',_0x698244,JSON[_0x678c('0x12')](_0x5c3f9b));_0x23c6ba(_0x5c3f9b);})[_0x678c('0x18')](function(_0x18225f){logger[_0x678c('0x13')](_0x678c('0x19'),_0x18225f[_0x678c('0x15')],_0x698244);_0x1407be(_0xeb152c['error'](0x1f4,_0x18225f[_0x678c('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index fc58913..08e665c 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 _0x78d3=['removeListener','register','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x2d7a93,_0x248393){var _0x326d7b=function(_0x5128a4){while(--_0x5128a4){_0x2d7a93['push'](_0x2d7a93['shift']());}};_0x326d7b(++_0x248393);}(_0x78d3,0x73));var _0x378d=function(_0x405cf1,_0x3a34cf){_0x405cf1=_0x405cf1-0x0;var _0x34184c=_0x78d3[_0x405cf1];return _0x34184c;};'use strict';var ChatMessageEvents=require(_0x378d('0x0'));var events=[_0x378d('0x1'),_0x378d('0x2'),_0x378d('0x3')];function createListener(_0x40323e,_0x1d87b8){return function(_0x367f93){_0x1d87b8[_0x378d('0x4')](_0x40323e,_0x367f93);};}function removeListener(_0x52f934,_0x32a62f){return function(){ChatMessageEvents[_0x378d('0x5')](_0x52f934,_0x32a62f);};}exports[_0x378d('0x6')]=function(_0xc18c0b){for(var _0x59117c=0x0,_0x47a99f=events['length'];_0x59117c<_0x47a99f;_0x59117c++){var _0x1c880e=events[_0x59117c];var _0x4b3ef5=createListener(_0x378d('0x7')+_0x1c880e,_0xc18c0b);ChatMessageEvents['on'](_0x1c880e,_0x4b3ef5);}};
\ No newline at end of file
+var _0x3248=['save','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3248,0x1bc));var _0x8324=function(_0x4056fc,_0x4cb52c){_0x4056fc=_0x4056fc-0x0;var _0x38a488=_0x3248[_0x4056fc];return _0x38a488;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x8324('0x0'),'remove','update'];function createListener(_0x1daa25,_0xf7c3f5){return function(_0x257d13){_0xf7c3f5[_0x8324('0x1')](_0x1daa25,_0x257d13);};}function removeListener(_0x2cfce9,_0x334505){return function(){ChatMessageEvents['removeListener'](_0x2cfce9,_0x334505);};}exports[_0x8324('0x2')]=function(_0x1c5c2a){for(var _0x5157f4=0x0,_0x25ee7a=events[_0x8324('0x3')];_0x5157f4<_0x25ee7a;_0x5157f4++){var _0x4302c5=events[_0x5157f4];var _0x1514c0=createListener('chatMessage:'+_0x4302c5,_0x1c5c2a);ChatMessageEvents['on'](_0x4302c5,_0x1514c0);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index bbc676b..e6abdbb 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 _0x9eb6=['post','chat','create','put','/:id','update','accept','/:id/reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show'];(function(_0x52c528,_0x46698f){var _0x5ba344=function(_0x4104ef){while(--_0x4104ef){_0x52c528['push'](_0x52c528['shift']());}};_0x5ba344(++_0x46698f);}(_0x9eb6,0x17a));var _0x69eb=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x9eb6[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require(_0x69eb('0x0'));var util=require(_0x69eb('0x1'));var path=require(_0x69eb('0x2'));var timeout=require('connect-timeout');var express=require(_0x69eb('0x3'));var router=express[_0x69eb('0x4')]();var fs_extra=require(_0x69eb('0x5'));var auth=require(_0x69eb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x69eb('0x7')]('/',auth[_0x69eb('0x8')](),controller[_0x69eb('0x9')]);router[_0x69eb('0x7')](_0x69eb('0xa'),auth['isAuthenticated'](),controller[_0x69eb('0xb')]);router[_0x69eb('0x7')]('/:id',auth[_0x69eb('0x8')](),controller[_0x69eb('0xc')]);router[_0x69eb('0xd')]('/',auth[_0x69eb('0x8')](),interaction['tracked'](_0x69eb('0xe'),'chatmessage:create'),controller[_0x69eb('0xf')]);router[_0x69eb('0x10')](_0x69eb('0x11'),controller[_0x69eb('0x12')]);router[_0x69eb('0x10')]('/:id/accept',auth[_0x69eb('0x8')](),controller[_0x69eb('0x13')]);router['put'](_0x69eb('0x14'),auth[_0x69eb('0x8')](),controller['reject']);router[_0x69eb('0x15')](_0x69eb('0x11'),auth[_0x69eb('0x8')](),controller[_0x69eb('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xb51f=['/:id/accept','put','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','tracked','chat','chatmessage:create','create','update'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0xb51f,0x155));var _0xfb51=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0xb51f[_0x277fa3];return _0x2e4520;};'use strict';var multer=require(_0xfb51('0x0'));var util=require(_0xfb51('0x1'));var path=require(_0xfb51('0x2'));var timeout=require(_0xfb51('0x3'));var express=require('express');var router=express[_0xfb51('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfb51('0x5'));var interaction=require(_0xfb51('0x6'));var config=require(_0xfb51('0x7'));var controller=require('./chatMessage.controller');router[_0xfb51('0x8')]('/',auth[_0xfb51('0x9')](),controller[_0xfb51('0xa')]);router[_0xfb51('0x8')](_0xfb51('0xb'),auth[_0xfb51('0x9')](),controller[_0xfb51('0xc')]);router[_0xfb51('0x8')](_0xfb51('0xd'),auth[_0xfb51('0x9')](),controller['show']);router['post']('/',auth[_0xfb51('0x9')](),interaction[_0xfb51('0xe')](_0xfb51('0xf'),_0xfb51('0x10')),controller[_0xfb51('0x11')]);router['put'](_0xfb51('0xd'),controller[_0xfb51('0x12')]);router['put'](_0xfb51('0x13'),auth[_0xfb51('0x9')](),controller['accept']);router[_0xfb51('0x14')]('/:id/reject',auth[_0xfb51('0x9')](),controller[_0xfb51('0x15')]);router[_0xfb51('0x16')](_0xfb51('0xd'),auth[_0xfb51('0x9')](),controller['destroy']);module[_0xfb51('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 60ff73f..cd50878 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 _0xb497=['medium','sequelize'];(function(_0x341f55,_0x50862f){var _0x4057f3=function(_0x180545){while(--_0x180545){_0x341f55['push'](_0x341f55['shift']());}};_0x4057f3(++_0x50862f);}(_0xb497,0x9f));var _0x7b49=function(_0x245cf0,_0x4a36cf){_0x245cf0=_0x245cf0-0x0;var _0x4046ff=_0xb497[_0x245cf0];return _0x4046ff;};'use strict';var Sequelize=require(_0x7b49('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7b49('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xc94f=['medium','sequelize','TEXT'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xc94f,0xcd));var _0xfc94=function(_0xd7d92b,_0x162a88){_0xd7d92b=_0xd7d92b-0x0;var _0x42856d=_0xc94f[_0xd7d92b];return _0x42856d;};'use strict';var Sequelize=require(_0xfc94('0x0'));module['exports']={'body':{'type':Sequelize[_0xfc94('0x1')](_0xfc94('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index ae3331c..33f9343 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(_0x33e1e4,_0x2a13d7){var _0x3b5eb3=function(_0x494df2){while(--_0x494df2){_0x33e1e4['push'](_0x33e1e4['shift']());}};_0x3b5eb3(++_0x2a13d7);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x7a54,0x106));var _0x47a5=function(_0x18532a,_0x11386d){_0x18532a=_0x18532a-0x0;var _0x365abb=_0x7a54[_0x18532a];return _0x365abb;};'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 d2bd96d..a3caaa6 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 _0xff3e=['./chatOfflineMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3f0fc2,_0x58cd80){var _0x2bd742=function(_0x4d18ed){while(--_0x4d18ed){_0x3f0fc2['push'](_0x3f0fc2['shift']());}};_0x2bd742(++_0x58cd80);}(_0xff3e,0xf5));var _0xeff3=function(_0x376d19,_0xeaa649){_0x376d19=_0x376d19-0x0;var _0x1a2624=_0xff3e[_0x376d19];return _0x1a2624;};'use strict';var _=require('lodash');var util=require(_0xeff3('0x0'));var logger=require(_0xeff3('0x1'))('api');var moment=require(_0xeff3('0x2'));var BPromise=require(_0xeff3('0x3'));var rp=require(_0xeff3('0x4'));var fs=require('fs');var path=require(_0xeff3('0x5'));var rimraf=require('rimraf');var config=require(_0xeff3('0x6'));var attributes=require(_0xeff3('0x7'));module[_0xeff3('0x8')]=function(_0x40560d,_0x4691d7){return _0x40560d[_0xeff3('0x9')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeff3('0xa'),'collate':_0xeff3('0xb')});};
\ No newline at end of file
+var _0xf9b9=['moment','path','rimraf','../../config/environment','define','ChatOfflineMessage','chat_offline_messages','lodash','util','../../config/logger','api'];(function(_0x5f1c91,_0x34436a){var _0x585310=function(_0x5ec6c4){while(--_0x5ec6c4){_0x5f1c91['push'](_0x5f1c91['shift']());}};_0x585310(++_0x34436a);}(_0xf9b9,0x1d5));var _0x9f9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9b9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9f9b('0x0'));var util=require(_0x9f9b('0x1'));var logger=require(_0x9f9b('0x2'))(_0x9f9b('0x3'));var moment=require(_0x9f9b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f9b('0x5'));var rimraf=require(_0x9f9b('0x6'));var config=require(_0x9f9b('0x7'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x22efd3,_0x5d827f){return _0x22efd3[_0x9f9b('0x8')](_0x9f9b('0x9'),attributes,{'tableName':_0x9f9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 8747822..a0142ae 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 _0x1bfb=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1bfb,0x190));var _0xb1bf=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0x1bfb[_0x10d34b];return _0x92b0bf;};'use strict';var _=require(_0xb1bf('0x0'));var util=require(_0xb1bf('0x1'));var moment=require(_0xb1bf('0x2'));var BPromise=require(_0xb1bf('0x3'));var rs=require(_0xb1bf('0x4'));var fs=require('fs');var Redis=require(_0xb1bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb1bf('0x6'));var logger=require(_0xb1bf('0x7'))(_0xb1bf('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1bf('0x9'));var client=jayson['client'][_0xb1bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x377b04,_0x2df49a,_0x46eae){return new BPromise(function(_0x4b5195,_0x1af548){return client['request'](_0x377b04,_0x46eae)[_0xb1bf('0xb')](function(_0x723470){logger[_0xb1bf('0xc')](_0xb1bf('0xd'),_0x2df49a,_0xb1bf('0xe'));logger[_0xb1bf('0xf')](_0xb1bf('0x10'),_0x2df49a,_0xb1bf('0xe'),JSON[_0xb1bf('0x11')](_0x723470));if(_0x723470[_0xb1bf('0x12')]){if(_0x723470[_0xb1bf('0x12')][_0xb1bf('0x13')]===0x1f4){logger[_0xb1bf('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2df49a,_0x723470[_0xb1bf('0x12')]['message']);return _0x1af548(_0x723470['error'][_0xb1bf('0x14')]);}logger[_0xb1bf('0x12')](_0xb1bf('0xd'),_0x2df49a,_0x723470['error'][_0xb1bf('0x14')]);return _0x4b5195(_0x723470[_0xb1bf('0x12')][_0xb1bf('0x14')]);}else{logger[_0xb1bf('0xc')](_0xb1bf('0xd'),_0x2df49a,'request\x20sent');_0x4b5195(_0x723470[_0xb1bf('0x15')][_0xb1bf('0x14')]);}})['catch'](function(_0x3ff36f){logger[_0xb1bf('0x12')](_0xb1bf('0xd'),_0x2df49a,_0x3ff36f);_0x1af548(_0x3ff36f);});});}
\ No newline at end of file
+var _0x45c9=['message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xd69ddd,_0x4ee97d){var _0x4e5410=function(_0x58dd1b){while(--_0x58dd1b){_0xd69ddd['push'](_0xd69ddd['shift']());}};_0x4e5410(++_0x4ee97d);}(_0x45c9,0x96));var _0x945c=function(_0x158059,_0x1474c9){_0x158059=_0x158059-0x0;var _0x992c76=_0x45c9[_0x158059];return _0x992c76;};'use strict';var _=require('lodash');var util=require(_0x945c('0x0'));var moment=require('moment');var BPromise=require(_0x945c('0x1'));var rs=require(_0x945c('0x2'));var fs=require('fs');var Redis=require(_0x945c('0x3'));var db=require(_0x945c('0x4'))['db'];var utils=require(_0x945c('0x5'));var logger=require('../../config/logger')(_0x945c('0x6'));var config=require('../../config/environment');var jayson=require(_0x945c('0x7'));var client=jayson[_0x945c('0x8')][_0x945c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5c07,_0x265b02,_0x9a988b){return new BPromise(function(_0x4253bf,_0x56c700){return client[_0x945c('0xa')](_0x3c5c07,_0x9a988b)['then'](function(_0x439b59){logger['info'](_0x945c('0xb'),_0x265b02,'request\x20sent');logger[_0x945c('0xc')](_0x945c('0xd'),_0x265b02,_0x945c('0xe'),JSON[_0x945c('0xf')](_0x439b59));if(_0x439b59[_0x945c('0x10')]){if(_0x439b59[_0x945c('0x10')][_0x945c('0x11')]===0x1f4){logger[_0x945c('0x10')](_0x945c('0xb'),_0x265b02,_0x439b59[_0x945c('0x10')][_0x945c('0x12')]);return _0x56c700(_0x439b59[_0x945c('0x10')][_0x945c('0x12')]);}logger[_0x945c('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x265b02,_0x439b59[_0x945c('0x10')][_0x945c('0x12')]);return _0x4253bf(_0x439b59[_0x945c('0x10')][_0x945c('0x12')]);}else{logger[_0x945c('0x13')](_0x945c('0xb'),_0x265b02,_0x945c('0xe'));_0x4253bf(_0x439b59['result'][_0x945c('0x12')]);}})[_0x945c('0x14')](function(_0x3bfb01){logger['error'](_0x945c('0xb'),_0x265b02,_0x3bfb01);_0x56c700(_0x3bfb01);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 7ea8b50..412652a 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 _0x54d2=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x54d2,0xe3));var _0x254d=function(_0x367905,_0x325a4d){_0x367905=_0x367905-0x0;var _0xa2a385=_0x54d2[_0x367905];return _0xa2a385;};'use strict';var multer=require(_0x254d('0x0'));var util=require(_0x254d('0x1'));var path=require(_0x254d('0x2'));var timeout=require(_0x254d('0x3'));var express=require(_0x254d('0x4'));var router=express['Router']();var fs_extra=require(_0x254d('0x5'));var auth=require(_0x254d('0x6'));var interaction=require(_0x254d('0x7'));var config=require(_0x254d('0x8'));var controller=require(_0x254d('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x254d('0xa')](_0x254d('0xb'),auth['isAuthenticated'](),controller[_0x254d('0xc')]);router[_0x254d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x254d('0xd')]);router[_0x254d('0xe')]('/',auth[_0x254d('0xf')](),controller[_0x254d('0x10')]);router[_0x254d('0x11')](_0x254d('0x12'),auth[_0x254d('0xf')](),controller[_0x254d('0x13')]);router[_0x254d('0x14')](_0x254d('0x12'),auth['isAuthenticated'](),controller[_0x254d('0x15')]);module[_0x254d('0x16')]=router;
\ No newline at end of file
+var _0x43d5=['/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe','post','create','put','update','delete'];(function(_0x276d03,_0x2b8ece){var _0x578e0b=function(_0x48fb8a){while(--_0x48fb8a){_0x276d03['push'](_0x276d03['shift']());}};_0x578e0b(++_0x2b8ece);}(_0x43d5,0xdf));var _0x543d=function(_0x50c527,_0x2d4458){_0x50c527=_0x50c527-0x0;var _0x2c7c15=_0x43d5[_0x50c527];return _0x2c7c15;};'use strict';var multer=require(_0x543d('0x0'));var util=require(_0x543d('0x1'));var path=require('path');var timeout=require(_0x543d('0x2'));var express=require(_0x543d('0x3'));var router=express[_0x543d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x543d('0x5'));var interaction=require(_0x543d('0x6'));var config=require(_0x543d('0x7'));var controller=require(_0x543d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x543d('0x9')]);router[_0x543d('0xa')](_0x543d('0xb'),auth[_0x543d('0xc')](),controller[_0x543d('0xd')]);router[_0x543d('0xa')]('/:id',auth[_0x543d('0xc')](),controller['show']);router[_0x543d('0xe')]('/',auth[_0x543d('0xc')](),controller[_0x543d('0xf')]);router[_0x543d('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x543d('0x11')]);router[_0x543d('0x12')](_0x543d('0x13'),auth['isAuthenticated'](),controller[_0x543d('0x14')]);module[_0x543d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index ea8b8cd..b473cb7 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 _0x6101=['STRING','ENUM','mouseOver','INTEGER','exports'];(function(_0x31c7fc,_0x11de6a){var _0x3c568e=function(_0xb9c0ed){while(--_0xb9c0ed){_0x31c7fc['push'](_0x31c7fc['shift']());}};_0x3c568e(++_0x11de6a);}(_0x6101,0x7c));var _0x1610=function(_0x27ecb2,_0x55c9b5){_0x27ecb2=_0x27ecb2-0x0;var _0x347f58=_0x6101[_0x27ecb2];return _0x347f58;};'use strict';var Sequelize=require('sequelize');module[_0x1610('0x0')]={'name':{'type':Sequelize[_0x1610('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1610('0x2')](_0x1610('0x3'),'timeout'),'defaultValue':_0x1610('0x3')},'selector':{'type':Sequelize[_0x1610('0x1')]},'timeout':{'type':Sequelize[_0x1610('0x4')]}};
\ No newline at end of file
+var _0x9b70=['STRING','ENUM','timeout','mouseOver','INTEGER','sequelize','exports'];(function(_0x1183a9,_0x1c1b0b){var _0x5e6983=function(_0x2ee5a5){while(--_0x2ee5a5){_0x1183a9['push'](_0x1183a9['shift']());}};_0x5e6983(++_0x1c1b0b);}(_0x9b70,0x16a));var _0x09b7=function(_0x2a0527,_0x2fc13f){_0x2a0527=_0x2a0527-0x0;var _0x1f4163=_0x9b70[_0x2a0527];return _0x1f4163;};'use strict';var Sequelize=require(_0x09b7('0x0'));module[_0x09b7('0x1')]={'name':{'type':Sequelize[_0x09b7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x09b7('0x3')]('mouseOver',_0x09b7('0x4')),'defaultValue':_0x09b7('0x5')},'selector':{'type':Sequelize[_0x09b7('0x2')]},'timeout':{'type':Sequelize[_0x09b7('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 220aa91..a03cbfb 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 _0x0c02=['sendStatus','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','options','catch','create','body','find','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x126321,_0x263992){var _0x3febf7=function(_0x92cb00){while(--_0x92cb00){_0x126321['push'](_0x126321['shift']());}};_0x3febf7(++_0x263992);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20c0('0x0'));var zipdir=require(_0x20c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20c0('0x2'));var moment=require(_0x20c0('0x3'));var BPromise=require(_0x20c0('0x4'));var Mustache=require(_0x20c0('0x5'));var util=require(_0x20c0('0x6'));var path=require(_0x20c0('0x7'));var sox=require(_0x20c0('0x8'));var csv=require(_0x20c0('0x9'));var ejs=require(_0x20c0('0xa'));var fs=require('fs');var fs_extra=require(_0x20c0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x20c0('0xc'));var toCsv=require(_0x20c0('0x9'));var querystring=require(_0x20c0('0xd'));var Papa=require(_0x20c0('0xe'));var Redis=require(_0x20c0('0xf'));var authService=require(_0x20c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x20c0('0x11'));var config=require(_0x20c0('0x12'));var licenseUtil=require(_0x20c0('0x13'));var db=require(_0x20c0('0x14'))['db'];function respondWithStatusCode(_0x4ed79e,_0x56fa09){_0x56fa09=_0x56fa09||0xcc;return function(_0x55854e){if(_0x55854e){return _0x4ed79e['sendStatus'](_0x56fa09);}return _0x4ed79e[_0x20c0('0x15')](_0x56fa09)[_0x20c0('0x16')]();};}function respondWithResult(_0x42161f,_0x3b2bba){_0x3b2bba=_0x3b2bba||0xc8;return function(_0x37f4e0){if(_0x37f4e0){return _0x42161f[_0x20c0('0x15')](_0x3b2bba)[_0x20c0('0x17')](_0x37f4e0);}};}function respondWithFilteredResult(_0x105839,_0x280aff){return function(_0x5a5e25){if(_0x5a5e25){var _0xd80b64=typeof _0x280aff[_0x20c0('0x18')]===_0x20c0('0x19')&&typeof _0x280aff[_0x20c0('0x1a')]===_0x20c0('0x19');var _0xeff5b9=_0x5a5e25['count'];var _0x55de3b=_0xd80b64?0x0:_0x280aff['offset'];var _0x10a921=_0xd80b64?_0x5a5e25[_0x20c0('0x1b')]:_0x280aff[_0x20c0('0x18')]+_0x280aff[_0x20c0('0x1a')];var _0x5b3725;if(_0x10a921>=_0xeff5b9){_0x10a921=_0xeff5b9;_0x5b3725=0xc8;}else{_0x5b3725=0xce;}_0x105839[_0x20c0('0x15')](_0x5b3725);return _0x105839[_0x20c0('0x1c')](_0x20c0('0x1d'),_0x55de3b+'-'+_0x10a921+'/'+_0xeff5b9)['json'](_0x5a5e25);}return null;};}function patchUpdates(_0x54bd1e){return function(_0x343db7){try{jsonpatch[_0x20c0('0x1e')](_0x343db7,_0x54bd1e,!![]);}catch(_0x1407d3){return BPromise[_0x20c0('0x1f')](_0x1407d3);}return _0x343db7[_0x20c0('0x20')]();};}function saveUpdates(_0x53d8e8,_0x2213f5){return function(_0x28959a){if(_0x28959a){return _0x28959a[_0x20c0('0x21')](_0x53d8e8)[_0x20c0('0x22')](function(_0x52b8b8){return _0x52b8b8;});}return null;};}function removeEntity(_0xfea1eb,_0x3e545c){return function(_0x2447e6){if(_0x2447e6){return _0x2447e6[_0x20c0('0x23')]()[_0x20c0('0x22')](function(){_0xfea1eb[_0x20c0('0x15')](0xcc)[_0x20c0('0x16')]();});}};}function handleEntityNotFound(_0x55b129,_0x45c08c){return function(_0x595d94){if(!_0x595d94){_0x55b129[_0x20c0('0x24')](0x194);}return _0x595d94;};}function handleError(_0x31565b,_0x11da5a){_0x11da5a=_0x11da5a||0x1f4;return function(_0x14dac3){logger['error'](_0x14dac3['stack']);if(_0x14dac3[_0x20c0('0x25')]){delete _0x14dac3[_0x20c0('0x25')];}_0x31565b[_0x20c0('0x15')](_0x11da5a)['send'](_0x14dac3);};}exports[_0x20c0('0x26')]=function(_0x25592b,_0x1bcfaf){var _0x41c743={'raw':!![],'where':{'id':_0x25592b['params']['id']}},_0x4baaed={};_0x4baaed[_0x20c0('0x27')]=_[_0x20c0('0x28')](db[_0x20c0('0x29')][_0x20c0('0x2a')]);_0x4baaed[_0x20c0('0x2b')]=_[_0x20c0('0x28')](_0x25592b[_0x20c0('0x2b')]);_0x4baaed[_0x20c0('0x2c')]=_[_0x20c0('0x2d')](_0x4baaed[_0x20c0('0x27')],_0x4baaed[_0x20c0('0x2b')]);_0x41c743[_0x20c0('0x2e')]=_[_0x20c0('0x2d')](_0x4baaed[_0x20c0('0x27')],qs['fields'](_0x25592b[_0x20c0('0x2b')][_0x20c0('0x2f')]));_0x41c743[_0x20c0('0x2e')]=_0x41c743[_0x20c0('0x2e')]['length']?_0x41c743[_0x20c0('0x2e')]:_0x4baaed[_0x20c0('0x27')];if(_0x25592b[_0x20c0('0x2b')][_0x20c0('0x30')]){_0x41c743[_0x20c0('0x31')]=[{'all':!![]}];}_0x41c743=_['merge']({},_0x41c743,_0x25592b[_0x20c0('0x32')]);return db['ChatProactiveAction']['find'](_0x41c743)[_0x20c0('0x22')](handleEntityNotFound(_0x1bcfaf,null))[_0x20c0('0x22')](respondWithResult(_0x1bcfaf,null))[_0x20c0('0x33')](handleError(_0x1bcfaf,null));};exports[_0x20c0('0x34')]=function(_0x1a4aeb,_0x39fd84){return db[_0x20c0('0x29')]['create'](_0x1a4aeb['body'],{})['then'](respondWithResult(_0x39fd84,0xc9))[_0x20c0('0x33')](handleError(_0x39fd84,null));};exports[_0x20c0('0x21')]=function(_0x545b39,_0x346a04){if(_0x545b39[_0x20c0('0x35')]['id']){delete _0x545b39['body']['id'];}return db['ChatProactiveAction'][_0x20c0('0x36')]({'where':{'id':_0x545b39[_0x20c0('0x37')]['id']}})['then'](handleEntityNotFound(_0x346a04,null))[_0x20c0('0x22')](saveUpdates(_0x545b39['body'],null))[_0x20c0('0x22')](respondWithResult(_0x346a04,null))[_0x20c0('0x33')](handleError(_0x346a04,null));};exports[_0x20c0('0x23')]=function(_0x291e66,_0x5997f5){return db[_0x20c0('0x29')][_0x20c0('0x36')]({'where':{'id':_0x291e66[_0x20c0('0x37')]['id']}})[_0x20c0('0x22')](handleEntityNotFound(_0x5997f5,null))[_0x20c0('0x22')](removeEntity(_0x5997f5,null))[_0x20c0('0x33')](handleError(_0x5997f5,null));};
\ No newline at end of file
+var _0x2975=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','update','then','end','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','intersection','model','attributes','fields','length','include','merge','options','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash'];(function(_0xea1e6a,_0x5a1bf4){var _0xed4e08=function(_0x20e49a){while(--_0x20e49a){_0xea1e6a['push'](_0xea1e6a['shift']());}};_0xed4e08(++_0x5a1bf4);}(_0x2975,0x1c5));var _0x5297=function(_0x3f8543,_0x4bb213){_0x3f8543=_0x3f8543-0x0;var _0x5bdd19=_0x2975[_0x3f8543];return _0x5bdd19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5297('0x0'));var zipdir=require(_0x5297('0x1'));var jsonpatch=require(_0x5297('0x2'));var rp=require(_0x5297('0x3'));var moment=require(_0x5297('0x4'));var BPromise=require(_0x5297('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5297('0x6'));var csv=require(_0x5297('0x7'));var ejs=require(_0x5297('0x8'));var fs=require('fs');var fs_extra=require(_0x5297('0x9'));var _=require(_0x5297('0xa'));var squel=require(_0x5297('0xb'));var crypto=require(_0x5297('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5297('0xd'));var toCsv=require(_0x5297('0x7'));var querystring=require(_0x5297('0xe'));var Papa=require(_0x5297('0xf'));var Redis=require(_0x5297('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5297('0x11'));var as=require(_0x5297('0x12'));var hardwareService=require(_0x5297('0x13'));var logger=require('../../config/logger')(_0x5297('0x14'));var utils=require(_0x5297('0x15'));var config=require(_0x5297('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5297('0x17'))['db'];function respondWithStatusCode(_0x21bef8,_0x491fec){_0x491fec=_0x491fec||0xcc;return function(_0x594191){if(_0x594191){return _0x21bef8[_0x5297('0x18')](_0x491fec);}return _0x21bef8[_0x5297('0x19')](_0x491fec)['end']();};}function respondWithResult(_0x7e3417,_0x5b1a97){_0x5b1a97=_0x5b1a97||0xc8;return function(_0x253b83){if(_0x253b83){return _0x7e3417[_0x5297('0x19')](_0x5b1a97)['json'](_0x253b83);}};}function respondWithFilteredResult(_0x96304b,_0x1e5499){return function(_0x15e2e1){if(_0x15e2e1){var _0x40afca=typeof _0x1e5499[_0x5297('0x1a')]===_0x5297('0x1b')&&typeof _0x1e5499[_0x5297('0x1c')]===_0x5297('0x1b');var _0x4ae2fe=_0x15e2e1[_0x5297('0x1d')];var _0x136461=_0x40afca?0x0:_0x1e5499[_0x5297('0x1a')];var _0x38f106=_0x40afca?_0x15e2e1['count']:_0x1e5499[_0x5297('0x1a')]+_0x1e5499[_0x5297('0x1c')];var _0x52286c;if(_0x38f106>=_0x4ae2fe){_0x38f106=_0x4ae2fe;_0x52286c=0xc8;}else{_0x52286c=0xce;}_0x96304b[_0x5297('0x19')](_0x52286c);return _0x96304b['set'](_0x5297('0x1e'),_0x136461+'-'+_0x38f106+'/'+_0x4ae2fe)[_0x5297('0x1f')](_0x15e2e1);}return null;};}function patchUpdates(_0x39b675){return function(_0xc33c){try{jsonpatch['apply'](_0xc33c,_0x39b675,!![]);}catch(_0x43e00e){return BPromise[_0x5297('0x20')](_0x43e00e);}return _0xc33c['save']();};}function saveUpdates(_0x38408e,_0x3ebbc5){return function(_0x56fffa){if(_0x56fffa){return _0x56fffa[_0x5297('0x21')](_0x38408e)[_0x5297('0x22')](function(_0x574899){return _0x574899;});}return null;};}function removeEntity(_0x28df2d,_0x31ffc4){return function(_0x2c0f01){if(_0x2c0f01){return _0x2c0f01['destroy']()['then'](function(){_0x28df2d[_0x5297('0x19')](0xcc)[_0x5297('0x23')]();});}};}function handleEntityNotFound(_0x18fe2a,_0x4e1300){return function(_0x2ca4cc){if(!_0x2ca4cc){_0x18fe2a['sendStatus'](0x194);}return _0x2ca4cc;};}function handleError(_0x515a51,_0x28819d){_0x28819d=_0x28819d||0x1f4;return function(_0x373414){logger[_0x5297('0x24')](_0x373414[_0x5297('0x25')]);if(_0x373414['name']){delete _0x373414[_0x5297('0x26')];}_0x515a51[_0x5297('0x19')](_0x28819d)[_0x5297('0x27')](_0x373414);};}exports[_0x5297('0x28')]=function(_0x3826d2,_0x201181){var _0x248348={'raw':!![],'where':{'id':_0x3826d2[_0x5297('0x29')]['id']}},_0x1dee33={};_0x1dee33['model']=_[_0x5297('0x2a')](db[_0x5297('0x2b')][_0x5297('0x2c')]);_0x1dee33['query']=_[_0x5297('0x2a')](_0x3826d2[_0x5297('0x2d')]);_0x1dee33['filters']=_[_0x5297('0x2e')](_0x1dee33[_0x5297('0x2f')],_0x1dee33[_0x5297('0x2d')]);_0x248348[_0x5297('0x30')]=_[_0x5297('0x2e')](_0x1dee33['model'],qs[_0x5297('0x31')](_0x3826d2[_0x5297('0x2d')][_0x5297('0x31')]));_0x248348[_0x5297('0x30')]=_0x248348['attributes'][_0x5297('0x32')]?_0x248348['attributes']:_0x1dee33[_0x5297('0x2f')];if(_0x3826d2[_0x5297('0x2d')]['includeAll']){_0x248348[_0x5297('0x33')]=[{'all':!![]}];}_0x248348=_[_0x5297('0x34')]({},_0x248348,_0x3826d2[_0x5297('0x35')]);return db[_0x5297('0x2b')]['find'](_0x248348)[_0x5297('0x22')](handleEntityNotFound(_0x201181,null))[_0x5297('0x22')](respondWithResult(_0x201181,null))[_0x5297('0x36')](handleError(_0x201181,null));};exports[_0x5297('0x37')]=function(_0x5d546a,_0x276c25){return db[_0x5297('0x2b')][_0x5297('0x37')](_0x5d546a[_0x5297('0x38')],{})[_0x5297('0x22')](respondWithResult(_0x276c25,0xc9))[_0x5297('0x36')](handleError(_0x276c25,null));};exports[_0x5297('0x21')]=function(_0x171ffb,_0x209c21){if(_0x171ffb[_0x5297('0x38')]['id']){delete _0x171ffb['body']['id'];}return db[_0x5297('0x2b')][_0x5297('0x39')]({'where':{'id':_0x171ffb[_0x5297('0x29')]['id']}})[_0x5297('0x22')](handleEntityNotFound(_0x209c21,null))[_0x5297('0x22')](saveUpdates(_0x171ffb[_0x5297('0x38')],null))['then'](respondWithResult(_0x209c21,null))[_0x5297('0x36')](handleError(_0x209c21,null));};exports['destroy']=function(_0x380ba1,_0x3588f0){return db[_0x5297('0x2b')]['find']({'where':{'id':_0x380ba1['params']['id']}})[_0x5297('0x22')](handleEntityNotFound(_0x3588f0,null))[_0x5297('0x22')](removeEntity(_0x3588f0,null))[_0x5297('0x36')](handleError(_0x3588f0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index f1e48f8..6c968aa 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 _0x7216=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction'];(function(_0x40cd61,_0x36162c){var _0x120ce8=function(_0x59c7cc){while(--_0x59c7cc){_0x40cd61['push'](_0x40cd61['shift']());}};_0x120ce8(++_0x36162c);}(_0x7216,0x11e));var _0x6721=function(_0x47e7c1,_0x290f15){_0x47e7c1=_0x47e7c1-0x0;var _0x4244f7=_0x7216[_0x47e7c1];return _0x4244f7;};'use strict';var _=require(_0x6721('0x0'));var util=require(_0x6721('0x1'));var logger=require(_0x6721('0x2'))(_0x6721('0x3'));var moment=require(_0x6721('0x4'));var BPromise=require('bluebird');var rp=require(_0x6721('0x5'));var fs=require('fs');var path=require(_0x6721('0x6'));var rimraf=require(_0x6721('0x7'));var config=require(_0x6721('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x6721('0x9')]=function(_0x2f595d,_0x120202){return _0x2f595d['define'](_0x6721('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa345=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x5d6250,_0xba4c48){var _0x52a098=function(_0x5cda48){while(--_0x5cda48){_0x5d6250['push'](_0x5d6250['shift']());}};_0x52a098(++_0xba4c48);}(_0xa345,0x6c));var _0x5a34=function(_0xb857bd,_0x4c546c){_0xb857bd=_0xb857bd-0x0;var _0x1a8503=_0xa345[_0xb857bd];return _0x1a8503;};'use strict';var _=require(_0x5a34('0x0'));var util=require(_0x5a34('0x1'));var logger=require(_0x5a34('0x2'))(_0x5a34('0x3'));var moment=require(_0x5a34('0x4'));var BPromise=require(_0x5a34('0x5'));var rp=require(_0x5a34('0x6'));var fs=require('fs');var path=require(_0x5a34('0x7'));var rimraf=require(_0x5a34('0x8'));var config=require(_0x5a34('0x9'));var attributes=require(_0x5a34('0xa'));module[_0x5a34('0xb')]=function(_0x19df50,_0x27a173){return _0x19df50[_0x5a34('0xc')](_0x5a34('0xd'),attributes,{'tableName':_0x5a34('0xe'),'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 1439b9e..4dd5eff 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 _0x6a3b=['debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x4e310c,_0x161a51){var _0x247cf7=function(_0x2e9ad7){while(--_0x2e9ad7){_0x4e310c['push'](_0x4e310c['shift']());}};_0x247cf7(++_0x161a51);}(_0x6a3b,0x1a9));var _0xb6a3=function(_0x49eec3,_0x4c0bdb){_0x49eec3=_0x49eec3-0x0;var _0x44b4c0=_0x6a3b[_0x49eec3];return _0x44b4c0;};'use strict';var _=require(_0xb6a3('0x0'));var util=require(_0xb6a3('0x1'));var moment=require(_0xb6a3('0x2'));var BPromise=require('bluebird');var rs=require(_0xb6a3('0x3'));var fs=require('fs');var Redis=require(_0xb6a3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6a3('0x5'));var logger=require(_0xb6a3('0x6'))(_0xb6a3('0x7'));var config=require(_0xb6a3('0x8'));var jayson=require(_0xb6a3('0x9'));var client=jayson[_0xb6a3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11f76d,_0x3e96bf,_0x5128e6){return new BPromise(function(_0x24c372,_0x3f07ba){return client['request'](_0x11f76d,_0x5128e6)[_0xb6a3('0xb')](function(_0x2729cd){logger[_0xb6a3('0xc')](_0xb6a3('0xd'),_0x3e96bf,_0xb6a3('0xe'));logger[_0xb6a3('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3e96bf,_0xb6a3('0xe'),JSON[_0xb6a3('0x10')](_0x2729cd));if(_0x2729cd[_0xb6a3('0x11')]){if(_0x2729cd[_0xb6a3('0x11')][_0xb6a3('0x12')]===0x1f4){logger[_0xb6a3('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x3e96bf,_0x2729cd['error'][_0xb6a3('0x13')]);return _0x3f07ba(_0x2729cd[_0xb6a3('0x11')][_0xb6a3('0x13')]);}logger[_0xb6a3('0x11')](_0xb6a3('0xd'),_0x3e96bf,_0x2729cd[_0xb6a3('0x11')][_0xb6a3('0x13')]);return _0x24c372(_0x2729cd[_0xb6a3('0x11')][_0xb6a3('0x13')]);}else{logger[_0xb6a3('0xc')](_0xb6a3('0xd'),_0x3e96bf,_0xb6a3('0xe'));_0x24c372(_0x2729cd[_0xb6a3('0x14')][_0xb6a3('0x13')]);}})[_0xb6a3('0x15')](function(_0x520059){logger['error'](_0xb6a3('0xd'),_0x3e96bf,_0x520059);_0x3f07ba(_0x520059);});});}
\ No newline at end of file
+var _0x53d0=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x5a46ef,_0x539480){var _0x5b232f=function(_0x2f8b74){while(--_0x2f8b74){_0x5a46ef['push'](_0x5a46ef['shift']());}};_0x5b232f(++_0x539480);}(_0x53d0,0x6c));var _0x053d=function(_0xb03acb,_0x2e9075){_0xb03acb=_0xb03acb-0x0;var _0x2e3fff=_0x53d0[_0xb03acb];return _0x2e3fff;};'use strict';var _=require('lodash');var util=require(_0x053d('0x0'));var moment=require(_0x053d('0x1'));var BPromise=require('bluebird');var rs=require(_0x053d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x053d('0x3'))['db'];var utils=require(_0x053d('0x4'));var logger=require(_0x053d('0x5'))(_0x053d('0x6'));var config=require(_0x053d('0x7'));var jayson=require(_0x053d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b15f3,_0x5d32e0,_0x4f5728){return new BPromise(function(_0x4484be,_0x236113){return client['request'](_0x2b15f3,_0x4f5728)['then'](function(_0x60994c){logger[_0x053d('0x9')](_0x053d('0xa'),_0x5d32e0,_0x053d('0xb'));logger[_0x053d('0xc')](_0x053d('0xd'),_0x5d32e0,_0x053d('0xb'),JSON[_0x053d('0xe')](_0x60994c));if(_0x60994c[_0x053d('0xf')]){if(_0x60994c[_0x053d('0xf')][_0x053d('0x10')]===0x1f4){logger[_0x053d('0xf')](_0x053d('0xa'),_0x5d32e0,_0x60994c[_0x053d('0xf')][_0x053d('0x11')]);return _0x236113(_0x60994c['error'][_0x053d('0x11')]);}logger[_0x053d('0xf')](_0x053d('0xa'),_0x5d32e0,_0x60994c['error'][_0x053d('0x11')]);return _0x4484be(_0x60994c[_0x053d('0xf')][_0x053d('0x11')]);}else{logger[_0x053d('0x9')]('ChatProactiveAction,\x20%s,\x20%s',_0x5d32e0,_0x053d('0xb'));_0x4484be(_0x60994c[_0x053d('0x12')][_0x053d('0x11')]);}})[_0x053d('0x13')](function(_0x5af375){logger[_0x053d('0xf')](_0x053d('0xa'),_0x5d32e0,_0x5af375);_0x236113(_0x5af375);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 0163069..7007e24 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 _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xabce,0x103));var _0xeabc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xabce[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router;
\ No newline at end of file
+var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x71ab,0x64));var _0xb71a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x71ab[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('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 29d51aa..b7b1cda 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 _0x8281=['exports','name','STRING','ENUM','rrmemory','beepall','sequelize'];(function(_0x23dd0c,_0x83f73c){var _0x576742=function(_0x1cc94a){while(--_0x1cc94a){_0x23dd0c['push'](_0x23dd0c['shift']());}};_0x576742(++_0x83f73c);}(_0x8281,0x8b));var _0x1828=function(_0x4f381d,_0x2d8287){_0x4f381d=_0x4f381d-0x0;var _0x3ac952=_0x8281[_0x4f381d];return _0x3ac952;};'use strict';var Sequelize=require(_0x1828('0x0'));module[_0x1828('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1828('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1828('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1828('0x4')](_0x1828('0x5'),_0x1828('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x4ab3=['sequelize','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4ab3,0x85));var _0x34ab=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0x4ab3[_0x3b231a];return _0x18d67a;};'use strict';var Sequelize=require(_0x34ab('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x34ab('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x34ab('0x2')]},'timeout':{'type':Sequelize[_0x34ab('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x34ab('0x4'),_0x34ab('0x5'),_0x34ab('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 6707357..8517229 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 _0xcbb0=['where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','ChatQueues','UserProfileSection','autoAssociation','describe','getMembers','findOne','length','order','pick','ChatQueueId','UserId','agent','chatPause','createdAt','%s/%s','SIP','Team','getTeams','addTeams','User','Agents','online','voicePause','sequelize','transaction','each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','ids','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort'];(function(_0xb4e0c3,_0x3782ca){var _0x3c7a14=function(_0xedf1f5){while(--_0xedf1f5){_0xb4e0c3['push'](_0xb4e0c3['shift']());}};_0x3c7a14(++_0x3782ca);}(_0xcbb0,0xdf));var _0x0cbb=function(_0x1fb5fb,_0x15ed17){_0x1fb5fb=_0x1fb5fb-0x0;var _0x2c36ef=_0xcbb0[_0x1fb5fb];return _0x2c36ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0cbb('0x0'));var jsonpatch=require(_0x0cbb('0x1'));var rp=require('request-promise');var moment=require(_0x0cbb('0x2'));var BPromise=require(_0x0cbb('0x3'));var Mustache=require(_0x0cbb('0x4'));var util=require('util');var path=require(_0x0cbb('0x5'));var sox=require(_0x0cbb('0x6'));var csv=require(_0x0cbb('0x7'));var ejs=require(_0x0cbb('0x8'));var fs=require('fs');var fs_extra=require(_0x0cbb('0x9'));var _=require(_0x0cbb('0xa'));var squel=require(_0x0cbb('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0cbb('0xc'));var toCsv=require(_0x0cbb('0x7'));var querystring=require('querystring');var Papa=require(_0x0cbb('0xd'));var Redis=require(_0x0cbb('0xe'));var authService=require(_0x0cbb('0xf'));var qs=require(_0x0cbb('0x10'));var as=require(_0x0cbb('0x11'));var hardwareService=require(_0x0cbb('0x12'));var logger=require('../../config/logger')(_0x0cbb('0x13'));var utils=require(_0x0cbb('0x14'));var config=require(_0x0cbb('0x15'));var licenseUtil=require(_0x0cbb('0x16'));var db=require(_0x0cbb('0x17'))['db'];config['redis']=_[_0x0cbb('0x18')](config[_0x0cbb('0x19')],{'host':_0x0cbb('0x1a'),'port':0x18eb});var socket=require(_0x0cbb('0x1b'))(new Redis(config[_0x0cbb('0x19')]));require(_0x0cbb('0x1c'))[_0x0cbb('0x1d')](socket);var jayson=require(_0x0cbb('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b43c1,_0x2ecb9e,_0x5ed7e6,_0x3f2da4){return new BPromise(function(_0x3855d9,_0x14176a){var _0x57ebe6=_0x3f2da4||client;return _0x57ebe6[_0x0cbb('0x1f')](_0x4b43c1,_0x5ed7e6)[_0x0cbb('0x20')](function(_0x5ede69){logger[_0x0cbb('0x21')]('ChatQueue,\x20%s,\x20%s',_0x2ecb9e,_0x0cbb('0x22'));logger[_0x0cbb('0x23')](_0x0cbb('0x24'),_0x2ecb9e,_0x0cbb('0x22'),JSON[_0x0cbb('0x25')](_0x5ede69));if(_0x5ede69[_0x0cbb('0x26')]){if(_0x5ede69['error'][_0x0cbb('0x27')]===0x1f4){logger[_0x0cbb('0x26')](_0x0cbb('0x28'),_0x2ecb9e,_0x5ede69[_0x0cbb('0x26')][_0x0cbb('0x29')]);return _0x14176a(_0x5ede69['error'][_0x0cbb('0x29')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2ecb9e,_0x5ede69[_0x0cbb('0x26')][_0x0cbb('0x29')]);return _0x3855d9(_0x5ede69[_0x0cbb('0x26')][_0x0cbb('0x29')]);}else{logger['info'](_0x0cbb('0x28'),_0x2ecb9e,_0x0cbb('0x22'));_0x3855d9(_0x5ede69[_0x0cbb('0x2a')][_0x0cbb('0x29')]);}})[_0x0cbb('0x2b')](function(_0x38baaa){logger[_0x0cbb('0x26')](_0x0cbb('0x28'),_0x2ecb9e,_0x38baaa);_0x14176a(_0x38baaa);});});}function respondWithStatusCode(_0x191562,_0x57cc6d){_0x57cc6d=_0x57cc6d||0xcc;return function(_0x20b163){if(_0x20b163){return _0x191562[_0x0cbb('0x2c')](_0x57cc6d);}return _0x191562['status'](_0x57cc6d)[_0x0cbb('0x2d')]();};}function respondWithResult(_0x5cda57,_0x3539f4){_0x3539f4=_0x3539f4||0xc8;return function(_0x56f9df){if(_0x56f9df){return _0x5cda57[_0x0cbb('0x2e')](_0x3539f4)[_0x0cbb('0x2f')](_0x56f9df);}};}function respondWithFilteredResult(_0xefdaa5,_0x330827){return function(_0xcbf747){if(_0xcbf747){var _0xd32b35=typeof _0x330827[_0x0cbb('0x30')]==='undefined'&&typeof _0x330827[_0x0cbb('0x31')]==='undefined';var _0x3cc60b=_0xcbf747[_0x0cbb('0x32')];var _0xf6603b=_0xd32b35?0x0:_0x330827[_0x0cbb('0x30')];var _0x34ad41=_0xd32b35?_0xcbf747['count']:_0x330827[_0x0cbb('0x30')]+_0x330827['limit'];var _0x4b28d9;if(_0x34ad41>=_0x3cc60b){_0x34ad41=_0x3cc60b;_0x4b28d9=0xc8;}else{_0x4b28d9=0xce;}_0xefdaa5[_0x0cbb('0x2e')](_0x4b28d9);return _0xefdaa5[_0x0cbb('0x33')](_0x0cbb('0x34'),_0xf6603b+'-'+_0x34ad41+'/'+_0x3cc60b)[_0x0cbb('0x2f')](_0xcbf747);}return null;};}function patchUpdates(_0x285a89){return function(_0xdc11d2){try{jsonpatch[_0x0cbb('0x35')](_0xdc11d2,_0x285a89,!![]);}catch(_0x56491f){return BPromise['reject'](_0x56491f);}return _0xdc11d2[_0x0cbb('0x36')]();};}function saveUpdates(_0x5cbd3f,_0x38dbd6){return function(_0x306a17){if(_0x306a17){return _0x306a17[_0x0cbb('0x37')](_0x5cbd3f)[_0x0cbb('0x20')](function(_0x306338){return _0x306338;});}return null;};}function removeEntity(_0x430d09,_0x62be05){return function(_0x2bacbe){if(_0x2bacbe){return _0x2bacbe[_0x0cbb('0x38')]()[_0x0cbb('0x20')](function(){var _0xf9d8b8=_0x2bacbe['get']({'plain':!![]});var _0x2788bb='ChatQueues';return db[_0x0cbb('0x39')][_0x0cbb('0x38')]({'where':{'type':_0x2788bb,'resourceId':_0xf9d8b8['id']}})[_0x0cbb('0x20')](function(){return _0x2bacbe;});})[_0x0cbb('0x20')](function(){_0x430d09[_0x0cbb('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13c786,_0x1187cd){return function(_0x44b2ba){if(!_0x44b2ba){_0x13c786[_0x0cbb('0x2c')](0x194);}return _0x44b2ba;};}function handleError(_0x102530,_0x55aefc){_0x55aefc=_0x55aefc||0x1f4;return function(_0x436e78){logger[_0x0cbb('0x26')](_0x436e78[_0x0cbb('0x3a')]);if(_0x436e78[_0x0cbb('0x3b')]){delete _0x436e78[_0x0cbb('0x3b')];}_0x102530[_0x0cbb('0x2e')](_0x55aefc)['send'](_0x436e78);};}exports[_0x0cbb('0x3c')]=function(_0x56c719,_0x186914){var _0x46e16b={},_0x1da443={},_0x152226={'count':0x0,'rows':[]};var _0x228947=_[_0x0cbb('0x3d')](db[_0x0cbb('0x3e')][_0x0cbb('0x3f')],function(_0x48c684){return{'name':_0x48c684[_0x0cbb('0x40')],'type':_0x48c684[_0x0cbb('0x41')][_0x0cbb('0x42')]};});_0x1da443[_0x0cbb('0x43')]=_[_0x0cbb('0x3d')](_0x228947,'name');_0x1da443['query']=_[_0x0cbb('0x44')](_0x56c719[_0x0cbb('0x45')]);_0x1da443[_0x0cbb('0x46')]=_[_0x0cbb('0x47')](_0x1da443[_0x0cbb('0x43')],_0x1da443[_0x0cbb('0x45')]);_0x46e16b['attributes']=_[_0x0cbb('0x47')](_0x1da443['model'],qs[_0x0cbb('0x48')](_0x56c719[_0x0cbb('0x45')]['fields']));_0x46e16b[_0x0cbb('0x49')]=_0x46e16b[_0x0cbb('0x49')]['length']?_0x46e16b[_0x0cbb('0x49')]:_0x1da443['model'];if(!_0x56c719[_0x0cbb('0x45')][_0x0cbb('0x4a')](_0x0cbb('0x4b'))){_0x46e16b['limit']=qs[_0x0cbb('0x31')](_0x56c719[_0x0cbb('0x45')]['limit']);_0x46e16b[_0x0cbb('0x30')]=qs[_0x0cbb('0x30')](_0x56c719[_0x0cbb('0x45')]['offset']);}_0x46e16b['order']=qs[_0x0cbb('0x4c')](_0x56c719[_0x0cbb('0x45')][_0x0cbb('0x4c')]);_0x46e16b[_0x0cbb('0x4d')]=qs[_0x0cbb('0x46')](_['pick'](_0x56c719['query'],_0x1da443['filters']),_0x228947);if(_0x56c719[_0x0cbb('0x45')][_0x0cbb('0x4e')]){_0x46e16b[_0x0cbb('0x4d')]=_[_0x0cbb('0x4f')](_0x46e16b['where'],{'$or':_[_0x0cbb('0x3d')](_0x228947,function(_0x2f6084){if(_0x2f6084['type']!=='VIRTUAL'){var _0x335ff2={};_0x335ff2[_0x2f6084[_0x0cbb('0x3b')]]={'$like':'%'+_0x56c719['query'][_0x0cbb('0x4e')]+'%'};return _0x335ff2;}})});}_0x46e16b=_['merge']({},_0x46e16b,_0x56c719[_0x0cbb('0x50')]);var _0x258887={'where':_0x46e16b['where']};return db[_0x0cbb('0x3e')][_0x0cbb('0x32')](_0x258887)[_0x0cbb('0x20')](function(_0x53fede){_0x152226['count']=_0x53fede;if(_0x56c719[_0x0cbb('0x45')][_0x0cbb('0x51')]){_0x46e16b[_0x0cbb('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0x0cbb('0x53')](_0x46e16b);})[_0x0cbb('0x20')](function(_0x5e63f9){_0x152226[_0x0cbb('0x54')]=_0x5e63f9;return _0x152226;})[_0x0cbb('0x20')](respondWithFilteredResult(_0x186914,_0x46e16b))[_0x0cbb('0x2b')](handleError(_0x186914,null));};exports[_0x0cbb('0x55')]=function(_0x74d2eb,_0x4e9cd6){var _0x48f28a={'raw':!![],'where':{'id':_0x74d2eb[_0x0cbb('0x56')]['id']}},_0x46f5bb={};_0x46f5bb[_0x0cbb('0x43')]=_[_0x0cbb('0x44')](db[_0x0cbb('0x3e')][_0x0cbb('0x3f')]);_0x46f5bb['query']=_[_0x0cbb('0x44')](_0x74d2eb[_0x0cbb('0x45')]);_0x46f5bb[_0x0cbb('0x46')]=_[_0x0cbb('0x47')](_0x46f5bb[_0x0cbb('0x43')],_0x46f5bb[_0x0cbb('0x45')]);_0x48f28a['attributes']=_['intersection'](_0x46f5bb['model'],qs[_0x0cbb('0x48')](_0x74d2eb[_0x0cbb('0x45')][_0x0cbb('0x48')]));_0x48f28a[_0x0cbb('0x49')]=_0x48f28a[_0x0cbb('0x49')]['length']?_0x48f28a[_0x0cbb('0x49')]:_0x46f5bb[_0x0cbb('0x43')];if(_0x74d2eb[_0x0cbb('0x45')][_0x0cbb('0x51')]){_0x48f28a['include']=[{'all':!![]}];}_0x48f28a=_[_0x0cbb('0x4f')]({},_0x48f28a,_0x74d2eb[_0x0cbb('0x50')]);return db['ChatQueue'][_0x0cbb('0x57')](_0x48f28a)['then'](handleEntityNotFound(_0x4e9cd6,null))[_0x0cbb('0x20')](respondWithResult(_0x4e9cd6,null))[_0x0cbb('0x2b')](handleError(_0x4e9cd6,null));};exports[_0x0cbb('0x58')]=function(_0x54a701,_0x5a4a42){return db[_0x0cbb('0x3e')][_0x0cbb('0x58')](_0x54a701[_0x0cbb('0x59')],{})['then'](function(_0x675d63){var _0xf17185=_0x54a701['user']['get']({'plain':!![]});if(!_0xf17185)throw new Error(_0x0cbb('0x5a'));if(_0xf17185[_0x0cbb('0x5b')]===_0x0cbb('0x5c')){var _0x473280=_0x675d63[_0x0cbb('0x5d')]({'plain':!![]});var _0x2dc3ac=_0x0cbb('0x5e');return db[_0x0cbb('0x5f')][_0x0cbb('0x57')]({'where':{'name':_0x2dc3ac,'userProfileId':_0xf17185['userProfileId']},'raw':!![]})[_0x0cbb('0x20')](function(_0x4908e9){if(_0x4908e9&&_0x4908e9[_0x0cbb('0x60')]===0x0){return db[_0x0cbb('0x39')][_0x0cbb('0x58')]({'name':_0x473280['name'],'resourceId':_0x473280['id'],'type':_0x4908e9[_0x0cbb('0x3b')],'sectionId':_0x4908e9['id']},{})[_0x0cbb('0x20')](function(){return _0x675d63;});}else{return _0x675d63;}})[_0x0cbb('0x2b')](function(_0x10a8ed){logger[_0x0cbb('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10a8ed);throw _0x10a8ed;});}return _0x675d63;})['then'](respondWithResult(_0x5a4a42,0xc9))[_0x0cbb('0x2b')](handleError(_0x5a4a42,null));};exports[_0x0cbb('0x37')]=function(_0x4c594c,_0x2364b8){if(_0x4c594c[_0x0cbb('0x59')]['id']){delete _0x4c594c[_0x0cbb('0x59')]['id'];}return db[_0x0cbb('0x3e')][_0x0cbb('0x57')]({'where':{'id':_0x4c594c[_0x0cbb('0x56')]['id']}})[_0x0cbb('0x20')](handleEntityNotFound(_0x2364b8,null))[_0x0cbb('0x20')](saveUpdates(_0x4c594c['body'],null))[_0x0cbb('0x20')](respondWithResult(_0x2364b8,null))['catch'](handleError(_0x2364b8,null));};exports['destroy']=function(_0x1d0392,_0x329eb2){return db[_0x0cbb('0x3e')]['find']({'where':{'id':_0x1d0392[_0x0cbb('0x56')]['id']}})['then'](handleEntityNotFound(_0x329eb2,null))[_0x0cbb('0x20')](removeEntity(_0x329eb2,null))['catch'](handleError(_0x329eb2,null));};exports[_0x0cbb('0x61')]=function(_0xd0df88,_0x1ae52f){return db[_0x0cbb('0x3e')][_0x0cbb('0x61')]()['then'](respondWithResult(_0x1ae52f,null))[_0x0cbb('0x2b')](handleError(_0x1ae52f,null));};exports[_0x0cbb('0x62')]=function(_0x574231,_0x59c664,_0x42829f){var _0x1f0eb0={'raw':!![],'where':{}},_0x1d29c8={},_0x39cda7;return db[_0x0cbb('0x3e')][_0x0cbb('0x63')]({'where':{'id':_0x574231[_0x0cbb('0x56')]['id']}})[_0x0cbb('0x20')](handleEntityNotFound(_0x59c664,null))[_0x0cbb('0x20')](function(_0x3ac6a3){if(_0x3ac6a3){_0x39cda7=_0x3ac6a3[_0x0cbb('0x5d')]({'plain':!![]});_0x1d29c8[_0x0cbb('0x43')]=_['keys'](db['UserChatQueue'][_0x0cbb('0x3f')]);_0x1d29c8['query']=_[_0x0cbb('0x44')](_0x574231[_0x0cbb('0x45')]);_0x1d29c8[_0x0cbb('0x46')]=_[_0x0cbb('0x47')](_0x1d29c8[_0x0cbb('0x43')],_0x1d29c8[_0x0cbb('0x45')]);_0x1f0eb0[_0x0cbb('0x49')]=_[_0x0cbb('0x47')](_0x1d29c8['model'],qs[_0x0cbb('0x48')](_0x574231[_0x0cbb('0x45')][_0x0cbb('0x48')]));_0x1f0eb0[_0x0cbb('0x49')]=_0x1f0eb0[_0x0cbb('0x49')][_0x0cbb('0x64')]?_0x1f0eb0[_0x0cbb('0x49')]:_0x1d29c8[_0x0cbb('0x43')];if(!_0x574231[_0x0cbb('0x45')]['hasOwnProperty']('nolimit')){_0x1f0eb0[_0x0cbb('0x31')]=qs[_0x0cbb('0x31')](_0x574231[_0x0cbb('0x45')][_0x0cbb('0x31')]);_0x1f0eb0['offset']=qs[_0x0cbb('0x30')](_0x574231[_0x0cbb('0x45')][_0x0cbb('0x30')]);}_0x1f0eb0[_0x0cbb('0x65')]=qs[_0x0cbb('0x4c')](_0x574231[_0x0cbb('0x45')][_0x0cbb('0x4c')]);_0x1f0eb0['where']=qs[_0x0cbb('0x46')](_[_0x0cbb('0x66')](_0x574231[_0x0cbb('0x45')],_0x1d29c8[_0x0cbb('0x46')]));_0x1f0eb0[_0x0cbb('0x4d')][_0x0cbb('0x67')]=_0x3ac6a3['id'];if(_0x574231['query']['filter']){_0x1f0eb0['where']=_[_0x0cbb('0x4f')](_0x1f0eb0['where'],{'$or':_[_0x0cbb('0x3d')](_0x1f0eb0[_0x0cbb('0x49')],function(_0x4ddefc){var _0x4ba73b={};_0x4ba73b[_0x4ddefc]={'$like':'%'+_0x574231[_0x0cbb('0x45')][_0x0cbb('0x4e')]+'%'};return _0x4ba73b;})});}_0x1f0eb0=_[_0x0cbb('0x4f')]({},_0x1f0eb0,_0x574231[_0x0cbb('0x50')]);return db['UserChatQueue'][_0x0cbb('0x53')](_0x1f0eb0);}})[_0x0cbb('0x20')](function(_0x177497){if(_0x177497){return db['User']['findAndCountAll']({'where':{'id':_[_0x0cbb('0x3d')](_0x177497,_0x0cbb('0x68')),'role':_0x0cbb('0x69')},'attributes':['id',_0x0cbb('0x3b'),_0x0cbb('0x6a'),'updatedAt',_0x0cbb('0x6b')]});}})[_0x0cbb('0x20')](function(_0x38ac50){if(_0x38ac50){return{'count':_0x38ac50[_0x0cbb('0x32')],'rows':_['map'](_0x38ac50[_0x0cbb('0x54')],function(_0x2d09d2){return{'membername':_0x2d09d2['name'],'UserId':_0x2d09d2['id'],'queue_name':_0x39cda7[_0x0cbb('0x3b')],'ChatQueueId':_0x39cda7['id'],'interface':util['format'](_0x0cbb('0x6c'),_0x0cbb('0x6d'),_0x2d09d2[_0x0cbb('0x3b')]),'penalty':0x0,'paused':_0x2d09d2[_0x0cbb('0x6a')],'createdAt':_0x2d09d2[_0x0cbb('0x6b')],'updatedAt':_0x2d09d2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0cbb('0x20')](respondWithFilteredResult(_0x59c664,_0x1f0eb0))[_0x0cbb('0x2b')](handleError(_0x59c664,null));};exports['getTeams']=function(_0x1f3b47,_0x325f96,_0x4f0c47){var _0x4fb1c6={};var _0x1e1d41={};var _0x159e8c;var _0x4409cc;return db['ChatQueue'][_0x0cbb('0x63')]({'where':{'id':_0x1f3b47[_0x0cbb('0x56')]['id']}})[_0x0cbb('0x20')](handleEntityNotFound(_0x325f96,null))[_0x0cbb('0x20')](function(_0x5b5f19){if(_0x5b5f19){_0x159e8c=_0x5b5f19;_0x1e1d41[_0x0cbb('0x43')]=_[_0x0cbb('0x44')](db[_0x0cbb('0x6e')][_0x0cbb('0x3f')]);_0x1e1d41[_0x0cbb('0x45')]=_[_0x0cbb('0x44')](_0x1f3b47[_0x0cbb('0x45')]);_0x1e1d41[_0x0cbb('0x46')]=_[_0x0cbb('0x47')](_0x1e1d41[_0x0cbb('0x43')],_0x1e1d41[_0x0cbb('0x45')]);_0x4fb1c6['attributes']=_[_0x0cbb('0x47')](_0x1e1d41[_0x0cbb('0x43')],qs[_0x0cbb('0x48')](_0x1f3b47[_0x0cbb('0x45')][_0x0cbb('0x48')]));_0x4fb1c6['attributes']=_0x4fb1c6['attributes'][_0x0cbb('0x64')]?_0x4fb1c6['attributes']:_0x1e1d41[_0x0cbb('0x43')];_0x4fb1c6[_0x0cbb('0x65')]=qs[_0x0cbb('0x4c')](_0x1f3b47[_0x0cbb('0x45')][_0x0cbb('0x4c')]);_0x4fb1c6[_0x0cbb('0x4d')]=qs[_0x0cbb('0x46')](_[_0x0cbb('0x66')](_0x1f3b47[_0x0cbb('0x45')],_0x1e1d41[_0x0cbb('0x46')]));if(_0x1f3b47['query'][_0x0cbb('0x4e')]){_0x4fb1c6[_0x0cbb('0x4d')]=_[_0x0cbb('0x4f')](_0x4fb1c6['where'],{'$or':_[_0x0cbb('0x3d')](_0x4fb1c6['attributes'],function(_0x52a542){var _0xd33b3a={};_0xd33b3a[_0x52a542]={'$like':'%'+_0x1f3b47[_0x0cbb('0x45')]['filter']+'%'};return _0xd33b3a;})});}_0x4fb1c6=_[_0x0cbb('0x4f')]({},_0x4fb1c6,_0x1f3b47[_0x0cbb('0x50')]);return _0x159e8c[_0x0cbb('0x6f')](_0x4fb1c6);}})['then'](function(_0xc69a92){if(_0xc69a92){_0x4409cc=_0xc69a92[_0x0cbb('0x64')];if(!_0x1f3b47[_0x0cbb('0x45')][_0x0cbb('0x4a')](_0x0cbb('0x4b'))){_0x4fb1c6[_0x0cbb('0x31')]=qs['limit'](_0x1f3b47['query'][_0x0cbb('0x31')]);_0x4fb1c6[_0x0cbb('0x30')]=qs[_0x0cbb('0x30')](_0x1f3b47[_0x0cbb('0x45')]['offset']);}return _0x159e8c[_0x0cbb('0x6f')](_0x4fb1c6);}})[_0x0cbb('0x20')](function(_0x3b32f4){if(_0x3b32f4){return _0x3b32f4?{'count':_0x4409cc,'rows':_0x3b32f4}:null;}})[_0x0cbb('0x20')](respondWithResult(_0x325f96,null))[_0x0cbb('0x2b')](handleError(_0x325f96,null));};exports[_0x0cbb('0x70')]=function(_0x25f906,_0x49caee,_0x3f2947){var _0x237910=_0x25f906[_0x0cbb('0x59')]['ids'];return db[_0x0cbb('0x6e')][_0x0cbb('0x53')]({'where':{'id':_0x237910},'attributes':['id'],'include':[{'model':db[_0x0cbb('0x71')],'as':_0x0cbb('0x72'),'attributes':['id','name',_0x0cbb('0x73'),_0x0cbb('0x74'),'interface'],'raw':!![]}]})['then'](function(_0xd11977){if(_0xd11977){var _0x2bfe6b=_['flatMap'](_0xd11977,function(_0xea3961){var _0x14e673=_0xea3961[_0x0cbb('0x5d')]({'plain':!![]});return _0x14e673[_0x0cbb('0x72')];});return db[_0x0cbb('0x3e')]['find']({'where':{'id':_0x25f906['params']['id']}})['then'](function(_0x34b15f){return db[_0x0cbb('0x75')][_0x0cbb('0x76')](function(_0x15c178){return _0x34b15f[_0x0cbb('0x70')](_0x237910,{'transaction':_0x15c178})[_0x0cbb('0x20')](function(){return BPromise[_0x0cbb('0x77')](_0x2bfe6b,function(_0x754d5f){return db[_0x0cbb('0x78')][_0x0cbb('0x79')]({'where':{'UserId':_0x754d5f['id'],'ChatQueueId':_0x25f906[_0x0cbb('0x56')]['id']},'transaction':_0x15c178});});})[_0x0cbb('0x20')](function(){_0x2bfe6b[_0x0cbb('0x7a')](function(_0x3ee93a){socket[_0x0cbb('0x7b')](_0x0cbb('0x7c'),{'UserId':_0x3ee93a['id'],'ChatQueueId':_0x34b15f['id']});});});});});}})['then'](respondWithStatusCode(_0x49caee,null))[_0x0cbb('0x2b')](handleError(_0x49caee,null));};exports['removeTeams']=function(_0x1cf87a,_0x570485,_0x3fc93a){return db[_0x0cbb('0x6e')][_0x0cbb('0x53')]({'where':{'id':_0x1cf87a['query'][_0x0cbb('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x0cbb('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0cbb('0x20')](handleEntityNotFound(_0x570485,null))[_0x0cbb('0x20')](function(_0x578dc5){var _0x16091b=_[_0x0cbb('0x3d')](_0x578dc5,'id');var _0x2f2d91=[];var _0x12e093=[];var _0x10244a=squel[_0x0cbb('0x7e')]();_0x10244a[_0x0cbb('0x7f')]('tq.TeamId')[_0x0cbb('0x80')]('team_has_chat_queues','tq')[_0x0cbb('0x81')](_0x0cbb('0x82'),'ut',_0x0cbb('0x83'))[_0x0cbb('0x4d')]('ChatQueueId\x20=\x20?',_0x1cf87a[_0x0cbb('0x56')]['id']);for(var _0x1de2a1=0x0;_0x1de2a1<_0x578dc5[_0x0cbb('0x64')];_0x1de2a1+=0x1){let _0x285835=_0x578dc5[_0x1de2a1];for(var _0x192883=0x0;_0x192883<_0x285835['Agents'][_0x0cbb('0x64')];_0x192883+=0x1){let _0x1031e1=_0x285835[_0x0cbb('0x72')][_0x192883];var _0x3fc151=_0x10244a[_0x0cbb('0x84')]();_0x3fc151[_0x0cbb('0x4d')]('ut.UserId\x20=\x20?',_0x1031e1['id']);_0x12e093[_0x0cbb('0x85')](db['sequelize'][_0x0cbb('0x45')](_0x3fc151[_0x0cbb('0x86')](),{'type':db[_0x0cbb('0x75')][_0x0cbb('0x87')]['SELECT']})[_0x0cbb('0x20')](function(_0x5bf402){if(_0x5bf402['length']===0x1){return _0x1031e1['id'];}else{var _0x4363b4=_[_0x0cbb('0x88')](_[_0x0cbb('0x3d')](_0x5bf402,_0x0cbb('0x89')),function(_0xb07cb0){return _['includes'](_0x16091b,_0xb07cb0);});if(_0x4363b4){return _0x1031e1['id'];}}}));}}return BPromise[_0x0cbb('0x8a')](_0x12e093)[_0x0cbb('0x20')](function(_0x430cdc){_0x2f2d91=_(_0x2f2d91)[_0x0cbb('0x8b')](_0x430cdc)[_0x0cbb('0x8c')]()[_0x0cbb('0x8d')]();return db[_0x0cbb('0x3e')][_0x0cbb('0x57')]({'where':{'id':_0x1cf87a[_0x0cbb('0x56')]['id']}})[_0x0cbb('0x20')](function(_0x454c98){return db['sequelize']['transaction'](function(_0x5c7933){return _0x454c98[_0x0cbb('0x8e')](_0x1cf87a[_0x0cbb('0x45')]['ids'],{'transaction':_0x5c7933})[_0x0cbb('0x20')](function(){if(!_[_0x0cbb('0x8f')](_0x2f2d91)){return _0x454c98[_0x0cbb('0x90')](_0x2f2d91,{'transaction':_0x5c7933});}})['then'](function(){_0x2f2d91['forEach'](function(_0x4015c8){socket[_0x0cbb('0x7b')](_0x0cbb('0x91'),{'UserId':_0x4015c8,'ChatQueueId':_0x454c98['id']});});});});});});})[_0x0cbb('0x20')](respondWithStatusCode(_0x570485,null))[_0x0cbb('0x2b')](handleError(_0x570485,null));};exports['addAgents']=function(_0x90c12c,_0x5363a7,_0x133d26){return db['ChatQueue'][_0x0cbb('0x57')]({'where':{'id':_0x90c12c['params']['id']}})[_0x0cbb('0x20')](handleEntityNotFound(_0x5363a7,null))[_0x0cbb('0x20')](function(_0x44f004){if(_0x44f004){return _0x44f004[_0x0cbb('0x92')](_0x90c12c[_0x0cbb('0x59')]['ids'],_[_0x0cbb('0x93')](_0x90c12c[_0x0cbb('0x59')],[_0x0cbb('0x7d'),'id'])||{})[_0x0cbb('0x94')](function(_0x385e46){for(var _0x193d48=0x0;_0x193d48<_0x90c12c['body'][_0x0cbb('0x7d')][_0x0cbb('0x64')];_0x193d48+=0x1){socket[_0x0cbb('0x7b')]('userChatQueue:save',{'UserId':Number(_0x90c12c['body'][_0x0cbb('0x7d')][_0x193d48]),'ChatQueueId':Number(_0x90c12c[_0x0cbb('0x56')]['id'])});}return _0x385e46;});}})[_0x0cbb('0x20')](respondWithResult(_0x5363a7,null))[_0x0cbb('0x2b')](handleError(_0x5363a7,null));};exports[_0x0cbb('0x90')]=function(_0xc116ea,_0x509fd4,_0x2145f7){return db['ChatQueue'][_0x0cbb('0x57')]({'where':{'id':_0xc116ea['params']['id']}})[_0x0cbb('0x20')](handleEntityNotFound(_0x509fd4,null))[_0x0cbb('0x20')](function(_0x1e86cb){if(_0x1e86cb){return _0x1e86cb[_0x0cbb('0x90')](_0xc116ea[_0x0cbb('0x45')]['ids'])[_0x0cbb('0x20')](function(){if(_['isArray'](_0xc116ea[_0x0cbb('0x45')][_0x0cbb('0x7d')])){for(var _0x50d917=0x0;_0x50d917<_0xc116ea[_0x0cbb('0x45')][_0x0cbb('0x7d')][_0x0cbb('0x64')];_0x50d917+=0x1){socket[_0x0cbb('0x7b')]('userChatQueue:remove',{'UserId':Number(_0xc116ea['query'][_0x0cbb('0x7d')][_0x50d917]),'ChatQueueId':Number(_0xc116ea['params']['id'])});}}else{socket['emit'](_0x0cbb('0x91'),{'UserId':Number(_0xc116ea[_0x0cbb('0x45')][_0x0cbb('0x7d')]),'ChatQueueId':Number(_0xc116ea[_0x0cbb('0x56')]['id'])});}});}})[_0x0cbb('0x20')](respondWithStatusCode(_0x509fd4,null))[_0x0cbb('0x2b')](handleError(_0x509fd4,null));};exports[_0x0cbb('0x95')]=function(_0x287346,_0x53609c,_0x45660b){var _0x4b8f02={};var _0x1b4c02={};var _0x4649eb;var _0x259a95;return db['ChatQueue'][_0x0cbb('0x63')]({'where':{'id':_0x287346[_0x0cbb('0x56')]['id']}})[_0x0cbb('0x20')](handleEntityNotFound(_0x53609c,null))[_0x0cbb('0x20')](function(_0x2a1633){if(_0x2a1633){_0x4649eb=_0x2a1633;_0x1b4c02['model']=_[_0x0cbb('0x44')](db[_0x0cbb('0x71')][_0x0cbb('0x3f')]);_0x1b4c02[_0x0cbb('0x45')]=_['keys'](_0x287346['query']);_0x1b4c02['filters']=_[_0x0cbb('0x47')](_0x1b4c02[_0x0cbb('0x43')],_0x1b4c02['query']);_0x4b8f02[_0x0cbb('0x49')]=_[_0x0cbb('0x47')](_0x1b4c02[_0x0cbb('0x43')],qs[_0x0cbb('0x48')](_0x287346['query'][_0x0cbb('0x48')]));_0x4b8f02[_0x0cbb('0x49')]=_0x4b8f02['attributes'][_0x0cbb('0x64')]?_0x4b8f02[_0x0cbb('0x49')]:_0x1b4c02[_0x0cbb('0x43')];_0x4b8f02[_0x0cbb('0x65')]=qs[_0x0cbb('0x4c')](_0x287346[_0x0cbb('0x45')][_0x0cbb('0x4c')]);_0x4b8f02[_0x0cbb('0x4d')]=qs[_0x0cbb('0x46')](_[_0x0cbb('0x66')](_0x287346['query'],_0x1b4c02[_0x0cbb('0x46')]));if(_0x287346[_0x0cbb('0x45')][_0x0cbb('0x4e')]){_0x4b8f02[_0x0cbb('0x4d')]=_['merge'](_0x4b8f02[_0x0cbb('0x4d')],{'$or':_[_0x0cbb('0x3d')](_0x4b8f02['attributes'],function(_0x456b91){var _0x5e8441={};_0x5e8441[_0x456b91]={'$like':'%'+_0x287346[_0x0cbb('0x45')][_0x0cbb('0x4e')]+'%'};return _0x5e8441;})});}_0x4b8f02=_[_0x0cbb('0x4f')]({},_0x4b8f02,_0x287346[_0x0cbb('0x50')]);return _0x4649eb[_0x0cbb('0x95')](_0x4b8f02);}})[_0x0cbb('0x20')](function(_0x2b719a){if(_0x2b719a){_0x259a95=_0x2b719a[_0x0cbb('0x64')];if(!_0x287346[_0x0cbb('0x45')][_0x0cbb('0x4a')](_0x0cbb('0x4b'))){_0x4b8f02['limit']=qs['limit'](_0x287346[_0x0cbb('0x45')][_0x0cbb('0x31')]);_0x4b8f02[_0x0cbb('0x30')]=qs[_0x0cbb('0x30')](_0x287346[_0x0cbb('0x45')][_0x0cbb('0x30')]);}return _0x4649eb[_0x0cbb('0x95')](_0x4b8f02);}})[_0x0cbb('0x20')](function(_0x28ae0e){if(_0x28ae0e){return _0x28ae0e?{'count':_0x259a95,'rows':_0x28ae0e}:null;}})[_0x0cbb('0x20')](respondWithResult(_0x53609c,null))[_0x0cbb('0x2b')](handleError(_0x53609c,null));};
\ No newline at end of file
+var _0xafb7=['QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','userChatQueue:save','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString'];(function(_0x2f04a1,_0x36b976){var _0xddc4b6=function(_0x2e6645){while(--_0x2e6645){_0x2f04a1['push'](_0x2f04a1['shift']());}};_0xddc4b6(++_0x36b976);}(_0xafb7,0x1dc));var _0x7afb=function(_0x5e192d,_0x548bdf){_0x5e192d=_0x5e192d-0x0;var _0x109da7=_0xafb7[_0x5e192d];return _0x109da7;};'use strict';var emlformat=require(_0x7afb('0x0'));var rimraf=require(_0x7afb('0x1'));var zipdir=require(_0x7afb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7afb('0x3'));var moment=require('moment');var BPromise=require(_0x7afb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7afb('0x5'));var sox=require('sox');var csv=require(_0x7afb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7afb('0x7'));var _=require('lodash');var squel=require(_0x7afb('0x8'));var crypto=require(_0x7afb('0x9'));var jsforce=require(_0x7afb('0xa'));var deskjs=require(_0x7afb('0xb'));var toCsv=require(_0x7afb('0x6'));var querystring=require(_0x7afb('0xc'));var Papa=require(_0x7afb('0xd'));var Redis=require('ioredis');var authService=require(_0x7afb('0xe'));var qs=require(_0x7afb('0xf'));var as=require(_0x7afb('0x10'));var hardwareService=require(_0x7afb('0x11'));var logger=require(_0x7afb('0x12'))(_0x7afb('0x13'));var utils=require(_0x7afb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7afb('0x15'));var db=require(_0x7afb('0x16'))['db'];config[_0x7afb('0x17')]=_[_0x7afb('0x18')](config[_0x7afb('0x17')],{'host':_0x7afb('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7afb('0x17')]));require(_0x7afb('0x1a'))['register'](socket);var jayson=require(_0x7afb('0x1b'));var client=jayson['client'][_0x7afb('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x28cbdd,_0x25eb8f,_0x2b5f4f,_0x13ed56){return new BPromise(function(_0x28d60b,_0x4c060e){var _0x334fd2=_0x13ed56||client;return _0x334fd2[_0x7afb('0x1d')](_0x28cbdd,_0x2b5f4f)[_0x7afb('0x1e')](function(_0x2187bb){logger['info'](_0x7afb('0x1f'),_0x25eb8f,_0x7afb('0x20'));logger[_0x7afb('0x21')](_0x7afb('0x22'),_0x25eb8f,'request\x20sent',JSON[_0x7afb('0x23')](_0x2187bb));if(_0x2187bb[_0x7afb('0x24')]){if(_0x2187bb['error'][_0x7afb('0x25')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x25eb8f,_0x2187bb[_0x7afb('0x24')][_0x7afb('0x26')]);return _0x4c060e(_0x2187bb[_0x7afb('0x24')][_0x7afb('0x26')]);}logger[_0x7afb('0x24')](_0x7afb('0x1f'),_0x25eb8f,_0x2187bb[_0x7afb('0x24')][_0x7afb('0x26')]);return _0x28d60b(_0x2187bb[_0x7afb('0x24')]['message']);}else{logger[_0x7afb('0x27')](_0x7afb('0x1f'),_0x25eb8f,_0x7afb('0x20'));_0x28d60b(_0x2187bb['result'][_0x7afb('0x26')]);}})[_0x7afb('0x28')](function(_0x216adf){logger[_0x7afb('0x24')](_0x7afb('0x1f'),_0x25eb8f,_0x216adf);_0x4c060e(_0x216adf);});});}function respondWithStatusCode(_0x4da190,_0xc5afa){_0xc5afa=_0xc5afa||0xcc;return function(_0x593c1f){if(_0x593c1f){return _0x4da190[_0x7afb('0x29')](_0xc5afa);}return _0x4da190[_0x7afb('0x2a')](_0xc5afa)[_0x7afb('0x2b')]();};}function respondWithResult(_0x581d06,_0x86471a){_0x86471a=_0x86471a||0xc8;return function(_0x2f6d56){if(_0x2f6d56){return _0x581d06['status'](_0x86471a)[_0x7afb('0x2c')](_0x2f6d56);}};}function respondWithFilteredResult(_0x3f6a70,_0xed7686){return function(_0x3d52d8){if(_0x3d52d8){var _0x2255c8=typeof _0xed7686[_0x7afb('0x2d')]==='undefined'&&typeof _0xed7686[_0x7afb('0x2e')]===_0x7afb('0x2f');var _0x331e87=_0x3d52d8[_0x7afb('0x30')];var _0x5aeccc=_0x2255c8?0x0:_0xed7686['offset'];var _0x31efce=_0x2255c8?_0x3d52d8[_0x7afb('0x30')]:_0xed7686[_0x7afb('0x2d')]+_0xed7686[_0x7afb('0x2e')];var _0x493be3;if(_0x31efce>=_0x331e87){_0x31efce=_0x331e87;_0x493be3=0xc8;}else{_0x493be3=0xce;}_0x3f6a70[_0x7afb('0x2a')](_0x493be3);return _0x3f6a70[_0x7afb('0x31')](_0x7afb('0x32'),_0x5aeccc+'-'+_0x31efce+'/'+_0x331e87)[_0x7afb('0x2c')](_0x3d52d8);}return null;};}function patchUpdates(_0x9dfe2b){return function(_0x24b639){try{jsonpatch[_0x7afb('0x33')](_0x24b639,_0x9dfe2b,!![]);}catch(_0x1025dd){return BPromise[_0x7afb('0x34')](_0x1025dd);}return _0x24b639[_0x7afb('0x35')]();};}function saveUpdates(_0x549725,_0x35350f){return function(_0x1c30d2){if(_0x1c30d2){return _0x1c30d2[_0x7afb('0x36')](_0x549725)[_0x7afb('0x1e')](function(_0x588ff4){return _0x588ff4;});}return null;};}function removeEntity(_0xf2fc21,_0x39d7fa){return function(_0x22814c){if(_0x22814c){return _0x22814c[_0x7afb('0x37')]()[_0x7afb('0x1e')](function(){var _0x3bc819=_0x22814c[_0x7afb('0x38')]({'plain':!![]});var _0x1c69f0=_0x7afb('0x39');return db[_0x7afb('0x3a')][_0x7afb('0x37')]({'where':{'type':_0x1c69f0,'resourceId':_0x3bc819['id']}})['then'](function(){return _0x22814c;});})[_0x7afb('0x1e')](function(){_0xf2fc21[_0x7afb('0x2a')](0xcc)[_0x7afb('0x2b')]();});}};}function handleEntityNotFound(_0xeb7fd6,_0x40388f){return function(_0x53b500){if(!_0x53b500){_0xeb7fd6[_0x7afb('0x29')](0x194);}return _0x53b500;};}function handleError(_0x26d220,_0x5b3431){_0x5b3431=_0x5b3431||0x1f4;return function(_0x19f17b){logger['error'](_0x19f17b[_0x7afb('0x3b')]);if(_0x19f17b['name']){delete _0x19f17b[_0x7afb('0x3c')];}_0x26d220['status'](_0x5b3431)[_0x7afb('0x3d')](_0x19f17b);};}exports[_0x7afb('0x3e')]=function(_0x8321ae,_0x1ef33a){var _0x164eff={},_0xbc528a={},_0x21485d={'count':0x0,'rows':[]};var _0x35b56a=_[_0x7afb('0x3f')](db[_0x7afb('0x40')][_0x7afb('0x41')],function(_0x583cdb){return{'name':_0x583cdb['fieldName'],'type':_0x583cdb['type'][_0x7afb('0x42')]};});_0xbc528a['model']=_[_0x7afb('0x3f')](_0x35b56a,_0x7afb('0x3c'));_0xbc528a[_0x7afb('0x43')]=_['keys'](_0x8321ae[_0x7afb('0x43')]);_0xbc528a[_0x7afb('0x44')]=_[_0x7afb('0x45')](_0xbc528a[_0x7afb('0x46')],_0xbc528a[_0x7afb('0x43')]);_0x164eff[_0x7afb('0x47')]=_[_0x7afb('0x45')](_0xbc528a['model'],qs[_0x7afb('0x48')](_0x8321ae['query'][_0x7afb('0x48')]));_0x164eff[_0x7afb('0x47')]=_0x164eff['attributes'][_0x7afb('0x49')]?_0x164eff['attributes']:_0xbc528a['model'];if(!_0x8321ae[_0x7afb('0x43')][_0x7afb('0x4a')](_0x7afb('0x4b'))){_0x164eff[_0x7afb('0x2e')]=qs[_0x7afb('0x2e')](_0x8321ae[_0x7afb('0x43')]['limit']);_0x164eff[_0x7afb('0x2d')]=qs['offset'](_0x8321ae['query'][_0x7afb('0x2d')]);}_0x164eff['order']=qs[_0x7afb('0x4c')](_0x8321ae[_0x7afb('0x43')][_0x7afb('0x4c')]);_0x164eff[_0x7afb('0x4d')]=qs[_0x7afb('0x44')](_[_0x7afb('0x4e')](_0x8321ae['query'],_0xbc528a[_0x7afb('0x44')]),_0x35b56a);if(_0x8321ae[_0x7afb('0x43')][_0x7afb('0x4f')]){_0x164eff['where']=_[_0x7afb('0x50')](_0x164eff['where'],{'$or':_[_0x7afb('0x3f')](_0x35b56a,function(_0x71f102){if(_0x71f102[_0x7afb('0x51')]!==_0x7afb('0x52')){var _0x45195a={};_0x45195a[_0x71f102[_0x7afb('0x3c')]]={'$like':'%'+_0x8321ae[_0x7afb('0x43')][_0x7afb('0x4f')]+'%'};return _0x45195a;}})});}_0x164eff=_['merge']({},_0x164eff,_0x8321ae['options']);var _0x4c0193={'where':_0x164eff['where']};return db[_0x7afb('0x40')][_0x7afb('0x30')](_0x4c0193)['then'](function(_0x7b6000){_0x21485d[_0x7afb('0x30')]=_0x7b6000;if(_0x8321ae[_0x7afb('0x43')][_0x7afb('0x53')]){_0x164eff[_0x7afb('0x54')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x164eff);})[_0x7afb('0x1e')](function(_0x4edc1e){_0x21485d[_0x7afb('0x55')]=_0x4edc1e;return _0x21485d;})[_0x7afb('0x1e')](respondWithFilteredResult(_0x1ef33a,_0x164eff))[_0x7afb('0x28')](handleError(_0x1ef33a,null));};exports[_0x7afb('0x56')]=function(_0x4a7c6d,_0x3ed04c){var _0x57878a={'raw':!![],'where':{'id':_0x4a7c6d[_0x7afb('0x57')]['id']}},_0x85e1b6={};_0x85e1b6[_0x7afb('0x46')]=_[_0x7afb('0x58')](db[_0x7afb('0x40')][_0x7afb('0x41')]);_0x85e1b6[_0x7afb('0x43')]=_[_0x7afb('0x58')](_0x4a7c6d[_0x7afb('0x43')]);_0x85e1b6[_0x7afb('0x44')]=_[_0x7afb('0x45')](_0x85e1b6[_0x7afb('0x46')],_0x85e1b6[_0x7afb('0x43')]);_0x57878a[_0x7afb('0x47')]=_[_0x7afb('0x45')](_0x85e1b6['model'],qs[_0x7afb('0x48')](_0x4a7c6d[_0x7afb('0x43')][_0x7afb('0x48')]));_0x57878a[_0x7afb('0x47')]=_0x57878a['attributes'][_0x7afb('0x49')]?_0x57878a[_0x7afb('0x47')]:_0x85e1b6[_0x7afb('0x46')];if(_0x4a7c6d[_0x7afb('0x43')][_0x7afb('0x53')]){_0x57878a[_0x7afb('0x54')]=[{'all':!![]}];}_0x57878a=_[_0x7afb('0x50')]({},_0x57878a,_0x4a7c6d[_0x7afb('0x59')]);return db['ChatQueue']['find'](_0x57878a)[_0x7afb('0x1e')](handleEntityNotFound(_0x3ed04c,null))['then'](respondWithResult(_0x3ed04c,null))['catch'](handleError(_0x3ed04c,null));};exports[_0x7afb('0x5a')]=function(_0x329221,_0x58c612){return db[_0x7afb('0x40')][_0x7afb('0x5a')](_0x329221[_0x7afb('0x5b')],{})[_0x7afb('0x1e')](function(_0xd162a3){var _0x3f32b8=_0x329221[_0x7afb('0x5c')][_0x7afb('0x38')]({'plain':!![]});if(!_0x3f32b8)throw new Error(_0x7afb('0x5d'));if(_0x3f32b8[_0x7afb('0x5e')]===_0x7afb('0x5c')){var _0x2c3eff=_0xd162a3[_0x7afb('0x38')]({'plain':!![]});var _0x5080b0='ChatQueues';return db['UserProfileSection'][_0x7afb('0x5f')]({'where':{'name':_0x5080b0,'userProfileId':_0x3f32b8[_0x7afb('0x60')]},'raw':!![]})[_0x7afb('0x1e')](function(_0x3917d9){if(_0x3917d9&&_0x3917d9[_0x7afb('0x61')]===0x0){return db[_0x7afb('0x3a')][_0x7afb('0x5a')]({'name':_0x2c3eff[_0x7afb('0x3c')],'resourceId':_0x2c3eff['id'],'type':_0x3917d9[_0x7afb('0x3c')],'sectionId':_0x3917d9['id']},{})['then'](function(){return _0xd162a3;});}else{return _0xd162a3;}})[_0x7afb('0x28')](function(_0x13bc8c){logger[_0x7afb('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bc8c);throw _0x13bc8c;});}return _0xd162a3;})['then'](respondWithResult(_0x58c612,0xc9))[_0x7afb('0x28')](handleError(_0x58c612,null));};exports[_0x7afb('0x36')]=function(_0x359ed5,_0x3925ce){if(_0x359ed5[_0x7afb('0x5b')]['id']){delete _0x359ed5[_0x7afb('0x5b')]['id'];}return db[_0x7afb('0x40')][_0x7afb('0x5f')]({'where':{'id':_0x359ed5[_0x7afb('0x57')]['id']}})[_0x7afb('0x1e')](handleEntityNotFound(_0x3925ce,null))[_0x7afb('0x1e')](saveUpdates(_0x359ed5['body'],null))['then'](respondWithResult(_0x3925ce,null))[_0x7afb('0x28')](handleError(_0x3925ce,null));};exports[_0x7afb('0x37')]=function(_0x19ca70,_0x208df6){return db[_0x7afb('0x40')][_0x7afb('0x5f')]({'where':{'id':_0x19ca70[_0x7afb('0x57')]['id']}})[_0x7afb('0x1e')](handleEntityNotFound(_0x208df6,null))[_0x7afb('0x1e')](removeEntity(_0x208df6,null))[_0x7afb('0x28')](handleError(_0x208df6,null));};exports[_0x7afb('0x62')]=function(_0xdd5c03,_0x4020c5){return db[_0x7afb('0x40')][_0x7afb('0x62')]()[_0x7afb('0x1e')](respondWithResult(_0x4020c5,null))[_0x7afb('0x28')](handleError(_0x4020c5,null));};exports[_0x7afb('0x63')]=function(_0x1dc212,_0x38ee2f,_0x17ce87){var _0x542aa4={'raw':!![],'where':{}},_0x3b2fcc={},_0x5634c4;return db['ChatQueue'][_0x7afb('0x64')]({'where':{'id':_0x1dc212['params']['id']}})[_0x7afb('0x1e')](handleEntityNotFound(_0x38ee2f,null))[_0x7afb('0x1e')](function(_0x5800a1){if(_0x5800a1){_0x5634c4=_0x5800a1['get']({'plain':!![]});_0x3b2fcc['model']=_[_0x7afb('0x58')](db[_0x7afb('0x65')][_0x7afb('0x41')]);_0x3b2fcc['query']=_[_0x7afb('0x58')](_0x1dc212['query']);_0x3b2fcc[_0x7afb('0x44')]=_[_0x7afb('0x45')](_0x3b2fcc[_0x7afb('0x46')],_0x3b2fcc[_0x7afb('0x43')]);_0x542aa4['attributes']=_[_0x7afb('0x45')](_0x3b2fcc[_0x7afb('0x46')],qs[_0x7afb('0x48')](_0x1dc212[_0x7afb('0x43')][_0x7afb('0x48')]));_0x542aa4['attributes']=_0x542aa4[_0x7afb('0x47')]['length']?_0x542aa4[_0x7afb('0x47')]:_0x3b2fcc[_0x7afb('0x46')];if(!_0x1dc212[_0x7afb('0x43')][_0x7afb('0x4a')](_0x7afb('0x4b'))){_0x542aa4['limit']=qs['limit'](_0x1dc212[_0x7afb('0x43')][_0x7afb('0x2e')]);_0x542aa4[_0x7afb('0x2d')]=qs[_0x7afb('0x2d')](_0x1dc212[_0x7afb('0x43')]['offset']);}_0x542aa4[_0x7afb('0x66')]=qs[_0x7afb('0x4c')](_0x1dc212['query'][_0x7afb('0x4c')]);_0x542aa4[_0x7afb('0x4d')]=qs[_0x7afb('0x44')](_['pick'](_0x1dc212[_0x7afb('0x43')],_0x3b2fcc[_0x7afb('0x44')]));_0x542aa4[_0x7afb('0x4d')][_0x7afb('0x67')]=_0x5800a1['id'];if(_0x1dc212[_0x7afb('0x43')]['filter']){_0x542aa4['where']=_['merge'](_0x542aa4[_0x7afb('0x4d')],{'$or':_[_0x7afb('0x3f')](_0x542aa4[_0x7afb('0x47')],function(_0x168c1c){var _0x25da09={};_0x25da09[_0x168c1c]={'$like':'%'+_0x1dc212[_0x7afb('0x43')][_0x7afb('0x4f')]+'%'};return _0x25da09;})});}_0x542aa4=_[_0x7afb('0x50')]({},_0x542aa4,_0x1dc212[_0x7afb('0x59')]);return db['UserChatQueue'][_0x7afb('0x68')](_0x542aa4);}})[_0x7afb('0x1e')](function(_0x4338ab){if(_0x4338ab){return db['User']['findAndCountAll']({'where':{'id':_[_0x7afb('0x3f')](_0x4338ab,_0x7afb('0x69')),'role':_0x7afb('0x6a')},'attributes':['id',_0x7afb('0x3c'),_0x7afb('0x6b'),_0x7afb('0x6c'),_0x7afb('0x6d')]});}})[_0x7afb('0x1e')](function(_0x584cc0){if(_0x584cc0){return{'count':_0x584cc0[_0x7afb('0x30')],'rows':_[_0x7afb('0x3f')](_0x584cc0['rows'],function(_0x1587fe){return{'membername':_0x1587fe[_0x7afb('0x3c')],'UserId':_0x1587fe['id'],'queue_name':_0x5634c4[_0x7afb('0x3c')],'ChatQueueId':_0x5634c4['id'],'interface':util[_0x7afb('0x6e')](_0x7afb('0x6f'),_0x7afb('0x70'),_0x1587fe['name']),'penalty':0x0,'paused':_0x1587fe[_0x7afb('0x6b')],'createdAt':_0x1587fe[_0x7afb('0x6d')],'updatedAt':_0x1587fe['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7afb('0x1e')](respondWithFilteredResult(_0x38ee2f,_0x542aa4))[_0x7afb('0x28')](handleError(_0x38ee2f,null));};exports[_0x7afb('0x71')]=function(_0x599e3a,_0x3386f6,_0x20974f){var _0x52d1bd={};var _0x3c563d={};var _0x7642a8;var _0x45ec2c;return db['ChatQueue']['findOne']({'where':{'id':_0x599e3a[_0x7afb('0x57')]['id']}})[_0x7afb('0x1e')](handleEntityNotFound(_0x3386f6,null))['then'](function(_0x2eaec6){if(_0x2eaec6){_0x7642a8=_0x2eaec6;_0x3c563d['model']=_[_0x7afb('0x58')](db[_0x7afb('0x72')][_0x7afb('0x41')]);_0x3c563d[_0x7afb('0x43')]=_[_0x7afb('0x58')](_0x599e3a[_0x7afb('0x43')]);_0x3c563d[_0x7afb('0x44')]=_[_0x7afb('0x45')](_0x3c563d[_0x7afb('0x46')],_0x3c563d[_0x7afb('0x43')]);_0x52d1bd[_0x7afb('0x47')]=_[_0x7afb('0x45')](_0x3c563d['model'],qs[_0x7afb('0x48')](_0x599e3a[_0x7afb('0x43')]['fields']));_0x52d1bd[_0x7afb('0x47')]=_0x52d1bd[_0x7afb('0x47')][_0x7afb('0x49')]?_0x52d1bd['attributes']:_0x3c563d[_0x7afb('0x46')];_0x52d1bd[_0x7afb('0x66')]=qs[_0x7afb('0x4c')](_0x599e3a['query']['sort']);_0x52d1bd[_0x7afb('0x4d')]=qs[_0x7afb('0x44')](_[_0x7afb('0x4e')](_0x599e3a[_0x7afb('0x43')],_0x3c563d['filters']));if(_0x599e3a[_0x7afb('0x43')]['filter']){_0x52d1bd['where']=_['merge'](_0x52d1bd[_0x7afb('0x4d')],{'$or':_[_0x7afb('0x3f')](_0x52d1bd[_0x7afb('0x47')],function(_0x2bc4ec){var _0x5a1dad={};_0x5a1dad[_0x2bc4ec]={'$like':'%'+_0x599e3a[_0x7afb('0x43')][_0x7afb('0x4f')]+'%'};return _0x5a1dad;})});}_0x52d1bd=_[_0x7afb('0x50')]({},_0x52d1bd,_0x599e3a['options']);return _0x7642a8[_0x7afb('0x71')](_0x52d1bd);}})[_0x7afb('0x1e')](function(_0x582fab){if(_0x582fab){_0x45ec2c=_0x582fab[_0x7afb('0x49')];if(!_0x599e3a[_0x7afb('0x43')]['hasOwnProperty']('nolimit')){_0x52d1bd[_0x7afb('0x2e')]=qs[_0x7afb('0x2e')](_0x599e3a[_0x7afb('0x43')][_0x7afb('0x2e')]);_0x52d1bd[_0x7afb('0x2d')]=qs[_0x7afb('0x2d')](_0x599e3a['query'][_0x7afb('0x2d')]);}return _0x7642a8[_0x7afb('0x71')](_0x52d1bd);}})[_0x7afb('0x1e')](function(_0x227429){if(_0x227429){return _0x227429?{'count':_0x45ec2c,'rows':_0x227429}:null;}})[_0x7afb('0x1e')](respondWithResult(_0x3386f6,null))[_0x7afb('0x28')](handleError(_0x3386f6,null));};exports[_0x7afb('0x73')]=function(_0x12ba75,_0x3b4674,_0x413523){var _0x149e9a=_0x12ba75[_0x7afb('0x5b')][_0x7afb('0x74')];return db[_0x7afb('0x72')][_0x7afb('0x68')]({'where':{'id':_0x149e9a},'attributes':['id'],'include':[{'model':db[_0x7afb('0x75')],'as':_0x7afb('0x76'),'attributes':['id',_0x7afb('0x3c'),_0x7afb('0x77'),_0x7afb('0x78'),_0x7afb('0x79')],'raw':!![]}]})[_0x7afb('0x1e')](function(_0x4f10d6){if(_0x4f10d6){var _0x1820aa=_[_0x7afb('0x7a')](_0x4f10d6,function(_0xc9e107){var _0x57980c=_0xc9e107[_0x7afb('0x38')]({'plain':!![]});return _0x57980c[_0x7afb('0x76')];});return db[_0x7afb('0x40')][_0x7afb('0x5f')]({'where':{'id':_0x12ba75[_0x7afb('0x57')]['id']}})['then'](function(_0x832855){return db[_0x7afb('0x7b')][_0x7afb('0x7c')](function(_0x5cd815){return _0x832855['addTeams'](_0x149e9a,{'transaction':_0x5cd815})[_0x7afb('0x1e')](function(){return BPromise[_0x7afb('0x7d')](_0x1820aa,function(_0x5e782b){return db[_0x7afb('0x65')]['findOrCreate']({'where':{'UserId':_0x5e782b['id'],'ChatQueueId':_0x12ba75[_0x7afb('0x57')]['id']},'transaction':_0x5cd815});});})['then'](function(){_0x1820aa[_0x7afb('0x7e')](function(_0x96bdcf){socket['emit'](_0x7afb('0x7f'),{'UserId':_0x96bdcf['id'],'ChatQueueId':_0x832855['id']});});});});});}})[_0x7afb('0x1e')](respondWithStatusCode(_0x3b4674,null))[_0x7afb('0x28')](handleError(_0x3b4674,null));};exports['removeTeams']=function(_0x491550,_0x2ebe7e,_0x32262c){return db[_0x7afb('0x72')]['findAll']({'where':{'id':_0x491550[_0x7afb('0x43')][_0x7afb('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7afb('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ebe7e,null))[_0x7afb('0x1e')](function(_0x165de4){var _0x52e4d5=_[_0x7afb('0x3f')](_0x165de4,'id');var _0x30162d=[];var _0x1f6795=[];var _0x4827e4=squel[_0x7afb('0x80')]();_0x4827e4[_0x7afb('0x81')](_0x7afb('0x82'))['from']('team_has_chat_queues','tq')[_0x7afb('0x83')]('user_has_teams','ut',_0x7afb('0x84'))[_0x7afb('0x4d')](_0x7afb('0x85'),_0x491550[_0x7afb('0x57')]['id']);for(var _0x17021c=0x0;_0x17021c<_0x165de4[_0x7afb('0x49')];_0x17021c+=0x1){let _0x1d6a38=_0x165de4[_0x17021c];for(var _0x35badd=0x0;_0x35badd<_0x1d6a38[_0x7afb('0x76')][_0x7afb('0x49')];_0x35badd+=0x1){let _0xf14fb6=_0x1d6a38[_0x7afb('0x76')][_0x35badd];var _0x2dd7ef=_0x4827e4['clone']();_0x2dd7ef[_0x7afb('0x4d')]('ut.UserId\x20=\x20?',_0xf14fb6['id']);_0x1f6795[_0x7afb('0x86')](db[_0x7afb('0x7b')][_0x7afb('0x43')](_0x2dd7ef[_0x7afb('0x87')](),{'type':db[_0x7afb('0x7b')][_0x7afb('0x88')][_0x7afb('0x89')]})['then'](function(_0x18ca71){if(_0x18ca71[_0x7afb('0x49')]===0x1){return _0xf14fb6['id'];}else{var _0x1a8a2a=_[_0x7afb('0x8a')](_[_0x7afb('0x3f')](_0x18ca71,_0x7afb('0x8b')),function(_0x3587c6){return _[_0x7afb('0x8c')](_0x52e4d5,_0x3587c6);});if(_0x1a8a2a){return _0xf14fb6['id'];}}}));}}return BPromise[_0x7afb('0x8d')](_0x1f6795)[_0x7afb('0x1e')](function(_0x31f3f6){_0x30162d=_(_0x30162d)[_0x7afb('0x8e')](_0x31f3f6)[_0x7afb('0x8f')]()['value']();return db[_0x7afb('0x40')][_0x7afb('0x5f')]({'where':{'id':_0x491550[_0x7afb('0x57')]['id']}})[_0x7afb('0x1e')](function(_0x17e20f){return db[_0x7afb('0x7b')]['transaction'](function(_0x11cd9c){return _0x17e20f[_0x7afb('0x90')](_0x491550[_0x7afb('0x43')][_0x7afb('0x74')],{'transaction':_0x11cd9c})[_0x7afb('0x1e')](function(){if(!_['isEmpty'](_0x30162d)){return _0x17e20f[_0x7afb('0x91')](_0x30162d,{'transaction':_0x11cd9c});}})[_0x7afb('0x1e')](function(){_0x30162d[_0x7afb('0x7e')](function(_0x55d322){socket[_0x7afb('0x92')](_0x7afb('0x93'),{'UserId':_0x55d322,'ChatQueueId':_0x17e20f['id']});});});});});});})['then'](respondWithStatusCode(_0x2ebe7e,null))[_0x7afb('0x28')](handleError(_0x2ebe7e,null));};exports[_0x7afb('0x94')]=function(_0x135c34,_0x2a82f6,_0x4edbda){return db[_0x7afb('0x40')][_0x7afb('0x5f')]({'where':{'id':_0x135c34['params']['id']}})[_0x7afb('0x1e')](handleEntityNotFound(_0x2a82f6,null))[_0x7afb('0x1e')](function(_0x129b4e){if(_0x129b4e){return _0x129b4e[_0x7afb('0x94')](_0x135c34[_0x7afb('0x5b')][_0x7afb('0x74')],_[_0x7afb('0x95')](_0x135c34['body'],['ids','id'])||{})[_0x7afb('0x96')](function(_0x3fc206){for(var _0x43aecb=0x0;_0x43aecb<_0x135c34[_0x7afb('0x5b')][_0x7afb('0x74')]['length'];_0x43aecb+=0x1){socket['emit'](_0x7afb('0x7f'),{'UserId':Number(_0x135c34[_0x7afb('0x5b')][_0x7afb('0x74')][_0x43aecb]),'ChatQueueId':Number(_0x135c34[_0x7afb('0x57')]['id'])});}return _0x3fc206;});}})['then'](respondWithResult(_0x2a82f6,null))[_0x7afb('0x28')](handleError(_0x2a82f6,null));};exports['removeAgents']=function(_0x3a11c6,_0x4ff674,_0x405718){return db[_0x7afb('0x40')]['find']({'where':{'id':_0x3a11c6[_0x7afb('0x57')]['id']}})['then'](handleEntityNotFound(_0x4ff674,null))[_0x7afb('0x1e')](function(_0x4b3c42){if(_0x4b3c42){return _0x4b3c42[_0x7afb('0x91')](_0x3a11c6['query'][_0x7afb('0x74')])['then'](function(){if(_[_0x7afb('0x97')](_0x3a11c6[_0x7afb('0x43')]['ids'])){for(var _0x3b3fc9=0x0;_0x3b3fc9<_0x3a11c6[_0x7afb('0x43')][_0x7afb('0x74')][_0x7afb('0x49')];_0x3b3fc9+=0x1){socket['emit'](_0x7afb('0x93'),{'UserId':Number(_0x3a11c6['query'][_0x7afb('0x74')][_0x3b3fc9]),'ChatQueueId':Number(_0x3a11c6[_0x7afb('0x57')]['id'])});}}else{socket['emit'](_0x7afb('0x93'),{'UserId':Number(_0x3a11c6[_0x7afb('0x43')][_0x7afb('0x74')]),'ChatQueueId':Number(_0x3a11c6['params']['id'])});}});}})[_0x7afb('0x1e')](respondWithStatusCode(_0x4ff674,null))[_0x7afb('0x28')](handleError(_0x4ff674,null));};exports[_0x7afb('0x98')]=function(_0xbfe7bb,_0x1bebb1,_0x24db4d){var _0x24da6e={};var _0x21077d={};var _0x4de3bf;var _0x4fc021;return db[_0x7afb('0x40')]['findOne']({'where':{'id':_0xbfe7bb['params']['id']}})[_0x7afb('0x1e')](handleEntityNotFound(_0x1bebb1,null))[_0x7afb('0x1e')](function(_0x2a989f){if(_0x2a989f){_0x4de3bf=_0x2a989f;_0x21077d['model']=_[_0x7afb('0x58')](db[_0x7afb('0x75')][_0x7afb('0x41')]);_0x21077d['query']=_['keys'](_0xbfe7bb[_0x7afb('0x43')]);_0x21077d[_0x7afb('0x44')]=_[_0x7afb('0x45')](_0x21077d[_0x7afb('0x46')],_0x21077d['query']);_0x24da6e[_0x7afb('0x47')]=_['intersection'](_0x21077d[_0x7afb('0x46')],qs['fields'](_0xbfe7bb[_0x7afb('0x43')][_0x7afb('0x48')]));_0x24da6e[_0x7afb('0x47')]=_0x24da6e[_0x7afb('0x47')][_0x7afb('0x49')]?_0x24da6e[_0x7afb('0x47')]:_0x21077d[_0x7afb('0x46')];_0x24da6e['order']=qs[_0x7afb('0x4c')](_0xbfe7bb[_0x7afb('0x43')][_0x7afb('0x4c')]);_0x24da6e[_0x7afb('0x4d')]=qs[_0x7afb('0x44')](_[_0x7afb('0x4e')](_0xbfe7bb[_0x7afb('0x43')],_0x21077d[_0x7afb('0x44')]));if(_0xbfe7bb[_0x7afb('0x43')][_0x7afb('0x4f')]){_0x24da6e[_0x7afb('0x4d')]=_[_0x7afb('0x50')](_0x24da6e['where'],{'$or':_[_0x7afb('0x3f')](_0x24da6e[_0x7afb('0x47')],function(_0x45e008){var _0x1cca03={};_0x1cca03[_0x45e008]={'$like':'%'+_0xbfe7bb[_0x7afb('0x43')][_0x7afb('0x4f')]+'%'};return _0x1cca03;})});}_0x24da6e=_[_0x7afb('0x50')]({},_0x24da6e,_0xbfe7bb['options']);return _0x4de3bf[_0x7afb('0x98')](_0x24da6e);}})[_0x7afb('0x1e')](function(_0x12c126){if(_0x12c126){_0x4fc021=_0x12c126[_0x7afb('0x49')];if(!_0xbfe7bb[_0x7afb('0x43')]['hasOwnProperty'](_0x7afb('0x4b'))){_0x24da6e[_0x7afb('0x2e')]=qs['limit'](_0xbfe7bb['query']['limit']);_0x24da6e[_0x7afb('0x2d')]=qs['offset'](_0xbfe7bb[_0x7afb('0x43')]['offset']);}return _0x4de3bf[_0x7afb('0x98')](_0x24da6e);}})[_0x7afb('0x1e')](function(_0x3b2697){if(_0x3b2697){return _0x3b2697?{'count':_0x4fc021,'rows':_0x3b2697}:null;}})['then'](respondWithResult(_0x1bebb1,null))[_0x7afb('0x28')](handleError(_0x1bebb1,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 3ab74ba..6fbd00e 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 _0xaf76=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5eac87,_0x152105){var _0x3de3e1=function(_0x488e5d){while(--_0x488e5d){_0x5eac87['push'](_0x5eac87['shift']());}};_0x3de3e1(++_0x152105);}(_0xaf76,0x1b6));var _0x6af7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf76[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6af7('0x0'));var ChatQueue=require(_0x6af7('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6af7('0x2')](0x0);var events={'afterCreate':_0x6af7('0x3'),'afterUpdate':_0x6af7('0x4'),'afterDestroy':_0x6af7('0x5')};function emitEvent(_0x57d1e3){return function(_0x560e59,_0x4a9726,_0x53c745){ChatQueueEvents[_0x6af7('0x6')](_0x57d1e3+':'+_0x560e59['id'],_0x560e59);ChatQueueEvents['emit'](_0x57d1e3,_0x560e59);_0x53c745(null);};}for(var e in events){if(events[_0x6af7('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x6af7('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x321e=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x46f81c,_0x220ad7){var _0x1e0f99=function(_0x2bd6cf){while(--_0x2bd6cf){_0x46f81c['push'](_0x46f81c['shift']());}};_0x1e0f99(++_0x220ad7);}(_0x321e,0xba));var _0xe321=function(_0x246c77,_0x568234){_0x246c77=_0x246c77-0x0;var _0x2d5192=_0x321e[_0x246c77];return _0x2d5192;};'use strict';var EventEmitter=require(_0xe321('0x0'));var ChatQueue=require(_0xe321('0x1'))['db'][_0xe321('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe321('0x3')](0x0);var events={'afterCreate':_0xe321('0x4'),'afterUpdate':_0xe321('0x5'),'afterDestroy':_0xe321('0x6')};function emitEvent(_0x5bbfb1){return function(_0x105035,_0x488c2b,_0x403d07){ChatQueueEvents[_0xe321('0x7')](_0x5bbfb1+':'+_0x105035['id'],_0x105035);ChatQueueEvents[_0xe321('0x7')](_0x5bbfb1,_0x105035);_0x403d07(null);};}for(var e in events){if(events[_0xe321('0x8')](e)){var event=events[e];ChatQueue[_0xe321('0x9')](e,emitEvent(event));}}module[_0xe321('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 f0e2d81..23254df 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 _0x4dde=['./chatQueue.attributes','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4ba785,_0xad6b18){var _0x158750=function(_0x5dff8b){while(--_0x5dff8b){_0x4ba785['push'](_0x4ba785['shift']());}};_0x158750(++_0xad6b18);}(_0x4dde,0x6f));var _0xe4dd=function(_0x135800,_0x2f6fdc){_0x135800=_0x135800-0x0;var _0x3ae888=_0x4dde[_0x135800];return _0x3ae888;};'use strict';var _=require(_0xe4dd('0x0'));var util=require(_0xe4dd('0x1'));var logger=require(_0xe4dd('0x2'))(_0xe4dd('0x3'));var moment=require(_0xe4dd('0x4'));var BPromise=require(_0xe4dd('0x5'));var rp=require(_0xe4dd('0x6'));var fs=require('fs');var path=require(_0xe4dd('0x7'));var rimraf=require('rimraf');var config=require(_0xe4dd('0x8'));var attributes=require(_0xe4dd('0x9'));module['exports']=function(_0x2eb251,_0x2b571b){return _0x2eb251['define'](_0xe4dd('0xa'),attributes,{'tableName':_0xe4dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x817b=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','api'];(function(_0x3a6c08,_0x3ee204){var _0x54957a=function(_0x2668a9){while(--_0x2668a9){_0x3a6c08['push'](_0x3a6c08['shift']());}};_0x54957a(++_0x3ee204);}(_0x817b,0x100));var _0xb817=function(_0x518eda,_0x26d575){_0x518eda=_0x518eda-0x0;var _0x163c1d=_0x817b[_0x518eda];return _0x163c1d;};'use strict';var _=require(_0xb817('0x0'));var util=require(_0xb817('0x1'));var logger=require(_0xb817('0x2'))(_0xb817('0x3'));var moment=require('moment');var BPromise=require(_0xb817('0x4'));var rp=require(_0xb817('0x5'));var fs=require('fs');var path=require(_0xb817('0x6'));var rimraf=require(_0xb817('0x7'));var config=require(_0xb817('0x8'));var attributes=require(_0xb817('0x9'));module[_0xb817('0xa')]=function(_0x54f5fb,_0x14e85c){return _0x54f5fb[_0xb817('0xb')]('ChatQueue',attributes,{'tableName':_0xb817('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 7ad845a..a06baf3 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 _0x56a4=['where','map','include','model','attributes','then','catch','find','raw','ShowChatQueue','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','options'];(function(_0x11c6b8,_0x5b2d7b){var _0x38b38f=function(_0x641ad0){while(--_0x641ad0){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x38b38f(++_0x5b2d7b);}(_0x56a4,0x73));var _0x456a=function(_0x599d7f,_0xc586e8){_0x599d7f=_0x599d7f-0x0;var _0x3346d3=_0x56a4[_0x599d7f];return _0x3346d3;};'use strict';var _=require('lodash');var util=require(_0x456a('0x0'));var moment=require(_0x456a('0x1'));var BPromise=require(_0x456a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x456a('0x3'))['db'];var utils=require(_0x456a('0x4'));var logger=require(_0x456a('0x5'))(_0x456a('0x6'));var config=require(_0x456a('0x7'));var jayson=require(_0x456a('0x8'));var client=jayson[_0x456a('0x9')][_0x456a('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x456a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x456a('0xb')]));require('./chatQueue.socket')[_0x456a('0xc')](socket);function respondWithRpcPromise(_0x86bcda,_0x177988,_0x2e5f10){return new BPromise(function(_0x12f945,_0x56f14c){return client[_0x456a('0xd')](_0x86bcda,_0x2e5f10)['then'](function(_0x59f11c){logger[_0x456a('0xe')](_0x456a('0xf'),_0x177988,_0x456a('0x10'));logger[_0x456a('0x11')](_0x456a('0x12'),_0x177988,_0x456a('0x10'),JSON[_0x456a('0x13')](_0x59f11c));if(_0x59f11c['error']){if(_0x59f11c[_0x456a('0x14')]['code']===0x1f4){logger[_0x456a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x177988,_0x59f11c[_0x456a('0x14')]['message']);return _0x56f14c(_0x59f11c[_0x456a('0x14')]['message']);}logger[_0x456a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x177988,_0x59f11c[_0x456a('0x14')][_0x456a('0x15')]);return _0x12f945(_0x59f11c[_0x456a('0x14')][_0x456a('0x15')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x177988,_0x456a('0x10'));_0x12f945(_0x59f11c[_0x456a('0x16')][_0x456a('0x15')]);}})['catch'](function(_0x5aaf40){logger[_0x456a('0x14')](_0x456a('0xf'),_0x177988,_0x5aaf40);_0x56f14c(_0x5aaf40);});});}exports[_0x456a('0x17')]=function(_0x5aff8b){var _0x202877=this;return new Promise(function(_0x2db147,_0x1378ae){return db['ChatQueue']['findAll']({'raw':_0x5aff8b['options']?_0x5aff8b[_0x456a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b['options'][_0x456a('0x19')]||null:null,'attributes':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b[_0x456a('0x18')]['attributes']||null:null,'limit':_0x5aff8b['options']?_0x5aff8b[_0x456a('0x18')]['limit']||null:null,'include':_0x5aff8b[_0x456a('0x18')]?_0x5aff8b[_0x456a('0x18')]['include']?_[_0x456a('0x1a')](_0x5aff8b[_0x456a('0x18')][_0x456a('0x1b')],function(_0x3f8967){return{'model':db[_0x3f8967[_0x456a('0x1c')]],'as':_0x3f8967['as'],'attributes':_0x3f8967[_0x456a('0x1d')],'include':_0x3f8967['include']?_[_0x456a('0x1a')](_0x3f8967['include'],function(_0x2f7e93){return{'model':db[_0x2f7e93[_0x456a('0x1c')]],'as':_0x2f7e93['as'],'attributes':_0x2f7e93['attributes'],'include':_0x2f7e93[_0x456a('0x1b')]?_['map'](_0x2f7e93[_0x456a('0x1b')],function(_0x3097fb){return{'model':db[_0x3097fb[_0x456a('0x1c')]],'as':_0x3097fb['as'],'attributes':_0x3097fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x456a('0x1e')](function(_0x25287a){logger[_0x456a('0xe')](_0x456a('0x17'),_0x5aff8b);logger[_0x456a('0x11')](_0x456a('0x17'),_0x5aff8b,JSON[_0x456a('0x13')](_0x25287a));_0x2db147(_0x25287a);})[_0x456a('0x1f')](function(_0x1b9af6){logger[_0x456a('0x14')]('GetChatQueue',_0x1b9af6[_0x456a('0x15')],_0x5aff8b);_0x1378ae(_0x202877[_0x456a('0x14')](0x1f4,_0x1b9af6[_0x456a('0x15')]));});});};exports['ShowChatQueue']=function(_0x1ef547){var _0x6d6e3c=this;return new Promise(function(_0x40445d,_0x21f232){return db['ChatQueue'][_0x456a('0x20')]({'raw':_0x1ef547[_0x456a('0x18')]?_0x1ef547[_0x456a('0x18')][_0x456a('0x21')]===undefined?!![]:![]:!![],'where':_0x1ef547['options']?_0x1ef547[_0x456a('0x18')]['where']||null:null,'attributes':_0x1ef547[_0x456a('0x18')]?_0x1ef547[_0x456a('0x18')][_0x456a('0x1d')]||null:null,'include':_0x1ef547['options']?_0x1ef547['options'][_0x456a('0x1b')]?_[_0x456a('0x1a')](_0x1ef547['options']['include'],function(_0x3c308b){return{'model':db[_0x3c308b['model']],'as':_0x3c308b['as'],'attributes':_0x3c308b[_0x456a('0x1d')],'include':_0x3c308b['include']?_[_0x456a('0x1a')](_0x3c308b[_0x456a('0x1b')],function(_0x1b234d){return{'model':db[_0x1b234d[_0x456a('0x1c')]],'as':_0x1b234d['as'],'attributes':_0x1b234d[_0x456a('0x1d')],'include':_0x1b234d[_0x456a('0x1b')]?_[_0x456a('0x1a')](_0x1b234d[_0x456a('0x1b')],function(_0x307440){return{'model':db[_0x307440['model']],'as':_0x307440['as'],'attributes':_0x307440['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5886ed){logger['info'](_0x456a('0x22'),_0x1ef547);logger[_0x456a('0x11')](_0x456a('0x22'),_0x1ef547,JSON[_0x456a('0x13')](_0x5886ed));_0x40445d(_0x5886ed);})[_0x456a('0x1f')](function(_0x2a8527){logger[_0x456a('0x14')](_0x456a('0x22'),_0x2a8527['message'],_0x1ef547);_0x21f232(_0x6d6e3c[_0x456a('0x14')](0x1f4,_0x2a8527[_0x456a('0x15')]));});});};
\ No newline at end of file
+var _0x173d=['map','model','ShowChatQueue','ChatQueue','find','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x2c7879,_0x164f1b){var _0x2dc765=function(_0x52a6f3){while(--_0x52a6f3){_0x2c7879['push'](_0x2c7879['shift']());}};_0x2dc765(++_0x164f1b);}(_0x173d,0x108));var _0xd173=function(_0x239996,_0x20b354){_0x239996=_0x239996-0x0;var _0x1ef000=_0x173d[_0x239996];return _0x1ef000;};'use strict';var _=require('lodash');var util=require(_0xd173('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd173('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd173('0x2'))['db'];var utils=require(_0xd173('0x3'));var logger=require(_0xd173('0x4'))(_0xd173('0x5'));var config=require(_0xd173('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd173('0x7')][_0xd173('0x8')]({'port':0x232a});config[_0xd173('0x9')]=_['defaults'](config[_0xd173('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd173('0xa'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xd173('0xb')](socket);function respondWithRpcPromise(_0x40aece,_0x4f37ea,_0x2ac519){return new BPromise(function(_0x1e1bd5,_0x4b0ac9){return client[_0xd173('0xc')](_0x40aece,_0x2ac519)[_0xd173('0xd')](function(_0x1b4bd1){logger[_0xd173('0xe')](_0xd173('0xf'),_0x4f37ea,_0xd173('0x10'));logger[_0xd173('0x11')](_0xd173('0x12'),_0x4f37ea,_0xd173('0x10'),JSON[_0xd173('0x13')](_0x1b4bd1));if(_0x1b4bd1[_0xd173('0x14')]){if(_0x1b4bd1[_0xd173('0x14')]['code']===0x1f4){logger[_0xd173('0x14')]('ChatQueue,\x20%s,\x20%s',_0x4f37ea,_0x1b4bd1[_0xd173('0x14')][_0xd173('0x15')]);return _0x4b0ac9(_0x1b4bd1['error'][_0xd173('0x15')]);}logger[_0xd173('0x14')](_0xd173('0xf'),_0x4f37ea,_0x1b4bd1[_0xd173('0x14')]['message']);return _0x1e1bd5(_0x1b4bd1['error'][_0xd173('0x15')]);}else{logger[_0xd173('0xe')](_0xd173('0xf'),_0x4f37ea,'request\x20sent');_0x1e1bd5(_0x1b4bd1[_0xd173('0x16')][_0xd173('0x15')]);}})[_0xd173('0x17')](function(_0x262eac){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4f37ea,_0x262eac);_0x4b0ac9(_0x262eac);});});}exports[_0xd173('0x18')]=function(_0xec34f9){var _0x38be1d=this;return new Promise(function(_0x35c2d8,_0x58e9ff){return db['ChatQueue'][_0xd173('0x19')]({'raw':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1b')]===undefined?!![]:![]:!![],'where':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1c')]||null:null,'attributes':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1d')]||null:null,'limit':_0xec34f9[_0xd173('0x1a')]?_0xec34f9['options'][_0xd173('0x1e')]||null:null,'include':_0xec34f9[_0xd173('0x1a')]?_0xec34f9[_0xd173('0x1a')][_0xd173('0x1f')]?_[_0xd173('0x20')](_0xec34f9[_0xd173('0x1a')]['include'],function(_0x57f971){return{'model':db[_0x57f971[_0xd173('0x21')]],'as':_0x57f971['as'],'attributes':_0x57f971[_0xd173('0x1d')],'include':_0x57f971[_0xd173('0x1f')]?_[_0xd173('0x20')](_0x57f971[_0xd173('0x1f')],function(_0x378a07){return{'model':db[_0x378a07[_0xd173('0x21')]],'as':_0x378a07['as'],'attributes':_0x378a07[_0xd173('0x1d')],'include':_0x378a07['include']?_['map'](_0x378a07[_0xd173('0x1f')],function(_0x15035c){return{'model':db[_0x15035c['model']],'as':_0x15035c['as'],'attributes':_0x15035c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd173('0xd')](function(_0x38a389){logger[_0xd173('0xe')](_0xd173('0x18'),_0xec34f9);logger[_0xd173('0x11')](_0xd173('0x18'),_0xec34f9,JSON['stringify'](_0x38a389));_0x35c2d8(_0x38a389);})['catch'](function(_0x142273){logger[_0xd173('0x14')]('GetChatQueue',_0x142273[_0xd173('0x15')],_0xec34f9);_0x58e9ff(_0x38be1d[_0xd173('0x14')](0x1f4,_0x142273[_0xd173('0x15')]));});});};exports[_0xd173('0x22')]=function(_0x1def05){var _0x4dfcd8=this;return new Promise(function(_0x4957d4,_0x5f4ea4){return db[_0xd173('0x23')][_0xd173('0x24')]({'raw':_0x1def05['options']?_0x1def05[_0xd173('0x1a')][_0xd173('0x1b')]===undefined?!![]:![]:!![],'where':_0x1def05[_0xd173('0x1a')]?_0x1def05[_0xd173('0x1a')][_0xd173('0x1c')]||null:null,'attributes':_0x1def05['options']?_0x1def05[_0xd173('0x1a')][_0xd173('0x1d')]||null:null,'include':_0x1def05[_0xd173('0x1a')]?_0x1def05[_0xd173('0x1a')][_0xd173('0x1f')]?_[_0xd173('0x20')](_0x1def05['options'][_0xd173('0x1f')],function(_0x3b0855){return{'model':db[_0x3b0855[_0xd173('0x21')]],'as':_0x3b0855['as'],'attributes':_0x3b0855['attributes'],'include':_0x3b0855['include']?_[_0xd173('0x20')](_0x3b0855[_0xd173('0x1f')],function(_0x37ef2d){return{'model':db[_0x37ef2d['model']],'as':_0x37ef2d['as'],'attributes':_0x37ef2d[_0xd173('0x1d')],'include':_0x37ef2d[_0xd173('0x1f')]?_[_0xd173('0x20')](_0x37ef2d[_0xd173('0x1f')],function(_0x2ceec8){return{'model':db[_0x2ceec8['model']],'as':_0x2ceec8['as'],'attributes':_0x2ceec8[_0xd173('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19a966){logger[_0xd173('0xe')](_0xd173('0x22'),_0x1def05);logger['debug']('ShowChatQueue',_0x1def05,JSON[_0xd173('0x13')](_0x19a966));_0x4957d4(_0x19a966);})['catch'](function(_0x22808d){logger[_0xd173('0x14')]('ShowChatQueue',_0x22808d['message'],_0x1def05);_0x5f4ea4(_0x4dfcd8[_0xd173('0x14')](0x1f4,_0x22808d[_0xd173('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index cc415b9..dbe9649 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 _0xc368=['removeListener','register','length','chatQueue:','save','update','emit'];(function(_0x1d14a4,_0x3d0375){var _0x5cae92=function(_0x332f16){while(--_0x332f16){_0x1d14a4['push'](_0x1d14a4['shift']());}};_0x5cae92(++_0x3d0375);}(_0xc368,0x7b));var _0x8c36=function(_0x5717e6,_0x2428d5){_0x5717e6=_0x5717e6-0x0;var _0x19aeb2=_0xc368[_0x5717e6];return _0x19aeb2;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8c36('0x0'),'remove',_0x8c36('0x1')];function createListener(_0x17fa33,_0x20e697){return function(_0x2640c5){_0x20e697[_0x8c36('0x2')](_0x17fa33,_0x2640c5);};}function removeListener(_0x5d3b27,_0x3e9034){return function(){ChatQueueEvents[_0x8c36('0x3')](_0x5d3b27,_0x3e9034);};}exports[_0x8c36('0x4')]=function(_0x1d3660){for(var _0x5ebfc1=0x0,_0x554022=events[_0x8c36('0x5')];_0x5ebfc1<_0x554022;_0x5ebfc1++){var _0x384867=events[_0x5ebfc1];var _0x3e76be=createListener(_0x8c36('0x6')+_0x384867,_0x1d3660);ChatQueueEvents['on'](_0x384867,_0x3e76be);}};
\ No newline at end of file
+var _0xc3b5=['length','remove','update','emit','register'];(function(_0x462285,_0xf42831){var _0x891594=function(_0x2b525e){while(--_0x2b525e){_0x462285['push'](_0x462285['shift']());}};_0x891594(++_0xf42831);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x46afc4,_0x1d874f){_0x46afc4=_0x46afc4-0x0;var _0x295829=_0xc3b5[_0x46afc4];return _0x295829;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 0e02e88..6e0e42b 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x11f6a1,_0x4b3ec7){var _0x3df8a2=function(_0xdd0d48){while(--_0xdd0d48){_0x11f6a1['push'](_0x11f6a1['shift']());}};_0x3df8a2(++_0x4b3ec7);}(_0x55ca,0x126));var _0xa55c=function(_0x52e9e3,_0xe465a7){_0x52e9e3=_0x52e9e3-0x0;var _0x960a8d=_0x55ca[_0x52e9e3];return _0x960a8d;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5fc3,0xa8));var _0x35fc=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x5fc3[_0x237da8];return _0x558825;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 7494f32..4429b84 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 _0x2c79=['STRING','DATE','moment','sequelize'];(function(_0x2e5a67,_0x37dadb){var _0x1f37b9=function(_0x47a076){while(--_0x47a076){_0x2e5a67['push'](_0x2e5a67['shift']());}};_0x1f37b9(++_0x37dadb);}(_0x2c79,0x102));var _0x92c7=function(_0x5bfef4,_0x57e1aa){_0x5bfef4=_0x5bfef4-0x0;var _0x363045=_0x2c79[_0x5bfef4];return _0x363045;};'use strict';var moment=require(_0x92c7('0x0'));var Sequelize=require(_0x92c7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x92c7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x92c7('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x92c7('0x3')]},'acceptAt':{'type':Sequelize[_0x92c7('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x92c7('0x2')]}};
\ No newline at end of file
+var _0xb8ec=['STRING','DATE','moment'];(function(_0xd9e62f,_0x3e3c86){var _0x287092=function(_0x56de56){while(--_0x56de56){_0xd9e62f['push'](_0xd9e62f['shift']());}};_0x287092(++_0x3e3c86);}(_0xb8ec,0x98));var _0xcb8e=function(_0x1e0b6b,_0xf1071d){_0x1e0b6b=_0x1e0b6b-0x0;var _0x358b32=_0xb8ec[_0x1e0b6b];return _0x358b32;};'use strict';var moment=require(_0xcb8e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcb8e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xcb8e('0x1')]},'joinAt':{'type':Sequelize[_0xcb8e('0x2')]},'leaveAt':{'type':Sequelize[_0xcb8e('0x2')]},'acceptAt':{'type':Sequelize[_0xcb8e('0x2')]},'exitAt':{'type':Sequelize[_0xcb8e('0x2')]},'reason':{'type':Sequelize[_0xcb8e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 275f311..56b5a28 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 _0xfc91=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','include','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','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','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','model','query','keys','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc91,0xb5));var _0x1fc9=function(_0x3e7703,_0x4ead9a){_0x3e7703=_0x3e7703-0x0;var _0xf8c99a=_0xfc91[_0x3e7703];return _0xf8c99a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fc9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fc9('0x1'));var rp=require(_0x1fc9('0x2'));var moment=require(_0x1fc9('0x3'));var BPromise=require(_0x1fc9('0x4'));var Mustache=require(_0x1fc9('0x5'));var util=require(_0x1fc9('0x6'));var path=require(_0x1fc9('0x7'));var sox=require(_0x1fc9('0x8'));var csv=require(_0x1fc9('0x9'));var ejs=require(_0x1fc9('0xa'));var fs=require('fs');var fs_extra=require(_0x1fc9('0xb'));var _=require(_0x1fc9('0xc'));var squel=require('squel');var crypto=require(_0x1fc9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1fc9('0x9'));var querystring=require(_0x1fc9('0xe'));var Papa=require(_0x1fc9('0xf'));var Redis=require(_0x1fc9('0x10'));var authService=require(_0x1fc9('0x11'));var qs=require(_0x1fc9('0x12'));var as=require(_0x1fc9('0x13'));var hardwareService=require(_0x1fc9('0x14'));var logger=require(_0x1fc9('0x15'))(_0x1fc9('0x16'));var utils=require(_0x1fc9('0x17'));var config=require(_0x1fc9('0x18'));var licenseUtil=require(_0x1fc9('0x19'));var db=require(_0x1fc9('0x1a'))['db'];function respondWithStatusCode(_0x2ef956,_0x37629a){_0x37629a=_0x37629a||0xcc;return function(_0x32d8ab){if(_0x32d8ab){return _0x2ef956['sendStatus'](_0x37629a);}return _0x2ef956[_0x1fc9('0x1b')](_0x37629a)[_0x1fc9('0x1c')]();};}function respondWithResult(_0x47f51b,_0x47670a){_0x47670a=_0x47670a||0xc8;return function(_0x39fe61){if(_0x39fe61){return _0x47f51b[_0x1fc9('0x1b')](_0x47670a)[_0x1fc9('0x1d')](_0x39fe61);}};}function respondWithFilteredResult(_0x3e0c75,_0x373e71){return function(_0x5e4787){if(_0x5e4787){var _0x4e46b7=typeof _0x373e71[_0x1fc9('0x1e')]==='undefined'&&typeof _0x373e71[_0x1fc9('0x1f')]==='undefined';var _0x533635=_0x5e4787[_0x1fc9('0x20')];var _0x1d05ab=_0x4e46b7?0x0:_0x373e71[_0x1fc9('0x1e')];var _0x40efef=_0x4e46b7?_0x5e4787[_0x1fc9('0x20')]:_0x373e71[_0x1fc9('0x1e')]+_0x373e71[_0x1fc9('0x1f')];var _0x1392fa;if(_0x40efef>=_0x533635){_0x40efef=_0x533635;_0x1392fa=0xc8;}else{_0x1392fa=0xce;}_0x3e0c75[_0x1fc9('0x1b')](_0x1392fa);return _0x3e0c75[_0x1fc9('0x21')](_0x1fc9('0x22'),_0x1d05ab+'-'+_0x40efef+'/'+_0x533635)[_0x1fc9('0x1d')](_0x5e4787);}return null;};}function patchUpdates(_0x1ddde2){return function(_0x19d9bd){try{jsonpatch['apply'](_0x19d9bd,_0x1ddde2,!![]);}catch(_0x56a867){return BPromise[_0x1fc9('0x23')](_0x56a867);}return _0x19d9bd[_0x1fc9('0x24')]();};}function saveUpdates(_0x36123d,_0x56a342){return function(_0x524e1a){if(_0x524e1a){return _0x524e1a[_0x1fc9('0x25')](_0x36123d)['then'](function(_0x528aa5){return _0x528aa5;});}return null;};}function removeEntity(_0x5a73fd,_0x14c02c){return function(_0x58f4ec){if(_0x58f4ec){return _0x58f4ec[_0x1fc9('0x26')]()[_0x1fc9('0x27')](function(){_0x5a73fd['status'](0xcc)[_0x1fc9('0x1c')]();});}};}function handleEntityNotFound(_0x4f1598,_0x59c293){return function(_0x24cb50){if(!_0x24cb50){_0x4f1598[_0x1fc9('0x28')](0x194);}return _0x24cb50;};}function handleError(_0x2ae7e2,_0x29bf4){_0x29bf4=_0x29bf4||0x1f4;return function(_0x1dfbbc){logger['error'](_0x1dfbbc[_0x1fc9('0x29')]);if(_0x1dfbbc[_0x1fc9('0x2a')]){delete _0x1dfbbc['name'];}_0x2ae7e2[_0x1fc9('0x1b')](_0x29bf4)[_0x1fc9('0x2b')](_0x1dfbbc);};}exports[_0x1fc9('0x2c')]=function(_0x538d5f,_0x19a8e1){var _0x2aa669={},_0x19e270={},_0x31ba25={'count':0x0,'rows':[]};var _0x16f3a4=_[_0x1fc9('0x2d')](db[_0x1fc9('0x2e')][_0x1fc9('0x2f')],function(_0x5dfb6b){return{'name':_0x5dfb6b[_0x1fc9('0x30')],'type':_0x5dfb6b['type']['key']};});_0x19e270[_0x1fc9('0x31')]=_[_0x1fc9('0x2d')](_0x16f3a4,_0x1fc9('0x2a'));_0x19e270[_0x1fc9('0x32')]=_[_0x1fc9('0x33')](_0x538d5f[_0x1fc9('0x32')]);_0x19e270[_0x1fc9('0x34')]=_['intersection'](_0x19e270['model'],_0x19e270[_0x1fc9('0x32')]);_0x2aa669[_0x1fc9('0x35')]=_['intersection'](_0x19e270['model'],qs[_0x1fc9('0x36')](_0x538d5f['query'][_0x1fc9('0x36')]));_0x2aa669[_0x1fc9('0x35')]=_0x2aa669[_0x1fc9('0x35')][_0x1fc9('0x37')]?_0x2aa669[_0x1fc9('0x35')]:_0x19e270[_0x1fc9('0x31')];if(!_0x538d5f[_0x1fc9('0x32')][_0x1fc9('0x38')](_0x1fc9('0x39'))){_0x2aa669[_0x1fc9('0x1f')]=qs[_0x1fc9('0x1f')](_0x538d5f[_0x1fc9('0x32')][_0x1fc9('0x1f')]);_0x2aa669[_0x1fc9('0x1e')]=qs[_0x1fc9('0x1e')](_0x538d5f[_0x1fc9('0x32')][_0x1fc9('0x1e')]);}_0x2aa669[_0x1fc9('0x3a')]=qs['sort'](_0x538d5f[_0x1fc9('0x32')][_0x1fc9('0x3b')]);_0x2aa669[_0x1fc9('0x3c')]=qs[_0x1fc9('0x34')](_[_0x1fc9('0x3d')](_0x538d5f['query'],_0x19e270[_0x1fc9('0x34')]),_0x16f3a4);if(_0x538d5f[_0x1fc9('0x32')][_0x1fc9('0x3e')]){_0x2aa669[_0x1fc9('0x3c')]=_[_0x1fc9('0x3f')](_0x2aa669[_0x1fc9('0x3c')],{'$or':_[_0x1fc9('0x2d')](_0x16f3a4,function(_0x5886be){if(_0x5886be[_0x1fc9('0x40')]!==_0x1fc9('0x41')){var _0x43d7b9={};_0x43d7b9[_0x5886be['name']]={'$like':'%'+_0x538d5f[_0x1fc9('0x32')][_0x1fc9('0x3e')]+'%'};return _0x43d7b9;}})});}_0x2aa669=_[_0x1fc9('0x3f')]({},_0x2aa669,_0x538d5f[_0x1fc9('0x42')]);var _0x2fa2b0={'where':_0x2aa669[_0x1fc9('0x3c')]};return db[_0x1fc9('0x2e')][_0x1fc9('0x20')](_0x2fa2b0)[_0x1fc9('0x27')](function(_0x5623fb){_0x31ba25[_0x1fc9('0x20')]=_0x5623fb;if(_0x538d5f[_0x1fc9('0x32')][_0x1fc9('0x43')]){_0x2aa669['include']=[{'all':!![]}];}return db[_0x1fc9('0x2e')]['findAll'](_0x2aa669);})[_0x1fc9('0x27')](function(_0x4ee54b){_0x31ba25[_0x1fc9('0x44')]=_0x4ee54b;return _0x31ba25;})[_0x1fc9('0x27')](respondWithFilteredResult(_0x19a8e1,_0x2aa669))[_0x1fc9('0x45')](handleError(_0x19a8e1,null));};exports[_0x1fc9('0x46')]=function(_0x12e808,_0x153e62){var _0x366a91={'raw':!![],'where':{'id':_0x12e808[_0x1fc9('0x47')]['id']}},_0x54799d={};_0x54799d[_0x1fc9('0x31')]=_[_0x1fc9('0x33')](db[_0x1fc9('0x2e')][_0x1fc9('0x2f')]);_0x54799d[_0x1fc9('0x32')]=_[_0x1fc9('0x33')](_0x12e808[_0x1fc9('0x32')]);_0x54799d[_0x1fc9('0x34')]=_[_0x1fc9('0x48')](_0x54799d[_0x1fc9('0x31')],_0x54799d[_0x1fc9('0x32')]);_0x366a91[_0x1fc9('0x35')]=_[_0x1fc9('0x48')](_0x54799d[_0x1fc9('0x31')],qs[_0x1fc9('0x36')](_0x12e808[_0x1fc9('0x32')][_0x1fc9('0x36')]));_0x366a91[_0x1fc9('0x35')]=_0x366a91[_0x1fc9('0x35')][_0x1fc9('0x37')]?_0x366a91[_0x1fc9('0x35')]:_0x54799d[_0x1fc9('0x31')];if(_0x12e808[_0x1fc9('0x32')][_0x1fc9('0x43')]){_0x366a91[_0x1fc9('0x49')]=[{'all':!![]}];}_0x366a91=_['merge']({},_0x366a91,_0x12e808['options']);return db[_0x1fc9('0x2e')][_0x1fc9('0x4a')](_0x366a91)[_0x1fc9('0x27')](handleEntityNotFound(_0x153e62,null))[_0x1fc9('0x27')](respondWithResult(_0x153e62,null))[_0x1fc9('0x45')](handleError(_0x153e62,null));};exports[_0x1fc9('0x4b')]=function(_0x16835d,_0x3eeac5){return db[_0x1fc9('0x2e')][_0x1fc9('0x4b')](_0x16835d['body'],{})[_0x1fc9('0x27')](respondWithResult(_0x3eeac5,0xc9))['catch'](handleError(_0x3eeac5,null));};exports[_0x1fc9('0x25')]=function(_0x3cb02a,_0x14a8f0){if(_0x3cb02a[_0x1fc9('0x4c')]['id']){delete _0x3cb02a[_0x1fc9('0x4c')]['id'];}return db[_0x1fc9('0x2e')][_0x1fc9('0x4a')]({'where':{'id':_0x3cb02a[_0x1fc9('0x47')]['id']}})['then'](handleEntityNotFound(_0x14a8f0,null))[_0x1fc9('0x27')](saveUpdates(_0x3cb02a['body'],null))[_0x1fc9('0x27')](respondWithResult(_0x14a8f0,null))['catch'](handleError(_0x14a8f0,null));};exports[_0x1fc9('0x26')]=function(_0x106ce2,_0x22fe09){return db['ChatQueueReport'][_0x1fc9('0x4a')]({'where':{'id':_0x106ce2['params']['id']}})[_0x1fc9('0x27')](handleEntityNotFound(_0x22fe09,null))['then'](removeEntity(_0x22fe09,null))[_0x1fc9('0x45')](handleError(_0x22fe09,null));};exports[_0x1fc9('0x4d')]=function(_0x218a09,_0x4e65af){return db['ChatQueueReport'][_0x1fc9('0x4d')]()[_0x1fc9('0x27')](respondWithResult(_0x4e65af,null))[_0x1fc9('0x45')](handleError(_0x4e65af,null));};
\ No newline at end of file
+var _0x15ef=['util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','save','then','destroy','end','error','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','ChatQueueReport','include','findAll','catch','show','params','length','includeAll','options','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x4fc1f2,_0x5c2053){var _0x5e8663=function(_0x5b10ac){while(--_0x5b10ac){_0x4fc1f2['push'](_0x4fc1f2['shift']());}};_0x5e8663(++_0x5c2053);}(_0x15ef,0x80));var _0xf15e=function(_0x6f9f0f,_0xd54430){_0x6f9f0f=_0x6f9f0f-0x0;var _0x3cfc63=_0x15ef[_0x6f9f0f];return _0x3cfc63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf15e('0x0'));var zipdir=require(_0xf15e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf15e('0x2'));var moment=require(_0xf15e('0x3'));var BPromise=require(_0xf15e('0x4'));var Mustache=require(_0xf15e('0x5'));var util=require(_0xf15e('0x6'));var path=require('path');var sox=require(_0xf15e('0x7'));var csv=require(_0xf15e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf15e('0x9'));var squel=require(_0xf15e('0xa'));var crypto=require('crypto');var jsforce=require(_0xf15e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf15e('0x8'));var querystring=require(_0xf15e('0xc'));var Papa=require(_0xf15e('0xd'));var Redis=require(_0xf15e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf15e('0xf'));var logger=require(_0xf15e('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf15e('0x11'));var db=require(_0xf15e('0x12'))['db'];function respondWithStatusCode(_0x8551e2,_0x5809f7){_0x5809f7=_0x5809f7||0xcc;return function(_0x442d51){if(_0x442d51){return _0x8551e2[_0xf15e('0x13')](_0x5809f7);}return _0x8551e2[_0xf15e('0x14')](_0x5809f7)['end']();};}function respondWithResult(_0x1ec4ad,_0x1d76e9){_0x1d76e9=_0x1d76e9||0xc8;return function(_0x3e1b34){if(_0x3e1b34){return _0x1ec4ad[_0xf15e('0x14')](_0x1d76e9)[_0xf15e('0x15')](_0x3e1b34);}};}function respondWithFilteredResult(_0x1cbcc3,_0x17c241){return function(_0x2d6bd7){if(_0x2d6bd7){var _0x54b94c=typeof _0x17c241[_0xf15e('0x16')]===_0xf15e('0x17')&&typeof _0x17c241['limit']===_0xf15e('0x17');var _0x4356ca=_0x2d6bd7[_0xf15e('0x18')];var _0x487018=_0x54b94c?0x0:_0x17c241['offset'];var _0x3ad067=_0x54b94c?_0x2d6bd7[_0xf15e('0x18')]:_0x17c241['offset']+_0x17c241[_0xf15e('0x19')];var _0x1f1f33;if(_0x3ad067>=_0x4356ca){_0x3ad067=_0x4356ca;_0x1f1f33=0xc8;}else{_0x1f1f33=0xce;}_0x1cbcc3[_0xf15e('0x14')](_0x1f1f33);return _0x1cbcc3['set']('Content-Range',_0x487018+'-'+_0x3ad067+'/'+_0x4356ca)[_0xf15e('0x15')](_0x2d6bd7);}return null;};}function patchUpdates(_0x3fa737){return function(_0x499658){try{jsonpatch[_0xf15e('0x1a')](_0x499658,_0x3fa737,!![]);}catch(_0x56e8c9){return BPromise['reject'](_0x56e8c9);}return _0x499658[_0xf15e('0x1b')]();};}function saveUpdates(_0x239d41,_0x389489){return function(_0x9ece34){if(_0x9ece34){return _0x9ece34['update'](_0x239d41)[_0xf15e('0x1c')](function(_0xa09c0c){return _0xa09c0c;});}return null;};}function removeEntity(_0x302b70,_0x51c06a){return function(_0x248c4b){if(_0x248c4b){return _0x248c4b[_0xf15e('0x1d')]()['then'](function(){_0x302b70['status'](0xcc)[_0xf15e('0x1e')]();});}};}function handleEntityNotFound(_0xb36af,_0x1fd237){return function(_0x471079){if(!_0x471079){_0xb36af[_0xf15e('0x13')](0x194);}return _0x471079;};}function handleError(_0x58877f,_0x48764e){_0x48764e=_0x48764e||0x1f4;return function(_0x3f9d64){logger[_0xf15e('0x1f')](_0x3f9d64['stack']);if(_0x3f9d64[_0xf15e('0x20')]){delete _0x3f9d64[_0xf15e('0x20')];}_0x58877f[_0xf15e('0x14')](_0x48764e)[_0xf15e('0x21')](_0x3f9d64);};}exports[_0xf15e('0x22')]=function(_0xff4c07,_0x1e6a63){var _0x40321a={},_0x5dd9cf={},_0x3567d5={'count':0x0,'rows':[]};var _0x17f112=_[_0xf15e('0x23')](db['ChatQueueReport'][_0xf15e('0x24')],function(_0x203711){return{'name':_0x203711['fieldName'],'type':_0x203711[_0xf15e('0x25')][_0xf15e('0x26')]};});_0x5dd9cf[_0xf15e('0x27')]=_['map'](_0x17f112,_0xf15e('0x20'));_0x5dd9cf[_0xf15e('0x28')]=_[_0xf15e('0x29')](_0xff4c07[_0xf15e('0x28')]);_0x5dd9cf['filters']=_[_0xf15e('0x2a')](_0x5dd9cf[_0xf15e('0x27')],_0x5dd9cf['query']);_0x40321a[_0xf15e('0x2b')]=_[_0xf15e('0x2a')](_0x5dd9cf[_0xf15e('0x27')],qs['fields'](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x2c')]));_0x40321a['attributes']=_0x40321a[_0xf15e('0x2b')]['length']?_0x40321a[_0xf15e('0x2b')]:_0x5dd9cf[_0xf15e('0x27')];if(!_0xff4c07['query']['hasOwnProperty'](_0xf15e('0x2d'))){_0x40321a[_0xf15e('0x19')]=qs['limit'](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x19')]);_0x40321a[_0xf15e('0x16')]=qs[_0xf15e('0x16')](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x16')]);}_0x40321a['order']=qs[_0xf15e('0x2e')](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x2e')]);_0x40321a[_0xf15e('0x2f')]=qs[_0xf15e('0x30')](_[_0xf15e('0x31')](_0xff4c07[_0xf15e('0x28')],_0x5dd9cf[_0xf15e('0x30')]),_0x17f112);if(_0xff4c07['query'][_0xf15e('0x32')]){_0x40321a['where']=_[_0xf15e('0x33')](_0x40321a[_0xf15e('0x2f')],{'$or':_[_0xf15e('0x23')](_0x17f112,function(_0x40e707){if(_0x40e707[_0xf15e('0x25')]!==_0xf15e('0x34')){var _0x4d411f={};_0x4d411f[_0x40e707[_0xf15e('0x20')]]={'$like':'%'+_0xff4c07[_0xf15e('0x28')][_0xf15e('0x32')]+'%'};return _0x4d411f;}})});}_0x40321a=_[_0xf15e('0x33')]({},_0x40321a,_0xff4c07['options']);var _0x52ebab={'where':_0x40321a[_0xf15e('0x2f')]};return db[_0xf15e('0x35')][_0xf15e('0x18')](_0x52ebab)['then'](function(_0x514c68){_0x3567d5['count']=_0x514c68;if(_0xff4c07['query']['includeAll']){_0x40321a[_0xf15e('0x36')]=[{'all':!![]}];}return db[_0xf15e('0x35')][_0xf15e('0x37')](_0x40321a);})['then'](function(_0x3a56bd){_0x3567d5['rows']=_0x3a56bd;return _0x3567d5;})[_0xf15e('0x1c')](respondWithFilteredResult(_0x1e6a63,_0x40321a))[_0xf15e('0x38')](handleError(_0x1e6a63,null));};exports[_0xf15e('0x39')]=function(_0x180d7a,_0x52bbc4){var _0xf32fc5={'raw':!![],'where':{'id':_0x180d7a[_0xf15e('0x3a')]['id']}},_0x37f0a6={};_0x37f0a6[_0xf15e('0x27')]=_[_0xf15e('0x29')](db['ChatQueueReport'][_0xf15e('0x24')]);_0x37f0a6[_0xf15e('0x28')]=_[_0xf15e('0x29')](_0x180d7a[_0xf15e('0x28')]);_0x37f0a6[_0xf15e('0x30')]=_[_0xf15e('0x2a')](_0x37f0a6[_0xf15e('0x27')],_0x37f0a6['query']);_0xf32fc5[_0xf15e('0x2b')]=_[_0xf15e('0x2a')](_0x37f0a6['model'],qs['fields'](_0x180d7a[_0xf15e('0x28')]['fields']));_0xf32fc5['attributes']=_0xf32fc5[_0xf15e('0x2b')][_0xf15e('0x3b')]?_0xf32fc5['attributes']:_0x37f0a6[_0xf15e('0x27')];if(_0x180d7a[_0xf15e('0x28')][_0xf15e('0x3c')]){_0xf32fc5[_0xf15e('0x36')]=[{'all':!![]}];}_0xf32fc5=_[_0xf15e('0x33')]({},_0xf32fc5,_0x180d7a[_0xf15e('0x3d')]);return db[_0xf15e('0x35')][_0xf15e('0x3e')](_0xf32fc5)[_0xf15e('0x1c')](handleEntityNotFound(_0x52bbc4,null))['then'](respondWithResult(_0x52bbc4,null))[_0xf15e('0x38')](handleError(_0x52bbc4,null));};exports[_0xf15e('0x3f')]=function(_0x3b79a8,_0x5b31c9){return db['ChatQueueReport'][_0xf15e('0x3f')](_0x3b79a8[_0xf15e('0x40')],{})[_0xf15e('0x1c')](respondWithResult(_0x5b31c9,0xc9))[_0xf15e('0x38')](handleError(_0x5b31c9,null));};exports[_0xf15e('0x41')]=function(_0xac7515,_0x3b5c7b){if(_0xac7515[_0xf15e('0x40')]['id']){delete _0xac7515['body']['id'];}return db[_0xf15e('0x35')][_0xf15e('0x3e')]({'where':{'id':_0xac7515['params']['id']}})[_0xf15e('0x1c')](handleEntityNotFound(_0x3b5c7b,null))['then'](saveUpdates(_0xac7515[_0xf15e('0x40')],null))[_0xf15e('0x1c')](respondWithResult(_0x3b5c7b,null))[_0xf15e('0x38')](handleError(_0x3b5c7b,null));};exports['destroy']=function(_0x46e6e9,_0x3e2fd6){return db[_0xf15e('0x35')][_0xf15e('0x3e')]({'where':{'id':_0x46e6e9[_0xf15e('0x3a')]['id']}})[_0xf15e('0x1c')](handleEntityNotFound(_0x3e2fd6,null))[_0xf15e('0x1c')](removeEntity(_0x3e2fd6,null))[_0xf15e('0x38')](handleError(_0x3e2fd6,null));};exports[_0xf15e('0x42')]=function(_0x4fd54b,_0x5471d8){return db[_0xf15e('0x35')][_0xf15e('0x42')]()[_0xf15e('0x1c')](respondWithResult(_0x5471d8,null))[_0xf15e('0x38')](handleError(_0x5471d8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index d3d4d90..07b7635 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2368ee,_0x598759){var _0x17cbc1=function(_0x187bfc){while(--_0x187bfc){_0x2368ee['push'](_0x2368ee['shift']());}};_0x17cbc1(++_0x598759);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0xcb91[_0x3792e6];return _0x441e44;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index e3ab7d2..00d51a2 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 _0x3ef0=['create','options','raw','then','CreateChatQueueReport','stringify','UpdateChatQueueReport','body','where','attributes','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatQueueReport'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x3ef0,0x141));var _0x03ef=function(_0x2a64b2,_0x4d447a){_0x2a64b2=_0x2a64b2-0x0;var _0x2db167=_0x3ef0[_0x2a64b2];return _0x2db167;};'use strict';var _=require(_0x03ef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03ef('0x1'));var fs=require('fs');var Redis=require(_0x03ef('0x2'));var db=require(_0x03ef('0x3'))['db'];var utils=require(_0x03ef('0x4'));var logger=require(_0x03ef('0x5'))(_0x03ef('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x03ef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe25a18,_0x5bcb91,_0x2fdb92){return new BPromise(function(_0x59ea1e,_0x1c328f){return client[_0x03ef('0x8')](_0xe25a18,_0x2fdb92)['then'](function(_0x579304){logger[_0x03ef('0x9')](_0x03ef('0xa'),_0x5bcb91,_0x03ef('0xb'));logger[_0x03ef('0xc')](_0x03ef('0xd'),_0x5bcb91,_0x03ef('0xb'),JSON['stringify'](_0x579304));if(_0x579304[_0x03ef('0xe')]){if(_0x579304['error'][_0x03ef('0xf')]===0x1f4){logger[_0x03ef('0xe')](_0x03ef('0xa'),_0x5bcb91,_0x579304[_0x03ef('0xe')][_0x03ef('0x10')]);return _0x1c328f(_0x579304[_0x03ef('0xe')][_0x03ef('0x10')]);}logger[_0x03ef('0xe')](_0x03ef('0xa'),_0x5bcb91,_0x579304['error'][_0x03ef('0x10')]);return _0x59ea1e(_0x579304[_0x03ef('0xe')][_0x03ef('0x10')]);}else{logger[_0x03ef('0x9')](_0x03ef('0xa'),_0x5bcb91,_0x03ef('0xb'));_0x59ea1e(_0x579304[_0x03ef('0x11')][_0x03ef('0x10')]);}})[_0x03ef('0x12')](function(_0x311bb1){logger[_0x03ef('0xe')](_0x03ef('0xa'),_0x5bcb91,_0x311bb1);_0x1c328f(_0x311bb1);});});}exports['CreateChatQueueReport']=function(_0x120317){var _0x51fd1b=this;return new Promise(function(_0x4d4d70,_0x4cb597){return db[_0x03ef('0x13')][_0x03ef('0x14')](_0x120317['body'],{'raw':_0x120317['options']?_0x120317[_0x03ef('0x15')][_0x03ef('0x16')]===undefined?!![]:![]:!![]})[_0x03ef('0x17')](function(_0x2efdf7){logger[_0x03ef('0x9')](_0x03ef('0x18'),_0x120317);logger[_0x03ef('0xc')](_0x03ef('0x18'),_0x120317,JSON[_0x03ef('0x19')](_0x2efdf7));_0x4d4d70(_0x2efdf7);})[_0x03ef('0x12')](function(_0x121768){logger[_0x03ef('0xe')](_0x03ef('0x18'),_0x121768[_0x03ef('0x10')],_0x120317);_0x4cb597(_0x51fd1b[_0x03ef('0xe')](0x1f4,_0x121768[_0x03ef('0x10')]));});});};exports[_0x03ef('0x1a')]=function(_0x5796c8){var _0x5e85c6=this;return new Promise(function(_0x1f72c4,_0xb5d2f){return db[_0x03ef('0x13')]['update'](_0x5796c8[_0x03ef('0x1b')],{'raw':_0x5796c8['options']?_0x5796c8[_0x03ef('0x15')][_0x03ef('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5796c8['options']?_0x5796c8[_0x03ef('0x15')][_0x03ef('0x1c')]||null:null,'attributes':_0x5796c8['options']?_0x5796c8[_0x03ef('0x15')][_0x03ef('0x1d')]||null:null,'limit':_0x5796c8[_0x03ef('0x15')]?_0x5796c8[_0x03ef('0x15')][_0x03ef('0x1e')]||null:null})[_0x03ef('0x17')](function(_0x559b5b){logger['info'](_0x03ef('0x1a'),_0x5796c8);logger[_0x03ef('0xc')](_0x03ef('0x1a'),_0x5796c8,JSON[_0x03ef('0x19')](_0x559b5b));_0x1f72c4(_0x559b5b);})['catch'](function(_0xe77790){logger['error'](_0x03ef('0x1a'),_0xe77790[_0x03ef('0x10')],_0x5796c8);_0xb5d2f(_0x5e85c6[_0x03ef('0xe')](0x1f4,_0xe77790['message']));});});};
\ No newline at end of file
+var _0xd501=['request\x20sent','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0xd501,0x135));var _0x1d50=function(_0xd6204,_0x5c578c){_0xd6204=_0xd6204-0x0;var _0x205fe9=_0xd501[_0xd6204];return _0x205fe9;};'use strict';var _=require(_0x1d50('0x0'));var util=require(_0x1d50('0x1'));var moment=require(_0x1d50('0x2'));var BPromise=require(_0x1d50('0x3'));var rs=require(_0x1d50('0x4'));var fs=require('fs');var Redis=require(_0x1d50('0x5'));var db=require(_0x1d50('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d50('0x7'))(_0x1d50('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d50('0x9')][_0x1d50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x472295,_0x4e31be,_0x34ba42){return new BPromise(function(_0x34cfc7,_0x447527){return client[_0x1d50('0xb')](_0x472295,_0x34ba42)[_0x1d50('0xc')](function(_0x52e8a4){logger[_0x1d50('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x4e31be,'request\x20sent');logger[_0x1d50('0xe')](_0x1d50('0xf'),_0x4e31be,'request\x20sent',JSON[_0x1d50('0x10')](_0x52e8a4));if(_0x52e8a4[_0x1d50('0x11')]){if(_0x52e8a4[_0x1d50('0x11')][_0x1d50('0x12')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x4e31be,_0x52e8a4[_0x1d50('0x11')][_0x1d50('0x13')]);return _0x447527(_0x52e8a4[_0x1d50('0x11')][_0x1d50('0x13')]);}logger[_0x1d50('0x11')](_0x1d50('0x14'),_0x4e31be,_0x52e8a4[_0x1d50('0x11')][_0x1d50('0x13')]);return _0x34cfc7(_0x52e8a4[_0x1d50('0x11')]['message']);}else{logger[_0x1d50('0xd')](_0x1d50('0x14'),_0x4e31be,_0x1d50('0x15'));_0x34cfc7(_0x52e8a4[_0x1d50('0x16')]['message']);}})['catch'](function(_0x3ed906){logger[_0x1d50('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4e31be,_0x3ed906);_0x447527(_0x3ed906);});});}exports[_0x1d50('0x17')]=function(_0x4bd9ea){var _0x35f3a1=this;return new Promise(function(_0x1f3328,_0x202b9f){return db[_0x1d50('0x18')][_0x1d50('0x19')](_0x4bd9ea[_0x1d50('0x1a')],{'raw':_0x4bd9ea[_0x1d50('0x1b')]?_0x4bd9ea[_0x1d50('0x1b')][_0x1d50('0x1c')]===undefined?!![]:![]:!![]})[_0x1d50('0xc')](function(_0x509d7f){logger[_0x1d50('0xd')](_0x1d50('0x17'),_0x4bd9ea);logger[_0x1d50('0xe')](_0x1d50('0x17'),_0x4bd9ea,JSON['stringify'](_0x509d7f));_0x1f3328(_0x509d7f);})[_0x1d50('0x1d')](function(_0x4f879f){logger[_0x1d50('0x11')]('CreateChatQueueReport',_0x4f879f[_0x1d50('0x13')],_0x4bd9ea);_0x202b9f(_0x35f3a1[_0x1d50('0x11')](0x1f4,_0x4f879f[_0x1d50('0x13')]));});});};exports[_0x1d50('0x1e')]=function(_0x4b50e1){var _0x439975=this;return new Promise(function(_0x2f57f0,_0xec26ab){return db[_0x1d50('0x18')][_0x1d50('0x1f')](_0x4b50e1[_0x1d50('0x1a')],{'raw':_0x4b50e1[_0x1d50('0x1b')]?_0x4b50e1[_0x1d50('0x1b')][_0x1d50('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b50e1['options']?_0x4b50e1[_0x1d50('0x1b')][_0x1d50('0x20')]||null:null,'attributes':_0x4b50e1['options']?_0x4b50e1[_0x1d50('0x1b')]['attributes']||null:null,'limit':_0x4b50e1[_0x1d50('0x1b')]?_0x4b50e1['options']['limit']||null:null})[_0x1d50('0xc')](function(_0x4ad732){logger[_0x1d50('0xd')]('UpdateChatQueueReport',_0x4b50e1);logger[_0x1d50('0xe')](_0x1d50('0x1e'),_0x4b50e1,JSON[_0x1d50('0x10')](_0x4ad732));_0x2f57f0(_0x4ad732);})[_0x1d50('0x1d')](function(_0x5e2e3f){logger['error'](_0x1d50('0x1e'),_0x5e2e3f['message'],_0x4b50e1);_0xec26ab(_0x439975[_0x1d50('0x11')](0x1f4,_0x5e2e3f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 0f889e1..aac9d7a 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 _0x3595=['show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x3595,0x1d7));var _0x5359=function(_0x4a0e57,_0x54c11e){_0x4a0e57=_0x4a0e57-0x0;var _0x4d8fc1=_0x3595[_0x4a0e57];return _0x4d8fc1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5359('0x0'));var timeout=require(_0x5359('0x1'));var express=require(_0x5359('0x2'));var router=express[_0x5359('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5359('0x4'));var interaction=require(_0x5359('0x5'));var config=require(_0x5359('0x6'));var controller=require(_0x5359('0x7'));router[_0x5359('0x8')]('/',auth[_0x5359('0x9')](),controller[_0x5359('0xa')]);router['get']('/describe',auth[_0x5359('0x9')](),controller[_0x5359('0xb')]);router['get']('/:id',auth[_0x5359('0x9')](),controller[_0x5359('0xc')]);router[_0x5359('0xd')]('/',auth[_0x5359('0x9')](),controller[_0x5359('0xe')]);router[_0x5359('0xf')](_0x5359('0x10'),auth[_0x5359('0x9')](),controller[_0x5359('0x11')]);router[_0x5359('0x12')](_0x5359('0x10'),auth['isAuthenticated'](),controller[_0x5359('0x13')]);module[_0x5359('0x14')]=router;
\ No newline at end of file
+var _0x6206=['get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','./chatQueueReport.controller'];(function(_0x2c0544,_0x122cad){var _0x158533=function(_0x1ce473){while(--_0x1ce473){_0x2c0544['push'](_0x2c0544['shift']());}};_0x158533(++_0x122cad);}(_0x6206,0x129));var _0x6620=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x6206[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0x6620('0x0'));var util=require(_0x6620('0x1'));var path=require(_0x6620('0x2'));var timeout=require('connect-timeout');var express=require(_0x6620('0x3'));var router=express['Router']();var fs_extra=require(_0x6620('0x4'));var auth=require(_0x6620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6620('0x6'));router[_0x6620('0x7')]('/',auth[_0x6620('0x8')](),controller[_0x6620('0x9')]);router[_0x6620('0x7')]('/describe',auth[_0x6620('0x8')](),controller[_0x6620('0xa')]);router[_0x6620('0x7')](_0x6620('0xb'),auth['isAuthenticated'](),controller[_0x6620('0xc')]);router[_0x6620('0xd')]('/',auth[_0x6620('0x8')](),controller[_0x6620('0xe')]);router[_0x6620('0xf')](_0x6620('0xb'),auth['isAuthenticated'](),controller[_0x6620('0x10')]);router[_0x6620('0x11')](_0x6620('0xb'),auth[_0x6620('0x8')](),controller[_0x6620('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index ce1bb66..0b74648 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x544e7f,_0x4afcfe){var _0x4b23a0=function(_0x174c4c){while(--_0x174c4c){_0x544e7f['push'](_0x544e7f['shift']());}};_0x4b23a0(++_0x4afcfe);}(_0xedd9,0xfc));var _0x9edd=function(_0x547741,_0x41a203){_0x547741=_0x547741-0x0;var _0x50cd44=_0xedd9[_0x547741];return _0x50cd44;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4da9f1,_0x32ba93){var _0x501038=function(_0x4bb076){while(--_0x4bb076){_0x4da9f1['push'](_0x4da9f1['shift']());}};_0x501038(++_0x32ba93);}(_0xaa88,0x137));var _0x8aa8=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0xaa88[_0x58d5ac];return _0x37985c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 7f42610..8a48815 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 _0xf8de=['key','model','keys','query','filters','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','fields','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatTransferReport','fieldName'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0xf8de,0x199));var _0xef8d=function(_0x282700,_0x147045){_0x282700=_0x282700-0x0;var _0x326e2a=_0xf8de[_0x282700];return _0x326e2a;};'use strict';var emlformat=require(_0xef8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef8d('0x1'));var jsonpatch=require(_0xef8d('0x2'));var rp=require(_0xef8d('0x3'));var moment=require(_0xef8d('0x4'));var BPromise=require(_0xef8d('0x5'));var Mustache=require(_0xef8d('0x6'));var util=require(_0xef8d('0x7'));var path=require(_0xef8d('0x8'));var sox=require(_0xef8d('0x9'));var csv=require(_0xef8d('0xa'));var ejs=require(_0xef8d('0xb'));var fs=require('fs');var fs_extra=require(_0xef8d('0xc'));var _=require(_0xef8d('0xd'));var squel=require(_0xef8d('0xe'));var crypto=require('crypto');var jsforce=require(_0xef8d('0xf'));var deskjs=require(_0xef8d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xef8d('0x11'));var Papa=require(_0xef8d('0x12'));var Redis=require(_0xef8d('0x13'));var authService=require(_0xef8d('0x14'));var qs=require(_0xef8d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef8d('0x16'));var utils=require(_0xef8d('0x17'));var config=require(_0xef8d('0x18'));var licenseUtil=require(_0xef8d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x197ea1,_0x3278f0){_0x3278f0=_0x3278f0||0xcc;return function(_0x209347){if(_0x209347){return _0x197ea1['sendStatus'](_0x3278f0);}return _0x197ea1[_0xef8d('0x1a')](_0x3278f0)[_0xef8d('0x1b')]();};}function respondWithResult(_0x1fa744,_0x2f5e84){_0x2f5e84=_0x2f5e84||0xc8;return function(_0x133c70){if(_0x133c70){return _0x1fa744[_0xef8d('0x1a')](_0x2f5e84)[_0xef8d('0x1c')](_0x133c70);}};}function respondWithFilteredResult(_0x34246a,_0x3b8e99){return function(_0x2501f7){if(_0x2501f7){var _0x263471=typeof _0x3b8e99[_0xef8d('0x1d')]===_0xef8d('0x1e')&&typeof _0x3b8e99[_0xef8d('0x1f')]===_0xef8d('0x1e');var _0x1d2eac=_0x2501f7[_0xef8d('0x20')];var _0xa785ad=_0x263471?0x0:_0x3b8e99[_0xef8d('0x1d')];var _0x107a0c=_0x263471?_0x2501f7[_0xef8d('0x20')]:_0x3b8e99[_0xef8d('0x1d')]+_0x3b8e99[_0xef8d('0x1f')];var _0xdcf696;if(_0x107a0c>=_0x1d2eac){_0x107a0c=_0x1d2eac;_0xdcf696=0xc8;}else{_0xdcf696=0xce;}_0x34246a['status'](_0xdcf696);return _0x34246a[_0xef8d('0x21')](_0xef8d('0x22'),_0xa785ad+'-'+_0x107a0c+'/'+_0x1d2eac)[_0xef8d('0x1c')](_0x2501f7);}return null;};}function patchUpdates(_0x40968f){return function(_0x4fa9f4){try{jsonpatch['apply'](_0x4fa9f4,_0x40968f,!![]);}catch(_0x413d7f){return BPromise[_0xef8d('0x23')](_0x413d7f);}return _0x4fa9f4['save']();};}function saveUpdates(_0x5eba5e,_0x4f80de){return function(_0x57b721){if(_0x57b721){return _0x57b721[_0xef8d('0x24')](_0x5eba5e)[_0xef8d('0x25')](function(_0x442ef3){return _0x442ef3;});}return null;};}function removeEntity(_0x319d63,_0x5b3755){return function(_0x23ee4b){if(_0x23ee4b){return _0x23ee4b['destroy']()['then'](function(){_0x319d63['status'](0xcc)[_0xef8d('0x1b')]();});}};}function handleEntityNotFound(_0x5511cc,_0x1d388c){return function(_0x4411c5){if(!_0x4411c5){_0x5511cc[_0xef8d('0x26')](0x194);}return _0x4411c5;};}function handleError(_0x1680f7,_0x9b93f1){_0x9b93f1=_0x9b93f1||0x1f4;return function(_0x533998){logger[_0xef8d('0x27')](_0x533998[_0xef8d('0x28')]);if(_0x533998[_0xef8d('0x29')]){delete _0x533998[_0xef8d('0x29')];}_0x1680f7[_0xef8d('0x1a')](_0x9b93f1)[_0xef8d('0x2a')](_0x533998);};}exports[_0xef8d('0x2b')]=function(_0x2c1854,_0x46d7b3){var _0x5e8804={},_0x3f9b01={},_0x2c8ba5={'count':0x0,'rows':[]};var _0x28c5df=_[_0xef8d('0x2c')](db[_0xef8d('0x2d')]['rawAttributes'],function(_0x2bfefe){return{'name':_0x2bfefe[_0xef8d('0x2e')],'type':_0x2bfefe['type'][_0xef8d('0x2f')]};});_0x3f9b01[_0xef8d('0x30')]=_[_0xef8d('0x2c')](_0x28c5df,_0xef8d('0x29'));_0x3f9b01['query']=_[_0xef8d('0x31')](_0x2c1854[_0xef8d('0x32')]);_0x3f9b01[_0xef8d('0x33')]=_['intersection'](_0x3f9b01[_0xef8d('0x30')],_0x3f9b01['query']);_0x5e8804['attributes']=_['intersection'](_0x3f9b01[_0xef8d('0x30')],qs['fields'](_0x2c1854['query']['fields']));_0x5e8804['attributes']=_0x5e8804['attributes']['length']?_0x5e8804[_0xef8d('0x34')]:_0x3f9b01[_0xef8d('0x30')];if(!_0x2c1854[_0xef8d('0x32')][_0xef8d('0x35')](_0xef8d('0x36'))){_0x5e8804[_0xef8d('0x1f')]=qs[_0xef8d('0x1f')](_0x2c1854[_0xef8d('0x32')][_0xef8d('0x1f')]);_0x5e8804['offset']=qs[_0xef8d('0x1d')](_0x2c1854[_0xef8d('0x32')][_0xef8d('0x1d')]);}_0x5e8804[_0xef8d('0x37')]=qs[_0xef8d('0x38')](_0x2c1854[_0xef8d('0x32')][_0xef8d('0x38')]);_0x5e8804[_0xef8d('0x39')]=qs[_0xef8d('0x33')](_[_0xef8d('0x3a')](_0x2c1854[_0xef8d('0x32')],_0x3f9b01['filters']),_0x28c5df);if(_0x2c1854[_0xef8d('0x32')][_0xef8d('0x3b')]){_0x5e8804['where']=_[_0xef8d('0x3c')](_0x5e8804[_0xef8d('0x39')],{'$or':_[_0xef8d('0x2c')](_0x28c5df,function(_0x1dd7ed){if(_0x1dd7ed[_0xef8d('0x3d')]!=='VIRTUAL'){var _0x5b06f0={};_0x5b06f0[_0x1dd7ed[_0xef8d('0x29')]]={'$like':'%'+_0x2c1854['query'][_0xef8d('0x3b')]+'%'};return _0x5b06f0;}})});}_0x5e8804=_[_0xef8d('0x3c')]({},_0x5e8804,_0x2c1854[_0xef8d('0x3e')]);var _0x2fa95b={'where':_0x5e8804[_0xef8d('0x39')]};return db[_0xef8d('0x2d')][_0xef8d('0x20')](_0x2fa95b)['then'](function(_0x4a71f0){_0x2c8ba5[_0xef8d('0x20')]=_0x4a71f0;if(_0x2c1854[_0xef8d('0x32')][_0xef8d('0x3f')]){_0x5e8804['include']=[{'all':!![]}];}return db[_0xef8d('0x2d')][_0xef8d('0x40')](_0x5e8804);})[_0xef8d('0x25')](function(_0x562d30){_0x2c8ba5[_0xef8d('0x41')]=_0x562d30;return _0x2c8ba5;})['then'](respondWithFilteredResult(_0x46d7b3,_0x5e8804))[_0xef8d('0x42')](handleError(_0x46d7b3,null));};exports['show']=function(_0x1f6572,_0x2398f9){var _0x26a0b5={'raw':!![],'where':{'id':_0x1f6572[_0xef8d('0x43')]['id']}},_0x2ccd78={};_0x2ccd78[_0xef8d('0x30')]=_['keys'](db[_0xef8d('0x2d')][_0xef8d('0x44')]);_0x2ccd78[_0xef8d('0x32')]=_[_0xef8d('0x31')](_0x1f6572[_0xef8d('0x32')]);_0x2ccd78[_0xef8d('0x33')]=_[_0xef8d('0x45')](_0x2ccd78[_0xef8d('0x30')],_0x2ccd78[_0xef8d('0x32')]);_0x26a0b5['attributes']=_[_0xef8d('0x45')](_0x2ccd78[_0xef8d('0x30')],qs[_0xef8d('0x46')](_0x1f6572[_0xef8d('0x32')][_0xef8d('0x46')]));_0x26a0b5[_0xef8d('0x34')]=_0x26a0b5[_0xef8d('0x34')]['length']?_0x26a0b5['attributes']:_0x2ccd78[_0xef8d('0x30')];if(_0x1f6572[_0xef8d('0x32')]['includeAll']){_0x26a0b5[_0xef8d('0x47')]=[{'all':!![]}];}_0x26a0b5=_[_0xef8d('0x3c')]({},_0x26a0b5,_0x1f6572[_0xef8d('0x3e')]);return db['ChatTransferReport'][_0xef8d('0x48')](_0x26a0b5)[_0xef8d('0x25')](handleEntityNotFound(_0x2398f9,null))['then'](respondWithResult(_0x2398f9,null))[_0xef8d('0x42')](handleError(_0x2398f9,null));};exports['create']=function(_0x4f9985,_0x4ac873){return db[_0xef8d('0x2d')][_0xef8d('0x49')](_0x4f9985[_0xef8d('0x4a')],{})[_0xef8d('0x25')](respondWithResult(_0x4ac873,0xc9))[_0xef8d('0x42')](handleError(_0x4ac873,null));};exports[_0xef8d('0x24')]=function(_0x15251d,_0xbc394e){if(_0x15251d[_0xef8d('0x4a')]['id']){delete _0x15251d[_0xef8d('0x4a')]['id'];}return db[_0xef8d('0x2d')][_0xef8d('0x48')]({'where':{'id':_0x15251d[_0xef8d('0x43')]['id']}})[_0xef8d('0x25')](handleEntityNotFound(_0xbc394e,null))[_0xef8d('0x25')](saveUpdates(_0x15251d[_0xef8d('0x4a')],null))['then'](respondWithResult(_0xbc394e,null))['catch'](handleError(_0xbc394e,null));};exports['destroy']=function(_0x247395,_0x69851c){return db['ChatTransferReport'][_0xef8d('0x48')]({'where':{'id':_0x247395[_0xef8d('0x43')]['id']}})[_0xef8d('0x25')](handleEntityNotFound(_0x69851c,null))[_0xef8d('0x25')](removeEntity(_0x69851c,null))[_0xef8d('0x42')](handleError(_0x69851c,null));};exports[_0xef8d('0x4b')]=function(_0x24339c,_0x5aa865){return db['ChatTransferReport'][_0xef8d('0x4b')]()[_0xef8d('0x25')](respondWithResult(_0x5aa865,null))[_0xef8d('0x42')](handleError(_0x5aa865,null));};
\ No newline at end of file
+var _0x8c54=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','merge','options','find'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8c54,0xe1));var _0x48c5=function(_0x3982da,_0x2b143c){_0x3982da=_0x3982da-0x0;var _0xa88562=_0x8c54[_0x3982da];return _0xa88562;};'use strict';var emlformat=require(_0x48c5('0x0'));var rimraf=require(_0x48c5('0x1'));var zipdir=require(_0x48c5('0x2'));var jsonpatch=require(_0x48c5('0x3'));var rp=require(_0x48c5('0x4'));var moment=require('moment');var BPromise=require(_0x48c5('0x5'));var Mustache=require(_0x48c5('0x6'));var util=require(_0x48c5('0x7'));var path=require(_0x48c5('0x8'));var sox=require(_0x48c5('0x9'));var csv=require(_0x48c5('0xa'));var ejs=require(_0x48c5('0xb'));var fs=require('fs');var fs_extra=require(_0x48c5('0xc'));var _=require(_0x48c5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x48c5('0xa'));var querystring=require(_0x48c5('0xe'));var Papa=require('papaparse');var Redis=require(_0x48c5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x48c5('0x10'));var as=require(_0x48c5('0x11'));var hardwareService=require(_0x48c5('0x12'));var logger=require(_0x48c5('0x13'))(_0x48c5('0x14'));var utils=require('../../config/utils');var config=require(_0x48c5('0x15'));var licenseUtil=require(_0x48c5('0x16'));var db=require(_0x48c5('0x17'))['db'];function respondWithStatusCode(_0x3d04b2,_0x1c4d7c){_0x1c4d7c=_0x1c4d7c||0xcc;return function(_0x561214){if(_0x561214){return _0x3d04b2[_0x48c5('0x18')](_0x1c4d7c);}return _0x3d04b2[_0x48c5('0x19')](_0x1c4d7c)[_0x48c5('0x1a')]();};}function respondWithResult(_0x38e9bb,_0x1ac224){_0x1ac224=_0x1ac224||0xc8;return function(_0x17751a){if(_0x17751a){return _0x38e9bb[_0x48c5('0x19')](_0x1ac224)[_0x48c5('0x1b')](_0x17751a);}};}function respondWithFilteredResult(_0x5789bf,_0x1d8d58){return function(_0x14fe13){if(_0x14fe13){var _0x26a0d2=typeof _0x1d8d58[_0x48c5('0x1c')]===_0x48c5('0x1d')&&typeof _0x1d8d58[_0x48c5('0x1e')]===_0x48c5('0x1d');var _0x35648f=_0x14fe13[_0x48c5('0x1f')];var _0x6c1846=_0x26a0d2?0x0:_0x1d8d58[_0x48c5('0x1c')];var _0x1616a1=_0x26a0d2?_0x14fe13[_0x48c5('0x1f')]:_0x1d8d58['offset']+_0x1d8d58[_0x48c5('0x1e')];var _0x327782;if(_0x1616a1>=_0x35648f){_0x1616a1=_0x35648f;_0x327782=0xc8;}else{_0x327782=0xce;}_0x5789bf['status'](_0x327782);return _0x5789bf[_0x48c5('0x20')](_0x48c5('0x21'),_0x6c1846+'-'+_0x1616a1+'/'+_0x35648f)[_0x48c5('0x1b')](_0x14fe13);}return null;};}function patchUpdates(_0xcc4b7a){return function(_0x2a5d2e){try{jsonpatch['apply'](_0x2a5d2e,_0xcc4b7a,!![]);}catch(_0x53e02c){return BPromise['reject'](_0x53e02c);}return _0x2a5d2e[_0x48c5('0x22')]();};}function saveUpdates(_0x5b6cc3,_0x34398b){return function(_0x52a9eb){if(_0x52a9eb){return _0x52a9eb[_0x48c5('0x23')](_0x5b6cc3)[_0x48c5('0x24')](function(_0x31ba52){return _0x31ba52;});}return null;};}function removeEntity(_0x4477dc,_0x1cd741){return function(_0x525041){if(_0x525041){return _0x525041[_0x48c5('0x25')]()['then'](function(){_0x4477dc[_0x48c5('0x19')](0xcc)[_0x48c5('0x1a')]();});}};}function handleEntityNotFound(_0x1b59ae,_0x168fdd){return function(_0x224cda){if(!_0x224cda){_0x1b59ae[_0x48c5('0x18')](0x194);}return _0x224cda;};}function handleError(_0x35e7da,_0x8b1a41){_0x8b1a41=_0x8b1a41||0x1f4;return function(_0x3b1906){logger['error'](_0x3b1906[_0x48c5('0x26')]);if(_0x3b1906[_0x48c5('0x27')]){delete _0x3b1906[_0x48c5('0x27')];}_0x35e7da[_0x48c5('0x19')](_0x8b1a41)['send'](_0x3b1906);};}exports[_0x48c5('0x28')]=function(_0x165846,_0x1e511d){var _0x46298c={},_0x1b1580={},_0x16463f={'count':0x0,'rows':[]};var _0xebbcf9=_[_0x48c5('0x29')](db[_0x48c5('0x2a')][_0x48c5('0x2b')],function(_0x1c2e05){return{'name':_0x1c2e05[_0x48c5('0x2c')],'type':_0x1c2e05['type']['key']};});_0x1b1580['model']=_[_0x48c5('0x29')](_0xebbcf9,_0x48c5('0x27'));_0x1b1580[_0x48c5('0x2d')]=_[_0x48c5('0x2e')](_0x165846[_0x48c5('0x2d')]);_0x1b1580[_0x48c5('0x2f')]=_['intersection'](_0x1b1580[_0x48c5('0x30')],_0x1b1580[_0x48c5('0x2d')]);_0x46298c[_0x48c5('0x31')]=_[_0x48c5('0x32')](_0x1b1580['model'],qs[_0x48c5('0x33')](_0x165846[_0x48c5('0x2d')][_0x48c5('0x33')]));_0x46298c['attributes']=_0x46298c[_0x48c5('0x31')][_0x48c5('0x34')]?_0x46298c[_0x48c5('0x31')]:_0x1b1580[_0x48c5('0x30')];if(!_0x165846[_0x48c5('0x2d')][_0x48c5('0x35')](_0x48c5('0x36'))){_0x46298c['limit']=qs[_0x48c5('0x1e')](_0x165846[_0x48c5('0x2d')]['limit']);_0x46298c[_0x48c5('0x1c')]=qs['offset'](_0x165846[_0x48c5('0x2d')]['offset']);}_0x46298c[_0x48c5('0x37')]=qs[_0x48c5('0x38')](_0x165846[_0x48c5('0x2d')][_0x48c5('0x38')]);_0x46298c['where']=qs[_0x48c5('0x2f')](_[_0x48c5('0x39')](_0x165846['query'],_0x1b1580[_0x48c5('0x2f')]),_0xebbcf9);if(_0x165846[_0x48c5('0x2d')][_0x48c5('0x3a')]){_0x46298c[_0x48c5('0x3b')]=_['merge'](_0x46298c[_0x48c5('0x3b')],{'$or':_[_0x48c5('0x29')](_0xebbcf9,function(_0x336319){if(_0x336319['type']!==_0x48c5('0x3c')){var _0x33155a={};_0x33155a[_0x336319[_0x48c5('0x27')]]={'$like':'%'+_0x165846['query'][_0x48c5('0x3a')]+'%'};return _0x33155a;}})});}_0x46298c=_['merge']({},_0x46298c,_0x165846['options']);var _0x120557={'where':_0x46298c[_0x48c5('0x3b')]};return db[_0x48c5('0x2a')]['count'](_0x120557)[_0x48c5('0x24')](function(_0x37d727){_0x16463f['count']=_0x37d727;if(_0x165846[_0x48c5('0x2d')]['includeAll']){_0x46298c[_0x48c5('0x3d')]=[{'all':!![]}];}return db[_0x48c5('0x2a')][_0x48c5('0x3e')](_0x46298c);})[_0x48c5('0x24')](function(_0x4dfc64){_0x16463f[_0x48c5('0x3f')]=_0x4dfc64;return _0x16463f;})['then'](respondWithFilteredResult(_0x1e511d,_0x46298c))[_0x48c5('0x40')](handleError(_0x1e511d,null));};exports[_0x48c5('0x41')]=function(_0xa18670,_0x5b8e99){var _0x4cf358={'raw':!![],'where':{'id':_0xa18670[_0x48c5('0x42')]['id']}},_0x37b30b={};_0x37b30b[_0x48c5('0x30')]=_[_0x48c5('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x37b30b['query']=_['keys'](_0xa18670[_0x48c5('0x2d')]);_0x37b30b['filters']=_[_0x48c5('0x32')](_0x37b30b[_0x48c5('0x30')],_0x37b30b[_0x48c5('0x2d')]);_0x4cf358[_0x48c5('0x31')]=_[_0x48c5('0x32')](_0x37b30b[_0x48c5('0x30')],qs['fields'](_0xa18670[_0x48c5('0x2d')][_0x48c5('0x33')]));_0x4cf358[_0x48c5('0x31')]=_0x4cf358['attributes'][_0x48c5('0x34')]?_0x4cf358[_0x48c5('0x31')]:_0x37b30b[_0x48c5('0x30')];if(_0xa18670[_0x48c5('0x2d')][_0x48c5('0x43')]){_0x4cf358[_0x48c5('0x3d')]=[{'all':!![]}];}_0x4cf358=_[_0x48c5('0x44')]({},_0x4cf358,_0xa18670[_0x48c5('0x45')]);return db[_0x48c5('0x2a')][_0x48c5('0x46')](_0x4cf358)[_0x48c5('0x24')](handleEntityNotFound(_0x5b8e99,null))[_0x48c5('0x24')](respondWithResult(_0x5b8e99,null))[_0x48c5('0x40')](handleError(_0x5b8e99,null));};exports[_0x48c5('0x47')]=function(_0x4c99cd,_0x5a64cf){return db[_0x48c5('0x2a')][_0x48c5('0x47')](_0x4c99cd[_0x48c5('0x48')],{})[_0x48c5('0x24')](respondWithResult(_0x5a64cf,0xc9))[_0x48c5('0x40')](handleError(_0x5a64cf,null));};exports[_0x48c5('0x23')]=function(_0x1a2174,_0x478628){if(_0x1a2174[_0x48c5('0x48')]['id']){delete _0x1a2174[_0x48c5('0x48')]['id'];}return db[_0x48c5('0x2a')][_0x48c5('0x46')]({'where':{'id':_0x1a2174[_0x48c5('0x42')]['id']}})[_0x48c5('0x24')](handleEntityNotFound(_0x478628,null))[_0x48c5('0x24')](saveUpdates(_0x1a2174[_0x48c5('0x48')],null))[_0x48c5('0x24')](respondWithResult(_0x478628,null))[_0x48c5('0x40')](handleError(_0x478628,null));};exports['destroy']=function(_0x1f3c43,_0x3bce8a){return db[_0x48c5('0x2a')][_0x48c5('0x46')]({'where':{'id':_0x1f3c43[_0x48c5('0x42')]['id']}})[_0x48c5('0x24')](handleEntityNotFound(_0x3bce8a,null))[_0x48c5('0x24')](removeEntity(_0x3bce8a,null))['catch'](handleError(_0x3bce8a,null));};exports['describe']=function(_0x345d95,_0x1bac86){return db[_0x48c5('0x2a')][_0x48c5('0x49')]()[_0x48c5('0x24')](respondWithResult(_0x1bac86,null))[_0x48c5('0x40')](handleError(_0x1bac86,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c9d9a53..f140c82 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 _0x368c=['report_chat_transfer','uniqueid','lodash','util','api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x368c,0x18e));var _0xc368=function(_0x2c0ffd,_0x42f26b){_0x2c0ffd=_0x2c0ffd-0x0;var _0x4247e8=_0x368c[_0x2c0ffd];return _0x4247e8;};'use strict';var _=require(_0xc368('0x0'));var util=require(_0xc368('0x1'));var logger=require('../../config/logger')(_0xc368('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc368('0x3'));var fs=require('fs');var path=require(_0xc368('0x4'));var rimraf=require(_0xc368('0x5'));var config=require(_0xc368('0x6'));var attributes=require(_0xc368('0x7'));module['exports']=function(_0x5c9400,_0x4cec2b){return _0x5c9400[_0xc368('0x8')](_0xc368('0x9'),attributes,{'tableName':_0xc368('0xa'),'paranoid':![],'indexes':[{'name':_0xc368('0xb'),'fields':[_0xc368('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x19ba=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0x19ba,0x172));var _0xa19b=function(_0x54a6e7,_0xe3895c){_0x54a6e7=_0x54a6e7-0x0;var _0x8b5cce=_0x19ba[_0x54a6e7];return _0x8b5cce;};'use strict';var _=require(_0xa19b('0x0'));var util=require(_0xa19b('0x1'));var logger=require(_0xa19b('0x2'))(_0xa19b('0x3'));var moment=require(_0xa19b('0x4'));var BPromise=require('bluebird');var rp=require(_0xa19b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa19b('0x6'));var config=require(_0xa19b('0x7'));var attributes=require(_0xa19b('0x8'));module[_0xa19b('0x9')]=function(_0x278331,_0x18842d){return _0x278331['define'](_0xa19b('0xa'),attributes,{'tableName':_0xa19b('0xb'),'paranoid':![],'indexes':[{'name':_0xa19b('0xc'),'fields':[_0xa19b('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 ace4e06..9327d32 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 _0xb7a0=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5057b6,_0x48fd8b){var _0x2d7dba=function(_0x3197b4){while(--_0x3197b4){_0x5057b6['push'](_0x5057b6['shift']());}};_0x2d7dba(++_0x48fd8b);}(_0xb7a0,0x7a));var _0x0b7a=function(_0x371fb3,_0x2c3bcd){_0x371fb3=_0x371fb3-0x0;var _0x4304b4=_0xb7a0[_0x371fb3];return _0x4304b4;};'use strict';var _=require('lodash');var util=require(_0x0b7a('0x0'));var moment=require(_0x0b7a('0x1'));var BPromise=require(_0x0b7a('0x2'));var rs=require(_0x0b7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b7a('0x4'))['db'];var utils=require(_0x0b7a('0x5'));var logger=require(_0x0b7a('0x6'))('rpc');var config=require(_0x0b7a('0x7'));var jayson=require(_0x0b7a('0x8'));var client=jayson[_0x0b7a('0x9')][_0x0b7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x456cd8,_0x204933,_0x11ec13){return new BPromise(function(_0x81124a,_0x50b153){return client[_0x0b7a('0xb')](_0x456cd8,_0x11ec13)[_0x0b7a('0xc')](function(_0x59fe81){logger[_0x0b7a('0xd')](_0x0b7a('0xe'),_0x204933,_0x0b7a('0xf'));logger[_0x0b7a('0x10')](_0x0b7a('0x11'),_0x204933,_0x0b7a('0xf'),JSON[_0x0b7a('0x12')](_0x59fe81));if(_0x59fe81[_0x0b7a('0x13')]){if(_0x59fe81[_0x0b7a('0x13')][_0x0b7a('0x14')]===0x1f4){logger[_0x0b7a('0x13')](_0x0b7a('0xe'),_0x204933,_0x59fe81[_0x0b7a('0x13')][_0x0b7a('0x15')]);return _0x50b153(_0x59fe81[_0x0b7a('0x13')]['message']);}logger[_0x0b7a('0x13')](_0x0b7a('0xe'),_0x204933,_0x59fe81[_0x0b7a('0x13')][_0x0b7a('0x15')]);return _0x81124a(_0x59fe81['error']['message']);}else{logger[_0x0b7a('0xd')](_0x0b7a('0xe'),_0x204933,_0x0b7a('0xf'));_0x81124a(_0x59fe81['result'][_0x0b7a('0x15')]);}})[_0x0b7a('0x16')](function(_0x24b4a1){logger[_0x0b7a('0x13')](_0x0b7a('0xe'),_0x204933,_0x24b4a1);_0x50b153(_0x24b4a1);});});}
\ No newline at end of file
+var _0xebf2=['rpc','../../config/environment','client','http','request','then','info','debug','error','code','ChatTransferReport,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x21354a,_0x3c4926){var _0x128fb6=function(_0x274772){while(--_0x274772){_0x21354a['push'](_0x21354a['shift']());}};_0x128fb6(++_0x3c4926);}(_0xebf2,0x8b));var _0x2ebf=function(_0x204e08,_0x11f5dc){_0x204e08=_0x204e08-0x0;var _0x4dfe3a=_0xebf2[_0x204e08];return _0x4dfe3a;};'use strict';var _=require(_0x2ebf('0x0'));var util=require(_0x2ebf('0x1'));var moment=require(_0x2ebf('0x2'));var BPromise=require(_0x2ebf('0x3'));var rs=require(_0x2ebf('0x4'));var fs=require('fs');var Redis=require(_0x2ebf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ebf('0x6'));var logger=require(_0x2ebf('0x7'))(_0x2ebf('0x8'));var config=require(_0x2ebf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2ebf('0xa')][_0x2ebf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3daca7,_0xc455ea,_0x1ba725){return new BPromise(function(_0x5e06a8,_0x398944){return client[_0x2ebf('0xc')](_0x3daca7,_0x1ba725)[_0x2ebf('0xd')](function(_0x535878){logger[_0x2ebf('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0xc455ea,'request\x20sent');logger[_0x2ebf('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xc455ea,'request\x20sent',JSON['stringify'](_0x535878));if(_0x535878['error']){if(_0x535878[_0x2ebf('0x10')][_0x2ebf('0x11')]===0x1f4){logger[_0x2ebf('0x10')](_0x2ebf('0x12'),_0xc455ea,_0x535878[_0x2ebf('0x10')][_0x2ebf('0x13')]);return _0x398944(_0x535878[_0x2ebf('0x10')][_0x2ebf('0x13')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc455ea,_0x535878[_0x2ebf('0x10')][_0x2ebf('0x13')]);return _0x5e06a8(_0x535878[_0x2ebf('0x10')][_0x2ebf('0x13')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xc455ea,_0x2ebf('0x14'));_0x5e06a8(_0x535878['result']['message']);}})['catch'](function(_0x57aa72){logger[_0x2ebf('0x10')](_0x2ebf('0x12'),_0xc455ea,_0x57aa72);_0x398944(_0x57aa72);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 15bc801..dfc3ec9 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 _0x47a4=['delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put'];(function(_0x4a7c02,_0x15b41c){var _0x21e305=function(_0x4647fe){while(--_0x4647fe){_0x4a7c02['push'](_0x4a7c02['shift']());}};_0x21e305(++_0x15b41c);}(_0x47a4,0xe6));var _0x447a=function(_0x7a4cca,_0x4165d2){_0x7a4cca=_0x7a4cca-0x0;var _0x48d98f=_0x47a4[_0x7a4cca];return _0x48d98f;};'use strict';var multer=require('multer');var util=require(_0x447a('0x0'));var path=require('path');var timeout=require(_0x447a('0x1'));var express=require(_0x447a('0x2'));var router=express[_0x447a('0x3')]();var fs_extra=require(_0x447a('0x4'));var auth=require(_0x447a('0x5'));var interaction=require(_0x447a('0x6'));var config=require(_0x447a('0x7'));var controller=require(_0x447a('0x8'));router[_0x447a('0x9')]('/',auth[_0x447a('0xa')](),controller[_0x447a('0xb')]);router[_0x447a('0x9')](_0x447a('0xc'),auth[_0x447a('0xa')](),controller['describe']);router['get'](_0x447a('0xd'),auth[_0x447a('0xa')](),controller[_0x447a('0xe')]);router[_0x447a('0xf')]('/',auth[_0x447a('0xa')](),controller['create']);router[_0x447a('0x10')](_0x447a('0xd'),auth[_0x447a('0xa')](),controller['update']);router[_0x447a('0x11')]('/:id',auth[_0x447a('0xa')](),controller[_0x447a('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x23a7=['/:id','show','create','put','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x5dc778,_0x20192d){var _0x1977ee=function(_0x1496d2){while(--_0x1496d2){_0x5dc778['push'](_0x5dc778['shift']());}};_0x1977ee(++_0x20192d);}(_0x23a7,0xc3));var _0x723a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x23a7[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x723a('0x0'));var util=require(_0x723a('0x1'));var path=require(_0x723a('0x2'));var timeout=require(_0x723a('0x3'));var express=require(_0x723a('0x4'));var router=express['Router']();var fs_extra=require(_0x723a('0x5'));var auth=require(_0x723a('0x6'));var interaction=require(_0x723a('0x7'));var config=require('../../config/environment');var controller=require(_0x723a('0x8'));router[_0x723a('0x9')]('/',auth['isAuthenticated'](),controller[_0x723a('0xa')]);router[_0x723a('0x9')](_0x723a('0xb'),auth[_0x723a('0xc')](),controller[_0x723a('0xd')]);router[_0x723a('0x9')](_0x723a('0xe'),auth[_0x723a('0xc')](),controller[_0x723a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x723a('0x10')]);router[_0x723a('0x11')](_0x723a('0xe'),auth[_0x723a('0xc')](),controller['update']);router['delete'](_0x723a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x723a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 0c94832..8a3974d 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 _0x1d25=['#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','name','onlineForm','parse','getDataValue','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent'];(function(_0x5016c9,_0x57cdf0){var _0x5371ee=function(_0x494af9){while(--_0x494af9){_0x5016c9['push'](_0x5016c9['shift']());}};_0x5371ee(++_0x57cdf0);}(_0x1d25,0x96));var _0x51d2=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0x1d25[_0x45313f];return _0x402910;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x51d2('0x0'));module[_0x51d2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x51d2('0x2')],'allowNull':![],'unique':_0x51d2('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x4')},'mapKeyOffline':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x51d2('0x2')],'allowNull':![],'defaultValue':_0x51d2('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x51d2('0x2')],'allowNull':![],'defaultValue':_0x51d2('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x51d2('0x2')],'allowNull':![],'defaultValue':_0x51d2('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x51d2('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x51d2('0xa')]('rounded',_0x51d2('0xb')),'defaultValue':_0x51d2('0xc')},'header_online':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0xd')},'start_chat_button':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x51d2('0xe')},'header_offline':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x51d2('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x51d2('0x11')]},'closingQuestion':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x51d2('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x14')},'noteTitle':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x15')},'placeholderMessage':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x16')},'closingMessage':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x17')},'closingMessageButton':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x51d2('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x19')},'ratingType':{'type':Sequelize[_0x51d2('0xa')](_0x51d2('0x1a'),'thumb'),'defaultValue':_0x51d2('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x51d2('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x51d2('0x11')],'defaultValue':function(){return JSON[_0x51d2('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x51d2('0x1c'),'type':'text','required':!![]},'props':{'title':_0x51d2('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x51d2('0x4'),'type':_0x51d2('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x51d2('0x1d'))?JSON[_0x51d2('0x1e')](this[_0x51d2('0x1f')](_0x51d2('0x1d'))):{};},'set':function(_0x1ffc8f){return this[_0x51d2('0x20')]('onlineForm',JSON[_0x51d2('0x1b')](_0x1ffc8f));}},'offlineForm':{'type':Sequelize[_0x51d2('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x51d2('0x21'),'props':{'title':_0x51d2('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x51d2('0x4')},'variable':null},{'type':_0x51d2('0x22'),'config':{'placeholder':_0x51d2('0x23')},'props':{'title':'Comments','helpText':_0x51d2('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x51d2('0x1f')](_0x51d2('0x25'))?JSON[_0x51d2('0x1e')](this['getDataValue'](_0x51d2('0x25'))):{};},'set':function(_0x5a368a){return this[_0x51d2('0x20')](_0x51d2('0x25'),JSON[_0x51d2('0x1b')](_0x5a368a));}},'token':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':function(){return rs[_0x51d2('0x26')]();}},'autoclose':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x51d2('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x51d2('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':_0x51d2('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x29')},'skipUnmanaged':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x18')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x51d2('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x51d2('0x2')]},'notificationTemplate':{'type':Sequelize[_0x51d2('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x2a')},'verticalAlignment':{'type':Sequelize[_0x51d2('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x51d2('0x2')],'defaultValue':_0x51d2('0x2b')},'defaultTitle':{'type':Sequelize[_0x51d2('0x2')]},'customerAvatar':{'type':Sequelize[_0x51d2('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x51d2('0x2')],'allowNull':![],'defaultValue':_0x51d2('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x51d2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x51d2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x51d2('0x2d')},'systemAvatar':{'type':Sequelize[_0x51d2('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x51d2('0x8')],'comment':_0x51d2('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![],'comment':_0x51d2('0x2f'),'set':function(_0x998564){if(!_0x998564)this[_0x51d2('0x20')](_0x51d2('0x30'),null);this['setDataValue'](_0x51d2('0x31'),_0x998564);}},'vidaooEscalation':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x51d2('0x2')],'allowNull':![],'defaultValue':_0x51d2('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x51d2('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x51d2('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x51d2('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x51d2('0x11')]}};
\ No newline at end of file
+var _0xc185=['getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','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.','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','stringify','name','text','input'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc185,0x1b2));var _0x5c18=function(_0xe2ad18,_0x195d01){_0xe2ad18=_0xe2ad18-0x0;var _0x3e9b9f=_0xc185[_0xe2ad18];return _0x3e9b9f;};'use strict';var Sequelize=require(_0x5c18('0x0'));var rs=require('randomstring');module[_0x5c18('0x1')]={'name':{'type':Sequelize[_0x5c18('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x5c18('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x5c18('0x2')]},'mapKey':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x3')},'mapKeyOffline':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5c18('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5c18('0x2')],'allowNull':![],'defaultValue':_0x5c18('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5c18('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5c18('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5c18('0x2')]},'animation':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5c18('0x8')](_0x5c18('0x9'),_0x5c18('0xa')),'defaultValue':_0x5c18('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x5c18('0xb')},'start_chat_button':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0xc')},'offline_chat_button':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0xd')},'header_offline':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5c18('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5c18('0xe')]},'closingQuestion':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5c18('0x11')},'noteTitle':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x12')},'placeholderMessage':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x13')},'closingMessage':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0xd')},'skipMessageButton':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x15')},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5c18('0xe')],'defaultValue':function(){return JSON[_0x5c18('0x16')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x5c18('0x17'),'type':_0x5c18('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x5c18('0x19'),'props':{'title':_0x5c18('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x5c18('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5c18('0x1a')](_0x5c18('0x1b'))?JSON['parse'](this[_0x5c18('0x1a')](_0x5c18('0x1b'))):{};},'set':function(_0x289df1){return this[_0x5c18('0x1c')]('onlineForm',JSON[_0x5c18('0x16')](_0x289df1));}},'offlineForm':{'type':Sequelize[_0x5c18('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5c18('0x19'),'props':{'title':_0x5c18('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x5c18('0x3'),'type':_0x5c18('0x3')},'variable':null},{'type':_0x5c18('0x1d'),'config':{'placeholder':_0x5c18('0x1e')},'props':{'title':_0x5c18('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x5c18('0x1a')](_0x5c18('0x1f'))?JSON[_0x5c18('0x20')](this['getDataValue'](_0x5c18('0x1f'))):{};},'set':function(_0x55fe3a){return this[_0x5c18('0x1c')]('offlineForm',JSON[_0x5c18('0x16')](_0x55fe3a));}},'token':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':function(){return rs[_0x5c18('0x21')]();}},'autoclose':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5c18('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5c18('0x2')]},'waitingTitle':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x22')},'offlineMessageBody':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x24')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5c18('0x14')},'sendUnmanaged':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5c18('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5c18('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5c18('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x26')},'verticalAlignment':{'type':Sequelize[_0x5c18('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5c18('0x27')},'defaultTitle':{'type':Sequelize[_0x5c18('0x2')]},'customerAvatar':{'type':Sequelize[_0x5c18('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5c18('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5c18('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5c18('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':_0x5c18('0x28')},'systemAvatar':{'type':Sequelize[_0x5c18('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5c18('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1d34ba){if(!_0x1d34ba)this[_0x5c18('0x1c')](_0x5c18('0x2a'),null);this[_0x5c18('0x1c')](_0x5c18('0x2b'),_0x1d34ba);}},'vidaooEscalation':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5c18('0x2')]},'vidaooTopic':{'type':Sequelize[_0x5c18('0x2')],'allowNull':![],'defaultValue':_0x5c18('0x2c')},'vidaooNote':{'type':Sequelize[_0x5c18('0x2')],'defaultValue':function(){return _0x5c18('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x5c18('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5c18('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5c18('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 1c064fb..2541964 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 _0x5608=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','ChatWebsites','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','filename','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','isNil','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','existsSync','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','user-agent','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','Contacts','DESC','List','account','Applications','list','applications','orderBy','priority','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','get','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','mapValues','offlineMessageSubject','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','../../config/license/util','getLicense','virtual','License','increment','all','server/files/chat/iframe.ejs','remote','x-real-ip','remoteAddress','replace','alignment','textColor','color_button','addApplications','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5608,0x124));var _0x8560=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x5608[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x8560('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8560('0x1'));var jsonpatch=require(_0x8560('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8560('0x3'));var Mustache=require('mustache');var util=require(_0x8560('0x4'));var path=require(_0x8560('0x5'));var sox=require(_0x8560('0x6'));var csv=require('to-csv');var ejs=require(_0x8560('0x7'));var fs=require('fs');var fs_extra=require(_0x8560('0x8'));var _=require(_0x8560('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8560('0xa'));var deskjs=require(_0x8560('0xb'));var toCsv=require(_0x8560('0xc'));var querystring=require(_0x8560('0xd'));var Papa=require(_0x8560('0xe'));var Redis=require(_0x8560('0xf'));var authService=require(_0x8560('0x10'));var qs=require(_0x8560('0x11'));var as=require(_0x8560('0x12'));var hardwareService=require(_0x8560('0x13'));var logger=require(_0x8560('0x14'))(_0x8560('0x15'));var utils=require(_0x8560('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8560('0x17'))['db'];config[_0x8560('0x18')]=_[_0x8560('0x19')](config[_0x8560('0x18')],{'host':_0x8560('0x1a'),'port':0x18eb});var socket=require(_0x8560('0x1b'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x8560('0x1c')](socket);var jayson=require(_0x8560('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8560('0x1e')]['http']({'port':0x232a});var client9003=jayson[_0x8560('0x1e')][_0x8560('0x1f')]({'port':0x232b});var client9001=jayson[_0x8560('0x1e')]['http']({'port':0x2329});function respondWithRpcPromise(_0x1bed53,_0x560a0f,_0x7ebb1f,_0x161c0a){return new BPromise(function(_0x3c41dc,_0x247681){var _0x3cbc23=_0x161c0a||client;return _0x3cbc23['request'](_0x1bed53,_0x7ebb1f)[_0x8560('0x20')](function(_0x1f266b){logger['info'](_0x8560('0x21'),_0x560a0f,_0x8560('0x22'));logger[_0x8560('0x23')](_0x8560('0x24'),_0x560a0f,_0x8560('0x22'),JSON['stringify'](_0x1f266b));if(_0x1f266b['error']){if(_0x1f266b[_0x8560('0x25')]['code']===0x1f4){logger[_0x8560('0x25')](_0x8560('0x21'),_0x560a0f,_0x1f266b[_0x8560('0x25')]['message']);return _0x247681(_0x1f266b[_0x8560('0x25')]['message']);}logger[_0x8560('0x25')](_0x8560('0x21'),_0x560a0f,_0x1f266b[_0x8560('0x25')][_0x8560('0x26')]);return _0x3c41dc(_0x1f266b[_0x8560('0x25')][_0x8560('0x26')]);}else{logger[_0x8560('0x27')](_0x8560('0x21'),_0x560a0f,_0x8560('0x22'));_0x3c41dc(_0x1f266b[_0x8560('0x28')][_0x8560('0x26')]);}})[_0x8560('0x29')](function(_0x5d1854){logger[_0x8560('0x25')](_0x8560('0x21'),_0x560a0f,_0x5d1854);_0x247681(_0x5d1854);});});}function respondWithStatusCode(_0x2a4db9,_0x34cedd){_0x34cedd=_0x34cedd||0xcc;return function(_0x517bfa){if(_0x517bfa){return _0x2a4db9[_0x8560('0x2a')](_0x34cedd);}return _0x2a4db9[_0x8560('0x2b')](_0x34cedd)[_0x8560('0x2c')]();};}function respondWithResult(_0x2c0be9,_0x12bbce){_0x12bbce=_0x12bbce||0xc8;return function(_0x471693){if(_0x471693){return _0x2c0be9[_0x8560('0x2b')](_0x12bbce)['json'](_0x471693);}};}function respondWithFilteredResult(_0x1fa668,_0xfc0595){return function(_0x4c835d){if(_0x4c835d){var _0x58179e=typeof _0xfc0595[_0x8560('0x2d')]===_0x8560('0x2e')&&typeof _0xfc0595[_0x8560('0x2f')]==='undefined';var _0x4c5b2e=_0x4c835d['count'];var _0x414d45=_0x58179e?0x0:_0xfc0595[_0x8560('0x2d')];var _0x9ce5c6=_0x58179e?_0x4c835d[_0x8560('0x30')]:_0xfc0595[_0x8560('0x2d')]+_0xfc0595[_0x8560('0x2f')];var _0x404a5b;if(_0x9ce5c6>=_0x4c5b2e){_0x9ce5c6=_0x4c5b2e;_0x404a5b=0xc8;}else{_0x404a5b=0xce;}_0x1fa668[_0x8560('0x2b')](_0x404a5b);return _0x1fa668['set'](_0x8560('0x31'),_0x414d45+'-'+_0x9ce5c6+'/'+_0x4c5b2e)[_0x8560('0x32')](_0x4c835d);}return null;};}function patchUpdates(_0xdd9a7d){return function(_0x5d04eb){try{jsonpatch[_0x8560('0x33')](_0x5d04eb,_0xdd9a7d,!![]);}catch(_0x17b541){return BPromise[_0x8560('0x34')](_0x17b541);}return _0x5d04eb['save']();};}function saveUpdates(_0x1d1e06,_0x50acfe){return function(_0x34cc7c){if(_0x34cc7c){return _0x34cc7c[_0x8560('0x35')](_0x1d1e06)['then'](function(_0x137491){return _0x137491;});}return null;};}function removeEntity(_0x51e2c6,_0x244adb){return function(_0x3f8a46){if(_0x3f8a46){return _0x3f8a46[_0x8560('0x36')]()[_0x8560('0x20')](function(){var _0x2aa5df=_0x3f8a46['get']({'plain':!![]});var _0x35e193=_0x8560('0x37');return db['UserProfileResource'][_0x8560('0x36')]({'where':{'type':_0x35e193,'resourceId':_0x2aa5df['id']}})[_0x8560('0x20')](function(){return _0x3f8a46;});})[_0x8560('0x20')](function(){_0x51e2c6[_0x8560('0x2b')](0xcc)[_0x8560('0x2c')]();});}};}function handleEntityNotFound(_0x5d7282,_0x113ebc){return function(_0x54b6e4){if(!_0x54b6e4){_0x5d7282[_0x8560('0x2a')](0x194);}return _0x54b6e4;};}function handleError(_0x3d030a,_0xc50569){_0xc50569=_0xc50569||0x1f4;return function(_0x25d667){logger[_0x8560('0x25')](_0x25d667[_0x8560('0x38')]);if(_0x25d667[_0x8560('0x39')]){delete _0x25d667[_0x8560('0x39')];}_0x3d030a[_0x8560('0x2b')](_0xc50569)['send'](_0x25d667);};}exports[_0x8560('0x3a')]=function(_0x4cd815,_0x1fa76e){var _0x162c35={'include':[{'model':db[_0x8560('0x3b')],'as':_0x8560('0x3c')}]},_0x3e54d6={},_0x3243d5={'count':0x0,'rows':[]};var _0x5e8cdd=_[_0x8560('0x3d')](db[_0x8560('0x3e')][_0x8560('0x3f')],function(_0x40774f){return{'name':_0x40774f[_0x8560('0x40')],'type':_0x40774f[_0x8560('0x41')][_0x8560('0x42')]};});_0x3e54d6[_0x8560('0x43')]=_[_0x8560('0x3d')](_0x5e8cdd,'name');_0x3e54d6['query']=_[_0x8560('0x44')](_0x4cd815[_0x8560('0x45')]);_0x3e54d6['filters']=_[_0x8560('0x46')](_0x3e54d6['model'],_0x3e54d6[_0x8560('0x45')]);_0x162c35[_0x8560('0x47')]=_[_0x8560('0x46')](_0x3e54d6[_0x8560('0x43')],qs[_0x8560('0x48')](_0x4cd815['query'][_0x8560('0x48')]));_0x162c35[_0x8560('0x47')]=_0x162c35['attributes'][_0x8560('0x49')]?_0x162c35[_0x8560('0x47')]:_0x3e54d6['model'];if(!_0x4cd815['query'][_0x8560('0x4a')]('nolimit')){_0x162c35[_0x8560('0x2f')]=qs['limit'](_0x4cd815['query'][_0x8560('0x2f')]);_0x162c35[_0x8560('0x2d')]=qs['offset'](_0x4cd815[_0x8560('0x45')][_0x8560('0x2d')]);}_0x162c35[_0x8560('0x4b')]=qs[_0x8560('0x4c')](_0x4cd815[_0x8560('0x45')][_0x8560('0x4c')]);_0x162c35[_0x8560('0x4d')]=qs[_0x8560('0x4e')](_['pick'](_0x4cd815['query'],_0x3e54d6[_0x8560('0x4e')]),_0x5e8cdd);if(_0x4cd815[_0x8560('0x45')][_0x8560('0x4f')]){_0x162c35[_0x8560('0x4d')]=_[_0x8560('0x50')](_0x162c35['where'],{'$or':_[_0x8560('0x3d')](_0x5e8cdd,function(_0x1cd54a){if(_0x1cd54a[_0x8560('0x41')]!==_0x8560('0x51')){var _0x2ec25d={};_0x2ec25d[_0x1cd54a['name']]={'$like':'%'+_0x4cd815[_0x8560('0x45')][_0x8560('0x4f')]+'%'};return _0x2ec25d;}})});}_0x162c35=_[_0x8560('0x50')]({},_0x162c35,_0x4cd815[_0x8560('0x52')]);var _0xa7fbad={'where':_0x162c35[_0x8560('0x4d')]};return db[_0x8560('0x3e')][_0x8560('0x30')](_0xa7fbad)[_0x8560('0x20')](function(_0x18f1f8){_0x3243d5[_0x8560('0x30')]=_0x18f1f8;if(_0x4cd815[_0x8560('0x45')][_0x8560('0x53')]){_0x162c35[_0x8560('0x54')]=[{'all':!![]}];}return db['ChatWebsite'][_0x8560('0x55')](_0x162c35);})[_0x8560('0x20')](function(_0x23676b){_0x3243d5[_0x8560('0x56')]=_0x23676b;return _0x3243d5;})[_0x8560('0x20')](respondWithFilteredResult(_0x1fa76e,_0x162c35))[_0x8560('0x29')](handleError(_0x1fa76e,null));};exports['show']=function(_0x5acbf6,_0x1a0d3f){var _0x4a44c7={'raw':![],'where':{'id':_0x5acbf6['params']['id']},'include':[{'model':db[_0x8560('0x3b')],'as':'mandatoryDispositionPause'}]},_0xbc2c44={};_0xbc2c44[_0x8560('0x43')]=_[_0x8560('0x44')](db[_0x8560('0x3e')]['rawAttributes']);_0xbc2c44[_0x8560('0x45')]=_[_0x8560('0x44')](_0x5acbf6['query']);_0xbc2c44[_0x8560('0x4e')]=_[_0x8560('0x46')](_0xbc2c44[_0x8560('0x43')],_0xbc2c44[_0x8560('0x45')]);_0x4a44c7[_0x8560('0x47')]=_[_0x8560('0x46')](_0xbc2c44[_0x8560('0x43')],qs['fields'](_0x5acbf6['query']['fields']));_0x4a44c7['attributes']=_0x4a44c7['attributes']['length']?_0x4a44c7[_0x8560('0x47')]:_0xbc2c44['model'];if(_0x5acbf6[_0x8560('0x45')][_0x8560('0x53')]){_0x4a44c7[_0x8560('0x54')]=[{'all':!![]}];}_0x4a44c7=_[_0x8560('0x50')]({},_0x4a44c7,_0x5acbf6['options']);return db[_0x8560('0x3e')][_0x8560('0x57')](_0x4a44c7)[_0x8560('0x20')](handleEntityNotFound(_0x1a0d3f,null))[_0x8560('0x20')](respondWithResult(_0x1a0d3f,null))['catch'](handleError(_0x1a0d3f,null));};exports[_0x8560('0x58')]=function(_0x3ec0b4,_0x4a6487){return db[_0x8560('0x3e')]['create'](_0x3ec0b4[_0x8560('0x59')],{})[_0x8560('0x20')](function(_0x23f64e){var _0x34bf8d=_0x3ec0b4['user']['get']({'plain':!![]});if(!_0x34bf8d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34bf8d['role']===_0x8560('0x5a')){var _0x18e18e=_0x23f64e['get']({'plain':!![]});var _0x346f8f=_0x8560('0x37');return db[_0x8560('0x5b')][_0x8560('0x57')]({'where':{'name':_0x346f8f,'userProfileId':_0x34bf8d[_0x8560('0x5c')]},'raw':!![]})[_0x8560('0x20')](function(_0x5af334){if(_0x5af334&&_0x5af334['autoAssociation']===0x0){return db[_0x8560('0x5d')][_0x8560('0x58')]({'name':_0x18e18e['name'],'resourceId':_0x18e18e['id'],'type':_0x5af334[_0x8560('0x39')],'sectionId':_0x5af334['id']},{})[_0x8560('0x20')](function(){return _0x23f64e;});}else{return _0x23f64e;}})[_0x8560('0x29')](function(_0x34b49e){logger[_0x8560('0x25')](_0x8560('0x5e'),_0x34b49e);throw _0x34b49e;});}return _0x23f64e;})[_0x8560('0x20')](respondWithResult(_0x4a6487,0xc9))[_0x8560('0x29')](handleError(_0x4a6487,null));};exports[_0x8560('0x35')]=function(_0x4b336d,_0x1c3459){if(_0x4b336d[_0x8560('0x59')]['id']){delete _0x4b336d[_0x8560('0x59')]['id'];}return db[_0x8560('0x3e')]['find']({'where':{'id':_0x4b336d['params']['id']},'include':[{'model':db[_0x8560('0x3b')],'as':_0x8560('0x3c')}]})[_0x8560('0x20')](handleEntityNotFound(_0x1c3459,null))[_0x8560('0x20')](saveUpdates(_0x4b336d[_0x8560('0x59')],null))['then'](respondWithResult(_0x1c3459,null))[_0x8560('0x29')](handleError(_0x1c3459,null));};exports[_0x8560('0x36')]=function(_0x4cfd22,_0x970ea6){return db[_0x8560('0x3e')][_0x8560('0x57')]({'where':{'id':_0x4cfd22[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x970ea6,null))[_0x8560('0x20')](removeEntity(_0x970ea6,null))[_0x8560('0x29')](handleError(_0x970ea6,null));};exports[_0x8560('0x60')]=function(_0xecc63e,_0x4ce1a9){return db[_0x8560('0x3e')]['describe']()['then'](respondWithResult(_0x4ce1a9,null))[_0x8560('0x29')](handleError(_0x4ce1a9,null));};exports[_0x8560('0x61')]=function(_0x104830,_0x10dd0e,_0x576d46){if(_0x104830[_0x8560('0x59')]['id']){delete _0x104830[_0x8560('0x59')]['id'];}return db[_0x8560('0x3e')][_0x8560('0x57')]({'where':{'id':_0x104830['params']['id']}})['then'](handleEntityNotFound(_0x10dd0e,null))[_0x8560('0x20')](function(_0x55b44d){if(_0x55b44d){_0x104830[_0x8560('0x59')][_0x8560('0x62')]=_0x55b44d['id'];return db[_0x8560('0x63')]['create'](_0x104830['body']);}})[_0x8560('0x20')](respondWithResult(_0x10dd0e,null))[_0x8560('0x29')](handleError(_0x10dd0e,null));};exports[_0x8560('0x64')]=function(_0xb4e407,_0x41c588,_0x48f457){var _0x33932f={'raw':![],'where':{}};var _0x4cca93={};var _0x576071={'count':0x0,'rows':[]};return db[_0x8560('0x3e')]['findOne']({'where':{'id':_0xb4e407['params']['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x41c588,null))[_0x8560('0x20')](function(_0x5c69c8){if(_0x5c69c8){_0x4cca93['model']=_[_0x8560('0x44')](db[_0x8560('0x63')]['rawAttributes']);_0x4cca93[_0x8560('0x45')]=_[_0x8560('0x44')](_0xb4e407['query']);_0x4cca93[_0x8560('0x4e')]=_['intersection'](_0x4cca93[_0x8560('0x43')],_0x4cca93[_0x8560('0x45')]);_0x33932f[_0x8560('0x47')]=_[_0x8560('0x46')](_0x4cca93['model'],qs['fields'](_0xb4e407[_0x8560('0x45')]['fields']));_0x33932f[_0x8560('0x47')]=_0x33932f[_0x8560('0x47')][_0x8560('0x49')]?_0x33932f['attributes']:_0x4cca93[_0x8560('0x43')];if(!_0xb4e407[_0x8560('0x45')][_0x8560('0x4a')](_0x8560('0x65'))){_0x33932f[_0x8560('0x2f')]=qs[_0x8560('0x2f')](_0xb4e407['query'][_0x8560('0x2f')]);_0x33932f[_0x8560('0x2d')]=qs[_0x8560('0x2d')](_0xb4e407[_0x8560('0x45')][_0x8560('0x2d')]);}_0x33932f[_0x8560('0x4b')]=qs[_0x8560('0x4c')](_0xb4e407[_0x8560('0x45')][_0x8560('0x4c')]);_0x33932f['where']=qs[_0x8560('0x4e')](_[_0x8560('0x66')](_0xb4e407[_0x8560('0x45')],_0x4cca93[_0x8560('0x4e')]));_0x33932f[_0x8560('0x4d')]['ChatWebsiteId']=_0x5c69c8['id'];if(_0xb4e407['query'][_0x8560('0x4f')]){_0x33932f[_0x8560('0x4d')]=_[_0x8560('0x50')](_0x33932f[_0x8560('0x4d')],{'$or':_[_0x8560('0x3d')](_0x33932f['attributes'],function(_0x408b93){var _0x48cab6={};_0x48cab6[_0x408b93]={'$like':'%'+_0xb4e407[_0x8560('0x45')]['filter']+'%'};return _0x48cab6;})});}_0x33932f=_[_0x8560('0x50')]({},_0x33932f,_0xb4e407[_0x8560('0x52')]);return db[_0x8560('0x63')]['count']({'where':_0x33932f[_0x8560('0x4d')]})['then'](function(_0x17127d){_0x576071[_0x8560('0x30')]=_0x17127d;if(_0xb4e407[_0x8560('0x45')][_0x8560('0x53')]){_0x33932f[_0x8560('0x54')]=[{'all':!![]}];}return db[_0x8560('0x63')][_0x8560('0x55')](_0x33932f);})[_0x8560('0x20')](function(_0x35b928){_0x576071[_0x8560('0x56')]=_0x35b928;return _0x576071;});}})[_0x8560('0x20')](respondWithFilteredResult(_0x41c588,_0x33932f))[_0x8560('0x29')](handleError(_0x41c588,null));};exports['removeDispositions']=function(_0x403559,_0x125d73,_0xf9b82d){return db[_0x8560('0x3e')]['find']({'where':{'id':_0x403559[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x125d73,null))['then'](function(_0x14d345){if(_0x14d345){return _0x14d345[_0x8560('0x67')](_0x403559['query'][_0x8560('0x68')]);}})['then'](respondWithStatusCode(_0x125d73,null))[_0x8560('0x29')](handleError(_0x125d73,null));};exports[_0x8560('0x69')]=function(_0x3a815c,_0x3d56b3,_0x1eb93c){if(_0x3a815c[_0x8560('0x59')]['id']){delete _0x3a815c[_0x8560('0x59')]['id'];}return db[_0x8560('0x3e')]['find']({'where':{'id':_0x3a815c['params']['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x3d56b3,null))['then'](function(_0x5004c0){if(_0x5004c0){_0x3a815c[_0x8560('0x59')]['ChatWebsiteId']=_0x5004c0['id'];return db[_0x8560('0x6a')][_0x8560('0x58')](_0x3a815c[_0x8560('0x59')]);}})[_0x8560('0x20')](respondWithResult(_0x3d56b3,null))['catch'](handleError(_0x3d56b3,null));};exports[_0x8560('0x6b')]=function(_0x553895,_0x24483b,_0x21c688){var _0x301483={'raw':![],'where':{}};var _0x4ceac5={};var _0xae720c={'count':0x0,'rows':[]};return db[_0x8560('0x3e')][_0x8560('0x6c')]({'where':{'id':_0x553895[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x24483b,null))['then'](function(_0x4d2de0){if(_0x4d2de0){_0x4ceac5[_0x8560('0x43')]=_[_0x8560('0x44')](db['CannedAnswer']['rawAttributes']);_0x4ceac5['query']=_['keys'](_0x553895[_0x8560('0x45')]);_0x4ceac5[_0x8560('0x4e')]=_[_0x8560('0x46')](_0x4ceac5[_0x8560('0x43')],_0x4ceac5[_0x8560('0x45')]);_0x301483[_0x8560('0x47')]=_[_0x8560('0x46')](_0x4ceac5[_0x8560('0x43')],qs[_0x8560('0x48')](_0x553895['query'][_0x8560('0x48')]));_0x301483[_0x8560('0x47')]=_0x301483[_0x8560('0x47')][_0x8560('0x49')]?_0x301483[_0x8560('0x47')]:_0x4ceac5['model'];if(!_0x553895['query']['hasOwnProperty'](_0x8560('0x65'))){_0x301483['limit']=qs[_0x8560('0x2f')](_0x553895[_0x8560('0x45')]['limit']);_0x301483['offset']=qs['offset'](_0x553895[_0x8560('0x45')][_0x8560('0x2d')]);}_0x301483[_0x8560('0x4b')]=qs['sort'](_0x553895['query'][_0x8560('0x4c')]);_0x301483[_0x8560('0x4d')]=qs[_0x8560('0x4e')](_[_0x8560('0x66')](_0x553895[_0x8560('0x45')],_0x4ceac5[_0x8560('0x4e')]));_0x301483[_0x8560('0x4d')][_0x8560('0x62')]=_0x4d2de0['id'];if(_0x553895[_0x8560('0x45')][_0x8560('0x4f')]){_0x301483[_0x8560('0x4d')]=_['merge'](_0x301483[_0x8560('0x4d')],{'$or':_[_0x8560('0x3d')](_0x301483[_0x8560('0x47')],function(_0x2c69d6){var _0x540db8={};_0x540db8[_0x2c69d6]={'$like':'%'+_0x553895[_0x8560('0x45')][_0x8560('0x4f')]+'%'};return _0x540db8;})});}_0x301483=_[_0x8560('0x50')]({},_0x301483,_0x553895[_0x8560('0x52')]);return db[_0x8560('0x6a')][_0x8560('0x30')]({'where':_0x301483[_0x8560('0x4d')]})[_0x8560('0x20')](function(_0x23bf6c){_0xae720c[_0x8560('0x30')]=_0x23bf6c;if(_0x553895[_0x8560('0x45')][_0x8560('0x53')]){_0x301483['include']=[{'all':!![]}];}return db[_0x8560('0x6a')][_0x8560('0x55')](_0x301483);})[_0x8560('0x20')](function(_0x5c7923){_0xae720c[_0x8560('0x56')]=_0x5c7923;return _0xae720c;});}})[_0x8560('0x20')](respondWithFilteredResult(_0x24483b,_0x301483))[_0x8560('0x29')](handleError(_0x24483b,null));};exports[_0x8560('0x6d')]=function(_0x25d55a,_0x2ac0a5,_0x5b6fd3){return db[_0x8560('0x3e')]['find']({'where':{'id':_0x25d55a[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x2ac0a5,null))[_0x8560('0x20')](function(_0x3761b3){if(_0x3761b3){return _0x3761b3[_0x8560('0x6d')](_0x25d55a[_0x8560('0x45')][_0x8560('0x68')]);}})[_0x8560('0x20')](respondWithStatusCode(_0x2ac0a5,null))[_0x8560('0x29')](handleError(_0x2ac0a5,null));};exports[_0x8560('0x6e')]=function(_0x453f86,_0x245b3a,_0x3b3978){_0x453f86[_0x8560('0x59')][_0x8560('0x6f')]=_0x453f86['file'][_0x8560('0x70')];return db['ChatWebsite'][_0x8560('0x57')]({'where':{'id':_0x453f86[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x245b3a,null))['then'](saveUpdates(_0x453f86['body'],null))[_0x8560('0x20')](respondWithResult(_0x245b3a,null))[_0x8560('0x29')](handleError(_0x245b3a,null));};exports['addAvatar']=function(_0xffc128,_0x3fbcb3,_0x4ec786){_0xffc128[_0x8560('0x59')][_0x8560('0x71')]=_0xffc128[_0x8560('0x72')][_0x8560('0x70')];return db[_0x8560('0x3e')][_0x8560('0x57')]({'where':{'id':_0xffc128['params']['id']}})['then'](handleEntityNotFound(_0x3fbcb3,null))[_0x8560('0x20')](saveUpdates(_0xffc128[_0x8560('0x59')],null))['then'](respondWithResult(_0x3fbcb3,null))[_0x8560('0x29')](handleError(_0x3fbcb3,null));};exports[_0x8560('0x73')]=function(_0x17aa95,_0x5bbb9c,_0x3ae735){_0x17aa95['body'][_0x8560('0x74')]=_0x17aa95['file'][_0x8560('0x70')];return db[_0x8560('0x3e')][_0x8560('0x57')]({'where':{'id':_0x17aa95['params']['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x5bbb9c,null))[_0x8560('0x20')](saveUpdates(_0x17aa95[_0x8560('0x59')],null))[_0x8560('0x20')](respondWithResult(_0x5bbb9c,null))[_0x8560('0x29')](handleError(_0x5bbb9c,null));};exports[_0x8560('0x75')]=function(_0xabdb72,_0x5ef74a,_0x263afa){_0xabdb72[_0x8560('0x59')][_0x8560('0x76')]=_0xabdb72[_0x8560('0x72')][_0x8560('0x70')];return db[_0x8560('0x3e')]['find']({'where':{'id':_0xabdb72[_0x8560('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5ef74a,null))[_0x8560('0x20')](saveUpdates(_0xabdb72[_0x8560('0x59')],null))[_0x8560('0x20')](respondWithResult(_0x5ef74a,null))['catch'](handleError(_0x5ef74a,null));};exports[_0x8560('0x77')]=function(_0x3e2654,_0x34a622,_0x5965ec){var _0x481743=path['join'](config[_0x8560('0x78')],_0x8560('0x79'));var _0xf95084={'where':{'id':_0x3e2654[_0x8560('0x5f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x56a0b0=![];return require('../../config/license/util')['getLicense']()['then'](function(_0xae8d61){if(_0xae8d61){_0x56a0b0=_0xae8d61[_0x8560('0x7a')];}})[_0x8560('0x20')](function(){return db['ChatWebsite'][_0x8560('0x57')](_0xf95084);})[_0x8560('0x20')](handleEntityNotFound(_0x34a622,null))[_0x8560('0x20')](function(_0x55cc6f){if(_0x55cc6f){if(!_[_0x8560('0x7b')](_0x55cc6f[_0x8560('0x6f')])){if(fs['existsSync'](path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0x7d'),_0x55cc6f[_0x8560('0x6f')]))&&_0x56a0b0){_0x481743=path[_0x8560('0x7c')](config['root'],_0x8560('0x7d'),_0x55cc6f[_0x8560('0x6f')]);}}return _0x34a622['download'](_0x481743);}})[_0x8560('0x29')](handleError(_0x34a622,null));};exports[_0x8560('0x7e')]=function(_0x18a781,_0x25c479,_0x53a0a6){var _0x1b328c=path[_0x8560('0x7c')](config['root'],_0x8560('0x7f'));var _0xf9f989={'where':{'id':_0x18a781[_0x8560('0x5f')]['id']},'attributes':['id',_0x8560('0x71')],'raw':!![]};return db[_0x8560('0x3e')][_0x8560('0x57')](_0xf9f989)[_0x8560('0x20')](handleEntityNotFound(_0x25c479,null))['then'](function(_0x312583){if(_0x312583){if(!_[_0x8560('0x7b')](_0x312583[_0x8560('0x71')])){if(fs['existsSync'](path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0x80'),_0x312583[_0x8560('0x71')]))){_0x1b328c=path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0x80'),_0x312583[_0x8560('0x71')]);}}return _0x25c479['download'](_0x1b328c);}})[_0x8560('0x29')](handleError(_0x25c479,null));};exports[_0x8560('0x81')]=function(_0xad4743,_0x552ff6,_0xb96a8d){var _0x39ca48=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x51fc5c={'where':{'id':_0xad4743[_0x8560('0x5f')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x8560('0x3e')]['find'](_0x51fc5c)[_0x8560('0x20')](handleEntityNotFound(_0x552ff6,null))[_0x8560('0x20')](function(_0x528a78){if(_0x528a78){if(!_['isNil'](_0x528a78[_0x8560('0x74')])){if(fs[_0x8560('0x82')](path[_0x8560('0x7c')](config['root'],'server/files/images/avatars/',_0x528a78[_0x8560('0x74')]))&&_0x528a78['showCustomerAvatar']){_0x39ca48=path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0x80'),_0x528a78[_0x8560('0x74')]);}}return _0x552ff6[_0x8560('0x83')](_0x39ca48);}})['catch'](handleError(_0x552ff6,null));};exports[_0x8560('0x84')]=function(_0x574a03,_0x10276f,_0x2082df){var _0x4756d4=path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0x85'));var _0x1c34dc={'where':{'id':_0x574a03[_0x8560('0x5f')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8560('0x3e')]['find'](_0x1c34dc)[_0x8560('0x20')](handleEntityNotFound(_0x10276f,null))[_0x8560('0x20')](function(_0x16bffc){if(_0x16bffc){if(!_[_0x8560('0x7b')](_0x16bffc[_0x8560('0x76')])){if(fs[_0x8560('0x82')](path['join'](config[_0x8560('0x78')],'server/files/images/avatars/',_0x16bffc[_0x8560('0x76')]))){_0x4756d4=path[_0x8560('0x7c')](config[_0x8560('0x78')],'server/files/images/avatars/',_0x16bffc[_0x8560('0x76')]);}}return _0x10276f[_0x8560('0x83')](_0x4756d4);}})[_0x8560('0x29')](handleError(_0x10276f,null));};exports['notify']=function(_0x2cdc45,_0x340050,_0xe8073e){var _0x22b70d=require(_0x8560('0x86'));var _0x3dc593=new _0x22b70d();var _0x38f7e9=_0x3dc593['setUA'](_0x2cdc45['headers'][_0x8560('0x87')])['getResult']();var _0x49a573={'body':_0x2cdc45['body'],'channel':_0x8560('0x88')};var _0x2cbd6d=[];var _0x2d5279=[];var _0x2460df={};var _0x466eef=![];return db[_0x8560('0x89')][_0x8560('0x60')]()['then'](function(_0x3da66d){if(!_0x3da66d){throw new db[(_0x8560('0x8a'))]['ValidationError'](_0x8560('0x8b'));}_0x2cbd6d=_[_0x8560('0x8c')](_[_0x8560('0x44')](_0x3da66d),['createdAt',_0x8560('0x8d')]);_0x2d5279=_[_0x8560('0x8c')](_[_0x8560('0x44')](_0x3da66d),[_0x8560('0x8e'),_0x8560('0x8d'),_0x8560('0x8f'),_0x8560('0x90')]);if(_0x2cdc45[_0x8560('0x59')]['id']){delete _0x2cdc45[_0x8560('0x59')]['id'];}if(_[_0x8560('0x7b')](_0x2cdc45[_0x8560('0x59')]['from'])){throw new db[(_0x8560('0x8a'))][(_0x8560('0x91'))]('from\x20is\x20mandatory');}if(_[_0x8560('0x7b')](_0x2cdc45[_0x8560('0x59')][_0x8560('0x59')])||_0x2cdc45[_0x8560('0x59')][_0x8560('0x59')]===''){throw new db[(_0x8560('0x8a'))][(_0x8560('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8560('0x7b')](_0x2cdc45[_0x8560('0x59')]['mapKey'])){throw new db[(_0x8560('0x8a'))][(_0x8560('0x91'))](_0x8560('0x92')+_0x2d5279);}if(!_['includes'](_0x2d5279,_0x2cdc45[_0x8560('0x59')]['mapKey'])){throw new db[(_0x8560('0x8a'))][(_0x8560('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d5279);}_0x2460df[_0x2cdc45[_0x8560('0x59')][_0x8560('0x93')]]=_0x2cdc45[_0x8560('0x59')][_0x8560('0x94')];})[_0x8560('0x20')](function(){return db[_0x8560('0x3e')]['find']({'where':{'id':_0x2cdc45[_0x8560('0x5f')]['id']},'include':[{'model':db[_0x8560('0x95')],'as':'List','include':[{'model':db[_0x8560('0x89')],'as':_0x8560('0x96'),'where':_0x2460df,'limit':0x1,'order':[['updatedAt',_0x8560('0x97')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x8560('0x20')](handleEntityNotFound(_0x340050,null))[_0x8560('0x20')](function(_0x9ce799){if(_0x9ce799&&_0x9ce799[_0x8560('0x98')]){_0x49a573[_0x8560('0x99')]=_0x9ce799;_0x49a573['applications']=_0x9ce799[_0x8560('0x9a')];_0x49a573[_0x8560('0x9b')]=_0x9ce799['List'];_0x49a573[_0x8560('0x9c')]=_[_0x8560('0x9d')](_0x49a573[_0x8560('0x9c')],[_0x8560('0x9e')],['asc']);if(_0x49a573[_0x8560('0x99')][_0x8560('0x9a')]){delete _0x49a573[_0x8560('0x99')][_0x8560('0x9a')];}if(_0x49a573[_0x8560('0x99')][_0x8560('0x98')]&&_0x49a573[_0x8560('0x99')]['List'][_0x8560('0x96')][_0x8560('0x49')]){return _0x49a573['account'][_0x8560('0x98')][_0x8560('0x96')][0x0];}var _0x2fa213=_[_0x8560('0x19')](_0x2cdc45[_0x8560('0x59')],{'firstName':_0x2cdc45[_0x8560('0x59')][_0x8560('0x94')],'ListId':_0x9ce799[_0x8560('0x90')]});_0x2fa213[_0x2cdc45[_0x8560('0x59')][_0x8560('0x93')]]=_0x2cdc45['body'][_0x8560('0x94')];return db[_0x8560('0x89')]['create'](_0x2fa213,{'fields':_0x2cbd6d,'raw':!![]});}})['then'](handleEntityNotFound(_0x340050,null))[_0x8560('0x20')](function(_0x2f1212){_0x49a573[_0x8560('0x9f')]=_0x2f1212;var _0x5c6458=_0x2cdc45[_0x8560('0x59')]['customerIp'];if(_0x2cdc45[_0x8560('0xa0')]['cf-connecting-ip']){_0x5c6458=_0x2cdc45['headers'][_0x8560('0xa1')];}else if(_0x2cdc45['headers'][_0x8560('0xa2')]){_0x5c6458=_[_0x8560('0xa3')](_0x2cdc45[_0x8560('0xa0')]['x-forwarded-for'][_0x8560('0xa4')](','));}if(_0x2f1212){var _0xb90bdc={'ContactId':_0x2f1212['id'],'ChatWebsiteId':_0x2cdc45[_0x8560('0x5f')]['id'],'from':(_0x2f1212[_0x8560('0xa5')]||'')+'\x20'+(_0x2f1212[_0x8560('0xa6')]||''),'customerIp':_0x5c6458,'customerPort':_0x2cdc45['headers'][_0x8560('0xa7')]?_0x2cdc45[_0x8560('0xa0')][_0x8560('0xa7')]:null,'referer':_0x2cdc45['body'][_0x8560('0xa8')],'browserName':_0x38f7e9['browser']['name']&&_0x38f7e9[_0x8560('0xa9')][_0x8560('0xaa')]?util[_0x8560('0xab')](_0x8560('0xac'),_0x38f7e9[_0x8560('0xa9')]['name'],_0x38f7e9[_0x8560('0xa9')][_0x8560('0xaa')]):_0x8560('0xad'),'browserVersion':_0x38f7e9[_0x8560('0xa9')][_0x8560('0xaa')]||_0x8560('0xad'),'osName':util[_0x8560('0xab')](_0x8560('0xac'),_0x38f7e9['os'][_0x8560('0x39')],_0x38f7e9['os'][_0x8560('0xaa')]),'osVersion':_0x38f7e9['os'][_0x8560('0xaa')],'deviceModel':_0x38f7e9[_0x8560('0xae')][_0x8560('0x43')]&&_0x38f7e9['device'][_0x8560('0xaf')]?util['format'](_0x8560('0xb0'),_0x38f7e9[_0x8560('0xae')][_0x8560('0x43')],_0x38f7e9['device'][_0x8560('0xaf')],_0x38f7e9[_0x8560('0xae')][_0x8560('0x41')]):null,'deviceVendor':_0x38f7e9[_0x8560('0xae')][_0x8560('0xaf')],'deviceType':_0x38f7e9[_0x8560('0xae')][_0x8560('0x41')],'formData':JSON[_0x8560('0xb1')](_0x2cdc45[_0x8560('0x59')])};var _0x34449b={'ChatWebsiteId':_0x2cdc45['params']['id'],'closed':![]};if(_0x2cdc45['body'][_0x8560('0xb2')]){_0x34449b[_0x8560('0xb2')]=_0x2cdc45[_0x8560('0x59')][_0x8560('0xb2')];return db['ChatInteraction'][_0x8560('0x57')]({'where':_0x34449b})[_0x8560('0x20')](function(_0x1ed389){if(_0x1ed389){return[_0x1ed389,![]];}_0xb90bdc['threadId']=_0x2cdc45[_0x8560('0x59')][_0x8560('0xb2')];_0xb90bdc[_0x8560('0xb3')]=_0x2cdc45[_0x8560('0x59')]['externalUrl'];return db[_0x8560('0xb4')][_0x8560('0x58')](_0xb90bdc)['then'](function(_0x40bf33){return[_0x40bf33,!![]];});});}_0x34449b['ContactId']=_0x2f1212['id'];if(_0x2cdc45[_0x8560('0x59')]['interaction']&&_0x2cdc45[_0x8560('0x59')][_0x8560('0xb5')]['id']){_0x34449b['id']=_0x2cdc45[_0x8560('0x59')][_0x8560('0xb5')]['id'];return db[_0x8560('0xb4')][_0x8560('0x57')]({'where':_0x34449b})[_0x8560('0x20')](function(_0x564fd5){if(_0x564fd5){return[_0x564fd5,![]];}return db[_0x8560('0xb4')]['create'](_0xb90bdc)['then'](function(_0x38d822){return[_0x38d822,!![]];});});}return db[_0x8560('0xb4')][_0x8560('0x58')](_0xb90bdc)[_0x8560('0x20')](function(_0x3e3766){return[_0x3e3766,!![]];});}})[_0x8560('0xb6')](function(_0x2a7840,_0x4f0fd5){if(_0x2a7840){_0x466eef=_0x4f0fd5;if(!_0x4f0fd5){var _0xda054c={'from':(_0x49a573['contact'][_0x8560('0xa5')]||'')+'\x20'+(_0x49a573[_0x8560('0x9f')][_0x8560('0xa6')]||'')};if(_0x2cdc45[_0x8560('0x59')][_0x8560('0xb2')]&&_0x2cdc45['body']['messageId']&&_0x2cdc45[_0x8560('0x59')][_0x8560('0xb2')]!=_0x2cdc45[_0x8560('0x59')][_0x8560('0xb7')]){_0xda054c['threadId']=_0x2cdc45[_0x8560('0x59')][_0x8560('0xb7')];}return _0x2a7840[_0x8560('0x35')](_0xda054c);}else{return _0x2a7840;}}})['then'](function(_0x10cd9b){_0x49a573[_0x8560('0xb5')]=_0x10cd9b[_0x8560('0xb8')]({'plain':!![]});_0x49a573[_0x8560('0xb5')][_0x8560('0xb9')]=_0x466eef;if(_0x49a573['interaction'][_0x8560('0xb9')]){if(_0x49a573[_0x8560('0x99')][_0x8560('0xba')]){_0x49a573[_0x8560('0x9c')][_0x8560('0xbb')]({'id':0x0,'priority':_0x49a573[_0x8560('0x9c')][_0x8560('0x49')]+0x1,'app':'close','appdata':_0x8560('0xbc'),'interval':_0x8560('0xbd')});}}return db[_0x8560('0xbe')][_0x8560('0x58')]({'body':_0x2cdc45[_0x8560('0x59')][_0x8560('0x59')],'ChatWebsiteId':_0x2cdc45['params']['id'],'ChatInteractionId':_0x10cd9b['id'],'direction':'in','ContactId':_0x49a573[_0x8560('0x9f')]['id'],'AttachmentId':_0x2cdc45[_0x8560('0x59')][_0x8560('0xbf')]});})[_0x8560('0x20')](function(_0x532a91){_0x49a573['message']=_0x532a91;if(_0x49a573[_0x8560('0xb5')][_0x8560('0xc0')]){return db[_0x8560('0xc1')][_0x8560('0x57')]({'attributes':['id',_0x8560('0x39')],'where':{'id':_0x49a573[_0x8560('0xb5')][_0x8560('0xc0')]}})[_0x8560('0x20')](function(_0x4d06d1){if(_0x4d06d1){_0x49a573[_0x8560('0x9c')][_0x8560('0xc2')]({'id':0x0,'priority':0x0,'app':_0x8560('0xc3'),'appdata':_0x4d06d1[_0x8560('0x39')]+','+(_0x49a573['account'][_0x8560('0xc4')]||0xa),'interval':_0x8560('0xbd')});_0x49a573[_0x8560('0xc5')]=!![];}return respondWithRpcPromise(_0x8560('0xc6'),_0x8560('0xc7'),_0x49a573);});}return respondWithRpcPromise(_0x8560('0xc6'),_0x8560('0xc7'),_0x49a573);})[_0x8560('0x20')](function(_0x417ba2){respondWithRpcPromise(_0x8560('0xc8'),_0x8560('0xc8'),{'event':'notify','message':_0x417ba2},client9002);return _0x417ba2;})[_0x8560('0x20')](respondWithResult(_0x340050,null))[_0x8560('0x29')](handleError(_0x340050,null));};exports[_0x8560('0xc9')]=function(_0x127574,_0x4646f3,_0x30b54d){var _0x99b86b,_0x15ab28,_0x3cda30;var _0x5e72f6=[];var _0x46a36a=[];var _0x5ae119={};var _0x5efda9=_0x127574[_0x8560('0xca')]||[];var _0x35e8f8=[];var _0x434877;return db[_0x8560('0x89')][_0x8560('0x60')]()['then'](function(_0xc2462d){if(!_0xc2462d){throw new db['Sequelize'][(_0x8560('0x91'))](_0x8560('0x8b'));}_0x46a36a=_[_0x8560('0x8c')](_['keys'](_0xc2462d),[_0x8560('0x8e'),'updatedAt']);_0x5e72f6=_['difference'](_[_0x8560('0x44')](_0xc2462d),[_0x8560('0x8e'),'updatedAt',_0x8560('0x8f'),'ListId']);if(_0x127574[_0x8560('0x59')]['id']){delete _0x127574[_0x8560('0x59')]['id'];}if(_[_0x8560('0x7b')](_0x127574[_0x8560('0x59')][_0x8560('0x94')])){throw _0x4646f3[_0x8560('0x2b')](0x1f4)[_0x8560('0xcb')](new db[(_0x8560('0x8a'))][(_0x8560('0x91'))](_0x8560('0xcc')));}if(_[_0x8560('0x7b')](_0x127574[_0x8560('0x59')][_0x8560('0x59')])||_0x127574[_0x8560('0x59')]['body']===''){throw _0x4646f3['status'](0x1f4)[_0x8560('0xcb')](new db[(_0x8560('0x8a'))][(_0x8560('0x91'))](_0x8560('0xcd')));}if(_[_0x8560('0x7b')](_0x127574[_0x8560('0x59')][_0x8560('0xce')])){throw _0x4646f3['status'](0x1f4)[_0x8560('0xcb')](new db[(_0x8560('0x8a'))][(_0x8560('0x91'))](_0x8560('0xcf')+_0x5e72f6));}if(!_[_0x8560('0xd0')](_0x5e72f6,_0x127574[_0x8560('0x59')][_0x8560('0xce')])){throw _0x4646f3['status'](0x1f4)[_0x8560('0xcb')](new db[(_0x8560('0x8a'))][(_0x8560('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e72f6));}_0x5ae119[_0x127574['body']['mapKeyOffline']]=_0x127574[_0x8560('0x59')][_0x8560('0x94')];})[_0x8560('0x20')](function(){return db[_0x8560('0x3e')][_0x8560('0x57')]({'where':{'id':_0x127574[_0x8560('0x5f')]['id']},'include':[{'model':db[_0x8560('0x95')],'as':_0x8560('0x98')},{'model':db[_0x8560('0xd1')],'as':_0x8560('0xd1')}]});})[_0x8560('0x20')](handleEntityNotFound(_0x4646f3,null))[_0x8560('0x20')](function(_0x4103e7){if(_0x4103e7&&_0x4103e7['List']){_0x15ab28=_0x4103e7;var _0x4ed7e4=_[_0x8560('0x19')](_0x127574[_0x8560('0x59')],{'firstName':_0x127574['body']['from'],'phone':_0x127574[_0x8560('0x59')]['from'],'ListId':_0x4103e7['ListId']});_0x4ed7e4[_0x127574[_0x8560('0x59')][_0x8560('0xce')]]=_0x127574['body'][_0x8560('0x94')];return db['CmContact']['findOrCreate']({'where':_0x5ae119,'defaults':_0x4ed7e4});}})[_0x8560('0xb6')](function(_0x4e0562){if(_0x4e0562){_0x3cda30=_0x4e0562;var _0x4f4936=fs[_0x8560('0xd2')](path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0xd3')),_0x8560('0xd4'));var _0x51fbce=ejs[_0x8560('0xd5')](_0x4f4936,{'body':_[_0x8560('0xd6')](_0x127574['body'][_0x8560('0x59')]),'bodyTitle':_0x15ab28[_0x8560('0xd7')]});return db[_0x8560('0xd8')]['create']({'body':_0x51fbce,'ContactId':_0x4e0562['id'],'ChatWebsiteId':_0x15ab28['id']});}})[_0x8560('0x20')](function(_0x1a73d7){_0x434877=_0x1a73d7;if(_0x5efda9[_0x8560('0x49')]){var _0x52261b=_0x5efda9[_0x8560('0x3d')](function(_0x524f70){return{'name':_0x524f70[_0x8560('0xd9')],'basename':_0x524f70[_0x8560('0x70')],'type':_0x524f70[_0x8560('0xda')],'ChatOfflineMessageId':_0x1a73d7['id']};});_0x35e8f8=_0x52261b[_0x8560('0x3d')](_0x3ea7d6=>{var _0xd801a={'filename':_0x3ea7d6['name'],'path':path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0xdb'),_0x8560('0xca'),_0x8560('0xdc'),_0x8560('0xdd'),_0x3ea7d6['basename'])};return _0xd801a;});if(!_0x15ab28[_0x8560('0xde')]){return db[_0x8560('0xdf')][_0x8560('0xe0')](function(_0x19059d){return db['Attachment']['bulkCreate'](_0x52261b,{'transaction':_0x19059d});});}}})[_0x8560('0x20')](function(){if(_0x434877){_0x99b86b=_0x434877;return db['MailAccount'][_0x8560('0x6c')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8560('0xe1'),'raw':!![]}]});}})['then'](function(_0x5df022){if(_0x5df022&&_0x5df022[_0x8560('0xe1')]&&_0x15ab28[_0x8560('0xe2')]&&_0x15ab28[_0x8560('0xe3')]){var _0x849c41={'tls':{'rejectUnauthorized':![]}};if(_0x5df022[_0x8560('0xe1')][_0x8560('0xe4')]){_0x849c41[_0x8560('0xe4')]=_0x5df022[_0x8560('0xe1')][_0x8560('0xe4')];}else{_0x849c41[_0x8560('0xe5')]=_0x5df022['Smtp'][_0x8560('0xe5')];_0x849c41[_0x8560('0xe6')]=_0x5df022['Smtp'][_0x8560('0xe6')];_0x849c41[_0x8560('0xe7')]=_0x5df022[_0x8560('0xe1')][_0x8560('0xe7')];}if(_0x5df022[_0x8560('0xe1')][_0x8560('0xe8')]){_0x849c41[_0x8560('0xe9')]={'user':_0x5df022['Smtp'][_0x8560('0x5a')],'pass':_0x5df022[_0x8560('0xe1')][_0x8560('0xea')]};}return respondWithRpcPromise(_0x8560('0xeb'),_0x8560('0xec'),{'account':_0x849c41,'message':{'from':util[_0x8560('0xab')](_0x8560('0xed'),_0x5df022[_0x8560('0x39')],_0x5df022[_0x8560('0xee')]||_0x5df022[_0x8560('0xe1')][_0x8560('0x5a')]),'to':_0x15ab28[_0x8560('0xe3')],'subject':_0x15ab28['offlineMessageSubject'],'html':_0x99b86b[_0x8560('0x59')],'attachments':_0x35e8f8}},client9003)['then'](function(){return _0x99b86b;})['catch'](function(_0x3c093a){console[_0x8560('0x25')](_0x3c093a);});}})[_0x8560('0x20')](function(){if(_0x15ab28&&_0x15ab28[_0x8560('0xde')]&&_0x15ab28[_0x8560('0xef')]){var _0x492023=[];if(_0x5efda9[_0x8560('0x49')]){_0x492023=_0x5efda9[_0x8560('0x3d')](function(_0x12c8a0){return{'name':_0x12c8a0[_0x8560('0xd9')],'basename':_0x12c8a0['filename'],'type':_0x12c8a0[_0x8560('0xda')],'ChatOfflineMessageId':_0x434877['id']};});}var _0xf2cea3;if(!_[_0x8560('0x7b')](_0x15ab28[_0x8560('0xf0')])){var _0x33501b=_[_0x8560('0x3d')](_0x127574[_0x8560('0x59')],function(_0x4c1c73){return _0x4c1c73;});var _0x2147e8=_['toPairsIn'](_0x33501b)[0x0];var _0x2603f8=_[_0x8560('0xf1')](_0x2147e8,function(_0x3f63cd){return _0x3f63cd;});_0xf2cea3=_0x2603f8[0x1][_0x15ab28[_0x8560('0xf0')]];}var _0x1652fd={'from':_0x3cda30[_0x8560('0xee')],'firstName':_0x3cda30['firstName'],'lastName':_0x3cda30[_0x8560('0xa6')],'mapKey':_0x8560('0xee'),'message':{'from':_0x3cda30[_0x8560('0xee')],'to':_0x15ab28[_0x8560('0xd1')][_0x8560('0xee')],'cc':'','subject':_[_0x8560('0x7b')](_0xf2cea3)?_0x15ab28[_0x8560('0xf2')]:_0xf2cea3,'messageId':'','sentAt':new Date(),'attach':_0x492023[_0x8560('0x49')],'attachments':_0x492023,'originChannel':'Chat','ChatWebsiteId':_0x15ab28['id'],'ChatOfflineMessageId':_0x99b86b['id'],'originTo':_0x15ab28['MailAccount'][_0x8560('0xee')]},'body':_0x99b86b[_0x8560('0x59')]};var _0x29e5d2={'account':{'id':_0x15ab28[_0x8560('0xef')]},'body':_0x1652fd,'log':_0x8560('0xf3')};return respondWithRpcPromise(_0x8560('0xf3'),_0x8560('0xf4'),_0x29e5d2,client9001)[_0x8560('0x20')](function(){return _0x99b86b;})['catch'](function(_0x4cc1e2){console['error'](_0x4cc1e2);});}return;})[_0x8560('0x20')](function(){if(_0x99b86b){return _0x99b86b;}})[_0x8560('0x20')](respondWithResult(_0x4646f3,null))['catch'](function(_0x59a3c9){console[_0x8560('0x25')](_0x8560('0x29'),_0x59a3c9);for(var _0x394b17 of _0x5efda9){var _0x141d9a=path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0xdb'),'files',_0x8560('0xdc'),_0x8560('0xdd'),_0x394b17[_0x8560('0x70')]);fs_extra['remove'](_0x141d9a)[_0x8560('0x29')](function(_0x2df487){console[_0x8560('0x25')](_0x8560('0xf5'),_0x141d9a,_0x2df487);});}});};exports[_0x8560('0xf6')]=function(_0x2cbdce,_0x1a6c51,_0x4e5d12){return db[_0x8560('0xb4')][_0x8560('0x57')]({'where':{'id':_0x2cbdce['params']['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x1a6c51,null))[_0x8560('0x20')](function(_0x3d93fc){if(_0x3d93fc){return _0x3d93fc[_0x8560('0xf6')](_0x2cbdce[_0x8560('0x59')][_0x8560('0x68')],_['omit'](_0x2cbdce[_0x8560('0x59')],[_0x8560('0x68'),'id'])||{});}})['then'](respondWithResult(_0x1a6c51,null))['catch'](handleError(_0x1a6c51,null));};exports[_0x8560('0xf7')]=function(_0x427fe3,_0x41ac6b,_0x477d27){var _0x383038={'raw':![],'where':{}};var _0x32fcfa={};var _0x58cfc9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8560('0x6c')]({'where':{'id':_0x427fe3[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x41ac6b,null))[_0x8560('0x20')](function(_0xe15eb){if(_0xe15eb){_0x32fcfa['model']=_[_0x8560('0x44')](db[_0x8560('0xb4')][_0x8560('0x3f')]);_0x32fcfa[_0x8560('0x45')]=_[_0x8560('0x44')](_0x427fe3[_0x8560('0x45')]);_0x32fcfa[_0x8560('0x4e')]=_[_0x8560('0x46')](_0x32fcfa[_0x8560('0x43')],_0x32fcfa['query']);_0x383038[_0x8560('0x47')]=_['intersection'](_0x32fcfa[_0x8560('0x43')],qs[_0x8560('0x48')](_0x427fe3[_0x8560('0x45')]['fields']));_0x383038['attributes']=_0x383038[_0x8560('0x47')][_0x8560('0x49')]?_0x383038[_0x8560('0x47')]:_0x32fcfa[_0x8560('0x43')];if(!_0x427fe3[_0x8560('0x45')][_0x8560('0x4a')](_0x8560('0x65'))){_0x383038[_0x8560('0x2f')]=qs['limit'](_0x427fe3['query']['limit']);_0x383038[_0x8560('0x2d')]=qs[_0x8560('0x2d')](_0x427fe3[_0x8560('0x45')][_0x8560('0x2d')]);}_0x383038['order']=qs[_0x8560('0x4c')](_0x427fe3[_0x8560('0x45')][_0x8560('0x4c')]);_0x383038['where']=qs['filters'](_[_0x8560('0x66')](_0x427fe3[_0x8560('0x45')],_0x32fcfa['filters']));_0x383038[_0x8560('0x4d')][_0x8560('0x62')]=_0xe15eb['id'];if(_0x427fe3[_0x8560('0x45')][_0x8560('0x4f')]){_0x383038[_0x8560('0x4d')]=_[_0x8560('0x50')](_0x383038[_0x8560('0x4d')],{'$or':_[_0x8560('0x3d')](_0x383038[_0x8560('0x47')],function(_0x5b3645){var _0x2ab474={};_0x2ab474[_0x5b3645]={'$like':'%'+_0x427fe3[_0x8560('0x45')][_0x8560('0x4f')]+'%'};return _0x2ab474;})});}_0x383038=_[_0x8560('0x50')]({},_0x383038,_0x427fe3['options']);return db[_0x8560('0xb4')]['count']({'where':_0x383038[_0x8560('0x4d')]})[_0x8560('0x20')](function(_0x593511){_0x58cfc9[_0x8560('0x30')]=_0x593511;if(_0x427fe3[_0x8560('0x45')][_0x8560('0x53')]){_0x383038[_0x8560('0x54')]=[{'model':db[_0x8560('0x89')],'as':_0x8560('0xf8'),'required':![]},{'model':db[_0x8560('0xc1')],'as':_0x8560('0xf9'),'attributes':['name',_0x8560('0xfa'),_0x8560('0xfb')],'required':![]},{'model':db[_0x8560('0xfc')],'as':_0x8560('0xfd'),'attributes':['id',_0x8560('0x39'),_0x8560('0xfe')],'where':_0x427fe3[_0x8560('0x45')]['tag']?{'id':_0x427fe3['query'][_0x8560('0xff')]}:undefined,'required':_0x427fe3['query']['tag']?!![]:![]}];}return db[_0x8560('0xb4')][_0x8560('0x55')](_0x383038);})['then'](function(_0x3852ac){_0x58cfc9[_0x8560('0x56')]=_0x3852ac;return _0x58cfc9;});}})[_0x8560('0x20')](respondWithFilteredResult(_0x41ac6b,_0x383038))['catch'](handleError(_0x41ac6b,null));};function iftimePromise(_0x5967f2,_0x583860){return respondWithRpcPromise(_0x8560('0x100'),_0x8560('0x101'),{'command':_0x583860['timezone']?util[_0x8560('0xab')](_0x8560('0x102'),_0x5967f2[_0x8560('0x103')],_0x583860[_0x8560('0x104')]):util[_0x8560('0xab')]('iftime\x20%s',_0x5967f2[_0x8560('0x103')])},client9002)['then'](function(_0x4f118f){var _0x1ea28f=_0x4f118f&&_0x4f118f[_0x8560('0x105')](_0x8560('0x106'))>=0x0?!![]:![];logger[_0x8560('0x27')](_0x8560('0x107'),_0x583860['id'],_0x5967f2['id'],_0x5967f2[_0x8560('0x103')],_0x1ea28f?_0x8560('0x108'):_0x8560('0x109'),_0x583860[_0x8560('0x104')]?_0x583860[_0x8560('0x104')]:_0x8560('0x10a'));return _0x1ea28f;})[_0x8560('0x29')](function(_0x1a2a3f){logger[_0x8560('0x25')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x583860['id'],_0x5967f2['id'],_0x5967f2['interval'],util[_0x8560('0x10b')](_0x1a2a3f,{'showHidden':![],'depth':null}),_0x583860[_0x8560('0x104')]?_0x583860['timezone']:_0x8560('0x10a'));return![];});}exports[_0x8560('0x101')]=function(_0x4d907e,_0x3bed23,_0x1dd971){var _0x1bed67=0x0;var _0x1cbe3e=0x0;var _0x137d49=![];var _0x234ce7;var _0x33256c;return db[_0x8560('0x3e')]['find']({'where':{'id':_0x4d907e['params']['id']},'include':[{'model':db[_0x8560('0x10c')],'as':'Interval','include':[{'model':db[_0x8560('0x10c')],'as':_0x8560('0x10d'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x8560('0x20')](handleEntityNotFound(_0x3bed23,null))[_0x8560('0x20')](function(_0xb3191b){if(_0xb3191b){_0x234ce7=_0xb3191b;return _0xb3191b['getProactiveActions']({'raw':!![]});}})['then'](function(_0x1f0981){if(_0x234ce7){if(_0x1f0981){_0x33256c=_0x1f0981;}}return require(_0x8560('0x10e'))[_0x8560('0x10f')]();})['then'](function(_0x1e2f13){if(_0x1e2f13){_0x1cbe3e=_0x1e2f13[_0x8560('0x110')];_0x137d49=_0x1e2f13[_0x8560('0x7a')];}})[_0x8560('0x20')](function(){return db[_0x8560('0xb4')][_0x8560('0x30')]({'where':{'closed':![]}});})[_0x8560('0x20')](function(_0x38a17a){_0x1bed67=_0x38a17a;if(_0x1cbe3e&&_0x38a17a>_0x1cbe3e){return db[_0x8560('0x111')][_0x8560('0x6c')]({'where':{'id':0x1}})[_0x8560('0x20')](function(_0x3a6f48){if(_0x3a6f48){_0x3a6f48[_0x8560('0x112')]('chatLicenseExceeded');}});}})[_0x8560('0x20')](function(){if(_0x234ce7[_0x8560('0x10c')]&&_0x234ce7[_0x8560('0x10c')][_0x8560('0x10d')]){var _0x142eef=[];for(var _0x2d9802=0x0;_0x2d9802<_0x234ce7[_0x8560('0x10c')]['Intervals']['length'];_0x2d9802++){var _0xe7570=_0x234ce7[_0x8560('0x10c')][_0x8560('0x10d')][_0x2d9802]['get']({'plain':!![]});_0x142eef['push'](iftimePromise(_0xe7570,_0x234ce7));}return BPromise[_0x8560('0x113')](_0x142eef)[_0x8560('0x20')](function(_0x52f878){return _['some'](_0x52f878);});}else{return!![];}})[_0x8560('0x20')](function(_0x3a5231){var _0x519335=fs['readFileSync'](path[_0x8560('0x7c')](config[_0x8560('0x78')],_0x8560('0x114')),_0x8560('0xd4'));var _0x31fe79={'remote':_0x234ce7[_0x8560('0x115')],'query':querystring[_0x8560('0xb1')](_[_0x8560('0x50')](_0x234ce7[_0x8560('0xb8')]({'plain':!![]}),{'customerIp':_0x4d907e[_0x8560('0xa0')][_0x8560('0xa2')]||_0x4d907e[_0x8560('0xa0')][_0x8560('0x116')]||_0x4d907e['connection'][_0x8560('0x117')]||_0x4d907e['ip'],'referer':_0x4d907e[_0x8560('0xa0')]['referer'],'openedInteractions':_0x1bed67,'maxInteractions':_0x1cbe3e,'virtual':_0x137d49[_0x8560('0x110')],'online':_0x3a5231,'custom':_0x137d49}))[_0x8560('0x118')](/'/g,'\x5c\x27')};_0x3bed23[_0x8560('0xcb')](ejs['render'](Mustache['render'](_0x519335,_0x31fe79),{'proactiveActions':_0x33256c,'alignment':_0x234ce7[_0x8560('0x119')],'verticalAlignment':_0x234ce7['verticalAlignment'],'div_color':_0x234ce7[_0x8560('0xfe')],'text_color':_0x234ce7[_0x8560('0x11a')],'button_color':_0x234ce7[_0x8560('0x11b')],'background_color':_0x234ce7['backgroundColor']}));})[_0x8560('0x29')](handleError(_0x3bed23,null));};exports[_0x8560('0x11c')]=function(_0x535e20,_0x4c0a7e,_0x5a6058){return db['ChatWebsite'][_0x8560('0x6c')]({'where':{'id':_0x535e20[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x4c0a7e,null))[_0x8560('0x20')](function(_0x2b5ef1){if(_0x2b5ef1){return db[_0x8560('0xdf')][_0x8560('0xe0')](function(_0x332684){return db[_0x8560('0x11d')]['destroy']({'where':{'ChatWebsiteId':_0x535e20['params']['id']},'transaction':_0x332684})['then'](function(_0x5ec5c0){var _0x5dc3fd=_[_0x8560('0x3d')](_0x535e20[_0x8560('0x59')],function(_0x2aa156){_0x2aa156['ChatWebsiteId']=_0x535e20[_0x8560('0x5f')]['id'];return _0x2aa156;});return db[_0x8560('0x11d')][_0x8560('0x11e')](_0x5dc3fd,{'transaction':_0x332684});});})['then'](function(){return db[_0x8560('0x11d')][_0x8560('0x11f')]({'where':{'ChatWebsiteId':_0x535e20['params']['id']},'order':_0x8560('0x9e')});});}})[_0x8560('0x20')](respondWithResult(_0x4c0a7e,null))['catch'](handleError(_0x4c0a7e,null));};exports[_0x8560('0x120')]=function(_0x230379,_0x2fcef4,_0x108c3b){var _0x97b65d={};var _0x3aa14c={};var _0x3a73ed;var _0x167902;return db[_0x8560('0x3e')][_0x8560('0x6c')]({'where':{'id':_0x230379[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x2fcef4,null))[_0x8560('0x20')](function(_0x3023fe){if(_0x3023fe){_0x3a73ed=_0x3023fe;_0x3aa14c[_0x8560('0x43')]=_[_0x8560('0x44')](db[_0x8560('0x11d')][_0x8560('0x3f')]);_0x3aa14c[_0x8560('0x45')]=_[_0x8560('0x44')](_0x230379['query']);_0x3aa14c[_0x8560('0x4e')]=_['intersection'](_0x3aa14c[_0x8560('0x43')],_0x3aa14c[_0x8560('0x45')]);_0x97b65d[_0x8560('0x47')]=_['intersection'](_0x3aa14c[_0x8560('0x43')],qs[_0x8560('0x48')](_0x230379[_0x8560('0x45')]['fields']));_0x97b65d[_0x8560('0x47')]=_0x97b65d['attributes'][_0x8560('0x49')]?_0x97b65d[_0x8560('0x47')]:_0x3aa14c['model'];_0x97b65d[_0x8560('0x4b')]=qs[_0x8560('0x4c')](_0x230379[_0x8560('0x45')][_0x8560('0x4c')]);_0x97b65d[_0x8560('0x4d')]=qs[_0x8560('0x4e')](_[_0x8560('0x66')](_0x230379[_0x8560('0x45')],_0x3aa14c[_0x8560('0x4e')]));if(_0x230379[_0x8560('0x45')][_0x8560('0x4f')]){_0x97b65d[_0x8560('0x4d')]=_[_0x8560('0x50')](_0x97b65d[_0x8560('0x4d')],{'$or':_['map'](_0x97b65d['attributes'],function(_0x3b1409){var _0x3261cd={};_0x3261cd[_0x3b1409]={'$like':'%'+_0x230379[_0x8560('0x45')][_0x8560('0x4f')]+'%'};return _0x3261cd;})});}_0x97b65d=_[_0x8560('0x50')]({},_0x97b65d,_0x230379[_0x8560('0x52')]);return _0x3a73ed[_0x8560('0x120')](_0x97b65d);}})[_0x8560('0x20')](function(_0x4dc65a){if(_0x4dc65a){_0x167902=_0x4dc65a[_0x8560('0x49')];if(!_0x230379[_0x8560('0x45')][_0x8560('0x4a')](_0x8560('0x65'))){_0x97b65d[_0x8560('0x2f')]=qs[_0x8560('0x2f')](_0x230379[_0x8560('0x45')][_0x8560('0x2f')]);_0x97b65d[_0x8560('0x2d')]=qs[_0x8560('0x2d')](_0x230379[_0x8560('0x45')][_0x8560('0x2d')]);}return _0x3a73ed[_0x8560('0x120')](_0x97b65d);}})[_0x8560('0x20')](function(_0x1f0529){if(_0x1f0529){return _0x1f0529?{'count':_0x167902,'rows':_0x1f0529}:null;}})[_0x8560('0x20')](respondWithResult(_0x2fcef4,null))[_0x8560('0x29')](handleError(_0x2fcef4,null));};exports[_0x8560('0x121')]=function(_0x40b156,_0x17070f,_0xb2b69e){return db[_0x8560('0x122')][_0x8560('0x57')]({'where':{'id':_0x40b156['params']['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x17070f,null))[_0x8560('0x20')](function(_0x567233){if(_0x567233){return _0x567233[_0x8560('0x121')](_0x40b156[_0x8560('0x59')][_0x8560('0x68')],_[_0x8560('0x123')](_0x40b156[_0x8560('0x59')],[_0x8560('0x68'),'id'])||{});}})[_0x8560('0x20')](respondWithResult(_0x17070f,null))[_0x8560('0x29')](handleError(_0x17070f,null));};exports[_0x8560('0x124')]=function(_0x1f4bb8,_0x101c76,_0x3279d4){var _0x3730b2={};var _0x113507={};var _0x1d8c77;var _0x545dcd;return db[_0x8560('0x3e')][_0x8560('0x6c')]({'where':{'id':_0x1f4bb8[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x101c76,null))[_0x8560('0x20')](function(_0x1c3f13){if(_0x1c3f13){_0x1d8c77=_0x1c3f13;_0x113507['model']=_[_0x8560('0x44')](db[_0x8560('0x125')][_0x8560('0x3f')]);_0x113507['query']=_[_0x8560('0x44')](_0x1f4bb8[_0x8560('0x45')]);_0x113507[_0x8560('0x4e')]=_[_0x8560('0x46')](_0x113507['model'],_0x113507['query']);_0x3730b2[_0x8560('0x47')]=_['intersection'](_0x113507[_0x8560('0x43')],qs['fields'](_0x1f4bb8[_0x8560('0x45')][_0x8560('0x48')]));_0x3730b2[_0x8560('0x47')]=_0x3730b2[_0x8560('0x47')][_0x8560('0x49')]?_0x3730b2['attributes']:_0x113507[_0x8560('0x43')];_0x3730b2[_0x8560('0x4b')]=qs[_0x8560('0x4c')](_0x1f4bb8[_0x8560('0x45')]['sort']);_0x3730b2[_0x8560('0x4d')]=qs['filters'](_['pick'](_0x1f4bb8['query'],_0x113507[_0x8560('0x4e')]));if(_0x1f4bb8['query'][_0x8560('0x4f')]){_0x3730b2[_0x8560('0x4d')]=_[_0x8560('0x50')](_0x3730b2['where'],{'$or':_['map'](_0x3730b2[_0x8560('0x47')],function(_0x29c203){var _0x545b08={};_0x545b08[_0x29c203]={'$like':'%'+_0x1f4bb8[_0x8560('0x45')][_0x8560('0x4f')]+'%'};return _0x545b08;})});}_0x3730b2=_['merge']({},_0x3730b2,_0x1f4bb8[_0x8560('0x52')]);return _0x1d8c77[_0x8560('0x124')](_0x3730b2);}})[_0x8560('0x20')](function(_0x5dba){if(_0x5dba){_0x545dcd=_0x5dba[_0x8560('0x49')];if(!_0x1f4bb8[_0x8560('0x45')]['hasOwnProperty'](_0x8560('0x65'))){_0x3730b2[_0x8560('0x2f')]=qs[_0x8560('0x2f')](_0x1f4bb8[_0x8560('0x45')][_0x8560('0x2f')]);_0x3730b2[_0x8560('0x2d')]=qs[_0x8560('0x2d')](_0x1f4bb8[_0x8560('0x45')][_0x8560('0x2d')]);}return _0x1d8c77['getProactiveActions'](_0x3730b2);}})[_0x8560('0x20')](function(_0x658dc7){if(_0x658dc7){return _0x658dc7?{'count':_0x545dcd,'rows':_0x658dc7}:null;}})['then'](respondWithResult(_0x101c76,null))[_0x8560('0x29')](handleError(_0x101c76,null));};exports[_0x8560('0x126')]=function(_0x58d354,_0x5dc2a0,_0x3425d1){var _0x2ae939=_0x58d354[_0x8560('0x45')][_0x8560('0x127')]===_0x8560('0x128')?_0x8560('0x129'):_0x8560('0x12a');return db[_0x8560('0x3e')]['find']({'attributes':['id',_0x2ae939],'where':{'id':_0x58d354[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x5dc2a0,null))[_0x8560('0x20')](function(_0x34e963){if(_0x34e963){var _0x557b24=_0x34e963[_0x2ae939];var _0x3da65c=_0x557b24&&_0x557b24[_0x8560('0x12b')]?_0x557b24[_0x8560('0x12b')]:[];_0x5dc2a0['send']({'fromKey':_['isNil'](_0x557b24[_0x8560('0x12c')])?undefined:_0x557b24['fromKey'],'count':_0x3da65c[_0x8560('0x49')],'rows':_0x3da65c});}})[_0x8560('0x29')](handleError(_0x5dc2a0,null));};exports['getOfflineMessages']=function(_0x4843b9,_0x2980a6,_0x65ff36){var _0x11c5a3={'raw':![],'where':{}};var _0x25710c={};var _0x1becc7={'count':0x0,'rows':[]};return db[_0x8560('0x3e')][_0x8560('0x6c')]({'where':{'id':_0x4843b9[_0x8560('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2980a6,null))[_0x8560('0x20')](function(_0x2d33fb){if(_0x2d33fb){_0x25710c['model']=_[_0x8560('0x44')](db['ChatOfflineMessage'][_0x8560('0x3f')]);_0x25710c[_0x8560('0x45')]=_[_0x8560('0x44')](_0x4843b9['query']);_0x25710c[_0x8560('0x4e')]=_[_0x8560('0x46')](_0x25710c['model'],_0x25710c[_0x8560('0x45')]);_0x11c5a3[_0x8560('0x47')]=_[_0x8560('0x46')](_0x25710c[_0x8560('0x43')],qs[_0x8560('0x48')](_0x4843b9[_0x8560('0x45')][_0x8560('0x48')]));_0x11c5a3[_0x8560('0x47')]=_0x11c5a3[_0x8560('0x47')][_0x8560('0x49')]?_0x11c5a3['attributes']:_0x25710c['model'];if(!_0x4843b9['query'][_0x8560('0x4a')]('nolimit')){_0x11c5a3[_0x8560('0x2f')]=qs['limit'](_0x4843b9['query'][_0x8560('0x2f')]);_0x11c5a3[_0x8560('0x2d')]=qs['offset'](_0x4843b9[_0x8560('0x45')][_0x8560('0x2d')]);}_0x11c5a3['order']=qs[_0x8560('0x4c')](_0x4843b9[_0x8560('0x45')]['sort']);_0x11c5a3[_0x8560('0x4d')]=qs[_0x8560('0x4e')](_[_0x8560('0x66')](_0x4843b9[_0x8560('0x45')],_0x25710c['filters']));_0x11c5a3[_0x8560('0x4d')][_0x8560('0x62')]=_0x2d33fb['id'];if(_0x4843b9[_0x8560('0x45')]['filter']){_0x11c5a3[_0x8560('0x4d')]=_[_0x8560('0x50')](_0x11c5a3[_0x8560('0x4d')],{'$or':_[_0x8560('0x3d')](_0x11c5a3[_0x8560('0x47')],function(_0x24d192){var _0x312c6e={};_0x312c6e[_0x24d192]={'$like':'%'+_0x4843b9['query']['filter']+'%'};return _0x312c6e;})});}_0x11c5a3=_['merge']({},_0x11c5a3,_0x4843b9['options']);return db[_0x8560('0xd8')][_0x8560('0x30')]({'where':_0x11c5a3[_0x8560('0x4d')]})['then'](function(_0x560f02){_0x1becc7['count']=_0x560f02;if(_0x4843b9[_0x8560('0x45')][_0x8560('0x53')]){_0x11c5a3[_0x8560('0x54')]=[{'all':!![]}];}else{_0x11c5a3['include']=[{'model':db[_0x8560('0x89')],'as':'Contact','required':![]},{'model':db[_0x8560('0x12d')],'as':_0x8560('0x12e'),'required':![]}];}return db[_0x8560('0xd8')]['findAll'](_0x11c5a3);})[_0x8560('0x20')](function(_0x37f23f){_0x1becc7[_0x8560('0x56')]=_0x37f23f;return _0x1becc7;});}})['then'](respondWithFilteredResult(_0x2980a6,_0x11c5a3))['catch'](handleError(_0x2980a6,null));};exports['addAgents']=function(_0x1e869f,_0x3e6642,_0x214fcd){return db[_0x8560('0x3e')][_0x8560('0x57')]({'where':{'id':_0x1e869f[_0x8560('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e6642,null))[_0x8560('0x20')](function(_0x4c4a29){if(_0x4c4a29){return _0x4c4a29[_0x8560('0x12f')](_0x1e869f[_0x8560('0x59')][_0x8560('0x68')],_['omit'](_0x1e869f[_0x8560('0x59')],[_0x8560('0x68'),'id'])||{})[_0x8560('0xb6')](function(_0x52b696){for(var _0x484a65=0x0;_0x484a65<_0x1e869f[_0x8560('0x59')]['ids'][_0x8560('0x49')];_0x484a65+=0x1){socket[_0x8560('0x130')](_0x8560('0x131'),{'UserId':Number(_0x1e869f[_0x8560('0x59')][_0x8560('0x68')][_0x484a65]),'ChatWebsiteId':Number(_0x1e869f[_0x8560('0x5f')]['id'])});}return _0x52b696;});}})[_0x8560('0x20')](respondWithResult(_0x3e6642,null))[_0x8560('0x29')](handleError(_0x3e6642,null));};exports[_0x8560('0x132')]=function(_0x4efe94,_0x2f309e,_0x493e2b){return db[_0x8560('0x3e')]['find']({'where':{'id':_0x4efe94[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x2f309e,null))['then'](function(_0x2369e8){if(_0x2369e8){return _0x2369e8['removeAgents'](_0x4efe94[_0x8560('0x45')]['ids'])['then'](function(){if(_[_0x8560('0x133')](_0x4efe94['query'][_0x8560('0x68')])){for(var _0x7d7c9d=0x0;_0x7d7c9d<_0x4efe94[_0x8560('0x45')][_0x8560('0x68')]['length'];_0x7d7c9d+=0x1){socket[_0x8560('0x130')](_0x8560('0x134'),{'UserId':Number(_0x4efe94[_0x8560('0x45')][_0x8560('0x68')][_0x7d7c9d]),'ChatWebsiteId':Number(_0x4efe94[_0x8560('0x5f')]['id'])});}}else{socket[_0x8560('0x130')](_0x8560('0x134'),{'UserId':Number(_0x4efe94[_0x8560('0x45')][_0x8560('0x68')]),'ChatWebsiteId':Number(_0x4efe94['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2f309e,null))[_0x8560('0x29')](handleError(_0x2f309e,null));};exports[_0x8560('0x135')]=function(_0xc17d88,_0x2e3d03,_0x4e330e){var _0x29e457={};var _0x5760b3={};var _0x23f1e8;var _0x31c4ff;return db[_0x8560('0x3e')][_0x8560('0x6c')]({'where':{'id':_0xc17d88[_0x8560('0x5f')]['id']}})[_0x8560('0x20')](handleEntityNotFound(_0x2e3d03,null))[_0x8560('0x20')](function(_0x46e8c9){if(_0x46e8c9){_0x23f1e8=_0x46e8c9;_0x5760b3['model']=_['keys'](db[_0x8560('0xc1')][_0x8560('0x3f')]);_0x5760b3[_0x8560('0x45')]=_['keys'](_0xc17d88[_0x8560('0x45')]);_0x5760b3[_0x8560('0x4e')]=_['intersection'](_0x5760b3['model'],_0x5760b3['query']);_0x29e457['attributes']=_[_0x8560('0x46')](_0x5760b3[_0x8560('0x43')],qs['fields'](_0xc17d88[_0x8560('0x45')]['fields']));_0x29e457[_0x8560('0x47')]=_0x29e457[_0x8560('0x47')][_0x8560('0x49')]?_0x29e457['attributes']:_0x5760b3[_0x8560('0x43')];_0x29e457[_0x8560('0x4b')]=qs[_0x8560('0x4c')](_0xc17d88[_0x8560('0x45')][_0x8560('0x4c')]);_0x29e457[_0x8560('0x4d')]=qs[_0x8560('0x4e')](_[_0x8560('0x66')](_0xc17d88[_0x8560('0x45')],_0x5760b3[_0x8560('0x4e')]));if(_0xc17d88[_0x8560('0x45')]['filter']){_0x29e457['where']=_[_0x8560('0x50')](_0x29e457[_0x8560('0x4d')],{'$or':_[_0x8560('0x3d')](_0x29e457[_0x8560('0x47')],function(_0x398672){var _0x46e759={};_0x46e759[_0x398672]={'$like':'%'+_0xc17d88['query'][_0x8560('0x4f')]+'%'};return _0x46e759;})});}_0x29e457=_[_0x8560('0x50')]({},_0x29e457,_0xc17d88[_0x8560('0x52')]);return _0x23f1e8[_0x8560('0x135')](_0x29e457);}})[_0x8560('0x20')](function(_0x4ce9ad){if(_0x4ce9ad){_0x31c4ff=_0x4ce9ad[_0x8560('0x49')];if(!_0xc17d88[_0x8560('0x45')][_0x8560('0x4a')]('nolimit')){_0x29e457[_0x8560('0x2f')]=qs['limit'](_0xc17d88[_0x8560('0x45')][_0x8560('0x2f')]);_0x29e457[_0x8560('0x2d')]=qs[_0x8560('0x2d')](_0xc17d88[_0x8560('0x45')][_0x8560('0x2d')]);}return _0x23f1e8[_0x8560('0x135')](_0x29e457);}})[_0x8560('0x20')](function(_0x52c095){if(_0x52c095){return _0x52c095?{'count':_0x31c4ff,'rows':_0x52c095}:null;}})['then'](respondWithResult(_0x2e3d03,null))[_0x8560('0x29')](handleError(_0x2e3d03,null));};
\ No newline at end of file
+var _0xa2b2=['attachments','offline-chat','openNewInteraction','sequelize','transaction','bulkCreate','findOne','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','internal','Tags','color','tag','getSnippet','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','utf8','remote','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','squel','crypto','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./chatWebsite.socket','http','client','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','get','ChatWebsites','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','options','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','ChatApplication','Applications','account','applications','list','priority','asc','Contacts','contact','customerIp','headers','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','update','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','mimetype','server','files'];(function(_0x124bd1,_0x124a1a){var _0x488899=function(_0x1f7208){while(--_0x1f7208){_0x124bd1['push'](_0x124bd1['shift']());}};_0x488899(++_0x124a1a);}(_0xa2b2,0x189));var _0x2a2b=function(_0x333749,_0x5807c4){_0x333749=_0x333749-0x0;var _0x57be8c=_0xa2b2[_0x333749];return _0x57be8c;};'use strict';var emlformat=require(_0x2a2b('0x0'));var rimraf=require(_0x2a2b('0x1'));var zipdir=require(_0x2a2b('0x2'));var jsonpatch=require(_0x2a2b('0x3'));var rp=require('request-promise');var moment=require(_0x2a2b('0x4'));var BPromise=require(_0x2a2b('0x5'));var Mustache=require('mustache');var util=require(_0x2a2b('0x6'));var path=require(_0x2a2b('0x7'));var sox=require('sox');var csv=require(_0x2a2b('0x8'));var ejs=require(_0x2a2b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a2b('0xa'));var crypto=require(_0x2a2b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2a2b('0xc'));var toCsv=require(_0x2a2b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2a2b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a2b('0xe'))(_0x2a2b('0xf'));var utils=require(_0x2a2b('0x10'));var config=require(_0x2a2b('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2a2b('0x12')]=_[_0x2a2b('0x13')](config[_0x2a2b('0x12')],{'host':_0x2a2b('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a2b('0x12')]));require(_0x2a2b('0x15'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2a2b('0x16')]({'port':0x232c});var client9002=jayson[_0x2a2b('0x17')]['http']({'port':0x232a});var client9003=jayson[_0x2a2b('0x17')][_0x2a2b('0x16')]({'port':0x232b});var client9001=jayson[_0x2a2b('0x17')]['http']({'port':0x2329});function respondWithRpcPromise(_0x24dbb8,_0x87f1e4,_0x2af41c,_0xaf4be4){return new BPromise(function(_0x37790d,_0x4f60b5){var _0x35c539=_0xaf4be4||client;return _0x35c539['request'](_0x24dbb8,_0x2af41c)['then'](function(_0x4eaeca){logger['info'](_0x2a2b('0x18'),_0x87f1e4,_0x2a2b('0x19'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x87f1e4,_0x2a2b('0x19'),JSON[_0x2a2b('0x1a')](_0x4eaeca));if(_0x4eaeca[_0x2a2b('0x1b')]){if(_0x4eaeca[_0x2a2b('0x1b')][_0x2a2b('0x1c')]===0x1f4){logger[_0x2a2b('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x87f1e4,_0x4eaeca[_0x2a2b('0x1b')][_0x2a2b('0x1d')]);return _0x4f60b5(_0x4eaeca[_0x2a2b('0x1b')]['message']);}logger[_0x2a2b('0x1b')](_0x2a2b('0x18'),_0x87f1e4,_0x4eaeca[_0x2a2b('0x1b')]['message']);return _0x37790d(_0x4eaeca['error'][_0x2a2b('0x1d')]);}else{logger[_0x2a2b('0x1e')](_0x2a2b('0x18'),_0x87f1e4,'request\x20sent');_0x37790d(_0x4eaeca[_0x2a2b('0x1f')][_0x2a2b('0x1d')]);}})[_0x2a2b('0x20')](function(_0x33eaa3){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x87f1e4,_0x33eaa3);_0x4f60b5(_0x33eaa3);});});}function respondWithStatusCode(_0x5a0a5c,_0x3bd305){_0x3bd305=_0x3bd305||0xcc;return function(_0x56240e){if(_0x56240e){return _0x5a0a5c[_0x2a2b('0x21')](_0x3bd305);}return _0x5a0a5c['status'](_0x3bd305)[_0x2a2b('0x22')]();};}function respondWithResult(_0x15cd26,_0x3851a7){_0x3851a7=_0x3851a7||0xc8;return function(_0x2562d1){if(_0x2562d1){return _0x15cd26[_0x2a2b('0x23')](_0x3851a7)[_0x2a2b('0x24')](_0x2562d1);}};}function respondWithFilteredResult(_0x5bc867,_0x165b5a){return function(_0x419990){if(_0x419990){var _0x131f8a=typeof _0x165b5a[_0x2a2b('0x25')]==='undefined'&&typeof _0x165b5a[_0x2a2b('0x26')]===_0x2a2b('0x27');var _0x1bdedd=_0x419990['count'];var _0x30e973=_0x131f8a?0x0:_0x165b5a[_0x2a2b('0x25')];var _0x5e48e4=_0x131f8a?_0x419990[_0x2a2b('0x28')]:_0x165b5a[_0x2a2b('0x25')]+_0x165b5a['limit'];var _0x3e1cc5;if(_0x5e48e4>=_0x1bdedd){_0x5e48e4=_0x1bdedd;_0x3e1cc5=0xc8;}else{_0x3e1cc5=0xce;}_0x5bc867[_0x2a2b('0x23')](_0x3e1cc5);return _0x5bc867[_0x2a2b('0x29')](_0x2a2b('0x2a'),_0x30e973+'-'+_0x5e48e4+'/'+_0x1bdedd)[_0x2a2b('0x24')](_0x419990);}return null;};}function patchUpdates(_0x884bcd){return function(_0x7a13be){try{jsonpatch[_0x2a2b('0x2b')](_0x7a13be,_0x884bcd,!![]);}catch(_0x182d1d){return BPromise[_0x2a2b('0x2c')](_0x182d1d);}return _0x7a13be[_0x2a2b('0x2d')]();};}function saveUpdates(_0x40c4fd,_0x21cd08){return function(_0x5a50a4){if(_0x5a50a4){return _0x5a50a4['update'](_0x40c4fd)[_0x2a2b('0x2e')](function(_0x2c474a){return _0x2c474a;});}return null;};}function removeEntity(_0x1de301,_0x1394f6){return function(_0x3b5ada){if(_0x3b5ada){return _0x3b5ada['destroy']()['then'](function(){var _0xbbc5f5=_0x3b5ada[_0x2a2b('0x2f')]({'plain':!![]});var _0x12cfae=_0x2a2b('0x30');return db['UserProfileResource'][_0x2a2b('0x31')]({'where':{'type':_0x12cfae,'resourceId':_0xbbc5f5['id']}})[_0x2a2b('0x2e')](function(){return _0x3b5ada;});})[_0x2a2b('0x2e')](function(){_0x1de301[_0x2a2b('0x23')](0xcc)[_0x2a2b('0x22')]();});}};}function handleEntityNotFound(_0x35286b,_0x140c6b){return function(_0x35f3c4){if(!_0x35f3c4){_0x35286b[_0x2a2b('0x21')](0x194);}return _0x35f3c4;};}function handleError(_0x151066,_0x56087b){_0x56087b=_0x56087b||0x1f4;return function(_0x41f01f){logger[_0x2a2b('0x1b')](_0x41f01f[_0x2a2b('0x32')]);if(_0x41f01f[_0x2a2b('0x33')]){delete _0x41f01f[_0x2a2b('0x33')];}_0x151066[_0x2a2b('0x23')](_0x56087b)[_0x2a2b('0x34')](_0x41f01f);};}exports[_0x2a2b('0x35')]=function(_0x1bf506,_0x1833ea){var _0xf53ab9={'include':[{'model':db[_0x2a2b('0x36')],'as':_0x2a2b('0x37')}]},_0x2eb1f0={},_0x232d5e={'count':0x0,'rows':[]};var _0x5b4c1b=_[_0x2a2b('0x38')](db[_0x2a2b('0x39')][_0x2a2b('0x3a')],function(_0x5ca92b){return{'name':_0x5ca92b[_0x2a2b('0x3b')],'type':_0x5ca92b[_0x2a2b('0x3c')]['key']};});_0x2eb1f0[_0x2a2b('0x3d')]=_[_0x2a2b('0x38')](_0x5b4c1b,_0x2a2b('0x33'));_0x2eb1f0['query']=_[_0x2a2b('0x3e')](_0x1bf506['query']);_0x2eb1f0[_0x2a2b('0x3f')]=_[_0x2a2b('0x40')](_0x2eb1f0[_0x2a2b('0x3d')],_0x2eb1f0[_0x2a2b('0x41')]);_0xf53ab9['attributes']=_['intersection'](_0x2eb1f0[_0x2a2b('0x3d')],qs[_0x2a2b('0x42')](_0x1bf506[_0x2a2b('0x41')][_0x2a2b('0x42')]));_0xf53ab9[_0x2a2b('0x43')]=_0xf53ab9[_0x2a2b('0x43')][_0x2a2b('0x44')]?_0xf53ab9[_0x2a2b('0x43')]:_0x2eb1f0['model'];if(!_0x1bf506[_0x2a2b('0x41')][_0x2a2b('0x45')](_0x2a2b('0x46'))){_0xf53ab9[_0x2a2b('0x26')]=qs[_0x2a2b('0x26')](_0x1bf506[_0x2a2b('0x41')]['limit']);_0xf53ab9[_0x2a2b('0x25')]=qs[_0x2a2b('0x25')](_0x1bf506[_0x2a2b('0x41')][_0x2a2b('0x25')]);}_0xf53ab9[_0x2a2b('0x47')]=qs[_0x2a2b('0x48')](_0x1bf506[_0x2a2b('0x41')][_0x2a2b('0x48')]);_0xf53ab9[_0x2a2b('0x49')]=qs['filters'](_[_0x2a2b('0x4a')](_0x1bf506[_0x2a2b('0x41')],_0x2eb1f0['filters']),_0x5b4c1b);if(_0x1bf506[_0x2a2b('0x41')][_0x2a2b('0x4b')]){_0xf53ab9[_0x2a2b('0x49')]=_['merge'](_0xf53ab9[_0x2a2b('0x49')],{'$or':_[_0x2a2b('0x38')](_0x5b4c1b,function(_0x3c0ce6){if(_0x3c0ce6[_0x2a2b('0x3c')]!==_0x2a2b('0x4c')){var _0x4a4a56={};_0x4a4a56[_0x3c0ce6[_0x2a2b('0x33')]]={'$like':'%'+_0x1bf506['query']['filter']+'%'};return _0x4a4a56;}})});}_0xf53ab9=_[_0x2a2b('0x4d')]({},_0xf53ab9,_0x1bf506['options']);var _0x10ccf8={'where':_0xf53ab9[_0x2a2b('0x49')]};return db[_0x2a2b('0x39')]['count'](_0x10ccf8)[_0x2a2b('0x2e')](function(_0x56fe9a){_0x232d5e['count']=_0x56fe9a;if(_0x1bf506[_0x2a2b('0x41')][_0x2a2b('0x4e')]){_0xf53ab9[_0x2a2b('0x4f')]=[{'all':!![]}];}return db[_0x2a2b('0x39')][_0x2a2b('0x50')](_0xf53ab9);})[_0x2a2b('0x2e')](function(_0x2a2f56){_0x232d5e[_0x2a2b('0x51')]=_0x2a2f56;return _0x232d5e;})[_0x2a2b('0x2e')](respondWithFilteredResult(_0x1833ea,_0xf53ab9))['catch'](handleError(_0x1833ea,null));};exports['show']=function(_0x4fae46,_0x12f9b7){var _0x5c38ff={'raw':![],'where':{'id':_0x4fae46['params']['id']},'include':[{'model':db[_0x2a2b('0x36')],'as':'mandatoryDispositionPause'}]},_0x4cceb2={};_0x4cceb2[_0x2a2b('0x3d')]=_['keys'](db[_0x2a2b('0x39')]['rawAttributes']);_0x4cceb2[_0x2a2b('0x41')]=_[_0x2a2b('0x3e')](_0x4fae46['query']);_0x4cceb2[_0x2a2b('0x3f')]=_[_0x2a2b('0x40')](_0x4cceb2['model'],_0x4cceb2[_0x2a2b('0x41')]);_0x5c38ff[_0x2a2b('0x43')]=_[_0x2a2b('0x40')](_0x4cceb2[_0x2a2b('0x3d')],qs[_0x2a2b('0x42')](_0x4fae46[_0x2a2b('0x41')][_0x2a2b('0x42')]));_0x5c38ff['attributes']=_0x5c38ff[_0x2a2b('0x43')][_0x2a2b('0x44')]?_0x5c38ff[_0x2a2b('0x43')]:_0x4cceb2[_0x2a2b('0x3d')];if(_0x4fae46[_0x2a2b('0x41')]['includeAll']){_0x5c38ff[_0x2a2b('0x4f')]=[{'all':!![]}];}_0x5c38ff=_[_0x2a2b('0x4d')]({},_0x5c38ff,_0x4fae46[_0x2a2b('0x52')]);return db['ChatWebsite'][_0x2a2b('0x53')](_0x5c38ff)['then'](handleEntityNotFound(_0x12f9b7,null))['then'](respondWithResult(_0x12f9b7,null))[_0x2a2b('0x20')](handleError(_0x12f9b7,null));};exports[_0x2a2b('0x54')]=function(_0x39775c,_0x40c74f){return db[_0x2a2b('0x39')][_0x2a2b('0x54')](_0x39775c[_0x2a2b('0x55')],{})[_0x2a2b('0x2e')](function(_0x2e181b){var _0xc9aee7=_0x39775c[_0x2a2b('0x56')][_0x2a2b('0x2f')]({'plain':!![]});if(!_0xc9aee7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc9aee7['role']===_0x2a2b('0x56')){var _0x4bda8b=_0x2e181b[_0x2a2b('0x2f')]({'plain':!![]});var _0x2dff55=_0x2a2b('0x30');return db['UserProfileSection'][_0x2a2b('0x53')]({'where':{'name':_0x2dff55,'userProfileId':_0xc9aee7[_0x2a2b('0x57')]},'raw':!![]})[_0x2a2b('0x2e')](function(_0x3b2643){if(_0x3b2643&&_0x3b2643[_0x2a2b('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x4bda8b['name'],'resourceId':_0x4bda8b['id'],'type':_0x3b2643[_0x2a2b('0x33')],'sectionId':_0x3b2643['id']},{})[_0x2a2b('0x2e')](function(){return _0x2e181b;});}else{return _0x2e181b;}})[_0x2a2b('0x20')](function(_0x5fb175){logger[_0x2a2b('0x1b')](_0x2a2b('0x59'),_0x5fb175);throw _0x5fb175;});}return _0x2e181b;})[_0x2a2b('0x2e')](respondWithResult(_0x40c74f,0xc9))[_0x2a2b('0x20')](handleError(_0x40c74f,null));};exports['update']=function(_0x313a53,_0x414f6b){if(_0x313a53['body']['id']){delete _0x313a53[_0x2a2b('0x55')]['id'];}return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x313a53[_0x2a2b('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x2a2b('0x2e')](handleEntityNotFound(_0x414f6b,null))[_0x2a2b('0x2e')](saveUpdates(_0x313a53['body'],null))[_0x2a2b('0x2e')](respondWithResult(_0x414f6b,null))[_0x2a2b('0x20')](handleError(_0x414f6b,null));};exports[_0x2a2b('0x31')]=function(_0xf4bd66,_0x5c2080){return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0xf4bd66[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x5c2080,null))[_0x2a2b('0x2e')](removeEntity(_0x5c2080,null))[_0x2a2b('0x20')](handleError(_0x5c2080,null));};exports[_0x2a2b('0x5b')]=function(_0x4e36e0,_0x34193e){return db['ChatWebsite']['describe']()[_0x2a2b('0x2e')](respondWithResult(_0x34193e,null))[_0x2a2b('0x20')](handleError(_0x34193e,null));};exports['addDisposition']=function(_0x1a5495,_0x47656c,_0x25e0f3){if(_0x1a5495['body']['id']){delete _0x1a5495[_0x2a2b('0x55')]['id'];}return db[_0x2a2b('0x39')]['find']({'where':{'id':_0x1a5495[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x47656c,null))[_0x2a2b('0x2e')](function(_0x3e2315){if(_0x3e2315){_0x1a5495[_0x2a2b('0x55')][_0x2a2b('0x5c')]=_0x3e2315['id'];return db['Disposition']['create'](_0x1a5495['body']);}})[_0x2a2b('0x2e')](respondWithResult(_0x47656c,null))['catch'](handleError(_0x47656c,null));};exports['getDispositions']=function(_0x180a5f,_0x4c4e13,_0x390769){var _0xba3dab={'raw':![],'where':{}};var _0xfcca48={};var _0x3ecf51={'count':0x0,'rows':[]};return db[_0x2a2b('0x39')]['findOne']({'where':{'id':_0x180a5f['params']['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x4c4e13,null))[_0x2a2b('0x2e')](function(_0x4fe65d){if(_0x4fe65d){_0xfcca48[_0x2a2b('0x3d')]=_[_0x2a2b('0x3e')](db[_0x2a2b('0x5d')][_0x2a2b('0x3a')]);_0xfcca48[_0x2a2b('0x41')]=_[_0x2a2b('0x3e')](_0x180a5f[_0x2a2b('0x41')]);_0xfcca48[_0x2a2b('0x3f')]=_[_0x2a2b('0x40')](_0xfcca48[_0x2a2b('0x3d')],_0xfcca48[_0x2a2b('0x41')]);_0xba3dab[_0x2a2b('0x43')]=_['intersection'](_0xfcca48[_0x2a2b('0x3d')],qs[_0x2a2b('0x42')](_0x180a5f[_0x2a2b('0x41')][_0x2a2b('0x42')]));_0xba3dab[_0x2a2b('0x43')]=_0xba3dab['attributes']['length']?_0xba3dab['attributes']:_0xfcca48['model'];if(!_0x180a5f['query'][_0x2a2b('0x45')](_0x2a2b('0x46'))){_0xba3dab[_0x2a2b('0x26')]=qs[_0x2a2b('0x26')](_0x180a5f[_0x2a2b('0x41')][_0x2a2b('0x26')]);_0xba3dab['offset']=qs[_0x2a2b('0x25')](_0x180a5f[_0x2a2b('0x41')][_0x2a2b('0x25')]);}_0xba3dab[_0x2a2b('0x47')]=qs[_0x2a2b('0x48')](_0x180a5f[_0x2a2b('0x41')][_0x2a2b('0x48')]);_0xba3dab[_0x2a2b('0x49')]=qs[_0x2a2b('0x3f')](_[_0x2a2b('0x4a')](_0x180a5f[_0x2a2b('0x41')],_0xfcca48[_0x2a2b('0x3f')]));_0xba3dab['where'][_0x2a2b('0x5c')]=_0x4fe65d['id'];if(_0x180a5f[_0x2a2b('0x41')]['filter']){_0xba3dab[_0x2a2b('0x49')]=_['merge'](_0xba3dab['where'],{'$or':_['map'](_0xba3dab[_0x2a2b('0x43')],function(_0x9a136c){var _0x427d15={};_0x427d15[_0x9a136c]={'$like':'%'+_0x180a5f[_0x2a2b('0x41')]['filter']+'%'};return _0x427d15;})});}_0xba3dab=_[_0x2a2b('0x4d')]({},_0xba3dab,_0x180a5f['options']);return db['Disposition']['count']({'where':_0xba3dab['where']})['then'](function(_0x13c280){_0x3ecf51[_0x2a2b('0x28')]=_0x13c280;if(_0x180a5f[_0x2a2b('0x41')][_0x2a2b('0x4e')]){_0xba3dab['include']=[{'all':!![]}];}return db[_0x2a2b('0x5d')][_0x2a2b('0x50')](_0xba3dab);})['then'](function(_0x40fb65){_0x3ecf51['rows']=_0x40fb65;return _0x3ecf51;});}})[_0x2a2b('0x2e')](respondWithFilteredResult(_0x4c4e13,_0xba3dab))['catch'](handleError(_0x4c4e13,null));};exports['removeDispositions']=function(_0x39fb40,_0xa2e245,_0x883e10){return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x39fb40[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0xa2e245,null))[_0x2a2b('0x2e')](function(_0x44dee1){if(_0x44dee1){return _0x44dee1[_0x2a2b('0x5e')](_0x39fb40[_0x2a2b('0x41')][_0x2a2b('0x5f')]);}})['then'](respondWithStatusCode(_0xa2e245,null))[_0x2a2b('0x20')](handleError(_0xa2e245,null));};exports[_0x2a2b('0x60')]=function(_0x45ad97,_0xc1b5dc,_0x161b2c){if(_0x45ad97[_0x2a2b('0x55')]['id']){delete _0x45ad97[_0x2a2b('0x55')]['id'];}return db[_0x2a2b('0x39')]['find']({'where':{'id':_0x45ad97['params']['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0xc1b5dc,null))[_0x2a2b('0x2e')](function(_0x146dc6){if(_0x146dc6){_0x45ad97['body']['ChatWebsiteId']=_0x146dc6['id'];return db[_0x2a2b('0x61')][_0x2a2b('0x54')](_0x45ad97[_0x2a2b('0x55')]);}})[_0x2a2b('0x2e')](respondWithResult(_0xc1b5dc,null))[_0x2a2b('0x20')](handleError(_0xc1b5dc,null));};exports[_0x2a2b('0x62')]=function(_0x330934,_0x4239a4,_0x495cd9){var _0x579d67={'raw':![],'where':{}};var _0x5d668b={};var _0x7f0f57={'count':0x0,'rows':[]};return db[_0x2a2b('0x39')]['findOne']({'where':{'id':_0x330934[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x4239a4,null))[_0x2a2b('0x2e')](function(_0x52af4d){if(_0x52af4d){_0x5d668b[_0x2a2b('0x3d')]=_['keys'](db[_0x2a2b('0x61')]['rawAttributes']);_0x5d668b[_0x2a2b('0x41')]=_[_0x2a2b('0x3e')](_0x330934['query']);_0x5d668b[_0x2a2b('0x3f')]=_[_0x2a2b('0x40')](_0x5d668b['model'],_0x5d668b[_0x2a2b('0x41')]);_0x579d67[_0x2a2b('0x43')]=_[_0x2a2b('0x40')](_0x5d668b[_0x2a2b('0x3d')],qs['fields'](_0x330934[_0x2a2b('0x41')]['fields']));_0x579d67['attributes']=_0x579d67['attributes'][_0x2a2b('0x44')]?_0x579d67[_0x2a2b('0x43')]:_0x5d668b['model'];if(!_0x330934[_0x2a2b('0x41')][_0x2a2b('0x45')](_0x2a2b('0x46'))){_0x579d67[_0x2a2b('0x26')]=qs['limit'](_0x330934[_0x2a2b('0x41')][_0x2a2b('0x26')]);_0x579d67['offset']=qs[_0x2a2b('0x25')](_0x330934[_0x2a2b('0x41')][_0x2a2b('0x25')]);}_0x579d67['order']=qs['sort'](_0x330934[_0x2a2b('0x41')][_0x2a2b('0x48')]);_0x579d67['where']=qs[_0x2a2b('0x3f')](_[_0x2a2b('0x4a')](_0x330934['query'],_0x5d668b[_0x2a2b('0x3f')]));_0x579d67[_0x2a2b('0x49')][_0x2a2b('0x5c')]=_0x52af4d['id'];if(_0x330934['query'][_0x2a2b('0x4b')]){_0x579d67['where']=_[_0x2a2b('0x4d')](_0x579d67['where'],{'$or':_[_0x2a2b('0x38')](_0x579d67[_0x2a2b('0x43')],function(_0x47a4b4){var _0x340a5a={};_0x340a5a[_0x47a4b4]={'$like':'%'+_0x330934[_0x2a2b('0x41')][_0x2a2b('0x4b')]+'%'};return _0x340a5a;})});}_0x579d67=_[_0x2a2b('0x4d')]({},_0x579d67,_0x330934['options']);return db[_0x2a2b('0x61')][_0x2a2b('0x28')]({'where':_0x579d67[_0x2a2b('0x49')]})['then'](function(_0xa73ea3){_0x7f0f57[_0x2a2b('0x28')]=_0xa73ea3;if(_0x330934['query'][_0x2a2b('0x4e')]){_0x579d67['include']=[{'all':!![]}];}return db[_0x2a2b('0x61')][_0x2a2b('0x50')](_0x579d67);})['then'](function(_0x54faad){_0x7f0f57[_0x2a2b('0x51')]=_0x54faad;return _0x7f0f57;});}})[_0x2a2b('0x2e')](respondWithFilteredResult(_0x4239a4,_0x579d67))[_0x2a2b('0x20')](handleError(_0x4239a4,null));};exports[_0x2a2b('0x63')]=function(_0x2b3e77,_0x8667a5,_0x2f7552){return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x2b3e77[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x8667a5,null))[_0x2a2b('0x2e')](function(_0x34f4ea){if(_0x34f4ea){return _0x34f4ea[_0x2a2b('0x63')](_0x2b3e77[_0x2a2b('0x41')][_0x2a2b('0x5f')]);}})[_0x2a2b('0x2e')](respondWithStatusCode(_0x8667a5,null))[_0x2a2b('0x20')](handleError(_0x8667a5,null));};exports[_0x2a2b('0x64')]=function(_0x3034dd,_0x3b5d1a,_0x46794c){_0x3034dd[_0x2a2b('0x55')][_0x2a2b('0x65')]=_0x3034dd[_0x2a2b('0x66')][_0x2a2b('0x67')];return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x3034dd[_0x2a2b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3b5d1a,null))[_0x2a2b('0x2e')](saveUpdates(_0x3034dd[_0x2a2b('0x55')],null))[_0x2a2b('0x2e')](respondWithResult(_0x3b5d1a,null))[_0x2a2b('0x20')](handleError(_0x3b5d1a,null));};exports[_0x2a2b('0x68')]=function(_0x1b437f,_0x58950b,_0x430fe8){_0x1b437f[_0x2a2b('0x55')][_0x2a2b('0x69')]=_0x1b437f[_0x2a2b('0x66')][_0x2a2b('0x67')];return db['ChatWebsite'][_0x2a2b('0x53')]({'where':{'id':_0x1b437f[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x58950b,null))['then'](saveUpdates(_0x1b437f['body'],null))[_0x2a2b('0x2e')](respondWithResult(_0x58950b,null))[_0x2a2b('0x20')](handleError(_0x58950b,null));};exports[_0x2a2b('0x6a')]=function(_0x4e076c,_0x4883cb,_0x27aae6){_0x4e076c[_0x2a2b('0x55')]['customerAvatar']=_0x4e076c['file'][_0x2a2b('0x67')];return db[_0x2a2b('0x39')]['find']({'where':{'id':_0x4e076c[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x4883cb,null))[_0x2a2b('0x2e')](saveUpdates(_0x4e076c[_0x2a2b('0x55')],null))[_0x2a2b('0x2e')](respondWithResult(_0x4883cb,null))[_0x2a2b('0x20')](handleError(_0x4883cb,null));};exports['addSystemAvatar']=function(_0x4b88f5,_0x538fb5,_0x5c95ab){_0x4b88f5[_0x2a2b('0x55')][_0x2a2b('0x6b')]=_0x4b88f5['file'][_0x2a2b('0x67')];return db['ChatWebsite']['find']({'where':{'id':_0x4b88f5[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x538fb5,null))[_0x2a2b('0x2e')](saveUpdates(_0x4b88f5[_0x2a2b('0x55')],null))['then'](respondWithResult(_0x538fb5,null))[_0x2a2b('0x20')](handleError(_0x538fb5,null));};exports[_0x2a2b('0x6c')]=function(_0x5e5c47,_0x523bcb,_0x5e20a1){var _0x24a97f=path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],_0x2a2b('0x6f'));var _0x20a636={'where':{'id':_0x5e5c47[_0x2a2b('0x5a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x264091=![];return require('../../config/license/util')[_0x2a2b('0x70')]()['then'](function(_0x22713e){if(_0x22713e){_0x264091=_0x22713e['custom'];}})[_0x2a2b('0x2e')](function(){return db['ChatWebsite'][_0x2a2b('0x53')](_0x20a636);})['then'](handleEntityNotFound(_0x523bcb,null))[_0x2a2b('0x2e')](function(_0x36f27d){if(_0x36f27d){if(!_[_0x2a2b('0x71')](_0x36f27d[_0x2a2b('0x65')])){if(fs[_0x2a2b('0x72')](path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],_0x2a2b('0x73'),_0x36f27d[_0x2a2b('0x65')]))&&_0x264091){_0x24a97f=path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],'server/files/images/logos/',_0x36f27d[_0x2a2b('0x65')]);}}return _0x523bcb[_0x2a2b('0x74')](_0x24a97f);}})[_0x2a2b('0x20')](handleError(_0x523bcb,null));};exports['getAvatar']=function(_0x4dad27,_0x4b5106,_0x3e150e){var _0x16bed7=path[_0x2a2b('0x6d')](config['root'],_0x2a2b('0x75'));var _0x21c628={'where':{'id':_0x4dad27[_0x2a2b('0x5a')]['id']},'attributes':['id',_0x2a2b('0x69')],'raw':!![]};return db[_0x2a2b('0x39')]['find'](_0x21c628)[_0x2a2b('0x2e')](handleEntityNotFound(_0x4b5106,null))['then'](function(_0x2cf031){if(_0x2cf031){if(!_['isNil'](_0x2cf031[_0x2a2b('0x69')])){if(fs[_0x2a2b('0x72')](path['join'](config[_0x2a2b('0x6e')],'server/files/images/avatars/',_0x2cf031['agentAvatar']))){_0x16bed7=path['join'](config['root'],_0x2a2b('0x76'),_0x2cf031['agentAvatar']);}}return _0x4b5106['download'](_0x16bed7);}})[_0x2a2b('0x20')](handleError(_0x4b5106,null));};exports[_0x2a2b('0x77')]=function(_0x50b571,_0x5144b8,_0x154e7e){var _0x231610=path[_0x2a2b('0x6d')](config['root'],_0x2a2b('0x78'));var _0x17ef3f={'where':{'id':_0x50b571[_0x2a2b('0x5a')]['id']},'attributes':['id','customerAvatar',_0x2a2b('0x79')],'raw':!![]};return db['ChatWebsite'][_0x2a2b('0x53')](_0x17ef3f)['then'](handleEntityNotFound(_0x5144b8,null))['then'](function(_0x177923){if(_0x177923){if(!_[_0x2a2b('0x71')](_0x177923[_0x2a2b('0x7a')])){if(fs[_0x2a2b('0x72')](path[_0x2a2b('0x6d')](config['root'],_0x2a2b('0x76'),_0x177923[_0x2a2b('0x7a')]))&&_0x177923[_0x2a2b('0x79')]){_0x231610=path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],_0x2a2b('0x76'),_0x177923['customerAvatar']);}}return _0x5144b8['download'](_0x231610);}})[_0x2a2b('0x20')](handleError(_0x5144b8,null));};exports['getSystemAvatar']=function(_0x364c00,_0x3ec0ff,_0x1704ce){var _0x157654=path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],_0x2a2b('0x7b'));var _0x98c4d7={'where':{'id':_0x364c00[_0x2a2b('0x5a')]['id']},'attributes':['id',_0x2a2b('0x6b')],'raw':!![]};return db[_0x2a2b('0x39')][_0x2a2b('0x53')](_0x98c4d7)[_0x2a2b('0x2e')](handleEntityNotFound(_0x3ec0ff,null))[_0x2a2b('0x2e')](function(_0x41ac1f){if(_0x41ac1f){if(!_[_0x2a2b('0x71')](_0x41ac1f[_0x2a2b('0x6b')])){if(fs[_0x2a2b('0x72')](path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],_0x2a2b('0x76'),_0x41ac1f['systemAvatar']))){_0x157654=path['join'](config[_0x2a2b('0x6e')],_0x2a2b('0x76'),_0x41ac1f[_0x2a2b('0x6b')]);}}return _0x3ec0ff['download'](_0x157654);}})[_0x2a2b('0x20')](handleError(_0x3ec0ff,null));};exports['notify']=function(_0x151814,_0x4918b1,_0x5204c3){var _0x1c0fbb=require(_0x2a2b('0x7c'));var _0x34c85a=new _0x1c0fbb();var _0x303a45=_0x34c85a[_0x2a2b('0x7d')](_0x151814['headers'][_0x2a2b('0x7e')])[_0x2a2b('0x7f')]();var _0x47132e={'body':_0x151814['body'],'channel':_0x2a2b('0x80')};var _0x38f0fa=[];var _0x10fea7=[];var _0x5ac9d2={};var _0x3f8985=![];return db[_0x2a2b('0x81')][_0x2a2b('0x5b')]()['then'](function(_0x53db2f){if(!_0x53db2f){throw new db[(_0x2a2b('0x82'))]['ValidationError'](_0x2a2b('0x83'));}_0x38f0fa=_[_0x2a2b('0x84')](_[_0x2a2b('0x3e')](_0x53db2f),[_0x2a2b('0x85'),_0x2a2b('0x86')]);_0x10fea7=_[_0x2a2b('0x84')](_[_0x2a2b('0x3e')](_0x53db2f),[_0x2a2b('0x85'),_0x2a2b('0x86'),'CompanyId',_0x2a2b('0x87')]);if(_0x151814[_0x2a2b('0x55')]['id']){delete _0x151814['body']['id'];}if(_['isNil'](_0x151814[_0x2a2b('0x55')]['from'])){throw new db[(_0x2a2b('0x82'))][(_0x2a2b('0x88'))](_0x2a2b('0x89'));}if(_['isNil'](_0x151814[_0x2a2b('0x55')][_0x2a2b('0x55')])||_0x151814[_0x2a2b('0x55')]['body']===''){throw new db['Sequelize'][(_0x2a2b('0x88'))](_0x2a2b('0x8a'));}if(_[_0x2a2b('0x71')](_0x151814[_0x2a2b('0x55')]['mapKey'])){throw new db[(_0x2a2b('0x82'))][(_0x2a2b('0x88'))](_0x2a2b('0x8b')+_0x10fea7);}if(!_[_0x2a2b('0x8c')](_0x10fea7,_0x151814[_0x2a2b('0x55')][_0x2a2b('0x8d')])){throw new db[(_0x2a2b('0x82'))]['ValidationError'](_0x2a2b('0x8e')+_0x10fea7);}_0x5ac9d2[_0x151814['body'][_0x2a2b('0x8d')]]=_0x151814['body'][_0x2a2b('0x8f')];})[_0x2a2b('0x2e')](function(){return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x151814[_0x2a2b('0x5a')]['id']},'include':[{'model':db[_0x2a2b('0x90')],'as':_0x2a2b('0x91'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5ac9d2,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x2a2b('0x92')],'as':_0x2a2b('0x93')}]});})[_0x2a2b('0x2e')](handleEntityNotFound(_0x4918b1,null))['then'](function(_0x2641fc){if(_0x2641fc&&_0x2641fc[_0x2a2b('0x91')]){_0x47132e[_0x2a2b('0x94')]=_0x2641fc;_0x47132e[_0x2a2b('0x95')]=_0x2641fc[_0x2a2b('0x93')];_0x47132e[_0x2a2b('0x96')]=_0x2641fc[_0x2a2b('0x91')];_0x47132e['applications']=_['orderBy'](_0x47132e[_0x2a2b('0x95')],[_0x2a2b('0x97')],[_0x2a2b('0x98')]);if(_0x47132e[_0x2a2b('0x94')][_0x2a2b('0x93')]){delete _0x47132e[_0x2a2b('0x94')]['Applications'];}if(_0x47132e['account'][_0x2a2b('0x91')]&&_0x47132e[_0x2a2b('0x94')][_0x2a2b('0x91')][_0x2a2b('0x99')]['length']){return _0x47132e[_0x2a2b('0x94')][_0x2a2b('0x91')][_0x2a2b('0x99')][0x0];}var _0x3ecc63=_[_0x2a2b('0x13')](_0x151814['body'],{'firstName':_0x151814[_0x2a2b('0x55')][_0x2a2b('0x8f')],'ListId':_0x2641fc[_0x2a2b('0x87')]});_0x3ecc63[_0x151814[_0x2a2b('0x55')][_0x2a2b('0x8d')]]=_0x151814[_0x2a2b('0x55')][_0x2a2b('0x8f')];return db[_0x2a2b('0x81')]['create'](_0x3ecc63,{'fields':_0x38f0fa,'raw':!![]});}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x4918b1,null))[_0x2a2b('0x2e')](function(_0x11cd60){_0x47132e[_0x2a2b('0x9a')]=_0x11cd60;var _0xca1300=_0x151814['body'][_0x2a2b('0x9b')];if(_0x151814[_0x2a2b('0x9c')]['cf-connecting-ip']){_0xca1300=_0x151814[_0x2a2b('0x9c')]['cf-connecting-ip'];}else if(_0x151814['headers'][_0x2a2b('0x9d')]){_0xca1300=_[_0x2a2b('0x9e')](_0x151814['headers'][_0x2a2b('0x9d')][_0x2a2b('0x9f')](','));}if(_0x11cd60){var _0x57780e={'ContactId':_0x11cd60['id'],'ChatWebsiteId':_0x151814['params']['id'],'from':(_0x11cd60['firstName']||'')+'\x20'+(_0x11cd60['lastName']||''),'customerIp':_0xca1300,'customerPort':_0x151814[_0x2a2b('0x9c')]['x-real-port']?_0x151814[_0x2a2b('0x9c')][_0x2a2b('0xa0')]:null,'referer':_0x151814[_0x2a2b('0x55')][_0x2a2b('0xa1')],'browserName':_0x303a45['browser'][_0x2a2b('0x33')]&&_0x303a45[_0x2a2b('0xa2')][_0x2a2b('0xa3')]?util[_0x2a2b('0xa4')]('%s\x20%s',_0x303a45[_0x2a2b('0xa2')][_0x2a2b('0x33')],_0x303a45['browser'][_0x2a2b('0xa3')]):'unknown','browserVersion':_0x303a45[_0x2a2b('0xa2')][_0x2a2b('0xa3')]||_0x2a2b('0xa5'),'osName':util[_0x2a2b('0xa4')](_0x2a2b('0xa6'),_0x303a45['os']['name'],_0x303a45['os']['version']),'osVersion':_0x303a45['os'][_0x2a2b('0xa3')],'deviceModel':_0x303a45[_0x2a2b('0xa7')][_0x2a2b('0x3d')]&&_0x303a45[_0x2a2b('0xa7')][_0x2a2b('0xa8')]?util[_0x2a2b('0xa4')]('%s\x20%s\x20%s',_0x303a45[_0x2a2b('0xa7')]['model'],_0x303a45[_0x2a2b('0xa7')][_0x2a2b('0xa8')],_0x303a45['device'][_0x2a2b('0x3c')]):null,'deviceVendor':_0x303a45[_0x2a2b('0xa7')][_0x2a2b('0xa8')],'deviceType':_0x303a45[_0x2a2b('0xa7')][_0x2a2b('0x3c')],'formData':JSON[_0x2a2b('0x1a')](_0x151814['body'])};var _0x46dd81={'ChatWebsiteId':_0x151814[_0x2a2b('0x5a')]['id'],'closed':![]};if(_0x151814['body'][_0x2a2b('0xa9')]){_0x46dd81[_0x2a2b('0xa9')]=_0x151814[_0x2a2b('0x55')]['threadId'];return db[_0x2a2b('0xaa')][_0x2a2b('0x53')]({'where':_0x46dd81})[_0x2a2b('0x2e')](function(_0x5d72be){if(_0x5d72be){return[_0x5d72be,![]];}_0x57780e[_0x2a2b('0xa9')]=_0x151814[_0x2a2b('0x55')][_0x2a2b('0xa9')];_0x57780e[_0x2a2b('0xab')]=_0x151814[_0x2a2b('0x55')]['externalUrl'];return db[_0x2a2b('0xaa')][_0x2a2b('0x54')](_0x57780e)[_0x2a2b('0x2e')](function(_0x366c9f){return[_0x366c9f,!![]];});});}_0x46dd81[_0x2a2b('0xac')]=_0x11cd60['id'];if(_0x151814[_0x2a2b('0x55')][_0x2a2b('0xad')]&&_0x151814[_0x2a2b('0x55')]['interaction']['id']){_0x46dd81['id']=_0x151814['body'][_0x2a2b('0xad')]['id'];return db[_0x2a2b('0xaa')][_0x2a2b('0x53')]({'where':_0x46dd81})[_0x2a2b('0x2e')](function(_0x52de78){if(_0x52de78){return[_0x52de78,![]];}return db[_0x2a2b('0xaa')]['create'](_0x57780e)[_0x2a2b('0x2e')](function(_0x66f5f6){return[_0x66f5f6,!![]];});});}return db[_0x2a2b('0xaa')][_0x2a2b('0x54')](_0x57780e)[_0x2a2b('0x2e')](function(_0x450d3f){return[_0x450d3f,!![]];});}})[_0x2a2b('0xae')](function(_0x18d895,_0x54b459){if(_0x18d895){_0x3f8985=_0x54b459;if(!_0x54b459){var _0xaf91c0={'from':(_0x47132e[_0x2a2b('0x9a')][_0x2a2b('0xaf')]||'')+'\x20'+(_0x47132e[_0x2a2b('0x9a')]['lastName']||'')};if(_0x151814[_0x2a2b('0x55')][_0x2a2b('0xa9')]&&_0x151814[_0x2a2b('0x55')][_0x2a2b('0xb0')]&&_0x151814[_0x2a2b('0x55')][_0x2a2b('0xa9')]!=_0x151814['body'][_0x2a2b('0xb0')]){_0xaf91c0['threadId']=_0x151814[_0x2a2b('0x55')][_0x2a2b('0xb0')];}return _0x18d895[_0x2a2b('0xb1')](_0xaf91c0);}else{return _0x18d895;}}})[_0x2a2b('0x2e')](function(_0x2c17f1){_0x47132e['interaction']=_0x2c17f1[_0x2a2b('0x2f')]({'plain':!![]});_0x47132e[_0x2a2b('0xad')][_0x2a2b('0xb2')]=_0x3f8985;if(_0x47132e[_0x2a2b('0xad')][_0x2a2b('0xb2')]){if(_0x47132e[_0x2a2b('0x94')][_0x2a2b('0xb3')]){_0x47132e[_0x2a2b('0x95')]['push']({'id':0x0,'priority':_0x47132e['applications'][_0x2a2b('0x44')]+0x1,'app':_0x2a2b('0xb4'),'appdata':_0x2a2b('0xb5'),'interval':_0x2a2b('0xb6')});}}return db['ChatMessage'][_0x2a2b('0x54')]({'body':_0x151814[_0x2a2b('0x55')][_0x2a2b('0x55')],'ChatWebsiteId':_0x151814[_0x2a2b('0x5a')]['id'],'ChatInteractionId':_0x2c17f1['id'],'direction':'in','ContactId':_0x47132e[_0x2a2b('0x9a')]['id'],'AttachmentId':_0x151814[_0x2a2b('0x55')][_0x2a2b('0xb7')]});})[_0x2a2b('0x2e')](function(_0x479f89){_0x47132e[_0x2a2b('0x1d')]=_0x479f89;if(_0x47132e[_0x2a2b('0xad')]['UserId']){return db['User'][_0x2a2b('0x53')]({'attributes':['id',_0x2a2b('0x33')],'where':{'id':_0x47132e[_0x2a2b('0xad')][_0x2a2b('0xb8')]}})[_0x2a2b('0x2e')](function(_0x21eed2){if(_0x21eed2){_0x47132e[_0x2a2b('0x95')][_0x2a2b('0xb9')]({'id':0x0,'priority':0x0,'app':_0x2a2b('0xba'),'appdata':_0x21eed2[_0x2a2b('0x33')]+','+(_0x47132e[_0x2a2b('0x94')][_0x2a2b('0xbb')]||0xa),'interval':_0x2a2b('0xb6')});_0x47132e[_0x2a2b('0xbc')]=!![];}return respondWithRpcPromise(_0x2a2b('0xbd'),_0x2a2b('0xbe'),_0x47132e);});}return respondWithRpcPromise('Start',_0x2a2b('0xbe'),_0x47132e);})[_0x2a2b('0x2e')](function(_0x3044c8){respondWithRpcPromise(_0x2a2b('0xbf'),'EventManager',{'event':_0x2a2b('0xc0'),'message':_0x3044c8},client9002);return _0x3044c8;})[_0x2a2b('0x2e')](respondWithResult(_0x4918b1,null))[_0x2a2b('0x20')](handleError(_0x4918b1,null));};exports[_0x2a2b('0xc1')]=function(_0x53ee98,_0x20b515,_0x4411e6){var _0x3ef0f7,_0x13b3ba,_0x42af49;var _0x4fca8a=[];var _0x2753b1=[];var _0x46b028={};var _0x5e3b63=_0x53ee98['files']||[];var _0x35faec=[];var _0x5a7347;return db[_0x2a2b('0x81')][_0x2a2b('0x5b')]()['then'](function(_0x56001a){if(!_0x56001a){throw new db['Sequelize'][(_0x2a2b('0x88'))](_0x2a2b('0x83'));}_0x2753b1=_[_0x2a2b('0x84')](_[_0x2a2b('0x3e')](_0x56001a),['createdAt',_0x2a2b('0x86')]);_0x4fca8a=_[_0x2a2b('0x84')](_[_0x2a2b('0x3e')](_0x56001a),[_0x2a2b('0x85'),'updatedAt','CompanyId',_0x2a2b('0x87')]);if(_0x53ee98[_0x2a2b('0x55')]['id']){delete _0x53ee98[_0x2a2b('0x55')]['id'];}if(_[_0x2a2b('0x71')](_0x53ee98['body'][_0x2a2b('0x8f')])){throw _0x20b515['status'](0x1f4)[_0x2a2b('0x34')](new db['Sequelize']['ValidationError'](_0x2a2b('0x89')));}if(_[_0x2a2b('0x71')](_0x53ee98['body'][_0x2a2b('0x55')])||_0x53ee98['body'][_0x2a2b('0x55')]===''){throw _0x20b515[_0x2a2b('0x23')](0x1f4)[_0x2a2b('0x34')](new db[(_0x2a2b('0x82'))][(_0x2a2b('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x53ee98[_0x2a2b('0x55')][_0x2a2b('0xc2')])){throw _0x20b515[_0x2a2b('0x23')](0x1f4)['send'](new db[(_0x2a2b('0x82'))][(_0x2a2b('0x88'))](_0x2a2b('0xc3')+_0x4fca8a));}if(!_[_0x2a2b('0x8c')](_0x4fca8a,_0x53ee98['body'][_0x2a2b('0xc2')])){throw _0x20b515['status'](0x1f4)[_0x2a2b('0x34')](new db[(_0x2a2b('0x82'))][(_0x2a2b('0x88'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4fca8a));}_0x46b028[_0x53ee98[_0x2a2b('0x55')]['mapKeyOffline']]=_0x53ee98[_0x2a2b('0x55')][_0x2a2b('0x8f')];})[_0x2a2b('0x2e')](function(){return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x53ee98[_0x2a2b('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0x2a2b('0xc4')}]});})[_0x2a2b('0x2e')](handleEntityNotFound(_0x20b515,null))['then'](function(_0x3f26d6){if(_0x3f26d6&&_0x3f26d6[_0x2a2b('0x91')]){_0x13b3ba=_0x3f26d6;var _0x2dabfe=_[_0x2a2b('0x13')](_0x53ee98['body'],{'firstName':_0x53ee98[_0x2a2b('0x55')]['from'],'phone':_0x53ee98[_0x2a2b('0x55')]['from'],'ListId':_0x3f26d6['ListId']});_0x2dabfe[_0x53ee98[_0x2a2b('0x55')]['mapKeyOffline']]=_0x53ee98[_0x2a2b('0x55')][_0x2a2b('0x8f')];return db[_0x2a2b('0x81')][_0x2a2b('0xc5')]({'where':_0x46b028,'defaults':_0x2dabfe});}})[_0x2a2b('0xae')](function(_0x5e7915){if(_0x5e7915){_0x42af49=_0x5e7915;var _0x597d65=fs[_0x2a2b('0xc6')](path['join'](config[_0x2a2b('0x6e')],_0x2a2b('0xc7')),'utf8');var _0x3c5767=ejs[_0x2a2b('0xc8')](_0x597d65,{'body':_[_0x2a2b('0xc9')](_0x53ee98[_0x2a2b('0x55')][_0x2a2b('0x55')]),'bodyTitle':_0x13b3ba['offlineMessageBody']});return db['ChatOfflineMessage'][_0x2a2b('0x54')]({'body':_0x3c5767,'ContactId':_0x5e7915['id'],'ChatWebsiteId':_0x13b3ba['id']});}})[_0x2a2b('0x2e')](function(_0x5a7022){_0x5a7347=_0x5a7022;if(_0x5e3b63[_0x2a2b('0x44')]){var _0x227e27=_0x5e3b63[_0x2a2b('0x38')](function(_0x391edb){return{'name':_0x391edb['originalname'],'basename':_0x391edb[_0x2a2b('0x67')],'type':_0x391edb[_0x2a2b('0xca')],'ChatOfflineMessageId':_0x5a7022['id']};});_0x35faec=_0x227e27[_0x2a2b('0x38')](_0x56ee69=>{var _0x861ff4={'filename':_0x56ee69['name'],'path':path[_0x2a2b('0x6d')](config['root'],_0x2a2b('0xcb'),_0x2a2b('0xcc'),_0x2a2b('0xcd'),_0x2a2b('0xce'),_0x56ee69['basename'])};return _0x861ff4;});if(!_0x13b3ba[_0x2a2b('0xcf')]){return db[_0x2a2b('0xd0')][_0x2a2b('0xd1')](function(_0xdda2d2){return db['Attachment'][_0x2a2b('0xd2')](_0x227e27,{'transaction':_0xdda2d2});});}}})['then'](function(){if(_0x5a7347){_0x3ef0f7=_0x5a7347;return db[_0x2a2b('0xc4')][_0x2a2b('0xd3')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2a2b('0xd4'),'raw':!![]}]});}})[_0x2a2b('0x2e')](function(_0x419cba){if(_0x419cba&&_0x419cba['Smtp']&&_0x13b3ba[_0x2a2b('0xd5')]&&_0x13b3ba[_0x2a2b('0xd6')]){var _0x4707f9={'tls':{'rejectUnauthorized':![]}};if(_0x419cba[_0x2a2b('0xd4')][_0x2a2b('0xd7')]){_0x4707f9['service']=_0x419cba[_0x2a2b('0xd4')][_0x2a2b('0xd7')];}else{_0x4707f9[_0x2a2b('0xd8')]=_0x419cba[_0x2a2b('0xd4')]['host'];_0x4707f9[_0x2a2b('0xd9')]=_0x419cba['Smtp'][_0x2a2b('0xd9')];_0x4707f9[_0x2a2b('0xda')]=_0x419cba[_0x2a2b('0xd4')][_0x2a2b('0xda')];}if(_0x419cba['Smtp'][_0x2a2b('0xdb')]){_0x4707f9[_0x2a2b('0xdc')]={'user':_0x419cba[_0x2a2b('0xd4')][_0x2a2b('0x56')],'pass':_0x419cba['Smtp'][_0x2a2b('0xdd')]};}return respondWithRpcPromise(_0x2a2b('0xde'),_0x2a2b('0xdf'),{'account':_0x4707f9,'message':{'from':util['format'](_0x2a2b('0xe0'),_0x419cba[_0x2a2b('0x33')],_0x419cba[_0x2a2b('0xe1')]||_0x419cba['Smtp'][_0x2a2b('0x56')]),'to':_0x13b3ba['forwardOfflineAddress'],'subject':_0x13b3ba[_0x2a2b('0xe2')],'html':_0x3ef0f7[_0x2a2b('0x55')],'attachments':_0x35faec}},client9003)[_0x2a2b('0x2e')](function(){return _0x3ef0f7;})['catch'](function(_0x45cd42){console[_0x2a2b('0x1b')](_0x45cd42);});}})[_0x2a2b('0x2e')](function(){if(_0x13b3ba&&_0x13b3ba['openNewInteraction']&&_0x13b3ba[_0x2a2b('0xe3')]){var _0x11eacb=[];if(_0x5e3b63[_0x2a2b('0x44')]){_0x11eacb=_0x5e3b63[_0x2a2b('0x38')](function(_0x5e5191){return{'name':_0x5e5191['originalname'],'basename':_0x5e5191[_0x2a2b('0x67')],'type':_0x5e5191['mimetype'],'ChatOfflineMessageId':_0x5a7347['id']};});}var _0x58ff16;if(!_['isNil'](_0x13b3ba[_0x2a2b('0xe4')])){var _0x1f5ff7=_[_0x2a2b('0x38')](_0x53ee98[_0x2a2b('0x55')],function(_0x266131){return _0x266131;});var _0x2a6e18=_[_0x2a2b('0xe5')](_0x1f5ff7)[0x0];var _0x4a6dee=_[_0x2a2b('0xe6')](_0x2a6e18,function(_0x33d4fc){return _0x33d4fc;});_0x58ff16=_0x4a6dee[0x1][_0x13b3ba[_0x2a2b('0xe4')]];}var _0x336b97={'from':_0x42af49[_0x2a2b('0xe1')],'firstName':_0x42af49['firstName'],'lastName':_0x42af49['lastName'],'mapKey':_0x2a2b('0xe1'),'message':{'from':_0x42af49['email'],'to':_0x13b3ba['MailAccount'][_0x2a2b('0xe1')],'cc':'','subject':_[_0x2a2b('0x71')](_0x58ff16)?_0x13b3ba['offlineMessageSubject']:_0x58ff16,'messageId':'','sentAt':new Date(),'attach':_0x11eacb[_0x2a2b('0x44')],'attachments':_0x11eacb,'originChannel':_0x2a2b('0xe7'),'ChatWebsiteId':_0x13b3ba['id'],'ChatOfflineMessageId':_0x3ef0f7['id'],'originTo':_0x13b3ba[_0x2a2b('0xc4')]['email']},'body':_0x3ef0f7['body']};var _0x39171c={'account':{'id':_0x13b3ba[_0x2a2b('0xe3')]},'body':_0x336b97,'log':_0x2a2b('0xe8')};return respondWithRpcPromise(_0x2a2b('0xe8'),'notifyMail',_0x39171c,client9001)['then'](function(){return _0x3ef0f7;})[_0x2a2b('0x20')](function(_0x24aa8d){console[_0x2a2b('0x1b')](_0x24aa8d);});}return;})[_0x2a2b('0x2e')](function(){if(_0x3ef0f7){return _0x3ef0f7;}})[_0x2a2b('0x2e')](respondWithResult(_0x20b515,null))['catch'](function(_0x5b1ff2){console[_0x2a2b('0x1b')](_0x2a2b('0x20'),_0x5b1ff2);for(var _0x3dba15 of _0x5e3b63){var _0x5aad59=path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],_0x2a2b('0xcb'),_0x2a2b('0xcc'),_0x2a2b('0xcd'),_0x2a2b('0xce'),_0x3dba15[_0x2a2b('0x67')]);fs_extra[_0x2a2b('0xe9')](_0x5aad59)[_0x2a2b('0x20')](function(_0x4c1202){console[_0x2a2b('0x1b')](_0x2a2b('0xea'),_0x5aad59,_0x4c1202);});}});};exports[_0x2a2b('0xeb')]=function(_0x3fc9f1,_0x8ae55e,_0x40329b){return db[_0x2a2b('0xaa')]['find']({'where':{'id':_0x3fc9f1['params']['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x8ae55e,null))[_0x2a2b('0x2e')](function(_0x5f5351){if(_0x5f5351){return _0x5f5351[_0x2a2b('0xeb')](_0x3fc9f1[_0x2a2b('0x55')][_0x2a2b('0x5f')],_[_0x2a2b('0xec')](_0x3fc9f1[_0x2a2b('0x55')],['ids','id'])||{});}})[_0x2a2b('0x2e')](respondWithResult(_0x8ae55e,null))['catch'](handleError(_0x8ae55e,null));};exports[_0x2a2b('0xed')]=function(_0x11e6cc,_0x2caf32,_0x5635f6){var _0x18c9b8={'raw':![],'where':{}};var _0x1ab5b4={};var _0x21ce9f={'count':0x0,'rows':[]};return db[_0x2a2b('0x39')][_0x2a2b('0xd3')]({'where':{'id':_0x11e6cc[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x2caf32,null))[_0x2a2b('0x2e')](function(_0xda7dfb){if(_0xda7dfb){_0x1ab5b4[_0x2a2b('0x3d')]=_[_0x2a2b('0x3e')](db[_0x2a2b('0xaa')][_0x2a2b('0x3a')]);_0x1ab5b4[_0x2a2b('0x41')]=_[_0x2a2b('0x3e')](_0x11e6cc[_0x2a2b('0x41')]);_0x1ab5b4['filters']=_[_0x2a2b('0x40')](_0x1ab5b4['model'],_0x1ab5b4[_0x2a2b('0x41')]);_0x18c9b8[_0x2a2b('0x43')]=_['intersection'](_0x1ab5b4[_0x2a2b('0x3d')],qs[_0x2a2b('0x42')](_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0x42')]));_0x18c9b8[_0x2a2b('0x43')]=_0x18c9b8['attributes'][_0x2a2b('0x44')]?_0x18c9b8[_0x2a2b('0x43')]:_0x1ab5b4['model'];if(!_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0x45')](_0x2a2b('0x46'))){_0x18c9b8[_0x2a2b('0x26')]=qs[_0x2a2b('0x26')](_0x11e6cc[_0x2a2b('0x41')]['limit']);_0x18c9b8[_0x2a2b('0x25')]=qs[_0x2a2b('0x25')](_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0x25')]);}_0x18c9b8[_0x2a2b('0x47')]=qs['sort'](_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0x48')]);_0x18c9b8[_0x2a2b('0x49')]=qs['filters'](_[_0x2a2b('0x4a')](_0x11e6cc[_0x2a2b('0x41')],_0x1ab5b4[_0x2a2b('0x3f')]));_0x18c9b8[_0x2a2b('0x49')][_0x2a2b('0x5c')]=_0xda7dfb['id'];if(_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0x4b')]){_0x18c9b8[_0x2a2b('0x49')]=_['merge'](_0x18c9b8[_0x2a2b('0x49')],{'$or':_[_0x2a2b('0x38')](_0x18c9b8[_0x2a2b('0x43')],function(_0x1bd6b8){var _0x23a120={};_0x23a120[_0x1bd6b8]={'$like':'%'+_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0x4b')]+'%'};return _0x23a120;})});}_0x18c9b8=_[_0x2a2b('0x4d')]({},_0x18c9b8,_0x11e6cc[_0x2a2b('0x52')]);return db[_0x2a2b('0xaa')]['count']({'where':_0x18c9b8[_0x2a2b('0x49')]})[_0x2a2b('0x2e')](function(_0xa97694){_0x21ce9f[_0x2a2b('0x28')]=_0xa97694;if(_0x11e6cc[_0x2a2b('0x41')]['includeAll']){_0x18c9b8['include']=[{'model':db[_0x2a2b('0x81')],'as':_0x2a2b('0xee'),'required':![]},{'model':db[_0x2a2b('0xef')],'as':_0x2a2b('0xf0'),'attributes':[_0x2a2b('0x33'),'fullname',_0x2a2b('0xf1')],'required':![]},{'model':db['Tag'],'as':_0x2a2b('0xf2'),'attributes':['id','name',_0x2a2b('0xf3')],'where':_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0xf4')]?{'id':_0x11e6cc['query'][_0x2a2b('0xf4')]}:undefined,'required':_0x11e6cc[_0x2a2b('0x41')][_0x2a2b('0xf4')]?!![]:![]}];}return db[_0x2a2b('0xaa')]['findAll'](_0x18c9b8);})[_0x2a2b('0x2e')](function(_0x382813){_0x21ce9f['rows']=_0x382813;return _0x21ce9f;});}})[_0x2a2b('0x2e')](respondWithFilteredResult(_0x2caf32,_0x18c9b8))[_0x2a2b('0x20')](handleError(_0x2caf32,null));};function iftimePromise(_0x919dd2,_0x282874){return respondWithRpcPromise('Command',_0x2a2b('0xf5'),{'command':_0x282874[_0x2a2b('0xf6')]?util['format']('iftime\x20%s,%s',_0x919dd2['interval'],_0x282874[_0x2a2b('0xf6')]):util['format'](_0x2a2b('0xf7'),_0x919dd2[_0x2a2b('0xf8')])},client9002)[_0x2a2b('0x2e')](function(_0x3623ec){var _0x370260=_0x3623ec&&_0x3623ec[_0x2a2b('0xf9')](_0x2a2b('0xfa'))>=0x0?!![]:![];logger[_0x2a2b('0x1e')](_0x2a2b('0xfb'),_0x282874['id'],_0x919dd2['id'],_0x919dd2[_0x2a2b('0xf8')],_0x370260?_0x2a2b('0xfc'):_0x2a2b('0xfd'),_0x282874['timezone']?_0x282874[_0x2a2b('0xf6')]:_0x2a2b('0xfe'));return _0x370260;})[_0x2a2b('0x20')](function(_0x470740){logger[_0x2a2b('0x1b')](_0x2a2b('0xfb'),_0x282874['id'],_0x919dd2['id'],_0x919dd2[_0x2a2b('0xf8')],util[_0x2a2b('0xff')](_0x470740,{'showHidden':![],'depth':null}),_0x282874[_0x2a2b('0xf6')]?_0x282874[_0x2a2b('0xf6')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x49d98e,_0x2f53be,_0x6d5702){var _0x3f382d=0x0;var _0xb66fca=0x0;var _0x3cf4f6=![];var _0x57706d;var _0x1857d0;return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x49d98e[_0x2a2b('0x5a')]['id']},'include':[{'model':db[_0x2a2b('0x100')],'as':_0x2a2b('0x100'),'include':[{'model':db['Interval'],'as':_0x2a2b('0x101'),'attributes':['id',_0x2a2b('0xf8')],'raw':!![]}]}]})[_0x2a2b('0x2e')](handleEntityNotFound(_0x2f53be,null))[_0x2a2b('0x2e')](function(_0x731b40){if(_0x731b40){_0x57706d=_0x731b40;return _0x731b40[_0x2a2b('0x102')]({'raw':!![]});}})[_0x2a2b('0x2e')](function(_0x5dd090){if(_0x57706d){if(_0x5dd090){_0x1857d0=_0x5dd090;}}return require(_0x2a2b('0x103'))[_0x2a2b('0x70')]();})[_0x2a2b('0x2e')](function(_0xcfaf98){if(_0xcfaf98){_0xb66fca=_0xcfaf98[_0x2a2b('0x104')];_0x3cf4f6=_0xcfaf98['custom'];}})[_0x2a2b('0x2e')](function(){return db[_0x2a2b('0xaa')][_0x2a2b('0x28')]({'where':{'closed':![]}});})['then'](function(_0x97a860){_0x3f382d=_0x97a860;if(_0xb66fca&&_0x97a860>_0xb66fca){return db[_0x2a2b('0x105')][_0x2a2b('0xd3')]({'where':{'id':0x1}})['then'](function(_0x42687e){if(_0x42687e){_0x42687e['increment'](_0x2a2b('0x106'));}});}})[_0x2a2b('0x2e')](function(){if(_0x57706d[_0x2a2b('0x100')]&&_0x57706d[_0x2a2b('0x100')][_0x2a2b('0x101')]){var _0x4d68cf=[];for(var _0x56cdac=0x0;_0x56cdac<_0x57706d['Interval']['Intervals'][_0x2a2b('0x44')];_0x56cdac++){var _0x4aa229=_0x57706d[_0x2a2b('0x100')][_0x2a2b('0x101')][_0x56cdac]['get']({'plain':!![]});_0x4d68cf[_0x2a2b('0x107')](iftimePromise(_0x4aa229,_0x57706d));}return BPromise[_0x2a2b('0x108')](_0x4d68cf)[_0x2a2b('0x2e')](function(_0x3d4306){return _[_0x2a2b('0x109')](_0x3d4306);});}else{return!![];}})[_0x2a2b('0x2e')](function(_0x4294e8){var _0x29496a=fs['readFileSync'](path[_0x2a2b('0x6d')](config[_0x2a2b('0x6e')],_0x2a2b('0x10a')),_0x2a2b('0x10b'));var _0xc6731={'remote':_0x57706d[_0x2a2b('0x10c')],'query':querystring[_0x2a2b('0x1a')](_[_0x2a2b('0x4d')](_0x57706d['get']({'plain':!![]}),{'customerIp':_0x49d98e['headers'][_0x2a2b('0x9d')]||_0x49d98e['headers']['x-real-ip']||_0x49d98e[_0x2a2b('0x10d')][_0x2a2b('0x10e')]||_0x49d98e['ip'],'referer':_0x49d98e['headers'][_0x2a2b('0xa1')],'openedInteractions':_0x3f382d,'maxInteractions':_0xb66fca,'virtual':_0x3cf4f6[_0x2a2b('0x104')],'online':_0x4294e8,'custom':_0x3cf4f6}))[_0x2a2b('0x10f')](/'/g,'\x5c\x27')};_0x2f53be[_0x2a2b('0x34')](ejs[_0x2a2b('0xc8')](Mustache[_0x2a2b('0xc8')](_0x29496a,_0xc6731),{'proactiveActions':_0x1857d0,'alignment':_0x57706d[_0x2a2b('0x110')],'verticalAlignment':_0x57706d[_0x2a2b('0x111')],'div_color':_0x57706d['color'],'text_color':_0x57706d[_0x2a2b('0x112')],'button_color':_0x57706d[_0x2a2b('0x113')],'background_color':_0x57706d[_0x2a2b('0x114')]}));})['catch'](handleError(_0x2f53be,null));};exports[_0x2a2b('0x115')]=function(_0x3f3580,_0xe4bd04,_0xef3775){return db[_0x2a2b('0x39')][_0x2a2b('0xd3')]({'where':{'id':_0x3f3580[_0x2a2b('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe4bd04,null))[_0x2a2b('0x2e')](function(_0x590cc1){if(_0x590cc1){return db['sequelize']['transaction'](function(_0x588c24){return db[_0x2a2b('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x3f3580[_0x2a2b('0x5a')]['id']},'transaction':_0x588c24})[_0x2a2b('0x2e')](function(_0x2d67e8){var _0x1708d3=_[_0x2a2b('0x38')](_0x3f3580[_0x2a2b('0x55')],function(_0x5405ae){_0x5405ae[_0x2a2b('0x5c')]=_0x3f3580[_0x2a2b('0x5a')]['id'];return _0x5405ae;});return db[_0x2a2b('0x92')]['bulkCreate'](_0x1708d3,{'transaction':_0x588c24});});})[_0x2a2b('0x2e')](function(){return db[_0x2a2b('0x92')][_0x2a2b('0x116')]({'where':{'ChatWebsiteId':_0x3f3580[_0x2a2b('0x5a')]['id']},'order':_0x2a2b('0x97')});});}})[_0x2a2b('0x2e')](respondWithResult(_0xe4bd04,null))['catch'](handleError(_0xe4bd04,null));};exports['getApplications']=function(_0xa1ac18,_0x30b06c,_0x2d2de3){var _0x3961d8={};var _0x2b44fb={};var _0x53b1fb;var _0x3e2b06;return db[_0x2a2b('0x39')][_0x2a2b('0xd3')]({'where':{'id':_0xa1ac18['params']['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x30b06c,null))[_0x2a2b('0x2e')](function(_0x3f2fcc){if(_0x3f2fcc){_0x53b1fb=_0x3f2fcc;_0x2b44fb['model']=_[_0x2a2b('0x3e')](db[_0x2a2b('0x92')][_0x2a2b('0x3a')]);_0x2b44fb[_0x2a2b('0x41')]=_['keys'](_0xa1ac18[_0x2a2b('0x41')]);_0x2b44fb[_0x2a2b('0x3f')]=_[_0x2a2b('0x40')](_0x2b44fb[_0x2a2b('0x3d')],_0x2b44fb['query']);_0x3961d8[_0x2a2b('0x43')]=_[_0x2a2b('0x40')](_0x2b44fb[_0x2a2b('0x3d')],qs[_0x2a2b('0x42')](_0xa1ac18['query']['fields']));_0x3961d8['attributes']=_0x3961d8['attributes'][_0x2a2b('0x44')]?_0x3961d8[_0x2a2b('0x43')]:_0x2b44fb[_0x2a2b('0x3d')];_0x3961d8[_0x2a2b('0x47')]=qs[_0x2a2b('0x48')](_0xa1ac18[_0x2a2b('0x41')][_0x2a2b('0x48')]);_0x3961d8['where']=qs[_0x2a2b('0x3f')](_[_0x2a2b('0x4a')](_0xa1ac18[_0x2a2b('0x41')],_0x2b44fb['filters']));if(_0xa1ac18[_0x2a2b('0x41')][_0x2a2b('0x4b')]){_0x3961d8[_0x2a2b('0x49')]=_[_0x2a2b('0x4d')](_0x3961d8[_0x2a2b('0x49')],{'$or':_[_0x2a2b('0x38')](_0x3961d8['attributes'],function(_0x4aae0f){var _0x1d701b={};_0x1d701b[_0x4aae0f]={'$like':'%'+_0xa1ac18[_0x2a2b('0x41')][_0x2a2b('0x4b')]+'%'};return _0x1d701b;})});}_0x3961d8=_[_0x2a2b('0x4d')]({},_0x3961d8,_0xa1ac18[_0x2a2b('0x52')]);return _0x53b1fb[_0x2a2b('0x117')](_0x3961d8);}})[_0x2a2b('0x2e')](function(_0x58df73){if(_0x58df73){_0x3e2b06=_0x58df73['length'];if(!_0xa1ac18[_0x2a2b('0x41')][_0x2a2b('0x45')]('nolimit')){_0x3961d8[_0x2a2b('0x26')]=qs[_0x2a2b('0x26')](_0xa1ac18[_0x2a2b('0x41')][_0x2a2b('0x26')]);_0x3961d8[_0x2a2b('0x25')]=qs[_0x2a2b('0x25')](_0xa1ac18[_0x2a2b('0x41')][_0x2a2b('0x25')]);}return _0x53b1fb['getApplications'](_0x3961d8);}})[_0x2a2b('0x2e')](function(_0x44f15b){if(_0x44f15b){return _0x44f15b?{'count':_0x3e2b06,'rows':_0x44f15b}:null;}})[_0x2a2b('0x2e')](respondWithResult(_0x30b06c,null))[_0x2a2b('0x20')](handleError(_0x30b06c,null));};exports[_0x2a2b('0x118')]=function(_0x5193e2,_0x12af67,_0x5f30bc){return db[_0x2a2b('0x119')][_0x2a2b('0x53')]({'where':{'id':_0x5193e2[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x12af67,null))[_0x2a2b('0x2e')](function(_0x1ef37e){if(_0x1ef37e){return _0x1ef37e[_0x2a2b('0x118')](_0x5193e2[_0x2a2b('0x55')][_0x2a2b('0x5f')],_[_0x2a2b('0xec')](_0x5193e2['body'],[_0x2a2b('0x5f'),'id'])||{});}})[_0x2a2b('0x2e')](respondWithResult(_0x12af67,null))[_0x2a2b('0x20')](handleError(_0x12af67,null));};exports[_0x2a2b('0x102')]=function(_0xa1489e,_0x5d3ef3,_0x5ad188){var _0x40eaec={};var _0x3ac8ef={};var _0x33b689;var _0x1f7f91;return db['ChatWebsite'][_0x2a2b('0xd3')]({'where':{'id':_0xa1489e['params']['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x5d3ef3,null))[_0x2a2b('0x2e')](function(_0x4640fa){if(_0x4640fa){_0x33b689=_0x4640fa;_0x3ac8ef[_0x2a2b('0x3d')]=_[_0x2a2b('0x3e')](db['ChatProactiveAction']['rawAttributes']);_0x3ac8ef[_0x2a2b('0x41')]=_[_0x2a2b('0x3e')](_0xa1489e[_0x2a2b('0x41')]);_0x3ac8ef['filters']=_[_0x2a2b('0x40')](_0x3ac8ef['model'],_0x3ac8ef[_0x2a2b('0x41')]);_0x40eaec[_0x2a2b('0x43')]=_[_0x2a2b('0x40')](_0x3ac8ef[_0x2a2b('0x3d')],qs[_0x2a2b('0x42')](_0xa1489e[_0x2a2b('0x41')][_0x2a2b('0x42')]));_0x40eaec[_0x2a2b('0x43')]=_0x40eaec[_0x2a2b('0x43')][_0x2a2b('0x44')]?_0x40eaec[_0x2a2b('0x43')]:_0x3ac8ef[_0x2a2b('0x3d')];_0x40eaec[_0x2a2b('0x47')]=qs['sort'](_0xa1489e[_0x2a2b('0x41')][_0x2a2b('0x48')]);_0x40eaec[_0x2a2b('0x49')]=qs['filters'](_[_0x2a2b('0x4a')](_0xa1489e['query'],_0x3ac8ef[_0x2a2b('0x3f')]));if(_0xa1489e[_0x2a2b('0x41')][_0x2a2b('0x4b')]){_0x40eaec[_0x2a2b('0x49')]=_[_0x2a2b('0x4d')](_0x40eaec[_0x2a2b('0x49')],{'$or':_[_0x2a2b('0x38')](_0x40eaec['attributes'],function(_0x1853b6){var _0x5651ea={};_0x5651ea[_0x1853b6]={'$like':'%'+_0xa1489e[_0x2a2b('0x41')][_0x2a2b('0x4b')]+'%'};return _0x5651ea;})});}_0x40eaec=_[_0x2a2b('0x4d')]({},_0x40eaec,_0xa1489e[_0x2a2b('0x52')]);return _0x33b689[_0x2a2b('0x102')](_0x40eaec);}})['then'](function(_0x38c650){if(_0x38c650){_0x1f7f91=_0x38c650[_0x2a2b('0x44')];if(!_0xa1489e[_0x2a2b('0x41')][_0x2a2b('0x45')](_0x2a2b('0x46'))){_0x40eaec[_0x2a2b('0x26')]=qs[_0x2a2b('0x26')](_0xa1489e[_0x2a2b('0x41')]['limit']);_0x40eaec['offset']=qs['offset'](_0xa1489e['query'][_0x2a2b('0x25')]);}return _0x33b689[_0x2a2b('0x102')](_0x40eaec);}})[_0x2a2b('0x2e')](function(_0x21467d){if(_0x21467d){return _0x21467d?{'count':_0x1f7f91,'rows':_0x21467d}:null;}})[_0x2a2b('0x2e')](respondWithResult(_0x5d3ef3,null))[_0x2a2b('0x20')](handleError(_0x5d3ef3,null));};exports[_0x2a2b('0x11a')]=function(_0x1acbe4,_0x58907a,_0x5365c6){var _0x3b8fc7=_0x1acbe4[_0x2a2b('0x41')][_0x2a2b('0x11b')]===_0x2a2b('0x11c')?_0x2a2b('0x11d'):_0x2a2b('0x11e');return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'attributes':['id',_0x3b8fc7],'where':{'id':_0x1acbe4[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x58907a,null))[_0x2a2b('0x2e')](function(_0x49fdf8){if(_0x49fdf8){var _0x1dec38=_0x49fdf8[_0x3b8fc7];var _0x1b0c48=_0x1dec38&&_0x1dec38[_0x2a2b('0x11f')]?_0x1dec38[_0x2a2b('0x11f')]:[];_0x58907a['send']({'fromKey':_[_0x2a2b('0x71')](_0x1dec38[_0x2a2b('0x120')])?undefined:_0x1dec38[_0x2a2b('0x120')],'count':_0x1b0c48['length'],'rows':_0x1b0c48});}})[_0x2a2b('0x20')](handleError(_0x58907a,null));};exports[_0x2a2b('0x121')]=function(_0x497966,_0x5df0ad,_0x8e3c0e){var _0x50143b={'raw':![],'where':{}};var _0x3e724f={};var _0x33dda2={'count':0x0,'rows':[]};return db[_0x2a2b('0x39')][_0x2a2b('0xd3')]({'where':{'id':_0x497966['params']['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x5df0ad,null))[_0x2a2b('0x2e')](function(_0x2a99b2){if(_0x2a99b2){_0x3e724f[_0x2a2b('0x3d')]=_[_0x2a2b('0x3e')](db[_0x2a2b('0x122')][_0x2a2b('0x3a')]);_0x3e724f['query']=_[_0x2a2b('0x3e')](_0x497966[_0x2a2b('0x41')]);_0x3e724f[_0x2a2b('0x3f')]=_[_0x2a2b('0x40')](_0x3e724f[_0x2a2b('0x3d')],_0x3e724f[_0x2a2b('0x41')]);_0x50143b['attributes']=_[_0x2a2b('0x40')](_0x3e724f[_0x2a2b('0x3d')],qs[_0x2a2b('0x42')](_0x497966[_0x2a2b('0x41')][_0x2a2b('0x42')]));_0x50143b[_0x2a2b('0x43')]=_0x50143b[_0x2a2b('0x43')]['length']?_0x50143b[_0x2a2b('0x43')]:_0x3e724f[_0x2a2b('0x3d')];if(!_0x497966[_0x2a2b('0x41')][_0x2a2b('0x45')](_0x2a2b('0x46'))){_0x50143b[_0x2a2b('0x26')]=qs[_0x2a2b('0x26')](_0x497966[_0x2a2b('0x41')]['limit']);_0x50143b[_0x2a2b('0x25')]=qs['offset'](_0x497966[_0x2a2b('0x41')][_0x2a2b('0x25')]);}_0x50143b[_0x2a2b('0x47')]=qs[_0x2a2b('0x48')](_0x497966[_0x2a2b('0x41')]['sort']);_0x50143b['where']=qs[_0x2a2b('0x3f')](_[_0x2a2b('0x4a')](_0x497966[_0x2a2b('0x41')],_0x3e724f[_0x2a2b('0x3f')]));_0x50143b['where'][_0x2a2b('0x5c')]=_0x2a99b2['id'];if(_0x497966[_0x2a2b('0x41')][_0x2a2b('0x4b')]){_0x50143b[_0x2a2b('0x49')]=_[_0x2a2b('0x4d')](_0x50143b[_0x2a2b('0x49')],{'$or':_[_0x2a2b('0x38')](_0x50143b['attributes'],function(_0x8646b2){var _0x17b125={};_0x17b125[_0x8646b2]={'$like':'%'+_0x497966[_0x2a2b('0x41')][_0x2a2b('0x4b')]+'%'};return _0x17b125;})});}_0x50143b=_[_0x2a2b('0x4d')]({},_0x50143b,_0x497966[_0x2a2b('0x52')]);return db[_0x2a2b('0x122')]['count']({'where':_0x50143b[_0x2a2b('0x49')]})['then'](function(_0xb7e66c){_0x33dda2[_0x2a2b('0x28')]=_0xb7e66c;if(_0x497966[_0x2a2b('0x41')][_0x2a2b('0x4e')]){_0x50143b[_0x2a2b('0x4f')]=[{'all':!![]}];}else{_0x50143b[_0x2a2b('0x4f')]=[{'model':db[_0x2a2b('0x81')],'as':_0x2a2b('0xee'),'required':![]},{'model':db[_0x2a2b('0x123')],'as':_0x2a2b('0x124'),'required':![]}];}return db['ChatOfflineMessage'][_0x2a2b('0x50')](_0x50143b);})[_0x2a2b('0x2e')](function(_0x39a48a){_0x33dda2[_0x2a2b('0x51')]=_0x39a48a;return _0x33dda2;});}})[_0x2a2b('0x2e')](respondWithFilteredResult(_0x5df0ad,_0x50143b))[_0x2a2b('0x20')](handleError(_0x5df0ad,null));};exports[_0x2a2b('0x125')]=function(_0x54cbde,_0x49ad15,_0x115632){return db['ChatWebsite'][_0x2a2b('0x53')]({'where':{'id':_0x54cbde['params']['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x49ad15,null))['then'](function(_0x5593b0){if(_0x5593b0){return _0x5593b0[_0x2a2b('0x125')](_0x54cbde[_0x2a2b('0x55')]['ids'],_[_0x2a2b('0xec')](_0x54cbde[_0x2a2b('0x55')],['ids','id'])||{})['spread'](function(_0x3e925e){for(var _0xb30e92=0x0;_0xb30e92<_0x54cbde['body']['ids']['length'];_0xb30e92+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x54cbde[_0x2a2b('0x55')][_0x2a2b('0x5f')][_0xb30e92]),'ChatWebsiteId':Number(_0x54cbde[_0x2a2b('0x5a')]['id'])});}return _0x3e925e;});}})[_0x2a2b('0x2e')](respondWithResult(_0x49ad15,null))[_0x2a2b('0x20')](handleError(_0x49ad15,null));};exports[_0x2a2b('0x126')]=function(_0x3c9d09,_0x311ced,_0x4a83c5){return db[_0x2a2b('0x39')][_0x2a2b('0x53')]({'where':{'id':_0x3c9d09[_0x2a2b('0x5a')]['id']}})[_0x2a2b('0x2e')](handleEntityNotFound(_0x311ced,null))[_0x2a2b('0x2e')](function(_0x48647a){if(_0x48647a){return _0x48647a[_0x2a2b('0x126')](_0x3c9d09['query'][_0x2a2b('0x5f')])['then'](function(){if(_[_0x2a2b('0x127')](_0x3c9d09[_0x2a2b('0x41')]['ids'])){for(var _0x52a771=0x0;_0x52a771<_0x3c9d09[_0x2a2b('0x41')][_0x2a2b('0x5f')][_0x2a2b('0x44')];_0x52a771+=0x1){socket[_0x2a2b('0x128')](_0x2a2b('0x129'),{'UserId':Number(_0x3c9d09[_0x2a2b('0x41')][_0x2a2b('0x5f')][_0x52a771]),'ChatWebsiteId':Number(_0x3c9d09[_0x2a2b('0x5a')]['id'])});}}else{socket[_0x2a2b('0x128')](_0x2a2b('0x129'),{'UserId':Number(_0x3c9d09[_0x2a2b('0x41')][_0x2a2b('0x5f')]),'ChatWebsiteId':Number(_0x3c9d09[_0x2a2b('0x5a')]['id'])});}});}})[_0x2a2b('0x2e')](respondWithStatusCode(_0x311ced,null))[_0x2a2b('0x20')](handleError(_0x311ced,null));};exports[_0x2a2b('0x12a')]=function(_0x1c1fcf,_0x17f545,_0x49ca11){var _0x2a5067={};var _0x52a4e5={};var _0x2e2ff4;var _0x5cad70;return db[_0x2a2b('0x39')][_0x2a2b('0xd3')]({'where':{'id':_0x1c1fcf[_0x2a2b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x17f545,null))[_0x2a2b('0x2e')](function(_0x2339b3){if(_0x2339b3){_0x2e2ff4=_0x2339b3;_0x52a4e5[_0x2a2b('0x3d')]=_[_0x2a2b('0x3e')](db[_0x2a2b('0xef')][_0x2a2b('0x3a')]);_0x52a4e5[_0x2a2b('0x41')]=_[_0x2a2b('0x3e')](_0x1c1fcf[_0x2a2b('0x41')]);_0x52a4e5[_0x2a2b('0x3f')]=_[_0x2a2b('0x40')](_0x52a4e5[_0x2a2b('0x3d')],_0x52a4e5[_0x2a2b('0x41')]);_0x2a5067[_0x2a2b('0x43')]=_[_0x2a2b('0x40')](_0x52a4e5[_0x2a2b('0x3d')],qs['fields'](_0x1c1fcf[_0x2a2b('0x41')]['fields']));_0x2a5067['attributes']=_0x2a5067[_0x2a2b('0x43')]['length']?_0x2a5067[_0x2a2b('0x43')]:_0x52a4e5[_0x2a2b('0x3d')];_0x2a5067['order']=qs['sort'](_0x1c1fcf[_0x2a2b('0x41')][_0x2a2b('0x48')]);_0x2a5067[_0x2a2b('0x49')]=qs[_0x2a2b('0x3f')](_[_0x2a2b('0x4a')](_0x1c1fcf[_0x2a2b('0x41')],_0x52a4e5['filters']));if(_0x1c1fcf[_0x2a2b('0x41')][_0x2a2b('0x4b')]){_0x2a5067['where']=_[_0x2a2b('0x4d')](_0x2a5067[_0x2a2b('0x49')],{'$or':_['map'](_0x2a5067[_0x2a2b('0x43')],function(_0x4bf89f){var _0x39b6bc={};_0x39b6bc[_0x4bf89f]={'$like':'%'+_0x1c1fcf[_0x2a2b('0x41')][_0x2a2b('0x4b')]+'%'};return _0x39b6bc;})});}_0x2a5067=_['merge']({},_0x2a5067,_0x1c1fcf[_0x2a2b('0x52')]);return _0x2e2ff4[_0x2a2b('0x12a')](_0x2a5067);}})[_0x2a2b('0x2e')](function(_0x310b4b){if(_0x310b4b){_0x5cad70=_0x310b4b[_0x2a2b('0x44')];if(!_0x1c1fcf['query'][_0x2a2b('0x45')]('nolimit')){_0x2a5067[_0x2a2b('0x26')]=qs[_0x2a2b('0x26')](_0x1c1fcf[_0x2a2b('0x41')]['limit']);_0x2a5067[_0x2a2b('0x25')]=qs[_0x2a2b('0x25')](_0x1c1fcf[_0x2a2b('0x41')][_0x2a2b('0x25')]);}return _0x2e2ff4[_0x2a2b('0x12a')](_0x2a5067);}})[_0x2a2b('0x2e')](function(_0x4768e3){if(_0x4768e3){return _0x4768e3?{'count':_0x5cad70,'rows':_0x4768e3}:null;}})[_0x2a2b('0x2e')](respondWithResult(_0x17f545,null))[_0x2a2b('0x20')](handleError(_0x17f545,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 8318e3d..6f4fbd3 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 _0x3379=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c2311,_0x24ae77){var _0x2f0ab2=function(_0x4769aa){while(--_0x4769aa){_0x5c2311['push'](_0x5c2311['shift']());}};_0x2f0ab2(++_0x24ae77);}(_0x3379,0x115));var _0x9337=function(_0x4c8543,_0x393cd4){_0x4c8543=_0x4c8543-0x0;var _0x580d91=_0x3379[_0x4c8543];return _0x580d91;};'use strict';var EventEmitter=require(_0x9337('0x0'));var ChatWebsite=require(_0x9337('0x1'))['db'][_0x9337('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9337('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9337('0x4'),'afterDestroy':_0x9337('0x5')};function emitEvent(_0x144317){return function(_0x30dcfe,_0x49ce9a,_0x45eb99){ChatWebsiteEvents[_0x9337('0x6')](_0x144317+':'+_0x30dcfe['id'],_0x30dcfe);ChatWebsiteEvents[_0x9337('0x6')](_0x144317,_0x30dcfe);_0x45eb99(null);};}for(var e in events){if(events[_0x9337('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9337('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4453=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x31a528,_0xa1707f){var _0x4deca8=function(_0x34227e){while(--_0x34227e){_0x31a528['push'](_0x31a528['shift']());}};_0x4deca8(++_0xa1707f);}(_0x4453,0x9c));var _0x3445=function(_0x57f7ea,_0x54da6b){_0x57f7ea=_0x57f7ea-0x0;var _0x54a7e4=_0x4453[_0x57f7ea];return _0x54a7e4;};'use strict';var EventEmitter=require(_0x3445('0x0'));var ChatWebsite=require(_0x3445('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3445('0x2')](0x0);var events={'afterCreate':_0x3445('0x3'),'afterUpdate':'update','afterDestroy':_0x3445('0x4')};function emitEvent(_0x1419a5){return function(_0xfff5,_0x22c15c,_0x461d8a){ChatWebsiteEvents[_0x3445('0x5')](_0x1419a5+':'+_0xfff5['id'],_0xfff5);ChatWebsiteEvents[_0x3445('0x5')](_0x1419a5,_0xfff5);_0x461d8a(null);};}for(var e in events){if(events[_0x3445('0x6')](e)){var event=events[e];ChatWebsite[_0x3445('0x7')](e,emitEvent(event));}}module[_0x3445('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 abccb60..9205875 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 _0xf68c=['define','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x403168,_0x5e3ee8){var _0x1f0a82=function(_0x2da0d2){while(--_0x2da0d2){_0x403168['push'](_0x403168['shift']());}};_0x1f0a82(++_0x5e3ee8);}(_0xf68c,0x140));var _0xcf68=function(_0x4fc79e,_0x22c7de){_0x4fc79e=_0x4fc79e-0x0;var _0x9c12f8=_0xf68c[_0x4fc79e];return _0x9c12f8;};'use strict';var _=require(_0xcf68('0x0'));var util=require(_0xcf68('0x1'));var logger=require(_0xcf68('0x2'))(_0xcf68('0x3'));var moment=require('moment');var BPromise=require(_0xcf68('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf68('0x5'));var rimraf=require(_0xcf68('0x6'));var config=require(_0xcf68('0x7'));var attributes=require(_0xcf68('0x8'));module[_0xcf68('0x9')]=function(_0x3c799c,_0x1de0f3){return _0x3c799c[_0xcf68('0xa')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1466=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_websites','lodash','util','../../config/logger'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x1466,0x11b));var _0x6146=function(_0x416ada,_0x4be4ef){_0x416ada=_0x416ada-0x0;var _0x23d1dc=_0x1466[_0x416ada];return _0x23d1dc;};'use strict';var _=require(_0x6146('0x0'));var util=require(_0x6146('0x1'));var logger=require(_0x6146('0x2'))(_0x6146('0x3'));var moment=require(_0x6146('0x4'));var BPromise=require(_0x6146('0x5'));var rp=require(_0x6146('0x6'));var fs=require('fs');var path=require(_0x6146('0x7'));var rimraf=require(_0x6146('0x8'));var config=require(_0x6146('0x9'));var attributes=require('./chatWebsite.attributes');module[_0x6146('0xa')]=function(_0x165c02,_0x50c386){return _0x165c02[_0x6146('0xb')]('ChatWebsite',attributes,{'tableName':_0x6146('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index abb071f..e4f6594 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 _0xb6cc=['register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','redis','localhost','./chatWebsite.socket'];(function(_0x61ef0f,_0x2cfd20){var _0x21ad28=function(_0x36414d){while(--_0x36414d){_0x61ef0f['push'](_0x61ef0f['shift']());}};_0x21ad28(++_0x2cfd20);}(_0xb6cc,0xc9));var _0xcb6c=function(_0x57d4f7,_0x4b6dc7){_0x57d4f7=_0x57d4f7-0x0;var _0x1f0668=_0xb6cc[_0x57d4f7];return _0x1f0668;};'use strict';var _=require(_0xcb6c('0x0'));var util=require(_0xcb6c('0x1'));var moment=require(_0xcb6c('0x2'));var BPromise=require(_0xcb6c('0x3'));var rs=require(_0xcb6c('0x4'));var fs=require('fs');var Redis=require(_0xcb6c('0x5'));var db=require(_0xcb6c('0x6'))['db'];var utils=require(_0xcb6c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xcb6c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb6c('0x9')][_0xcb6c('0xa')]({'port':0x232a});config['redis']=_[_0xcb6c('0xb')](config[_0xcb6c('0xc')],{'host':_0xcb6c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcb6c('0xe'))[_0xcb6c('0xf')](socket);function respondWithRpcPromise(_0x3b4d1a,_0x197586,_0x3b92b9){return new BPromise(function(_0x4b3865,_0x409abe){return client['request'](_0x3b4d1a,_0x3b92b9)[_0xcb6c('0x10')](function(_0x3657f2){logger[_0xcb6c('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x197586,_0xcb6c('0x12'));logger[_0xcb6c('0x13')](_0xcb6c('0x14'),_0x197586,_0xcb6c('0x12'),JSON[_0xcb6c('0x15')](_0x3657f2));if(_0x3657f2['error']){if(_0x3657f2['error']['code']===0x1f4){logger[_0xcb6c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x197586,_0x3657f2[_0xcb6c('0x16')][_0xcb6c('0x17')]);return _0x409abe(_0x3657f2[_0xcb6c('0x16')][_0xcb6c('0x17')]);}logger[_0xcb6c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x197586,_0x3657f2[_0xcb6c('0x16')]['message']);return _0x4b3865(_0x3657f2[_0xcb6c('0x16')][_0xcb6c('0x17')]);}else{logger['info'](_0xcb6c('0x18'),_0x197586,_0xcb6c('0x12'));_0x4b3865(_0x3657f2[_0xcb6c('0x19')][_0xcb6c('0x17')]);}})[_0xcb6c('0x1a')](function(_0x2293bd){logger[_0xcb6c('0x16')](_0xcb6c('0x18'),_0x197586,_0x2293bd);_0x409abe(_0x2293bd);});});}
\ No newline at end of file
+var _0x480d=['message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52dc38,_0x2a4db0){var _0x52e132=function(_0x39acbf){while(--_0x39acbf){_0x52dc38['push'](_0x52dc38['shift']());}};_0x52e132(++_0x2a4db0);}(_0x480d,0x18c));var _0xd480=function(_0x2a7d0c,_0x1ce709){_0x2a7d0c=_0x2a7d0c-0x0;var _0x37ccc0=_0x480d[_0x2a7d0c];return _0x37ccc0;};'use strict';var _=require(_0xd480('0x0'));var util=require('util');var moment=require(_0xd480('0x1'));var BPromise=require(_0xd480('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd480('0x3'));var db=require(_0xd480('0x4'))['db'];var utils=require(_0xd480('0x5'));var logger=require(_0xd480('0x6'))(_0xd480('0x7'));var config=require(_0xd480('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd480('0x9')][_0xd480('0xa')]({'port':0x232a});config[_0xd480('0xb')]=_[_0xd480('0xc')](config[_0xd480('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd480('0xd'))(new Redis(config[_0xd480('0xb')]));require(_0xd480('0xe'))['register'](socket);function respondWithRpcPromise(_0x1152fa,_0x2ec784,_0x53de33){return new BPromise(function(_0x4ee5e9,_0x4a1c41){return client[_0xd480('0xf')](_0x1152fa,_0x53de33)[_0xd480('0x10')](function(_0x38efe2){logger[_0xd480('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x2ec784,_0xd480('0x12'));logger[_0xd480('0x13')](_0xd480('0x14'),_0x2ec784,_0xd480('0x12'),JSON[_0xd480('0x15')](_0x38efe2));if(_0x38efe2[_0xd480('0x16')]){if(_0x38efe2['error'][_0xd480('0x17')]===0x1f4){logger[_0xd480('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2ec784,_0x38efe2[_0xd480('0x16')][_0xd480('0x18')]);return _0x4a1c41(_0x38efe2[_0xd480('0x16')][_0xd480('0x18')]);}logger[_0xd480('0x16')](_0xd480('0x19'),_0x2ec784,_0x38efe2[_0xd480('0x16')]['message']);return _0x4ee5e9(_0x38efe2['error'][_0xd480('0x18')]);}else{logger[_0xd480('0x11')](_0xd480('0x19'),_0x2ec784,'request\x20sent');_0x4ee5e9(_0x38efe2[_0xd480('0x1a')][_0xd480('0x18')]);}})[_0xd480('0x1b')](function(_0x4f47dc){logger['error'](_0xd480('0x19'),_0x2ec784,_0x4f47dc);_0x4a1c41(_0x4f47dc);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 519208a..1a1a435 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 _0x3cd0=['update','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cd0,0xfd));var _0x03cd=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x3cd0[_0x255ac0];return _0x437bf1;};'use strict';var ChatWebsiteEvents=require(_0x03cd('0x0'));var events=[_0x03cd('0x1'),_0x03cd('0x2'),_0x03cd('0x3')];function createListener(_0x16dbb2,_0x3f38d9){return function(_0x5b3d8a){_0x3f38d9['emit'](_0x16dbb2,_0x5b3d8a);};}function removeListener(_0x5abc8e,_0x4bc885){return function(){ChatWebsiteEvents[_0x03cd('0x4')](_0x5abc8e,_0x4bc885);};}exports[_0x03cd('0x5')]=function(_0x41878c){for(var _0x53ac33=0x0,_0x3800da=events[_0x03cd('0x6')];_0x53ac33<_0x3800da;_0x53ac33++){var _0x596e48=events[_0x53ac33];var _0x41743c=createListener(_0x03cd('0x7')+_0x596e48,_0x41878c);ChatWebsiteEvents['on'](_0x596e48,_0x41743c);}};
\ No newline at end of file
+var _0x8cf2=['emit','register','length','./chatWebsite.events','save'];(function(_0x2dc5e,_0x5376dd){var _0x384e3a=function(_0x136429){while(--_0x136429){_0x2dc5e['push'](_0x2dc5e['shift']());}};_0x384e3a(++_0x5376dd);}(_0x8cf2,0x1e3));var _0x28cf=function(_0x2d42e7,_0x4420e5){_0x2d42e7=_0x2d42e7-0x0;var _0x5205a9=_0x8cf2[_0x2d42e7];return _0x5205a9;};'use strict';var ChatWebsiteEvents=require(_0x28cf('0x0'));var events=[_0x28cf('0x1'),'remove','update'];function createListener(_0x4d28a9,_0x5a82fa){return function(_0x496fa6){_0x5a82fa[_0x28cf('0x2')](_0x4d28a9,_0x496fa6);};}function removeListener(_0x5dd77d,_0x36efa4){return function(){ChatWebsiteEvents['removeListener'](_0x5dd77d,_0x36efa4);};}exports[_0x28cf('0x3')]=function(_0x4d8d14){for(var _0x40a5c8=0x0,_0xe2181f=events[_0x28cf('0x4')];_0x40a5c8<_0xe2181f;_0x40a5c8++){var _0x1c18a5=events[_0x40a5c8];var _0x3f985b=createListener('chatWebsite:'+_0x1c18a5,_0x4d8d14);ChatWebsiteEvents['on'](_0x1c18a5,_0x3f985b);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index a409227..2bb7a55 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 _0x0e03=['file','addLogo','join','now','single','addAvatar','server/files/images/avatars/','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo'];(function(_0x46a8ff,_0x8ecc7c){var _0xaa4c09=function(_0x2ad188){while(--_0x2ad188){_0x46a8ff['push'](_0x46a8ff['shift']());}};_0xaa4c09(++_0x8ecc7c);}(_0x0e03,0x169));var _0x30e0=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x0e03[_0xb6e2ea];return _0x2a57bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30e0('0x0'));var timeout=require(_0x30e0('0x1'));var express=require(_0x30e0('0x2'));var router=express[_0x30e0('0x3')]();var fs_extra=require(_0x30e0('0x4'));var auth=require(_0x30e0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x30e0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x30e0('0x7')]);router[_0x30e0('0x8')](_0x30e0('0x9'),auth['isAuthenticated'](),controller[_0x30e0('0xa')]);router[_0x30e0('0x8')](_0x30e0('0xb'),auth[_0x30e0('0xc')](),controller[_0x30e0('0xd')]);router['get'](_0x30e0('0xe'),auth[_0x30e0('0xc')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x30e0('0xc')](),controller[_0x30e0('0xf')]);router[_0x30e0('0x8')]('/:id/logo',controller[_0x30e0('0x10')]);router['get'](_0x30e0('0x11'),controller[_0x30e0('0x12')]);router['get'](_0x30e0('0x13'),controller['getCustomerAvatar']);router[_0x30e0('0x8')](_0x30e0('0x14'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x30e0('0xc')](),controller['getInteractions']);router[_0x30e0('0x8')](_0x30e0('0x15'),controller[_0x30e0('0x16')]);router[_0x30e0('0x8')](_0x30e0('0x17'),auth[_0x30e0('0xc')](),controller[_0x30e0('0x18')]);router[_0x30e0('0x8')]('/:id/proactive_actions',auth[_0x30e0('0xc')](),controller[_0x30e0('0x19')]);router[_0x30e0('0x8')]('/:id/fields',controller[_0x30e0('0x1a')]);router[_0x30e0('0x8')](_0x30e0('0x1b'),auth[_0x30e0('0xc')](),controller[_0x30e0('0x1c')]);router['get'](_0x30e0('0x1d'),auth[_0x30e0('0xc')](),controller[_0x30e0('0x1e')]);router['post']('/',auth[_0x30e0('0xc')](),controller['create']);router[_0x30e0('0x1f')](_0x30e0('0xe'),auth[_0x30e0('0xc')](),controller[_0x30e0('0x20')]);router[_0x30e0('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x30e0('0x21')]);var upload=multer({'storage':multer[_0x30e0('0x22')]({'destination':function(_0x1cde27,_0x25047e,_0x485076){_0x485076(null,path['join'](config[_0x30e0('0x23')],_0x30e0('0x24')));},'filename':function(_0x17036b,_0x4a7d9c,_0x1f69d9){_0x1f69d9(null,util[_0x30e0('0x25')](_0x30e0('0x26'),Date['now'](),_0x4a7d9c[_0x30e0('0x27')]));}})});router[_0x30e0('0x1f')](_0x30e0('0x28'),upload['single'](_0x30e0('0x29')),controller[_0x30e0('0x2a')]);var upload=multer({'storage':multer[_0x30e0('0x22')]({'destination':function(_0x17fb8a,_0xddb94b,_0x2d57f6){_0x2d57f6(null,path[_0x30e0('0x2b')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x17f68b,_0x3d7916,_0x4db686){_0x4db686(null,util[_0x30e0('0x25')]('%s-%s',Date[_0x30e0('0x2c')](),_0x3d7916[_0x30e0('0x27')]));}})});router[_0x30e0('0x1f')](_0x30e0('0x11'),upload[_0x30e0('0x2d')](_0x30e0('0x29')),controller[_0x30e0('0x2e')]);var upload=multer({'storage':multer[_0x30e0('0x22')]({'destination':function(_0x4af403,_0x43b002,_0x150efd){_0x150efd(null,path['join'](config['root'],_0x30e0('0x2f')));},'filename':function(_0x386ff5,_0x5a7dd2,_0x3b097d){_0x3b097d(null,util['format'](_0x30e0('0x26'),Date[_0x30e0('0x2c')](),_0x5a7dd2[_0x30e0('0x27')]));}})});router[_0x30e0('0x1f')](_0x30e0('0x13'),upload['single'](_0x30e0('0x29')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x30e0('0x22')]({'destination':function(_0xeebd30,_0x24ba74,_0x2daddd){_0x2daddd(null,path[_0x30e0('0x2b')](config[_0x30e0('0x23')],_0x30e0('0x2f')));},'filename':function(_0x15d7f3,_0x1ad163,_0x1801d9){_0x1801d9(null,util[_0x30e0('0x25')](_0x30e0('0x26'),Date[_0x30e0('0x2c')](),_0x1ad163['originalname']));}})});router[_0x30e0('0x1f')](_0x30e0('0x14'),upload[_0x30e0('0x2d')](_0x30e0('0x29')),controller['addSystemAvatar']);router['post']('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x1e405c,_0x68058c,_0x5506b0){const _0x4790c6=path['join'](config['root'],_0x30e0('0x30'),_0x30e0('0x31'),_0x30e0('0x32'));fs_extra['ensureDir'](_0x4790c6,function(){_0x5506b0(null,_0x4790c6);});},'filename':function(_0x2a51b5,_0x4267ac,_0x484302){const _0x5c91ae=_0x4267ac['originalname'][_0x30e0('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x498af7=path[_0x30e0('0x34')](_0x5c91ae);const _0x20539a=Date[_0x30e0('0x2c')]()+'-'+_0x5c91ae[_0x30e0('0x33')](_0x498af7,'')+_0x498af7;_0x484302(null,_0x20539a);}})});router[_0x30e0('0x1f')](_0x30e0('0x35'),offlineUploadMulter[_0x30e0('0x36')](),controller[_0x30e0('0x37')]);router[_0x30e0('0x1f')](_0x30e0('0x38'),auth[_0x30e0('0xc')](),controller[_0x30e0('0x39')]);router['post'](_0x30e0('0x17'),auth['isAuthenticated'](),controller['addApplications']);router[_0x30e0('0x1f')](_0x30e0('0x3a'),auth['isAuthenticated'](),controller[_0x30e0('0x3b')]);router[_0x30e0('0x1f')](_0x30e0('0x1d'),auth['isAuthenticated'](),controller[_0x30e0('0x3c')]);router[_0x30e0('0x3d')](_0x30e0('0xb'),auth['isAuthenticated'](),controller[_0x30e0('0x3e')]);router[_0x30e0('0x3f')](_0x30e0('0xb'),auth[_0x30e0('0xc')](),controller[_0x30e0('0x40')]);router[_0x30e0('0x3f')](_0x30e0('0xe'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x30e0('0x3f')]('/:id/canned_answers',auth[_0x30e0('0xc')](),controller[_0x30e0('0x41')]);router['delete'](_0x30e0('0x1d'),auth['isAuthenticated'](),controller[_0x30e0('0x42')]);module['exports']=router;
\ No newline at end of file
+var _0xdaf4=['/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','post','/:id/canned_answers','addAnswer','root','%s-%s','now','originalname','/:id/logo','single','file','join','format','addAvatar','addCustomerAvatar','server/files/images/avatars/','notify','diskStorage','attachments','offline-chat','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xdaf4,0xf8));var _0x4daf=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0xdaf4[_0x5a2285];return _0x48f6ed;};'use strict';var multer=require(_0x4daf('0x0'));var util=require('util');var path=require(_0x4daf('0x1'));var timeout=require(_0x4daf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4daf('0x3'));var auth=require(_0x4daf('0x4'));var interaction=require(_0x4daf('0x5'));var config=require(_0x4daf('0x6'));var controller=require(_0x4daf('0x7'));router[_0x4daf('0x8')]('/',auth[_0x4daf('0x9')](),controller[_0x4daf('0xa')]);router[_0x4daf('0x8')](_0x4daf('0xb'),auth[_0x4daf('0x9')](),controller[_0x4daf('0xc')]);router['get']('/:id',auth[_0x4daf('0x9')](),controller[_0x4daf('0xd')]);router['get'](_0x4daf('0xe'),auth[_0x4daf('0x9')](),controller[_0x4daf('0xf')]);router[_0x4daf('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4daf('0x10')]);router[_0x4daf('0x8')]('/:id/logo',controller['getLogo']);router[_0x4daf('0x8')](_0x4daf('0x11'),controller[_0x4daf('0x12')]);router[_0x4daf('0x8')](_0x4daf('0x13'),controller['getCustomerAvatar']);router['get'](_0x4daf('0x14'),controller['getSystemAvatar']);router[_0x4daf('0x8')](_0x4daf('0x15'),auth[_0x4daf('0x9')](),controller[_0x4daf('0x16')]);router['get'](_0x4daf('0x17'),controller['getSnippet']);router['get'](_0x4daf('0x18'),auth['isAuthenticated'](),controller[_0x4daf('0x19')]);router[_0x4daf('0x8')](_0x4daf('0x1a'),auth[_0x4daf('0x9')](),controller[_0x4daf('0x1b')]);router[_0x4daf('0x8')](_0x4daf('0x1c'),controller[_0x4daf('0x1d')]);router[_0x4daf('0x8')](_0x4daf('0x1e'),auth[_0x4daf('0x9')](),controller['getOfflineMessages']);router[_0x4daf('0x8')]('/:id/users',auth[_0x4daf('0x9')](),controller['getAgents']);router[_0x4daf('0x1f')]('/',auth[_0x4daf('0x9')](),controller['create']);router['post'](_0x4daf('0xe'),auth[_0x4daf('0x9')](),controller['addDisposition']);router[_0x4daf('0x1f')](_0x4daf('0x20'),auth['isAuthenticated'](),controller[_0x4daf('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32f9bc,_0x5d2b14,_0x3cc468){_0x3cc468(null,path['join'](config[_0x4daf('0x22')],'server/files/images/logos/'));},'filename':function(_0x28a352,_0x25df04,_0x265a29){_0x265a29(null,util['format'](_0x4daf('0x23'),Date[_0x4daf('0x24')](),_0x25df04[_0x4daf('0x25')]));}})});router[_0x4daf('0x1f')](_0x4daf('0x26'),upload[_0x4daf('0x27')](_0x4daf('0x28')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x24ab87,_0xb57ed0,_0x2ba3fb){_0x2ba3fb(null,path[_0x4daf('0x29')](config[_0x4daf('0x22')],'server/files/images/avatars/'));},'filename':function(_0xc28c86,_0x63d87c,_0x8da64e){_0x8da64e(null,util[_0x4daf('0x2a')](_0x4daf('0x23'),Date[_0x4daf('0x24')](),_0x63d87c['originalname']));}})});router[_0x4daf('0x1f')](_0x4daf('0x11'),upload[_0x4daf('0x27')](_0x4daf('0x28')),controller[_0x4daf('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e80dc,_0x100af8,_0x17647f){_0x17647f(null,path[_0x4daf('0x29')](config[_0x4daf('0x22')],'server/files/images/avatars/'));},'filename':function(_0x5554c7,_0x5655f8,_0x249170){_0x249170(null,util[_0x4daf('0x2a')]('%s-%s',Date[_0x4daf('0x24')](),_0x5655f8[_0x4daf('0x25')]));}})});router['post']('/:id/customer_avatar',upload[_0x4daf('0x27')](_0x4daf('0x28')),controller[_0x4daf('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5dffc3,_0x11a0a7,_0x17e027){_0x17e027(null,path[_0x4daf('0x29')](config['root'],_0x4daf('0x2d')));},'filename':function(_0x4fead3,_0x18e7b7,_0x17437f){_0x17437f(null,util[_0x4daf('0x2a')](_0x4daf('0x23'),Date[_0x4daf('0x24')](),_0x18e7b7[_0x4daf('0x25')]));}})});router[_0x4daf('0x1f')](_0x4daf('0x14'),upload['single'](_0x4daf('0x28')),controller['addSystemAvatar']);router[_0x4daf('0x1f')]('/:id/notify',controller[_0x4daf('0x2e')]);const offlineUploadMulter=multer({'storage':multer[_0x4daf('0x2f')]({'destination':function(_0x2880de,_0x3a1ccb,_0x13e541){const _0x2d3555=path['join'](config['root'],'server/files',_0x4daf('0x30'),_0x4daf('0x31'));fs_extra['ensureDir'](_0x2d3555,function(){_0x13e541(null,_0x2d3555);});},'filename':function(_0x1f78ca,_0x1384e4,_0xac8f06){const _0x86728e=_0x1384e4[_0x4daf('0x25')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1411e9=path[_0x4daf('0x32')](_0x86728e);const _0x10b347=Date['now']()+'-'+_0x86728e[_0x4daf('0x33')](_0x1411e9,'')+_0x1411e9;_0xac8f06(null,_0x10b347);}})});router[_0x4daf('0x1f')](_0x4daf('0x34'),offlineUploadMulter[_0x4daf('0x35')](),controller[_0x4daf('0x36')]);router[_0x4daf('0x1f')](_0x4daf('0x15'),auth['isAuthenticated'](),controller[_0x4daf('0x37')]);router[_0x4daf('0x1f')](_0x4daf('0x18'),auth[_0x4daf('0x9')](),controller[_0x4daf('0x38')]);router[_0x4daf('0x1f')](_0x4daf('0x1a'),auth['isAuthenticated'](),controller[_0x4daf('0x39')]);router['post'](_0x4daf('0x3a'),auth[_0x4daf('0x9')](),controller['addAgents']);router[_0x4daf('0x3b')](_0x4daf('0x3c'),auth[_0x4daf('0x9')](),controller[_0x4daf('0x3d')]);router[_0x4daf('0x3e')]('/:id',auth[_0x4daf('0x9')](),controller[_0x4daf('0x3f')]);router[_0x4daf('0x3e')](_0x4daf('0xe'),auth['isAuthenticated'](),controller[_0x4daf('0x40')]);router[_0x4daf('0x3e')]('/:id/canned_answers',auth[_0x4daf('0x9')](),controller[_0x4daf('0x41')]);router[_0x4daf('0x3e')](_0x4daf('0x3a'),auth[_0x4daf('0x9')](),controller[_0x4daf('0x42')]);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 59a43cf..46a2d11 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 _0xfc17=['Google','sequelize','exports','STRING','ENUM'];(function(_0x36abfd,_0x32068a){var _0x14ab00=function(_0x79ee87){while(--_0x79ee87){_0x36abfd['push'](_0x36abfd['shift']());}};_0x14ab00(++_0x32068a);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x5e5b9a,_0x26e6c1){_0x5e5b9a=_0x5e5b9a-0x0;var _0x38231a=_0xfc17[_0x5e5b9a];return _0x38231a;};'use strict';var Sequelize=require(_0x7fc1('0x0'));module[_0x7fc1('0x1')]={'name':{'type':Sequelize[_0x7fc1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7fc1('0x3')]('AmazonAWS',_0x7fc1('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x7fc1('0x2')]},'data2':{'type':Sequelize[_0x7fc1('0x2')]}};
\ No newline at end of file
+var _0x0960=['Google','STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x250c78,_0x25b838){var _0x44f07a=function(_0x599b41){while(--_0x599b41){_0x250c78['push'](_0x250c78['shift']());}};_0x44f07a(++_0x25b838);}(_0x0960,0xc2));var _0x0096=function(_0x55c3df,_0xa52b7){_0x55c3df=_0x55c3df-0x0;var _0x3b95c5=_0x0960[_0x55c3df];return _0x3b95c5;};'use strict';var Sequelize=require(_0x0096('0x0'));module[_0x0096('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0096('0x2')](_0x0096('0x3'),_0x0096('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x0096('0x5')]},'data2':{'type':Sequelize[_0x0096('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e6d43cf..b87dd50 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 _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x5e3898,_0x39f21a){var _0xd775f6=function(_0x4c6831){while(--_0x4c6831){_0x5e3898['push'](_0x5e3898['shift']());}};_0xd775f6(++_0x39f21a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,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(_0x55cfc1,_0x3c5de5){var _0x4b6119=function(_0x2654c0){while(--_0x2654c0){_0x55cfc1['push'](_0x55cfc1['shift']());}};_0x4b6119(++_0x3c5de5);}(_0x7a54,0x106));var _0x47a5=function(_0x1d90a2,_0x4021ca){_0x1d90a2=_0x1d90a2-0x0;var _0x35bba2=_0x7a54[_0x1d90a2];return _0x35bba2;};'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 94d1138..ae48640 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 _0xb179=['path','../../config/environment','exports','cloud_providers','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2f6d94,_0x43f3f7){var _0x9e4c3b=function(_0x40737e){while(--_0x40737e){_0x2f6d94['push'](_0x2f6d94['shift']());}};_0x9e4c3b(++_0x43f3f7);}(_0xb179,0x148));var _0x9b17=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb179[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x9b17('0x0'));var logger=require(_0x9b17('0x1'))(_0x9b17('0x2'));var moment=require('moment');var BPromise=require(_0x9b17('0x3'));var rp=require(_0x9b17('0x4'));var fs=require('fs');var path=require(_0x9b17('0x5'));var rimraf=require('rimraf');var config=require(_0x9b17('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x9b17('0x7')]=function(_0x51e093,_0x558150){return _0x51e093['define']('CloudProvider',attributes,{'tableName':_0x9b17('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ae3=['../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ae3,0x11e));var _0x35ae=function(_0x497ecd,_0x7115ab){_0x497ecd=_0x497ecd-0x0;var _0x2bed21=_0x5ae3[_0x497ecd];return _0x2bed21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x35ae('0x0'))(_0x35ae('0x1'));var moment=require('moment');var BPromise=require(_0x35ae('0x2'));var rp=require(_0x35ae('0x3'));var fs=require('fs');var path=require(_0x35ae('0x4'));var rimraf=require(_0x35ae('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ae('0x6'));module[_0x35ae('0x7')]=function(_0xe36b7b,_0x3abea4){return _0xe36b7b[_0x35ae('0x8')](_0x35ae('0x9'),attributes,{'tableName':_0x35ae('0xa'),'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 ed54c4f..68f1d03 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 _0xbb35=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5d8212,_0x34cf7f){var _0x4f8055=function(_0x1bfee4){while(--_0x1bfee4){_0x5d8212['push'](_0x5d8212['shift']());}};_0x4f8055(++_0x34cf7f);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x1a7358,_0x3ec9dd){_0x1a7358=_0x1a7358-0x0;var _0x199718=_0xbb35[_0x1a7358];return _0x199718;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var moment=require(_0x5bb3('0x1'));var BPromise=require(_0x5bb3('0x2'));var rs=require(_0x5bb3('0x3'));var fs=require('fs');var Redis=require(_0x5bb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bb3('0x5'));var logger=require(_0x5bb3('0x6'))(_0x5bb3('0x7'));var config=require(_0x5bb3('0x8'));var jayson=require(_0x5bb3('0x9'));var client=jayson[_0x5bb3('0xa')][_0x5bb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbd7a90,_0xe7fb91,_0x4f59cb){return new BPromise(function(_0x14986f,_0x11d7df){return client[_0x5bb3('0xc')](_0xbd7a90,_0x4f59cb)[_0x5bb3('0xd')](function(_0x534872){logger[_0x5bb3('0xe')]('CloudProvider,\x20%s,\x20%s',_0xe7fb91,_0x5bb3('0xf'));logger['debug'](_0x5bb3('0x10'),_0xe7fb91,_0x5bb3('0xf'),JSON[_0x5bb3('0x11')](_0x534872));if(_0x534872[_0x5bb3('0x12')]){if(_0x534872[_0x5bb3('0x12')]['code']===0x1f4){logger[_0x5bb3('0x12')](_0x5bb3('0x13'),_0xe7fb91,_0x534872[_0x5bb3('0x12')]['message']);return _0x11d7df(_0x534872[_0x5bb3('0x12')][_0x5bb3('0x14')]);}logger[_0x5bb3('0x12')](_0x5bb3('0x13'),_0xe7fb91,_0x534872[_0x5bb3('0x12')][_0x5bb3('0x14')]);return _0x14986f(_0x534872[_0x5bb3('0x12')][_0x5bb3('0x14')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0xe7fb91,'request\x20sent');_0x14986f(_0x534872[_0x5bb3('0x15')][_0x5bb3('0x14')]);}})[_0x5bb3('0x16')](function(_0x1092df){logger[_0x5bb3('0x12')](_0x5bb3('0x13'),_0xe7fb91,_0x1092df);_0x11d7df(_0x1092df);});});}
\ No newline at end of file
+var _0xe8e8=['lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe8e8,0xc6));var _0x8e8e=function(_0xad4f90,_0xa40747){_0xad4f90=_0xad4f90-0x0;var _0x32b0f9=_0xe8e8[_0xad4f90];return _0x32b0f9;};'use strict';var _=require(_0x8e8e('0x0'));var util=require(_0x8e8e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e8e('0x2'));var fs=require('fs');var Redis=require(_0x8e8e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e8e('0x4'))('rpc');var config=require(_0x8e8e('0x5'));var jayson=require(_0x8e8e('0x6'));var client=jayson[_0x8e8e('0x7')][_0x8e8e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x559147,_0x2d5ad4,_0x4edd6c){return new BPromise(function(_0x21703a,_0x35e125){return client[_0x8e8e('0x9')](_0x559147,_0x4edd6c)[_0x8e8e('0xa')](function(_0x40be2d){logger[_0x8e8e('0xb')](_0x8e8e('0xc'),_0x2d5ad4,'request\x20sent');logger[_0x8e8e('0xd')](_0x8e8e('0xe'),_0x2d5ad4,_0x8e8e('0xf'),JSON[_0x8e8e('0x10')](_0x40be2d));if(_0x40be2d['error']){if(_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x12')]===0x1f4){logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x13')]);return _0x35e125(_0x40be2d[_0x8e8e('0x11')][_0x8e8e('0x13')]);}logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x40be2d['error'][_0x8e8e('0x13')]);return _0x21703a(_0x40be2d[_0x8e8e('0x11')]['message']);}else{logger[_0x8e8e('0xb')](_0x8e8e('0xc'),_0x2d5ad4,'request\x20sent');_0x21703a(_0x40be2d[_0x8e8e('0x14')][_0x8e8e('0x13')]);}})[_0x8e8e('0x15')](function(_0x3b958a){logger[_0x8e8e('0x11')](_0x8e8e('0xc'),_0x2d5ad4,_0x3b958a);_0x35e125(_0x3b958a);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8d9ba08..fbd65ba 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 _0x86a8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2a8f04,_0x11bf25){var _0x50af8b=function(_0x2366c6){while(--_0x2366c6){_0x2a8f04['push'](_0x2a8f04['shift']());}};_0x50af8b(++_0x11bf25);}(_0x86a8,0xc0));var _0x886a=function(_0x24334e,_0x1bfca5){_0x24334e=_0x24334e-0x0;var _0x4eb691=_0x86a8[_0x24334e];return _0x4eb691;};'use strict';var multer=require(_0x886a('0x0'));var util=require(_0x886a('0x1'));var path=require(_0x886a('0x2'));var timeout=require(_0x886a('0x3'));var express=require(_0x886a('0x4'));var router=express[_0x886a('0x5')]();var fs_extra=require(_0x886a('0x6'));var auth=require(_0x886a('0x7'));var interaction=require(_0x886a('0x8'));var config=require(_0x886a('0x9'));var controller=require(_0x886a('0xa'));router[_0x886a('0xb')]('/',auth[_0x886a('0xc')](),controller[_0x886a('0xd')]);router[_0x886a('0xb')](_0x886a('0xe'),auth[_0x886a('0xc')](),controller[_0x886a('0xf')]);router[_0x886a('0x10')]('/',auth[_0x886a('0xc')](),controller[_0x886a('0x11')]);router[_0x886a('0x12')](_0x886a('0xe'),auth[_0x886a('0xc')](),controller[_0x886a('0x13')]);router[_0x886a('0x14')](_0x886a('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x886a('0x15')]=router;
\ No newline at end of file
+var _0xe9f0=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0xd4e53c,_0x116395){var _0x2f1381=function(_0xe299b7){while(--_0xe299b7){_0xd4e53c['push'](_0xd4e53c['shift']());}};_0x2f1381(++_0x116395);}(_0xe9f0,0x1ea));var _0x0e9f=function(_0x232456,_0x1ff422){_0x232456=_0x232456-0x0;var _0x5c0763=_0xe9f0[_0x232456];return _0x5c0763;};'use strict';var multer=require(_0x0e9f('0x0'));var util=require(_0x0e9f('0x1'));var path=require(_0x0e9f('0x2'));var timeout=require(_0x0e9f('0x3'));var express=require(_0x0e9f('0x4'));var router=express[_0x0e9f('0x5')]();var fs_extra=require(_0x0e9f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0e9f('0x7'));var config=require(_0x0e9f('0x8'));var controller=require('./cloudProvider.controller');router[_0x0e9f('0x9')]('/',auth[_0x0e9f('0xa')](),controller['index']);router[_0x0e9f('0x9')](_0x0e9f('0xb'),auth[_0x0e9f('0xa')](),controller[_0x0e9f('0xc')]);router[_0x0e9f('0xd')]('/',auth['isAuthenticated'](),controller[_0x0e9f('0xe')]);router[_0x0e9f('0xf')](_0x0e9f('0xb'),auth['isAuthenticated'](),controller[_0x0e9f('0x10')]);router['delete'](_0x0e9f('0xb'),auth[_0x0e9f('0xa')](),controller[_0x0e9f('0x11')]);module[_0x0e9f('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9623993..6b5cdc8 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 _0x1629=['sequelize','exports','STRING','name'];(function(_0x4e0e9d,_0x248845){var _0x3b4f3a=function(_0x45fdf7){while(--_0x45fdf7){_0x4e0e9d['push'](_0x4e0e9d['shift']());}};_0x3b4f3a(++_0x248845);}(_0x1629,0x1d8));var _0x9162=function(_0x2841e1,_0x55d931){_0x2841e1=_0x2841e1-0x0;var _0x3d6eff=_0x1629[_0x2841e1];return _0x3d6eff;};'use strict';var Sequelize=require(_0x9162('0x0'));module[_0x9162('0x1')]={'name':{'type':Sequelize[_0x9162('0x2')],'unique':_0x9162('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x9162('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9162('0x2')]},'type':{'type':Sequelize[_0x9162('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9162('0x2')]},'country':{'type':Sequelize[_0x9162('0x2')]},'email':{'type':Sequelize[_0x9162('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9162('0x2')]},'sStreet':{'type':Sequelize[_0x9162('0x2')]},'sPostalCode':{'type':Sequelize[_0x9162('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5aa7=['STRING','sequelize','exports','name'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x5aa7,0x131));var _0x75aa=function(_0x549c5d,_0x25628c){_0x549c5d=_0x549c5d-0x0;var _0x4707d0=_0x5aa7[_0x549c5d];return _0x4707d0;};'use strict';var Sequelize=require(_0x75aa('0x0'));module[_0x75aa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x75aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x75aa('0x3')]},'companyId':{'type':Sequelize[_0x75aa('0x3')]},'website':{'type':Sequelize[_0x75aa('0x3')]},'phone':{'type':Sequelize[_0x75aa('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x75aa('0x3')]},'street':{'type':Sequelize[_0x75aa('0x3')]},'postalCode':{'type':Sequelize[_0x75aa('0x3')]},'city':{'type':Sequelize[_0x75aa('0x3')]},'country':{'type':Sequelize[_0x75aa('0x3')]},'email':{'type':Sequelize[_0x75aa('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x75aa('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x75aa('0x3')]},'sCity':{'type':Sequelize[_0x75aa('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x75aa('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index f09cb17..1ea9cda 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 _0xab5b=['save','destroy','get','Companies','then','error','stack','name','send','index','CmCompany','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','map','filter','options','include','rows','catch','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','CmContact','ids','omit','getContacts','findOne','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab5b,0x190));var _0xbab5=function(_0x3243fb,_0x11222c){_0x3243fb=_0x3243fb-0x0;var _0x551362=_0xab5b[_0x3243fb];return _0x551362;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require(_0xbab5('0x2'));var jsonpatch=require(_0xbab5('0x3'));var rp=require(_0xbab5('0x4'));var moment=require(_0xbab5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbab5('0x6'));var path=require(_0xbab5('0x7'));var sox=require(_0xbab5('0x8'));var csv=require('to-csv');var ejs=require(_0xbab5('0x9'));var fs=require('fs');var fs_extra=require(_0xbab5('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbab5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbab5('0xc'));var querystring=require(_0xbab5('0xd'));var Papa=require(_0xbab5('0xe'));var Redis=require('ioredis');var authService=require(_0xbab5('0xf'));var qs=require(_0xbab5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbab5('0x11'));var logger=require(_0xbab5('0x12'))(_0xbab5('0x13'));var utils=require(_0xbab5('0x14'));var config=require(_0xbab5('0x15'));var licenseUtil=require(_0xbab5('0x16'));var db=require(_0xbab5('0x17'))['db'];function respondWithStatusCode(_0x3cae1a,_0x183c9a){_0x183c9a=_0x183c9a||0xcc;return function(_0x7a1d66){if(_0x7a1d66){return _0x3cae1a[_0xbab5('0x18')](_0x183c9a);}return _0x3cae1a[_0xbab5('0x19')](_0x183c9a)[_0xbab5('0x1a')]();};}function respondWithResult(_0x1967f1,_0x4a09ea){_0x4a09ea=_0x4a09ea||0xc8;return function(_0x3d35a7){if(_0x3d35a7){return _0x1967f1['status'](_0x4a09ea)[_0xbab5('0x1b')](_0x3d35a7);}};}function respondWithFilteredResult(_0x2d17c4,_0xe34d67){return function(_0x165005){if(_0x165005){var _0x239306=typeof _0xe34d67['offset']===_0xbab5('0x1c')&&typeof _0xe34d67['limit']===_0xbab5('0x1c');var _0x3ace05=_0x165005[_0xbab5('0x1d')];var _0x227514=_0x239306?0x0:_0xe34d67[_0xbab5('0x1e')];var _0x137d59=_0x239306?_0x165005[_0xbab5('0x1d')]:_0xe34d67['offset']+_0xe34d67[_0xbab5('0x1f')];var _0x2fce37;if(_0x137d59>=_0x3ace05){_0x137d59=_0x3ace05;_0x2fce37=0xc8;}else{_0x2fce37=0xce;}_0x2d17c4[_0xbab5('0x19')](_0x2fce37);return _0x2d17c4[_0xbab5('0x20')](_0xbab5('0x21'),_0x227514+'-'+_0x137d59+'/'+_0x3ace05)[_0xbab5('0x1b')](_0x165005);}return null;};}function patchUpdates(_0x2b5a74){return function(_0x33d0ab){try{jsonpatch['apply'](_0x33d0ab,_0x2b5a74,!![]);}catch(_0x5b3450){return BPromise[_0xbab5('0x22')](_0x5b3450);}return _0x33d0ab[_0xbab5('0x23')]();};}function saveUpdates(_0xaf07ce,_0x4934b2){return function(_0x2453f6){if(_0x2453f6){return _0x2453f6['update'](_0xaf07ce)['then'](function(_0x242a44){return _0x242a44;});}return null;};}function removeEntity(_0x1b1102,_0x3b5354){return function(_0x4088e1){if(_0x4088e1){return _0x4088e1[_0xbab5('0x24')]()['then'](function(){var _0x6dbd94=_0x4088e1[_0xbab5('0x25')]({'plain':!![]});var _0xc3f1f4=_0xbab5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0xc3f1f4,'resourceId':_0x6dbd94['id']}})[_0xbab5('0x27')](function(){return _0x4088e1;});})[_0xbab5('0x27')](function(){_0x1b1102[_0xbab5('0x19')](0xcc)[_0xbab5('0x1a')]();});}};}function handleEntityNotFound(_0x5c9021,_0x268101){return function(_0x39aaeb){if(!_0x39aaeb){_0x5c9021[_0xbab5('0x18')](0x194);}return _0x39aaeb;};}function handleError(_0x1c0163,_0x2ebbf1){_0x2ebbf1=_0x2ebbf1||0x1f4;return function(_0x4f1278){logger[_0xbab5('0x28')](_0x4f1278[_0xbab5('0x29')]);if(_0x4f1278[_0xbab5('0x2a')]){delete _0x4f1278[_0xbab5('0x2a')];}_0x1c0163[_0xbab5('0x19')](_0x2ebbf1)[_0xbab5('0x2b')](_0x4f1278);};}exports[_0xbab5('0x2c')]=function(_0x2c8256,_0x1aaac9){var _0x5a8e4e={},_0xbec9a6={},_0x1e5442={'count':0x0,'rows':[]};return db[_0xbab5('0x2d')]['describe']()['then'](function(_0x1ecd8d){_0xbec9a6[_0xbab5('0x2e')]=_[_0xbab5('0x2f')](_0x1ecd8d);_0xbec9a6['query']=_[_0xbab5('0x2f')](_0x2c8256['query']);_0xbec9a6[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0xbec9a6[_0xbab5('0x2e')],_0xbec9a6[_0xbab5('0x32')]);_0x5a8e4e['attributes']=_['intersection'](_0xbec9a6[_0xbab5('0x2e')],qs[_0xbab5('0x33')](_0x2c8256['query']['fields']));_0x5a8e4e[_0xbab5('0x34')]=_0x5a8e4e[_0xbab5('0x34')][_0xbab5('0x35')]?_0x5a8e4e[_0xbab5('0x34')]:_0xbec9a6[_0xbab5('0x2e')];if(!_0x2c8256[_0xbab5('0x32')][_0xbab5('0x36')](_0xbab5('0x37'))){_0x5a8e4e[_0xbab5('0x1f')]=qs[_0xbab5('0x1f')](_0x2c8256['query'][_0xbab5('0x1f')]);_0x5a8e4e[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x2c8256[_0xbab5('0x32')][_0xbab5('0x1e')]);}_0x5a8e4e[_0xbab5('0x38')]=qs['sort'](_0x2c8256['query']['sort']);_0x5a8e4e[_0xbab5('0x39')]=qs['filters'](_[_0xbab5('0x3a')](_0x2c8256[_0xbab5('0x32')],_0xbec9a6['filters']),_0x1ecd8d);if(_0x2c8256['query']['filter']){_0x5a8e4e[_0xbab5('0x39')]=_[_0xbab5('0x3b')](_0x5a8e4e[_0xbab5('0x39')],{'$or':_[_0xbab5('0x3c')](_0x5a8e4e[_0xbab5('0x34')],function(_0x2c188f){var _0x39e550={};_0x39e550[_0x2c188f]={'$like':'%'+_0x2c8256[_0xbab5('0x32')][_0xbab5('0x3d')]+'%'};return _0x39e550;})});}_0x5a8e4e=_[_0xbab5('0x3b')]({},_0x5a8e4e,_0x2c8256[_0xbab5('0x3e')]);var _0x4bf511={'where':_0x5a8e4e[_0xbab5('0x39')]};return db['CmCompany'][_0xbab5('0x1d')](_0x4bf511)[_0xbab5('0x27')](function(_0x4c1a2c){_0x1e5442[_0xbab5('0x1d')]=_0x4c1a2c;if(_0x2c8256['query']['includeAll']){_0x5a8e4e[_0xbab5('0x3f')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x5a8e4e);})[_0xbab5('0x27')](function(_0x369154){_0x1e5442[_0xbab5('0x40')]=_0x369154;return _0x1e5442;})[_0xbab5('0x27')](respondWithFilteredResult(_0x1aaac9,_0x5a8e4e))[_0xbab5('0x41')](handleError(_0x1aaac9,null));})['catch'](handleError(_0x1aaac9,null));};exports[_0xbab5('0x42')]=function(_0x38aec9,_0x5205b8){var _0x1febbf={'raw':![],'where':{'id':_0x38aec9['params']['id']}},_0x8c2f39={};_0x8c2f39[_0xbab5('0x2e')]=_[_0xbab5('0x2f')](db[_0xbab5('0x2d')][_0xbab5('0x43')]);_0x8c2f39[_0xbab5('0x32')]=_[_0xbab5('0x2f')](_0x38aec9[_0xbab5('0x32')]);_0x8c2f39[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0x8c2f39[_0xbab5('0x2e')],_0x8c2f39['query']);_0x1febbf[_0xbab5('0x34')]=_[_0xbab5('0x31')](_0x8c2f39['model'],qs[_0xbab5('0x33')](_0x38aec9['query'][_0xbab5('0x33')]));_0x1febbf[_0xbab5('0x34')]=_0x1febbf[_0xbab5('0x34')]['length']?_0x1febbf[_0xbab5('0x34')]:_0x8c2f39['model'];if(_0x38aec9[_0xbab5('0x32')]['includeAll']){_0x1febbf[_0xbab5('0x3f')]=[{'all':!![]}];}_0x1febbf=_[_0xbab5('0x3b')]({},_0x1febbf,_0x38aec9[_0xbab5('0x3e')]);return db[_0xbab5('0x2d')]['find'](_0x1febbf)[_0xbab5('0x27')](handleEntityNotFound(_0x5205b8,null))[_0xbab5('0x27')](respondWithResult(_0x5205b8,null))[_0xbab5('0x41')](handleError(_0x5205b8,null));};exports[_0xbab5('0x44')]=function(_0x200337,_0x256db6){return db['CmCompany'][_0xbab5('0x44')](_0x200337[_0xbab5('0x45')],{})[_0xbab5('0x27')](function(_0x113b63){var _0x5878a6=_0x200337[_0xbab5('0x46')][_0xbab5('0x25')]({'plain':!![]});if(!_0x5878a6)throw new Error(_0xbab5('0x47'));if(_0x5878a6[_0xbab5('0x48')]==='user'){var _0x4def63=_0x113b63[_0xbab5('0x25')]({'plain':!![]});var _0x26bb4f=_0xbab5('0x26');return db[_0xbab5('0x49')][_0xbab5('0x4a')]({'where':{'name':_0x26bb4f,'userProfileId':_0x5878a6[_0xbab5('0x4b')]},'raw':!![]})[_0xbab5('0x27')](function(_0x4b3552){if(_0x4b3552&&_0x4b3552[_0xbab5('0x4c')]===0x0){return db[_0xbab5('0x4d')][_0xbab5('0x44')]({'name':_0x4def63['name'],'resourceId':_0x4def63['id'],'type':_0x4b3552[_0xbab5('0x2a')],'sectionId':_0x4b3552['id']},{})[_0xbab5('0x27')](function(){return _0x113b63;});}else{return _0x113b63;}})[_0xbab5('0x41')](function(_0x14b654){logger[_0xbab5('0x28')](_0xbab5('0x4e'),_0x14b654);throw _0x14b654;});}return _0x113b63;})['then'](respondWithResult(_0x256db6,0xc9))[_0xbab5('0x41')](handleError(_0x256db6,null));};exports[_0xbab5('0x4f')]=function(_0x4633b8,_0x13b739){if(_0x4633b8[_0xbab5('0x45')]['id']){delete _0x4633b8['body']['id'];}return db[_0xbab5('0x2d')]['find']({'where':{'id':_0x4633b8[_0xbab5('0x50')]['id']}})[_0xbab5('0x27')](handleEntityNotFound(_0x13b739,null))['then'](saveUpdates(_0x4633b8[_0xbab5('0x45')],null))['then'](respondWithResult(_0x13b739,null))[_0xbab5('0x41')](handleError(_0x13b739,null));};exports[_0xbab5('0x24')]=function(_0x174329,_0x5fd4e5){return db['CmCompany']['find']({'where':{'id':_0x174329[_0xbab5('0x50')]['id']}})['then'](handleEntityNotFound(_0x5fd4e5,null))[_0xbab5('0x27')](removeEntity(_0x5fd4e5,null))[_0xbab5('0x41')](handleError(_0x5fd4e5,null));};exports['describe']=function(_0x443eeb,_0x49fd38){return db[_0xbab5('0x2d')]['describe']()[_0xbab5('0x27')](respondWithResult(_0x49fd38,null))['catch'](handleError(_0x49fd38,null));};exports['addContacts']=function(_0x5f18bf,_0x1dd640,_0x3dab15){return db[_0xbab5('0x51')]['find']({'where':{'id':_0x5f18bf[_0xbab5('0x50')]['id']}})['then'](handleEntityNotFound(_0x1dd640,null))[_0xbab5('0x27')](function(_0xf138){if(_0xf138){return _0xf138['addContacts'](_0x5f18bf[_0xbab5('0x45')][_0xbab5('0x52')],_[_0xbab5('0x53')](_0x5f18bf[_0xbab5('0x45')],[_0xbab5('0x52'),'id'])||{});}})[_0xbab5('0x27')](respondWithResult(_0x1dd640,null))[_0xbab5('0x41')](handleError(_0x1dd640,null));};exports[_0xbab5('0x54')]=function(_0x4a2184,_0xa47a32,_0x346273){var _0x258496={};var _0x1b3944={};var _0x111211;var _0x345273;return db[_0xbab5('0x2d')][_0xbab5('0x55')]({'where':{'id':_0x4a2184['params']['id']}})['then'](handleEntityNotFound(_0xa47a32,null))[_0xbab5('0x27')](function(_0x515611){if(_0x515611){_0x111211=_0x515611;_0x1b3944[_0xbab5('0x2e')]=_[_0xbab5('0x2f')](db[_0xbab5('0x51')]['rawAttributes']);_0x1b3944[_0xbab5('0x32')]=_['keys'](_0x4a2184['query']);_0x1b3944[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0x1b3944[_0xbab5('0x2e')],_0x1b3944[_0xbab5('0x32')]);_0x258496['attributes']=_['intersection'](_0x1b3944[_0xbab5('0x2e')],qs[_0xbab5('0x33')](_0x4a2184[_0xbab5('0x32')]['fields']));_0x258496[_0xbab5('0x34')]=_0x258496['attributes'][_0xbab5('0x35')]?_0x258496[_0xbab5('0x34')]:_0x1b3944[_0xbab5('0x2e')];_0x258496[_0xbab5('0x38')]=qs[_0xbab5('0x56')](_0x4a2184['query'][_0xbab5('0x56')]);_0x258496[_0xbab5('0x39')]=qs[_0xbab5('0x30')](_['pick'](_0x4a2184[_0xbab5('0x32')],_0x1b3944['filters']));if(_0x4a2184['query'][_0xbab5('0x3d')]){_0x258496[_0xbab5('0x39')]=_[_0xbab5('0x3b')](_0x258496[_0xbab5('0x39')],{'$or':_['map'](_0x258496['attributes'],function(_0x5511df){var _0x4e0343={};_0x4e0343[_0x5511df]={'$like':'%'+_0x4a2184[_0xbab5('0x32')][_0xbab5('0x3d')]+'%'};return _0x4e0343;})});}_0x258496=_[_0xbab5('0x3b')]({},_0x258496,_0x4a2184[_0xbab5('0x3e')]);return _0x111211[_0xbab5('0x54')](_0x258496);}})[_0xbab5('0x27')](function(_0x2bef76){if(_0x2bef76){_0x345273=_0x2bef76[_0xbab5('0x35')];if(!_0x4a2184['query']['hasOwnProperty'](_0xbab5('0x37'))){_0x258496[_0xbab5('0x1f')]=qs[_0xbab5('0x1f')](_0x4a2184[_0xbab5('0x32')][_0xbab5('0x1f')]);_0x258496[_0xbab5('0x1e')]=qs[_0xbab5('0x1e')](_0x4a2184[_0xbab5('0x32')][_0xbab5('0x1e')]);}return _0x111211[_0xbab5('0x54')](_0x258496);}})[_0xbab5('0x27')](function(_0x46c5bd){if(_0x46c5bd){return _0x46c5bd?{'count':_0x345273,'rows':_0x46c5bd}:null;}})[_0xbab5('0x27')](respondWithResult(_0xa47a32,null))[_0xbab5('0x41')](handleError(_0xa47a32,null));};
\ No newline at end of file
+var _0x601c=['getContacts','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','update','then','get','Companies','UserProfileResource','destroy','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','omit','ids'];(function(_0x587137,_0x2c22f6){var _0x59985e=function(_0x5ea780){while(--_0x5ea780){_0x587137['push'](_0x587137['shift']());}};_0x59985e(++_0x2c22f6);}(_0x601c,0x1f3));var _0xc601=function(_0x21d673,_0x4b2b4c){_0x21d673=_0x21d673-0x0;var _0xd1caad=_0x601c[_0x21d673];return _0xd1caad;};'use strict';var emlformat=require(_0xc601('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc601('0x1'));var jsonpatch=require(_0xc601('0x2'));var rp=require('request-promise');var moment=require(_0xc601('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc601('0x4'));var util=require(_0xc601('0x5'));var path=require('path');var sox=require(_0xc601('0x6'));var csv=require(_0xc601('0x7'));var ejs=require(_0xc601('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc601('0x9'));var squel=require(_0xc601('0xa'));var crypto=require(_0xc601('0xb'));var jsforce=require(_0xc601('0xc'));var deskjs=require(_0xc601('0xd'));var toCsv=require(_0xc601('0x7'));var querystring=require(_0xc601('0xe'));var Papa=require(_0xc601('0xf'));var Redis=require('ioredis');var authService=require(_0xc601('0x10'));var qs=require(_0xc601('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc601('0x12'));var logger=require(_0xc601('0x13'))(_0xc601('0x14'));var utils=require('../../config/utils');var config=require(_0xc601('0x15'));var licenseUtil=require(_0xc601('0x16'));var db=require(_0xc601('0x17'))['db'];function respondWithStatusCode(_0x1f5bbb,_0x128048){_0x128048=_0x128048||0xcc;return function(_0x366da0){if(_0x366da0){return _0x1f5bbb['sendStatus'](_0x128048);}return _0x1f5bbb[_0xc601('0x18')](_0x128048)[_0xc601('0x19')]();};}function respondWithResult(_0x290254,_0x25bbab){_0x25bbab=_0x25bbab||0xc8;return function(_0x5aeefb){if(_0x5aeefb){return _0x290254[_0xc601('0x18')](_0x25bbab)[_0xc601('0x1a')](_0x5aeefb);}};}function respondWithFilteredResult(_0x25cf80,_0x4d1b66){return function(_0x118789){if(_0x118789){var _0x46300b=typeof _0x4d1b66[_0xc601('0x1b')]===_0xc601('0x1c')&&typeof _0x4d1b66['limit']==='undefined';var _0x159cc8=_0x118789[_0xc601('0x1d')];var _0x3f6822=_0x46300b?0x0:_0x4d1b66[_0xc601('0x1b')];var _0x3138f1=_0x46300b?_0x118789['count']:_0x4d1b66[_0xc601('0x1b')]+_0x4d1b66['limit'];var _0x533b8d;if(_0x3138f1>=_0x159cc8){_0x3138f1=_0x159cc8;_0x533b8d=0xc8;}else{_0x533b8d=0xce;}_0x25cf80['status'](_0x533b8d);return _0x25cf80['set'](_0xc601('0x1e'),_0x3f6822+'-'+_0x3138f1+'/'+_0x159cc8)[_0xc601('0x1a')](_0x118789);}return null;};}function patchUpdates(_0x5c392d){return function(_0x1092ce){try{jsonpatch[_0xc601('0x1f')](_0x1092ce,_0x5c392d,!![]);}catch(_0x4491d4){return BPromise['reject'](_0x4491d4);}return _0x1092ce['save']();};}function saveUpdates(_0x58e951,_0x137c83){return function(_0x2fcabb){if(_0x2fcabb){return _0x2fcabb[_0xc601('0x20')](_0x58e951)[_0xc601('0x21')](function(_0x1a70c7){return _0x1a70c7;});}return null;};}function removeEntity(_0x497715,_0x3e602d){return function(_0x417163){if(_0x417163){return _0x417163['destroy']()[_0xc601('0x21')](function(){var _0x4e4dff=_0x417163[_0xc601('0x22')]({'plain':!![]});var _0x273acf=_0xc601('0x23');return db[_0xc601('0x24')][_0xc601('0x25')]({'where':{'type':_0x273acf,'resourceId':_0x4e4dff['id']}})[_0xc601('0x21')](function(){return _0x417163;});})[_0xc601('0x21')](function(){_0x497715[_0xc601('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23e4d3,_0x2bbd4f){return function(_0x5af523){if(!_0x5af523){_0x23e4d3[_0xc601('0x26')](0x194);}return _0x5af523;};}function handleError(_0x310d84,_0x237b1d){_0x237b1d=_0x237b1d||0x1f4;return function(_0x123107){logger[_0xc601('0x27')](_0x123107['stack']);if(_0x123107[_0xc601('0x28')]){delete _0x123107[_0xc601('0x28')];}_0x310d84[_0xc601('0x18')](_0x237b1d)[_0xc601('0x29')](_0x123107);};}exports[_0xc601('0x2a')]=function(_0x2a28d4,_0x3c9af3){var _0xfdfa7={},_0x28e3ed={},_0x17c9b={'count':0x0,'rows':[]};return db[_0xc601('0x2b')][_0xc601('0x2c')]()[_0xc601('0x21')](function(_0x2dc8d9){_0x28e3ed[_0xc601('0x2d')]=_[_0xc601('0x2e')](_0x2dc8d9);_0x28e3ed[_0xc601('0x2f')]=_[_0xc601('0x2e')](_0x2a28d4[_0xc601('0x2f')]);_0x28e3ed[_0xc601('0x30')]=_[_0xc601('0x31')](_0x28e3ed[_0xc601('0x2d')],_0x28e3ed['query']);_0xfdfa7['attributes']=_['intersection'](_0x28e3ed[_0xc601('0x2d')],qs[_0xc601('0x32')](_0x2a28d4['query']['fields']));_0xfdfa7[_0xc601('0x33')]=_0xfdfa7[_0xc601('0x33')][_0xc601('0x34')]?_0xfdfa7[_0xc601('0x33')]:_0x28e3ed[_0xc601('0x2d')];if(!_0x2a28d4[_0xc601('0x2f')][_0xc601('0x35')](_0xc601('0x36'))){_0xfdfa7['limit']=qs['limit'](_0x2a28d4[_0xc601('0x2f')][_0xc601('0x37')]);_0xfdfa7[_0xc601('0x1b')]=qs[_0xc601('0x1b')](_0x2a28d4['query']['offset']);}_0xfdfa7[_0xc601('0x38')]=qs[_0xc601('0x39')](_0x2a28d4[_0xc601('0x2f')]['sort']);_0xfdfa7[_0xc601('0x3a')]=qs[_0xc601('0x30')](_['pick'](_0x2a28d4[_0xc601('0x2f')],_0x28e3ed[_0xc601('0x30')]),_0x2dc8d9);if(_0x2a28d4[_0xc601('0x2f')][_0xc601('0x3b')]){_0xfdfa7[_0xc601('0x3a')]=_[_0xc601('0x3c')](_0xfdfa7['where'],{'$or':_[_0xc601('0x3d')](_0xfdfa7[_0xc601('0x33')],function(_0x50b6b5){var _0x5996d3={};_0x5996d3[_0x50b6b5]={'$like':'%'+_0x2a28d4[_0xc601('0x2f')][_0xc601('0x3b')]+'%'};return _0x5996d3;})});}_0xfdfa7=_[_0xc601('0x3c')]({},_0xfdfa7,_0x2a28d4[_0xc601('0x3e')]);var _0x999416={'where':_0xfdfa7['where']};return db['CmCompany'][_0xc601('0x1d')](_0x999416)['then'](function(_0x39f453){_0x17c9b[_0xc601('0x1d')]=_0x39f453;if(_0x2a28d4['query'][_0xc601('0x3f')]){_0xfdfa7['include']=[{'all':!![]}];}return db[_0xc601('0x2b')][_0xc601('0x40')](_0xfdfa7);})['then'](function(_0x2bdee5){_0x17c9b['rows']=_0x2bdee5;return _0x17c9b;})[_0xc601('0x21')](respondWithFilteredResult(_0x3c9af3,_0xfdfa7))[_0xc601('0x41')](handleError(_0x3c9af3,null));})[_0xc601('0x41')](handleError(_0x3c9af3,null));};exports[_0xc601('0x42')]=function(_0x428a64,_0x17b998){var _0x40ae22={'raw':![],'where':{'id':_0x428a64[_0xc601('0x43')]['id']}},_0x2ee79b={};_0x2ee79b['model']=_[_0xc601('0x2e')](db['CmCompany'][_0xc601('0x44')]);_0x2ee79b['query']=_['keys'](_0x428a64[_0xc601('0x2f')]);_0x2ee79b[_0xc601('0x30')]=_['intersection'](_0x2ee79b['model'],_0x2ee79b[_0xc601('0x2f')]);_0x40ae22['attributes']=_[_0xc601('0x31')](_0x2ee79b[_0xc601('0x2d')],qs[_0xc601('0x32')](_0x428a64[_0xc601('0x2f')][_0xc601('0x32')]));_0x40ae22[_0xc601('0x33')]=_0x40ae22[_0xc601('0x33')][_0xc601('0x34')]?_0x40ae22[_0xc601('0x33')]:_0x2ee79b[_0xc601('0x2d')];if(_0x428a64[_0xc601('0x2f')][_0xc601('0x3f')]){_0x40ae22['include']=[{'all':!![]}];}_0x40ae22=_[_0xc601('0x3c')]({},_0x40ae22,_0x428a64[_0xc601('0x3e')]);return db[_0xc601('0x2b')][_0xc601('0x45')](_0x40ae22)[_0xc601('0x21')](handleEntityNotFound(_0x17b998,null))[_0xc601('0x21')](respondWithResult(_0x17b998,null))[_0xc601('0x41')](handleError(_0x17b998,null));};exports[_0xc601('0x46')]=function(_0x39d759,_0x54d35a){return db[_0xc601('0x2b')][_0xc601('0x46')](_0x39d759['body'],{})[_0xc601('0x21')](function(_0x55fc94){var _0x2804f1=_0x39d759['user'][_0xc601('0x22')]({'plain':!![]});if(!_0x2804f1)throw new Error(_0xc601('0x47'));if(_0x2804f1[_0xc601('0x48')]===_0xc601('0x49')){var _0x4b9ddf=_0x55fc94['get']({'plain':!![]});var _0x1a0a14=_0xc601('0x23');return db[_0xc601('0x4a')][_0xc601('0x45')]({'where':{'name':_0x1a0a14,'userProfileId':_0x2804f1['userProfileId']},'raw':!![]})[_0xc601('0x21')](function(_0x301e82){if(_0x301e82&&_0x301e82[_0xc601('0x4b')]===0x0){return db[_0xc601('0x24')][_0xc601('0x46')]({'name':_0x4b9ddf['name'],'resourceId':_0x4b9ddf['id'],'type':_0x301e82['name'],'sectionId':_0x301e82['id']},{})[_0xc601('0x21')](function(){return _0x55fc94;});}else{return _0x55fc94;}})[_0xc601('0x41')](function(_0xd99ae2){logger[_0xc601('0x27')](_0xc601('0x4c'),_0xd99ae2);throw _0xd99ae2;});}return _0x55fc94;})['then'](respondWithResult(_0x54d35a,0xc9))[_0xc601('0x41')](handleError(_0x54d35a,null));};exports[_0xc601('0x20')]=function(_0x38ed40,_0x26ea6f){if(_0x38ed40[_0xc601('0x4d')]['id']){delete _0x38ed40[_0xc601('0x4d')]['id'];}return db['CmCompany'][_0xc601('0x45')]({'where':{'id':_0x38ed40[_0xc601('0x43')]['id']}})[_0xc601('0x21')](handleEntityNotFound(_0x26ea6f,null))['then'](saveUpdates(_0x38ed40[_0xc601('0x4d')],null))[_0xc601('0x21')](respondWithResult(_0x26ea6f,null))[_0xc601('0x41')](handleError(_0x26ea6f,null));};exports[_0xc601('0x25')]=function(_0x5878a2,_0x78a293){return db[_0xc601('0x2b')][_0xc601('0x45')]({'where':{'id':_0x5878a2[_0xc601('0x43')]['id']}})[_0xc601('0x21')](handleEntityNotFound(_0x78a293,null))['then'](removeEntity(_0x78a293,null))[_0xc601('0x41')](handleError(_0x78a293,null));};exports[_0xc601('0x2c')]=function(_0xbfaa14,_0x98c937){return db[_0xc601('0x2b')][_0xc601('0x2c')]()[_0xc601('0x21')](respondWithResult(_0x98c937,null))['catch'](handleError(_0x98c937,null));};exports[_0xc601('0x4e')]=function(_0x28a1c5,_0x4eb100,_0xb283d4){return db[_0xc601('0x4f')]['find']({'where':{'id':_0x28a1c5[_0xc601('0x43')]['id']}})[_0xc601('0x21')](handleEntityNotFound(_0x4eb100,null))['then'](function(_0x2b8bad){if(_0x2b8bad){return _0x2b8bad[_0xc601('0x4e')](_0x28a1c5[_0xc601('0x4d')]['ids'],_[_0xc601('0x50')](_0x28a1c5[_0xc601('0x4d')],[_0xc601('0x51'),'id'])||{});}})['then'](respondWithResult(_0x4eb100,null))[_0xc601('0x41')](handleError(_0x4eb100,null));};exports[_0xc601('0x52')]=function(_0x4087e4,_0x500ce7,_0x5b41b8){var _0x78af63={};var _0x45cb28={};var _0x538459;var _0x38288c;return db[_0xc601('0x2b')]['findOne']({'where':{'id':_0x4087e4[_0xc601('0x43')]['id']}})['then'](handleEntityNotFound(_0x500ce7,null))[_0xc601('0x21')](function(_0x1dba32){if(_0x1dba32){_0x538459=_0x1dba32;_0x45cb28[_0xc601('0x2d')]=_['keys'](db['CmContact'][_0xc601('0x44')]);_0x45cb28[_0xc601('0x2f')]=_[_0xc601('0x2e')](_0x4087e4['query']);_0x45cb28[_0xc601('0x30')]=_['intersection'](_0x45cb28[_0xc601('0x2d')],_0x45cb28[_0xc601('0x2f')]);_0x78af63['attributes']=_['intersection'](_0x45cb28['model'],qs['fields'](_0x4087e4['query'][_0xc601('0x32')]));_0x78af63['attributes']=_0x78af63[_0xc601('0x33')][_0xc601('0x34')]?_0x78af63[_0xc601('0x33')]:_0x45cb28[_0xc601('0x2d')];_0x78af63[_0xc601('0x38')]=qs[_0xc601('0x39')](_0x4087e4['query'][_0xc601('0x39')]);_0x78af63[_0xc601('0x3a')]=qs['filters'](_['pick'](_0x4087e4[_0xc601('0x2f')],_0x45cb28[_0xc601('0x30')]));if(_0x4087e4[_0xc601('0x2f')][_0xc601('0x3b')]){_0x78af63[_0xc601('0x3a')]=_['merge'](_0x78af63[_0xc601('0x3a')],{'$or':_[_0xc601('0x3d')](_0x78af63[_0xc601('0x33')],function(_0x30ded4){var _0x12b860={};_0x12b860[_0x30ded4]={'$like':'%'+_0x4087e4[_0xc601('0x2f')][_0xc601('0x3b')]+'%'};return _0x12b860;})});}_0x78af63=_[_0xc601('0x3c')]({},_0x78af63,_0x4087e4[_0xc601('0x3e')]);return _0x538459[_0xc601('0x52')](_0x78af63);}})[_0xc601('0x21')](function(_0x1f8dfc){if(_0x1f8dfc){_0x38288c=_0x1f8dfc[_0xc601('0x34')];if(!_0x4087e4[_0xc601('0x2f')][_0xc601('0x35')](_0xc601('0x36'))){_0x78af63[_0xc601('0x37')]=qs[_0xc601('0x37')](_0x4087e4[_0xc601('0x2f')][_0xc601('0x37')]);_0x78af63[_0xc601('0x1b')]=qs[_0xc601('0x1b')](_0x4087e4[_0xc601('0x2f')]['offset']);}return _0x538459[_0xc601('0x52')](_0x78af63);}})[_0xc601('0x21')](function(_0x44107e){if(_0x44107e){return _0x44107e?{'count':_0x38288c,'rows':_0x44107e}:null;}})[_0xc601('0x21')](respondWithResult(_0x500ce7,null))[_0xc601('0x41')](handleError(_0x500ce7,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 7700463..82671f5 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 _0xe1cd=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x3c22fe,_0x1b4c55){var _0x53df50=function(_0x105ea7){while(--_0x105ea7){_0x3c22fe['push'](_0x3c22fe['shift']());}};_0x53df50(++_0x1b4c55);}(_0xe1cd,0x9b));var _0xde1c=function(_0x43c963,_0x28b4b1){_0x43c963=_0x43c963-0x0;var _0x1e06b5=_0xe1cd[_0x43c963];return _0x1e06b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde1c('0x0'))(_0xde1c('0x1'));var moment=require(_0xde1c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xde1c('0x3'));var config=require(_0xde1c('0x4'));var attributes=require(_0xde1c('0x5'));module[_0xde1c('0x6')]=function(_0x2e689d,_0x1f03a6){return _0x2e689d[_0xde1c('0x7')](_0xde1c('0x8'),attributes,{'tableName':_0xde1c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5114=['CmCompany','cm_companies','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5114,0x1d0));var _0x4511=function(_0x22dc41,_0x590632){_0x22dc41=_0x22dc41-0x0;var _0x34b23e=_0x5114[_0x22dc41];return _0x34b23e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4511('0x0'))('api');var moment=require(_0x4511('0x1'));var BPromise=require('bluebird');var rp=require(_0x4511('0x2'));var fs=require('fs');var path=require(_0x4511('0x3'));var rimraf=require('rimraf');var config=require(_0x4511('0x4'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x42408d,_0x2b2cc0){return _0x42408d['define'](_0x4511('0x5'),attributes,{'tableName':_0x4511('0x6'),'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 41b1cf3..ac255be 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 _0x1e42=['code','CmCompany,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error'];(function(_0x19ebdc,_0x11b44b){var _0x2436e6=function(_0xa03308){while(--_0xa03308){_0x19ebdc['push'](_0x19ebdc['shift']());}};_0x2436e6(++_0x11b44b);}(_0x1e42,0x66));var _0x21e4=function(_0x44512b,_0x199f03){_0x44512b=_0x44512b-0x0;var _0x30e108=_0x1e42[_0x44512b];return _0x30e108;};'use strict';var _=require(_0x21e4('0x0'));var util=require(_0x21e4('0x1'));var moment=require(_0x21e4('0x2'));var BPromise=require(_0x21e4('0x3'));var rs=require(_0x21e4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21e4('0x5'))['db'];var utils=require(_0x21e4('0x6'));var logger=require(_0x21e4('0x7'))(_0x21e4('0x8'));var config=require(_0x21e4('0x9'));var jayson=require(_0x21e4('0xa'));var client=jayson['client'][_0x21e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd0e891,_0x4b8293,_0x4e3457){return new BPromise(function(_0x196392,_0x3f743){return client[_0x21e4('0xc')](_0xd0e891,_0x4e3457)[_0x21e4('0xd')](function(_0x54334c){logger['info']('CmCompany,\x20%s,\x20%s',_0x4b8293,_0x21e4('0xe'));logger[_0x21e4('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4b8293,_0x21e4('0xe'),JSON[_0x21e4('0x10')](_0x54334c));if(_0x54334c[_0x21e4('0x11')]){if(_0x54334c[_0x21e4('0x11')][_0x21e4('0x12')]===0x1f4){logger[_0x21e4('0x11')](_0x21e4('0x13'),_0x4b8293,_0x54334c[_0x21e4('0x11')][_0x21e4('0x14')]);return _0x3f743(_0x54334c[_0x21e4('0x11')][_0x21e4('0x14')]);}logger['error'](_0x21e4('0x13'),_0x4b8293,_0x54334c['error'][_0x21e4('0x14')]);return _0x196392(_0x54334c[_0x21e4('0x11')][_0x21e4('0x14')]);}else{logger[_0x21e4('0x15')](_0x21e4('0x13'),_0x4b8293,_0x21e4('0xe'));_0x196392(_0x54334c[_0x21e4('0x16')][_0x21e4('0x14')]);}})[_0x21e4('0x17')](function(_0x2360b7){logger[_0x21e4('0x11')]('CmCompany,\x20%s,\x20%s',_0x4b8293,_0x2360b7);_0x3f743(_0x2360b7);});});}
\ No newline at end of file
+var _0x8cb1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x426b61,_0x585c1e){var _0x2cb12b=function(_0x45539d){while(--_0x45539d){_0x426b61['push'](_0x426b61['shift']());}};_0x2cb12b(++_0x585c1e);}(_0x8cb1,0x176));var _0x18cb=function(_0x4f217f,_0x313163){_0x4f217f=_0x4f217f-0x0;var _0x3b583a=_0x8cb1[_0x4f217f];return _0x3b583a;};'use strict';var _=require(_0x18cb('0x0'));var util=require(_0x18cb('0x1'));var moment=require(_0x18cb('0x2'));var BPromise=require(_0x18cb('0x3'));var rs=require(_0x18cb('0x4'));var fs=require('fs');var Redis=require(_0x18cb('0x5'));var db=require(_0x18cb('0x6'))['db'];var utils=require(_0x18cb('0x7'));var logger=require(_0x18cb('0x8'))(_0x18cb('0x9'));var config=require(_0x18cb('0xa'));var jayson=require(_0x18cb('0xb'));var client=jayson[_0x18cb('0xc')][_0x18cb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x57be07,_0x211a45,_0x39dd65){return new BPromise(function(_0x5f4b57,_0x5a0223){return client[_0x18cb('0xe')](_0x57be07,_0x39dd65)[_0x18cb('0xf')](function(_0x1633d2){logger[_0x18cb('0x10')]('CmCompany,\x20%s,\x20%s',_0x211a45,_0x18cb('0x11'));logger[_0x18cb('0x12')](_0x18cb('0x13'),_0x211a45,_0x18cb('0x11'),JSON[_0x18cb('0x14')](_0x1633d2));if(_0x1633d2[_0x18cb('0x15')]){if(_0x1633d2[_0x18cb('0x15')][_0x18cb('0x16')]===0x1f4){logger['error'](_0x18cb('0x17'),_0x211a45,_0x1633d2[_0x18cb('0x15')][_0x18cb('0x18')]);return _0x5a0223(_0x1633d2[_0x18cb('0x15')][_0x18cb('0x18')]);}logger[_0x18cb('0x15')](_0x18cb('0x17'),_0x211a45,_0x1633d2[_0x18cb('0x15')][_0x18cb('0x18')]);return _0x5f4b57(_0x1633d2[_0x18cb('0x15')][_0x18cb('0x18')]);}else{logger['info'](_0x18cb('0x17'),_0x211a45,_0x18cb('0x11'));_0x5f4b57(_0x1633d2[_0x18cb('0x19')][_0x18cb('0x18')]);}})[_0x18cb('0x1a')](function(_0x1c60b6){logger[_0x18cb('0x15')](_0x18cb('0x17'),_0x211a45,_0x1c60b6);_0x5a0223(_0x1c60b6);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 8a5d1c9..1252701 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 _0xc6b9=['isAuthenticated','show','/:id/contacts','post','create','addContacts','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','index','/describe','describe'];(function(_0xcf225,_0x3c74d9){var _0x1b8af5=function(_0x29883e){while(--_0x29883e){_0xcf225['push'](_0xcf225['shift']());}};_0x1b8af5(++_0x3c74d9);}(_0xc6b9,0x1bb));var _0x9c6b=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xc6b9[_0x3b5049];return _0x12454e;};'use strict';var multer=require(_0x9c6b('0x0'));var util=require(_0x9c6b('0x1'));var path=require(_0x9c6b('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c6b('0x3'));var router=express[_0x9c6b('0x4')]();var fs_extra=require(_0x9c6b('0x5'));var auth=require(_0x9c6b('0x6'));var interaction=require(_0x9c6b('0x7'));var config=require('../../config/environment');var controller=require(_0x9c6b('0x8'));router[_0x9c6b('0x9')]('/',auth['isAuthenticated'](),controller[_0x9c6b('0xa')]);router[_0x9c6b('0x9')](_0x9c6b('0xb'),auth['isAuthenticated'](),controller[_0x9c6b('0xc')]);router[_0x9c6b('0x9')]('/:id',auth[_0x9c6b('0xd')](),controller[_0x9c6b('0xe')]);router['get'](_0x9c6b('0xf'),auth[_0x9c6b('0xd')](),controller['getContacts']);router[_0x9c6b('0x10')]('/',auth['isAuthenticated'](),controller[_0x9c6b('0x11')]);router[_0x9c6b('0x10')](_0x9c6b('0xf'),auth[_0x9c6b('0xd')](),controller[_0x9c6b('0x12')]);router['put'](_0x9c6b('0x13'),auth[_0x9c6b('0xd')](),controller[_0x9c6b('0x14')]);router[_0x9c6b('0x15')](_0x9c6b('0x13'),auth['isAuthenticated'](),controller[_0x9c6b('0x16')]);module[_0x9c6b('0x17')]=router;
\ No newline at end of file
+var _0x6267=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','/:id/contacts','put','update','destroy','exports','multer','util'];(function(_0x329274,_0x286a29){var _0x42af70=function(_0x2d7518){while(--_0x2d7518){_0x329274['push'](_0x329274['shift']());}};_0x42af70(++_0x286a29);}(_0x6267,0x71));var _0x7626=function(_0x41d4f4,_0x3503b7){_0x41d4f4=_0x41d4f4-0x0;var _0x7f9f90=_0x6267[_0x41d4f4];return _0x7f9f90;};'use strict';var multer=require(_0x7626('0x0'));var util=require(_0x7626('0x1'));var path=require(_0x7626('0x2'));var timeout=require(_0x7626('0x3'));var express=require(_0x7626('0x4'));var router=express[_0x7626('0x5')]();var fs_extra=require(_0x7626('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7626('0x7'));var controller=require(_0x7626('0x8'));router[_0x7626('0x9')]('/',auth[_0x7626('0xa')](),controller[_0x7626('0xb')]);router[_0x7626('0x9')](_0x7626('0xc'),auth[_0x7626('0xa')](),controller[_0x7626('0xd')]);router['get'](_0x7626('0xe'),auth[_0x7626('0xa')](),controller[_0x7626('0xf')]);router[_0x7626('0x9')]('/:id/contacts',auth[_0x7626('0xa')](),controller['getContacts']);router[_0x7626('0x10')]('/',auth[_0x7626('0xa')](),controller[_0x7626('0x11')]);router['post'](_0x7626('0x12'),auth['isAuthenticated'](),controller['addContacts']);router[_0x7626('0x13')]('/:id',auth[_0x7626('0xa')](),controller[_0x7626('0x14')]);router['delete'](_0x7626('0xe'),auth[_0x7626('0xa')](),controller[_0x7626('0x15')]);module[_0x7626('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 c48e697..699df8d 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 _0x171d=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x134e0c,_0x1e5d9c){var _0x4997e3=function(_0x3b8c60){while(--_0x3b8c60){_0x134e0c['push'](_0x134e0c['shift']());}};_0x4997e3(++_0x1e5d9c);}(_0x171d,0x9b));var _0xd171=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x171d[_0x500c0];return _0xdd146f;};'use strict';var _=require(_0xd171('0x0'));var Sequelize=require(_0xd171('0x1'));module[_0xd171('0x2')]={'firstName':{'type':Sequelize[_0xd171('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd171('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd171('0x3')]},'city':{'type':Sequelize[_0xd171('0x3')]},'country':{'type':Sequelize[_0xd171('0x3')]},'dateOfBirth':{'type':Sequelize[_0xd171('0x3')]},'description':{'type':Sequelize[_0xd171('0x4')]},'phone':{'type':Sequelize[_0xd171('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xd171('0x3')]},'facebook':{'type':Sequelize[_0xd171('0x3')]},'fb_data':{'type':Sequelize[_0xd171('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xd171('0x3')]},'viber':{'type':Sequelize[_0xd171('0x3')]},'line':{'type':Sequelize[_0xd171('0x3')]},'wechat':{'type':Sequelize[_0xd171('0x3')]},'telegram':{'type':Sequelize[_0xd171('0x3')]},'UserId':{'type':Sequelize[_0xd171('0x5')]},'priority':{'type':Sequelize[_0xd171('0x5')](0x2)[_0xd171('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd171('0x7')],'defaultValue':Sequelize[_0xd171('0x8')]}};
\ No newline at end of file
+var _0x85b3=['sequelize','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x56e9ab,_0x53ef52){var _0x1d5ac6=function(_0x3c7d9f){while(--_0x3c7d9f){_0x56e9ab['push'](_0x56e9ab['shift']());}};_0x1d5ac6(++_0x53ef52);}(_0x85b3,0xfb));var _0x385b=function(_0xca4fbf,_0xc78f88){_0xca4fbf=_0xca4fbf-0x0;var _0xbf6d9a=_0x85b3[_0xca4fbf];return _0xbf6d9a;};'use strict';var _=require(_0x385b('0x0'));var Sequelize=require(_0x385b('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x385b('0x2')]},'street':{'type':Sequelize[_0x385b('0x2')]},'postalCode':{'type':Sequelize[_0x385b('0x2')]},'city':{'type':Sequelize[_0x385b('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x385b('0x2')]},'description':{'type':Sequelize[_0x385b('0x3')]},'phone':{'type':Sequelize[_0x385b('0x2')]},'mobile':{'type':Sequelize[_0x385b('0x2')]},'fax':{'type':Sequelize[_0x385b('0x2')]},'email':{'type':Sequelize[_0x385b('0x2')]},'url':{'type':Sequelize[_0x385b('0x2')]},'facebook':{'type':Sequelize[_0x385b('0x2')]},'fb_data':{'type':Sequelize[_0x385b('0x2')]},'twitter':{'type':Sequelize[_0x385b('0x2')]},'skype':{'type':Sequelize[_0x385b('0x2')]},'teams':{'type':Sequelize[_0x385b('0x2')]},'viber':{'type':Sequelize[_0x385b('0x2')]},'line':{'type':Sequelize[_0x385b('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x385b('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x385b('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x385b('0x5')],'defaultValue':Sequelize[_0x385b('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 05c9306..018df5a 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 _0x62fc=['sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','CmContact','length','keys','startsWith','cf_','push','CmCustomField','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','tools_tags','from','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','find','Tag','value','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','c.id','t.id\x20IN\x20?','resolve','user','conditions','User','getLists','c.ListId\x20IS\x20NULL','role','agent','ListId','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','TagIds','Tags','rows','catch','destroy','params','describe','tags','columnName','displayName','alias','custom','values','body','get','join','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','info','ChatInteraction','update','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','findOrCreate','spread','findAll','omit','cf_%d','$and','pickBy','map','format','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','setTags','ids','getHoppers','ContactId','options','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','child_process','pid','upload','createReadStream','file','path','parse','meta','import','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','openchannel','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','userSecondDisposition','userThirdDisposition','fullname','createdAt','DESC','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','UserId','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','substatus','externalUrl','findAndCountAll'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x62fc,0x131));var _0xc62f=function(_0x32cc5c,_0x4a2d81){_0x32cc5c=_0x32cc5c-0x0;var _0x422d7e=_0x62fc[_0x32cc5c];return _0x422d7e;};'use strict';var emlformat=require(_0xc62f('0x0'));var rimraf=require(_0xc62f('0x1'));var zipdir=require(_0xc62f('0x2'));var jsonpatch=require(_0xc62f('0x3'));var rp=require(_0xc62f('0x4'));var moment=require('moment');var BPromise=require(_0xc62f('0x5'));var Mustache=require('mustache');var util=require(_0xc62f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc62f('0x7'));var ejs=require(_0xc62f('0x8'));var fs=require('fs');var fs_extra=require(_0xc62f('0x9'));var _=require(_0xc62f('0xa'));var squel=require(_0xc62f('0xb'));var crypto=require(_0xc62f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc62f('0xd'));var toCsv=require(_0xc62f('0x7'));var querystring=require(_0xc62f('0xe'));var Papa=require(_0xc62f('0xf'));var Redis=require(_0xc62f('0x10'));var authService=require(_0xc62f('0x11'));var qs=require(_0xc62f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc62f('0x13'));var logger=require(_0xc62f('0x14'))(_0xc62f('0x15'));var utils=require(_0xc62f('0x16'));var config=require(_0xc62f('0x17'));var licenseUtil=require(_0xc62f('0x18'));var db=require('../../mysqldb')['db'];config[_0xc62f('0x19')]=_[_0xc62f('0x1a')](config[_0xc62f('0x19')],{'host':_0xc62f('0x1b'),'port':0x18eb});var socket=require(_0xc62f('0x1c'))(new Redis(config[_0xc62f('0x19')]));require(_0xc62f('0x1d'))[_0xc62f('0x1e')](socket);function respondWithStatusCode(_0x575fa9,_0x2ea588){_0x2ea588=_0x2ea588||0xcc;return function(_0x43e648){if(_0x43e648){return _0x575fa9[_0xc62f('0x1f')](_0x2ea588);}return _0x575fa9[_0xc62f('0x20')](_0x2ea588)[_0xc62f('0x21')]();};}function respondWithResult(_0x4408e2,_0x197741){_0x197741=_0x197741||0xc8;return function(_0x1ac161){if(_0x1ac161){return _0x4408e2[_0xc62f('0x20')](_0x197741)[_0xc62f('0x22')](_0x1ac161);}};}function respondWithFilteredResult(_0x3feada,_0x5e12b8){return function(_0x47af10){if(_0x47af10){var _0x50863e=typeof _0x5e12b8[_0xc62f('0x23')]==='undefined'&&typeof _0x5e12b8[_0xc62f('0x24')]===_0xc62f('0x25');var _0x499e4d=_0x47af10[_0xc62f('0x26')];var _0x2e1a8a=_0x50863e?0x0:_0x5e12b8[_0xc62f('0x23')];var _0x4d7163=_0x50863e?_0x47af10['count']:_0x5e12b8['offset']+_0x5e12b8[_0xc62f('0x24')];var _0x1546f2;if(_0x4d7163>=_0x499e4d){_0x4d7163=_0x499e4d;_0x1546f2=0xc8;}else{_0x1546f2=0xce;}_0x3feada[_0xc62f('0x20')](_0x1546f2);return _0x3feada[_0xc62f('0x27')](_0xc62f('0x28'),_0x2e1a8a+'-'+_0x4d7163+'/'+_0x499e4d)[_0xc62f('0x22')](_0x47af10);}return null;};}function patchUpdates(_0x2dc43a){return function(_0x20178a){try{jsonpatch[_0xc62f('0x29')](_0x20178a,_0x2dc43a,!![]);}catch(_0x57248a){return BPromise[_0xc62f('0x2a')](_0x57248a);}return _0x20178a[_0xc62f('0x2b')]();};}function saveUpdates(_0x21ddea,_0xbaf8fa){return function(_0x3b7721){if(_0x3b7721){return _0x3b7721['update'](_0x21ddea)[_0xc62f('0x2c')](function(_0x55fd33){return _0x55fd33;});}return null;};}function removeEntity(_0x2dc1b9,_0x1d359c){return function(_0x1310f3){if(_0x1310f3){return _0x1310f3['destroy']()['then'](function(){_0x2dc1b9[_0xc62f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e04e2,_0x10043a){return function(_0x388b8e){if(!_0x388b8e){_0x1e04e2[_0xc62f('0x1f')](0x194);}return _0x388b8e;};}function handleError(_0x3d439a,_0x27144d){_0x27144d=_0x27144d||0x1f4;return function(_0x1af45f){logger[_0xc62f('0x2d')](_0x1af45f[_0xc62f('0x2e')]);if(_0x1af45f['name']){delete _0x1af45f[_0xc62f('0x2f')];}_0x3d439a[_0xc62f('0x20')](_0x27144d)[_0xc62f('0x30')](_0x1af45f);};}exports[_0xc62f('0x31')]=function(_0x40af6b,_0x364f4d){var _0x1ea2a1={},_0x488158={},_0x11dfa7={'count':0x0,'rows':[]};return db[_0xc62f('0x32')]['describe']()['then'](function(_0x3effec){var _0x3fee6a=[];for(var _0x3557a6=0x0;_0x3557a6
','Attachments','push','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','value','pop','isEmpty','test','html'];(function(_0x219749,_0x3d4cf1){var _0x315ce0=function(_0x4290c1){while(--_0x4290c1){_0x219749['push'](_0x219749['shift']());}};_0x315ce0(++_0x3d4cf1);}(_0xf8ad,0xd8));var _0xdf8a=function(_0x160afe,_0xccd3ed){_0x160afe=_0x160afe-0x0;var _0x45e202=_0xf8ad[_0x160afe];return _0x45e202;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0xdf8a('0x0'));var fs=require('fs');var path=require('path');var util=require(_0xdf8a('0x1'));var tnef=require(_0xdf8a('0x2'));var logger=require(_0xdf8a('0x3'))(_0xdf8a('0x4'));var config=require(_0xdf8a('0x5'));function getAddress(_0x360034){var _0x5e4284=_[_0xdf8a('0x6')](_0x360034['value']);return _0x5e4284&&_0x5e4284['address']?_0x5e4284[_0xdf8a('0x7')]:_0xdf8a('0x8')+random[_0xdf8a('0x9')](0x6)+_0xdf8a('0xa');}function getFirstName(_0x35204d){var _0x1dd819=_[_0xdf8a('0x6')](_0x35204d['value']);if(_0x1dd819&&_0x1dd819[_0xdf8a('0xb')]){if(_0x1dd819['name']==_0x1dd819[_0xdf8a('0x7')]){return _0x1dd819[_0xdf8a('0xb')][_0xdf8a('0xc')](0x0,_0x1dd819[_0xdf8a('0xb')][_0xdf8a('0xd')]('@'));}var _0x3b1a1f=_0x1dd819[_0xdf8a('0xb')][_0xdf8a('0xe')](/\s+/);return _0x3b1a1f[_0xdf8a('0xf')]>0x1?_0x3b1a1f[_0xdf8a('0x10')](0x0,-0x1)[_0xdf8a('0x11')]('\x20'):_0x1dd819[_0xdf8a('0xb')];}return _0xdf8a('0x12');}function getLastName(_0x685d5b){var _0x5ed10c=_[_0xdf8a('0x6')](_0x685d5b[_0xdf8a('0x13')]);if(_0x5ed10c&&_0x5ed10c[_0xdf8a('0xb')]){var _0x14f9da=_0x5ed10c['name'][_0xdf8a('0xe')](/\s+/);return _0x14f9da[_0xdf8a('0xf')]>0x1?_0x14f9da[_0xdf8a('0x14')]():'';}return'';}function getMails(_0x4c9c0e,_0xa69e61){var _0x392220='';for(var _0x4aa870=0x0;_0x4aa870<_0xa69e61[_0xdf8a('0x13')][_0xdf8a('0xf')];_0x4aa870+=0x1){if(_0xa69e61['value'][_0x4aa870][_0xdf8a('0x7')]!==_0x4c9c0e){if(!_[_0xdf8a('0x15')](_0x392220)){_0x392220+=',';}_0x392220+=_0xa69e61[_0xdf8a('0x13')][_0x4aa870]['name']||_0xa69e61[_0xdf8a('0x13')][_0x4aa870][_0xdf8a('0x7')]||'';_0x392220+='\x20<';_0x392220+=_0xa69e61['value'][_0x4aa870]['address']?_0xa69e61[_0xdf8a('0x13')][_0x4aa870][_0xdf8a('0x7')]:_0xdf8a('0x8')+random[_0xdf8a('0x9')](0x6)+_0xdf8a('0xa');_0x392220+='>';}}return _0x392220;}function parseEmail(_0x1385b6,_0x24238b,_0x315414){if(_0x24238b['html']){var _0x24c830=/